Download data/lean/OAI/Analysis/Conductivity/Variational/CompactCompatibleReplacement.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 11.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Variational/CompactCompatibleReplacement.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Conductivity/Variational/CompactCompatibleReplacement.lean
-
curl -L -o CompactCompatibleReplacement.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Variational/CompactCompatibleReplacement.lean
11.1 kB
| import Mathlib | |
| import OAI.Analysis.Conductivity.Variational.CompactSelectedReplacement | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory | |
| open scoped ENNReal | |
| open Matrix Filter Topology | |
| open Set MeasureTheory Filter Topology | |
| open scoped BigOperators | |
| open Set MeasureTheory Filter Topology | |
| open scoped Manifold | |
| open Set Filter | |
| open scoped Topology | |
| open Set Filter MeasureTheory | |
| open scoped Topology Manifold ENNReal | |
| open Set | |
| namespace ScalarConductivity | |
| open Matrix Set MeasureTheory | |
| open scoped Matrix.Norms.Elementwise | |
| structure CompactCompatibleReplacement (ΞΌ : Measure Coord3) (O : Set Coord3) | |
| (u : Coord3 β Fin 2 β β) (A : Coord3 β Symmetric3) where | |
| du : Coord3 β Fin 2 β β | |
| dF : Coord3 β Matrix (Fin 3) (Fin 2) β | |
| tensor : Coord3 β Symmetric3 | |
| smooth_du : ContDiff β (β(β€ : ββ)) du | |
| compact_du : HasCompactSupport du | |
| support_du : tsupport du β O | |
| smooth_dF : ContDiff β (β(β€ : ββ)) dF | |
| compact_dF : HasCompactSupport dF | |
| support_dF : tsupport dF β O | |
| cauchy_dF : β j (Ο : Coord3 β β), ContDiff β (β(β€ : ββ)) Ο β | |
| (β« x, fderiv β Ο x ((dF x).col j) βΞΌ) = 0 | |
| smooth_tensor : ContDiffOn β (β(β€ : ββ)) (fun x => (tensor x).val) O | |
| constitutive : β x β O, (tensor x).val * | |
| gradientColumns (fderiv β (fun y => u y+du y) x) = conductivityFlux u A x + dF x | |
| def CompactTwoFieldReplacement.forgetRank {ΞΌ : Measure Coord3} {O : Set Coord3} | |
| {u : Coord3 β Fin 2 β β} {A : Coord3 β Symmetric3} | |
| (R : CompactTwoFieldReplacement ΞΌ O u A) : CompactCompatibleReplacement ΞΌ O u A where | |
| du := R.du | |
| dF := R.dF | |
| tensor := R.tensor | |
| smooth_du := R.smooth_du | |
| compact_du := R.compact_du | |
| support_du := R.support_du | |
| smooth_dF := R.smooth_dF | |
| compact_dF := R.compact_dF | |
| support_dF := R.support_dF | |
| cauchy_dF := R.cauchy_dF | |
| smooth_tensor := R.smooth_tensor | |
| constitutive := R.constitutive | |
| lemma gradientColumns_affine_column {O : Set Coord3} (hO : IsOpen O) | |
| {u v : Coord3 β Fin 2 β β} {l ΞΊ : Fin 2 β β} | |
| (he : β x β O, β j, u x j = l j * v x 0 + ΞΊ j) | |
| (hv : DifferentiableOn β v O) {x : Coord3} (hx : x β O) (i : Fin 3) (j : Fin 2) : | |
| gradientColumns (fderiv β u x) i j = l j * gradientColumns (fderiv β v x) i 0 := by | |
| let w : Coord3 β Fin 2 β β := fun x j => l j * v x 0 + ΞΊ j | |
| have hw : HasFDerivAt w | |
| (ContinuousLinearMap.pi (fun j => l j β’ | |
| ((ContinuousLinearMap.proj 0).comp (fderiv β v x)))) x := by | |
| apply hasFDerivAt_pi.mpr | |
| intro j | |
| exact (((ContinuousLinearMap.proj 0).hasFDerivAt.comp x | |
| (hv x hx |>.differentiableAt (hO.mem_nhds hx)).hasFDerivAt).const_mul (l j)).add_const (ΞΊ j) | |
| have heq : EqOn u w O := fun y hy => funext (he y hy) | |
| rw [fderiv_eq_of_eqOn_open hO heq hx, hw.fderiv] | |
| rfl | |
| def CompactSelectedReplacement.affineTransfer | |
| {ΞΌ : Measure Coord3} {O : Set Coord3} (hO : IsOpen O) | |
| {u v : Coord3 β Fin 2 β β} {A : Coord3 β Symmetric3} | |
| {l ΞΊ : Fin 2 β β} | |
| (he : β x β O, β j, u x j = l j * v x 0 + ΞΊ j) | |
| (hv : ContDiffOn β (β(β€ : ββ)) v O) | |
| (R : CompactSelectedReplacement {0} ΞΌ O v A) : | |
| CompactCompatibleReplacement ΞΌ O u A := by | |
| classical | |
| let du : Coord3 β Fin 2 β β := fun x j => l j * R.du x 0 | |
| let dF : Coord3 β Matrix (Fin 3) (Fin 2) β := fun x i j => l j * R.dF x i 0 | |
| have hdu : ContDiff β (β(β€ : ββ)) du := | |
| contDiff_pi.mpr (fun j => contDiff_const.mul (contDiff_pi.mp R.smooth_du 0)) | |
| have hdF : ContDiff β (β(β€ : ββ)) dF := | |
| contDiff_pi.mpr (fun i => contDiff_pi.mpr (fun j => contDiff_const.mul | |
| (contDiff_pi.mp (contDiff_pi.mp R.smooth_dF i) 0))) | |
| have hsu : Function.support du β Function.support R.du := by | |
| intro x hx hz | |
| apply hx | |
| ext j | |
| simp [du, hz] | |
| have hsF : Function.support dF β Function.support R.dF := by | |
| intro x hx hz | |
| apply hx | |
| ext i j | |
| simp [dF, hz] | |
| have hsdu : tsupport du β tsupport R.du := closure_mono hsu | |
| have hsdF : tsupport dF β tsupport R.dF := closure_mono hsF | |
| refine β¨du, dF, R.tensor, hdu, R.compact_du.mono hsu, hsdu.trans R.support_du, | |
| hdF, R.compact_dF.mono hsF, hsdF.trans R.support_dF, ?_, R.smooth_tensor, ?_β© | |
| Β· intro j Ο hΟ | |
| have hecol : (fun x => (dF x).col j) = fun x => l j β’ (R.dF x).col 0 := rfl | |
| simp_rw [show β x, (dF x).col j = l j β’ (R.dF x).col 0 from fun x => congrFun hecol x, | |
| map_smul, smul_eq_mul] | |
| rw [integral_const_mul, R.cauchy_dF 0 (by simp) Ο hΟ, mul_zero] | |
| Β· intro x hx | |
| have hnew (y : Coord3) (hy : y β O) (j : Fin 2) : | |
| (u y + du y) j = l j * (v y + R.du y) 0 + ΞΊ j := by | |
| simp only [Pi.add_apply, du, he y hy j] | |
| ring | |
| have hvd := hv.differentiableOn (by simp) | |
| have hvo := (hv.add R.smooth_du.contDiffOn).differentiableOn (by simp) | |
| ext i j | |
| change (β k, (R.tensor x).val i k * gradientColumns (fderiv β (fun y => u y+du y) x) k j) = | |
| (β k, (A x).val i k * gradientColumns (fderiv β u x) k j) + l j * R.dF x i 0 | |
| simp_rw [gradientColumns_affine_column hO hnew hvo hx, | |
| gradientColumns_affine_column hO he hvd hx] | |
| have hr := congrFun (congrFun (R.constitutive x hx) i) 0 | |
| change (β k, (R.tensor x).val i k * gradientColumns (fderiv β (fun y => v y+R.du y) x) k 0) = | |
| (β k, (A x).val i k * gradientColumns (fderiv β v x) k 0) + R.dF x i 0 at hr | |
| calc | |
| β k, (R.tensor x).val i k * (l j * gradientColumns (fderiv β (fun y => v y+R.du y) x) k 0) = | |
| l j * β k, (R.tensor x).val i k * gradientColumns (fderiv β (fun y => v y+R.du y) x) k 0 := by | |
| rw [Finset.mul_sum]; apply Finset.sum_congr rfl; intro k _; ring | |
| _ = l j * ((β k, (A x).val i k * gradientColumns (fderiv β v x) k 0) + R.dF x i 0) := by rw [hr] | |
| _ = (β k, (A x).val i k * (l j * gradientColumns (fderiv β v x) k 0)) + l j * R.dF x i 0 := by | |
| rw [mul_add, Finset.mul_sum]; congr 1; apply Finset.sum_congr rfl; intro k _; ring | |
| lemma CompactSelectedReplacement.affineTransfer_relation | |
| {ΞΌ : Measure Coord3} {O : Set Coord3} (hO : IsOpen O) | |
| {u v : Coord3 β Fin 2 β β} {A : Coord3 β Symmetric3} | |
| {l ΞΊ : Fin 2 β β} | |
| (he : β x β O, β j, u x j = l j * v x 0 + ΞΊ j) | |
| (hv : ContDiffOn β (β(β€ : ββ)) v O) | |
| (R : CompactSelectedReplacement {0} ΞΌ O v A) : | |
| β x β O, β j, (u x + (R.affineTransfer hO he hv).du x) j = | |
| l j * (v x + R.du x) 0 + ΞΊ j := by | |
| intro x hx j | |
| change u x j + l j * R.du x 0 = _ | |
| rw [he x hx j] | |
| simp only [Pi.add_apply] | |
| ring | |
| end ScalarConductivity | |
| namespace ScalarConductivity | |
| open Matrix Set MeasureTheory Filter Topology | |
| open scoped Matrix.Norms.Elementwise | |
| def CompactSelectedReplacement.changeOld | |
| {J : Set (Fin 2)} | |
| {ΞΌ : Measure Coord3} {O : Set Coord3} (hO : IsOpen O) | |
| {u v : Coord3 β Fin 2 β β} {A B : Coord3 β Symmetric3} | |
| (R : CompactSelectedReplacement J ΞΌ O u A) (he : EqOn u v O) (hAB : EqOn A B O) : | |
| CompactSelectedReplacement J ΞΌ O v B where | |
| du := R.du | |
| dF := R.dF | |
| tensor := R.tensor | |
| smooth_du := R.smooth_du | |
| compact_du := R.compact_du | |
| support_du := R.support_du | |
| smooth_dF := R.smooth_dF | |
| compact_dF := R.compact_dF | |
| support_dF := R.support_dF | |
| cauchy_dF := R.cauchy_dF | |
| smooth_tensor := R.smooth_tensor | |
| rank := by | |
| intro x hx | |
| rw [β fderiv_eq_of_eqOn_open hO (show EqOn (fun y => u y+R.du y) | |
| (fun y => v y+R.du y) O from fun y hy => by dsimp only; rw [he hy]) hx] | |
| exact R.rank x hx | |
| constitutive := by | |
| intro x hx | |
| rw [β fderiv_eq_of_eqOn_open hO (show EqOn (fun y => u y+R.du y) | |
| (fun y => v y+R.du y) O from fun y hy => by dsimp only; rw [he hy]) hx] | |
| rw [R.constitutive x hx] | |
| simp only [conductivityFlux, hAB hx, fderiv_eq_of_eqOn_open hO he hx] | |
| theorem exists_locally_smooth_selected_split | |
| (J : Set (Fin 2)) | |
| (ΞΌ : Measure Coord3) [ΞΌ.IsAddHaarMeasure] | |
| (u : Coord3 β Fin 2 β β) (A : Coord3 β Symmetric3) {p : Coord3} | |
| {U : Set Coord3} (hU : IsOpen U) (hUb : Bornology.IsBounded U) (hpU : p β U) | |
| (hu : ContDiffOn β (β(β€ : ββ)) u U) | |
| (hA : ContDiffOn β (β(β€ : ββ)) (fun x => (A x).val) U) | |
| (hdiv : β j β J, β (Ο : Coord3 β β), ContDiff β (β(β€ : ββ)) Ο β HasCompactSupport Ο β | |
| tsupport Ο β U β (β« x, fderiv β Ο x ((conductivityFlux u A x).col j) βΞΌ) = 0) | |
| (hD : Function.Surjective (fderiv β u p)) | |
| (d : Coord3) (L : Coord3 βL[β] β) (hLd : L d = 1) | |
| (B : Mat3) (hB : B.IsSymm) (hBn : β v, L (B *α΅₯ v) = 0) | |
| {ΞΈ c m : β} (hΞΈ : 0 < ΞΈ) (hΞΈ1 : ΞΈ < 1) | |
| (hm : 0 < m) (hpath : β z β Icc (-ΞΈ) (1-ΞΈ), m β€ 1+c*z) | |
| (C : β β Symmetric3) (hC : β z β Icc (-ΞΈ) (1-ΞΈ), ContinuousAt C z) | |
| (hCs : β z β Icc (-ΞΈ) (1-ΞΈ), ContDiffAt β (β(β€ : ββ)) (fun t => (C t).val) z) | |
| (hdet : β z β Icc (-ΞΈ) (1-ΞΈ), 0 < (splitJacobian d L c z).det) | |
| (hconstit : β z β Icc (-ΞΈ) (1-ΞΈ), | |
| (C z).val = (splitJacobian d L c z).detβ»ΒΉ β’ | |
| (splitJacobian d L c z * ((A p).val + z β’ B) * (splitJacobian d L c z)α΅)) | |
| {G : Set (β Γ Symmetric3)} (hG : IsOpen G) | |
| (hCG : β z β Icc (-ΞΈ) (1-ΞΈ), (z, C z) β G) : | |
| β W : Set Coord3, IsOpen W β§ p β W β§ closure W β U β§ IsCompact (closure W) β§ | |
| β O : Set Coord3, IsOpen O β O β W β β Ξ΅ : β, 0 < Ξ΅ β | |
| β (R : CompactSelectedReplacement J ΞΌ O u A) (q : Coord3 β β), | |
| ContDiff β (β(β€ : ββ)) q β§ (β x, q x β Icc (-ΞΈ) (1-ΞΈ)) β§ | |
| (β x β O, (q x, R.tensor x) β G) β§ | |
| ΞΌ {x | x β O β§ q x β -ΞΈ β§ q x β 1-ΞΈ} β€ ENNReal.ofReal Ξ΅ := by | |
| obtain β¨v, V, hv, _, hV, hpV, hVU, heβ© := exists_smooth_compact_extension | |
| hU hUb isCompact_singleton (singleton_subset_iff.mpr hpU) u hu | |
| have hep : fderiv β v p = fderiv β u p := fderiv_eq_of_eqOn_open hV he (hpV (mem_singleton p)) | |
| have hAp : ContinuousAt A p := | |
| Topology.IsInducing.subtypeVal.continuousAt_iff.mpr | |
| (hA.continuousOn.continuousAt (hU.mem_nhds hpU)) | |
| have hdivv : β j β J, β (Ο : Coord3 β β), ContDiff β (β(β€ : ββ)) Ο β HasCompactSupport Ο β | |
| tsupport Ο β V β (β« x, fderiv β Ο x ((conductivityFlux v A x).col j) βΞΌ) = 0 := by | |
| intro j hj Ο hΟ hc hs | |
| rw [derivative_test_integral_congr ΞΌ Ο _ (fun x => (conductivityFlux u A x).col j) (by | |
| intro x hx | |
| simp only [conductivityFlux, fderiv_eq_of_eqOn_open hV he (hs hx)])] | |
| exact hdiv j hj Ο hΟ hc (hs.trans hVU) | |
| obtain β¨W, hW, hpW, hWV, hWc, hwβ© := exists_selected_split_on_subpatch J ΞΌ v hv A hAp | |
| hV (hUb.subset hVU) (hpV (mem_singleton p)) (hA.mono hVU) hdivv (hep βΈ hD) | |
| d L hLd B hB hBn hΞΈ hΞΈ1 hm hpath C hC hCs hdet hconstit hG hCG | |
| refine β¨W, hW, hpW, hWV.trans hVU, hWc, ?_β© | |
| intro O hO hOW Ξ΅ hΞ΅ | |
| obtain β¨R, q, hq, hqr, hqG, hqmβ© := hw O hO hOW Ξ΅ hΞ΅ | |
| exact β¨R.changeOld hO (he.mono (hOW.trans (subset_closure.trans hWV))) (fun _ _ => rfl), | |
| q, hq, hqr, hqG, hqmβ© | |
| end ScalarConductivity | |
| end | |
| end OAI | |