Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
c331950
feat(circuit/frontier): Boolean tensor networks and their contraction
SamuelSchlesinger Oct 30, 2026
ae63897
feat(circuit/frontier): deformed contraction and the Cauchy kernel
SamuelSchlesinger Oct 30, 2026
b06c211
refactor(circuit/frontier): index explicit tables by BitString.lsbValue
SamuelSchlesinger Oct 30, 2026
6c76726
Merge claude/boolean-tensor-networks (#1844 review fix) into the T2.1…
SamuelSchlesinger Oct 30, 2026
fa3aa4a
feat(foundations): Galois rings, ring Lagrange interpolation and the …
SamuelSchlesinger Oct 30, 2026
31ff8a6
feat(circuit/frontier): Lemma D.4, integral local coordinates of the …
SamuelSchlesinger Oct 30, 2026
3d38310
refactor(foundations): move integer valuation bounds to RatValuation
SamuelSchlesinger Oct 30, 2026
adeeddc
feat(circuit/frontier): mode expansion and the child identity (D.16)
SamuelSchlesinger Oct 30, 2026
6e6afdd
Merge remote-tracking branch 'origin/claude/t2-integral-coordinates' …
SamuelSchlesinger Oct 30, 2026
05c80d0
feat(circuit/frontier): modes of the Cauchy matrix, the geometric exp…
SamuelSchlesinger Oct 30, 2026
5597d92
Merge remote-tracking branch 'origin/claude/t2-cauchy-modes' into cla…
SamuelSchlesinger Oct 31, 2026
f6826a6
feat(circuit/frontier): local deformation and finite-precision tapere…
SamuelSchlesinger Oct 31, 2026
b78b6dd
Merge remote-tracking branch 'origin/claude/t2-galois-ring' into clau…
SamuelSchlesinger Oct 31, 2026
f934946
refactor(foundations): move AdjoinRoot coefficient reduction to its o…
SamuelSchlesinger Oct 31, 2026
5189108
doc(foundations): scope GaloisRing to the manuscript's base ring O/(2^n)
SamuelSchlesinger Oct 31, 2026
1e12be9
feat(circuit/frontier): correctness of one active call, packing bridg…
SamuelSchlesinger Oct 31, 2026
8e24241
test: make the tapered recovery test module public
SamuelSchlesinger Oct 31, 2026
1fb800a
Merge branch 'claude/t2-local-recovery' into claude/t2-active-call
SamuelSchlesinger Oct 31, 2026
02ef13c
feat(GenericRAM/Native): depth-first stack recursion with native bounds
SamuelSchlesinger Oct 31, 2026
286ff75
Merge remote-tracking branch 'origin/main' into claude/t2-local-recovery
SamuelSchlesinger Oct 31, 2026
d9722cc
chore: merge main and regenerate Complexity.lean
SamuelSchlesinger Oct 31, 2026
0009156
Merge branch 'claude/t2-local-recovery' into claude/t2-active-call
SamuelSchlesinger Oct 31, 2026
99d9e0d
feat(PolyTime): arithmetic in (Z/2^p)[U]/(f) on coefficient lists
SamuelSchlesinger Oct 31, 2026
27d0311
doc(GenericRAM/Native): qualify the module path in the stack recursio…
SamuelSchlesinger Oct 31, 2026
70f4cd5
feat(PolyTime/Nat): the clock 2^(K n / sqrt(floor(log2 n))) in polyno…
SamuelSchlesinger Oct 31, 2026
b9caee5
feat(PolyTime): unit and powers in (Z/2^p)[U]/(f)
SamuelSchlesinger Oct 31, 2026
bed24be
Merge remote-tracking branch 'origin/claude/t2-galois-ring' into clau…
SamuelSchlesinger Oct 31, 2026
dc4824e
feat(PolyTime): negation, subtraction and Newton inversion in (Z/2^p)…
SamuelSchlesinger Oct 31, 2026
164f4b2
Merge remote-tracking branch 'origin/main' into claude/t2-native-recu…
SamuelSchlesinger Oct 31, 2026
f9bcc51
Merge origin/main into claude/t2-cauchy-modes
SamuelSchlesinger Oct 31, 2026
c10db7a
chore: refresh Galois ring prerequisites on main
SamuelSchlesinger Oct 31, 2026
5312093
refactor(circuit/frontier): packingGroup takes the edge ends directly
SamuelSchlesinger Oct 31, 2026
c64e111
feat(circuit/frontier): renaming and lifting tensor networks
SamuelSchlesinger Oct 31, 2026
55c7a8f
feat(foundations): digit lifts in Z_(p)[X]/(f) have unit differences
SamuelSchlesinger Oct 31, 2026
9d8168f
feat(circuit/frontier): the contraction recursion and its correctness…
SamuelSchlesinger Oct 31, 2026
bffa3cf
feat(foundations): count tuples of bounded weight by the partition ge…
SamuelSchlesinger Oct 31, 2026
bbfbba0
feat(circuit/frontier): children of an active call have at most M/16 …
SamuelSchlesinger Oct 31, 2026
5bea2c1
feat(PolyTime): polynomials over (Z/2^p)[U]/(f) and Lagrange interpol…
SamuelSchlesinger Oct 31, 2026
c2e5c59
feat(circuit/frontier): unfolding lemmas for an active call and a lea…
SamuelSchlesinger Oct 31, 2026
bafb62e
feat(circuit/frontier): parameter schedule of the contraction recursi…
SamuelSchlesinger Oct 31, 2026
5328bbe
feat(circuit/frontier): fields of the active-node splitting; expose o…
SamuelSchlesinger Oct 31, 2026
d9a7343
feat(circuit/frontier): mode count at a certified active call
SamuelSchlesinger Oct 31, 2026
79e1c82
Merge remote-tracking branch 'origin/claude/t2-native-recursion' into…
SamuelSchlesinger Oct 31, 2026
af73f5b
feat(circuit/frontier): the contraction recursion has 2^O(s/sqrt(log …
SamuelSchlesinger Oct 31, 2026
9526858
Merge remote-tracking branch 'origin/claude/t2-parameters' into claud…
SamuelSchlesinger Oct 31, 2026
5fef5d3
feat(circuit/frontier): run the recursion with the parameter schedule…
SamuelSchlesinger Oct 31, 2026
7926132
feat(circuit/frontier): direct summation over networks with described…
SamuelSchlesinger Oct 31, 2026
83ea444
Merge remote-tracking branch 'origin/claude/t2-galois-ring' into clau…
SamuelSchlesinger Oct 31, 2026
c1407c7
feat(PolyTime): Newton inversion inverts every unit of a Galois ring
SamuelSchlesinger Oct 31, 2026
0e0e060
Merge remote-tracking branch 'origin/claude/t2-galois-interp' into cl…
SamuelSchlesinger Oct 31, 2026
3bba7ad
Merge branch 'claude/t2-galois-inv' into claude/t2-native-recovery
SamuelSchlesinger Oct 31, 2026
bcc7b10
wip: native recovery definitions and constants
SamuelSchlesinger Oct 31, 2026
3685aba
feat(circuit/frontier): explicit packet entries of the child networks…
SamuelSchlesinger Oct 31, 2026
7999990
wip: reciprocal and multiplier correctness
SamuelSchlesinger Oct 31, 2026
3efcd6b
feat(circuit/frontier): native tapered recovery components (Lemma D.5)
SamuelSchlesinger Oct 31, 2026
4c076d5
feat(circuit/frontier): the local Cauchy kernel as a product of units…
SamuelSchlesinger Oct 31, 2026
c997e5f
Merge remote-tracking branch 'origin/claude/t2-galois-arith' into cla…
SamuelSchlesinger Oct 31, 2026
9dde334
feat(circuit/frontier): native recovery computes recoverFromValues mo…
SamuelSchlesinger Oct 31, 2026
36c9ae9
Merge origin/main into claude/t2-packet-entry
SamuelSchlesinger Oct 31, 2026
955f94a
feat(circuit/frontier): direct summation over described networks with…
SamuelSchlesinger Oct 31, 2026
67d77cc
Merge remote-tracking branch 'origin/main' into claude/t2-described-g…
SamuelSchlesinger Oct 31, 2026
9e5bd2b
Merge origin/main into claude/t2-described-leaf
SamuelSchlesinger Oct 31, 2026
5280f8c
feat(circuit/frontier): native recovery is polynomial-time
SamuelSchlesinger Oct 31, 2026
87ee708
Merge remote-tracking branch 'origin/main' into claude/t2-packet-eval…
SamuelSchlesinger Oct 31, 2026
62dc6f5
feat(circuit/frontier): evaluate packet entries on coefficient lists …
SamuelSchlesinger Oct 31, 2026
6f54c2d
fix(circuit/frontier): terminal rewrites in twoVal_eq
SamuelSchlesinger Oct 31, 2026
04fe069
refactor(circuit/frontier): packet modes by dense index y0 * nb + b
SamuelSchlesinger Oct 31, 2026
3615494
Merge remote-tracking branch 'origin/claude/t2-described-galois' into…
SamuelSchlesinger Oct 31, 2026
b1ee3e5
feat(circuit/frontier): the value table of native recovery
SamuelSchlesinger Oct 31, 2026
2bfdbb3
feat(PolyTime): the kernel of reduction A_N → A_n is 2^n A_N
SamuelSchlesinger Oct 31, 2026
5317b59
feat(circuit/frontier): coefficient extraction as a stack recursion
SamuelSchlesinger Oct 31, 2026
3130c30
refactor(circuit/frontier): take the number of slots L as a parameter…
SamuelSchlesinger Oct 31, 2026
44c05e5
Merge branch 'claude/t2-packet-evaluator' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
1454915
fix(circuit/frontier): mode terms vanish when a packet has no exponents
SamuelSchlesinger Oct 31, 2026
7aed491
Merge branch 'claude/t2-packet-evaluator' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
f3be9f4
feat(combinatorics): enumerate the tuples of bounded weight with a su…
SamuelSchlesinger Oct 31, 2026
bd3e539
feat(PolyTime): the successor of a tuple of bounded weight in polynom…
SamuelSchlesinger Oct 31, 2026
fb6f83d
feat(circuit/frontier): the native packet evaluator in time exp(O(L l…
SamuelSchlesinger Oct 31, 2026
e03f0ce
feat(circuit/frontier): descriptors of packet vertices and their nati…
SamuelSchlesinger Oct 31, 2026
8e9725b
Merge remote-tracking branch 'origin/main' into claude/t2-packet-eval…
SamuelSchlesinger Oct 31, 2026
5736072
chore: regenerate Complexity.lean after merging main
SamuelSchlesinger Oct 31, 2026
1b2f892
Merge branch 'claude/t2-packet-evaluator' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
74a464e
chore: regenerate Complexity.lean after merging the base
SamuelSchlesinger Oct 31, 2026
0e967bc
Merge branch 'claude/t2-coeff-scheme' into claude/t2-packet-terms
SamuelSchlesinger Oct 31, 2026
4f29528
feat(circuit/frontier): the cursor over the children of an active call
SamuelSchlesinger Oct 31, 2026
af142d1
refactor(combinatorics): count the feasible coordinate values with Ma…
SamuelSchlesinger Oct 31, 2026
92a90ac
Merge branch 'claude/t2-budget-tuples' into claude/t2-child-cursor
SamuelSchlesinger Oct 31, 2026
8daeef7
feat(circuit/frontier): the values a call stores along the cursor
SamuelSchlesinger Oct 31, 2026
207d29d
feat(circuit/frontier): the stored values are the sums over the mode …
SamuelSchlesinger Oct 31, 2026
956e30a
feat(circuit/frontier): vertex descriptors and the entries of native …
SamuelSchlesinger Oct 31, 2026
dec0329
Merge remote-tracking branch 'origin/main' into claude/t2-native-child
SamuelSchlesinger Oct 31, 2026
a82e654
Merge remote-tracking branch 'origin/main' into claude/t2-instance
SamuelSchlesinger Oct 31, 2026
dd7ddec
Merge remote-tracking branch 'origin/claude/t2-child-cursor' into cla…
SamuelSchlesinger Oct 31, 2026
6c7d419
Merge remote-tracking branch 'origin/claude/t2-recovery-store' into c…
SamuelSchlesinger Oct 31, 2026
7e456fc
Merge remote-tracking branch 'origin/claude/t2-schedule-count' into c…
SamuelSchlesinger Oct 31, 2026
0da975a
chore: regenerate Complexity.lean after merges
SamuelSchlesinger Oct 31, 2026
1f4a846
Merge origin/main into claude/t2-schedule-count
SamuelSchlesinger Oct 31, 2026
ef0982e
refactor(circuit/frontier): share the port/descriptor record between …
SamuelSchlesinger Oct 31, 2026
d18d15f
test(circuit/frontier): name IsRowsFirstBipartite explicitly on an an…
SamuelSchlesinger Oct 31, 2026
88ddd69
refactor(circuit/frontier): number packet modes with Mathlib's finPro…
SamuelSchlesinger Oct 31, 2026
3b4d836
Merge origin/main into claude/t2-child-cursor
SamuelSchlesinger Oct 31, 2026
bd4bf8e
Merge branch 'claude/t2-packet-evaluator' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
21e70d1
Merge branch 'claude/t2-described-galois' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
bd6a6a6
feat(GenericRAM/Native): derivations of stack recursions from recursi…
SamuelSchlesinger Oct 31, 2026
9bc99e7
Merge branch 'claude/t2-coeff-scheme' into claude/t2-packet-terms
SamuelSchlesinger Oct 31, 2026
9f36eb7
Merge branch 'claude/t2-stack-tree' into claude/t2-instance
SamuelSchlesinger Oct 31, 2026
30bb409
refactor(circuit/frontier): read packet exponents at finProdFinEquiv …
SamuelSchlesinger Oct 31, 2026
1268016
Merge branch 'claude/t2-packet-terms' into claude/t2-assembly
SamuelSchlesinger Oct 31, 2026
a74e6d0
refactor(circuit/frontier): read packet exponents at finProdFinEquiv …
SamuelSchlesinger Oct 31, 2026
1d440fa
feat(GenericRAM/Native): derivations by well-founded recursion; Descr…
SamuelSchlesinger Oct 31, 2026
df3a3bf
Merge remote-tracking branch 'origin/main' into claude/t2-instance
SamuelSchlesinger Oct 31, 2026
149edec
Merge remote-tracking branch 'origin/claude/t2-child-cursor' into cla…
SamuelSchlesinger Oct 31, 2026
f7de400
Merge remote-tracking branch 'origin/claude/t2-schedule-count' into c…
SamuelSchlesinger Oct 31, 2026
4bfc713
wip: described lift and native child (in progress)
SamuelSchlesinger Oct 31, 2026
77b3193
Merge remote-tracking branch 'origin/main' into claude/t2-native-child
SamuelSchlesinger Oct 31, 2026
b585eeb
Merge branch 'claude/t2-described-leaf' into claude/t2-described-galois
SamuelSchlesinger Oct 31, 2026
766fca0
Merge remote-tracking branch 'origin/main' into claude/t2-described-g…
SamuelSchlesinger Oct 31, 2026
cd930a8
Merge remote-tracking branch 'origin/main' into claude/t2-packet-eval…
SamuelSchlesinger Oct 31, 2026
f5bd48c
Merge branch 'claude/t2-packet-evaluator' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
2689826
Merge branch 'claude/t2-described-galois' into claude/t2-coeff-scheme
SamuelSchlesinger Oct 31, 2026
470d392
feat(circuit/frontier): the native contraction recursion as a stack r…
SamuelSchlesinger Oct 31, 2026
69dc8fb
Merge branch 'claude/t2-coeff-scheme' into claude/t2-packet-terms
SamuelSchlesinger Oct 31, 2026
1e77f7d
Merge branch 'claude/t2-packet-terms' into claude/t2-assembly
SamuelSchlesinger Oct 31, 2026
babef77
chore: regenerate Complexity.lean after merging the base
SamuelSchlesinger Oct 31, 2026
e280400
feat(circuit/frontier): the native machine of the fast contraction al…
SamuelSchlesinger Oct 31, 2026
09b118e
Merge remote-tracking branch 'origin/claude/t2-assembly' into claude/…
SamuelSchlesinger Oct 31, 2026
3e3b6bf
Merge #1952's review fixes; adapt to ExplicitTensorNetwork = Describe…
SamuelSchlesinger Oct 31, 2026
5e15a84
feat(circuit/frontier): native child networks and their contraction (…
SamuelSchlesinger Oct 31, 2026
215d85d
feat(circuit/frontier): the call count with a constant explicit in C …
SamuelSchlesinger Oct 31, 2026
6888efe
feat(Classes/CountingSimulation): the guard of the fast contraction a…
SamuelSchlesinger Oct 31, 2026
4daaf46
feat(circuit/frontier): one native active call is correct when its st…
SamuelSchlesinger Oct 31, 2026
8855b0c
Merge remote-tracking branch 'origin/claude/t2-assembly' into claude/…
SamuelSchlesinger Oct 31, 2026
121d56d
chore: adapt to the shared described-network record and finProdFinEqu…
SamuelSchlesinger Oct 31, 2026
57709b8
test(circuit/frontier): native child on a tiny network
SamuelSchlesinger Oct 31, 2026
af0bb03
wip: fast machine resources scaffolding
SamuelSchlesinger Oct 31, 2026
9d3c390
feat(circuit/frontier): the native child is rows-first
SamuelSchlesinger Oct 31, 2026
d1ca4a0
style(circuit/frontier): wrap long lines and pin flexible simps in th…
SamuelSchlesinger Oct 31, 2026
211d01d
feat(Classes/CountingSimulation): the fast machine within the interfa…
SamuelSchlesinger Oct 31, 2026
455906c
feat(Classes/CountingSimulation): the contraction algorithm from the …
SamuelSchlesinger Oct 31, 2026
7b8cc9b
feat(circuit/frontier): the modulus is irreducible modulo 2; tests of…
SamuelSchlesinger Oct 31, 2026
63c56cc
feat(Classes/CountingSimulation): the guard of the fast algorithm is …
SamuelSchlesinger Oct 31, 2026
21b7ab8
feat(circuit/frontier): the values stored by an active call, at each …
SamuelSchlesinger Oct 31, 2026
c6c8f64
feat(circuit/frontier): an active call has at least 64^a edges
SamuelSchlesinger Oct 31, 2026
0275abb
Merge remote-tracking branch 'origin/claude/t2-native-child' into cla…
SamuelSchlesinger Oct 31, 2026
6668fe1
feat(circuit/frontier): the step of the native recursion is correct, …
SamuelSchlesinger Oct 31, 2026
a180db5
feat(Classes/CountingSimulation): the contraction algorithm from the …
SamuelSchlesinger Oct 31, 2026
8081ab9
feat(circuit/frontier): binary-digit points have lifts with unit diff…
SamuelSchlesinger Oct 31, 2026
5d0a92d
feat(circuit/frontier): the native child in polynomial time, and its …
SamuelSchlesinger Oct 31, 2026
0906c9c
refactor(circuit/frontier): one rows-first predicate on described net…
SamuelSchlesinger Oct 31, 2026
8bd4f74
doc(circuit/frontier): keep the rows-first bullet's first line
SamuelSchlesinger Oct 31, 2026
408395f
doc(circuit/frontier): docstrings of the betaSlice lemmas
SamuelSchlesinger Oct 31, 2026
7327607
Merge remote-tracking branch 'origin/claude/t2-native-polytime' into …
SamuelSchlesinger Oct 31, 2026
6ba1ca3
feat(circuit/frontier): the components of the native contraction recu…
SamuelSchlesinger Oct 31, 2026
0450bd2
Merge #1967 (claude/t2-native-child) into claude/t2-native-polytime
SamuelSchlesinger Oct 31, 2026
27756a5
Merge #1973 (claude/t2-native-polytime) into claude/t2-instance
SamuelSchlesinger Oct 31, 2026
ad3df99
fix(Classes/CountingSimulation): unfold the unified rows-first predic…
SamuelSchlesinger Oct 31, 2026
1fa7791
doc(circuit/frontier): restore the exact quotation of the child edge …
SamuelSchlesinger Oct 31, 2026
43f5dd2
Merge origin/main into claude/t2-instance
SamuelSchlesinger Oct 31, 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
9 changes: 9 additions & 0 deletions Complexity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -921,12 +921,20 @@ public import Complexity.Computability.Circuit.Frontier.TensorNetwork.CoeffSchem
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.Constraint
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.Deformation
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.DescribedContraction
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.DescribedLift
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.DirectContraction
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.Explicit
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.FastContraction
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.FastContractionMachine
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.FastContractionPolyTime
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.FastContractionStep
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.IntegralCoordinates
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.KernelProduct
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.LocalDeformation
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.ModeExpansion
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.NativeCall
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.NativeChild
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.NativeChildPolyTime
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.NativeRecovery
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.PacketEntry
public import Complexity.Computability.Circuit.Frontier.TensorNetwork.PacketEvaluator
Expand Down Expand Up @@ -1127,6 +1135,7 @@ public import Complexity.Computability.Complexity.Classes.CountingSimulation.Adm
public import Complexity.Computability.Complexity.Classes.CountingSimulation.Assembly
public import Complexity.Computability.Complexity.Classes.CountingSimulation.BlockNetworks
public import Complexity.Computability.Complexity.Classes.CountingSimulation.Containments
public import Complexity.Computability.Complexity.Classes.CountingSimulation.FastAlgorithm
public import Complexity.Computability.Complexity.Classes.CountingSimulation.Guarded
public import Complexity.Computability.Complexity.Classes.CountingSimulation.Interfaces
public import Complexity.Computability.Complexity.Classes.DP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module
-- upstream: candidate

public import Complexity.Computability.Circuit.Frontier.TensorNetwork.Explicit
public import Complexity.Computability.GenericRAM.Native.StackRecursion
public import Complexity.Computability.GenericRAM.Native.StackRecursionTree
public import Complexity.Computability.PolyTime.GaloisRingArithmetic
public import Complexity.Foundations.Data.BitString.List.Binary
public import Complexity.Computability.Machines.Turing.MultiTape.Encodings.Words
Expand Down Expand Up @@ -83,8 +83,6 @@ contraction algorithm, with implicit packet tensors as descriptors.

## Main results

* `Cslib.GenericRAM.StackRecursion.Scheme.Loop.counted`: a call whose children are indexed by
a counter.
* `Cslib.Circuits.Frontier.DescribedNetwork.eval_sumRoot`: direct summation evaluates to
`sumValue`, with `2 ^ m (k + 1) + 1` nodes and two open calls.
* `Cslib.Circuits.Frontier.SumOps.IsHom.map_sumValue`: under a homomorphism, the value is the
Expand All @@ -100,43 +98,6 @@ contraction algorithm, with implicit packet tensors as descriptors.

@[expose] public section

namespace Cslib.GenericRAM.StackRecursion.Scheme

open Finset

variable {X A Y : Type} {R : Scheme X A Y} {I : Invariant X A Y}

/-- **A call with counted children.** If, from the accumulators `acc c`, the call `x` asks for the
children `child c` for `c < bound` and then stops, and the children evaluate to `val c`, then its
loop from `acc 0` ends at `acc bound`, with the children's nodes and at most `H` levels. -/
theorem Loop.counted {x : X} {acc : ℕ → A} {child : ℕ → X} {val : ℕ → Y} {nodes height : ℕ → ℕ}
(bound H : ℕ) (hnext : ∀ c < bound, R.next x (acc c) = some (child c))
(hdone : R.next x (acc bound) = none)
(habsorb : ∀ c < bound, R.absorb x (acc c) (val c) = acc (c + 1))
(heval : ∀ c < bound, R.Eval I (child c) (val c) (nodes c) (height c))
(hframe : ∀ c < bound, I.frame x (acc c)) (hH : ∀ c < bound, height c ≤ H) :
∃ h ≤ H, R.Loop I x (acc 0) (acc bound) (∑ c ∈ range bound, nodes c) h := by
-- From any start `s ≤ bound`.
have key : ∀ k s, s + k = bound →
∃ h ≤ H, R.Loop I x (acc s) (acc bound) (∑ c ∈ Ico s bound, nodes c) h := by
intro k
induction k with
| zero =>
intro s hs
subst hs
exact ⟨0, Nat.zero_le _, by simpa using Loop.done hdone⟩
| succ k ih =>
intro s hs
obtain ⟨h, hh, hl⟩ := ih (s + 1) (by omega)
have hs' : s < bound := by omega
have hl' := Loop.child (hframe s hs') (hnext s hs') (heval s hs')
(by rw [habsorb s hs']; exact hl)
refine ⟨max (height s) h, max_le (hH s hs') hh, ?_⟩
rwa [sum_eq_sum_Ico_succ_bot hs']
simpa using key bound 0 (by omega)

end Cslib.GenericRAM.StackRecursion.Scheme

namespace Cslib.Circuits.Frontier

open Finset Cslib.BitString Cslib.GenericRAM Cslib.GenericRAM.StackRecursion Turing.MultiTapeTM
Expand Down
Loading
Loading