File: Mathlib/Analysis/BoxIntegral/Basic.lean

full_name: BoxIntegral.«_aux_Mathlib_Analysis_BoxIntegral_Basic___macroRules_BoxIntegral_termℝⁿ_1»
code: local notation "ℝⁿ" => ι → ℝ
goal: Lean.Macro

full_name: BoxIntegral.integralSum
code: /-- The integral sum of `f : ℝⁿ → E` over a tagged prepartition `π` w.r.t. box-additive volume `vol`
with codomain `E →L[ℝ] F` is the sum of `vol J (f (π.tag J))` over all boxes of `π`. -/
def integralSum (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I) : F 
goal: F

full_name: BoxIntegral.integralSum_biUnionTagged
code: theorem integralSum_biUnionTagged (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : Prepartition I)
    (πi : ∀ J, TaggedPrepartition J) :
    integralSum f vol (π.biUnionTagged πi) = ∑ J ∈ π.boxes, integralSum f vol (πi J) 
goal: BoxIntegral.integralSum f vol (π.biUnionTagged πi) = ∑ J ∈ π.boxes, BoxIntegral.integralSum f vol (πi J)

full_name: BoxIntegral.integralSum_biUnion_partition
code: theorem integralSum_biUnion_partition (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F)
    (π : TaggedPrepartition I) (πi : ∀ J, Prepartition J) (hπi : ∀ J ∈ π, (πi J).IsPartition) :
    integralSum f vol (π.biUnionPrepartition πi) = integralSum f vol π 
goal: BoxIntegral.integralSum f vol (π.biUnionPrepartition πi) = BoxIntegral.integralSum f vol π

full_name: BoxIntegral.integralSum_inf_partition
code: theorem integralSum_inf_partition (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I)
    {π' : Prepartition I} (h : π'.IsPartition) :
    integralSum f vol (π.infPrepartition π') = integralSum f vol π 
goal: BoxIntegral.integralSum f vol (π.infPrepartition π') = BoxIntegral.integralSum f vol π

full_name: BoxIntegral.integralSum_fiberwise
code: theorem integralSum_fiberwise {α} (g : Box ι → α) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F)
    (π : TaggedPrepartition I) :
    (∑ y ∈ π.boxes.image g, integralSum f vol (π.filter (g · = y))) = integralSum f vol π 
goal: ∑ y ∈ Finset.image g π.boxes, BoxIntegral.integralSum f vol (π.filter fun x => g x = y) =
  BoxIntegral.integralSum f vol π

full_name: BoxIntegral.integralSum_sub_partitions
code: theorem integralSum_sub_partitions (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F)
    {π₁ π₂ : TaggedPrepartition I} (h₁ : π₁.IsPartition) (h₂ : π₂.IsPartition) :
    integralSum f vol π₁ - integralSum f vol π₂ =
      ∑ J ∈ (π₁.toPrepartition ⊓ π₂.toPrepartition).boxes,
        (vol J (f <| (π₁.infPrepartition π₂.toPrepartition).tag J) -
          vol J (f <| (π₂.infPrepartition π₁.toPrepartition).tag J)) 
goal: BoxIntegral.integralSum f vol π₁ - BoxIntegral.integralSum f vol π₂ =
  ∑ J ∈ (π₁.toPrepartition ⊓ π₂.toPrepartition).boxes,
    ((vol J) (f ((π₁.infPrepartition π₂.toPrepartition).tag J)) -
      (vol J) (f ((π₂.infPrepartition π₁.toPrepartition).tag J)))

full_name: BoxIntegral.integralSum_disjUnion
code: @[simp]
theorem integralSum_disjUnion (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) {π₁ π₂ : TaggedPrepartition I}
    (h : Disjoint π₁.iUnion π₂.iUnion) :
    integralSum f vol (π₁.disjUnion π₂ h) = integralSum f vol π₁ + integralSum f vol π₂ 
goal: BoxIntegral.integralSum f vol (π₁.disjUnion π₂ h) = BoxIntegral.integralSum f vol π₁ + BoxIntegral.integralSum f vol π₂

full_name: BoxIntegral.integralSum_add
code: @[simp]
theorem integralSum_add (f g : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I) :
    integralSum (f + g) vol π = integralSum f vol π + integralSum g vol π 
goal: BoxIntegral.integralSum (f + g) vol π = BoxIntegral.integralSum f vol π + BoxIntegral.integralSum g vol π

full_name: BoxIntegral.integralSum_neg
code: @[simp]
theorem integralSum_neg (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I) :
    integralSum (-f) vol π = -integralSum f vol π 
goal: BoxIntegral.integralSum (-f) vol π = -BoxIntegral.integralSum f vol π

full_name: BoxIntegral.integralSum_smul
code: @[simp]
theorem integralSum_smul (c : ℝ) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I) :
    integralSum (c • f) vol π = c • integralSum f vol π 
goal: BoxIntegral.integralSum (c • f) vol π = c • BoxIntegral.integralSum f vol π

