math / data /lean /OAI /MathematicalPhysics /NavierStokes /ForcedComputation /Programs /CompactRapidEmbedding.lean
Download data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/CompactRapidEmbedding.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.07 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/CompactRapidEmbedding.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/CompactRapidEmbedding.lean
-
curl -L -o CompactRapidEmbedding.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/CompactRapidEmbedding.lean
8.07 kB
| import OAI.MathematicalPhysics.RapidForcing.Support | |
| namespace OAI | |
| /-! An explicit reflected similarity places the compact rapid-forcing | |
| construction in a single unit chart. The first-coordinate observation is | |
| preserved, and material trajectories are conjugated by the same map. -/ | |
| noncomputable section | |
| open Set | |
| open scoped ContDiff | |
| namespace RapidForcing.CompactEmbedding | |
| def reflection : Space ββα΅’[β] Space := | |
| LinearIsometryEquiv.piLpCongrRight 2 (fun i : Fin 3 => | |
| if i = 0 then LinearIsometryEquiv.neg β else LinearIsometryEquiv.refl β β) | |
| @[simp] theorem reflection_apply (x : Space) (i : Fin 3) : | |
| reflection x i = if i = 0 then -x i else x i := by | |
| by_cases hi : i = 0 <;> simp [reflection, LinearIsometryEquiv.piLpCongrRight_apply, hi] | |
| @[simp] theorem reflection_reflection (x : Space) : reflection (reflection x) = x := by | |
| ext i | |
| by_cases hi : i = 0 <;> simp [hi] | |
| def linear : Space βL[β] Space := | |
| (1 / 8 : β) β’ reflection.toContinuousLinearMap | |
| def inverseLinear : Space βL[β] Space := | |
| (8 : β) β’ reflection.toContinuousLinearMap | |
| def coordinateSign (i : Fin 3) : β := if i = 0 then -1 else 1 | |
| theorem linear_apply (x : Space) (i : Fin 3) : | |
| linear x i = (coordinateSign i / 8) * x i := by | |
| by_cases hi : i = 0 <;> simp [linear, coordinateSign, hi, div_eq_mul_inv] | |
| theorem inverseLinear_basis (i : Fin 3) : | |
| inverseLinear (basis i) = (8 * coordinateSign i) β’ basis i := by | |
| ext j | |
| by_cases hji : j = i | |
| Β· subst j | |
| by_cases hi : i = 0 <;> simp [inverseLinear, coordinateSign, basis, hi] | |
| Β· have hj0 : i = 0 β j β 0 := by intro hi; simpa [hi] using hji | |
| by_cases hi : i = 0 <;> simp [inverseLinear, coordinateSign, basis, hji, hi, hj0] | |
| @[simp] theorem inverseLinear_linear (x : Space) : inverseLinear (linear x) = x := by | |
| simp [inverseLinear, linear, map_smul, smul_smul] | |
| @[simp] theorem linear_inverseLinear (x : Space) : linear (inverseLinear x) = x := by | |
| simp [inverseLinear, linear, map_smul, smul_smul] | |
| theorem norm_linear (x : Space) : βlinear xβ = (1 / 8 : β) * βxβ := by | |
| simp [linear, norm_smul] | |
| theorem norm_inverseLinear (x : Space) : βinverseLinear xβ = 8 * βxβ := by | |
| simp [inverseLinear, norm_smul] | |
| def center : Space := vec (3 / 8) (1 / 2) (1 / 2) | |
| def embed (x : Space) : Space := center + linear x | |
| def unembed (x : Space) : Space := inverseLinear (x - center) | |
| @[simp] theorem unembed_embed (x : Space) : unembed (embed x) = x := by | |
| simp [unembed, embed] | |
| @[simp] theorem embed_unembed (x : Space) : embed (unembed x) = x := by | |
| simp [unembed, embed] | |
| @[simp] theorem embed_zero : embed 0 = center := by simp [embed] | |
| @[simp] theorem unembed_center : unembed center = 0 := by simp [unembed] | |
| theorem embed_injective : Function.Injective embed := | |
| Function.LeftInverse.injective unembed_embed | |
| theorem unembed_injective : Function.Injective unembed := | |
| Function.LeftInverse.injective embed_unembed | |
| @[simp] theorem embed_first (x : Space) : embed x 0 = 3 / 8 - x 0 / 8 := by | |
| simp [embed, center, vec, linear, sub_eq_add_neg, div_eq_mul_inv, mul_comm] | |
| @[simp] theorem embed_second (x : Space) : embed x 1 = 1 / 2 + x 1 / 8 := by | |
| simp [embed, center, vec, linear, div_eq_mul_inv, mul_comm] | |
| @[simp] theorem embed_third (x : Space) : embed x 2 = 1 / 2 + x 2 / 8 := by | |
| simp [embed, center, vec, linear, div_eq_mul_inv, mul_comm] | |
| theorem embed_observation (x : Space) : 1 / 2 < embed x 0 β x 0 < -1 := by | |
| rw [embed_first] | |
| constructor <;> intro h <;> linarith | |
| def chart : Set Space := {x | (β i, 1 / 4 β€ x i) β§ β i, x i β€ 3 / 4} | |
| theorem embed_mem_chart {x : Space} (hx : x β K) : embed x β chart := by | |
| obtain β¨hx0, hx0', hx1, hx1', hx2, hx2'β© := hx | |
| have h0 := embed_first x | |
| have h1 := embed_second x | |
| have h2 := embed_third x | |
| constructor <;> intro i <;> fin_cases i <;> dsimp <;> linarith | |
| theorem chart_inside_unit {x : Space} (hx : x β chart) : | |
| β i, 0 < x i β§ x i < 1 := by | |
| intro i | |
| have h0 := hx.1 i | |
| have h1 := hx.2 i | |
| constructor <;> linarith | |
| def compactChart : Set Space := embed '' K | |
| theorem compactChart_compact : IsCompact compactChart := | |
| K_compact.image (continuous_const.add linear.continuous) | |
| theorem compactChart_subset_chart : compactChart β chart := by | |
| rintro _ β¨x, hx, rflβ© | |
| exact embed_mem_chart hx | |
| theorem embed_hasFDerivAt (x : Space) : HasFDerivAt embed linear x := by | |
| exact linear.hasFDerivAt.const_add center | |
| theorem unembed_hasFDerivAt (x : Space) : HasFDerivAt unembed inverseLinear x := by | |
| have he : unembed = fun y => inverseLinear y - inverseLinear center := by | |
| funext y | |
| exact map_sub inverseLinear y center | |
| rw [he] | |
| exact inverseLinear.hasFDerivAt.sub_const _ | |
| theorem embed_contDiff : ContDiff β β embed := | |
| contDiff_const.add linear.contDiff | |
| theorem unembed_contDiff : ContDiff β β unembed := | |
| inverseLinear.contDiff.comp (contDiff_id.sub contDiff_const) | |
| def field (u : Field Space) : Field Space := | |
| fun t x => linear (u t (unembed x)) | |
| @[simp] theorem field_embed (u : Field Space) (t : β) (x : Space) : | |
| field u t (embed x) = linear (u t x) := by simp [field] | |
| theorem field_zero (u : Field Space) {t : β} (hu : β x, u t x = 0) : | |
| β x, field u t x = 0 := by intro x; simp [field, hu] | |
| theorem field_supported {u : Field Space} (hu : Supported u) {t : β} (ht : 0 β€ t) : | |
| tsupport (field u t) β compactChart := by | |
| apply closure_minimal _ compactChart_compact.isClosed | |
| intro x hx | |
| have hmem : unembed x β K := by | |
| by_contra h | |
| exact hx (by simp [field, hu.zero_off ht h]) | |
| exact β¨unembed x, hmem, embed_unembed xβ© | |
| theorem field_smooth {u : Field Space} (hu : Smooth u) : Smooth (field u) := by | |
| exact linear.contDiff.comp_contDiffOn | |
| (hu.comp (contDiff_fst.prodMk (unembed_contDiff.comp contDiff_snd)).contDiffOn | |
| (fun y hy => β¨hy.1, mem_univ _β©)) | |
| theorem embed_curve_hasDerivWithinAt {Ξ³ : β β Space} {v : Space} | |
| {s : Set β} {t : β} (hΞ³ : HasDerivWithinAt Ξ³ v s t) : | |
| HasDerivWithinAt (fun r => embed (Ξ³ r)) (linear v) s t := by | |
| simpa only [Function.comp_def] using (embed_hasFDerivAt (Ξ³ t)).comp_hasDerivWithinAt t hΞ³ | |
| theorem unembed_curve_hasDerivWithinAt {Ξ³ : β β Space} {v : Space} | |
| {s : Set β} {t : β} (hΞ³ : HasDerivWithinAt Ξ³ v s t) : | |
| HasDerivWithinAt (fun r => unembed (Ξ³ r)) (inverseLinear v) s t := by | |
| simpa only [Function.comp_def] using | |
| (unembed_hasFDerivAt (Ξ³ t)).comp_hasDerivWithinAt t hΞ³ | |
| def flow (X : β β Space β Space) : β β Space β Space := | |
| fun t x => embed (X t (unembed x)) | |
| @[simp] theorem flow_embed (X : β β Space β Space) (t : β) (x : Space) : | |
| flow X t (embed x) = embed (X t x) := by simp [flow] | |
| theorem trajectory_unembed {u : Field Space} {a : Space} {T : β} {Ξ³ : β β Space} | |
| (hΞ³ : TrajectoryOn (field u) a T Ξ³) : | |
| TrajectoryOn u (unembed a) T (fun t => unembed (Ξ³ t)) := by | |
| refine β¨by change unembed (Ξ³ 0) = unembed a; rw [hΞ³.1], ?_β© | |
| intro t ht | |
| simpa only [field, inverseLinear_linear] using | |
| unembed_curve_hasDerivWithinAt (hΞ³.2 t ht) | |
| theorem materialFlow {u : Field Space} {X : β β Space β Space} | |
| (hX : MaterialFlow u X) : MaterialFlow (field u) (flow X) := by | |
| refine β¨?_, ?_, ?_β© | |
| Β· intro a | |
| simp [flow, hX.1] | |
| Β· intro a t ht | |
| simpa only [flow, field, unembed_embed] using | |
| embed_curve_hasDerivWithinAt (hX.2.1 (unembed a) t ht) | |
| Β· intro T hT a Ξ³ hΞ³ t ht | |
| have he := hX.2.2 T hT (unembed a) (fun r => unembed (Ξ³ r)) | |
| (trajectory_unembed hΞ³) t ht | |
| have he' := congrArg embed he | |
| simpa only [embed_unembed, flow] using he' | |
| theorem flow_observation (X : β β Space β Space) (t : β) : | |
| 1 / 2 < flow X t center 0 β X t 0 0 < -1 := by | |
| simpa only [flow, unembed_center] using embed_observation (X t 0) | |
| theorem reaches_iff (X : β β Space β Space) : | |
| (β t : β, 0 β€ t β§ 1 / 2 < flow X t center 0) β | |
| β t : β, 0 β€ t β§ X t 0 0 < -1 := by | |
| simp only [flow_observation] | |
| end RapidForcing.CompactEmbedding | |
| end | |
| end OAI | |