File: Mathlib/Analysis/BoxIntegral/Partition/Basic.lean

full_name: BoxIntegral.Prepartition.boxes
code: /-- A prepartition of `I : BoxIntegral.Box ι` is a finite set of pairwise disjoint subboxes of
`I`. -/
structure Prepartition (I : Box ι) where
  /-- The underlying set of boxes -/
  boxes : Finset (Box ι)
  /-- Each box is a sub-box of `I` -/
  le_of_mem' : ∀ J ∈ boxes, J ≤ I
  /-- The boxes in a prepartition are pairwise disjoint. -/
  pairwiseDisjoint : Set.Pairwise (↑boxes) (Disjoint on ((↑) : Box ι → Set (ι → ℝ)))
goal: Finset (BoxIntegral.Box ι)

full_name: BoxIntegral.Prepartition.pairwiseDisjoint
code: /-- A prepartition of `I : BoxIntegral.Box ι` is a finite set of pairwise disjoint subboxes of
`I`. -/
structure Prepartition (I : Box ι) where
  /-- The underlying set of boxes -/
  boxes : Finset (Box ι)
  /-- Each box is a sub-box of `I` -/
  le_of_mem' : ∀ J ∈ boxes, J ≤ I
  /-- The boxes in a prepartition are pairwise disjoint. -/
  pairwiseDisjoint : Set.Pairwise (↑boxes) (Disjoint on ((↑) : Box ι → Set (ι → ℝ)))
goal: (↑self.boxes).Pairwise (Disjoint on BoxIntegral.Box.toSet)

full_name: BoxIntegral.Prepartition
code: /-- A prepartition of `I : BoxIntegral.Box ι` is a finite set of pairwise disjoint subboxes of
`I`. -/
structure Prepartition (I : Box ι) where
  /-- The underlying set of boxes -/
  boxes : Finset (Box ι)
  /-- Each box is a sub-box of `I` -/
  le_of_mem' : ∀ J ∈ boxes, J ≤ I
  /-- The boxes in a prepartition are pairwise disjoint. -/
  pairwiseDisjoint : Set.Pairwise (↑boxes) (Disjoint on ((↑) : Box ι → Set (ι → ℝ)))
goal: Type u_1

full_name: BoxIntegral.Prepartition.le_of_mem'
code: /-- A prepartition of `I : BoxIntegral.Box ι` is a finite set of pairwise disjoint subboxes of
`I`. -/
structure Prepartition (I : Box ι) where
  /-- The underlying set of boxes -/
  boxes : Finset (Box ι)
  /-- Each box is a sub-box of `I` -/
  le_of_mem' : ∀ J ∈ boxes, J ≤ I
  /-- The boxes in a prepartition are pairwise disjoint. -/
  pairwiseDisjoint : Set.Pairwise (↑boxes) (Disjoint on ((↑) : Box ι → Set (ι → ℝ)))
goal: J ∈ self.boxes → J ≤ I