full_name: BoxIntegral.HasIntegral
code: /-- The predicate `HasIntegral I l f vol y` says that `y` is the integral of `f` over `I` along `l`
w.r.t. volume `vol`. This means that integral sums of `f` tend to `𝓝 y` along
`BoxIntegral.IntegrationParams.toFilteriUnion I ⊤`. -/
def HasIntegral (I : Box ι) (l : IntegrationParams) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (y : F) :
    Prop 
goal: Prop

full_name: BoxIntegral.Integrable
code: /-- A function is integrable if there exists a vector that satisfies the `HasIntegral`
predicate. -/
def Integrable (I : Box ι) (l : IntegrationParams) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) 
goal: Prop

full_name: BoxIntegral.integral
code: /-- The integral of a function `f` over a box `I` along a filter `l` w.r.t. a volume `vol`.
Returns zero on non-integrable functions. -/
def integral (I : Box ι) (l : IntegrationParams) (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) 
goal: F

full_name: BoxIntegral.HasIntegral.tendsto
code: /-- Reinterpret `BoxIntegral.HasIntegral` as `Filter.Tendsto`, e.g., dot-notation theorems
that are shadowed in the `BoxIntegral.HasIntegral` namespace. -/
theorem HasIntegral.tendsto (h : HasIntegral I l f vol y) :
    Tendsto (integralSum f vol) (l.toFilteriUnion I ⊤) (𝓝 y) 
goal: Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I ⊤) (𝓝 y)

full_name: BoxIntegral.hasIntegral_iff
code: /-- The `ε`-`δ` definition of `BoxIntegral.HasIntegral`. -/
theorem hasIntegral_iff : HasIntegral I l f vol y ↔
    ∀ ε > (0 : ℝ), ∃ r : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ), (∀ c, l.RCond (r c)) ∧
      ∀ c π, l.MemBaseSet I c (r c) π → IsPartition π → dist (integralSum f vol π) y ≤ ε 
goal: BoxIntegral.HasIntegral I l f vol y ↔
  ∀ ε > 0,
    ∃ r,
      (∀ (c : ℝ≥0), l.RCond (r c)) ∧
        ∀ (c : ℝ≥0) (π : BoxIntegral.TaggedPrepartition I),
          l.MemBaseSet I c (r c) π → π.IsPartition → dist (BoxIntegral.integralSum f vol π) y ≤ ε

full_name: BoxIntegral.HasIntegral.of_mul
code: /-- Quite often it is more natural to prove an estimate of the form `a * ε`, not `ε` in the RHS of
`BoxIntegral.hasIntegral_iff`, so we provide this auxiliary lemma.  -/
theorem HasIntegral.of_mul (a : ℝ)
    (h : ∀ ε : ℝ, 0 < ε → ∃ r : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ), (∀ c, l.RCond (r c)) ∧ ∀ c π,
      l.MemBaseSet I c (r c) π → IsPartition π → dist (integralSum f vol π) y ≤ a * ε) :
    HasIntegral I l f vol y 
goal: BoxIntegral.HasIntegral I l f vol y

full_name: BoxIntegral.integrable_iff_cauchy
code: theorem integrable_iff_cauchy [CompleteSpace F] :
    Integrable I l f vol ↔ Cauchy ((l.toFilteriUnion I ⊤).map (integralSum f vol)) 
goal: BoxIntegral.Integrable I l f vol ↔ Cauchy (Filter.map (BoxIntegral.integralSum f vol) (l.toFilteriUnion I ⊤))

full_name: BoxIntegral.integrable_iff_cauchy_basis
code: /-- In a complete space, a function is integrable if and only if its integral sums form a Cauchy
net. Here we restate this fact in terms of `∀ ε > 0, ∃ r, ...`. -/
theorem integrable_iff_cauchy_basis [CompleteSpace F] : Integrable I l f vol ↔
    ∀ ε > (0 : ℝ), ∃ r : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ), (∀ c, l.RCond (r c)) ∧
      ∀ c₁ c₂ π₁ π₂, l.MemBaseSet I c₁ (r c₁) π₁ → π₁.IsPartition → l.MemBaseSet I c₂ (r c₂) π₂ →
        π₂.IsPartition → dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε 
goal: BoxIntegral.Integrable I l f vol ↔
  ∀ ε > 0,
    ∃ r,
      (∀ (c : ℝ≥0), l.RCond (r c)) ∧
        ∀ (c₁ c₂ : ℝ≥0) (π₁ π₂ : BoxIntegral.TaggedPrepartition I),
          l.MemBaseSet I c₁ (r c₁) π₁ →
            π₁.IsPartition →
              l.MemBaseSet I c₂ (r c₂) π₂ →
                π₂.IsPartition → dist (BoxIntegral.integralSum f vol π₁) (BoxIntegral.integralSum f vol π₂) ≤ ε

