lemmadiffuse_drift_commute {n : β} {v f r : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1)
(hf : ContDiffββ f) (hr : ContDiffββ r)
(heq : β x, Laplacian.laplacian f x - fderiv β f x (diffuseDrift v x) = r x)
(k : Fin n) (x : Space n) :
Laplacian.laplacian (coordDeriv f k) x - fderiv β (coordDeriv f k) x (diffuseDrift v x) =
coordDeriv r k x + βl : Fin n, coordDeriv (driftCoeff v l) k x * coordDeriv f l x :=by
proof Β· 21
lines
have hc (l : Fin n) := (tensorCoeff_smooth hv hi).2.2.2.2 l
have hdc (l : Fin n) := (hc l).differentiable (by simp)
have hdfl (l : Fin n) := (coordDeriv_smooth hf l).differentiable (by simp)
havehe : Laplacian.laplacian f = fun y => r y + βl : Fin n, driftCoeff v l y * coordDeriv f l y :=by
funext y
have hh := heq y
rw [fderiv_diffuseDrift_sum] at hh
linarith
rw [laplacian_coordDeriv hf, he, coordDeriv_add (g :=fun y =>βl : Fin n, driftCoeff v l y * coordDeriv f l y)
(hr.differentiable (by simp))
(Differentiable.fun_sum (fun l _ => (hdc l).fun_mul (hdfl l))),
coordDeriv_sum (f :=fun l y => driftCoeff v l y * coordDeriv f l y) _
(fun l _ => (hdc l).fun_mul (hdfl l)), fderiv_diffuseDrift_sum]
have hh (l : Fin n) : coordDeriv (fun y => driftCoeff v l y * coordDeriv f l y) k x =
driftCoeff v l x * coordDeriv (coordDeriv f k) l x +
coordDeriv (driftCoeff v l) k x * coordDeriv f l x :=by
rw [coordDeriv_mul (hdc l) (hdfl l), coordDeriv_comm (smooth_C2 hf) l k]
ring
simp_rw [hh]
rw [Finset.sum_add_distrib]
ring
lemmainverseHessian_deriv_drift_bound {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v)
(i j k : Fin n) (x : Space n) :
|Laplacian.laplacian (coordDeriv (inverseHessian v i j) k) x -
fderiv β (coordDeriv (inverseHessian v i j) k) x (diffuseDrift v x)| β€
tensorCoeffConstant n * (1 + 6 * n) *
(diffuseDefect v x + Real.sqrt (hessianSquare v x) + Real.sqrt (tensorDerivativeSquare v x)) :=by
proof Β· 23
lines
rw [diffuse_drift_commute hv hi (inverseHessian_smooth hv hi i j) (tensorSource_smooth hv hi i j)
(inverseHessian_drift_factored hv hi hAC i j)]
letC:= tensorCoeffConstant n
letS:=Real.sqrt (hessianSquare v x)
letQ:=Real.sqrt (tensorDerivativeSquare v x)
havehC : 0β€C:= (tensorCoeffConstant_pos n).le
havehD : 0β€ diffuseDefect v x := diffuseDefect_nonneg (smooth_C2 hv) hi hAC x
havehS : 0β€S:=Real.sqrt_nonneg _
havehQ : 0β€Q:=Real.sqrt_nonneg _
havehh : |βl : Fin n, coordDeriv (driftCoeff v l) k x * coordDeriv (inverseHessian v i j) l x| β€
n * (C * Q) :=by
apply (Finset.abs_sum_le_sum_abs _ _).trans
apply le_trans (Finset.sum_le_sum (fun (l : Fin n) (_ : l βFinset.univ) =>show
|coordDeriv (driftCoeff v l) k x * coordDeriv (inverseHessian v i j) l x| β€C * Qby
rw [abs_mul]
exact mul_le_mul (((tensorCoeff_C1Bound hv hi hAC).2.2.2.2 l).2 k x)
(inverseHessian_deriv_abs_le_sqrt v i j l x) (abs_nonneg _) hC))
simp
apply ((abs_add_le _ _).trans (add_le_add (tensorSource_coord_bound hv hi hAC i j k x) hh)).trans
change C * (1 + 5 * n) * (diffuseDefect v x + S + Q) + n * (C * Q) β€C * (1 + 6 * n) * (diffuseDefect v x + S + Q)
havehpos : 0β€C * n * (diffuseDefect v x + S) :=by positivity
nlinarith
lemmadrift_sum_identity {n : β} {ΞΉ : Type*} (s : Finset ΞΉ) {f : ΞΉ βSpace n ββ}
(hf : β i β s, ContDiffβ2 (f i)) (b : Space n βSpace n) (x : Space n) :
Laplacian.laplacian (fun y =>β i β s, f i y) x -
fderiv β (fun y =>β i β s, f i y) x (b x) =
β i β s, (Laplacian.laplacian (f i) x - fderiv β (f i) x (b x)) :=by
proof Β· 3
lines
rw [laplacian_sum s hf, fderiv_fun_sum (A:= f)
(fun i hi => (hf i hi).differentiable (by norm_num) x)]
simp only [sum_apply, Finset.sum_sub_distrib]
lemmatensorDerivativeSquare_eq_sum {n : β} (v : Space n ββ) (x : Space n) :
tensorDerivativeSquare v x = βi : Fin n, βj : Fin n, βk : Fin n,
coordDeriv (inverseHessian v i j) k x ^ 2:=by
proof Β· 1
line
simp only [tensorDerivativeSquare, gradient_norm_sq]
lemmatensorDerivativeSquare_uniform {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v)
(x : Space n) :
tensorDerivativeSquare v x β€ n ^ 3 * inverseJetConstant n ^ 2:=by
proof Β· 8
lines
rw [tensorDerivativeSquare_eq_sum]
have hh (i j k : Fin n) : coordDeriv (inverseHessian v i j) k x ^ 2β€ inverseJetConstant n ^ 2:=by
rw [β sq_abs (coordDeriv (inverseHessian v i j) k x)]
exact pow_le_pow_leftβ (abs_nonneg _) (((inverseJet_C1Bound hv hi hAC).2.2.2.2 i j).2 k x) 2
apply (Finset.sum_le_sum (fun i _ =>Finset.sum_le_sum (fun j _ =>Finset.sum_le_sum (fun k _ => hh i j k)))).trans
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
ring_nf; rfl
lemmatensorDerivativeSquare_drift_identity {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (x : Space n) :
Laplacian.laplacian (tensorDerivativeSquare v) x -
fderiv β (tensorDerivativeSquare v) x (diffuseDrift v x) =
βi : Fin n, βj : Fin n, βk : Fin n,
(2 * βgradient (coordDeriv (inverseHessian v i j) k) xβ ^ 2 +
2 * coordDeriv (inverseHessian v i j) k x *
(Laplacian.laplacian (coordDeriv (inverseHessian v i j) k) x -
fderiv β (coordDeriv (inverseHessian v i j) k) x (diffuseDrift v x))) :=by
proof Β· 11
lines
have hT (i j k : Fin n) := smooth_C2 (coordDeriv_smooth (inverseHessian_smooth hv hi i j) k)
havehe : tensorDerivativeSquare v = fun y =>βi : Fin n, βj : Fin n, βk : Fin n,
coordDeriv (inverseHessian v i j) k y ^ 2:= funext (tensorDerivativeSquare_eq_sum v)
rw [he, drift_sum_identity _ (fun i _ =>ContDiff.sum (fun j _ =>ContDiff.sum (fun k _ => (hT i j k).pow 2)))]
apply Finset.sum_congr rfl; intro i _
rw [drift_sum_identity _ (fun j _ =>ContDiff.sum (fun k _ => (hT i j k).pow 2))]
apply Finset.sum_congr rfl; intro j _
rw [drift_sum_identity _ (fun k _ => (hT i j k).pow 2)]
apply Finset.sum_congr rfl; intro k _
exact drift_square_identity (hT i j k) (diffuseDrift v) x
lemmatensorDerivativeSquare_drift_lower {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v)
(x : Space n) :
-tensorSecondBernsteinConstant n * (tensorDerivativeSquare v x + diffuseDefect v x) β€Laplacian.laplacian (tensorDerivativeSquare v) x -
fderiv β (tensorDerivativeSquare v) x (diffuseDrift v x) :=by
proof Β· 51
lines
letC:= tensorCoeffConstant n * (1 + 6 * n)
letS:=Real.sqrt (hessianSquare v x)
letQ:=Real.sqrt (tensorDerivativeSquare v x)
havehC : 0β€C:= mul_nonneg (tensorCoeffConstant_pos n).le (by positivity)
have hD := diffuseDefect_nonneg (smooth_C2 hv) hi hAC x
have hD1 := diffuseDefect_le_one v x
havehD2 : diffuseDefect v x ^ 2β€ diffuseDefect v x :=by nlinarith
havehS : S ^ 2 = hessianSquare v x :=Real.sq_sqrt (hessianSquare_nonneg v x)
havehQ : Q ^ 2 = tensorDerivativeSquare v x :=Real.sq_sqrt (tensorDerivativeSquare_nonneg v x)
havehBs : 0β€ tensorBernsteinConstant n :=by dsimp [tensorBernsteinConstant]; positivity
have hpair (i j k : Fin n) :
-(coordDeriv (inverseHessian v i j) k x ^ 2) -
3 * C ^ 2 * (diffuseDefect v x + hessianSquare v x + tensorDerivativeSquare v x) β€2 * βgradient (coordDeriv (inverseHessian v i j) k) xβ ^ 2 +
2 * coordDeriv (inverseHessian v i j) k x *
(Laplacian.laplacian (coordDeriv (inverseHessian v i j) k) x -
fderiv β (coordDeriv (inverseHessian v i j) k) x (diffuseDrift v x)) :=byletR:=Laplacian.laplacian (coordDeriv (inverseHessian v i j) k) x -
fderiv β (coordDeriv (inverseHessian v i j) k) x (diffuseDrift v x)
havehR : |R| β€C * (diffuseDefect v x + S + Q) := inverseHessian_deriv_drift_bound hv hi hAC i j k x
havehR2 : R ^ 2β€3 * C ^ 2 *
(diffuseDefect v x + hessianSquare v x + tensorDerivativeSquare v x) :=bycalcR ^ 2 = |R| ^ 2:= (sq_abs R).symm
_ β€ (C * (diffuseDefect v x + S + Q)) ^ 2:= pow_le_pow_leftβ (abs_nonneg R) hR 2
_ = C ^ 2 * (diffuseDefect v x + S + Q) ^ 2:=by ring
_ β€C ^ 2 * (3 * (diffuseDefect v x + hessianSquare v x + tensorDerivativeSquare v x)) :=by
apply mul_le_mul_of_nonneg_left _ (sq_nonneg C)
nlinarith [sq_nonneg (diffuseDefect v x - S), sq_nonneg (diffuseDefect v x - Q), sq_nonneg (S - Q)]
_ = _ :=by ring
have hy := sq_nonneg (coordDeriv (inverseHessian v i j) k x + R)
have hg := sq_nonneg βgradient (coordDeriv (inverseHessian v i j) k) xβ
change _ β€2 * βgradient (coordDeriv (inverseHessian v i j) k) xβ ^ 2 +
2 * coordDeriv (inverseHessian v i j) k x * R
nlinarith
rw [tensorDerivativeSquare_drift_identity hv hi]
have hsum :=Finset.sum_le_sum (fun (i : Fin n) (_ : i βFinset.univ) =>Finset.sum_le_sum (fun (j : Fin n) (_ : j βFinset.univ) =>Finset.sum_le_sum (fun (k : Fin n) (_ : k βFinset.univ) => hpair i j k)))
apply le_trans _ hsum
simp only [Finset.sum_sub_distrib, Finset.sum_neg_distrib, Finset.sum_const,
Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
rw [β tensorDerivativeSquare_eq_sum]
have hFD := hessianSquare_le_defect hv hi hAC x
have hE := tensorDerivativeSquare_nonneg v x
havehbig : diffuseDefect v x + hessianSquare v x + tensorDerivativeSquare v x β€
(tensorBernsteinConstant n + 4) * (diffuseDefect v x + tensorDerivativeSquare v x) :=by
nlinarith [mul_nonneg hBs hE]
have hscale := mul_le_mul_of_nonneg_left hbig (show0β€3 * (n : β) ^ 3 * C ^ 2by positivity)
dsimp only [tensorSecondBernsteinConstant]
change -(1 + 3 * (n : β) ^ 3 * C ^ 2 * (tensorBernsteinConstant n + 4)) * _ β€ _
nlinarith
lemmahessianSquare_drift_lower_refined {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v)
(x : Space n) :
2 * tensorDerivativeSquare v x - tensorBernsteinConstant n * (hessianSquare v x + diffuseDefect v x ^ 2) β€Laplacian.laplacian (hessianSquare v) x - fderiv β (hessianSquare v) x (diffuseDrift v x) :=by
proof Β· 37
lines
letC:= tensorSystemConstant n
letS:=Real.sqrt (hessianSquare v x)
havehC : 0β€C:=by dsimp [C, tensorSystemConstant]; positivity
havehS : 0β€S:=Real.sqrt_nonneg _
havehSsq : S ^ 2 = hessianSquare v x :=Real.sq_sqrt (hessianSquare_nonneg v x)
havehD : 0β€ diffuseDefect v x := diffuseDefect_nonneg (smooth_C2 hv) hi hAC x
have hpair (i j : Fin n) :
2 * βgradient (inverseHessian v i j) xβ ^ 2 - (inverseHessian v i j x ^ 2) - 2 * C ^ 2 * (hessianSquare v x + diffuseDefect v x ^ 2) β€2 * βgradient (inverseHessian v i j) xβ ^ 2 +
2 * inverseHessian v i j x * (Laplacian.laplacian (inverseHessian v i j) x -
fderiv β (inverseHessian v i j) x (diffuseDrift v x)) :=byletR:=Laplacian.laplacian (inverseHessian v i j) x - fderiv β (inverseHessian v i j) x (diffuseDrift v x)
havehR : |R| β€C * (diffuseDefect v x + S) := inverseHessian_drift_abs_bound hv hi hAC i j x
havehR2 : R ^ 2β€2 * C ^ 2 * (hessianSquare v x + diffuseDefect v x ^ 2) :=bycalcR ^ 2 = |R| ^ 2:= (sq_abs R).symm
_ β€ (C * (diffuseDefect v x + S)) ^ 2:= pow_le_pow_leftβ (abs_nonneg R) hR 2
_ = C ^ 2 * (diffuseDefect v x + S) ^ 2:=by ring
_ β€C ^ 2 * (2 * (hessianSquare v x + diffuseDefect v x ^ 2)) :=by
apply mul_le_mul_of_nonneg_left _ (sq_nonneg C)
nlinarith [sq_nonneg (diffuseDefect v x - S)]
_ = _ :=by ring
have hy := sq_nonneg (inverseHessian v i j x + R)
have hg := sq_nonneg βgradient (inverseHessian v i j) xβ
change _ β€2 * βgradient (inverseHessian v i j) xβ ^ 2 + 2 * inverseHessian v i j x * R
nlinarith
rw [hessianSquare_drift_identity hv hi]
have hsum :=Finset.sum_le_sum (fun (i : Fin n) (_ : i βFinset.univ) =>Finset.sum_le_sum (fun (j : Fin n) (_ : j βFinset.univ) => hpair i j))
apply le_trans _ hsum
simp only [Finset.sum_sub_distrib, Finset.sum_const,
Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, βFinset.mul_sum]
rw [β hessianSquare_eq_sum]
change 2 * tensorDerivativeSquare v x - tensorBernsteinConstant n * _ β€2 * tensorDerivativeSquare v x - hessianSquare v x - _
dsimp only [tensorBernsteinConstant]
change 2 * tensorDerivativeSquare v x - (1 + 2 * (n : β) ^ 2 * C ^ 2) * _ β€ _
nlinarith [sq_nonneg (diffuseDefect v x)]
lemmadefectCarrier_bounds {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v)
(x : Space n) : diffuseDefect v x / 2β€ defectCarrier v x β§ defectCarrier v x β€ diffuseDefect v x :=by
lemmadrift_const_mul {n : β} {f : Space n ββ} (hf : ContDiffβ2 f)
(b : Space n βSpace n) (c : β) (x : Space n) :
Laplacian.laplacian (fun y => c * f y) x - fderiv β (fun y => c * f y) x (b x) =
c * (Laplacian.laplacian f x - fderiv β f x (b x)) :=by
proof Β· 3
lines
rw [laplacian_fun_const_mul hf]
rw [fderiv_const_mul (hf.differentiable (by norm_num) x)]
simp only [smul_apply, smul_eq_mul]; ring
lemmadrift_sub {n : β} {f g : Space n ββ} (hf : ContDiffβ2 f) (hg : ContDiffβ2 g)
(b : Space n βSpace n) (x : Space n) :
Laplacian.laplacian (fun y => f y - g y) x - fderiv β (fun y => f y - g y) x (b x) =
(Laplacian.laplacian f x - fderiv β f x (b x)) -
(Laplacian.laplacian g x - fderiv β g x (b x)) :=by
proof Β· 3
lines
rw [laplacian_fun_sub hf hg, fderiv_fun_sub (hf.differentiable (by norm_num) x)
(hg.differentiable (by norm_num) x)]
simp only [sub_apply]; ring
lemmadefectCarrier_drift_upper {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v)
(x : Space n) :
Laplacian.laplacian (defectCarrier v) x - fderiv β (defectCarrier v) x (diffuseDrift v x) β€2 * (2 + tensorBernsteinConstant n * (tensorBernsteinConstant n + 4) / carrierScale n) *
defectCarrier v x - 2 * (tensorDerivativeSquare v x / carrierScale n) :=by
proof Β· 24
lines
have hD := diffuseDefect_nonneg (smooth_C2 hv) hi hAC x
have hD1 := diffuseDefect_le_one v x
havehD2 : diffuseDefect v x ^ 2β€ diffuseDefect v x :=by nlinarith
have hF := hessianSquare_le_defect hv hi hAC x
have hF0 := hessianSquare_nonneg v x
havehBs : 0β€ tensorBernsteinConstant n :=by dsimp [tensorBernsteinConstant]; positivity
have hs := carrierScale_pos n
have hCD := (defectCarrier_bounds hv hi hAC x).1have hUp := diffuseDefect_drift_upper hv hi hAC x
have hLow := hessianSquare_drift_lower_refined hv hi hAC x
have hlow' := div_le_div_of_nonneg_right hLow hs.le
havehFd : hessianSquare v x + diffuseDefect v x ^ 2β€
(tensorBernsteinConstant n + 4) * diffuseDefect v x :=by linarith
have hFd' := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hFd hBs) hs.le
have hCD' := mul_le_mul_of_nonneg_left hCD
(show0β€2 * (2 + tensorBernsteinConstant n * (tensorBernsteinConstant n + 4) / carrierScale n) by positivity)
havehe : defectCarrier v = fun y => diffuseDefect v y -
(carrierScale n)β»ΒΉ * hessianSquare v y :=by funext y; simp [defectCarrier, div_eq_mul_inv, mul_comm]
rw [he, drift_sub (smooth_C2 (diffuseDefect_smooth hv hi))
(contDiff_const.mul (smooth_C2 (hessianSquare_smooth hv hi))),
drift_const_mul (smooth_C2 (hessianSquare_smooth hv hi))]
rw [he] at hCD'
simp only [div_eq_mul_inv] at hlow' hFd' hCD' β’
nlinarith
lemmaC1Bound.sub {n : β} {f g : Space n ββ} {CK : β}
(hf : Differentiableβ f) (hg : Differentiableβ g) (h : C1Bound f C) (h' : C1Bound g K) :
C1Bound (fun x => f x - g x) (C + K) :=by
proof Β· 6
lines
constructor
Β· intro x; exact (abs_sub (f x) (g x)).trans (add_le_add (h.1 x) (h'.1 x))
Β· intro i x
change |fderiv β (fun y => f y - g y) x (basis n i)| β€ _
rw [fderiv_fun_sub (hf x) (hg x), sub_apply]
exact (abs_sub _ _).trans (add_le_add (h.2 i x) (h'.2 i x))
lemmaC1Bound.sum {n : β} {ΞΉ : Type*} (s : Finset ΞΉ) {f : ΞΉ βSpace n ββ} {C : ΞΉ ββ}
(hf : β i β s, Differentiableβ (f i)) (h : β i β s, C1Bound (f i) (C i)) :
C1Bound (fun x =>β i β s, f i x) (β i β s, C i) :=by
proof Β· 5
lines
constructor
Β· intro x; exact (Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum (fun i hi => (h i hi).1 x))
Β· intro k x
rw [coordDeriv_sum s hf]
exact (Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum (fun i hi => (h i hi).2 k x))
lemmahessianSquare_C1Bound {n : β} {v : Space n ββ}
(hv : ContDiffββ v) (hi : β x, v x βSet.Ioo (-1 : β) 1) (hAC : AllenCahn v) :
C1Bound (hessianSquare v) (2 * n ^ 2 * inverseJetConstant n ^ 2) :=by
proof Β· 12
lines
havehJ : 0β€ inverseJetConstant n := (bynorm_num : (0 : β) β€1).trans (inverseJetConstant_one_le n)
have hT (i j : Fin n) := (inverseHessian_smooth hv hi i j).differentiable (by simp)
have hb (i j : Fin n) := (inverseJet_C1Bound hv hi hAC).2.2.2.2 i j
have hp (i j : Fin n) := (hb i j).mul (hT i j) (hT i j) hJ hJ (hb i j)
have hh :=C1Bound.sum Finset.univ
(fun i _ =>Differentiable.fun_sum (fun j _ => (hT i j).fun_mul (hT i j)))
(fun i _ =>C1Bound.sum Finset.univ (fun j _ => (hT i j).fun_mul (hT i j)) (fun j _ => hp i j))
havehe : (fun y =>βi : Fin n, βj : Fin n, inverseHessian v i j y * inverseHessian v i j y) =
hessianSquare v :=by funext y; simp only [β pow_two, β hessianSquare_eq_sum]
rw [he] at hh
convert hh using1
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]; ring