Download data/lean/OAI/Analysis/Conductivity/Variational/CompactFiberPrimitive.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.28 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Variational/CompactFiberPrimitive.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Conductivity/Variational/CompactFiberPrimitive.lean
-
curl -L -o CompactFiberPrimitive.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Variational/CompactFiberPrimitive.lean
9.28 kB
| import Mathlib | |
| import OAI.Analysis.Conductivity.Sobolev.WallPrimitive | |
| namespace OAI | |
| noncomputable section | |
| namespace ScalarConductivity | |
| section | |
| open Set MeasureTheory Filter Topology | |
| variable {E : Type} [NormedAddCommGroup E] [NormedSpace β E] [ProperSpace E] | |
| def fiberPrimitive (a : β) (f : E Γ β β β) (p : E Γ β) : β := | |
| wallPrimitive f p-wallPrimitive f (p.1,a) | |
| lemma fiberPrimitive_smooth (a : β) {f : E Γ β β β} | |
| (hf : ContDiff β (β(β€ : ββ)) f) : | |
| ContDiff β (β(β€ : ββ)) (fiberPrimitive a f) := | |
| (wallPrimitive_smooth hf).sub ((wallPrimitive_smooth hf).comp (contDiff_fst.prodMk contDiff_const)) | |
| omit [NormedSpace β E] [ProperSpace E] in | |
| lemma fiberPrimitive_eq_integral (a : β) {f : E Γ β β β} (hf : Continuous f) (p : E Γ β) : | |
| fiberPrimitive a f p=β« t in a..p.2, f (p.1,t) := by | |
| have hc : Continuous (fun t : β => f (p.1,t)) := hf.comp (continuous_const.prodMk continuous_id) | |
| change wallPrimitive f (p.1,p.2)-wallPrimitive f (p.1,a)=_ | |
| simp only [wallPrimitive_eq_intervalIntegral] | |
| exact intervalIntegral.integral_interval_sub_left (ΞΌ := volume) (hc.intervalIntegrable _ _) (hc.intervalIntegrable _ _) | |
| lemma fiberPrimitive_derivative (a : β) {f : E Γ β β β} | |
| (hf : ContDiff β (β(β€ : ββ)) f) (p : E Γ β) : | |
| wallDerivative (fiberPrimitive a f) p=f p := by | |
| have h := ((fiberPrimitive_smooth a hf).differentiable (by simp) p).hasFDerivAt.comp_hasDerivAt p.2 | |
| ((hasDerivAt_const p.2 p.1).prodMk (hasDerivAt_id p.2)) | |
| have hd : HasDerivAt (fun t : β => fiberPrimitive a f (p.1,t)) (f p) p.2 := by | |
| exact (wallPrimitive_hasDerivAt hf.continuous p.1 p.2).sub_const (wallPrimitive f (p.1,a)) | |
| exact h.unique hd | |
| omit [NormedSpace β E] [ProperSpace E] | |
| lemma fiberPrimitive_of_zero_fiber (a : β) {f : E Γ β β β} (hf : Continuous f) | |
| (x : E) (hx : β t, f (x,t)=0) (z : β) : fiberPrimitive a f (x,z)=0 := by | |
| rw [fiberPrimitive_eq_integral a hf] | |
| simp only [hx,intervalIntegral.integral_zero] | |
| lemma fiberPrimitive_below {a b : β} {f : E Γ β β β} (hf : Continuous f) | |
| (hv : β p, f pβ 0 β p.2βIoo a b) (p : E Γ β) (hp : p.2β€a) : | |
| fiberPrimitive a f p=0 := by | |
| rw [fiberPrimitive_eq_integral a hf] | |
| calc | |
| _ = β« t in a..p.2, (0:β) := by | |
| apply intervalIntegral.integral_congr | |
| intro t ht | |
| rw [uIcc_of_ge hp] at ht | |
| by_contra hn | |
| exact (not_lt_of_ge ht.2) (hv (p.1,t) hn).1 | |
| _ = 0 := by simp | |
| lemma fiberPrimitive_above {a b : β} {f : E Γ β β β} (hf : Continuous f) | |
| (hv : β p, f pβ 0 β p.2βIoo a b) | |
| (hz : β x, (β« t in a..b, f (x,t))=0) (p : E Γ β) (hp : bβ€p.2) : | |
| fiberPrimitive a f p=0 := by | |
| have hc : Continuous (fun t : β => f (p.1,t)) := hf.comp (continuous_const.prodMk continuous_id) | |
| rw [fiberPrimitive_eq_integral a hf,βintervalIntegral.integral_add_adjacent_intervals | |
| (hc.intervalIntegrable a b) (hc.intervalIntegrable b p.2),hz,zero_add] | |
| calc | |
| _ = β« t in b..p.2, (0:β) := by | |
| apply intervalIntegral.integral_congr | |
| intro t ht | |
| rw [uIcc_of_le hp] at ht | |
| by_contra hn | |
| exact (not_lt_of_ge ht.1) (hv (p.1,t) hn).2 | |
| _ = 0 := by simp | |
| theorem fiberPrimitive_compact {a b : β} {f : E Γ β β β} (hf : Continuous f) | |
| (hs : HasCompactSupport f) (hv : β p, f pβ 0 β p.2βIoo a b) | |
| (hz : β x, (β« t in a..b, f (x,t))=0) : | |
| HasCompactSupport (fiberPrimitive a f) β§ | |
| tsupport (fiberPrimitive a f) β (Prod.fst '' tsupport f) ΓΛ’ Icc a b := by | |
| have hK : IsCompact ((Prod.fst '' tsupport f) ΓΛ’ Icc a b) := | |
| (hs.image continuous_fst).prod isCompact_Icc | |
| have hsub : Function.support (fiberPrimitive a f) β (Prod.fst '' tsupport f) ΓΛ’ Icc a b := by | |
| intro p hp | |
| refine β¨?_,?_,?_β© | |
| Β· by_contra hx | |
| have hz' : β t, f (p.1,t)=0 := by | |
| intro t | |
| by_contra hn | |
| exact hx β¨(p.1,t),subset_tsupport f hn,rflβ© | |
| exact hp (fiberPrimitive_of_zero_fiber a hf p.1 hz' p.2) | |
| Β· by_contra h | |
| exact hp (fiberPrimitive_below hf hv p (le_of_lt (lt_of_not_ge h))) | |
| Β· by_contra h | |
| exact hp (fiberPrimitive_above hf hv hz p (le_of_lt (lt_of_not_ge h))) | |
| refine β¨HasCompactSupport.of_support_subset_isCompact hK hsub,?_β© | |
| exact closure_minimal hsub hK.isClosed | |
| end | |
| open Set MeasureTheory Matrix | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| def compactMomentGram (Ο : β β β) (w : β β ΞΉ β β) : Matrix ΞΉ ΞΉ β := | |
| fun i j => β« s, Ο s*w s i*w s j | |
| omit [Fintype ΞΉ] [DecidableEq ΞΉ] in | |
| lemma compactMoment_integrable {Ο : β β β} {w : β β ΞΉ β β} | |
| (hc : Continuous Ο) (hs : HasCompactSupport Ο) (hw : β i, Continuous (fun s => w s i)) | |
| (i j : ΞΉ) : Integrable (fun s => Ο s*w s i*w s j) := | |
| ((hc.mul (hw i)).mul (hw j)).integrable_of_hasCompactSupport ((hs.mul_right).mul_right) | |
| omit [DecidableEq ΞΉ] in | |
| lemma compactMoment_dot_integrable {Ο : β β β} {w : β β ΞΉ β β} | |
| (hc : Continuous Ο) (hs : HasCompactSupport Ο) (hw : β i, Continuous (fun s => w s i)) | |
| (a : ΞΉ β β) : Integrable (fun s => Ο s*(a β¬α΅₯ w s)^2) := by | |
| apply Continuous.integrable_of_hasCompactSupport | |
| Β· exact hc.mul ((continuous_finsetSum _ (fun i _ => continuous_const.mul (hw i))).pow 2) | |
| Β· exact hs.mul_right | |
| omit [DecidableEq ΞΉ] in | |
| lemma compactMoment_quadratic {Ο : β β β} {w : β β ΞΉ β β} | |
| (hc : Continuous Ο) (hs : HasCompactSupport Ο) (hw : β i, Continuous (fun s => w s i)) | |
| (a : ΞΉ β β) : a β¬α΅₯ ((compactMomentGram Ο w)*α΅₯a)=β« s, Ο s*(a β¬α΅₯ w s)^2 := by | |
| have hi (i j : ΞΉ) : Integrable (fun s => a i*(Ο s*w s i*w s j)*a j) := | |
| ((compactMoment_integrable hc hs hw i j).const_mul _).mul_const _ | |
| calc | |
| _ = β i, β j, β« s, a i*(Ο s*w s i*w s j)*a j := by | |
| simp only [compactMomentGram,mulVec,dotProduct,Finset.mul_sum, | |
| integral_mul_const,integral_const_mul] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| ring | |
| _ = β« s, β i, β j, a i*(Ο s*w s i*w s j)*a j := by | |
| rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hi i j))] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| exact (integral_finsetSum _ (fun j _ => hi i j)).symm | |
| _ = _ := by | |
| apply integral_congr_ae | |
| exact Filter.Eventually.of_forall fun s => by | |
| simp only [dotProduct,pow_two,Finset.sum_mul,Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| ring | |
| omit [DecidableEq ΞΉ] in | |
| theorem compactMomentGram_posDef {Ο : β β β} {w : β β ΞΉ β β} | |
| (hc : Continuous Ο) (hs : HasCompactSupport Ο) (hw : β i, Continuous (fun s => w s i)) | |
| (hn : β s, 0β€Ο s) {l r : β} (hp : β sβIoo l r, 0<Ο s) | |
| (hind : β a : ΞΉ β β, (β sβIoo l r, a β¬α΅₯ w s=0) β a=0) : | |
| (compactMomentGram Ο w).PosDef := by | |
| apply Matrix.posDef_iff_dotProduct_mulVec.mpr | |
| refine β¨?_,?_β© | |
| Β· ext i j | |
| simp only [conjTranspose_apply,star_trivial,compactMomentGram] | |
| apply integral_congr_ae | |
| exact Filter.Eventually.of_forall (fun s => by ring) | |
| Β· intro a ha | |
| simp only [star_trivial] | |
| rw [compactMoment_quadratic hc hs hw] | |
| have hnon : β s, 0β€Ο s*(a β¬α΅₯ w s)^2 := fun s => mul_nonneg (hn s) (sq_nonneg _) | |
| apply (integral_nonneg hnon).lt_of_ne' | |
| intro hz | |
| have hae := (integral_eq_zero_iff_of_nonneg hnon | |
| (compactMoment_dot_integrable hc hs hw a)).mp hz | |
| have he := MeasureTheory.Measure.eq_of_ae_eq hae | |
| (hc.mul ((continuous_finsetSum _ (fun i _ => continuous_const.mul (hw i))).pow 2)) | |
| continuous_zero | |
| apply ha | |
| apply hind | |
| intro s hs | |
| have h := congrFun he s | |
| have hsq : (a β¬α΅₯ w s)^2=0 := (mul_eq_zero.mp h).resolve_left (hp s hs).ne' | |
| nlinarith [sq_nonneg (a β¬α΅₯ w s)] | |
| theorem compactMoment_surjective {Ο : β β β} {w : β β ΞΉ β β} | |
| (hc : ContDiff β (β(β€ : ββ)) Ο) (hs : HasCompactSupport Ο) | |
| (hw : β i, ContDiff β (β(β€ : ββ)) (fun s => w s i)) | |
| (hG : (compactMomentGram Ο w).PosDef) (b : ΞΉ β β) : | |
| β f : β β β, ContDiff β (β(β€ : ββ)) f β§ HasCompactSupport f β§ | |
| tsupport f β tsupport Ο β§ (β i, (β« s, f s*w s i)=b i) := by | |
| obtain β¨a,haβ© := Matrix.mulVec_surjective_iff_isUnit.mpr hG.isUnit b | |
| refine β¨fun s => Ο s*(a β¬α΅₯ w s),hc.mul ?_,hs.mul_right,tsupport_mul_subset_left,?_β© | |
| Β· exact ContDiff.sum (fun i _ => contDiff_const.mul (hw i)) | |
| Β· intro i | |
| rw [βcongrFun ha i] | |
| change (β« s, Ο s*(a β¬α΅₯ w s)*w s i)=β j, compactMomentGram Ο w i j*a j | |
| calc | |
| _ = β« s, β j, (Ο s*w s i*w s j)*a j := by | |
| apply integral_congr_ae | |
| exact Filter.Eventually.of_forall (fun s => by | |
| simp only [dotProduct,Finset.mul_sum,Finset.sum_mul] | |
| apply Finset.sum_congr rfl; intro j _; ring) | |
| _ = _ := by | |
| rw [integral_finsetSum _ (fun j _ => | |
| (compactMoment_integrable hc.continuous hs (fun j => (hw j).continuous) i j).mul_const _)] | |
| simp only [integral_mul_const,compactMomentGram] | |
| end ScalarConductivity | |
| end | |
| end OAI | |