full_name: BoxIntegral.HasIntegral.mono
code: theorem HasIntegral.mono {l₁ l₂ : IntegrationParams} (h : HasIntegral I l₁ f vol y) (hl : l₂ ≤ l₁) :
    HasIntegral I l₂ f vol y 
goal: BoxIntegral.HasIntegral I l₂ f vol y

full_name: BoxIntegral.Integrable.hasIntegral
code: protected theorem Integrable.hasIntegral (h : Integrable I l f vol) :
    HasIntegral I l f vol (integral I l f vol) 
goal: BoxIntegral.HasIntegral I l f vol (BoxIntegral.integral I l f vol)

full_name: BoxIntegral.Integrable.mono
code: theorem Integrable.mono {l'} (h : Integrable I l f vol) (hle : l' ≤ l) : Integrable I l' f vol 
goal: BoxIntegral.Integrable I l' f vol

full_name: BoxIntegral.HasIntegral.unique
code: theorem HasIntegral.unique (h : HasIntegral I l f vol y) (h' : HasIntegral I l f vol y') : y = y' 
goal: y = y'

full_name: BoxIntegral.HasIntegral.integrable
code: theorem HasIntegral.integrable (h : HasIntegral I l f vol y) : Integrable I l f vol 
goal: BoxIntegral.Integrable I l f vol

full_name: BoxIntegral.HasIntegral.integral_eq
code: theorem HasIntegral.integral_eq (h : HasIntegral I l f vol y) : integral I l f vol = y 
goal: BoxIntegral.integral I l f vol = y

