Principal declarations
theorem PriorityEncoder.encode_correct
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 67–107) · file SHA-256 1be04943f5455fc1… Axioms reported by the fresh build: propext, Quot.sound
PRIORITY-ENCODER CORRECTNESS, for every input assignment: the binary output decodes
to exactly the selection readout (first true flag, value bits), and to `none` when
the readout is invalid or no flag is true.
Statement as elaborated and printed by Lean 4.26.0
∀ (R : NimAudit.CorrBridge.RCirc) (N r : ℕ),
R.sel.length = N →
N ≤ 2 ^ r →
∀ (z : ℕ → Bool),
NimAudit.PriorityEncoder.binSem (NimAudit.PriorityEncoder.encode R N r) N z =
NimAudit.SelectCircuit.selReadout R z
Exact source text, lines 67–107
67/-- PRIORITY-ENCODER CORRECTNESS, for every input assignment: the binary output decodes68 to exactly the selection readout (first true flag, value bits), and to `none` when69 the readout is invalid or no flag is true. -/70theorem encode_correct (R : RCirc) (N r : Nat) (hlen : R.sel.length = N) (hr : N ≤ 2 ^ r)71 (z : Nat → Bool) : binSem (encode R N r) N z = selReadout R z := by72 unfold binSem selReadout encode73 simp only74 by_cases hv : eval z R.valid = true75 · cases hft : firstTrue (R.sel.map (eval z)) with76 | none =>77 have hany : (R.sel.map (eval z)).any id = false := by78 have := firstTrue_isSome (R.sel.map (eval z)); rw [hft] at this; simpa using this.symm79 have hor : eval z (or ((List.range N).map (getC R.sel))) = false := by80 rw [eval_or, List.any_map]81 have e : ((List.range N).any (eval z ∘ getC R.sel)) = (R.sel.map (eval z)).any id := by82 rw [← flags_eq R.sel N hlen z, List.any_map]; rfl83 rw [e, hany]84 simp [hv, hor]85 | some i =>86 have hiN : i < N := by have := firstTrue_lt hft; simpa [hlen] using this87 have hflag : (R.sel.map (eval z)).getD i false = true := ((firstTrue_some_iff _ i).1 hft).2.188 have hor : eval z (or ((List.range N).map (getC R.sel))) = true := by89 rw [eval_or, List.any_map]90 apply List.any_eq_true.mpr91 exact ⟨i, List.mem_range.mpr hiN, by simp only [Function.comp_apply, eval_getC]; exact hflag⟩92 have hidx : toNatBE (((List.range r).map (idxBit R.sel N r)).map (eval z)) = i := by93 rw [List.map_map]94 apply toNatBE_of_bits (Nat.lt_of_lt_of_le hiN hr)95 intro q _96 simp only [Function.comp_apply]97 apply Bool.eq_iff_iff.mpr98 simp only [idxBit, eval_or, List.any_map, List.any_eq_true, List.mem_filter, List.mem_range,99 Function.comp_apply]100 constructor101 · rintro ⟨i', ⟨hi', hb⟩, he⟩102 rw [firstF_eval R.sel hlen z hi', hft, decide_eq_true_iff] at he103 cases he; exact hb104 · intro hb105 exact ⟨i, ⟨hiN, hb⟩, by rw [firstF_eval R.sel hlen z hiN, hft]; simp⟩106 simp only [eval_and, List.all_cons, List.all_nil, hv, hor, Bool.and_true, if_true, hidx, hiN]107 · simp [hv]
Project declarations in the statement: AC0.Circ, CorrBridge.RCirc, CorrBridge.RCirc.sel, PriorityEncoder.binSem, PriorityEncoder.encode, SelectCircuit.selReadout
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.eval, AC0.Circ.eval_and, AC0.Circ.eval_or, AC0.Circ.or, AttainCircuit.firstTrue_lt, AttainCircuit.toNatBE_of_bits, BinReadout.BCirc.idx, BinReadout.BCirc.mk, BinReadout.BCirc.val, BinReadout.BCirc.valid, Bridge.toNatBE, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, CorrBridge.eval_getC, CorrBridge.firstTrue, CorrBridge.firstTrue_some_iff, CorrBridge.getC, PriorityEncoder.binSem, PriorityEncoder.encode, PriorityEncoder.firstF, PriorityEncoder.firstF_eval, PriorityEncoder.flags_eq, PriorityEncoder.idxBit, SelectCircuit.firstTrue_isSome, SelectCircuit.selReadout
theorem PriorityEncoder.encode_bound
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 131–200) · file SHA-256 1be04943f5455fc1… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound
ENCODER RESOURCES: from source formulas of depth ≤ D, size ≤ S on inputs below M,
every output formula has depth ≤ D + 3, size ≤ 4·((N+2)(S+2))^3 and inputs below M.
Statement as elaborated and printed by Lean 4.26.0
∀ (R : NimAudit.CorrBridge.RCirc) {N B r D S M : ℕ},
R.sel.length = N →
R.val.length = B →
N ≤ 2 ^ r →
(∀ c ∈ R.valid :: (R.sel ++ R.val), c.depth ≤ D ∧ c.size ≤ S ∧ c.maxInput ≤ M) →
NimAudit.PriorityEncoder.BinBound (NimAudit.PriorityEncoder.encode R N r) N B r (D + 3)
(4 * ((N + 2) * (S + 2)) ^ 3) M
Exact source text, lines 131–200
131/-- ENCODER RESOURCES: from source formulas of depth ≤ D, size ≤ S on inputs below M,132 every output formula has depth ≤ D + 3, size ≤ 4·((N+2)(S+2))^3 and inputs below M. -/133theorem encode_bound (R : RCirc) {N B r D S M : Nat} (hlen : R.sel.length = N) (hvl : R.val.length = B)134 (hr : N ≤ 2 ^ r)135 (hall : ∀ c ∈ R.valid :: (R.sel ++ R.val), depth c ≤ D ∧ size c ≤ S ∧ maxInput c ≤ M) :136 BinBound (encode R N r) N B r (D + 3) (4 * ((N + 2) * (S + 2)) ^ 3) M := by137 generalize hU : (N + 2) * (S + 2) = U138 have hNU : N + 2 ≤ U := by139 rw [← hU]; exact Nat.le_mul_of_pos_right (N + 2) (by omega)140 have hSU : S + 2 ≤ U := by141 rw [← hU]; exact Nat.le_mul_of_pos_left (S + 2) (by omega)142 have hU1 : 1 ≤ U := by omega143 have hsel : ∀ i < N, depth (getC R.sel i) ≤ D ∧ size (getC R.sel i) ≤ S ∧ maxInput (getC R.sel i) ≤ M :=144 fun i hi => hall _ (by simp [getC_mem (show i < R.sel.length by omega)])145 have hsel1 : ∀ i < N, size (getC R.sel i) ≤ 1 * U ^ 1 := fun i hi => by146 have := (hsel i hi).2.1; simp; omega147 have hF : ∀ i < N, depth (firstF R.sel i) ≤ D + 2 ∧ size (firstF R.sel i) ≤ 3 * U ^ 2 ∧148 maxInput (firstF R.sel i) ≤ M := by149 intro i hi150 refine ⟨dp_firstC (fun i' hi' => (hsel i' (by omega)).1),151 sz_firstC hU1 (by omega) (fun i' hi' => hsel1 i' (by omega)),152 mx_firstC (fun i' hi' => (hsel i' (by omega)).2.2)⟩153 refine ⟨by simp [encode], by simp [encode, hvl], hr, ?_⟩154 intro c hc155 simp only [encode, List.mem_cons, List.mem_append, List.mem_map, List.mem_range] at hc156 rcases hc with rfl | ⟨q, _, rfl⟩ | hcv157 · -- validity158 have hv := hall R.valid (by simp)159 refine ⟨?_, ?_, ?_⟩160 · apply depth_and_le; intro c hc161 simp only [List.mem_cons, List.mem_singleton, List.not_mem_nil, or_false] at hc162 rcases hc with rfl | rfl163 · omega164 · apply depth_or_le; intro c hc165 obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hc166 have := (hsel i (List.mem_range.mp hi)).1; omega167 · apply size_and_le hU1 (by simp; omega)168 intro c hc169 simp only [List.mem_cons, List.mem_singleton, List.not_mem_nil, or_false] at hc170 rcases hc with rfl | rfl171 · exact lift1 hU1 (show size R.valid ≤ 1 * U ^ 1 by simp; omega) (by omega) (by omega)172 · exact lift1 hU1 (size_or_le hU1 (by simp; omega) (fun c hc => by173 obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hc; exact hsel1 i (List.mem_range.mp hi)))174 (by omega) (by omega)175 · apply ControllerBits.maxInput_and_le; intro c hc176 simp only [List.mem_cons, List.mem_singleton, List.not_mem_nil, or_false] at hc177 rcases hc with rfl | rfl178 · exact hv.2.2179 · apply ControllerBits.maxInput_or_le; intro c hc180 obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hc181 exact (hsel i (List.mem_range.mp hi)).2.2182 · -- index bit q183 refine ⟨?_, ?_, ?_⟩184 · unfold idxBit; apply depth_or_le; intro c hc185 obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hc186 exact (hF i (List.mem_range.mp (List.mem_filter.mp hi).1)).1187 · unfold idxBit188 apply size_or_le hU1 (by189 have := List.length_filter_le (fun i => i.testBit (r - 1 - q)) (List.range N)190 simp only [List.length_map, List.length_range] at this ⊢; omega)191 intro c hc192 obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hc193 exact (hF i (List.mem_range.mp (List.mem_filter.mp hi).1)).2.1194 · unfold idxBit; apply ControllerBits.maxInput_or_le; intro c hc195 obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hc196 exact (hF i (List.mem_range.mp (List.mem_filter.mp hi).1)).2.2197 · -- value bit (unchanged)198 have h := hall c (by simp [hcv])199 refine ⟨by omega, ?_, h.2.2⟩200 exact lift1 hU1 (show size c ≤ 1 * U ^ 1 by simp; omega) (by omega) (by omega)
Project declarations in the statement: AC0.Circ, AC0.Circ.depth, AC0.Circ.maxInput, AC0.Circ.size, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, PriorityEncoder.BinBound, PriorityEncoder.encode
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.depth, AC0.Circ.maxInput, AC0.Circ.or, AC0.Circ.size, BinReadout.BCirc.idx, BinReadout.BCirc.val, BinReadout.BCirc.valid, BinReadout.getC_mem, ControllerBits.maxInput_and_le, ControllerBits.maxInput_or_le, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, CorrBridge.depth_and_le, CorrBridge.depth_or_le, CorrBridge.getC, CorrBridge.size_and_le, CorrBridge.size_or_le, PriorityEncoder.BinBound.mk, PriorityEncoder.encode, PriorityEncoder.firstF, PriorityEncoder.idxBit, SelectCircuit.dp_firstC, SelectCircuit.lift1, SelectCircuit.mx_firstC, SelectCircuit.sz_firstC
theorem PriorityEncoder.encode_noflag
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 342–348) · file SHA-256 1be04943f5455fc1… Axioms reported by the fresh build: propext, Quot.sound
No true candidate flag: no move (even if the source valid flag is true).
Statement as elaborated and printed by Lean 4.26.0
∀ (R : NimAudit.CorrBridge.RCirc) (N r : ℕ),
R.sel.length = N →
∀ (z : ℕ → Bool),
(∀ i < N, NimAudit.AC0.Circ.eval z (NimAudit.CorrBridge.getC R.sel i) = false) →
NimAudit.PriorityEncoder.binSem (NimAudit.PriorityEncoder.encode R N r) N z = none
Exact source text, lines 342–348
342/-- No true candidate flag: no move (even if the source valid flag is true). -/343theorem encode_noflag (R : RCirc) (N r : Nat) (hlen : R.sel.length = N) (z : Nat → Bool)344 (hno : ∀ i < N, eval z (getC R.sel i) = false) : binSem (encode R N r) N z = none := by345 have hor : eval z (or ((List.range N).map (getC R.sel))) = false := by346 rw [eval_or, List.any_map]; apply List.any_eq_false.mpr347 intro i hi; simpa using hno i (List.mem_range.mp hi)348 simp [binSem, encode, hor]
Project declarations in the statement: AC0.Circ, AC0.Circ.eval, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.getC, PriorityEncoder.binSem, PriorityEncoder.encode
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.eval, AC0.Circ.eval_and, AC0.Circ.eval_or, AC0.Circ.or, BinReadout.BCirc.idx, BinReadout.BCirc.val, BinReadout.BCirc.valid, Bridge.toNatBE, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.valid, CorrBridge.getC, PriorityEncoder.encode
theorem PriorityEncoder.encode_least
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 350–361) · file SHA-256 1be04943f5455fc1… Axioms reported by the fresh build: propext, Quot.sound
Several true flags: the encoded index is the least true one.
Statement as elaborated and printed by Lean 4.26.0
∀ (R : NimAudit.CorrBridge.RCirc) (N r : ℕ),
R.sel.length = N →
N ≤ 2 ^ r →
∀ (z : ℕ → Bool),
NimAudit.AC0.Circ.eval z R.valid = true →
∀ {i : ℕ},
i < N →
NimAudit.AC0.Circ.eval z (NimAudit.CorrBridge.getC R.sel i) = true →
(∀ k < i, NimAudit.AC0.Circ.eval z (NimAudit.CorrBridge.getC R.sel k) = false) →
NimAudit.PriorityEncoder.binSem (NimAudit.PriorityEncoder.encode R N r) N z =
some (i, NimAudit.Bridge.toNatBE (List.map (NimAudit.AC0.Circ.eval z) R.val))
Exact source text, lines 350–361
350/-- Several true flags: the encoded index is the least true one. -/351theorem encode_least (R : RCirc) (N r : Nat) (hlen : R.sel.length = N) (hr : N ≤ 2 ^ r) (z : Nat → Bool)352 (hv : eval z R.valid = true) {i : Nat} (hi : i < N) (hti : eval z (getC R.sel i) = true)353 (hlow : ∀ k < i, eval z (getC R.sel k) = false) :354 binSem (encode R N r) N z = some (i, toNatBE (R.val.map (eval z))) := by355 rw [encode_correct R N r hlen hr z]356 have hft : firstTrue (R.sel.map (eval z)) = some i := by357 rw [firstTrue_some_iff]358 refine ⟨by simp [hlen, hi], ?_, ?_⟩359 · rw [← eval_getC]; exact hti360 · intro k hk; rw [← eval_getC]; exact hlow k hk361 simp [selReadout, hv, hft]
Project declarations in the statement: AC0.Circ, AC0.Circ.eval, Bridge.toNatBE, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, CorrBridge.getC, PriorityEncoder.binSem, PriorityEncoder.encode
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.eval, Bridge.toNatBE, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, CorrBridge.eval_getC, CorrBridge.firstTrue, CorrBridge.firstTrue_some_iff, CorrBridge.getC, PriorityEncoder.binSem, PriorityEncoder.encode, PriorityEncoder.encode_correct, SelectCircuit.selReadout
theorem PriorityEncoder.encode_zero
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 363–366) · file SHA-256 1be04943f5455fc1… Axioms reported by the fresh build: propext, Quot.sound
N = 0: never a move, for any index width.
Statement as elaborated and printed by Lean 4.26.0
∀ (R : NimAudit.CorrBridge.RCirc) (r : ℕ),
R.sel.length = 0 →
∀ (z : ℕ → Bool),
NimAudit.PriorityEncoder.binSem (NimAudit.PriorityEncoder.encode R 0 r) 0 z = none
Exact source text, lines 363–366
363/-- N = 0: never a move, for any index width. -/364theorem encode_zero (R : RCirc) (r : Nat) (hlen : R.sel.length = 0) (z : Nat → Bool) :365 binSem (encode R 0 r) 0 z = none :=366 encode_noflag R 0 r hlen z (fun i hi => absurd hi (by omega))
Project declarations in the statement: AC0.Circ, CorrBridge.RCirc, CorrBridge.RCirc.sel, PriorityEncoder.binSem, PriorityEncoder.encode
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.eval, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.getC, PriorityEncoder.encode_noflag
theorem PriorityEncoder.encode_one
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 368–371) · file SHA-256 1be04943f5455fc1… Axioms reported by the fresh build: propext, Quot.sound
N = 1 with zero index width (r = 0): the index list is empty and decodes to 0.
Statement as elaborated and printed by Lean 4.26.0
∀ (R : NimAudit.CorrBridge.RCirc),
R.sel.length = 1 →
∀ (z : ℕ → Bool),
(NimAudit.PriorityEncoder.encode R 1 0).idx = [] ∧
NimAudit.PriorityEncoder.binSem (NimAudit.PriorityEncoder.encode R 1 0) 1 z =
NimAudit.SelectCircuit.selReadout R z
Exact source text, lines 368–371
368/-- N = 1 with zero index width (r = 0): the index list is empty and decodes to 0. -/369theorem encode_one (R : RCirc) (hlen : R.sel.length = 1) (z : Nat → Bool) :370 (encode R 1 0).idx = [] ∧ binSem (encode R 1 0) 1 z = selReadout R z :=371 ⟨rfl, encode_correct R 1 0 hlen (by decide) z⟩
Project declarations in the statement: AC0.Circ, BinReadout.BCirc.idx, CorrBridge.RCirc, CorrBridge.RCirc.sel, PriorityEncoder.binSem, PriorityEncoder.encode, SelectCircuit.selReadout
Project declarations used by the proof or definition body
AC0.Circ, BinReadout.BCirc.idx, CorrBridge.RCirc, CorrBridge.RCirc.sel, PriorityEncoder.binSem, PriorityEncoder.encode, PriorityEncoder.encode_correct, SelectCircuit.selReadout
Definitions these statements use
def PriorityEncoder.encode
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 34–38) · file SHA-256 1be04943f5455fc1…
THE PRIORITY ENCODER.
Statement as elaborated and printed by Lean 4.26.0
NimAudit.CorrBridge.RCirc → ℕ → ℕ → NimAudit.BinReadout.BCirc
Exact source text, lines 34–38
34/-- THE PRIORITY ENCODER. -/35def encode (R : RCirc) (N r : Nat) : BCirc :=36 ⟨and [R.valid, or ((List.range N).map (getC R.sel))],37 (List.range r).map (idxBit R.sel N r),38 R.val⟩
Project declarations in the statement: BinReadout.BCirc, CorrBridge.RCirc
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.or, BinReadout.BCirc.mk, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, CorrBridge.getC, PriorityEncoder.idxBit
inductive AC0.Circ
Module Circuit
(lean/phase3/Circuit.lean, lines 35–40) · file SHA-256 af97cc0eec7d8464…
Statement as elaborated and printed by Lean 4.26.0
Type
Exact source text, lines 35–40
35inductive Circ where36 | input (i : Nat)37 | const (b : Bool)38 | not (c : Circ)39 | and (cs : List Circ)40 | or (cs : List Circ)
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
inductive CorrBridge.RCirc
Module NimCorrBridge
(lean/phase3/NimCorrBridge.lean, lines 34–37) · file SHA-256 d3fb2e4a64db3e92…
Statement as elaborated and printed by Lean 4.26.0
Type
Exact source text, lines 34–37
34structure RCirc where35 valid : Circ36 sel : List Circ37 val : List Circ
Project declarations in the statement: none
Project declarations used by the proof or definition body
AC0.Circ
def CorrBridge.RCirc.sel
Module NimCorrBridge
(lean/phase3/NimCorrBridge.lean, lines 36–36) · file SHA-256 d3fb2e4a64db3e92…
Statement as elaborated and printed by Lean 4.26.0
NimAudit.CorrBridge.RCirc → List NimAudit.AC0.Circ
Exact source text, lines 36–36
36 sel : List Circ
Project declarations in the statement: AC0.Circ, CorrBridge.RCirc
Project declarations used by the proof or definition body
CorrBridge.RCirc
def PriorityEncoder.binSem
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 40–47) · file SHA-256 1be04943f5455fc1…
Binary-format semantics on an arbitrary input vector (an index ≥ N is invalid);
on boards this is exactly `BinReadout.binReadoutOf`.
Statement as elaborated and printed by Lean 4.26.0
NimAudit.BinReadout.BCirc → ℕ → (ℕ → Bool) → Option (ℕ × ℕ)
Exact source text, lines 40–47
40/-- Binary-format semantics on an arbitrary input vector (an index ≥ N is invalid);41 on boards this is exactly `BinReadout.binReadoutOf`. -/42def binSem (S : BCirc) (N : Nat) (z : Nat → Bool) : Option (Nat × Nat) :=43 if eval z S.valid then44 if toNatBE (S.idx.map (eval z)) < N then45 some (toNatBE (S.idx.map (eval z)), toNatBE (S.val.map (eval z)))46 else none47 else none
Project declarations in the statement: BinReadout.BCirc
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.eval, BinReadout.BCirc, BinReadout.BCirc.idx, BinReadout.BCirc.val, BinReadout.BCirc.valid, Bridge.toNatBE
def SelectCircuit.selReadout
Module SelectCircuit
(lean/phase4/SelectCircuit.lean, lines 26–32) · file SHA-256 922ee44ce0ababa9…
Evaluation of a move readout on an arbitrary input vector.
Statement as elaborated and printed by Lean 4.26.0
NimAudit.CorrBridge.RCirc → (ℕ → Bool) → Option (ℕ × ℕ)
Exact source text, lines 26–32
26/-- Evaluation of a move readout on an arbitrary input vector. -/27def selReadout (R : RCirc) (z : Nat → Bool) : Option (Nat × Nat) :=28 if eval z R.valid then29 match firstTrue (R.sel.map (eval z)) with30 | some i => some (i, toNatBE (R.val.map (eval z)))31 | none => none32 else none
Project declarations in the statement: CorrBridge.RCirc
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.eval, Bridge.toNatBE, CorrBridge.RCirc, CorrBridge.RCirc.sel, CorrBridge.RCirc.val, CorrBridge.RCirc.valid, CorrBridge.firstTrue
def AC0.Circ.depth
Module Circuit
(lean/phase3/Circuit.lean, lines 61–66) · file SHA-256 af97cc0eec7d8464…
Statement as elaborated and printed by Lean 4.26.0
NimAudit.AC0.Circ → ℕ
Exact source text, lines 61–66
61def depth : Circ → Nat62 | input _ => 063 | const _ => 064 | not c => depth c + 165 | and cs => listMax (cs.attach.map (fun ⟨c, _⟩ => depth c)) + 166 | or cs => listMax (cs.attach.map (fun ⟨c, _⟩ => depth c)) + 1
Project declarations in the statement: AC0.Circ
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.casesOn, AC0.Circ.const, AC0.Circ.input, AC0.Circ.listMax, AC0.Circ.not, AC0.Circ.or, AC0.Circ.rec, AC0.Circ.rec_1
def AC0.Circ.maxInput
Module Circuit
(lean/phase3/Circuit.lean, lines 68–74) · file SHA-256 af97cc0eec7d8464…
One more than the largest input index used (0 if none).
Statement as elaborated and printed by Lean 4.26.0
NimAudit.AC0.Circ → ℕ
Exact source text, lines 68–74
68/-- One more than the largest input index used (0 if none). -/69def maxInput : Circ → Nat70 | input i => i + 171 | const _ => 072 | not c => maxInput c73 | and cs => listMax (cs.attach.map (fun ⟨c, _⟩ => maxInput c))74 | or cs => listMax (cs.attach.map (fun ⟨c, _⟩ => maxInput c))
Project declarations in the statement: AC0.Circ
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.casesOn, AC0.Circ.const, AC0.Circ.input, AC0.Circ.listMax, AC0.Circ.not, AC0.Circ.or, AC0.Circ.rec, AC0.Circ.rec_1
def AC0.Circ.size
Module Circuit
(lean/phase3/Circuit.lean, lines 51–56) · file SHA-256 af97cc0eec7d8464…
Statement as elaborated and printed by Lean 4.26.0
NimAudit.AC0.Circ → ℕ
Exact source text, lines 51–56
51def size : Circ → Nat52 | input _ => 153 | const _ => 154 | not c => size c + 155 | and cs => (cs.attach.map (fun ⟨c, _⟩ => size c)).sum + 156 | or cs => (cs.attach.map (fun ⟨c, _⟩ => size c)).sum + 1
Project declarations in the statement: AC0.Circ
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.casesOn, AC0.Circ.const, AC0.Circ.input, AC0.Circ.not, AC0.Circ.or, AC0.Circ.rec, AC0.Circ.rec_1
def CorrBridge.RCirc.val
Module NimCorrBridge
(lean/phase3/NimCorrBridge.lean, lines 37–37) · file SHA-256 d3fb2e4a64db3e92…
Statement as elaborated and printed by Lean 4.26.0
NimAudit.CorrBridge.RCirc → List NimAudit.AC0.Circ
Exact source text, lines 37–37
37 val : List Circ
Project declarations in the statement: AC0.Circ, CorrBridge.RCirc
Project declarations used by the proof or definition body
CorrBridge.RCirc
def CorrBridge.RCirc.valid
Module NimCorrBridge
(lean/phase3/NimCorrBridge.lean, lines 35–35) · file SHA-256 d3fb2e4a64db3e92…
Statement as elaborated and printed by Lean 4.26.0
NimAudit.CorrBridge.RCirc → NimAudit.AC0.Circ
Exact source text, lines 35–35
35 valid : Circ
Project declarations in the statement: AC0.Circ, CorrBridge.RCirc
Project declarations used by the proof or definition body
CorrBridge.RCirc
inductive PriorityEncoder.BinBound
Module PriorityEncoder
(lean/phase5/PriorityEncoder.lean, lines 111–116) · file SHA-256 1be04943f5455fc1…
Resource bounds for binary readout formulas on an arbitrary input support M.
Statement as elaborated and printed by Lean 4.26.0
NimAudit.BinReadout.BCirc → ℕ → ℕ → ℕ → ℕ → ℕ → ℕ → Prop
Exact source text, lines 111–116
111/-- Resource bounds for binary readout formulas on an arbitrary input support M. -/112structure BinBound (S : BCirc) (N B r D Sz M : Nat) : Prop where113 idx_len : S.idx.length = r114 val_len : S.val.length = B115 width : N ≤ 2 ^ r116 all : ∀ c ∈ S.valid :: (S.idx ++ S.val), depth c ≤ D ∧ size c ≤ Sz ∧ maxInput c ≤ M
Project declarations in the statement: BinReadout.BCirc
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.depth, AC0.Circ.maxInput, AC0.Circ.size, BinReadout.BCirc, BinReadout.BCirc.idx, BinReadout.BCirc.val, BinReadout.BCirc.valid
def AC0.Circ.eval
Module Circuit
(lean/phase3/Circuit.lean, lines 44–49) · file SHA-256 af97cc0eec7d8464…
Statement as elaborated and printed by Lean 4.26.0
(ℕ → Bool) → NimAudit.AC0.Circ → Bool
Exact source text, lines 44–49
44def eval (x : Nat → Bool) : Circ → Bool45 | input i => x i46 | const b => b47 | not c => !(eval x c)48 | and cs => cs.attach.all (fun ⟨c, _⟩ => eval x c)49 | or cs => cs.attach.any (fun ⟨c, _⟩ => eval x c)
Project declarations in the statement: AC0.Circ
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.and, AC0.Circ.casesOn, AC0.Circ.const, AC0.Circ.input, AC0.Circ.not, AC0.Circ.or, AC0.Circ.rec, AC0.Circ.rec_1
def CorrBridge.getC
Module NimCorrBridge
(lean/phase3/NimCorrBridge.lean, lines 87–87) · file SHA-256 d3fb2e4a64db3e92…
Statement as elaborated and printed by Lean 4.26.0
List NimAudit.AC0.Circ → ℕ → NimAudit.AC0.Circ
Exact source text, lines 87–87
87def getC (cs : List Circ) (i : Nat) : Circ := cs.getD i (const false)
Project declarations in the statement: AC0.Circ
Project declarations used by the proof or definition body
AC0.Circ, AC0.Circ.const
def Bridge.toNatBE
Module BitBridge
(lean/phase3/BitBridge.lean, lines 57–60) · file SHA-256 000644dc271d27f9…
Big-endian value of a bit list.
Statement as elaborated and printed by Lean 4.26.0
List Bool → ℕ
Exact source text, lines 57–60
57/-- Big-endian value of a bit list. -/58def toNatBE : List Bool → Nat59 | [] => 060 | b :: v => (if b then 2 ^ v.length else 0) + toNatBE v
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
def BinReadout.BCirc.idx
Module BinaryReadout
(lean/phase4/BinaryReadout.lean, lines 27–27) · file SHA-256 17ef1a62ba9edafb…
Statement as elaborated and printed by Lean 4.26.0
NimAudit.BinReadout.BCirc → List NimAudit.AC0.Circ
Exact source text, lines 27–27
27 idx : List Circ
Project declarations in the statement: AC0.Circ, BinReadout.BCirc
Project declarations used by the proof or definition body
BinReadout.BCirc
Full modules
Build evidence: fresh isolated rebuild of all 38 bundled modules with Lean (version 4.26.0, started 2026-10-10T15:21:56Z, finished 2026-10-10T15:27:00Z: 38/38 modules compiled, 1588 axiom reports, no errors. See Build for the commands and the independent audit of 2026-10-10 (dated evidence).