Download data/lean/OAI/Analysis/Conductivity/Branching/CascadeGeometry.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.31 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Branching/CascadeGeometry.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Conductivity/Branching/CascadeGeometry.lean
-
curl -L -o CascadeGeometry.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Branching/CascadeGeometry.lean
8.31 kB
| import Mathlib | |
| import OAI.Analysis.Conductivity.Variational.ScaledSmoothSeries | |
| namespace OAI | |
| noncomputable section | |
| namespace ScalarConductivity | |
| open Real Set Filter Topology MeasureTheory | |
| def cascadePhase (D k : β) (j : β) (t : β) : β := | |
| (2:β)^j*(k*t-2*D)+2*D | |
| lemma cascadePhase_zero (D k t : β) : cascadePhase D k 0 t = k*t := by | |
| simp [cascadePhase] | |
| lemma cascadePhase_succ (D k t : β) (j : β) : | |
| cascadePhase D k (j+1) t = 2*(cascadePhase D k j t-D) := by | |
| unfold cascadePhase | |
| rw [pow_succ] | |
| ring | |
| lemma cascadePhase_add (D k t : β) (j n : β) : | |
| cascadePhase D k (j+n) t = (2:β)^n*(cascadePhase D k j t-2*D)+2*D := by | |
| unfold cascadePhase | |
| rw [pow_add] | |
| ring | |
| lemma cascadePhase_antitone {D k t : β} (ht : k*t β€ 2*D) : | |
| Antitone (fun j => cascadePhase D k j t) := by | |
| apply antitone_nat_of_succ_le | |
| intro j | |
| have hp : 0 β€ (2:β)^j := by positivity | |
| rw [cascadePhase_succ] | |
| have : cascadePhase D k j t β€ 2*D := by | |
| unfold cascadePhase | |
| nlinarith [mul_nonpos_of_nonneg_of_nonpos hp (by linarith : k*t-2*Dβ€0)] | |
| linarith | |
| lemma cascadePhase_before {D k t : β} (hD : 0 < D) {i j : β} | |
| (hij : i < j) (hj : 0 β€ cascadePhase D k j t) : | |
| D β€ cascadePhase D k i t := by | |
| by_cases ht : k*t β€ 2*D | |
| Β· have h := cascadePhase_antitone ht (show i+1β€j by omega) | |
| dsimp only at h | |
| rw [cascadePhase_succ] at h | |
| linarith | |
| Β· have hp : 0 β€ (2:β)^i := by positivity | |
| have : 0 β€ (2:β)^i*(k*t-2*D) := mul_nonneg hp (by linarith) | |
| unfold cascadePhase | |
| linarith | |
| lemma cascadePhase_after {D k t : β} (hD : 0 < D) {i j : β} | |
| (hij : j+1 < i) (hj : cascadePhase D k j t β€ D) : | |
| cascadePhase D k i t β€ -2*D := by | |
| have ht : k*t β€ 2*D := by | |
| by_contra hh | |
| have hp : 0 < (2:β)^j := by positivity | |
| have : 0 < (2:β)^j*(k*t-2*D) := mul_pos hp (by linarith) | |
| unfold cascadePhase at hj | |
| linarith | |
| have h := cascadePhase_antitone ht (show j + 2 β€ i by omega) | |
| dsimp only at h | |
| rw [show j+2=(j+1)+1 by omega,cascadePhase_succ,cascadePhase_succ] at h | |
| linarith | |
| lemma cascadeProfile_only_two {L K k t : β} (hL : 0 < L) (hK : 0 < K) | |
| {j i : β} (hjβ : 0 β€ cascadePhase (cascadeLength L K) k j t) | |
| (hjβ : cascadePhase (cascadeLength L K) k j t β€ cascadeLength L K) | |
| (hi : i β j) (hi' : i β j+1) : | |
| cascadeProfile L K (cascadePhase (cascadeLength L K) k i t) = 0 := by | |
| have hD := cascade_length_positive hL hK | |
| by_cases hij : i < j | |
| Β· apply cascadeProfile_zero_right hL | |
| have hh := cascadePhase_before hD hij hjβ | |
| change K+2+2*L β€ cascadePhase (cascadeLength L K) k i t at hh | |
| linarith | |
| Β· apply cascadeProfile_zero_left hL | |
| have hh := cascadePhase_after hD (show j+1 < i by omega) hjβ | |
| change cascadePhase (cascadeLength L K) k i t β€ -2*(K+2+2*L) at hh | |
| linarith | |
| lemma cascadeProfile_terminal {L K k t : β} (hL : 0 < L) (hK : 0 < K) | |
| (ht : 2*cascadeLength L K β€ k*t) (j : β) : | |
| cascadeProfile L K (cascadePhase (cascadeLength L K) k j t) = 0 := by | |
| apply cascadeProfile_zero_right hL | |
| have hp : 0 β€ (2:β)^j*(k*t-2*cascadeLength L K) := | |
| mul_nonneg (by positivity) (by linarith) | |
| unfold cascadePhase cascadeLength at * | |
| linarith | |
| lemma exists_cascade_stage {D k t : β} (_ : 0 < D) | |
| (htβ : 0 β€ k*t) (ht : k*t < 2*D) : | |
| β j : β, 0 β€ cascadePhase D k j t β§ cascadePhase D k j t β€ D := by | |
| have hex : β j : β, cascadePhase D k j t β€ D := by | |
| obtain β¨j,hjβ© := pow_unbounded_of_one_lt (D/(2*D-k*t)) (by norm_num : (1:β)<2) | |
| refine β¨j,?_β© | |
| have hh : D β€ (2:β)^j*(2*D-k*t) := by | |
| exact (div_le_iffβ (by linarith : 0<2*D-k*t)).mp hj.le | |
| unfold cascadePhase | |
| nlinarith | |
| let j := Nat.find hex | |
| refine β¨j,?_,Nat.find_spec hexβ© | |
| cases hj : j with | |
| | zero => simpa [hj,cascadePhase_zero] using htβ | |
| | succ n => | |
| have hn : n < Nat.find hex := by change n < j; omega | |
| have hh := Nat.find_min hex hn | |
| rw [not_le] at hh | |
| rw [cascadePhase_succ] | |
| linarith | |
| def cascadeAxis (j : β) : Fin 3 := if Even j then 1 else 2 | |
| lemma cascadeAxis_ne_zero (j : β) : cascadeAxis j β 0 := by | |
| unfold cascadeAxis | |
| split <;> decide | |
| lemma cascadeAxis_succ (j : β) : cascadeAxis (j+1) = if Even j then 2 else 1 := by | |
| simp only [cascadeAxis,Nat.even_add_one] | |
| split <;> simp_all | |
| def cascadeCenter (D k : β) (j : β) : Coord3 := | |
| Pi.single 0 ((2*D/k)*(1-1/(2:β)^j)) | |
| lemma cascade_dilation_time {k : β} (hk : k β 0) (D : β) (j : β) (x : Coord3) : | |
| ((k*2^j) β’ (x-cascadeCenter D k j)) 0 = cascadePhase D k j (x 0) := by | |
| simp only [Pi.smul_apply,Pi.sub_apply,smul_eq_mul,cascadeCenter,Pi.single_eq_same,cascadePhase] | |
| field_simp | |
| ring | |
| lemma cascade_dilation_angular (D k : β) (j : β) (x : Coord3) : | |
| ((k*2^j) β’ (x-cascadeCenter D k j)) (cascadeAxis j) = k*2^j*x (cascadeAxis j) := by | |
| simp [cascadeCenter,Pi.single_eq_of_ne (cascadeAxis_ne_zero j)] | |
| def cascadeTerm (L K k A : β) (j : β) (x : Coord3) : β := | |
| (A*cascadeRatio L K^j)*cascadeProfile L K (cascadePhase (cascadeLength L K) k j (x 0))* | |
| cos (k*2^j*x (cascadeAxis j)) | |
| def cascadeValue (L K k A : β) (x : Coord3) : β := β' j : β, cascadeTerm L K k A j x | |
| lemma cascadeTerm_scaled {k : β} (hk : k β 0) (L K A : β) (j : β) (x : Coord3) : | |
| cascadeTerm L K k A j x = (A*cascadeRatio L K^j)* | |
| cascadeMother L K (cascadeAxis j) ((k*2^j) β’ (x-cascadeCenter (cascadeLength L K) k j)) := by | |
| rw [cascadeMother,cascade_dilation_time hk,cascade_dilation_angular] | |
| unfold cascadeTerm | |
| ring | |
| theorem cascadeValue_C2 {L K k : β} (hL : 1 β€ L) (hK : 0 < K) (hk : k β 0) (A : β) : | |
| ContDiff β 2 (cascadeValue L K k A) := by | |
| have hh := geometric_scaled_C2 | |
| (f := fun j => cascadeMother L K (cascadeAxis j)) | |
| (fun _ => cascadeMother_smooth _ _ _) | |
| (fun n => by | |
| obtain β¨C,hC,hbβ© := cascadeMother_iterated_bound (lt_of_lt_of_le (by norm_num) hL) n | |
| exact β¨C,hC,fun j x => hb (cascadeAxis j) xβ©) | |
| (cascadeRatio_pos L K).le (cascadeRatio_small hL hK) A k | |
| (cascadeCenter (cascadeLength L K) k) | |
| convert hh using 1 | |
| funext x | |
| exact tsum_congr fun j => cascadeTerm_scaled hk L K A j x | |
| lemma cascadeValue_terminal {L K k : β} (hL : 0 < L) (hK : 0 < K) (A : β) | |
| (x : Coord3) (hx : 2*cascadeLength L K β€ k*x 0) : cascadeValue L K k A x = 0 := by | |
| change (β' j : β, cascadeTerm L K k A j x) = 0 | |
| have h : β j, cascadeTerm L K k A j x = 0 := by | |
| intro j | |
| rw [cascadeTerm,cascadeProfile_terminal hL hK hx,mul_zero,zero_mul] | |
| simp only [h,tsum_zero] | |
| lemma cascadeValue_two_modes {L K k : β} (hL : 0 < L) (hK : 0 < K) (A : β) | |
| (x : Coord3) (j : β) (hjβ : 0 β€ cascadePhase (cascadeLength L K) k j (x 0)) | |
| (hjβ : cascadePhase (cascadeLength L K) k j (x 0) β€ cascadeLength L K) : | |
| cascadeValue L K k A x = cascadeTerm L K k A j x + cascadeTerm L K k A (j+1) x := by | |
| have h : (β' i : β, cascadeTerm L K k A i x) = β i β ({j,j+1} : Finset β), cascadeTerm L K k A i x := tsum_eq_sum (s := ({j,j+1} : Finset β)) (f := fun i => cascadeTerm L K k A i x) (by | |
| intro i hi | |
| have hiβ : i β j := by simpa using fun h => hi (by simp [h]) | |
| have hiβ : i β j+1 := by simpa using fun h => hi (by simp [h]) | |
| rw [cascadeTerm,cascadeProfile_only_two hL hK hjβ hjβ hiβ hiβ,mul_zero,zero_mul]) | |
| simpa [cascadeValue,Finset.sum_pair (show j β j+1 by omega)] using h | |
| lemma cascadeValue_zero_phase {L K k : β} (hL : 0 < L) (hK : 0 < K) (A : β) | |
| (x : Coord3) (hx : x 0 = 0) : cascadeValue L K k A x = A*cos (k*x 1) := by | |
| have hβ : 0 β€ cascadePhase (cascadeLength L K) k 0 (x 0) := by simp [cascadePhase_zero,hx] | |
| have hβ : cascadePhase (cascadeLength L K) k 0 (x 0) β€ cascadeLength L K := by | |
| simpa [cascadePhase_zero,hx] using (cascade_length_positive hL hK).le | |
| rw [cascadeValue_two_modes hL hK A x 0 hβ hβ] | |
| have hz : cascadeProfile L K (cascadePhase (cascadeLength L K) k 1 (x 0)) = 0 := by | |
| apply cascadeProfile_zero_left hL | |
| simp [cascadePhase,hx,cascadeLength] | |
| linarith | |
| rw [cascadeTerm,cascadeTerm,hz] | |
| simp [cascadePhase_zero,hx,cascadeProfile_connector hL (le_refl 0) (show (0:β)β€K+2 by linarith), | |
| connectorProfile,cascadeAxis] | |
| end ScalarConductivity | |
| end | |
| end OAI | |