full_name: BoxIntegral.HasIntegral.add
code: nonrec theorem HasIntegral.add (h : HasIntegral I l f vol y) (h' : HasIntegral I l g vol y') :
    HasIntegral I l (f + g) vol (y + y') 
goal: BoxIntegral.HasIntegral I l (f + g) vol (y + y')

full_name: BoxIntegral.Integrable.add
code: theorem Integrable.add (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    Integrable I l (f + g) vol 
goal: BoxIntegral.Integrable I l (f + g) vol

full_name: BoxIntegral.integral_add
code: theorem integral_add (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    integral I l (f + g) vol = integral I l f vol + integral I l g vol 
goal: BoxIntegral.integral I l (f + g) vol = BoxIntegral.integral I l f vol + BoxIntegral.integral I l g vol

full_name: BoxIntegral.HasIntegral.neg
code: nonrec theorem HasIntegral.neg (hf : HasIntegral I l f vol y) : HasIntegral I l (-f) vol (-y) 
goal: BoxIntegral.HasIntegral I l (-f) vol (-y)

full_name: BoxIntegral.Integrable.neg
code: theorem Integrable.neg (hf : Integrable I l f vol) : Integrable I l (-f) vol 
goal: BoxIntegral.Integrable I l (-f) vol

full_name: BoxIntegral.Integrable.of_neg
code: theorem Integrable.of_neg (hf : Integrable I l (-f) vol) : Integrable I l f vol 
goal: BoxIntegral.Integrable I l f vol

full_name: BoxIntegral.integrable_neg
code: @[simp]
theorem integrable_neg : Integrable I l (-f) vol ↔ Integrable I l f vol 
goal: BoxIntegral.Integrable I l (-f) vol ↔ BoxIntegral.Integrable I l f vol

full_name: BoxIntegral.integral_neg
code: @[simp]
theorem integral_neg : integral I l (-f) vol = -integral I l f vol 
goal: BoxIntegral.integral I l (-f) vol = -BoxIntegral.integral I l f vol

full_name: BoxIntegral.HasIntegral.sub
code: theorem HasIntegral.sub (h : HasIntegral I l f vol y) (h' : HasIntegral I l g vol y') :
    HasIntegral I l (f - g) vol (y - y') 
goal: BoxIntegral.HasIntegral I l (f - g) vol (y - y')

full_name: BoxIntegral.Integrable.sub
code: theorem Integrable.sub (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    Integrable I l (f - g) vol 
goal: BoxIntegral.Integrable I l (f - g) vol

full_name: BoxIntegral.integral_sub
code: theorem integral_sub (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    integral I l (f - g) vol = integral I l f vol - integral I l g vol 
goal: BoxIntegral.integral I l (f - g) vol = BoxIntegral.integral I l f vol - BoxIntegral.integral I l g vol

full_name: BoxIntegral.hasIntegral_const
code: theorem hasIntegral_const (c : E) : HasIntegral I l (fun _ => c) vol (vol I c) 
goal: BoxIntegral.HasIntegral I l (fun x => c) vol ((vol I) c)

full_name: BoxIntegral.integral_const
code: @[simp]
theorem integral_const (c : E) : integral I l (fun _ => c) vol = vol I c 
goal: BoxIntegral.integral I l (fun x => c) vol = (vol I) c

full_name: BoxIntegral.integrable_const
code: theorem integrable_const (c : E) : Integrable I l (fun _ => c) vol 
goal: BoxIntegral.Integrable I l (fun x => c) vol

full_name: BoxIntegral.hasIntegral_zero
code: theorem hasIntegral_zero : HasIntegral I l (fun _ => (0 : E)) vol 0 
goal: BoxIntegral.HasIntegral I l (fun x => 0) vol 0

full_name: BoxIntegral.integrable_zero
code: theorem integrable_zero : Integrable I l (fun _ => (0 : E)) vol 
goal: BoxIntegral.Integrable I l (fun x => 0) vol

full_name: BoxIntegral.integral_zero
code: theorem integral_zero : integral I l (fun _ => (0 : E)) vol = 0 
goal: BoxIntegral.integral I l (fun x => 0) vol = 0

full_name: BoxIntegral.HasIntegral.sum
code: theorem HasIntegral.sum {α : Type*} {s : Finset α} {f : α → ℝⁿ → E} {g : α → F}
    (h : ∀ i ∈ s, HasIntegral I l (f i) vol (g i)) :
    HasIntegral I l (fun x => ∑ i ∈ s, f i x) vol (∑ i ∈ s, g i) 
goal: BoxIntegral.HasIntegral I l (fun x => ∑ i ∈ s, f i x) vol (∑ i ∈ s, g i)

full_name: BoxIntegral.HasIntegral.smul
code: theorem HasIntegral.smul (hf : HasIntegral I l f vol y) (c : ℝ) :
    HasIntegral I l (c • f) vol (c • y) 
goal: BoxIntegral.HasIntegral I l (c • f) vol (c • y)

full_name: BoxIntegral.Integrable.smul
code: theorem Integrable.smul (hf : Integrable I l f vol) (c : ℝ) : Integrable I l (c • f) vol 
goal: BoxIntegral.Integrable I l (c • f) vol

full_name: BoxIntegral.Integrable.of_smul
code: theorem Integrable.of_smul {c : ℝ} (hf : Integrable I l (c • f) vol) (hc : c ≠ 0) :
    Integrable I l f vol 
goal: BoxIntegral.Integrable I l f vol

full_name: BoxIntegral.integral_smul
code: @[simp]
theorem integral_smul (c : ℝ) : integral I l (fun x => c • f x) vol = c • integral I l f vol 
goal: BoxIntegral.integral I l (fun x => c • f x) vol = c • BoxIntegral.integral I l f vol

full_name: BoxIntegral.integral_nonneg
code: /-- The integral of a nonnegative function w.r.t. a volume generated by a locally-finite measure is
nonnegative. -/
theorem integral_nonneg {g : ℝⁿ → ℝ} (hg : ∀ x ∈ Box.Icc I, 0 ≤ g x) (μ : Measure ℝⁿ)
    [IsLocallyFiniteMeasure μ] : 0 ≤ integral I l g μ.toBoxAdditive.toSMul 
goal: 0 ≤ BoxIntegral.integral I l g μ.toBoxAdditive.toSMul

full_name: BoxIntegral.norm_integral_le_of_norm_le
code: /-- If `‖f x‖ ≤ g x` on `[l, u]` and `g` is integrable, then the norm of the integral of `f` is less
than or equal to the integral of `g`. -/
theorem norm_integral_le_of_norm_le {g : ℝⁿ → ℝ} (hle : ∀ x ∈ Box.Icc I, ‖f x‖ ≤ g x)
    (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] (hg : Integrable I l g μ.toBoxAdditive.toSMul) :
    ‖(integral I l f μ.toBoxAdditive.toSMul : E)‖ ≤ integral I l g μ.toBoxAdditive.toSMul 
goal: ‖BoxIntegral.integral I l f μ.toBoxAdditive.toSMul‖ ≤ BoxIntegral.integral I l g μ.toBoxAdditive.toSMul

full_name: BoxIntegral.norm_integral_le_of_le_const
code: theorem norm_integral_le_of_le_const {c : ℝ}
    (hc : ∀ x ∈ Box.Icc I, ‖f x‖ ≤ c) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] :
    ‖(integral I l f μ.toBoxAdditive.toSMul : E)‖ ≤ (μ I).toReal * c 
goal: ‖BoxIntegral.integral I l f μ.toBoxAdditive.toSMul‖ ≤ (μ ↑I).toReal * c

full_name: BoxIntegral.Integrable.convergenceR
code: /-- If `ε > 0`, then `BoxIntegral.Integrable.convergenceR` is a function `r : ℝ≥0 → ℝⁿ → (0, ∞)`
such that for every `c : ℝ≥0`, for every tagged partition `π` subordinate to `r` (and satisfying
additional distortion estimates if `BoxIntegral.IntegrationParams.bDistortion l = true`), the
corresponding integral sum is `ε`-close to the integral.

If `BoxIntegral.IntegrationParams.bRiemann = true`, then `r c x` does not depend on `x`. If
`ε ≤ 0`, then we use `r c x = 1`.  -/
def convergenceR (h : Integrable I l f vol) (ε : ℝ) : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ) 
goal: ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0)

full_name: BoxIntegral.Integrable.convergenceR_cond
code: theorem convergenceR_cond (h : Integrable I l f vol) (ε : ℝ) (c : ℝ≥0) :
    l.RCond (h.convergenceR ε c) 
goal: l.RCond (h.convergenceR ε c)

full_name: BoxIntegral.Integrable.dist_integralSum_integral_le_of_memBaseSet
code: theorem dist_integralSum_integral_le_of_memBaseSet (h : Integrable I l f vol) (h₀ : 0 < ε)
    (hπ : l.MemBaseSet I c (h.convergenceR ε c) π) (hπp : π.IsPartition) :
    dist (integralSum f vol π) (integral I l f vol) ≤ ε 
goal: dist (BoxIntegral.integralSum f vol π) (BoxIntegral.integral I l f vol) ≤ ε

full_name: BoxIntegral.Integrable.dist_integralSum_le_of_memBaseSet
code: /-- **Henstock-Sacks inequality**. Let `r₁ r₂ : ℝⁿ → (0, ∞)` be a function such that for any tagged
*partition* of `I` subordinate to `rₖ`, `k=1,2`, the integral sum of `f` over this partition differs
from the integral of `f` by at most `εₖ`. Then for any two tagged *prepartition* `π₁ π₂` subordinate
to `r₁` and `r₂` respectively and covering the same part of `I`, the integral sums of `f` over these
prepartitions differ from each other by at most `ε₁ + ε₂`.

The actual statement

- uses `BoxIntegral.Integrable.convergenceR` instead of a predicate assumption on `r`;
- uses `BoxIntegral.IntegrationParams.MemBaseSet` instead of “subordinate to `r`” to
  account for additional requirements like being a Henstock partition or having a bounded
  distortion.

See also `BoxIntegral.Integrable.dist_integralSum_sum_integral_le_of_memBaseSet_of_iUnion_eq` and
`BoxIntegral.Integrable.dist_integralSum_sum_integral_le_of_memBaseSet`.
-/
theorem dist_integralSum_le_of_memBaseSet (h : Integrable I l f vol) (hpos₁ : 0 < ε₁)
    (hpos₂ : 0 < ε₂) (h₁ : l.MemBaseSet I c₁ (h.convergenceR ε₁ c₁) π₁)
    (h₂ : l.MemBaseSet I c₂ (h.convergenceR ε₂ c₂) π₂) (HU : π₁.iUnion = π₂.iUnion) :
    dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂ 
goal: dist (BoxIntegral.integralSum f vol π₁) (BoxIntegral.integralSum f vol π₂) ≤ ε₁ + ε₂

full_name: BoxIntegral.Integrable.tendsto_integralSum_toFilter_prod_self_inf_iUnion_eq_uniformity
code: /-- If `f` is integrable on `I` along `l`, then for two sufficiently fine tagged prepartitions
(in the sense of the filter `BoxIntegral.IntegrationParams.toFilter l I`) such that they cover
the same part of `I`, the integral sums of `f` over `π₁` and `π₂` are very close to each other.  -/
theorem tendsto_integralSum_toFilter_prod_self_inf_iUnion_eq_uniformity (h : Integrable I l f vol) :
    Tendsto (fun π : TaggedPrepartition I × TaggedPrepartition I =>
      (integralSum f vol π.1, integralSum f vol π.2))
        ((l.toFilter I ×ˢ l.toFilter I) ⊓ 𝓟 {π | π.1.iUnion = π.2.iUnion}) (𝓤 F) 
goal: Filter.Tendsto (fun π => (BoxIntegral.integralSum f vol π.1, BoxIntegral.integralSum f vol π.2))
  (l.toFilter I ×ˢ l.toFilter I ⊓ 𝓟 {π | π.1.iUnion = π.2.iUnion}) (𝓤 F)

full_name: BoxIntegral.Integrable.cauchy_map_integralSum_toFilteriUnion
code: /-- If `f` is integrable on a box `I` along `l`, then for any fixed subset `s` of `I` that can be
represented as a finite union of boxes, the integral sums of `f` over tagged prepartitions that
cover exactly `s` form a Cauchy “sequence” along `l`. -/
theorem cauchy_map_integralSum_toFilteriUnion (h : Integrable I l f vol) (π₀ : Prepartition I) :
    Cauchy ((l.toFilteriUnion I π₀).map (integralSum f vol)) 
goal: Cauchy (Filter.map (BoxIntegral.integralSum f vol) (l.toFilteriUnion I π₀))

full_name: BoxIntegral.Integrable.to_subbox_aux
code: theorem to_subbox_aux (h : Integrable I l f vol) (hJ : J ≤ I) :
    ∃ y : F, HasIntegral J l f vol y ∧
      Tendsto (integralSum f vol) (l.toFilteriUnion I (Prepartition.single I J hJ)) (𝓝 y) 
goal: ∃ y,
  BoxIntegral.HasIntegral J l f vol y ∧
    Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I (BoxIntegral.Prepartition.single I J hJ)) (𝓝 y)

full_name: BoxIntegral.Integrable.to_subbox
code: /-- If `f` is integrable on a box `I`, then it is integrable on any subbox of `I`. -/
theorem to_subbox (h : Integrable I l f vol) (hJ : J ≤ I) : Integrable J l f vol 
goal: BoxIntegral.Integrable J l f vol

full_name: BoxIntegral.Integrable.tendsto_integralSum_toFilteriUnion_single
code: /-- If `f` is integrable on a box `I`, then integral sums of `f` over tagged prepartitions
that cover exactly a subbox `J ≤ I` tend to the integral of `f` over `J` along `l`. -/
theorem tendsto_integralSum_toFilteriUnion_single (h : Integrable I l f vol) (hJ : J ≤ I) :
    Tendsto (integralSum f vol) (l.toFilteriUnion I (Prepartition.single I J hJ))
      (𝓝 <| integral J l f vol) 
goal: Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I (BoxIntegral.Prepartition.single I J hJ))
  (𝓝 (BoxIntegral.integral J l f vol))

full_name: BoxIntegral.Integrable.dist_integralSum_sum_integral_le_of_memBaseSet_of_iUnion_eq
code: /-- **Henstock-Sacks inequality**. Let `r : ℝⁿ → (0, ∞)` be a function such that for any tagged
*partition* of `I` subordinate to `r`, the integral sum of `f` over this partition differs from the
integral of `f` by at most `ε`. Then for any tagged *prepartition* `π` subordinate to `r`, the
integral sum of `f` over this prepartition differs from the integral of `f` over the part of `I`
covered by `π` by at most `ε`.

The actual statement

- uses `BoxIntegral.Integrable.convergenceR` instead of a predicate assumption on `r`;
- uses `BoxIntegral.IntegrationParams.MemBaseSet` instead of “subordinate to `r`” to
  account for additional requirements like being a Henstock partition or having a bounded
  distortion;
- takes an extra argument `π₀ : prepartition I` and an assumption `π.Union = π₀.Union` instead of
  using `π.to_prepartition`.
-/
theorem dist_integralSum_sum_integral_le_of_memBaseSet_of_iUnion_eq (h : Integrable I l f vol)
    (h0 : 0 < ε) (hπ : l.MemBaseSet I c (h.convergenceR ε c) π) {π₀ : Prepartition I}
    (hU : π.iUnion = π₀.iUnion) :
    dist (integralSum f vol π) (∑ J ∈ π₀.boxes, integral J l f vol) ≤ ε 
goal: dist (BoxIntegral.integralSum f vol π) (∑ J ∈ π₀.boxes, BoxIntegral.integral J l f vol) ≤ ε

full_name: BoxIntegral.Integrable.dist_integralSum_sum_integral_le_of_memBaseSet
code: /-- **Henstock-Sacks inequality**. Let `r : ℝⁿ → (0, ∞)` be a function such that for any tagged
*partition* of `I` subordinate to `r`, the integral sum of `f` over this partition differs from the
integral of `f` by at most `ε`. Then for any tagged *prepartition* `π` subordinate to `r`, the
integral sum of `f` over this prepartition differs from the integral of `f` over the part of `I`
covered by `π` by at most `ε`.

The actual statement

- uses `BoxIntegral.Integrable.convergenceR` instead of a predicate assumption on `r`;
- uses `BoxIntegral.IntegrationParams.MemBaseSet` instead of “subordinate to `r`” to
  account for additional requirements like being a Henstock partition or having a bounded
  distortion;
-/
theorem dist_integralSum_sum_integral_le_of_memBaseSet (h : Integrable I l f vol) (h0 : 0 < ε)
    (hπ : l.MemBaseSet I c (h.convergenceR ε c) π) :
    dist (integralSum f vol π) (∑ J ∈ π.boxes, integral J l f vol) ≤ ε 
goal: dist (BoxIntegral.integralSum f vol π) (∑ J ∈ π.boxes, BoxIntegral.integral J l f vol) ≤ ε

full_name: BoxIntegral.Integrable.tendsto_integralSum_sum_integral
code: /-- Integral sum of `f` over a tagged prepartition `π` such that `π.Union = π₀.Union` tends to the
sum of integrals of `f` over the boxes of `π₀`. -/
theorem tendsto_integralSum_sum_integral (h : Integrable I l f vol) (π₀ : Prepartition I) :
    Tendsto (integralSum f vol) (l.toFilteriUnion I π₀)
      (𝓝 <| ∑ J ∈ π₀.boxes, integral J l f vol) 
goal: Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I π₀)
  (𝓝 (∑ J ∈ π₀.boxes, BoxIntegral.integral J l f vol))

full_name: BoxIntegral.Integrable.sum_integral_congr
code: /-- If `f` is integrable on `I`, then `fun J ↦ integral J l f vol` is box-additive on subboxes of
`I`: if `π₁`, `π₂` are two prepartitions of `I` covering the same part of `I`, the sum of integrals
of `f` over the boxes of `π₁` is equal to the sum of integrals of `f` over the boxes of `π₂`.

See also `BoxIntegral.Integrable.toBoxAdditive` for a bundled version. -/
theorem sum_integral_congr (h : Integrable I l f vol) {π₁ π₂ : Prepartition I}
    (hU : π₁.iUnion = π₂.iUnion) :
    ∑ J ∈ π₁.boxes, integral J l f vol = ∑ J ∈ π₂.boxes, integral J l f vol 
goal: ∑ J ∈ π₁.boxes, BoxIntegral.integral J l f vol = ∑ J ∈ π₂.boxes, BoxIntegral.integral J l f vol

full_name: BoxIntegral.Integrable.toBoxAdditive_apply
code: /-- If `f` is integrable on `I`, then `fun J ↦ integral J l f vol` is box-additive on subboxes of
`I`: if `π₁`, `π₂` are two prepartitions of `I` covering the same part of `I`, the sum of integrals
of `f` over the boxes of `π₁` is equal to the sum of integrals of `f` over the boxes of `π₂`.

See also `BoxIntegral.Integrable.sum_integral_congr` for an unbundled version. -/
@[simps]
def toBoxAdditive (h : Integrable I l f vol) : ι →ᵇᵃ[I] F 
goal: h.toBoxAdditive J = BoxIntegral.integral J l f vol

full_name: BoxIntegral.Integrable.toBoxAdditive
code: /-- If `f` is integrable on `I`, then `fun J ↦ integral J l f vol` is box-additive on subboxes of
`I`: if `π₁`, `π₂` are two prepartitions of `I` covering the same part of `I`, the sum of integrals
of `f` over the boxes of `π₁` is equal to the sum of integrals of `f` over the boxes of `π₂`.

See also `BoxIntegral.Integrable.sum_integral_congr` for an unbundled version. -/
@[simps]
def toBoxAdditive (h : Integrable I l f vol) : ι →ᵇᵃ[I] F 
goal: ι →ᵇᵃ[↑I] F

full_name: BoxIntegral.integrable_of_bounded_and_ae_continuousWithinAt
code: /-- A function that is bounded and a.e. continuous on a box `I` is integrable on `I`. -/
theorem integrable_of_bounded_and_ae_continuousWithinAt [CompleteSpace E] {I : Box ι} {f : ℝⁿ → E}
    (hb : ∃ C : ℝ, ∀ x ∈ Box.Icc I, ‖f x‖ ≤ C) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ]
    (hc : ∀ᵐ x ∂(μ.restrict (Box.Icc I)), ContinuousWithinAt f (Box.Icc I) x) :
    Integrable I l f μ.toBoxAdditive.toSMul 
goal: BoxIntegral.Integrable I l f μ.toBoxAdditive.toSMul

full_name: BoxIntegral.integrable_of_bounded_and_ae_continuous
code: /-- A function that is bounded on a box `I` and a.e. continuous is integrable on `I`.

This is a version of `integrable_of_bounded_and_ae_continuousWithinAt` with a stronger continuity
assumption so that the user does not need to specialize the continuity assumption to each box on
which the theorem is to be applied. -/
theorem integrable_of_bounded_and_ae_continuous [CompleteSpace E] {I : Box ι} {f : ℝⁿ → E}
    (hb : ∃ C : ℝ, ∀ x ∈ Box.Icc I, ‖f x‖ ≤ C) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ]
    (hc : ∀ᵐ x ∂μ, ContinuousAt f x) : Integrable I l f μ.toBoxAdditive.toSMul 
