math / data /lean /OAI /MathematicalPhysics /NavierStokes /VelocityDetection /ExpandingArrayLoss.lean
Download data/lean/OAI/MathematicalPhysics/NavierStokes/VelocityDetection/ExpandingArrayLoss.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 17.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/NavierStokes/VelocityDetection/ExpandingArrayLoss.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/NavierStokes/VelocityDetection/ExpandingArrayLoss.lean
-
curl -L -o ExpandingArrayLoss.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/NavierStokes/VelocityDetection/ExpandingArrayLoss.lean
17.1 kB
| import OAI.MathematicalPhysics.NavierStokes.VelocityDetection.CutoffRetention | |
| import OAI.MathematicalPhysics.NavierStokes.VelocityDetection.ArrayTrajectories | |
| import OAI.MathematicalPhysics.NavierStokes.VelocityDetection.CutoffCutoffZeroOnUpper | |
| namespace OAI | |
| noncomputable section | |
| namespace VelocityDetection.ExpandingArray | |
| open scoped BigOperators Topology ContDiff | |
| open Set Function Filter | |
| open Set Function Filter MeasureTheory | |
| open scoped Topology BigOperators ContDiff | |
| open scoped Topology ContDiff BigOperators | |
| open Expanding Stacks FiniteAddresses MovingCutoff SmoothProfiles SpatialCalculus | |
| variable {N b : β} (hb : 0 < b) (table : Fin N β Fin b β Option (Rule (Fin N) b)) | |
| (terminal : Fin N) (Ξ½ : β) (m : β) (cβ : Configuration (Fin N)) | |
| def loss : β := Ξ½ * 3000 * ((initialRadius Ξ½ (Kβ N b m) (D b))β»ΒΉ ^ 2 + | |
| β' n : β, duration Ξ½ (Kβ N b m) (D b) n / radius Ξ½ (Kβ N b m) (D b) n ^ 2) | |
| include hb in | |
| theorem loss_lt (hΞ½ : 0 < Ξ½) : loss (N := N) (b := b) Ξ½ m < (1 / 24 : β) := | |
| total_loss_lt hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) | |
| include hb in | |
| theorem loading_loss_le_loss (hΞ½ : 0 < Ξ½) : | |
| Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) 0 ^ 2 β€ loss (N := N) (b := b) Ξ½ m := by | |
| have heq : Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) 0 ^ 2 = | |
| Ξ½ * 3000 * (initialRadius Ξ½ (Kβ N b m) (D b))β»ΒΉ ^ 2 := by | |
| simp only [radius, pow_zero, mul_one, inv_pow, div_eq_mul_inv] | |
| rw [heq, loss, mul_add] | |
| have hs : 0 β€ β' n : β, duration Ξ½ (Kβ N b m) (D b) n / | |
| radius Ξ½ (Kβ N b m) (D b) n ^ 2 := | |
| tsum_nonneg (fun n => (loss_term_bound hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) n).1) | |
| have : 0 β€ Ξ½ * 3000 * (β' n : β, duration Ξ½ (Kβ N b m) (D b) n / | |
| radius Ξ½ (Kβ N b m) (D b) n ^ 2) := by positivity | |
| linarith | |
| theorem field_slice_component (hΞ½ : 0 < Ξ½) (t : β) (i : Fin 2) : | |
| ContDiff β 1 (fun X => field hb table terminal Ξ½ m t X i) := | |
| ((contDiff_apply β β i).comp | |
| (SpatialCalculus.contDiff_slice (contDiff_field hb table terminal Ξ½ m hΞ½) t)).of_le (by simp) | |
| end VelocityDetection.ExpandingArray | |
| end | |
| noncomputable section | |
| namespace VelocityDetection.ExpandingArray | |
| open scoped BigOperators Topology ContDiff | |
| open Set Function Filter | |
| open Set Function Filter MeasureTheory | |
| open scoped Topology BigOperators ContDiff | |
| open scoped Topology ContDiff BigOperators | |
| open Expanding Stacks FiniteAddresses MovingCutoff SmoothProfiles SpatialCalculus | |
| variable {N b : β} (hb : 0 < b) (table : Fin N β Fin b β Option (Rule (Fin N) b)) | |
| (terminal : Fin N) (Ξ½ : β) (m : β) (cβ : Configuration (Fin N)) | |
| variable (hΞ½ : 0 < Ξ½) {Ο : ScalarField 2} | |
| (hΟ : ContDiff β 2 (uncurry Ο)) | |
| (heq : β t, 0 β€ t β β X, | |
| deriv (fun s => Ο s X) t + advection (field hb table terminal Ξ½ m) Ο t X = | |
| Ξ½ * laplacian Ο t X + impulse (point hb table terminal Ξ½ m cβ 0) t X) | |
| (hΟinit : β X, Ο 0 X = 0) | |
| (hΟint : β t, 0 β€ t β Integrable (Ο t)) | |
| (hΟnonneg : β t, 0 β€ t β β X, 0 β€ Ο t X) | |
| (hmass : β t, 0 β€ t β (β« X, Ο t X) = step t) | |
| include hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| theorem retained_loading {t : β} (ht : t β Icc (0 : β) 1) : | |
| (β« X, Ο t X) - capture (radius Ξ½ (Kβ N b m) (D b) 0) | |
| (fun _ => point hb table terminal Ξ½ m cβ 0) Ο t β€ | |
| Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) 0 ^ 2 := by | |
| have hR : 0 < radius Ξ½ (Kβ N b m) (D b) 0 := | |
| lt_of_lt_of_le zero_lt_one (radius_ge_one hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) 0) | |
| have hu (s : β) (hs : s β Ioo (0 : β) t) : 0 β€ s := hs.1.le | |
| have h := retention_on_interval (Ξ½ := Ξ½) | |
| (R := radius Ξ½ (Kβ N b m) (D b) 0) | |
| (a := field hb table terminal Ξ½ m) (g := impulse (point hb table terminal Ξ½ m cβ 0)) | |
| (c := fun _ => point hb table terminal Ξ½ m cβ 0) (M := step) | |
| hR hΞ½.le ht.1 hΟ contDiff_const Real.smoothTransition.continuous.continuousOn | |
| (fun s _ => by rw [integral_impulse]; exact (differentiable_step s).hasDerivAt) | |
| (fun s _ => field_slice_component hb table terminal Ξ½ m hΞ½ s) | |
| (fun s _ => (contDiff_impulse (point hb table terminal Ξ½ m cβ 0)).continuous.comp | |
| (continuous_const.prodMk continuous_id)) | |
| (fun s _ X => divergence_field hb table terminal Ξ½ m hΞ½ s X) | |
| (fun s hs X => heq s (hu s hs) X) | |
| (fun s hs X _ => by | |
| rw [field_at_rest hb table terminal Ξ½ m hΞ½ (hs.2.le.trans ht.2) X] | |
| symm | |
| exact deriv_const s _) | |
| (fun s hs => hΟint s (hu s hs)) (fun s hs => hΟnonneg s (hu s hs)) | |
| (fun s hs => by rw [hmass s (hu s hs)]; exact Real.smoothTransition.le_one s) | |
| (fun s _ X hX i => by | |
| have hsupport := (impulse_support_bound (point hb table terminal Ξ½ m cβ 0) X s hX).2.2 i | |
| have hlarge := radius_ge_one hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) 0 | |
| linarith) | |
| have hz : capture (radius Ξ½ (Kβ N b m) (D b) 0) | |
| (fun _ => point hb table terminal Ξ½ m cβ 0) Ο 0 = 0 := by | |
| simp only [capture, hΟinit, mul_zero, integral_zero] | |
| rw [hz, show step 0 = 0 from Real.smoothTransition.zero_of_nonpos le_rfl, zero_sub, | |
| sub_zero, β hmass t ht.1] at h | |
| have hm := mul_le_mul_of_nonneg_left ht.2 (by positivity : | |
| 0 β€ Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) 0 ^ 2) | |
| exact h.trans (by simpa using hm) | |
| theorem retained_at_loading_end : | |
| step (startTime Ξ½ (Kβ N b m) (D b) 0) - | |
| capture (radius Ξ½ (Kβ N b m) (D b) 0) (runPath hb table terminal Ξ½ m cβ 0) Ο | |
| (startTime Ξ½ (Kβ N b m) (D b) 0) β€ | |
| Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) 0 ^ 2 := by | |
| have hc : capture (radius Ξ½ (Kβ N b m) (D b) 0) | |
| (runPath hb table terminal Ξ½ m cβ 0) Ο (startTime Ξ½ (Kβ N b m) (D b) 0) = | |
| capture (radius Ξ½ (Kβ N b m) (D b) 0) | |
| (fun _ => point hb table terminal Ξ½ m cβ 0) Ο 1 := by | |
| unfold capture | |
| rw [runPath_start] | |
| rfl | |
| rw [hc] | |
| change step 1 - _ β€ _ | |
| rw [β hmass 1 (by norm_num)] | |
| exact retained_loading hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass β¨by norm_num, le_rflβ© | |
| end VelocityDetection.ExpandingArray | |
| end | |
| noncomputable section | |
| namespace VelocityDetection.ExpandingArray | |
| open scoped BigOperators Topology ContDiff | |
| open Set Function Filter | |
| open Set Function Filter MeasureTheory | |
| open scoped Topology BigOperators ContDiff | |
| open scoped Topology ContDiff BigOperators | |
| open Expanding Stacks FiniteAddresses MovingCutoff SmoothProfiles SpatialCalculus | |
| variable {N b : β} (hb : 0 < b) (table : Fin N β Fin b β Option (Rule (Fin N) b)) | |
| (terminal : Fin N) (Ξ½ : β) (m : β) (cβ : Configuration (Fin N)) | |
| variable (hΞ½ : 0 < Ξ½) {Ο : ScalarField 2} | |
| (hΟ : ContDiff β 2 (uncurry Ο)) | |
| (heq : β t, 0 β€ t β β X, | |
| deriv (fun s => Ο s X) t + advection (field hb table terminal Ξ½ m) Ο t X = | |
| Ξ½ * laplacian Ο t X + impulse (point hb table terminal Ξ½ m cβ 0) t X) | |
| (hΟinit : β X, Ο 0 X = 0) | |
| (hΟint : β t, 0 β€ t β Integrable (Ο t)) | |
| (hΟnonneg : β t, 0 β€ t β β X, 0 β€ Ο t X) | |
| (hmass : β t, 0 β€ t β (β« X, Ο t X) = step t) | |
| include hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| variable (hm : 1 β€ m) | |
| (hcβ : cβ.leftStack < capacity b m 0 β§ cβ.rightStack < capacity b m 0) | |
| (hdir : IncomingDirection table) (hin : IncomingRule table) (hterm : NoOutgoing table terminal) | |
| include hm hcβ hdir hin hterm | |
| theorem retained_stages {n : β} | |
| (hactive : β k β€ n, (lookup hb table (orbit hb table cβ k)).isSome) | |
| {t : β} (ht : t β Icc (startTime Ξ½ (Kβ N b m) (D b) n) | |
| (startTime Ξ½ (Kβ N b m) (D b) (n + 1))) : | |
| (β« X, Ο t X) - capture (radius Ξ½ (Kβ N b m) (D b) n) | |
| (runPath hb table terminal Ξ½ m cβ n) Ο t β€ loss (N := N) (b := b) Ξ½ m := by | |
| have hR (k : β) : 0 < radius Ξ½ (Kβ N b m) (D b) k := | |
| lt_of_lt_of_le zero_lt_one (radius_ge_one hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) k) | |
| have hΟ (k : β) : startTime Ξ½ (Kβ N b m) (D b) k β€ startTime Ξ½ (Kβ N b m) (D b) (k + 1) := | |
| (startTime_strictMono hΞ½ (Kβ_nonneg N b m) (D_ge_one hb)).monotone (Nat.le_succ k) | |
| have hu (k : β) (s : β) (hs : s β Icc (startTime Ξ½ (Kβ N b m) (D b) k) | |
| (startTime Ξ½ (Kβ N b m) (D b) (k + 1))) : 1 β€ s := by | |
| linarith [startTime_ge hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) k, | |
| Nat.cast_nonneg (Ξ± := β) k, hs.1] | |
| have loss_eq (k : β) : | |
| (Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) k ^ 2) * | |
| (startTime Ξ½ (Kβ N b m) (D b) (k + 1) - startTime Ξ½ (Kβ N b m) (D b) k) = | |
| Ξ½ * 3000 * (duration Ξ½ (Kβ N b m) (D b) k / radius Ξ½ (Kβ N b m) (D b) k ^ 2) := by | |
| rw [startTime, add_sub_cancel_left] | |
| ring | |
| have hsummable : Summable (fun k => (Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) k ^ 2) * | |
| (startTime Ξ½ (Kβ N b m) (D b) (k + 1) - startTime Ξ½ (Kβ N b m) (D b) k)) := by | |
| simp_rw [loss_eq] | |
| exact (summable_loss hΞ½ (Kβ_nonneg N b m) (D_ge_one hb)).mul_left _ | |
| have h := retention_le_series (Ξ½ := Ξ½) | |
| (R := radius Ξ½ (Kβ N b m) (D b)) (Ο := startTime Ξ½ (Kβ N b m) (D b)) | |
| (a := field hb table terminal Ξ½ m) (g := impulse (point hb table terminal Ξ½ m cβ 0)) | |
| (c := runPath hb table terminal Ξ½ m cβ) (M := step) | |
| hΞ½.le hR hΟ (radius_next_ge hΞ½ (Kβ_nonneg N b m) (D_ge_one hb)) hΟ | |
| (fun k => (contDiff_runPath hb table terminal Ξ½ m cβ k).of_le (by simp)) | |
| (runPath_joins hb table terminal Ξ½ m cβ hΞ½) | |
| (fun _ => Real.smoothTransition.continuous.continuousOn) | |
| (fun _ s _ => by rw [integral_impulse]; exact (differentiable_step s).hasDerivAt) | |
| (fun _ s _ => field_slice_component hb table terminal Ξ½ m hΞ½ s) | |
| (fun _ s _ => (contDiff_impulse (point hb table terminal Ξ½ m cβ 0)).continuous.comp | |
| (continuous_const.prodMk continuous_id)) | |
| (fun _ s _ X => divergence_field hb table terminal Ξ½ m hΞ½ s X) | |
| (fun k s hs X => heq s (by linarith [hu k s β¨hs.1.le, hs.2.leβ©]) X) | |
| (fun k hk s hs X hX => runPath_plateau hb table terminal Ξ½ m cβ hm hcβ hΞ½ hdir hin hterm | |
| k (hactive k hk) β¨hs.1.le, hs.2.leβ© X hX) | |
| (fun k s hs => hΟint s (by linarith [hu k s hs])) | |
| (fun k s hs => hΟnonneg s (by linarith [hu k s hs])) | |
| (fun k s hs => by | |
| rw [hmass s (by linarith [hu k s β¨hs.1.le, hs.2.leβ©])] | |
| exact Real.smoothTransition.le_one s) | |
| (fun k s hs X hX _ => by | |
| have hz := impulse_zero_of_time_one_le (point hb table terminal Ξ½ m cβ 0) | |
| (hu k s β¨hs.1.le, hs.2.leβ©) | |
| exact False.elim (hX (congrFun hz X))) hsummable ht | |
| have hload := retained_at_loading_end hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| rw [β hmass t (by linarith [hu n t ht])] at h | |
| simp_rw [loss_eq] at h | |
| rw [tsum_mul_left] at h | |
| have hbudget : loss (N := N) (b := b) Ξ½ m = Ξ½ * 3000 / radius Ξ½ (Kβ N b m) (D b) 0 ^ 2 + | |
| Ξ½ * 3000 * (β' k : β, duration Ξ½ (Kβ N b m) (D b) k / radius Ξ½ (Kβ N b m) (D b) k ^ 2) := by | |
| simp only [loss, mul_add, radius, pow_zero, mul_one, inv_pow, div_eq_mul_inv] | |
| rw [hbudget] | |
| linarith | |
| end VelocityDetection.ExpandingArray | |
| end | |
| noncomputable section | |
| namespace VelocityDetection.ExpandingArray | |
| open scoped BigOperators Topology ContDiff | |
| open Set Function Filter | |
| open Set Function Filter MeasureTheory | |
| open scoped Topology BigOperators ContDiff | |
| open scoped Topology ContDiff BigOperators | |
| open Expanding Stacks FiniteAddresses MovingCutoff SmoothProfiles SpatialCalculus | |
| variable {N b : β} (hb : 0 < b) (table : Fin N β Fin b β Option (Rule (Fin N) b)) | |
| (terminal : Fin N) (Ξ½ : β) (m : β) (cβ : Configuration (Fin N)) | |
| variable (hΞ½ : 0 < Ξ½) {Ο : ScalarField 2} | |
| (hΟ : ContDiff β 2 (uncurry Ο)) | |
| (heq : β t, 0 β€ t β β X, | |
| deriv (fun s => Ο s X) t + advection (field hb table terminal Ξ½ m) Ο t X = | |
| Ξ½ * laplacian Ο t X + impulse (point hb table terminal Ξ½ m cβ 0) t X) | |
| (hΟinit : β X, Ο 0 X = 0) | |
| (hΟint : β t, 0 β€ t β Integrable (Ο t)) | |
| (hΟnonneg : β t, 0 β€ t β β X, 0 β€ Ο t X) | |
| (hmass : β t, 0 β€ t β (β« X, Ο t X) = step t) | |
| include hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| variable (hm : 1 β€ m) | |
| (hcβ : cβ.leftStack < capacity b m 0 β§ cβ.rightStack < capacity b m 0) | |
| (hdir : IncomingDirection table) (hin : IncomingRule table) (hterm : NoOutgoing table terminal) | |
| include hm hcβ hdir hin hterm | |
| variable (hcont : Continues hb table terminal cβ) | |
| include hcont | |
| theorem nonterminal_mass_small (hnever : Β¬ Reaches hb table terminal cβ) | |
| {t : β} (ht : 0 β€ t) : | |
| (β« X in Observation.upperHalfPlane, Ο t X) < (1 / 4 : β) := by | |
| have hn (k : β) : (orbit hb table cβ k).state β terminal := by | |
| intro he | |
| exact hnever β¨k, heβ© | |
| have hactive (k : β) : (lookup hb table (orbit hb table cβ k)).isSome := hcont k (hn k) | |
| have hR (k : β) : 0 < radius Ξ½ (Kβ N b m) (D b) k := | |
| lt_of_lt_of_le zero_lt_one (radius_ge_one hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) k) | |
| by_cases htβ : t β€ 1 | |
| Β· apply Cutoff.upper_mass_small (hR 0) (hΟint t ht) (hΟnonneg t ht) | |
| (c := point hb table terminal Ξ½ m cβ 0) | |
| (Ξ΄ := loss (N := N) (b := b) Ξ½ m) | |
| Β· have hc : point hb table terminal Ξ½ m cβ 0 1 = -spacing Ξ½ (Kβ N b m) (D b) 0 := by | |
| simp only [point, sign, ite_eq_right (hn 0), neg_one_mul, Matrix.cons_val_one, Matrix.cons_val_zero] | |
| rw [hc, spacing] | |
| linarith [hR 0] | |
| Β· exact loss_lt hb Ξ½ m hΞ½ | |
| Β· exact (retained_loading hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| β¨ht, htββ©).trans (loading_loss_le_loss hb Ξ½ m hΞ½) | |
| Β· obtain β¨n, hstageβ© := time_in_stage hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) (le_of_not_ge htβ) | |
| apply Cutoff.upper_mass_small (hR n) (hΟint t ht) (hΟnonneg t ht) | |
| (c := runPath hb table terminal Ξ½ m cβ n t) | |
| (Ξ΄ := loss (N := N) (b := b) Ξ½ m) | |
| Β· have hneg := runPath_negative hb table terminal Ξ½ m cβ hm hcβ hΞ½ hterm n | |
| (hactive n) (hn (n + 1)) t | |
| rw [spacing] at hneg | |
| linarith [hR n] | |
| Β· exact loss_lt hb Ξ½ m hΞ½ | |
| Β· exact retained_stages hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| hm hcβ hdir hin hterm (fun k _ => hactive k) hstage | |
| theorem terminal_mass_large (hinit : cβ.state β terminal) | |
| (hreach : Reaches hb table terminal cβ) : | |
| β t : β, 0 β€ t β§ (3 / 4 : β) < β« X in Observation.upperHalfPlane, Ο t X := by | |
| let hex : β n, (orbit hb table cβ n).state = terminal := hreach | |
| have hzero : Nat.find hex β 0 := by | |
| intro hz | |
| have h := Nat.find_spec hex | |
| rw [hz, orbit_zero] at h | |
| exact hinit h | |
| obtain β¨n, hnβ© := Nat.exists_eq_succ_of_ne_zero hzero | |
| have hfirst : (orbit hb table cβ (n + 1)).state = terminal := by | |
| simpa only [hn] using Nat.find_spec hex | |
| have hactive (k : β) (hk : k β€ n) : (lookup hb table (orbit hb table cβ k)).isSome := | |
| hcont k (Nat.find_min hex (by omega)) | |
| let t := startTime Ξ½ (Kβ N b m) (D b) (n + 1) | |
| have htβ : 1 β€ t := by | |
| have h := startTime_ge hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) (n + 1) | |
| dsimp [t] | |
| linarith [Nat.cast_nonneg (Ξ± := β) (n + 1)] | |
| have ht : 0 β€ t := by linarith | |
| have hR : 0 < radius Ξ½ (Kβ N b m) (D b) n := | |
| lt_of_lt_of_le zero_lt_one (radius_ge_one hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) n) | |
| refine β¨t, ht, ?_β© | |
| apply Cutoff.upper_mass_large hR (hΟint t ht) (hΟnonneg t ht) | |
| (c := runPath hb table terminal Ξ½ m cβ n t) | |
| (Ξ΄ := loss (N := N) (b := b) Ξ½ m) | |
| Β· dsimp [t] | |
| rw [runPath_end hb table terminal Ξ½ m cβ hΞ½] | |
| have hc : point hb table terminal Ξ½ m cβ (n + 1) 1 = | |
| spacing Ξ½ (Kβ N b m) (D b) (n + 1) := by | |
| simp only [point, sign, hfirst, ite_true, one_mul, Matrix.cons_val_one, Matrix.cons_val_zero] | |
| rw [hc, spacing] | |
| linarith [radius_next_ge hΞ½ (Kβ_nonneg N b m) (D_ge_one hb) n] | |
| Β· exact loss_lt hb Ξ½ m hΞ½ | |
| Β· rw [hmass t ht] | |
| exact Real.smoothTransition.one_of_one_le htβ | |
| Β· apply retained_stages hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| hm hcβ hdir hin hterm hactive | |
| exact β¨(startTime_strictMono hΞ½ (Kβ_nonneg N b m) (D_ge_one hb)).monotone (Nat.le_succ n), le_rflβ© | |
| theorem scalar_detection (hinit : cβ.state β terminal) : | |
| Observation.planeEvent (liftVelocity (field hb table terminal Ξ½ m) Ο) β | |
| Reaches hb table terminal cβ := by | |
| rw [Observation.planeEvent_lift] | |
| constructor | |
| Β· rintro β¨t, ht, hmargβ© | |
| by_contra hnever | |
| have h := nonterminal_mass_small hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| hm hcβ hdir hin hterm hcont hnever ht | |
| linarith | |
| Β· intro hreach | |
| obtain β¨t, ht, hmargβ© := terminal_mass_large hb table terminal Ξ½ m cβ hΞ½ hΟ heq hΟinit hΟint hΟnonneg hmass | |
| hm hcβ hdir hin hterm hcont hinit hreach | |
| exact β¨t, ht, lt_trans (by norm_num) hmargβ© | |
| end VelocityDetection.ExpandingArray | |
| end | |
| end OAI | |