feat(AppendOneMsg): unconditional append perfect completeness at 1-message ++ 1-message#636
feat(AppendOneMsg): unconditional append perfect completeness at 1-message ++ 1-message#636Abraxas1010 wants to merge 4 commits into
Conversation
…dd run_pure_verifier Two new theorems alongside the open general append_completeness: * Reduction.run_pure_verifier — for any reduction whose verifier is a pure function f of statement and transcript, (R.run stmt wit).run equals the lifted prover run followed by pure massage. The run characterization the support_run_pure_verifier premise pattern suggests. * Reduction.append_perfectCompleteness_of_proverFactorization — perfect completeness composes across append given: pure verifiers, the prover-level simulated factorization (the distributional shadow of the open Prover.append_run, taken as a hypothesis so this theorem is usable now and the factorization can land separately), and — answering the TODO at the top of this section — R2's completeness quantified over ALL initial states: the appended run hands R2 whatever state R1's prover left, so a fixed-init premise cannot apply. A run-level factorization through R2.run is false pointwise (the appended verifier chains V1's output while the appended prover chains P1's; they agree only on honest supports), hence the prover-level hypothesis. No sorry; axioms [propext, Classical.choice, Quot.sound]. All importers build. From The Institute for Ontological Mathematics (IAOM) / Equation Capital dba Apoth3osis.
…ssage ++ 1-message The commit-then-reveal shape from Verified-zkEVM#627, fully proven (sorry-free, axioms [propext, Classical.choice, Quot.sound]): * per-field equation lemmas for Prover.append at the embedded literal indices (the Eq.mpr casts from the tactic-mode field definitions discharged by an eq_mpr_eq_cast/cast_heq/congr recipe); * append_run_components: the appended prover's run characterized entirely in component operations (P1's message; the boundary handoff P1.output >> P2.input >> P2.sendMessage; P2's output), each under the pinned direct lift (a restated liftM can elect a two-hop route through a component challenge sum that is semantically but not definitionally equal — pinned explicitly); * simulated bridges: the direct lifts wash out under any QueryImpl; * hfact_oneMsg: the prover-level simulated factorization — the hypothesis of Reduction.append_perfectCompleteness_of_proverFactorization, proven; * append_perfectCompleteness_oneMsg: pure verifiers + R1 complete at init + R2 complete uniformly in the initial state => the appended reduction is perfectly complete. Unconditional at this shape. The composition theorem is restated locally (see the CompositionLocal note): applying the Append.lean version at these concrete reducible specs hits a pinned-vs-generic OracleInterface unification storm. Stacked on Verified-zkEVM#631 (runToRound_succ) and Verified-zkEVM#635 (the composition theorem) — their commits are included; review only AppendOneMsg.lean + the ArkLib.lean import. From The Institute for Ontological Mathematics (IAOM) / Equation Capital dba Apoth3osis.
🤖 PR Summary
This PR adds the Mathematical FormalizationAppendOneMsg.lean (new file)
Component-wise equation lemmas breaking the appended prover's operations:
Run decomposition: Transcript alignment: Simulation bridges:
Local restatement: Notes (in-file): The composition theorem is restated locally because applying the generic Append.lean
Execution.lean
Proof Completion (sorries removed)SendWitness.lean
Infrastructure / CI
No remaining
|
| Metric | Count |
|---|---|
| 📝 Files Changed | 5 |
| ✅ Lines Added | 772 |
| ❌ Lines Removed | 2 |
Lean Declarations
✏️ Added: 23 declaration(s)
ArkLib/OracleReduction/Composition/Sequential/Append.lean (2)
theorem append_perfectCompleteness_of_proverFactorizationtheorem run_pure_verifier
ArkLib/OracleReduction/Composition/Sequential/AppendOneMsg.lean (20)
@[reducible] def liftc {M₁ M₂ α : Type} (x : OracleComp oSpec α) :@[reducible] def liftd {M α : Type} (x : OracleComp oSpec α) :@[reducible] def spec₁ (M₁ : Type) : ProtocolSpec 1@[reducible] def spec₂ (M₂ : Type) : ProtocolSpec 1theorem append_input (ctx : S₁ × W₁) :theorem append_output (st : (P₁.append P₂).PrvState (Fin.last (1 + 1))) :theorem append_perfectCompleteness_of_proverFactorizationtheorem append_perfectCompleteness_oneMsgtheorem append_runToRound_one :theorem append_run_components :theorem append_run_raw :theorem append_sendMessage_boundary (st : (P₁.append P₂).PrvState (Fin.castSucc 1)) :theorem append_sendMessage_left (st : (P₁.append P₂).PrvState (Fin.castSucc 0)) :theorem bridge_c {α : Type} (X : OracleComp oSpec α) :theorem bridge_d {M α : Type} (X : OracleComp oSpec α) :theorem hfact_oneMsgtheorem oneMsg_run_raw {S W S' W' M : Type}theorem processRound_one_eqtheorem run_pure_verifiertheorem transcript_align (y₁ : M₁) (y₂ : M₂) :
ArkLib/OracleReduction/Execution.lean (1)
theorem Prover.runToRound_succ (i : Fin n)
sorry Tracking
✅ Removed: 1 `sorry`(s)
ArkLib/ProofSystem/Component/SendWitness.lean (1)
theorem reduction_completeness :(L77)
📋 **Additional Analysis**
The diff introduces a new file AppendOneMsg.lean and modifies several existing files. Overall it is a substantial addition that advances the formalization goals. However, several violations of the ArkLib style guide and documentation standards are present. The most significant issues are excessive line lengths, missing docstrings for many theorems, and empty lines inside proofs. Several minor style issues are also noted. The duplication of theorems is intentional but should be documented more clearly. The review below lists the violations by category.
📄 **Per-File Summaries**
- ArkLib.lean: Added an import of
ArkLib.OracleReduction.Composition.Sequential.AppendOneMsg, making a new module available that likely provides definitions or theorems for appending a single message in sequential oracle-reduction compositions. - ArkLib/OracleReduction/Composition/Sequential/Append.lean: The file adds two new theorems:
run_pure_verifier, which states that for a reduction whose verifier is a pure function of statement and transcript, theReduction.runmonad collapses to a lift of the prover's run, providing a reusable lemma for pure-verifier reductions; andappend_perfectCompleteness_of_proverFactorization, which proves that perfect completeness composes acrossReduction.appendunder the assumptions of pure verifiers, a prover-level simulated factorizationhfact, and thatR₂is complete uniformly in the initial state (addressing a previous TODO by requiring completeness for all initial states, not just a fixed one). The latter theorem usesrun_pure_verifierand the existingappend_perfectCompletenessinfrastructure. - ArkLib/OracleReduction/Composition/Sequential/AppendOneMsg.lean: This new file
AppendOneMsg.leanproves that perfect completeness composes acrossReduction.appendfor single-message protocols with pure verifiers, removing the factorization hypothesis left open by the genericReduction.append_perfectCompleteness_of_proverFactorizationinAppend.lean. It introduces the concrete protocol specsspec₁andspec₂(each a single-round.P_to_Vfollowed by a message type), and establishes the main resultsappend_perfectCompleteness_oneMsg(the unconditional composition theorem) andhfact_oneMsg(the prover-level simulated factorization(P₁.append P₂).runequalsP₁.runthenP₂.run). Supporting this are: component-wise equation lemmas (append_sendMessage_left,append_sendMessage_boundary,append_input,append_output) breaking the appended prover's operations into those ofP₁andP₂; a run decompositionappend_run_componentsexpressing the appended run in terms of per-component operations under direct lifts;transcript_alignshowing the nested transcript concatenation equals the++ₜof the two single-message transcripts; bridge lemmas (bridge_c,bridge_d) proving that simulating a directly-liftedoSpeccomputation through the composed challenge-sumQueryImplequals simulating it through the lifted base implementation; and a local restatementappend_perfectCompleteness_of_proverFactorizationwith thehfacthypothesis, used to derive the final unconditional theorem by supplyinghfact_oneMsg. - ArkLib/OracleReduction/Execution.lean: Added the theorem
Prover.runToRound_succ(fori : Fin n,stmt,wit,prover) that statesprover.runToRound i.succ stmt wit = prover.processRound i (prover.runToRound i.castSucc stmt wit). This provides a one-step unfolding ofrunToRoundand is intended as a workhorse for collapsing concrete protocol executions round by round (e.g., in component completeness proofs). Nosorryoradmitwere introduced. - ArkLib/ProofSystem/Component/SendWitness.lean: This diff replaces a
sorryplaceholder in thereduction_completenesstheorem with a complete proof. The proof usessimp,rw, andrefinewith two subgoals: the first shows that the probability of failure is zero by invokingprobOutput_eq_zero_of_not_mem_supportandsimulateQ_pure, and the second shows that every element of the support corresponds to a valid input by rewriting throughStateT.run_pureandmap_pure. No other changes are made in the file.
Last updated: 2026-07-11 01:52 UTC.
The capstone of the composition thread on #627: for single-message protocols with pure verifiers — the commit-then-reveal shape — perfect completeness composes across
Reduction.appendunconditionally. Sorry-free; axioms[propext, Classical.choice, Quot.sound].New file
Composition/Sequential/AppendOneMsg.lean:Prover.appendat the embedded literal indices — theEq.mprcasts from the tactic-mode field definitions fall to a reusableeq_mpr_eq_cast/cast_heq/congr 1recipe (left region, thei = mboundary handoff, input, output).append_run_components— the appended prover's run written entirely in component operations, each under an explicitly pinned direct lift (warning documented: a restatedliftMcan elect a two-hop route through a component's challenge-sum that is semantically but not definitionally equal toprocessRound's lift).QueryImpl(simulateQ_liftM_eq_of_queryat the pinned chain).hfact_oneMsg— the prover-level simulated factorization, i.e. feat(Append): completeness composition under init-uniformity + run_pure_verifier #635's hypothesis, proven throughProver.append's actual definition.append_perfectCompleteness_oneMsg— the crown:h₁atinit,h₂uniformly in the initial state, pure verifiers ⟹ appended perfect completeness.Notes for review:
AppendOneMsg.lean+ oneArkLib.leanimport line). Happy to rebase once those land.CompositionLocalsection: applying theAppend.leancopy at these concrete reducible specs runs into a pinned-vs-genericOracleInterfaceunification storm (whnf heartbeat divergence) — documented in-file; deduplicating is a follow-up once the instance story for concrete specs is settled.Prover.append_run:rw/simprefuse thesimulateQ_bind/StateT.run_bindrewrites on these goals;erw(or term-levelcongrArg+Eq.trans) is required. The full proof cadence is visible inhfact_oneMsgas a template.With #631 + the reveal-round completeness from the #627 thread, stage-1 BCS completeness now assembles end-to-end.
From The Institute for Ontological Mathematics (IAOM) / Equation Capital dba Apoth3osis