goal: BoxIntegral.Integrable I l f μ.toBoxAdditive.toSMul

full_name: BoxIntegral.integrable_of_continuousOn
code: /-- A continuous function is box-integrable with respect to any locally finite measure.

This is true for any volume with bounded variation. -/
theorem integrable_of_continuousOn [CompleteSpace E] {I : Box ι} {f : ℝⁿ → E}
    (hc : ContinuousOn f (Box.Icc I)) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] :
    Integrable.{u, v, v} I l f μ.toBoxAdditive.toSMul 
goal: BoxIntegral.Integrable I l f μ.toBoxAdditive.toSMul

full_name: BoxIntegral.HasIntegral.of_bRiemann_eq_false_of_forall_isLittleO
code: /-- This is an auxiliary lemma used to prove two statements at once. Use one of the next two
lemmas instead. -/
theorem HasIntegral.of_bRiemann_eq_false_of_forall_isLittleO (hl : l.bRiemann = false)
    (B : ι →ᵇᵃ[I] ℝ) (hB0 : ∀ J, 0 ≤ B J) (g : ι →ᵇᵃ[I] F) (s : Set ℝⁿ) (hs : s.Countable)
    (hlH : s.Nonempty → l.bHenstock = true)
    (H₁ : ∀ (c : ℝ≥0), ∀ x ∈ Box.Icc I ∩ s, ∀ ε > (0 : ℝ),
      ∃ δ > 0, ∀ J ≤ I, Box.Icc J ⊆ Metric.closedBall x δ → x ∈ Box.Icc J →
        (l.bDistortion → J.distortion ≤ c) → dist (vol J (f x)) (g J) ≤ ε)
    (H₂ : ∀ (c : ℝ≥0), ∀ x ∈ Box.Icc I \ s, ∀ ε > (0 : ℝ),
      ∃ δ > 0, ∀ J ≤ I, Box.Icc J ⊆ Metric.closedBall x δ → (l.bHenstock → x ∈ Box.Icc J) →
        (l.bDistortion → J.distortion ≤ c) → dist (vol J (f x)) (g J) ≤ ε * B J) :
    HasIntegral I l f vol (g I) 
