Download data/lean/OAI/Analysis/Conductivity/Branching/BranchOutputNormalization.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Branching/BranchOutputNormalization.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Conductivity/Branching/BranchOutputNormalization.lean
-
curl -L -o BranchOutputNormalization.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Branching/BranchOutputNormalization.lean
6.3 kB
| import Mathlib | |
| import OAI.Analysis.Conductivity.Sobolev.CentralPairRegularity | |
| import OAI.Analysis.Conductivity.Fourier.TorusSpectralContinuation | |
| import OAI.Analysis.Conductivity.Branching.TorusEndingCorrection | |
| namespace OAI | |
| noncomputable section | |
| namespace ScalarConductivity | |
| open Set Filter Topology MeasureTheory Matrix UnitAddTorus | |
| variable {E : Type*} [AddCommGroup E] | |
| def branchNormalize (i : Fin 3) (u : Fin 2 β E) : Fin 2 β E := | |
| if i=0 then ![-u 0,u 1-u 0] else if i=1 then u else ![u 1,u 0] | |
| lemma branchNormalize_involutive (i : Fin 3) : Function.Involutive (branchNormalize (E:=E) i) := by | |
| intro u | |
| ext j | |
| fin_cases i <;> fin_cases j <;> simp [branchNormalize] | |
| lemma branchNormalize_add (i : Fin 3) (u v : Fin 2 β E) : | |
| branchNormalize i (u+v)=branchNormalize i u+branchNormalize i v := by | |
| ext j | |
| fin_cases i <;> fin_cases j <;> simp [branchNormalize] <;> abel | |
| variable [Module β E] | |
| def branchNormalizeLinear (i : Fin 3) : (Fin 2 β E) ββ[β] (Fin 2 β E) where | |
| toFun := branchNormalize i | |
| map_add' := branchNormalize_add i | |
| map_smul' c u := by | |
| ext j | |
| fin_cases i <;> fin_cases j <;> simp [branchNormalize,smul_sub] | |
| def branchNormalizeEquiv (i : Fin 3) : (Fin 2 β β) βL[β] (Fin 2 β β) := | |
| ({ toLinearMap := branchNormalizeLinear i | |
| invFun := branchNormalize i | |
| left_inv := branchNormalize_involutive i | |
| right_inv := branchNormalize_involutive i } : | |
| (Fin 2 β β) ββ[β] (Fin 2 β β)).toContinuousLinearEquiv | |
| @[simp] lemma branchNormalizeEquiv_apply (i : Fin 3) (u : Fin 2 β β) : | |
| branchNormalizeEquiv i u=branchNormalize i u := rfl | |
| lemma branchNormalize_basis_slopes (i : Fin 3) : | |
| branchNormalize i (fun j => centralBasisSlopes j i)=normalizedSlope := by | |
| ext j | |
| fin_cases i <;> fin_cases j <;> norm_num [branchNormalize,centralBasisSlopes,normalizedSlope] | |
| lemma branchNormalize_normalized_slope (i : Fin 3) : | |
| branchNormalize i normalizedSlope=(fun j => centralBasisSlopes j i) := by | |
| rw [βbranchNormalize_basis_slopes i,branchNormalize_involutive i] | |
| lemma branchNormalize_affineField {s : Fin 3 β β} | |
| (hs : β x y : β,(1/2)*(x^2+y^2) β€ s 0*x^2+2*s 1*x*y+s 2*y^2) | |
| (i : Fin 3) (ΞΊ : Fin 2 β β) (f : Fin 2 β TorusL2) {x : Coord3} (hx : 0<x 0) : | |
| branchNormalize i (fun j => torusAffineField s (ΞΊ j) (f j) x)= | |
| fun j => torusAffineField s (branchNormalize i ΞΊ j) (branchNormalize i f j) x := by | |
| ext j | |
| fin_cases i <;> fin_cases j <;> | |
| simp [branchNormalize,torusAffineField,torusRealContinuation_neg, | |
| torusRealContinuation_sub hs _ _ hx] <;> ring | |
| lemma branchNormalize_means (i : Fin 3) (f : Fin 2 β TorusL2) : | |
| branchNormalize i (fun j => (mFourierCoeff (f j) 0).re)= | |
| fun j => (mFourierCoeff (branchNormalize i f j : TorusL2) 0).re := by | |
| fin_cases i | |
| Β· ext j | |
| fin_cases j | |
| Β· change -(mFourierCoeff (f 0) 0).re=(mFourierCoeff (-f 0 : TorusL2) 0).re | |
| rw [mFourierCoeff_Lp_neg,Complex.neg_re] | |
| Β· change (mFourierCoeff (f 1) 0).re-(mFourierCoeff (f 0) 0).re= | |
| (mFourierCoeff (f 1-f 0 : TorusL2) 0).re | |
| simp only [sub_eq_add_neg] | |
| rw [mFourierCoeff_Lp_add,mFourierCoeff_Lp_neg,Complex.add_re,Complex.neg_re] | |
| Β· rfl | |
| Β· ext j | |
| fin_cases j <;> rfl | |
| end ScalarConductivity | |
| namespace ScalarConductivity | |
| open Set Filter Topology MeasureTheory Matrix UnitAddTorus | |
| open scoped Matrix.Norms.Elementwise | |
| namespace TorusEndingData | |
| variable {s : Fin 3 β β} {f : Fin 2 β TorusL2} (z : TorusEndingData s f) | |
| lemma terminal_component (j : Fin 2) (x : Coord3) (hx : z.Rβ€x 0) : | |
| z.w.v x j=normalizedSlope j*x 0+(mFourierCoeff (f j) 0).re := by | |
| rw [z.terminal_v x hx] | |
| fin_cases j <;> simp [normalizedSlope] | |
| lemma terminal_gradient (j : Fin 2) (x : Coord3) (hx : z.R<x 0) : | |
| (gradientColumns (fderiv β z.w.v x)).col j=normalizedSlope j β’ Pi.single 0 1 := by | |
| have he : (fun x => z.w.v x j)=αΆ [π x] | |
| (fun x => normalizedSlope j*x 0+(mFourierCoeff (f j) 0).re) := by | |
| filter_upwards [(axial_halfspace_open z.R).mem_nhds hx] with y hy | |
| exact z.terminal_component j y hy.le | |
| have hd := (((ContinuousLinearMap.proj (0 : Fin 3) : Coord3 βL[β] β).hasFDerivAt | |
| (x:=x)).const_mul (normalizedSlope j)).add_const ((mFourierCoeff (f j) 0).re) | |
| ext i | |
| change fderiv β z.w.v x (Pi.single i 1) j=normalizedSlope j*((Pi.single (0:Fin 3) (1:β) : Coord3) i) | |
| rw [βpotential_component_fderiv (z.w.smooth.differentiable (by norm_num)) j, | |
| he.fderiv_eq (π := β)] | |
| change fderiv β (fun x => normalizedSlope j * | |
| (ContinuousLinearMap.proj (0 : Fin 3) : Coord3 βL[β] β) x + | |
| (mFourierCoeff (f j) 0).re) x (Pi.single i 1)=_ | |
| rw [hd.fderiv] | |
| fin_cases i <;> simp | |
| lemma terminal_flux (j : Fin 2) (x : Coord3) (hx : z.R<x 0) : | |
| (z.w.G x).col j=normalizedSlope j β’ Pi.single 0 1 := by | |
| have ha : (fun x => (z.w.G x).col j)=α΅[volume.restrict {x : Coord3 | z.R<x 0}] | |
| (fun _ => normalizedSlope j β’ Pi.single 0 1) := by | |
| filter_upwards [ae_restrict_of_ae z.w.constitution, | |
| ae_restrict_mem (axial_halfspace_open z.R).measurableSet] with y hy hyR | |
| rw [βhy] | |
| change z.w.E y*α΅₯(gradientColumns (fderiv β z.w.v y)).col j=_ | |
| rw [z.terminal_gradient j y hyR,Matrix.mulVec_smul,z.terminal_E y hyR.le] | |
| exact (Measure.eqOn_open_of_ae_eq ha (axial_halfspace_open z.R) | |
| (z.w.component_flux_C1 j).continuous.continuousOn continuous_const.continuousOn) hx | |
| lemma fluxCorrection_at_zero | |
| (hs : β x y : β,(1/2)*(x^2+y^2) β€ s 0*x^2+2*s 1*x*y+s 2*y^2) | |
| (j : Fin 2) (x : Coord3) (hx : x 0=0) : z.fluxCorrection j x=0 := by | |
| exact (torusEndingFluxCorrection_initial_zero z.e_pos (fun y hy => z.initial_flux hs j y hy) | |
| (by rw [hx]; linarith [z.d_pos,z.e_pos])).eq_of_nhds | |
| lemma fluxCorrection_at_terminal (j : Fin 2) (x : Coord3) (hx : z.R<x 0) : | |
| z.fluxCorrection j x=normalizedSlope j β’ Pi.single 0 1- | |
| flatModeFlux s (torusAffineField s (normalizedSlope j) (f j)) x := by | |
| rw [show z.fluxCorrection j x=(z.w.G x).col j- | |
| flatModeFlux s (torusAffineField s (normalizedSlope j) (f j)) x from | |
| (torusEndingFluxCorrection_terminal (by linarith [z.e_pos,z.overlap_lt] : z.d+z.e/2<x 0)).eq_of_nhds, | |
| z.terminal_flux j x hx] | |
| end TorusEndingData | |
| end ScalarConductivity | |
| end | |
| end OAI | |