The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V18. Measure and integration

Mathlib.MeasureTheory.Integral.DivergenceTheorem

9 declarations. Mathlib docs · Source

Divergence theorem for Bochner integral

In this file we prove the Divergence theorem for Bochner integral on a box in ℝⁿ⁺¹ = Fin (n + 1) → ℝ. More precisely, we prove the following theorem.

Let E be a complete normed space. If f : ℝⁿ⁺¹ → Eⁿ⁺¹ is continuous on a rectangular box [a, b] : Set ℝⁿ⁺¹, a ≤ b, differentiable on its interior with derivative f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹, and the divergence fun x ↦ ∑ i, f' x eᵢ i is integrable on [a, b], where eᵢ = Pi.single i 1 is the i-th basis vector, then its integral is equal to the sum of integrals of f over the faces of [a, b], taken with appropriate signs. Moreover, the same is true if the function is not differentiable at countably many points of the interior of [a, b].

Once we prove the general theorem, we deduce corollaries for functions ℝ → E and pairs of functions (ℝ × ℝ) → E.

Notation

We use the following local notation to make the statement more readable. Note that the documentation website shows the actual terms, not those abbreviated using local notations.

  • ℝⁿ, ℝⁿ⁺¹, Eⁿ⁺¹: Fin n → ℝ, Fin (n + 1) → ℝ, Fin (n + 1) → E;
  • face i: the i-th face of the box [a, b] as a closed segment in ℝⁿ, namely [a ∘ Fin.succAbove i, b ∘ Fin.succAbove i];
  • e i : i-th basis vector Pi.single i 1;
  • frontFace i, backFace i: embeddings ℝⁿ → ℝⁿ⁺¹ corresponding to the front face {x | x i = b i} and back face {x | x i = a i} of the box [a, b], respectively. They are given by Fin.insertNth i (b i) and Fin.insertNth i (a i).

TODO

  • Add a version that assumes existence and integrability of partial derivatives.

Tags

divergence theorem, Bochner integral

Divergence theorem for functions on ℝⁿ⁺¹ = Fin (n + 1) → ℝ.

In this section we use the divergence theorem for a Henstock-Kurzweil-like integral BoxIntegral.hasIntegral_GP_divergence_of_forall_hasDerivWithinAt to prove the divergence theorem for Bochner integral. The divergence theorem for Bochner integral MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable assumes that the function itself is continuous on a closed box, differentiable at all but countably many points of its interior, and the divergence is integrable on the box.

This statement differs from BoxIntegral.hasIntegral_GP_divergence_of_forall_hasDerivWithinAt in several aspects.

  • We use Bochner integral instead of a Henstock-Kurzweil integral. This modification is done in MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable_aux₁. As a side effect of this change, we need to assume that the divergence is integrable.

  • We don't assume differentiability on the boundary of the box. This modification is done in MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable_aux₂. To prove it, we choose an increasing sequence of smaller boxes that cover the interior of the original box, then apply the previous lemma to these smaller boxes and take the limit of both sides of the equation.

  • We assume a ≤ b instead of ∀ i, a i < b i. This is the last step of the proof, and it is done in the main theorem MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable.

