Download data/lean/OAI/Analysis/Conductivity/Variational/CompactSelectedReplacement.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 11.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Variational/CompactSelectedReplacement.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/Conductivity/Variational/CompactSelectedReplacement.lean
-
curl -L -o CompactSelectedReplacement.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/Conductivity/Variational/CompactSelectedReplacement.lean
11.8 kB
| import Mathlib | |
| import OAI.Analysis.Conductivity.Variational.ChangeOld | |
| 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 Filter Topology | |
| open scoped Matrix.Norms.Elementwise | |
| structure CompactSelectedReplacement (J : Set (Fin 2)) (ΞΌ : 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 β J, β (Ο : Coord3 β β), ContDiff β (β(β€ : ββ)) Ο β | |
| (β« x, fderiv β Ο x ((dF x).col j) βΞΌ) = 0 | |
| smooth_tensor : ContDiffOn β (β(β€ : ββ)) (fun x => (tensor x).val) O | |
| rank : β x β O, LinearIndependent β | |
| (gradientColumns (fderiv β (fun y => u y+du y) x)).col | |
| constitutive : β x β O, (tensor x).val * | |
| gradientColumns (fderiv β (fun y => u y+du y) x) = conductivityFlux u A x + dF x | |
| theorem synchronized_selected_replacement | |
| (J : Set (Fin 2)) | |
| (ΞΌ : Measure Coord3) [ΞΌ.IsAddHaarMeasure] | |
| (u : Coord3 β Fin 2 β β) (hu : ContDiff β (β(β€ : ββ)) u) | |
| (A : Coord3 β Symmetric3) {U O K : Set Coord3} | |
| (hU : IsOpen U) (hUb : Bornology.IsBounded U) (hOU : O β U) | |
| (hK : IsCompact K) (hKO : K β O) | |
| (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) | |
| (Y : Coord3 β Coord3) (hY : ContDiff β (β(β€ : ββ)) Y) | |
| (hYi : ContDiff β (β(β€ : ββ)) Y.symm) (hoff : β x β K, Y x = x) | |
| (z : Coord3 β β) (hz : ContDiff β (β(β€ : ββ)) z) | |
| (C : β β Symmetric3) | |
| (hC : β x β O, ContDiffAt β (β(β€ : ββ)) (fun t => (C t).val) (z x)) | |
| (Ξ΄ : Fin 2 β Coord3 β Coord3) | |
| (hΞ΄ : β j, ContDiff β (β(β€ : ββ)) (Ξ΄ j)) | |
| (hsΞ΄ : β j, tsupport (Ξ΄ j) β K) | |
| (hΞ΄div : β j (Ο : Coord3 β β), ContDiff β (β(β€ : ββ)) Ο β | |
| (β« x, fderiv β Ο x (Ξ΄ j x) βΞΌ) = 0) | |
| (hstate : β x β O, | |
| let E := gradientColumns (fderiv β u x) | |
| let Ft := conductivityFlux u A x + Matrix.of (fun i j => Ξ΄ j x i) | |
| let J := operatorMatrix (fderiv β Y x) | |
| let At := repairPushed (C (z x)) J E Ft | |
| 0 < J.det β§ LinearIndependent β E.col β§ | |
| At.val * gradientColumns (fderiv β (u β Y.symm) (Y x)) = pushFlux J Ft) : | |
| β R : CompactSelectedReplacement J ΞΌ O u A, β x β O, | |
| R.tensor (Y x) = repairPushed (C (z x)) (operatorMatrix (fderiv β Y x)) | |
| (gradientColumns (fderiv β u x)) | |
| (conductivityFlux u A x + Matrix.of (fun i j => Ξ΄ j x i)) := by | |
| classical | |
| let Ft : Coord3 β Matrix (Fin 3) (Fin 2) β := | |
| fun x => conductivityFlux u A x + Matrix.of (fun i j => Ξ΄ j x i) | |
| let G : Coord3 β Matrix (Fin 3) (Fin 2) β := | |
| fun x => Matrix.of (fun i j => piolaFlux Y (fun t => (Ft t).col j) x i) | |
| let dF : Coord3 β Matrix (Fin 3) (Fin 2) β := fun x => G x - conductivityFlux u A x | |
| let B : Coord3 β Symmetric3 := fun x => repairPushed (C (z x)) | |
| (operatorMatrix (fderiv β Y x)) (gradientColumns (fderiv β u x)) (Ft x) | |
| let du : Coord3 β Fin 2 β β := fun x => u (Y.symm x)-u x | |
| have heq : (fun x => u x+du x) = u β Y.symm := by | |
| funext x; simp only [du, Function.comp_apply]; abel | |
| have him : MapsTo Y.symm O O := (equiv_mapsTo_of_fixed_compl Y O | |
| (fun x hx => hoff x (fun hk => hx (hKO hk)))).2 | |
| have hF := conductivityFlux_contDiffOn u hu A hU hA | |
| have hcol (j : Fin 2) : ContDiffOn β (β(β€ : ββ)) | |
| (fun x => (conductivityFlux u A x).col j) U := by | |
| apply contDiffOn_pi.mpr; intro i | |
| exact contDiffOn_pi.mp (contDiffOn_pi.mp hF i) j | |
| have hdcol (j : Fin 2) := local_compact_updated_flux_regular Y hY hYi hU hUb hK | |
| (hKO.trans hOU) hoff (fun x => (conductivityFlux u A x).col j) (Ξ΄ j) | |
| (hcol j) (hΞ΄ j) (hsΞ΄ j) | |
| have hdFe (j : Fin 2) : (fun x => (dF x).col j) = | |
| fun x => piolaFlux Y (fun t => (conductivityFlux u A t).col j + Ξ΄ j t) x - | |
| (conductivityFlux u A x).col j := by rfl | |
| have hdFs : ContDiff β (β(β€ : ββ)) dF := by | |
| apply contDiff_pi.mpr; intro i | |
| apply contDiff_pi.mpr; intro j | |
| exact contDiff_pi.mp (hdFe j βΈ (hdcol j).1) i | |
| have hdsupp : tsupport dF β K := tsupport_matrix_subset dF hK.isClosed | |
| (fun j => hdFe j βΈ (hdcol j).2.2) | |
| have hdu := local_compact_recomposition_difference Y hYi hU hUb hK | |
| (hKO.trans hOU) hoff u hu.contDiffOn | |
| have hBs : ContDiffOn β (β(β€ : ββ)) (fun x => (B x).val) O := by | |
| intro x hx | |
| have hd := (hstate x hx).1.ne' | |
| have hi := (hstate x hx).2.1 | |
| have hFt : ContDiffAt β (β(β€ : ββ)) Ft x := by | |
| apply ((hF x (hOU hx)).contDiffAt (hU.mem_nhds (hOU hx))).add | |
| apply contDiffAt_pi.mpr; intro i | |
| apply contDiffAt_pi.mpr; intro j | |
| exact contDiffAt_pi.mp (hΞ΄ j).contDiffAt i | |
| exact (contDiffAt_repairPushed (fun x => C (z x)) _ _ _ | |
| ((hC x hx).comp x hz.contDiffAt) | |
| ((operatorMatrix_contDiff (m := Fin 3) (n := Fin 3)).contDiffAt.comp x (hY.contDiffAt.fderiv_right (by simp))) | |
| (contDiff_gradientColumns u hu).contDiffAt hFt hd hi).contDiffWithinAt | |
| refine β¨{ | |
| du := du, dF := dF, tensor := B β Y.symm | |
| smooth_du := hdu.1, compact_du := hdu.2.1, support_du := hdu.2.2.trans hKO | |
| smooth_dF := hdFs, compact_dF := hK.of_isClosed_subset isClosed_closure hdsupp | |
| support_dF := hdsupp.trans hKO | |
| cauchy_dF := ?_ | |
| smooth_tensor := hBs.comp hYi.contDiffOn him | |
| rank := ?_ | |
| constitutive := ?_ }, ?_β© | |
| Β· intro j hj Ο hΟ | |
| have hh := local_compact_updated_flux ΞΌ Y hY hYi hU hUb hK (hKO.trans hOU) hoff | |
| (fun x => (conductivityFlux u A x).col j) (Ξ΄ j) (hcol j) (hdiv j hj) | |
| (hΞ΄ j) (hsΞ΄ j) (hΞ΄div j) | |
| simpa only [congrFun (hdFe j)] using hh.2.2.2 Ο hΟ | |
| Β· intro x hx | |
| rw [heq, β Y.apply_symm_apply x, gradientColumns_recomposition Y | |
| (hY.differentiable (by simp)) (hYi.differentiable (by simp)) u (hu.differentiable (by simp))] | |
| exact pushGradient_rank _ (hstate (Y.symm x) (him hx)).1.ne' _ | |
| (hstate (Y.symm x) (him hx)).2.1 | |
| Β· intro x hx | |
| rw [heq] | |
| have hh := (hstate (Y.symm x) (him hx)).2.2 | |
| rw [Y.apply_symm_apply] at hh | |
| change (B (Y.symm x)).val * gradientColumns (fderiv β (u β Y.symm) x) = | |
| conductivityFlux u A x + dF x | |
| rw [hh] | |
| have he : conductivityFlux u A x+dF x=G x := by simp only [dF]; abel | |
| rw [he] | |
| ext i j | |
| have hd : 0 < (fderiv β Y (Y.symm x)).det := by | |
| rw [β operatorMatrix_det]; exact (hstate (Y.symm x) (him hx)).1 | |
| have hp := piolaFlux_columns Y Ft hd j | |
| rw [Y.apply_symm_apply] at hp | |
| exact congrFun hp.symm i | |
| Β· intro x _ | |
| simp only [Function.comp_apply, Y.symm_apply_apply, B, Ft] | |
| theorem exists_selected_split_on_subpatch | |
| (J : Set (Fin 2)) | |
| (ΞΌ : Measure Coord3) [ΞΌ.IsAddHaarMeasure] | |
| (u : Coord3 β Fin 2 β β) (hu : ContDiff β (β(β€ : ββ)) u) | |
| (A : Coord3 β Symmetric3) {p : Coord3} (hAp : ContinuousAt A p) | |
| {U : Set Coord3} (hU : IsOpen U) (hUb : Bornology.IsBounded U) (hpU : p β 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 β¨X, W, hW, hpW, hWU, hWc, hWX, hX, hXi, hopβ© := | |
| exists_local_split_on_subpatch_retained ΞΌ u hu A hAp hD d L hLd B hB hBn | |
| hΞΈ hΞΈ1 hm hpath C hC hdet hconstit hG hCG hU hpU | |
| refine β¨W, hW, hpW, hWU, hWc, ?_β© | |
| intro O hO hOW Ξ΅ hΞ΅ | |
| have hOU : O β U := hOW.trans (subset_closure.trans hWU) | |
| have hOX : O β X.source := hOW.trans hWX | |
| obtain β¨Ο, H, F, hΟc, hΟO, hΟb, hHr, hF, hFs, hFdiv, hnβ© := hop O hO hOW Ξ΅ hΞ΅ | |
| obtain β¨n, hnβ© := hn.exists | |
| obtain β¨Y, hY, hYi, hoffO, _, hform, hpure, hstateβ© := hn | |
| have hΟt : tsupport Ο.val β X.target := hΟO.trans (by | |
| rintro y β¨x, hx, rflβ©; exact X.map_source (hOX hx)) | |
| let K := X.symm '' tsupport Ο.val | |
| have hK : IsCompact K := hΟc.image_of_continuousOn (X.symm.continuousOn.mono hΟt) | |
| have hKO : K β O := by | |
| rintro x β¨y, hy, rflβ© | |
| obtain β¨t, ht, rflβ© := hΟO hy | |
| simpa only [X.left_inv (hOX ht)] using ht | |
| have hΟp := localPullback_tsupport X Ο.val hΟc hΟt | |
| have hoff : β x β K, Y x = x := by | |
| intro x hx | |
| have hz := image_eq_zero_of_notMem_tsupport (fun h => hx (hΟp.2.1 h)) | |
| rw [hform x, hz, mul_zero, zero_mul, zero_smul, add_zero] | |
| let z : Coord3 β β := fun x => localPullback X Ο.val x * | |
| (smoothDirection 1 H).val ((n+1 : β) * L (X x)) | |
| have hz : ContDiff β (β(β€ : ββ)) z := | |
| (localPullback_contDiff X hX.contDiffOn Ο.val (smoothScalar_contDiff Ο) hΟc hΟt).mul | |
| ((smoothScalar_contDiff (smoothDirection 1 H)).comp | |
| (contDiff_const.mul (L.contDiff.comp hX))) | |
| have hzr : β x, z x β Icc (-ΞΈ) (1-ΞΈ) := fun x => | |
| scalar_cutoff_segment hΞΈ.le (by linarith) (localPullback_bounds X Ο.val hΟb x) (hHr _) | |
| obtain β¨R, hRtβ© := synchronized_selected_replacement J ΞΌ u hu A hU hUb hOU hK hKO hA hdiv | |
| Y hY hYi hoff z hz C (fun x _ => hCs _ (hzr x)) (F (n+1 : β)) | |
| (hF _) (fun j => (hFs _ j).2.2) (hFdiv _) (fun x hx => | |
| β¨(hstate x hx).1, (hstate x hx).2.1, (hstate x hx).2.2.2β©) | |
| let q : Coord3 β β := z β Y.symm | |
| have him : MapsTo Y.symm O O := (equiv_mapsTo_of_fixed_compl Y O hoffO).2 | |
| refine β¨R, q, hz.comp hYi, fun x => hzr _, ?_, hpureβ© | |
| intro x hx | |
| have ht := hRt (Y.symm x) (him hx) | |
| rw [Y.apply_symm_apply] at ht | |
| rw [ht] | |
| exact (hstate (Y.symm x) (him hx)).2.2.1 | |
| end ScalarConductivity | |
| end | |
| end OAI | |