import proofs.SutureOpenBranch011c /-! # 011c / S-01c.4 — actual real SD.4 selected minor This module defines the selected full-target minor directly from SD.4 on the real `8 x 4` coframe-coordinate carrier. Its determinant is a finite polynomial expression, so Lean proves its continuity. The separate value-at-`Pi_star` calculation is the remaining attachment to the exact integer certificate in SutureRegular011c. -/ set_option autoImplicit false namespace SutureActualMinor011c open RootFieldLift011a SutureOpenBranch011c SutureRegular011c noncomputable section def eta (a b : Fin 8) : ℝ := match a.val, b.val with | 0, 0 => -2 | 0, 1 => 1 | 1, 0 => 1 | 1, 1 => 2 | 2, 2 => 1 | 3, 3 => 1 | 4, 4 => 1 | 5, 5 => 1 | 6, 6 => 1 | 7, 7 => 1 | _, _ => 0 def chat (a b : Fin 8) : ℝ := match a.val, b.val with | 0, 1 => -1 | 1, 0 => 1 | 2, 3 => -1 | 3, 2 => 1 | 4, 5 => -1 | 5, 4 => 1 | 6, 7 => -1 | 7, 6 => 1 | _, _ => 0 def symMu (r : Fin 10) : Fin 4 := match r.val with | 0 | 1 | 2 | 3 => 0 | 4 | 5 | 6 => 1 | 7 | 8 => 2 | _ => 3 def symNu (r : Fin 10) : Fin 4 := match r.val with | 0 => 0 | 1 | 4 => 1 | 2 | 5 | 7 => 2 | _ => 3 def antiMu (r : Fin 6) : Fin 4 := match r.val with | 0 | 1 | 2 => 0 | 3 | 4 => 1 | _ => 2 def antiNu (r : Fin 6) : Fin 4 := match r.val with | 0 => 1 | 1 | 3 => 2 | _ => 3 def columnA (c : Fin 32) : Fin 8 := ⟨c.val / 4, by omega⟩ def columnMu (c : Fin 32) : Fin 4 := ⟨c.val % 4, Nat.mod_lt _ (by decide)⟩ def dSym (pi : CoframeCoordinates) (r : Fin 10) (c : Fin 32) : ℝ := let mu := symMu r let nu := symNu r let a := columnA c let lam := columnMu c (if lam = mu then ∑ b : Fin 8, eta a b * pi b nu else 0) + (if lam = nu then ∑ b : Fin 8, pi b mu * eta b a else 0) def dAnti (pi : CoframeCoordinates) (r : Fin 6) (c : Fin 32) : ℝ := let mu := antiMu r let nu := antiNu r let a := columnA c let lam := columnMu c (if lam = mu then ∑ b : Fin 8, chat a b * pi b nu else 0) + (if lam = nu then ∑ b : Fin 8, pi b mu * chat b a else 0) def sutureDifferentialEntry (pi : CoframeCoordinates) (r : Fin 16) (c : Fin 32) : ℝ := if h : r.val < 10 then dSym pi ⟨r.val, h⟩ c else dAnti pi ⟨r.val - 10, by omega⟩ c def selectedRow (r : Fin 16) : Fin 16 := match r.val with | 0 => 0 | 1 => 1 | 2 => 2 | 3 => 3 | 4 => 4 | 5 => 5 | 6 => 6 | 7 => 8 | 8 => 10 | 9 => 11 | 10 => 9 | 11 => 7 | 12 => 12 | 13 => 13 | 14 => 14 | _ => 15 def selectedColumn (c : Fin 16) : Fin 32 := match c.val with | 0 => 0 | 1 => 1 | 2 => 2 | 3 => 3 | 4 => 4 | 5 => 5 | 6 => 7 | 7 => 8 | 8 => 9 | 9 => 10 | 10 => 11 | 11 => 12 | 12 => 13 | 13 => 14 | 14 => 16 | _ => 17 def actualMinorMatrix (pi : CoframeCoordinates) : Matrix (Fin 16) (Fin 16) ℝ := fun r c => sutureDifferentialEntry pi (selectedRow r) (selectedColumn c) def actualMinor : CoframeCoordinates → ℝ := fun pi => (actualMinorMatrix pi).det theorem continuous_ite_const {X : Type*} [TopologicalSpace X] {p : Prop} [Decidable p] {f g : X → ℝ} (hf : Continuous f) (hg : Continuous g) : Continuous fun x => if p then f x else g x := by by_cases h : p · simpa [h] using hf · simpa [h] using hg @[fun_prop] theorem entry_continuous (r : Fin 16) (c : Fin 32) : Continuous fun pi : CoframeCoordinates => sutureDifferentialEntry pi r c := by unfold sutureDifferentialEntry split · dsimp [dSym] apply Continuous.add · apply continuous_ite_const · apply continuous_finsetSum intro b _ fun_prop · fun_prop · apply continuous_ite_const · apply continuous_finsetSum intro b _ fun_prop · fun_prop · dsimp [dAnti] apply Continuous.add · apply continuous_ite_const · apply continuous_finsetSum intro b _ fun_prop · fun_prop · apply continuous_ite_const · apply continuous_finsetSum intro b _ fun_prop · fun_prop theorem actualMinor_continuous : Continuous actualMinor := by change Continuous fun pi => (actualMinorMatrix pi).det simp_rw [Matrix.det_apply, actualMinorMatrix] refine continuous_finsetSum _ fun sigma _ => ?_ apply Continuous.smul continuous_const refine continuous_finsetProd _ fun i _ => ?_ exact entry_continuous (selectedRow (sigma i)) (selectedColumn i) /-! This fulfills the continuity premise of `SmoothMinorBridge` for the actual SD.4 selected minor. The value-at-`piStar` equality is isolated below as the one remaining attachment to the kernel-checked integer certificate. -/ def actualMinorBridge (agreement : actualMinor SutureOpenBranch011c.piStar = (regularMinorDeterminant : ℝ)) : SmoothMinorBridge where minor := actualMinor continuousMinor := actualMinor_continuous agreesAtPiStar := agreement theorem actualMinor_open_regular_branch (agreement : actualMinor SutureOpenBranch011c.piStar = (regularMinorDeterminant : ℝ)) : IsOpen (regularBranch (actualMinorBridge agreement)) ∧ SutureOpenBranch011c.piStar ∈ regularBranch (actualMinorBridge agreement) := smooth_regular_branch (actualMinorBridge agreement) def actualMinorSource011c : SourceRef := ⟨"Suture Field Dynamics v0.1", "SD.4 selected 16 by 16 minor written directly over the real coframe carrier in SutureActualMinor011c.lean"⟩ #print axioms entry_continuous #print axioms actualMinor_continuous #print axioms actualMinor_open_regular_branch end end SutureActualMinor011c