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.UniformCone |
| 3 | import NavierStokes.SimilarityHomogeneity |
| 4 | import Mathlib.Topology.UniformSpace.HeineCantor |
| 5 | |
| 6 | /-! |
| 7 | # Actual grid representatives and uniform primary reference parameters |
| 8 | |
| 9 | Representatives are selected in the intersection of the actual closed mask |
| 10 | support and the fixed closed active set. The enlarged-box distance is then a |
| 11 | consequence of the mesh, rather than a hypothesis on the selected point. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | namespace NavierStokes.PrimaryRepresentatives |
| 17 | |
| 18 | open Set Function Filter |
| 19 | open scoped ContDiff Topology InnerProductSpace |
| 20 | |
| 21 | abbrev Slow := PhaseCalculus.Slow |
| 22 | abbrev Plane := MovingFrameODE.Plane |
| 23 | abbrev Grid := SlotColoring.Grid |
| 24 | abbrev Label := PartitionedCovariance.UnsignedLabel |
| 25 | abbrev Position := SlotColoring.Position |
| 26 | |
| 27 | noncomputable def position (q : Slow) : Position := ![q.1, q.2.1, q.2.2] |
| 28 | noncomputable def slow (x : Position) : Slow := (x 0, (x 1, x 2)) |
| 29 | |
| 30 | @[simp] theorem position_slow (x : Position) : position (slow x) = x := by |
| 31 | ext j |
| 32 | fin_cases j <;> rfl |
| 33 | |
| 34 | @[simp] theorem slow_position (q : Slow) : slow (position q) = q := rfl |
| 35 | |
| 36 | theorem position_smooth : ContDiff ℝ ∞ position := by |
| 37 | apply contDiff_pi.mpr |
| 38 | intro j |
| 39 | fin_cases j |
| 40 | · exact contDiff_fst |
| 41 | · exact contDiff_snd.fst |
| 42 | · exact contDiff_snd.snd |
| 43 | |
| 44 | theorem norm_slow_sub_le {x y : Position} {c : ℝ} |
| 45 | (h : ∀ j, |x j - y j| ≤ c) : ‖slow x - slow y‖ ≤ c := by |
| 46 | change max |x 0 - y 0| (max |x 1 - y 1| |x 2 - y 2|) ≤ c |
| 47 | exact max_le (h 0) (max_le (h 1) (h 2)) |
| 48 | |
| 49 | noncomputable def nativeMask (n : ℕ) (k : Grid) (q : Slow) : ℝ := |
| 50 | SquaredPartition.slowMask n k (position q) |
| 51 | |
| 52 | noncomputable def gridBox (n : ℕ) (k : Grid) (a : ℝ) : Set Slow := |
| 53 | {q | ∀ j, |position q j - SquaredPartition.nativeSpacing n * (k j : ℝ)| ≤ |
| 54 | a * SquaredPartition.nativeSpacing n} |
| 55 | |
| 56 | theorem gridBox_closed (n : ℕ) (k : Grid) (a : ℝ) : IsClosed (gridBox n k a) := by |
| 57 | simp only [gridBox, Set.ofPred_forall] |
| 58 | exact isClosed_iInter fun j => isClosed_le |
| 59 | (((continuous_apply j).comp position_smooth.continuous).sub continuous_const).abs continuous_const |
| 60 | |
| 61 | theorem nativeMask_smooth (n : ℕ) (k : Grid) : ContDiff ℝ ∞ (nativeMask n k) := |
| 62 | (SquaredPartition.slowMask_smooth n k).comp position_smooth |
| 63 | |
| 64 | theorem nativeMask_tsupport_subset {n : ℕ} (hn : 1 ≤ n) (k : Grid) : |
| 65 | tsupport (nativeMask n k) ⊆ gridBox n k 1 := by |
| 66 | apply closure_minimal _ (gridBox_closed n k 1) |
| 67 | intro q hq j |
| 68 | have hx : position q ∈ tsupport (SquaredPartition.slowMask n k) := subset_closure hq |
| 69 | have hj := SquaredPartition.slowMask_tsupport_subset hn k hx j (mem_univ _) |
| 70 | change |position q j - SquaredPartition.nativeSpacing n * (k j : ℝ)| ≤ |
| 71 | 1 * SquaredPartition.nativeSpacing n |
| 72 | rw [one_mul, abs_le] |
| 73 | constructor <;> linarith [hj.1, hj.2] |
| 74 | |
| 75 | theorem gridBox_distance {n : ℕ} {k : Grid} {a b : ℝ} {q q₀ : Slow} |
| 76 | (hq : q ∈ gridBox n k a) (h₀ : q₀ ∈ gridBox n k b) : |
| 77 | ‖q - q₀‖ ≤ (a + b) * SquaredPartition.nativeSpacing n := by |
| 78 | rw [← slow_position q, ← slow_position q₀] |
| 79 | apply norm_slow_sub_le |
| 80 | intro j |
| 81 | have ht := abs_sub_le (position q j) |
| 82 | (SquaredPartition.nativeSpacing n * (k j : ℝ)) (position q₀ j) |
| 83 | rw [abs_sub_comm (SquaredPartition.nativeSpacing n * (k j : ℝ))] at ht |
| 84 | linarith [hq j, h₀ j] |
| 85 | |
| 86 | /-- Exactly the labels whose closed mask support meets the closed active set. -/ |
| 87 | noncomputable def ActiveLabel (K : Set Slow) := |
| 88 | {L : Label // 1 ≤ L.1 ∧ (K ∩ tsupport (nativeMask L.1 L.2)).Nonempty} |
| 89 | |
| 90 | noncomputable def representative (K : Set Slow) (L : ActiveLabel K) : Slow := |
| 91 | Classical.choose L.property.2 |
| 92 | |
| 93 | theorem representative_mem (K : Set Slow) (L : ActiveLabel K) : representative K L ∈ K := |
| 94 | (Classical.choose_spec L.property.2).1 |
| 95 | |
| 96 | theorem representative_mem_tsupport (K : Set Slow) (L : ActiveLabel K) : |
| 97 | representative K L ∈ tsupport (nativeMask L.val.1 L.val.2) := |
| 98 | (Classical.choose_spec L.property.2).2 |
| 99 | |
| 100 | /-- The sharp bound furnished by a one-mesh support and a two-mesh pad. -/ |
| 101 | theorem representative_enlarged_distance (K : Set Slow) (L : ActiveLabel K) |
| 102 | {q : Slow} (hq : q ∈ gridBox L.val.1 L.val.2 2) : |
| 103 | ‖q - representative K L‖ ≤ 3 / ChartScales.S L.val.1 ^ 3 := by |
| 104 | have h₀ := nativeMask_tsupport_subset L.property.1 L.val.2 (representative_mem_tsupport K L) |
| 105 | simpa only [show (2 : ℝ) + 1 = 3 by norm_num, SquaredPartition.nativeSpacing, |
| 106 | div_eq_mul_inv] using gridBox_distance hq h₀ |
| 107 | |
| 108 | theorem representative_support_distance (K : Set Slow) (L : ActiveLabel K) |
| 109 | {q : Slow} (hq : q ∈ tsupport (nativeMask L.val.1 L.val.2)) : |
| 110 | ‖q - representative K L‖ ≤ 2 / ChartScales.S L.val.1 ^ 3 := by |
| 111 | have h₀ := nativeMask_tsupport_subset L.property.1 L.val.2 (representative_mem_tsupport K L) |
| 112 | have hq' := nativeMask_tsupport_subset L.property.1 L.val.2 hq |
| 113 | simpa only [show (1 : ℝ) + 1 = 2 by norm_num, SquaredPartition.nativeSpacing, |
| 114 | div_eq_mul_inv] using gridBox_distance hq' h₀ |
| 115 | |
| 116 | noncomputable def normalizedSlow (D : ℝ) (n : ℕ) (x : Position) : Slow := |
| 117 | slow (SquaredPartition.slowCoordinates D n x) |
| 118 | |
| 119 | theorem width_eq_scaled_spacing (D : ℝ) (n : ℕ) (j : Fin 3) : |
| 120 | SlotColoring.width D j n = ChartScales.Q n ^ SlotColoring.axisExponent D j * |
| 121 | SquaredPartition.nativeSpacing n := by |
| 122 | unfold SlotColoring.width |
| 123 | rw [SlotColoring.spacing_eq_scaled_mesh] |
| 124 | simp only [ChartScales.Q, SquaredPartition.nativeSpacing, ChartScales.S, one_div] |
| 125 | |
| 126 | theorem physicalMask_nativeMask (D : ℝ) (L : Label) (q : ℝ) (x : Position) : |
| 127 | PartitionedCovariance.mask D L q x = SquaredPartition.dyadicMask (L.1 : ℤ) q * |
| 128 | nativeMask L.1 L.2 (normalizedSlow D L.1 x) := by |
| 129 | simp only [PartitionedCovariance.mask, PartitionedCovariance.physicalMask, |
| 130 | PartitionedCovariance.signedLabel, nativeMask, normalizedSlow, position_slow, |
| 131 | SquaredPartition.physicalSlowMask] |
| 132 | |
| 133 | /-- Every nonzero actual physical mask on the active set produces one of |
| 134 | the labels for which the representative was constructed. -/ |
| 135 | theorem physicalMask_active (K : Set Slow) (D : ℝ) (L : Label) |
| 136 | (hL : 1 ≤ L.1) {q : ℝ} {x : Position} |
| 137 | (hx : normalizedSlow D L.1 x ∈ K) (hm : PartitionedCovariance.mask D L q x ≠ 0) : |
| 138 | ∃ A : ActiveLabel K, A.val = L := by |
| 139 | refine ⟨⟨L, hL, normalizedSlow D L.1 x, hx, ?_⟩, rfl⟩ |
| 140 | apply subset_closure |
| 141 | rw [physicalMask_nativeMask] at hm |
| 142 | exact (mul_ne_zero_iff.mp hm).2 |
| 143 | |
| 144 | theorem grid_mesh_tendsto_zero : |
| 145 | Tendsto (fun n : ℕ => 3 / ChartScales.S n ^ 3) atTop (𝓝 0) := by |
| 146 | have hS : Tendsto (fun n : ℕ => ChartScales.S n ^ 3) atTop atTop := |
| 147 | (tendsto_pow_atTop (by norm_num : (3 : ℕ) ≠ 0)).comp PhaseEstimates.chart_S_tendsto_atTop |
| 148 | have hi : Tendsto (fun n : ℕ => (ChartScales.S n ^ 3)⁻¹) atTop (𝓝 (0 : ℝ)) := |
| 149 | hS.inv_tendsto_atTop |
| 150 | simpa only [div_eq_mul_inv, mul_zero] using hi.const_mul (3 : ℝ) |
| 151 | |
| 152 | /-! ## Reference frame and exact unstable-mode parameters -/ |
| 153 | |
| 154 | noncomputable def normalDirection (g : Plane) : Plane := ‖g‖⁻¹ • g |
| 155 | noncomputable def transverseDirection (g : Plane) : Plane := |
| 156 | -MovingFrameODE.quarterTurn (normalDirection g) |
| 157 | noncomputable def coupling (F : ℝ) (g : Plane) : ℝ := 2 * F * normalDirection g 0 |
| 158 | noncomputable def lambda0 (F : ℝ) (g : Plane) : ℝ := |
| 159 | Real.sqrt (-(coupling F g) * (coupling F g + ‖g‖)) |
| 160 | noncomputable def c0 (F : ℝ) (g : Plane) : ℝ := lambda0 F g / coupling F g |
| 161 | |
| 162 | /-- Primitive strict shear conditions. The last inequality is the positive |
| 163 | opening of the unstable two-dimensional reference system. -/ |
| 164 | structure ReferenceCone (F : ℝ) (g : Plane) : Prop where |
| 165 | frequency_pos : 0 < F |
| 166 | theta_neg : g 0 < 0 |
| 167 | opening_pos : 0 < 2 * F * g 0 + ‖g‖ ^ 2 |
| 168 | |
| 169 | theorem ReferenceCone.shear_ne_zero {F : ℝ} {g : Plane} (h : ReferenceCone F g) : g ≠ 0 := by |
| 170 | intro hg |
| 171 | simpa [hg] using h.theta_neg |
| 172 | |
| 173 | /-- The manuscript's shear coordinates give the primitive reference cone |
| 174 | from `a > 0` and `a²+b² > 2a`. -/ |
| 175 | theorem referenceCone_of_shear_coordinates {F a b : ℝ} (hF : 0 < F) (ha : 0 < a) |
| 176 | (hv : 2 * a < a ^ 2 + b ^ 2) : ReferenceCone F (F • !₂[-a, b]) := by |
| 177 | refine ⟨hF, ?_, ?_⟩ |
| 178 | · change F * -a < 0 |
| 179 | exact mul_neg_of_pos_of_neg hF (neg_neg_of_pos ha) |
| 180 | · have hn := ViscousPropagator.plane_norm_sq (F • !₂[-a, b]) |
| 181 | change ‖F • !₂[-a, b]‖ ^ 2 = (F * -a) ^ 2 + (F * b) ^ 2 at hn |
| 182 | change 0 < 2 * F * (F * -a) + ‖F • !₂[-a, b]‖ ^ 2 |
| 183 | rw [hn] |
| 184 | nlinarith [mul_pos (sq_pos_of_pos hF) (sub_pos.mpr hv)] |
| 185 | |
| 186 | theorem normalDirection_unit {g : Plane} (hg : g ≠ 0) : ‖normalDirection g‖ = 1 := by |
| 187 | simp only [normalDirection, norm_smul, norm_inv, norm_norm] |
| 188 | exact inv_mul_cancel₀ (norm_ne_zero_iff.mpr hg) |
| 189 | |
| 190 | theorem transverseDirection_unit {g : Plane} (hg : g ≠ 0) : ‖transverseDirection g‖ = 1 := by |
| 191 | rw [transverseDirection, norm_neg, PhaseEstimates.quarterTurn_norm, normalDirection_unit hg] |
| 192 | |
| 193 | theorem quarterTurn_transverseDirection (g : Plane) : |
| 194 | MovingFrameODE.quarterTurn (transverseDirection g) = normalDirection g := by |
| 195 | rw [transverseDirection, map_neg, MovingFrameODE.quarterTurn_square, neg_neg] |
| 196 | |
| 197 | theorem norm_smul_normalDirection {g : Plane} (hg : g ≠ 0) : |
| 198 | ‖g‖ • normalDirection g = g := by |
| 199 | rw [normalDirection, smul_smul, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hg), one_smul] |
| 200 | |
| 201 | theorem transverseDirection_inner_shear (g : Plane) : |
| 202 | ⟪transverseDirection g, g⟫_ℝ = 0 := by |
| 203 | rw [transverseDirection, normalDirection, map_smul, inner_neg_left, real_inner_smul_left, |
| 204 | real_inner_comm, MovingFrameODE.inner_quarterTurn_self] |
| 205 | ring |
| 206 | |
| 207 | theorem normalDirection_theta (g : Plane) : normalDirection g 0 = g 0 / ‖g‖ := by |
| 208 | simp [normalDirection, div_eq_mul_inv, mul_comm] |
| 209 | |
| 210 | theorem coupling_eq (F : ℝ) (g : Plane) : coupling F g = (2 * F * g 0) / ‖g‖ := by |
| 211 | rw [coupling, normalDirection_theta] |
| 212 | ring |
| 213 | |
| 214 | theorem ReferenceCone.coupling_neg {F : ℝ} {g : Plane} (h : ReferenceCone F g) : |
| 215 | coupling F g < 0 := by |
| 216 | rw [coupling_eq] |
| 217 | exact div_neg_of_neg_of_pos (mul_neg_of_pos_of_neg (by linarith [h.frequency_pos]) h.theta_neg) |
| 218 | (norm_pos_iff.mpr h.shear_ne_zero) |
| 219 | |
| 220 | theorem ReferenceCone.coupling_add_norm_pos {F : ℝ} {g : Plane} (h : ReferenceCone F g) : |
| 221 | 0 < coupling F g + ‖g‖ := by |
| 222 | have hg := norm_pos_iff.mpr h.shear_ne_zero |
| 223 | have he : coupling F g + ‖g‖ = (2 * F * g 0 + ‖g‖ ^ 2) / ‖g‖ := by |
| 224 | rw [coupling_eq] |
| 225 | field_simp |
| 226 | rw [he] |
| 227 | exact div_pos h.opening_pos hg |
| 228 | |
| 229 | theorem ReferenceCone.lambda0_pos {F : ℝ} {g : Plane} (h : ReferenceCone F g) : |
| 230 | 0 < lambda0 F g := |
| 231 | Real.sqrt_pos.mpr (mul_pos (neg_pos.mpr h.coupling_neg) h.coupling_add_norm_pos) |
| 232 | |
| 233 | theorem ReferenceCone.lambda0_sq {F : ℝ} {g : Plane} (h : ReferenceCone F g) : |
| 234 | lambda0 F g ^ 2 = -(coupling F g) * (coupling F g + ‖g‖) := |
| 235 | Real.sq_sqrt (mul_pos (neg_pos.mpr h.coupling_neg) h.coupling_add_norm_pos).le |
| 236 | |
| 237 | theorem ReferenceCone.c0_neg {F : ℝ} {g : Plane} (h : ReferenceCone F g) : c0 F g < 0 := |
| 238 | div_neg_of_pos_of_neg h.lambda0_pos h.coupling_neg |
| 239 | |
| 240 | theorem ReferenceCone.lambda0_div_c0 {F : ℝ} {g : Plane} (h : ReferenceCone F g) : |
| 241 | lambda0 F g / c0 F g = 2 * F * normalDirection g 0 := by |
| 242 | rw [c0, div_div_eq_mul_div, mul_div_cancel_left₀ _ h.lambda0_pos.ne'] |
| 243 | rfl |
| 244 | |
| 245 | theorem ReferenceCone.lambda0_mul_c0 {F : ℝ} {g : Plane} (h : ReferenceCone F g) : |
| 246 | lambda0 F g * c0 F g = -(2 * F * normalDirection g 0 + ‖g‖) := by |
| 247 | change lambda0 F g * (lambda0 F g / coupling F g) = -(coupling F g + ‖g‖) |
| 248 | rw [← mul_div_assoc, ← pow_two, h.lambda0_sq] |
| 249 | field_simp [h.coupling_neg.ne] |
| 250 | |
| 251 | section Continuity |
| 252 | |
| 253 | variable {X : Type*} [TopologicalSpace X] {K : Set X} {F : X → ℝ} {g : X → Plane} |
| 254 | |
| 255 | theorem normalDirection_continuousOn (hg : ContinuousOn g K) |
| 256 | (hne : ∀ q ∈ K, g q ≠ 0) : ContinuousOn (fun q => normalDirection (g q)) K := |
| 257 | (hg.norm.inv₀ (fun q hq => norm_ne_zero_iff.mpr (hne q hq))).smul hg |
| 258 | |
| 259 | theorem transverseDirection_continuousOn (hg : ContinuousOn g K) |
| 260 | (hne : ∀ q ∈ K, g q ≠ 0) : ContinuousOn (fun q => transverseDirection (g q)) K := |
| 261 | (MovingFrameODE.quarterTurn.continuous.comp_continuousOn |
| 262 | (normalDirection_continuousOn hg hne)).neg |
| 263 | |
| 264 | theorem coupling_continuousOn (hF : ContinuousOn F K) (hg : ContinuousOn g K) |
| 265 | (hne : ∀ q ∈ K, g q ≠ 0) : ContinuousOn (fun q => coupling (F q) (g q)) K := by |
| 266 | exact (continuousOn_const.mul hF).mul |
| 267 | ((PiLp.continuous_apply 2 _ 0).comp_continuousOn (normalDirection_continuousOn hg hne)) |
| 268 | |
| 269 | theorem lambda0_continuousOn (hF : ContinuousOn F K) (hg : ContinuousOn g K) |
| 270 | (hne : ∀ q ∈ K, g q ≠ 0) : ContinuousOn (fun q => lambda0 (F q) (g q)) K := by |
| 271 | have hc := coupling_continuousOn hF hg hne |
| 272 | exact (hc.neg.mul (hc.add hg.norm)).sqrt |
| 273 | |
| 274 | theorem c0_continuousOn (hF : ContinuousOn F K) (hg : ContinuousOn g K) |
| 275 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) : ContinuousOn (fun q => c0 (F q) (g q)) K := |
| 276 | (lambda0_continuousOn hF hg (fun q hq => (hc q hq).shear_ne_zero)).div |
| 277 | (coupling_continuousOn hF hg (fun q hq => (hc q hq).shear_ne_zero)) |
| 278 | (fun q hq => (hc q hq).coupling_neg.ne) |
| 279 | |
| 280 | end Continuity |
| 281 | |
| 282 | noncomputable def parameterScalars (F : Slow → ℝ) (g : Slow → Plane) (q : Slow) : Fin 9 → ℝ := |
| 283 | ![q.1, F q, ‖g q‖, lambda0 (F q) (g q), c0 (F q) (g q), |
| 284 | q.1⁻¹, ‖g q‖⁻¹, (lambda0 (F q) (g q))⁻¹, (c0 (F q) (g q))⁻¹] |
| 285 | |
| 286 | theorem parameterScalars_continuousOn {K : Set Slow} {F : Slow → ℝ} {g : Slow → Plane} |
| 287 | (hF : ContinuousOn F K) (hg : ContinuousOn g K) (hR : ∀ q ∈ K, 0 < q.1) |
| 288 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) : ContinuousOn (parameterScalars F g) K := by |
| 289 | have hn : ∀ q ∈ K, g q ≠ 0 := fun q hq => (hc q hq).shear_ne_zero |
| 290 | have hlam := lambda0_continuousOn hF hg hn |
| 291 | have hc0 := c0_continuousOn hF hg hc |
| 292 | apply continuousOn_pi.mpr |
| 293 | intro i |
| 294 | fin_cases i |
| 295 | · exact continuous_fst.continuousOn |
| 296 | · exact hF |
| 297 | · exact hg.norm |
| 298 | · exact hlam |
| 299 | · exact hc0 |
| 300 | · exact continuous_fst.continuousOn.inv₀ (fun q hq => (hR q hq).ne') |
| 301 | · exact hg.norm.inv₀ (fun q hq => norm_ne_zero_iff.mpr (hn q hq)) |
| 302 | · exact hlam.inv₀ (fun q hq => (hc q hq).lambda0_pos.ne') |
| 303 | · exact hc0.inv₀ (fun q hq => (hc q hq).c0_neg.ne) |
| 304 | |
| 305 | /-- The same constant controls every representative parameter and reciprocal. -/ |
| 306 | structure ParameterBounds (M R F : ℝ) (g : Plane) : Prop where |
| 307 | radius : R ≤ M |
| 308 | frequency : |F| ≤ M |
| 309 | shear : ‖g‖ ≤ M |
| 310 | lambda : lambda0 F g ≤ M |
| 311 | ratio : |c0 F g| ≤ M |
| 312 | radius_inv : R⁻¹ ≤ M |
| 313 | shear_inv : ‖g‖⁻¹ ≤ M |
| 314 | lambda_inv : (lambda0 F g)⁻¹ ≤ M |
| 315 | ratio_inv : |c0 F g|⁻¹ ≤ M |
| 316 | |
| 317 | theorem compact_parameter_bounds {K : Set Slow} (hK : IsCompact K) |
| 318 | {F : Slow → ℝ} {g : Slow → Plane} (hF : ContinuousOn F K) (hg : ContinuousOn g K) |
| 319 | (hR : ∀ q ∈ K, 0 < q.1) (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) : |
| 320 | ∃ M : ℝ, 1 ≤ M ∧ ∀ q ∈ K, ParameterBounds M q.1 (F q) (g q) := by |
| 321 | obtain ⟨B, hB⟩ := hK.exists_bound_of_continuousOn (parameterScalars_continuousOn hF hg hR hc) |
| 322 | refine ⟨max 1 B, le_max_left _ _, fun q hq => ?_⟩ |
| 323 | have hb (i : Fin 9) : |parameterScalars F g q i| ≤ max 1 B := by |
| 324 | exact (norm_le_pi_norm (parameterScalars F g q) i).trans |
| 325 | ((hB q hq).trans (le_max_right _ _)) |
| 326 | have hgq : 0 < ‖g q‖ := norm_pos_iff.mpr (hc q hq).shear_ne_zero |
| 327 | refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 328 | · simpa [parameterScalars, abs_of_pos (hR q hq)] using hb 0 |
| 329 | · simpa [parameterScalars] using hb 1 |
| 330 | · simpa [parameterScalars] using hb 2 |
| 331 | · simpa [parameterScalars, abs_of_pos (hc q hq).lambda0_pos] using hb 3 |
| 332 | · simpa [parameterScalars] using hb 4 |
| 333 | · simpa [parameterScalars, abs_of_pos (inv_pos.mpr (hR q hq))] using hb 5 |
| 334 | · simpa [parameterScalars, abs_of_pos (inv_pos.mpr hgq)] using hb 6 |
| 335 | · simpa [parameterScalars, abs_of_pos (inv_pos.mpr (hc q hq).lambda0_pos)] using hb 7 |
| 336 | · simpa [parameterScalars, abs_inv] using hb 8 |
| 337 | |
| 338 | private theorem reciprocal_lower {M x : ℝ} (hM : 0 < M) (hx : 0 < x) (h : x⁻¹ ≤ M) : |
| 339 | M⁻¹ ≤ x := by |
| 340 | have hb := mul_le_mul_of_nonneg_right h hx.le |
| 341 | rw [inv_mul_cancel₀ hx.ne'] at hb |
| 342 | have he : M * M⁻¹ = 1 := mul_inv_cancel₀ hM.ne' |
| 343 | nlinarith |
| 344 | |
| 345 | theorem ParameterBounds.mono {M M' R F : ℝ} {g : Plane} |
| 346 | (h : ParameterBounds M R F g) (hMM' : M ≤ M') : ParameterBounds M' R F g := |
| 347 | ⟨h.radius.trans hMM', h.frequency.trans hMM', h.shear.trans hMM', h.lambda.trans hMM', |
| 348 | h.ratio.trans hMM', h.radius_inv.trans hMM', h.shear_inv.trans hMM', |
| 349 | h.lambda_inv.trans hMM', h.ratio_inv.trans hMM'⟩ |
| 350 | |
| 351 | theorem ParameterBounds.positive_lower {M R F : ℝ} {g : Plane} |
| 352 | (h : ParameterBounds M R F g) (hM : 1 ≤ M) (hR : 0 < R) (hc : ReferenceCone F g) : |
| 353 | M⁻¹ ≤ R ∧ M⁻¹ ≤ ‖g‖ ∧ M⁻¹ ≤ lambda0 F g ∧ M⁻¹ ≤ |c0 F g| := by |
| 354 | have hM0 : 0 < M := lt_of_lt_of_le zero_lt_one hM |
| 355 | exact ⟨reciprocal_lower hM0 hR h.radius_inv, |
| 356 | reciprocal_lower hM0 (norm_pos_iff.mpr hc.shear_ne_zero) h.shear_inv, |
| 357 | reciprocal_lower hM0 hc.lambda0_pos h.lambda_inv, |
| 358 | reciprocal_lower hM0 (abs_pos.mpr hc.c0_neg.ne) h.ratio_inv⟩ |
| 359 | |
| 360 | /-! ## A fixed compact set from the actual normalized similarity range -/ |
| 361 | |
| 362 | /-- Normalized active points, including the limiting time face `T = 0`. -/ |
| 363 | noncomputable def activeReference (h a b : ℝ) : Set Slow := |
| 364 | {p | 0 ≤ p.1 ∧ 0 ≤ p.2.2 ∧ ∃ q ∈ Icc (1 / 2 : ℝ) 2, |
| 365 | SimilarityCoordinates.forwardScalar (2 * h) p.2.1 q = p.2.2 ∧ |
| 366 | p.1 ^ 2 / (2 * q) ∈ Icc a b} |
| 367 | |
| 368 | noncomputable def referenceBox (a b : ℝ) : Set Slow := |
| 369 | Icc (Real.sqrt a) (2 * Real.sqrt b) ×ˢ (Icc (-2 : ℝ) 2 ×ˢ Icc (0 : ℝ) 2) |
| 370 | |
| 371 | noncomputable def referenceCompact (h a b : ℝ) : Set Slow := closure (activeReference h a b) |
| 372 | |
| 373 | theorem activeReference_subset_box {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / 2) |
| 374 | (ha : 0 < a) (hab : a ≤ b) : activeReference h a b ⊆ referenceBox a b := by |
| 375 | rintro p ⟨hR, hT, q, hq, he, hX⟩ |
| 376 | have hq0 : 0 < q := by linarith [hq.1] |
| 377 | have hb : 0 < b := ha.trans_le hab |
| 378 | have hp : 0 < q ^ (2 * h) := Real.rpow_pos_of_pos hq0 _ |
| 379 | have hfactor : q ^ (2 * h) * (q ^ (1 - 2 * h) - p.2.1 ^ 2) = p.2.2 := by |
| 380 | rw [← SimilarityCoordinates.forwardScalar_factor hq0] |
| 381 | exact he |
| 382 | have hZ : p.2.1 ^ 2 ≤ q ^ (1 - 2 * h) := by nlinarith |
| 383 | have hqpow : q ^ (1 - 2 * h) ≤ 2 := by |
| 384 | calc |
| 385 | q ^ (1 - 2 * h) ≤ (2 : ℝ) ^ (1 - 2 * h) := |
| 386 | Real.rpow_le_rpow hq0.le hq.2 (by linarith) |
| 387 | _ ≤ (2 : ℝ) ^ (1 : ℝ) := |
| 388 | Real.rpow_le_rpow_of_exponent_le (by norm_num) (by linarith) |
| 389 | _ = 2 := Real.rpow_one _ |
| 390 | have hRlo := (le_div_iff₀ (show 0 < 2 * q by positivity)).mp hX.1 |
| 391 | have hRhi := (div_le_iff₀ (show 0 < 2 * q by positivity)).mp hX.2 |
| 392 | have hRlower : a ≤ p.1 ^ 2 := by nlinarith [hq.1] |
| 393 | have hRupper : p.1 ^ 2 ≤ 4 * b := by nlinarith [hq.2] |
| 394 | have hsa := Real.sq_sqrt ha.le |
| 395 | have hsb := Real.sq_sqrt hb.le |
| 396 | have hTq : p.2.2 ≤ q := by |
| 397 | dsimp [SimilarityCoordinates.forwardScalar] at he |
| 398 | nlinarith [sq_nonneg p.2.1] |
| 399 | refine ⟨⟨?_, ?_⟩, ⟨⟨?_, ?_⟩, ⟨hT, hTq.trans hq.2⟩⟩⟩ |
| 400 | · nlinarith [Real.sqrt_nonneg a] |
| 401 | · nlinarith [Real.sqrt_nonneg b] |
| 402 | · nlinarith |
| 403 | · nlinarith |
| 404 | |
| 405 | theorem referenceCompact_subset_box {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / 2) |
| 406 | (ha : 0 < a) (hab : a ≤ b) : referenceCompact h a b ⊆ referenceBox a b := |
| 407 | closure_minimal (activeReference_subset_box hh hh1 ha hab) |
| 408 | (isClosed_Icc.prod (isClosed_Icc.prod isClosed_Icc)) |
| 409 | |
| 410 | theorem referenceCompact_isCompact {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / 2) |
| 411 | (ha : 0 < a) (hab : a ≤ b) : IsCompact (referenceCompact h a b) := |
| 412 | (isCompact_Icc.prod (isCompact_Icc.prod isCompact_Icc)).of_isClosed_subset |
| 413 | isClosed_closure (referenceCompact_subset_box hh hh1 ha hab) |
| 414 | |
| 415 | theorem referenceCompact_radius_pos {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / 2) |
| 416 | (ha : 0 < a) (hab : a ≤ b) {q : Slow} (hq : q ∈ referenceCompact h a b) : 0 < q.1 := |
| 417 | (Real.sqrt_pos.mpr ha).trans_le (referenceCompact_subset_box hh hh1 ha hab hq).1.1 |
| 418 | |
| 419 | /-- One explicit convex chart containing the whole normalized compact set. -/ |
| 420 | noncomputable def baseChart (a b : ℝ) : Set Slow := |
| 421 | Ioo (Real.sqrt a / 2) (2 * Real.sqrt b + 1) ×ˢ |
| 422 | (Ioo (-3 : ℝ) 3 ×ˢ Ioo (-1 : ℝ) 3) |
| 423 | |
| 424 | theorem baseChart_open (a b : ℝ) : IsOpen (baseChart a b) := |
| 425 | isOpen_Ioo.prod (isOpen_Ioo.prod isOpen_Ioo) |
| 426 | |
| 427 | theorem referenceCompact_subset_baseChart {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / 2) |
| 428 | (ha : 0 < a) (hab : a ≤ b) : referenceCompact h a b ⊆ baseChart a b := by |
| 429 | intro q hq |
| 430 | obtain ⟨hR, hZ, hT⟩ := referenceCompact_subset_box hh hh1 ha hab hq |
| 431 | have hsa := Real.sqrt_pos.mpr ha |
| 432 | exact ⟨⟨by linarith [hR.1], by linarith [hR.2]⟩, |
| 433 | ⟨⟨by linarith [hZ.1], by linarith [hZ.2]⟩, |
| 434 | ⟨by linarith [hT.1], by linarith [hT.2]⟩⟩⟩ |
| 435 | |
| 436 | theorem normalizedSlow_coordinates (D : ℝ) (n : ℕ) (x : Position) : |
| 437 | normalizedSlow D n x = |
| 438 | (x 0 / ChartScales.Q n ^ (1 / 2 : ℝ), (x 1 / ChartScales.Q n ^ D, x 2 / ChartScales.Q n)) := by |
| 439 | simp [normalizedSlow, slow, SquaredPartition.slowCoordinates, SlotColoring.axisExponent] |
| 440 | |
| 441 | /-- The physical similarity equation and the actual dyadic mask put every |
| 442 | active point into the same compact reference set, independent of its label. -/ |
| 443 | theorem physicalMask_normalized_mem {h a b : ℝ} (L : Label) {q : ℝ} {x : Position} |
| 444 | (hq : 0 < q) (hR : 0 ≤ x 0) (hT : 0 ≤ x 2) |
| 445 | (he : SimilarityCoordinates.forwardScalar (2 * h) (x 1) q = x 2) |
| 446 | (hX : x 0 ^ 2 / (2 * q) ∈ Icc a b) |
| 447 | (hm : PartitionedCovariance.mask (CoordinateAlgebra.D h) L q x ≠ 0) : |
| 448 | normalizedSlow (CoordinateAlgebra.D h) L.1 x ∈ referenceCompact h a b := by |
| 449 | apply subset_closure |
| 450 | have hQ := ChartScales.Q_pos L.1 |
| 451 | have hQp : 0 < ChartScales.Q L.1 ^ CoordinateAlgebra.D h := Real.rpow_pos_of_pos hQ _ |
| 452 | rw [physicalMask_nativeMask] at hm |
| 453 | have hd : q ∈ support (SquaredPartition.dyadicMask (L.1 : ℤ)) := (mul_ne_zero_iff.mp hm).1 |
| 454 | rw [SquaredPartition.dyadicMask_support, SquaredPartition.integerQ_nat] at hd |
| 455 | have hqn : q / ChartScales.Q L.1 ∈ Icc (1 / 2 : ℝ) 2 := by |
| 456 | constructor |
| 457 | · apply (le_div_iff₀ hQ).mpr |
| 458 | linarith [hd.1] |
| 459 | · exact (div_le_iff₀ hQ).mpr hd.2.le |
| 460 | have hs := SimilarityHomogeneity.forwardScalar_scale hQ (div_pos hq hQ) (2 * h) |
| 461 | (x 1 / ChartScales.Q L.1 ^ CoordinateAlgebra.D h) |
| 462 | have hD : (1 - 2 * h) / 2 = CoordinateAlgebra.D h := by |
| 463 | unfold CoordinateAlgebra.D |
| 464 | ring |
| 465 | rw [hD, mul_div_cancel₀ _ hQp.ne', mul_div_cancel₀ _ hQ.ne', he] at hs |
| 466 | have hnormeq : SimilarityCoordinates.forwardScalar (2 * h) |
| 467 | (x 1 / ChartScales.Q L.1 ^ CoordinateAlgebra.D h) (q / ChartScales.Q L.1) = |
| 468 | x 2 / ChartScales.Q L.1 := by |
| 469 | apply (eq_div_iff hQ.ne').mpr |
| 470 | nlinarith [hs] |
| 471 | have hroot : (ChartScales.Q L.1 ^ (1 / 2 : ℝ)) ^ 2 = ChartScales.Q L.1 := by |
| 472 | rw [← Real.rpow_mul_natCast hQ.le] |
| 473 | norm_num |
| 474 | have hratio : (x 0 / ChartScales.Q L.1 ^ (1 / 2 : ℝ)) ^ 2 / |
| 475 | (2 * (q / ChartScales.Q L.1)) = x 0 ^ 2 / (2 * q) := by |
| 476 | rw [div_pow, hroot] |
| 477 | field_simp |
| 478 | rw [normalizedSlow_coordinates] |
| 479 | refine ⟨div_nonneg hR (Real.rpow_pos_of_pos hQ _).le, div_nonneg hT hQ.le, |
| 480 | q / ChartScales.Q L.1, hqn, hnormeq, ?_⟩ |
| 481 | simpa only [hratio] using hX |
| 482 | |
| 483 | /-! ## One target-direction parameter, with uniform mixed-point slack -/ |
| 484 | |
| 485 | noncomputable def targetRatio (F : ℝ) (g T : Plane) : ℝ := |
| 486 | |c0 F g * ⟪T, transverseDirection g⟫_ℝ / ⟪T, normalDirection g⟫_ℝ| |
| 487 | |
| 488 | /-- `T` is a continuous target direction, including at zero-amplitude edges. -/ |
| 489 | structure TargetCone (F : ℝ) (g T : Plane) : Prop where |
| 490 | inward : ⟪T, normalDirection g⟫_ℝ < 0 |
| 491 | ratio_lt_one : targetRatio F g T < 1 |
| 492 | |
| 493 | noncomputable def slopeRatio (u : ℝ) : ℝ := u / Real.sqrt (1 + u ^ 2) |
| 494 | |
| 495 | theorem exists_slopeRatio_gt {r : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) : |
| 496 | ∃ u : ℝ, 0 < u ∧ r < slopeRatio u := by |
| 497 | have hsq : 0 < 1 - r ^ 2 := by nlinarith |
| 498 | let u := (Real.sqrt (1 - r ^ 2))⁻¹ |
| 499 | have hu : 0 < u := inv_pos.mpr (Real.sqrt_pos.mpr hsq) |
| 500 | have hp : u ^ 2 * (1 - r ^ 2) = 1 := by |
| 501 | dsimp [u] |
| 502 | rw [inv_pow, Real.sq_sqrt hsq.le, inv_mul_cancel₀ hsq.ne'] |
| 503 | have hroot : 0 < Real.sqrt (1 + u ^ 2) := Real.sqrt_pos.mpr (by positivity) |
| 504 | have hsquare : (r * Real.sqrt (1 + u ^ 2)) ^ 2 < u ^ 2 := by |
| 505 | rw [mul_pow, Real.sq_sqrt (show 0 ≤ 1 + u ^ 2 by positivity)] |
| 506 | nlinarith |
| 507 | refine ⟨u, hu, (lt_div_iff₀ hroot).mpr ?_⟩ |
| 508 | by_contra! hn |
| 509 | have hbad := pow_le_pow_left₀ hu.le hn 2 |
| 510 | linarith |
| 511 | |
| 512 | theorem slopeRatio_lt_one (u : ℝ) : slopeRatio u < 1 := by |
| 513 | have hp : 0 < Real.sqrt (1 + u ^ 2) := Real.sqrt_pos.mpr (by positivity) |
| 514 | apply (div_lt_one hp).mpr |
| 515 | have hs := Real.sq_sqrt (show 0 ≤ 1 + u ^ 2 by positivity) |
| 516 | nlinarith [Real.sqrt_nonneg (1 + u ^ 2)] |
| 517 | |
| 518 | theorem targetRatio_continuousOn {K : Set Slow} {F : Slow → ℝ} {g T : Slow → Plane} |
| 519 | (hF : ContinuousOn F K) (hg : ContinuousOn g K) (hT : ContinuousOn T K) |
| 520 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) |
| 521 | (ht : ∀ q ∈ K, TargetCone (F q) (g q) (T q)) : |
| 522 | ContinuousOn (fun q => targetRatio (F q) (g q) (T q)) K := by |
| 523 | have hn := normalDirection_continuousOn hg (fun q hq => (hc q hq).shear_ne_zero) |
| 524 | have hk := transverseDirection_continuousOn hg (fun q hq => (hc q hq).shear_ne_zero) |
| 525 | exact (((c0_continuousOn hF hg hc).mul (hT.inner hk)).div (hT.inner hn) |
| 526 | (fun q hq => (ht q hq).inward.ne)).abs |
| 527 | |
| 528 | theorem compact_target_choice {K : Set Slow} (hK : IsCompact K) |
| 529 | {F : Slow → ℝ} {g T : Slow → Plane} |
| 530 | (hF : ContinuousOn F K) (hg : ContinuousOn g K) (hT : ContinuousOn T K) |
| 531 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) |
| 532 | (ht : ∀ q ∈ K, TargetCone (F q) (g q) (T q)) : |
| 533 | ∃ u η : ℝ, 0 < u ∧ 0 < η ∧ ∀ q ∈ K, |
| 534 | ⟪T q, normalDirection (g q)⟫_ℝ ≤ -η ∧ |
| 535 | targetRatio (F q) (g q) (T q) + η ≤ slopeRatio u := by |
| 536 | have hn := normalDirection_continuousOn hg (fun q hq => (hc q hq).shear_ne_zero) |
| 537 | obtain ⟨d, hd, hdb⟩ := UniformCone.positive_uniform_margin hK (hT.inner hn).fun_neg |
| 538 | (fun q hq => neg_pos.mpr (ht q hq).inward) |
| 539 | obtain ⟨e, he, heb⟩ := UniformCone.positive_uniform_margin hK |
| 540 | (continuousOn_const.fun_sub (targetRatio_continuousOn hF hg hT hc ht)) |
| 541 | (fun q hq => sub_pos.mpr (ht q hq).ratio_lt_one) |
| 542 | let r := 1 - min e (1 / 2) |
| 543 | have hr : 0 ≤ r := by dsimp [r]; linarith [min_le_right e (1 / 2 : ℝ)] |
| 544 | have hr1 : r < 1 := by dsimp [r]; linarith [lt_min he (by norm_num : (0 : ℝ) < 1 / 2)] |
| 545 | obtain ⟨u, hu, hur⟩ := exists_slopeRatio_gt hr hr1 |
| 546 | let η := min d ((slopeRatio u - r) / 2) |
| 547 | have hη : 0 < η := lt_min hd (half_pos (sub_pos.mpr hur)) |
| 548 | refine ⟨u, η, hu, hη, fun q hq => ?_⟩ |
| 549 | have hηd : η ≤ d := min_le_left _ _ |
| 550 | have hηr : η ≤ (slopeRatio u - r) / 2 := min_le_right _ _ |
| 551 | have hratio : targetRatio (F q) (g q) (T q) ≤ r := by |
| 552 | dsimp [r] |
| 553 | linarith [heb q hq, min_le_left e (1 / 2 : ℝ)] |
| 554 | refine ⟨by linarith [hdb q hq], ?_⟩ |
| 555 | calc |
| 556 | targetRatio (F q) (g q) (T q) + η ≤ r + (slopeRatio u - r) / 2 := |
| 557 | add_le_add hratio hηr |
| 558 | _ ≤ r + (slopeRatio u - r) := |
| 559 | add_le_add_right (half_le_self (sub_pos.mpr hur).le) r |
| 560 | _ = slopeRatio u := by ring |
| 561 | |
| 562 | /-- A continuous positive diagonal on a compact set stays positive at |
| 563 | nearby pairs, with one distance independent of the base point. -/ |
| 564 | theorem compact_diagonal_positive {K : Set Slow} (hK : IsCompact K) |
| 565 | {f : Slow × Slow → ℝ} (hf : ContinuousOn f (K ×ˢ K)) |
| 566 | (hpos : ∀ q ∈ K, 0 < f (q, q)) : |
| 567 | ∃ δ : ℝ, 0 < δ ∧ ∀ q₀ ∈ K, ∀ q ∈ K, dist q q₀ < δ → 0 < f (q₀, q) := by |
| 568 | have hd : ContinuousOn (fun q => f (q, q)) K := |
| 569 | hf.comp (continuous_id.prodMk continuous_id).continuousOn (fun _ hq => ⟨hq, hq⟩) |
| 570 | obtain ⟨m, hm, hmb⟩ := UniformCone.positive_uniform_margin hK hd hpos |
| 571 | obtain ⟨δ, hδ, hb⟩ := Metric.uniformContinuousOn_iff.mp |
| 572 | ((hK.prod hK).uniformContinuousOn_of_continuous hf) |
| 573 | (m / 2) (half_pos hm) |
| 574 | refine ⟨δ, hδ, fun q₀ h₀ q hq hdist => ?_⟩ |
| 575 | have hp : dist (q₀, q) (q₀, q₀) < δ := by |
| 576 | rw [Prod.dist_eq, dist_self, max_eq_right dist_nonneg] |
| 577 | exact hdist |
| 578 | have hh := hb (q₀, q) ⟨h₀, hq⟩ (q₀, q₀) ⟨h₀, h₀⟩ hp |
| 579 | rw [Real.dist_eq] at hh |
| 580 | have hlo := (abs_lt.mp hh).1 |
| 581 | linarith [hmb q₀ h₀] |
| 582 | |
| 583 | theorem compact_mixed_target {K : Set Slow} (hK : IsCompact K) |
| 584 | {F : Slow → ℝ} {g T : Slow → Plane} |
| 585 | (hF : ContinuousOn F K) (hg : ContinuousOn g K) (hT : ContinuousOn T K) |
| 586 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) |
| 587 | (ht : ∀ q ∈ K, TargetCone (F q) (g q) (T q)) : |
| 588 | ∃ u δ : ℝ, 0 < u ∧ 0 < δ ∧ ∀ q₀ ∈ K, ∀ q ∈ K, dist q q₀ < δ → |
| 589 | ⟪T q, normalDirection (g q₀)⟫_ℝ < 0 ∧ |
| 590 | |c0 (F q₀) (g q₀) * ⟪T q, transverseDirection (g q₀)⟫_ℝ / |
| 591 | ⟪T q, normalDirection (g q₀)⟫_ℝ| < slopeRatio u := by |
| 592 | obtain ⟨u, η, hu, hη, hb⟩ := compact_target_choice hK hF hg hT hc ht |
| 593 | have hn : ContinuousOn (fun z : Slow × Slow => normalDirection (g z.1)) (K ×ˢ K) := |
| 594 | (normalDirection_continuousOn hg (fun q hq => (hc q hq).shear_ne_zero)).comp |
| 595 | continuous_fst.continuousOn (fun _ hq => hq.1) |
| 596 | have hk : ContinuousOn (fun z : Slow × Slow => transverseDirection (g z.1)) (K ×ˢ K) := |
| 597 | (transverseDirection_continuousOn hg (fun q hq => (hc q hq).shear_ne_zero)).comp |
| 598 | continuous_fst.continuousOn (fun _ hq => hq.1) |
| 599 | have hc0 : ContinuousOn (fun z : Slow × Slow => c0 (F z.1) (g z.1)) (K ×ˢ K) := |
| 600 | (c0_continuousOn hF hg hc).comp continuous_fst.continuousOn (fun _ hq => hq.1) |
| 601 | have ht' : ContinuousOn (fun z : Slow × Slow => T z.2) (K ×ˢ K) := |
| 602 | hT.comp continuous_snd.continuousOn (fun _ hq => hq.2) |
| 603 | let a : Slow × Slow → ℝ := fun z => -⟪T z.2, normalDirection (g z.1)⟫_ℝ |
| 604 | let b : Slow × Slow → ℝ := fun z => slopeRatio u * a z - |
| 605 | |c0 (F z.1) (g z.1) * ⟪T z.2, transverseDirection (g z.1)⟫_ℝ| |
| 606 | have ha : ContinuousOn a (K ×ˢ K) := (ht'.inner hn).neg |
| 607 | have hb' : ContinuousOn b (K ×ˢ K) := |
| 608 | (continuousOn_const.mul ha).sub (hc0.mul (ht'.inner hk)).abs |
| 609 | obtain ⟨δa, hδa, hpa⟩ := compact_diagonal_positive hK ha |
| 610 | (fun q hq => neg_pos.mpr (ht q hq).inward) |
| 611 | have hbp : ∀ q ∈ K, 0 < b (q, q) := by |
| 612 | intro q hq |
| 613 | have hratio : targetRatio (F q) (g q) (T q) < slopeRatio u := by linarith [(hb q hq).2] |
| 614 | rw [targetRatio, abs_div, abs_of_neg (ht q hq).inward] at hratio |
| 615 | exact sub_pos.mpr ((div_lt_iff₀ (neg_pos.mpr (ht q hq).inward)).mp hratio) |
| 616 | obtain ⟨δb, hδb, hpb⟩ := compact_diagonal_positive hK hb' hbp |
| 617 | refine ⟨u, min δa δb, hu, lt_min hδa hδb, fun q₀ h₀ q hq hdist => ?_⟩ |
| 618 | have hneg : ⟪T q, normalDirection (g q₀)⟫_ℝ < 0 := |
| 619 | neg_pos.mp (hpa q₀ h₀ q hq (hdist.trans_le (min_le_left _ _))) |
| 620 | refine ⟨hneg, ?_⟩ |
| 621 | rw [abs_div, abs_of_neg hneg] |
| 622 | apply (div_lt_iff₀ (neg_pos.mpr hneg)).mpr |
| 623 | exact sub_pos.mp (hpb q₀ h₀ q hq (hdist.trans_le (min_le_right _ _))) |
| 624 | |
| 625 | /-- The mixed-point cone has a positive numerical margin independent of |
| 626 | both points. The single selected `u` is strictly above the supremum. -/ |
| 627 | theorem compact_mixed_target_margin {K : Set Slow} (hK : IsCompact K) |
| 628 | {F : Slow → ℝ} {g T : Slow → Plane} |
| 629 | (hF : ContinuousOn F K) (hg : ContinuousOn g K) (hT : ContinuousOn T K) |
| 630 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) |
| 631 | (ht : ∀ q ∈ K, TargetCone (F q) (g q) (T q)) : |
| 632 | ∃ u η δ : ℝ, 0 < u ∧ 0 < η ∧ 0 < δ ∧ ∀ q₀ ∈ K, ∀ q ∈ K, dist q q₀ < δ → |
| 633 | ⟪T q, normalDirection (g q₀)⟫_ℝ ≤ -η ∧ |
| 634 | |c0 (F q₀) (g q₀) * ⟪T q, transverseDirection (g q₀)⟫_ℝ / |
| 635 | ⟪T q, normalDirection (g q₀)⟫_ℝ| + η ≤ slopeRatio u := by |
| 636 | obtain ⟨u₀, δ₀, hu₀, hδ₀, hbase⟩ := compact_mixed_target hK hF hg hT hc ht |
| 637 | have hr₀ : 0 ≤ slopeRatio u₀ := div_nonneg hu₀.le (Real.sqrt_nonneg _) |
| 638 | obtain ⟨u, hu, hgap⟩ := exists_slopeRatio_gt hr₀ (slopeRatio_lt_one u₀) |
| 639 | have hn₀ := normalDirection_continuousOn hg (fun q hq => (hc q hq).shear_ne_zero) |
| 640 | obtain ⟨m, hm, hmb⟩ := UniformCone.positive_uniform_margin hK (hT.inner hn₀).fun_neg |
| 641 | (fun q hq => neg_pos.mpr (ht q hq).inward) |
| 642 | have hn : ContinuousOn (fun z : Slow × Slow => normalDirection (g z.1)) (K ×ˢ K) := |
| 643 | hn₀.comp continuous_fst.continuousOn (fun _ hq => hq.1) |
| 644 | have hT' : ContinuousOn (fun z : Slow × Slow => T z.2) (K ×ˢ K) := |
| 645 | hT.comp continuous_snd.continuousOn (fun _ hq => hq.2) |
| 646 | have hcont : ContinuousOn (fun z : Slow × Slow => |
| 647 | -⟪T z.2, normalDirection (g z.1)⟫_ℝ - m / 2) (K ×ˢ K) := |
| 648 | (hT'.inner hn).neg.sub continuousOn_const |
| 649 | obtain ⟨δ₁, hδ₁, hden⟩ := compact_diagonal_positive hK hcont |
| 650 | (fun q hq => by dsimp only; linarith [hmb q hq]) |
| 651 | let η := min (m / 2) ((slopeRatio u - slopeRatio u₀) / 2) |
| 652 | have hη : 0 < η := lt_min (half_pos hm) (half_pos (sub_pos.mpr hgap)) |
| 653 | refine ⟨u, η, min δ₀ δ₁, hu, hη, lt_min hδ₀ hδ₁, fun q₀ h₀ q hq hd => ?_⟩ |
| 654 | have hinner := hden q₀ h₀ q hq (hd.trans_le (min_le_right _ _)) |
| 655 | have hratio := (hbase q₀ h₀ q hq (hd.trans_le (min_le_left _ _))).2 |
| 656 | have hηm : η ≤ m / 2 := min_le_left _ _ |
| 657 | have hηgap : η ≤ (slopeRatio u - slopeRatio u₀) / 2 := min_le_right _ _ |
| 658 | refine ⟨by dsimp only at hinner; linarith, ?_⟩ |
| 659 | calc |
| 660 | _ ≤ slopeRatio u₀ + (slopeRatio u - slopeRatio u₀) / 2 := add_le_add hratio.le hηgap |
| 661 | _ ≤ slopeRatio u₀ + (slopeRatio u - slopeRatio u₀) := |
| 662 | add_le_add_right (half_le_self (sub_pos.mpr hgap).le) _ |
| 663 | _ = slopeRatio u := by ring |
| 664 | |
| 665 | theorem representative_target_margin {K : Set Slow} (hK : IsCompact K) |
| 666 | {F : Slow → ℝ} {g T : Slow → Plane} |
| 667 | (hF : ContinuousOn F K) (hg : ContinuousOn g K) (hT : ContinuousOn T K) |
| 668 | (hc : ∀ q ∈ K, ReferenceCone (F q) (g q)) |
| 669 | (ht : ∀ q ∈ K, TargetCone (F q) (g q) (T q)) : |
| 670 | ∃ u η : ℝ, 0 < u ∧ 0 < η ∧ ∃ N : ℕ, ∀ L : ActiveLabel K, N ≤ L.val.1 → |
| 671 | ∀ q ∈ K, q ∈ gridBox L.val.1 L.val.2 2 → |
| 672 | ⟪T q, normalDirection (g (representative K L))⟫_ℝ ≤ -η ∧ |
| 673 | |c0 (F (representative K L)) (g (representative K L)) * |
| 674 | ⟪T q, transverseDirection (g (representative K L))⟫_ℝ / |
| 675 | ⟪T q, normalDirection (g (representative K L))⟫_ℝ| + η ≤ slopeRatio u := by |
| 676 | obtain ⟨u, η, δ, hu, hη, hδ, hb⟩ := compact_mixed_target_margin hK hF hg hT hc ht |
| 677 | obtain ⟨N, hN⟩ := eventually_atTop.mp ((tendsto_order.1 grid_mesh_tendsto_zero).2 δ hδ) |
| 678 | refine ⟨u, η, hu, hη, N, fun L hL q hq hbox => hb _ (representative_mem K L) q hq ?_⟩ |
| 679 | simpa only [dist_eq_norm] using |
| 680 | (representative_enlarged_distance K L hbox).trans_lt (hN _ hL) |
| 681 | |
| 682 | theorem targetRatio_smul (F : ℝ) (g T : Plane) {a : ℝ} (ha : a ≠ 0) : |
| 683 | targetRatio F g (a • T) = targetRatio F g T := by |
| 684 | unfold targetRatio |
| 685 | rw [real_inner_smul_left, real_inner_smul_left] |
| 686 | congr 1 |
| 687 | rw [show c0 F g * (a * ⟪T, transverseDirection g⟫_ℝ) = |
| 688 | a * (c0 F g * ⟪T, transverseDirection g⟫_ℝ) by ring] |
| 689 | exact mul_div_mul_left _ _ ha |
| 690 | |
| 691 | theorem TargetCone.pos_smul {F : ℝ} {g T : Plane} (h : TargetCone F g T) |
| 692 | {a : ℝ} (ha : 0 < a) : TargetCone F g (a • T) := by |
| 693 | refine ⟨?_, ?_⟩ |
| 694 | · rw [real_inner_smul_left] |
| 695 | exact mul_neg_of_pos_of_neg ha h.inward |
| 696 | · rw [targetRatio_smul F g T ha.ne'] |
| 697 | exact h.ratio_lt_one |
| 698 | |
| 699 | end NavierStokes.PrimaryRepresentatives |