/-! # Audit 01 (Lean 4): Section 5.2 Finite-Dimensionality Audit for arXiv:2611.34924v1 Target claim: `C07` — V. Chandrasekaran, *An algebraic quantization of gravity from the null cone*, arXiv:2611.34924v1 (25 Nov 2026), Section 5.2 (pp. 38-45, Eqs. 5.30-5.38), Section 3.6 & Fig. 28 (p. 42), Appendix D.2 (pp. 70-73, Eqs. D.22-D.25), and Appendix E Condition 1. ## Scope (Layer 1 vs. Layer 2) This standalone Lean 4.36.0 module (zero external dependencies, zero `sorry`, `-DwarningAsError=true`, standard core axioms `{propext, Classical.choice, Quot.sound}` only) formalizes three distinct layers of results, with explicit types separating finite-list algebra from continuum operator translation: 1. **Part I — Cleared Finite-List Algebraic Core of Eqs. (D.25), (5.32), and (5.38):** - `BasisState` stores finite natural-number weights (`weight : Nat`) and nonnegative second moments (`weightedSqDev : Nat`) bounded by `w * ds^2` inside the area band `I` and `W * sMax^2` outside `I`. - `eq_D25_variance_bound`: integer-cleared finite-list variance inequality mirroring Eq. (D.25). - `eq_532_538_chained_nonpositive`: chains `eq_D25_variance_bound` taking the squared boost bound (Eq. 5.32) and our cleared transcription of the cycle-parameter inequality as explicit hypotheses to derive `2 * num - delta_eta * T <= 0`. - `conditional_finite_dim_if_unconditional_convergence`: finite-step `omega` contradiction showing integer partial sums `Z_k <= 0` cannot all lie within `eps < Z_uncut` of `Z_uncut`. - *Layer 2 boundary for Part I:* Translating real continuum spectral moments and Hilbert-space operators of App. D.2 into these cleared `Nat`-weighted records is an analytical Layer 2 step outside the Lean theorem statement. 2. **Part II — Finite-List Rank Bound Under Positive Lower Weight:** - `one_line_finiteness_from_trace_bound`: for any finite list `L : List BasisState` whose entries satisfy `0 < c <= st.weight` and `traceWeight L <= M`, proves `L.length <= M / c` directly. - *Layer 2 boundary for Part II:* Under Eq. (5.30c) (`C_b^dagger C_b >= c * 1 > 0`), applying this lemma to any orthonormal subset shows that once a finite closed trace `Tr(C_b^dagger C_b) <= M` (such as `Z[1] < infinity` from p. 42's cut-independence postulate + p. 43's finite uncut squared norm) is granted, `dim H_D <= M / c` already follows in one line without boosts, gravitons, or cycles. 3. **Part III — Standalone Lean 4 Counterexample Model on `Bool × Nat`:** - Basis: `BasisIdx := Bool × Nat`, with area `s(false, n) = 0` and `s(true, n) = 1`. - Weights: choosing `s_b = 3/2, sigma_s = 1` in Eq. (5.25) gives `C_b^dagger C_b = e^{-s} f_b(s) = e^{-9/8} * 1` on `s in {0, 1}` with `m_{b,D} = f_b(0) = e^{-9/8}`, satisfying EVERY inequality of Eq. (5.30c): `e^{-s_*} m_{b,D} * 1 <= m_{b,D} * tilde_rho_D <= C_b^dagger C_b <= e^{-s} * 1 <= 1` (setting `s_* = 3/2` also satisfies `s_b <= s_*` while preserving all bounds). We factor out the common positive scalar `e^{-9/8} > 0`. - Integer kernel representing doubled-space matrix elements (by hand calculation — no Hilbert space or operators are constructed inside Lean): `obsKernel(x, y) := -swapKernel(x, y)` represents the matrix elements of `O = -(S ⊗ S*)` (`||O|| = 1`), `boostSign(x) = (-1)^{s(x)}` represents `U_eta = 1 ⊗ e^{i pi s*}` (`eta = 2 pi^2`), `boostedObsKernel` is the boosted kernel, `deltaEtaKernel = boostedObsKernel - obsKernel`, and `xKernel = deltaEtaKernel - 1` (`delta_eta = 2` set explicitly). - We PROVE `deltaEtaKernel_eq_two_swap` and `cutAmplitude_eq_formula` showing that for EVERY duplicate-free basis subset `F` (`F.Nodup`), the double kernel sum `cutAmplitude F := sum_{x in F} sum_{y in F} xKernel x y` equals `4 * pairCount F - F.length` (representing `` for the unnormalized vector `|Psi_tilde_F> = sum_{x in F} |x> ⊗ |x*>`, distinct from Chandrasekaran's normalized `|Psi_P>` in Eq. D.22). - We prove `Nodup`, nesting/monotonicity (`E N ⊆ E (N + 1)`), and cofinality (`∀ x, ∃ N, x ∈ E N`) for **THREE** exhaustions of the same infinite basis `Bool × Nat`: 1. `pairedExhaustion N`: `cutAmplitude = +2N -> +infinity`. 2. `constPosExhaustion N`: `cutAmplitude = +2` (EXACT finite positive constant for all `N >= 1`). 3. `cycleR m` for ANY `m >= 4` (cycle length `r = m + 1 >= 5`, including `r = 40` where Eq. 5.32's exact-variance bound `2*pi / sqrt(40) < 1 = delta_eta / 2` holds, and `r >= 331` / `r >= 1227` where even Eq. D.25's looser upper bound drops below `1` for `s_* = 1` / `3/2`): for every duplicate-free `ks`, `cutAmplitude (ks.flatMap (cycleR m)) <= -((m - 3) * ks.length)`. **Layer 2 boundary:** On p. 42 (and Fig. 28 / App. E Condition 1), Chandrasekaran argues for cut-independence via diffeomorphism invariance ("closing this internal cut with C_b and both insertions fixed must reproduce the unnormalized amplitude on the uncut preparation (Section 3.6)") and p. 43 implicitly treats the uncut squared norm as finite. This `Bool × Nat` toy satisfies the finite-cut inequalities Eqs. (5.30c)–(5.37) and `Z_P[X] <= 0` of Eq. (5.38), has NO uncut amplitude `Z[X]` (omitting `0 < Z[X]` in Eq. 5.38), and does NOT test diffeomorphism invariance; it isolates that p. 43's appeal to Eq. (4.29) together with those finite-cut inequalities and strong convergence `P -> 1` does not supply convergence of the closed-cut partial sums, while Part II shows that granting a finite closed trace is already as strong as finite rank. Physical 4D dimension via other routes remains open (`T03`). -/ namespace Sec52Audit /-! ## Part I: Valid Conditional Core of Eqs. (D.25), (5.32), and (5.38) -/ structure BasisState where weight : Nat inBand : Bool weightedSqDev : Nat deriving Repr, DecidableEq def traceWeight : List BasisState → Nat | [] => 0 | st :: rest => st.weight + traceWeight rest def totalWeightedSqDev : List BasisState → Nat | [] => 0 | st :: rest => st.weightedSqDev + totalWeightedSqDev rest def outCount : List BasisState → Nat | [] => 0 | st :: rest => (if st.inBand then 0 else 1) + outCount rest theorem length_pos_of_nonempty {α : Type} {L : List α} (hne : L ≠ []) : 0 < L.length := by cases L with | nil => exact absurd rfl hne | cons _ _ => simp theorem traceWeight_ge_lower {c : Nat} : ∀ (L : List BasisState), (∀ st ∈ L, c ≤ st.weight) → L.length * c ≤ traceWeight L | [], _ => by simp [traceWeight] | st :: rest, h => by have hst : c ≤ st.weight := h st (by simp) have hrest : rest.length * c ≤ traceWeight rest := traceWeight_ge_lower rest (fun x hx => h x (by simp [hx])) simp only [List.length_cons, traceWeight, Nat.succ_mul] omega theorem traceWeight_pos {c : Nat} (hc : 0 < c) {L : List BasisState} (hne : L ≠ []) (hlower : ∀ st ∈ L, c ≤ st.weight) : 0 < traceWeight L := by have hge := traceWeight_ge_lower L hlower have hlen : 0 < L.length := length_pos_of_nonempty hne have hprod : 0 < L.length * c := Nat.mul_pos hlen hc omega theorem totalWeightedSqDev_le_split {ds sMax W : Nat} : ∀ (L : List BasisState), (∀ st ∈ L, (st.inBand = true → st.weightedSqDev ≤ st.weight * (ds * ds)) ∧ (st.inBand = false → st.weightedSqDev ≤ W * (sMax * sMax))) → totalWeightedSqDev L ≤ traceWeight L * (ds * ds) + outCount L * (W * (sMax * sMax)) | [], _ => by simp [totalWeightedSqDev, traceWeight, outCount] | st :: rest, h => by have hst := h st (by simp) have ih := totalWeightedSqDev_le_split (ds := ds) (sMax := sMax) (W := W) rest (fun x hx => h x (by simp [hx])) simp only [totalWeightedSqDev, traceWeight, outCount] cases hb : st.inBand with | true => have hterm := hst.1 hb simp only [↓reduceIte, Nat.zero_add, Nat.add_mul] omega | false => have hterm := hst.2 hb simp only [Bool.false_eq_true, ↓reduceIte, Nat.add_mul, Nat.one_mul] omega /-- **Theorem 1 (Eq. D.25, cleared-denominator finite-list variance inequality for diagonal spectral-moment records):** -/ theorem eq_D25_variance_bound {ds sMax c W r : Nat} (hc : 0 < c) (hr : 0 < r) (L : List BasisState) (hne : L ≠ []) (hbounds : ∀ st ∈ L, c ≤ st.weight ∧ st.weight ≤ W ∧ (st.inBand = true → st.weightedSqDev ≤ st.weight * (ds * ds)) ∧ (st.inBand = false → st.weightedSqDev ≤ W * (sMax * sMax))) (hcycle : r * outCount L ≤ L.length) : 0 < r * c * traceWeight L ∧ r * c * totalWeightedSqDev L ≤ traceWeight L * (r * c * (ds * ds) + W * (sMax * sMax)) := by have htr_pos : 0 < traceWeight L := traceWeight_pos hc hne (fun st hst => (hbounds st hst).1) have hdenom_pos : 0 < r * c * traceWeight L := Nat.mul_pos (Nat.mul_pos hr hc) htr_pos have hsplit := totalWeightedSqDev_le_split (ds := ds) (sMax := sMax) (W := W) L (fun st hst => ⟨(hbounds st hst).2.2.1, (hbounds st hst).2.2.2⟩) have htr : L.length * c ≤ traceWeight L := traceWeight_ge_lower L (fun st hst => (hbounds st hst).1) have hout_le_tr : r * c * outCount L ≤ traceWeight L := by calc r * c * outCount L = (r * outCount L) * c := by rw [Nat.mul_right_comm] _ ≤ L.length * c := Nat.mul_le_mul_right c hcycle _ ≤ traceWeight L := htr refine ⟨hdenom_pos, ?_⟩ calc r * c * totalWeightedSqDev L ≤ r * c * (traceWeight L * (ds * ds) + outCount L * (W * (sMax * sMax))) := Nat.mul_le_mul_left (r * c) hsplit _ = traceWeight L * (r * c * (ds * ds)) + (r * c * outCount L) * (W * (sMax * sMax)) := by rw [Nat.mul_add] have h1 : r * c * (traceWeight L * (ds * ds)) = traceWeight L * (r * c * (ds * ds)) := by rw [← Nat.mul_assoc, Nat.mul_comm (r * c) (traceWeight L), Nat.mul_assoc] have h2 : r * c * (outCount L * (W * (sMax * sMax))) = (r * c * outCount L) * (W * (sMax * sMax)) := by rw [← Nat.mul_assoc] rw [h1, h2] _ ≤ traceWeight L * (r * c * (ds * ds)) + traceWeight L * (W * (sMax * sMax)) := Nat.add_le_add_left (Nat.mul_le_mul_right (W * (sMax * sMax)) hout_le_tr) _ _ = traceWeight L * (r * c * (ds * ds) + W * (sMax * sMax)) := by rw [← Nat.mul_add] theorem nat_le_of_sq_le_sq {a b : Nat} (h : a * a ≤ b * b) : a ≤ b := by by_cases hab : a ≤ b · exact hab · have hlt : b < a := Nat.lt_of_not_ge hab have hsq : b * b < a * a := Nat.mul_lt_mul_of_lt_of_lt hlt hlt omega /-- **Theorem 2 (Chained Eqs. D.25 + 5.32 => Eq. 5.38):** Let `T = traceWeight L = Tr(P C_b^dagger C_b)`, `V = totalWeightedSqDev L = Tr[P C_b^dagger C_b P (s - s_0)^2]`, `num = T * |_P| = |Z_P[Delta_eta O]|`, and `C_eta = (|eta| / pi) * ||O||`. Chains `eq_D25_variance_bound` with the squared Eq. (5.32) boost inequality `num^2 <= C_eta^2 * T * V` and our cleared transcription of Chandrasekaran's cycle-parameter condition (stated in prose in App. D.2, p. 72: `C_eta * sqrt(B / (r * c)) <= delta_eta / 2`, cleared as `4 * C_eta^2 * B <= r * c * delta_eta^2`) to derive Eq. (5.38) (`2 * num - delta_eta * traceWeight L <= 0`). -/ theorem eq_532_538_chained_nonpositive {ds sMax c W r C_eta delta_eta num : Nat} (hc : 0 < c) (hr : 0 < r) (L : List BasisState) (hne : L ≠ []) (hbounds : ∀ st ∈ L, c ≤ st.weight ∧ st.weight ≤ W ∧ (st.inBand = true → st.weightedSqDev ≤ st.weight * (ds * ds)) ∧ (st.inBand = false → st.weightedSqDev ≤ W * (sMax * sMax))) (hcycle : r * outCount L ≤ L.length) (hboost : num * num ≤ (C_eta * C_eta) * traceWeight L * totalWeightedSqDev L) (hparam : 4 * (C_eta * C_eta) * (r * c * (ds * ds) + W * (sMax * sMax)) ≤ r * c * (delta_eta * delta_eta)) : (2 * (num : Int)) - (delta_eta : Int) * (traceWeight L : Int) ≤ 0 := by have hD25 := (eq_D25_variance_bound hc hr L hne hbounds hcycle).2 let T := traceWeight L let V := totalWeightedSqDev L let B := r * c * (ds * ds) + W * (sMax * sMax) have hrc_pos : 0 < r * c := Nat.mul_pos hr hc have hfour_num : (2 * num) * (2 * num) = 4 * (num * num) := by calc (2 * num) * (2 * num) = 2 * (num * (2 * num)) := Nat.mul_assoc _ _ _ _ = 2 * ((2 * num) * num) := by rw [Nat.mul_comm num (2 * num)] _ = 2 * (2 * (num * num)) := by rw [Nat.mul_assoc 2 num num] _ = (2 * 2) * (num * num) := (Nat.mul_assoc 2 2 (num * num)).symm _ = 4 * (num * num) := rfl have hsq_rc : r * c * ((2 * num) * (2 * num)) ≤ r * c * ((delta_eta * T) * (delta_eta * T)) := by rw [hfour_num] calc r * c * (4 * (num * num)) ≤ r * c * (4 * ((C_eta * C_eta) * T * V)) := Nat.mul_le_mul_left (r * c) (Nat.mul_le_mul_left 4 hboost) _ = (4 * (C_eta * C_eta) * T) * (r * c * V) := by calc r * c * (4 * ((C_eta * C_eta) * T * V)) = (4 * ((C_eta * C_eta) * T * V)) * (r * c) := Nat.mul_comm _ _ _ = ((4 * ((C_eta * C_eta) * T)) * V) * (r * c) := by rw [← Nat.mul_assoc 4 ((C_eta * C_eta) * T) V] _ = (4 * (C_eta * C_eta) * T) * (V * (r * c)) := by rw [Nat.mul_assoc, ← Nat.mul_assoc 4 (C_eta * C_eta) T] _ = (4 * (C_eta * C_eta) * T) * (r * c * V) := by rw [Nat.mul_comm V (r * c)] _ ≤ (4 * (C_eta * C_eta) * T) * (T * B) := Nat.mul_le_mul_left _ hD25 _ = (4 * (C_eta * C_eta) * B) * (T * T) := by have e1 : 4 * (C_eta * C_eta) * T * (T * B) = 4 * (C_eta * C_eta) * (T * (T * B)) := by rw [Nat.mul_assoc] have e2 : T * (T * B) = B * (T * T) := by rw [← Nat.mul_assoc, Nat.mul_comm (T * T) B] rw [e1, e2, ← Nat.mul_assoc] _ ≤ (r * c * (delta_eta * delta_eta)) * (T * T) := Nat.mul_le_mul_right (T * T) hparam _ = r * c * ((delta_eta * T) * (delta_eta * T)) := by have e3 : (delta_eta * delta_eta) * (T * T) = (delta_eta * T) * (delta_eta * T) := by calc (delta_eta * delta_eta) * (T * T) = delta_eta * (delta_eta * (T * T)) := Nat.mul_assoc _ _ _ _ = delta_eta * ((delta_eta * T) * T) := by rw [← Nat.mul_assoc delta_eta T T] _ = delta_eta * (T * (delta_eta * T)) := by rw [Nat.mul_comm (delta_eta * T) T] _ = (delta_eta * T) * (delta_eta * T) := (Nat.mul_assoc delta_eta T (delta_eta * T)).symm rw [Nat.mul_assoc (r * c), e3] have hsq : (2 * num) * (2 * num) ≤ (delta_eta * T) * (delta_eta * T) := Nat.le_of_mul_le_mul_left hsq_rc hrc_pos have hlin : 2 * num ≤ delta_eta * T := nat_le_of_sq_le_sq hsq have hlin_int : (2 * (num : Int)) ≤ (delta_eta : Int) * (traceWeight L : Int) := by have h1 : ((2 * num : Nat) : Int) ≤ ((delta_eta * traceWeight L : Nat) : Int) := Int.ofNat_le.mpr hlin simpa [Int.natCast_mul] using h1 omega /-- **Theorem 3 (Finite-step contradiction from nonpositive integer partial sums):** Elementary `omega` fact: a sequence of nonpositive integer sums `Z_k <= 0` cannot satisfy `Z_uncut - Z_k <= eps` for `eps < Z_uncut`. -/ theorem conditional_finite_dim_if_unconditional_convergence (Z : Nat → Int) (Z_uncut eps : Int) (hnonpos : ∀ k, Z k ≤ 0) (heps : eps < Z_uncut) (hconv : ∃ N, ∀ k ≥ N, Z_uncut - Z k ≤ eps) : False := by rcases hconv with ⟨N, hN⟩ have h1 := hN N (Nat.le_refl N) have h2 := hnonpos N omega /-! ## Part II: One-Line Collapse If Finite Closed Trace Is Assumed -/ /-- **Theorem 4 (One-line finiteness from Hilbert-Schmidt / finite closed trace):** -/ theorem one_line_finiteness_from_trace_bound {c M : Nat} (hc : 0 < c) (L : List BasisState) (hlower : ∀ st ∈ L, c ≤ st.weight) (hfinite_trace : traceWeight L ≤ M) : L.length ≤ M / c := by have hmul : L.length * c ≤ M := Nat.le_trans (traceWeight_ge_lower L hlower) hfinite_trace exact (Nat.le_div_iff_mul_le hc).mpr hmul /-! ## Part III: Formalized Doubled-Space Operator Counterexample on `Bool × Nat` -/ abbrev BasisIdx := Bool × Nat def swapKernel (x y : BasisIdx) : Int := if x.2 == y.2 && x.1 != y.1 then 1 else 0 def obsKernel (x y : BasisIdx) : Int := -swapKernel x y def boostSign (x : BasisIdx) : Int := if x.1 then -1 else 1 def boostedObsKernel (x y : BasisIdx) : Int := boostSign x * obsKernel x y * boostSign y def deltaEtaKernel (x y : BasisIdx) : Int := boostedObsKernel x y - obsKernel x y theorem deltaEtaKernel_eq_two_swap (x y : BasisIdx) : deltaEtaKernel x y = 2 * swapKernel x y := by rcases x with ⟨bx, nx⟩ rcases y with ⟨by_, ny⟩ unfold deltaEtaKernel boostedObsKernel obsKernel boostSign swapKernel cases bx <;> cases by_ <;> by_cases h : nx = ny <;> simp [h] def xKernel (x y : BasisIdx) : Int := deltaEtaKernel x y - (if x == y then 1 else 0) def sumInt {α : Type} (f : α → Int) : List α → Int | [] => 0 | a :: as => f a + sumInt f as theorem sumInt_ite_eq {α : Type} [DecidableEq α] [BEq α] [LawfulBEq α] (x : α) : ∀ (L : List α), L.Nodup → sumInt (fun y => if x == y then (1 : Int) else 0) L = if x ∈ L then 1 else 0 | [], _ => by simp [sumInt] | a :: as, hnd => by rw [List.nodup_cons] at hnd have ih := sumInt_ite_eq x as hnd.2 simp only [sumInt, List.mem_cons] by_cases hxa : x = a · subst hxa have hnot : x ∉ as := hnd.1 rw [ih] simp [hnot] · have hbeq : (x == a) = false := beq_false_of_ne hxa rw [hbeq, ih] simp [hxa] /-- Exact unnormalized doubled-space cut amplitude `` (with common positive factor `e^{-9/8}` factored out), computed directly as the double sum `sum_{x in F} sum_{y in F} `. -/ def cutAmplitude (F : List BasisIdx) : Int := sumInt (fun x => sumInt (fun y => xKernel x y) F) F def partner (x : BasisIdx) : BasisIdx := (!x.1, x.2) theorem swapKernel_eq_ite_partner (x y : BasisIdx) : swapKernel x y = if partner x == y then 1 else 0 := by rcases x with ⟨bx, nx⟩ rcases y with ⟨by_, ny⟩ unfold swapKernel partner cases bx <;> cases by_ <;> by_cases h : nx = ny <;> simp [h] theorem sumInt_swap_row (x : BasisIdx) (F : List BasisIdx) (hnd : F.Nodup) : sumInt (fun y => swapKernel x y) F = if partner x ∈ F then 1 else 0 := by have heq : (fun y => swapKernel x y) = (fun y => if partner x == y then (1 : Int) else 0) := funext (swapKernel_eq_ite_partner x) rw [heq, sumInt_ite_eq (partner x) F hnd] def pairCount (F : List BasisIdx) : Nat := (F.filter (fun x => x.1 == true && F.contains (false, x.2))).length def lowPairCount (F : List BasisIdx) : Nat := (F.filter (fun x => x.1 == false && F.contains (true, x.2))).length theorem sumInt_partner_split (F : List BasisIdx) : ∀ (L : List BasisIdx), sumInt (fun x => if partner x ∈ F then (1 : Int) else 0) L = ((L.filter (fun x => x.1 == true && F.contains (false, x.2))).length : Int) + ((L.filter (fun x => x.1 == false && F.contains (true, x.2))).length : Int) | [] => by simp [sumInt] | a :: as => by have ih := sumInt_partner_split F as rcases a with ⟨ba, na⟩ cases ba with | true => have hp : partner (true, na) = (false, na) := rfl by_cases hmem : (false, na) ∈ F · simp [sumInt, hp, hmem, ih]; omega · simp [sumInt, hp, hmem, ih] | false => have hp : partner (false, na) = (true, na) := rfl by_cases hmem : (true, na) ∈ F · simp [sumInt, hp, hmem, ih]; omega · simp [sumInt, hp, hmem, ih] theorem nodup_length_le_of_subset {α : Type} [DecidableEq α] : ∀ (X Y : List α), X.Nodup → (∀ x ∈ X, x ∈ Y) → X.length ≤ Y.length | [], _, _, _ => by simp | u :: us, Y, hX, hXY => by rw [List.nodup_cons] at hX have huY : u ∈ Y := hXY u (by simp) have hYpos : 0 < Y.length := length_pos_of_nonempty (by intro h; subst h; simp at huY) have hYlen := List.length_erase_of_mem huY have hrest : us.length ≤ (Y.erase u).length := by apply nodup_length_le_of_subset us (Y.erase u) hX.2 intro z hz have hzu : z ≠ u := fun h => hX.1 (h ▸ hz) exact (List.mem_erase_of_ne hzu).mpr (hXY z (by simp [hz])) simp only [List.length_cons] omega theorem list_length_eq_of_nodup_equiv {α : Type} [DecidableEq α] (A B : List α) (hA : A.Nodup) (hB : B.Nodup) (heq : ∀ x, x ∈ A ↔ x ∈ B) : A.length = B.length := by have h1 := nodup_length_le_of_subset A B hA (fun x hx => (heq x).mp hx) have h2 := nodup_length_le_of_subset B A hB (fun x hx => (heq x).mpr hx) omega theorem nodup_map_of_inj {α β : Type} {f : α → β} (hinj : ∀ a b, f a = f b → a = b) : ∀ {L : List α}, L.Nodup → (L.map f).Nodup | [], _ => by simp | a :: as, hnd => by rw [List.nodup_cons] at hnd simp only [List.map_cons, List.nodup_cons] refine ⟨?_, nodup_map_of_inj hinj hnd.2⟩ intro hmem simp only [List.mem_map] at hmem rcases hmem with ⟨b, hb, hfb⟩ have hab : b = a := hinj b a hfb subst hab exact hnd.1 hb theorem nodup_map_of_inj_on {α β : Type} {f : α → β} : ∀ {L : List α}, L.Nodup → (∀ a ∈ L, ∀ b ∈ L, f a = f b → a = b) → (L.map f).Nodup | [], _, _ => by simp | a :: as, hnd, hinj => by rw [List.nodup_cons] at hnd simp only [List.map_cons, List.nodup_cons] refine ⟨?_, nodup_map_of_inj_on hnd.2 (fun x hx y hy => hinj x (by simp [hx]) y (by simp [hy]))⟩ intro hmem simp only [List.mem_map] at hmem rcases hmem with ⟨b, hb, hfb⟩ have hab : b = a := hinj b (by simp [hb]) a (by simp) hfb subst hab exact hnd.1 hb theorem lowPairCount_eq_pairCount (F : List BasisIdx) (hnd : F.Nodup) : lowPairCount F = pairCount F := by unfold lowPairCount pairCount let A := (F.filter (fun x => x.1 == false && F.contains (true, x.2))).map Prod.snd let B := (F.filter (fun x => x.1 == true && F.contains (false, x.2))).map Prod.snd have hlenA : A.length = (F.filter (fun x => x.1 == false && F.contains (true, x.2))).length := by simp [A] have hlenB : B.length = (F.filter (fun x => x.1 == true && F.contains (false, x.2))).length := by simp [B] rw [← hlenA, ← hlenB] apply list_length_eq_of_nodup_equiv A B · apply nodup_map_of_inj_on (hnd.filter _) intro x hx y hy hxy simp only [List.mem_filter, Bool.and_eq_true, beq_iff_eq] at hx hy rcases x with ⟨bx, nx⟩ rcases y with ⟨by_, ny⟩ simp only at hxy hx hy subst hxy rw [hx.2.1, hy.2.1] · apply nodup_map_of_inj_on (hnd.filter _) intro x hx y hy hxy simp only [List.mem_filter, Bool.and_eq_true, beq_iff_eq] at hx hy rcases x with ⟨bx, nx⟩ rcases y with ⟨by_, ny⟩ simp only at hxy hx hy subst hxy rw [hx.2.1, hy.2.1] · intro n simp only [A, B, List.mem_map, List.mem_filter, Bool.and_eq_true, beq_iff_eq, List.contains_iff_mem] constructor · rintro ⟨⟨bx, nx⟩, ⟨hmem, hbx, hpartner⟩, rfl⟩ simp only at hbx hpartner subst hbx exact ⟨(true, nx), ⟨hpartner, rfl, hmem⟩, rfl⟩ · rintro ⟨⟨bx, nx⟩, ⟨hmem, hbx, hpartner⟩, rfl⟩ simp only at hbx hpartner subst hbx exact ⟨(false, nx), ⟨hpartner, rfl, hmem⟩, rfl⟩ /-- **Theorem 5 (Derived Matrix-Element Identity — proved from the operator kernel, NOT defined by fiat):** For every duplicate-free basis subset `F` (`F.Nodup`), the doubled-space cut amplitude `cutAmplitude F = sum_{x in F} sum_{y in F} ` equals `4 * pairCount F - F.length`. -/ theorem cutAmplitude_eq_formula (F : List BasisIdx) (hnd : F.Nodup) : cutAmplitude F = 4 * (pairCount F : Int) - (F.length : Int) := by unfold cutAmplitude have hrow : ∀ x ∈ F, sumInt (fun y => xKernel x y) F = 2 * (if partner x ∈ F then (1 : Int) else 0) - 1 := by intro x hx have hfun : ∀ (L : List BasisIdx), sumInt (fun y => xKernel x y) L = 2 * sumInt (fun y => swapKernel x y) L - sumInt (fun y => if x == y then (1 : Int) else 0) L := by intro L induction L with | nil => simp [sumInt] | cons a as ih => simp only [sumInt] rw [ih] simp only [xKernel, deltaEtaKernel_eq_two_swap] omega rw [hfun F, sumInt_swap_row x F hnd, sumInt_ite_eq x F hnd] simp [hx] have houter : ∀ (L : List BasisIdx), (∀ x ∈ L, x ∈ F) → sumInt (fun x => sumInt (fun y => xKernel x y) F) L = 2 * sumInt (fun x => if partner x ∈ F then (1 : Int) else 0) L - (L.length : Int) := by intro L hsub induction L with | nil => simp [sumInt] | cons a as ih => have ha := hrow a (hsub a (by simp)) have hrest := ih (fun z hz => hsub z (by simp [hz])) simp only [sumInt, List.length_cons, ha, hrest] omega rw [houter F (fun x hx => hx), sumInt_partner_split F F] have hlow := lowPairCount_eq_pairCount F hnd unfold lowPairCount pairCount at hlow unfold pairCount omega def highAreaCount (F : List BasisIdx) : Nat := (F.filter (fun x => x.1 == true)).length theorem length_filter_le_filter {α : Type} (p q : α → Bool) (himp : ∀ x, p x = true → q x = true) : ∀ (L : List α), (L.filter p).length ≤ (L.filter q).length | [] => by simp | x :: xs => by have ih := length_filter_le_filter p q himp xs simp only [List.filter_cons] cases hp : p x with | false => cases hq : q x with | false => exact ih | true => simp; omega | true => have hq : q x = true := himp x hp simp [hq] omega theorem pairCount_le_highAreaCount (F : List BasisIdx) : pairCount F ≤ highAreaCount F := by unfold pairCount highAreaCount apply length_filter_le_filter intro x hx simp only [Bool.and_eq_true] at hx exact hx.1 theorem filter_eq_of_forall_eq {α : Type} (p q : α → Bool) : ∀ (L : List α), (∀ x ∈ L, p x = q x) → L.filter p = L.filter q | [], _ => rfl | x :: xs, h => by have hx : p x = q x := h x (by simp) have ih := filter_eq_of_forall_eq p q xs (fun y hy => h y (by simp [hy])) simp [List.filter_cons, hx, ih] /-! ### Exhaustion 1: Natural Paired Exhaustion (`cutAmplitude = +2N -> +infinity`) -/ def pairedExhaustion : Nat → List BasisIdx | 0 => [] | n + 1 => (false, n) :: (true, n) :: pairedExhaustion n theorem mem_pairedExhaustion_of_lt {b : Bool} {n N : Nat} (h : n < N) : (b, n) ∈ pairedExhaustion N := by induction N with | zero => omega | succ k ih => unfold pairedExhaustion by_cases hnk : n = k · subst hnk; cases b <;> simp · have hmem := ih (by omega : n < k); simp [hmem] theorem mem_pairedExhaustion_snd_lt {x : BasisIdx} {N : Nat} (hx : x ∈ pairedExhaustion N) : x.2 < N := by induction N with | zero => simp [pairedExhaustion] at hx | succ k ih => simp only [pairedExhaustion, List.mem_cons] at hx rcases hx with rfl | rfl | hrest · simp · simp · exact Nat.lt_succ_of_lt (ih hrest) theorem pairedExhaustion_nodup (N : Nat) : (pairedExhaustion N).Nodup := by induction N with | zero => simp [pairedExhaustion] | succ k ih => simp only [pairedExhaustion, List.nodup_cons, List.mem_cons, not_or] refine ⟨⟨(fun h => by cases h), (fun h => ?_)⟩, ⟨(fun h => ?_), ih⟩⟩ · have := mem_pairedExhaustion_snd_lt h; simp at this · have := mem_pairedExhaustion_snd_lt h; simp at this theorem paired_exhaustion_covers_all (x : BasisIdx) : ∃ N, x ∈ pairedExhaustion N := ⟨x.2 + 1, mem_pairedExhaustion_of_lt (Nat.lt_succ_self x.2)⟩ theorem pairedExhaustion_mono (N : Nat) (x : BasisIdx) (h : x ∈ pairedExhaustion N) : x ∈ pairedExhaustion (N + 1) := by simp [pairedExhaustion, h] theorem pairedExhaustion_length (N : Nat) : (pairedExhaustion N).length = 2 * N := by induction N with | zero => rfl | succ k ih => simp [pairedExhaustion, ih]; omega theorem pairedExhaustion_highAreaCount (N : Nat) : highAreaCount (pairedExhaustion N) = N := by induction N with | zero => rfl | succ k ih => simp [pairedExhaustion, highAreaCount] at ih ⊢; omega theorem pairedExhaustion_pairCount (N : Nat) : pairCount (pairedExhaustion N) = N := by unfold pairCount have heq : (pairedExhaustion N).filter (fun x => x.1 == true && (pairedExhaustion N).contains (false, x.2)) = (pairedExhaustion N).filter (fun x => x.1 == true) := by apply filter_eq_of_forall_eq intro x hx have hmem : (false, x.2) ∈ pairedExhaustion N := mem_pairedExhaustion_of_lt (mem_pairedExhaustion_snd_lt hx) simp [hmem] rw [heq] exact pairedExhaustion_highAreaCount N /-- **Theorem 6a (Exhaustion 1 — Positive Divergence):** -/ theorem paired_exhaustion_exact_positive (N : Nat) : (pairedExhaustion N).Nodup ∧ cutAmplitude (pairedExhaustion N) = 2 * (N : Int) := by have hnd := pairedExhaustion_nodup N refine ⟨hnd, ?_⟩ rw [cutAmplitude_eq_formula _ hnd, pairedExhaustion_pairCount N, pairedExhaustion_length N] omega /-! ### Exhaustion 2: Constant Finite Positive Exhaustion (`cutAmplitude = +2` for every `N >= 1`) -/ def constPosExhaustion (N : Nat) : List BasisIdx := (List.range N).map (fun j => (true, j)) ++ (List.range (3 * N - 2)).map (fun m => (false, m)) theorem constPosExhaustion_nodup (N : Nat) : (constPosExhaustion N).Nodup := by unfold constPosExhaustion rw [List.nodup_append] refine ⟨?_, ?_, ?_⟩ · exact nodup_map_of_inj (fun a b h => by injection h) List.nodup_range · exact nodup_map_of_inj (fun a b h => by injection h) List.nodup_range · intro x hx y hy hxy simp only [List.mem_map] at hx hy rcases hx with ⟨a, _, rfl⟩ rcases hy with ⟨b, _, rfl⟩ cases hxy theorem constPosExhaustion_covers_all (x : BasisIdx) : ∃ N, 1 ≤ N ∧ x ∈ constPosExhaustion N := by rcases x with ⟨b, m⟩ cases b with | true => refine ⟨m + 1, by omega, ?_⟩ unfold constPosExhaustion simp only [List.mem_append, List.mem_map, List.mem_range] left; exact ⟨m, by omega, rfl⟩ | false => refine ⟨m + 1, by omega, ?_⟩ unfold constPosExhaustion simp only [List.mem_append, List.mem_map, List.mem_range] right; exact ⟨m, by omega, rfl⟩ theorem constPosExhaustion_mono (N : Nat) (x : BasisIdx) (h : x ∈ constPosExhaustion N) : x ∈ constPosExhaustion (N + 1) := by simp only [constPosExhaustion, List.mem_append, List.mem_map, List.mem_range] at h ⊢ rcases h with ⟨a, ha, rfl⟩ | ⟨a, ha, rfl⟩ · exact Or.inl ⟨a, by omega, rfl⟩ · exact Or.inr ⟨a, by omega, rfl⟩ /-- **Theorem 6b (Exhaustion 2 — Exact Constant Finite Positive Limit `cutAmplitude = +2`):** -/ theorem constPos_exhaustion_exact_two (N : Nat) (hN : 1 ≤ N) : (constPosExhaustion N).Nodup ∧ cutAmplitude (constPosExhaustion N) = 2 := by have hnd := constPosExhaustion_nodup N refine ⟨hnd, ?_⟩ rw [cutAmplitude_eq_formula _ hnd] have hlen : (constPosExhaustion N).length = 4 * N - 2 := by simp [constPosExhaustion] omega have hpair : pairCount (constPosExhaustion N) = N := by unfold pairCount have heq : (constPosExhaustion N).filter (fun x => x.1 == true && (constPosExhaustion N).contains (false, x.2)) = (constPosExhaustion N).filter (fun x => x.1 == true) := by apply filter_eq_of_forall_eq intro x hx rcases x with ⟨bx, nx⟩ cases bx with | false => simp | true => simp only [constPosExhaustion, List.mem_append, List.mem_map, List.mem_range] at hx have hlt : nx < N := by rcases hx with ⟨a, ha, hpair_eq⟩ | ⟨a, _, hpair_eq⟩ · injection hpair_eq with _ h2; omega · injection hpair_eq with h1; cases h1 have hmem : (false, nx) ∈ constPosExhaustion N := by unfold constPosExhaustion simp only [List.mem_append, List.mem_map, List.mem_range] right; exact ⟨nx, by omega, rfl⟩ simp [hmem] rw [heq] simp only [constPosExhaustion, List.filter_append] have hf1 : ((List.range N).map (fun j => (true, j))).filter (fun x => x.1 == true) = (List.range N).map (fun j => (true, j)) := by apply List.filter_eq_self.mpr intro x hx; simp only [List.mem_map] at hx; rcases hx with ⟨j, _, rfl⟩; simp have hf2 : ((List.range (3 * N - 2)).map (fun m => (false, m))).filter (fun x => x.1 == true) = [] := by apply List.filter_eq_nil_iff.mpr intro x hx; simp only [List.mem_map] at hx; rcases hx with ⟨m, _, rfl⟩; simp rw [hf1, hf2] simp rw [hlen, hpair] omega /-! ### Exhaustion 3: Generalized Length-`r = m + 1` Cycle Partition (`m >= 4`, incl. `r = 5` & `r = 40`) -/ def cycleR (m k : Nat) : List BasisIdx := (true, k) :: (List.range m).map (fun j => (false, m * k + j)) def cycleOfR (m : Nat) : BasisIdx → Nat | (true, k) => k | (false, n) => n / m theorem cycleR_covers_all {m : Nat} (hm : 0 < m) (x : BasisIdx) : x ∈ cycleR m (cycleOfR m x) := by rcases x with ⟨b, n⟩ cases b with | true => simp [cycleOfR, cycleR] | false => simp only [cycleOfR, cycleR, List.mem_cons, List.mem_map, List.mem_range] right exact ⟨n % m, Nat.mod_lt n hm, by congr 1; exact Nat.div_add_mod n m⟩ theorem cycleR_exhaustion_covers_all {m : Nat} (hm : 0 < m) (x : BasisIdx) : ∃ N, x ∈ (List.range N).flatMap (cycleR m) := by refine ⟨cycleOfR m x + 1, ?_⟩ simp only [List.mem_flatMap, List.mem_range] exact ⟨cycleOfR m x, Nat.lt_succ_self _, cycleR_covers_all hm x⟩ theorem cycleR_exhaustion_mono (m N : Nat) (x : BasisIdx) (h : x ∈ (List.range N).flatMap (cycleR m)) : x ∈ (List.range (N + 1)).flatMap (cycleR m) := by simp only [List.mem_flatMap, List.mem_range] at h ⊢ rcases h with ⟨k, hk, hxk⟩ exact ⟨k, by omega, hxk⟩ theorem cycleR_disjoint {m : Nat} (hm : 0 < m) {x : BasisIdx} {k : Nat} (hx : x ∈ cycleR m k) : k = cycleOfR m x := by rcases x with ⟨b, n⟩ simp only [cycleR, List.mem_cons, List.mem_map, List.mem_range] at hx cases b with | true => rcases hx with h | ⟨j, _, h⟩ · injection h with _ h2; simpa [cycleOfR] using h2.symm · injection h with h1; cases h1 | false => rcases hx with h | ⟨j, hj, h⟩ · injection h with h1; cases h1 · injection h with _ h2 simp only [cycleOfR] subst h2 have hdiv : (m * k + j) / m = k + j / m := Nat.mul_add_div hm k j have hj0 : j / m = 0 := Nat.div_eq_of_lt hj omega theorem cycleR_nodup (m k : Nat) : (cycleR m k).Nodup := by unfold cycleR rw [List.nodup_cons] refine ⟨?_, ?_⟩ · intro h simp only [List.mem_map] at h rcases h with ⟨j, _, hj⟩ cases hj · exact nodup_map_of_inj (fun a b h => by injection h with _ h2; omega) List.nodup_range theorem flatMap_cycleR_nodup {m : Nat} (hm : 0 < m) : ∀ {ks : List Nat}, ks.Nodup → (ks.flatMap (cycleR m)).Nodup | [], _ => by simp | k :: rest, hnd => by rw [List.nodup_cons] at hnd simp only [List.flatMap_cons] rw [List.nodup_append] refine ⟨cycleR_nodup m k, flatMap_cycleR_nodup hm hnd.2, ?_⟩ intro x hx y hy hxy subst hxy simp only [List.mem_flatMap] at hy rcases hy with ⟨k', hk', hxk'⟩ have h1 := cycleR_disjoint hm hx have h2 := cycleR_disjoint hm hxk' have heq : k = k' := by omega subst heq exact hnd.1 hk' theorem cycleR_length (m k : Nat) : (cycleR m k).length = m + 1 := by simp [cycleR] theorem cycleR_highAreaCount (m k : Nat) : highAreaCount (cycleR m k) = 1 := by unfold highAreaCount cycleR simp only [List.filter_cons, beq_self_eq_true, ↓reduceIte, List.length_cons] have hnil : ((List.range m).map (fun j => (false, m * k + j))).filter (fun x => x.1 == true) = [] := by apply List.filter_eq_nil_iff.mpr intro x hx; simp only [List.mem_map] at hx; rcases hx with ⟨j, _, rfl⟩; simp rw [hnil] rfl theorem flatMap_length_cycleR (m : Nat) : ∀ (ks : List Nat), (ks.flatMap (cycleR m)).length = (m + 1) * ks.length | [] => by simp | k :: rest => by simp only [List.flatMap_cons, List.length_append, cycleR_length, flatMap_length_cycleR m rest, List.length_cons] rw [Nat.mul_succ] omega theorem highAreaCount_append (A B : List BasisIdx) : highAreaCount (A ++ B) = highAreaCount A + highAreaCount B := by simp [highAreaCount, List.filter_append] theorem flatMap_highAreaCount_cycleR (m : Nat) : ∀ (ks : List Nat), highAreaCount (ks.flatMap (cycleR m)) = ks.length | [] => rfl | k :: rest => by simp only [List.flatMap_cons, highAreaCount_append, cycleR_highAreaCount, flatMap_highAreaCount_cycleR m rest, List.length_cons] omega /-- **Theorem 6c (Exhaustion 3 — Universal Negativity for ANY Cycle Length `r = m + 1 >= 5`):** -/ theorem cycleR_union_negative {m : Nat} (hm : 4 ≤ m) {ks : List Nat} (hnd : ks.Nodup) : (ks.flatMap (cycleR m)).Nodup ∧ cutAmplitude (ks.flatMap (cycleR m)) ≤ -(((m - 3 : Nat) * ks.length : Nat) : Int) := by have hm_pos : 0 < m := by omega have hGnd : (ks.flatMap (cycleR m)).Nodup := flatMap_cycleR_nodup hm_pos hnd refine ⟨hGnd, ?_⟩ rw [cutAmplitude_eq_formula _ hGnd, flatMap_length_cycleR m ks] have hpair : pairCount (ks.flatMap (cycleR m)) ≤ ks.length := by calc pairCount (ks.flatMap (cycleR m)) ≤ highAreaCount (ks.flatMap (cycleR m)) := pairCount_le_highAreaCount _ _ = ks.length := flatMap_highAreaCount_cycleR m ks have hdiff : (m + 1) * ks.length = 4 * ks.length + (m - 3) * ks.length := by rw [← Nat.add_mul] congr 1 omega omega /-- **Theorem 6d (Three Duplicate-Free Exhaustions of the Exact Same Infinite Basis `Bool × Nat`):** 1. `pairedExhaustion N` -> `+2N` (`+infinity`) 2. `constPosExhaustion N` -> exact finite constant `+2 > 0` 3. `(List.range N).flatMap (cycleR 39)` (`r = 40`, satisfying Eq. 5.32's `2*pi/sqrt(40) < 1`) -> `<= -36N` (`-infinity`). -/ theorem three_exhaustions_same_basis (N : Nat) (hN : 1 ≤ N) : cutAmplitude (pairedExhaustion N) = 2 * (N : Int) ∧ cutAmplitude (constPosExhaustion N) = 2 ∧ cutAmplitude ((List.range N).flatMap (cycleR 39)) ≤ -36 * (N : Int) := by have h1 := (paired_exhaustion_exact_positive N).2 have h2 := (constPos_exhaustion_exact_two N hN).2 have h3 := (cycleR_union_negative (m := 39) (by omega) (List.nodup_range (n := N))).2 rw [List.length_range] at h3 refine ⟨h1, h2, ?_⟩ omega end Sec52Audit