goal: BoxIntegral.HasIntegral I l f vol (g I)

full_name: BoxIntegral.HasIntegral.of_le_Henstock_of_forall_isLittleO
code: /-- A function `f` has Henstock (or `⊥`) integral over `I` is equal to the value of a box-additive
function `g` on `I` provided that `vol J (f x)` is sufficiently close to `g J` for sufficiently
small boxes `J ∋ x`. This lemma is useful to prove, e.g., to prove the Divergence theorem for
integral along `⊥`.

Let `l` be either `BoxIntegral.IntegrationParams.Henstock` or `⊥`. Let `g` a box-additive function
on subboxes of `I`. Suppose that there exists a nonnegative box-additive function `B` and a
countable set `s` with the following property.

For every `c : ℝ≥0`, a point `x ∈ I.Icc`, and a positive `ε` there exists `δ > 0` such that for any
box `J ≤ I` such that

- `x ∈ J.Icc ⊆ Metric.closedBall x δ`;
- if `l.bDistortion` (i.e., `l = ⊥`), then the distortion of `J` is less than or equal to `c`,

the distance between the term `vol J (f x)` of an integral sum corresponding to `J` and `g J` is
less than or equal to `ε` if `x ∈ s` and is less than or equal to `ε * B J` otherwise.

Then `f` is integrable on `I` along `l` with integral `g I`. -/
theorem HasIntegral.of_le_Henstock_of_forall_isLittleO (hl : l ≤ Henstock) (B : ι →ᵇᵃ[I] ℝ)
    (hB0 : ∀ J, 0 ≤ B J) (g : ι →ᵇᵃ[I] F) (s : Set ℝⁿ) (hs : s.Countable)
    (H₁ : ∀ (c : ℝ≥0), ∀ x ∈ Box.Icc I ∩ s, ∀ ε > (0 : ℝ),
      ∃ δ > 0, ∀ J ≤ I, Box.Icc J ⊆ Metric.closedBall x δ → x ∈ Box.Icc J →
        (l.bDistortion → J.distortion ≤ c) → dist (vol J (f x)) (g J) ≤ ε)
    (H₂ : ∀ (c : ℝ≥0), ∀ x ∈ Box.Icc I \ s, ∀ ε > (0 : ℝ),
      ∃ δ > 0, ∀ J ≤ I, Box.Icc J ⊆ Metric.closedBall x δ → x ∈ Box.Icc J →
        (l.bDistortion → J.distortion ≤ c) → dist (vol J (f x)) (g J) ≤ ε * B J) :
    HasIntegral I l f vol (g I) 
