Skip to content

Commit 118f53c

Browse files
author
Abraxas1010
committed
feat(Append): construct the challenge-oracle SubSpec embeddings (2 sorries removed)
The two instances [pSpec_i.Challenge]o < [(pSpec1 ++ pSpec2).Challenge]o were stubbed with sorry. The lens data is: ChallengeIdx.inl/.inr on oracle indices, and transport along the challenge-type equalities Challenge_inl/Challenge_inr (new lemmas, by Fin.append_left/right) on responses. monadLift is spelled in lens form so liftM_eq_lift holds by rfl, per the SubSpec design notes. All downstream modules (Sequential.General, CoordinateWiseSpecialSoundness Composition, RingSwitching) build unchanged. From The Institute for Ontological Mathematics (IAOM) / Equation Capital dba Apoth3osis.
1 parent fad5cbf commit 118f53c

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

  • ArkLib/OracleReduction/Composition/Sequential

ArkLib/OracleReduction/Composition/Sequential/Append.lean

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,35 @@ variable {P₁ : Prover oSpec Stmt₁ Wit₁ Stmt₂ Wit₂ pSpec₁}
331331

332332
-- theorem append_runToRound
333333

334-
instance : [(pSpec₁).Challenge]ₒ ⊂ₒ [(pSpec₁ ++ₚ pSpec₂).Challenge]ₒ := sorry
335-
instance : [(pSpec₂).Challenge]ₒ ⊂ₒ [(pSpec₁ ++ₚ pSpec₂).Challenge]ₒ := sorry
334+
/-- The challenge type at a left-embedded index of the appended protocol is the
335+
left protocol's challenge type. -/
336+
theorem _root_.ProtocolSpec.Challenge_inl (i : pSpec₁.ChallengeIdx) :
337+
(pSpec₁ ++ₚ pSpec₂).Challenge (ChallengeIdx.inl i) = pSpec₁.Challenge i := by
338+
simp only [ProtocolSpec.append, Challenge, ChallengeIdx.inl, Fin.vappend_eq_append,
339+
Fin.append_left]
340+
341+
/-- The challenge type at a right-embedded index of the appended protocol is the
342+
right protocol's challenge type. -/
343+
theorem _root_.ProtocolSpec.Challenge_inr (i : pSpec₂.ChallengeIdx) :
344+
(pSpec₁ ++ₚ pSpec₂).Challenge (ChallengeIdx.inr i) = pSpec₂.Challenge i := by
345+
simp only [ProtocolSpec.append, Challenge, ChallengeIdx.inr, Fin.vappend_eq_append,
346+
Fin.append_right]
347+
348+
/-- The left component's challenge oracles embed into the appended protocol's:
349+
`ChallengeIdx.inl` on indices, transport along `Challenge_inl` on responses. -/
350+
instance : [(pSpec₁).Challenge]ₒ ⊂ₒ [(pSpec₁ ++ₚ pSpec₂).Challenge]ₒ where
351+
monadLift q := ⟨⟨ChallengeIdx.inl q.input.1, q.input.2⟩,
352+
q.cont ∘ fun r => cast (ProtocolSpec.Challenge_inl q.input.1) r⟩
353+
onQuery t := ⟨ChallengeIdx.inl t.1, t.2
354+
onResponse t r := cast (ProtocolSpec.Challenge_inl t.1) r
355+
356+
/-- The right component's challenge oracles embed into the appended protocol's:
357+
`ChallengeIdx.inr` on indices, transport along `Challenge_inr` on responses. -/
358+
instance : [(pSpec₂).Challenge]ₒ ⊂ₒ [(pSpec₁ ++ₚ pSpec₂).Challenge]ₒ where
359+
monadLift q := ⟨⟨ChallengeIdx.inr q.input.1, q.input.2⟩,
360+
q.cont ∘ fun r => cast (ProtocolSpec.Challenge_inr q.input.1) r⟩
361+
onQuery t := ⟨ChallengeIdx.inr t.1, t.2
362+
onResponse t r := cast (ProtocolSpec.Challenge_inr t.1) r
336363

337364
/--
338365
States that running an appended prover `P₁.append P₂` with an initial statement `stmt₁` and

0 commit comments

Comments
 (0)