File size: 8,336 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | import Mathlib
import OAI.Analysis.Conductivity.Variational.CompactFiberDecomposition
namespace OAI
noncomputable section
namespace ScalarConductivity
open Set MeasureTheory Filter Topology
lemma interval_integral_eq_integral_of_support {a b : β} (hab : aβ€b)
{f : β β β} (hv : β t, f tβ 0 β tβIoo a b) :
(β« t in a..b, f t)=β« t, f t := by
rw [intervalIntegral.integral_of_le hab]
apply setIntegral_eq_integral_of_forall_compl_eq_zero
intro x hx
by_contra hn
exact hx β¨(hv x hn).1,(hv x hn).2.leβ©
lemma compactFiberMarginal_integral {E : Type} [NormedAddCommGroup E] [NormedSpace β E]
[MeasureSpace E] [BorelSpace E] [SFinite (volume : Measure E)]
{a b : β} (hab : aβ€b) {f : EΓβ β β} (hf : Integrable f)
(hv : β p, f pβ 0 β p.2βIoo a b) :
(β« x, compactFiberMarginal a b f x)=β« p, f p := by
have he (x : E) : compactFiberMarginal a b f x=β« t, f (x,t) :=
interval_integral_eq_integral_of_support hab (fun t ht => hv (x,t) ht)
simp_rw [he]
exact (integral_prod f hf).symm
lemma compact_scalar_primitive {a b : β} (hab : a<b) {r : β β β}
(hr : ContDiff β (β(β€ : ββ)) r)
(hv : β t, r tβ 0 β tβIoo a b) (hz : (β« t, r t)=0) :
β P : β β β, ContDiff β (β(β€ : ββ)) P β§ HasCompactSupport P β§
(β t, deriv P t=r t) β§ tsupport PβIcc a b := by
let f : βΓβ β β := fun p => r p.2
have hf : ContDiff β (β(β€ : ββ)) f := hr.comp contDiff_snd
let P : β β β := fun t => fiberPrimitive a f (0,t)
have hP : ContDiff β (β(β€ : ββ)) P :=
(fiberPrimitive_smooth a hf).comp (contDiff_const.prodMk contDiff_id)
have hvf : β p, f pβ 0 β p.2βIoo a b := fun p hp => hv p.2 hp
have hzf : β x, (β« t in a..b, f (x,t))=0 := by
intro x
exact (interval_integral_eq_integral_of_support hab.le hv).trans hz
have hs : Function.support PβIcc a b := by
intro t ht
refine β¨?_,?_β©
Β· by_contra hn
exact ht (fiberPrimitive_below hf.continuous hvf (0,t) (le_of_not_ge hn))
Β· by_contra hn
exact ht (fiberPrimitive_above hf.continuous hvf hzf (0,t) (le_of_not_ge hn))
refine β¨P,hP,HasCompactSupport.of_support_subset_isCompact isCompact_Icc hs,?_,
closure_minimal hs isClosed_Iccβ©
intro t
have hd := (((fiberPrimitive_smooth a hf).differentiable (by simp)) (0,t)).hasFDerivAt.comp_hasDerivAt t
((hasDerivAt_const t (0:β)).prodMk (hasDerivAt_id t))
exact hd.deriv.trans (fiberPrimitive_derivative a hf (0,t))
lemma cube_partial_fiber (f : Box3 β β) (p : Box3) :
cubePartial f ((0,0),1) p=wallDerivative f p := rfl
theorem compact_box_divergence {a b : Fin 3 β β} (hab : β i,a i<b i)
{r : Box3 β β} (hr : ContDiff β (β(β€ : ββ)) r) (hs : HasCompactSupport r)
(hv : tsupport rβ(Ioo (a 0) (b 0) ΓΛ’ Ioo (a 1) (b 1)) ΓΛ’ Ioo (a 2) (b 2))
(hz : (β« p, r p)=0) :
β Fβ Fβ Fβ : Box3 β β,
ContDiff β (β(β€ : ββ)) Fβ β§ ContDiff β (β(β€ : ββ)) Fβ β§
ContDiff β (β(β€ : ββ)) Fβ β§
HasCompactSupport Fβ β§ HasCompactSupport Fβ β§ HasCompactSupport Fβ β§
(β p, cubePartial Fβ ((1,0),0) p+cubePartial Fβ ((0,1),0) p+
cubePartial Fβ ((0,0),1) p=r p) β§
tsupport Fββͺtsupport Fββͺtsupport Fββ
(Icc (a 0) (b 0) ΓΛ’ Icc (a 1) (b 1)) ΓΛ’ Icc (a 2) (b 2) := by
obtain β¨Ξ·β,hΞ·β,hsΞ·β,hvΞ·β,hiΞ·ββ© := exists_unit_interval_bump (hab 2)
obtain β¨Ξ·β,hΞ·β,hsΞ·β,hvΞ·β,hiΞ·ββ© := exists_unit_interval_bump (hab 1)
let R := compactFiberMarginal (a 2) (b 2) r
have hR := compactFiberMarginal_smooth (hab 2).le hr
have hsR := (compactFiberMarginal_support hs (a := a 2) (b := b 2)).1
have hvR : tsupport RβIoo (a 0) (b 0) ΓΛ’ Ioo (a 1) (b 1) := by
intro x hx
obtain β¨p,hp,rflβ© := (compactFiberMarginal_support hs).2 hx
exact (hv hp).1
obtain β¨Fβ,hFβ,hsFβ,hdβ,htββ© := compact_fiber_decomposition (hab 2) hr hs
(fun p hp => (hv (subset_tsupport r hp)).2) hΞ·β hsΞ·β hvΞ·β hiΞ·β
let S := compactFiberMarginal (a 1) (b 1) R
have hS := compactFiberMarginal_smooth (hab 1).le hR
have hsS := (compactFiberMarginal_support hsR (a := a 1) (b := b 1)).1
have hvS : tsupport SβIoo (a 0) (b 0) := by
intro x hx
obtain β¨p,hp,rflβ© := (compactFiberMarginal_support hsR).2 hx
exact (hvR hp).1
obtain β¨G,hG,hsG,hdG,htGβ© := compact_fiber_decomposition (hab 1) hR hsR
(fun p hp => (hvR (subset_tsupport R hp)).2) hΞ·β hsΞ·β hvΞ·β hiΞ·β
have hzR : (β« x,R x)=0 := by
rw [compactFiberMarginal_integral (hab 2).le
(hr.continuous.integrable_of_hasCompactSupport hs)
(fun p hp => (hv (subset_tsupport r hp)).2)]
exact hz
have hzS : (β« x,S x)=0 := by
rw [compactFiberMarginal_integral (hab 1).le
(hR.continuous.integrable_of_hasCompactSupport hsR)
(fun p hp => (hvR (subset_tsupport R hp)).2)]
exact hzR
obtain β¨P,hP,hsP,hdP,htPβ© := compact_scalar_primitive (hab 0) hS
(fun x hx => hvS (subset_tsupport S hx)) hzS
let Fβ : Box3 β β := fun p => Ξ·β p.2*Ξ·β p.1.2*P p.1.1
let Fβ : Box3 β β := fun p => Ξ·β p.2*G p.1
have hFβ : ContDiff β (β(β€ : ββ)) Fβ :=
((hΞ·β.comp contDiff_snd).mul (hΞ·β.comp (contDiff_snd.comp contDiff_fst))).mul
(hP.comp (contDiff_fst.comp contDiff_fst))
have hFβ : ContDiff β (β(β€ : ββ)) Fβ :=
(hΞ·β.comp contDiff_snd).mul (hG.comp contDiff_fst)
let K := (Icc (a 0) (b 0) ΓΛ’ Icc (a 1) (b 1)) ΓΛ’ Icc (a 2) (b 2)
have hK : IsCompact K := (isCompact_Icc.prod isCompact_Icc).prod isCompact_Icc
have htβ : tsupport FββK := by
apply closure_minimal _ hK.isClosed
intro p hp
obtain β¨hβ,hββ© := mul_ne_zero_iff.mp hp
obtain β¨hβ,hββ© := mul_ne_zero_iff.mp hβ
exact β¨β¨htP (subset_tsupport P hβ),Ioo_subset_Icc_self (hvΞ·β (subset_tsupport Ξ·β hβ))β©,
Ioo_subset_Icc_self (hvΞ·β (subset_tsupport Ξ·β hβ))β©
have htβ : tsupport FββK := by
apply closure_minimal _ hK.isClosed
intro p hp
obtain β¨hβ,hββ© := mul_ne_zero_iff.mp hp
have hh := htG (subset_tsupport G hβ)
obtain β¨q,hq,hqxβ© := hh.1
exact β¨β¨Ioo_subset_Icc_self (hqx βΈ (hvR hq).1),hh.2β©,
Ioo_subset_Icc_self (hvΞ·β (subset_tsupport Ξ·β hβ))β©
have htβ' : tsupport FββK := by
intro p hp
have hh := htβ hp
obtain β¨q,hq,hqpβ© := hh.1
have hxy := (hv hq).1
change q.1β_ at hxy
rw [hqp] at hxy
exact β¨β¨Ioo_subset_Icc_self hxy.1,Ioo_subset_Icc_self hxy.2β©,hh.2β©
refine β¨Fβ,Fβ,Fβ,hFβ,hFβ,hFβ,
HasCompactSupport.of_support_subset_isCompact hK (subset_tsupport Fβ |>.trans htβ),
HasCompactSupport.of_support_subset_isCompact hK (subset_tsupport Fβ |>.trans htβ),hsFβ,?_,
union_subset (union_subset htβ htβ) htβ'β©
intro p
have hdβ : cubePartial Fβ ((1,0),0) p=Ξ·β p.2*Ξ·β p.1.2*S p.1.1 := by
have hline := (hasDerivAt_id p.1.1).prodMk (hasDerivAt_const p.1.1 p.1.2)
have he := ((hFβ.differentiable (by simp)) p).hasFDerivAt.comp_hasDerivAt p.1.1
(hline.prodMk (hasDerivAt_const p.1.1 p.2))
have he' : HasDerivAt (fun t => Fβ ((t,p.1.2),p.2))
(cubePartial Fβ ((1,0),0) p) p.1.1 := he
have hp := ((hP.differentiable (by simp)) p.1.1).hasDerivAt.const_mul
(Ξ·β p.2*Ξ·β p.1.2)
rw [hdP] at hp
exact he'.unique hp
have hdβ : cubePartial Fβ ((0,1),0) p=Ξ·β p.2*wallDerivative G p.1 := by
have hline := (hasDerivAt_const p.1.2 p.1.1).prodMk (hasDerivAt_id p.1.2)
have he := ((hFβ.differentiable (by simp)) p).hasFDerivAt.comp_hasDerivAt p.1.2
(hline.prodMk (hasDerivAt_const p.1.2 p.2))
have he' : HasDerivAt (fun t => Fβ ((p.1.1,t),p.2))
(cubePartial Fβ ((0,1),0) p) p.1.2 := he
have hg := (((hG.differentiable (by simp)) p.1).hasFDerivAt.comp_hasDerivAt
p.1.2 hline).const_mul (Ξ·β p.2)
exact he'.unique hg
rw [hdβ,hdβ,cube_partial_fiber]
have hβ := hdG p.1
have hβ := hdβ p
dsimp [S,R] at *
linear_combination (Ξ·β p.2)*hβ+hβ
end ScalarConductivity
end
end OAI
|