goal: BoxIntegral.HasIntegral I l f vol (g I)

full_name: BoxIntegral.HasIntegral.mcShane_of_forall_isLittleO
code: /-- Suppose that there exists a nonnegative box-additive function `B` with the following property.

For every `c : ℝ≥0`, a point `x ∈ I.Icc`, and a positive `ε` there exists `δ > 0` such that for any
box `J ≤ I` such that

- `J.Icc ⊆ Metric.closedBall x δ`;
- if `l.bDistortion` (i.e., `l = ⊥`), then the distortion of `J` is less than or equal to `c`,

the distance between the term `vol J (f x)` of an integral sum corresponding to `J` and `g J` is
less than or equal to `ε * B J`.

Then `f` is McShane integrable on `I` with integral `g I`. -/
theorem HasIntegral.mcShane_of_forall_isLittleO (B : ι →ᵇᵃ[I] ℝ) (hB0 : ∀ J, 0 ≤ B J)
    (g : ι →ᵇᵃ[I] F) (H : ∀ (c : ℝ≥0), ∀ x ∈ Box.Icc I, ∀ ε > (0 : ℝ), ∃ δ > 0, ∀ J ≤ I,
      Box.Icc J ⊆ Metric.closedBall x δ → dist (vol J (f x)) (g J) ≤ ε * B J) :
    HasIntegral I McShane f vol (g I) 
goal: BoxIntegral.HasIntegral I BoxIntegral.IntegrationParams.McShane f vol (g I)