Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | module |
| 2 | |
| 3 | import Mathlib.Analysis.LocallyConvex.AbsConvexOpen |
| 4 | import Mathlib.Analysis.Matrix.Hermitian |
| 5 | import Mathlib.RingTheory.PiTensorProduct |
| 6 | import Mathlib.Topology.Separation.CompletelyRegular |
| 7 | import TauCeti.Topology.Algebra.Group.Units |
| 8 | import TauCeti.Topology.Instances.Matrix |
| 9 | public import Lib.General.Measure.FibreMeasure |
| 10 | public import Lib.DiscreteSeries.Haar.GramPolar |
| 11 | import Lib.Adelic.Adeles.AdditiveCharacter |
| 12 | |
| 13 | /-! |
| 14 | # The fibre measure of the Gram map |
| 15 | |
| 16 | Let `J` be a hermitian involution of size `r` and `G = U(J)`. The Gram map sends a tuple of vectors, |
| 17 | the columns of a matrix `Y`, to the real coordinates (`New.gramCoords`) of the hermitian matrix |
| 18 | `T = Yᴴ J Y`. |
| 19 | |
| 20 | * `New.LeGramFiber J E m`: the law of `g E` under the measure `m` on `G` is at most the fibre |
| 21 | measure `dY / dT` on the tuples with the Gram matrix of `E`. |
| 22 | * `New.LeGramFiber.le_haar`, `New.leGramFiber_haar`: on the bases with Gram matrix `J`, which form |
| 23 | the group `G`, the largest measure below the fibre measure is `vol U(r) / 2 ^ r` times the compact |
| 24 | dual Haar measure `New.haarU J`, which is the `volume` of `U(J)`. Here `vol U(r)` is `New.volU r`. |
| 25 | * `New.LeGramFiber.append`, `New.LeGramFiber.append_vector`, `New.LeGramFiber.insert`: lower bounds |
| 26 | for the fibre measure by choosing some vectors, moving them to a fixed position by an isometry, |
| 27 | and choosing the others. |
| 28 | |
| 29 | Notions from other files: |
| 30 | * `New.LeFibreMeasure μ ν π b l`: the measure `l` is at most the fibre measure of `μ / ν` for the |
| 31 | map `π` over the point `b`. |
| 32 | * `New.gramCoords J Y`: the real coordinates of the hermitian matrix `Yᴴ J Y`; `New.hermOfReal t` is |
| 33 | the hermitian matrix with coordinates `t`. |
| 34 | * `New.IsGramSection J V σ`: a differentiable section `σ` of the Gram map on the open set `V` of |
| 35 | coordinates, with invertible values. |
| 36 | * `joinCols e (E₁, E₂)`, `joinCol e (E, v)`: the matrix with the columns of `E₁` and `E₂`, or of `E` |
| 37 | and `v`, in the places given by `e`; `inclMatrix ℂ u` has the columns `e_{u k}`. |
| 38 | |
| 39 | ## Relation to the literature |
| 40 | |
| 41 | Known result: the invariant measure `dY / dT` on tuples of vectors with a given Gram matrix. Source: |
| 42 | C. L. Siegel, Über die analytische Theorie der quadratischen Formen, Ann. of Math. 36 (1935). |
| 43 | -/ |
| 44 | |
| 45 | @[expose] public section |
| 46 | |
| 47 | noncomputable section |
| 48 | |
| 49 | namespace New |
| 50 | |
| 51 | open Matrix MeasureTheory Measure Complex Fintype ENNReal Norms.L2Operator Filter Topology |
| 52 | |
| 53 | variable {ι n n₁ n₂ : Type} [Fintype ι] [Fintype n] [Fintype n₁] [Fintype n₂] |
| 54 | [DecidableEq ι] [DecidableEq n] [DecidableEq n₁] [DecidableEq n₂] |
| 55 | {J : Matrix ι ι ℂ} [IsHermitianInvolution J] |
| 56 | |
| 57 | /-! ### The fibre measure over `J` -/ |
| 58 | |
| 59 | variable (J) in |
| 60 | /-- The image of the measure `m` under `g ↦ g E` is at most the fibre measure `dY / dT` of the Gram |
| 61 | map on the tuples with the Gram matrix of `E`. -/ |
| 62 | def LeGramFiber (E : Matrix ι n ℂ) (m : Measure (U J)) : Prop := |
| 63 | LeFibreMeasure volume volume (gramCoords J) (gramCoords J E) |
| 64 | (m.map fun g : U J ↦ g.val.val * E) |
| 65 | |
| 66 | omit [IsHermitianInvolution J] in |
| 67 | /-- For a section `σ` of the Gram map on `V`, the factor `γ = Y σ(T)⁻¹` depends continuously on |
| 68 | the matrix `Y` with Gram coordinates `T` in `V`. -/ |
| 69 | theorem IsGramSection.continuousOn_mul_inv {V : Set (Matrix ι ι ℝ)} |
| 70 | {σ : Matrix ι ι ℝ → Matrix ι ι ℂ} (hσ : IsGramSection J V σ) : |
| 71 | ContinuousOn (fun Y : Matrix ι ι ℂ ↦ Y * (σ (gramCoords J Y))⁻¹) (gramCoords J ⁻¹' V) := by |
| 72 | intro Y hY |
| 73 | have h_section := |
| 74 | (hσ.differentiableAt hY).continuousAt.comp (continuous_gramCoords J).continuousAt |
| 75 | have h_inv := h_section.matrix_inv ((isUnit_iff_isUnit_det _).1 (hσ.isUnit hY)).ne_zero |
| 76 | exact (continuousAt_id.mul h_inv).continuousWithinAt |
| 77 | |
| 78 | /-- A measure `m` on `U(J)` that is at most the fibre measure `dY / dT` of the Gram map on the bases |
| 79 | with Gram matrix `J` is at most `vol U(r) / 2 ^ r` times the compact dual Haar measure, which is |
| 80 | the `volume` of `U(J)`. Here `r` is the size of `J` and `vol U(r) = volU r`. -/ |
| 81 | theorem LeGramFiber.le_haar {m : Measure (U J)} (h_fibre : LeGramFiber J (1 : Matrix ι ι ℂ) m) : |
| 82 | m ≤ ENNReal.ofReal (volU (card ι) / 2 ^ card ι) • volume := by |
| 83 | -- Test against the indicator function of the open set `W` of the `γ σ(T)` with `γ` in an open |
| 84 | -- set `O` and `T` in `V`; then use the outer regularity of Haar measure. |
| 85 | obtain ⟨V, σ, hσ, h_base, hσ_base⟩ := exists_isGramSection J |
| 86 | set c : ℝ≥0∞ := ENNReal.ofReal (volU (card ι) / 2 ^ card ι) |
| 87 | have h_open (O : Set (U J)) (hO : IsOpen O) : m O ≤ c * volume O := by |
| 88 | obtain ⟨O', hO', hO_eq⟩ := isClosedEmbedding_U.isInducing.isOpen_iff.1 hO |
| 89 | let W : Set (Matrix ι ι ℂ) := |
| 90 | gramCoords J ⁻¹' V ∩ (fun Y ↦ Y * (σ (gramCoords J Y))⁻¹) ⁻¹' O' |
| 91 | have hW : IsOpen W := hσ.continuousOn_mul_inv.isOpen_inter_preimage |
| 92 | (hσ.isOpen.preimage (continuous_gramCoords J)) hO' |
| 93 | let K : Matrix ι ι ℂ → ℝ≥0∞ := W.indicator fun _ ↦ 1 |
| 94 | have hK : Measurable K := measurable_const.indicator hW.measurableSet |
| 95 | have h_slice (μ : Measure (U J)) (t : Matrix ι ι ℝ) (ht : t ∈ V) : |
| 96 | ∫⁻ g : U J, K (g.val.val * σ t) ∂μ = μ O := by |
| 97 | have h_pre : (fun g : U J ↦ g.val.val * σ t) ⁻¹' W = O := Set.ext fun g ↦ by |
| 98 | simp [W, ← hO_eq, gramCoords_U_mul, hσ.gramCoords_eq ht, ht, |
| 99 | mul_nonsing_inv_cancel_right _ _ ((isUnit_iff_isUnit_det _).1 (hσ.isUnit ht))] |
| 100 | rw [← lintegral_indicator_one hO.measurableSet, ← h_pre] |
| 101 | exact lintegral_congr fun g ↦ (Set.indicator_comp_right _).symm |
| 102 | calc m O = ∫⁻ g : U J, K (g.val.val * 1) ∂m := by rw [← h_slice m _ h_base, hσ_base] |
| 103 | _ = ∫⁻ Y, K Y ∂m.map (fun g : U J ↦ g.val.val * 1) := (lintegral_map hK (by fun_prop)).symm |
| 104 | _ ≤ c * volume O := by |
| 105 | refine h_fibre _ (hW.lowerSemicontinuous_indicator zero_le_one) _ ?_ |
| 106 | filter_upwards [eventually_smallSets_subset.2 (hσ.isOpen.mem_nhds h_base)] |
| 107 | with S hS hS_open |
| 108 | rw [(hσ.mono hS_open hS).lintegral_eq hK, |
| 109 | setLIntegral_congr_fun hS_open.measurableSet fun t ht ↦ h_slice volume t (hS ht), |
| 110 | setLIntegral_const, mul_assoc] |
| 111 | have h_regular : (c • (volume : Measure (U J))).OuterRegular := .smul _ ofReal_ne_top |
| 112 | refine Measure.le_iff.2 fun A _ ↦ ?_ |
| 113 | rw [A.measure_eq_iInf_isOpen (c • volume)] |
| 114 | exact le_iInf₂ fun O hAO ↦ le_iInf fun hO ↦ (measure_mono hAO).trans (h_open O hO) |
| 115 | |
| 116 | /-- The measure `vol U(r) / 2 ^ r` times the compact dual Haar measure, which is the `volume` of |
| 117 | `U(J)`, is at most the fibre measure `dY / dT` of the Gram map on the bases with Gram matrix `J` |
| 118 | (`New.LeGramFiber`). Here `r` is the size of `J` and `vol U(r) = volU r`. -/ |
| 119 | theorem leGramFiber_haar : |
| 120 | LeGramFiber J (1 : Matrix ι ι ℂ) (ENNReal.ofReal (volU (card ι) / 2 ^ card ι) • volume) := by |
| 121 | -- The products `g σ(T)` are coordinates near the bases with Gram matrix `J`, and the volume in |
| 122 | -- them is `c` times the product of the Haar measure and `dT`. |
| 123 | obtain ⟨V, σ, hσ, h_base, hσ_base⟩ := exists_isGramSection J |
| 124 | set c : ℝ≥0∞ := ENNReal.ofReal (volU (card ι) / 2 ^ card ι) |
| 125 | set T : Matrix ι ι ℝ := gramCoords J (1 : Matrix ι ι ℂ) |
| 126 | have σ_meas : Measurable σ := hσ.measurable |
| 127 | have h_gram : ∀ t ∈ V, ∀ g : U J, gramCoords J (g.val.val * σ t) = t := fun t ht g ↦ |
| 128 | (gramCoords_U_mul g _).trans (hσ.gramCoords_eq ht) |
| 129 | have σ_cont : ContinuousAt σ T := (hσ.differentiableAt h_base).continuousAt |
| 130 | have h_fibre : LeFibreMeasure volume volume (gramCoords J) T |
| 131 | ((volume.withDensity fun _ : U J ↦ c).map fun g : U J ↦ g.val.val * σ T) := by |
| 132 | refine .of_coordinates (ψ := fun t (g : U J) ↦ g.val.val * σ t) (w := fun _ _ ↦ c) |
| 133 | (by fun_prop) (by fun_prop) measurable_const (hσ.isOpen.mem_nhds h_base) |
| 134 | (fun t ht ↦ .of_forall fun g _ ↦ h_gram t ht g) |
| 135 | (.of_forall fun g ↦ ⟨by fun_prop, continuousAt_const⟩) fun K hK ↦ ?_ |
| 136 | simp only [lintegral_const_mul' c _ ofReal_ne_top] |
| 137 | exact (hσ.lintegral_eq hK).ge.trans (setLIntegral_le_lintegral _ _) |
| 138 | rwa [withDensity_const, hσ_base] at h_fibre |
| 139 | |
| 140 | /-! ### Choosing vectors in turn -/ |
| 141 | |
| 142 | omit [DecidableEq ι] [DecidableEq n] in |
| 143 | theorem sum_norm_sq_eq_re_trace (Y : Matrix ι n ℂ) : |
| 144 | ∑ a : ι, ∑ b : n, ‖Y a b‖ ^ 2 = (Yᴴ * Y).trace.re := by |
| 145 | simp [trace, Matrix.mul_apply, Finset.sum_comm (s := (Finset.univ : Finset ι)), conj_mul', |
| 146 | ← Complex.ofReal_pow] |
| 147 | |
| 148 | omit [DecidableEq ι] in |
| 149 | /-- If the columns of `D` and `R` together form an orthonormal basis of `ℂ ^ ι`, then |
| 150 | `(M, x) ↦ D M + R x` preserves the volume. -/ |
| 151 | theorem measurePreserving_mul_add_mul {D : Matrix ι n₁ ℂ} {R : Matrix ι n₂ ℂ} (hD : Dᴴ * D = 1) |
| 152 | (hR : Rᴴ * R = 1) (hDR : Dᴴ * R = 0) (h_card : card n₁ + card n₂ = card ι) : |
| 153 | MeasurePreserving fun p : Matrix n₁ n ℂ × Matrix n₂ n ℂ ↦ D * p.1 + R * p.2 := by |
| 154 | have hRD : Rᴴ * D = 0 := by simpa using congrArg conjTranspose hDR |
| 155 | let f : (Matrix n₁ n ℂ × Matrix n₂ n ℂ) →ₗ[ℝ] Matrix ι n ℂ := |
| 156 | (mulLeftLinearMap n ℝ D).coprod (mulLeftLinearMap n ℝ R) |
| 157 | have f_inj : Function.Injective f := |
| 158 | Function.LeftInverse.injective (g := fun y ↦ (Dᴴ * y, Rᴴ * y)) fun p ↦ by |
| 159 | simp [f, Matrix.mul_add, ← Matrix.mul_assoc, hD, hR, hDR, hRD] |
| 160 | have h_gram (p : Matrix n₁ n ℂ × Matrix n₂ n ℂ) : (f p)ᴴ * f p = p.1ᴴ * p.1 + p.2ᴴ * p.2 := by |
| 161 | simp [f, Matrix.mul_add, Matrix.add_mul, Matrix.mul_assoc, ← Matrix.mul_assoc Dᴴ, |
| 162 | ← Matrix.mul_assoc Rᴴ, hD, hR, hDR, hRD] |
| 163 | have : IsAddHaarMeasure (volume : Measure (Matrix n₁ n ℂ × Matrix n₂ n ℂ)) := |
| 164 | prod.instIsAddHaarMeasure _ _ |
| 165 | refine HasGaussianIntegral.measurePreserving (f.linearEquivOfInjective f_inj ?_) fun p ↦ ?_ |
| 166 | · simp [Module.finrank_matrix, ← h_card, add_mul] |
| 167 | · simp [sum_norm_sq_eq_re_trace, h_gram] |
| 168 | |
| 169 | omit [Fintype n] in |
| 170 | theorem gramCoords_eq_iff {Y : Matrix ι n ℂ} {t : Matrix n n ℝ} : |
| 171 | gramCoords J Y = t ↔ Yᴴ * J * Y = hermOfReal t := by |
| 172 | refine ⟨fun h ↦ by rw [← h, hermOfReal_gramCoords IsHermitianInvolution.isHermitian], fun h ↦ ?_⟩ |
| 173 | rw [gramCoords, h, skewCoords_I_smul_hermOfReal] |
| 174 | |
| 175 | /-- Coordinates adapted to the Gram products with `E`. If the columns of `J E` and `R` form an |
| 176 | orthonormal basis, then `(M, x) ↦ J E M + R x` preserves the volume. -/ |
| 177 | theorem measurePreserving_mul_mul_add_mul {E : Matrix ι n₁ ℂ} {R : Matrix ι n₂ ℂ} (hE : Eᴴ * E = 1) |
| 178 | (hR : Rᴴ * R = 1) (h_orth : Eᴴ * J * R = 0) (h_card : card n₁ + card n₂ = card ι) : |
| 179 | MeasurePreserving fun p : Matrix n₁ n ℂ × Matrix n₂ n ℂ ↦ J * E * p.1 + R * p.2 := by |
| 180 | have h_adj : (J * E)ᴴ = Eᴴ * J := by rw [conjTranspose_mul, IsHermitianInvolution.isHermitian.eq] |
| 181 | refine measurePreserving_mul_add_mul ?_ hR (by rwa [h_adj]) h_card |
| 182 | simp [h_adj, Matrix.mul_assoc, ← Matrix.mul_assoc J, IsHermitianInvolution.mul_self, hE] |
| 183 | |
| 184 | /-- The fibre measure of the products with `E`. Let `J` be a hermitian involution, and suppose the |
| 185 | columns of `J E` and `R` form an orthonormal basis. Then the image `l` of Lebesgue measure under |
| 186 | `x ↦ J E M + R x` is at most the fibre measure of `y ↦ Eᴴ J y` over `M` (`New.LeFibreMeasure`). That |
| 187 | is, take a lower semicontinuous `K ≥ 0` with `∫_{Eᴴ J y ∈ S} K dy ≤ C·vol(S)` for all open `S` near |
| 188 | `M`; then `∫ K dl ≤ C`. -/ |
| 189 | theorem leFiberMeasure_conjTranspose_mul_mul {E : Matrix ι n₁ ℂ} {R : Matrix ι n₂ ℂ} |
| 190 | (hE : Eᴴ * E = 1) |
| 191 | (hR : Rᴴ * R = 1) (h_orth : Eᴴ * J * R = 0) (h_card : card n₁ + card n₂ = card ι) |
| 192 | (M : Matrix n₁ n ℂ) : |
| 193 | LeFibreMeasure volume volume (fun y : Matrix ι n ℂ ↦ Eᴴ * J * y) M |
| 194 | (volume.map fun x : Matrix n₂ n ℂ ↦ J * E * M + R * x) := by |
| 195 | have h_proj (t : Matrix n₁ n ℂ) (x : Matrix n₂ n ℂ) : Eᴴ * J * (J * E * t + R * x) = t := by |
| 196 | simp [Matrix.mul_add, ← Matrix.mul_assoc, h_orth, Matrix.mul_assoc _ J J, |
| 197 | IsHermitianInvolution.mul_self, hE] |
| 198 | exact .of_measurePreserving (measurePreserving_mul_mul_add_mul hE hR h_orth h_card) |
| 199 | (by fun_prop) h_proj fun _ ↦ Continuous.continuousAt (by fun_prop) |
| 200 | |
| 201 | omit [DecidableEq n] [DecidableEq n₁] in |
| 202 | /-- Choosing `g` with law `m` and completing `g E₁` by further columns with the Lebesgue measure, in |
| 203 | the places given by `e` (`joinCols`), is the same as completing `E₁` first and then moving all |
| 204 | columns by `g`. -/ |
| 205 | theorem map_joinCols_prod_volume (e : n₁ ⊕ n₂ ≃ n) (E₁ : Matrix ι n₁ ℂ) (m : Measure (U J)) |
| 206 | [SFinite m] : |
| 207 | (volume.prod (m.map fun g : U J ↦ g.val.val * E₁)).map |
| 208 | (fun p : Matrix ι n₂ ℂ × Matrix ι n₁ ℂ ↦ joinCols e p.swap) = |
| 209 | (m.prod volume).map fun p : U J × Matrix ι n₂ ℂ ↦ p.1.val.val * joinCols e (E₁, p.2) := by |
| 210 | have h_first : MeasurePreserving (fun g : U J ↦ g.val.val * E₁) m |
| 211 | (m.map fun g : U J ↦ g.val.val * E₁) := ⟨by fun_prop, rfl⟩ |
| 212 | -- For each fixed `g`, multiplication by `g` preserves the volume of the further columns. |
| 213 | have h_move : MeasurePreserving (fun p : U J × Matrix ι n₂ ℂ ↦ |
| 214 | (p.1.val.val * E₁, p.1.val.val * p.2)) (m.prod volume) |
| 215 | ((m.map fun g : U J ↦ g.val.val * E₁).prod volume) := |
| 216 | h_first.skew_product (by fun_prop) (.of_forall fun g ↦ (measurePreserving_U_mul g).map_eq) |
| 217 | have h_swap := measurePreserving_swap.comp h_move |
| 218 | rw [← h_swap.map_eq, Measure.map_map (by fun_prop) h_swap.measurable] |
| 219 | simp [Function.comp_def, mul_joinCols] |
| 220 | |
| 221 | omit [DecidableEq n] [DecidableEq n₁] [DecidableEq n₂] [IsHermitianInvolution J] in |
| 222 | /-- Let `E = joinCols e (E₁, E₂)` have the columns of `E₁` and `E₂`. If `m'` is carried by the |
| 223 | elements that fix `E₁`, then the law of `g (E₁, g' E₂)` under `m × m'` is the law of `g E` under |
| 224 | the convolution `m ∗ₘ m'`. -/ |
| 225 | theorem map_mul_joinCols_prod_eq_map_mconv {E : Matrix ι n ℂ} {E₁ : Matrix ι n₁ ℂ} |
| 226 | {E₂ : Matrix ι n₂ ℂ} (e : n₁ ⊕ n₂ ≃ n) (hE : joinCols e (E₁, E₂) = E) {m m' : Measure (U J)} |
| 227 | [SFinite m'] (h_fix : ∀ᵐ g : U J ∂m', g.val.val * E₁ = E₁) : |
| 228 | (m.prod (m'.map fun g : U J ↦ g.val.val * E₂)).map |
| 229 | (fun p : U J × Matrix ι n₂ ℂ ↦ p.1.val.val * joinCols e (E₁, p.2)) = |
| 230 | (m ∗ₘ m').map fun g : U J ↦ g.val.val * E := by |
| 231 | have h_prod : m.prod (m'.map fun g : U J ↦ g.val.val * E₂) = |
| 232 | (m.prod m').map (Prod.map id fun g : U J ↦ g.val.val * E₂) := by |
| 233 | rw [← map_prod_map _ _ measurable_id (by fun_prop), m.map_id] |
| 234 | have h_ae : ∀ᵐ p : U J × U J ∂m.prod m', |
| 235 | p.1.val.val * joinCols e (E₁, p.2.val.val * E₂) = (p.1 * p.2).val.val * E := |
| 236 | (quasiMeasurePreserving_snd.ae h_fix).mono fun p hp ↦ by |
| 237 | simp [← hE, mul_joinCols, Matrix.mul_assoc, hp] |
| 238 | rw [h_prod, Measure.map_map (by fun_prop) (by fun_prop), mconv, |
| 239 | Measure.map_map (by fun_prop) measurable_mul] |
| 240 | exact map_congr h_ae |
| 241 | |
| 242 | /-- Choosing vectors in turn. Let the tuple `E = joinCols e (E₁, E₂)` consist of `E₁` and `E₂`, in |
| 243 | the places given by `e`. Suppose that the law of `g E₁` under `m` is at most the fibre measure of |
| 244 | the Gram map (`New.LeGramFiber`), that `m'` is carried by the elements that fix `E₁`, and that the |
| 245 | law of `g' E₂` under `m'` is at most the fibre measure (`New.LeFibreMeasure`) of the map that sends |
| 246 | `y` to the products `E₁ᴴ J y` and to the coordinates `gramCoords J y` of its Gram matrix. Then the |
| 247 | law of `g g' E` is at most the fibre measure of the Gram map over the Gram matrix of `E`. -/ |
| 248 | theorem LeGramFiber.append {E : Matrix ι n ℂ} {E₁ : Matrix ι n₁ ℂ} {E₂ : Matrix ι n₂ ℂ} |
| 249 | (e : n₁ ⊕ n₂ ≃ n) (hE : joinCols e (E₁, E₂) = E) {m m' : Measure (U J)} [SFinite m] |
| 250 | [SFinite m'] (h_first : LeGramFiber J E₁ m) |
| 251 | (h_rest : LeFibreMeasure volume volume |
| 252 | (fun y : Matrix ι n₂ ℂ ↦ (E₁ᴴ * J * y, gramCoords J y)) (E₁ᴴ * J * E₂, gramCoords J E₂) |
| 253 | (m'.map fun g : U J ↦ g.val.val * E₂)) |
| 254 | (h_fix : ∀ᵐ g : U J ∂m', g.val.val * E₁ = E₁) : |
| 255 | LeGramFiber J E (m ∗ₘ m') := by |
| 256 | -- The Gram matrix consists of `π₁`, the Gram matrix of the first columns, and of `π₂`, the |
| 257 | -- other two blocks. Take the fibre of `π₁`, and on it the fibre of `π₂`. |
| 258 | let split (Y : Matrix ι n ℂ) : Matrix ι n₁ ℂ × Matrix ι n₂ ℂ := (joinCols e).symm Y |
| 259 | let π₁ (Y : Matrix ι n ℂ) : Matrix n₁ n₁ ℝ := gramCoords J (split Y).1 |
| 260 | let π₂ (Y : Matrix ι n ℂ) : Matrix n₁ n₂ ℂ × Matrix n₂ n₂ ℝ := |
| 261 | ((split Y).1ᴴ * J * (split Y).2, gramCoords J (split Y).2) |
| 262 | let move (p : U J × Matrix ι n₂ ℂ) : Matrix ι n ℂ := p.1.val.val * joinCols e (E₁, p.2) |
| 263 | have split_cont : Continuous split := (joinCols e).symm.continuous_of_finiteDimensional |
| 264 | have π₂_cont : Continuous π₂ := by fun_prop |
| 265 | have h₁ : LeFibreMeasure volume volume π₁ (gramCoords J E₁) ((m.prod volume).map move) := by |
| 266 | have join_vol : MeasurePreserving (fun p : Matrix ι n₂ ℂ × Matrix ι n₁ ℂ ↦ joinCols e p.swap) |
| 267 | (volume.prod volume) := (measurePreserving_joinCols e).comp measurePreserving_swap |
| 268 | rw [← map_joinCols_prod_volume, ← join_vol.map_eq] |
| 269 | exact h_first.map_prod join_vol.measurable (fun y ↦ by fun_prop) (by fun_prop) |
| 270 | (by simp [π₁, split]) |
| 271 | have h_law : (m.prod (m'.map fun g : U J ↦ g.val.val * E₂)).map move = |
| 272 | (m ∗ₘ m').map fun g : U J ↦ g.val.val * E := map_mul_joinCols_prod_eq_map_mconv e hE h_fix |
| 273 | -- The products in `π₂` do not change when all columns are moved by `g`. |
| 274 | have h₂ : LeFibreMeasure ((m.prod volume).map move) volume π₂ (E₁ᴴ * J * E₂, gramCoords J E₂) |
| 275 | ((m ∗ₘ m').map fun g : U J ↦ g.val.val * E) := by |
| 276 | rw [← h_law] |
| 277 | refine h_rest.map_prod (by fun_prop) (fun g ↦ by fun_prop) π₂_cont.measurable fun g y ↦ ?_ |
| 278 | simp only [π₂, split, move, mul_joinCols, LinearEquiv.symm_apply_apply, gramCoords_U_mul, |
| 279 | U.gram_invariant] |
| 280 | obtain ⟨φ, φ_vol, φ_apply⟩ : |
| 281 | ∃ φ : Matrix n n ℝ ≃ₜ Matrix n₁ n₁ ℝ × Matrix n₁ n₂ ℂ × Matrix n₂ n₂ ℝ, |
| 282 | MeasurePreserving φ ∧ ∀ t : Matrix n n ℝ, φ t = (t.submatrix (e ∘ Sum.inl) (e ∘ Sum.inl), |
| 283 | (hermOfReal t).submatrix (e ∘ Sum.inl) (e ∘ Sum.inr), |
| 284 | t.submatrix (e ∘ Sum.inr) (e ∘ Sum.inr)) := |
| 285 | exists_measurePreserving_hermBlocks e |
| 286 | have φ_gram (Y : Matrix ι n ℂ) : (π₁ Y, π₂ Y) = φ (gramCoords J Y) := by |
| 287 | rw [φ_apply, hermOfReal_gramCoords IsHermitianInvolution.isHermitian] |
| 288 | simp [π₁, π₂, split, joinCols, gramCoords, skewCoords, Matrix.mul_apply, ← ext_iff] |
| 289 | have h_base : (gramCoords J E₁, E₁ᴴ * J * E₂, gramCoords J E₂) = φ (gramCoords J E) := by |
| 290 | simp only [← φ_gram, ← hE, π₁, π₂, split, LinearEquiv.symm_apply_apply] |
| 291 | have h_both : LeFibreMeasure volume (volume.prod volume) (fun Y ↦ φ (gramCoords J Y)) |
| 292 | (φ (gramCoords J E)) ((m ∗ₘ m').map fun g : U J ↦ g.val.val * E) := by |
| 293 | simpa only [h_base, φ_gram] using h₁.trans h₂ π₂_cont |
| 294 | have : BorelSpace (Matrix n₁ n₁ ℝ × Matrix n₁ n₂ ℂ × Matrix n₂ n₂ ℝ) := Prod.borelSpace |
| 295 | simpa only [LeGramFiber, Function.comp_def, φ.symm_apply_apply] using |
| 296 | h_both.comp_homeomorph φ.symm (φ_vol.symm φ.toMeasurableEquiv) |
| 297 | |
| 298 | /-- Choosing one more vector `v`: the case of `New.LeGramFiber.append` in which the second tuple |
| 299 | has one member. Suppose that the law of `g E` under `m` is at most the fibre measure of the Gram |
| 300 | map, that `m'` is carried by the elements that fix `E`, and that the law of `g v` under `m'` is at |
| 301 | most the fibre measure of the map that sends `y` to the vector `Eᴴ J y` and the number `y* J y`. |
| 302 | Then the law of `g (E, v)` under `m ∗ m'` is at most the fibre measure of the Gram map, `(E, v)` |
| 303 | having its columns in the places given by `e`. -/ |
| 304 | theorem LeGramFiber.append_vector {E : Matrix ι n₁ ℂ} {v : ι → ℂ} (e : n₁ ⊕ Unit ≃ n) |
| 305 | {m m' : Measure (U J)} [SFinite m] [SFinite m'] (h_first : LeGramFiber J E m) |
| 306 | (h_next : LeFibreMeasure volume volume |
| 307 | (fun y : ι → ℂ ↦ (Eᴴ *ᵥ J *ᵥ y, (star y ⬝ᵥ J *ᵥ y).re)) (Eᴴ *ᵥ J *ᵥ v, (star v ⬝ᵥ J *ᵥ v).re) |
| 308 | (m'.map fun g : U J ↦ g.val.val *ᵥ v)) |
| 309 | (h_fix : ∀ᵐ g : U J ∂m', g.val.val * E = E) : |
| 310 | LeGramFiber J (joinCol e (E, v)) (m ∗ₘ m') := by |
| 311 | -- Carry `h_next` from vectors to matrices with one column (`toCol`), and from pairs of a vector |
| 312 | -- and a number to the two blocks of the Gram matrix (`toCorner`). |
| 313 | have h_col (A : Matrix ι ι ℂ) (y : ι → ℂ) : A * toCol ι ℂ y = toCol ι ℂ (A *ᵥ y) := rfl |
| 314 | have h_comm (y : ι → ℂ) : toCorner n₁ (Eᴴ *ᵥ J *ᵥ y, (star y ⬝ᵥ J *ᵥ y).re) = |
| 315 | (Eᴴ * J * toCol ι ℂ y, gramCoords J (toCol ι ℂ y)) := by |
| 316 | have h_real : (star y ⬝ᵥ J *ᵥ y).im = 0 := |
| 317 | IsHermitianInvolution.isHermitian.im_star_dotProduct_mulVec_self y |
| 318 | have h_norm : ((toCol ι ℂ y)ᴴ * J * toCol ι ℂ y) () () = star y ⬝ᵥ J *ᵥ y := by |
| 319 | exact congrArg (fun A : Matrix Unit Unit ℂ ↦ A () ()) (gram_replicateCol J y y) |
| 320 | rw [toCorner_apply, mulVec_mulVec] |
| 321 | refine Prod.ext rfl (Matrix.ext fun _ _ ↦ ?_) |
| 322 | simp [gramCoords, skewCoords, h_norm, h_real] |
| 323 | have h_moved : LeFibreMeasure volume volume |
| 324 | ((fun y ↦ (Eᴴ * J * y, gramCoords J y)) ∘ toCol ι ℂ) |
| 325 | (Eᴴ * J * toCol ι ℂ v, gramCoords J (toCol ι ℂ v)) (m'.map fun g ↦ g.val.val *ᵥ v) := by |
| 326 | rw [← h_comm] |
| 327 | exact (h_next.comp_homeomorph _ measurePreserving_toCorner).congr (.of_forall h_comm) |
| 328 | refine h_first.append (E₂ := toCol ι ℂ v) e rfl ?_ h_fix |
| 329 | simpa (disch := fun_prop) only [(measurePreserving_toCol ι ℂ).map_eq, Measure.map_map, h_col, |
| 330 | Function.comp_def] using h_moved.map (by fun_prop) (by fun_prop) (by fun_prop) |
| 331 | |
| 332 | omit [IsHermitianInvolution J] in |
| 333 | /-- For the empty tuple `E`, the law of `g E` under the unit mass at the identity of `U(J)` is at |
| 334 | most the fibre measure of the Gram map. -/ |
| 335 | theorem leGramFiber_dirac [IsEmpty n] (E : Matrix ι n ℂ) : LeGramFiber J E (dirac 1) := by |
| 336 | have h_vol : MeasurePreserving (fun _ : Matrix n n ℝ × Unit ↦ E) (volume.prod (dirac ())) := |
| 337 | ⟨measurable_const, |
| 338 | by simp [volume_eq_dirac_of_isEmpty E, volume_eq_dirac_of_isEmpty (gramCoords J E)]⟩ |
| 339 | have h_fibre : LeFibreMeasure volume volume (gramCoords J) (gramCoords J E) |
| 340 | ((dirac () : Measure Unit).map fun _ ↦ E) := |
| 341 | .of_measurePreserving h_vol (by fun_prop) (fun _ _ ↦ Subsingleton.elim _ _) |
| 342 | fun _ ↦ continuousAt_const |
| 343 | simpa [LeGramFiber] using h_fibre |
| 344 | |
| 345 | /-- The bijection from `p` and one more point onto `q = p ∪ {j}`, for `j` outside `p`: the point |
| 346 | goes to `j`. -/ |
| 347 | def subtypeInsertEquiv {α : Type} {p q : α → Prop} {j : α} (hj : ¬p j) |
| 348 | (hq : ∀ i : α, q i ↔ p i ∨ i = j) : Subtype p ⊕ Unit ≃ Subtype q := |
| 349 | .ofBijective (Sum.elim (fun i ↦ ⟨i, (hq i).2 (.inl i.2)⟩) fun _ ↦ ⟨j, (hq j).2 (.inr rfl)⟩) <| by |
| 350 | simp only [Function.Bijective, Function.Injective, Function.Surjective, Sum.forall, |
| 351 | Sum.exists, Subtype.forall, Subtype.exists, Sum.elim_inl, Sum.elim_inr, Subtype.mk.injEq] |
| 352 | grind |
| 353 | |
| 354 | /-- Choosing one more basis vector, `inclMatrix ℂ Subtype.val` being the matrix with the columns |
| 355 | `e_i` for the `i` in a set of indices. Let `p` be a set of indices, `j` an index outside it and |
| 356 | `q = p ∪ {j}`. Let the law of `g (e_i)_{i ∈ p}` under `m` be at most the fibre measure of the Gram |
| 357 | map. Let `m'` be carried by the elements that fix these `e_i`, and let the law of `g e_j` under |
| 358 | `m'` be at most the fibre measure of the `J`-products of a vector `y` with them and with itself. |
| 359 | Then the law of `g (e_i)_{i ∈ q}` under `m ∗ m'` is at most the fibre measure of the Gram map. -/ |
| 360 | theorem LeGramFiber.insert {p q : ι → Prop} [DecidablePred p] [DecidablePred q] {j : ι} |
| 361 | (hj : ¬p j) (hq : ∀ i : ι, q i ↔ p i ∨ i = j) {m m' : Measure (U J)} [SFinite m] [SFinite m'] |
| 362 | (h_first : LeGramFiber J (inclMatrix ℂ (Subtype.val : Subtype p → ι)) m) |
| 363 | (h_next : LeFibreMeasure volume volume |
| 364 | (fun y : ι → ℂ ↦ (fun i : Subtype p ↦ (J *ᵥ y) i, (star y ⬝ᵥ J *ᵥ y).re)) |
| 365 | (fun i : Subtype p ↦ J i j, (J j j).re) (m'.map fun g : U J ↦ g.val.val *ᵥ Pi.single j 1)) |
| 366 | (h_fix : ∀ᵐ g : U J ∂m', ∀ i k : ι, p k → g.val.val i k = (1 : Matrix ι ι ℂ) i k) : |
| 367 | LeGramFiber J (inclMatrix ℂ (Subtype.val : Subtype q → ι)) (m ∗ₘ m') := by |
| 368 | set E : Matrix ι (Subtype p) ℂ := inclMatrix ℂ Subtype.val |
| 369 | have h_join : |
| 370 | joinCol (subtypeInsertEquiv hj hq) (E, Pi.single j 1) = inclMatrix ℂ Subtype.val := by |
| 371 | ext i k |
| 372 | obtain ⟨k | ⟨⟩, rfl⟩ := (subtypeInsertEquiv hj hq).surjective k |
| 373 | · exact joinCol_inl .. |
| 374 | · exact (joinCol_inr ..).trans (Pi.single_apply j 1 i) |
| 375 | have h_products (y : ι → ℂ) : Eᴴ *ᵥ y = fun i : Subtype p ↦ y i := |
| 376 | funext fun i ↦ by simp [E, inclMatrix, mulVec, dotProduct, Matrix.one_apply] |
| 377 | rw [← h_join] |
| 378 | refine h_first.append_vector _ ?_ (h_fix.mono fun g hg ↦ |
| 379 | (mul_inclMatrix g.val.val _).trans (Matrix.ext fun i k ↦ hg i k k.property)) |
| 380 | -- `mulVec_mulVec` would merge `Eᴴ` and `J` before `h_products` applies. |
| 381 | simpa [h_products, -mulVec_mulVec] using h_next |
| 382 | |
| 383 | end New |
| 384 | |
| 385 | end |