full_name: BoxIntegral.Prepartition.instMembershipBox
code: instance : Membership (Box ι) (Prepartition I) 
goal: Membership (BoxIntegral.Box ι) (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.mem_boxes
code: @[simp]
theorem mem_boxes : J ∈ π.boxes ↔ J ∈ π 
goal: J ∈ π.boxes ↔ J ∈ π

full_name: BoxIntegral.Prepartition.mem_mk
code: @[simp]
theorem mem_mk {s h₁ h₂} : J ∈ (mk s h₁ h₂ : Prepartition I) ↔ J ∈ s 
goal: J ∈ { boxes := s, le_of_mem' := h₁, pairwiseDisjoint := h₂ } ↔ J ∈ s

full_name: BoxIntegral.Prepartition.disjoint_coe_of_mem
code: theorem disjoint_coe_of_mem (h₁ : J₁ ∈ π) (h₂ : J₂ ∈ π) (h : J₁ ≠ J₂) :
    Disjoint (J₁ : Set (ι → ℝ)) J₂ 
goal: Disjoint ↑J₁ ↑J₂

full_name: BoxIntegral.Prepartition.eq_of_mem_of_mem
code: theorem eq_of_mem_of_mem (h₁ : J₁ ∈ π) (h₂ : J₂ ∈ π) (hx₁ : x ∈ J₁) (hx₂ : x ∈ J₂) : J₁ = J₂ 
goal: J₁ = J₂

full_name: BoxIntegral.Prepartition.eq_of_le_of_le
code: theorem eq_of_le_of_le (h₁ : J₁ ∈ π) (h₂ : J₂ ∈ π) (hle₁ : J ≤ J₁) (hle₂ : J ≤ J₂) : J₁ = J₂ 
goal: J₁ = J₂

full_name: BoxIntegral.Prepartition.eq_of_le
code: theorem eq_of_le (h₁ : J₁ ∈ π) (h₂ : J₂ ∈ π) (hle : J₁ ≤ J₂) : J₁ = J₂ 
goal: J₁ = J₂

full_name: BoxIntegral.Prepartition.le_of_mem
code: theorem le_of_mem (hJ : J ∈ π) : J ≤ I 
goal: J ≤ I

full_name: BoxIntegral.Prepartition.lower_le_lower
code: theorem lower_le_lower (hJ : J ∈ π) : I.lower ≤ J.lower 
goal: I.lower ≤ J.lower

full_name: BoxIntegral.Prepartition.upper_le_upper
code: theorem upper_le_upper (hJ : J ∈ π) : J.upper ≤ I.upper 
goal: J.upper ≤ I.upper

full_name: BoxIntegral.Prepartition.injective_boxes
code: theorem injective_boxes : Function.Injective (boxes : Prepartition I → Finset (Box ι)) 
goal: Function.Injective BoxIntegral.Prepartition.boxes

full_name: BoxIntegral.Prepartition.ext
code: @[ext]
theorem ext (h : ∀ J, J ∈ π₁ ↔ J ∈ π₂) : π₁ = π₂ 
goal: π₁ = π₂

full_name: BoxIntegral.Prepartition.single_boxes
code: /-- The singleton prepartition `{J}`, `J ≤ I`. -/
@[simps]
def single (I J : Box ι) (h : J ≤ I) : Prepartition I 
goal: (BoxIntegral.Prepartition.single I J h).boxes = {J}

full_name: BoxIntegral.Prepartition.single
code: /-- The singleton prepartition `{J}`, `J ≤ I`. -/
@[simps]
def single (I J : Box ι) (h : J ≤ I) : Prepartition I 
goal: BoxIntegral.Prepartition I

full_name: BoxIntegral.Prepartition.mem_single
code: @[simp]
theorem mem_single {J'} (h : J ≤ I) : J' ∈ single I J h ↔ J' = J 
goal: J' ∈ BoxIntegral.Prepartition.single I J h ↔ J' = J

full_name: BoxIntegral.Prepartition.instLE
code: /-- We say that `π ≤ π'` if each box of `π` is a subbox of some box of `π'`. -/
instance : LE (Prepartition I) 
goal: LE (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.partialOrder
code: instance partialOrder : PartialOrder (Prepartition I) 
goal: PartialOrder (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.instOrderTop
code: instance : OrderTop (Prepartition I) 
goal: OrderTop (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.instOrderBot
code: instance : OrderBot (Prepartition I) 
goal: OrderBot (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.instInhabited
code: instance : Inhabited (Prepartition I) 
goal: Inhabited (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.le_def
code: theorem le_def : π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∃ J' ∈ π₂, J ≤ J' 
goal: π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∃ J' ∈ π₂, J ≤ J'

full_name: BoxIntegral.Prepartition.mem_top
code: @[simp]
theorem mem_top : J ∈ (⊤ : Prepartition I) ↔ J = I 
goal: J ∈ ⊤ ↔ J = I

full_name: BoxIntegral.Prepartition.top_boxes
code: @[simp]
theorem top_boxes : (⊤ : Prepartition I).boxes = {I} 
goal: ⊤.boxes = {I}

full_name: BoxIntegral.Prepartition.not_mem_bot
code: @[simp]
theorem not_mem_bot : J ∉ (⊥ : Prepartition I) 
goal: J ∉ ⊥

full_name: BoxIntegral.Prepartition.bot_boxes
code: @[simp]
theorem bot_boxes : (⊥ : Prepartition I).boxes = ∅ 
goal: ⊥.boxes = ∅

full_name: BoxIntegral.Prepartition.injOn_setOf_mem_Icc_setOf_lower_eq
code: /-- An auxiliary lemma used to prove that the same point can't belong to more than
`2 ^ Fintype.card ι` closed boxes of a prepartition. -/
theorem injOn_setOf_mem_Icc_setOf_lower_eq (x : ι → ℝ) :
    InjOn (fun J : Box ι => { i | J.lower i = x i }) { J | J ∈ π ∧ x ∈ Box.Icc J } 
goal: Set.InjOn (fun J => {i | J.lower i = x i}) {J | J ∈ π ∧ x ∈ BoxIntegral.Box.Icc J}

full_name: BoxIntegral.Prepartition.card_filter_mem_Icc_le
code: /-- The set of boxes of a prepartition that contain `x` in their closures has cardinality
at most `2 ^ Fintype.card ι`. -/
theorem card_filter_mem_Icc_le [Fintype ι] (x : ι → ℝ) :
    (π.boxes.filter fun J : Box ι => x ∈ Box.Icc J).card ≤ 2 ^ Fintype.card ι 
goal: (Finset.filter (fun J => x ∈ BoxIntegral.Box.Icc J) π.boxes).card ≤ 2 ^ Fintype.card ι

full_name: BoxIntegral.Prepartition.iUnion
code: /-- Given a prepartition `π : BoxIntegral.Prepartition I`, `π.iUnion` is the part of `I` covered by
the boxes of `π`. -/
protected def iUnion : Set (ι → ℝ) 
goal: Set (ι → ℝ)

full_name: BoxIntegral.Prepartition.iUnion_def
code: theorem iUnion_def : π.iUnion = ⋃ J ∈ π, ↑J 
goal: π.iUnion = ⋃ J ∈ π, ↑J

full_name: BoxIntegral.Prepartition.iUnion_def'
code: theorem iUnion_def' : π.iUnion = ⋃ J ∈ π.boxes, ↑J 
goal: π.iUnion = ⋃ J ∈ π.boxes, ↑J

full_name: BoxIntegral.Prepartition.mem_iUnion
code: @[simp]
theorem mem_iUnion : x ∈ π.iUnion ↔ ∃ J ∈ π, x ∈ J 
goal: x ∈ π.iUnion ↔ ∃ J ∈ π, x ∈ J

full_name: BoxIntegral.Prepartition.iUnion_single
code: @[simp]
theorem iUnion_single (h : J ≤ I) : (single I J h).iUnion = J 
goal: (BoxIntegral.Prepartition.single I J h).iUnion = ↑J

full_name: BoxIntegral.Prepartition.iUnion_top
code: @[simp]
theorem iUnion_top : (⊤ : Prepartition I).iUnion = I 
goal: ⊤.iUnion = ↑I

full_name: BoxIntegral.Prepartition.iUnion_eq_empty
code: @[simp]
theorem iUnion_eq_empty : π₁.iUnion = ∅ ↔ π₁ = ⊥ 
goal: π₁.iUnion = ∅ ↔ π₁ = ⊥

full_name: BoxIntegral.Prepartition.iUnion_bot
code: @[simp]
theorem iUnion_bot : (⊥ : Prepartition I).iUnion = ∅ 
goal: ⊥.iUnion = ∅

full_name: BoxIntegral.Prepartition.subset_iUnion
code: theorem subset_iUnion (h : J ∈ π) : ↑J ⊆ π.iUnion 
goal: ↑J ⊆ π.iUnion

full_name: BoxIntegral.Prepartition.iUnion_subset
code: theorem iUnion_subset : π.iUnion ⊆ I 
goal: π.iUnion ⊆ ↑I

full_name: BoxIntegral.Prepartition.iUnion_mono
code: @[mono]
theorem iUnion_mono (h : π₁ ≤ π₂) : π₁.iUnion ⊆ π₂.iUnion 
goal: π₁.iUnion ⊆ π₂.iUnion

full_name: BoxIntegral.Prepartition.disjoint_boxes_of_disjoint_iUnion
code: theorem disjoint_boxes_of_disjoint_iUnion (h : Disjoint π₁.iUnion π₂.iUnion) :
    Disjoint π₁.boxes π₂.boxes 
goal: Disjoint π₁.boxes π₂.boxes

full_name: BoxIntegral.Prepartition.le_iff_nonempty_imp_le_and_iUnion_subset
code: theorem le_iff_nonempty_imp_le_and_iUnion_subset :
    π₁ ≤ π₂ ↔
      (∀ J ∈ π₁, ∀ J' ∈ π₂, (J ∩ J' : Set (ι → ℝ)).Nonempty → J ≤ J') ∧ π₁.iUnion ⊆ π₂.iUnion 
goal: π₁ ≤ π₂ ↔ (∀ J ∈ π₁, ∀ J' ∈ π₂, (↑J ∩ ↑J').Nonempty → J ≤ J') ∧ π₁.iUnion ⊆ π₂.iUnion

full_name: BoxIntegral.Prepartition.eq_of_boxes_subset_iUnion_superset
code: theorem eq_of_boxes_subset_iUnion_superset (h₁ : π₁.boxes ⊆ π₂.boxes) (h₂ : π₂.iUnion ⊆ π₁.iUnion) :
    π₁ = π₂ 
goal: π₁ = π₂

full_name: BoxIntegral.Prepartition.biUnion
code: /-- Given a prepartition `π` of a box `I` and a collection of prepartitions `πi J` of all boxes
`J ∈ π`, returns the prepartition of `I` into the union of the boxes of all `πi J`.

Though we only use the values of `πi` on the boxes of `π`, we require `πi` to be a globally defined
function. -/
@[simps]
def biUnion (πi : ∀ J : Box ι, Prepartition J) : Prepartition I 
goal: BoxIntegral.Prepartition I

full_name: BoxIntegral.Prepartition.biUnion_boxes
code: /-- Given a prepartition `π` of a box `I` and a collection of prepartitions `πi J` of all boxes
`J ∈ π`, returns the prepartition of `I` into the union of the boxes of all `πi J`.

Though we only use the values of `πi` on the boxes of `π`, we require `πi` to be a globally defined
function. -/
@[simps]
def biUnion (πi : ∀ J : Box ι, Prepartition J) : Prepartition I 
goal: (π.biUnion πi).boxes = π.boxes.biUnion fun J => (πi J).boxes

full_name: BoxIntegral.Prepartition.mem_biUnion
code: @[simp]
theorem mem_biUnion : J ∈ π.biUnion πi ↔ ∃ J' ∈ π, J ∈ πi J' 
goal: J ∈ π.biUnion πi ↔ ∃ J' ∈ π, J ∈ πi J'

full_name: BoxIntegral.Prepartition.biUnion_le
code: theorem biUnion_le (πi : ∀ J, Prepartition J) : π.biUnion πi ≤ π 
goal: π.biUnion πi ≤ π

full_name: BoxIntegral.Prepartition.biUnion_top
code: @[simp]
theorem biUnion_top : (π.biUnion fun _ => ⊤) = π 
goal: (π.biUnion fun x => ⊤) = π

full_name: BoxIntegral.Prepartition.biUnion_congr
code: @[congr]
theorem biUnion_congr (h : π₁ = π₂) (hi : ∀ J ∈ π₁, πi₁ J = πi₂ J) :
    π₁.biUnion πi₁ = π₂.biUnion πi₂ 
goal: π₁.biUnion πi₁ = π₂.biUnion πi₂

full_name: BoxIntegral.Prepartition.biUnion_congr_of_le
code: theorem biUnion_congr_of_le (h : π₁ = π₂) (hi : ∀ J ≤ I, πi₁ J = πi₂ J) :
    π₁.biUnion πi₁ = π₂.biUnion πi₂ 
goal: π₁.biUnion πi₁ = π₂.biUnion πi₂

full_name: BoxIntegral.Prepartition.iUnion_biUnion
code: @[simp]
theorem iUnion_biUnion (πi : ∀ J : Box ι, Prepartition J) :
    (π.biUnion πi).iUnion = ⋃ J ∈ π, (πi J).iUnion 
goal: (π.biUnion πi).iUnion = ⋃ J ∈ π, (πi J).iUnion

full_name: BoxIntegral.Prepartition.sum_biUnion_boxes
code: @[simp]
theorem sum_biUnion_boxes {M : Type*} [AddCommMonoid M] (π : Prepartition I)
    (πi : ∀ J, Prepartition J) (f : Box ι → M) :
    (∑ J ∈ π.boxes.biUnion fun J => (πi J).boxes, f J) =
      ∑ J ∈ π.boxes, ∑ J' ∈ (πi J).boxes, f J' 
goal: ∑ J ∈ π.boxes.biUnion fun J => (πi J).boxes, f J = ∑ J ∈ π.boxes, ∑ J' ∈ (πi J).boxes, f J'

full_name: BoxIntegral.Prepartition.biUnionIndex
code: /-- Given a box `J ∈ π.biUnion πi`, returns the box `J' ∈ π` such that `J ∈ πi J'`.
For `J ∉ π.biUnion πi`, returns `I`. -/
def biUnionIndex (πi : ∀ (J : Box ι), Prepartition J) (J : Box ι) : Box ι 
goal: BoxIntegral.Box ι

full_name: BoxIntegral.Prepartition.biUnionIndex_mem
code: theorem biUnionIndex_mem (hJ : J ∈ π.biUnion πi) : π.biUnionIndex πi J ∈ π 
goal: π.biUnionIndex πi J ∈ π

full_name: BoxIntegral.Prepartition.biUnionIndex_le
code: theorem biUnionIndex_le (πi : ∀ J, Prepartition J) (J : Box ι) : π.biUnionIndex πi J ≤ I 
goal: π.biUnionIndex πi J ≤ I

full_name: BoxIntegral.Prepartition.mem_biUnionIndex
code: theorem mem_biUnionIndex (hJ : J ∈ π.biUnion πi) : J ∈ πi (π.biUnionIndex πi J) 
goal: J ∈ πi (π.biUnionIndex πi J)

full_name: BoxIntegral.Prepartition.le_biUnionIndex
code: theorem le_biUnionIndex (hJ : J ∈ π.biUnion πi) : J ≤ π.biUnionIndex πi J 
goal: J ≤ π.biUnionIndex πi J

full_name: BoxIntegral.Prepartition.biUnionIndex_of_mem
code: /-- Uniqueness property of `BoxIntegral.Prepartition.biUnionIndex`. -/
theorem biUnionIndex_of_mem (hJ : J ∈ π) {J'} (hJ' : J' ∈ πi J) : π.biUnionIndex πi J' = J 
goal: π.biUnionIndex πi J' = J

full_name: BoxIntegral.Prepartition.biUnion_assoc
code: theorem biUnion_assoc (πi : ∀ J, Prepartition J) (πi' : Box ι → ∀ J : Box ι, Prepartition J) :
    (π.biUnion fun J => (πi J).biUnion (πi' J)) =
      (π.biUnion πi).biUnion fun J => πi' (π.biUnionIndex πi J) J 
goal: (π.biUnion fun J => (πi J).biUnion (πi' J)) = (π.biUnion πi).biUnion fun J => πi' (π.biUnionIndex πi J) J

full_name: BoxIntegral.Prepartition.ofWithBot
code: /-- Create a `BoxIntegral.Prepartition` from a collection of possibly empty boxes by filtering out
the empty one if it exists. -/
def ofWithBot (boxes : Finset (WithBot (Box ι)))
    (le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I)
    (pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint) :
    Prepartition I 
goal: BoxIntegral.Prepartition I

full_name: BoxIntegral.Prepartition.mem_ofWithBot
code: @[simp]
theorem mem_ofWithBot {boxes : Finset (WithBot (Box ι))} {h₁ h₂} :
    J ∈ (ofWithBot boxes h₁ h₂ : Prepartition I) ↔ (J : WithBot (Box ι)) ∈ boxes 
goal: J ∈ BoxIntegral.Prepartition.ofWithBot boxes h₁ h₂ ↔ ↑J ∈ boxes

full_name: BoxIntegral.Prepartition.iUnion_ofWithBot
code: @[simp]
theorem iUnion_ofWithBot (boxes : Finset (WithBot (Box ι)))
    (le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I)
    (pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint) :
    (ofWithBot boxes le_of_mem pairwise_disjoint).iUnion = ⋃ J ∈ boxes, ↑J 
goal: (BoxIntegral.Prepartition.ofWithBot boxes le_of_mem pairwise_disjoint).iUnion = ⋃ J ∈ boxes, ↑J

full_name: BoxIntegral.Prepartition.ofWithBot_le
code: theorem ofWithBot_le {boxes : Finset (WithBot (Box ι))}
    {le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I}
    {pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint}
    (H : ∀ J ∈ boxes, J ≠ ⊥ → ∃ J' ∈ π, J ≤ ↑J') :
    ofWithBot boxes le_of_mem pairwise_disjoint ≤ π 
goal: BoxIntegral.Prepartition.ofWithBot boxes le_of_mem pairwise_disjoint ≤ π

full_name: BoxIntegral.Prepartition.le_ofWithBot
code: theorem le_ofWithBot {boxes : Finset (WithBot (Box ι))}
    {le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I}
    {pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint}
    (H : ∀ J ∈ π, ∃ J' ∈ boxes, ↑J ≤ J') : π ≤ ofWithBot boxes le_of_mem pairwise_disjoint 
goal: π ≤ BoxIntegral.Prepartition.ofWithBot boxes le_of_mem pairwise_disjoint

full_name: BoxIntegral.Prepartition.ofWithBot_mono
code: theorem ofWithBot_mono {boxes₁ : Finset (WithBot (Box ι))}
    {le_of_mem₁ : ∀ J ∈ boxes₁, (J : WithBot (Box ι)) ≤ I}
    {pairwise_disjoint₁ : Set.Pairwise (boxes₁ : Set (WithBot (Box ι))) Disjoint}
    {boxes₂ : Finset (WithBot (Box ι))} {le_of_mem₂ : ∀ J ∈ boxes₂, (J : WithBot (Box ι)) ≤ I}
    {pairwise_disjoint₂ : Set.Pairwise (boxes₂ : Set (WithBot (Box ι))) Disjoint}
    (H : ∀ J ∈ boxes₁, J ≠ ⊥ → ∃ J' ∈ boxes₂, J ≤ J') :
    ofWithBot boxes₁ le_of_mem₁ pairwise_disjoint₁ ≤
      ofWithBot boxes₂ le_of_mem₂ pairwise_disjoint₂ 
goal: BoxIntegral.Prepartition.ofWithBot boxes₁ le_of_mem₁ pairwise_disjoint₁ ≤
  BoxIntegral.Prepartition.ofWithBot boxes₂ le_of_mem₂ pairwise_disjoint₂

full_name: BoxIntegral.Prepartition.sum_ofWithBot
code: theorem sum_ofWithBot {M : Type*} [AddCommMonoid M] (boxes : Finset (WithBot (Box ι)))
    (le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I)
    (pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint) (f : Box ι → M) :
    (∑ J ∈ (ofWithBot boxes le_of_mem pairwise_disjoint).boxes, f J) =
      ∑ J ∈ boxes, Option.elim' 0 f J 
goal: ∑ J ∈ (BoxIntegral.Prepartition.ofWithBot boxes le_of_mem pairwise_disjoint).boxes, f J =
  ∑ J ∈ boxes, Option.elim' 0 f J

full_name: BoxIntegral.Prepartition.restrict
code: /-- Restrict a prepartition to a box. -/
def restrict (π : Prepartition I) (J : Box ι) : Prepartition J 
goal: BoxIntegral.Prepartition J

full_name: BoxIntegral.Prepartition.mem_restrict
code: @[simp]
theorem mem_restrict : J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, (J₁ : WithBot (Box ι)) = ↑J ⊓ ↑J' 
goal: J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, ↑J₁ = ↑J ⊓ ↑J'

full_name: BoxIntegral.Prepartition.mem_restrict'
code: theorem mem_restrict' : J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, (J₁ : Set (ι → ℝ)) = ↑J ∩ ↑J' 
goal: J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, ↑J₁ = ↑J ∩ ↑J'

full_name: BoxIntegral.Prepartition.restrict_mono
code: @[mono]
theorem restrict_mono {π₁ π₂ : Prepartition I} (Hle : π₁ ≤ π₂) : π₁.restrict J ≤ π₂.restrict J 
goal: π₁.restrict J ≤ π₂.restrict J

full_name: BoxIntegral.Prepartition.monotone_restrict
code: theorem monotone_restrict : Monotone fun π : Prepartition I => restrict π J 
goal: Monotone fun π => π.restrict J

full_name: BoxIntegral.Prepartition.restrict_boxes_of_le
code: /-- Restricting to a larger box does not change the set of boxes. We cannot claim equality
of prepartitions because they have different types. -/
theorem restrict_boxes_of_le (π : Prepartition I) (h : I ≤ J) : (π.restrict J).boxes = π.boxes 
goal: (π.restrict J).boxes = π.boxes

full_name: BoxIntegral.Prepartition.restrict_self
code: @[simp]
theorem restrict_self : π.restrict I = π 
goal: π.restrict I = π

full_name: BoxIntegral.Prepartition.iUnion_restrict
code: @[simp]
theorem iUnion_restrict : (π.restrict J).iUnion = (J : Set (ι → ℝ)) ∩ (π.iUnion) 
goal: (π.restrict J).iUnion = ↑J ∩ π.iUnion

full_name: BoxIntegral.Prepartition.restrict_biUnion
code: @[simp]
theorem restrict_biUnion (πi : ∀ J, Prepartition J) (hJ : J ∈ π) :
    (π.biUnion πi).restrict J = πi J 
goal: (π.biUnion πi).restrict J = πi J

full_name: BoxIntegral.Prepartition.biUnion_le_iff
code: theorem biUnion_le_iff {πi : ∀ J, Prepartition J} {π' : Prepartition I} :
    π.biUnion πi ≤ π' ↔ ∀ J ∈ π, πi J ≤ π'.restrict J 
goal: π.biUnion πi ≤ π' ↔ ∀ J ∈ π, πi J ≤ π'.restrict J

full_name: BoxIntegral.Prepartition.le_biUnion_iff
code: theorem le_biUnion_iff {πi : ∀ J, Prepartition J} {π' : Prepartition I} :
    π' ≤ π.biUnion πi ↔ π' ≤ π ∧ ∀ J ∈ π, π'.restrict J ≤ πi J 
goal: π' ≤ π.biUnion πi ↔ π' ≤ π ∧ ∀ J ∈ π, π'.restrict J ≤ πi J

full_name: BoxIntegral.Prepartition.inf
code: instance inf : Inf (Prepartition I) 
goal: Inf (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.inf_def
code: theorem inf_def (π₁ π₂ : Prepartition I) : π₁ ⊓ π₂ = π₁.biUnion fun J => π₂.restrict J 
goal: π₁ ⊓ π₂ = π₁.biUnion fun J => π₂.restrict J

full_name: BoxIntegral.Prepartition.mem_inf
code: @[simp]
theorem mem_inf {π₁ π₂ : Prepartition I} :
    J ∈ π₁ ⊓ π₂ ↔ ∃ J₁ ∈ π₁, ∃ J₂ ∈ π₂, (J : WithBot (Box ι)) = ↑J₁ ⊓ ↑J₂ 
goal: J ∈ π₁ ⊓ π₂ ↔ ∃ J₁ ∈ π₁, ∃ J₂ ∈ π₂, ↑J = ↑J₁ ⊓ ↑J₂

full_name: BoxIntegral.Prepartition.iUnion_inf
code: @[simp]
theorem iUnion_inf (π₁ π₂ : Prepartition I) : (π₁ ⊓ π₂).iUnion = π₁.iUnion ∩ π₂.iUnion 
goal: (π₁ ⊓ π₂).iUnion = π₁.iUnion ∩ π₂.iUnion

full_name: BoxIntegral.Prepartition.instSemilatticeInf
code: instance : SemilatticeInf (Prepartition I) 
goal: SemilatticeInf (BoxIntegral.Prepartition I)

full_name: BoxIntegral.Prepartition.filter_boxes
code: /-- The prepartition with boxes `{J ∈ π | p J}`. -/
@[simps]
def filter (π : Prepartition I) (p : Box ι → Prop) : Prepartition I 
goal: (π.filter p).boxes = Finset.filter p π.boxes

full_name: BoxIntegral.Prepartition.filter
code: /-- The prepartition with boxes `{J ∈ π | p J}`. -/
@[simps]
def filter (π : Prepartition I) (p : Box ι → Prop) : Prepartition I 
goal: BoxIntegral.Prepartition I

full_name: BoxIntegral.Prepartition.mem_filter
code: @[simp]
theorem mem_filter {p : Box ι → Prop} : J ∈ π.filter p ↔ J ∈ π ∧ p J 
goal: J ∈ π.filter p ↔ J ∈ π ∧ p J

full_name: BoxIntegral.Prepartition.filter_le
code: theorem filter_le (π : Prepartition I) (p : Box ι → Prop) : π.filter p ≤ π 
goal: π.filter p ≤ π

full_name: BoxIntegral.Prepartition.filter_of_true
code: theorem filter_of_true {p : Box ι → Prop} (hp : ∀ J ∈ π, p J) : π.filter p = π 
goal: π.filter p = π

full_name: BoxIntegral.Prepartition.filter_true
code: @[simp]
theorem filter_true : (π.filter fun _ => True) = π 
goal: (π.filter fun x => True) = π

full_name: BoxIntegral.Prepartition.iUnion_filter_not
code: @[simp]
theorem iUnion_filter_not (π : Prepartition I) (p : Box ι → Prop) :
    (π.filter fun J => ¬p J).iUnion = π.iUnion \ (π.filter p).iUnion 
goal: (π.filter fun J => ¬p J).iUnion = π.iUnion \ (π.filter p).iUnion

full_name: BoxIntegral.Prepartition.sum_fiberwise
code: theorem sum_fiberwise {α M} [AddCommMonoid M] (π : Prepartition I) (f : Box ι → α) (g : Box ι → M) :
    (∑ y ∈ π.boxes.image f, ∑ J ∈ (π.filter fun J => f J = y).boxes, g J) =
      ∑ J ∈ π.boxes, g J 
goal: ∑ y ∈ Finset.image f π.boxes, ∑ J ∈ (π.filter fun J => f J = y).boxes, g J = ∑ J ∈ π.boxes, g J

full_name: BoxIntegral.Prepartition.disjUnion
code: /-- Union of two disjoint prepartitions. -/
@[simps]
def disjUnion (π₁ π₂ : Prepartition I) (h : Disjoint π₁.iUnion π₂.iUnion) : Prepartition I 
goal: BoxIntegral.Prepartition I

full_name: BoxIntegral.Prepartition.disjUnion_boxes
code: /-- Union of two disjoint prepartitions. -/
@[simps]
def disjUnion (π₁ π₂ : Prepartition I) (h : Disjoint π₁.iUnion π₂.iUnion) : Prepartition I 
goal: (π₁.disjUnion π₂ h).boxes = π₁.boxes ∪ π₂.boxes

full_name: BoxIntegral.Prepartition.mem_disjUnion
code: @[simp]
theorem mem_disjUnion (H : Disjoint π₁.iUnion π₂.iUnion) :
    J ∈ π₁.disjUnion π₂ H ↔ J ∈ π₁ ∨ J ∈ π₂ 
goal: J ∈ π₁.disjUnion π₂ H ↔ J ∈ π₁ ∨ J ∈ π₂

full_name: BoxIntegral.Prepartition.iUnion_disjUnion
code: @[simp]
theorem iUnion_disjUnion (h : Disjoint π₁.iUnion π₂.iUnion) :
    (π₁.disjUnion π₂ h).iUnion = π₁.iUnion ∪ π₂.iUnion 
goal: (π₁.disjUnion π₂ h).iUnion = π₁.iUnion ∪ π₂.iUnion

full_name: BoxIntegral.Prepartition.sum_disj_union_boxes
code: @[simp]
theorem sum_disj_union_boxes {M : Type*} [AddCommMonoid M] (h : Disjoint π₁.iUnion π₂.iUnion)
    (f : Box ι → M) :
    ∑ J ∈ π₁.boxes ∪ π₂.boxes, f J = (∑ J ∈ π₁.boxes, f J) + ∑ J ∈ π₂.boxes, f J 
goal: ∑ J ∈ π₁.boxes ∪ π₂.boxes, f J = ∑ J ∈ π₁.boxes, f J + ∑ J ∈ π₂.boxes, f J

full_name: BoxIntegral.Prepartition.distortion
code: /-- The distortion of a prepartition is the maximum of the distortions of the boxes of this
prepartition. -/
def distortion : ℝ≥0 
goal: ℝ≥0

full_name: BoxIntegral.Prepartition.distortion_le_of_mem
code: theorem distortion_le_of_mem (h : J ∈ π) : J.distortion ≤ π.distortion 
goal: J.distortion ≤ π.distortion

full_name: BoxIntegral.Prepartition.distortion_le_iff
code: theorem distortion_le_iff {c : ℝ≥0} : π.distortion ≤ c ↔ ∀ J ∈ π, Box.distortion J ≤ c 
goal: π.distortion ≤ c ↔ ∀ J ∈ π, J.distortion ≤ c

full_name: BoxIntegral.Prepartition.distortion_biUnion
code: theorem distortion_biUnion (π : Prepartition I) (πi : ∀ J, Prepartition J) :
    (π.biUnion πi).distortion = π.boxes.sup fun J => (πi J).distortion 
goal: (π.biUnion πi).distortion = π.boxes.sup fun J => (πi J).distortion

full_name: BoxIntegral.Prepartition.distortion_disjUnion
code: @[simp]
theorem distortion_disjUnion (h : Disjoint π₁.iUnion π₂.iUnion) :
    (π₁.disjUnion π₂ h).distortion = max π₁.distortion π₂.distortion 
goal: (π₁.disjUnion π₂ h).distortion = max π₁.distortion π₂.distortion

full_name: BoxIntegral.Prepartition.distortion_of_const
code: theorem distortion_of_const {c} (h₁ : π.boxes.Nonempty) (h₂ : ∀ J ∈ π, Box.distortion J = c) :
    π.distortion = c 
goal: π.distortion = c

full_name: BoxIntegral.Prepartition.distortion_top
code: @[simp]
theorem distortion_top (I : Box ι) : distortion (⊤ : Prepartition I) = I.distortion 
goal: ⊤.distortion = I.distortion

full_name: BoxIntegral.Prepartition.distortion_bot
code: @[simp]
theorem distortion_bot (I : Box ι) : distortion (⊥ : Prepartition I) = 0 
goal: ⊥.distortion = 0

full_name: BoxIntegral.Prepartition.IsPartition
code: /-- A prepartition `π` of `I` is a partition if the boxes of `π` cover the whole `I`. -/
def IsPartition (π : Prepartition I) 
goal: Prop

full_name: BoxIntegral.Prepartition.isPartition_iff_iUnion_eq
code: theorem isPartition_iff_iUnion_eq {π : Prepartition I} : π.IsPartition ↔ π.iUnion = I 
goal: π.IsPartition ↔ π.iUnion = ↑I

full_name: BoxIntegral.Prepartition.isPartition_single_iff
code: @[simp]
theorem isPartition_single_iff (h : J ≤ I) : IsPartition (single I J h) ↔ J = I 
goal: (BoxIntegral.Prepartition.single I J h).IsPartition ↔ J = I

full_name: BoxIntegral.Prepartition.isPartitionTop
code: theorem isPartitionTop (I : Box ι) : IsPartition (⊤ : Prepartition I) 
goal: ⊤.IsPartition

full_name: BoxIntegral.Prepartition.IsPartition.iUnion_eq
code: theorem iUnion_eq (h : π.IsPartition) : π.iUnion = I 
goal: π.iUnion = ↑I

full_name: BoxIntegral.Prepartition.IsPartition.iUnion_subset
code: theorem iUnion_subset (h : π.IsPartition) (π₁ : Prepartition I) : π₁.iUnion ⊆ π.iUnion 
goal: π₁.iUnion ⊆ π.iUnion

full_name: BoxIntegral.Prepartition.IsPartition.existsUnique
code: protected theorem existsUnique (h : π.IsPartition) (hx : x ∈ I) :
    ∃! J ∈ π, x ∈ J 
goal: ∃! J, J ∈ π ∧ x ∈ J

full_name: BoxIntegral.Prepartition.IsPartition.nonempty_boxes
code: theorem nonempty_boxes (h : π.IsPartition) : π.boxes.Nonempty 
goal: π.boxes.Nonempty

full_name: BoxIntegral.Prepartition.IsPartition.eq_of_boxes_subset
code: theorem eq_of_boxes_subset (h₁ : π₁.IsPartition) (h₂ : π₁.boxes ⊆ π₂.boxes) : π₁ = π₂ 
goal: π₁ = π₂

full_name: BoxIntegral.Prepartition.IsPartition.le_iff
code: theorem le_iff (h : π₂.IsPartition) :
    π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∀ J' ∈ π₂, (J ∩ J' : Set (ι → ℝ)).Nonempty → J ≤ J' 
goal: π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∀ J' ∈ π₂, (↑J ∩ ↑J').Nonempty → J ≤ J'

full_name: BoxIntegral.Prepartition.IsPartition.biUnion
code: protected theorem biUnion (h : IsPartition π) (hi : ∀ J ∈ π, IsPartition (πi J)) :
    IsPartition (π.biUnion πi) 
goal: (π.biUnion πi).IsPartition

full_name: BoxIntegral.Prepartition.IsPartition.restrict
code: protected theorem restrict (h : IsPartition π) (hJ : J ≤ I) : IsPartition (π.restrict J) 
goal: (π.restrict J).IsPartition

full_name: BoxIntegral.Prepartition.IsPartition.inf
code: protected theorem inf (h₁ : IsPartition π₁) (h₂ : IsPartition π₂) : IsPartition (π₁ ⊓ π₂) 
goal: (π₁ ⊓ π₂).IsPartition

full_name: BoxIntegral.Prepartition.iUnion_biUnion_partition
code: theorem iUnion_biUnion_partition (h : ∀ J ∈ π, (πi J).IsPartition) :
    (π.biUnion πi).iUnion = π.iUnion 
goal: (π.biUnion πi).iUnion = π.iUnion

full_name: BoxIntegral.Prepartition.isPartitionDisjUnionOfEqDiff
code: theorem isPartitionDisjUnionOfEqDiff (h : π₂.iUnion = ↑I \ π₁.iUnion) :
    IsPartition (π₁.disjUnion π₂ <| h.symm ▸ disjoint_sdiff_self_right) 
goal: (π₁.disjUnion π₂ ⋯).IsPartition