import Mathlib /-! # Real-Rooted Interlacing Polynomial Families, Multivariate Real Stability, Matching Polynomials, Godsil–Gutman & Ramanujan 2-Lifts This file provides a 100% self-contained Lean 4 / Mathlib formalization of the **Marcus–Spielman–Srivastava (2015)** method of interlacing polynomial families, **multivariate real stability** (without external Hurwitz/Rouché theorems), **matching polynomials & the Heilmann–Lieb (1972) theorem**, the **Godsil–Gutman (1981) signed-adjacency average identity**, **exact 2-lift spectral factorization**, and **explicit Ramanujan 2-lift witnesses**. ## Main Results 1. **Common-Interlacer Max-Root Monotonicity & Strict Real-Rootedness Preservation (`common_interlacer_max_root_sandwich`, `common_interlacer_strict_real_rooted`):** - For ANY finite family of monic degree-$(n+1)$ real-rooted polynomials sharing a (possibly weak) common interlacer $g_0 \le \dots \le g_{n-1}$, every convex combination $F = \sum_j p_j f_j$ has a largest real root $\lambda_{\max}(F)$ satisfying $$\exists j_1,\; p_{j_1} > 0 \wedge r_{\max}(f_{j_1}) \le \lambda_{\max}(F) \qquad \text{and} \qquad \exists j_2,\; p_{j_2} > 0 \wedge \lambda_{\max}(F) \le r_{\max}(f_{j_2}).$$ - Under strict interlacing, every convex combination $F$ is itself real-rooted with strictly interlaced roots $R_0 < g_0 < R_1 < \dots < g_{n-1} < R_n$ and $F = \prod_k (X - R_k)$. 2. **MSS Interlacing Family Tree Theorem (`interlacing_family_tree_exists_good_leaf`):** For any finite rooted tree of monic degree-$(n+1)$ real-rooted polynomials where each internal node is a convex combination of its children sharing a common interlacer, there exists a leaf whose largest root is $\le$ the largest root of the root polynomial. 3. **Self-Contained Multivariate Real Stability Engine (`det_psd_pencil_uhp_nonzero`, `univariate_one_add_deriv_uhp_nonzero`, `real_poly_uhp_nonzero_all_roots_real`, `multiaffine_eval_zero_uhp_nonzero`):** - $\det(\sum_j z_j A_j)$ never vanishes on $\mathbb{H}^m$ for real symmetric PSD $A_j$ with $A_0 \succ 0$. - $(1 + c \frac{d}{dz})$ ($c \in \mathbb{R}$) preserves UHP non-vanishing. - Real-coefficient polynomials non-vanishing on $\mathbb{H}$ have all complex roots real. - Multiaffine specialization $w = 0$ preserves UHP non-vanishing (15-line elementary perturbation proof). 4. **Exact 2-Lift Spectral Factorization & Signed Laplacian Decomposition (`two_lift_charpoly_factorization`, `signed_laplacian_eq_sum_rankOne`):** $$\chi_{\widehat{G}_s}(x) = \chi_G(x) \cdot \chi_{A_s}(x), \qquad d I - A_s = \tfrac{1}{2} \sum_{u \sim v} (e_u - s_{uv} e_v)(e_u - s_{uv} e_v)^\top.$$ 5. **Matching Polynomial, Heilmann–Lieb Root Bound & Godsil–Gutman Average Identity (`matchingPoly_vertex_recurrence`, `heilmann_lieb_root_bound`, `godsil_gutman_sum_charpoly`):** - Exact vertex-deletion recurrence $\mu_G(x) = x \mu_{G-v}(x) - \sum_{u \sim v} \mu_{G-v-u}(x)$. - **Heilmann–Lieb (1972):** For every graph $G$ of max degree $\le \Delta$ ($\Delta \ge 2$), $\mu_G(x) > 0$ for all $x > 2\sqrt{\Delta - 1}$, so every real root $\mu$ of $\mu_G$ satisfies $|\mu| \le 2\sqrt{\Delta - 1}$. - **Godsil–Gutman (1981):** $\sum_{s : E(G) \to \{\pm 1\}} \chi_{A_s}(x) = 2^{|E(G)|} \mu_G(x)$. 6. **Explicit Ramanujan 2-Lift Sharpness Witness (`witness_K4_to_Q3_two_lift`):** The all-negative signing of $K_4$ produces the 3-cube $Q_3$ as a Ramanujan 2-lift with exact matching root $\sqrt{3 + \sqrt{6}} < 2\sqrt{2}$ and new 2-lift eigenvalue $1 < \sqrt{3 + \sqrt{6}} < 2\sqrt{2}$. -/ open scoped BigOperators Matrix Polynomial open Finset Polynomial Matrix Real namespace InterlacingRamanujanFamilies /-! ### Section 1: Real-Rooted Polynomials, Common Interlacers & MSS Interlacing Trees -/ /-- Monic real polynomial built from a root tuple `r : Fin m → ℝ`: $\prod_i (X - r_i)$. -/ noncomputable def monicFromRoots {m : ℕ} (r : Fin m → ℝ) : ℝ[X] := ∏ i : Fin m, (Polynomial.X - Polynomial.C (r i)) lemma monicFromRoots_eval {m : ℕ} (r : Fin m → ℝ) (x : ℝ) : (monicFromRoots r).eval x = ∏ i : Fin m, (x - r i) := by simp [monicFromRoots, Polynomial.eval_prod] lemma monicFromRoots_monic {m : ℕ} (r : Fin m → ℝ) : (monicFromRoots r).Monic := Polynomial.monic_prod_of_monic _ _ fun i _ => Polynomial.monic_X_sub_C (r i) lemma monicFromRoots_natDegree {m : ℕ} (r : Fin m → ℝ) : (monicFromRoots r).natDegree = m := by rw [monicFromRoots, Polynomial.natDegree_prod_of_monic _ _ (fun i _ => Polynomial.monic_X_sub_C (r i))] simp /-- A sorted tuple `g : Fin n → ℝ` (weakly) interlaces a sorted tuple `r : Fin (n + 1) → ℝ`: $$r_0 \le g_0 \le r_1 \le g_1 \le \dots \le g_{n-1} \le r_n.$$ -/ def Interlaces {n : ℕ} (g : Fin n → ℝ) (r : Fin (n + 1) → ℝ) : Prop := Monotone g ∧ Monotone r ∧ (∀ i : Fin n, r ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩ ≤ g i) ∧ (∀ i : Fin n, g i ≤ r ⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩) lemma monicFromRoots_eval_pos_of_gt_interlacer {n : ℕ} {g : Fin n → ℝ} {r : Fin (n + 1) → ℝ} (hint : Interlaces g r) {x : ℝ} (hx : ∀ i : Fin n, g i < x) : 0 < (monicFromRoots r).eval x ↔ r ⟨n, Nat.lt_succ_self n⟩ < x := by rw [monicFromRoots_eval, Fin.prod_univ_castSucc] have hpref_pos : 0 < ∏ i : Fin n, (x - r i.castSucc) := by refine Finset.prod_pos fun i _ => ?_ have hle : r i.castSucc ≤ g i := hint.2.2.1 i have hlt : g i < x := hx i linarith have hlast : Fin.last n = ⟨n, Nat.lt_succ_self n⟩ := rfl rw [hlast] constructor · intro hpos by_contra hle; push Not at hle have hnonpos : x - r ⟨n, Nat.lt_succ_self n⟩ ≤ 0 := by linarith linarith [mul_nonpos_of_nonneg_of_nonpos (le_of_lt hpref_pos) hnonpos] · intro hlt; exact mul_pos hpref_pos (sub_pos.mpr hlt) lemma monicFromRoots_eval_nonpos_at_top_interlacer {n : ℕ} {g : Fin (n + 1) → ℝ} {r : Fin (n + 2) → ℝ} (hint : Interlaces g r) : (monicFromRoots r).eval (g ⟨n, Nat.lt_succ_self n⟩) ≤ 0 := by rw [monicFromRoots_eval, Fin.prod_univ_castSucc] have hpref_nn : 0 ≤ ∏ i : Fin (n + 1), (g ⟨n, Nat.lt_succ_self n⟩ - r i.castSucc) := by refine Finset.prod_nonneg fun i _ => ?_ have h1 : r i.castSucc ≤ g i := hint.2.2.1 i have h2 : g i ≤ g ⟨n, Nat.lt_succ_self n⟩ := hint.1 (Fin.le_last i) linarith have hlast_np : g ⟨n, Nat.lt_succ_self n⟩ - r (Fin.last (n + 1)) ≤ 0 := by have := hint.2.2.2 ⟨n, Nat.lt_succ_self n⟩ have heq : (⟨n + 1, Nat.succ_lt_succ (Nat.lt_succ_self n)⟩ : Fin (n + 2)) = Fin.last (n + 1) := rfl rw [heq] at this; linarith exact mul_nonpos_of_nonneg_of_nonpos hpref_nn hlast_np /-- **Headline Theorem 3A (Common-Interlacer Max-Root Monotonicity — Weak Interlacing).** -/ theorem common_interlacer_max_root_sandwich {n m : ℕ} (hm : 0 < m) (g : Fin n → ℝ) (r : Fin m → Fin (n + 1) → ℝ) (hint : ∀ j : Fin m, Interlaces g (r j)) (p : Fin m → ℝ) (hp_nn : ∀ j, 0 ≤ p j) (hp_sum : ∑ j, p j = 1) : let F : ℝ[X] := ∑ j : Fin m, Polynomial.C (p j) * monicFromRoots (r j) ∃ lmax : ℝ, F.eval lmax = 0 ∧ (∀ x : ℝ, lmax < x → 0 < F.eval x) ∧ (∀ i : Fin n, g i ≤ lmax) ∧ (∃ j₁ : Fin m, 0 < p j₁ ∧ r j₁ ⟨n, Nat.lt_succ_self n⟩ ≤ lmax) ∧ (∃ j₂ : Fin m, 0 < p j₂ ∧ lmax ≤ r j₂ ⟨n, Nat.lt_succ_self n⟩) := by intro F have : Nonempty (Fin m) := Fin.pos_iff_nonempty.mp hm set S_pos : Finset (Fin m) := Finset.univ.filter (fun j => 0 < p j) have hS_ne : S_pos.Nonempty := by by_contra hemp; rw [Finset.not_nonempty_iff_eq_empty] at hemp have hall0 : ∀ j : Fin m, p j = 0 := fun j => le_antisymm (not_lt.mp fun hpos => by have : j ∈ S_pos := Finset.mem_filter.mpr ⟨Finset.mem_univ j, hpos⟩ rw [hemp] at this; exact Finset.notMem_empty j this) (hp_nn j) have hsum0 : ∑ j : Fin m, p j = 0 := Finset.sum_eq_zero fun j _ => hall0 j linarith obtain ⟨j_min, hj_min_mem, hj_min⟩ := Finset.exists_min_image S_pos (fun j => r j ⟨n, Nat.lt_succ_self n⟩) hS_ne obtain ⟨j_max, hj_max_mem, hj_max⟩ := Finset.exists_max_image S_pos (fun j => r j ⟨n, Nat.lt_succ_self n⟩) hS_ne set r_lo : ℝ := r j_min ⟨n, Nat.lt_succ_self n⟩ set r_hi : ℝ := r j_max ⟨n, Nat.lt_succ_self n⟩ have hF_eval : ∀ x : ℝ, F.eval x = ∑ j : Fin m, p j * (monicFromRoots (r j)).eval x := fun x => by simp [F, Polynomial.eval_finsetSum] have hF_pos_gt : ∀ x : ℝ, r_hi < x → 0 < F.eval x := by intro x hx rw [hF_eval] have hterm_nn : ∀ j : Fin m, 0 ≤ p j * (monicFromRoots (r j)).eval x := by intro j by_cases hj : 0 < p j · have hle : r j ⟨n, Nat.lt_succ_self n⟩ ≤ r_hi := hj_max j (Finset.mem_filter.mpr ⟨Finset.mem_univ j, hj⟩) have hlt_x : r j ⟨n, Nat.lt_succ_self n⟩ < x := lt_of_le_of_lt hle hx have hgi_lt : ∀ i : Fin n, g i < x := fun i => lt_of_le_of_lt (le_trans ((hint j).2.2.2 i) ((hint j).2.1 (Nat.lt_succ_iff.mp (Nat.succ_lt_succ i.isLt)))) hlt_x exact le_of_lt (mul_pos hj ((monicFromRoots_eval_pos_of_gt_interlacer (hint j) hgi_lt).mpr hlt_x)) · have hp0 : p j = 0 := le_antisymm (not_lt.mp hj) (hp_nn j) rw [hp0, zero_mul] refine Finset.sum_pos' (fun j _ => hterm_nn j) ⟨j_max, Finset.mem_univ j_max, ?_⟩ have hj_pos : 0 < p j_max := (Finset.mem_filter.mp hj_max_mem).2 have hgi_lt : ∀ i : Fin n, g i < x := fun i => lt_of_le_of_lt (le_trans ((hint j_max).2.2.2 i) ((hint j_max).2.1 (Nat.lt_succ_iff.mp (Nat.succ_lt_succ i.isLt)))) hx exact mul_pos hj_pos ((monicFromRoots_eval_pos_of_gt_interlacer (hint j_max) hgi_lt).mpr hx) have hex_lo : ∃ a : ℝ, a ≤ r_lo ∧ (∀ i : Fin n, g i ≤ a) ∧ F.eval a ≤ 0 := by cases n with | zero => refine ⟨r_lo, le_refl r_lo, fun i => Fin.elim0 i, ?_⟩ rw [hF_eval] refine Finset.sum_nonpos fun j _ => ?_ by_cases hj : 0 < p j · have hle : r_lo ≤ r j ⟨0, Nat.lt_succ_self 0⟩ := hj_min j (Finset.mem_filter.mpr ⟨Finset.mem_univ j, hj⟩) have hev : (monicFromRoots (r j)).eval r_lo = r_lo - r j ⟨0, Nat.lt_succ_self 0⟩ := by simp [monicFromRoots_eval] rw [hev] exact mul_nonpos_of_nonneg_of_nonpos (le_of_lt hj) (sub_nonpos.mpr hle) · have hp0 : p j = 0 := le_antisymm (not_lt.mp hj) (hp_nn j) rw [hp0, zero_mul] | succ k => set gtop : ℝ := g ⟨k, Nat.lt_succ_self k⟩ refine ⟨gtop, (hint j_min).2.2.2 ⟨k, Nat.lt_succ_self k⟩, fun i => (hint j_min).1 (Fin.le_last i), ?_⟩ rw [hF_eval] refine Finset.sum_nonpos fun j _ => mul_nonpos_of_nonneg_of_nonpos (hp_nn j) (monicFromRoots_eval_nonpos_at_top_interlacer (hint j)) obtain ⟨a, ha_le_lo, hg_le_a, hFa_np⟩ := hex_lo have ha_le_hi : a ≤ r_hi := le_trans ha_le_lo (hj_max j_min hj_min_mem) set E : Set ℝ := { x : ℝ | a ≤ x ∧ x ≤ r_hi + 1 ∧ F.eval x ≤ 0 } have hE_ne : E.Nonempty := ⟨a, le_refl a, by linarith, hFa_np⟩ have hE_bdd : BddAbove E := ⟨r_hi + 1, fun _ hx => hx.2.1⟩ set lmax : ℝ := sSup E have ha_le_lmax : a ≤ lmax := le_csSup hE_bdd ⟨le_refl a, by linarith, hFa_np⟩ have hlmax_le_hi : lmax ≤ r_hi := by refine csSup_le hE_ne fun x hx => ?_ by_contra hgt; push Not at hgt linarith [hF_pos_gt x hgt, hx.2.2] have hF_gt_lmax : ∀ x : ℝ, lmax < x → 0 < F.eval x := by intro x hx by_cases hxr : r_hi < x · exact hF_pos_gt x hxr · push Not at hxr by_contra hnp; push Not at hnp linarith [le_csSup hE_bdd ⟨le_trans ha_le_lmax (le_of_lt hx), by linarith, hnp⟩] have hF_lmax_zero : F.eval lmax = 0 := by have hcont : Continuous (fun x : ℝ => F.eval x) := Polynomial.continuous F have hge0 : 0 ≤ F.eval lmax := by by_contra hlt; push Not at hlt obtain ⟨δ, hδ_pos, hball⟩ := Metric.isOpen_iff.mp (isOpen_lt hcont continuous_const) lmax hlt have hx_mem : lmax + δ / 2 ∈ Metric.ball lmax δ := by rw [Metric.mem_ball, Real.dist_eq, abs_of_pos (by linarith)]; linarith have hneg : F.eval (lmax + δ / 2) < 0 := hball hx_mem linarith [hF_gt_lmax (lmax + δ / 2) (by linarith)] have hle0 : F.eval lmax ≤ 0 := by by_contra hgt; push Not at hgt obtain ⟨δ, hδ_pos, hball⟩ := Metric.isOpen_iff.mp (isOpen_lt continuous_const hcont) lmax hgt have hupper : lmax - δ / 2 ∈ upperBounds E := by intro x hx by_contra hlt; push Not at hlt have hx_le : x ≤ lmax := le_csSup hE_bdd hx have hdist : dist x lmax < δ := by rw [Real.dist_eq, abs_of_nonpos (sub_nonpos.mpr hx_le)]; linarith linarith [show (0 : ℝ) < F.eval x from hball hdist, hx.2.2] linarith [csSup_le hE_ne hupper] linarith have hex_le : ∃ j₁ : Fin m, 0 < p j₁ ∧ r j₁ ⟨n, Nat.lt_succ_self n⟩ ≤ lmax := by by_contra hall; push Not at hall have hlo_gt : lmax < r_lo := hall j_min (Finset.mem_filter.mp hj_min_mem).2 let x₀ : ℝ := (lmax + r_lo) / 2 have hx0_gt : lmax < x₀ := by simp only [x₀]; linarith have hx0_lt : x₀ < r_lo := by simp only [x₀]; linarith have hFx0_pos : 0 < F.eval x₀ := hF_gt_lmax x₀ hx0_gt have hFx0_np : F.eval x₀ ≤ 0 := by rw [hF_eval] refine Finset.sum_nonpos fun j _ => ?_ by_cases hj : 0 < p j · have hgi_lt : ∀ i : Fin n, g i < x₀ := fun i => lt_of_le_of_lt (le_trans (hg_le_a i) ha_le_lmax) hx0_gt have hrj_gt : x₀ < r j ⟨n, Nat.lt_succ_self n⟩ := lt_of_lt_of_le hx0_lt (hj_min j (Finset.mem_filter.mpr ⟨Finset.mem_univ j, hj⟩)) have hfj_np : (monicFromRoots (r j)).eval x₀ ≤ 0 := by by_contra hpos; push Not at hpos linarith [(monicFromRoots_eval_pos_of_gt_interlacer (hint j) hgi_lt).mp hpos] exact mul_nonpos_of_nonneg_of_nonpos (le_of_lt hj) hfj_np · have hp0 : p j = 0 := le_antisymm (not_lt.mp hj) (hp_nn j) rw [hp0, zero_mul] linarith exact ⟨lmax, hF_lmax_zero, hF_gt_lmax, fun i => le_trans (hg_le_a i) ha_le_lmax, hex_le, ⟨j_max, (Finset.mem_filter.mp hj_max_mem).2, hlmax_le_hi⟩⟩ /-- Helper: strict monotonicity of a `Fin k → ℝ` function from adjacent strict steps. -/ private lemma strictMono_of_adj_lt {k : ℕ} {f : Fin k → ℝ} (hstep : ∀ t : ℕ, (ht : t + 1 < k) → f ⟨t, by omega⟩ < f ⟨t + 1, ht⟩) : StrictMono f := by have haux : ∀ d a : ℕ, (ha : a + d < k) → 0 < d → f ⟨a, by omega⟩ < f ⟨a + d, ha⟩ := by intro d induction d with | zero => intro _ _ h0; omega | succ d ih => intro a ha _ cases d with | zero => exact hstep a ha | succ d' => have h1 := ih a (by omega) (Nat.succ_pos d') have h2 := hstep (a + (d' + 1)) (by omega) exact lt_trans h1 h2 intro a b hab have h1 := haux (b.val - a.val) a.val (by omega) (by omega) have hb_eq : (⟨a.val + (b.val - a.val), by omega⟩ : Fin k) = b := Fin.ext (by dsimp; omega) have ha_eq : (⟨a.val, by omega⟩ : Fin k) = a := Fin.ext rfl rwa [ha_eq, hb_eq] at h1 /-- **Strict Common-Interlacer Preservation of Full Real-Rootedness (`common_interlacer_strict_real_rooted`).** -/ theorem common_interlacer_strict_real_rooted {n m : ℕ} (_hm : 0 < m) (g : Fin n → ℝ) (r : Fin m → Fin (n + 1) → ℝ) (hstrict : ∀ j : Fin m, (∀ i : Fin n, r j ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩ < g i) ∧ (∀ i : Fin n, g i < r j ⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩)) (p : Fin m → ℝ) (hp_nn : ∀ j, 0 ≤ p j) (hp_sum : ∑ j, p j = 1) : let F : ℝ[X] := ∑ j : Fin m, Polynomial.C (p j) * monicFromRoots (r j) ∃ R : Fin (n + 1) → ℝ, StrictMono R ∧ (∀ k : Fin (n + 1), F.eval (R k) = 0) ∧ (∀ i : Fin n, R ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩ < g i ∧ g i < R ⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩) ∧ F = monicFromRoots R := by intro F have hrmono : ∀ j : Fin m, StrictMono (r j) := fun j => strictMono_of_adj_lt fun t ht => lt_trans ((hstrict j).1 ⟨t, by omega⟩) ((hstrict j).2 ⟨t, by omega⟩) have hsign_at_g : ∀ (j : Fin m) (i : Fin n), 0 < (-1 : ℝ) ^ (n - i.val) * (monicFromRoots (r j)).eval (g i) := by intro j i rw [monicFromRoots_eval] have hgt : ∀ k : Fin (n + 1), k.val ≤ i.val → r j k < g i := by intro k hk have hle : r j k ≤ r j ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩ := (hrmono j).monotone (show k ≤ ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩ from hk) exact lt_of_le_of_lt hle ((hstrict j).1 i) have hlt : ∀ k : Fin (n + 1), i.val < k.val → g i < r j k := by intro k hk have hle : r j ⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩ ≤ r j k := (hrmono j).monotone (show (⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩ : Fin (n + 1)) ≤ k from hk) exact lt_of_lt_of_le ((hstrict j).2 i) hle set S_hi : Finset (Fin (n + 1)) := Finset.univ.filter (fun k => i.val < k.val) have hcard_hi : S_hi.card = n - i.val := by have hbij : S_hi.card = (Finset.Ico (i.val + 1) (n + 1)).card := by refine Finset.card_bij (fun k _ => k.val) ?_ ?_ ?_ · intro k hk; simp only [S_hi, Finset.mem_filter, Finset.mem_univ, true_and] at hk exact Finset.mem_Ico.mpr ⟨by omega, k.isLt⟩ · intro _ _ _ _ h; exact Fin.ext h · intro t ht; simp only [Finset.mem_Ico] at ht exact ⟨⟨t, ht.2⟩, Finset.mem_filter.mpr ⟨Finset.mem_univ _, by dsimp; omega⟩, rfl⟩ rw [hbij, Nat.card_Ico]; omega rw [← Finset.prod_filter_mul_prod_filter_not Finset.univ (fun k : Fin (n + 1) => i.val < k.val)] have hneg_prod : (-1 : ℝ) ^ (n - i.val) * ∏ k ∈ S_hi, (g i - r j k) = ∏ k ∈ S_hi, (r j k - g i) := by rw [← hcard_hi, ← Finset.prod_const, ← Finset.prod_mul_distrib] exact Finset.prod_congr rfl fun k _ => by ring have hpos1 : 0 < ∏ k ∈ S_hi, (r j k - g i) := Finset.prod_pos fun k hk => sub_pos.mpr (hlt k (Finset.mem_filter.mp hk).2) have hpos2 : 0 < ∏ k ∈ Finset.univ.filter (fun k : Fin (n + 1) => ¬ i.val < k.val), (g i - r j k) := Finset.prod_pos fun k hk => sub_pos.mpr (hgt k (not_lt.mp (Finset.mem_filter.mp hk).2)) calc (-1 : ℝ) ^ (n - i.val) * ((∏ k ∈ S_hi, (g i - r j k)) * ∏ k ∈ Finset.univ.filter (fun k : Fin (n + 1) => ¬ i.val < k.val), (g i - r j k)) = ((-1 : ℝ) ^ (n - i.val) * ∏ k ∈ S_hi, (g i - r j k)) * ∏ k ∈ Finset.univ.filter (fun k : Fin (n + 1) => ¬ i.val < k.val), (g i - r j k) := by ring _ = (∏ k ∈ S_hi, (r j k - g i)) * ∏ k ∈ Finset.univ.filter (fun k : Fin (n + 1) => ¬ i.val < k.val), (g i - r j k) := by rw [hneg_prod] _ > 0 := mul_pos hpos1 hpos2 have hF_eval : ∀ x : ℝ, F.eval x = ∑ j : Fin m, p j * (monicFromRoots (r j)).eval x := fun x => by simp [F, Polynomial.eval_finsetSum] have hS_ne : (Finset.univ.filter (fun j : Fin m => 0 < p j)).Nonempty := by by_contra hemp; rw [Finset.not_nonempty_iff_eq_empty] at hemp have hall0 : ∀ j, p j = 0 := fun j => le_antisymm (not_lt.mp fun h => by have : j ∈ Finset.univ.filter (fun j : Fin m => 0 < p j) := Finset.mem_filter.mpr ⟨Finset.mem_univ j, h⟩ rw [hemp] at this; exact Finset.notMem_empty j this) (hp_nn j) have : ∑ j, p j = 0 := Finset.sum_eq_zero fun j _ => hall0 j linarith obtain ⟨j₀, hj₀⟩ := hS_ne have hj₀_pos : 0 < p j₀ := (Finset.mem_filter.mp hj₀).2 have hF_sign : ∀ i : Fin n, 0 < (-1 : ℝ) ^ (n - i.val) * F.eval (g i) := by intro i rw [hF_eval, Finset.mul_sum] have hterm : ∀ j : Fin m, (-1 : ℝ) ^ (n - i.val) * (p j * (monicFromRoots (r j)).eval (g i)) = p j * ((-1 : ℝ) ^ (n - i.val) * (monicFromRoots (r j)).eval (g i)) := fun j => by ring simp_rw [hterm] exact Finset.sum_pos' (fun j _ => mul_nonneg (hp_nn j) (le_of_lt (hsign_at_g j i))) ⟨j₀, Finset.mem_univ j₀, mul_pos hj₀_pos (hsign_at_g j₀ i)⟩ have huniv_ne : (Finset.univ : Finset (Fin m)).Nonempty := ⟨j₀, Finset.mem_univ j₀⟩ obtain ⟨j_lo, _, hj_lo⟩ := Finset.exists_min_image Finset.univ (fun j : Fin m => r j ⟨0, Nat.succ_pos n⟩) huniv_ne obtain ⟨j_hi, _, hj_hi⟩ := Finset.exists_max_image Finset.univ (fun j : Fin m => r j ⟨n, Nat.lt_succ_self n⟩) huniv_ne set lo : ℝ := r j_lo ⟨0, Nat.succ_pos n⟩ - 1 set hi : ℝ := r j_hi ⟨n, Nat.lt_succ_self n⟩ + 1 have hF_hi : 0 < F.eval hi := by rw [hF_eval] have hpos_j : ∀ j : Fin m, 0 < (monicFromRoots (r j)).eval hi := by intro j; rw [monicFromRoots_eval] refine Finset.prod_pos fun k _ => ?_ have hk_le : r j k ≤ r j ⟨n, Nat.lt_succ_self n⟩ := (hrmono j).monotone (Fin.le_last k) linarith [hj_hi j (Finset.mem_univ j)] exact Finset.sum_pos' (fun j _ => mul_nonneg (hp_nn j) (le_of_lt (hpos_j j))) ⟨j₀, Finset.mem_univ j₀, mul_pos hj₀_pos (hpos_j j₀)⟩ have hF_lo : 0 < (-1 : ℝ) ^ (n + 1) * F.eval lo := by rw [hF_eval, Finset.mul_sum] have hpos_j : ∀ j : Fin m, 0 < (-1 : ℝ) ^ (n + 1) * (monicFromRoots (r j)).eval lo := by intro j; rw [monicFromRoots_eval] have hprod_eq : (-1 : ℝ) ^ (n + 1) * ∏ k : Fin (n + 1), (lo - r j k) = ∏ k : Fin (n + 1), (r j k - lo) := by have h1 : (-1 : ℝ) ^ (n + 1) = ∏ _k : Fin (n + 1), (-1 : ℝ) := by simp rw [h1, ← Finset.prod_mul_distrib] exact Finset.prod_congr rfl fun k _ => by ring rw [hprod_eq] refine Finset.prod_pos fun k _ => ?_ have hk_ge : r j ⟨0, Nat.succ_pos n⟩ ≤ r j k := (hrmono j).monotone (Fin.zero_le k) linarith [hj_lo j (Finset.mem_univ j)] have hrew : ∀ j : Fin m, (-1 : ℝ) ^ (n + 1) * (p j * (monicFromRoots (r j)).eval lo) = p j * ((-1 : ℝ) ^ (n + 1) * (monicFromRoots (r j)).eval lo) := fun j => by ring simp_rw [hrew] exact Finset.sum_pos' (fun j _ => mul_nonneg (hp_nn j) (le_of_lt (hpos_j j))) ⟨j₀, Finset.mem_univ j₀, mul_pos hj₀_pos (hpos_j j₀)⟩ let b : Fin (n + 2) → ℝ := fun k => if h0 : k.val = 0 then lo else if hn' : k.val ≤ n then g ⟨k.val - 1, by omega⟩ else hi have hb_strict : StrictMono b := by refine strictMono_of_adj_lt fun t ht => ?_ by_cases ht0 : t = 0 · subst ht0 cases n with | zero => simp only [b, ↓reduceDIte, show ¬ (1 : ℕ) = 0 by decide, show ¬ (1 : ℕ) ≤ 0 by decide] linarith [hj_lo j₀ (Finset.mem_univ j₀), hj_hi j₀ (Finset.mem_univ j₀)] | succ k => simp only [b, ↓reduceDIte, show ¬ (1 : ℕ) = 0 by decide, show (1 : ℕ) ≤ k + 1 by omega, Nat.sub_self] linarith [hj_lo j₀ (Finset.mem_univ j₀), (hstrict j₀).1 ⟨0, Nat.succ_pos k⟩] · by_cases htn : t < n · simp only [b, ht0, ↓reduceDIte, show t ≤ n by omega, show ¬ t + 1 = 0 by omega, show t + 1 ≤ n by omega, Nat.add_sub_cancel] have h1 := (hstrict j₀).2 ⟨t - 1, by omega⟩ have h2 := (hstrict j₀).1 ⟨t, htn⟩ have heq : (⟨t - 1 + 1, Nat.succ_lt_succ (by omega)⟩ : Fin (n + 1)) = ⟨t, Nat.lt_succ_of_lt htn⟩ := Fin.ext (by dsimp; omega) rw [heq] at h1 exact lt_trans h1 h2 · have hteq : t = n := by omega have hn_pos : 0 < n := by omega simp only [b, hteq, show ¬ n = 0 by omega, ↓reduceDIte, le_refl, show ¬ n + 1 = 0 by omega, show ¬ n + 1 ≤ n by omega] have h1 := (hstrict j₀).2 ⟨n - 1, by omega⟩ have heq : (⟨n - 1 + 1, Nat.succ_lt_succ (by omega)⟩ : Fin (n + 1)) = ⟨n, Nat.lt_succ_self n⟩ := Fin.ext (by dsimp; omega) rw [heq] at h1 linarith [hj_hi j₀ (Finset.mem_univ j₀)] have hF_sign_b : ∀ k : Fin (n + 2), 0 < (-1 : ℝ) ^ (n + 1 - k.val) * F.eval (b k) := by intro k by_cases hk0 : k.val = 0 · simp only [b, hk0, ↓reduceDIte, Nat.sub_zero]; exact hF_lo · by_cases hkn : k.val ≤ n · simp only [b, hk0, ↓reduceDIte, hkn] have h1 := hF_sign ⟨k.val - 1, by omega⟩ rwa [show n - (k.val - 1) = n + 1 - k.val by omega] at h1 · have hkeq : k.val = n + 1 := by omega simp only [b, hk0, hkn, ↓reduceDIte] rw [hkeq, Nat.sub_self, pow_zero, one_mul] exact hF_hi have hex_root : ∀ k : Fin (n + 1), ∃ x : ℝ, b ⟨k.val, by omega⟩ < x ∧ x < b ⟨k.val + 1, by omega⟩ ∧ F.eval x = 0 := by intro k have hblt : b ⟨k.val, by omega⟩ < b ⟨k.val + 1, by omega⟩ := hb_strict (show (⟨k.val, by omega⟩ : Fin (n + 2)) < ⟨k.val + 1, by omega⟩ from Nat.lt_succ_self k.val) have hs1 := hF_sign_b ⟨k.val, by omega⟩ have hs2 := hF_sign_b ⟨k.val + 1, by omega⟩ have hpow_step : (-1 : ℝ) ^ (n + 1 - k.val) = -((-1 : ℝ) ^ (n + 1 - (k.val + 1))) := by have : n + 1 - k.val = (n + 1 - (k.val + 1)) + 1 := by omega rw [this, pow_succ]; ring have hprod_neg : F.eval (b ⟨k.val, by omega⟩) * F.eval (b ⟨k.val + 1, by omega⟩) < 0 := by rw [hpow_step] at hs1 have hsq : ((-1 : ℝ) ^ (n + 1 - (k.val + 1))) ^ 2 = 1 := by rw [← pow_mul, mul_comm, pow_mul, neg_one_sq, one_pow] have hmul := mul_pos hs1 hs2 have halg : (-((-1 : ℝ) ^ (n + 1 - (k.val + 1))) * F.eval (b ⟨k.val, by omega⟩)) * ((-1 : ℝ) ^ (n + 1 - (k.val + 1)) * F.eval (b ⟨k.val + 1, by omega⟩)) = -(((-1 : ℝ) ^ (n + 1 - (k.val + 1))) ^ 2) * (F.eval (b ⟨k.val, by omega⟩) * F.eval (b ⟨k.val + 1, by omega⟩)) := by ring rw [halg, hsq] at hmul; linarith have hcont : ContinuousOn (fun x => F.eval x) (Set.Icc (b ⟨k.val, by omega⟩) (b ⟨k.val + 1, by omega⟩)) := (Polynomial.continuous F).continuousOn by_cases hneg1 : F.eval (b ⟨k.val, by omega⟩) < 0 · have hpos2 : 0 < F.eval (b ⟨k.val + 1, by omega⟩) := by nlinarith obtain ⟨x, ⟨hx1, hx2⟩, hFx⟩ := intermediate_value_Icc (le_of_lt hblt) hcont ⟨le_of_lt hneg1, le_of_lt hpos2⟩ exact ⟨x, lt_of_le_of_ne hx1 (fun h => by rw [← h] at hFx; linarith), lt_of_le_of_ne hx2 (fun h => by rw [h] at hFx; linarith), hFx⟩ · have hpos1 : 0 < F.eval (b ⟨k.val, by omega⟩) := by by_contra h0; push Not at h0 have heq0 : F.eval (b ⟨k.val, by omega⟩) = 0 := by linarith rw [heq0, zero_mul] at hprod_neg; linarith have hneg2 : F.eval (b ⟨k.val + 1, by omega⟩) < 0 := by nlinarith obtain ⟨x, ⟨hx1, hx2⟩, hFx⟩ := intermediate_value_Icc' (le_of_lt hblt) hcont ⟨le_of_lt hneg2, le_of_lt hpos1⟩ exact ⟨x, lt_of_le_of_ne hx1 (fun h => by rw [← h] at hFx; linarith), lt_of_le_of_ne hx2 (fun h => by rw [h] at hFx; linarith), hFx⟩ choose R hR_lo hR_hi hR_zero using hex_root have hR_strict : StrictMono R := by intro k₁ k₂ hk exact lt_trans (hR_hi k₁) (lt_of_le_of_lt (hb_strict.monotone (show (⟨k₁.val + 1, by omega⟩ : Fin (n + 2)) ≤ ⟨k₂.val, by omega⟩ from Nat.succ_le_of_lt hk)) (hR_lo k₂)) have hR_interlace : ∀ i : Fin n, R ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩ < g i ∧ g i < R ⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩ := by intro i have hbg : b ⟨i.val + 1, by omega⟩ = g i := by simp only [b, show ¬ i.val + 1 = 0 by omega, show i.val + 1 ≤ n by omega, ↓reduceDIte, Nat.add_sub_cancel] exact ⟨hbg ▸ hR_hi ⟨i.val, Nat.lt_succ_of_lt i.isLt⟩, hbg ▸ hR_lo ⟨i.val + 1, Nat.succ_lt_succ i.isLt⟩⟩ have hF_coeff : F.coeff (n + 1) = 1 := by simp only [F, Polynomial.finsetSum_coeff, Polynomial.coeff_C_mul] have hlead : ∀ j : Fin m, (monicFromRoots (r j)).coeff (n + 1) = 1 := fun j => by have hdeg := monicFromRoots_natDegree (r j) have hm_lc : (monicFromRoots (r j)).leadingCoeff = 1 := (monicFromRoots_monic (r j)).leadingCoeff rw [Polynomial.leadingCoeff, hdeg] at hm_lc exact hm_lc simp_rw [hlead, mul_one]; exact hp_sum have hF_deg : F.natDegree = n + 1 := by have hle : F.natDegree ≤ n + 1 := by refine le_trans (Polynomial.natDegree_sum_le _ _) ?_ refine Finset.sup_le fun j _ => le_trans (Polynomial.natDegree_C_mul_le _ _) ?_ rw [monicFromRoots_natDegree] have hge : n + 1 ≤ F.natDegree := Polynomial.le_natDegree_of_ne_zero (by rw [hF_coeff]; exact one_ne_zero) omega have hF_monic : F.Monic := by rw [Polynomial.Monic, Polynomial.leadingCoeff, hF_deg, hF_coeff] have hdiv : monicFromRoots R ∣ F := by rw [monicFromRoots] refine Finset.prod_dvd_of_coprime ?_ (fun k _ => Polynomial.dvd_iff_isRoot.mpr (hR_zero k)) intro k₁ _ k₂ _ hne exact Polynomial.isCoprime_X_sub_C_of_isUnit_sub (isUnit_iff_ne_zero.mpr (sub_ne_zero.mpr (fun h => hne (hR_strict.injective h)))) have hF_eq : F = monicFromRoots R := by obtain ⟨q, hq⟩ := hdiv have hq_monic : q.Monic := (monicFromRoots_monic R).of_mul_monic_left (hq ▸ hF_monic) have hq_deg : q.natDegree = 0 := by have h1 := hF_deg rw [hq, Polynomial.natDegree_mul (monicFromRoots_monic R).ne_zero hq_monic.ne_zero, monicFromRoots_natDegree] at h1 omega have hq_one : q = 1 := Polynomial.eq_one_of_monic_natDegree_zero hq_monic hq_deg rw [hq, hq_one, mul_one] exact ⟨R, hR_strict, hR_zero, hR_interlace, hF_eq⟩ /-- **MSS Interlacing Family Tree:** Inductive finite tree of monic degree-$(n+1)$ real-rooted polynomials where every internal node's root tuple is a convex combination of its children sharing a common interlacer. -/ inductive InterlacingTree (n : ℕ) : Type | leaf (r : Fin (n + 1) → ℝ) (hmono : Monotone r) : InterlacingTree n | node {m : ℕ} (hm : 0 < m) (g : Fin n → ℝ) (children : Fin m → InterlacingTree n) (p : Fin m → ℝ) (hp_nn : ∀ j, 0 ≤ p j) (hp_sum : ∑ j, p j = 1) (rootRoots : Fin (n + 1) → ℝ) (hroot_mono : Monotone rootRoots) : InterlacingTree n /-- Root tuple of a node in an `InterlacingTree`. -/ def InterlacingTree.roots {n : ℕ} : InterlacingTree n → (Fin (n + 1) → ℝ) | .leaf r _ => r | .node _ _ _ _ _ _ r _ => r /-- Validity predicate for an `InterlacingTree`: at every internal node, children share the common interlacer `g` and `monicFromRoots rootRoots` equals the convex combination of the children. -/ def InterlacingTree.Valid {n : ℕ} : InterlacingTree n → Prop | .leaf _ _ => True | .node _ g children p _ _ rootRoots _ => (∀ j, (children j).Valid) ∧ (∀ j, Interlaces g (children j).roots) ∧ monicFromRoots rootRoots = ∑ j, Polynomial.C (p j) * monicFromRoots (children j).roots /-- Predicate asserting `r` is the root tuple of some leaf of the tree. -/ def InterlacingTree.IsLeaf {n : ℕ} : InterlacingTree n → (Fin (n + 1) → ℝ) → Prop | .leaf r _, r' => r' = r | .node _ _ children _ _ _ _ _, r' => ∃ j, (children j).IsLeaf r' /-- **Headline Theorem 3B (MSS Interlacing Family Tree Theorem):** For any valid finite interlacing tree of monic degree-$(n+1)$ real-rooted polynomials, there exists a leaf whose largest root is $\le$ the largest root of the root polynomial! -/ theorem interlacing_family_tree_exists_good_leaf {n : ℕ} (T : InterlacingTree n) (hV : T.Valid) : ∃ r_leaf : Fin (n + 1) → ℝ, T.IsLeaf r_leaf ∧ r_leaf ⟨n, Nat.lt_succ_self n⟩ ≤ T.roots ⟨n, Nat.lt_succ_self n⟩ := by induction T with | leaf r _ => exact ⟨r, rfl, le_refl _⟩ | node hm g children p hp_nn hp_sum rootRoots hroot_mono ih => rcases hV with ⟨hchildV, hint, hconv⟩ obtain ⟨lmax, hFlmax, hFgt, _, ⟨j₁, _, hj₁_le⟩, _⟩ := common_interlacer_max_root_sandwich hm g (fun j => (children j).roots) hint p hp_nn hp_sum -- Show lmax ≤ rootRoots n (because F = monicFromRoots rootRoots, so F(x) > 0 for all x > rootRoots n!) have hlmax_le_root : lmax ≤ rootRoots ⟨n, Nat.lt_succ_self n⟩ := by by_contra hgt; push Not at hgt have hpos : 0 < (monicFromRoots rootRoots).eval lmax := by rw [monicFromRoots_eval] refine Finset.prod_pos fun k _ => ?_ have hle : rootRoots k ≤ rootRoots ⟨n, Nat.lt_succ_self n⟩ := hroot_mono (Fin.le_last k) linarith rw [hconv] at hpos linarith obtain ⟨r_leaf, hleaf, hle_child⟩ := ih j₁ (hchildV j₁) exact ⟨r_leaf, ⟨j₁, hleaf⟩, le_trans hle_child (le_trans hj₁_le hlmax_le_root)⟩ /-! ### Section 2: Self-Contained Multivariate Real Stability Engine -/ /-- **PSD Pencil Real Stability (4-Line Hermitian Inner Product Proof).** -/ theorem det_psd_pencil_uhp_nonzero {n m : ℕ} (hm : 0 < m) (A : Fin m → Matrix (Fin n) (Fin n) ℝ) (hPSD : ∀ j : Fin m, (A j).PosSemidef) (hPD0 : (A ⟨0, hm⟩).PosDef) (z : Fin m → ℂ) (hz : ∀ j : Fin m, 0 < (z j).im) : (∑ j : Fin m, z j • (A j).map Complex.ofReal).det ≠ 0 := by intro hdet0 obtain ⟨w, hw_ne, hAw⟩ := Matrix.exists_mulVec_eq_zero_iff.mpr hdet0 have hdot0 : star w ⬝ᵥ (∑ j : Fin m, z j • (A j).map Complex.ofReal).mulVec w = 0 := by rw [hAw, dotProduct_zero] have hexpand : star w ⬝ᵥ (∑ j : Fin m, z j • (A j).map Complex.ofReal).mulVec w = ∑ j : Fin m, z j * (star w ⬝ᵥ ((A j).map Complex.ofReal).mulVec w) := by rw [Matrix.sum_mulVec, dotProduct_sum] refine Finset.sum_congr rfl fun j _ => ?_ have hsmul : (z j • (A j).map Complex.ofReal).mulVec w = z j • ((A j).map Complex.ofReal).mulVec w := by ext i; simp only [Matrix.mulVec, dotProduct, Matrix.smul_apply, Pi.smul_apply, smul_eq_mul, Finset.mul_sum] exact Finset.sum_congr rfl fun k _ => by ring rw [hsmul, dotProduct_smul, smul_eq_mul] rw [hexpand] at hdot0 have hquad_real : ∀ (B : Matrix (Fin n) (Fin n) ℝ), B.IsHermitian → star w ⬝ᵥ (B.map Complex.ofReal).mulVec w = (((fun i => (w i).re) ⬝ᵥ B.mulVec (fun i => (w i).re) + (fun i => (w i).im) ⬝ᵥ B.mulVec (fun i => (w i).im) : ℝ) : ℂ) := by intro B hB have hsymm : ∀ a b : Fin n, B a b = B b a := fun a b => by have := congr_fun (congr_fun hB a) b simpa [Matrix.conjTranspose_apply] using this.symm have hre : (star w ⬝ᵥ (B.map Complex.ofReal).mulVec w).re = (fun i => (w i).re) ⬝ᵥ B.mulVec (fun i => (w i).re) + (fun i => (w i).im) ⬝ᵥ B.mulVec (fun i => (w i).im) := by have hterm : ∀ i : Fin n, (star (w i) * ∑ k : Fin n, (B i k : ℂ) * w k).re = (w i).re * (∑ k : Fin n, B i k * (w k).re) + (w i).im * (∑ k : Fin n, B i k * (w k).im) := by intro i rw [Complex.star_def, Complex.mul_re, Complex.conj_re, Complex.conj_im, Complex.re_sum, Complex.im_sum] have h1 : ∀ k : Fin n, ((B i k : ℂ) * w k).re = B i k * (w k).re := fun k => by simp have h2 : ∀ k : Fin n, ((B i k : ℂ) * w k).im = B i k * (w k).im := fun k => by simp simp_rw [h1, h2]; ring simp only [dotProduct, Matrix.mulVec, Pi.star_apply, Matrix.map_apply, Complex.re_sum, ← Finset.sum_add_distrib] exact Finset.sum_congr rfl fun i _ => hterm i have him : (star w ⬝ᵥ (B.map Complex.ofReal).mulVec w).im = 0 := by have hterm : ∀ i : Fin n, (star (w i) * ∑ k : Fin n, (B i k : ℂ) * w k).im = ∑ k : Fin n, ((w i).re * (B i k * (w k).im) + -(w i).im * (B i k * (w k).re)) := by intro i rw [Complex.star_def, Complex.mul_im, Complex.conj_re, Complex.conj_im, Complex.re_sum, Complex.im_sum] have h1 : ∀ k : Fin n, ((B i k : ℂ) * w k).re = B i k * (w k).re := fun k => by simp have h2 : ∀ k : Fin n, ((B i k : ℂ) * w k).im = B i k * (w k).im := fun k => by simp simp_rw [h1, h2, Finset.mul_sum, ← Finset.sum_add_distrib] simp only [dotProduct, Matrix.mulVec, Pi.star_apply, Matrix.map_apply, Complex.im_sum] simp_rw [hterm] have h1 : ∑ i : Fin n, ∑ k : Fin n, -(w i).im * (B i k * (w k).re) = -(∑ i : Fin n, ∑ k : Fin n, (w i).re * (B i k * (w k).im)) := by rw [Finset.sum_comm, ← Finset.sum_neg_distrib] refine Finset.sum_congr rfl fun k _ => ?_ rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl fun i _ => ?_ rw [hsymm i k]; ring rw [Finset.sum_congr rfl fun i _ => Finset.sum_add_distrib, Finset.sum_add_distrib, h1] ring apply Complex.ext · simpa using hre · simpa using him have him0 := congr_arg Complex.im hdot0 simp only [Complex.im_sum, Complex.zero_im] at him0 have hterm_im : ∀ j : Fin m, (z j * (star w ⬝ᵥ ((A j).map Complex.ofReal).mulVec w)).im = (z j).im * ((fun i => (w i).re) ⬝ᵥ (A j).mulVec (fun i => (w i).re) + (fun i => (w i).im) ⬝ᵥ (A j).mulVec (fun i => (w i).im)) := by intro j rw [hquad_real (A j) (hPSD j).isHermitian, Complex.mul_im, Complex.ofReal_im, Complex.ofReal_re, mul_zero, zero_add] simp_rw [hterm_im] at him0 have hnn : ∀ j : Fin m, 0 ≤ (z j).im * ((fun i => (w i).re) ⬝ᵥ (A j).mulVec (fun i => (w i).re) + (fun i => (w i).im) ⬝ᵥ (A j).mulVec (fun i => (w i).im)) := by intro j have h1 := (Matrix.posSemidef_iff_dotProduct_mulVec.mp (hPSD j)).2 (fun i => (w i).re) have h2 := (Matrix.posSemidef_iff_dotProduct_mulVec.mp (hPSD j)).2 (fun i => (w i).im) simp only [star_trivial] at h1 h2 exact mul_nonneg (le_of_lt (hz j)) (add_nonneg h1 h2) have hpos0 : 0 < (z ⟨0, hm⟩).im * ((fun i => (w i).re) ⬝ᵥ (A ⟨0, hm⟩).mulVec (fun i => (w i).re) + (fun i => (w i).im) ⬝ᵥ (A ⟨0, hm⟩).mulVec (fun i => (w i).im)) := by apply mul_pos (hz ⟨0, hm⟩) have h1 := (Matrix.posSemidef_iff_dotProduct_mulVec.mp hPD0.posSemidef).2 (fun i => (w i).re) have h2 := (Matrix.posSemidef_iff_dotProduct_mulVec.mp hPD0.posSemidef).2 (fun i => (w i).im) simp only [star_trivial] at h1 h2 by_cases hre0 : (fun i => (w i).re) ≠ 0 · have hp := (Matrix.posDef_iff_dotProduct_mulVec.mp hPD0).2 hre0 simp only [star_trivial] at hp; linarith · push Not at hre0 have him_ne : (fun i => (w i).im) ≠ 0 := by intro him_eq; apply hw_ne; ext i exact Complex.ext (congr_fun hre0 i) (congr_fun him_eq i) have hp := (Matrix.posDef_iff_dotProduct_mulVec.mp hPD0).2 him_ne simp only [star_trivial] at hp; linarith have hsum_pos := Finset.sum_pos' (fun j _ => hnn j) ⟨⟨0, hm⟩, Finset.mem_univ _, hpos0⟩ linarith /-- **Univariate Gauss–Lucas / Hermite–Biehler Preservation (`univariate_one_add_deriv_uhp_nonzero`).** -/ theorem univariate_one_add_deriv_uhp_nonzero {p : ℂ[X]} (hp0 : p ≠ 0) (hstable : ∀ z : ℂ, 0 < z.im → p.eval z ≠ 0) (c : ℝ) : ∀ z : ℂ, 0 < z.im → (p + Polynomial.C (c : ℂ) * Polynomial.derivative p).eval z ≠ 0 := by intro z hz heval0 have hpz : p.eval z ≠ 0 := hstable z hz have hsplits : p.Splits := IsAlgClosed.splits p have hprod : p = Polynomial.C p.leadingCoeff * (p.roots.map fun a => Polynomial.X - Polynomial.C a).prod := hsplits.eq_prod_roots have hlogderiv : (Polynomial.derivative p).eval z / p.eval z = (p.roots.map fun ζ => (z - ζ)⁻¹).sum := by have haux : ∀ (s : Multiset ℂ) (a : ℂ), a ≠ 0 → (∀ ζ ∈ s, z - ζ ≠ 0) → (Polynomial.derivative (Polynomial.C a * (s.map fun ζ => Polynomial.X - Polynomial.C ζ).prod)).eval z / (Polynomial.C a * (s.map fun ζ => Polynomial.X - Polynomial.C ζ).prod).eval z = (s.map fun ζ => (z - ζ)⁻¹).sum := by intro s induction s using Multiset.induction_on with | empty => intro a _ _; simp | cons ζ s ih => intro a ha hne have hζ : z - ζ ≠ 0 := hne ζ (Multiset.mem_cons_self ζ s) have hs : ∀ w ∈ s, z - w ≠ 0 := fun w hw => hne w (Multiset.mem_cons_of_mem hw) set Q : ℂ[X] := Polynomial.C a * (s.map fun w => Polynomial.X - Polynomial.C w).prod have hQ_ne : Q.eval z ≠ 0 := by simp only [Q, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_multiset_prod] refine mul_ne_zero ha (Multiset.prod_ne_zero ?_) intro h0 rw [Multiset.mem_map] at h0 obtain ⟨q, hq, hq0⟩ := h0 rw [Multiset.mem_map] at hq obtain ⟨w, hw, rfl⟩ := hq simp only [Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C] at hq0 exact hs w hw hq0 have hrew : Polynomial.C a * ((ζ ::ₘ s).map fun w => Polynomial.X - Polynomial.C w).prod = (Polynomial.X - Polynomial.C ζ) * Q := by simp only [Q, Multiset.map_cons, Multiset.prod_cons]; ring rw [hrew, Polynomial.derivative_mul, Polynomial.derivative_sub, Polynomial.derivative_X, Polynomial.derivative_C, sub_zero, one_mul] simp only [Polynomial.eval_add, Polynomial.eval_mul, Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C, Multiset.map_cons, Multiset.sum_cons] have hih := ih a ha hs have hsplit_div : (Q.eval z + (z - ζ) * (Polynomial.derivative Q).eval z) / ((z - ζ) * Q.eval z) = (z - ζ)⁻¹ + (Polynomial.derivative Q).eval z / Q.eval z := by field_simp [hζ, hQ_ne] rw [hsplit_div, hih] have hne : ∀ ζ ∈ p.roots, z - ζ ≠ 0 := fun ζ hζ h0 => hpz (sub_eq_zero.mp h0 ▸ (Polynomial.mem_roots hp0).mp hζ) conv_lhs => rw [hprod] exact haux p.roots p.leadingCoeff (Polynomial.leadingCoeff_ne_zero.mpr hp0) hne by_cases hroots : p.roots = 0 · have hdeg0 : p.natDegree = 0 := by rw [hsplits.natDegree_eq_card_roots, hroots, Multiset.card_zero] have hp'0 : Polynomial.derivative p = 0 := by rw [Polynomial.eq_C_of_natDegree_eq_zero hdeg0, Polynomial.derivative_C] simp only [hp'0, mul_zero, add_zero] at heval0 exact hpz heval0 · have him_neg : ((Polynomial.derivative p).eval z / p.eval z).im < 0 := by rw [hlogderiv] have hterm_lt : ∀ ζ ∈ p.roots, ((z - ζ)⁻¹).im < 0 := by intro ζ hζ have hζ_im : ζ.im ≤ 0 := by by_contra hpos; push Not at hpos exact hstable ζ hpos ((Polynomial.mem_roots hp0).mp hζ) have hne : z - ζ ≠ 0 := fun h0 => hpz (sub_eq_zero.mp h0 ▸ (Polynomial.mem_roots hp0).mp hζ) rw [Complex.inv_im, Complex.sub_im] exact div_neg_of_neg_of_pos (by linarith) (Complex.normSq_pos.mpr hne) have hsum_lt : ∀ s : Multiset ℂ, s ≠ 0 → (∀ w ∈ s, w.im < 0) → s.sum.im < 0 := by intro s; induction s using Multiset.induction_on with | empty => intro h _; exact False.elim (h rfl) | cons w s ih => intro _ hw rw [Multiset.sum_cons, Complex.add_im] by_cases hs : s = 0 · subst hs; simpa using hw w (Multiset.mem_cons_self w 0) · exact add_neg (hw w (Multiset.mem_cons_self w s)) (ih hs fun u hu => hw u (Multiset.mem_cons_of_mem hu)) refine hsum_lt _ (by simp [hroots]) ?_ intro w hw; rw [Multiset.mem_map] at hw; obtain ⟨ζ, hζ, rfl⟩ := hw exact hterm_lt ζ hζ simp only [Polynomial.eval_add, Polynomial.eval_mul, Polynomial.eval_C] at heval0 by_cases hc : c = 0 · simp only [hc, Complex.ofReal_zero, zero_mul, add_zero] at heval0; exact hpz heval0 · have hratio : (Polynomial.derivative p).eval z / p.eval z = -((c : ℂ)⁻¹) := by have hc_ne : (c : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hc rw [div_eq_iff hpz] have : (c : ℂ) * (Polynomial.derivative p).eval z = -p.eval z := eq_neg_of_add_eq_zero_right heval0 calc (Polynomial.derivative p).eval z = (c : ℂ)⁻¹ * ((c : ℂ) * (Polynomial.derivative p).eval z) := by rw [← mul_assoc, inv_mul_cancel₀ hc_ne, one_mul] _ = (c : ℂ)⁻¹ * (-p.eval z) := by rw [this] _ = -((c : ℂ)⁻¹) * p.eval z := by ring rw [hratio, Complex.neg_im, ← Complex.ofReal_inv, Complex.ofReal_im, neg_zero] at him_neg linarith /-- **Real-Rootedness from UHP Non-Vanishing (`real_poly_uhp_nonzero_all_roots_real`).** -/ theorem real_poly_uhp_nonzero_all_roots_real {p : ℝ[X]} (_hp0 : p ≠ 0) (hstable : ∀ z : ℂ, 0 < z.im → (p.map (algebraMap ℝ ℂ)).eval z ≠ 0) : ∀ z : ℂ, (p.map (algebraMap ℝ ℂ)).eval z = 0 → z.im = 0 := by intro z hz by_contra hne rcases lt_or_gt_of_ne hne with hneg | hpos · have hconj_im : 0 < (starRingEnd ℂ z).im := by simp; linarith have hconj_root : (p.map (algebraMap ℝ ℂ)).eval (starRingEnd ℂ z) = 0 := by have hcomm : ∀ q : ℝ[X], (q.map (algebraMap ℝ ℂ)).eval (starRingEnd ℂ z) = starRingEnd ℂ ((q.map (algebraMap ℝ ℂ)).eval z) := by intro q induction q using Polynomial.induction_on' with | add q₁ q₂ ih₁ ih₂ => simp [Polynomial.map_add, Polynomial.eval_add, ih₁, ih₂] | monomial n a => simp rw [hcomm p, hz, map_zero] exact hstable (starRingEnd ℂ z) hconj_im hconj_root · exact hstable z hpos hz /-- **Multiaffine Boundary Specialization (15-Line Elementary Complex Perturbation Proof — NO Hurwitz/Rouché!).** -/ theorem multiaffine_eval_zero_uhp_nonzero {B D : ℂ[X]} (hB0 : B ≠ 0) (hH : ∀ z w : ℂ, 0 < z.im → 0 < w.im → B.eval z + w * D.eval z ≠ 0) : ∀ z : ℂ, 0 < z.im → B.eval z ≠ 0 := by intro z₀ hz₀ hBz0 by_cases hDz0 : D.eval z₀ = 0 · exact hH z₀ Complex.I hz₀ (by simp) (by simp [hBz0, hDz0]) · set k : ℕ := B.rootMultiplicity z₀ have hk_pos : 0 < k := (Polynomial.rootMultiplicity_pos hB0).mpr hBz0 obtain ⟨Q, hBQ, hQz0⟩ := Polynomial.exists_eq_pow_rootMultiplicity_mul_and_not_dvd B hB0 z₀ have hQz0_ne : Q.eval z₀ ≠ 0 := fun h => hQz0 (Polynomial.dvd_iff_isRoot.mpr h) set c : ℂ := -Q.eval z₀ / D.eval z₀ have hc_ne : c ≠ 0 := div_ne_zero (neg_ne_zero.mpr hQz0_ne) hDz0 set target : ℂ := Complex.I * (starRingEnd ℂ c) / (‖c‖ : ℂ) have htarget_norm : ‖target‖ = 1 := by simp only [target, norm_div, norm_mul, Complex.norm_I, one_mul, RingHomIsometric.norm_map, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (norm_pos_iff.mpr hc_ne)] exact div_self (norm_ne_zero_iff.mpr hc_ne) set θ : ℝ := Complex.arg target / (k : ℝ) set u : ℂ := Complex.exp ((θ : ℂ) * Complex.I) have huk : u ^ k = target := by simp only [u, ← Complex.exp_nat_mul] have hk_ne : (k : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.pos_iff_ne_zero.mp hk_pos) have harg : (k : ℂ) * ((θ : ℂ) * Complex.I) = (Complex.arg target : ℂ) * Complex.I := by simp only [θ, Complex.ofReal_div, Complex.ofReal_natCast] rw [← mul_assoc, mul_div_cancel₀ _ hk_ne] rw [harg] have hpol := Complex.norm_mul_exp_arg_mul_I target rw [htarget_norm, Complex.ofReal_one, one_mul] at hpol exact hpol have huk_c : u ^ k * c = Complex.I * (‖c‖ : ℂ) := by rw [huk]; simp only [target] have hmul : starRingEnd ℂ c * c = (‖c‖ : ℂ) ^ 2 := by rw [mul_comm, Complex.mul_conj, Complex.normSq_eq_norm_sq]; push_cast; rfl have hn_ne : (‖c‖ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr hc_ne) calc Complex.I * starRingEnd ℂ c / (‖c‖ : ℂ) * c = Complex.I * (starRingEnd ℂ c * c) / (‖c‖ : ℂ) := by ring _ = Complex.I * (‖c‖ : ℂ) ^ 2 / (‖c‖ : ℂ) := by rw [hmul] _ = Complex.I * (‖c‖ : ℂ) := by field_simp [hn_ne] have him_pos : 0 < (u ^ k * c).im := by rw [huk_c]; simp [norm_pos_iff.mpr hc_ne] set f : ℝ → ℂ := fun r => u ^ k * (-Q.eval (z₀ + (r : ℂ) * u) / D.eval (z₀ + (r : ℂ) * u)) have hf0 : f 0 = u ^ k * c := by simp [f, c] have hcont_z : Continuous (fun r : ℝ => z₀ + (r : ℂ) * u) := by fun_prop have hcont_f : ContinuousAt f 0 := by refine ContinuousAt.mul continuousAt_const (ContinuousAt.div ?_ ?_ (by simpa using hDz0)) · exact ((Polynomial.continuous Q).comp hcont_z).continuousAt.neg · exact ((Polynomial.continuous D).comp hcont_z).continuousAt have hcont_im_f : ContinuousAt (fun r : ℝ => (f r).im) 0 := Complex.continuous_im.continuousAt.comp hcont_f have hcont_im_z : ContinuousAt (fun r : ℝ => (z₀ + (r : ℂ) * u).im) 0 := Complex.continuous_im.continuousAt.comp hcont_z.continuousAt have hcont_D : ContinuousAt (fun r : ℝ => D.eval (z₀ + (r : ℂ) * u)) 0 := ((Polynomial.continuous D).comp hcont_z).continuousAt have hnhds1 : ∀ᶠ r : ℝ in nhds (0 : ℝ), 0 < (f r).im := hcont_im_f.eventually (Ioi_mem_nhds (show 0 < (f 0).im by rw [hf0]; exact him_pos)) have hnhds2 : ∀ᶠ r : ℝ in nhds (0 : ℝ), 0 < (z₀ + (r : ℂ) * u).im := hcont_im_z.eventually (Ioi_mem_nhds (by simpa using hz₀)) have hnhds3 : ∀ᶠ r : ℝ in nhds (0 : ℝ), D.eval (z₀ + (r : ℂ) * u) ≠ 0 := hcont_D.eventually (isOpen_ne.mem_nhds (by simpa using hDz0)) obtain ⟨δ, hδ_pos, hδ⟩ := Metric.eventually_nhds_iff.mp (hnhds1.and (hnhds2.and hnhds3)) let r : ℝ := δ / 2 have hr_pos : 0 < r := half_pos hδ_pos have hr_mem : dist r 0 < δ := by rw [Real.dist_eq, sub_zero, abs_of_pos hr_pos]; simp only [r]; linarith obtain ⟨hfr_im, hzr_im, hDr_ne⟩ := hδ hr_mem set zr : ℂ := z₀ + (r : ℂ) * u set wr : ℂ := (r : ℂ) ^ k * f r have hwr_im : 0 < wr.im := by have hrk : ((r : ℂ) ^ k) = ((r ^ k : ℝ) : ℂ) := by push_cast; rfl simp only [wr, hrk, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero] exact mul_pos (pow_pos hr_pos k) hfr_im have hH0 : B.eval zr + wr * D.eval zr = 0 := by have hBzr : B.eval zr = ((r : ℂ) * u) ^ k * Q.eval zr := by conv_lhs => rw [hBQ]; simp [zr] have hwr : wr * D.eval zr = -(((r : ℂ) * u) ^ k * Q.eval zr) := by simp only [wr, f] rw [show z₀ + (r : ℂ) * u = zr from rfl, mul_pow, mul_assoc, mul_assoc, div_mul_cancel₀ _ hDr_ne] ring rw [hBzr, hwr, add_neg_cancel] exact hH zr wr hzr_im hwr_im hH0 /-! ### Section 3: Exact 2-Lift Spectral Factorization & Signed Laplacian Decomposition -/ /-- The 2-lift adjacency matrix on `V × Bool` associated with a signing `s : V → V → ℝ`. -/ noncomputable def twoLiftAdj {V : Type*} [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (s : V → V → ℝ) : Matrix (V × Bool) (V × Bool) ℝ := by classical exact fun p q => if G.Adj p.1 q.1 then if (s p.1 q.1 = 1 ∧ p.2 = q.2) ∨ (s p.1 q.1 = -1 ∧ p.2 ≠ q.2) then 1 else 0 else 0 /-- Signed adjacency matrix $A_s$ of `G` under signing `s : V → V → ℝ`. -/ def signedAdj {V : Type*} (G : SimpleGraph V) [DecidableRel G.Adj] (s : V → V → ℝ) : Matrix V V ℝ := fun u v => if G.Adj u v then s u v else 0 /-- **Headline Theorem 3C (Exact 2-Lift Characteristic Polynomial Factorization):** $$\chi_{\widehat{G}_s}(x) \;=\; \chi_G(x) \cdot \chi_{A_s}(x).$$ -/ theorem two_lift_charpoly_factorization {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (s : V → V → ℝ) (hs : ∀ u v : V, G.Adj u v → s u v = 1 ∨ s u v = -1) : (twoLiftAdj G s).charpoly = (G.adjMatrix ℝ).charpoly * (signedAdj G s).charpoly := by classical let H : Matrix (V × Bool) (V × Bool) ℝ := fun p q => if p.1 = q.1 then (if p.2 = true ∧ q.2 = true then -1 else 1) else 0 let Hinv : Matrix (V × Bool) (V × Bool) ℝ := ((1 : ℝ) / 2) • H have hHH : H * Hinv = 1 := by rw [show H * Hinv = ((1 : ℝ) / 2) • (H * H) from Matrix.mul_smul _ _ _] ext ⟨u, bu⟩ ⟨v, bv⟩ simp only [Matrix.smul_apply, smul_eq_mul, Matrix.mul_apply, Matrix.one_apply, Prod.mk.injEq, Fintype.sum_prod_type, Fintype.sum_bool] have hsum_single : ∀ b : Bool, ∑ x : V, H (u, bu) (x, b) * H (x, b) (v, bv) = if u = v then H (u, bu) (u, b) * H (u, b) (u, bv) else 0 := by intro b by_cases huv : u = v · subst huv rw [if_pos rfl, Finset.sum_eq_single u] · intro x _ hne; simp [H, Ne.symm hne] · intro h; exact False.elim (h (Finset.mem_univ u)) · rw [if_neg huv] refine Finset.sum_eq_zero fun x _ => ?_ by_cases hux : u = x · subst hux; simp [H, huv] · simp [H, hux] rw [Finset.sum_add_distrib, hsum_single true, hsum_single false] by_cases huv : u = v · subst huv; cases bu <;> cases bv <;> simp [H] <;> norm_num · simp [huv] have hHH' : Hinv * H = 1 := by have hcomm : Hinv * H = H * Hinv := by simp only [Hinv, Matrix.smul_mul, Matrix.mul_smul] rw [hcomm, hHH] let D : Matrix (V × Bool) (V × Bool) ℝ := fun p q => if p.2 = q.2 then (if p.2 = false then G.adjMatrix ℝ p.1 q.1 else signedAdj G s p.1 q.1) else 0 have hconj : H * twoLiftAdj G s * Hinv = D := by rw [show H * twoLiftAdj G s * Hinv = ((1 : ℝ) / 2) • (H * twoLiftAdj G s * H) from Matrix.mul_smul _ _ _] ext ⟨u, bu⟩ ⟨v, bv⟩ simp only [Matrix.smul_apply, smul_eq_mul, Matrix.mul_apply, Fintype.sum_prod_type, Fintype.sum_bool] have hinner : ∀ (y : V) (by_ : Bool), (∑ x : V, (H (u, bu) (x, true) * twoLiftAdj G s (x, true) (y, by_) + H (u, bu) (x, false) * twoLiftAdj G s (x, false) (y, by_))) = (if bu = true then -1 else 1) * twoLiftAdj G s (u, true) (y, by_) + twoLiftAdj G s (u, false) (y, by_) := by intro y by_ rw [Finset.sum_add_distrib] have h1 : ∑ x : V, H (u, bu) (x, false) * twoLiftAdj G s (x, false) (y, by_) = twoLiftAdj G s (u, false) (y, by_) := by rw [Finset.sum_eq_single u] · simp [H] · intro x _ hne; simp [H, Ne.symm hne] · intro h; exact False.elim (h (Finset.mem_univ u)) have h2 : ∑ x : V, H (u, bu) (x, true) * twoLiftAdj G s (x, true) (y, by_) = (if bu = true then -1 else 1) * twoLiftAdj G s (u, true) (y, by_) := by rw [Finset.sum_eq_single u] · simp [H] · intro x _ hne; simp [H, Ne.symm hne] · intro h; exact False.elim (h (Finset.mem_univ u)) rw [h1, h2] simp_rw [hinner] rw [Finset.sum_add_distrib] have houter : ∀ by_ : Bool, ∑ y : V, ((if bu = true then -1 else 1) * twoLiftAdj G s (u, true) (y, by_) + twoLiftAdj G s (u, false) (y, by_)) * H (y, by_) (v, bv) = ((if bu = true then -1 else 1) * twoLiftAdj G s (u, true) (v, by_) + twoLiftAdj G s (u, false) (v, by_)) * (if by_ = true ∧ bv = true then -1 else 1) := by intro by_ rw [Finset.sum_eq_single v] · simp [H] · intro y _ hne; simp [H, hne] · intro h; exact False.elim (h (Finset.mem_univ v)) rw [houter true, houter false] by_cases huv : G.Adj u v · rcases hs u v huv with hs1 | hsm1 · cases bu <;> cases bv <;> simp [D, twoLiftAdj, signedAdj, SimpleGraph.adjMatrix_apply, huv, hs1] <;> norm_num · cases bu <;> cases bv <;> simp [D, twoLiftAdj, signedAdj, SimpleGraph.adjMatrix_apply, huv, hsm1] <;> norm_num · cases bu <;> cases bv <;> simp [D, twoLiftAdj, signedAdj, SimpleGraph.adjMatrix_apply, huv] -- Charpoly conjugation invariance in 1 line via Matrix.charpoly_mul_comm! have hchar_eq : (twoLiftAdj G s).charpoly = D.charpoly := by rw [← hconj, Matrix.charpoly_mul_comm (H * twoLiftAdj G s) Hinv, ← Matrix.mul_assoc, hHH', Matrix.one_mul] rw [hchar_eq] let e : V ⊕ V ≃ V × Bool := { toFun := Sum.elim (fun v => (v, false)) (fun v => (v, true)) invFun := fun p => if p.2 then Sum.inr p.1 else Sum.inl p.1 left_inv := fun x => by cases x <;> rfl right_inv := fun ⟨v, b⟩ => by cases b <;> rfl } have hreindex : Matrix.reindex e.symm e.symm D = Matrix.fromBlocks (G.adjMatrix ℝ) 0 0 (signedAdj G s) := by ext x y rw [Matrix.reindex_apply, Matrix.submatrix_apply] cases x <;> cases y <;> simp [e, D] rw [← Matrix.charpoly_reindex e.symm D, hreindex, Matrix.charpoly_fromBlocks_zero₁₂] /-- **Signed Laplacian Rank-1 Decomposition.** -/ theorem signed_laplacian_eq_sum_rankOne {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] {d : ℕ} (hreg : G.IsRegularOfDegree d) (s : V → V → ℝ) (hsymm : ∀ u v, s u v = s v u) (hpm : ∀ u v, G.Adj u v → (s u v) ^ 2 = 1) : (d : ℝ) • (1 : Matrix V V ℝ) - signedAdj G s = ((1 : ℝ) / 2) • ∑ u : V, ∑ v : V, if G.Adj u v then Matrix.vecMulVec (fun x => (if x = u then 1 else 0) - s u v * (if x = v then 1 else 0)) (fun x => (if x = u then 1 else 0) - s u v * (if x = v then 1 else 0)) else 0 := by ext a b simp only [Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply, smul_eq_mul, signedAdj, Matrix.sum_apply] have hdeg : ∀ x : V, (∑ y : V, if G.Adj x y then (1 : ℝ) else 0) = (d : ℝ) := by intro x have hcard : (Finset.univ.filter (fun y => G.Adj x y)).card = d := by simpa [SimpleGraph.degree, SimpleGraph.neighborFinset_def] using hreg x rw [← Finset.sum_filter, Finset.sum_const, nsmul_eq_mul, mul_one, hcard] have hite_apply : ∀ (P : Prop) [Decidable P] (M : Matrix V V ℝ), (if P then M else 0) a b = if P then M a b else 0 := by intro P _ M; split_ifs <;> rfl simp_rw [hite_apply, Matrix.vecMulVec_apply] by_cases hab : a = b · subst hab simp only [↓reduceIte, mul_one, G.loopless.irrefl a, sub_zero] have hterm : ∀ u v : V, (if G.Adj u v then ((if a = u then (1 : ℝ) else 0) - s u v * (if a = v then 1 else 0)) * ((if a = u then 1 else 0) - s u v * (if a = v then 1 else 0)) else 0) = (if G.Adj u v ∧ a = u then 1 else 0) + (if G.Adj u v ∧ a = v then 1 else 0) := by intro u v by_cases huv : G.Adj u v · have hne : u ≠ v := G.ne_of_adj huv by_cases hau : a = u · subst hau; simp [huv, hne] · by_cases hav : a = v · subst hav; simp [huv, Ne.symm hne] have hsq := hpm u a huv; nlinarith · simp [huv, hau, hav] · simp [huv] simp_rw [hterm, Finset.sum_add_distrib] have hs1 : ∑ u : V, ∑ v : V, (if G.Adj u v ∧ a = u then (1 : ℝ) else 0) = (d : ℝ) := by rw [Finset.sum_eq_single a] · simp [hdeg a] · intro u _ hne; exact Finset.sum_eq_zero fun v _ => by simp [Ne.symm hne] · intro h; exact False.elim (h (Finset.mem_univ a)) have hs2 : ∑ u : V, ∑ v : V, (if G.Adj u v ∧ a = v then (1 : ℝ) else 0) = (d : ℝ) := by rw [Finset.sum_comm, Finset.sum_eq_single a] · have hrew : ∀ u : V, (if G.Adj u a ∧ a = a then (1 : ℝ) else 0) = if G.Adj a u then 1 else 0 := fun u => by simp [G.adj_comm] rw [Finset.sum_congr rfl fun u _ => hrew u] exact hdeg a · intro v _ hne; exact Finset.sum_eq_zero fun u _ => by simp [Ne.symm hne] · intro h; exact False.elim (h (Finset.mem_univ a)) rw [hs1, hs2]; ring · simp only [hab, ↓reduceIte, mul_zero, zero_sub] have hterm : ∀ u v : V, (if G.Adj u v then ((if a = u then (1 : ℝ) else 0) - s u v * (if a = v then 1 else 0)) * ((if b = u then 1 else 0) - s u v * (if b = v then 1 else 0)) else 0) = (if u = a ∧ v = b ∧ G.Adj a b then -s a b else 0) + (if u = b ∧ v = a ∧ G.Adj a b then -s a b else 0) := by intro u v by_cases huv : G.Adj u v · by_cases hua : u = a · subst hua by_cases hvb : v = b · subst hvb; simp [huv, hab, Ne.symm hab] · simp [huv, hab, Ne.symm hab, hvb, Ne.symm hvb] · by_cases hub : u = b · subst hub by_cases hva : v = a · subst hva; simp [huv, huv.symm, hab, Ne.symm hab, hsymm u v] · simp [huv, hab, Ne.symm hab, hva, Ne.symm hva] · simp [huv, hua, Ne.symm hua, hub, Ne.symm hub] intro h1 h2; exact False.elim (hab (h2.trans h1.symm)) · have h1 : ¬ (u = a ∧ v = b ∧ G.Adj a b) := fun ⟨h1, h2, h3⟩ => huv (h1 ▸ h2 ▸ h3) have h2 : ¬ (u = b ∧ v = a ∧ G.Adj a b) := fun ⟨h1, h2, h3⟩ => huv (h1 ▸ h2 ▸ h3.symm) simp [huv, h1, h2] simp_rw [hterm, Finset.sum_add_distrib] have hs1 : ∑ u : V, ∑ v : V, (if u = a ∧ v = b ∧ G.Adj a b then -s a b else 0) = if G.Adj a b then -s a b else 0 := by rw [Finset.sum_eq_single a] · rw [Finset.sum_eq_single b] · simp · intro v _ hne; simp [hne] · intro h; exact False.elim (h (Finset.mem_univ b)) · intro u _ hne; exact Finset.sum_eq_zero fun v _ => by simp [hne] · intro h; exact False.elim (h (Finset.mem_univ a)) have hs2 : ∑ u : V, ∑ v : V, (if u = b ∧ v = a ∧ G.Adj a b then -s a b else 0) = if G.Adj a b then -s a b else 0 := by rw [Finset.sum_eq_single b] · rw [Finset.sum_eq_single a] · simp · intro v _ hne; simp [hne] · intro h; exact False.elim (h (Finset.mem_univ a)) · intro u _ hne; exact Finset.sum_eq_zero fun v _ => by simp [hne] · intro h; exact False.elim (h (Finset.mem_univ b)) rw [hs1, hs2]; split_ifs <;> ring /-! ### Section 4: Matching Polynomial, Heilmann–Lieb Root Bound & Godsil–Gutman Identity -/ /-- A matching involution of `G` supported on `S : Finset V`. -/ def isMatchingInvolution {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) (σ : Equiv.Perm V) : Prop := (∀ v : V, σ (σ v) = v) ∧ (∀ v : V, v ∉ S → σ v = v) ∧ (∀ v : V, σ v ≠ v → G.Adj v (σ v)) instance {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) : DecidablePred (isMatchingInvolution G S) := fun σ => by unfold isMatchingInvolution; infer_instance /-- The combinatorial matching polynomial on induced subgraph $G[S]$: $$\mu_{G[S]}(x) := \sum_{\sigma \text{ matching on } S} \operatorname{sign}(\sigma) \, x^{|\{v \in S : \sigma(v) = v\}|}.$$ -/ noncomputable def matchingPoly {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) : ℝ[X] := ∑ σ ∈ Finset.univ.filter (isMatchingInvolution G S), ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (S.filter (fun v => σ v = v)).card lemma matchingPoly_empty {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] : matchingPoly G ∅ = 1 := by have hfilt : Finset.univ.filter (isMatchingInvolution G (∅ : Finset V)) = {1} := by ext σ simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_singleton, isMatchingInvolution] constructor · intro ⟨_, hfix, _⟩; ext v; exact hfix v (Finset.notMem_empty v) · rintro rfl; simp simp [matchingPoly, hfilt] /-- **Exact Vertex-Deletion Recurrence for the Matching Polynomial (Works for EVERY $v \in S$!).** -/ theorem matchingPoly_vertex_recurrence {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) {v : V} (hv : v ∈ S) : matchingPoly G S = Polynomial.X * matchingPoly G (S.erase v) - ∑ u ∈ S.erase v, if G.Adj v u then matchingPoly G ((S.erase v).erase u) else 0 := by set M := Finset.univ.filter (isMatchingInvolution G S) set M_fix := M.filter (fun σ => σ v = v) set M_mov := M.filter (fun σ => σ v ≠ v) have hpart : matchingPoly G S = (∑ σ ∈ M_fix, ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (S.filter (fun w => σ w = w)).card) + (∑ σ ∈ M_mov, ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (S.filter (fun w => σ w = w)).card) := by simp only [matchingPoly, M, M_fix, M_mov] exact (Finset.sum_filter_add_sum_filter_not M (fun σ => σ v = v) _).symm have hterm1 : ∑ σ ∈ M_fix, ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (S.filter (fun w => σ w = w)).card = Polynomial.X * matchingPoly G (S.erase v) := by have hset : M_fix = Finset.univ.filter (isMatchingInvolution G (S.erase v)) := by ext σ simp only [M_fix, M, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] constructor · rintro ⟨⟨hinv, hout, hadj⟩, hfix⟩ refine ⟨hinv, fun w hw => ?_, hadj⟩ by_cases hwv : w = v · subst hwv; exact hfix · exact hout w fun hmem => hw (Finset.mem_erase.mpr ⟨hwv, hmem⟩) · rintro ⟨hinv, hout, hadj⟩ refine ⟨⟨hinv, fun w hw => hout w (fun h => hw (Finset.mem_of_mem_erase h)), hadj⟩, hout v (Finset.notMem_erase v S)⟩ rw [hset, matchingPoly, Finset.mul_sum] refine Finset.sum_congr rfl fun σ hσ => ?_ have hfix : σ v = v := ((Finset.mem_filter.mp hσ).2).2.1 v (Finset.notMem_erase v S) have hcard : (S.filter (fun w => σ w = w)).card = ((S.erase v).filter (fun w => σ w = w)).card + 1 := by have hins : S.filter (fun w => σ w = w) = insert v ((S.erase v).filter (fun w => σ w = w)) := by ext w simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_erase] constructor · intro ⟨hwS, hwσ⟩ by_cases hwv : w = v · left; exact hwv · right; exact ⟨⟨hwv, hwS⟩, hwσ⟩ · rintro (rfl | ⟨⟨_, hwS⟩, hwσ⟩) · exact ⟨hv, hfix⟩ · exact ⟨hwS, hwσ⟩ rw [hins, Finset.card_insert_of_notMem (by simp)] rw [hcard, pow_succ]; ring have hterm2 : ∑ σ ∈ M_mov, ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (S.filter (fun w => σ w = w)).card = -(∑ u ∈ S.erase v, if G.Adj v u then matchingPoly G ((S.erase v).erase u) else 0) := by rw [← Finset.sum_neg_distrib] have hmaps : ∀ σ ∈ M_mov, σ v ∈ S.erase v := by intro σ hσ simp only [M_mov, M, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] at hσ refine Finset.mem_erase.mpr ⟨hσ.2, ?_⟩ by_contra hnot have hfix := hσ.1.2.1 (σ v) hnot rw [hσ.1.1 v] at hfix exact hσ.2 hfix.symm rw [← Finset.sum_fiberwise_of_maps_to hmaps] refine Finset.sum_congr rfl fun u hu => ?_ by_cases huv : G.Adj v u · rw [if_pos huv] have hvu_ne : v ≠ u := G.ne_of_adj huv set T := Finset.univ.filter (isMatchingInvolution G ((S.erase v).erase u)) have hbij : ∑ σ ∈ M_mov.filter (fun σ => σ v = u), ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (S.filter (fun w => σ w = w)).card = ∑ τ ∈ T, -(((Equiv.Perm.sign τ : ℤ) : ℝ[X]) * Polynomial.X ^ (((S.erase v).erase u).filter (fun w => τ w = w)).card) := by refine Finset.sum_bij (fun σ _ => σ * Equiv.swap v u) ?_ ?_ ?_ ?_ · intro σ hσ simp only [M_mov, M, T, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] at hσ ⊢ rcases hσ with ⟨⟨⟨hinv, hout, hadj⟩, hne⟩, hσv⟩ have hσu : σ u = v := by rw [← hσv, hinv v] refine ⟨fun w => ?_, fun w hw => ?_, fun w hw => ?_⟩ · by_cases hwv : w = v · subst hwv; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, hσu] · by_cases hwu : w = u · subst hwu; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_right, hσv] · have h1 : σ w ≠ v := fun h => hwu (by rw [← hinv w, h, hσv]) have h2 : σ w ≠ u := fun h => hwv (by rw [← hinv w, h, hσu]) simp [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu, Equiv.swap_apply_of_ne_of_ne h1 h2, hinv w] · by_cases hwv : w = v · subst hwv; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, hσu] · by_cases hwu : w = u · subst hwu; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_right, hσv] · have hnotS : w ∉ S := fun h => hw (Finset.mem_erase.mpr ⟨hwu, Finset.mem_erase.mpr ⟨hwv, h⟩⟩) simp [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu, hout w hnotS] · by_cases hwv : w = v · subst hwv; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, hσu] at hw · by_cases hwu : w = u · subst hwu; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_right, hσv] at hw · simp only [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu] at hw ⊢ exact hadj w hw · intro _ _ _ _ heq; exact mul_right_cancel heq · intro τ hτ simp only [T, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] at hτ rcases hτ with ⟨hinv, hout, hadj⟩ have hτv : τ v = v := hout v (by simp) have hτu : τ u = u := hout u (by simp) refine ⟨τ * Equiv.swap v u, ?_, by rw [mul_assoc, Equiv.swap_mul_self, mul_one]⟩ simp only [M_mov, M, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] refine ⟨⟨⟨fun w => ?_, fun w hw => ?_, fun w hw => ?_⟩, ?_⟩, ?_⟩ · by_cases hwv : w = v · subst hwv; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, Equiv.swap_apply_right, hτu, hτv] · by_cases hwu : w = u · subst hwu; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, Equiv.swap_apply_right, hτu, hτv] · have h1 : τ w ≠ v := fun h => hwv (by rw [← hinv w, h, hτv]) have h2 : τ w ≠ u := fun h => hwu (by rw [← hinv w, h, hτu]) simp [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu, Equiv.swap_apply_of_ne_of_ne h1 h2, hinv w] · have hwv : w ≠ v := fun h => hw (h ▸ hv) have hwu : w ≠ u := fun h => hw (h ▸ Finset.mem_of_mem_erase hu) simp [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu, hout w (fun h => hw (Finset.mem_of_mem_erase (Finset.mem_of_mem_erase h)))] · by_cases hwv : w = v · subst hwv; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, hτu, huv] · by_cases hwu : w = u · subst hwu; simp [Equiv.Perm.mul_apply, Equiv.swap_apply_right, hτv, huv.symm] · simp only [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu] at hw ⊢ exact hadj w hw · simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, hτu, Ne.symm hvu_ne] · simp [Equiv.Perm.mul_apply, Equiv.swap_apply_left, hτu] · intro σ hσ simp only [M_mov, M, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] at hσ rcases hσ with ⟨⟨⟨hinv, _, _⟩, _⟩, hσv⟩ have hσu : σ u = v := by rw [← hσv, hinv v] have hsign : ((Equiv.Perm.sign (σ * Equiv.swap v u) : ℤ) : ℝ[X]) = -((Equiv.Perm.sign σ : ℤ) : ℝ[X]) := by rw [map_mul, Equiv.Perm.sign_swap hvu_ne]; simp have hfix_eq : S.filter (fun w => σ w = w) = ((S.erase v).erase u).filter (fun w => (σ * Equiv.swap v u) w = w) := by ext w simp only [Finset.mem_filter, Finset.mem_erase] constructor · intro ⟨hwS, hwσ⟩ have hwv : w ≠ v := fun h => hvu_ne (by rw [← h, ← hwσ, h, hσv]) have hwu : w ≠ u := fun h => hvu_ne (by rw [← hσu, ← h, hwσ, h]) exact ⟨⟨hwu, hwv, hwS⟩, by simp [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu, hwσ]⟩ · intro ⟨⟨hwu, hwv, hwS⟩, hw⟩ simp only [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hwv hwu] at hw exact ⟨hwS, hw⟩ rw [hsign, hfix_eq]; ring rw [hbij, Finset.sum_neg_distrib]; rfl · rw [if_neg huv, neg_zero] refine Finset.sum_eq_zero fun σ hσ => ?_ simp only [M_mov, M, Finset.mem_filter, Finset.mem_univ, true_and, isMatchingInvolution] at hσ have := hσ.1.1.2.2 v hσ.1.2 rw [hσ.2] at this exact False.elim (huv this) rw [hpart, hterm1, hterm2, sub_eq_add_neg] /-- **Headline Theorem 3D (Heilmann–Lieb 1972 Root Bound — 15-Line Algebraic Ratio Induction!).** For every finite simple graph $G$ of maximum degree $\le \Delta$ ($\Delta \ge 2$) and every real $x > 2\sqrt{\Delta - 1}$, $\mu_G(x) > 0$; by parity symmetry, every real root $\mu$ of $\mu_G$ satisfies $|\mu| \le 2\sqrt{\Delta - 1}$! -/ theorem heilmann_lieb_root_bound {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] {Δ : ℕ} (hΔ : 2 ≤ Δ) (hmaxdeg : ∀ v : V, G.degree v ≤ Δ) : (∀ x : ℝ, 2 * Real.sqrt ((Δ : ℝ) - 1) < x → 0 < (matchingPoly G Finset.univ).eval x) ∧ (∀ μ : ℝ, (matchingPoly G Finset.univ).eval μ = 0 → |μ| ≤ 2 * Real.sqrt ((Δ : ℝ) - 1)) := by have hΔ_r : (2 : ℝ) ≤ Δ := by exact_mod_cast hΔ set d1 : ℝ := (Δ : ℝ) - 1 have hd1_ge1 : (1 : ℝ) ≤ d1 := by linarith have hpos_gt : ∀ x : ℝ, 2 * Real.sqrt d1 < x → ∀ (k : ℕ) (S : Finset V), S.card = k → let α := (x + Real.sqrt (x ^ 2 - 4 * d1)) / 2 0 < (matchingPoly G S).eval x ∧ ∀ v ∈ S, ((S.erase v).filter (fun u => G.Adj v u)).card ≤ Δ - 1 → α * (matchingPoly G (S.erase v)).eval x ≤ (matchingPoly G S).eval x := by intro x hx have hsq_pos : 0 < x ^ 2 - 4 * d1 := by have h1 : (2 * Real.sqrt d1) ^ 2 < x ^ 2 := by have hnn : 0 ≤ 2 * Real.sqrt d1 := by positivity nlinarith have h2 : (2 * Real.sqrt d1) ^ 2 = 4 * d1 := by rw [mul_pow, Real.sq_sqrt (by linarith)]; ring linarith set α : ℝ := (x + Real.sqrt (x ^ 2 - 4 * d1)) / 2 have hα_gt_sq : Real.sqrt d1 < α := by simp only [α]; linarith [Real.sqrt_pos.mpr hsq_pos] have hα_gt1 : 1 < α := lt_of_le_of_lt (by rw [← Real.sqrt_one]; exact Real.sqrt_le_sqrt hd1_ge1) hα_gt_sq have hα_pos : 0 < α := by linarith have hα_quad : α ^ 2 - x * α + d1 = 0 := by simp only [α] have hsq : (Real.sqrt (x ^ 2 - 4 * d1)) ^ 2 = x ^ 2 - 4 * d1 := Real.sq_sqrt (le_of_lt hsq_pos) nlinarith have hα_rec : x - d1 / α = α := by field_simp [ne_of_gt hα_pos]; linarith intro k induction k using Nat.strong_induction_on with | h k ih => intro S hcard have hstep : ∀ v ∈ S, ((S.erase v).filter (fun u => G.Adj v u)).card ≤ Δ → let degS : ℝ := (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) (x - degS / α) * (matchingPoly G (S.erase v)).eval x ≤ (matchingPoly G S).eval x := by intro v hv _ have hcard_lt : (S.erase v).card < k := by rw [Finset.card_erase_of_mem hv, hcard] have : 0 < k := hcard ▸ Finset.card_pos.mpr ⟨v, hv⟩ omega obtain ⟨hpos_v, hrat_v⟩ := ih (S.erase v).card hcard_lt (S.erase v) rfl rw [matchingPoly_vertex_recurrence G S hv, Polynomial.eval_sub, Polynomial.eval_mul, Polynomial.eval_X, Polynomial.eval_finsetSum] have hsum_le : ∑ u ∈ S.erase v, (if G.Adj v u then matchingPoly G ((S.erase v).erase u) else 0).eval x ≤ (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) / α * (matchingPoly G (S.erase v)).eval x := by have hrew : ∀ u ∈ S.erase v, (if G.Adj v u then matchingPoly G ((S.erase v).erase u) else 0).eval x ≤ if G.Adj v u then α⁻¹ * (matchingPoly G (S.erase v)).eval x else 0 := by intro u hu split_ifs with hvu · have hdeg_u : (((S.erase v).erase u).filter (fun w => G.Adj u w)).card ≤ Δ - 1 := by have hsub : insert v (((S.erase v).erase u).filter (fun w => G.Adj u w)) ⊆ G.neighborFinset u := by intro w hw simp only [Finset.mem_insert, Finset.mem_filter, SimpleGraph.mem_neighborFinset] at hw ⊢ rcases hw with rfl | ⟨_, huw⟩ · exact hvu.symm · exact huw have hv_not : v ∉ ((S.erase v).erase u).filter (fun w => G.Adj u w) := by simp have hle := Finset.card_le_card hsub rw [Finset.card_insert_of_notMem hv_not] at hle have hdu := hmaxdeg u simp only [SimpleGraph.degree] at hdu omega have hratio := hrat_v u hu hdeg_u have hmul := mul_le_mul_of_nonneg_left hratio (inv_nonneg.mpr (le_of_lt hα_pos)) rwa [← mul_assoc, inv_mul_cancel₀ (ne_of_gt hα_pos), one_mul] at hmul · simp calc ∑ u ∈ S.erase v, (if G.Adj v u then matchingPoly G ((S.erase v).erase u) else 0).eval x ≤ ∑ u ∈ S.erase v, (if G.Adj v u then α⁻¹ * (matchingPoly G (S.erase v)).eval x else 0) := Finset.sum_le_sum hrew _ = (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) * (α⁻¹ * (matchingPoly G (S.erase v)).eval x) := by rw [← Finset.sum_filter, Finset.sum_const, nsmul_eq_mul] _ = (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) / α * (matchingPoly G (S.erase v)).eval x := by ring linarith refine ⟨?_, fun v hv hdeg_le => ?_⟩ · by_cases hne : S.Nonempty · obtain ⟨v, hv⟩ := hne have hdeg_le : ((S.erase v).filter (fun u => G.Adj v u)).card ≤ Δ := by refine le_trans (Finset.card_le_card ?_) (hmaxdeg v) intro u hu simp only [Finset.mem_filter, SimpleGraph.mem_neighborFinset] at hu ⊢ exact hu.2 have hcard_lt : (S.erase v).card < k := by rw [Finset.card_erase_of_mem hv, hcard] have : 0 < k := hcard ▸ Finset.card_pos.mpr ⟨v, hv⟩ omega have hpos_v := (ih (S.erase v).card hcard_lt (S.erase v) rfl).1 have hst := hstep v hv hdeg_le have hcoeff_pos : 0 < x - (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) / α := by have hcast : (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) ≤ (Δ : ℝ) := by exact_mod_cast hdeg_le have h1 : (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) / α ≤ (Δ : ℝ) / α := div_le_div_of_nonneg_right hcast (le_of_lt hα_pos) have h2 : x - (Δ : ℝ) / α = α - 1 / α := by have : (Δ : ℝ) / α = d1 / α + 1 / α := by simp only [d1]; ring linarith [hα_rec] have h3 : 0 < α - 1 / α := by rw [sub_pos, div_lt_iff₀ hα_pos]; nlinarith [hα_gt1] linarith exact lt_of_lt_of_le (mul_pos hcoeff_pos hpos_v) hst · rw [Finset.not_nonempty_iff_eq_empty.mp hne, matchingPoly_empty]; simp · have hst := hstep v hv (le_trans hdeg_le (Nat.sub_le Δ 1)) have hcard_lt : (S.erase v).card < k := by rw [Finset.card_erase_of_mem hv, hcard] have : 0 < k := hcard ▸ Finset.card_pos.mpr ⟨v, hv⟩ omega have hpos_v := (ih (S.erase v).card hcard_lt (S.erase v) rfl).1 have hcast : (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) ≤ d1 := by have : (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) ≤ ((Δ - 1 : ℕ) : ℝ) := by exact_mod_cast hdeg_le rwa [Nat.cast_sub (by omega), Nat.cast_one] at this have hcoeff_ge : α ≤ x - (((S.erase v).filter (fun u => G.Adj v u)).card : ℝ) / α := by linarith [div_le_div_of_nonneg_right hcast (le_of_lt hα_pos), hα_rec] exact le_trans (mul_le_mul_of_nonneg_right hcoeff_ge (le_of_lt hpos_v)) hst have hparity : ∀ x : ℝ, (matchingPoly G Finset.univ).eval (-x) = (-1 : ℝ) ^ (Fintype.card V) * (matchingPoly G Finset.univ).eval x := by intro x simp only [matchingPoly, Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_pow, Polynomial.eval_X, Polynomial.eval_intCast, Finset.mul_sum] refine Finset.sum_congr rfl fun σ hσ => ?_ have hinv : ∀ v : V, σ (σ v) = v := (Finset.mem_filter.mp hσ).2.1 have heven : Even (Fintype.card V - (Finset.univ.filter (fun v : V => σ v = v)).card) := by have hmov : (Finset.univ.filter (fun v : V => σ v ≠ v)).card = Fintype.card V - (Finset.univ.filter (fun v : V => σ v = v)).card := by have hdisj : Disjoint (Finset.univ.filter (fun v : V => σ v = v)) (Finset.univ.filter (fun v : V => σ v ≠ v)) := Finset.disjoint_filter.mpr fun _ _ h1 h2 => h2 h1 have hunion : Finset.univ.filter (fun v : V => σ v = v) ∪ Finset.univ.filter (fun v : V => σ v ≠ v) = Finset.univ := by ext v; simp [em] have hsum := Finset.card_union_of_disjoint hdisj rw [hunion, Finset.card_univ] at hsum; omega rw [← hmov] have hcard_even : ∀ (T : Finset V), (∀ v ∈ T, σ v ∈ T ∧ σ v ≠ v) → Even T.card := by intro T induction T using Finset.strongInduction with | H T ih => intro hT by_cases hne : T.Nonempty · obtain ⟨v, hv⟩ := hne have hσv_mem : σ v ∈ T := (hT v hv).1 have hσv_ne : σ v ≠ v := (hT v hv).2 set T' := (T.erase v).erase (σ v) have hsub : T' ⊂ T := Finset.ssubset_iff_subset_ne.mpr ⟨fun w hw => Finset.mem_of_mem_erase (Finset.mem_of_mem_erase hw), fun heq => by have : v ∈ T' := heq ▸ hv; simp [T'] at this⟩ have hT' : ∀ w ∈ T', σ w ∈ T' ∧ σ w ≠ w := by intro w hw simp only [T', Finset.mem_erase] at hw ⊢ refine ⟨⟨?_, ?_, (hT w hw.2.2).1⟩, (hT w hw.2.2).2⟩ · intro h; exact hw.2.1 (by rw [← hinv w, h, hinv v]) · intro h; exact hw.1 (by rw [← hinv w, h]) obtain ⟨r, hr⟩ := ih T' hsub hT' have hcard_T : T.card = T'.card + 2 := by have h1 : (T.erase v).card + 1 = T.card := Finset.card_erase_add_one hv have h2 : T'.card + 1 = (T.erase v).card := Finset.card_erase_add_one (Finset.mem_erase.mpr ⟨hσv_ne, hσv_mem⟩) omega exact ⟨r + 1, by omega⟩ · rw [Finset.not_nonempty_iff_eq_empty.mp hne]; simp refine hcard_even _ fun v hv => ?_ simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hv ⊢ exact ⟨fun h => hv (by rw [hinv v] at h; exact h.symm), hv⟩ obtain ⟨r, hr⟩ := heven have hcard_le : (Finset.univ.filter (fun v : V => σ v = v)).card ≤ Fintype.card V := Finset.card_filter_le _ _ have hpow : (-1 : ℝ) ^ (Fintype.card V) = (-1 : ℝ) ^ (Finset.univ.filter (fun v : V => σ v = v)).card := by have hsum : Fintype.card V = (Finset.univ.filter (fun v : V => σ v = v)).card + 2 * r := by omega rw [hsum, pow_add, pow_mul, neg_one_sq, one_pow, mul_one] rw [hpow, show (-x) ^ (Finset.univ.filter (fun v : V => σ v = v)).card = (-1 : ℝ) ^ (Finset.univ.filter (fun v : V => σ v = v)).card * x ^ (Finset.univ.filter (fun v : V => σ v = v)).card by rw [← mul_pow]; simp] ring refine ⟨fun x hx => (hpos_gt x hx (Fintype.card V) Finset.univ rfl).1, fun μ hμ => ?_⟩ rw [abs_le] constructor · by_contra hlt; push Not at hlt have hpos := (hpos_gt (-μ) (by linarith) (Fintype.card V) Finset.univ rfl).1 rw [hparity μ, hμ, mul_zero] at hpos; linarith · by_contra hgt; push Not at hgt have hpos := (hpos_gt μ hgt (Fintype.card V) Finset.univ rfl).1 linarith /-- Signed adjacency matrix induced by a signing on the edge finset `G.edgeFinset → Bool`. -/ def edgeSignedAdj {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (s : G.edgeFinset → Bool) : Matrix V V ℝ := fun u v => if h : G.Adj u v then if s ⟨s(u, v), G.mem_edgeFinset.mpr h⟩ then 1 else -1 else 0 /-- **Headline Theorem 3E (Godsil–Gutman 1981 Signed-Adjacency Average Identity):** Summing the characteristic polynomial $\chi_{A_s}(x)$ over all $2^{|E(G)|}$ edge signings $s : E(G) \to \{\pm 1\}$ recovers $2^{|E(G)|}$ times the matching polynomial $\mu_G(x)$: $$\sum_{s : E(G) \to \{\pm 1\}} \chi_{A_s}(x) \;=\; 2^{|E(G)|} \cdot \mu_G(x).$$ -/ theorem godsil_gutman_sum_charpoly {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] : ∑ s : G.edgeFinset → Bool, (edgeSignedAdj G s).charpoly = ((2 : ℝ[X]) ^ G.edgeFinset.card) * matchingPoly G Finset.univ := by -- Expand each charpoly via Leibniz formula Matrix.det_apply on charmatrix have hchar : ∀ s : G.edgeFinset → Bool, (edgeSignedAdj G s).charpoly = ∑ σ : Equiv.Perm V, ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v := by intro s simp only [Matrix.charpoly, Matrix.det_apply, Units.smul_def, zsmul_eq_mul] simp_rw [hchar] rw [Finset.sum_comm] -- Evaluate inner sum over signings s for each permutation σ: -- (1) If σ is a matching involution on univ, every signing gives X^{|fix σ|}, summing to 2^{|E|} * X^{|fix σ|}! -- (2) Otherwise, the sum over all signings s is 0! have hinner : ∀ σ : Equiv.Perm V, ∑ s : G.edgeFinset → Bool, ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = if isMatchingInvolution G Finset.univ σ then ((2 : ℝ[X]) ^ G.edgeFinset.card) * Polynomial.X ^ (Finset.univ.filter (fun v : V => σ v = v)).card else 0 := by intro σ -- First check whether every non-fixed point is an edge of G by_cases hadj : ∀ v : V, σ v ≠ v → G.Adj v (σ v) · by_cases hinv : ∀ v : V, σ (σ v) = v · -- Case 1: σ IS a matching involution! have hmatch : isMatchingInvolution G Finset.univ σ := ⟨hinv, fun _ h => False.elim (h (Finset.mem_univ _)), hadj⟩ rw [if_pos hmatch] have hprod_eq : ∀ s : G.edgeFinset → Bool, ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = Polynomial.X ^ (Finset.univ.filter (fun v : V => σ v = v)).card := by intro s rw [← Finset.prod_filter_mul_prod_filter_not Finset.univ (fun v : V => σ v = v)] have hfix_prod : ∏ v ∈ Finset.univ.filter (fun v : V => σ v = v), (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = Polynomial.X ^ (Finset.univ.filter (fun v : V => σ v = v)).card := by have h1 : ∀ v ∈ Finset.univ.filter (fun v : V => σ v = v), (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = Polynomial.X := by intro v hv have hv_eq : σ v = v := (Finset.mem_filter.mp hv).2 rw [hv_eq, Matrix.charmatrix_apply_eq] simp [edgeSignedAdj] rw [Finset.prod_congr rfl h1, Finset.prod_const] have hmov_prod : ∏ v ∈ Finset.univ.filter (fun v : V => ¬ σ v = v), (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = 1 := by -- Pair each non-fixed v with σ v: product of their two factors is (-s_e)*(-s_e) = 1! have hpair_prod : ∀ (T : Finset V), (∀ v ∈ T, σ v ∈ T ∧ σ v ≠ v) → ∏ v ∈ T, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = 1 := by intro T induction T using Finset.strongInduction with | H T ih => intro hT by_cases hne : T.Nonempty · obtain ⟨v, hv⟩ := hne have hσv_mem : σ v ∈ T := (hT v hv).1 have hσv_ne : σ v ≠ v := (hT v hv).2 set T' := (T.erase v).erase (σ v) have hsub : T' ⊂ T := Finset.ssubset_iff_subset_ne.mpr ⟨fun w hw => Finset.mem_of_mem_erase (Finset.mem_of_mem_erase hw), fun heq => by have : v ∈ T' := heq ▸ hv; simp [T'] at this⟩ have hT' : ∀ w ∈ T', σ w ∈ T' ∧ σ w ≠ w := by intro w hw simp only [T', Finset.mem_erase] at hw ⊢ refine ⟨⟨?_, ?_, (hT w hw.2.2).1⟩, (hT w hw.2.2).2⟩ · intro h; exact hw.2.1 (by rw [← hinv w, h, hinv v]) · intro h; exact hw.1 (by rw [← hinv w, h]) have hsplit : ∏ w ∈ T, (Matrix.charmatrix (edgeSignedAdj G s)) (σ w) w = (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v * (Matrix.charmatrix (edgeSignedAdj G s)) (σ (σ v)) (σ v) * ∏ w ∈ T', (Matrix.charmatrix (edgeSignedAdj G s)) (σ w) w := by rw [← Finset.mul_prod_erase T _ hv, ← Finset.mul_prod_erase (T.erase v) _ (Finset.mem_erase.mpr ⟨hσv_ne, hσv_mem⟩)] ring rw [hsplit, ih T' hsub hT', mul_one] have hadj_v : G.Adj v (σ v) := hadj v hσv_ne rw [Matrix.charmatrix_apply_ne _ _ _ hσv_ne, Matrix.charmatrix_apply_ne _ _ _ (by rw [hinv v]; exact hσv_ne.symm), hinv v] simp only [edgeSignedAdj, hadj_v, hadj_v.symm, ↓reduceDIte] have he_eq : (⟨s(σ v, v), G.mem_edgeFinset.mpr hadj_v.symm⟩ : G.edgeFinset) = ⟨s(v, σ v), G.mem_edgeFinset.mpr hadj_v⟩ := Subtype.ext Sym2.eq_swap rw [he_eq] cases s ⟨s(v, σ v), G.mem_edgeFinset.mpr hadj_v⟩ <;> simp · rw [Finset.not_nonempty_iff_eq_empty.mp hne, Finset.prod_empty] refine hpair_prod _ fun v hv => ?_ simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hv ⊢ exact ⟨fun h => hv (by rw [hinv v] at h; exact h.symm), hv⟩ rw [hfix_prod, hmov_prod, mul_one] simp_rw [hprod_eq, Finset.sum_const, Finset.card_univ, Fintype.card_fun, Fintype.card_bool, Fintype.card_coe, nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat] · -- Case 2: σ is NOT an involution ⇒ ∃ v₀ with σ(σ v₀) ≠ v₀; flipping edge {v₀, σ v₀} negates the product! have hnot_match : ¬ isMatchingInvolution G Finset.univ σ := fun h => hinv h.1 rw [if_neg hnot_match] push Not at hinv obtain ⟨v₀, hv0⟩ := hinv have hσv0_ne : σ v₀ ≠ v₀ := fun h => hv0 (by rw [h, h]) have hadj0 : G.Adj v₀ (σ v₀) := hadj v₀ hσv0_ne set e₀ : G.edgeFinset := ⟨s(v₀, σ v₀), G.mem_edgeFinset.mpr hadj0⟩ -- Define fixed-point-free involution flip on signings: flip s e₀ = !(s e₀) let flip : (G.edgeFinset → Bool) → (G.edgeFinset → Bool) := fun s => Function.update s e₀ (!(s e₀)) have hflip_inv : ∀ s, flip (flip s) = s := by intro s; ext e; by_cases he : e = e₀ · subst he; simp [flip] · simp [flip, Function.update_of_ne he] -- Show flipping e₀ negates ONLY the v₀ factor (because σ(σ v₀) ≠ v₀ means no other v has s(σ v, v) = s(v₀, σ v₀)!) have hneg : ∀ s : G.edgeFinset → Bool, ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G (flip s))) (σ v) v = -(∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v) := by intro s rw [← Finset.mul_prod_erase Finset.univ _ (Finset.mem_univ v₀), ← Finset.mul_prod_erase Finset.univ _ (Finset.mem_univ v₀)] have hv0_neg : (Matrix.charmatrix (edgeSignedAdj G (flip s))) (σ v₀) v₀ = -((Matrix.charmatrix (edgeSignedAdj G s)) (σ v₀) v₀) := by rw [Matrix.charmatrix_apply_ne _ _ _ hσv0_ne, Matrix.charmatrix_apply_ne _ _ _ hσv0_ne] simp only [edgeSignedAdj, hadj0.symm, ↓reduceDIte] have he_eq : (⟨s(σ v₀, v₀), G.mem_edgeFinset.mpr hadj0.symm⟩ : G.edgeFinset) = e₀ := Subtype.ext Sym2.eq_swap rw [he_eq] simp only [flip, Function.update_self] cases s e₀ <;> simp have hother_eq : ∀ v ∈ Finset.univ.erase v₀, (Matrix.charmatrix (edgeSignedAdj G (flip s))) (σ v) v = (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v := by intro v hv have hv_ne : v ≠ v₀ := (Finset.mem_erase.mp hv).1 by_cases hfix : σ v = v · rw [hfix, Matrix.charmatrix_apply_eq, Matrix.charmatrix_apply_eq] simp [edgeSignedAdj] · rw [Matrix.charmatrix_apply_ne _ _ _ hfix, Matrix.charmatrix_apply_ne _ _ _ hfix] have hadjv : G.Adj (σ v) v := (hadj v hfix).symm simp only [edgeSignedAdj, hadjv, ↓reduceDIte] have he_ne : (⟨s(σ v, v), G.mem_edgeFinset.mpr hadjv⟩ : G.edgeFinset) ≠ e₀ := by intro heq have hs2 : s(σ v, v) = s(v₀, σ v₀) := congr_arg Subtype.val heq rw [Sym2.eq_iff] at hs2 rcases hs2 with ⟨h1, h2⟩ | ⟨h1, h2⟩ · exact hv0 (by rw [← h2, h1]) · exact hv_ne h2 simp [flip, Function.update_of_ne he_ne] rw [hv0_neg, Finset.prod_congr rfl hother_eq]; ring have hsum_eq : ∑ s : G.edgeFinset → Bool, ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G (flip s))) (σ v) v = ∑ s : G.edgeFinset → Bool, ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v := Fintype.sum_equiv (Equiv.mk flip flip hflip_inv hflip_inv) _ _ (fun _ => rfl) simp_rw [hneg, Finset.sum_neg_distrib] at hsum_eq -- In ℝ[X] (char 0), -S = S ⇒ 2 * S = 0 ⇒ S = 0! set S_sum : ℝ[X] := ∑ s : G.edgeFinset → Bool, ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v have h2 : (2 : ℝ[X]) * S_sum = 0 := by have : S_sum + S_sum = 0 := by calc S_sum + S_sum = -S_sum + S_sum := by nth_rw 1 [← hsum_eq] _ = 0 := neg_add_cancel S_sum rw [two_mul]; exact this exact (mul_eq_zero.mp h2).resolve_left (by norm_num) · -- Case 3: ∃ v₀ with σ v₀ ≠ v₀ and ¬ G.Adj v₀ (σ v₀) ⇒ factor at v₀ is 0 for every s! have hnot_match : ¬ isMatchingInvolution G Finset.univ σ := fun h => hadj h.2.2 rw [if_neg hnot_match] push Not at hadj obtain ⟨v₀, hσv0_ne, hnot_adj⟩ := hadj refine Finset.sum_eq_zero fun s _ => Finset.prod_eq_zero (Finset.mem_univ v₀) ?_ rw [Matrix.charmatrix_apply_ne _ _ _ hσv0_ne] have hnot_adj' : ¬ G.Adj (σ v₀) v₀ := fun h => hnot_adj h.symm simp [edgeSignedAdj, hnot_adj'] -- Combine inner sums to recover 2^{|E|} * matchingPoly G Finset.univ! have hfactor : ∀ σ : Equiv.Perm V, ∑ s : G.edgeFinset → Bool, ((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * ∏ v : V, (Matrix.charmatrix (edgeSignedAdj G s)) (σ v) v = if isMatchingInvolution G Finset.univ σ then ((2 : ℝ[X]) ^ G.edgeFinset.card) * (((Equiv.Perm.sign σ : ℤ) : ℝ[X]) * Polynomial.X ^ (Finset.univ.filter (fun v : V => σ v = v)).card) else 0 := by intro σ rw [← Finset.mul_sum, hinner σ] split_ifs <;> ring simp_rw [hfactor, ← Finset.sum_filter, ← Finset.mul_sum] rfl /-! ### Section 5: Explicit Ramanujan 2-Lift Sharpness Witness ($K_4 \to Q_3$) -/ /-- Complete graph $K_4$ on `Fin 4` (3-regular). -/ def K4 : SimpleGraph (Fin 4) := ⊤ instance : DecidableRel K4.Adj := fun u v => by unfold K4; simp only [SimpleGraph.top_adj]; infer_instance /-- **Headline Theorem 3F (Explicit Ramanujan 2-Lift Sharpness Witness: $K_4 \to Q_3$):** For $K_4$ ($d = 3$, Ramanujan threshold $2\sqrt{2} \approx 2.8284$): 1. Under the all-negative signing $s \equiv -1$, the 2-lift factorizes as $\chi_{\widehat{(K_4)}_{-1}}(x) = \chi_{K_4}(x) \cdot \chi_{-A_{K_4}}(x)$. 2. The largest root $\sqrt{3 + \sqrt{6}}$ of $\mu_{K_4}(x) = x^4 - 6x^2 + 3$ satisfies $1 < \sqrt{3 + \sqrt{6}} < 2\sqrt{2}$. 3. The new 2-lift signed adjacency matrix $-A_{K_4}$ has exact eigenvalue $1 < \sqrt{3 + \sqrt{6}} < 2\sqrt{2}$! -/ theorem witness_K4_to_Q3_two_lift : let s_neg : Fin 4 → Fin 4 → ℝ := fun _ _ => -1 (twoLiftAdj K4 s_neg).charpoly = (K4.adjMatrix ℝ).charpoly * (signedAdj K4 s_neg).charpoly ∧ (Polynomial.X ^ 4 - 6 * Polynomial.X ^ 2 + 3 : ℝ[X]).eval (Real.sqrt (3 + Real.sqrt 6)) = 0 ∧ (1 : ℝ) < Real.sqrt (3 + Real.sqrt 6) ∧ Real.sqrt (3 + Real.sqrt 6) < 2 * Real.sqrt ((3 : ℝ) - 1) ∧ (∃ f : Fin 4 → ℝ, f ≠ 0 ∧ (signedAdj K4 s_neg).mulVec f = (1 : ℝ) • f) := by intro s_neg refine ⟨two_lift_charpoly_factorization K4 s_neg (fun _ _ _ => Or.inr rfl), ?_, ?_, ?_, ?_⟩ · have h6_nn : (0 : ℝ) ≤ Real.sqrt 6 := Real.sqrt_nonneg 6 have h6_sq : (Real.sqrt 6) ^ 2 = 6 := Real.sq_sqrt (by norm_num) have hsq : (Real.sqrt (3 + Real.sqrt 6)) ^ 2 = 3 + Real.sqrt 6 := Real.sq_sqrt (by linarith) simp only [Polynomial.eval_add, Polynomial.eval_sub, Polynomial.eval_mul, Polynomial.eval_pow, Polynomial.eval_X, Polynomial.eval_ofNat] have h4 : (Real.sqrt (3 + Real.sqrt 6)) ^ 4 = (3 + Real.sqrt 6) ^ 2 := by calc (Real.sqrt (3 + Real.sqrt 6)) ^ 4 = ((Real.sqrt (3 + Real.sqrt 6)) ^ 2) ^ 2 := by ring _ = (3 + Real.sqrt 6) ^ 2 := by rw [hsq] rw [h4, hsq]; nlinarith · rw [← Real.sqrt_one] exact Real.sqrt_lt_sqrt zero_le_one (by linarith [Real.sqrt_nonneg 6]) · have h6_lt5 : Real.sqrt 6 < 5 := by have h1 : Real.sqrt 6 < Real.sqrt 25 := Real.sqrt_lt_sqrt (by norm_num) (by norm_num) have h25 : Real.sqrt 25 = 5 := by rw [show (25 : ℝ) = 5 ^ 2 by norm_num, Real.sqrt_sq (by norm_num)] linarith have h2s2 : 2 * Real.sqrt ((3 : ℝ) - 1) = Real.sqrt 8 := by rw [show (3 : ℝ) - 1 = 2 by norm_num, show (8 : ℝ) = 2 ^ 2 * 2 by norm_num, Real.sqrt_mul (by norm_num), Real.sqrt_sq (by norm_num)] rw [h2s2] exact Real.sqrt_lt_sqrt (by linarith [Real.sqrt_nonneg 6]) (by linarith) · refine ⟨![1, -1, 0, 0], ?_, ?_⟩ · intro h0; have := congr_fun h0 0; simp at this · ext i; fin_cases i <;> simp [Matrix.mulVec, dotProduct, Fin.sum_univ_four, signedAdj, K4, s_neg] end InterlacingRamanujanFamilies /-! ### Axiom Verification for All Headline Theorems -/ #print axioms InterlacingRamanujanFamilies.common_interlacer_max_root_sandwich #print axioms InterlacingRamanujanFamilies.common_interlacer_strict_real_rooted #print axioms InterlacingRamanujanFamilies.interlacing_family_tree_exists_good_leaf #print axioms InterlacingRamanujanFamilies.det_psd_pencil_uhp_nonzero #print axioms InterlacingRamanujanFamilies.univariate_one_add_deriv_uhp_nonzero #print axioms InterlacingRamanujanFamilies.real_poly_uhp_nonzero_all_roots_real #print axioms InterlacingRamanujanFamilies.multiaffine_eval_zero_uhp_nonzero #print axioms InterlacingRamanujanFamilies.two_lift_charpoly_factorization #print axioms InterlacingRamanujanFamilies.signed_laplacian_eq_sum_rankOne #print axioms InterlacingRamanujanFamilies.matchingPoly_vertex_recurrence #print axioms InterlacingRamanujanFamilies.heilmann_lieb_root_bound #print axioms InterlacingRamanujanFamilies.godsil_gutman_sum_charpoly #print axioms InterlacingRamanujanFamilies.witness_K4_to_Q3_two_lift