Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import NavierStokes.PartitionedCovariance |
| 2 | import NavierStokes.FlatCovariance |
| 3 | import NavierStokes.WeightedQuotients |
| 4 | import NavierStokes.WeightedClasses |
| 5 | |
| 6 | /-! |
| 7 | # Signed covariance updates with the constructed primary waves |
| 8 | |
| 9 | The signed solve uses the existing primary square roots, pulse columns, |
| 10 | physical masks, covering powers, and angular phases. Distinct labels are |
| 11 | separated by the constructed padded slots. A signed square is retained as |
| 12 | a separate term; it is not included in the linear covariance identity. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | namespace NavierStokes.SignedCovariance |
| 18 | |
| 19 | open Set Function Filter MeasureTheory Matrix |
| 20 | open PartitionedCovariance |
| 21 | open scoped BigOperators Topology ContDiff |
| 22 | |
| 23 | abbrev Vec2 := Fin 2 → ℝ |
| 24 | abbrev Mat2 := Matrix (Fin 2) (Fin 2) ℝ |
| 25 | abbrev Plane := TorusInverse.Plane |
| 26 | |
| 27 | /-- The numerator is the actual inverse-matrix solve. -/ |
| 28 | noncomputable def increment (H : Mat2) (T R : Vec2) (j : Fin 2) : ℝ := |
| 29 | (H⁻¹.mulVec R) j / (2 * SmoothCovariance.amplitudes H T j) |
| 30 | |
| 31 | theorem increment_eq_inverse (H : Mat2) (T R : Vec2) |
| 32 | (hcone : SmoothCovariance.StrictCone H T) (j : Fin 2) : |
| 33 | increment H T R j = (H⁻¹.mulVec R) j / (2 * Real.sqrt ((H⁻¹.mulVec T) j)) := by |
| 34 | rw [increment, (amplitudes_are_inverse_weights hcone j).2] |
| 35 | |
| 36 | private theorem edge_zero_one : FlatCutoff.edge 0 1 = 1 := by |
| 37 | rw [FlatCutoff.edge_of_pos 0 (by norm_num : (0 : ℝ) < 1)] |
| 38 | norm_num |
| 39 | |
| 40 | private theorem edge_matrix_zero (H : Mat2) : |
| 41 | FlatCovariance.edgeMatrix 0 (fun _ => H) 1 = H := by |
| 42 | ext i j |
| 43 | simp [FlatCovariance.edgeMatrix, FlatCovariance.columns, edge_zero_one] |
| 44 | |
| 45 | private theorem edge_target_zero (R : Vec2) : |
| 46 | FlatCovariance.edgeTarget 0 (fun _ => R) 1 = R := by |
| 47 | ext i |
| 48 | simp [FlatCovariance.edgeTarget, FlatCovariance.scaledTarget, edge_zero_one] |
| 49 | |
| 50 | /-- The scalar solve is the already proved flat-edge solve at unit edge weight. -/ |
| 51 | theorem increment_eq_flat (H : Mat2) (T R : Vec2) |
| 52 | (hcone : SmoothCovariance.StrictCone H T) : |
| 53 | increment H T R = FlatCovariance.signedAmplitude 0 0 0 |
| 54 | (fun _ => H) (fun _ => T) (fun _ => R) 1 := by |
| 55 | funext j |
| 56 | simp only [increment, FlatCovariance.signedAmplitude, FlatCovariance.primaryAmplitude, |
| 57 | FlatCovariance.inverseCoefficients, edge_matrix_zero, edge_target_zero] |
| 58 | rw [SmoothCovariance.inverse_formula H T hcone.det_ne_zero] |
| 59 | rfl |
| 60 | |
| 61 | /-- Exact two-sided covariance, reusing `FlatCovariance.signed_cross_reconstruct`. -/ |
| 62 | theorem cross_reconstruct (H : Mat2) (T R : Vec2) |
| 63 | (hcone : SmoothCovariance.StrictCone H T) : |
| 64 | H.mulVec (fun j => 2 * SmoothCovariance.amplitudes H T j * increment H T R j) = R := by |
| 65 | have he := FlatCovariance.signed_cross_reconstruct |
| 66 | (σ := 0) (τ := 0) (κ := 0) (G := fun _ => H) (T := fun _ => T) |
| 67 | (R := fun _ => R) (x := 1) hcone |
| 68 | rw [← increment_eq_flat H T R hcone] at he |
| 69 | simp only [FlatCovariance.primaryAmplitude, FlatCovariance.inverseCoefficients, |
| 70 | edge_matrix_zero, edge_target_zero] at he |
| 71 | rw [SmoothCovariance.inverse_formula H T hcone.det_ne_zero] at he |
| 72 | exact he |
| 73 | |
| 74 | /-- The signed square is a genuine additional covariance. -/ |
| 75 | noncomputable def squareColumn (H : Mat2) (T R : Vec2) : Vec2 := |
| 76 | H.mulVec (fun j => increment H T R j ^ 2) |
| 77 | |
| 78 | /-! ## A bilinear average of the actual waves -/ |
| 79 | |
| 80 | theorem wave_product_rescale (a b : ℝ) (n : ℕ) (f g : Plane → ℝ) |
| 81 | (mode : ℤ) (phase : Plane → ℝ) (Y : Plane) (θ : ℝ) : |
| 82 | wave a n f mode phase Y θ * wave b n g mode phase Y θ = |
| 83 | (a * b) * (wave 1 n f mode phase Y θ * wave 1 n g mode phase Y θ) := by |
| 84 | unfold wave |
| 85 | ring |
| 86 | |
| 87 | theorem angularMean_bilinear (a b : ℝ) (n : ℕ) (f g : Plane → ℝ) |
| 88 | (mode : ℤ) (hmode : mode ≠ 0) (phase : Plane → ℝ) (Y : Plane) : |
| 89 | SmoothLoop.angularMean (fun θ => wave a n f mode phase Y θ * wave b n g mode phase Y θ) = |
| 90 | (a * b) * ((covered n f Y * covered n g Y) * (1 / 2)) := by |
| 91 | rw [show (fun θ => wave a n f mode phase Y θ * wave b n g mode phase Y θ) = |
| 92 | (fun θ => (a * b) * (wave 1 n f mode phase Y θ * wave 1 n g mode phase Y θ)) from |
| 93 | funext (fun θ => wave_product_rescale a b n f g mode phase Y θ)] |
| 94 | rw [SmoothLoop.angularMean_const_mul, angularMean_wave_product 1 n f g mode hmode phase] |
| 95 | ring |
| 96 | |
| 97 | theorem angularMean_bilinear_continuous (a b : ℝ) (n : ℕ) {f g : Plane → ℝ} |
| 98 | (hf : Continuous f) (hcf : HasCompactSupport f) (hg : Continuous g) (hcg : HasCompactSupport g) |
| 99 | (mode : ℤ) (hmode : mode ≠ 0) (phase : Plane → ℝ) : |
| 100 | Continuous (fun Y => SmoothLoop.angularMean |
| 101 | (fun θ => wave a n f mode phase Y θ * wave b n g mode phase Y θ)) := by |
| 102 | simp_rw [angularMean_bilinear a b n f g mode hmode phase] |
| 103 | exact continuous_const.mul (((covered_continuous hf hcf n).mul |
| 104 | (covered_continuous hg hcg n)).mul continuous_const) |
| 105 | |
| 106 | /-- Both scalar coefficients multiply precisely the same native pulse. -/ |
| 107 | theorem PairData.bilinear_diagonal {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} |
| 108 | {U : UnsignedLabel} (P : PairData sys U) |
| 109 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (a b : ℝ) (j i : Fin 2) : |
| 110 | doubleAverage (fun Y θ => |
| 111 | wave a (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j) Y θ * |
| 112 | wave b (SlotColoring.nativeIndex h U.1) (P.rawTangent hdet j i) (P.modes j) (P.phases j) Y θ) = |
| 113 | a * b * P.matrix i j := by |
| 114 | have heq : (fun Y θ => |
| 115 | wave a (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j) Y θ * |
| 116 | wave b (SlotColoring.nativeIndex h U.1) (P.rawTangent hdet j i) (P.modes j) (P.phases j) Y θ) = |
| 117 | fun Y θ => (a * b) * |
| 118 | (wave 1 (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j) Y θ * |
| 119 | wave 1 (SlotColoring.nativeIndex h U.1) (P.rawTangent hdet j i) (P.modes j) (P.phases j) Y θ) := by |
| 120 | funext Y θ |
| 121 | exact wave_product_rescale _ _ _ _ _ _ _ _ _ |
| 122 | rw [heq] |
| 123 | rw [doubleAverage_const_mul] |
| 124 | have hu := (P.pulses j).wave_covariance vr vt (slotCenter h (signedLabel U j)) hdet |
| 125 | (P.ci j) sys.radius (P.ci_pos j) sys.radius_pos |
| 126 | (slotSet h sys.radius vr vt (signedLabel U j)) (sys.injective _) |
| 127 | (P.rawRadial_support hdet j) (fun i => P.rawTangent_support hdet j i) |
| 128 | 1 (SlotColoring.nativeIndex h U.1) (P.phases j) (P.modes j) (P.modes_ne j) i |
| 129 | simpa only [PairData.rawRadial, PairData.rawTangent, PairData.matrix, pairMatrix, |
| 130 | one_pow, one_mul] using congrArg (fun z : ℝ => a * b * z) hu |
| 131 | |
| 132 | /-! ## The same physical masks, slots, and phases for arbitrary coefficients -/ |
| 133 | |
| 134 | noncomputable def radialWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} |
| 135 | {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 136 | (outer ε : ℝ) (a : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) : Plane → ℝ → ℝ := |
| 137 | wave (outer * (Real.sqrt ε * a j * mask D U q x)) |
| 138 | (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j) |
| 139 | |
| 140 | noncomputable def tangentWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} |
| 141 | {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 142 | (outer ε : ℝ) (a : Vec2) (q : ℝ) (x : SlotColoring.Position) (j i : Fin 2) : Plane → ℝ → ℝ := |
| 143 | wave (outer * (Real.sqrt ε * a j * mask D U q x)) |
| 144 | (SlotColoring.nativeIndex h U.1) (P.rawTangent hdet j i) (P.modes j) (P.phases j) |
| 145 | |
| 146 | theorem radialWith_primary {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} |
| 147 | {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 148 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) : |
| 149 | radialWith P hdet outer ε (SmoothCovariance.amplitudes P.matrix T) q x j = |
| 150 | P.radialWave hdet outer ε T q x j := rfl |
| 151 | |
| 152 | theorem tangentWith_primary {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} |
| 153 | {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 154 | (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j i : Fin 2) : |
| 155 | tangentWith P hdet outer ε (SmoothCovariance.amplitudes P.matrix T) q x j i = |
| 156 | P.tangentWave hdet outer ε T q x j i := rfl |
| 157 | |
| 158 | /-- Pointwise diagonal reduction uses padded-slot disjointness, including |
| 159 | when different labels carry the same angular harmonic. -/ |
| 160 | theorem finite_product_diagonal {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 161 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 162 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 163 | (outer ε : UnsignedLabel → ℝ) (a b : UnsignedLabel → Vec2) (F : Finset UnsignedLabel) |
| 164 | {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (i : Fin 2) (Y : Plane) (θ : ℝ) : |
| 165 | (∑ v ∈ F.product (Finset.univ : Finset (Fin 2)), |
| 166 | radialWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 Y θ) * |
| 167 | (∑ v ∈ F.product (Finset.univ : Finset (Fin 2)), |
| 168 | tangentWith (P v.1) hdet (outer v.1) (ε v.1) (b v.1) q x v.2 i Y θ) = |
| 169 | ∑ v ∈ F.product (Finset.univ : Finset (Fin 2)), |
| 170 | radialWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 Y θ * |
| 171 | tangentWith (P v.1) hdet (outer v.1) (ε v.1) (b v.1) q x v.2 i Y θ := by |
| 172 | apply sum_product_diagonal |
| 173 | intro v hv w hw hvw |
| 174 | have hz := sys.wave_cross_zero |
| 175 | (L := signedTailLabel N v) (M := signedTailLabel N w) |
| 176 | (by change 1 ≤ v.1.1 + N; omega) (by change 1 ≤ w.1.1 + N; omega) |
| 177 | (fun he => hvw (signedTailLabel_injective N he)) |
| 178 | ((P v.1).rawRadial_support hdet v.2) ((P w.1).rawTangent_support hdet w.2 i) |
| 179 | hq x Y θ (outer v.1 * Real.sqrt (ε v.1) * a v.1 v.2) |
| 180 | (outer w.1 * Real.sqrt (ε w.1) * b w.1 w.2) |
| 181 | ((P v.1).modes v.2) ((P w.1).modes w.2) ((P v.1).phases v.2) ((P w.1).phases w.2) |
| 182 | simpa only [radialWith, tangentWith, signedTailLabel, physicalMask_signedLabel, |
| 183 | signedLabel, physicalMask, mask, mul_assoc] using hz |
| 184 | |
| 185 | theorem finite_bilinear_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 186 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 187 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 188 | (outer ε : UnsignedLabel → ℝ) (a b : UnsignedLabel → Vec2) (F : Finset UnsignedLabel) |
| 189 | (hε : ∀ U ∈ F, 0 ≤ ε U) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (i : Fin 2) : |
| 190 | doubleAverage (fun Y θ => |
| 191 | (∑ v ∈ F.product (Finset.univ : Finset (Fin 2)), |
| 192 | radialWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 Y θ) * |
| 193 | (∑ v ∈ F.product (Finset.univ : Finset (Fin 2)), |
| 194 | tangentWith (P v.1) hdet (outer v.1) (ε v.1) (b v.1) q x v.2 i Y θ)) = |
| 195 | ∑ U ∈ F, outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2 * |
| 196 | ((P U).matrix.mulVec (fun j => a U j * b U j)) i := by |
| 197 | simp_rw [finite_product_diagonal sys hdet N hN P outer ε a b F hq x i] |
| 198 | rw [doubleAverage_sum] |
| 199 | · apply (Finset.sum_product F Finset.univ _).trans |
| 200 | apply Finset.sum_congr rfl |
| 201 | intro U hU |
| 202 | simp only [radialWith, tangentWith, PairData.bilinear_diagonal, |
| 203 | Matrix.mulVec, dotProduct, Fin.sum_univ_two] |
| 204 | have hs := Real.sq_sqrt (hε U hU) |
| 205 | calc |
| 206 | _ = outer U ^ 2 * (Real.sqrt (ε U)) ^ 2 * mask D (tailLabel N U) q x ^ 2 * |
| 207 | ((P U).matrix i 0 * (a U 0 * b U 0) + (P U).matrix i 1 * (a U 1 * b U 1)) := by ring |
| 208 | _ = _ := by rw [hs] |
| 209 | · intro v hv Y |
| 210 | exact (wave_continuous_theta _ _ _ _ _ _).mul (wave_continuous_theta _ _ _ _ _ _) |
| 211 | · intro v hv |
| 212 | exact angularMean_bilinear_continuous _ _ _ ((P v.1).rawRadial_continuous hdet v.2) |
| 213 | ((P v.1).rawRadial_compact hdet v.2) ((P v.1).rawTangent_continuous hdet v.2 i) |
| 214 | ((P v.1).rawTangent_compact hdet v.2 i) ((P v.1).modes v.2) |
| 215 | ((P v.1).modes_ne v.2) ((P v.1).phases v.2) |
| 216 | |
| 217 | noncomputable def assembledRadialWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} |
| 218 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 219 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 220 | (a : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) (Y : Plane) (θ : ℝ) : ℝ := |
| 221 | ∑ᶠ v : UnsignedLabel × Fin 2, radialWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 Y θ |
| 222 | |
| 223 | noncomputable def assembledTangentWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} |
| 224 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 225 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 226 | (a : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) (i : Fin 2) (Y : Plane) (θ : ℝ) : ℝ := |
| 227 | ∑ᶠ v : UnsignedLabel × Fin 2, tangentWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 i Y θ |
| 228 | |
| 229 | theorem assembledRadialWith_finite {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} |
| 230 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 231 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 232 | (a : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (Y : Plane) (θ : ℝ) : |
| 233 | assembledRadialWith P hdet outer ε a q x Y θ = |
| 234 | ∑ v ∈ (finite_active_masks D N hq x).toFinset.product (Finset.univ : Finset (Fin 2)), |
| 235 | radialWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 Y θ := by |
| 236 | classical |
| 237 | apply finsum_eq_sum_of_support_subset |
| 238 | intro v hv |
| 239 | refine Finset.mem_product.mpr ⟨?_, Finset.mem_univ _⟩ |
| 240 | apply (finite_active_masks D N hq x).mem_toFinset.mpr |
| 241 | intro hm |
| 242 | exact hv (by simp [radialWith, wave, hm]) |
| 243 | |
| 244 | theorem assembledTangentWith_finite {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} |
| 245 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 246 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 247 | (a : UnsignedLabel → Vec2) {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 248 | (i : Fin 2) (Y : Plane) (θ : ℝ) : |
| 249 | assembledTangentWith P hdet outer ε a q x i Y θ = |
| 250 | ∑ v ∈ (finite_active_masks D N hq x).toFinset.product (Finset.univ : Finset (Fin 2)), |
| 251 | tangentWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 i Y θ := by |
| 252 | classical |
| 253 | apply finsum_eq_sum_of_support_subset |
| 254 | intro v hv |
| 255 | refine Finset.mem_product.mpr ⟨?_, Finset.mem_univ _⟩ |
| 256 | apply (finite_active_masks D N hq x).mem_toFinset.mpr |
| 257 | intro hm |
| 258 | exact hv (by simp [tangentWith, wave, hm]) |
| 259 | |
| 260 | theorem assembled_bilinear_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 261 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 262 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 263 | (outer ε : UnsignedLabel → ℝ) (a b : UnsignedLabel → Vec2) |
| 264 | {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 265 | (hε : ∀ U, mask D (tailLabel N U) q x ≠ 0 → 0 ≤ ε U) (i : Fin 2) : |
| 266 | doubleAverage (fun Y θ => assembledRadialWith P hdet outer ε a q x Y θ * |
| 267 | assembledTangentWith P hdet outer ε b q x i Y θ) = |
| 268 | ∑ᶠ U : UnsignedLabel, outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2 * |
| 269 | ((P U).matrix.mulVec (fun j => a U j * b U j)) i := by |
| 270 | classical |
| 271 | simp_rw [assembledRadialWith_finite P hdet outer ε a hq x, |
| 272 | assembledTangentWith_finite P hdet outer ε b hq x i] |
| 273 | rw [finite_bilinear_covariance sys hdet N hN P outer ε a b _ |
| 274 | (fun U hU => hε U ((finite_active_masks D N hq x).mem_toFinset.mp hU)) hq x i] |
| 275 | symm |
| 276 | apply finsum_eq_sum_of_support_subset |
| 277 | intro U hU |
| 278 | apply (finite_active_masks D N hq x).mem_toFinset.mpr |
| 279 | intro hm |
| 280 | exact hU (by simp [hm]) |
| 281 | |
| 282 | /-- Off-diagonal products vanish before either integral, so interchanging the |
| 283 | two scalar coefficient families leaves the product unchanged pointwise. -/ |
| 284 | theorem assembled_bilinear_symmetry {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 285 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 286 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 287 | (outer ε : UnsignedLabel → ℝ) (a b : UnsignedLabel → Vec2) |
| 288 | {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) (i : Fin 2) (Y : Plane) (θ : ℝ) : |
| 289 | assembledRadialWith P hdet outer ε a q x Y θ * assembledTangentWith P hdet outer ε b q x i Y θ = |
| 290 | assembledRadialWith P hdet outer ε b q x Y θ * assembledTangentWith P hdet outer ε a q x i Y θ := by |
| 291 | classical |
| 292 | simp_rw [assembledRadialWith_finite P hdet outer ε _ hq x, |
| 293 | assembledTangentWith_finite P hdet outer ε _ hq x i, |
| 294 | finite_product_diagonal sys hdet N hN P outer ε _ _ _ hq x i] |
| 295 | apply Finset.sum_congr rfl |
| 296 | intro v hv |
| 297 | unfold radialWith tangentWith wave |
| 298 | ring |
| 299 | |
| 300 | noncomputable def signedRadial {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} |
| 301 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 302 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 303 | (T R : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) : Plane → ℝ → ℝ := |
| 304 | assembledRadialWith P hdet outer ε (fun U => increment (P U).matrix (T U) (R U)) q x |
| 305 | |
| 306 | noncomputable def signedTangent {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} |
| 307 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 308 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) |
| 309 | (T R : UnsignedLabel → Vec2) (q : ℝ) (x : SlotColoring.Position) (i : Fin 2) : Plane → ℝ → ℝ := |
| 310 | assembledTangentWith P hdet outer ε (fun U => increment (P U).matrix (T U) (R U)) q x i |
| 311 | |
| 312 | theorem cross_reconstruct_component (H : Mat2) (T R : Vec2) |
| 313 | (hcone : SmoothCovariance.StrictCone H T) (i : Fin 2) : |
| 314 | 2 * (H.mulVec (fun j => SmoothCovariance.amplitudes H T j * increment H T R j)) i = R i := by |
| 315 | have hc := congrFun (cross_reconstruct H T R hcone) i |
| 316 | simp only [Matrix.mulVec, dotProduct, Fin.sum_univ_two] at hc ⊢ |
| 317 | calc |
| 318 | _ = H i 0 * (2 * SmoothCovariance.amplitudes H T 0 * increment H T R 0) + |
| 319 | H i 1 * (2 * SmoothCovariance.amplitudes H T 1 * increment H T R 1) := by ring |
| 320 | _ = _ := hc |
| 321 | |
| 322 | /-- The assembled two-sided primary/signed cross covariance. Positivity is |
| 323 | required only for primary weights; the signed target is arbitrary. -/ |
| 324 | theorem assembled_cross_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 325 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 326 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 327 | (outer ε : UnsignedLabel → ℝ) (T R : UnsignedLabel → Vec2) |
| 328 | {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 329 | (hε : ∀ U, mask D (tailLabel N U) q x ≠ 0 → 0 ≤ ε U) |
| 330 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → SmoothCovariance.StrictCone (P U).matrix (T U)) |
| 331 | (i : Fin 2) : |
| 332 | doubleAverage (fun Y θ => |
| 333 | assembledRadial P hdet outer ε T q x Y θ * signedTangent P hdet outer ε T R q x i Y θ + |
| 334 | signedRadial P hdet outer ε T R q x Y θ * assembledTangent P hdet outer ε T q x i Y θ) = |
| 335 | ∑ᶠ U : UnsignedLabel, outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2 * R U i := by |
| 336 | let a : UnsignedLabel → Vec2 := fun U => SmoothCovariance.amplitudes (P U).matrix (T U) |
| 337 | let b : UnsignedLabel → Vec2 := fun U => increment (P U).matrix (T U) (R U) |
| 338 | have heq : (fun Y θ => |
| 339 | assembledRadial P hdet outer ε T q x Y θ * signedTangent P hdet outer ε T R q x i Y θ + |
| 340 | signedRadial P hdet outer ε T R q x Y θ * assembledTangent P hdet outer ε T q x i Y θ) = |
| 341 | fun Y θ => 2 * (assembledRadialWith P hdet outer ε a q x Y θ * |
| 342 | assembledTangentWith P hdet outer ε b q x i Y θ) := by |
| 343 | funext Y θ |
| 344 | change assembledRadialWith P hdet outer ε a q x Y θ * assembledTangentWith P hdet outer ε b q x i Y θ + |
| 345 | assembledRadialWith P hdet outer ε b q x Y θ * assembledTangentWith P hdet outer ε a q x i Y θ = _ |
| 346 | rw [assembled_bilinear_symmetry sys hdet N hN P outer ε b a hq x i] |
| 347 | ring |
| 348 | rw [heq, doubleAverage_const_mul, |
| 349 | assembled_bilinear_covariance sys hdet N hN P outer ε a b hq x hε i] |
| 350 | have hf : (support (fun U : UnsignedLabel => outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2 * |
| 351 | ((P U).matrix.mulVec (fun j => a U j * b U j)) i)).Finite := by |
| 352 | apply (finite_active_masks D N hq x).subset |
| 353 | intro U hU hm |
| 354 | exact hU (by simp [hm]) |
| 355 | rw [mul_finsum _ 2] |
| 356 | apply finsum_congr |
| 357 | intro U |
| 358 | by_cases hm : mask D (tailLabel N U) q x = 0 |
| 359 | · simp [hm] |
| 360 | · calc |
| 361 | _ = (outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2) * |
| 362 | (2 * ((P U).matrix.mulVec (fun j => a U j * b U j)) i) := by ring |
| 363 | _ = _ := by rw [cross_reconstruct_component (P U).matrix (T U) (R U) (hcone U hm) i] |
| 364 | |
| 365 | /-- The signed-square covariance is retained exactly, with no sign restriction |
| 366 | on the prescribed stress. -/ |
| 367 | theorem assembled_signed_square {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 368 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 369 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 370 | (outer ε : UnsignedLabel → ℝ) (T R : UnsignedLabel → Vec2) |
| 371 | {q : ℝ} (hq : 0 < q) (x : SlotColoring.Position) |
| 372 | (hε : ∀ U, mask D (tailLabel N U) q x ≠ 0 → 0 ≤ ε U) (i : Fin 2) : |
| 373 | doubleAverage (fun Y θ => signedRadial P hdet outer ε T R q x Y θ * |
| 374 | signedTangent P hdet outer ε T R q x i Y θ) = |
| 375 | ∑ᶠ U : UnsignedLabel, outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2 * |
| 376 | squareColumn (P U).matrix (T U) (R U) i := by |
| 377 | simpa only [signedRadial, signedTangent, squareColumn, pow_two] using |
| 378 | assembled_bilinear_covariance sys hdet N hN P outer ε |
| 379 | (fun U => increment (P U).matrix (T U) (R U)) |
| 380 | (fun U => increment (P U).matrix (T U) (R U)) hq x hε i |
| 381 | |
| 382 | /-! ## The physical signed target -/ |
| 383 | |
| 384 | /-- Section 10.2's chart stress `Q^(2 A) σ / ε`. -/ |
| 385 | noncomputable def chartStress (h : ℝ) (N : ℕ) (σ : Vec2) (U : UnsignedLabel) : Vec2 := |
| 386 | fun i => ChartScales.Q (U.1 + N) ^ (2 * velocityExponent h) * σ i / |
| 387 | physicalViscosity h N U |
| 388 | |
| 389 | theorem physical_signed_scale (h : ℝ) (N : ℕ) (σ : Vec2) (U : UnsignedLabel) (i : Fin 2) : |
| 390 | physicalOuter h N U ^ 2 * physicalViscosity h N U * chartStress h N σ U i = σ i := by |
| 391 | have hQ := ChartScales.Q_pos (U.1 + N) |
| 392 | have hε := ChartScales.epsilon_pos h (U.1 + N) |
| 393 | have hp : (ChartScales.Q (U.1 + N) ^ (-velocityExponent h)) ^ 2 * |
| 394 | ChartScales.Q (U.1 + N) ^ (2 * velocityExponent h) = 1 := by |
| 395 | rw [← Real.rpow_mul_natCast hQ.le, ← Real.rpow_add hQ] |
| 396 | have he : -velocityExponent h * (2 : ℝ) + 2 * velocityExponent h = 0 := by ring |
| 397 | simp only [Nat.cast_ofNat, he, Real.rpow_zero] |
| 398 | unfold physicalOuter chartStress |
| 399 | change _ * ChartScales.epsilon h (U.1 + N) * |
| 400 | (_ * σ i / ChartScales.epsilon h (U.1 + N)) = _ |
| 401 | calc |
| 402 | _ = ((ChartScales.Q (U.1 + N) ^ (-velocityExponent h)) ^ 2 * |
| 403 | ChartScales.Q (U.1 + N) ^ (2 * velocityExponent h)) * σ i := by |
| 404 | field_simp |
| 405 | _ = _ := by rw [hp, one_mul] |
| 406 | |
| 407 | /-- The actual two-sided primary/signed covariance equals the prescribed |
| 408 | physical stress, for the same constructed squared partition as the primary. -/ |
| 409 | theorem physical_signed_cross_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 410 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 411 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 412 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (T0 σ : Vec2) |
| 413 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |
| 414 | SmoothCovariance.StrictCone (P U).matrix (chartTarget h q N T0 U)) (i : Fin 2) : |
| 415 | doubleAverage (fun Y θ => |
| 416 | assembledRadial P hdet (physicalOuter h N) (physicalViscosity h N) (chartTarget h q N T0) q x Y θ * |
| 417 | signedTangent P hdet (physicalOuter h N) (physicalViscosity h N) |
| 418 | (chartTarget h q N T0) (chartStress h N σ) q x i Y θ + |
| 419 | signedRadial P hdet (physicalOuter h N) (physicalViscosity h N) |
| 420 | (chartTarget h q N T0) (chartStress h N σ) q x Y θ * |
| 421 | assembledTangent P hdet (physicalOuter h N) (physicalViscosity h N) (chartTarget h q N T0) q x i Y θ) = |
| 422 | σ i := by |
| 423 | rw [assembled_cross_covariance sys hdet N hN P (physicalOuter h N) (physicalViscosity h N) |
| 424 | (chartTarget h q N T0) (chartStress h N σ) hq x |
| 425 | (fun U _ => (ChartScales.epsilon_pos h (U.1 + N)).le) hcone i] |
| 426 | have heq (U : UnsignedLabel) : physicalOuter h N U ^ 2 * physicalViscosity h N U * |
| 427 | mask D (tailLabel N U) q x ^ 2 * chartStress h N σ U i = mask D (tailLabel N U) q x ^ 2 * σ i := by |
| 428 | calc |
| 429 | _ = mask D (tailLabel N U) q x ^ 2 * |
| 430 | (physicalOuter h N U ^ 2 * physicalViscosity h N U * chartStress h N σ U i) := by ring |
| 431 | _ = _ := by rw [physical_signed_scale] |
| 432 | simp_rw [heq] |
| 433 | have hf : (support (fun U : UnsignedLabel => mask D (tailLabel N U) q x ^ 2)).Finite := by |
| 434 | apply (finite_active_masks D N hq x).subset |
| 435 | intro U hU hz |
| 436 | exact hU (by simp [hz]) |
| 437 | rw [← finsum_mul _ _, physical_mask_tail_sum_sq D N hq hqN x, one_mul] |
| 438 | |
| 439 | /-! ## Uniform weighted jets from input classes and a primary lower bound -/ |
| 440 | |
| 441 | open WeightedClasses |
| 442 | |
| 443 | section Weighted |
| 444 | |
| 445 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 446 | |
| 447 | /-- A polynomial reciprocal bound, imposed only on the positive primary |
| 448 | weight. No regularity of a quotient by the envelope is assumed. -/ |
| 449 | noncomputable def InverseControl (s : StripData E) (w g : ℕ → E → ℝ) : Prop := |
| 450 | ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ n x, x ∈ s.domain → |
| 451 | w n x / g n x ≤ C * s.growth n x ^ p |
| 452 | |
| 453 | theorem inverseControl_of_lower {s : StripData E} {w g : ℕ → E → ℝ} |
| 454 | (hg : ∀ n x, x ∈ s.domain → 0 < g n x) {c : ℝ} (hc : 0 < c) (p : ℕ) |
| 455 | (hlower : ∀ n x, x ∈ s.domain → c * w n x / s.growth n x ^ p ≤ g n x) : |
| 456 | InverseControl s w g := by |
| 457 | refine ⟨c⁻¹, (inv_pos.mpr hc).le, p, ?_⟩ |
| 458 | intro n x hx |
| 459 | have hG : 0 < s.growth n x ^ p := pow_pos (zero_lt_one.trans_le (s.one_le_growth n x)) _ |
| 460 | have hl := (div_le_iff₀ hG).mp (hlower n x hx) |
| 461 | apply (div_le_iff₀ (hg n x hx)).mpr |
| 462 | calc |
| 463 | w n x = c⁻¹ * (c * w n x) := by rw [← mul_assoc, inv_mul_cancel₀ hc.ne', one_mul] |
| 464 | _ ≤ c⁻¹ * (g n x * s.growth n x ^ p) := mul_le_mul_of_nonneg_left hl (inv_pos.mpr hc).le |
| 465 | _ = _ := by ring |
| 466 | |
| 467 | /-- A common finite envelope for input jets and the positive lower bound, |
| 468 | uniform in the discrete band and every point of the strip. -/ |
| 469 | theorem class_input_envelope {s : StripData E} {w g r : ℕ → E → ℝ} |
| 470 | (hw : ∀ n x, x ∈ s.domain → 0 < w n x) |
| 471 | (hp : ∀ n x, x ∈ s.domain → 0 < g n x) |
| 472 | (hg : MemClass s w 0 g) (hr : MemClass s w 0 r) |
| 473 | (hlower : InverseControl s w g) (m : ℕ) : |
| 474 | ∃ C : ℝ, 1 ≤ C ∧ ∃ p : ℕ, ∀ n x, x ∈ s.domain → |
| 475 | 1 ≤ C * s.growth n x ^ p ∧ |
| 476 | w n x / (C * s.growth n x ^ p) ≤ g n x ∧ |
| 477 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j (g n) x‖ ≤ w n x * (C * s.growth n x ^ p)) ∧ |
| 478 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j (r n) x‖ ≤ w n x * (C * s.growth n x ^ p)) := by |
| 479 | obtain ⟨Cg, hCg, pg, hgj⟩ := hg.bounds m |
| 480 | obtain ⟨Cr, hCr, pr, hrj⟩ := hr.bounds m |
| 481 | obtain ⟨C0, hC0, p0, hl⟩ := hlower |
| 482 | let C := Cg + Cr + C0 + 1 |
| 483 | let p := pg + pr + p0 |
| 484 | have hC : 1 ≤ C := by dsimp [C]; linarith |
| 485 | refine ⟨C, hC, p, ?_⟩ |
| 486 | intro n x hx |
| 487 | have hm (A : ℝ) (hA : 0 ≤ A) (hAC : A ≤ C) (k : ℕ) (hkp : k ≤ p) : |
| 488 | A * s.growth n x ^ k ≤ C * s.growth n x ^ p := by |
| 489 | exact mul_le_mul hAC (pow_le_pow_right₀ (s.one_le_growth n x) hkp) |
| 490 | (pow_nonneg (s.growth_nonneg n x) k) (zero_le_one.trans hC) |
| 491 | have hB : 1 ≤ C * s.growth n x ^ p := |
| 492 | one_le_mul_of_one_le_of_one_le hC (one_le_pow₀ (s.one_le_growth n x)) |
| 493 | refine ⟨hB, ?_, ?_, ?_⟩ |
| 494 | · apply (div_le_iff₀ (zero_lt_one.trans_le hB)).mpr |
| 495 | have hl' : w n x / g n x ≤ C * s.growth n x ^ p := |
| 496 | (hl n x hx).trans (hm C0 hC0 (by dsimp [C]; linarith) p0 (by dsimp [p]; omega)) |
| 497 | simpa only [mul_comm] using (div_le_iff₀ (hp n x hx)).mp hl' |
| 498 | · intro j hj |
| 499 | calc |
| 500 | _ ≤ Cg * s.growth n x ^ pg * w n x := by |
| 501 | simpa only [majorant, Real.rpow_zero, mul_one] using hgj n x hx j hj |
| 502 | _ ≤ (C * s.growth n x ^ p) * w n x := mul_le_mul_of_nonneg_right |
| 503 | (hm Cg hCg (by dsimp [C]; linarith) pg (by dsimp [p]; omega)) (hw n x hx).le |
| 504 | _ = _ := by ring |
| 505 | · intro j hj |
| 506 | calc |
| 507 | _ ≤ Cr * s.growth n x ^ pr * w n x := by |
| 508 | simpa only [majorant, Real.rpow_zero, mul_one] using hrj n x hx j hj |
| 509 | _ ≤ (C * s.growth n x ^ p) * w n x := mul_le_mul_of_nonneg_right |
| 510 | (hm Cr hCr (by dsimp [C]; linarith) pr (by dsimp [p]; omega)) (hw n x hx).le |
| 511 | _ = _ := by ring |
| 512 | |
| 513 | noncomputable def signedJetCost (j : ℕ) : ℝ := |
| 514 | WeightedQuotients.chooseSum j * WeightedQuotients.orderBound (-(1 / 2 : ℝ)) j / 2 |
| 515 | |
| 516 | noncomputable def prefixJetCost (m : ℕ) : ℝ := |
| 517 | 1 + ∑ j ∈ Finset.range (m + 1), |signedJetCost j| |
| 518 | |
| 519 | theorem prefixJetCost_pos (m : ℕ) : 0 < prefixJetCost m := by |
| 520 | have hs := Finset.sum_nonneg (s := Finset.range (m + 1)) (fun j _ => abs_nonneg (signedJetCost j)) |
| 521 | dsimp [prefixJetCost] |
| 522 | linarith |
| 523 | |
| 524 | theorem signedJetCost_le {j m : ℕ} (hj : j ≤ m) : signedJetCost j ≤ prefixJetCost m := by |
| 525 | have hs := Finset.single_le_sum (f := fun j => |signedJetCost j|) |
| 526 | (fun k _ => abs_nonneg (signedJetCost k)) (Finset.mem_range.mpr (Nat.lt_succ_of_le hj)) |
| 527 | exact (le_abs_self _).trans (hs.trans (by dsimp [prefixJetCost]; linarith)) |
| 528 | |
| 529 | theorem signedJetCost_nonneg (j : ℕ) : 0 ≤ signedJetCost j := |
| 530 | div_nonneg (mul_nonneg (WeightedQuotients.chooseSum_nonneg j) |
| 531 | (WeightedQuotients.orderBound_nonneg _ _)) (by norm_num) |
| 532 | |
| 533 | /-- Derive the all-order signed quotient class from weighted input jets. |
| 534 | The weight is never differentiated or divided out as a variable function. -/ |
| 535 | theorem signed_quotient_class_zero {s : StripData E} {w g r : ℕ → E → ℝ} |
| 536 | (hw : ∀ n x, x ∈ s.domain → 0 < w n x) |
| 537 | (hp : ∀ n x, x ∈ s.domain → 0 < g n x) |
| 538 | (hg : MemClass s w 0 g) (hr : MemClass s w 0 r) |
| 539 | (hlower : InverseControl s w g) : |
| 540 | MemClass s (fun n x => Real.sqrt (w n x)) 0 |
| 541 | (fun n x => r n x / (2 * Real.sqrt (g n x))) := by |
| 542 | have hsmooth (n : ℕ) : ContDiffOn ℝ ∞ |
| 543 | (fun x => r n x / (2 * Real.sqrt (g n x))) s.domain := |
| 544 | (hr.smooth n).div (contDiffOn_const.mul ((hg.smooth n).sqrt (fun x hx => (hp n x hx).ne'))) |
| 545 | (fun x hx => mul_ne_zero (by norm_num) (Real.sqrt_pos.mpr (hp n x hx)).ne') |
| 546 | refine ⟨fun n x hx => Real.sqrt_nonneg _, hsmooth, ?_⟩ |
| 547 | intro m |
| 548 | obtain ⟨C, hC, p, henv⟩ := class_input_envelope hw hp hg hr hlower m |
| 549 | refine ⟨prefixJetCost m * C ^ (2 * m + 2), |
| 550 | mul_nonneg (prefixJetCost_pos m).le (pow_nonneg (zero_le_one.trans hC) _), p * (2 * m + 2), ?_⟩ |
| 551 | intro n x hx j hj |
| 552 | obtain ⟨hB, hlo, hgj, hrj⟩ := henv n x hx |
| 553 | have hb := WeightedQuotients.signed_jet_bound s.isOpen_domain (hg.smooth n) (hr.smooth n) |
| 554 | (hp n) hx (hw n x hx) hB j hlo (fun k hk => hgj k (hk.trans hj)) (fun k hk => hrj k (hk.trans hj)) |
| 555 | calc |
| 556 | _ ≤ Real.sqrt (w n x) * signedJetCost j * (C * s.growth n x ^ p) ^ (2 * j + 2) := hb |
| 557 | _ ≤ Real.sqrt (w n x) * prefixJetCost m * (C * s.growth n x ^ p) ^ (2 * m + 2) := by |
| 558 | apply mul_le_mul |
| 559 | · exact mul_le_mul_of_nonneg_left (signedJetCost_le hj) (Real.sqrt_nonneg _) |
| 560 | · exact pow_le_pow_right₀ hB (by omega) |
| 561 | · exact pow_nonneg (zero_le_one.trans hB) _ |
| 562 | · exact mul_nonneg (Real.sqrt_nonneg _) (prefixJetCost_pos m).le |
| 563 | _ = majorant s (fun n x => Real.sqrt (w n x)) 0 |
| 564 | (prefixJetCost m * C ^ (2 * m + 2)) (p * (2 * m + 2)) n x := by |
| 565 | simp only [majorant, Real.rpow_zero, mul_one, mul_pow, pow_mul] |
| 566 | ring |
| 567 | |
| 568 | /-- Discrete powers of epsilon pass through the quotient without a jet loss. -/ |
| 569 | theorem signed_quotient_class {s : StripData E} {w g r : ℕ → E → ℝ} {β : ℝ} |
| 570 | (hw : ∀ n x, x ∈ s.domain → 0 < w n x) |
| 571 | (hp : ∀ n x, x ∈ s.domain → 0 < g n x) |
| 572 | (hg : MemClass s w 0 g) (hr : MemClass s w β r) |
| 573 | (hlower : InverseControl s w g) : |
| 574 | MemClass s (fun n x => Real.sqrt (w n x)) β |
| 575 | (fun n x => r n x / (2 * Real.sqrt (g n x))) := by |
| 576 | have hr0 : MemClass s w 0 (fun n x => s.epsilon n ^ (-β) * r n x) := by |
| 577 | simpa only [smul_eq_mul, add_neg_cancel] using hr.band_smul (bandBound_rpow s (-β)) |
| 578 | have hq0 := signed_quotient_class_zero hw hp hg hr0 hlower |
| 579 | have hq := hq0.band_smul (bandBound_rpow s β) |
| 580 | have heq : (fun n x => s.epsilon n ^ β • (s.epsilon n ^ (-β) * r n x / (2 * Real.sqrt (g n x)))) = |
| 581 | (fun n x => r n x / (2 * Real.sqrt (g n x))) := by |
| 582 | funext n x |
| 583 | simp only [smul_eq_mul, ← mul_div_assoc, ← mul_assoc, |
| 584 | ← Real.rpow_add (s.epsilon_pos n), add_neg_cancel, Real.rpow_zero, one_mul] |
| 585 | simpa only [zero_add, heq] using hq |
| 586 | |
| 587 | /-- A companion primary square-root bound from the same genuine inputs. -/ |
| 588 | theorem sqrt_class {s : StripData E} {w g : ℕ → E → ℝ} |
| 589 | (hw : ∀ n x, x ∈ s.domain → 0 < w n x) |
| 590 | (hp : ∀ n x, x ∈ s.domain → 0 < g n x) |
| 591 | (hg : MemClass s w 0 g) (hlower : InverseControl s w g) : |
| 592 | MemClass s (fun n x => Real.sqrt (w n x)) 0 (fun n x => Real.sqrt (g n x)) := by |
| 593 | have hq := signed_quotient_class_zero hw hp hg hg hlower |
| 594 | have htwo : BandBound s 0 (fun _ => (2 : ℝ)) := by |
| 595 | refine ⟨2, by norm_num, 0, ?_⟩ |
| 596 | intro n |
| 597 | simp |
| 598 | have heq : (fun n x => (2 : ℝ) • (g n x / (2 * Real.sqrt (g n x)))) = |
| 599 | (fun n x => Real.sqrt (g n x)) := by |
| 600 | funext n x |
| 601 | simp only [smul_eq_mul] |
| 602 | calc |
| 603 | 2 * (g n x / (2 * Real.sqrt (g n x))) = g n x / Real.sqrt (g n x) := by ring |
| 604 | _ = _ := Real.div_sqrt |
| 605 | simpa only [zero_add, heq] using hq.band_smul htwo |
| 606 | |
| 607 | theorem memClass_congrOn {s : StripData E} {w f g : ℕ → E → ℝ} {β : ℝ} |
| 608 | (hf : MemClass s w β f) (heq : ∀ n x, x ∈ s.domain → f n x = g n x) : |
| 609 | MemClass s w β g := by |
| 610 | refine ⟨hf.weight_nonneg, fun n => (hf.smooth n).congr (fun x hx => (heq n x hx).symm), ?_⟩ |
| 611 | intro m |
| 612 | obtain ⟨C, hC, p, hb⟩ := hf.bounds m |
| 613 | refine ⟨C, hC, p, ?_⟩ |
| 614 | intro n x hx j hj |
| 615 | have he : g n =ᶠ[𝓝 x] f n := by |
| 616 | filter_upwards [s.isOpen_domain.mem_nhds hx] with y hy |
| 617 | exact (heq n y hy).symm |
| 618 | rw [WeightedQuotients.jet_congr he j] |
| 619 | exact hb n x hx j hj |
| 620 | |
| 621 | /-- The actual matrix-inverse signed coefficient has the half-weight class, |
| 622 | derived from the inverse numerator jets and positive primary inverse jets. -/ |
| 623 | theorem increment_wave_class {s : StripData E} {H : ℕ → E → Mat2} |
| 624 | {T R : ℕ → E → Vec2} {β : ℝ} (j : Fin 2) |
| 625 | (hζ : ∀ x ∈ s.domain, 0 < s.zeta x) |
| 626 | (hcone : ∀ n x, x ∈ s.domain → SmoothCovariance.StrictCone (H n x) (T n x)) |
| 627 | (hY : MeanClass s 0 (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 628 | (hR : MeanClass s β (fun n x => ((H n x)⁻¹.mulVec (R n x)) j)) |
| 629 | (hlower : InverseControl s (fun _ x => s.zeta x) |
| 630 | (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) : |
| 631 | WaveClass s (fun _ _ => 1) β (fun n x => increment (H n x) (T n x) (R n x) j) := by |
| 632 | have hq := signed_quotient_class (fun n x hx => hζ x hx) |
| 633 | (fun n x hx => (amplitudes_are_inverse_weights (hcone n x hx) j).1) hY hR hlower |
| 634 | have he := memClass_congrOn hq |
| 635 | (fun n x hx => (increment_eq_inverse (H n x) (T n x) (R n x) (hcone n x hx) j).symm) |
| 636 | simpa only [WaveClass, mul_one] using he |
| 637 | |
| 638 | /-- Multiplying a signed coefficient by the original pulse envelope gives |
| 639 | the wave weight `sqrt ζ * P` with the expected epsilon exponent. -/ |
| 640 | theorem increment_times_pulse_class {s : StripData E} {H : ℕ → E → Mat2} |
| 641 | {T R : ℕ → E → Vec2} {β γ : ℝ} {P f : ℕ → E → ℝ} (j : Fin 2) |
| 642 | (hζ : ∀ x ∈ s.domain, 0 < s.zeta x) |
| 643 | (hcone : ∀ n x, x ∈ s.domain → SmoothCovariance.StrictCone (H n x) (T n x)) |
| 644 | (hY : MeanClass s 0 (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 645 | (hR : MeanClass s β (fun n x => ((H n x)⁻¹.mulVec (R n x)) j)) |
| 646 | (hlower : InverseControl s (fun _ x => s.zeta x) |
| 647 | (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 648 | (hf : MemClass s P γ f) : |
| 649 | WaveClass s P (β + γ) |
| 650 | (fun n x => increment (H n x) (T n x) (R n x) j * f n x) := by |
| 651 | have hc := increment_wave_class j hζ hcone hY hR hlower |
| 652 | simpa only [WaveClass, mul_one] using (MemClass.mul hc hf) |
| 653 | |
| 654 | /-- The exact signed-square column satisfies a mean-class estimate. The |
| 655 | assumptions are estimates for the input inverse solves and actual columns. -/ |
| 656 | theorem signed_square_class {s : StripData E} {H : ℕ → E → Mat2} |
| 657 | {T R : ℕ → E → Vec2} {β : ℝ} (i : Fin 2) |
| 658 | (hζ : ∀ x ∈ s.domain, 0 < s.zeta x) |
| 659 | (hcone : ∀ n x, x ∈ s.domain → SmoothCovariance.StrictCone (H n x) (T n x)) |
| 660 | (hY : ∀ j, MeanClass s 0 (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 661 | (hR : ∀ j, MeanClass s β (fun n x => ((H n x)⁻¹.mulVec (R n x)) j)) |
| 662 | (hlower : ∀ j, InverseControl s (fun _ x => s.zeta x) |
| 663 | (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 664 | (hH : ∀ j, UnweightedClass s 0 (fun n x => H n x i j)) : |
| 665 | MeanClass s (2 * β) (fun n x => squareColumn (H n x) (T n x) (R n x) i) := by |
| 666 | have ht (j : Fin 2) : MeanClass s (β + β) (fun n x => |
| 667 | H n x i j * (increment (H n x) (T n x) (R n x) j * increment (H n x) (T n x) (R n x) j)) := by |
| 668 | have hc := increment_wave_class j hζ hcone (hY j) (hR j) (hlower j) |
| 669 | have hsq := WeightedClasses.WaveClass.mul_mean hc hc (fun _ _ _ => zero_le_one) (fun _ _ _ => le_rfl) |
| 670 | simpa only [MeanClass, UnweightedClass, one_mul, zero_add] using (MemClass.mul (hH j) hsq) |
| 671 | have hsum := MemClass.sum Finset.univ _ (fun n x hx => s.zeta_nonneg x hx) (fun j _ => ht j) |
| 672 | simpa only [MeanClass, squareColumn, Matrix.mulVec, dotProduct, pow_two, two_mul] using hsum |
| 673 | |
| 674 | /-- Native velocity amplitudes contain `sqrt ε`, so their signed-square |
| 675 | covariance is `ε H(δa²)` and has order `2B - 2loss`. -/ |
| 676 | theorem native_signed_square_class {s : StripData E} {H : ℕ → E → Mat2} |
| 677 | {T R : ℕ → E → Vec2} (B loss : ℝ) (i : Fin 2) |
| 678 | (hζ : ∀ x ∈ s.domain, 0 < s.zeta x) |
| 679 | (hcone : ∀ n x, x ∈ s.domain → SmoothCovariance.StrictCone (H n x) (T n x)) |
| 680 | (hY : ∀ j, MeanClass s 0 (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 681 | (hR : ∀ j, MeanClass s (B - 1 / 2 - loss) (fun n x => ((H n x)⁻¹.mulVec (R n x)) j)) |
| 682 | (hlower : ∀ j, InverseControl s (fun _ x => s.zeta x) |
| 683 | (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 684 | (hH : ∀ j, UnweightedClass s 0 (fun n x => H n x i j)) : |
| 685 | MeanClass s (2 * B - 2 * loss) |
| 686 | (fun n x => s.epsilon n * squareColumn (H n x) (T n x) (R n x) i) := by |
| 687 | have hc := signed_square_class i hζ hcone hY hR hlower hH |
| 688 | have hb := hc.band_smul (bandBound_rpow s 1) |
| 689 | have he : 2 * (B - 1 / 2 - loss) + 1 = 2 * B - 2 * loss := by ring |
| 690 | unfold MeanClass |
| 691 | simpa only [he, Real.rpow_one, smul_eq_mul] using hb |
| 692 | |
| 693 | /-- This version keeps the flat weights of the individual columns. The |
| 694 | column weight and its inverse-solve weight multiply back to the mean weight; |
| 695 | an exponentially singular inverse is therefore not assumed unweighted. -/ |
| 696 | theorem balanced_signed_square_class {s : StripData E} {H : ℕ → E → Mat2} |
| 697 | {T R : ℕ → E → Vec2} {w v : Fin 2 → ℕ → E → ℝ} {β : ℝ} (i : Fin 2) |
| 698 | (hw : ∀ j n x, x ∈ s.domain → 0 < w j n x) |
| 699 | (hcone : ∀ n x, x ∈ s.domain → SmoothCovariance.StrictCone (H n x) (T n x)) |
| 700 | (hY : ∀ j, MemClass s (w j) 0 (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 701 | (hR : ∀ j, MemClass s (w j) β (fun n x => ((H n x)⁻¹.mulVec (R n x)) j)) |
| 702 | (hlower : ∀ j, InverseControl s (w j) (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 703 | (hH : ∀ j, MemClass s (v j) 0 (fun n x => H n x i j)) |
| 704 | (hbalance : ∀ j n x, x ∈ s.domain → v j n x * w j n x ≤ s.zeta x) : |
| 705 | MeanClass s (2 * β) (fun n x => squareColumn (H n x) (T n x) (R n x) i) := by |
| 706 | have ht (j : Fin 2) : MeanClass s (β + β) (fun n x => |
| 707 | H n x i j * (increment (H n x) (T n x) (R n x) j * increment (H n x) (T n x) (R n x) j)) := by |
| 708 | have hc := signed_quotient_class (hw j) |
| 709 | (fun n x hx => (amplitudes_are_inverse_weights (hcone n x hx) j).1) (hY j) (hR j) (hlower j) |
| 710 | have hi := memClass_congrOn hc |
| 711 | (fun n x hx => (increment_eq_inverse (H n x) (T n x) (R n x) (hcone n x hx) j).symm) |
| 712 | have hsq : MemClass s (w j) (β + β) |
| 713 | (fun n x => increment (H n x) (T n x) (R n x) j * increment (H n x) (T n x) (R n x) j) := by |
| 714 | apply (MemClass.mul hi hi).mono_weight (fun n x hx => (hw j n x hx).le) |
| 715 | intro n x hx |
| 716 | exact (Real.mul_self_sqrt (hw j n x hx).le).le |
| 717 | have hh := (MemClass.mul (hH j) hsq).mono_weight (fun n x hx => s.zeta_nonneg x hx) (hbalance j) |
| 718 | unfold MeanClass |
| 719 | simpa only [zero_add] using hh |
| 720 | have hsum := MemClass.sum Finset.univ _ (fun n x hx => s.zeta_nonneg x hx) (fun j _ => ht j) |
| 721 | simpa only [MeanClass, squareColumn, Matrix.mulVec, dotProduct, pow_two, two_mul] using hsum |
| 722 | |
| 723 | /-- Exact cancellation of the column's flat factor with the remaining |
| 724 | inverse-solve factor, including the zero edge. -/ |
| 725 | theorem balanced_edge_weights (σ κ δ : ℝ) : |
| 726 | FlatCutoff.edge κ δ * FlatCutoff.edge (σ - κ) δ = FlatCutoff.edge σ δ := by |
| 727 | rw [FlatCovariance.edge_mul] |
| 728 | congr 1 |
| 729 | ring |
| 730 | |
| 731 | theorem balanced_native_signed_square_class {s : StripData E} {H : ℕ → E → Mat2} |
| 732 | {T R : ℕ → E → Vec2} {w v : Fin 2 → ℕ → E → ℝ} (B loss : ℝ) (i : Fin 2) |
| 733 | (hw : ∀ j n x, x ∈ s.domain → 0 < w j n x) |
| 734 | (hcone : ∀ n x, x ∈ s.domain → SmoothCovariance.StrictCone (H n x) (T n x)) |
| 735 | (hY : ∀ j, MemClass s (w j) 0 (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 736 | (hR : ∀ j, MemClass s (w j) (B - 1 / 2 - loss) (fun n x => ((H n x)⁻¹.mulVec (R n x)) j)) |
| 737 | (hlower : ∀ j, InverseControl s (w j) (fun n x => ((H n x)⁻¹.mulVec (T n x)) j)) |
| 738 | (hH : ∀ j, MemClass s (v j) 0 (fun n x => H n x i j)) |
| 739 | (hbalance : ∀ j n x, x ∈ s.domain → v j n x * w j n x ≤ s.zeta x) : |
| 740 | MeanClass s (2 * B - 2 * loss) |
| 741 | (fun n x => s.epsilon n * squareColumn (H n x) (T n x) (R n x) i) := by |
| 742 | have hc := balanced_signed_square_class i hw hcone hY hR hlower hH hbalance |
| 743 | have hb := hc.band_smul (bandBound_rpow s 1) |
| 744 | have he : 2 * (B - 1 / 2 - loss) + 1 = 2 * B - 2 * loss := by ring |
| 745 | unfold MeanClass |
| 746 | simpa only [he, Real.rpow_one, smul_eq_mul] using hb |
| 747 | |
| 748 | end Weighted |
| 749 | |
| 750 | /-! ## A quantitative bound for the complete assembled signed square -/ |
| 751 | |
| 752 | theorem increment_sq_bound (H : Mat2) (T R : Vec2) |
| 753 | (hcone : SmoothCovariance.StrictCone H T) (j : Fin 2) |
| 754 | {l d : ℝ} (hl : 0 < l) (_hd : 0 ≤ d) |
| 755 | (hY : l ≤ (H⁻¹.mulVec T) j) (hR : |(H⁻¹.mulVec R) j| ≤ d) : |
| 756 | increment H T R j ^ 2 ≤ d ^ 2 / (4 * l) := by |
| 757 | have hpos := (amplitudes_are_inverse_weights hcone j).1 |
| 758 | have hr2 : ((H⁻¹.mulVec R) j) ^ 2 ≤ d ^ 2 := by |
| 759 | simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) hR 2 |
| 760 | rw [increment_eq_inverse H T R hcone j, div_pow, mul_pow, Real.sq_sqrt hpos.le] |
| 761 | norm_num only [OfNat.ofNat, Nat.cast_ofNat] |
| 762 | calc |
| 763 | _ ≤ d ^ 2 / (4 * (H⁻¹.mulVec T) j) := div_le_div_of_nonneg_right hr2 (by positivity) |
| 764 | _ ≤ _ := div_le_div_of_nonneg_left (sq_nonneg d) (by positivity) (by linarith) |
| 765 | |
| 766 | theorem squareColumn_abs_bound (H : Mat2) (T R : Vec2) |
| 767 | (hcone : SmoothCovariance.StrictCone H T) (i : Fin 2) |
| 768 | {l d K : ℝ} (hl : 0 < l) (hd : 0 ≤ d) (hK : 0 ≤ K) |
| 769 | (hY : ∀ j, l ≤ (H⁻¹.mulVec T) j) (hR : ∀ j, |(H⁻¹.mulVec R) j| ≤ d) |
| 770 | (hH : ∀ j, |H i j| ≤ K) : |squareColumn H T R i| ≤ 2 * K * d ^ 2 / (4 * l) := by |
| 771 | have hb (j : Fin 2) : |H i j * increment H T R j ^ 2| ≤ K * (d ^ 2 / (4 * l)) := by |
| 772 | rw [abs_mul, abs_of_nonneg (sq_nonneg (increment H T R j))] |
| 773 | exact mul_le_mul (hH j) (increment_sq_bound H T R hcone j hl hd (hY j) (hR j)) |
| 774 | (sq_nonneg _) hK |
| 775 | unfold squareColumn |
| 776 | simp only [Matrix.mulVec, dotProduct, Fin.sum_univ_two] |
| 777 | calc |
| 778 | _ ≤ |H i 0 * increment H T R 0 ^ 2| + |H i 1 * increment H T R 1 ^ 2| := abs_add_le _ _ |
| 779 | _ ≤ K * (d ^ 2 / (4 * l)) + K * (d ^ 2 / (4 * l)) := add_le_add (hb 0) (hb 1) |
| 780 | _ = _ := by ring |
| 781 | |
| 782 | theorem mask_average_bound (D : ℝ) (N : ℕ) {q : ℝ} (hq : 0 < q) |
| 783 | (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) (f : UnsignedLabel → ℝ) (B : ℝ) |
| 784 | (hb : ∀ U, mask D (tailLabel N U) q x ≠ 0 → |f U| ≤ B) : |
| 785 | |∑ᶠ U : UnsignedLabel, mask D (tailLabel N U) q x ^ 2 * f U| ≤ B := by |
| 786 | classical |
| 787 | let F := (finite_active_masks D N hq x).toFinset |
| 788 | have hz (U : UnsignedLabel) (hU : U ∉ F) : mask D (tailLabel N U) q x = 0 := by |
| 789 | by_contra hm |
| 790 | exact hU ((finite_active_masks D N hq x).mem_toFinset.mpr hm) |
| 791 | have heq : (∑ᶠ U : UnsignedLabel, mask D (tailLabel N U) q x ^ 2 * f U) = |
| 792 | ∑ U ∈ F, mask D (tailLabel N U) q x ^ 2 * f U := by |
| 793 | apply finsum_eq_sum_of_support_subset |
| 794 | intro U hU |
| 795 | by_contra hn |
| 796 | exact hU (by simp [hz U hn]) |
| 797 | have hs : (∑ U ∈ F, mask D (tailLabel N U) q x ^ 2) = 1 := by |
| 798 | rw [← physical_mask_tail_sum_sq D N hq hqN x] |
| 799 | symm |
| 800 | apply finsum_eq_sum_of_support_subset |
| 801 | intro U hU |
| 802 | by_contra hn |
| 803 | exact hU (by simp [hz U hn]) |
| 804 | rw [heq] |
| 805 | calc |
| 806 | _ ≤ ∑ U ∈ F, |mask D (tailLabel N U) q x ^ 2 * f U| := Finset.abs_sum_le_sum_abs _ _ |
| 807 | _ ≤ ∑ U ∈ F, mask D (tailLabel N U) q x ^ 2 * B := by |
| 808 | apply Finset.sum_le_sum |
| 809 | intro U hU |
| 810 | rw [abs_mul, abs_of_nonneg (sq_nonneg _)] |
| 811 | exact mul_le_mul_of_nonneg_left |
| 812 | (hb U ((finite_active_masks D N hq x).mem_toFinset.mp hU)) (sq_nonneg _) |
| 813 | _ = B := by rw [← Finset.sum_mul, hs, one_mul] |
| 814 | |
| 815 | /-- A bound for the full actual averaged remainder, proved from the primary |
| 816 | inverse lower bound, signed inverse numerator bound, and actual column bound. |
| 817 | The number of active labels costs nothing because their squared masks sum to one. -/ |
| 818 | theorem assembled_signed_square_bound {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) |
| 819 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (N : ℕ) (hN : 1 ≤ N) |
| 820 | (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) |
| 821 | (outer ε : UnsignedLabel → ℝ) (T R : UnsignedLabel → Vec2) |
| 822 | {q : ℝ} (hq : 0 < q) (hqN : q ≤ ChartScales.Q N) (x : SlotColoring.Position) |
| 823 | (hε : ∀ U, mask D (tailLabel N U) q x ≠ 0 → 0 ≤ ε U) |
| 824 | (hcone : ∀ U, mask D (tailLabel N U) q x ≠ 0 → SmoothCovariance.StrictCone (P U).matrix (T U)) |
| 825 | {l d K Λ : ℝ} (hl : 0 < l) (hd : 0 ≤ d) (hK : 0 ≤ K) (hΛ : 0 ≤ Λ) |
| 826 | (hY : ∀ U, mask D (tailLabel N U) q x ≠ 0 → ∀ j, l ≤ ((P U).matrix⁻¹.mulVec (T U)) j) |
| 827 | (hR : ∀ U, mask D (tailLabel N U) q x ≠ 0 → ∀ j, |((P U).matrix⁻¹.mulVec (R U)) j| ≤ d) |
| 828 | (hH : ∀ U, mask D (tailLabel N U) q x ≠ 0 → ∀ i j, |(P U).matrix i j| ≤ K) |
| 829 | (hscale : ∀ U, mask D (tailLabel N U) q x ≠ 0 → outer U ^ 2 * ε U ≤ Λ) (i : Fin 2) : |
| 830 | |doubleAverage (fun Y θ => signedRadial P hdet outer ε T R q x Y θ * |
| 831 | signedTangent P hdet outer ε T R q x i Y θ)| ≤ Λ * (2 * K * d ^ 2 / (4 * l)) := by |
| 832 | rw [assembled_signed_square sys hdet N hN P outer ε T R hq x hε i] |
| 833 | have heq : (fun U : UnsignedLabel => outer U ^ 2 * ε U * mask D (tailLabel N U) q x ^ 2 * |
| 834 | squareColumn (P U).matrix (T U) (R U) i) = |
| 835 | fun U => mask D (tailLabel N U) q x ^ 2 * |
| 836 | (outer U ^ 2 * ε U * squareColumn (P U).matrix (T U) (R U) i) := by |
| 837 | funext U |
| 838 | ring |
| 839 | rw [heq] |
| 840 | apply mask_average_bound D N hq hqN x |
| 841 | intro U hU |
| 842 | rw [abs_mul, abs_of_nonneg (mul_nonneg (sq_nonneg _) (hε U hU))] |
| 843 | exact mul_le_mul (hscale U hU) |
| 844 | (squareColumn_abs_bound (P U).matrix (T U) (R U) (hcone U hU) i hl hd hK (hY U hU) (hR U hU) (hH U hU i)) |
| 845 | (abs_nonneg _) hΛ |
| 846 | |
| 847 | /-! ## Smooth edge extension of the actual inverse amplitudes -/ |
| 848 | |
| 849 | section Edge |
| 850 | |
| 851 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 852 | |
| 853 | noncomputable def extendedIncrement (H : E × ℝ → Mat2) (T R : E × ℝ → Vec2) |
| 854 | (j : Fin 2) : E × ℝ → ℝ := |
| 855 | FlatZeroExtension.zeroExtension (fun p => ((H p)⁻¹.mulVec (R p)) j / |
| 856 | (2 * Real.sqrt (((H p)⁻¹.mulVec (T p)) j))) |
| 857 | |
| 858 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 859 | theorem extendedIncrement_of_pos (H : E × ℝ → Mat2) (T R : E × ℝ → Vec2) |
| 860 | (j : Fin 2) {p : E × ℝ} (hp : 0 < p.2) (hcone : SmoothCovariance.StrictCone (H p) (T p)) : |
| 861 | extendedIncrement H T R j p = increment (H p) (T p) (R p) j := by |
| 862 | rw [extendedIncrement, FlatZeroExtension.zeroExtension_of_pos _ hp, |
| 863 | increment_eq_inverse _ _ _ hcone j] |
| 864 | |
| 865 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 866 | theorem extendedIncrement_of_nonpos (H : E × ℝ → Mat2) (T R : E × ℝ → Vec2) |
| 867 | (j : Fin 2) {p : E × ℝ} (hp : p.2 ≤ 0) : extendedIncrement H T R j p = 0 := |
| 868 | FlatZeroExtension.zeroExtension_of_nonpos _ hp |
| 869 | |
| 870 | /-- Joint smoothness, every parameter jet, and zero tensors at the edge, |
| 871 | from actual inverse-solve derivatives and the primary's weighted lower bound. -/ |
| 872 | theorem extendedIncrement_regular {U : Set E} (hU : IsOpen U) {c : ℝ} (hc : 0 < c) |
| 873 | {H : E × ℝ → Mat2} {T R : E × ℝ → Vec2} {S : E × ℝ → ℝ} (j : Fin 2) |
| 874 | (hS : ∀ p ∈ WeightedQuotients.edgeStrip U, 1 ≤ S p) |
| 875 | (hscale : WeightedQuotients.LocallyBoundedScale U S) |
| 876 | (hH : ∀ i j, ContDiffOn ℝ ∞ (fun p => H p i j) (U ×ˢ Ioi 0)) |
| 877 | (hT : ∀ i, ContDiffOn ℝ ∞ (fun p => T p i) (U ×ˢ Ioi 0)) |
| 878 | (hR : ∀ i, ContDiffOn ℝ ∞ (fun p => R p i) (U ×ˢ Ioi 0)) |
| 879 | (hcone : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), SmoothCovariance.StrictCone (H p) (T p)) |
| 880 | (hlower : WeightedQuotients.PolyBound (WeightedQuotients.edgeStrip U) S (fun p => p.2⁻¹) |
| 881 | (fun p => FlatCutoff.edge c p.2 / ((H p)⁻¹.mulVec (T p)) j)) |
| 882 | (hYjets : WeightedQuotients.WeightedJets c U S (fun p => ((H p)⁻¹.mulVec (T p)) j)) |
| 883 | (hRjets : WeightedQuotients.WeightedJets c U S (fun p => ((H p)⁻¹.mulVec (R p)) j)) : |
| 884 | ContDiffOn ℝ ∞ (extendedIncrement H T R j) (U ×ˢ univ) ∧ |
| 885 | WeightedQuotients.WeightedJets (c / 2) U S (extendedIncrement H T R j) ∧ |
| 886 | ∀ m : ℕ, ∀ x ∈ U, iteratedFDeriv ℝ m (extendedIncrement H T R j) (x, 0) = 0 := by |
| 887 | have hp : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), 0 < ((H p)⁻¹.mulVec (T p)) j := |
| 888 | fun p hp => (amplitudes_are_inverse_weights (hcone p hp) j).1 |
| 889 | have hYs := SmoothCovariance.contDiffOn_inverse_solution hH hT |
| 890 | (fun p hp => (hcone p hp).det_ne_zero) j |
| 891 | have hRs := SmoothCovariance.contDiffOn_inverse_solution hH hR |
| 892 | (fun p hp => (hcone p hp).det_ne_zero) j |
| 893 | have he := WeightedQuotients.weighted_zero_extension hc hU hS hscale hp hYs hRs hlower hYjets hRjets |
| 894 | refine ⟨he.2.1, ?_, fun m x hx => (he.2.2 m x hx).2⟩ |
| 895 | have hj := (WeightedQuotients.weighted_half_jets hU hS hp hYs hRs hlower hYjets hRjets).2 |
| 896 | intro m |
| 897 | apply (hj m).mono |
| 898 | intro p hp |
| 899 | change ‖iteratedFDeriv ℝ m (FlatZeroExtension.zeroExtension _) p‖ / _ ≤ _ |
| 900 | rw [WeightedQuotients.jet_congr (FlatZeroExtension.zeroExtension_germ_pos _ hp.2.1) m] |
| 901 | |
| 902 | noncomputable def maskedExtendedIncrement (D : ℝ) (L : UnsignedLabel) |
| 903 | (q : E × ℝ → ℝ) (x : E × ℝ → SlotColoring.Position) |
| 904 | (H : E × ℝ → Mat2) (T R : E × ℝ → Vec2) (j : Fin 2) (p : E × ℝ) : ℝ := |
| 905 | mask D L (q p) (x p) * extendedIncrement H T R j p |
| 906 | |
| 907 | theorem physical_mask_smooth (D : ℝ) (L : UnsignedLabel) : |
| 908 | ContDiff ℝ ∞ (fun p : ℝ × SlotColoring.Position => mask D L p.1 p.2) := |
| 909 | ((SquaredPartition.dyadicMask_smooth (L.1 : ℤ)).comp contDiff_fst).mul |
| 910 | ((SquaredPartition.physicalSlowMask_smooth D L.1 L.2).comp contDiff_snd) |
| 911 | |
| 912 | theorem physical_mask_compactSupport (D : ℝ) (L : UnsignedLabel) (hL : 1 ≤ L.1) : |
| 913 | HasCompactSupport (fun p : ℝ × SlotColoring.Position => mask D L p.1 p.2) := by |
| 914 | have hc : IsCompact (tsupport (SquaredPartition.dyadicMask (L.1 : ℤ)) ×ˢ |
| 915 | tsupport (SquaredPartition.physicalSlowMask D L.1 L.2)) := |
| 916 | (SquaredPartition.dyadicMask_compactSupport _).prod |
| 917 | (SquaredPartition.physicalSlowMask_compactSupport D hL L.2) |
| 918 | apply hc.of_isClosed_subset isClosed_closure |
| 919 | apply closure_minimal _ hc.isClosed |
| 920 | intro p hp |
| 921 | change SquaredPartition.dyadicMask (L.1 : ℤ) p.1 * |
| 922 | SquaredPartition.physicalSlowMask D L.1 L.2 p.2 ≠ 0 at hp |
| 923 | exact ⟨subset_closure (mul_ne_zero_iff.mp hp).1, subset_closure (mul_ne_zero_iff.mp hp).2⟩ |
| 924 | |
| 925 | theorem masked_physical_coefficient_compactSupport (D : ℝ) (L : UnsignedLabel) (hL : 1 ≤ L.1) |
| 926 | (f : ℝ × SlotColoring.Position → ℝ) : |
| 927 | HasCompactSupport (fun p => mask D L p.1 p.2 * f p) := |
| 928 | (physical_mask_compactSupport D L hL).mul_right |
| 929 | |
| 930 | theorem masked_physical_coefficients_locallyFinite (D : ℝ) (N : ℕ) |
| 931 | (f : UnsignedLabel → Ioi (0 : ℝ) × SlotColoring.Position → ℝ) : |
| 932 | LocallyFinite (fun L => support (fun p : Ioi (0 : ℝ) × SlotColoring.Position => |
| 933 | mask D (tailLabel N L) p.1 p.2 * f L p)) := by |
| 934 | apply ((mask_locallyFinite D).comp_injective (tailLabel_injective N)).subset |
| 935 | intro L p hp |
| 936 | exact (mul_ne_zero_iff.mp hp).1 |
| 937 | |
| 938 | theorem masked_physical_jet_support (D : ℝ) (L : UnsignedLabel) |
| 939 | (f : ℝ × SlotColoring.Position → ℝ) (m : ℕ) : |
| 940 | tsupport (iteratedFDeriv ℝ m (fun p => mask D L p.1 p.2 * f p)) ⊆ |
| 941 | tsupport (fun p : ℝ × SlotColoring.Position => mask D L p.1 p.2) := by |
| 942 | apply (tsupport_iteratedFDeriv_subset m).trans |
| 943 | apply closure_mono |
| 944 | intro p hp |
| 945 | exact (mul_ne_zero_iff.mp hp).1 |
| 946 | |
| 947 | theorem maskedExtendedIncrement_smooth (D : ℝ) (L : UnsignedLabel) |
| 948 | {U : Set E} {q : E × ℝ → ℝ} {x : E × ℝ → SlotColoring.Position} |
| 949 | {H : E × ℝ → Mat2} {T R : E × ℝ → Vec2} (j : Fin 2) |
| 950 | (hq : ContDiffOn ℝ ∞ q (U ×ˢ univ)) (hx : ContDiffOn ℝ ∞ x (U ×ˢ univ)) |
| 951 | (he : ContDiffOn ℝ ∞ (extendedIncrement H T R j) (U ×ˢ univ)) : |
| 952 | ContDiffOn ℝ ∞ (maskedExtendedIncrement D L q x H T R j) (U ×ˢ univ) := |
| 953 | (((physical_mask_smooth D L).comp_contDiffOn (hq.prodMk hx)).mul he) |
| 954 | |
| 955 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 956 | /-- The signed update cannot create support outside the original mask or |
| 957 | on the zero side of the edge. Its inverse numerator also controls support. -/ |
| 958 | theorem maskedExtendedIncrement_support (D : ℝ) (L : UnsignedLabel) |
| 959 | (q : E × ℝ → ℝ) (x : E × ℝ → SlotColoring.Position) |
| 960 | (H : E × ℝ → Mat2) (T R : E × ℝ → Vec2) (j : Fin 2) : |
| 961 | support (maskedExtendedIncrement D L q x H T R j) ⊆ |
| 962 | {p | mask D L (q p) (x p) ≠ 0 ∧ 0 < p.2 ∧ ((H p)⁻¹.mulVec (R p)) j ≠ 0} := by |
| 963 | intro p hp |
| 964 | have hm := mul_ne_zero_iff.mp hp |
| 965 | refine ⟨hm.1, ?_, ?_⟩ |
| 966 | · by_contra hn |
| 967 | exact hm.2 (extendedIncrement_of_nonpos H T R j (le_of_not_gt hn)) |
| 968 | · intro hr |
| 969 | apply hm.2 |
| 970 | by_cases hδ : 0 < p.2 |
| 971 | · simp [extendedIncrement, FlatZeroExtension.zeroExtension_of_pos _ hδ, hr] |
| 972 | · exact extendedIncrement_of_nonpos H T R j (le_of_not_gt hδ) |
| 973 | |
| 974 | end Edge |
| 975 | |
| 976 | end NavierStokes.SignedCovariance |