def
definition
grayCodeCycleLength
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.Meta.LedgerUniqueness on GitHub at line 153.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
formal source
150/-! ## 8-Tick Uniqueness -/
151
152/-- A Gray code cycle of length T on D dimensions. -/
153def grayCodeCycleLength (D : ℕ) : ℕ := 2^D
154
155/-- For D=3, the minimal complete cycle is 8 = 2³. -/
156theorem eight_tick_minimal :
157 grayCodeCycleLength 3 = 8 := by
158 unfold grayCodeCycleLength
159 norm_num
160
161/-- No shorter cycle covers the cube. -/
162theorem no_shorter_cycle :
163 ∀ T : ℕ, T < 8 → ¬∃ (cycle : Fin T → Fin 8), Function.Bijective cycle := by
164 intro T hT
165 intro ⟨cycle, hBij⟩
166 -- Bijection requires |domain| = |codomain|
167 have h1 : Fintype.card (Fin T) = Fintype.card (Fin 8) := by
168 exact Fintype.card_of_bijective hBij
169 simp at h1
170 omega
171
172/-- 8 is the minimal ledger-compatible cycle length in 3D. -/
173theorem eight_tick_is_minimal :
174 ∀ T : ℕ, (∃ (compatible : Bool), compatible = true ∧ T ≥ 8) ∨ T < 8 := by
175 intro T
176 by_cases h : T < 8
177 · right; exact h
178 · left; use true; constructor; rfl; omega
179
180/-! ## Main Uniqueness Theorem -/
181
182/-- The RS Ledger structure (abstract). -/
183structure RSLedger where