Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 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
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
17 changes: 15 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,26 @@ Start with [`README.md`](README.md) for project overview.

## Guardrails

- Lean defaults: `autoImplicit = false`; the long-file linter cap is `1500` unless a file opts
out locally.
- `autoImplicit = false` is set globally in `lakefile.toml`; do **not** add
`set_option autoImplicit false` in individual files.
- The long-file linter cap is `1500` unless a file opts out locally.
- `ArkLib.lean` is generated; do not hand-edit it.
- Prefer readable Lean notation when it helps clarity: use notation such as `∑`, `∏`,
infix operators, binder notation, and dot notation instead of more verbose combinator
forms when the result is clearer and elaborates cleanly.
- Prefer term-style definitions over tactic-style definitions. Do not start a definition
with a `by` block unless there is a strong reason; if a definition seems to require
tactics, first reconsider the surrounding API, helper definitions, or expected normal form.
- Prefer existing library and repo combinators over bespoke helper definitions for simple
tuple/index plumbing. If a definition is just snoc/append/update/projection/reindexing and a
clear standard combinator already expresses it, use that directly instead of writing or keeping
a wrapper definition.
- Edit source, not derived output such as `.lake/`, `blueprint/web/`, `blueprint/print/`,
`dependency_graphs/`, or `home_page/docs/`.
- Pre-existing `sorry` blocks exist in active formalizations; distinguish existing gaps from new
regressions.
- Docstrings must be intrinsic and descriptive. Cross-reference *live* sibling definitions, but
never reference removed/renamed definitions, change history, or use reactive language.
- If a PR changes commands, repo structure, generated outputs, or the blueprint/citation
workflow, update the matching page in [`docs/wiki/`](docs/wiki/README.md) in the same PR.
- Promote recurring agent learnings into [`docs/wiki/`](docs/wiki/README.md); do not let stable
Expand Down
31 changes: 31 additions & 0 deletions ArkLib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import ArkLib.Data.CodingTheory.ProximityGap.DG25.Basic
import ArkLib.Data.CodingTheory.ProximityGap.DG25.MainResults
import ArkLib.Data.CodingTheory.ProximityGap.DG25.ReedSolomon
import ArkLib.Data.CodingTheory.ReedSolomon
import ArkLib.Data.CompPoly.Basic
import ArkLib.Data.CompPoly.Fold
import ArkLib.Data.EllipticCurve.BN254
import ArkLib.Data.Fin.Basic
import ArkLib.Data.Fin.Fold
Expand Down Expand Up @@ -81,6 +83,23 @@ import ArkLib.Data.Polynomial.RationalFunctions
import ArkLib.Data.Polynomial.SplitFold
import ArkLib.Data.Probability.Instances
import ArkLib.Data.Probability.Notation
import ArkLib.Interaction.Boundary.Compatibility
import ArkLib.Interaction.Boundary.Core
import ArkLib.Interaction.Boundary.Oracle
import ArkLib.Interaction.Boundary.OracleSecurity
import ArkLib.Interaction.Boundary.Reification
import ArkLib.Interaction.Boundary.Security
import ArkLib.Interaction.FiatShamir.Basic
import ArkLib.Interaction.FiatShamir.DuplexSponge
import ArkLib.Interaction.FiatShamir.Transform
import ArkLib.Interaction.Oracle.Continuation
import ArkLib.Interaction.Oracle.Core
import ArkLib.Interaction.Oracle.Execution
import ArkLib.Interaction.Oracle.StateChain
import ArkLib.Interaction.OracleReification
import ArkLib.Interaction.OracleSecurity
import ArkLib.Interaction.Reduction
import ArkLib.Interaction.Security
import ArkLib.OracleReduction.BCS.Basic
import ArkLib.OracleReduction.Basic
import ArkLib.OracleReduction.Cast
Expand Down Expand Up @@ -147,6 +166,13 @@ import ArkLib.ProofSystem.ConstraintSystem.MemoryChecking
import ArkLib.ProofSystem.ConstraintSystem.Plonk
import ArkLib.ProofSystem.ConstraintSystem.R1CS
import ArkLib.ProofSystem.Fri.Domain
import ArkLib.ProofSystem.Fri.Interaction.Core
import ArkLib.ProofSystem.Fri.Interaction.FinalFold
import ArkLib.ProofSystem.Fri.Interaction.FoldPhase
import ArkLib.ProofSystem.Fri.Interaction.FoldRound
import ArkLib.ProofSystem.Fri.Interaction.General
import ArkLib.ProofSystem.Fri.Interaction.Protocol
import ArkLib.ProofSystem.Fri.Interaction.QueryRound
import ArkLib.ProofSystem.Fri.RoundConsistency
import ArkLib.ProofSystem.Fri.Spec.General
import ArkLib.ProofSystem.Fri.Spec.SingleRound
Expand All @@ -160,6 +186,11 @@ import ArkLib.ProofSystem.Stir.ProximityBound
import ArkLib.ProofSystem.Stir.ProximityGap
import ArkLib.ProofSystem.Stir.Quotienting
import ArkLib.ProofSystem.Sumcheck.Impl.Basic
import ArkLib.ProofSystem.Sumcheck.Interaction.CompPoly
import ArkLib.ProofSystem.Sumcheck.Interaction.Defs
import ArkLib.ProofSystem.Sumcheck.Interaction.General
import ArkLib.ProofSystem.Sumcheck.Interaction.Oracle
import ArkLib.ProofSystem.Sumcheck.Interaction.SingleRound
import ArkLib.ProofSystem.Sumcheck.Spec.General
import ArkLib.ProofSystem.Sumcheck.Spec.SingleRound
import ArkLib.ProofSystem.Whir.BlockRelDistance
Expand Down
81 changes: 81 additions & 0 deletions ArkLib/Data/CompPoly/Basic.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/-
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

