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.MeasureTheory.Integral.Pi |
| 4 | import TauCeti.LinearAlgebra.Matrix.PosSemidef |
| 5 | public import Lib.General.Groups.BesselGroups |
| 6 | public import Lib.General.Measure.IntegralOperators |
| 7 | |
| 8 | /-! |
| 9 | # Sieve systems over places: products, positivity and lower semicontinuity |
| 10 | |
| 11 | An abstract sieve. A system `New.SieveSystem` over a ring `C` with a measure (a place, or a product |
| 12 | of places) consists of forms `J i p q`, `i ≤ n + 1`, on pairs of sequences ("heads"), each but the |
| 13 | last the integral of the next one over a common entry, with bounds `B₀`, `Λ`, `β`. |
| 14 | |
| 15 | * `New.SieveSystem.pi`: a product of finitely many systems on `ℂ` (one for each real |
| 16 | place in the application) and one more system is a system. |
| 17 | * `New.SieveSystem.integrable_sum_update`, `New.SieveSystem.integral_sum_update`, |
| 18 | `New.SieveSystem.norm_integral_mul_sum_update_le`: sum the forms `J (i + 1)` over all pairs of |
| 19 | heads from one finite family, with a common entry at position `i ≤ n`. The sum is integrable in |
| 20 | the common entry, its integral is the sum of the `J i`, and its twisted integrals are bounded by |
| 21 | `β` and `Λ`. |
| 22 | * `New.SieveSystem.sum_nonneg`, `New.SieveSystem.lowerSemicontinuousAt_sum`: such a sum is |
| 23 | nonnegative, and its real part is lower semicontinuous in a parameter `x : C` at each point where |
| 24 | every head is continuous. |
| 25 | * `New.dampedPower`, `New.headWeight`: the decay in the frequency and the weights `Λ` of the heads |
| 26 | at the real places. |
| 27 | |
| 28 | ## Relation to the literature |
| 29 | |
| 30 | See `New.Spanning.MainTerm.GlobalSieve` for related work. |
| 31 | -/ |
| 32 | |
| 33 | @[expose] public section |
| 34 | |
| 35 | noncomputable section |
| 36 | |
| 37 | open MeasureTheory Finset Function Matrix ComplexOrder |
| 38 | |
| 39 | namespace New |
| 40 | |
| 41 | /-- The gain at the ratio `r`: the function `r ^ k * min 1 r ^ 6`. -/ |
| 42 | def dampedPower (k : ℕ) (r : ℝ) : ℝ := r ^ k * min 1 r ^ 6 |
| 43 | |
| 44 | /-- The weight of a head `p` (with entries in `ℂˣ`) of length `i` at a real place. It is zero unless |
| 45 | the partial products `δ = p 0 * ⋯ * p l`, `l < i`, have modulus at most `R`, and then it is the |
| 46 | product of the numbers `max 1 ‖δ‖⁻¹ ^ K`. -/ |
| 47 | def headWeight (R : ℝ) (K i : ℕ) (p : ℕ → ℂˣ) : ℝ := |
| 48 | ∏ l ∈ range i, |
| 49 | let δ : ℂ := ∏ a ∈ range (l + 1), (p a : ℂ) |
| 50 | if ‖δ‖ ≤ R then max 1 ‖δ‖⁻¹ ^ K else 0 |
| 51 | |
| 52 | lemma headWeight_nonneg (R : ℝ) (K i : ℕ) (p : ℕ → ℂˣ) : 0 ≤ headWeight R K i p := |
| 53 | prod_nonneg fun _ _ ↦ ite_nonneg (by positivity) le_rfl |
| 54 | |
| 55 | variable {C U τ : Type} [CommRing C] [MeasureSpace C] [TopologicalSpace U] [Fintype τ] |
| 56 | |
| 57 | /-- The axioms of the sieve at a place or a product of places: `C` is a ring with a measure, `u c` |
| 58 | is the entry given by `c ∈ C`, and `ι` maps entries back to `C` (in the applications `x ↦ x⁻¹`, |
| 59 | times a constant at the finite places). The forms `J i p q`, `i ≤ n + 1`, pair two sequences of |
| 60 | entries, called heads, with weights `Λ i p`. The field `integrable_and_integral_update` makes each |
| 61 | form but the top one the integral of the next over a common entry, and bounds the same integral |
| 62 | twisted by `ψ (ξ * c)` at a unit `ξ` in terms of the decay `β ξ`. The top form `J (n + 1)` is |
| 63 | continuous, and positive semidefinite on heads with a common entry at position `n`. The bottom form |
| 64 | `J 0` has modulus at most `En`. -/ |
| 65 | structure SieveSystem (u : C → U) (ι : U → C) (n : ℕ) (J : ℕ → (ℕ → U) → (ℕ → U) → ℂ) (ψ : C → ℂ) |
| 66 | (En : ℝ) (Λ : ℕ → (ℕ → U) → ℝ) (β : C → ℝ) : Prop where |
| 67 | /-- The function `ψ` takes the value `1` at `0`. -/ |
| 68 | psi_zero : ψ 0 = 1 |
| 69 | /-- For `i ≤ n`, give both heads the entry `u c` at position `i`. Then `ψ (ξ * c)` times the form |
| 70 | `J (i + 1)` is integrable in `c`; its integral is `J i p q` if `ξ = 0`, and has modulus at most |
| 71 | `β ξ * (Λ i p * Λ i q)` if `ξ` is a unit. -/ |
| 72 | integrable_and_integral_update (i : ℕ) (p q : ℕ → U) (ξ : C) : |
| 73 | i ≤ n → |
| 74 | let f (c : C) : ℂ := ψ (ξ * c) * J (i + 1) (update p i (u c)) (update q i (u c)) |
| 75 | Integrable f ∧ |
| 76 | (ξ = 0 → ∫ c : C, f c = J i p q) ∧ |
| 77 | (IsUnit ξ → ‖∫ c : C, f c‖ ≤ β ξ * (Λ i p * Λ i q)) |
| 78 | /-- The top form `J (n + 1)` is a positive semidefinite kernel on heads with the same entry at |
| 79 | position `n`. -/ |
| 80 | posSemidef {κ : Type} [Fintype κ] (a : κ → ℕ → U) (t : U) : |
| 81 | (∀ i : κ, a i n = t) → (Matrix.of fun i j : κ ↦ J (n + 1) (a i) (a j)).PosSemidef |
| 82 | /-- The top form `J (n + 1)` is jointly continuous. -/ |
| 83 | continuous : Continuous (J (n + 1)).uncurry |
| 84 | /-- The bottom form `J 0` has modulus at most `En`. -/ |
| 85 | norm_bot_le (p q : ℕ → U) : ‖J 0 p q‖ ≤ En |
| 86 | /-- For `i < n`, if `ξ = ι (p i) - ι (q i)` is a unit, then `J (i + 1) p q` has modulus at most |
| 87 | `β ξ * (Λ (i + 1) p * Λ (i + 1) q)`. -/ |
| 88 | norm_le_of_isUnit_sub (i : ℕ) (p q : ℕ → U) : |
| 89 | i < n → |
| 90 | let ξ : C := ι (p i) - ι (q i) |
| 91 | IsUnit ξ → ‖J (i + 1) p q‖ ≤ β ξ * (Λ (i + 1) p * Λ (i + 1) q) |
| 92 | |
| 93 | variable {u : C → U} {ι : U → C} {n : ℕ} {J : ℕ → (ℕ → U) → (ℕ → U) → ℂ} {ψ : C → ℂ} {B₀ : ℝ} |
| 94 | {Λ : ℕ → (ℕ → U) → ℝ} {β : C → ℝ} |
| 95 | |
| 96 | /-- Bounds on the norms of finitely many complex factors `f v` and of one more factor `a` multiply |
| 97 | to a bound on the norm of their product. -/ |
| 98 | lemma norm_prod_mul_le_prod_mul {f : τ → ℂ} {g : τ → ℝ} {a : ℂ} {b : ℝ} |
| 99 | (hf : ∀ v : τ, ‖f v‖ ≤ g v) (ha : ‖a‖ ≤ b) : ‖(∏ v : τ, f v) * a‖ ≤ (∏ v : τ, g v) * b := |
| 100 | norm_mul_le_of_le ((norm_prod_le univ f).trans (by gcongr with v; exact hf v)) ha |
| 101 | |
| 102 | /-- Schur's product theorem for finitely many kernels: the entrywise product of positive |
| 103 | semidefinite kernels `A v` over `v ∈ s` and `B` is positive semidefinite. -/ |
| 104 | lemma posSemidef_prod_mul {σ κ : Type} {A : σ → κ → κ → ℂ} {B : κ → κ → ℂ} |
| 105 | (hA : ∀ v : σ, (Matrix.of (A v)).PosSemidef) (hB : (Matrix.of B).PosSemidef) (s : Finset σ) : |
| 106 | (Matrix.of fun i j : κ ↦ (∏ v ∈ s, A v i j) * B i j).PosSemidef := |
| 107 | (TauCeti.posSemidef_schur_finset_prod (s := s) fun v _ ↦ hA v).hadamard hB |
| 108 | |
| 109 | /-- The component at the complex factor `v` of a head `p` with entries in `(τ → ℂˣ) × U`: the |
| 110 | sequence `k ↦ (p k).1 v`. -/ |
| 111 | def headAt (v : τ) (p : ℕ → (τ → ℂˣ) × U) : ℕ → ℂˣ := (fun y : (τ → ℂˣ) × U ↦ y.1 v) ∘ p |
| 112 | |
| 113 | /-- For `i ≤ n`, give both heads the entry `u c` at position `i`. Then `ψ (ξ * c)` times the form |
| 114 | `J (i + 1)` is integrable in `c`. -/ |
| 115 | lemma SieveSystem.integrable_mul_update (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} (hi : i ≤ n) |
| 116 | (p q : ℕ → U) (ξ : C) : |
| 117 | Integrable fun c : C ↦ ψ (ξ * c) * J (i + 1) (update p i (u c)) (update q i (u c)) := |
| 118 | (K.integrable_and_integral_update i p q ξ hi).1 |
| 119 | |
| 120 | /-- For `i ≤ n`, the form `J (i + 1)` is integrable in a common entry `u c` at position `i`. -/ |
| 121 | lemma SieveSystem.integrable_update (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} (hi : i ≤ n) |
| 122 | (p q : ℕ → U) : Integrable fun c : C ↦ J (i + 1) (update p i (u c)) (update q i (u c)) := by |
| 123 | simpa only [zero_mul, K.psi_zero, one_mul] using K.integrable_mul_update hi p q 0 |
| 124 | |
| 125 | /-- The recursion: for `i ≤ n`, the form `J i` is the integral of `J (i + 1)` over a common entry |
| 126 | `u c` at position `i`. -/ |
| 127 | lemma SieveSystem.integral_update (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} (hi : i ≤ n) |
| 128 | (p q : ℕ → U) : ∫ c : C, J (i + 1) (update p i (u c)) (update q i (u c)) = J i p q := by |
| 129 | obtain ⟨-, h_zero, -⟩ := K.integrable_and_integral_update i p q 0 hi |
| 130 | simpa only [zero_mul, K.psi_zero, one_mul] using h_zero rfl |
| 131 | |
| 132 | /-- For `i ≤ n` and a unit `ξ`, the integral of `J (i + 1)` over a common entry `u c` at position |
| 133 | `i`, twisted by `ψ (ξ * c)`, has modulus at most `β ξ * (Λ i p * Λ i q)`. -/ |
| 134 | lemma SieveSystem.norm_integral_mul_update_le (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} |
| 135 | (hi : i ≤ n) (p q : ℕ → U) {ξ : C} (hξ : IsUnit ξ) : |
| 136 | ‖∫ c : C, ψ (ξ * c) * J (i + 1) (update p i (u c)) (update q i (u c))‖ ≤ |
| 137 | β ξ * (Λ i p * Λ i q) := by |
| 138 | obtain ⟨-, -, h_unit⟩ := K.integrable_and_integral_update i p q ξ hi |
| 139 | exact h_unit hξ |
| 140 | |
| 141 | /-- A finite product of sieve systems is a sieve system. |
| 142 | |
| 143 | Let `K` be such a system on `C` (with s-finite volume), and for each `v` in the finite type `τ` take |
| 144 | a system on `ℂ` with forms `J' v`, bounds `B₀' v`, `Λ'`, `γ v`, entry map `unitOrOne`, map `ι'` back |
| 145 | to `ℂ` and twist `wave`. Then the products of the forms, twists and bounds make a system on |
| 146 | `(τ → ℂ) × C`, each form and weight being evaluated on the components of the heads in its factor: |
| 147 | `headAt v p = fun k ↦ (p k).1 v` at `v`, and `Prod.snd ∘ p` in `U`. -/ |
| 148 | lemma SieveSystem.pi (K : SieveSystem u ι n J ψ B₀ Λ β) [SFinite (volume : Measure C)] {ι' : ℂˣ → ℂ} |
| 149 | {Λ' : ℕ → (ℕ → ℂˣ) → ℝ} {J' : τ → ℕ → (ℕ → ℂˣ) → (ℕ → ℂˣ) → ℂ} {B₀' : τ → ℝ} {γ : τ → ℂ → ℝ} |
| 150 | (h_factor : ∀ v : τ, SieveSystem unitOrOne ι' n (J' v) wave (B₀' v) Λ' (γ v)) : |
| 151 | SieveSystem (Prod.map (fun x : τ → ℂ ↦ unitOrOne ∘ x) u) |
| 152 | (Prod.map (fun y : τ → ℂˣ ↦ ι' ∘ y) ι) n |
| 153 | (fun (i : ℕ) (p q : ℕ → (τ → ℂˣ) × U) ↦ |
| 154 | (∏ v : τ, J' v i (headAt v p) (headAt v q)) * J i (Prod.snd ∘ p) (Prod.snd ∘ q)) |
| 155 | (fun x : (τ → ℂ) × C ↦ (∏ v : τ, wave (x.1 v)) * ψ x.2) |
| 156 | ((∏ v : τ, B₀' v) * B₀) |
| 157 | (fun (i : ℕ) (p : ℕ → (τ → ℂˣ) × U) ↦ (∏ v : τ, Λ' i (headAt v p)) * Λ i (Prod.snd ∘ p)) |
| 158 | fun x : (τ → ℂ) × C ↦ (∏ v : τ, γ v (x.1 v)) * β x.2 := by |
| 159 | -- Everything is checked factor by factor: Fubini for `integrable_and_integral_update`, Schur's |
| 160 | -- product theorem for `posSemidef`, and products of the local bounds for |
| 161 | -- `integrable_and_integral_update`, `norm_bot_le` and `norm_le_of_isUnit_sub`. |
| 162 | constructor |
| 163 | case psi_zero => simp [K.psi_zero, wave] |
| 164 | case integrable_and_integral_update => |
| 165 | intro i p q ξ hi f |
| 166 | -- The integrands in the factor `v` and in `C`. |
| 167 | let g (v : τ) (z : ℂ) : ℂ := wave (ξ.1 v * z) * |
| 168 | J' v (i + 1) (update (headAt v p) i (unitOrOne z)) (update (headAt v q) i (unitOrOne z)) |
| 169 | let gC (c : C) : ℂ := ψ (ξ.2 * c) * |
| 170 | J (i + 1) (update (Prod.snd ∘ p) i (u c)) (update (Prod.snd ∘ q) i (u c)) |
| 171 | have hf : f = fun x : (τ → ℂ) × C ↦ (∏ v, g v (x.1 v)) * gC x.2 := by |
| 172 | ext x |
| 173 | simp [f, g, gC, headAt, comp_update, prod_mul_distrib, mul_mul_mul_comm] |
| 174 | have h_fubini : ∫ x, f x = (∏ v, ∫ z, g v z) * ∫ c, gC c := by |
| 175 | rw [hf, ← integral_fintype_prod_volume_eq_prod, ← integral_prod_mul, Measure.volume_eq_prod] |
| 176 | refine ⟨?_, fun hξ ↦ ?_, fun hξ ↦ ?_⟩ |
| 177 | · rw [hf] |
| 178 | exact .mul_prod (.fintype_prod fun v ↦ (h_factor v).integrable_mul_update hi _ _ _) |
| 179 | (K.integrable_mul_update hi _ _ _) |
| 180 | · -- Both twists are `1` at `0`, and the recursion holds in each factor. |
| 181 | simp [h_fubini, g, gC, hξ, wave, K.psi_zero, (h_factor _).integral_update hi, |
| 182 | K.integral_update hi] |
| 183 | · rw [Prod.isUnit_iff, Pi.isUnit_iff] at hξ |
| 184 | obtain ⟨hξ_factor, hξ_C⟩ := hξ |
| 185 | rw [h_fubini] |
| 186 | refine (norm_prod_mul_le_prod_mul |
| 187 | (fun v ↦ (h_factor v).norm_integral_mul_update_le hi _ _ (hξ_factor v)) |
| 188 | (K.norm_integral_mul_update_le hi _ _ hξ_C)).trans_eq ?_ |
| 189 | simp [prod_mul_distrib, mul_mul_mul_comm] |
| 190 | case posSemidef => |
| 191 | intro κ _ a t ha |
| 192 | exact posSemidef_prod_mul (fun v ↦ (h_factor v).posSemidef _ (t.1 v) (by simp [headAt, ha])) |
| 193 | (K.posSemidef _ t.2 (by simp [ha])) univ |
| 194 | case continuous => |
| 195 | have h_cont_factor (v : τ) : Continuous (J' v (n + 1)).uncurry := (h_factor v).continuous |
| 196 | have h_cont_C : Continuous (J (n + 1)).uncurry := K.continuous |
| 197 | unfold headAt |
| 198 | fun_prop |
| 199 | case norm_bot_le => |
| 200 | exact fun p q ↦ norm_prod_mul_le_prod_mul (fun v ↦ (h_factor v).norm_bot_le _ _) |
| 201 | (K.norm_bot_le _ _) |
| 202 | case norm_le_of_isUnit_sub => |
| 203 | intro i p q hi ξ hξ |
| 204 | rw [Prod.isUnit_iff, Pi.isUnit_iff] at hξ |
| 205 | obtain ⟨hξ_factor, hξ_C⟩ := hξ |
| 206 | refine (norm_prod_mul_le_prod_mul |
| 207 | (fun v ↦ (h_factor v).norm_le_of_isUnit_sub i (headAt v p) (headAt v q) hi (hξ_factor v)) |
| 208 | (K.norm_le_of_isUnit_sub i (Prod.snd ∘ p) (Prod.snd ∘ q) hi hξ_C)).trans_eq ?_ |
| 209 | simp [ξ, headAt, prod_mul_distrib, mul_mul_mul_comm] |
| 210 | |
| 211 | /-- For `i ≤ n` and finitely many heads `a p`, the sum of `J (i + 1)` over all pairs of heads is |
| 212 | integrable in a common entry `u c` at position `i`. -/ |
| 213 | lemma SieveSystem.integrable_sum_update (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} (hi : i ≤ n) |
| 214 | (a : τ → ℕ → U) : |
| 215 | Integrable fun c : C ↦ |
| 216 | ∑ p : τ, ∑ q : τ, J (i + 1) (update (a p) i (u c)) (update (a q) i (u c)) := |
| 217 | integrable_finsetSum _ fun _ _ ↦ integrable_finsetSum _ fun _ _ ↦ K.integrable_update hi _ _ |
| 218 | |
| 219 | /-- The recursion summed over all pairs from finitely many heads `a p`: for `i ≤ n`, the sum of the |
| 220 | forms `J i` is the integral of the sum of the forms `J (i + 1)` over a common entry `u c` at |
| 221 | position `i`. -/ |
| 222 | lemma SieveSystem.integral_sum_update (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} (hi : i ≤ n) |
| 223 | (a : τ → ℕ → U) : |
| 224 | ∫ c : C, ∑ p : τ, ∑ q : τ, J (i + 1) (update (a p) i (u c)) (update (a q) i (u c)) = |
| 225 | ∑ p : τ, ∑ q : τ, J i (a p) (a q) := by |
| 226 | simp [integral_finsetSum, integrable_finsetSum, K.integrable_update hi, K.integral_update hi] |
| 227 | |
| 228 | /-- For `i ≤ n`, finitely many heads `a p` and a unit `ξ`, sum the forms `J (i + 1)` of the system |
| 229 | `K` over all pairs of heads with a common entry `u c` at position `i`. The integral of this sum |
| 230 | twisted by `ψ (ξ * c)` has modulus at most `β ξ * (∑ p, Λ i (a p)) ^ 2`, with `Λ` the head weights |
| 231 | and `β` the decay of `K`. -/ |
| 232 | lemma SieveSystem.norm_integral_mul_sum_update_le (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} |
| 233 | (hi : i ≤ n) (a : τ → ℕ → U) {ξ : C} (hξ : IsUnit ξ) : |
| 234 | ‖∫ c : C, ψ (ξ * c) * |
| 235 | ∑ p : τ, ∑ q : τ, J (i + 1) (update (a p) i (u c)) (update (a q) i (u c))‖ ≤ |
| 236 | β ξ * (∑ p : τ, Λ i (a p)) ^ 2 := |
| 237 | calc _ = ‖∑ p, ∑ q, |
| 238 | ∫ c, ψ (ξ * c) * J (i + 1) (update (a p) i (u c)) (update (a q) i (u c))‖ := by |
| 239 | simp [mul_sum, integral_finsetSum, integrable_finsetSum, K.integrable_mul_update hi] |
| 240 | _ ≤ ∑ p, ∑ q, β ξ * (Λ i (a p) * Λ i (a q)) := |
| 241 | norm_sum_le_of_le _ fun p _ ↦ norm_sum_le_of_le _ fun q _ ↦ |
| 242 | K.norm_integral_mul_update_le hi (a p) (a q) hξ |
| 243 | _ = β ξ * (∑ p, Λ i (a p)) ^ 2 := by simp only [sq, sum_mul_sum, ← mul_sum] |
| 244 | |
| 245 | /-- In a sieve system `K` with forms `J`, if finitely many heads `a p` have a common entry `t` at |
| 246 | position `i ≤ n`, then the sum of `J (i + 1)` over all pairs of heads is a nonnegative real |
| 247 | number. -/ |
| 248 | lemma SieveSystem.sum_nonneg (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} (hi : i ≤ n) |
| 249 | (a : τ → ℕ → U) {t : U} (h_common : ∀ p : τ, a p i = t) : |
| 250 | 0 ≤ ∑ p : τ, ∑ q : τ, J (i + 1) (a p) (a q) := by |
| 251 | -- Descend on `i`. At `i = n` the sum is the value of a positive semidefinite form on |
| 252 | -- `(1, …, 1)`. Below, it is the integral over a common next entry of the same sums for `i + 1`. |
| 253 | induction hi using Nat.decreasingInduction generalizing a t with |
| 254 | | self => |
| 255 | simpa [mulVec, dotProduct] using (K.posSemidef a t h_common).dotProduct_mulVec_nonneg 1 |
| 256 | | of_succ i hi ih => |
| 257 | rw [← K.integral_sum_update hi a] |
| 258 | exact integral_nonneg fun z ↦ ih _ fun p ↦ update_self (i + 1) (u z) (a p) |
| 259 | |
| 260 | variable [TopologicalSpace C] [FirstCountableTopology C] |
| 261 | |
| 262 | /-- In a sieve system `K` with forms `J`, let finitely many heads `b y p`, depending on `y : C`, |
| 263 | have a common entry `c y` at position `i ≤ n` for each `y`. The sum of `J (i + 1)` over all pairs |
| 264 | of heads, which is a nonnegative real number, is lower semicontinuous in `y` at each point `x` where |
| 265 | the heads are continuous. This is stated for `ENNReal.ofReal` of its real part. -/ |
| 266 | lemma SieveSystem.lowerSemicontinuousAt_sum (K : SieveSystem u ι n J ψ B₀ Λ β) {i : ℕ} |
| 267 | (hi : i ≤ n) (b : C → τ → ℕ → U) {c : C → U} (h_common : ∀ (y : C) (p : τ), b y p i = c y) |
| 268 | {x : C} (h_cont : ∀ p : τ, ContinuousAt (fun y : C ↦ b y p) x) : |
| 269 | LowerSemicontinuousAt |
| 270 | (fun y : C ↦ ENNReal.ofReal (RCLike.re (∑ p : τ, ∑ q : τ, J (i + 1) (b y p) (b y q)))) x := by |
| 271 | -- Descend on `i`. At `i = n` the sum is continuous at `x`. Below, it is the integral over a |
| 272 | -- common next entry `u z` of the same sums for `i + 1`, and Fatou's lemma applies. |
| 273 | induction hi using Nat.decreasingInduction generalizing b c with |
| 274 | | self => |
| 275 | have hJ : Continuous (J (n + 1)).uncurry := K.continuous |
| 276 | exact ContinuousAt.lowerSemicontinuousAt (by fun_prop [ENNReal.ofReal]) |
| 277 | | of_succ i hi ih => |
| 278 | -- `G y z` is the sum for `i + 1` at the heads `b y p` extended by the entry `u z`. |
| 279 | let G (y z : C) : ℂ := |
| 280 | ∑ p, ∑ q, J (i + 1 + 1) (update (b y p) (i + 1) (u z)) (update (b y q) (i + 1) (u z)) |
| 281 | have h_lsc (z : C) : LowerSemicontinuousAt (fun y ↦ ENNReal.ofReal (RCLike.re (G y z))) x := |
| 282 | ih _ (fun y p ↦ update_self (i + 1) (u z) (b y p)) (by fun_prop) |
| 283 | have h_int (y : C) : Integrable (G y) := K.integrable_sum_update hi (b y) |
| 284 | have h_re (y : C) : ENNReal.ofReal (RCLike.re (∑ p, ∑ q, J (i + 1) (b y p) (b y q))) = |
| 285 | ∫⁻ z, ENNReal.ofReal (RCLike.re (G y z)) := by |
| 286 | have h_nonneg (z : C) : 0 ≤ G y z := |
| 287 | K.sum_nonneg hi _ fun p ↦ update_self (i + 1) (u z) (b y p) |
| 288 | rw [← K.integral_sum_update hi (b y), ← integral_re (h_int y), |
| 289 | ofReal_integral_eq_lintegral_ofReal (h_int y).re |
| 290 | (.of_forall fun z ↦ (RCLike.nonneg_iff.1 (h_nonneg z)).1)] |
| 291 | simp only [lowerSemicontinuousAt_iff_le_liminf, h_re] at h_lsc ⊢ |
| 292 | calc ∫⁻ z, ENNReal.ofReal (RCLike.re (G x z)) |
| 293 | _ ≤ ∫⁻ z, Filter.liminf (fun y ↦ ENNReal.ofReal (RCLike.re (G y z))) (nhds x) := |
| 294 | lintegral_mono h_lsc |
| 295 | _ ≤ Filter.liminf (fun y ↦ ∫⁻ z, ENNReal.ofReal (RCLike.re (G y z))) (nhds x) := |
| 296 | lintegral_liminf_le' fun y ↦ (h_int y).re.aemeasurable.ennreal_ofReal |
| 297 | |
| 298 | end New |
| 299 | |
| 300 | end |