module import Mathlib.Algebra.Order.Star.Real import Mathlib.Analysis.Matrix.PosDef import Mathlib.RingTheory.PiTensorProduct import Mathlib.RingTheory.SimpleRing.Principal import TauCeti.LinearAlgebra.Matrix.Triangular public import Lib.General.LinearAlgebra.MatricesNearIdentity import Lib.DiscreteSeries.FlenstedJensen.CasimirEigenfunction import Lib.DiscreteSeries.Holomorphic.HighestVectorExtension import Lib.DiscreteSeries.Holomorphic.MaximalCompactMinors /-! # One minor near the identity For a unitary matrix `k` and a diagonal projection `P`, the principal minor of `k` on the range of `P` has squared modulus at most `exp (-‖[P, k]‖² / 2)` (`norm_principalMinor_sq_le_exp`). For `g` in `USign ε` near `1` and `X = g - 1`, the coefficient `l.dsCoeff g` is `l.flenstedJensen 1 y` for a matrix `y = (1 - u) g (1 - v)` with `u`, `v` strictly triangular, and each principal minor of `kᴴ y k` on a set of lowest entries of `l` is `exp (tr (P logOneAdd X) + ‖[P, X]‖² / 4 + r)` with an explicit bound for `r` (`exists_principalMinor_eq_exp`). This rests on an exact formula for `det (1 + P X)` through `logOneAdd` (`exists_det_compress_eq_exp_logOneAdd`). The norm of a matrix is the entrywise `ℓ²` norm (`Norms.Frobenius`). -/ @[expose] public section noncomputable section section SizeOfOneMinor open Matrix Finset Norms.Frobenius Complex namespace New.DiscreteSeries variable {n : Type} [Fintype n] [DecidableEq n] {P k : Matrix n n ℂ} {p : n → Prop} [DecidablePred p] /-! ### The size of one minor -/ /-- The square of `|det Y|` is at most `exp (tr (Yᴴ Y - 1))`; this trace is real. -/ lemma norm_det_sq_le_exp (Y : Matrix n n ℂ) : ‖Y.det‖ ^ 2 ≤ Real.exp (Yᴴ * Y - 1).trace.re := by -- Use `x ≤ exp (x - 1)` on the eigenvalues `x ≥ 0` of `Yᴴ Y`. have hY : (Yᴴ * Y).IsHermitian := isHermitian_conjTranspose_mul_self Y have nonneg : ∀ i, 0 ≤ hY.eigenvalues i := eigenvalues_conjTranspose_mul_self_nonneg Y have trace_eq : (Yᴴ * Y - 1).trace.re = ∑ i, (hY.eigenvalues i - 1) := by rw [trace_sub, hY.trace_eq_sum_eigenvalues] simp calc ‖Y.det‖ ^ 2 = ‖(Yᴴ * Y).det‖ := by rw [det_mul, det_conjTranspose, norm_mul, norm_star, sq] _ = ∏ i, hY.eigenvalues i := by simp [hY.det_eq_prod_eigenvalues, abs_of_nonneg (nonneg _)] _ ≤ ∏ i, Real.exp (hY.eigenvalues i - 1) := prod_le_prod₀ (fun i _ ↦ nonneg i) fun i _ ↦ by linarith only [Real.add_one_le_exp (hY.eigenvalues i - 1)] _ = Real.exp (Yᴴ * Y - 1).trace.re := by rw [trace_eq, Real.exp_sum] /-- The entry `(i, j)` of the commutator of `X` with the diagonal projection to the indices satisfying `p` has the norm of `X i j` if exactly one of `p i`, `p j` holds, else it is `0`. -/ lemma norm_lie_coordProj_apply (X : Matrix n n ℂ) (i j : n) : ‖⁅coordProj p, X⁆ i j‖ = if p i ↔ p j then 0 else ‖X i j‖ := by by_cases hi : p i <;> by_cases hj : p j <;> simp [coordProj, Ring.lie_def, hi, hj] /-- The squared Frobenius norm of the commutator with the coordinate projection is the sum of the squared Frobenius norms of the two off-diagonal blocks. -/ private lemma norm_lie_coordProj_sq_eq_blocks (p : n → Prop) [DecidablePred p] (X : Matrix n n ℂ) : ‖⁅coordProj p, X⁆‖ ^ 2 = ‖X.toBlock p (fun i ↦ ¬p i)‖ ^ 2 + ‖X.toBlock (fun i ↦ ¬p i) p‖ ^ 2 := by have hp (i : {i // p i}) : p i := i.property have hn (i : {i // ¬p i}) : ¬p i := i.property simp [frobenius_norm_sq_eq_sum_norm_sq, ← Fintype.sum_subtype_add_sum_subtype p, norm_lie_coordProj_apply, hp, hn] /-- The two blocks of a unitary matrix on the columns indexed by `p` have total squared Frobenius norm equal to the number of those columns. -/ private lemma norm_sq_add_norm_sq_block (p : n → Prop) [DecidablePred p] {k : Matrix n n ℂ} (hk : kᴴ * k = 1) : ‖k.toBlock p p‖ ^ 2 + ‖k.toBlock (fun i ↦ ¬p i) p‖ ^ 2 = Fintype.card {i // p i} := by have h : (k.toBlock p p)ᴴ * k.toBlock p p + (k.toBlock (fun i ↦ ¬p i) p)ᴴ * k.toBlock (fun i ↦ ¬p i) p = 1 := (toBlock_mul_eq_add p p p kᴴ k).symm.trans (by rw [hk, toBlock_one_self]) have hs {m : Type} [Fintype m] (X : Matrix m {i // p i} ℂ) : (Xᴴ * X).trace.re = ‖X‖ ^ 2 := by rw [← frobenius_inner_eq_trace_conjTranspose_mul] exact inner_self_eq_norm_sq (𝕜 := ℂ) X simpa [hs] using congrArg (fun M ↦ M.trace.re) h /-- Size of one minor: let `k` be a unitary matrix, `S` the set of indices satisfying `p`, and `P = coordProj p` the diagonal projection to `S`. Then the principal minor of `k` on `S` satisfies `|det_S k|² ≤ exp (-‖[P, k]‖² / 2)`. -/ theorem norm_principalMinor_sq_le_exp (p : n → Prop) [DecidablePred p] (hk : kᴴ * k = 1) : ‖principalMinor k p‖ ^ 2 ≤ Real.exp (-(‖⁅coordProj p, k⁆‖ ^ 2 / 2)) := by -- Apply the column identity to the matrix and its adjoint to account for both crossing blocks. have hcol := norm_sq_add_norm_sq_block p hk have hrow := norm_sq_add_norm_sq_block p (k := kᴴ) (by simpa using mul_eq_one_symm hk) change ‖(k.toBlock p p)ᴴ‖ ^ 2 + ‖(k.toBlock p (fun i ↦ ¬p i))ᴴ‖ ^ 2 = _ at hrow simp only [frobenius_norm_conjTranspose] at hrow refine (norm_det_sq_le_exp (k.toBlock p p)).trans_eq (congrArg Real.exp ?_) rw [trace_sub, sub_re, trace_star_mul_self_eq_norm_sq, ofReal_re, trace_one, norm_lie_coordProj_sq_eq_blocks, natCast_re] linarith only [hcol, hrow] end New.DiscreteSeries end SizeOfOneMinor section DeterminantOfCompression open Ring Matrix Norms.Frobenius Complex intervalIntegral namespace New.DiscreteSeries variable {n : Type*} [Fintype n] [DecidableEq n] {P Q X Y : Matrix n n ℂ} {δ c : ℝ} attribute [local simp] mul_add add_mul mul_assoc lie_def IsIdempotentElem.eq IsIdempotentElem.mul_self_mul IsStarProjection.isIdempotentElem /-- If `‖P X‖ ≤ 1 / 2` and `‖X‖ ≤ 1 / 2`, the integral over `[0, 1]` of `tr ((1 + s P X)⁻¹ P X) - tr (Q (1 + s X)⁻¹ X) + s tr (Y ^ 2) / 2` is `tr (logOneAdd (P X)) - tr (Q logOneAdd X) + tr (Y ^ 2) / 4`. -/ private lemma integral_trace_inv_one_add_smul_mul_sub_eq (hPX : ‖P * X‖ ≤ 2⁻¹) (hX : ‖X‖ ≤ 2⁻¹) : ∫ s : ℝ in 0..1, ((1 * ((1 + s • (P * X))⁻¹ * (P * X))).trace - (Q * ((1 + s • X)⁻¹ * X)).trace + s * (2⁻¹ * (Y * Y).trace)) = (logOneAdd (P * X)).trace - (Q * logOneAdd X).trace + 4⁻¹ * (Y * Y).trace := by have h_int_P := intervalIntegrable_trace_mul_inv_one_add_smul_mul hPX 1 have h_int_Q := intervalIntegrable_trace_mul_inv_one_add_smul_mul hX Q have h_int_Y : IntervalIntegrable (fun s : ℝ ↦ (s : ℂ) * (2⁻¹ * (Y * Y).trace)) MeasureTheory.volume 0 1 := (continuous_ofReal.intervalIntegrable ..).mul_const _ rw [integral_add (h_int_P.sub h_int_Q) h_int_Y, integral_sub h_int_P h_int_Q, integral_trace_mul_inv_one_add_smul_mul hPX 1, integral_trace_mul_inv_one_add_smul_mul hX Q, integral_mul_const, integral_ofReal, integral_id] norm_num ring /-- Let `P` and `Q` be orthogonal projections, and let `‖X‖ ≤ δ ≤ 1 / 2`, `tr ([P, Q] Y) = 0`, `‖[P, X] - Y‖ ≤ δ c`, `‖Y‖ ≤ c` and `‖Q - P‖ ≤ c`. Then `det (1 + P X) = exp (tr (Q logOneAdd X) - tr (Y ^ 2) / 4 + r)` with `|r| ≤ 100 δ c ^ 2`. -/ lemma exists_det_compress_eq_exp_logOneAdd (hP : IsStarProjection P) (hQ : IsStarProjection Q) (hδ : δ ≤ 2⁻¹) (hX : ‖X‖ ≤ δ) (h_comm : (⁅P, Q⁆ * Y).trace = 0) (h_near : ‖⁅P, X⁆ - Y‖ ≤ δ * c) (hY : ‖Y‖ ≤ c) (hPQ : ‖Q - P‖ ≤ c) : ∃ r : ℂ, (1 + P * X).det = cexp ((Q * logOneAdd X).trace - 4⁻¹ * (Y * Y).trace + r) ∧ ‖r‖ ≤ 100 * δ * c ^ 2 := by have hδ_nonneg : 0 ≤ δ := (norm_nonneg X).trans hX have hc_nonneg : 0 ≤ c := (norm_nonneg Y).trans hY have hPX : ‖P * X‖ ≤ δ := norm_proj_mul_le hP hX have h_lie : ‖⁅P, X⁆‖ ≤ c + 2⁻¹ * c := (norm_le_insert' _ Y).trans (by grw [hY, h_near, hδ]) -- `log det (1 + P X)` is the integral over `[0, 1]` of `tr ((1 + s P X)⁻¹ P X)`, by -- `det_one_add_eq_exp_trace_logOneAdd`, and `tr (Q logOneAdd X)` is that of -- `tr (Q (1 + s X)⁻¹ X)`. So the remainder `r` is the integral of the difference, corrected by -- `s tr (Y ^ 2) / 2`. refine ⟨(logOneAdd (P * X)).trace - (Q * logOneAdd X).trace + 4⁻¹ * (Y * Y).trace, ?_, ?_⟩ · rw [det_one_add_eq_exp_trace_logOneAdd (hPX.trans hδ)] congr 1 ring -- It remains to bound the integrand at each `s ∈ (0, 1]`. rw [← integral_trace_inv_one_add_smul_mul_sub_eq (Q := Q) (Y := Y) (hPX.trans hδ) (hX.trans hδ)] refine (norm_integral_le_of_norm_le_const (C := 100 * δ * c ^ 2) fun s hs ↦ ?_).trans_eq (by simp) have hs_mem : s ∈ Set.Icc (0 : ℝ) 1 := by grind have hs_half : s / 2 ∈ Set.Icc (0 : ℝ) 1 := by grind -- The resolvents `W = (1 + s X)⁻¹` and `V = (1 + s P X)⁻¹` are within `2 δ` of `1`. have hsX : ‖s • X‖ ≤ δ := norm_smul_le_of_le_one s hX hs_mem have hsPX : ‖s • (P * X)‖ ≤ δ := norm_smul_le_of_le_one s hPX hs_mem have hW_mul : (1 + s • X) * (1 + s • X)⁻¹ = 1 := one_add_mul_inv_one_add (hsX.trans_lt (by linarith)) have hW_mul' : (1 + s • X)⁻¹ * (1 + s • X) = 1 := inv_one_add_mul_one_add (hsX.trans_lt (by linarith)) have hW : ‖(1 + s • X)⁻¹ - 1‖ ≤ 2 * δ := (norm_inv_one_add_sub_one_le (hsX.trans hδ)).trans (by linarith) have hV_mul : (1 + s • (P * X)) * (1 + s • (P * X))⁻¹ = 1 := one_add_mul_inv_one_add (hsPX.trans_lt (by linarith)) have hV_mul' : (1 + s • (P * X))⁻¹ * (1 + s • (P * X)) = 1 := inv_one_add_mul_one_add (hsPX.trans_lt (by linarith)) have hV : ‖(1 + s • (P * X))⁻¹ - 1‖ ≤ 2 * δ := (norm_inv_one_add_sub_one_le (hsPX.trans hδ)).trans (by linarith) set W : Matrix n n ℂ := (1 + s • X)⁻¹ set V : Matrix n n ℂ := (1 + s • (P * X))⁻¹ set A : Matrix n n ℂ := ⁅P, X⁆ set D : Matrix n n ℂ := Q - P let Z : Matrix n n ℂ := W - 1 let N : Matrix n n ℂ := Z * (A * Z + A) + A * Z -- Rewrite the integrand as four traces, each of a product with one factor of size `δ` and two -- of size `c`. The identity uses `W (1 + s X) = 1`, `V (1 + s P X) = 1`, `P ^ 2 = P`, -- `Q ^ 2 = Q`, `tr ([P, Q] Y) = 0` and `tr (M M') = tr (M' M)`. have h_split : (1 * (V * (P * X))).trace - (Q * (W * X)).trace + s * (2⁻¹ * (Y * Y).trace) = trace ((P * D + Q * D - D) * (A - Y + Z * A - s • (N + A) * X)) - trace (s • (P * A) * ((N + A) * (V - 1) + N)) - trace ((D - P * D - P * D) * D * (X + Z * X)) - trace ((s / 2) • (A - Y) * (A + Y)) := by linear_combination (norm := ( simp +zetaDelta only [hP, hQ, trace_mul_comm P, trace_mul_comm V, trace_mul_comm Y (_ * _), trace_mul_comm X (P * X), mul_sub, sub_mul, mul_add, add_mul, mul_assoc, one_mul, mul_one, lie_def, IsStarProjection.isIdempotentElem, IsIdempotentElem.eq, IsIdempotentElem.mul_self_mul, trace_sub, trace_add, trace_smul, smul_add, Algebra.smul_mul_assoc, Algebra.mul_smul_comm, real_smul, ofReal_div, ofReal_ofNat] ring_nf)) h_comm + congr(($hV_mul' * P * W * X * P + V * P * (A * ($hW_mul' * P * (1 - W) + W * P * $hW_mul) - $hW_mul * X * P) + (1 - P) * $hV_mul * P * X - ⁅P, D⁆ * ($hW_mul' * P * W - W * P * $hW_mul) * X).trace) rw [h_split] apply le_trans · apply_rules (transparency := .reducible) (maxDepth := 99) [norm_smul_le_of_le_one s (hρ := hs_mem), norm_smul_le_of_le_one (s / 2) (hρ := hs_half), norm_proj_mul_le hP, norm_proj_mul_le hQ, @norm_trace_mul_le, norm_sub_le_of_le, norm_add_le_of_le, norm_mul_le_of_le] · have hδc := mul_nonneg hδ_nonneg (sq_nonneg c) linarith [mul_le_mul_of_nonneg_right hδ hδc, mul_le_mul_of_nonneg_right hδ (mul_nonneg hδ_nonneg hδc)] end New.DiscreteSeries end DeterminantOfCompression section MinorExpansion open Ring Matrix Norms.Frobenius Complex ComplexConjugate namespace New.DiscreteSeries variable {n : Type} [Fintype n] [DecidableEq n] {ε : n → ℤˣ} {h : ℕ} {l : HCParam ε} {X : Matrix n n ℂ} attribute [local simp] mul_add add_mul mul_assoc lie_def principalMinor_eq_det coordProj /-- The value of `l.flenstedJensen 1` at `zᴴ` is the conjugate of its value at `z`. -/ lemma conj_flenstedJensen_one (z : Matrix n n ℂ) : conj (l.flenstedJensen 1 z) = l.flenstedJensen 1 zᴴ := by simp [flenstedJensen, conj_weightMinors, ← integral_conj, mul_comm, mul_assoc] /-- Let `u` be block diagonal and strictly triangular: `u i j = 0` unless `l i < l j` and `ε i = ε j`. If `X` and `(1 - u) * X` are accretive, then `l.flenstedJensen 1` at `((1 - u) * X)ᴴ` is the conjugate of its value at `X`. -/ lemma flenstedJensen_shift_eq_conj (hl : l.HasGap h) {u : Matrix n n ℂ} (hu : ∀ i j, ¬(l i < l j ∧ ε i = ε j) → u i j = 0) (hX : X.IsAccretive) (huX : ((1 - u) * X).IsAccretive) : l.flenstedJensen 1 ((1 - u) * X)ᴴ = conj (l.flenstedJensen 1 X) := by have h_det : (1 - u).det ≠ 0 ∧ X.det ≠ 0 := by simpa [det_mul] using huX.det_ne_zero have hu_mem : 1 - u ∈ blockDiagAlg ε := mem_blockDiagAlg.2 fun i j hij ↦ by simp [one_apply_ne (show i ≠ j by rintro rfl; exact hij rfl), hu i j (by tauto)] have hu_borel : IsBorelMatrix l (1 - u) := ⟨fun i j hij ↦ by simp [one_apply_ne (show i ≠ j by rintro rfl; exact lt_irrefl _ hij), hu i j fun h' ↦ lt_asymm hij h'.1], h_det.1⟩ rw [← conj_flenstedJensen_one] congr 1 -- The triangular factor has diagonal entries 1, so its character is trivial. have h := flenstedJensen_triangular_mul_mul_triangular hl hu_mem hu_borel (b := 1) (one_mem _) ⟨blockTriangular_one, by simp⟩ hX (by simpa using huX) simpa [diagChar, show ∀ i, u i i = 0 from fun i ↦ hu i i (by simp)] using h /-- If `‖u‖ ≤ ‖X‖`, then `‖X - u - u * X‖ ≤ ‖X‖ + ‖X‖ + ‖X‖ * ‖X‖`. -/ private lemma norm_sub_sub_mul_le {X u : Matrix n n ℂ} (hu : ‖u‖ ≤ ‖X‖) : ‖X - u - u * X‖ ≤ ‖X‖ + ‖X‖ + ‖X‖ * ‖X‖ := norm_sub_le_of_le (norm_sub_le_of_le le_rfl hu) (norm_mul_le_of_le hu le_rfl) /-- If `‖g - 1‖ ≤ 1 / 4` and `‖u‖, ‖v‖ ≤ ‖g - 1‖`, then `‖(1 - u) * g * (1 - v) - 1‖ ≤ 4 * ‖g - 1‖`. -/ private lemma norm_one_sub_mul_mul_one_sub_sub_one_le {g u v : Matrix n n ℂ} (hg : ‖g - 1‖ ≤ 4⁻¹) (hu : ‖u‖ ≤ ‖g - 1‖) (hv : ‖v‖ ≤ ‖g - 1‖) : ‖(1 - u) * g * (1 - v) - 1‖ ≤ 4 * ‖g - 1‖ := by set X : Matrix n n ℂ := g - 1 let m : Matrix n n ℂ := X - u - u * X have hX_nonneg : 0 ≤ ‖X‖ := norm_nonneg X have hm : ‖m‖ ≤ ‖X‖ + ‖X‖ + ‖X‖ * ‖X‖ := norm_sub_sub_mul_le hu have h_eq : (1 - u) * g * (1 - v) - 1 = m - v - m * v := by have hgX : g = 1 + X := by simp [X] simp only [m, hgX] noncomm_ring rw [h_eq] have := norm_sub_le_of_le (norm_sub_le_of_le hm hv) (norm_mul_le_of_le hm hv) nlinarith [mul_le_mul_of_nonneg_right hg hX_nonneg, mul_le_mul_of_nonneg_right hg (mul_nonneg hX_nonneg hX_nonneg)] /-- To first order, the commutator `[P, (1 - u) * g * (1 - v) - 1]` is `[P, g - 1] - [P, u] - [P, v]`, with error at most `8 * ‖g - 1‖ * ‖[P, g - 1]‖` when `‖g - 1‖ ≤ 1 / 2` and `u`, `v` and their commutators with `P` are bounded by `g - 1` and `[P, g - 1]`. -/ private lemma norm_lie_one_sub_mul_mul_one_sub_sub_le {P g u v : Matrix n n ℂ} (hg : ‖g - 1‖ ≤ 2⁻¹) (hu : ‖u‖ ≤ ‖g - 1‖) (hv : ‖v‖ ≤ ‖g - 1‖) (hPu : ‖⁅P, u⁆‖ ≤ ‖⁅P, g - 1⁆‖) (hPv : ‖⁅P, v⁆‖ ≤ ‖⁅P, g - 1⁆‖) : ‖⁅P, (1 - u) * g * (1 - v) - 1⁆ - (⁅P, g - 1⁆ - ⁅P, u⁆ - ⁅P, v⁆)‖ ≤ 8 * ‖g - 1‖ * ‖⁅P, g - 1⁆‖ := by set X : Matrix n n ℂ := g - 1 set A : Matrix n n ℂ := ⁅P, X⁆ set B : Matrix n n ℂ := ⁅P, u⁆ set C : Matrix n n ℂ := ⁅P, v⁆ let m : Matrix n n ℂ := X - u - u * X let G : Matrix n n ℂ := B * X + u * A have hX_nonneg : 0 ≤ ‖X‖ := norm_nonneg X have hA_nonneg : 0 ≤ ‖A‖ := norm_nonneg A have hm : ‖m‖ ≤ 3 * ‖X‖ := by have : ‖m‖ ≤ ‖X‖ + ‖X‖ + ‖X‖ * ‖X‖ := norm_sub_sub_mul_le hu nlinarith [mul_le_mul_of_nonneg_right hg hX_nonneg] have hG : ‖G‖ ≤ ‖A‖ * ‖X‖ + ‖X‖ * ‖A‖ := norm_add_le_of_le (norm_mul_le_of_le hPu le_rfl) (norm_mul_le_of_le hu le_rfl) have h_eq : ⁅P, (1 - u) * g * (1 - v) - 1⁆ - (A - B - C) = -(G + m * C - (G + B - A) * v) := by have hgX : g = 1 + X := by simp [X] simp only [G, m, A, B, C, hgX, lie_def] noncomm_ring rw [h_eq, norm_neg] have := norm_sub_le_of_le (norm_add_le_of_le hG (norm_mul_le_of_le hm hPv)) (norm_mul_le_of_le (norm_sub_le_of_le (norm_add_le_of_le hG hPu) (le_refl ‖A‖)) hv) linarith [mul_nonneg hX_nonneg hA_nonneg, mul_le_mul_of_nonneg_right hg (mul_nonneg hX_nonneg hA_nonneg)] /-- For `g ∈ USign ε` with `‖g - 1‖ < 1 / 4`, removing the strictly lower and strictly upper block-diagonal parts of `g - 1` by unipotent factors leaves `l.dsCoeff g` equal to `l.flenstedJensen 1` at the shifted matrix. -/ private lemma dsCoeff_eq_flenstedJensen_shift (hl : l.HasGap h) (g : USign ε) (hg : ‖(g : Matrix n n ℂ) - 1‖ < 4⁻¹) : l.dsCoeff g = l.flenstedJensen 1 ((1 - lowerMask ε (-l) ((g : Matrix n n ℂ) - 1)) * g * (1 - lowerMask ε l ((g : Matrix n n ℂ) - 1))) := by set X : Matrix n n ℂ := (g : Matrix n n ℂ) - 1 let u : Matrix n n ℂ := lowerMask ε (-l) X let v : Matrix n n ℂ := lowerMask ε l X have hg_acc : (g : Matrix n n ℂ).IsAccretive := isAccretive_of_norm_sub_one_lt (hg.trans (by norm_num)) have hug_acc : ((1 - u) * (g : Matrix n n ℂ)).IsAccretive := by have h_near : ‖(1 - u) * (g : Matrix n n ℂ) * (1 - 0) - 1‖ ≤ 4 * ‖X‖ := norm_one_sub_mul_mul_one_sub_sub_one_le hg.le norm_entryMask_le (by simp) exact isAccretive_of_norm_sub_one_lt (by simpa using h_near.trans_lt (by linarith)) have hy_acc : ((1 - u) * (g : Matrix n n ℂ) * (1 - v)).IsAccretive := isAccretive_of_norm_sub_one_lt ((norm_one_sub_mul_mul_one_sub_sub_one_le hg.le norm_entryMask_le norm_entryMask_le).trans_lt (by linarith)) have h_left := flenstedJensen_shift_eq_conj hl (u := u) (by simp [u]; grind) hg_acc hug_acc have h_right := flenstedJensen_shift_eq_conj hl (u := vᴴ) (X := ((1 - u) * (g : Matrix n n ℂ))ᴴ) (by simp [v]; grind) (by simpa [IsAccretive, add_comm] using hug_acc) (by simpa [IsAccretive, add_comm] using hy_acc) rw [dsCoeff_eq_flenstedJensen hl (one_mem _) (by simpa using hg_acc)] simpa [u, v] using (h_right.trans (congrArg _ h_left)).symm /-- On a set `p` of highest entries of `l`, multiplying `g` by the strictly triangular unipotent factors `1 - lowerMask ε (-l) Z` and `1 - lowerMask ε l Z` preserves the principal minor on `p`. -/ private lemma principalMinor_one_sub_lowerMask_mul_mul (hl : l.HasGap h) (Z g : Matrix n n ℂ) (p : n → Prop) [DecidablePred p] (hp : ∀ i j, p i → ¬p j → l j < l i) : principalMinor ((1 - lowerMask ε (-l) Z) * g * (1 - lowerMask ε l Z)) p = principalMinor g p := by rw [principalMinor_mul, principalMinor_mul, principalMinor_eq_det, BlockTriangular.det_eq_prod_diag (hb := hl.injective), mul_comm, principalMinor_eq_det, BlockTriangular.det_eq_prod_diag (hb := hl.neg.injective)] <;> simp [BlockTriangular, Matrix.one_apply] <;> grind /-- The trace of the product of a block-diagonal matrix and the off-block-diagonal part `A - blockDiagPart ε A` of any matrix vanishes. -/ private lemma trace_mul_sub_blockDiagPart_eq_zero {Z A : Matrix n n ℂ} (hZ : Z ∈ blockDiagAlg ε) : (Z * (A - blockDiagPart ε A)).trace = 0 := by have hcomm : Z * signMatrix ε = signMatrix ε * Z := (mem_blockDiagAlg_iff_commute.1 hZ).eq.symm have h_tr : (Z * (signMatrix ε * (A * signMatrix ε))).trace = (Z * A).trace := by calc (Z * (signMatrix ε * (A * signMatrix ε))).trace = (signMatrix ε * (Z * A * signMatrix ε)).trace := by simp [← mul_assoc, hcomm] _ = (Z * A * (signMatrix ε * signMatrix ε)).trace := by rw [trace_mul_comm (signMatrix ε), mul_assoc] _ = (Z * A).trace := by rw [signMatrix_mul_self, mul_one] simp [blockDiagPart_eq, mul_sub, h_tr] ring /-- For `g ∈ USign ε` with `‖g - 1‖ ≤ 1 / 2` and `A = [coordProj p, g - 1]`, the quadratic trace combination `(tr (A ^ 2) - 2 tr ((A - blockDiagPart ε A) ^ 2)) / 4` equals `‖A‖ ^ 2 / 4` up to an error of norm at most `2 * ‖g - 1‖ * ‖A‖ ^ 2`, where the difference between `‖A‖ ^ 2` and `-tr (A ^ 2)` comes from `Xᴴ = s ((1 + X)⁻¹ - 1) s` with `X = g - 1` and `s = signMatrix ε`. -/ private lemma exists_trace_lie_sq_sub_two_mul_offDiag (g : USign ε) (hg : ‖(g : Matrix n n ℂ) - 1‖ ≤ 2⁻¹) (p : n → Prop) [DecidablePred p] : let A : Matrix n n ℂ := ⁅coordProj p, (g : Matrix n n ℂ) - 1⁆ ∃ e : ℂ, 4⁻¹ * ((A * A).trace - 2 * ((A - blockDiagPart ε A) * (A - blockDiagPart ε A)).trace) = (‖A‖ ^ 2 : ℂ) / 4 + e ∧ ‖e‖ ≤ 2 * ‖(g : Matrix n n ℂ) - 1‖ * ‖A‖ ^ 2 := by set X : Matrix n n ℂ := (g : Matrix n n ℂ) - 1 set P : Matrix n n ℂ := coordProj p set A : Matrix n n ℂ := ⁅P, X⁆ set s : Matrix n n ℂ := signMatrix ε set V : Matrix n n ℂ := (1 + X)⁻¹ - 1 have hP : IsStarProjection P := isStarProjection_coordProj p have hP_star : Pᴴ = P := hP.isSelfAdjoint have hsP : Commute s P := commute_diagonal .. have hV : ‖V‖ ≤ 2 * ‖X‖ := norm_inv_one_add_sub_one_le hg have hg_inv : (g : Matrix n n ℂ)⁻¹ = s * (g : Matrix n n ℂ)ᴴ * s := by simp [s, ← U.coe_inv (signMatrix_mul_self ε)] have hg_star : (g : Matrix n n ℂ)ᴴ = s * (g : Matrix n n ℂ)⁻¹ * s := by grind [signMatrix_mul_self] have hsAs : ‖s * A * s‖ = ‖A‖ := norm_signMatrix_conj ε A refine ⟨-((4⁻¹ : ℝ) • (V * (A * V + A) + A * V) * (s * A * s)).trace, ?_, ?_⟩ · simp [V, s, hg_star, hP_star, blockDiagPart_eq, hsP.eq, trace_mul_comm P, ← ofReal_pow, A, X, trace_mul_comm s, signMatrix_mul_self, ← mul_assoc s s, mul_sub, sub_mul, ← trace_star_mul_self_eq_norm_sq] ring_nf · rw [norm_neg, smul_mul_assoc, trace_smul, norm_smul, Real.norm_of_nonneg (by norm_num)] have hV' : ‖V‖ ≤ 1 := hV.trans (by linarith) have h_inner : ‖((V * (A * V + A) + A * V) * (s * A * s)).trace‖ ≤ (2 * ‖X‖ * (‖A‖ * 1 + ‖A‖) + ‖A‖ * (2 * ‖X‖)) * ‖A‖ := norm_trace_mul_le (norm_add_le_of_le (norm_mul_le_of_le hV (norm_add_le_of_le (norm_mul_le_of_le le_rfl hV') le_rfl)) (norm_mul_le_of_le le_rfl hV)) hsAs.le have h_rhs : (2 * ‖X‖ * (‖A‖ * 1 + ‖A‖) + ‖A‖ * (2 * ‖X‖)) * ‖A‖ = 6 * ‖X‖ * ‖A‖ ^ 2 := by ring linarith [mul_nonneg (norm_nonneg X) (sq_nonneg ‖A‖)] /-- For `X = g - 1` with `‖X‖ ≤ 1 / 2` and `A = [coordProj p, X]`, the off-block-diagonal part `A - blockDiagPart ε A` has norm at most `3 * ‖A‖`, and it agrees with the commutator of `coordProj p` with `(1 - lowerMask ε (-l) X) * g * (1 - lowerMask ε l X) - 1` up to an error of norm at most `8 * ‖X‖ * ‖A‖`. -/ private lemma norm_offDiag_le_and_norm_lie_sub_le (g : Matrix n n ℂ) (hg : ‖g - 1‖ ≤ 2⁻¹) (p : n → Prop) [DecidablePred p] (hp : ∀ i j, p i → ¬p j → l i < l j) : let A : Matrix n n ℂ := ⁅coordProj p, g - 1⁆ ‖A - blockDiagPart ε A‖ ≤ 3 * ‖A‖ ∧ ‖⁅coordProj p, (1 - lowerMask ε (-l) (g - 1)) * g * (1 - lowerMask ε l (g - 1)) - 1⁆ - (A - blockDiagPart ε A)‖ ≤ 8 * ‖g - 1‖ * ‖A‖ := by dsimp only set X : Matrix n n ℂ := g - 1 set P : Matrix n n ℂ := coordProj p set A : Matrix n n ℂ := ⁅P, X⁆ set A_off : Matrix n n ℂ := A - blockDiagPart ε A let u : Matrix n n ℂ := lowerMask ε (-l) X let v : Matrix n n ℂ := lowerMask ε l X have ⟨hB_mask, hC_mask, h_off⟩ : ⁅P, u⁆ = lowerMask ε (-l) A ∧ ⁅P, v⁆ = lowerMask ε l A ∧ A - ⁅P, u⁆ - ⁅P, v⁆ = A_off := by simp +zetaDelta [← ext_iff, blockDiagPart] grind have hB_le : ‖⁅P, u⁆‖ ≤ ‖A‖ := hB_mask ▸ norm_entryMask_le have hC_le : ‖⁅P, v⁆‖ ≤ ‖A‖ := hC_mask ▸ norm_entryMask_le refine ⟨?_, h_off ▸ norm_lie_one_sub_mul_mul_one_sub_sub_le hg norm_entryMask_le norm_entryMask_le hB_le hC_le⟩ rw [← h_off] linarith [norm_sub_le_of_le (norm_sub_le_of_le (le_refl ‖A‖) hB_le) hC_le] /-- Let `P = coordProj p` and `A_off = A - blockDiagPart ε A`. If `‖y - 1‖ ≤ δ ≤ 1 / 2`, `‖A_off‖ ≤ 3 ‖A‖`, and `‖[P, y - 1] - A_off‖ ≤ 2 δ ‖A‖`, then for every `κ ∈ maxCompactU ε`, the principal minor of `κᴴ y κ` on `p` is `exp (tr (P logOneAdd (y - 1)) - tr (A_off ^ 2) / 4 + t)` with `‖t‖ ≤ 100 δ (4 (‖A‖ + ‖[P, κ]‖)) ^ 2`. -/ private lemma exists_principalMinor_conj_eq_exp {A y : Matrix n n ℂ} {δ : ℝ} (hδ : δ ≤ 2⁻¹) (hy : ‖y - 1‖ ≤ δ) (p : n → Prop) [DecidablePred p] (hP : IsStarProjection (coordProj p)) (hA_nonneg : 0 ≤ ‖A‖) (hA_off : ‖A - blockDiagPart ε A‖ ≤ 3 * ‖A‖) (h_lie : ‖⁅coordProj p, y - 1⁆ - (A - blockDiagPart ε A)‖ ≤ 2 * δ * ‖A‖) (κ : maxCompactU ε) : ∃ t : ℂ, principalMinor ((κ : Matrix n n ℂ)ᴴ * y * (κ : Matrix n n ℂ)) p = cexp ((coordProj p * logOneAdd (y - 1)).trace - 4⁻¹ * ((A - blockDiagPart ε A) * (A - blockDiagPart ε A)).trace + t) ∧ ‖t‖ ≤ 100 * δ * (4 * (‖A‖ + ‖⁅coordProj p, (κ : Matrix n n ℂ)⁆‖)) ^ 2 := by -- The minor of `kᴴ y k` on `p`, as `det (1 + Q (y - 1))` for `Q = k P kᴴ`. set k : Matrix n n ℂ := (κ : Matrix n n ℂ) set P : Matrix n n ℂ := coordProj p set A_off : Matrix n n ℂ := A - blockDiagPart ε A let Q : Matrix n n ℂ := k * P * kᴴ have hk : kᴴ * k = 1 := (U_one_mem_unitaryGroup ⟨_, κ.property⟩).1 have hk' : k * kᴴ = 1 := mul_eq_one_symm hk have hk_mem : k ∈ blockDiagAlg ε := mem_maxCompactU.1 κ.property have hδ_nonneg : 0 ≤ δ := (norm_nonneg _).trans hy have hPk_nonneg : 0 ≤ ‖⁅P, k⁆‖ := norm_nonneg _ have hPQ : ‖P - Q‖ ≤ ‖⁅P, k⁆‖ := by have hP_star : Pᴴ = P := hP.isSelfAdjoint have hkPk : k * ⁅P, k⁆ᴴ = P - Q := by simp [Q, mul_sub, ← mul_assoc, hk', hP_star] exact (hkPk ▸ frobenius_norm_mul_of_unitary hk _).trans_le (norm_star _).le have h_comm : (⁅Q, P⁆ * A_off).trace = 0 := by have hP_mem : P ∈ blockDiagAlg ε := mem_blockDiagAlg_iff_commute.2 (commute_diagonal ..).symm have hk_star_mem : kᴴ ∈ blockDiagAlg ε := inv_eq_left_inv hk ▸ blockDiagAlg.inv_mem hk_mem have hQ_mem : Q ∈ blockDiagAlg ε := mul_mem (mul_mem hk_mem hP_mem) hk_star_mem exact trace_mul_sub_blockDiagPart_eq_zero (sub_mem (mul_mem hQ_mem hP_mem) (mul_mem hP_mem hQ_mem)) have h_near : ‖⁅Q, y - 1⁆ - A_off‖ ≤ δ * (4 * (‖A‖ + ‖⁅P, k⁆‖)) := by rw [show ⁅Q, y - 1⁆ - A_off = (y - 1) * (P - Q) - (P - Q) * (y - 1) + (⁅P, y - 1⁆ - A_off) by simp only [lie_def]; noncomm_ring] have := norm_add_le_of_le (norm_sub_le_of_le (norm_mul_le_of_le hy hPQ) (norm_mul_le_of_le hPQ hy)) h_lie linarith [mul_nonneg hδ_nonneg hA_nonneg, mul_nonneg hδ_nonneg hPk_nonneg] obtain ⟨t, ht_eq, ht⟩ := exists_det_compress_eq_exp_logOneAdd (P := Q) (Y := A_off) (hP.map (Unitary.conjStarAlgAut ℂ _ ⟨k, hk, hk'⟩)) hP hδ hy h_comm h_near (by linarith) (by linarith) have h_conj : principalMinor (kᴴ * y * k) p = (1 + Q * (y - 1)).det := by simp only [mul_assoc, principalMinor_eq_det, coordProj, det_one_add_mul_comm k, Q, P] noncomm_ring [hk] exact ⟨t, h_conj.trans ht_eq, ht⟩ /-- Let `l` have gap `h` and let `X = g - 1` have norm less than `1 / 1000`. There is a matrix `y` with `l.dsCoeff g = l.flenstedJensen 1 y` such that, for `k ∈ K = maxCompactU ε` and the diagonal projection `P = coordProj p` to a set `p` of lowest entries of `l`, the principal minor of `kᴴ y k` on `p` is `exp (tr (P logOneAdd X) + ‖[P, X]‖² / 4 + r)` with `|r| ≤ 2 · 10⁵ ‖X‖ (‖[P, X]‖² + ‖[P, k]‖²)`. -/ lemma exists_principalMinor_eq_exp (hl : l.HasGap h) (g : USign ε) (hg : ‖(g : Matrix n n ℂ) - 1‖ < 1000⁻¹) : ∃ y : Matrix n n ℂ, l.dsCoeff g = l.flenstedJensen 1 y ∧ ∀ (p : n → Prop) [DecidablePred p], (∀ i j, p i → ¬p j → l i < l j) → ∀ k : maxCompactU ε, ∃ r : ℂ, principalMinor ((k : Matrix n n ℂ)ᴴ * y * (k : Matrix n n ℂ)) p = cexp ((coordProj p * logOneAdd ((g : Matrix n n ℂ) - 1)).trace + ‖⁅coordProj p, (g : Matrix n n ℂ) - 1⁆‖ ^ 2 / 4 + r) ∧ ‖r‖ ≤ 200000 * ‖(g : Matrix n n ℂ) - 1‖ * (‖⁅coordProj p, (g : Matrix n n ℂ) - 1⁆‖ ^ 2 + ‖⁅coordProj p, (k : Matrix n n ℂ)⁆‖ ^ 2) := by set X : Matrix n n ℂ := (g : Matrix n n ℂ) - 1 let u : Matrix n n ℂ := lowerMask ε (-l) X let v : Matrix n n ℂ := lowerMask ε l X let y : Matrix n n ℂ := (1 - u) * g * (1 - v) have hX_nonneg : 0 ≤ ‖X‖ := norm_nonneg X have hX_half : ‖X‖ ≤ 2⁻¹ := by linarith have hX_four : 4 * ‖X‖ ≤ 2⁻¹ := by linarith have hy_near : ‖y - 1‖ ≤ 4 * ‖X‖ := norm_one_sub_mul_mul_one_sub_sub_one_le (by linarith) norm_entryMask_le norm_entryMask_le refine ⟨y, dsCoeff_eq_flenstedJensen_shift hl g (hg.trans (by norm_num)), fun p _ hp κ ↦ ?_⟩ -- Notation: `P` projects to `p`, `A = [P, X]`, and `A_off` is the off-block-diagonal part of `A`. set P : Matrix n n ℂ := coordProj p set A : Matrix n n ℂ := ⁅P, X⁆ set A_off : Matrix n n ℂ := A - blockDiagPart ε A have hP : IsStarProjection P := isStarProjection_coordProj p have hP_compl : IsStarProjection (1 - P) := hP.one_sub have hA_nonneg : 0 ≤ ‖A‖ := norm_nonneg A obtain ⟨hA_off_le, h_lie⟩ : ‖A_off‖ ≤ 3 * ‖A‖ ∧ ‖⁅P, y - 1⁆ - A_off‖ ≤ 8 * ‖X‖ * ‖A‖ := norm_offDiag_le_and_norm_lie_sub_le (g : Matrix n n ℂ) hX_half p hp have h_det_compl (x : Matrix n n ℂ) : (1 + (1 - P) * (x - 1)).det = principalMinor x (¬p ·) := by simp [P, det_apply, sub_mul] grind -- The complementary minor of `g`. obtain ⟨x, hx_eq, hx⟩ := exists_det_compress_eq_exp_logOneAdd (Y := -A) hP_compl hP_compl hX_half le_rfl (by simp) (by simp [A, mul_sub, sub_mul, mul_nonneg]) (norm_neg A).le (by simp) -- The complementary minor of `y`, which equals that of `g`. have h_near_compl : ‖⁅1 - P, y - 1⁆ - -A_off‖ ≤ 4 * ‖X‖ * (4 * ‖A‖) := by rw [show ⁅1 - P, y - 1⁆ - -A_off = -(⁅P, y - 1⁆ - A_off) by simp only [lie_def]; noncomm_ring, norm_neg] linarith [mul_nonneg hX_nonneg hA_nonneg] obtain ⟨z, hz_eq, hz⟩ := exists_det_compress_eq_exp_logOneAdd (Y := -A_off) hP_compl hP_compl hX_four hy_near (by simp) h_near_compl (by rw [norm_neg]; linarith) (by simp) obtain ⟨t, ht_eq, ht⟩ := exists_principalMinor_conj_eq_exp hX_four hy_near p hP hA_nonneg hA_off_le (by linarith) κ rw [h_det_compl, principalMinor_one_sub_lowerMask_mul_mul hl X g _ (by tauto), ← h_det_compl, hx_eq] at hz_eq have h_det : cexp (logOneAdd (y - 1)).trace = cexp (logOneAdd X).trace := by have h_det_y : (1 + (y - 1)).det = (1 + X).det := by have h : principalMinor y ⊤ = principalMinor (g : Matrix n n ℂ) ⊤ := principalMinor_one_sub_lowerMask_mul_mul hl X g ⊤ (by tauto) simpa [principalMinor_of_forall, X] using h rw [← det_one_add_eq_exp_trace_logOneAdd (hy_near.trans hX_four), h_det_y, det_one_add_eq_exp_trace_logOneAdd hX_half] obtain ⟨e, he_eq, he⟩ := exists_trace_lie_sq_sub_two_mul_offDiag g hX_half p refine ⟨t + z - x + e, ?_, ?_⟩ · -- Multiply by the complementary minor and by `det y = det g`, and compare exponents. refine ht_eq.trans (mul_right_cancel₀ (by simp) (congr(_ * ($hz_eq * $h_det)).trans ?_)) simp only [← exp_add, one_sub_mul, trace_sub, neg_mul, mul_neg, neg_neg] congr 1 linear_combination he_eq · have := norm_add_le_of_le (norm_sub_le_of_le (norm_add_le_of_le ht hz) hx) he linarith [mul_nonneg hX_nonneg (sq_nonneg ‖A‖), mul_nonneg hX_nonneg (sq_nonneg ‖⁅P, (κ : Matrix n n ℂ)⁆‖), mul_nonneg hX_nonneg (sq_nonneg (‖A‖ - ‖⁅P, (κ : Matrix n n ℂ)⁆‖))] end New.DiscreteSeries end MinorExpansion