Buckets:
cfahlgren1/math / lean /OAI /GroupTheory /PolycyclicRecognition /Analysis /CoarsePathConcatenation.lean
| import Mathlib.Topology.Path | |
| import Mathlib.Topology.MetricSpace.Basic | |
| import Mathlib.Tactic | |
| namespace OAI | |
| /-! # Coarse metric bounds under path concatenation | |
| The additive error is retained explicitly. This allows logarithmic-diameter | |
| switches and coarse-speed one-parameter legs to use a fixed finite mesh. | |
| -/ | |
| namespace PolycyclicRecognition | |
| open scoped unitInterval | |
| variable {X : Type*} [PseudoMetricSpace X] {x y z : X} | |
| def PathMetricBound (p : Path x y) (L κ : ℝ) : Prop := | |
| ∀ s t : unitInterval, dist (p s) (p t) ≤ L * |(s : ℝ) - t| + κ | |
| theorem PathMetricBound.mono {p : Path x y} {L κ L' κ' : ℝ} | |
| (h : PathMetricBound p L κ) (hL : L ≤ L') (hκ : κ ≤ κ') : | |
| PathMetricBound p L' κ' := by | |
| intro s t | |
| exact (h s t).trans (add_le_add (mul_le_mul_of_nonneg_right hL (abs_nonneg _)) hκ) | |
| theorem PathMetricBound.symm {p : Path x y} {L κ : ℝ} (h : PathMetricBound p L κ) : | |
| PathMetricBound p.symm L κ := by | |
| intro s t | |
| have hb := h (unitInterval.symm s) (unitInterval.symm t) | |
| simpa only [Path.symm_apply, Function.comp_apply, unitInterval.coe_symm_eq, sub_sub_sub_cancel_left, | |
| abs_sub_comm] using hb | |
| theorem PathMetricBound.cast {p : Path x y} {L κ : ℝ} (h : PathMetricBound p L κ) | |
| {x' y' : X} (hx : x' = x) (hy : y' = y) : PathMetricBound (p.cast hx hy) L κ := h | |
| private theorem pathMetricBound_trans_ordered {p : Path x y} {q : Path y z} {L κ : ℝ} | |
| (hκ : 0 ≤ κ) (hp : PathMetricBound p L κ) (hq : PathMetricBound q L κ) | |
| (s t : unitInterval) (hst : (s : ℝ) ≤ t) : | |
| dist ((p.trans q) s) ((p.trans q) t) ≤ (2 * L) * |(s : ℝ) - t| + 2 * κ := by | |
| rw [Path.trans_apply, Path.trans_apply] | |
| split_ifs with hs ht ht | |
| · calc | |
| _ ≤ L * |2 * (s : ℝ) - 2 * t| + κ := hp _ _ | |
| _ ≤ _ := by | |
| rw [show 2 * (s : ℝ) - 2 * t = 2 * ((s : ℝ) - t) by ring, | |
| abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] | |
| nlinarith | |
| · calc | |
| _ ≤ dist (p _) y + dist y (q _) := dist_triangle _ y _ | |
| _ ≤ (L * |2 * (s : ℝ) - 1| + κ) + | |
| (L * |0 - (2 * (t : ℝ) - 1)| + κ) := by | |
| apply add_le_add | |
| · simpa using hp _ 1 | |
| · simpa only [Path.source, Set.Icc.coe_zero] using | |
| hq 0 ⟨2 * (t : ℝ) - 1, unitInterval.two_mul_sub_one_mem_iff.mpr | |
| ⟨(not_le.mp ht).le, t.property.2⟩⟩ | |
| _ = _ := by | |
| rw [abs_of_nonpos (by linarith : 2 * (s : ℝ) - 1 ≤ 0), | |
| abs_of_nonpos (by linarith : 0 - (2 * (t : ℝ) - 1) ≤ 0), | |
| abs_of_nonpos (sub_nonpos.mpr hst)] | |
| ring | |
| · exfalso | |
| exact hs (hst.trans ht) | |
| · calc | |
| _ ≤ L * |(2 * (s : ℝ) - 1) - (2 * (t : ℝ) - 1)| + κ := hq _ _ | |
| _ ≤ _ := by | |
| rw [show (2 * (s : ℝ) - 1) - (2 * (t : ℝ) - 1) = | |
| 2 * ((s : ℝ) - t) by ring, abs_mul, | |
| abs_of_pos (by norm_num : (0 : ℝ) < 2)] | |
| nlinarith | |
| /-- Concatenation doubles the common speed and additive error. For a fixed | |
| number of pieces these constants stay independent of the height scale. -/ | |
| theorem PathMetricBound.trans {p : Path x y} {q : Path y z} {L κ : ℝ} | |
| (hκ : 0 ≤ κ) (hp : PathMetricBound p L κ) (hq : PathMetricBound q L κ) : | |
| PathMetricBound (p.trans q) (2 * L) (2 * κ) := by | |
| intro s t | |
| rcases le_total (s : ℝ) t with hst | hts | |
| · exact pathMetricBound_trans_ordered hκ hp hq s t hst | |
| · simpa only [dist_comm, abs_sub_comm] using | |
| pathMetricBound_trans_ordered hκ hp hq t s hts | |
| theorem path_trans_range_mem {S : Set X} {p : Path x y} {q : Path y z} | |
| (hp : ∀ t, p t ∈ S) (hq : ∀ t, q t ∈ S) : ∀ t, (p.trans q) t ∈ S := by | |
| intro t | |
| rw [Path.trans_apply] | |
| split_ifs | |
| · exact hp _ | |
| · exact hq _ | |
| /-- Fixed-time continuity survives concatenation even when endpoints vary. -/ | |
| theorem continuous_path_trans_sample {Y : Type*} [TopologicalSpace Y] | |
| {a b c : Y → X} (p : ∀ y, Path (a y) (b y)) (q : ∀ y, Path (b y) (c y)) | |
| (hp : ∀ t, Continuous (fun y => p y t)) (hq : ∀ t, Continuous (fun y => q y t)) | |
| (t : unitInterval) : Continuous (fun y => ((p y).trans (q y)) t) := by | |
| by_cases ht : (t : ℝ) ≤ 1 / 2 | |
| · simpa only [Path.trans_apply, dite_eq_left ht] using | |
| hp ⟨2 * (t : ℝ), unitInterval.mul_pos_mem_iff zero_lt_two |>.mpr ⟨t.property.1, ht⟩⟩ | |
| · simpa only [Path.trans_apply, dite_eq_right ht] using | |
| hq ⟨2 * (t : ℝ) - 1, unitInterval.two_mul_sub_one_mem_iff.mpr | |
| ⟨(not_le.mp ht).le, t.property.2⟩⟩ | |
| end PolycyclicRecognition | |
| end OAI | |
Xet Storage Details
- Size:
- 4.52 kB
- Xet hash:
- 7c0eee3d56825fd119959bd7f26bff79e44fe5d7fec9c9791da2702df73834f6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.