attribute [local instance] instDecidableEqOfLawfulBEq

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 :=
∀ 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
}

end OracleInterface
63 changes: 63 additions & 0 deletions ArkLib/Data/CompPoly/Fold.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/-
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 ArkLib.Data.CompPoly.Basic
import ArkLib.Data.Polynomial.SplitFold

/-!
# Computable Split/Fold for `CPolynomial`

Native computable `CPolynomial` versions of the split/fold operations used by
FRI. The definitions operate directly on CompPoly coefficients and do not route
through Mathlib polynomials.
-/

open CompPoly CPoly
open scoped BigOperators

namespace CompPoly.CPolynomial

variable {R : Type} [Semiring R] [BEq R] [LawfulBEq R] [DecidableEq R]

/-- The `i`-th component of the `n`-way split of a computable polynomial. -/
def splitNth (n : ℕ) [NeZero n] (p : CPolynomial R) : Fin n → CPolynomial R :=
fun i => ∑ j ∈ p.support,
if j % n = (i : ℕ) then
monomial (j / n) (p.coeff j)
else
0

/-- Recombine the `n`-way split of `p` using powers of `α`. -/
def foldNth (n : ℕ) [NeZero n] (p : CPolynomial R) (α : R) :
CPolynomial R :=
∑ i : Fin n, C (α ^ (i : ℕ)) * splitNth n p i

end CompPoly.CPolynomial

section ToPoly

open Polynomial

namespace CompPoly.CPolynomial

variable {R : Type} [CommSemiring R] [BEq R] [LawfulBEq R] [DecidableEq R]

theorem splitNth_toPoly (n : ℕ) [NeZero n] (p : CPolynomial R) (i : Fin n) :
(splitNth n p i).toPoly = p.toPoly.splitNth n i := by
sorry

theorem foldNth_toPoly (n : ℕ) [NeZero n] (p : CPolynomial R) (α : R) :
(foldNth n p α).toPoly = p.toPoly.foldNth n α := by
sorry

theorem foldNth_natDegree_le_of_le
(n d : ℕ) [NeZero n] (p : CPolynomial R) (α : R)
(hdeg : p.natDegree ≤ n * d) :
(foldNth n p α).natDegree ≤ d := by
sorry

end CompPoly.CPolynomial

end ToPoly
Loading
Loading