openAI-math-dataset / lean /OAI /Geometry /PrescribedRicci /ComplexIntegrationByParts.lean
roseking's picture
Add lean source and binary files (part 71)
2fca478 verified
Raw History Blame Contribute Delete
6.46 kB
16
def barDeriv (f : Coordinates d → ℂ) (z : Coordinates d) (j : Fin d) : ℂ :=
body · 2 lines
  (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector j) +
    Complex.I * fderiv ℝ f z (Complex.I • coordinateVector j))
20
def holDeriv (f : Coordinates d → ℂ) (z : Coordinates d) (j : Fin d) : ℂ :=
body · 2 lines
  (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector j) -
    Complex.I * fderiv ℝ f z (Complex.I • coordinateVector j))
24
lemma contDiff_deriv_direction {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F}
    (hf : ContDiff ℝ ∞ f) (v : E) : ContDiff ℝ ∞ (fun z => fderiv ℝ f z v) :=
proof · 1 line
  (hf.fderiv_right (by simp)).clm_apply contDiff_const
29
lemma contDiff_barDeriv {f : Coordinates d → ℂ} (hf : ContDiff ℝ ∞ f) (j : Fin d) :
    ContDiff ℝ ∞ (fun z => barDeriv f z j) :=
proof · 2 lines
  contDiff_const.mul ((contDiff_deriv_direction hf _).add
    (contDiff_const.mul (contDiff_deriv_direction hf _)))
34
lemma contDiff_holDeriv {f : Coordinates d → ℂ} (hf : ContDiff ℝ ∞ f) (j : Fin d) :
    ContDiff ℝ ∞ (fun z => holDeriv f z j) :=
proof · 2 lines
  contDiff_const.mul ((contDiff_deriv_direction hf _).sub
    (contDiff_const.mul (contDiff_deriv_direction hf _)))
39
lemma compactSupport_barDeriv {f : Coordinates d → ℂ} (hf : HasCompactSupport f)
    (j : Fin d) : HasCompactSupport (fun z => barDeriv f z j) := by
proof · 2 lines
  exact ((hf.fderiv_apply ℝ (coordinateVector j)).add
    (hf.fderiv_apply ℝ (Complex.I • coordinateVector j)).mul_left).mul_left
44
lemma integrable_mul_deriv {f g : Coordinates d → ℂ}
    (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport f)
    (v : Coordinates d) : Integrable (fun z => f z * fderiv ℝ g z v) :=
proof · 2 lines
  (hf.continuous.mul (contDiff_deriv_direction hg v).continuous).integrable_of_hasCompactSupport
    hc.mul_right
50
lemma integrable_deriv_mul {f g : Coordinates d → ℂ}
    (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport f)
    (v : Coordinates d) : Integrable (fun z => fderiv ℝ f z v * g z) :=
proof · 2 lines
  ((contDiff_deriv_direction hf v).continuous.mul hg.continuous).integrable_of_hasCompactSupport
    (hc.fderiv_apply ℝ v).mul_right
56
lemma contDiffAt_deriv_direction {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F} {z : E}
    (hf : ContDiffAt ℝ ∞ f z) (v : E) : ContDiffAt ℝ ∞ (fun y => fderiv ℝ f y v) z :=
proof · 1 line
  (hf.fderiv_right (by simp)).clm_apply contDiffAt_const
61
lemma continuous_mul_on_tsupport {E : Type*} [TopologicalSpace E] {f g : E → ℂ}
    (hf : Continuous f) (hg : ∀ z ∈ tsupport f, ContinuousAt g z) :
    Continuous (fun z => f z * g z) := by
proof · 7 lines
  rw [continuous_iff_continuousAt]
  intro z
  by_cases hz : z ∈ tsupport f
  · exact hf.continuousAt.mul (hg z hz)
  · apply (continuousAt_const (y := (0 : ℂ))).congr
    filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hz] with y hy
    simp only [hy, zero_mul, Pi.zero_apply]
72
lemma contDiff_mul_on_tsupport {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    {f g : E → ℂ} (hf : ContDiff ℝ ∞ f)
    (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z) :
    ContDiff ℝ ∞ (fun z => f z * g z) := by
proof · 7 lines
  rw [contDiff_iff_contDiffAt]
  intro z
  by_cases hz : z ∈ tsupport f
  · exact hf.contDiffAt.mul (hg z hz)
  · apply (contDiffAt_const (c := (0 : ℂ))).congr_of_eventuallyEq
    filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hz] with y hy
    simp only [hy, zero_mul, Pi.zero_apply]
84
lemma integrable_mul_deriv_local {f g : Coordinates d → ℂ}
    (hf : ContDiff ℝ ∞ f) (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z)
    (hc : HasCompactSupport f) (v : Coordinates d) :
    Integrable (fun z => f z * fderiv ℝ g z v) :=
proof · 3 lines
  (continuous_mul_on_tsupport hf.continuous (fun z hz =>
    (contDiffAt_deriv_direction (hg z hz) v).continuousAt)).integrable_of_hasCompactSupport
      hc.mul_right
92
lemma integrable_deriv_mul_local {f g : Coordinates d → ℂ}
    (hf : ContDiff ℝ ∞ f) (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z)
    (hc : HasCompactSupport f) (v : Coordinates d) :
    Integrable (fun z => fderiv ℝ f z v * g z) :=
proof · 3 lines
  (continuous_mul_on_tsupport (contDiff_deriv_direction hf v).continuous (fun z hz =>
    (hg z (tsupport_fderiv_apply_subset ℝ v hz)).continuousAt)).integrable_of_hasCompactSupport
      (hc.fderiv_apply ℝ v).mul_right
100
lemma integral_mul_barDeriv_local {f g : Coordinates d → ℂ}
    (hf : ContDiff ℝ ∞ f) (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z)
    (hc : HasCompactSupport f) (j : Fin d) :
    (∫ z, f z * barDeriv g z j) = -(∫ z, barDeriv f z j * g z) := by
proof · 22 lines
  have hv (v : Coordinates d) : (∫ z, f z * fderiv ℝ g z v) =
      -(∫ z, fderiv ℝ f z v * g z) :=
    integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable
      (integrable_deriv_mul_local hf hg hc v) (integrable_mul_deriv_local hf hg hc v)
      ((continuous_mul_on_tsupport hf.continuous (fun z hz => (hg z hz).continuousAt)).integrable_of_hasCompactSupport hc.mul_right)
      (fun z _ => hf.differentiable (by simp) z)
      (fun z hz => (hg z hz).differentiableAt (by simp))
  have he (z : Coordinates d) : f z * barDeriv g z j =
      (2 : ℂ)⁻¹ * (f z * fderiv ℝ g z (coordinateVector j)) +
      ((2 : ℂ)⁻¹ * Complex.I) * (f z * fderiv ℝ g z (Complex.I • coordinateVector j)) := by
    unfold barDeriv
    ring
  have he' (z : Coordinates d) : barDeriv f z j * g z =
      (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector j) * g z) +
      ((2 : ℂ)⁻¹ * Complex.I) * (fderiv ℝ f z (Complex.I • coordinateVector j) * g z) := by
    unfold barDeriv
    ring
  simp_rw [he, he']
  rw [integral_add ((integrable_mul_deriv_local hf hg hc _).const_mul _) ((integrable_mul_deriv_local hf hg hc _).const_mul _),
    integral_add ((integrable_deriv_mul_local hf hg hc _).const_mul _) ((integrable_deriv_mul_local hf hg hc _).const_mul _)]
  simp only [integral_const_mul, hv]
  ring