Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
27d04d4
Bump CompPoly to latest upstream master (fe33688)
quangvdao Mar 28, 2026
7008657
Slim Bivariate.lean by importing CompPoly bridge modules
quangvdao Mar 28, 2026
cee9b7d
Bump VCVio to latest master and drop redundant Q_ne_0
quangvdao Mar 28, 2026
42f33c2
Slim Prelude.lean imports to avoid pulling in all of VCVio and Mathlib
quangvdao Mar 28, 2026
01f9678
Address Gemini review: restore Q_ne_0, fix docstrings, add NoZeroDivi…
quangvdao Mar 28, 2026
1641cf3
Merge branch 'main' into quang/bump-comppoly
quangvdao Mar 28, 2026
cf58d7a
Fix linter warnings in Bivariate.lean
quangvdao Mar 28, 2026
0b39a78
Add Interaction layer: Spec + RoleDecoration replaces ProtocolSpec
quangvdao Mar 28, 2026
7835883
Phase 3: Oracle verifier redesign with growing oracle access
quangvdao Mar 28, 2026
6f2774b
Role.Refine: centralize role-aware pattern matching for sender decora…
quangvdao Mar 28, 2026
259c579
refactor(Interaction): split Basic and TwoParty into submodules
quangvdao Mar 28, 2026
5dea430
fix(Interaction): Spec.Decoration.swap for RoleDecoration dot notation
quangvdao Mar 28, 2026
ca07dca
chore(Interaction): add author headers and improve Spec docstrings
quangvdao Mar 29, 2026
ae9dda0
feat(Interaction): Reduction, Security, and Oracle redesign
quangvdao Mar 29, 2026
fa5cab2
chore: remove redundant per-file autoImplicit options
quangvdao Mar 29, 2026
4e1e982
refactor(Interaction): rename transcript ops, add n-ary chain combina…
quangvdao Mar 29, 2026
4aadca5
refactor(Interaction/Basic): promote Chain as default, extract StateC…
quangvdao Mar 29, 2026
5d8d86c
refactor(Interaction): merge intrinsic reduction, rename chain → stat…
quangvdao Mar 29, 2026
ce1e746
feat(Sumcheck/Interaction): add interaction-native sumcheck protocol
quangvdao Mar 29, 2026
56b6d01
chore: regenerate ArkLib.lean, update PORTING.md for Chain cutover
quangvdao Mar 29, 2026
12f92a3
refactor(Interaction): eliminate all dependent casts from definitions…
quangvdao Mar 30, 2026
639d5b6
refactor(Interaction): thread honest prover outputs through composition
quangvdao Mar 30, 2026
106c01f
Merge branch 'main' into quang/core-rebuild
quangvdao Mar 31, 2026
eccfede
refactor interaction-native oracle reductions
quangvdao Mar 31, 2026
43e1179
clean up oracle composition routing
quangvdao Mar 31, 2026
5be189b
prove oracle runner prover-map lemma
quangvdao Mar 31, 2026
2a4c7d4
update porting status for oracle refactor
quangvdao Mar 31, 2026
fff6693
relax oracle continuation composition for FRI
quangvdao Apr 1, 2026
b6fcca3
add continuation-native FRI building blocks
quangvdao Apr 1, 2026
3e7b288
document Lean notation and definition style
quangvdao Apr 1, 2026
c2d56ff
prefer existing library combinators over bespoke wrappers
quangvdao Apr 1, 2026
f4c7e4c
add interaction-native boundary layer
quangvdao Apr 1, 2026
9ff60f7
add interaction-native boundary transport layer
quangvdao Apr 1, 2026
4e333cd
document oracle execution helpers
quangvdao Apr 1, 2026
5f3272a
split boundary projection and lifting layers
quangvdao Apr 1, 2026
d0c3943
refine interaction security docs and signatures
quangvdao Apr 1, 2026
e1e7bc2
add interaction blueprint chapter
quangvdao Apr 1, 2026
3c4c5b0
rewrite interaction foundations motivation
quangvdao Apr 1, 2026
c95ec52
add generic interaction shape core
quangvdao Apr 2, 2026
a06d666
add interaction-native fiat-shamir core
quangvdao Apr 2, 2026
c624573
document interaction fiat-shamir transform
quangvdao Apr 2, 2026
d47b0cf
rename decoration over and strengthen generic core
quangvdao Apr 2, 2026
133a8b9
refactor interaction core around node contexts
quangvdao Apr 2, 2026
0e7c627
add schema bridge for node decorations
quangvdao Apr 2, 2026
3190fb6
extend schema decoration calculus
quangvdao Apr 2, 2026
9c88d9f
add schema maps and context reindexing
quangvdao Apr 2, 2026
3bbb86a
add functorial laws for schema reindexing
quangvdao Apr 2, 2026
5845eaa
extend schema maps and displayed transport
quangvdao Apr 2, 2026
cbd343d
add shape helpers for two-party cutover
quangvdao Apr 2, 2026
a9742ca
split interaction syntax from functorial shapes
quangvdao Apr 2, 2026
8f9d0a2
cut over two-party interaction types to syntax core
quangvdao Apr 2, 2026
92deb0a
cut over two-party execution to interaction core
quangvdao Apr 2, 2026
95741d0
route counterpart family transport through shape core
quangvdao Apr 2, 2026
8b427d6
promote role monad contexts in two-party layer
quangvdao Apr 2, 2026
08ab023
make two-party sender nodes uniformly monadic
quangvdao Apr 2, 2026
b1bee16
polish ownership syntax builder
quangvdao Apr 2, 2026
2411971
trim compose simp noise
quangvdao Apr 2, 2026
a35d0b6
generalize passive two-party observations
quangvdao Apr 2, 2026
3b746e4
propagate effectful passive observations
quangvdao Apr 2, 2026
57aa966
adjust sumcheck interactions for effectful observations
quangvdao Apr 2, 2026
d1b183b
keep sumcheck oracle fixed across rounds
quangvdao Apr 2, 2026
0e96281
add stateful sumcheck oracle prover variants
quangvdao Apr 2, 2026
2aefe08
remove stateless sumcheck residual sorry
quangvdao Apr 2, 2026
6819676
strengthen sumcheck oracle execution equivalence
quangvdao Apr 2, 2026
b8839ec
prune interaction alias surface and oracle umbrellas
quangvdao Apr 3, 2026
5072524
simplify boundary oracle context records
quangvdao Apr 3, 2026
c9a164f
trim two-party composition surface
quangvdao Apr 3, 2026
5724d41
trim basic composition sugar
quangvdao Apr 3, 2026
cb8ad34
remove boundary oracle routing sorrys
quangvdao Apr 3, 2026
2795c19
split oracle continuation execution core
quangvdao Apr 3, 2026
73e0d8b
add raw boundary oracle pullback theorem
quangvdao Apr 3, 2026
989d243
complete interaction round-by-round security proofs
quangvdao Apr 3, 2026
51fd362
weaken pure composition soundness assumptions
quangvdao Apr 3, 2026
56f84e0
move interaction soundness under verifier namespaces
quangvdao Apr 3, 2026
0158f32
separate fixed and dependent oracle verifier APIs
quangvdao Apr 3, 2026
11ebeeb
remove fixed oracle verifier specialization
quangvdao Apr 3, 2026
de02116
rework verifier soundness surfaces
quangvdao Apr 3, 2026
662aa8f
generalize oracle verifier input families
quangvdao Apr 3, 2026
f9651fe
document oracle continuation as specialization
quangvdao Apr 3, 2026
03f3dc4
promote interaction core to input localstmt api
quangvdao Apr 3, 2026
c9b0cd4
update fri and sumcheck for input localstmt api
quangvdao Apr 3, 2026
e177fc2
refactor(multiparty): cut over to local-view profiles
quangvdao Apr 3, 2026
c3a0aed
refactor(oracle): canonize continuation-shaped core
quangvdao Apr 3, 2026
ae6de96
refactor(proofsystem): cut over oracle protocol builders
quangvdao Apr 3, 2026
75df074
feat(interaction): add concurrent execution core
quangvdao Apr 3, 2026
0e02e66
refactor(interaction): align plain shared spine api
quangvdao Apr 3, 2026
30288d9
feat(interaction): add concurrent trace semantics
quangvdao Apr 3, 2026
0ae3e74
feat(interaction): add concurrent trace policies
quangvdao Apr 3, 2026
c56fce2
refactor(interaction): generalize composed statement input
quangvdao Apr 3, 2026
ef73c18
refactor(interaction): lift round-by-round security over shared input
quangvdao Apr 3, 2026
2a9f4db
refactor(interaction): generalize state-chain statement input
quangvdao Apr 3, 2026
447b248
refactor(oracle): rename shared-index bridge helpers
quangvdao Apr 3, 2026
1cae4e0
feat(interaction): add dynamic concurrent process core
quangvdao Apr 4, 2026
e0277ef
refactor(oracle): make security semantics behavior-first
quangvdao Apr 4, 2026
57411fc
refactor(interaction): center concurrent execution on process
quangvdao Apr 4, 2026
57f1f15
refactor(oracle): rename verifier languages
quangvdao Apr 4, 2026
1c4ebe9
refactor(oracle): rename oracleDeco parameters
quangvdao Apr 4, 2026
9baed01
refactor(interaction): fix non-sorry linter warnings
quangvdao Apr 4, 2026
77463dc
Merge origin/main into quang/core-rebuild
quangvdao Apr 4, 2026
0ace158
chore(ci): enforce interaction warning budget
quangvdao Apr 4, 2026
7e5c106
feat(concurrent): add run and liveness layers
quangvdao Apr 4, 2026
f2c02b2
refactor(oracle): clean continuation composition constructors
quangvdao Apr 4, 2026
3bb2b03
theorem(oracle): extend theorem surface
quangvdao Apr 4, 2026
3cab7ca
feat(concurrent): preserve behavior under refinement
quangvdao Apr 4, 2026
d111502
theorem(oracle): derive reified soundness bridge
quangvdao Apr 4, 2026
c4eefbc
feat(concurrent): add bisimulation and equivalence
quangvdao Apr 4, 2026
4926202
docs(interaction): expand concurrency notes
quangvdao Apr 4, 2026
87f0a3f
docs(interaction): add bracha verification note
quangvdao Apr 4, 2026
48a4924
refactor(oracle): make append oracle transport structural
quangvdao Apr 4, 2026
050fc40
fix(interaction): clear remaining non-sorry warnings
quangvdao Apr 4, 2026
831d4cb
docs(concurrent): clarify semantic docstrings
quangvdao Apr 4, 2026
be709b4
refactor(concurrent): finish process-over cutover
quangvdao Apr 4, 2026
9873da4
feat(concurrent): add interface boundary primitives
quangvdao Apr 4, 2026
989147d
feat(concurrent): add open composition laws
quangvdao Apr 4, 2026
21b0603
feat(concurrent): add boundary equivalences
quangvdao Apr 4, 2026
c819710
feat(concurrent): add equivalence-aware open laws
quangvdao Apr 4, 2026
246a7fa
fix(oracle): prove composed simulator bridge
quangvdao Apr 5, 2026
dfc8370
chore: regenerate ArkLib.lean to include OpenSyntax import
quangvdao Apr 7, 2026
20428b1
feat(concurrent): add interpret eliminator and simp lemmas for free o…
quangvdao Apr 7, 2026
8a39dc5
Merge remote-tracking branch 'origin/main' into quang/core-rebuild
quangvdao Apr 11, 2026
45ebc85
refactor: migrate general interaction theory to VCVio
quangvdao Apr 11, 2026
ad201f9
feat(Interaction/FiatShamir): add duplex sponge FS construction
quangvdao Apr 11, 2026
5861161
chore: update VCVio rev to include CI fixes
quangvdao Apr 11, 2026
704c622
refactor: update core interaction framework and commitment scheme
quangvdao Apr 13, 2026
a5145a0
feat(BCS): replace legacy BCS with HybridSpec framework
quangvdao Apr 13, 2026
e73ffad
docs: add BCS blueprint and update wiki
quangvdao Apr 13, 2026
2ace261
feat(Oracle.Spec): add cast-free oracle protocol specification layer
quangvdao Apr 13, 2026
5413d70
feat(Oracle.Spec): rework security definitions and fix composition
quangvdao Apr 14, 2026
a163dd5
feat(Oracle.Spec): add BCS Phase 2 infrastructure and fix KS→soundnes…
quangvdao Apr 14, 2026
58f53a4
feat(Oracle.Spec): add OpeningDeco and update porting status
quangvdao Apr 14, 2026
fcc3add
feat(Oracle.Spec): add chain composition, prove KS implies soundness
quangvdao Apr 14, 2026
464bbbe
fix(Oracle.Spec): revert circular KS→soundness proof
quangvdao Apr 14, 2026
f6093a6
refactor(interaction): unify oracle counterpart rewriting via mapOracles
quangvdao Apr 18, 2026
da43723
Merge branch 'main' into quang/core-rebuild
quangvdao Apr 30, 2026
43a68c7
fix(lean): repair oracle merge fallout
quangvdao Apr 30, 2026
eaa8c41
Merge branch 'main' into quang/core-rebuild
quangvdao Apr 30, 2026
14efe97
Merge main into core-rebuild for PR scoping
codygunton Jun 5, 2026
4b2001f
Pare down core-rebuild to the core oracle protocol surface (PR #1)
codygunton Jun 5, 2026
2d456d4
Pare down core-rebuild to the core + execution slice (PRs #1-#2)
codygunton Jun 5, 2026
17629f1
Merge upstream v4.30 dependency bump
codygunton Jun 9, 2026
fd3923d
Update PR 10 for v4.30 dependencies
codygunton Jun 10, 2026
ebcec17
Merge remote-tracking branch 'upstream' into cg/quang/core-rebuild-1-…
codygunton Jun 11, 2026
d9a9f01
Sync oracle execution branch with core surface
codygunton Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ArkLib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import ArkLib.Data.CodingTheory.ProximityGap.MCAGenerator
import ArkLib.Data.CodingTheory.ProximityGap.ProximityGenerators
import ArkLib.Data.CodingTheory.ReedSolomon
import ArkLib.Data.CodingTheory.ReedSolomon.Multilinear
import ArkLib.Data.CompPoly.Basic
import ArkLib.Data.Domain.CosetFftDomain.Defs
import ArkLib.Data.Domain.CosetFftDomain.Log
import ArkLib.Data.Domain.CosetFftDomain.Mem
Expand Down Expand Up @@ -136,6 +137,15 @@ import ArkLib.Data.Polynomial.SplitFold
import ArkLib.Data.Polynomial.Trivariate
import ArkLib.Data.Probability.Instances
import ArkLib.Data.Probability.Notation
import ArkLib.Interaction.Oracle.Bridge
import ArkLib.Interaction.Oracle.Chain
import ArkLib.Interaction.Oracle.Composition
import ArkLib.Interaction.Oracle.Continuation
import ArkLib.Interaction.Oracle.Core
import ArkLib.Interaction.Oracle.Execution
import ArkLib.Interaction.Oracle.Spec
import ArkLib.Interaction.Oracle.StateChain
import ArkLib.Interaction.Reduction
import ArkLib.OracleReduction.BCS.Basic
import ArkLib.OracleReduction.Basic
import ArkLib.OracleReduction.Cast
Expand Down
103 changes: 103 additions & 0 deletions ArkLib/Data/CompPoly/Basic.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/-
Copyright (c) 2024-2025 ArkLib Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Quang Dao
-/
import CompPoly.Multivariate.CMvPolynomial
import CompPoly.Multivariate.Operations
import CompPoly.Multivariate.Rename
import CompPoly.Univariate.ToPoly.Impl
import ArkLib.OracleReduction.OracleInterface

/-!
# Shared CompPoly Wrappers and Oracle Interfaces

Shared degree-bounded computable polynomial types used across protocols, together
with reusable `OracleInterface` instances.
-/

open CompPoly CPoly Std

namespace CPoly.CMvPolynomial

variable {n : ℕ} {R : Type} [CommSemiring R] [BEq R] [LawfulBEq R]

/-- `p` has individual degree at most `deg` when every monomial exponent is
bounded by `deg` in every coordinate. -/
def IndividualDegreeLE (deg : ℕ) (p : CMvPolynomial n R) : Prop :=
letI := Classical.decEq R
∀ i : Fin n, ∀ mono ∈ Lawful.monomials p, mono.degreeOf i ≤ deg

end CPoly.CMvPolynomial

/-- A computable univariate polynomial with `natDegree ≤ d`. -/
def CDegreeLE (R : Type) [BEq R] [Semiring R] [LawfulBEq R] (d : ℕ) :=
{ p : CPolynomial R // p.natDegree ≤ d }

/-- A computable multivariate polynomial with individual degree at most `d` in
every coordinate. -/
def CMvDegreeLE
(R : Type) [BEq R] [CommSemiring R] [LawfulBEq R] (n d : ℕ) :=
{ p : CMvPolynomial n R // CMvPolynomial.IndividualDegreeLE (R := R) d p }

section OracleInterface

open OracleComp OracleSpec

variable {n : ℕ} {deg : ℕ} {R : Type} [CommSemiring R] [BEq R] [LawfulBEq R]

instance instOracleInterfaceCMvPolynomial :
OracleInterface (CMvPolynomial n R) where
Query := Fin n → R
toOC := {
spec := (Fin n → R) →ₒ R
impl := fun points => do return CMvPolynomial.eval points (← read)
}

instance instOracleInterfaceCPolynomial [Nontrivial R] :
OracleInterface (CPolynomial R) where
Query := R
toOC := {
spec := R →ₒ R
impl := fun point => do return CPolynomial.eval point (← read)
}

instance instOracleInterfaceCDegreeLE [Semiring R] :
OracleInterface (CDegreeLE R deg) where
Query := R
toOC := {
spec := R →ₒ R
impl := fun point => do return CPolynomial.eval point (← read).1
}

instance instOracleInterfaceCMvDegreeLE :
OracleInterface (CMvDegreeLE R n deg) where
Query := Fin n → R
toOC := {
spec := (Fin n → R) →ₒ R
impl := fun points => do return CMvPolynomial.eval points (← read).1
}

namespace Examples

/-- A verifier-side query against a multivariate polynomial oracle.

The verifier supplies only an evaluation point. The polynomial itself is supplied
later as the read-only oracle environment. -/
def verifierQueryCMvPolynomial (points : Fin n → R) :
ReaderM (CMvPolynomial n R) R :=
(instOracleInterfaceCMvPolynomial (n := n) (R := R)).toOC.impl points

set_option linter.unusedSectionVars false

/-- Running the verifier-side query against a concrete polynomial agrees with
ordinary polynomial evaluation. -/
theorem verifierQueryCMvPolynomial_run (poly : CMvPolynomial n R) (points : Fin n → R) :
(verifierQueryCMvPolynomial (R := R) points).run poly =
CMvPolynomial.eval points poly := by
unfold verifierQueryCMvPolynomial
rfl

end Examples

end OracleInterface
98 changes: 98 additions & 0 deletions ArkLib/Interaction/Oracle/Bridge.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/-
Copyright (c) 2026 ArkLib Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Quang Dao
-/
import ArkLib.Interaction.Oracle.Core

/-!
# Bridge: Interaction.Spec + OracleDecoration → Oracle.Spec

Structural conversion from the W-type-based
`Interaction.Spec + RoleDecoration + OracleDecoration` to the new
`Interaction.Oracle.Spec` inductive.

## Main definitions

- `Interaction.Oracle.Spec.ofInteractionSpec` — convert an `Interaction.Spec`
with `RoleDecoration` and `OracleDecoration` into an `Oracle.Spec`.
At sender nodes the continuation is treated as constant (picking a
representative via a provided default-element function).
- `Interaction.Oracle.Spec.ofRoleDecoration` — convert a `RoleDecoration`
to `Spec.RoleDeco`.
- `Interaction.Oracle.Spec.ofOracleDecoration` — convert an
`OracleDecoration` to `Spec.OracleDeco`.

## Implementation notes

The bridge requires a `senderDefault` function to pick a representative
element at each sender node (since oracle message types may not have
`Inhabited` instances). In practice, all oracle message types are nonempty,
so any such function suffices.

Verifier and reduction conversions (from `OracleVerifier`/`OracleReduction`
to `Oracle.Verifier`/`Oracle.Reduction`) are deferred. The output types need
to be re-indexed from `Interaction.Spec.Transcript` to
`Oracle.Spec.PublicTranscript`, which requires careful coherence proofs. In
practice, consumers should construct `Oracle.Spec`-based reductions natively
rather than converting from the old representation.
-/

open OracleComp OracleSpec
open Interaction.TwoParty

namespace Interaction.Oracle.Spec

/-- Convert an `Interaction.Spec + RoleDecoration + OracleDecoration` into an
`Oracle.Spec`.

At sender nodes, the continuation `rest x` is structurally required to be
constant by `OracleDecoration` (oracle messages don't branch). We pick the
representative using the `senderDefault` function.

At receiver nodes, the continuation genuinely depends on the message, so
`.public` is used. -/
noncomputable def ofInteractionSpec
(senderDefault : ∀ (X : Type), OracleInterface X → X) :
(spec : Interaction.Spec) → (roles : RoleDecoration spec) →
OracleDecoration spec roles → Oracle.Spec
| .done, _, _ => .done
| .node X rest, ⟨.sender, rRest⟩, ⟨oi, odRest⟩ =>
let x₀ := senderDefault X oi
.oracle X (ofInteractionSpec senderDefault (rest x₀) (rRest x₀) (odRest x₀))
| .node X rest, ⟨.receiver, rRest⟩, odFn =>
.«public» X (fun x =>
ofInteractionSpec senderDefault (rest x) (rRest x) (odFn x))

/-- Convert a `RoleDecoration` to `RoleDeco` on the resulting `Oracle.Spec`.
Only receiver nodes carry role information in `Oracle.Spec`; sender nodes
are structurally `.sender` by construction. -/
noncomputable def ofRoleDecoration
(senderDefault : ∀ (X : Type), OracleInterface X → X) :
(spec : Interaction.Spec) → (roles : RoleDecoration spec) →
(od : OracleDecoration spec roles) →
RoleDeco (ofInteractionSpec senderDefault spec roles od)
| .done, _, _ => ⟨⟩
| .node _ rest, ⟨.sender, rRest⟩, ⟨oi, odRest⟩ =>
let x₀ := senderDefault _ oi
ofRoleDecoration senderDefault (rest x₀) (rRest x₀) (odRest x₀)
| .node _ rest, ⟨.receiver, rRest⟩, odFn =>
⟨.receiver, fun x =>
ofRoleDecoration senderDefault (rest x) (rRest x) (odFn x)⟩

/-- Convert an `OracleDecoration` to `OracleDeco` on the resulting
`Oracle.Spec`. The `OracleInterface` at each sender node becomes the
`.oracle` node's interface. -/
noncomputable def ofOracleDecoration
(senderDefault : ∀ (X : Type), OracleInterface X → X) :
(spec : Interaction.Spec) → (roles : RoleDecoration spec) →
(od : OracleDecoration spec roles) →
OracleDeco (ofInteractionSpec senderDefault spec roles od)
| .done, _, _ => ⟨⟩
| .node _ rest, ⟨.sender, rRest⟩, ⟨oi, odRest⟩ =>
let x₀ := senderDefault _ oi
⟨oi, ofOracleDecoration senderDefault (rest x₀) (rRest x₀) (odRest x₀)⟩
| .node _ rest, ⟨.receiver, rRest⟩, odFn =>
fun x => ofOracleDecoration senderDefault (rest x) (rRest x) (odFn x)

end Interaction.Oracle.Spec
Loading