Module docstring
{"# Accumulate
The function Accumulate takes a set s and returns ⋃ y ≤ x, s y.
"}
{"# Accumulate
The function Accumulate takes a set s and returns ⋃ y ≤ x, s y.
"}
Set.Accumulate
definition
[LE α] (s : α → Set β) (x : α) : Set β
/-- `Accumulate s` is the union of `s y` for `y ≤ x`. -/
def Accumulate [LE α] (s : α → Set β) (x : α) : Set β :=
⋃ y ≤ x, s y
Set.accumulate_def
theorem
[LE α] {x : α} : Accumulate s x = ⋃ y ≤ x, s y
theorem accumulate_def [LE α] {x : α} : Accumulate s x = ⋃ y ≤ x, s y :=
rfl
Set.mem_accumulate
theorem
[LE α] {x : α} {z : β} : z ∈ Accumulate s x ↔ ∃ y ≤ x, z ∈ s y
@[simp]
theorem mem_accumulate [LE α] {x : α} {z : β} : z ∈ Accumulate s xz ∈ Accumulate s x ↔ ∃ y ≤ x, z ∈ s y := by
simp_rw [accumulate_def, mem_iUnion₂, exists_prop]
Set.subset_accumulate
theorem
[Preorder α] {x : α} : s x ⊆ Accumulate s x
theorem subset_accumulate [Preorder α] {x : α} : s x ⊆ Accumulate s x := fun _ => mem_biUnion le_rfl
Set.accumulate_subset_iUnion
theorem
[LE α] (x : α) : Accumulate s x ⊆ ⋃ i, s i
theorem accumulate_subset_iUnion [LE α] (x : α) : AccumulateAccumulate s x ⊆ ⋃ i, s i :=
(biUnion_subset_biUnion_left (subset_univ _)).trans_eq (biUnion_univ _)
Set.monotone_accumulate
theorem
[Preorder α] : Monotone (Accumulate s)
theorem monotone_accumulate [Preorder α] : Monotone (Accumulate s) := fun _ _ hxy =>
biUnion_subset_biUnion_left fun _ hz => le_trans hz hxy
Set.accumulate_subset_accumulate
theorem
[Preorder α] {x y} (h : x ≤ y) : Accumulate s x ⊆ Accumulate s y
@[gcongr]
theorem accumulate_subset_accumulate [Preorder α] {x y} (h : x ≤ y) :
AccumulateAccumulate s x ⊆ Accumulate s y :=
monotone_accumulate h
Set.biUnion_accumulate
theorem
[Preorder α] (x : α) : ⋃ y ≤ x, Accumulate s y = ⋃ y ≤ x, s y
theorem biUnion_accumulate [Preorder α] (x : α) : ⋃ y ≤ x, Accumulate s y = ⋃ y ≤ x, s y := by
apply Subset.antisymm
· exact iUnion₂_subset fun y hy => monotone_accumulate hy
· exact iUnion₂_mono fun y _ => subset_accumulate
Set.iUnion_accumulate
theorem
[Preorder α] : ⋃ x, Accumulate s x = ⋃ x, s x
theorem iUnion_accumulate [Preorder α] : ⋃ x, Accumulate s x = ⋃ x, s x := by
apply Subset.antisymm
· simp only [subset_def, mem_iUnion, exists_imp, mem_accumulate]
intro z x x' ⟨_, hz⟩
exact ⟨x', hz⟩
· exact iUnion_mono fun i => subset_accumulate
Set.accumulate_bot
theorem
[PartialOrder α] [OrderBot α] (s : α → Set β) : Accumulate s ⊥ = s ⊥
@[simp]
lemma accumulate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Accumulate s ⊥ = s ⊥ := by
simp [Set.accumulate_def]
Set.accumulate_zero_nat
theorem
(s : ℕ → Set β) : Accumulate s 0 = s 0
@[simp]
lemma accumulate_zero_nat (s : ℕ → Set β) : Accumulate s 0 = s 0 := by
simp [accumulate_def]
Set.disjoint_accumulate
theorem
[Preorder α] (hs : Pairwise (Disjoint on s)) {i j : α} (hij : i < j) : Disjoint (Accumulate s i) (s j)
theorem disjoint_accumulate [Preorder α] (hs : Pairwise (DisjointDisjoint on s)) {i j : α} (hij : i < j) :
Disjoint (Accumulate s i) (s j) := by
apply disjoint_left.2 (fun x hx ↦ ?_)
simp only [Accumulate, mem_iUnion, exists_prop] at hx
rcases hx with ⟨k, hk, hx⟩
exact disjoint_left.1 (hs (hk.trans_lt hij).ne) hx