theorem MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable E3 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {n : ℕ} (a b : Fin (n + 1) → ℝ),
  a ≤ b →
    ∀ (f : (Fin (n + 1) → ℝ) → Fin (n + 1) → E) (f' : (Fin (n + 1) → ℝ) → (Fin (n + 1) → ℝ) →L[ℝ] Fin (n + 1) → E)
      (s : Set (Fin (n + 1) → ℝ)),
      s.Countable →
        ContinuousOn f (Set.Icc a b) →
          (∀ x ∈ (Set.univ.pi fun i ↦ Set.Ioo (a i) (b i)) \ s, HasFDerivAt f (f' x) x) →
            MeasureTheory.IntegrableOn (fun x ↦ ∑ i, (f' x) (Pi.single i 1) i) (Set.Icc a b) MeasureTheory.volume →
              ∫ (x : Fin (n + 1) → ℝ) in Set.Icc a b, ∑ i, (f' x) (Pi.single i 1) i =
                ∑ i,
                  ((∫ (x : Fin n → ℝ) in Set.Icc (a ∘ i.succAbove) (b ∘ i.succAbove), f (i.insertNth (b i) x) i) -
                    ∫ (x : Fin n → ℝ) in Set.Icc (a ∘ i.succAbove) (b ∘ i.succAbove), f (i.insertNth (a i) x) i)

Divergence theorem for Bochner integral. If f : ℝⁿ⁺¹ → Eⁿ⁺¹ is continuous on a rectangular box [a, b] : Set ℝⁿ⁺¹, a ≤ b, is differentiable on its interior with derivative f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹ and the divergence fun x ↦ ∑ i, f' x eᵢ i is integrable on [a, b], where eᵢ = Pi.single i 1 is the i-th basis vector, then its integral is equal to the sum of integrals of f over the faces of [a, b], taken with appropriate signs.

Moreover, the same is true if the function is not differentiable at countably many points of the interior of [a, b].

We represent both faces x i = a i and x i = b i as the box face i = [a ∘ Fin.succAbove i, b ∘ Fin.succAbove i] in ℝⁿ, where Fin.succAbove : Fin n ↪o Fin (n + 1) is the order embedding with range {i}ᶜ. The restrictions of f : ℝⁿ⁺¹ → Eⁿ⁺¹ to these faces are given by f ∘ backFace i and f ∘ frontFace i, where backFace i = Fin.insertNth i (a i) and frontFace i = Fin.insertNth i (b i) are embeddings ℝⁿ → ℝⁿ⁺¹ that take y : ℝⁿ and insert a i (resp., b i) as i-th coordinate.

theorem MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable' E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {n : ℕ} (a b : Fin (n + 1) → ℝ),
  a ≤ b →
    ∀ (f : Fin (n + 1) → (Fin (n + 1) → ℝ) → E) (f' : Fin (n + 1) → (Fin (n + 1) → ℝ) → (Fin (n + 1) → ℝ) →L[ℝ] E)
      (s : Set (Fin (n + 1) → ℝ)),
      s.Countable →
        (∀ (i : Fin (n + 1)), ContinuousOn (f i) (Set.Icc a b)) →
          (∀ x ∈ (Set.univ.pi fun i ↦ Set.Ioo (a i) (b i)) \ s, ∀ (i : Fin (n + 1)), HasFDerivAt (f i) (f' i x) x) →
            MeasureTheory.IntegrableOn (fun x ↦ ∑ i, (f' i x) (Pi.single i 1)) (Set.Icc a b) MeasureTheory.volume →
              ∫ (x : Fin (n + 1) → ℝ) in Set.Icc a b, ∑ i, (f' i x) (Pi.single i 1) =
                ∑ i,
                  ((∫ (x : Fin n → ℝ) in Set.Icc (a ∘ i.succAbove) (b ∘ i.succAbove), f i (i.insertNth (b i) x)) -
                    ∫ (x : Fin n → ℝ) in Set.Icc (a ∘ i.succAbove) (b ∘ i.succAbove), f i (i.insertNth (a i) x))

Divergence theorem for a family of functions f : Fin (n + 1) → ℝⁿ⁺¹ → E. See also MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable' for a version formulated in terms of a vector-valued function f : ℝⁿ⁺¹ → Eⁿ⁺¹.

theorem MeasureTheory.integral_divergence_of_hasFDerivAt_off_countable_of_equiv E1 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {n : ℕ} {F : Type u_1}
  [inst_2 : NormedAddCommGroup F] [inst_3 : NormedSpace ℝ F] [inst_4 : Preorder F]
  [inst_5 : MeasureTheory.MeasureSpace F] [BorelSpace F] (eL : F ≃L[ℝ] Fin (n + 1) → ℝ),
  (∀ (x y : F), eL x ≤ eL y ↔ x ≤ y) →
    MeasureTheory.MeasurePreserving (⇑eL) MeasureTheory.volume MeasureTheory.volume →
      ∀ (f : Fin (n + 1) → F → E) (f' : Fin (n + 1) → F → F →L[ℝ] E) (s : Set F),
        s.Countable →
          ∀ (a b : F),
            a ≤ b →
              (∀ (i : Fin (n + 1)), ContinuousOn (f i) (Set.Icc a b)) →
                (∀ x ∈ interior (Set.Icc a b) \ s, ∀ (i : Fin (n + 1)), HasFDerivAt (f i) (f' i x) x) →
                  ∀ (DF : F → E),
                    (∀ (x : F), DF x = ∑ i, (f' i x) (eL.symm (Pi.single i 1))) →
                      MeasureTheory.IntegrableOn DF (Set.Icc a b) MeasureTheory.volume →
                        ∫ (x : F) in Set.Icc a b, DF x =
                          ∑ i,
                            ((∫ (x : Fin n → ℝ) in Set.Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
                                f i (eL.symm (i.insertNth (eL b i) x))) -
                              ∫ (x : Fin n → ℝ) in Set.Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
                                f i (eL.symm (i.insertNth (eL a i) x)))

An auxiliary lemma that is used to specialize the general divergence theorem to spaces that do not have the form Fin n → ℝ.

theorem MeasureTheory.integral_eq_of_hasDerivAt_off_countable_of_le E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] [CompleteSpace E] (f f' : ℝ → E) {a b : ℝ},
  a ≤ b →
    ∀ {s : Set ℝ},
      s.Countable →
        ContinuousOn f (Set.Icc a b) →
          (∀ x ∈ Set.Ioo a b \ s, HasDerivAt f (f' x) x) →
            IntervalIntegrable f' MeasureTheory.volume a b → ∫ (x : ℝ) in a..b, f' x = f b - f a

Fundamental theorem of calculus, part 2. This version assumes that f is continuous on the interval and is differentiable off a countable set s.

See also

  • intervalIntegral.integral_eq_sub_of_hasDeriv_right_of_le for a version that only assumes right differentiability of f;
  • MeasureTheory.integral_eq_of_hasDerivWithinAt_off_countable for a version that works both for a ≤ b and b ≤ a at the expense of using unordered intervals instead of Set.Icc.

theorem MeasureTheory.integral_eq_of_hasDerivAt_off_countable E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] [CompleteSpace E] (f f' : ℝ → E) {a b : ℝ}
  {s : Set ℝ},
  s.Countable →
    ContinuousOn f (Set.uIcc a b) →
      (∀ x ∈ Set.Ioo (min a b) (max a b) \ s, HasDerivAt f (f' x) x) →
        IntervalIntegrable f' MeasureTheory.volume a b → ∫ (x : ℝ) in a..b, f' x = f b - f a

Fundamental theorem of calculus, part 2. This version assumes that f is continuous on the interval and is differentiable off a countable set s.

See also intervalIntegral.integral_eq_sub_of_hasDeriv_right for a version that only assumes right differentiability of f.

theorem MeasureTheory.integral_divergence_prod_Icc_of_hasFDerivAt_off_countable_of_le E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] (f g : ℝ × ℝ → E)
  (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a b : ℝ × ℝ),
  a ≤ b →
    ∀ (s : Set (ℝ × ℝ)),
      s.Countable →
        ContinuousOn f (Set.Icc a b) →
          ContinuousOn g (Set.Icc a b) →
            (∀ x ∈ Set.Ioo a.1 b.1 ×ˢ Set.Ioo a.2 b.2 \ s, HasFDerivAt f (f' x) x) →
              (∀ x ∈ Set.Ioo a.1 b.1 ×ˢ Set.Ioo a.2 b.2 \ s, HasFDerivAt g (g' x) x) →
                MeasureTheory.IntegrableOn (fun x ↦ (f' x) (1, 0) + (g' x) (0, 1)) (Set.Icc a b) MeasureTheory.volume →
                  ∫ (x : ℝ × ℝ) in Set.Icc a b, (f' x) (1, 0) + (g' x) (0, 1) =
                    (((∫ (x : ℝ) in a.1..b.1, g (x, b.2)) - ∫ (x : ℝ) in a.1..b.1, g (x, a.2)) +
                        ∫ (y : ℝ) in a.2..b.2, f (b.1, y)) -
                      ∫ (y : ℝ) in a.2..b.2, f (a.1, y)

Divergence theorem for functions on the plane along rectangles. It is formulated in terms of two functions f g : ℝ × ℝ → E and an integral over Icc a b = [a.1, b.1] × [a.2, b.2], where a b : ℝ × ℝ, a ≤ b. When thinking of f and g as the two coordinates of a single function F : ℝ × ℝ → E × E and when E = ℝ, this is the usual statement that the integral of the divergence of F inside the rectangle equals the integral of the normal derivative of F along the boundary.

See also MeasureTheory.integral2_divergence_prod_of_hasFDerivAt_off_countable for a version that does not assume a ≤ b and uses iterated interval integral instead of the integral over Icc a b.

theorem MeasureTheory.integral_divergence_prod_Icc_of_hasFDerivAt_of_le E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] (f g : ℝ × ℝ → E)
  (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a b : ℝ × ℝ),
  a ≤ b →
    ContinuousOn f (Set.Icc a b) →
      ContinuousOn g (Set.Icc a b) →
        (∀ x ∈ Set.Ioo a.1 b.1 ×ˢ Set.Ioo a.2 b.2, HasFDerivAt f (f' x) x) →
          (∀ x ∈ Set.Ioo a.1 b.1 ×ˢ Set.Ioo a.2 b.2, HasFDerivAt g (g' x) x) →
            MeasureTheory.IntegrableOn (fun x ↦ (f' x) (1, 0) + (g' x) (0, 1)) (Set.Icc a b) MeasureTheory.volume →
              ∫ (x : ℝ × ℝ) in Set.Icc a b, (f' x) (1, 0) + (g' x) (0, 1) =
                (((∫ (x : ℝ) in a.1..b.1, g (x, b.2)) - ∫ (x : ℝ) in a.1..b.1, g (x, a.2)) +
                    ∫ (y : ℝ) in a.2..b.2, f (b.1, y)) -
                  ∫ (y : ℝ) in a.2..b.2, f (a.1, y)

Divergence theorem for functions on the plane along rectangles. It is formulated in terms of two functions f g : ℝ × ℝ → E and an integral over Icc a b = [a.1, b.1] × [a.2, b.2], where a b : ℝ × ℝ, a ≤ b. When thinking of f and g as the two coordinates of a single function F : ℝ × ℝ → E × E and when E = ℝ, this is the usual statement that the integral of the divergence of F inside the rectangle equals the integral of the normal derivative of F along the boundary.

See also MeasureTheory.integral2_divergence_prod_of_hasFDerivAt for a version that does not assume a ≤ b and uses iterated interval integral instead of the integral over Icc a b.

See also integral_divergence_prod_Icc_of_hasFDerivAt_off_countable_of_le for a version that assumes differentiability out of a countable set.

theorem MeasureTheory.integral2_divergence_prod_of_hasFDerivAt_off_countable E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] (f g : ℝ × ℝ → E)
  (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a₁ a₂ b₁ b₂ : ℝ) (s : Set (ℝ × ℝ)),
  s.Countable →
    ContinuousOn f (Set.uIcc a₁ b₁ ×ˢ Set.uIcc a₂ b₂) →
      ContinuousOn g (Set.uIcc a₁ b₁ ×ˢ Set.uIcc a₂ b₂) →
        (∀ x ∈ Set.Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Set.Ioo (min a₂ b₂) (max a₂ b₂) \ s, HasFDerivAt f (f' x) x) →
          (∀ x ∈ Set.Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Set.Ioo (min a₂ b₂) (max a₂ b₂) \ s, HasFDerivAt g (g' x) x) →
            MeasureTheory.IntegrableOn (fun x ↦ (f' x) (1, 0) + (g' x) (0, 1)) (Set.uIcc a₁ b₁ ×ˢ Set.uIcc a₂ b₂)
                MeasureTheory.volume →
              ∫ (x : ℝ) in a₁..b₁, ∫ (y : ℝ) in a₂..b₂, (f' (x, y)) (1, 0) + (g' (x, y)) (0, 1) =
                (((∫ (x : ℝ) in a₁..b₁, g (x, b₂)) - ∫ (x : ℝ) in a₁..b₁, g (x, a₂)) + ∫ (y : ℝ) in a₂..b₂, f (b₁, y)) -
                  ∫ (y : ℝ) in a₂..b₂, f (a₁, y)

Divergence theorem for functions on the plane. It is formulated in terms of two functions f g : ℝ × ℝ → E and iterated integral ∫ x in a₁..b₁, ∫ y in a₂..b₂, _, where a₁ a₂ b₁ b₂ : ℝ. When thinking of f and g as the two coordinates of a single function F : ℝ × ℝ → E × E and when E = ℝ, this is the usual statement that the integral of the divergence of F inside the rectangle with vertices (aᵢ, bⱼ), i, j =1,2, equals the integral of the normal derivative of F along the boundary.

See also MeasureTheory.integral_divergence_prod_Icc_of_hasFDerivAt_off_countable_of_le for a version that uses an integral over Icc a b, where a b : ℝ × ℝ, a ≤ b.

theorem MeasureTheory.integral2_divergence_prod_of_hasFDerivAt E2 #

∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] (f g : ℝ × ℝ → E)
  (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a₁ a₂ b₁ b₂ : ℝ),
  ContinuousOn f (Set.uIcc a₁ b₁ ×ˢ Set.uIcc a₂ b₂) →
    ContinuousOn g (Set.uIcc a₁ b₁ ×ˢ Set.uIcc a₂ b₂) →
      (∀ x ∈ Set.Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Set.Ioo (min a₂ b₂) (max a₂ b₂), HasFDerivAt f (f' x) x) →
        (∀ x ∈ Set.Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Set.Ioo (min a₂ b₂) (max a₂ b₂), HasFDerivAt g (g' x) x) →
          MeasureTheory.IntegrableOn (fun x ↦ (f' x) (1, 0) + (g' x) (0, 1)) (Set.uIcc a₁ b₁ ×ˢ Set.uIcc a₂ b₂)
              MeasureTheory.volume →
            ∫ (x : ℝ) in a₁..b₁, ∫ (y : ℝ) in a₂..b₂, (f' (x, y)) (1, 0) + (g' (x, y)) (0, 1) =
              (((∫ (x : ℝ) in a₁..b₁, g (x, b₂)) - ∫ (x : ℝ) in a₁..b₁, g (x, a₂)) + ∫ (y : ℝ) in a₂..b₂, f (b₁, y)) -
                ∫ (y : ℝ) in a₂..b₂, f (a₁, y)

Divergence theorem for functions on the plane. It is formulated in terms of two functions f g : ℝ × ℝ → E and iterated integral ∫ x in a₁..b₁, ∫ y in a₂..b₂, _, where a₁ a₂ b₁ b₂ : ℝ. When thinking of f and g as the two coordinates of a single function F : ℝ × ℝ → E × E and when E = ℝ, this is the usual statement that the integral of the divergence of F inside the rectangle with vertices (aᵢ, bⱼ), i, j = 1, 2, equals the integral of the normal derivative of F along the boundary.

See also MeasureTheory.integral_divergence_prod_Icc_of_hasFDerivAt_of_le for a version that uses an integral over Icc a b, where a b : ℝ × ℝ, a ≤ b.

See also integral2_divergence_prod_of_hasFDerivAt_off_countable for a version that assumes differentiability outside of a countable set.