|
| 1 | +/- |
| 2 | +Copyright (c) 2026 Peter Pfaffelhuber. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Peter Pfaffelhuber |
| 5 | +-/ |
| 6 | + |
| 7 | +module |
| 8 | + |
| 9 | +public import Mathlib.Data.Set.Accumulate |
| 10 | + |
| 11 | +/-! |
| 12 | +# Dissipate |
| 13 | +
|
| 14 | +The function `dissipate` takes `s : α → Set β` with `LE α` and returns `⋂ y ≤ x, s y`. |
| 15 | +It is related to `accumulate s := ⋃ y ≤ x, s y`. |
| 16 | +
|
| 17 | +-/ |
| 18 | + |
| 19 | +@[expose] public section |
| 20 | + |
| 21 | +variable {α β : Type*} {s : α → Set β} |
| 22 | + |
| 23 | +namespace Set |
| 24 | + |
| 25 | +/-- `dissipate s` is the intersection of `s y` for `y ≤ x`. -/ |
| 26 | +def dissipate [LE α] (s : α → Set β) (x : α) : Set β := |
| 27 | + ⋂ y ≤ x, s y |
| 28 | + |
| 29 | +theorem dissipate_def [LE α] {x : α} : dissipate s x = ⋂ y ≤ x, s y := rfl |
| 30 | + |
| 31 | +@[simp] |
| 32 | +theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by |
| 33 | + simp [dissipate_def] |
| 34 | + |
| 35 | +theorem dissipate_subset [LE α] {x y : α} (hy : y ≤ x) : dissipate s x ⊆ s y := |
| 36 | + biInter_subset_of_mem hy |
| 37 | + |
| 38 | +theorem iInter_subset_dissipate [LE α] (x : α) : ⋂ i, s i ⊆ dissipate s x := by |
| 39 | + simp only [dissipate, subset_iInter_iff] |
| 40 | + exact fun x h ↦ iInter_subset_of_subset x fun ⦃a⦄ a ↦ a |
| 41 | + |
| 42 | +theorem antitone_dissipate [Preorder α] : Antitone (dissipate s) := |
| 43 | + fun _ _ hab ↦ biInter_subset_biInter_left fun _ hz => le_trans hz hab |
| 44 | + |
| 45 | +@[gcongr] |
| 46 | +theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : |
| 47 | + dissipate s x ⊆ dissipate s y := |
| 48 | + antitone_dissipate h |
| 49 | + |
| 50 | +@[simp] |
| 51 | +theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : |
| 52 | + ⋂ y, ⋂ (_ : y ≤ x), dissipate s y = dissipate s x := by |
| 53 | + apply Subset.antisymm |
| 54 | + · apply iInter_mono fun z y hy ↦ ?_ |
| 55 | + simp only [mem_iInter, mem_dissipate] at * |
| 56 | + exact fun h ↦ hy h z le_rfl |
| 57 | + · simp only [subset_iInter_iff] |
| 58 | + exact fun i j ↦ dissipate_subset_dissipate j |
| 59 | + |
| 60 | +@[simp] |
| 61 | +theorem iInter_dissipate [Preorder α] : ⋂ x, dissipate s x = ⋂ x, s x := by |
| 62 | + apply Subset.antisymm <;> simp_rw [subset_def, dissipate_def, mem_iInter] |
| 63 | + · exact fun z h x' ↦ h x' x' le_rfl |
| 64 | + · exact fun z h x' y hy ↦ h y |
| 65 | + |
| 66 | +@[simp] |
| 67 | +lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : dissipate s ⊥ = s ⊥ := by |
| 68 | + simp [dissipate_def] |
| 69 | + |
| 70 | +@[simp] |
| 71 | +lemma dissipate_zero_nat (s : ℕ → Set β) : dissipate s 0 = s 0 := by |
| 72 | + simp [dissipate_def] |
| 73 | + |
| 74 | +open Nat |
| 75 | + |
| 76 | +@[simp] |
| 77 | +theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : |
| 78 | + dissipate s (n + 1) = (dissipate s n) ∩ s (n + 1) := by |
| 79 | + ext x |
| 80 | + simp_all only [dissipate_def, mem_iInter, mem_inter_iff] |
| 81 | + grind |
| 82 | + |
| 83 | +end Set |
0 commit comments