/-! # 011c / SD.5 — exact rational LU certificate for the selected SD.4 minor Core Lean 4, no Mathlib, kernel evaluation (`decide +kernel`). Object. `A` is the selected 16 by 16 minor of the SD.4 differential at the SD.6 coframe `Pi_star`, with selected rows [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 9, 7, 12, 13, 14, 15] selected columns [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17] (the orders of `SutureRegular011c.selectedRows` / `selectedColumns` and `SutureActualMinor011c.selectedRow` / `selectedColumn`). `A` below is a verbatim copy of `SutureRegular011c.regularMinor`; the identification with that definition is checked in `SutureLDUWitness011c.lean`. Certificate. Rational tables `lowerEntries` (strictly lower part of `L`; the unit diagonal is implicit) and `upperEntries` (all of `U`, diagonal included) such that A = L * U, L unit lower triangular, U upper triangular, diag U = pivots, product of pivots = 368640. This file is finite exact algebra over Q only. The smooth SD.5 open-neighbourhood step, the determinant theorem for triangular real matrices, and the real SD.4 entry evaluation are separate (see `SutureLDU011c.lean`, `SutureLDUWitness011c.lean`). No physical premise, imported action term, density, calibration, or boundary term appears here. -/ set_option autoImplicit false namespace SutureLDUCertificate011c def selectedRows : List Nat := [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 9, 7, 12, 13, 14, 15] def selectedColumns : List Nat := [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17] /-- Selected SD.4 minor at `Pi_star`; verbatim `SutureRegular011c.regularMinor`. -/ def A : List (List Int) := [[8, 0, 0, 0, 6, 0, 0, -2, 0, 0, 0, -2, 0, 0, -2, 0], [3, 4, 0, 0, -4, 3, 0, -2, -1, 0, 0, 1, -1, 0, 0, -1], [-1, 0, 4, 0, 3, 0, 0, 1, 0, -1, 0, -1, 0, -1, 0, 0], [0, 0, 0, 4, 0, 0, 3, -2, 0, 0, -1, 0, 0, 0, -1, 0], [0, 6, 0, 0, 0, -8, 0, 0, -4, 0, 0, 0, 2, 0, 0, 0], [0, -1, 3, 0, 0, 3, 0, 0, 1, -2, 0, 0, -1, 1, 0, 0], [0, 0, 0, 3, 0, 0, -4, 0, -2, 0, -2, 0, 0, 0, 0, -1], [0, 0, 0, -1, 0, 0, 3, 0, 0, -2, 1, 0, 0, 0, 0, 0], [1, 2, 0, 0, -2, 1, 0, -1, -1, 0, 0, -2, 1, 0, -1, 0], [-1, 0, 2, 0, 1, 0, 0, 1, 0, -1, 0, 1, 0, 1, -1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, 0, 0], [0, 0, -2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, -2, 0, 0], [0, 0, 0, 2, 0, 0, 1, 0, 0, 0, -1, -2, 0, 0, 1, 0], [0, -1, -1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, -1], [0, 0, 0, -1, 0, 0, 2, 0, 0, 0, 1, 0, -2, 0, 0, 1], [0, 0, 0, 1, 0, 0, -1, 0, 0, 0, -1, 0, 0, -2, 0, 0]] /-- A sparse rational entry `num / den` at (row, col). -/ structure Ent where row : Nat col : Nat num : Int den : Nat def Ent.value (e : Ent) : Rat := mkRat e.num e.den /-- Strictly lower part of `L` (unit diagonal implicit); 56 nonzero entries. -/ def lowerEntries : List Ent := [ ⟨1, 0, 3, 8⟩, ⟨2, 0, -1, 8⟩, ⟨4, 1, 3, 2⟩, ⟨5, 1, -1, 4⟩, ⟨5, 2, 3, 4⟩, ⟨5, 4, -7, 15⟩, ⟨6, 3, 3, 4⟩, ⟨7, 3, -1, 4⟩, ⟨7, 6, -3, 5⟩, ⟨8, 0, 1, 8⟩, ⟨8, 1, 1, 2⟩, ⟨8, 4, 1, 25⟩, ⟨8, 7, -1, 2⟩, ⟨9, 0, -1, 8⟩, ⟨9, 2, 1, 2⟩, ⟨9, 4, -1, 75⟩, ⟨9, 5, 2, 25⟩, ⟨9, 7, 1, 1⟩, ⟨9, 8, -6, 5⟩, ⟨11, 2, -1, 2⟩, ⟨11, 4, 1, 5⟩, ⟨11, 5, -6, 5⟩, ⟨12, 3, 1, 2⟩, ⟨12, 6, 2, 25⟩, ⟨12, 7, 11, 5⟩, ⟨12, 8, -14, 5⟩, ⟨12, 9, 4, 1⟩, ⟨12, 10, 1, 10⟩, ⟨12, 11, -142, 5⟩, ⟨13, 1, -1, 4⟩, ⟨13, 2, -1, 4⟩, ⟨13, 4, -1, 15⟩, ⟨13, 5, -11, 25⟩, ⟨13, 8, -2, 5⟩, ⟨13, 9, -1, 2⟩, ⟨13, 11, -23, 1⟩, ⟨13, 12, 5, 16⟩, ⟨14, 3, -1, 4⟩, ⟨14, 6, -11, 25⟩, ⟨14, 7, 2, 5⟩, ⟨14, 8, 2, 5⟩, ⟨14, 9, 3, 1⟩, ⟨14, 10, -1, 20⟩, ⟨14, 11, 381, 5⟩, ⟨14, 12, -9, 8⟩, ⟨14, 13, -10, 1⟩, ⟨15, 3, 1, 4⟩, ⟨15, 6, 7, 25⟩, ⟨15, 7, 1, 5⟩, ⟨15, 8, -4, 5⟩, ⟨15, 9, -1, 1⟩, ⟨15, 10, 1, 10⟩, ⟨15, 11, -232, 5⟩, ⟨15, 12, 7, 8⟩, ⟨15, 13, 6, 1⟩, ⟨15, 14, -20, 33⟩] /-- All of `U` (diagonal = pivots); 81 nonzero entries. -/ def upperEntries : List Ent := [ ⟨0, 0, 8, 1⟩, ⟨0, 4, 6, 1⟩, ⟨0, 7, -2, 1⟩, ⟨0, 11, -2, 1⟩, ⟨0, 14, -2, 1⟩, ⟨1, 1, 4, 1⟩, ⟨1, 4, -25, 4⟩, ⟨1, 5, 3, 1⟩, ⟨1, 7, -5, 4⟩, ⟨1, 8, -1, 1⟩, ⟨1, 11, 7, 4⟩, ⟨1, 12, -1, 1⟩, ⟨1, 14, 3, 4⟩, ⟨1, 15, -1, 1⟩, ⟨2, 2, 4, 1⟩, ⟨2, 4, 15, 4⟩, ⟨2, 7, 3, 4⟩, ⟨2, 9, -1, 1⟩, ⟨2, 11, -5, 4⟩, ⟨2, 13, -1, 1⟩, ⟨2, 14, -1, 4⟩, ⟨3, 3, 4, 1⟩, ⟨3, 6, 3, 1⟩, ⟨3, 7, -2, 1⟩, ⟨3, 10, -1, 1⟩, ⟨3, 14, -1, 1⟩, ⟨4, 4, 75, 8⟩, ⟨4, 5, -25, 2⟩, ⟨4, 7, 15, 8⟩, ⟨4, 8, -5, 2⟩, ⟨4, 11, -21, 8⟩, ⟨4, 12, 7, 2⟩, ⟨4, 14, -9, 8⟩, ⟨4, 15, 3, 2⟩, ⟨5, 5, -25, 12⟩, ⟨5, 8, -5, 12⟩, ⟨5, 9, -5, 4⟩, ⟨5, 11, 3, 20⟩, ⟨5, 12, 23, 60⟩, ⟨5, 13, 7, 4⟩, ⟨5, 14, -3, 20⟩, ⟨5, 15, 9, 20⟩, ⟨6, 6, -25, 4⟩, ⟨6, 7, 3, 2⟩, ⟨6, 8, -2, 1⟩, ⟨6, 10, -5, 4⟩, ⟨6, 14, 3, 4⟩, ⟨6, 15, -1, 1⟩, ⟨7, 7, 2, 5⟩, ⟨7, 8, -6, 5⟩, ⟨7, 9, -2, 1⟩, ⟨7, 14, 1, 5⟩, ⟨7, 15, -3, 5⟩, ⟨8, 8, -1, 1⟩, ⟨8, 9, -1, 1⟩, ⟨8, 11, -63, 25⟩, ⟨8, 12, 34, 25⟩, ⟨8, 14, -49, 50⟩, ⟨8, 15, 7, 50⟩, ⟨9, 9, 2, 5⟩, ⟨9, 11, -212, 125⟩, ⟨9, 12, 206, 125⟩, ⟨9, 13, 34, 25⟩, ⟨9, 14, -313, 125⟩, ⟨9, 15, 94, 125⟩, ⟨10, 10, -4, 1⟩, ⟨11, 11, 2, 25⟩, ⟨11, 12, -6, 25⟩, ⟨11, 13, -2, 5⟩, ⟨11, 14, -2, 25⟩, ⟨11, 15, 6, 25⟩, ⟨12, 12, -48, 5⟩, ⟨12, 13, -84, 5⟩, ⟨12, 14, 6, 1⟩, ⟨12, 15, 28, 5⟩, ⟨13, 13, -3, 4⟩, ⟨13, 14, -43, 8⟩, ⟨13, 15, 13, 4⟩, ⟨14, 14, -33, 1⟩, ⟨14, 15, 19, 1⟩, ⟨15, 15, -16, 33⟩] def pivots : List Rat := [8, 4, 4, 4, (75 / 8), (-25 / 12), (-25 / 4), (2 / 5), -1, (2 / 5), -4, (2 / 25), (-48 / 5), (-3 / 4), -33, (-16 / 33)] def sparseAt (S : List Ent) (i j : Nat) : Rat := S.foldl (fun acc e => if e.row = i ∧ e.col = j then acc + e.value else acc) 0 def Lat (i j : Nat) : Rat := (if i = j then 1 else 0) + sparseAt lowerEntries i j def Uat (i j : Nat) : Rat := sparseAt upperEntries i j def Aat (i j : Nat) : Int := (A.getD i []).getD j 0 /-- Entry `(i, j)` of the product `L * U`. -/ def LUat (i j : Nat) : Rat := (List.range 16).foldl (fun s k => s + Lat i k * Uat k j) 0 /-! ## Shape and normal form of the data -/ theorem A_shape : A.length = 16 ∧ A.all (fun r => r.length == 16) = true := by decide +kernel theorem lower_entries_strict : lowerEntries.all (fun e => decide (e.col < e.row ∧ e.row < 16 ∧ 0 < e.den)) = true := by decide +kernel theorem upper_entries_triangular : upperEntries.all (fun e => decide (e.row ≤ e.col ∧ e.col < 16 ∧ 0 < e.den)) = true := by decide +kernel theorem lower_entries_reduced : lowerEntries.all (fun e => decide (e.num ≠ 0 ∧ Nat.gcd e.num.natAbs e.den = 1)) = true := by decide +kernel theorem upper_entries_reduced : upperEntries.all (fun e => decide (e.num ≠ 0 ∧ Nat.gcd e.num.natAbs e.den = 1)) = true := by decide +kernel theorem lower_coordinates_distinct : (lowerEntries.map fun e => (e.row, e.col)).Nodup := by decide +kernel theorem upper_coordinates_distinct : (upperEntries.map fun e => (e.row, e.col)).Nodup := by decide +kernel /-! ## Triangular witnesses (entrywise, on the assembled matrices) -/ theorem L_zero_above : ∀ i < 16, ∀ j < 16, i < j → Lat i j = 0 := by decide +kernel theorem L_unit_diagonal : ∀ i < 16, Lat i i = 1 := by decide +kernel theorem U_zero_below : ∀ i < 16, ∀ j < 16, j < i → Uat i j = 0 := by decide +kernel /-! ## The factorization -/ theorem LU_eq_A : ∀ i < 16, ∀ j < 16, LUat i j = (Aat i j : Rat) := by decide +kernel /-! ## Pivots and the determinant value -/ theorem U_diagonal_is_pivots : (List.range 16).map (fun k => Uat k k) = pivots := by decide +kernel theorem pivot_product : pivots.foldl (· * ·) 1 = 368640 := by decide +kernel #print axioms A_shape #print axioms lower_entries_strict #print axioms upper_entries_triangular #print axioms lower_entries_reduced #print axioms upper_entries_reduced #print axioms lower_coordinates_distinct #print axioms upper_coordinates_distinct #print axioms L_zero_above #print axioms L_unit_diagonal #print axioms U_zero_below #print axioms LU_eq_A #print axioms U_diagonal_is_pivots #print axioms pivot_product end SutureLDUCertificate011c