-
Notifications
You must be signed in to change notification settings - Fork 0
feat(opening): expose response splicing #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,65 @@ end OpeningStepResult | |
|
|
||
| namespace CanonicalOpening | ||
|
|
||
| /-- A verifier either audits one global response or opens one local response. -/ | ||
| inductive GlobalLocalChallenge (Index : Type) where | ||
| /-- Audit the response intended to establish the global relation. -/ | ||
| | global | ||
| /-- Open the response at one challenged local index. -/ | ||
| | opening (index : Index) | ||
|
|
||
| /-- | ||
| A one-round strategy commits before the challenge, then supplies separate | ||
| global and local responses. The local response function is semantic strategy | ||
| state, not a claim that its entire table is transmitted. | ||
| -/ | ||
| structure SeparatedResponseStrategy | ||
| (Commitment GlobalResponse Index LocalResponse : Type) where | ||
| /-- The message fixed before the verifier reveals its challenge. -/ | ||
| commitment : Commitment | ||
| /-- The response used on the global audit branch. -/ | ||
| globalResponse : GlobalResponse | ||
| /-- The response used at each local opening branch. -/ | ||
| localResponse : Index → LocalResponse | ||
|
|
||
| namespace SeparatedResponseStrategy | ||
|
|
||
| /-- Run the branch selected by a global-or-local challenge. -/ | ||
| def run | ||
| {Commitment GlobalResponse Index LocalResponse ChildClaim : Type} | ||
| (global : Commitment → GlobalResponse → OpeningStepResult ChildClaim) | ||
| (localStep : Commitment → Index → LocalResponse → OpeningStepResult ChildClaim) | ||
| (strategy : SeparatedResponseStrategy Commitment GlobalResponse Index LocalResponse) : | ||
| GlobalLocalChallenge Index → OpeningStepResult ChildClaim | ||
| | .global => global strategy.commitment strategy.globalResponse | ||
| | .opening index => localStep strategy.commitment index (strategy.localResponse index) | ||
|
|
||
| /-- | ||
| A separated strategy survives every challenge exactly when its global response | ||
| and every independently selectable local response are safe. This equivalence | ||
| is the response-splicing seam that a real commitment mechanism must close. | ||
| -/ | ||
| theorem safeForEveryChallenge_iff | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Rename this public theorem to AGENTS.md reference: AGENTS.md:L67-L67 Useful? React with 👍 / 👎. |
||
| {Commitment GlobalResponse Index LocalResponse ChildClaim : Type} | ||
| (childTrue : ChildClaim → Bool) | ||
| (global : Commitment → GlobalResponse → OpeningStepResult ChildClaim) | ||
| (localStep : Commitment → Index → LocalResponse → OpeningStepResult ChildClaim) | ||
| (strategy : SeparatedResponseStrategy Commitment GlobalResponse Index LocalResponse) : | ||
| (∀ challenge, (strategy.run global localStep challenge).isSafe childTrue = true) ↔ | ||
| (global strategy.commitment strategy.globalResponse).isSafe childTrue = true ∧ | ||
| ∀ index, | ||
| (localStep strategy.commitment index (strategy.localResponse index)).isSafe childTrue = | ||
| true := by | ||
| constructor | ||
| · intro hSafe | ||
| exact ⟨hSafe .global, fun index => hSafe (.opening index)⟩ | ||
| · rintro ⟨hGlobal, hLocal⟩ challenge | ||
| cases challenge with | ||
| | global => exact hGlobal | ||
| | opening index => exact hLocal index | ||
|
|
||
| end SeparatedResponseStrategy | ||
|
|
||
| /-- | ||
| One fixed proof survives every challenge without rejection or a false child. | ||
| This proposition states the semantic contract before finite enumeration. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When consumers pass
SeparatedResponseStrategyandGlobalLocalChallengedirectly tohasPerfectOneStepStrategy, typeclass synthesis cannot satisfy its[Fintype Proof]and[Fintype Challenge]requirements even when every component type andIndexis finite, because neither new declaration provides a conditionalFintypeinstance. Derive or define these instances so the finite strategy model can actually be used by the executable checker without downstream orphan instances.Useful? React with 👍 / 👎.