Skip to content

Add cc_calc constructs for MR16 construction chainsย #496

In review

Description

@MarcIlunga

Background

Multi-step constructive-cryptography proofs chain exact constructions ๐“ก โ€”[ฯ€]โ†’ ๐’ฎ, approximate constructions ๐“ก โ€”[ฯ€; ฮต]โ†’ ๐’ฎ, and intermediate specification equalities ๐“ก = ๐“ก'. In ConstructiveCryptography.Tactics.Substitution, cc_calc already supports paper-style chains for substitution relations and statistical/quantitative bounds, whereas ConstructiveCryptography.Tactics.Categorical currently offers only cc_compose and cc_chain [hโ‚, hโ‚‚, ...], which do not display intermediate specifications, mix exact and approximate steps, interleave specification equalities, or normalize scalar budgets (0 + ฮต, ฮต + 0) and whiskered converter compositions.

Proposed change

Add cc_calc constructs in ConstructiveCryptography.Tactics.Categorical (alongside Constructs.toConstructsWithin, Constructs.serial_within, and ConstructsWithin.serial_exact in ConstructiveCryptography.CryptographicAlgebra.PseudoMetric) to assemble paper-style MR16 construction chains alternating:

  • exact specification equalities ๐“ก = ๐“ก' := h
  • exact construction steps ๐“ก โ€”[ฯ€]โ†’ ๐’ฎ := h
  • approximate construction steps ๐“ก โ€”[ฯ€; ฮต]โ†’ ๐’ฎ := h (accepting either ConstructsWithin or Constructs into epsilonRelaxation ฮต ๐’ฎ)

with _ reusing the preceding specification, automatic serial composition in attachment order (ฯ€โ‚‚ โ‰ซ ฯ€โ‚ for inner ฯ€โ‚ followed by outer ฯ€โ‚‚), additive scalar budget assembly (ฮตโ‚ + ฮตโ‚‚), structural normalization of converter compositions (Category.assoc, Category.id_comp, Category.comp_id, MonoidalCategory.comp_whiskerRight, whiskerLeft_comp, id_whiskerRight, whiskerLeft_id) and scalar budgets (add_assoc, zero_add, add_zero), and full-goal closure (never leaving partial open goals or sorry).

cc_calc constructs
  ๐“กโ‚€ = ๐“กโ‚€' := hโ‚€
  _  โ€”[ฯ€โ‚]โ†’ ๐“กโ‚ := hโ‚
  _  โ€”[ฯ€โ‚‚; ฮต]โ†’ ๐“กโ‚‚ := hโ‚‚
  _  โ€”[ฯ€โ‚ƒ; ฮด]โ†’ ๐“กโ‚ƒ := hโ‚ƒ

Acceptance criteria

  • Pure exact chains (โ€”[ฯ€]โ†’ and =) close Constructs goals in any ResourceTheory (without requiring a metric) and also close zero-error ConstructsWithin / epsilonRelaxation 0 goals.
  • Pure approximate and mixed exact/approximate chains (โ€”[ฯ€]โ†’, โ€”[ฯ€; ฮต]โ†’, =) close both ConstructsWithin goals and Constructs goals targeting epsilonRelaxation, normalizing converter reassociations/whiskerings ((ฮบ โ‰ซ ฯ€) โ–ท P) and zero budgets (0 + ฮต, ฮต + 0) automatically.
  • Works seamlessly under CC custom notation (โ€”[ฯ€]โ†’, โ€”[ฯ€; ฮต]โ†’, โ€ข, โˆฅ, โ—, โ–ท, โŠ—โ‚˜, โ‰ซ) on both abstract CryptographicAlgebra and concrete Interface (including multi-step ActiveUserBank and Indifferentiability chains), and coexists unambiguously with cc_calc statistical / cc_calc quantitative / cc_calc mixed / cc_calc counted.
  • Negative tests confirm that missing steps, incomplete proofs (sorry / by skip / _), mismatched intermediate specifications, approximate steps against an unrelaxed exact goal, and wrong final converters or budgets fail cleanly without leaving open goals.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions