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.BasePhaseGeometry |
| 2 | import NavierStokes.AlignedProfileSpectralCone |
| 3 | import NavierStokes.PrimaryGeometryAssembly |
| 4 | import NavierStokes.LocalSignedRequest |
| 5 | |
| 6 | /-! |
| 7 | # Actual primary covariance and the flat target |
| 8 | |
| 9 | The two columns use the two signs of the same representative and the |
| 10 | actual Volterra primary. Target smallness at the attachment points is |
| 11 | retained as a scalar factor throughout the finite matrix solve. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | open Set Filter Function Matrix |
| 17 | open scoped Topology ContDiff InnerProductSpace BigOperators |
| 18 | |
| 19 | namespace NavierStokes.PrimaryTargetBounds |
| 20 | |
| 21 | abbrev Plane := MovingFrameODE.Plane |
| 22 | abbrev Slow := PhaseCalculus.Slow |
| 23 | abbrev Mat2 := SmoothCovariance.Mat2 |
| 24 | abbrev Vec2 := SmoothCovariance.Vec2 |
| 25 | |
| 26 | |
| 27 | noncomputable def phaseSign (j : Fin 2) : ℝ := if j = 0 then 1 else -1 |
| 28 | |
| 29 | theorem phaseSign_abs (j : Fin 2) : |phaseSign j| = 1 := by |
| 30 | fin_cases j <;> norm_num [phaseSign] |
| 31 | |
| 32 | /-- The normal and transverse columns in the fixed physical tangent plane. -/ |
| 33 | noncomputable def basisMatrix (K : Plane) : Mat2 := |
| 34 | fun i j => if j = 0 then MovingFrameODE.quarterTurn K i else K i |
| 35 | |
| 36 | noncomputable def modelMatrix (c u : ℝ) (K : Plane) : Mat2 := |
| 37 | basisMatrix K * PulseCovariance.signedModel c u |
| 38 | |
| 39 | noncomputable def modelNormal (K T : Plane) : ℝ := -⟪T, MovingFrameODE.quarterTurn K⟫_ℝ |
| 40 | noncomputable def modelTransverse (K T : Plane) : ℝ := ⟪T, K⟫_ℝ |
| 41 | |
| 42 | theorem basisMatrix_det (K : Plane) (hK : ‖K‖ = 1) : (basisMatrix K).det = -1 := by |
| 43 | have hs := ViscousPropagator.plane_norm_sq K |
| 44 | rw [hK, one_pow] at hs |
| 45 | simp only [basisMatrix, Matrix.det_fin_two, ite_true, show (1 : Fin 2) ≠ 0 by decide, |
| 46 | ite_false] |
| 47 | change -K 1 * K 1 - K 0 * K 0 = -1 |
| 48 | nlinarith |
| 49 | |
| 50 | theorem modelMatrix_column (c u : ℝ) (K : Plane) (i j : Fin 2) : |
| 51 | modelMatrix c u K i j = |
| 52 | c * Real.sqrt (1 + u ^ 2) * MovingFrameODE.quarterTurn K i - phaseSign j * u * K i := by |
| 53 | fin_cases j <;> |
| 54 | simp [modelMatrix, basisMatrix, Matrix.mul_apply, Fin.sum_univ_two, |
| 55 | PulseCovariance.signedModel, PulseCovariance.modelDirection, PulseCovariance.signedSlopes, |
| 56 | PulseCovariance.radiusProfile, phaseSign] <;> ring |
| 57 | |
| 58 | theorem basisMatrix_target (K T : Plane) (hK : ‖K‖ = 1) : |
| 59 | (basisMatrix K).mulVec (Covariance.target (modelNormal K T) (modelTransverse K T)) = |
| 60 | (fun i => T i) := by |
| 61 | have hs := ViscousPropagator.plane_norm_sq K |
| 62 | rw [hK, one_pow] at hs |
| 63 | ext i |
| 64 | fin_cases i <;> |
| 65 | simp [basisMatrix, Covariance.target, modelNormal, modelTransverse, Matrix.mulVec, |
| 66 | dotProduct, Fin.sum_univ_two, PiLp.inner_apply, MovingFrameODE.quarterTurn] <;> |
| 67 | nlinarith [congrArg (fun x : ℝ => x * T 0) hs, congrArg (fun x : ℝ => x * T 1) hs] |
| 68 | |
| 69 | theorem weights_unique {H : Mat2} {T z : Vec2} (hd : H.det ≠ 0) (he : H.mulVec z = T) : |
| 70 | SmoothCovariance.weights H T = z := by |
| 71 | rw [← SmoothCovariance.inverse_formula H T hd, ← he, Matrix.mulVec_mulVec, |
| 72 | Matrix.nonsing_inv_mul H (isUnit_iff_ne_zero.mpr hd), Matrix.one_mulVec] |
| 73 | |
| 74 | theorem strictCone_mul_left {B H : Mat2} {T : Vec2} (hB : B.det ≠ 0) |
| 75 | (hH : SmoothCovariance.StrictCone H T) : |
| 76 | SmoothCovariance.StrictCone (B * H) (B.mulVec T) := by |
| 77 | have he : SmoothCovariance.weights (B * H) (B.mulVec T) = SmoothCovariance.weights H T := |
| 78 | weights_unique (by rw [Matrix.det_mul]; exact mul_ne_zero hB hH.det_ne_zero) |
| 79 | (by rw [← Matrix.mulVec_mulVec, SmoothCovariance.reconstruct H T hH.det_ne_zero]) |
| 80 | apply (SmoothCovariance.weights_pos_iff _ _).mp |
| 81 | intro j |
| 82 | rw [he] |
| 83 | exact hH.weights_pos j |
| 84 | |
| 85 | theorem modelMatrix_strictCone {c u eta : ℝ} {K T : Plane} |
| 86 | (hc : c < 0) (hu : 0 < u) (heta : 0 < eta) (hK : ‖K‖ = 1) |
| 87 | (hm : eta ≤ modelNormal K T) |
| 88 | (hr : |c * modelTransverse K T| ≤ |
| 89 | (PrimaryRepresentatives.slopeRatio u - eta) * modelNormal K T) : |
| 90 | SmoothCovariance.StrictCone (modelMatrix c u K) (fun i => T i) := by |
| 91 | have hmp : 0 < modelNormal K T := heta.trans_le hm |
| 92 | have hratio : |c * modelTransverse K T / modelNormal K T| < |
| 93 | u / Real.sqrt (1 + u ^ 2) := by |
| 94 | rw [abs_div, abs_of_pos hmp] |
| 95 | apply (div_lt_iff₀ hmp).mpr |
| 96 | have hh := mul_pos heta hmp |
| 97 | change |c * modelTransverse K T| < PrimaryRepresentatives.slopeRatio u * modelNormal K T |
| 98 | nlinarith |
| 99 | have hbase := PulseCovariance.signedModel_strictCone hc hu (Covariance.cone_of_ratio hmp hratio) |
| 100 | have hh := strictCone_mul_left (B := basisMatrix K) (by rw [basisMatrix_det K hK]; norm_num) hbase |
| 101 | rwa [basisMatrix_target K T hK] at hh |
| 102 | |
| 103 | abbrev ModelPoint := ℝ × (Plane × Plane) |
| 104 | |
| 105 | noncomputable def modelSet (M u eta : ℝ) : Set ModelPoint := |
| 106 | {p | p.1 ∈ Icc (-M) (-(1 / M)) ∧ ‖p.2.1‖ = 1 ∧ ‖p.2.2‖ = 1 ∧ |
| 107 | eta ≤ modelNormal p.2.1 p.2.2 ∧ |
| 108 | |p.1 * modelTransverse p.2.1 p.2.2| ≤ |
| 109 | (PrimaryRepresentatives.slopeRatio u - eta) * modelNormal p.2.1 p.2.2} |
| 110 | |
| 111 | theorem modelNormal_continuous : Continuous (fun p : ModelPoint => modelNormal p.2.1 p.2.2) := |
| 112 | ((continuous_snd.snd.inner (MovingFrameODE.quarterTurn.continuous.comp continuous_snd.fst))).neg |
| 113 | |
| 114 | theorem modelTransverse_continuous : Continuous (fun p : ModelPoint => modelTransverse p.2.1 p.2.2) := |
| 115 | continuous_snd.snd.inner continuous_snd.fst |
| 116 | |
| 117 | theorem modelSet_compact (M u eta : ℝ) : IsCompact (modelSet M u eta) := by |
| 118 | have hcomp : IsCompact ((Icc (-M) (-(1 / M))) ×ˢ |
| 119 | (Metric.sphere (0 : Plane) 1 ×ˢ Metric.sphere (0 : Plane) 1)) := |
| 120 | isCompact_Icc.prod ((isCompact_sphere 0 1).prod (isCompact_sphere 0 1)) |
| 121 | have hclosed : IsClosed {p : ModelPoint | eta ≤ modelNormal p.2.1 p.2.2 ∧ |
| 122 | |p.1 * modelTransverse p.2.1 p.2.2| ≤ |
| 123 | (PrimaryRepresentatives.slopeRatio u - eta) * modelNormal p.2.1 p.2.2} := |
| 124 | (isClosed_le continuous_const modelNormal_continuous).inter |
| 125 | (isClosed_le (continuous_fst.mul modelTransverse_continuous).abs |
| 126 | (continuous_const.mul modelNormal_continuous)) |
| 127 | convert! hcomp.inter_right hclosed using 1 |
| 128 | ext p |
| 129 | simp only [modelSet, Set.mem_ofPred_eq, mem_inter_iff, mem_prod, Metric.mem_sphere, |
| 130 | dist_zero_right] |
| 131 | tauto |
| 132 | |
| 133 | theorem modelMatrix_continuous (u : ℝ) (i j : Fin 2) : |
| 134 | Continuous (fun p : ModelPoint => modelMatrix p.1 u p.2.1 i j) := by |
| 135 | simp_rw [modelMatrix_column] |
| 136 | fun_prop |
| 137 | |
| 138 | theorem compact_model_data {M u eta : ℝ} (hM : 1 ≤ M) (hu : 0 < u) (heta : 0 < eta) : |
| 139 | (∀ i j, ContinuousOn (fun p : ModelPoint => modelMatrix p.1 u p.2.1 i j) (modelSet M u eta)) ∧ |
| 140 | (∀ i, ContinuousOn (fun p : ModelPoint => p.2.2 i) (modelSet M u eta)) ∧ |
| 141 | ∀ p ∈ modelSet M u eta, |
| 142 | SmoothCovariance.StrictCone (modelMatrix p.1 u p.2.1) (fun i => p.2.2 i) := by |
| 143 | refine ⟨fun i j => (modelMatrix_continuous u i j).continuousOn, |
| 144 | fun i => (show Continuous (fun p : ModelPoint => p.2.2 i) by fun_prop).continuousOn, ?_⟩ |
| 145 | intro p hp |
| 146 | have hc : p.1 < 0 := hp.1.2.trans_lt (neg_neg_of_pos (one_div_pos.mpr (zero_lt_one.trans_le hM))) |
| 147 | exact modelMatrix_strictCone hc hu heta hp.2.1 hp.2.2.2.1 hp.2.2.2.2 |
| 148 | |
| 149 | noncomputable def modelVector (c s : ℝ) (K : Plane) : Plane := |
| 150 | (-s) • K + (c * Real.sqrt (1 + s ^ 2)) • MovingFrameODE.quarterTurn K |
| 151 | |
| 152 | theorem modelVector_column (c u : ℝ) (K : Plane) (j i : Fin 2) : |
| 153 | modelVector c (phaseSign j * u) K i = modelMatrix c u K i j := by |
| 154 | have hs : (phaseSign j * u) ^ 2 = u ^ 2 := by |
| 155 | fin_cases j <;> simp [phaseSign] |
| 156 | rw [modelMatrix_column] |
| 157 | simp only [modelVector, PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, hs] |
| 158 | ring |
| 159 | |
| 160 | theorem modelVector_lipschitz (c s t : ℝ) (K : Plane) (hK : ‖K‖ = 1) : |
| 161 | ‖modelVector c s K - modelVector c t K‖ ≤ (|c| + 1) * |s - t| := by |
| 162 | have he : modelVector c s K - modelVector c t K = |
| 163 | (t-s) • K + (c * (PulseCovariance.radiusProfile s - PulseCovariance.radiusProfile t)) • |
| 164 | MovingFrameODE.quarterTurn K := by |
| 165 | unfold modelVector PulseCovariance.radiusProfile |
| 166 | module |
| 167 | rw [he] |
| 168 | calc |
| 169 | _ ≤ ‖(t-s) • K‖ + ‖(c * (PulseCovariance.radiusProfile s - PulseCovariance.radiusProfile t)) • |
| 170 | MovingFrameODE.quarterTurn K‖ := norm_add_le _ _ |
| 171 | _ = |s-t| + |c| * |PulseCovariance.radiusProfile s - PulseCovariance.radiusProfile t| := by |
| 172 | simp only [norm_smul, Real.norm_eq_abs, hK, PhaseEstimates.quarterTurn_norm, mul_one, abs_mul, |
| 173 | abs_sub_comm t s] |
| 174 | _ ≤ |s-t| + |c| * |s-t| := add_le_add_right |
| 175 | (mul_le_mul_of_nonneg_left (PulseCovariance.radiusProfile_lipschitz s t) (abs_nonneg c)) _ |
| 176 | _ = _ := by ring |
| 177 | |
| 178 | theorem frame_combination_error (k K : Plane) (hk : ‖k‖ = 1) (a b a0 b0 : ℝ) : |
| 179 | ‖a • k + b • MovingFrameODE.quarterTurn k - |
| 180 | (a0 • K + b0 • MovingFrameODE.quarterTurn K)‖ ≤ |
| 181 | |a-a0| + |b-b0| + (|a0| + |b0|) * ‖k-K‖ := by |
| 182 | have he : a • k + b • MovingFrameODE.quarterTurn k - |
| 183 | (a0 • K + b0 • MovingFrameODE.quarterTurn K) = |
| 184 | ((a-a0) • k + (b-b0) • MovingFrameODE.quarterTurn k) + |
| 185 | (a0 • (k-K) + b0 • MovingFrameODE.quarterTurn (k-K)) := by |
| 186 | rw [map_sub] |
| 187 | module |
| 188 | rw [he] |
| 189 | calc |
| 190 | _ ≤ ‖(a-a0) • k + (b-b0) • MovingFrameODE.quarterTurn k‖ + |
| 191 | ‖a0 • (k-K) + b0 • MovingFrameODE.quarterTurn (k-K)‖ := norm_add_le _ _ |
| 192 | _ ≤ (‖(a-a0) • k‖ + ‖(b-b0) • MovingFrameODE.quarterTurn k‖) + |
| 193 | (‖a0 • (k-K)‖ + ‖b0 • MovingFrameODE.quarterTurn (k-K)‖) := |
| 194 | add_le_add (norm_add_le _ _) (norm_add_le _ _) |
| 195 | _ = _ := by |
| 196 | simp only [norm_smul, Real.norm_eq_abs, PhaseEstimates.quarterTurn_norm, hk, mul_one] |
| 197 | ring |
| 198 | |
| 199 | theorem tangent_ratio_error {n : MovingFrameODE.Space} {K : Plane} {B s delta r h : ℝ} |
| 200 | (hB : 0 < B) (hK : ‖K‖ = 1) (hd : delta ≤ B / 2) |
| 201 | (hn : ‖n - MovingFrameODE.pack (B*s) (B • K)‖ ≤ delta) : |
| 202 | ‖(-MovingFrameODE.radialSlope n) • MovingFrameODE.normalDirection n + |
| 203 | r • MovingFrameODE.quarterTurn (MovingFrameODE.normalDirection n) - |
| 204 | ((-s) • K + h • MovingFrameODE.quarterTurn K)‖ ≤ |
| 205 | (2 * (1 + |s|) + 4 * (|s| + |h|)) * delta / B + |r-h| := by |
| 206 | have hne := (PhaseEstimates.normal_lower_bounds hB hK hd hn).2.2.1 |
| 207 | have he := frame_combination_error (MovingFrameODE.normalDirection n) K |
| 208 | (MovingFrameODE.normalDirection_unit hne) (-MovingFrameODE.radialSlope n) r (-s) h |
| 209 | have hs := PhaseEstimates.radialSlope_close hB hK hd hn |
| 210 | have hk := PhaseEstimates.normalDirection_close hB hK hd hn |
| 211 | have hss : |-MovingFrameODE.radialSlope n - -s| = |MovingFrameODE.radialSlope n - s| := by |
| 212 | rw [← abs_neg] |
| 213 | congr 1 |
| 214 | ring |
| 215 | rw [hss, abs_neg] at he |
| 216 | calc |
| 217 | _ ≤ |MovingFrameODE.radialSlope n - s| + |r-h| + |
| 218 | (|s| + |h|) * ‖MovingFrameODE.normalDirection n-K‖ := he |
| 219 | _ ≤ 2 * (1 + |s|) * delta / B + |r-h| + (|s| + |h|) * (4*delta/B) := |
| 220 | add_le_add (add_le_add_left hs _) (mul_le_mul_of_nonneg_left hk (by positivity)) |
| 221 | _ = _ := by ring |
| 222 | |
| 223 | noncomputable def pulseRatio (d : PrimaryODE.FrameData Slow) (lam u L : ℝ) (p : Slow) (v : ℝ) : Plane := |
| 224 | !₂[PrimaryPulseBounds.normalizedPulse d lam u L (p, v/L) 1 / |
| 225 | PrimaryPulseBounds.normalizedPulse d lam u L (p, v/L) 0, |
| 226 | PrimaryPulseBounds.normalizedPulse d lam u L (p, v/L) 2 / |
| 227 | PrimaryPulseBounds.normalizedPulse d lam u L (p, v/L) 0] |
| 228 | |
| 229 | theorem pulseRatio_eq (d : PrimaryODE.FrameData Slow) (lam u : ℝ) {L : ℝ} (hL : 0 < L) |
| 230 | {U : Set Slow} (hA : ContinuousOn (d.coefficient 1) (U ×ˢ Icc 0 L)) |
| 231 | {p : Slow} (hp : p ∈ U) {v : ℝ} (hv : v ∈ Icc 0 L) |
| 232 | (hx : PrimaryODE.radialPrimary hL.le d |
| 233 | (fun z => PrimaryPulseBounds.referenceP lam u L z.2) p v ≠ 0) : |
| 234 | pulseRatio d lam u L p v = |
| 235 | (-d.rho (p,v)) • d.frame (p,v) 0 + |
| 236 | (PrimaryODE.transversePrimary hL.le d (fun z => PrimaryPulseBounds.referenceP lam u L z.2) p v / |
| 237 | PrimaryODE.radialPrimary hL.le d (fun z => PrimaryPulseBounds.referenceP lam u L z.2) p v) • |
| 238 | d.frame (p,v) 1 := by |
| 239 | have hLv : L * (v / L) = v := by field_simp |
| 240 | unfold pulseRatio PrimaryPulseBounds.normalizedPulse |
| 241 | rw [hLv, PrimaryPulseBounds.fundamental_eq_primary hL U hA hp hv] |
| 242 | ext i |
| 243 | fin_cases i <;> |
| 244 | simp [PrimaryODE.FrameData.ambient, MovingFrameODE.tangent, MovingFrameODE.pack, |
| 245 | PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, PrimaryODE.radialPrimary, |
| 246 | PrimaryODE.transversePrimary] at * <;> |
| 247 | field_simp |
| 248 | |
| 249 | noncomputable def geometricRatioConstant (M u : ℝ) : ℝ := |
| 250 | (2 * (1 + 3*M) + 4 * (3*M + BasePhaseGeometry.eigenBound M)) * |
| 251 | BasePhaseGeometry.phaseConstant M / BasePhaseGeometry.normalLower M u |
| 252 | |
| 253 | noncomputable def ratioConstant (M u gap : ℝ) : ℝ := |
| 254 | geometricRatioConstant M u + 4 * BasePhaseGeometry.eigenBound M * |
| 255 | GrowingMode.coneConstant gap (BasePhaseGeometry.modalConstant M u) |
| 256 | |
| 257 | theorem geometricRatioConstant_nonneg {M u : ℝ} (hM : 1 ≤ M) : 0 ≤ geometricRatioConstant M u := by |
| 258 | have hnormal := (BasePhaseGeometry.normalLower_pos (u := u) hM).le |
| 259 | have hp := (BasePhaseGeometry.phaseConstant_pos hM).le |
| 260 | have hM0 : 0 ≤ M := zero_le_one.trans hM |
| 261 | unfold geometricRatioConstant BasePhaseGeometry.eigenBound |
| 262 | positivity |
| 263 | |
| 264 | theorem ratioConstant_nonneg {M u gap : ℝ} (hM : 1 ≤ M) (hgap : 0 < gap) : |
| 265 | 0 ≤ ratioConstant M u gap := by |
| 266 | have hg := geometricRatioConstant_nonneg (u := u) hM |
| 267 | have hC := (BasePhaseGeometry.error_constants_nonneg (u := u) hM).2.1 |
| 268 | have hM0 : 0 ≤ M := zero_le_one.trans hM |
| 269 | unfold ratioConstant GrowingMode.coneConstant BasePhaseGeometry.eigenBound |
| 270 | positivity |
| 271 | |
| 272 | theorem signedSlot_center {u L : ℝ} (hu : 0 ≤ u) (hL : 0 < L) |
| 273 | (j : Fin 2) (v : ℝ) : |
| 274 | |PhaseEstimates.signedSlot (phaseSign j) u L v - phaseSign j * u| = |
| 275 | u * |v - L / 2| / L := by |
| 276 | have he : PhaseEstimates.signedSlot (phaseSign j) u L v - phaseSign j * u = |
| 277 | phaseSign j * u * (v-L/2) / L := by |
| 278 | unfold PhaseEstimates.signedSlot |
| 279 | field_simp ; ring |
| 280 | rw [he, abs_div, abs_mul, abs_mul, phaseSign_abs, one_mul, abs_of_nonneg hu, |
| 281 | abs_of_pos hL] |
| 282 | |
| 283 | section FamilyRatio |
| 284 | |
| 285 | open BasePhaseGeometry |
| 286 | |
| 287 | variable {ι : Type*} {D : PhaseJetBounds.Domain ι Slow} {h r0 u M : ℝ} |
| 288 | (a : FamilyData D h r0 u M) |
| 289 | (hh : 0 ≤ h) (hr : 0 < r0) (hM : 1 ≤ M) (hu : 0 < u) (huM : u ≤ M) |
| 290 | (hL : 1 / (2 * r0) ≤ M) (hslot : 4 * r0 * ChartScales.Tg ≤ M) |
| 291 | (hlarge : ∀ i, LargeBand h M u (a.band i)) |
| 292 | |
| 293 | include hh hr hM hu huM hL hslot hlarge |
| 294 | |
| 295 | theorem coefficient_continuous (i : ι) : |
| 296 | ContinuousOn ((a.frame i).coefficient 1) (D.carrier i ×ˢ Icc 0 (a.length i)) := |
| 297 | ((a.coefficient_jets hh hr hM hu huM hL hslot hlarge 1).smooth i).continuousOn.mono |
| 298 | (fun _ hz => ⟨hz.1, a.interval_subset_slot hr i hz.2⟩) |
| 299 | |
| 300 | theorem primary_ratio_error (i : ι) {p : Slow} (hp : p ∈ D.carrier i) |
| 301 | {gap : ℝ} (hgap : 0 < gap) |
| 302 | (hg : ∀ v ∈ Icc 0 (a.length i), |
| 303 | gap ≤ ViscousPropagator.referenceEigenvalue (a.lam i) u (a.length i) v) |
| 304 | (hcone : 2 * GrowingMode.coneConstant gap (modalConstant M u) ≤ D.scale i) |
| 305 | {v : ℝ} (hv : v ∈ Icc 0 (a.length i)) : |
| 306 | ‖pulseRatio (a.frame i) (a.lam i) u (a.length i) p v - |
| 307 | modelVector (a.c0 i) (a.slope i (p,v)) (a.K i)‖ ≤ ratioConstant M u gap / D.scale i := by |
| 308 | have hlength := a.length_pos hr i |
| 309 | have hS : 0 < D.scale i := zero_lt_one.trans_le (D.one_le_scale i) |
| 310 | have hc := a.coefficientControl hh hr hM hu huM hL hslot i (hlarge i) hp |
| 311 | have hA := coefficient_continuous a hh hr hM hu huM hL hslot hlarge i |
| 312 | have hslotL : a.length i ≤ (2*r0*ChartScales.Tg) * D.scale i := by |
| 313 | simpa only [FamilyData.length, a.scale_eq i, mul_assoc] using |
| 314 | (ChartScales.slotLength_bounds r0 h hr.le hh (hlarge i).four_le).2 |
| 315 | have hP (t : ℝ) (_ht : t ∈ Icc 0 (a.length i)) := |
| 316 | PrimaryPulseBounds.referenceP_pos (a.lam i) u (a.length i) t |
| 317 | have hPeq (t : ℝ) (ht : t ∈ Icc 0 (a.length i)) : |
| 318 | HasDerivAt (PrimaryPulseBounds.referenceP (a.lam i) u (a.length i)) |
| 319 | (((a.frame i).eigenvalue (p,t) - ViscousPropagator.referenceViscosity (a.lam i) u (a.length i) t) * |
| 320 | PrimaryPulseBounds.referenceP (a.lam i) u (a.length i) t) t := by |
| 321 | rw [hc.eigenvalue t ht] |
| 322 | exact PrimaryPulseBounds.referenceP_hasDerivAt _ _ _ _ |
| 323 | have herrors := error_constants_nonneg (u := u) hM |
| 324 | have hprimary := PrimaryODE.primary_bounds hlength.le (a.frame i) |
| 325 | (fun z => PrimaryPulseBounds.referenceP (a.lam i) u (a.length i) z.2) |
| 326 | hA hp hgap herrors.2.1 herrors.2.2 hS hcone (by simpa using hslotL) |
| 327 | (ViscousPropagator.referenceViscosity (a.lam i) u (a.length i)) |
| 328 | (fun t ht => by rw [hc.eigenvalue t ht]; exact hg t ht) |
| 329 | hc.errors hc.viscosity hP hPeq v hv |
| 330 | have hv' := a.interval_subset_slot hr i hv |
| 331 | have hnormal := (a.phase_estimates hh hr hM (by simpa only [abs_of_pos hu] using huM) |
| 332 | hL hslot i (hlarge i) hp hv').1 |
| 333 | have hsmall := a.phase_error_small hh hM i (hlarge i) |
| 334 | have hB := a.B_pos hh hM i |
| 335 | have hne := (PhaseEstimates.normal_lower_bounds hB (a.unit i) hsmall hnormal).2.2.1 |
| 336 | have hs := a.slope_bound hr hu.le huM (q := p) hv' |
| 337 | have hprof := reference_profile_bounds (one_div_pos.mpr (zero_lt_one.trans_le hM)) |
| 338 | (a.ratio_bound i).1 (a.ratio_bound i).2 (a.magnitude_bound hr hu.le huM hv') |
| 339 | have hH : |PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v| ≤ eigenBound M := |
| 340 | hprof.1.trans (by unfold eigenBound; nlinarith [show 0 ≤ M by linarith]) |
| 341 | have hgeom := tangent_ratio_error hB (a.unit i) hsmall hnormal |
| 342 | (r := PrimaryODE.transversePrimary hlength.le (a.frame i) |
| 343 | (fun z => PrimaryPulseBounds.referenceP (a.lam i) u (a.length i) z.2) p v / |
| 344 | PrimaryODE.radialPrimary hlength.le (a.frame i) |
| 345 | (fun z => PrimaryPulseBounds.referenceP (a.lam i) u (a.length i) z.2) p v) |
| 346 | (h := PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v) |
| 347 | have hsq : (a.slope i (p,v))^2 = PulseGrowth.slotMagnitude u (a.length i) v ^ 2 := |
| 348 | signedSlot_sq (a.sign i) u (a.length i) v |
| 349 | have hprofile : PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v = |
| 350 | a.c0 i * Real.sqrt (1 + (a.slope i (p,v))^2) := by |
| 351 | rw [hsq] |
| 352 | rfl |
| 353 | have he : pulseRatio (a.frame i) (a.lam i) u (a.length i) p v - |
| 354 | modelVector (a.c0 i) (a.slope i (p,v)) (a.K i) = |
| 355 | (-MovingFrameODE.radialSlope (a.phase.normal i (p,v))) • |
| 356 | MovingFrameODE.normalDirection (a.phase.normal i (p,v)) + |
| 357 | (PrimaryODE.transversePrimary hlength.le (a.frame i) |
| 358 | (fun z => PrimaryPulseBounds.referenceP (a.lam i) u (a.length i) z.2) p v / |
| 359 | PrimaryODE.radialPrimary hlength.le (a.frame i) |
| 360 | (fun z => PrimaryPulseBounds.referenceP (a.lam i) u (a.length i) z.2) p v) • |
| 361 | MovingFrameODE.quarterTurn (MovingFrameODE.normalDirection (a.phase.normal i (p,v))) - |
| 362 | ((-a.slope i (p,v)) • a.K i + |
| 363 | PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v • MovingFrameODE.quarterTurn (a.K i)) := by |
| 364 | rw [pulseRatio_eq (a.frame i) (a.lam i) u hlength hA hp hv hprimary.1.ne'] |
| 365 | simp only [FamilyData.frame, PhaseJetBounds.PhaseFamily.frameData, PrimaryODE.FrameData.ofNormalLocal, |
| 366 | PrimaryODE.localFrame_eq hne, MovingFrameODE.normalFrame_zero, MovingFrameODE.normalFrame_one] |
| 367 | rw [hprofile] |
| 368 | rfl |
| 369 | rw [he] |
| 370 | apply hgeom.trans |
| 371 | have hBmin := (a.B_bounds hh hM i).1 |
| 372 | have hcoef : 0 ≤ 2*(1+3*M)+4*(3*M+eigenBound M) := by unfold eigenBound; positivity |
| 373 | have hph : 0 ≤ phaseConstant M / D.scale i := div_nonneg (phaseConstant_pos hM).le hS.le |
| 374 | have hgeometric : |
| 375 | (2*(1+|a.slope i (p,v)|)+4*(|a.slope i (p,v)|+ |
| 376 | |PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v|)) * |
| 377 | (phaseConstant M / D.scale i) / a.B i ≤ geometricRatioConstant M u / D.scale i := by |
| 378 | calc |
| 379 | _ ≤ (2*(1+3*M)+4*(3*M+eigenBound M)) * (phaseConstant M / D.scale i) / a.B i := |
| 380 | div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (by linarith) hph) hB.le |
| 381 | _ ≤ (2*(1+3*M)+4*(3*M+eigenBound M)) * (phaseConstant M / D.scale i) / normalLower M u := |
| 382 | div_le_div_of_nonneg_left (mul_nonneg hcoef hph) (normalLower_pos hM) hBmin |
| 383 | _ = _ := by unfold geometricRatioConstant; ring |
| 384 | have hconeNonneg : 0 ≤ GrowingMode.coneConstant gap (modalConstant M u) := by |
| 385 | unfold GrowingMode.coneConstant |
| 386 | exact div_nonneg (mul_nonneg (by norm_num) (by linarith [herrors.2.1])) hgap.le |
| 387 | have hratiobound := hprimary.2.2.2 |
| 388 | change |PrimaryODE.transversePrimary _ _ _ _ _ / PrimaryODE.radialPrimary _ _ _ _ _ - |
| 389 | PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v| ≤ _ at hratiobound |
| 390 | have hratiobound' := hratiobound.trans (mul_le_mul_of_nonneg_right |
| 391 | (show 4 * |PrimaryODE.referenceProfile (a.c0 i) u (a.length i) v| ≤ 4 * eigenBound M by linarith) |
| 392 | (div_nonneg hconeNonneg hS.le)) |
| 393 | exact (add_le_add hgeometric hratiobound').trans_eq (by unfold ratioConstant; ring) |
| 394 | |
| 395 | /-- The actual uncut primary is compared with the central signed model. |
| 396 | The two errors have the concentration-compatible orders `1/L` and |
| 397 | `|v-L/2|/L`; no covariance convergence is a hypothesis. -/ |
| 398 | theorem primary_center_error (i : ι) (j : Fin 2) (hsign : a.sigma i = phaseSign j) |
| 399 | {p : Slow} (hp : p ∈ D.carrier i) {gap : ℝ} (hgap : 0 < gap) |
| 400 | (hg : ∀ v ∈ Icc 0 (a.length i), |
| 401 | gap ≤ ViscousPropagator.referenceEigenvalue (a.lam i) u (a.length i) v) |
| 402 | (hcone : 2 * GrowingMode.coneConstant gap (modalConstant M u) ≤ D.scale i) |
| 403 | {v : ℝ} (hv : v ∈ Icc 0 (a.length i)) (k : Fin 2) : |
| 404 | |PrimaryPulseBounds.normalizedPulse (a.frame i) (a.lam i) u (a.length i) |
| 405 | (p,v / a.length i) k.succ / |
| 406 | PrimaryPulseBounds.normalizedPulse (a.frame i) (a.lam i) u (a.length i) |
| 407 | (p,v / a.length i) 0 - modelMatrix (a.c0 i) u (a.K i) k j| ≤ |
| 408 | ((2*r0*ChartScales.Tg) * ratioConstant M u gap) / a.length i + |
| 409 | ((M+1)*u) * |v-a.length i/2| / a.length i := by |
| 410 | have hlength := a.length_pos hr i |
| 411 | have hS : 0 < D.scale i := zero_lt_one.trans_le (D.one_le_scale i) |
| 412 | have hslotL : a.length i ≤ (2*r0*ChartScales.Tg) * D.scale i := by |
| 413 | simpa only [FamilyData.length, a.scale_eq i, mul_assoc] using |
| 414 | (ChartScales.slotLength_bounds r0 h hr.le hh (hlarge i).four_le).2 |
| 415 | have hratio := primary_ratio_error a hh hr hM hu huM hL hslot hlarge i hp hgap hg hcone hv |
| 416 | have hslope : |a.slope i (p,v) - phaseSign j*u| = u*|v-a.length i/2|/a.length i := by |
| 417 | simpa only [FamilyData.slope, hsign] using signedSlot_center hu.le hlength j v |
| 418 | have hmodel := modelVector_lipschitz (a.c0 i) (a.slope i (p,v)) (phaseSign j*u) (a.K i) (a.unit i) |
| 419 | rw [hslope] at hmodel |
| 420 | have hbound : ‖pulseRatio (a.frame i) (a.lam i) u (a.length i) p v - |
| 421 | modelVector (a.c0 i) (phaseSign j*u) (a.K i)‖ ≤ |
| 422 | ratioConstant M u gap / D.scale i + ((M+1)*u)*|v-a.length i/2|/a.length i := by |
| 423 | apply (norm_sub_le_norm_sub_add_norm_sub _ _ _).trans |
| 424 | apply add_le_add hratio |
| 425 | apply hmodel.trans |
| 426 | calc |
| 427 | _ ≤ (M+1) * (u*|v-a.length i/2|/a.length i) := |
| 428 | mul_le_mul_of_nonneg_right (by linarith [(a.ratio_bound i).2]) (by positivity) |
| 429 | _ = _ := by ring |
| 430 | have hratioL : ratioConstant M u gap / D.scale i ≤ |
| 431 | ((2*r0*ChartScales.Tg) * ratioConstant M u gap) / a.length i := by |
| 432 | apply (div_le_div_iff₀ hS hlength).mpr |
| 433 | nlinarith [mul_le_mul_of_nonneg_left hslotL (ratioConstant_nonneg (u := u) hM hgap)] |
| 434 | have hcomponent := (PiLp.norm_apply_le |
| 435 | (pulseRatio (a.frame i) (a.lam i) u (a.length i) p v - |
| 436 | modelVector (a.c0 i) (phaseSign j*u) (a.K i)) k) |
| 437 | have he : (pulseRatio (a.frame i) (a.lam i) u (a.length i) p v - |
| 438 | modelVector (a.c0 i) (phaseSign j*u) (a.K i)) k = |
| 439 | PrimaryPulseBounds.normalizedPulse (a.frame i) (a.lam i) u (a.length i) |
| 440 | (p,v / a.length i) k.succ / |
| 441 | PrimaryPulseBounds.normalizedPulse (a.frame i) (a.lam i) u (a.length i) |
| 442 | (p,v / a.length i) 0 - modelMatrix (a.c0 i) u (a.K i) k j := by |
| 443 | rw [PiLp.sub_apply, modelVector_column] |
| 444 | fin_cases k <;> rfl |
| 445 | rw [he, Real.norm_eq_abs] at hcomponent |
| 446 | exact hcomponent.trans (hbound.trans (add_le_add_left hratioL _)) |
| 447 | |
| 448 | end FamilyRatio |
| 449 | |
| 450 | section FamilyPair |
| 451 | |
| 452 | open BasePhaseGeometry PrimaryCovarianceBounds |
| 453 | |
| 454 | variable {ι : Type*} {D : PhaseJetBounds.Domain ι Slow} {h r0 u M : ℝ} |
| 455 | |
| 456 | /-- The two signs share the same actual representative. -/ |
| 457 | structure CompatiblePair (a : Fin 2 → FamilyData D h r0 u M) : Prop where |
| 458 | band : ∀ j i, (a j).band i = (a 0).band i |
| 459 | ratio : ∀ j i, (a j).c0 i = (a 0).c0 i |
| 460 | transverse : ∀ j i, (a j).K i = (a 0).K i |
| 461 | sign : ∀ j i, (a j).sigma i = phaseSign j |
| 462 | |
| 463 | /-- The native finite covariance with the original joint label. -/ |
| 464 | noncomputable def familyCovariance (vr vt : TorusInverse.Plane) |
| 465 | (a : Fin 2 → FamilyData D h r0 u M) (i : ι) (p : Slow) : Mat2 := |
| 466 | PrimaryPulseBounds.primaryCovariance |
| 467 | (fun j i => PartitionedCovariance.nativePrefactor vr vt r0 * |
| 468 | ChartScales.timeCoefficient h ((a j).band i) * (a j).length i) |
| 469 | (fun j => (a j).frame) (fun j => (a j).lam) (fun _ _ => u) |
| 470 | (fun j => (a j).length) i p |
| 471 | |
| 472 | theorem familyCovariance_eq_native (vr vt : TorusInverse.Plane) |
| 473 | (a : Fin 2 → FamilyData D h r0 u M) (hc : CompatiblePair a) (i : ι) (p : Slow) : |
| 474 | familyCovariance vr vt a i p = nativePrimaryCovariance vr vt r0 h |
| 475 | (fun j _ => (a j).frame i) (fun j _ => (a j).lam i) (fun _ _ => u) |
| 476 | ((a 0).band i) p := by |
| 477 | unfold familyCovariance nativePrimaryCovariance PrimaryPulseBounds.primaryCovariance |
| 478 | ext r c |
| 479 | change _ * _ = _ * _ |
| 480 | simp only [FamilyData.length, hc.band] |
| 481 | |
| 482 | /-- Uniform finite-matrix bounds follow from the actual constructed |
| 483 | phases and their ODEs. The model point only records the common |
| 484 | representative and a unit target direction. -/ |
| 485 | theorem exists_family_bounds (vr vt : TorusInverse.Plane) |
| 486 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) |
| 487 | (hh : 0 ≤ h) (hr : 0 < r0) (hM : 1 ≤ M) (hu : 0 < u) (huM : u ≤ M) |
| 488 | (hL : 1 / (2*r0) ≤ M) (hslot : 4*r0*ChartScales.Tg ≤ M) |
| 489 | {eta : ℝ} (heta : 0 < eta) : |
| 490 | ∃ N : ℕ, 4 ≤ N ∧ ∃ detGap entryBound inverseLower : ℝ, |
| 491 | 0 < detGap ∧ 1 ≤ entryBound ∧ 0 < inverseLower ∧ |
| 492 | ∀ (ι : Type*) (D : PhaseJetBounds.Domain ι Slow) |
| 493 | (a : Fin 2 → FamilyData D h r0 u M), CompatiblePair a → |
| 494 | (∀ j i, LargeBand h M u ((a j).band i)) → |
| 495 | ∀ i : ι, N ≤ (a 0).band i → ∀ p ∈ D.carrier i, ∀ T : Plane, |
| 496 | ((a 0).c0 i, (a 0).K i, T) ∈ modelSet M u eta → |
| 497 | ∀ zeta : ℝ, 0 ≤ zeta → |
| 498 | ZeroOrderBounds (Real.sqrt (ChartScales.S ((a 0).band i))) |
| 499 | detGap entryBound inverseLower zeta (familyCovariance vr vt a i p) |
| 500 | (FlatCovariance.scaledTarget zeta (fun k => T k)) := by |
| 501 | let R : Set (ℝ × ℝ) := Icc (1/M) M ×ˢ {u} |
| 502 | have hR : IsCompact R := isCompact_Icc.prod (isCompact_singleton) |
| 503 | obtain ⟨gap, b, B, hgap, hb, hB, href⟩ := compact_reference_bounds hR |
| 504 | Prod.fst Prod.snd continuous_fst.continuousOn continuous_snd.continuousOn |
| 505 | (fun z hz => (one_div_pos.mpr (zero_lt_one.trans_le hM)).trans_le hz.1.1) |
| 506 | (fun z hz => by simpa only [mem_singleton_iff.mp hz.2] using hu) |
| 507 | let Kslot := 2*r0*ChartScales.Tg |
| 508 | let Clo := primaryLower (modalConstant M u) (dampingConstant M) Kslot |
| 509 | let Chi := primaryUpper (modalConstant M u) (dampingConstant M) Kslot |
| 510 | have herrors := error_constants_nonneg (u := u) hM |
| 511 | have hKslot : 0 ≤ Kslot := mul_nonneg (mul_nonneg (by norm_num) hr.le) ChartScales.Tg_pos.le |
| 512 | have hE : 0 ≤ Kslot * ratioConstant M u gap := |
| 513 | mul_nonneg hKslot (ratioConstant_nonneg hM hgap) |
| 514 | have hF : 0 ≤ (M+1)*u := by positivity |
| 515 | obtain ⟨hH0, hT0, hcone⟩ := compact_model_data hM hu heta |
| 516 | obtain ⟨N0, hN04, detGap, entryBound, inverseLower, hd, he, hi, hpair⟩ := |
| 517 | compact_chart_pair_bounds (modelSet_compact M u eta) |
| 518 | (fun p => modelMatrix p.1 u p.2.1) (fun p k => p.2.2 k) hH0 hT0 hcone vr vt hdet |
| 519 | (B := B) hr hh (primaryLower_pos _ _ _) (primaryUpper_pos _ _ _) hb hE hF |
| 520 | obtain ⟨N1, hN14, hN1⟩ := eventually_slow_large (2*GrowingMode.coneConstant gap (modalConstant M u)) |
| 521 | obtain ⟨N2, hN24, hN2⟩ := eventually_slotRadius_large hr hh 1 |
| 522 | refine ⟨max N0 (max N1 N2), hN04.trans (le_max_left _ _), |
| 523 | detGap, entryBound, inverseLower, hd, he, hi, ?_⟩ |
| 524 | intro ι D a hc hlarge i hn p hp T hT zeta hzeta |
| 525 | have hn0 : N0 ≤ (a 0).band i := (le_max_left _ _).trans hn |
| 526 | have hn1 : N1 ≤ (a 0).band i := (le_max_left _ _).trans ((le_max_right _ _).trans hn) |
| 527 | have hn2 : N2 ≤ (a 0).band i := (le_max_right _ _).trans ((le_max_right _ _).trans hn) |
| 528 | have hn4 := hN04.trans hn0 |
| 529 | have hlength (j : Fin 2) : (a j).length i = ChartScales.slotLength r0 h ((a 0).band i) := by |
| 530 | simp only [FamilyData.length, hc.band] |
| 531 | have hS : 0 < D.scale i := zero_lt_one.trans_le (D.one_le_scale i) |
| 532 | have hA (j : Fin 2) := coefficient_continuous (a j) hh hr hM hu huM hL hslot (hlarge j) i |
| 533 | have hk (j : Fin 2) := (a j).kinematics hh hr hM |
| 534 | (by simpa only [abs_of_pos hu] using huM) hL hslot i (hlarge j i) hp |
| 535 | have href (j : Fin 2) := href ((a j).lam i,u) ⟨(a j).lambda_bound i, rfl⟩ |
| 536 | ((a j).length i) ((a j).length_pos hr i) |
| 537 | have hconeS : 2*GrowingMode.coneConstant gap (modalConstant M u) ≤ D.scale i := by |
| 538 | rw [(a 0).scale_eq i] |
| 539 | exact hN1 _ hn1 |
| 540 | let P : Fin 2 → PartitionedCovariance.Pulse := fun j => |
| 541 | PrimaryPulseBounds.canonicalPrimaryPulse ((a j).frame i) ((a j).lam i) u |
| 542 | ((a j).length_pos hr i) (D.carrier i) (hA j) p hp (hk j) |
| 543 | have hPulse (j : Fin 2) : PulseCovariance.PulseBounds (slotRadius r0 h ((a 0).band i)) |
| 544 | Clo Chi b B (P j).ψ (P j).x := by |
| 545 | have hcoeff := (a j).coefficientControl hh hr hM hu huM hL hslot i (hlarge j i) hp |
| 546 | apply canonicalPrimaryPulse_bounds ((a j).frame i) ((a j).lam i) u |
| 547 | ((a j).length_pos hr i) (hN2 _ hn2) |
| 548 | (by rw [slotRadius_sq hr, hlength j]) |
| 549 | (D.carrier i) (hA j) p hp (hk j) hgap hb hB herrors.2.1 herrors.2.2 hS hconeS |
| 550 | · simpa only [Kslot, FamilyData.length, (a j).scale_eq i, mul_assoc] using |
| 551 | (ChartScales.slotLength_bounds r0 h hr.le hh (hlarge j i).four_le).2 |
| 552 | · exact hcoeff.eigenvalue |
| 553 | · exact hcoeff.errors |
| 554 | · exact hcoeff.viscosity |
| 555 | · exact href j |
| 556 | have hratio (j k : Fin 2) (v : ℝ) |
| 557 | (hv : v ∈ Icc 0 (ChartScales.slotLength r0 h ((a 0).band i))) : |
| 558 | |(P j).t v k / (P j).x v - modelMatrix ((a 0).c0 i) u ((a 0).K i) k j| ≤ |
| 559 | Kslot*ratioConstant M u gap / ChartScales.slotLength r0 h ((a 0).band i) + |
| 560 | ((M+1)*u)*|v-ChartScales.slotLength r0 h ((a 0).band i)/2| / |
| 561 | ChartScales.slotLength r0 h ((a 0).band i) := by |
| 562 | have hv' : v ∈ Icc 0 ((a j).length i) := by rwa [hlength j] |
| 563 | rw [canonicalPrimaryPulse_ratio _ _ _ _ _ _ _ _ _ hv'] |
| 564 | simpa only [hlength j, hc.ratio j i, hc.transverse j i, Kslot] using |
| 565 | primary_center_error (a j) hh hr hM hu huM hL hslot (hlarge j) i j (hc.sign j i) |
| 566 | hp hgap (fun v hv => (href j v hv).1) hconeS hv' k |
| 567 | have hbnd := hpair ((a 0).band i) hn0 (((a 0).c0 i),((a 0).K i),T) hT P hPulse hratio zeta hzeta |
| 568 | have heq : familyCovariance vr vt a i p = |
| 569 | PartitionedCovariance.pairMatrix vr vt r0 |
| 570 | (fun _ => ChartScales.timeCoefficient h ((a 0).band i)) P := by |
| 571 | exact PrimaryPulseBounds.primaryCovariance_eq_canonicalPairMatrix _ _ _ _ _ i |
| 572 | (D.carrier i) p hp (fun j => (a j).length_pos hr i) hA hk vr vt r0 |
| 573 | (fun _ => ChartScales.timeCoefficient h ((a 0).band i)) |
| 574 | (fun j => by rw [hc.band j i]) |
| 575 | rw [heq] |
| 576 | exact hbnd |
| 577 | |
| 578 | end FamilyPair |
| 579 | |
| 580 | section Prepared |
| 581 | |
| 582 | open PrimaryGeometryAssembly PrimaryCovarianceBounds |
| 583 | |
| 584 | variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} |
| 585 | (H : NominalConeAssembly.Certificate W) {ld : ModulatedProfileAssembly.LoopData W} |
| 586 | (v : ModulatedProfileAssembly.Witness ld) |
| 587 | {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} |
| 588 | (a : Prepared H v upper B r0 N0) |
| 589 | |
| 590 | theorem prepared_pair : CompatiblePair (family H v a) := |
| 591 | ⟨fun _ _ => rfl, fun _ _ => rfl, fun _ _ => rfl, fun _ _ => rfl⟩ |
| 592 | |
| 593 | /-- The mixed target margin is supplied by the actual closed profile |
| 594 | direction and its actual positive representative. -/ |
| 595 | theorem prepared_model_mem (L : Index W a.N) {p : Slow} |
| 596 | (hp : p ∈ PositiveRepresentatives.positivePart (referenceSet W)) |
| 597 | (hpL : p ∈ (domain W a.N).carrier L) : |
| 598 | ((family H v a 0).c0 L, (family H v a 0).K L, a.target p) ∈ |
| 599 | modelSet a.M a.u a.eta := by |
| 600 | have hmargin := a.target_margin L p hp hpL |
| 601 | have hcneg := (a.cone L).c0_neg |
| 602 | have hcb := (family H v a 0).ratio_bound L |
| 603 | have hm : a.eta ≤ modelNormal ((family H v a 0).K L) (a.target p) := by |
| 604 | change a.eta ≤ -⟪a.target p, MovingFrameODE.quarterTurn |
| 605 | (PrimaryRepresentatives.transverseDirection (shear H v (representative W L)))⟫_ℝ |
| 606 | rw [PrimaryRepresentatives.quarterTurn_transverseDirection] |
| 607 | linarith [hmargin.1] |
| 608 | refine ⟨?_, (family H v a 0).unit L, a.target_unit p hp.1, hm, ?_⟩ |
| 609 | · change -a.M ≤ PrimaryRepresentatives.c0 _ _ ∧ PrimaryRepresentatives.c0 _ _ ≤ -(1/a.M) |
| 610 | change 1/a.M ≤ |PrimaryRepresentatives.c0 _ _| ∧ |PrimaryRepresentatives.c0 _ _| ≤ a.M at hcb |
| 611 | rw [abs_of_neg hcneg] at hcb |
| 612 | constructor <;> linarith |
| 613 | · have hmpos := a.eta_pos.trans_le hm |
| 614 | have hratio : |(family H v a 0).c0 L * |
| 615 | modelTransverse ((family H v a 0).K L) (a.target p)| / |
| 616 | modelNormal ((family H v a 0).K L) (a.target p) ≤ |
| 617 | PrimaryRepresentatives.slopeRatio a.u - a.eta := by |
| 618 | have hn : ⟪a.target p, PrimaryRepresentatives.normalDirection |
| 619 | (shear H v (representative W L))⟫_ℝ < 0 := by linarith [a.eta_pos, hmargin.1] |
| 620 | rw [abs_div, abs_of_neg hn] at hmargin |
| 621 | change |PrimaryRepresentatives.c0 _ _ * ⟪a.target p, |
| 622 | PrimaryRepresentatives.transverseDirection _⟫_ℝ| / |
| 623 | -⟪a.target p, MovingFrameODE.quarterTurn (PrimaryRepresentatives.transverseDirection _)⟫_ℝ ≤ _ |
| 624 | rw [PrimaryRepresentatives.quarterTurn_transverseDirection] |
| 625 | linarith [hmargin.2] |
| 626 | exact (div_le_iff₀ hmpos).mp hratio |
| 627 | |
| 628 | noncomputable def preparedCovariance (vr vt : TorusInverse.Plane) : Index W a.N → Slow → Mat2 := |
| 629 | familyCovariance vr vt (family H v a) |
| 630 | |
| 631 | theorem preparedCovariance_eq_construction (vr vt : TorusInverse.Plane) (hr0 : 0 < r0) : |
| 632 | preparedCovariance H v a vr vt = PrimaryPulseBounds.primaryCovariance |
| 633 | (fun _ L => PartitionedCovariance.nativePrefactor vr vt r0 * |
| 634 | ChartScales.timeCoefficient F.data.h (BaseChartJets.cellBand L) * |
| 635 | ChartScales.slotLength r0 F.data.h (BaseChartJets.cellBand L)) |
| 636 | (fun j => (construction H v a hr0 j).frame) |
| 637 | (fun j => (construction H v a hr0 j).lam) |
| 638 | (fun j => (construction H v a hr0 j).u) |
| 639 | (fun j => (construction H v a hr0 j).L) := rfl |
| 640 | |
| 641 | /-- One later cutoff, with all representatives, targets and phases kept |
| 642 | fixed, supplies the actual normalized determinant and inverse bounds. -/ |
| 643 | theorem exists_prepared_bounds (vr vt : TorusInverse.Plane) |
| 644 | (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (hr0 : 0 < r0) : |
| 645 | ∃ N : ℕ, a.N ≤ N ∧ ∃ detGap entryBound inverseLower : ℝ, |
| 646 | 0 < detGap ∧ 1 ≤ entryBound ∧ 0 < inverseLower ∧ |
| 647 | ∀ (L : Index W a.N), N ≤ BaseChartJets.cellBand L → ∀ p : Slow, |
| 648 | p ∈ PositiveRepresentatives.positivePart (referenceSet W) → |
| 649 | p ∈ (domain W a.N).carrier L → ∀ zeta : ℝ, 0 ≤ zeta → |
| 650 | ZeroOrderBounds (Real.sqrt (ChartScales.S (BaseChartJets.cellBand L))) |
| 651 | detGap entryBound inverseLower zeta (preparedCovariance H v a vr vt L p) |
| 652 | (FlatCovariance.scaledTarget zeta (fun k => a.target p k)) := by |
| 653 | obtain ⟨N, hN4, dg, eb, il, hd, he, hi, hb⟩ := exists_family_bounds vr vt hdet |
| 654 | F.data.h_pos.le hr0 a.one_le_M a.u_pos a.u_le a.length_bound a.slot_bound a.eta_pos |
| 655 | refine ⟨max a.N N, le_max_left _ _, dg, eb, il, hd, he, hi, ?_⟩ |
| 656 | intro L hL p hp hpL zeta hzeta |
| 657 | exact hb (Index W a.N) (domain W a.N) (family H v a) (prepared_pair H v a) |
| 658 | (fun _ L => a.large _ L.property) L ((le_max_right _ _).trans hL) p hpL (a.target p) |
| 659 | (prepared_model_mem H v a L hp hpL) zeta hzeta |
| 660 | |
| 661 | end Prepared |
| 662 | |
| 663 | section MovingWeight |
| 664 | |
| 665 | variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) |
| 666 | |
| 667 | noncomputable def leftRadius : ℝ := Real.sqrt (2 * NominalConeAssembly.activeLeft W) |
| 668 | noncomputable def rightRadius : ℝ := Real.sqrt (2 * NominalConeAssembly.activeRight W) |
| 669 | |
| 670 | theorem leftRadius_pos : 0 < leftRadius W := |
| 671 | Real.sqrt_pos.mpr (mul_pos (by norm_num) (NominalConeAssembly.activeLeft_pos W)) |
| 672 | |
| 673 | theorem rightRadius_pos : 0 < rightRadius W := |
| 674 | Real.sqrt_pos.mpr (mul_pos (by norm_num) (LeadingStressWeights.activeRight_pos W)) |
| 675 | |
| 676 | theorem radii_ordered : leftRadius W < rightRadius W := |
| 677 | Real.sqrt_lt_sqrt (mul_nonneg (by norm_num) (NominalConeAssembly.activeLeft_pos W).le) |
| 678 | (mul_lt_mul_of_pos_left (PrimaryGeometryAssembly.active_order (W := W)) (by norm_num)) |
| 679 | |
| 680 | /-- These are the radial-log coefficients of the very same product |
| 681 | weight, not a replacement weight with a faster decay. -/ |
| 682 | noncomputable def stripWeight (r : ℝ) : ℝ := |
| 683 | WeightedRadialPrimitive.zeta (FinalSlowBase.edgeExponent W / 4) 1 |
| 684 | (WeightedRadialPrimitive.logLength (leftRadius W) (rightRadius W)) |
| 685 | (WeightedRadialPrimitive.logPosition (leftRadius W) r) |
| 686 | |
| 687 | theorem stripWeight_nonneg (r : ℝ) : 0 ≤ stripWeight W r := |
| 688 | mul_nonneg (FlatCutoff.edge_nonneg _ _) (FlatCutoff.edge_nonneg _ _) |
| 689 | |
| 690 | theorem edge_double (c x : ℝ) : FlatCutoff.edge c (2*x) = FlatCutoff.edge (c/4) x := by |
| 691 | by_cases hx : 0 < x |
| 692 | · rw [FlatCutoff.edge_of_pos _ (by positivity), FlatCutoff.edge_of_pos _ hx] |
| 693 | congr 1 |
| 694 | field_simp ; ring_nf |
| 695 | · rw [FlatCutoff.edge_of_nonpos _ (by linarith), FlatCutoff.edge_of_nonpos _ (le_of_not_gt hx)] |
| 696 | |
| 697 | theorem log_square_half {r : ℝ} (hr : 0 < r) : |
| 698 | Real.log (r^2/2) = 2*Real.log r - Real.log 2 := by |
| 699 | rw [Real.log_div (pow_ne_zero _ hr.ne') (by norm_num), Real.log_pow] |
| 700 | norm_num |
| 701 | |
| 702 | theorem stripWeight_eq (r eta : ℝ) (hr : 0 < r) : |
| 703 | stripWeight W r = FinalSlowBase.weight W (r^2/2,eta) := by |
| 704 | have ha := leftRadius_pos W |
| 705 | have hb := rightRadius_pos W |
| 706 | have hasq : (leftRadius W)^2/2 = NominalConeAssembly.activeLeft W := by |
| 707 | rw [leftRadius, Real.sq_sqrt (mul_nonneg (by norm_num) (NominalConeAssembly.activeLeft_pos W).le)] |
| 708 | ring |
| 709 | have hbsq : (rightRadius W)^2/2 = NominalConeAssembly.activeRight W := by |
| 710 | rw [rightRadius, Real.sq_sqrt (mul_nonneg (by norm_num) (LeadingStressWeights.activeRight_pos W).le)] |
| 711 | ring |
| 712 | have halog := log_square_half ha |
| 713 | have hblog := log_square_half hb |
| 714 | rw [hasq] at halog |
| 715 | rw [hbsq] at hblog |
| 716 | have hl : Real.log (r^2/2) - FinalSlowBase.logLeft W = |
| 717 | 2 * WeightedRadialPrimitive.logPosition (leftRadius W) r := by |
| 718 | rw [FinalSlowBase.logLeft, WeightedRadialPrimitive.logPosition, |
| 719 | Real.log_div hr.ne' ha.ne', log_square_half hr, halog] |
| 720 | ring |
| 721 | have hh : FinalSlowBase.logRight W - Real.log (r^2/2) = |
| 722 | 2 * (WeightedRadialPrimitive.logLength (leftRadius W) (rightRadius W) - |
| 723 | WeightedRadialPrimitive.logPosition (leftRadius W) r) := by |
| 724 | rw [FinalSlowBase.logRight, WeightedRadialPrimitive.logLength, |
| 725 | WeightedRadialPrimitive.logPosition, Real.log_div hb.ne' ha.ne', |
| 726 | Real.log_div hr.ne' ha.ne', log_square_half hr, hblog] |
| 727 | ring |
| 728 | unfold FinalSlowBase.weight BaseResidual.activeZeta ActiveAnnulusWeight.radialWeight |
| 729 | rw [ite_eq_left (by positivity : 0 < r^2/2)] |
| 730 | unfold ActiveAnnulusWeight.weight |
| 731 | rw [hl, hh, edge_double, edge_double] |
| 732 | norm_num [stripWeight, WeightedRadialPrimitive.zeta] |
| 733 | |
| 734 | noncomputable def profileRadius (h : ℝ) (p : Slow) : ℝ := |
| 735 | p.1 / Real.sqrt (BaseChartJets.normalizedCoordinates h p).1 |
| 736 | |
| 737 | noncomputable def movingWeight (p : Slow) : ℝ := stripWeight W (profileRadius F.data.h p) |
| 738 | |
| 739 | theorem movingWeight_nonneg (p : Slow) : 0 ≤ movingWeight W p := stripWeight_nonneg W _ |
| 740 | |
| 741 | theorem profileRadius_pos {p : Slow} (hT : 0 < p.2.2) (hR : 0 < p.1) : |
| 742 | 0 < profileRadius F.data.h p := |
| 743 | div_pos hR (Real.sqrt_pos.mpr (BaseChartJets.normalizedCoordinates_q_pos |
| 744 | F.data.h_pos F.data.h_lt_half hT)) |
| 745 | |
| 746 | theorem profileRadius_sq {p : Slow} (hT : 0 < p.2.2) : |
| 747 | (profileRadius F.data.h p)^2/2 = (BaseChartJets.normalizedCoordinates F.data.h p).2.1 := by |
| 748 | have hq := BaseChartJets.normalizedCoordinates_q_pos F.data.h_pos F.data.h_lt_half hT |
| 749 | unfold profileRadius |
| 750 | rw [div_pow, Real.sq_sqrt hq.le, BaseChartJets.normalizedCoordinates_eq] |
| 751 | unfold SimilarityHomogeneity.chartX SimilarityCoordinates.coordinateX SimilarityHomogeneity.chartQ |
| 752 | ring |
| 753 | |
| 754 | theorem movingWeight_eq {p : Slow} (hT : 0 < p.2.2) (hR : 0 < p.1) : |
| 755 | movingWeight W p = FinalSlowBase.weight W (BaseChartJets.normalizedCoordinates F.data.h p).2 := by |
| 756 | rw [movingWeight, stripWeight_eq W _ _ (profileRadius_pos hT hR), profileRadius_sq hT] |
| 757 | |
| 758 | /-- The mean-variable ordering `(R,((T,Z),Y))` uses exactly the same |
| 759 | normalized point `(R,(Z,T))`. -/ |
| 760 | noncomputable def meanPoint (x : LocalSignedRequest.Point) : Slow := |
| 761 | (x.1,(x.2.1.2,x.2.1.1)) |
| 762 | |
| 763 | theorem meanPoint_scalar (x : LocalSignedRequest.Point) : |
| 764 | (BaseChartJets.normalizedCoordinates F.data.h (meanPoint x)).1 = |
| 765 | MeanRankUpdate.chartQ (2*F.data.h) x := by |
| 766 | rw [BaseChartJets.normalizedCoordinates_eq] |
| 767 | rfl |
| 768 | |
| 769 | /-- Exact equality with the strip used for the signed correction. -/ |
| 770 | theorem movingStripData_zeta (U : LocalSignedRequest.SlowRegion (2*F.data.h)) |
| 771 | (epsilon S : ℕ → ℝ) (hepsilon : ∀ n, 0 < epsilon n) |
| 772 | (hepsilon_one : ∀ n, epsilon n ≤ 1) (hS : ∀ n, 1 ≤ S n) |
| 773 | (x : LocalSignedRequest.Point) : |
| 774 | (LocalSignedRequest.movingStripData U (leftRadius W) (rightRadius W) |
| 775 | (FinalSlowBase.edgeExponent W/4) 1 (leftRadius_pos W) |
| 776 | (div_pos (FinalSlowBase.edgeExponent_pos W) (by norm_num)) (by norm_num) |
| 777 | epsilon S hepsilon hepsilon_one hS).zeta x = movingWeight W (meanPoint x) := by |
| 778 | unfold movingWeight profileRadius |
| 779 | rw [meanPoint_scalar] |
| 780 | rfl |
| 781 | |
| 782 | theorem weight_zero_of_not_active {w : ℝ × ℝ} |
| 783 | (hx : ¬w.1 ∈ Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W)) : |
| 784 | FinalSlowBase.weight W w = 0 := by |
| 785 | by_cases hl : w.1 ≤ NominalConeAssembly.activeLeft W |
| 786 | · exact ActiveAnnulusWeight.radialWeight_zero_left _ _ |
| 787 | (by simpa only [FinalSlowBase.logLeft, Real.exp_log (NominalConeAssembly.activeLeft_pos W)] using hl) |
| 788 | · have hr : NominalConeAssembly.activeRight W ≤ w.1 := by |
| 789 | by_contra hn |
| 790 | exact hx ⟨lt_of_not_ge hl, lt_of_not_ge hn⟩ |
| 791 | exact ActiveAnnulusWeight.radialWeight_zero_right _ _ |
| 792 | (by simpa only [FinalSlowBase.logRight, Real.exp_log (LeadingStressWeights.activeRight_pos W)] using hr) |
| 793 | |
| 794 | end MovingWeight |
| 795 | |
| 796 | section ActualTarget |
| 797 | |
| 798 | variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} |
| 799 | (H : NominalConeAssembly.Certificate W) {ld : ModulatedProfileAssembly.LoopData W} |
| 800 | (v : ModulatedProfileAssembly.Witness ld) |
| 801 | |
| 802 | /-- The literal leading covariance target in its own normalized band. -/ |
| 803 | noncomputable def actualTarget (p : Slow) : Plane := |
| 804 | (BaseChartJets.normalizedCoordinates F.data.h p).1 ^ (-CoordinateAlgebra.A F.data.h - 1/2) • |
| 805 | ProfileSpectralCone.stressVector v.profiles F.data.h |
| 806 | (BaseChartJets.normalizedCoordinates F.data.h p).2 |
| 807 | |
| 808 | noncomputable def targetAmplitude (p : Slow) : ℝ := |
| 809 | (BaseChartJets.normalizedCoordinates F.data.h p).1 ^ (-CoordinateAlgebra.A F.data.h - 1/2) * |
| 810 | ‖ProfileSpectralCone.stressVector v.profiles F.data.h |
| 811 | (BaseChartJets.normalizedCoordinates F.data.h p).2‖ |
| 812 | |
| 813 | theorem targetAmplitude_nonneg {p : Slow} (hT : 0 < p.2.2) : 0 ≤ targetAmplitude v p := |
| 814 | mul_nonneg (Real.rpow_pos_of_pos (BaseChartJets.normalizedCoordinates_q_pos |
| 815 | F.data.h_pos F.data.h_lt_half hT) _).le (norm_nonneg _) |
| 816 | |
| 817 | theorem stress_norm_le_plane (w : ℝ × ℝ) : |
| 818 | ‖FinalSlowBase.leadingStress v w‖ ≤ ‖ProfileSpectralCone.stressVector v.profiles F.data.h w‖ := by |
| 819 | apply max_le |
| 820 | · exact PiLp.norm_apply_le (ProfileSpectralCone.stressVector v.profiles F.data.h w) 0 |
| 821 | · exact PiLp.norm_apply_le (ProfileSpectralCone.stressVector v.profiles F.data.h w) 1 |
| 822 | |
| 823 | theorem targetAmplitude_lower (hcone : LeadingStressWeights.FullTrueCone v) : |
| 824 | ∃ c : ℝ, 0 < c ∧ ∀ p ∈ PositiveRepresentatives.positivePart |
| 825 | (PrimaryGeometryAssembly.referenceSet W), |
| 826 | (BaseChartJets.normalizedCoordinates F.data.h p).2.1 ∈ |
| 827 | Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) → |
| 828 | c * movingWeight W p ≤ targetAmplitude v p := by |
| 829 | let K := AlignedProfileSpectralCone.referenceSet W |
| 830 | have hK := AlignedProfileSpectralCone.referenceSet_compact W |
| 831 | have hs : ContinuousOn (fun p => PositiveRepresentatives.stableQ F.data.h p ^ |
| 832 | (-CoordinateAlgebra.A F.data.h - 1/2)) K := by |
| 833 | intro p hp |
| 834 | have hp' := AlignedProfileSpectralCone.reference_point W hp |
| 835 | exact ((PositiveRepresentatives.stableQ_smoothAt F.data.h_pos.le F.data.h_lt_half.le hp'.stable).rpow_const_of_ne |
| 836 | hp'.scalar.ne').continuousAt.continuousWithinAt |
| 837 | obtain ⟨k, hk, hb⟩ := hK.exists_forall_le' hs (fun p hp => |
| 838 | Real.rpow_pos_of_pos (AlignedProfileSpectralCone.reference_point W hp).scalar _) |
| 839 | obtain ⟨m, hm, hmB⟩ := FinalSlowBase.leading_lowerBound v hcone |
| 840 | refine ⟨k*m, mul_pos hk hm, ?_⟩ |
| 841 | intro p hp hx |
| 842 | have hp' := AlignedProfileSpectralCone.reference_point W hp.1 |
| 843 | have hT : 0 < p.2.2 := hp.2 |
| 844 | have heta := (BaseChartJets.normalizedCoordinates_eta F.data.h_pos F.data.h_lt_half hT).le |
| 845 | have hinner : (BaseChartJets.normalizedCoordinates F.data.h p).2 ∈ FinalSlowBase.annulus W := |
| 846 | ⟨hx, abs_le.mp heta⟩ |
| 847 | have hf := hb p hp.1 |
| 848 | rw [PositiveRepresentatives.stableQ_eq_chartQ F.data.h_pos F.data.h_lt_half hT] at hf |
| 849 | have hf' : k ≤ (BaseChartJets.normalizedCoordinates F.data.h p).1 ^ |
| 850 | (-CoordinateAlgebra.A F.data.h - 1/2) := by |
| 851 | simpa only [BaseChartJets.normalizedCoordinates_eq] using hf |
| 852 | have hnorm := (hmB _ hinner).trans (stress_norm_le_plane v _) |
| 853 | rw [movingWeight_eq W hT hp'.radius] |
| 854 | unfold targetAmplitude |
| 855 | calc |
| 856 | k*m*FinalSlowBase.weight W _ = k*(m*FinalSlowBase.weight W _) := by ring |
| 857 | _ ≤ k*‖ProfileSpectralCone.stressVector v.profiles F.data.h |
| 858 | (BaseChartJets.normalizedCoordinates F.data.h p).2‖ := |
| 859 | mul_le_mul_of_nonneg_left hnorm hk.le |
| 860 | _ ≤ _ := mul_le_mul_of_nonneg_right hf' (norm_nonneg _) |
| 861 | |
| 862 | theorem actualTarget_eq_direction {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} |
| 863 | (a : PrimaryGeometryAssembly.Prepared H v upper B r0 N0) {p : Slow} |
| 864 | (hp : p ∈ PositiveRepresentatives.positivePart (PrimaryGeometryAssembly.referenceSet W)) |
| 865 | (hx : (BaseChartJets.normalizedCoordinates F.data.h p).2.1 ∈ |
| 866 | Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W)) : |
| 867 | actualTarget v p = targetAmplitude v p • a.target p := by |
| 868 | rw [PrimaryGeometryAssembly.target_eq_normalized_stress H v a hp.1 hp.2 hx] |
| 869 | unfold actualTarget targetAmplitude PrimaryRepresentatives.normalDirection |
| 870 | by_cases hz : ProfileSpectralCone.stressVector v.profiles F.data.h |
| 871 | (BaseChartJets.normalizedCoordinates F.data.h p).2 = 0 |
| 872 | · simp only [hz, smul_zero] |
| 873 | · rw [smul_smul, mul_assoc, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hz), mul_one] |
| 874 | |
| 875 | theorem stress_zero_of_not_active {w : ℝ × ℝ} (hw : 0 < w.1) |
| 876 | (heta : w.2 ∈ Icc (-1 : ℝ) 1) |
| 877 | (hx : ¬w.1 ∈ Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W)) : |
| 878 | ProfileSpectralCone.stressVector v.profiles F.data.h w = 0 := by |
| 879 | have hz : LeadingStressWeights.stress v.profiles F.data.h w = 0 := by |
| 880 | by_cases hl : w.1 ≤ NominalConeAssembly.activeLeft W |
| 881 | · exact LeadingStressWeights.stress_zero_before v hw.le hl heta |
| 882 | · exact LeadingStressWeights.stress_zero_after v |
| 883 | (by by_contra hn; exact hx ⟨lt_of_not_ge hl, lt_of_not_ge hn⟩) heta |
| 884 | ext k |
| 885 | fin_cases k |
| 886 | · exact congrArg Prod.fst hz |
| 887 | · exact congrArg Prod.snd hz |
| 888 | |
| 889 | theorem actualTarget_eq_direction_all {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} |
| 890 | (a : PrimaryGeometryAssembly.Prepared H v upper B r0 N0) {p : Slow} |
| 891 | (hp : p ∈ PositiveRepresentatives.positivePart (PrimaryGeometryAssembly.referenceSet W)) : |
| 892 | actualTarget v p = targetAmplitude v p • a.target p := by |
| 893 | by_cases hx : (BaseChartJets.normalizedCoordinates F.data.h p).2.1 ∈ |
| 894 | Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) |
| 895 | · exact actualTarget_eq_direction H v a hp hx |
| 896 | · have hp' := AlignedProfileSpectralCone.reference_point W hp.1 |
| 897 | have hX := ProfileSpectralCone.normalized_X_pos F.data.h_pos F.data.h_lt_half hp.2 hp'.radius |
| 898 | have heta := (BaseChartJets.normalizedCoordinates_eta F.data.h_pos F.data.h_lt_half hp.2).le |
| 899 | have hz := stress_zero_of_not_active v hX (abs_le.mp heta) hx |
| 900 | simp only [actualTarget, targetAmplitude, hz, smul_zero, norm_zero, mul_zero, zero_smul] |
| 901 | |
| 902 | theorem targetAmplitude_lower_all (hcone : LeadingStressWeights.FullTrueCone v) : |
| 903 | ∃ c : ℝ, 0 < c ∧ ∀ p ∈ PositiveRepresentatives.positivePart |
| 904 | (PrimaryGeometryAssembly.referenceSet W), c * movingWeight W p ≤ targetAmplitude v p := by |
| 905 | obtain ⟨c, hc, hb⟩ := targetAmplitude_lower v hcone |
| 906 | refine ⟨c, hc, ?_⟩ |
| 907 | intro p hp |
| 908 | by_cases hx : (BaseChartJets.normalizedCoordinates F.data.h p).2.1 ∈ |
| 909 | Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) |
| 910 | · exact hb p hp hx |
| 911 | · have hp' := AlignedProfileSpectralCone.reference_point W hp.1 |
| 912 | rw [movingWeight_eq W hp.2 hp'.radius, weight_zero_of_not_active W hx, mul_zero] |
| 913 | exact targetAmplitude_nonneg v hp.2 |
| 914 | |
| 915 | /-- The chart target at its own band is exactly the actual leading |
| 916 | stress times the residual scalar coordinate. -/ |
| 917 | theorem covarianceTarget_eq_actual {p : Slow} (hT : 0 < p.2.2) (hR : 0 < p.1) |
| 918 | (N : ℕ) (U : PartitionedCovariance.UnsignedLabel) : |
| 919 | FinalSlowBase.covarianceTarget H v |
| 920 | (ChartScales.Q (U.1+N) * (BaseChartJets.normalizedCoordinates F.data.h p).1) N U p = |
| 921 | actualTarget v p := by |
| 922 | have hq := BaseChartJets.normalizedCoordinates_q_pos F.data.h_pos F.data.h_lt_half hT |
| 923 | have hX := ProfileSpectralCone.normalized_X_pos F.data.h_pos F.data.h_lt_half hT hR |
| 924 | have heta := (BaseChartJets.normalizedCoordinates_eta F.data.h_pos F.data.h_lt_half hT).le |
| 925 | have he := EntranceAlignedBase.modulated_leading_stress_eq H v hX.le heta |
| 926 | have hdiv : ChartScales.Q (U.1+N) / |
| 927 | (ChartScales.Q (U.1+N) * (BaseChartJets.normalizedCoordinates F.data.h p).1) = |
| 928 | ((BaseChartJets.normalizedCoordinates F.data.h p).1)⁻¹ := by |
| 929 | field_simp [(ChartScales.Q_pos (U.1+N)).ne'] |
| 930 | have hfactor : (ChartScales.Q (U.1+N) / |
| 931 | (ChartScales.Q (U.1+N) * (BaseChartJets.normalizedCoordinates F.data.h p).1)) ^ |
| 932 | (PartitionedCovariance.velocityExponent F.data.h + 1/2) = |
| 933 | (BaseChartJets.normalizedCoordinates F.data.h p).1 ^ (-CoordinateAlgebra.A F.data.h - 1/2) := by |
| 934 | rw [hdiv, Real.inv_rpow hq.le, ← Real.rpow_neg hq.le] |
| 935 | congr 1 |
| 936 | unfold PartitionedCovariance.velocityExponent CoordinateAlgebra.A |
| 937 | ring |
| 938 | ext k |
| 939 | fin_cases k <;> |
| 940 | simp [FinalSlowBase.covarianceTarget, PartitionedCovariance.chartTarget, |
| 941 | actualTarget, ProfileSpectralCone.stressVector, FinalSlowBase.coefficients, |
| 942 | he.1, he.2, PiLp.smul_apply, smul_eq_mul] <;> |
| 943 | exact Or.inl (by simpa only [one_div] using hfactor) |
| 944 | |
| 945 | end ActualTarget |
| 946 | |
| 947 | section FinalBounds |
| 948 | |
| 949 | open PrimaryGeometryAssembly PrimaryCovarianceBounds |
| 950 | |
| 951 | variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} |
| 952 | (H : NominalConeAssembly.Certificate W) {ld : ModulatedProfileAssembly.LoopData W} |
| 953 | (v : ModulatedProfileAssembly.Witness ld) |
| 954 | {upper : ℝ} {B : ℕ} {r0 : ℝ} {N0 : ℕ} |
| 955 | (a : Prepared H v upper B r0 N0) |
| 956 | |
| 957 | /-- The actual primary covariance and the actual leading target satisfy |
| 958 | all order-zero hypotheses used for positive square-root weights, with |
| 959 | the same moving flat weight through both closed attachment edges. -/ |
| 960 | theorem exists_actual_bounds (hcone : LeadingStressWeights.FullTrueCone v) |
| 961 | (vr vt : TorusInverse.Plane) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (hr0 : 0 < r0) : |
| 962 | ∃ N : ℕ, a.N ≤ N ∧ ∃ detGap entryBound inverseLower : ℝ, |
| 963 | 0 < detGap ∧ 1 ≤ entryBound ∧ 0 < inverseLower ∧ |
| 964 | ∀ (L : Index W a.N), N ≤ BaseChartJets.cellBand L → ∀ p : Slow, |
| 965 | p ∈ PositiveRepresentatives.positivePart (referenceSet W) → |
| 966 | p ∈ (domain W a.N).carrier L → |
| 967 | ZeroOrderBounds (Real.sqrt (ChartScales.S (BaseChartJets.cellBand L))) |
| 968 | detGap entryBound inverseLower (movingWeight W p) |
| 969 | (preparedCovariance H v a vr vt L p) (fun k => actualTarget v p k) := by |
| 970 | obtain ⟨N, hN, dg, eb, il, hdg, heb, hil, hb⟩ := exists_prepared_bounds H v a vr vt hdet hr0 |
| 971 | obtain ⟨c, hc, hcb⟩ := targetAmplitude_lower_all v hcone |
| 972 | refine ⟨N, hN, dg, eb, il*c, hdg, heb, mul_pos hil hc, ?_⟩ |
| 973 | intro L hL p hp hpL |
| 974 | have hbound := hb L hL p hp hpL (targetAmplitude v p) (targetAmplitude_nonneg v hp.2) |
| 975 | have htarget : FlatCovariance.scaledTarget (targetAmplitude v p) (fun k => a.target p k) = |
| 976 | (fun k => actualTarget v p k) := by |
| 977 | rw [actualTarget_eq_direction_all H v a hp] |
| 978 | rfl |
| 979 | rw [htarget] at hbound |
| 980 | refine ⟨hbound.determinant, hbound.entries, ?_⟩ |
| 981 | intro j |
| 982 | calc |
| 983 | (il*c)*Real.sqrt (ChartScales.S (BaseChartJets.cellBand L))*movingWeight W p = |
| 984 | (il*Real.sqrt (ChartScales.S (BaseChartJets.cellBand L)))*(c*movingWeight W p) := by ring |
| 985 | _ ≤ (il*Real.sqrt (ChartScales.S (BaseChartJets.cellBand L)))*targetAmplitude v p := |
| 986 | mul_le_mul_of_nonneg_left (hcb p hp) (mul_nonneg hil.le (Real.sqrt_nonneg _)) |
| 987 | _ ≤ _ := hbound.weights j |
| 988 | |
| 989 | theorem restricted_covariance (vr vt : TorusInverse.Plane) (N : ℕ) (hN : a.N ≤ N) |
| 990 | (L : Index W N) (p : Slow) : |
| 991 | preparedCovariance H v (a.restrict N hN) vr vt L p = |
| 992 | preparedCovariance H v a vr vt (earlierIndex hN L) p := rfl |
| 993 | |
| 994 | /-- A single final band threshold suffices. Restriction retains the |
| 995 | original representative, carrier and phase on each surviving label. -/ |
| 996 | theorem exists_restricted_actual_bounds (hcone : LeadingStressWeights.FullTrueCone v) |
| 997 | (vr vt : TorusInverse.Plane) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (hr0 : 0 < r0) : |
| 998 | ∃ N : ℕ, ∃ hN : a.N ≤ N, ∃ detGap entryBound inverseLower : ℝ, |
| 999 | 0 < detGap ∧ 1 ≤ entryBound ∧ 0 < inverseLower ∧ |
| 1000 | ∀ (L : Index W N) (p : Slow), |
| 1001 | p ∈ PositiveRepresentatives.positivePart (referenceSet W) → |
| 1002 | p ∈ (domain W N).carrier L → |
| 1003 | ZeroOrderBounds (Real.sqrt (ChartScales.S (BaseChartJets.cellBand L))) |
| 1004 | detGap entryBound inverseLower (movingWeight W p) |
| 1005 | (preparedCovariance H v (a.restrict N hN) vr vt L p) (fun k => actualTarget v p k) := by |
| 1006 | obtain ⟨N, hN, dg, eb, il, hdg, heb, hil, hb⟩ := exists_actual_bounds H v a hcone vr vt hdet hr0 |
| 1007 | refine ⟨N, hN, dg, eb, il, hdg, heb, hil, ?_⟩ |
| 1008 | intro L p hp hpL |
| 1009 | rw [restricted_covariance H v a vr vt] |
| 1010 | exact hb (earlierIndex hN L) L.property p hp hpL |
| 1011 | |
| 1012 | /-- The source profile supplies the whole geometry. There is no extra |
| 1013 | target orientation, determinant, inverse-weight or ODE-error input. -/ |
| 1014 | theorem exists_constructed_bounds (hcone : LeadingStressWeights.FullTrueCone v) |
| 1015 | (upper : ℝ) (B : ℕ) (r0 : ℝ) (hr0 : 0 < r0) |
| 1016 | (hbox : 2 * NominalConeAssembly.activeRight W ≤ FinalSlowBase.boxRadius W upper) |
| 1017 | (N0 : ℕ) (vr vt : TorusInverse.Plane) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) : |
| 1018 | ∃ a : Prepared H v upper B r0 N0, ∃ detGap entryBound inverseLower : ℝ, |
| 1019 | 0 < detGap ∧ 1 ≤ entryBound ∧ 0 < inverseLower ∧ |
| 1020 | ∀ (L : Index W a.N) (p : Slow), |
| 1021 | p ∈ PositiveRepresentatives.positivePart (referenceSet W) → |
| 1022 | p ∈ (domain W a.N).carrier L → |
| 1023 | ZeroOrderBounds (Real.sqrt (ChartScales.S (BaseChartJets.cellBand L))) |
| 1024 | detGap entryBound inverseLower (movingWeight W p) |
| 1025 | (preparedCovariance H v a vr vt L p) (fun k => actualTarget v p k) := by |
| 1026 | let a := prepared H v hcone upper B r0 hbox N0 |
| 1027 | obtain ⟨N, hN, dg, eb, il, hdg, heb, hil, hb⟩ := |
| 1028 | exists_restricted_actual_bounds H v a hcone vr vt hdet hr0 |
| 1029 | exact ⟨a.restrict N hN, dg, eb, il, hdg, heb, hil, hb⟩ |
| 1030 | |
| 1031 | end FinalBounds |
| 1032 | |
| 1033 | end NavierStokes.PrimaryTargetBounds |
| 1034 | |
| 1035 | end |