doc-next-gen

Mathlib.Data.Finset.Lattice.Fold

Module docstring

{"# Lattice operations on finsets

This file is concerned with folding binary lattice operations over finsets.

For the special case of maximum and minimum of a finset, see Max.lean.

See also Mathlib/Order/CompleteLattice/Finset.lean, which is instead concerned with how big lattice or set operations behave when indexed by a finset. ","### sup ","### inf "}

Finset.sup definition
(s : Finset β) (f : β → α) : α
Full source
/-- Supremum of a finite set: `sup {a, b, c} f = f a ⊔ f b ⊔ f c` -/
def sup (s : Finset β) (f : β → α) : α :=
  s.fold (· ⊔ ·)  f
Supremum of a finite set under a function
Informal description
Given a finite set $s$ of elements of type $\beta$ and a function $f : \beta \to \alpha$, where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum $\sup s f$ is the least upper bound of the images of the elements of $s$ under $f$. It is computed by folding the join operation $\sqcup$ over the set, starting from $\bot$.
Finset.sup_def theorem
: s.sup f = (s.1.map f).sup
Full source
theorem sup_def : s.sup f = (s.1.map f).sup :=
  rfl
Supremum of Finite Set Equals Supremum of Its Image Multiset
Informal description
For any finite set $s$ of elements of type $\beta$ and any function $f : \beta \to \alpha$, where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum of $f$ over $s$ is equal to the supremum of the multiset obtained by applying $f$ to each element of $s$. That is, $\sup_{x \in s} f(x) = \sup (f \circ s)$.
Finset.sup_empty theorem
: (∅ : Finset β).sup f = ⊥
Full source
@[simp]
theorem sup_empty : ( : Finset β).sup f =  :=
  fold_empty
Supremum over Empty Finset is Bottom Element
Informal description
For any function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum of $f$ over the empty finset is equal to $\bot$, i.e., $\sup_{\varnothing} f = \bot$.
Finset.sup_cons theorem
{b : β} (h : b ∉ s) : (cons b s h).sup f = f b ⊔ s.sup f
Full source
@[simp]
theorem sup_cons {b : β} (h : b ∉ s) : (cons b s h).sup f = f b ⊔ s.sup f :=
  fold_cons h
Supremum of Function over Finite Set with Insertion: $\sup(\text{cons}(b, s, h), f) = f(b) \sqcup \sup(s, f)$
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ be a type. Given a finite set $s \subseteq \beta$, a function $f : \beta \to \alpha$, and an element $b \in \beta$ such that $b \notin s$, the supremum of $f$ over the set obtained by inserting $b$ into $s$ is equal to the join of $f(b)$ and the supremum of $f$ over $s$. That is, \[ \sup_{x \in \text{cons}(b, s, h)} f(x) = f(b) \sqcup \sup_{x \in s} f(x), \] where $\text{cons}(b, s, h)$ denotes the insertion of $b$ into $s$ under the assumption $h : b \notin s$.
Finset.sup_insert theorem
[DecidableEq β] {b : β} : (insert b s : Finset β).sup f = f b ⊔ s.sup f
Full source
@[simp]
theorem sup_insert [DecidableEq β] {b : β} : (insert b s : Finset β).sup f = f b ⊔ s.sup f :=
  fold_insert_idem
Supremum over Inserted Element Equals Join with Existing Supremum
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ be a type with decidable equality. For any finite set $s \subseteq \beta$, any function $f : \beta \to \alpha$, and any element $b \in \beta$, the supremum of $f$ over the set obtained by inserting $b$ into $s$ is equal to the join of $f(b)$ and the supremum of $f$ over $s$. That is, \[ \sup_{x \in s \cup \{b\}} f(x) = f(b) \sqcup \sup_{x \in s} f(x). \]
Finset.sup_image theorem
[DecidableEq β] (s : Finset γ) (f : γ → β) (g : β → α) : (s.image f).sup g = s.sup (g ∘ f)
Full source
@[simp]
theorem sup_image [DecidableEq β] (s : Finset γ) (f : γ → β) (g : β → α) :
    (s.image f).sup g = s.sup (g ∘ f) :=
  fold_image_idem
Supremum of Function over Image of Finite Set Equals Supremum of Composition
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ and $\gamma$ be types with decidable equality on $\beta$. Given a finite set $s \subseteq \gamma$, a function $f : \gamma \to \beta$, and a function $g : \beta \to \alpha$, the supremum of $g$ over the image of $s$ under $f$ is equal to the supremum of the composition $g \circ f$ over $s$. That is, \[ \sup_{x \in f(s)} g(x) = \sup_{y \in s} g(f(y)). \]
Finset.sup_map theorem
(s : Finset γ) (f : γ ↪ β) (g : β → α) : (s.map f).sup g = s.sup (g ∘ f)
Full source
@[simp]
theorem sup_map (s : Finset γ) (f : γ ↪ β) (g : β → α) : (s.map f).sup g = s.sup (g ∘ f) :=
  fold_map
Supremum Preservation under Injective Mapping
Informal description
Let $s$ be a finite set of elements of type $\gamma$, $f : \gamma \hookrightarrow \beta$ be an injective function embedding, and $g : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice with a bottom element. Then the supremum of $g$ over the image of $s$ under $f$ is equal to the supremum of $g \circ f$ over $s$, i.e., \[ \sup (f(s)) \, g = \sup s \, (g \circ f). \]
Finset.sup_singleton theorem
{b : β} : ({ b } : Finset β).sup f = f b
Full source
@[simp]
theorem sup_singleton {b : β} : ({b} : Finset β).sup f = f b :=
  Multiset.sup_singleton
Supremum of a Singleton Finset: $\sup_{\{b\}} f = f(b)$
Informal description
For any element $b$ of type $\beta$ and any function $f : \beta \to \alpha$, where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum of $f$ over the singleton finset $\{b\}$ is equal to $f(b)$, i.e., \[ \sup_{\{b\}} f = f(b). \]
Finset.sup_sup theorem
: s.sup (f ⊔ g) = s.sup f ⊔ s.sup g
Full source
theorem sup_sup : s.sup (f ⊔ g) = s.sup f ⊔ s.sup g := by
  induction s using Finset.cons_induction with
  | empty => rw [sup_empty, sup_empty, sup_empty, bot_sup_eq]
  | cons _ _ _ ih =>
    rw [sup_cons, sup_cons, sup_cons, ih]
    exact sup_sup_sup_comm _ _ _ _
Supremum of Pointwise Join Equals Join of Suprema over Finite Set
Informal description
For any finite set $s$ of elements of type $\beta$ and any two functions $f, g : \beta \to \alpha$, where $\alpha$ is a join-semilattice with a bottom element, the supremum of the pointwise join $f \sqcup g$ over $s$ is equal to the join of the suprema of $f$ and $g$ over $s$, i.e., \[ \sup_{x \in s} (f(x) \sqcup g(x)) = \left(\sup_{x \in s} f(x)\right) \sqcup \left(\sup_{x \in s} g(x)\right). \]
Finset.sup_congr theorem
{f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) : s₁.sup f = s₂.sup g
Full source
theorem sup_congr {f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) :
    s₁.sup f = s₂.sup g := by
  subst hs
  exact Finset.fold_congr hfg
Supremum Equality Under Function Congruence on Finite Sets
Informal description
Let $s_1$ and $s_2$ be finite sets of type $\beta$, and let $f, g : \beta \to \alpha$ be functions where $\alpha$ is a join-semilattice with a bottom element. If $s_1 = s_2$ and for every element $a \in s_2$ we have $f(a) = g(a)$, then the suprema of $f$ over $s_1$ and of $g$ over $s_2$ are equal, i.e., $\sup_{a \in s_1} f(a) = \sup_{a \in s_2} g(a)$.
map_finset_sup theorem
[SemilatticeSup β] [OrderBot β] [FunLike F α β] [SupBotHomClass F α β] (f : F) (s : Finset ι) (g : ι → α) : f (s.sup g) = s.sup (f ∘ g)
Full source
@[simp]
theorem _root_.map_finset_sup [SemilatticeSup β] [OrderBot β]
    [FunLike F α β] [SupBotHomClass F α β]
    (f : F) (s : Finset ι) (g : ι → α) : f (s.sup g) = s.sup (f ∘ g) :=
  Finset.cons_induction_on s (map_bot f) fun i s _ h => by
    rw [sup_cons, sup_cons, map_sup, h, Function.comp_apply]
Supremum Preservation Under Homomorphism: $f(\sup_s g) = \sup_s (f \circ g)$
Informal description
Let $\alpha$ and $\beta$ be join-semilattices with bottom elements $\bot_\alpha$ and $\bot_\beta$ respectively. Given a finite set $s$ of elements of type $\iota$, a function $g : \iota \to \alpha$, and a supremum-and-bottom-preserving homomorphism $f : \alpha \to \beta$, we have \[ f\left(\sup_{i \in s} g(i)\right) = \sup_{i \in s} (f \circ g)(i). \]
Finset.sup_le_iff theorem
{a : α} : s.sup f ≤ a ↔ ∀ b ∈ s, f b ≤ a
Full source
@[simp]
protected theorem sup_le_iff {a : α} : s.sup f ≤ a ↔ ∀ b ∈ s, f b ≤ a := by
  apply Iff.trans Multiset.sup_le
  simp only [Multiset.mem_map, and_imp, exists_imp]
  exact ⟨fun k b hb => k _ _ hb rfl, fun k a' b hb h => h ▸ k _ hb⟩
Supremum of Finite Set is Least Upper Bound: $\sup_s f \leq a \leftrightarrow \forall b \in s, f(b) \leq a$
Informal description
Let $s$ be a finite set of elements of type $\beta$, and let $f : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice with a bottom element $\bot$. For any element $a \in \alpha$, the supremum of $f$ over $s$ is less than or equal to $a$ if and only if for every element $b \in s$, the value $f(b)$ is less than or equal to $a$. In other words: \[ \sup_{b \in s} f(b) \leq a \leftrightarrow \forall b \in s, f(b) \leq a. \]
Finset.sup_const_le theorem
: (s.sup fun _ => a) ≤ a
Full source
theorem sup_const_le : (s.sup fun _ => a) ≤ a :=
  Finset.sup_le fun _ _ => le_rfl
Supremum of Constant Function is Bounded by Constant: $\sup_s a \leq a$
Informal description
For any finite set $s$ and any element $a$ in a join-semilattice $\alpha$ with a bottom element, the supremum of the constant function $\lambda \_, a$ over $s$ is less than or equal to $a$, i.e., \[ \sup_{b \in s} a \leq a. \]
Finset.le_sup theorem
{b : β} (hb : b ∈ s) : f b ≤ s.sup f
Full source
theorem le_sup {b : β} (hb : b ∈ s) : f b ≤ s.sup f :=
  Finset.sup_le_iff.1 le_rfl _ hb
Element in Finite Set is Bounded by Supremum: $f(b) \leq \sup_s f$ for $b \in s$
Informal description
Let $s$ be a finite set of elements of type $\beta$ and $f : \beta \to \alpha$ a function, where $\alpha$ is a join-semilattice with a bottom element. For any element $b \in s$, the value $f(b)$ is less than or equal to the supremum of $f$ over $s$, i.e., \[ f(b) \leq \sup_{x \in s} f(x). \]
Finset.isLUB_sup theorem
: IsLUB (f '' s) (s.sup f)
Full source
lemma isLUB_sup : IsLUB (f '' s) (s.sup f) := by
  simp +contextual [IsLUB, IsLeast, upperBounds, lowerBounds, le_sup]
Supremum of a Finite Set is the Least Upper Bound of its Image
Informal description
Let $s$ be a finite set of elements of type $\beta$ and $f : \beta \to \alpha$ a function, where $\alpha$ is a join-semilattice with a bottom element. Then the supremum $\sup s f$ is the least upper bound of the image of $s$ under $f$, i.e., $\text{IsLUB}(f(s), \sup s f)$.
Finset.isLUB_sup_id theorem
{s : Finset α} : IsLUB s (s.sup id)
Full source
lemma isLUB_sup_id {s : Finset α} : IsLUB s (s.sup id) := by simpa using isLUB_sup (f := id)
Identity Supremum is Least Upper Bound for Finite Sets
Informal description
For any finite set $s$ of elements in a join-semilattice $\alpha$ with a bottom element, the supremum of $s$ under the identity function is the least upper bound of $s$. That is, $\text{IsLUB}(s, \sup s \text{ id})$.
Finset.le_sup_of_le theorem
{b : β} (hb : b ∈ s) (h : a ≤ f b) : a ≤ s.sup f
Full source
theorem le_sup_of_le {b : β} (hb : b ∈ s) (h : a ≤ f b) : a ≤ s.sup f := h.trans <| le_sup hb
Transitivity of Supremum Bound in Finite Sets: $a \leq f(b) \implies a \leq \sup_s f$ for $b \in s$
Informal description
Let $s$ be a finite set of elements of type $\beta$, $f : \beta \to \alpha$ a function where $\alpha$ is a join-semilattice with a bottom element, and $a \in \alpha$. If there exists an element $b \in s$ such that $a \leq f(b)$, then $a$ is less than or equal to the supremum of $f$ over $s$, i.e., \[ a \leq \sup_{x \in s} f(x). \]
Finset.sup_union theorem
[DecidableEq β] : (s₁ ∪ s₂).sup f = s₁.sup f ⊔ s₂.sup f
Full source
theorem sup_union [DecidableEq β] : (s₁ ∪ s₂).sup f = s₁.sup f ⊔ s₂.sup f :=
  eq_of_forall_ge_iff fun c => by simp [or_imp, forall_and]
Supremum of Union Equals Join of Suprema
Informal description
Let $\beta$ be a type with decidable equality, and let $\alpha$ be a join-semilattice with a bottom element $\bot$. For any two finite sets $s_1, s_2 \subseteq \beta$ and any function $f : \beta \to \alpha$, the supremum of $f$ over the union $s_1 \cup s_2$ is equal to the join of the suprema of $f$ over $s_1$ and $s_2$, i.e., \[ \sup_{x \in s_1 \cup s_2} f(x) = \left(\sup_{x \in s_1} f(x)\right) \sqcup \left(\sup_{x \in s_2} f(x)\right). \]
Finset.sup_const theorem
{s : Finset β} (h : s.Nonempty) (c : α) : (s.sup fun _ => c) = c
Full source
theorem sup_const {s : Finset β} (h : s.Nonempty) (c : α) : (s.sup fun _ => c) = c :=
  eq_of_forall_ge_iff (fun _ => Finset.sup_le_iff.trans h.forall_const)
Supremum of Constant Function over Nonempty Finite Set is Constant
Informal description
For any nonempty finite set $s$ of elements of type $\beta$ and any constant $c$ in a join-semilattice $\alpha$ with a bottom element $\bot$, the supremum of the constant function $\lambda \_, c$ over $s$ is equal to $c$.
Finset.sup_bot theorem
(s : Finset β) : (s.sup fun _ => ⊥) = (⊥ : α)
Full source
@[simp]
theorem sup_bot (s : Finset β) : (s.sup fun _ => ) = ( : α) := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · exact sup_empty
  · exact sup_const hs _
Supremum of Bottom Function over Finite Set is Bottom
Informal description
For any finite set $s$ of elements of type $\beta$ and a join-semilattice $\alpha$ with a bottom element $\bot$, the supremum of the constant function $\lambda \_, \bot$ over $s$ is equal to $\bot$, i.e., \[ \sup_{x \in s} \bot = \bot. \]
Finset.sup_ite theorem
(p : β → Prop) [DecidablePred p] : (s.sup fun i => ite (p i) (f i) (g i)) = (s.filter p).sup f ⊔ (s.filter fun i => ¬p i).sup g
Full source
theorem sup_ite (p : β → Prop) [DecidablePred p] :
    (s.sup fun i => ite (p i) (f i) (g i)) = (s.filter p).sup f ⊔ (s.filter fun i => ¬p i).sup g :=
  fold_ite _
Supremum of Conditional Function over Finite Set
Informal description
Let $s$ be a finite set of elements of type $\beta$, and let $p$ be a predicate on $\beta$ with a decidable truth value. For functions $f, g : \beta \to \alpha$, where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum of the function defined by $\text{ite}(p(i), f(i), g(i))$ over $s$ is equal to the join of the suprema of $f$ over the subset of $s$ where $p$ holds and of $g$ over the subset of $s$ where $p$ does not hold. In other words, \[ \sup_{i \in s} \big(\text{if } p(i) \text{ then } f(i) \text{ else } g(i)\big) = \Big(\sup_{i \in s, p(i)} f(i)\Big) \sqcup \Big(\sup_{i \in s, \neg p(i)} g(i)\Big). \]
Finset.sup_mono_fun theorem
{g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.sup f ≤ s.sup g
Full source
@[gcongr]
theorem sup_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.sup f ≤ s.sup g :=
  Finset.sup_le fun b hb => le_trans (h b hb) (le_sup hb)
Monotonicity of Supremum under Function Comparison
Informal description
Let $s$ be a finite set of elements of type $\beta$, and let $f, g : \beta \to \alpha$ be functions where $\alpha$ is a join-semilattice with a bottom element. If for every $b \in s$ we have $f(b) \leq g(b)$, then the supremum of $f$ over $s$ is less than or equal to the supremum of $g$ over $s$, i.e., \[ \sup_{b \in s} f(b) \leq \sup_{b \in s} g(b). \]
Finset.sup_mono theorem
(h : s₁ ⊆ s₂) : s₁.sup f ≤ s₂.sup f
Full source
@[gcongr]
theorem sup_mono (h : s₁ ⊆ s₂) : s₁.sup f ≤ s₂.sup f :=
  Finset.sup_le (fun _ hb => le_sup (h hb))
Monotonicity of Supremum under Subset Inclusion
Informal description
Let $s_1$ and $s_2$ be finite sets of elements of type $\beta$, and let $f : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice with a bottom element $\bot$. If $s_1$ is a subset of $s_2$, then the supremum of $f$ over $s_1$ is less than or equal to the supremum of $f$ over $s_2$, i.e., \[ \sup_{x \in s_1} f(x) \leq \sup_{x \in s_2} f(x). \]
Finset.sup_comm theorem
(s : Finset β) (t : Finset γ) (f : β → γ → α) : (s.sup fun b => t.sup (f b)) = t.sup fun c => s.sup fun b => f b c
Full source
protected theorem sup_comm (s : Finset β) (t : Finset γ) (f : β → γ → α) :
    (s.sup fun b => t.sup (f b)) = t.sup fun c => s.sup fun b => f b c :=
  eq_of_forall_ge_iff fun a => by simpa using forall₂_swap
Commutativity of Double Supremum over Finite Sets
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ and $\gamma$ be arbitrary types. For any finite sets $s \subseteq \beta$ and $t \subseteq \gamma$, and any function $f : \beta \to \gamma \to \alpha$, the following equality holds: \[ \sup_{b \in s} \sup_{c \in t} f(b, c) = \sup_{c \in t} \sup_{b \in s} f(b, c) \]
Finset.sup_attach theorem
(s : Finset β) (f : β → α) : (s.attach.sup fun x => f x) = s.sup f
Full source
@[simp]
theorem sup_attach (s : Finset β) (f : β → α) : (s.attach.sup fun x => f x) = s.sup f :=
  (s.attach.sup_map (Function.Embedding.subtype _) f).symm.trans <| congr_arg _ attach_map_val
Supremum Preservation under Subtype Attachment
Informal description
For any finite set $s$ of elements of type $\beta$ and any function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum of $f$ over the elements of $s$ is equal to the supremum of $f$ over the attached subtype of $s$. That is, \[ \sup_{x \in s.\text{attach}} f(x) = \sup_{x \in s} f(x). \]
Finset.sup_erase_bot theorem
[DecidableEq α] (s : Finset α) : (s.erase ⊥).sup id = s.sup id
Full source
@[simp]
theorem sup_erase_bot [DecidableEq α] (s : Finset α) : (s.erase ).sup id = s.sup id := by
  refine (sup_mono (s.erase_subset _)).antisymm (Finset.sup_le_iff.2 fun a ha => ?_)
  obtain rfl | ha' := eq_or_ne a 
  · exact bot_le
  · exact le_sup (mem_erase.2 ⟨ha', ha⟩)
Supremum Unaffected by Removal of Bottom Element: $\sup (s \setminus \{\bot\}) = \sup s$
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$ and decidable equality. For any finite set $s \subseteq \alpha$, the supremum of $s$ with $\bot$ removed is equal to the supremum of $s$, i.e., \[ \sup (s \setminus \{\bot\}) = \sup s. \]
Finset.sup_sdiff_right theorem
{α β : Type*} [GeneralizedBooleanAlgebra α] (s : Finset β) (f : β → α) (a : α) : (s.sup fun b => f b \ a) = s.sup f \ a
Full source
theorem sup_sdiff_right {α β : Type*} [GeneralizedBooleanAlgebra α] (s : Finset β) (f : β → α)
    (a : α) : (s.sup fun b => f b \ a) = s.sup f \ a := by
  induction s using Finset.cons_induction with
  | empty => rw [sup_empty, sup_empty, bot_sdiff]
  | cons _ _ _ h => rw [sup_cons, sup_cons, h, sup_sdiff]
Supremum-Difference Commutation in Generalized Boolean Algebras: $\sup_{b \in s} (f(b) \setminus a) = (\sup_{b \in s} f(b)) \setminus a$
Informal description
Let $\alpha$ be a generalized Boolean algebra and $\beta$ be a type. For any finite set $s \subseteq \beta$, function $f : \beta \to \alpha$, and element $a \in \alpha$, the supremum of the set $\{f(b) \setminus a \mid b \in s\}$ is equal to the difference between the supremum of $f$ over $s$ and $a$, i.e., \[ \sup_{b \in s} (f(b) \setminus a) = \left(\sup_{b \in s} f(b)\right) \setminus a. \]
Finset.comp_sup_eq_sup_comp theorem
[SemilatticeSup γ] [OrderBot γ] {s : Finset β} {f : β → α} (g : α → γ) (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) (bot : g ⊥ = ⊥) : g (s.sup f) = s.sup (g ∘ f)
Full source
theorem comp_sup_eq_sup_comp [SemilatticeSup γ] [OrderBot γ] {s : Finset β} {f : β → α} (g : α → γ)
    (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) (bot : g  = ) : g (s.sup f) = s.sup (g ∘ f) :=
  Finset.cons_induction_on s bot fun c t hc ih => by
    rw [sup_cons, sup_cons, g_sup, ih, Function.comp_apply]
Supremum Preservation under Function Composition: $g(\sup f) = \sup (g \circ f)$
Informal description
Let $\alpha$ and $\gamma$ be join-semilattices with bottom elements $\bot_\alpha$ and $\bot_\gamma$ respectively. Given a finite set $s \subseteq \beta$, a function $f : \beta \to \alpha$, and a function $g : \alpha \to \gamma$ such that: 1. $g$ preserves suprema: $g(x \sqcup y) = g(x) \sqcup g(y)$ for all $x, y \in \alpha$, 2. $g$ preserves the bottom element: $g(\bot_\alpha) = \bot_\gamma$, then the image under $g$ of the supremum of $f$ over $s$ is equal to the supremum of $g \circ f$ over $s$, i.e., \[ g\left(\sup_{x \in s} f(x)\right) = \sup_{x \in s} g(f(x)). \]
Finset.sup_coe theorem
{P : α → Prop} {Pbot : P ⊥} {Psup : ∀ ⦃x y⦄, P x → P y → P (x ⊔ y)} (t : Finset β) (f : β → { x : α // P x }) : (@sup { x // P x } _ (Subtype.semilatticeSup Psup) (Subtype.orderBot Pbot) t f : α) = t.sup fun x => ↑(f x)
Full source
/-- Computing `sup` in a subtype (closed under `sup`) is the same as computing it in `α`. -/
theorem sup_coe {P : α → Prop} {Pbot : P } {Psup : ∀ ⦃x y⦄, P x → P y → P (x ⊔ y)} (t : Finset β)
    (f : β → { x : α // P x }) :
    (@sup { x // P x } _ (Subtype.semilatticeSup Psup) (Subtype.orderBot Pbot) t f : α) =
      t.sup fun x => ↑(f x) := by
  letI := Subtype.semilatticeSup Psup
  letI := Subtype.orderBot Pbot
  apply comp_sup_eq_sup_comp Subtype.val <;> intros <;> rfl
Subtype Supremum Equals Underlying Supremum for Closed Predicates
Informal description
Let $\alpha$ be a type with a join-semilattice structure and a bottom element $\bot$, and let $P : \alpha \to \text{Prop}$ be a predicate on $\alpha$ such that: 1. $P(\bot)$ holds, 2. For any $x, y \in \alpha$, if $P(x)$ and $P(y)$ hold, then $P(x \sqcup y)$ holds. Given a finite set $t$ of elements of type $\beta$ and a function $f : \beta \to \{x \in \alpha \mid P(x)\}$, the supremum of $f$ over $t$ in the subtype $\{x \in \alpha \mid P(x)\}$ (with the induced join-semilattice and order bot structures) is equal to the supremum of the underlying elements $\uparrow(f(x))$ over $t$ in $\alpha$. That is, \[ \left(\sup_{x \in t} f(x)\right) = \sup_{x \in t} \uparrow(f(x)). \]
Finset.sup_toFinset theorem
{α β} [DecidableEq β] (s : Finset α) (f : α → Multiset β) : (s.sup f).toFinset = s.sup fun x => (f x).toFinset
Full source
@[simp]
theorem sup_toFinset {α β} [DecidableEq β] (s : Finset α) (f : α → Multiset β) :
    (s.sup f).toFinset = s.sup fun x => (f x).toFinset :=
  comp_sup_eq_sup_comp Multiset.toFinset toFinset_union rfl
Finset Conversion Commutes with Supremum: $(\sup f).\text{toFinset} = \sup (f.\text{toFinset})$
Informal description
Let $\alpha$ and $\beta$ be types with decidable equality on $\beta$. For any finite set $s \subseteq \alpha$ and any function $f : \alpha \to \text{Multiset}(\beta)$, the conversion to a finset of the supremum of $f$ over $s$ is equal to the supremum over $s$ of the function that converts each $f(x)$ to a finset. In symbols: \[ \left(\sup_{x \in s} f(x)\right).\text{toFinset} = \sup_{x \in s} \left(f(x).\text{toFinset}\right). \]
List.foldr_sup_eq_sup_toFinset theorem
[DecidableEq α] (l : List α) : l.foldr (· ⊔ ·) ⊥ = l.toFinset.sup id
Full source
theorem _root_.List.foldr_sup_eq_sup_toFinset [DecidableEq α] (l : List α) :
    l.foldr (· ⊔ ·)  = l.toFinset.sup id := by
  rw [← coe_fold_r, ← Multiset.fold_dedup_idem, sup_def, ← List.toFinset_coe, toFinset_val,
    Multiset.map_id]
  rfl
Equality of List Right Fold and Finite Set Supremum under Identity
Informal description
For any list $l$ of elements of type $\alpha$ with decidable equality, the right fold of the join operation $\sqcup$ over $l$ starting from the bottom element $\bot$ is equal to the supremum of the image of $l$ under the identity function when viewed as a finite set. That is, $\mathrm{foldr}\ (\sqcup)\ \bot\ l = \sup (\mathrm{id} \circ l.\mathrm{toFinset})$.
Finset.subset_range_sup_succ theorem
(s : Finset ℕ) : s ⊆ range (s.sup id).succ
Full source
theorem subset_range_sup_succ (s : Finset ) : s ⊆ range (s.sup id).succ := fun _ hn =>
  mem_range.2 <| Nat.lt_succ_of_le <| @le_sup _ _ _ _ _ id _ hn
Finite Set of Natural Numbers is Bounded by its Supremum
Informal description
For any finite set $s$ of natural numbers, $s$ is a subset of the range from $0$ to $\sup s$, where $\sup s$ is the supremum of $s$ under the identity function. In other words, every element of $s$ is less than or equal to $\sup s$.
Finset.sup_induction theorem
{p : α → Prop} (hb : p ⊥) (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊔ a₂)) (hs : ∀ b ∈ s, p (f b)) : p (s.sup f)
Full source
theorem sup_induction {p : α → Prop} (hb : p ) (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊔ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.sup f) := by
  induction s using Finset.cons_induction with
  | empty => exact hb
  | cons _ _ _ ih =>
    simp only [sup_cons, forall_mem_cons] at hs ⊢
    exact hp _ hs.1 _ (ih hs.2)
Induction Principle for Supremum over Finite Sets
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a finite set with elements of type $\beta$. Given a predicate $p : \alpha \to \mathrm{Prop}$ such that: 1. $p(\bot)$ holds, 2. For any $a_1, a_2 \in \alpha$, if $p(a_1)$ and $p(a_2)$ hold, then $p(a_1 \sqcup a_2)$ holds, 3. For every $b \in s$, $p(f(b))$ holds, then $p(\sup_{b \in s} f(b))$ holds.
Finset.sup_le_of_le_directed theorem
{α : Type*} [SemilatticeSup α] [OrderBot α] (s : Set α) (hs : s.Nonempty) (hdir : DirectedOn (· ≤ ·) s) (t : Finset α) : (∀ x ∈ t, ∃ y ∈ s, x ≤ y) → ∃ x ∈ s, t.sup id ≤ x
Full source
theorem sup_le_of_le_directed {α : Type*} [SemilatticeSup α] [OrderBot α] (s : Set α)
    (hs : s.Nonempty) (hdir : DirectedOn (· ≤ ·) s) (t : Finset α) :
    (∀ x ∈ t, ∃ y ∈ s, x ≤ y) → ∃ x ∈ s, t.sup id ≤ x := by
  classical
    induction t using Finset.induction_on with
    | empty =>
      simpa only [forall_prop_of_true, and_true, forall_prop_of_false, bot_le, not_false_iff,
        sup_empty, forall_true_iff, not_mem_empty]
    | insert a r _ ih =>
      intro h
      have incs : (r : Set α) ⊆ ↑(insert a r) := by
        rw [Finset.coe_subset]
        apply Finset.subset_insert
      -- x ∈ s is above the sup of r
      obtain ⟨x, ⟨hxs, hsx_sup⟩⟩ := ih fun x hx => h x <| incs hx
      -- y ∈ s is above a
      obtain ⟨y, hys, hay⟩ := h a (Finset.mem_insert_self a r)
      -- z ∈ s is above x and y
      obtain ⟨z, hzs, ⟨hxz, hyz⟩⟩ := hdir x hxs y hys
      use z, hzs
      rw [sup_insert, id, sup_le_iff]
      exact ⟨le_trans hay hyz, le_trans hsx_sup hxz⟩
Directed Supremum Bound for Finite Sets in Join-Semilattices
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a nonempty subset of $\alpha$ that is directed with respect to the $\leq$ relation. For any finite subset $t$ of $\alpha$, if every element $x \in t$ is bounded above by some element $y \in s$, then the supremum of $t$ (with respect to the identity function) is also bounded above by some element in $s$. In other words, if $\forall x \in t, \exists y \in s, x \leq y$, then $\exists z \in s, \sup t \leq z$.
Finset.sup_mem theorem
(s : Set α) (w₁ : ⊥ ∈ s) (w₂ : ∀ᵉ (x ∈ s) (y ∈ s), x ⊔ y ∈ s) {ι : Type*} (t : Finset ι) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.sup p ∈ s
Full source
theorem sup_mem (s : Set α) (w₁ : ⊥ ∈ s) (w₂ : ∀ᵉ (x ∈ s) (y ∈ s), x ⊔ y ∈ s)
    {ι : Type*} (t : Finset ι) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.sup p ∈ s :=
  @sup_induction _ _ _ _ _ _ (· ∈ s) w₁ w₂ h
Closure of Supremum in Join-Semilattice Subset
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a subset of $\alpha$ such that: 1. $\bot \in s$, 2. For any $x, y \in s$, their join $x \sqcup y$ is also in $s$. For any finite set $t$ (indexed by type $\iota$) and any function $p : \iota \to \alpha$, if $p(i) \in s$ for all $i \in t$, then the supremum $\sup_{i \in t} p(i)$ is also in $s$.
Finset.sup_eq_bot_iff theorem
(f : β → α) (S : Finset β) : S.sup f = ⊥ ↔ ∀ s ∈ S, f s = ⊥
Full source
@[simp]
protected theorem sup_eq_bot_iff (f : β → α) (S : Finset β) : S.sup f = ⊥ ↔ ∀ s ∈ S, f s = ⊥ := by
  classical induction' S using Finset.induction with a S _ hi <;> simp [*]
Supremum Equals Bottom if and only if All Elements Map to Bottom
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ be any type. For any function $f : \beta \to \alpha$ and any finite set $S \subseteq \beta$, the supremum of $f$ over $S$ equals $\bot$ if and only if $f(s) = \bot$ for every $s \in S$. In symbols: \[ \sup_{s \in S} f(s) = \bot \leftrightarrow \forall s \in S, f(s) = \bot. \]
Finset.sup_disjSum theorem
(s : Finset β) (t : Finset γ) (f : β ⊕ γ → α) : (s.disjSum t).sup f = (s.sup fun x ↦ f (.inl x)) ⊔ (t.sup fun x ↦ f (.inr x))
Full source
@[simp]
lemma sup_disjSum (s : Finset β) (t : Finset γ) (f : β ⊕ γ → α) :
    (s.disjSum t).sup f = (s.sup fun x ↦ f (.inl x)) ⊔ (t.sup fun x ↦ f (.inr x)) :=
  congr(fold _ $(bot_sup_eq _ |>.symm) _ _).trans (fold_disjSum _ _ _ _ _ _)
Supremum over Disjoint Union Equals Join of Suprema
Informal description
For any finite sets $s$ (of type $\beta$) and $t$ (of type $\gamma$), and any function $f : \beta \oplus \gamma \to \alpha$ where $\alpha$ is a join-semilattice with a bottom element $\bot$, the supremum of $f$ over the disjoint union $s \sqcup t$ is equal to the supremum of $f$ over $s$ (via the left injection) joined with the supremum of $f$ over $t$ (via the right injection). In symbols: \[ \sup_{x \in s \sqcup t} f(x) = \left(\sup_{x \in s} f(\text{inl}(x))\right) \sqcup \left(\sup_{x \in t} f(\text{inr}(x))\right) \]
Finset.sup_eq_bot_of_isEmpty theorem
[IsEmpty β] (f : β → α) (S : Finset β) : S.sup f = ⊥
Full source
@[simp]
theorem sup_eq_bot_of_isEmpty [IsEmpty β] (f : β → α) (S : Finset β) : S.sup f =  := by
  rw [Finset.sup_eq_bot_iff]
  exact fun x _ => False.elim <| IsEmpty.false x
Supremum of Function over Empty Type is Bottom Element
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ be an empty type. For any function $f : \beta \to \alpha$ and any finite set $S \subseteq \beta$, the supremum of $f$ over $S$ equals $\bot$. In symbols: \[ \sup_{s \in S} f(s) = \bot. \]
Finset.le_sup_dite_pos theorem
(p : β → Prop) [DecidablePred p] {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : p b) : f b h₁ ≤ s.sup fun i ↦ if h : p i then f i h else g i h
Full source
theorem le_sup_dite_pos (p : β → Prop) [DecidablePred p]
    {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : p b) :
    f b h₁ ≤ s.sup fun i ↦ if h : p i then f i h else g i h := by
  have : f b h₁ = (fun i ↦ if h : p i then f i h else g i h) b := by simp [h₁]
  rw [this]
  apply le_sup h₀
Conditional Supremum Bound for Positive Case in Finite Sets
Informal description
Let $s$ be a finite set of elements of type $\beta$, and let $p : \beta \to \text{Prop}$ be a decidable predicate on $\beta$. Consider two functions $f : \Pi (b : \beta), p(b) \to \alpha$ and $g : \Pi (b : \beta), \neg p(b) \to \alpha$, where $\alpha$ is a join-semilattice with a bottom element $\bot$. For any element $b \in s$ such that $p(b)$ holds, we have: \[ f(b, h_1) \leq \sup_{i \in s} \begin{cases} f(i, h) & \text{if } p(i) \\ g(i, h) & \text{otherwise} \end{cases} \] where $h_1$ is a proof that $p(b)$ holds.
Finset.le_sup_dite_neg theorem
(p : β → Prop) [DecidablePred p] {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : ¬p b) : g b h₁ ≤ s.sup fun i ↦ if h : p i then f i h else g i h
Full source
theorem le_sup_dite_neg (p : β → Prop) [DecidablePred p]
    {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : ¬p b) :
    g b h₁ ≤ s.sup fun i ↦ if h : p i then f i h else g i h := by
  have : g b h₁ = (fun i ↦ if h : p i then f i h else g i h) b := by simp [h₁]
  rw [this]
  apply le_sup h₀
Supremum Bound for Negative Case in Conditional Function over Finite Set
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $\beta$ be a type with a decidable predicate $p : \beta \to \text{Prop}$. Given functions $f : \{b \in \beta \mid p(b)\} \to \alpha$ and $g : \{b \in \beta \mid \neg p(b)\} \to \alpha$, a finite set $s \subseteq \beta$, and an element $b \in s$ such that $\neg p(b)$, we have \[ g(b, \neg p(b)) \leq \sup_{i \in s} \begin{cases} f(i, p(i)) & \text{if } p(i), \\ g(i, \neg p(i)) & \text{otherwise}. \end{cases} \]
Finset.sup_eq_iSup theorem
[CompleteLattice β] (s : Finset α) (f : α → β) : s.sup f = ⨆ a ∈ s, f a
Full source
theorem sup_eq_iSup [CompleteLattice β] (s : Finset α) (f : α → β) : s.sup f = ⨆ a ∈ s, f a :=
  le_antisymm
    (Finset.sup_le (fun a ha => le_iSup_of_le a <| le_iSup (fun _ => f a) ha))
    (iSup_le fun _ => iSup_le fun ha => le_sup ha)
Supremum of Finite Set Equals Indexed Supremum
Informal description
Let $\beta$ be a complete lattice and $s$ be a finite set of elements of type $\alpha$. For any function $f : \alpha \to \beta$, the supremum of $f$ over $s$ is equal to the indexed supremum of $f$ over the elements of $s$, i.e., \[ \sup_{x \in s} f(x) = \bigsqcup_{x \in s} f(x). \]
Finset.sup_id_eq_sSup theorem
[CompleteLattice α] (s : Finset α) : s.sup id = sSup s
Full source
theorem sup_id_eq_sSup [CompleteLattice α] (s : Finset α) : s.sup id = sSup s := by
  simp [sSup_eq_iSup, sup_eq_iSup]
Supremum of Finite Set Equals Supremum of Identity Function
Informal description
For any finite set $s$ in a complete lattice $\alpha$, the supremum of the identity function over $s$ is equal to the supremum of the set $s$, i.e., \[ \sup_{x \in s} x = \bigvee s. \]
Finset.sup_id_set_eq_sUnion theorem
(s : Finset (Set α)) : s.sup id = ⋃₀ ↑s
Full source
theorem sup_id_set_eq_sUnion (s : Finset (Set α)) : s.sup id = ⋃₀ ↑s :=
  sup_id_eq_sSup _
Supremum of Finite Set of Sets Equals Union
Informal description
For any finite set $s$ of subsets of a type $\alpha$, the supremum of the identity function over $s$ is equal to the union of all sets in $s$, i.e., \[ \sup_{X \in s} X = \bigcup_{X \in s} X. \]
Finset.sup_set_eq_biUnion theorem
(s : Finset α) (f : α → Set β) : s.sup f = ⋃ x ∈ s, f x
Full source
@[simp]
theorem sup_set_eq_biUnion (s : Finset α) (f : α → Set β) : s.sup f = ⋃ x ∈ s, f x :=
  sup_eq_iSup _ _
Supremum of Finite Set of Sets Equals Union
Informal description
For any finite set $s$ of elements of type $\alpha$ and any function $f \colon \alpha \to \text{Set } \beta$, the supremum of $f$ over $s$ is equal to the union of $f(x)$ for all $x \in s$, i.e., \[ \sup_{x \in s} f(x) = \bigcup_{x \in s} f(x). \]
Finset.sup_eq_sSup_image theorem
[CompleteLattice β] (s : Finset α) (f : α → β) : s.sup f = sSup (f '' s)
Full source
theorem sup_eq_sSup_image [CompleteLattice β] (s : Finset α) (f : α → β) :
    s.sup f = sSup (f '' s) := by
  classical rw [← Finset.coe_image, ← sup_id_eq_sSup, sup_image, Function.id_comp]
Supremum of Function over Finite Set Equals Supremum of Image
Informal description
Let $\beta$ be a complete lattice and let $s$ be a finite set of elements of type $\alpha$. For any function $f \colon \alpha \to \beta$, the supremum of $f$ over $s$ is equal to the supremum of the image of $s$ under $f$, i.e., \[ \sup_{x \in s} f(x) = \bigvee f(s). \]
Finset.exists_sup_ge theorem
[SemilatticeSup β] [OrderBot β] [WellFoundedGT β] (f : α → β) : ∃ t : Finset α, ∀ a, f a ≤ t.sup f
Full source
theorem exists_sup_ge [SemilatticeSup β] [OrderBot β] [WellFoundedGT β] (f : α → β) :
    ∃ t : Finset α, ∀ a, f a ≤ t.sup f := by
  cases isEmpty_or_nonempty α
  · exact ⟨⊥, isEmptyElim⟩
  obtain ⟨_, ⟨t, rfl⟩, ht⟩ := wellFounded_gt.has_min _ (Set.range_nonempty (sup · f))
  refine ⟨t, fun a ↦ ?_⟩
  classical
  have := ht (f a ⊔ t.sup f) ⟨insert a t, by simp⟩
  rwa [GT.gt, right_lt_sup, not_not] at this
Existence of Finite Supremum Bound in Well-Founded Join-Semilattices
Informal description
Let $\beta$ be a join-semilattice with a bottom element $\bot$ and a well-founded "greater than" relation. For any function $f \colon \alpha \to \beta$, there exists a finite subset $t \subseteq \alpha$ such that for every $a \in \alpha$, the value $f(a)$ is less than or equal to the supremum of $f$ over $t$, i.e., $f(a) \leq \sup_{x \in t} f(x)$.
Finset.exists_sup_eq_iSup theorem
[CompleteLattice β] [WellFoundedGT β] (f : α → β) : ∃ t : Finset α, t.sup f = ⨆ a, f a
Full source
theorem exists_sup_eq_iSup [CompleteLattice β] [WellFoundedGT β] (f : α → β) :
    ∃ t : Finset α, t.sup f = ⨆ a, f a :=
  have ⟨t, ht⟩ := exists_sup_ge f
  ⟨t, (Finset.sup_le fun _ _ ↦ le_iSup ..).antisymm <| iSup_le ht⟩
Finite Supremum Attains Indexed Supremum in Complete Lattices
Informal description
Let $\beta$ be a complete lattice with a well-founded "greater than" relation. For any function $f \colon \alpha \to \beta$, there exists a finite subset $t \subseteq \alpha$ such that the supremum of $f$ over $t$ equals the supremum of $f$ over all of $\alpha$, i.e., $\sup_{x \in t} f(x) = \bigsqcup_{a \in \alpha} f(a)$.
Finset.inf definition
(s : Finset β) (f : β → α) : α
Full source
/-- Infimum of a finite set: `inf {a, b, c} f = f a ⊓ f b ⊓ f c` -/
def inf (s : Finset β) (f : β → α) : α :=
  s.fold (· ⊓ ·)  f
Infimum over a finite set
Informal description
For a finite set $s$ in a meet-semilattice $\alpha$ with a top element $\top$, and a function $f \colon \beta \to \alpha$, the infimum $\inf_{a \in s} f(a)$ is defined as the finite fold of the meet operation $\sqcap$ over $s$ with initial value $\top$. More concretely, for $s = \{a_1, \dots, a_n\}$, we have $\inf_{a \in s} f(a) = f(a_1) \sqcap \cdots \sqcap f(a_n)$ (with the empty infimum being $\top$).
Finset.inf_def theorem
: s.inf f = (s.1.map f).inf
Full source
theorem inf_def : s.inf f = (s.1.map f).inf :=
  rfl
Infimum of Function over Finite Set Equals Infimum of Multiset Image
Informal description
For any finite set $s$ and function $f \colon \beta \to \alpha$ where $\alpha$ is a meet-semilattice with top element $\top$, the infimum of $f$ over $s$ is equal to the infimum of the multiset obtained by applying $f$ to the elements of $s$. That is, $\inf_{a \in s} f(a) = \inf (f \circ s)$ where $f \circ s$ denotes the multiset image of $s$ under $f$.
Finset.inf_empty theorem
: (∅ : Finset β).inf f = ⊤
Full source
@[simp]
theorem inf_empty : ( : Finset β).inf f =  :=
  fold_empty
Empty Infimum Equals Top Element
Informal description
For any function $f \colon \beta \to \alpha$ where $\alpha$ is a meet-semilattice with a top element $\top$, the infimum over the empty finset is equal to $\top$, i.e., $\inf_{a \in \emptyset} f(a) = \top$.
Finset.inf_cons theorem
{b : β} (h : b ∉ s) : (cons b s h).inf f = f b ⊓ s.inf f
Full source
@[simp]
theorem inf_cons {b : β} (h : b ∉ s) : (cons b s h).inf f = f b ⊓ s.inf f :=
  @sup_cons αᵒᵈ _ _ _ _ _ _ h
Infimum of Function over Finite Set with Insertion: $\inf(\text{cons}(b, s, h), f) = f(b) \sqcap \inf(s, f)$
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $\beta$ be a type. Given a finite set $s \subseteq \beta$, a function $f : \beta \to \alpha$, and an element $b \in \beta$ such that $b \notin s$, the infimum of $f$ over the set obtained by inserting $b$ into $s$ is equal to the meet of $f(b)$ and the infimum of $f$ over $s$. That is, \[ \inf_{x \in \text{cons}(b, s, h)} f(x) = f(b) \sqcap \inf_{x \in s} f(x), \] where $\text{cons}(b, s, h)$ denotes the insertion of $b$ into $s$ under the assumption $h : b \notin s$.
Finset.inf_insert theorem
[DecidableEq β] {b : β} : (insert b s : Finset β).inf f = f b ⊓ s.inf f
Full source
@[simp]
theorem inf_insert [DecidableEq β] {b : β} : (insert b s : Finset β).inf f = f b ⊓ s.inf f :=
  fold_insert_idem
Infimum over Insertion: $\inf_{a \in s \cup \{b\}} f(a) = f(b) \sqcap \inf_{a \in s} f(a)$
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $\beta$ be a type with decidable equality. For any finite set $s \subseteq \beta$, any function $f \colon \beta \to \alpha$, and any element $b \in \beta$, the infimum over the set obtained by inserting $b$ into $s$ satisfies: \[ \inf_{a \in \text{insert } b \text{ } s} f(a) = f(b) \sqcap \left( \inf_{a \in s} f(a) \right) \]
Finset.inf_image theorem
[DecidableEq β] (s : Finset γ) (f : γ → β) (g : β → α) : (s.image f).inf g = s.inf (g ∘ f)
Full source
@[simp]
theorem inf_image [DecidableEq β] (s : Finset γ) (f : γ → β) (g : β → α) :
    (s.image f).inf g = s.inf (g ∘ f) :=
  fold_image_idem
Infimum over Image Equals Infimum over Preimage
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $\beta$ and $\gamma$ be types with decidable equality on $\beta$. For any finite set $s \subseteq \gamma$, any function $f \colon \gamma \to \beta$, and any function $g \colon \beta \to \alpha$, the infimum of $g$ over the image of $s$ under $f$ is equal to the infimum of $g \circ f$ over $s$. In symbols: \[ \inf_{b \in f(s)} g(b) = \inf_{c \in s} g(f(c)). \]
Finset.inf_map theorem
(s : Finset γ) (f : γ ↪ β) (g : β → α) : (s.map f).inf g = s.inf (g ∘ f)
Full source
@[simp]
theorem inf_map (s : Finset γ) (f : γ ↪ β) (g : β → α) : (s.map f).inf g = s.inf (g ∘ f) :=
  fold_map
Infimum Preservation under Injective Mapping of Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a finite set of elements of type $\gamma$. For any injective function $f \colon \gamma \hookrightarrow \beta$ and any function $g \colon \beta \to \alpha$, the infimum of $g$ over the image of $s$ under $f$ is equal to the infimum of $g \circ f$ over $s$. In other words, \[ \inf_{b \in f(s)} g(b) = \inf_{c \in s} g(f(c)). \]
Finset.inf_singleton theorem
{b : β} : ({ b } : Finset β).inf f = f b
Full source
@[simp]
theorem inf_singleton {b : β} : ({b} : Finset β).inf f = f b :=
  Multiset.inf_singleton
Infimum over Singleton Finset is Function Value
Informal description
For any element $b$ in a type $\beta$ and any function $f \colon \beta \to \alpha$, where $\alpha$ is a meet-semilattice with a top element $\top$, the infimum of $f$ over the singleton finset $\{b\}$ is equal to $f(b)$. In other words, \[ \inf_{a \in \{b\}} f(a) = f(b). \]
Finset.inf_inf theorem
: s.inf (f ⊓ g) = s.inf f ⊓ s.inf g
Full source
theorem inf_inf : s.inf (f ⊓ g) = s.inf f ⊓ s.inf g :=
  @sup_sup αᵒᵈ _ _ _ _ _ _
Infimum of Pointwise Meet Equals Meet of Infima over Finite Set
Informal description
For any finite set $s$ of elements of type $\beta$ and any two functions $f, g : \beta \to \alpha$, where $\alpha$ is a meet-semilattice with a top element, the infimum of the pointwise meet $f \sqcap g$ over $s$ is equal to the meet of the infima of $f$ and $g$ over $s$, i.e., \[ \inf_{x \in s} (f(x) \sqcap g(x)) = \left(\inf_{x \in s} f(x)\right) \sqcap \left(\inf_{x \in s} g(x)\right). \]
Finset.inf_congr theorem
{f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) : s₁.inf f = s₂.inf g
Full source
theorem inf_congr {f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) :
    s₁.inf f = s₂.inf g := by
  subst hs
  exact Finset.fold_congr hfg
Congruence of Infima over Equal Sets with Pointwise Equal Functions
Informal description
Let $s₁$ and $s₂$ be two finite sets of type $\beta$, and let $f, g : \beta \to \alpha$ be functions into a meet-semilattice $\alpha$ with a top element. If $s₁ = s₂$ and for every element $a \in s₂$ we have $f(a) = g(a)$, then the infimum of $f$ over $s₁$ equals the infimum of $g$ over $s₂$, i.e., \[ \inf_{a \in s₁} f(a) = \inf_{a \in s₂} g(a). \]
map_finset_inf theorem
[SemilatticeInf β] [OrderTop β] [FunLike F α β] [InfTopHomClass F α β] (f : F) (s : Finset ι) (g : ι → α) : f (s.inf g) = s.inf (f ∘ g)
Full source
@[simp]
theorem _root_.map_finset_inf [SemilatticeInf β] [OrderTop β]
    [FunLike F α β] [InfTopHomClass F α β]
    (f : F) (s : Finset ι) (g : ι → α) : f (s.inf g) = s.inf (f ∘ g) :=
  Finset.cons_induction_on s (map_top f) fun i s _ h => by
    rw [inf_cons, inf_cons, map_inf, h, Function.comp_apply]
Infimum-Preserving Homomorphism Commutes with Finite Infima
Informal description
Let $\alpha$ and $\beta$ be meet-semilattices with top elements, and let $F$ be a type of infimum-preserving and top-preserving homomorphisms from $\alpha$ to $\beta$. For any finite set $s$ indexed by $\iota$ and any function $g \colon \iota \to \alpha$, the homomorphism $f \in F$ satisfies: \[ f\left(\inf_{i \in s} g(i)\right) = \inf_{i \in s} (f \circ g)(i). \]
Finset.le_inf_iff theorem
{a : α} : a ≤ s.inf f ↔ ∀ b ∈ s, a ≤ f b
Full source
@[simp] protected theorem le_inf_iff {a : α} : a ≤ s.inf f ↔ ∀ b ∈ s, a ≤ f b :=
  @Finset.sup_le_iff αᵒᵈ _ _ _ _ _ _
Characterization of Lower Bounds of Finite Infima: $a \leq \inf_s f \leftrightarrow \forall b \in s, a \leq f(b)$
Informal description
Let $s$ be a finite set of elements of type $\beta$, and let $f \colon \beta \to \alpha$ be a function where $\alpha$ is a meet-semilattice with a top element $\top$. For any element $a \in \alpha$, we have \[ a \leq \inf_{b \in s} f(b) \leftrightarrow \forall b \in s, a \leq f(b). \]
Finset.le_inf_const_le theorem
: a ≤ s.inf fun _ => a
Full source
theorem le_inf_const_le : a ≤ s.inf fun _ => a :=
  Finset.le_inf fun _ _ => le_rfl
Element is Less Than or Equal to Infimum of Constant Function on Finite Set
Informal description
For any element $a$ in a meet-semilattice $\alpha$ with a top element $\top$, and for any finite set $s$, the infimum of the constant function $\lambda \_, a$ over $s$ satisfies $a \leq \inf_{b \in s} a$.
Finset.inf_le theorem
{b : β} (hb : b ∈ s) : s.inf f ≤ f b
Full source
theorem inf_le {b : β} (hb : b ∈ s) : s.inf f ≤ f b :=
  Finset.le_inf_iff.1 le_rfl _ hb
Infimum is a Lower Bound for Finite Sets
Informal description
For any finite set $s$ in a meet-semilattice $\alpha$ with a top element $\top$, and any function $f \colon \beta \to \alpha$, if an element $b \in s$, then the infimum of $f$ over $s$ is less than or equal to $f(b)$, i.e., \[ \inf_{a \in s} f(a) \leq f(b). \]
Finset.isGLB_inf theorem
: IsGLB (f '' s) (s.inf f)
Full source
lemma isGLB_inf : IsGLB (f '' s) (s.inf f) := by
  simp +contextual [IsGLB, IsGreatest, upperBounds, lowerBounds, inf_le]
Infimum over a finite set is the greatest lower bound of its image
Informal description
Let $s$ be a finite set in a meet-semilattice $\alpha$ with a top element $\top$, and let $f \colon \beta \to \alpha$ be a function. Then the infimum $\inf_{a \in s} f(a)$ is the greatest lower bound of the image set $f(s) = \{f(a) \mid a \in s\}$ in $\alpha$.
Finset.isGLB_inf_id theorem
{s : Finset α} : IsGLB s (s.inf id)
Full source
lemma isGLB_inf_id {s : Finset α} : IsGLB s (s.inf id) := by simpa using isGLB_inf (f := id)
Infimum of Identity Function is Greatest Lower Bound of Finite Set
Informal description
For any finite set $s$ in a meet-semilattice $\alpha$ with a top element $\top$, the infimum of the identity function over $s$ is the greatest lower bound of $s$ itself. That is, $\inf_{a \in s} a$ is the greatest element less than or equal to every element of $s$.
Finset.inf_le_of_le theorem
{b : β} (hb : b ∈ s) (h : f b ≤ a) : s.inf f ≤ a
Full source
theorem inf_le_of_le {b : β} (hb : b ∈ s) (h : f b ≤ a) : s.inf f ≤ a := (inf_le hb).trans h
Infimum is Below Any Upper Bound of a Set Element
Informal description
For any finite set $s$ in a meet-semilattice $\alpha$ with a top element $\top$, any function $f \colon \beta \to \alpha$, and any element $b \in s$, if $f(b) \leq a$ for some $a \in \alpha$, then the infimum of $f$ over $s$ satisfies $\inf_{x \in s} f(x) \leq a$.
Finset.inf_union theorem
[DecidableEq β] : (s₁ ∪ s₂).inf f = s₁.inf f ⊓ s₂.inf f
Full source
theorem inf_union [DecidableEq β] : (s₁ ∪ s₂).inf f = s₁.inf f ⊓ s₂.inf f :=
  eq_of_forall_le_iff fun c ↦ by simp [or_imp, forall_and]
Infimum over Union of Finite Sets Equals Meet of Infima
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $\beta$ be a type with decidable equality. For any two finite sets $s_1, s_2 \subseteq \beta$ and any function $f \colon \beta \to \alpha$, the infimum of $f$ over the union $s_1 \cup s_2$ is equal to the meet of the infima of $f$ over $s_1$ and $s_2$ separately, i.e., \[ \inf_{a \in s_1 \cup s_2} f(a) = \left(\inf_{a \in s_1} f(a)\right) \sqcap \left(\inf_{a \in s_2} f(a)\right). \]
Finset.inf_const theorem
(h : s.Nonempty) (c : α) : (s.inf fun _ => c) = c
Full source
theorem inf_const (h : s.Nonempty) (c : α) : (s.inf fun _ => c) = c := @sup_const αᵒᵈ _ _ _ _ h _
Infimum of Constant Function over Nonempty Finite Set is Constant
Informal description
For any nonempty finite set $s$ in a meet-semilattice $\alpha$ with a top element $\top$, and for any constant $c \in \alpha$, the infimum of the constant function $\lambda \_, c$ over $s$ is equal to $c$.
Finset.inf_top theorem
(s : Finset β) : (s.inf fun _ => ⊤) = (⊤ : α)
Full source
@[simp] theorem inf_top (s : Finset β) : (s.inf fun _ => ) = ( : α) := @sup_bot αᵒᵈ _ _ _ _
Infimum of Top Function over Finite Set is Top
Informal description
For any finite set $s$ of elements of type $\beta$ and a meet-semilattice $\alpha$ with a top element $\top$, the infimum of the constant function $\lambda \_, \top$ over $s$ is equal to $\top$, i.e., \[ \inf_{x \in s} \top = \top. \]
Finset.inf_ite theorem
(p : β → Prop) [DecidablePred p] : (s.inf fun i ↦ ite (p i) (f i) (g i)) = (s.filter p).inf f ⊓ (s.filter fun i ↦ ¬p i).inf g
Full source
theorem inf_ite (p : β → Prop) [DecidablePred p] :
    (s.inf fun i ↦ ite (p i) (f i) (g i)) = (s.filter p).inf f ⊓ (s.filter fun i ↦ ¬ p i).inf g :=
  fold_ite _
Infimum of Conditional Function over Finite Set
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a finite set of elements of type $\beta$. For any predicate $p$ on $\beta$ (with decidable truth values) and functions $f, g \colon \beta \to \alpha$, the infimum over $s$ of the function that returns $f(i)$ if $p(i)$ holds and $g(i)$ otherwise is equal to the meet of the infimum of $f$ over the subset of $s$ where $p$ holds and the infimum of $g$ over the subset of $s$ where $p$ does not hold. In symbols: \[ \inf_{i \in s} \big(\text{if } p(i) \text{ then } f(i) \text{ else } g(i)\big) = \Big(\inf_{i \in s, p(i)} f(i)\Big) \sqcap \Big(\inf_{i \in s, \neg p(i)} g(i)\Big). \]
Finset.inf_mono_fun theorem
{g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.inf f ≤ s.inf g
Full source
@[gcongr]
theorem inf_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.inf f ≤ s.inf g :=
  Finset.le_inf fun b hb => le_trans (inf_le hb) (h b hb)
Monotonicity of Infimum with Respect to Pointwise Inequality
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a finite set of elements of type $\beta$. For any functions $f, g \colon \beta \to \alpha$ such that $f(b) \leq g(b)$ for all $b \in s$, the infimum of $f$ over $s$ is less than or equal to the infimum of $g$ over $s$, i.e., \[ \inf_{b \in s} f(b) \leq \inf_{b \in s} g(b). \]
Finset.inf_mono theorem
(h : s₁ ⊆ s₂) : s₂.inf f ≤ s₁.inf f
Full source
@[gcongr]
theorem inf_mono (h : s₁ ⊆ s₂) : s₂.inf f ≤ s₁.inf f :=
  Finset.le_inf (fun _ hb => inf_le (h hb))
Monotonicity of Infimum under Finite Set Inclusion
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s_1$ and $s_2$ be finite sets of elements of type $\beta$ such that $s_1 \subseteq s_2$. For any function $f \colon \beta \to \alpha$, the infimum of $f$ over $s_2$ is less than or equal to the infimum of $f$ over $s_1$, i.e., \[ \inf_{b \in s_2} f(b) \leq \inf_{b \in s_1} f(b). \]
Finset.inf_comm theorem
(s : Finset β) (t : Finset γ) (f : β → γ → α) : (s.inf fun b => t.inf (f b)) = t.inf fun c => s.inf fun b => f b c
Full source
protected theorem inf_comm (s : Finset β) (t : Finset γ) (f : β → γ → α) :
    (s.inf fun b => t.inf (f b)) = t.inf fun c => s.inf fun b => f b c :=
  @Finset.sup_comm αᵒᵈ _ _ _ _ _ _ _
Commutativity of Double Infimum over Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $\beta$ and $\gamma$ be arbitrary types. For any finite sets $s \subseteq \beta$ and $t \subseteq \gamma$, and any function $f : \beta \to \gamma \to \alpha$, the following equality holds: \[ \inf_{b \in s} \inf_{c \in t} f(b, c) = \inf_{c \in t} \inf_{b \in s} f(b, c) \]
Finset.inf_attach theorem
(s : Finset β) (f : β → α) : (s.attach.inf fun x => f x) = s.inf f
Full source
theorem inf_attach (s : Finset β) (f : β → α) : (s.attach.inf fun x => f x) = s.inf f :=
  @sup_attach αᵒᵈ _ _ _ _ _
Infimum Preservation under Subtype Attachment
Informal description
For any finite set $s$ of elements of type $\beta$ and any function $f : \beta \to \alpha$ where $\alpha$ is a meet-semilattice with a top element $\top$, the infimum of $f$ over the elements of $s$ is equal to the infimum of $f$ over the attached subtype of $s$. That is, \[ \inf_{x \in s.\text{attach}} f(x) = \inf_{x \in s} f(x). \]
Finset.inf_erase_top theorem
[DecidableEq α] (s : Finset α) : (s.erase ⊤).inf id = s.inf id
Full source
@[simp]
theorem inf_erase_top [DecidableEq α] (s : Finset α) : (s.erase ).inf id = s.inf id :=
  @sup_erase_bot αᵒᵈ _ _ _ _
Infimum Unaffected by Removal of Top Element: $\inf (s \setminus \{\top\}) = \inf s$
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$ and decidable equality. For any finite set $s \subseteq \alpha$, the infimum of $s$ with $\top$ removed is equal to the infimum of $s$, i.e., \[ \inf (s \setminus \{\top\}) = \inf s. \]
Finset.comp_inf_eq_inf_comp theorem
[SemilatticeInf γ] [OrderTop γ] {s : Finset β} {f : β → α} (g : α → γ) (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) (top : g ⊤ = ⊤) : g (s.inf f) = s.inf (g ∘ f)
Full source
theorem comp_inf_eq_inf_comp [SemilatticeInf γ] [OrderTop γ] {s : Finset β} {f : β → α} (g : α → γ)
    (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) (top : g  = ) : g (s.inf f) = s.inf (g ∘ f) :=
  @comp_sup_eq_sup_comp αᵒᵈ _ γᵒᵈ _ _ _ _ _ _ _ g_inf top
Infimum Preservation under Function Composition: $g(\inf f) = \inf (g \circ f)$
Informal description
Let $\alpha$ and $\gamma$ be meet-semilattices with top elements $\top_\alpha$ and $\top_\gamma$ respectively. Given a finite set $s \subseteq \beta$, a function $f : \beta \to \alpha$, and a function $g : \alpha \to \gamma$ such that: 1. $g$ preserves infima: $g(x \sqcap y) = g(x) \sqcap g(y)$ for all $x, y \in \alpha$, 2. $g$ preserves the top element: $g(\top_\alpha) = \top_\gamma$, then the image under $g$ of the infimum of $f$ over $s$ is equal to the infimum of $g \circ f$ over $s$, i.e., \[ g\left(\inf_{x \in s} f(x)\right) = \inf_{x \in s} g(f(x)). \]
Finset.inf_coe theorem
{P : α → Prop} {Ptop : P ⊤} {Pinf : ∀ ⦃x y⦄, P x → P y → P (x ⊓ y)} (t : Finset β) (f : β → { x : α // P x }) : (@inf { x // P x } _ (Subtype.semilatticeInf Pinf) (Subtype.orderTop Ptop) t f : α) = t.inf fun x => ↑(f x)
Full source
/-- Computing `inf` in a subtype (closed under `inf`) is the same as computing it in `α`. -/
theorem inf_coe {P : α → Prop} {Ptop : P } {Pinf : ∀ ⦃x y⦄, P x → P y → P (x ⊓ y)} (t : Finset β)
    (f : β → { x : α // P x }) :
    (@inf { x // P x } _ (Subtype.semilatticeInf Pinf) (Subtype.orderTop Ptop) t f : α) =
      t.inf fun x => ↑(f x) :=
  @sup_coe αᵒᵈ _ _ _ _ Ptop Pinf t f
Subtype Infimum Equals Underlying Infimum for Closed Predicates
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $P : \alpha \to \text{Prop}$ be a predicate on $\alpha$ such that: 1. $P(\top)$ holds, 2. For any $x, y \in \alpha$, if $P(x)$ and $P(y)$ hold, then $P(x \sqcap y)$ holds. Given a finite set $t$ of elements of type $\beta$ and a function $f : \beta \to \{x \in \alpha \mid P(x)\}$, the infimum of $f$ over $t$ in the subtype $\{x \in \alpha \mid P(x)\}$ (with the induced meet-semilattice and order top structures) is equal to the infimum of the underlying elements $\uparrow(f(x))$ over $t$ in $\alpha$. That is, \[ \left(\inf_{x \in t} f(x)\right) = \inf_{x \in t} \uparrow(f(x)). \]
List.foldr_inf_eq_inf_toFinset theorem
[DecidableEq α] (l : List α) : l.foldr (· ⊓ ·) ⊤ = l.toFinset.inf id
Full source
theorem _root_.List.foldr_inf_eq_inf_toFinset [DecidableEq α] (l : List α) :
    l.foldr (· ⊓ ·)  = l.toFinset.inf id := by
  rw [← coe_fold_r, ← Multiset.fold_dedup_idem, inf_def, ← List.toFinset_coe, toFinset_val,
    Multiset.map_id]
  rfl
Equality of List Right Fold and Finset Infimum
Informal description
For any list $l$ of elements in a meet-semilattice $\alpha$ with a top element $\top$ and decidable equality, the right fold of the meet operation $\sqcap$ over $l$ with initial value $\top$ is equal to the infimum of the function $\mathrm{id}$ over the finset obtained from $l$. That is, $$ \mathrm{foldr}\ (\sqcap)\ \top\ l = \inf_{a \in \mathrm{toFinset}\ l} a. $$
Finset.inf_induction theorem
{p : α → Prop} (ht : p ⊤) (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊓ a₂)) (hs : ∀ b ∈ s, p (f b)) : p (s.inf f)
Full source
theorem inf_induction {p : α → Prop} (ht : p ) (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊓ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.inf f) :=
  @sup_induction αᵒᵈ _ _ _ _ _ _ ht hp hs
Induction Principle for Infimum over Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a finite set with elements of type $\beta$. Given a predicate $p : \alpha \to \mathrm{Prop}$ such that: 1. $p(\top)$ holds, 2. For any $a_1, a_2 \in \alpha$, if $p(a_1)$ and $p(a_2)$ hold, then $p(a_1 \sqcap a_2)$ holds, 3. For every $b \in s$, $p(f(b))$ holds, then $p(\inf_{b \in s} f(b))$ holds.
Finset.inf_mem theorem
(s : Set α) (w₁ : ⊤ ∈ s) (w₂ : ∀ᵉ (x ∈ s) (y ∈ s), x ⊓ y ∈ s) {ι : Type*} (t : Finset ι) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.inf p ∈ s
Full source
theorem inf_mem (s : Set α) (w₁ : ⊤ ∈ s) (w₂ : ∀ᵉ (x ∈ s) (y ∈ s), x ⊓ y ∈ s)
    {ι : Type*} (t : Finset ι) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.inf p ∈ s :=
  @inf_induction _ _ _ _ _ _ (· ∈ s) w₁ w₂ h
Closure of Infimum in Meet-Closed Set Containing Top
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s \subseteq \alpha$ be a subset satisfying: 1. $\top \in s$, 2. For any $x, y \in s$, their meet $x \sqcap y$ also belongs to $s$. For any finite set $t$ indexed by type $\iota$ and any function $p \colon \iota \to \alpha$ such that $p(i) \in s$ for all $i \in t$, the infimum $\inf_{i \in t} p(i)$ belongs to $s$.
Finset.inf_eq_top_iff theorem
(f : β → α) (S : Finset β) : S.inf f = ⊤ ↔ ∀ s ∈ S, f s = ⊤
Full source
@[simp]
protected theorem inf_eq_top_iff (f : β → α) (S : Finset β) : S.inf f = ⊤ ↔ ∀ s ∈ S, f s = ⊤ :=
  @Finset.sup_eq_bot_iff αᵒᵈ _ _ _ _ _
Infimum Equals Top if and only if All Elements Map to Top
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, $\beta$ be any type, $f : \beta \to \alpha$ a function, and $S$ a finite subset of $\beta$. Then the infimum of $f$ over $S$ equals $\top$ if and only if $f(s) = \top$ for every $s \in S$. In symbols: \[ \inf_{s \in S} f(s) = \top \leftrightarrow \forall s \in S, f(s) = \top. \]
Finset.inf_disjSum theorem
(s : Finset β) (t : Finset γ) (f : β ⊕ γ → α) : (s.disjSum t).inf f = (s.inf fun x ↦ f (.inl x)) ⊓ (t.inf fun x ↦ f (.inr x))
Full source
@[simp]
lemma inf_disjSum (s : Finset β) (t : Finset γ) (f : β ⊕ γ → α) :
    (s.disjSum t).inf f = (s.inf fun x ↦ f (.inl x)) ⊓ (t.inf fun x ↦ f (.inr x)) :=
  congr(fold _ $(top_inf_eq _ |>.symm) _ _).trans (fold_disjSum _ _ _ _ _ _)
Infimum over Disjoint Union Decomposes as Meet of Infima
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, $\beta$ and $\gamma$ be types, $s$ be a finite set of elements in $\beta$, $t$ be a finite set of elements in $\gamma$, and $f \colon \beta \oplus \gamma \to \alpha$ be a function. Then the infimum of $f$ over the disjoint union $s \sqcup t$ equals the meet of the infimum of $f$ over $s$ (via left injections) and the infimum of $f$ over $t$ (via right injections). In symbols: $$ \inf_{x \in s \sqcup t} f(x) = \left(\inf_{x \in s} f(\iota_1(x))\right) \sqcap \left(\inf_{x \in t} f(\iota_2(x))\right) $$ where $\iota_1 \colon \beta \to \beta \oplus \gamma$ and $\iota_2 \colon \gamma \to \beta \oplus \gamma$ are the canonical injections.
Finset.inf_dite_pos_le theorem
(p : β → Prop) [DecidablePred p] {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : p b) : (s.inf fun i ↦ if h : p i then f i h else g i h) ≤ f b h₁
Full source
theorem inf_dite_pos_le (p : β → Prop) [DecidablePred p]
    {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : p b) :
    (s.inf fun i ↦ if h : p i then f i h else g i h) ≤ f b h₁ := by
  have : f b h₁ = (fun i ↦ if h : p i then f i h else g i h) b := by simp [h₁]
  rw [this]
  apply inf_le h₀
Infimum of Conditional Function is Bounded by Positive Case
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, $\beta$ be a type, $p : \beta \to \text{Prop}$ be a decidable predicate, and $f : (b : \beta) \to p(b) \to \alpha$ and $g : (b : \beta) \to \neg p(b) \to \alpha$ be functions. For any finite set $s \subseteq \beta$ and any element $b \in s$ such that $p(b)$ holds, the infimum over $s$ of the function defined by cases (using $f$ when $p$ holds and $g$ otherwise) is less than or equal to $f(b)$. In symbols: \[ \inf_{i \in s} \left( \text{if } h : p(i) \text{ then } f(i)(h) \text{ else } g(i)(h) \right) \leq f(b)(h_1) \] where $h_1$ is the proof that $p(b)$ holds.
Finset.inf_dite_neg_le theorem
(p : β → Prop) [DecidablePred p] {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : ¬p b) : (s.inf fun i ↦ if h : p i then f i h else g i h) ≤ g b h₁
Full source
theorem inf_dite_neg_le (p : β → Prop) [DecidablePred p]
    {f : (b : β) → p b → α} {g : (b : β) → ¬p b → α} {b : β} (h₀ : b ∈ s) (h₁ : ¬p b) :
    (s.inf fun i ↦ if h : p i then f i h else g i h) ≤ g b h₁ := by
  have : g b h₁ = (fun i ↦ if h : p i then f i h else g i h) b := by simp [h₁]
  rw [this]
  apply inf_le h₀
Infimum of piecewise function bounds negative case
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, $s$ be a finite set of elements of type $\beta$, and $p$ be a decidable predicate on $\beta$. For any functions $f \colon \{b \in \beta \mid p b\} \to \alpha$ and $g \colon \{b \in \beta \mid \neg p b\} \to \alpha$, if $b \in s$ and $\neg p b$ holds, then the infimum of the piecewise-defined function \[ i \mapsto \begin{cases} f i & \text{if } p i \\ g i & \text{otherwise} \end{cases} \] over $s$ is less than or equal to $g b$.
Finset.toDual_sup theorem
[SemilatticeSup α] [OrderBot α] (s : Finset β) (f : β → α) : toDual (s.sup f) = s.inf (toDual ∘ f)
Full source
@[simp]
theorem toDual_sup [SemilatticeSup α] [OrderBot α] (s : Finset β) (f : β → α) :
    toDual (s.sup f) = s.inf (toDualtoDual ∘ f) :=
  rfl
Order Dual of Supremum Equals Infimum of Order Duals
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a finite set of elements of type $\beta$. For any function $f : \beta \to \alpha$, the order dual of the supremum $\sup_{b \in s} f(b)$ is equal to the infimum $\inf_{b \in s} f^{\text{op}}(b)$, where $f^{\text{op}} = \text{toDual} \circ f$ is the function $f$ composed with the order dual map. In other words, $\text{toDual}(\sup_{b \in s} f(b)) = \inf_{b \in s} \text{toDual}(f(b))$.
Finset.toDual_inf theorem
[SemilatticeInf α] [OrderTop α] (s : Finset β) (f : β → α) : toDual (s.inf f) = s.sup (toDual ∘ f)
Full source
@[simp]
theorem toDual_inf [SemilatticeInf α] [OrderTop α] (s : Finset β) (f : β → α) :
    toDual (s.inf f) = s.sup (toDualtoDual ∘ f) :=
  rfl
Duality between Infimum and Supremum under Order Dual
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a finite set of elements of type $\beta$. For any function $f \colon \beta \to \alpha$, the order dual of the infimum of $f$ over $s$ is equal to the supremum of the order dual of $f$ over $s$. In symbols: \[ \text{toDual}\left(\inf_{a \in s} f(a)\right) = \sup_{a \in s} \text{toDual}(f(a)). \]
Finset.ofDual_sup theorem
[SemilatticeInf α] [OrderTop α] (s : Finset β) (f : β → αᵒᵈ) : ofDual (s.sup f) = s.inf (ofDual ∘ f)
Full source
@[simp]
theorem ofDual_sup [SemilatticeInf α] [OrderTop α] (s : Finset β) (f : β → αᵒᵈ) :
    ofDual (s.sup f) = s.inf (ofDualofDual ∘ f) :=
  rfl
Duality between supremum in order dual and infimum in original order
Informal description
Let $\alpha$ be a meet-semilattice with a greatest element $\top$, and let $s$ be a finite set of elements of type $\beta$. For any function $f \colon \beta \to \alpha^{\text{op}}$ (where $\alpha^{\text{op}}$ is the order dual of $\alpha$), the following equality holds: \[ \text{ofDual}(\sup_{x \in s} f(x)) = \inf_{x \in s} (\text{ofDual} \circ f)(x) \] where $\text{ofDual} \colon \alpha^{\text{op}} \to \alpha$ is the canonical equivalence mapping elements back from the dual order to the original order.
Finset.ofDual_inf theorem
[SemilatticeSup α] [OrderBot α] (s : Finset β) (f : β → αᵒᵈ) : ofDual (s.inf f) = s.sup (ofDual ∘ f)
Full source
@[simp]
theorem ofDual_inf [SemilatticeSup α] [OrderBot α] (s : Finset β) (f : β → αᵒᵈ) :
    ofDual (s.inf f) = s.sup (ofDualofDual ∘ f) :=
  rfl
Duality between Infimum and Supremum under Order Dual Map
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a finite set of elements of type $\beta$. For any function $f \colon \beta \to \alpha^{\text{op}}$, the image of the infimum of $f$ over $s$ under the order dual map $\text{ofDual} \colon \alpha^{\text{op}} \to \alpha$ is equal to the supremum of $\text{ofDual} \circ f$ over $s$. In symbols: \[ \text{ofDual}\left(\inf_{x \in s} f(x)\right) = \sup_{x \in s} \text{ofDual}(f(x)). \]
Finset.sup_inf_distrib_left theorem
(s : Finset ι) (f : ι → α) (a : α) : a ⊓ s.sup f = s.sup fun i => a ⊓ f i
Full source
theorem sup_inf_distrib_left (s : Finset ι) (f : ι → α) (a : α) :
    a ⊓ s.sup f = s.sup fun i => a ⊓ f i := by
  induction s using Finset.cons_induction with
  | empty => simp_rw [Finset.sup_empty, inf_bot_eq]
  | cons _ _ _ h => rw [sup_cons, sup_cons, inf_sup_left, h]
Left Distributivity of Meet over Supremum in Finite Sets: $a \sqcap \sup_{i \in s} f(i) = \sup_{i \in s} (a \sqcap f(i))$
Informal description
Let $\alpha$ be a distributive lattice with a bottom element, and let $s$ be a finite set of elements of type $\iota$. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$, the meet of $a$ with the supremum of $f$ over $s$ is equal to the supremum over $s$ of the meets of $a$ with $f(i)$ for each $i \in s$. In symbols: \[ a \sqcap \left( \sup_{i \in s} f(i) \right) = \sup_{i \in s} (a \sqcap f(i)). \]
Finset.sup_inf_distrib_right theorem
(s : Finset ι) (f : ι → α) (a : α) : s.sup f ⊓ a = s.sup fun i => f i ⊓ a
Full source
theorem sup_inf_distrib_right (s : Finset ι) (f : ι → α) (a : α) :
    s.sup f ⊓ a = s.sup fun i => f i ⊓ a := by
  rw [_root_.inf_comm, s.sup_inf_distrib_left]
  simp_rw [_root_.inf_comm]
Right Distributivity of Meet over Supremum in Finite Sets: $\left( \sup_{i \in s} f(i) \right) \sqcap a = \sup_{i \in s} (f(i) \sqcap a)$
Informal description
Let $\alpha$ be a distributive lattice with a bottom element, and let $s$ be a finite set of elements of type $\iota$. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$, the meet of the supremum of $f$ over $s$ with $a$ is equal to the supremum over $s$ of the meets of $f(i)$ with $a$ for each $i \in s$. In symbols: \[ \left( \sup_{i \in s} f(i) \right) \sqcap a = \sup_{i \in s} (f(i) \sqcap a). \]
Finset.disjoint_sup_right theorem
: Disjoint a (s.sup f) ↔ ∀ ⦃i⦄, i ∈ s → Disjoint a (f i)
Full source
protected theorem disjoint_sup_right : DisjointDisjoint a (s.sup f) ↔ ∀ ⦃i⦄, i ∈ s → Disjoint a (f i) := by
  simp only [disjoint_iff, sup_inf_distrib_left, Finset.sup_eq_bot_iff]
Disjointness Criterion for Supremum over Finite Sets: $a \sqcap \sup_{i \in s} f(i) = \bot \leftrightarrow \forall i \in s, a \sqcap f(i) = \bot$
Informal description
Let $\alpha$ be a distributive lattice with a bottom element, and let $s$ be a finite set of elements of type $\iota$. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$, the element $a$ is disjoint from the supremum of $f$ over $s$ if and only if $a$ is disjoint from $f(i)$ for every $i \in s$. In symbols: \[ a \sqcap \left( \sup_{i \in s} f(i) \right) = \bot \leftrightarrow \forall i \in s, a \sqcap f(i) = \bot. \]
Finset.disjoint_sup_left theorem
: Disjoint (s.sup f) a ↔ ∀ ⦃i⦄, i ∈ s → Disjoint (f i) a
Full source
protected theorem disjoint_sup_left : DisjointDisjoint (s.sup f) a ↔ ∀ ⦃i⦄, i ∈ s → Disjoint (f i) a := by
  simp only [disjoint_iff, sup_inf_distrib_right, Finset.sup_eq_bot_iff]
Disjointness Criterion for Supremum over Finite Sets: $\sup_{i \in s} f(i) \sqcap a = \bot \leftrightarrow \forall i \in s, f(i) \sqcap a = \bot$
Informal description
Let $\alpha$ be a distributive lattice with a bottom element $\bot$, and let $s$ be a finite set of elements of type $\iota$. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$, the supremum of $f$ over $s$ is disjoint from $a$ if and only if $f(i)$ is disjoint from $a$ for every $i \in s$. In symbols: \[ \left( \sup_{i \in s} f(i) \right) \sqcap a = \bot \leftrightarrow \forall i \in s, f(i) \sqcap a = \bot. \]
Finset.inf_sup_distrib_left theorem
(s : Finset ι) (f : ι → α) (a : α) : a ⊔ s.inf f = s.inf fun i => a ⊔ f i
Full source
theorem inf_sup_distrib_left (s : Finset ι) (f : ι → α) (a : α) :
    a ⊔ s.inf f = s.inf fun i => a ⊔ f i :=
  @sup_inf_distrib_left αᵒᵈ _ _ _ _ _ _
Left Distributivity of Join over Infimum in Finite Sets: $a \sqcup \inf_{i \in s} f(i) = \inf_{i \in s} (a \sqcup f(i))$
Informal description
Let $\alpha$ be a distributive lattice with a top element, and let $s$ be a finite set of elements of type $\iota$. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$, the join of $a$ with the infimum of $f$ over $s$ is equal to the infimum over $s$ of the joins of $a$ with $f(i)$ for each $i \in s$. In symbols: \[ a \sqcup \left( \inf_{i \in s} f(i) \right) = \inf_{i \in s} (a \sqcup f(i)). \]
Finset.inf_sup_distrib_right theorem
(s : Finset ι) (f : ι → α) (a : α) : s.inf f ⊔ a = s.inf fun i => f i ⊔ a
Full source
theorem inf_sup_distrib_right (s : Finset ι) (f : ι → α) (a : α) :
    s.inf f ⊔ a = s.inf fun i => f i ⊔ a :=
  @sup_inf_distrib_right αᵒᵈ _ _ _ _ _ _
Right Distributivity of Join over Infimum in Finite Sets: $\left( \inf_{i \in s} f(i) \right) \sqcup a = \inf_{i \in s} (f(i) \sqcup a)$
Informal description
Let $\alpha$ be a distributive lattice with a top element, and let $s$ be a finite set of elements of type $\iota$. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$, the join of the infimum of $f$ over $s$ with $a$ is equal to the infimum over $s$ of the joins of $f(i)$ with $a$ for each $i \in s$. In symbols: \[ \left( \inf_{i \in s} f(i) \right) \sqcup a = \inf_{i \in s} (f(i) \sqcup a). \]
Finset.codisjoint_inf_right theorem
: Codisjoint a (s.inf f) ↔ ∀ ⦃i⦄, i ∈ s → Codisjoint a (f i)
Full source
protected theorem codisjoint_inf_right :
    CodisjointCodisjoint a (s.inf f) ↔ ∀ ⦃i⦄, i ∈ s → Codisjoint a (f i) :=
  @Finset.disjoint_sup_right αᵒᵈ _ _ _ _ _ _
Codisjointness Criterion for Infimum over Finite Sets: $a \sqcup \inf_{i \in s} f(i) = \top \leftrightarrow \forall i \in s, a \sqcup f(i) = \top$
Informal description
Let $\alpha$ be a distributive lattice with a top element $\top$, $s$ be a finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the element $a$ is codisjoint with the infimum of $f$ over $s$ if and only if $a$ is codisjoint with $f(i)$ for every $i \in s$. In symbols: \[ a \sqcup \left( \inf_{i \in s} f(i) \right) = \top \leftrightarrow \forall i \in s, a \sqcup f(i) = \top. \]
Finset.codisjoint_inf_left theorem
: Codisjoint (s.inf f) a ↔ ∀ ⦃i⦄, i ∈ s → Codisjoint (f i) a
Full source
protected theorem codisjoint_inf_left :
    CodisjointCodisjoint (s.inf f) a ↔ ∀ ⦃i⦄, i ∈ s → Codisjoint (f i) a :=
  @Finset.disjoint_sup_left αᵒᵈ _ _ _ _ _ _
Codisjointness Criterion for Infimum over Finite Sets: $\inf_{i \in s} f(i) \sqcup a = \top \leftrightarrow \forall i \in s, f(i) \sqcup a = \top$
Informal description
Let $\alpha$ be a distributive lattice with a top element $\top$, $s$ be a finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the infimum of $f$ over $s$ is codisjoint with $a$ if and only if $f(i)$ is codisjoint with $a$ for every $i \in s$. In symbols: \[ \left( \inf_{i \in s} f(i) \right) \sqcup a = \top \leftrightarrow \forall i \in s, f(i) \sqcup a = \top. \]
Finset.sup_sdiff_left theorem
(s : Finset ι) (f : ι → α) (a : α) : (s.sup fun b => a \ f b) = a \ s.inf f
Full source
theorem sup_sdiff_left (s : Finset ι) (f : ι → α) (a : α) :
    (s.sup fun b => a \ f b) = a \ s.inf f := by
  induction s using Finset.cons_induction with
  | empty => rw [sup_empty, inf_empty, sdiff_top]
  | cons _ _ _ h => rw [sup_cons, inf_cons, h, sdiff_inf]
Supremum of Differences Equals Difference of Infimum: $\sup_{b \in s} (a \setminus f(b)) = a \setminus \inf_{b \in s} f(b)$
Informal description
Let $\alpha$ be a Boolean algebra, $s$ be a finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the supremum of the set $\{a \setminus f(b) \mid b \in s\}$ equals $a$ minus the infimum of $f$ over $s$, i.e., \[ \sup_{b \in s} (a \setminus f(b)) = a \setminus \left(\inf_{b \in s} f(b)\right). \]
Finset.inf_sdiff_left theorem
(hs : s.Nonempty) (f : ι → α) (a : α) : (s.inf fun b => a \ f b) = a \ s.sup f
Full source
theorem inf_sdiff_left (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.inf fun b => a \ f b) = a \ s.sup f := by
  induction hs using Finset.Nonempty.cons_induction with
  | singleton => rw [sup_singleton, inf_singleton]
  | cons _ _ _ _ ih => rw [sup_cons, inf_cons, ih, sdiff_sup]
Infimum of Differences Equals Difference from Supremum: $\inf_{b \in s} (a \setminus f(b)) = a \setminus \sup_{b \in s} f(b)$
Informal description
Let $\alpha$ be a Boolean algebra, $s$ be a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the infimum of the set $\{a \setminus f(b) \mid b \in s\}$ equals $a$ minus the supremum of $f$ over $s$, i.e., \[ \inf_{b \in s} (a \setminus f(b)) = a \setminus \left(\sup_{b \in s} f(b)\right). \]
Finset.inf_sdiff_right theorem
(hs : s.Nonempty) (f : ι → α) (a : α) : (s.inf fun b => f b \ a) = s.inf f \ a
Full source
theorem inf_sdiff_right (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.inf fun b => f b \ a) = s.inf f \ a := by
  induction hs using Finset.Nonempty.cons_induction with
  | singleton => rw [inf_singleton, inf_singleton]
  | cons _ _ _ _ ih => rw [inf_cons, inf_cons, ih, inf_sdiff]
Infimum of Relative Complements Equals Relative Complement of Infimum: $\inf_{b \in s} (f(b) \setminus a) = (\inf_{b \in s} f(b)) \setminus a$
Informal description
Let $\alpha$ be a Boolean algebra, $s$ be a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the infimum of the set $\{f(b) \setminus a \mid b \in s\}$ equals the infimum of $f$ over $s$ minus $a$, i.e., \[ \inf_{b \in s} (f(b) \setminus a) = \left(\inf_{b \in s} f(b)\right) \setminus a. \]
Finset.inf_himp_right theorem
(s : Finset ι) (f : ι → α) (a : α) : (s.inf fun b => f b ⇨ a) = s.sup f ⇨ a
Full source
theorem inf_himp_right (s : Finset ι) (f : ι → α) (a : α) :
    (s.inf fun b => f b ⇨ a) = s.sup f ⇨ a :=
  @sup_sdiff_left αᵒᵈ _ _ _ _ _
Infimum of Heyting Implications Equals Implication from Supremum: $\inf_{b \in s} (f(b) \Rightarrow a) = (\sup_{b \in s} f(b)) \Rightarrow a$
Informal description
Let $\alpha$ be a Boolean algebra, $s$ be a finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the infimum of the set $\{f(b) \Rightarrow a \mid b \in s\}$ equals the Heyting implication from the supremum of $f$ over $s$ to $a$, i.e., \[ \inf_{b \in s} (f(b) \Rightarrow a) = \left(\sup_{b \in s} f(b)\right) \Rightarrow a. \]
Finset.sup_himp_right theorem
(hs : s.Nonempty) (f : ι → α) (a : α) : (s.sup fun b => f b ⇨ a) = s.inf f ⇨ a
Full source
theorem sup_himp_right (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.sup fun b => f b ⇨ a) = s.inf f ⇨ a :=
  @inf_sdiff_left αᵒᵈ _ _ _ hs _ _
Supremum of Heyting Implications Equals Implication from Infimum: $\sup_{b \in s} (f(b) \Rightarrow a) = (\inf_{b \in s} f(b)) \Rightarrow a$
Informal description
Let $\alpha$ be a Boolean algebra, $s$ be a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the supremum of the set $\{f(b) \Rightarrow a \mid b \in s\}$ equals the Heyting implication from the infimum of $f$ over $s$ to $a$, i.e., \[ \sup_{b \in s} (f(b) \Rightarrow a) = \left(\inf_{b \in s} f(b)\right) \Rightarrow a. \]
Finset.sup_himp_left theorem
(hs : s.Nonempty) (f : ι → α) (a : α) : (s.sup fun b => a ⇨ f b) = a ⇨ s.sup f
Full source
theorem sup_himp_left (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.sup fun b => a ⇨ f b) = a ⇨ s.sup f :=
  @inf_sdiff_right αᵒᵈ _ _ _ hs _ _
Supremum of Left Heyting Implications Equals Implication to Supremum: $\sup_{b \in s} (a \Rightarrow f(b)) = a \Rightarrow \sup_s f$
Informal description
Let $\alpha$ be a Boolean algebra, $s$ be a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. For any element $a \in \alpha$, the supremum of the set $\{a \Rightarrow f(b) \mid b \in s\}$ equals the Heyting implication from $a$ to the supremum of $f$ over $s$, i.e., \[ \sup_{b \in s} (a \Rightarrow f(b)) = a \Rightarrow \left(\sup_{b \in s} f(b)\right). \]
Finset.compl_sup theorem
(s : Finset ι) (f : ι → α) : (s.sup f)ᶜ = s.inf fun i => (f i)ᶜ
Full source
@[simp]
protected theorem compl_sup (s : Finset ι) (f : ι → α) : (s.sup f)ᶜ = s.inf fun i => (f i)ᶜ :=
  map_finset_sup (OrderIso.compl α) _ _
De Morgan's Law for Finite Suprema in Boolean Algebras: $(\sup_s f)^\complement = \inf_s f^\complement$
Informal description
For any finite set $s$ of elements of type $\iota$ and any function $f \colon \iota \to \alpha$ where $\alpha$ is a Boolean algebra, the complement of the supremum of $f$ over $s$ is equal to the infimum of the complements of $f$ over $s$. In symbols: \[ \left(\sup_{i \in s} f(i)\right)^\complement = \inf_{i \in s} f(i)^\complement. \]
Finset.compl_inf theorem
(s : Finset ι) (f : ι → α) : (s.inf f)ᶜ = s.sup fun i => (f i)ᶜ
Full source
@[simp]
protected theorem compl_inf (s : Finset ι) (f : ι → α) : (s.inf f)ᶜ = s.sup fun i => (f i)ᶜ :=
  map_finset_inf (OrderIso.compl α) _ _
De Morgan's Law for Finite Infima in Boolean Algebras: $(\inf_s f)^\complement = \sup_s f^\complement$
Informal description
For any finite set $s$ of elements of type $\iota$ and any function $f \colon \iota \to \alpha$ where $\alpha$ is a Boolean algebra, the complement of the infimum of $f$ over $s$ is equal to the supremum of the complements of $f$ over $s$. In symbols: \[ \left(\inf_{i \in s} f(i)\right)^\complement = \sup_{i \in s} f(i)^\complement. \]
Finset.comp_sup_eq_sup_comp_of_is_total theorem
[SemilatticeSup β] [OrderBot β] (g : α → β) (mono_g : Monotone g) (bot : g ⊥ = ⊥) : g (s.sup f) = s.sup (g ∘ f)
Full source
theorem comp_sup_eq_sup_comp_of_is_total [SemilatticeSup β] [OrderBot β] (g : α → β)
    (mono_g : Monotone g) (bot : g  = ) : g (s.sup f) = s.sup (g ∘ f) :=
  comp_sup_eq_sup_comp g mono_g.map_sup bot
Monotone Functions Preserve Finite Suprema: $g(\sup f) = \sup (g \circ f)$
Informal description
Let $\alpha$ and $\beta$ be join-semilattices with bottom elements $\bot_\alpha$ and $\bot_\beta$ respectively. Given a finite set $s \subseteq \iota$, a function $f : \iota \to \alpha$, and a monotone function $g : \alpha \to \beta$ such that $g(\bot_\alpha) = \bot_\beta$, then the image under $g$ of the supremum of $f$ over $s$ is equal to the supremum of $g \circ f$ over $s$, i.e., \[ g\left(\sup_{x \in s} f(x)\right) = \sup_{x \in s} g(f(x)). \]
Finset.le_sup_iff theorem
(ha : ⊥ < a) : a ≤ s.sup f ↔ ∃ b ∈ s, a ≤ f b
Full source
@[simp]
protected theorem le_sup_iff (ha :  < a) : a ≤ s.sup f ↔ ∃ b ∈ s, a ≤ f b := by
  apply Iff.intro
  · induction s using cons_induction with
    | empty => exact (absurd · (not_le_of_lt ha))
    | cons c t hc ih =>
      rw [sup_cons, le_sup_iff]
      exact fun
      | Or.inl h => ⟨c, mem_cons.2 (Or.inl rfl), h⟩
      | Or.inr h => let ⟨b, hb, hle⟩ := ih h; ⟨b, mem_cons.2 (Or.inr hb), hle⟩
  · exact fun ⟨b, hb, hle⟩ => le_trans hle (le_sup hb)
Characterization of Supremum in Finite Sets: $a \leq \sup_s f \leftrightarrow \exists b \in s, a \leq f(b)$ for $a > \bot$
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a finite set of elements of type $\beta$. For any function $f \colon \beta \to \alpha$ and any element $a \in \alpha$ such that $\bot < a$, we have \[ a \leq \sup_{x \in s} f(x) \quad \text{if and only if} \quad \exists b \in s, \ a \leq f(b). \]
Finset.sup_eq_top_iff theorem
{α : Type*} [LinearOrder α] [BoundedOrder α] [Nontrivial α] {s : Finset ι} {f : ι → α} : s.sup f = ⊤ ↔ ∃ b ∈ s, f b = ⊤
Full source
protected theorem sup_eq_top_iff {α : Type*} [LinearOrder α] [BoundedOrder α] [Nontrivial α]
    {s : Finset ι} {f : ι → α} : s.sup f = ⊤ ↔ ∃ b ∈ s, f b = ⊤ := by
  simp only [← top_le_iff]
  exact Finset.le_sup_iff bot_lt_top
Characterization of when a finite supremum equals the top element: $\sup_s f = \top \leftrightarrow \exists b \in s, f(b) = \top$
Informal description
Let $\alpha$ be a nontrivial linearly ordered set with a bounded order structure (having top and bottom elements $\top$ and $\bot$). For any finite set $s$ and any function $f \colon \iota \to \alpha$, the supremum of $f$ over $s$ equals $\top$ if and only if there exists an element $b \in s$ such that $f(b) = \top$.
Finset.Nonempty.sup_eq_top_iff theorem
{α : Type*} [LinearOrder α] [BoundedOrder α] {s : Finset ι} {f : ι → α} (hs : s.Nonempty) : s.sup f = ⊤ ↔ ∃ b ∈ s, f b = ⊤
Full source
protected theorem Nonempty.sup_eq_top_iff {α : Type*} [LinearOrder α] [BoundedOrder α]
    {s : Finset ι} {f : ι → α} (hs : s.Nonempty) : s.sup f = ⊤ ↔ ∃ b ∈ s, f b = ⊤ := by
  cases subsingleton_or_nontrivial α
  · simpa [Subsingleton.elim _ ( : α)]
  · exact Finset.sup_eq_top_iff
Nonempty Finite Supremum Equals Top iff Some Element Maps to Top
Informal description
Let $\alpha$ be a linearly ordered set with a bounded order structure (having top and bottom elements $\top$ and $\bot$). For any nonempty finite set $s$ and any function $f \colon \iota \to \alpha$, the supremum of $f$ over $s$ equals $\top$ if and only if there exists an element $b \in s$ such that $f(b) = \top$.
Finset.lt_sup_iff theorem
: a < s.sup f ↔ ∃ b ∈ s, a < f b
Full source
@[simp]
protected theorem lt_sup_iff : a < s.sup f ↔ ∃ b ∈ s, a < f b := by
  apply Iff.intro
  · induction s using cons_induction with
    | empty => exact (absurd · not_lt_bot)
    | cons c t hc ih =>
      rw [sup_cons, lt_sup_iff]
      exact fun
      | Or.inl h => ⟨c, mem_cons.2 (Or.inl rfl), h⟩
      | Or.inr h => let ⟨b, hb, hlt⟩ := ih h; ⟨b, mem_cons.2 (Or.inr hb), hlt⟩
  · exact fun ⟨b, hb, hlt⟩ => lt_of_lt_of_le hlt (le_sup hb)
Characterization of Strict Inequality Under Finite Supremum: $a < \sup_s f \leftrightarrow \exists b \in s, a < f(b)$
Informal description
For any element $a$ in a join-semilattice $\alpha$ with a bottom element $\bot$, and any finite set $s$ with a function $f : \beta \to \alpha$, the inequality $a < \sup_{x \in s} f(x)$ holds if and only if there exists an element $b \in s$ such that $a < f(b)$.
Finset.sup_lt_iff theorem
(ha : ⊥ < a) : s.sup f < a ↔ ∀ b ∈ s, f b < a
Full source
@[simp]
protected theorem sup_lt_iff (ha :  < a) : s.sup f < a ↔ ∀ b ∈ s, f b < a :=
  ⟨fun hs _ hb => lt_of_le_of_lt (le_sup hb) hs,
    Finset.cons_induction_on s (fun _ => ha) fun c t hc => by
      simpa only [sup_cons, sup_lt_iff, mem_cons, forall_eq_or_imp] using And.imp_right⟩
Supremum Strictly Less Than Criterion: $\sup_s f < a \leftrightarrow \forall b \in s, f(b) < a$
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, $s$ a finite set, and $f : \beta \to \alpha$ a function. For any element $a \in \alpha$ such that $\bot < a$, the supremum of $f$ over $s$ is strictly less than $a$ if and only if for every element $b \in s$, the value $f(b)$ is strictly less than $a$. That is, \[ \sup_{x \in s} f(x) < a \leftrightarrow \forall b \in s, f(b) < a. \]
Finset.sup_mem_of_nonempty theorem
(hs : s.Nonempty) : s.sup f ∈ f '' s
Full source
theorem sup_mem_of_nonempty (hs : s.Nonempty) : s.sup f ∈ f '' s := by
  classical
  induction s using Finset.induction with
  | empty => exfalso; simp only [Finset.not_nonempty_empty] at hs
  | insert a s _ h =>
    rw [Finset.sup_insert (b := a) (s := s) (f := f)]
    cases s.eq_empty_or_nonempty with
    | inl hs => simp [hs]
    | inr hs =>
      simp only [Finset.coe_insert]
      rcases le_total (f a) (s.sup f) with (ha | ha)
      · rw [sup_eq_right.mpr ha]
        exact Set.image_mono (Set.subset_insert a s) (h hs)
      · rw [sup_eq_left.mpr ha]
        apply Set.mem_image_of_mem _ (Set.mem_insert a ↑s)
Supremum of Nonempty Finite Set Lies in Its Image
Informal description
For any nonempty finite set $s$ and any function $f$ mapping elements of $s$ to a join-semilattice $\alpha$ with a bottom element $\bot$, the supremum of $f$ over $s$ lies in the image of $s$ under $f$, i.e., $\sup_{x \in s} f(x) \in f(s)$.
Finset.comp_inf_eq_inf_comp_of_is_total theorem
[SemilatticeInf β] [OrderTop β] (g : α → β) (mono_g : Monotone g) (top : g ⊤ = ⊤) : g (s.inf f) = s.inf (g ∘ f)
Full source
theorem comp_inf_eq_inf_comp_of_is_total [SemilatticeInf β] [OrderTop β] (g : α → β)
    (mono_g : Monotone g) (top : g  = ) : g (s.inf f) = s.inf (g ∘ f) :=
  comp_inf_eq_inf_comp g mono_g.map_inf top
Infimum Preservation under Monotone Functions: $g(\inf f) = \inf (g \circ f)$
Informal description
Let $\alpha$ and $\beta$ be meet-semilattices with top elements $\top_\alpha$ and $\top_\beta$ respectively. Given a finite set $s \subseteq \iota$, a function $f : \iota \to \alpha$, and a monotone function $g : \alpha \to \beta$ such that $g(\top_\alpha) = \top_\beta$, then the image under $g$ of the infimum of $f$ over $s$ is equal to the infimum of $g \circ f$ over $s$, i.e., \[ g\left(\inf_{x \in s} f(x)\right) = \inf_{x \in s} g(f(x)). \]
Finset.inf_le_iff theorem
(ha : a < ⊤) : s.inf f ≤ a ↔ ∃ b ∈ s, f b ≤ a
Full source
@[simp]
protected theorem inf_le_iff (ha : a < ) : s.inf f ≤ a ↔ ∃ b ∈ s, f b ≤ a :=
  @Finset.le_sup_iff αᵒᵈ _ _ _ _ _ _ ha
Characterization of Infimum in Finite Sets: $\inf_s f \leq a \leftrightarrow \exists b \in s, f(b) \leq a$ for $a < \top$
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a finite set. For any function $f \colon \iota \to \alpha$ and any element $a \in \alpha$ such that $a < \top$, the infimum of $f$ over $s$ is less than or equal to $a$ if and only if there exists an element $b \in s$ such that $f(b) \leq a$.
Finset.inf_eq_bot_iff theorem
{α : Type*} [LinearOrder α] [BoundedOrder α] [Nontrivial α] {s : Finset ι} {f : ι → α} : s.inf f = ⊥ ↔ ∃ b ∈ s, f b = ⊥
Full source
protected theorem inf_eq_bot_iff {α : Type*} [LinearOrder α] [BoundedOrder α] [Nontrivial α]
    {s : Finset ι} {f : ι → α} : s.inf f = ⊥ ↔ ∃ b ∈ s, f b = ⊥ :=
  Finset.sup_eq_top_iff (α := αᵒᵈ)
Characterization of when a finite infimum equals the bottom element: $\inf_s f = \bot \leftrightarrow \exists b \in s, f(b) = \bot$
Informal description
Let $\alpha$ be a nontrivial linearly ordered set with a greatest element $\top$ and a least element $\bot$. For any finite set $s$ and any function $f \colon \iota \to \alpha$, the infimum of $f$ over $s$ equals $\bot$ if and only if there exists an element $b \in s$ such that $f(b) = \bot$.
Finset.Nonempty.inf_eq_bot_iff theorem
{α : Type*} [LinearOrder α] [BoundedOrder α] {s : Finset ι} {f : ι → α} (h : s.Nonempty) : s.inf f = ⊥ ↔ ∃ b ∈ s, f b = ⊥
Full source
protected theorem Nonempty.inf_eq_bot_iff {α : Type*} [LinearOrder α] [BoundedOrder α]
    {s : Finset ι} {f : ι → α} (h : s.Nonempty) : s.inf f = ⊥ ↔ ∃ b ∈ s, f b = ⊥ :=
  h.sup_eq_top_iff (α := αᵒᵈ)
Nonempty Finite Infimum Equals Bottom iff Some Element Maps to Bottom
Informal description
Let $\alpha$ be a linearly ordered set with a greatest element $\top$ and a least element $\bot$. For any nonempty finite set $s$ and any function $f \colon \iota \to \alpha$, the infimum of $f$ over $s$ equals $\bot$ if and only if there exists an element $b \in s$ such that $f(b) = \bot$.
Finset.inf_lt_iff theorem
: s.inf f < a ↔ ∃ b ∈ s, f b < a
Full source
@[simp]
protected theorem inf_lt_iff : s.inf f < a ↔ ∃ b ∈ s, f b < a :=
  @Finset.lt_sup_iff αᵒᵈ _ _ _ _ _ _
Characterization of Strict Inequality Under Finite Infimum: $\inf_s f < a \leftrightarrow \exists b \in s, f(b) < a$
Informal description
For a finite set $s$ in a linearly ordered type $\alpha$ with a top element $\top$, and a function $f \colon \iota \to \alpha$, the infimum $\inf_{b \in s} f(b)$ is strictly less than an element $a \in \alpha$ if and only if there exists an element $b \in s$ such that $f(b) < a$.
Finset.lt_inf_iff theorem
(ha : a < ⊤) : a < s.inf f ↔ ∀ b ∈ s, a < f b
Full source
@[simp]
protected theorem lt_inf_iff (ha : a < ) : a < s.inf f ↔ ∀ b ∈ s, a < f b :=
  @Finset.sup_lt_iff αᵒᵈ _ _ _ _ _ _ ha
Strictly Less Than Infimum Criterion: $a < \inf_s f \leftrightarrow \forall b \in s, a < f(b)$
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, $s$ a finite set, and $f : \beta \to \alpha$ a function. For any element $a \in \alpha$ such that $a < \top$, we have that $a$ is strictly less than the infimum of $f$ over $s$ if and only if for every element $b \in s$, $a$ is strictly less than $f(b)$. That is, \[ a < \inf_{x \in s} f(x) \leftrightarrow \forall b \in s, a < f(b). \]
Finset.inf_eq_iInf theorem
[CompleteLattice β] (s : Finset α) (f : α → β) : s.inf f = ⨅ a ∈ s, f a
Full source
theorem inf_eq_iInf [CompleteLattice β] (s : Finset α) (f : α → β) : s.inf f = ⨅ a ∈ s, f a :=
  sup_eq_iSup (β := βᵒᵈ) ..
Infimum of Finite Set Equals Indexed Infimum
Informal description
Let $\beta$ be a complete lattice and $s$ be a finite set of elements of type $\alpha$. For any function $f : \alpha \to \beta$, the infimum of $f$ over $s$ is equal to the indexed infimum of $f$ over the elements of $s$, i.e., \[ \inf_{x \in s} f(x) = \bigsqcap_{x \in s} f(x). \]
Finset.inf_id_eq_sInf theorem
[CompleteLattice α] (s : Finset α) : s.inf id = sInf s
Full source
theorem inf_id_eq_sInf [CompleteLattice α] (s : Finset α) : s.inf id = sInf s :=
  sup_id_eq_sSup (α := αᵒᵈ) _
Infimum of Finite Set Equals Infimum of Identity Function
Informal description
Let $\alpha$ be a complete lattice and $s$ be a finite subset of $\alpha$. The infimum of the identity function over $s$ is equal to the infimum of the set $s$ itself, i.e., \[ \inf_{x \in s} x = \bigwedge s. \]
Finset.inf_id_set_eq_sInter theorem
(s : Finset (Set α)) : s.inf id = ⋂₀ ↑s
Full source
theorem inf_id_set_eq_sInter (s : Finset (Set α)) : s.inf id = ⋂₀ ↑s :=
  inf_id_eq_sInf _
Infimum of Identity Function on Finite Set of Sets Equals Their Intersection
Informal description
For any finite set $s$ of subsets of a type $\alpha$, the infimum of the identity function over $s$ is equal to the intersection of all sets in $s$, i.e., \[ \inf_{x \in s} x = \bigcap_{x \in s} x. \]
Finset.inf_set_eq_iInter theorem
(s : Finset α) (f : α → Set β) : s.inf f = ⋂ x ∈ s, f x
Full source
@[simp]
theorem inf_set_eq_iInter (s : Finset α) (f : α → Set β) : s.inf f = ⋂ x ∈ s, f x :=
  inf_eq_iInf _ _
Infimum of Sets over Finite Set Equals Indexed Intersection
Informal description
For any finite set $s$ of elements of type $\alpha$ and any function $f \colon \alpha \to \text{Set } \beta$, the infimum of $f$ over $s$ is equal to the indexed intersection of the sets $f(x)$ for $x \in s$, i.e., \[ \inf_{x \in s} f(x) = \bigcap_{x \in s} f(x). \]
Finset.inf_eq_sInf_image theorem
[CompleteLattice β] (s : Finset α) (f : α → β) : s.inf f = sInf (f '' s)
Full source
theorem inf_eq_sInf_image [CompleteLattice β] (s : Finset α) (f : α → β) :
    s.inf f = sInf (f '' s) :=
  sup_eq_sSup_image (β := βᵒᵈ) ..
Infimum of Function over Finite Set Equals Infimum of Image
Informal description
Let $\beta$ be a complete lattice and $s$ be a finite set of elements of type $\alpha$. For any function $f \colon \alpha \to \beta$, the infimum of $f$ over $s$ is equal to the infimum of the image of $s$ under $f$, i.e., \[ \inf_{x \in s} f(x) = \bigwedge f(s). \]
Finset.exists_inf_le theorem
[SemilatticeInf β] [OrderTop β] [WellFoundedLT β] (f : α → β) : ∃ t : Finset α, ∀ a, t.inf f ≤ f a
Full source
theorem exists_inf_le [SemilatticeInf β] [OrderTop β] [WellFoundedLT β] (f : α → β) :
    ∃ t : Finset α, ∀ a, t.inf f ≤ f a :=
  exists_sup_ge (β := βᵒᵈ) _
Existence of Finite Infimum Bound in Well-Founded Meet-Semilattices
Informal description
Let $\beta$ be a meet-semilattice with a top element $\top$ and a well-founded "less than" relation. For any function $f \colon \alpha \to \beta$, there exists a finite subset $t \subseteq \alpha$ such that for every $a \in \alpha$, the infimum of $f$ over $t$ is less than or equal to $f(a)$, i.e., $\inf_{x \in t} f(x) \leq f(a)$.
Finset.exists_inf_eq_iInf theorem
[CompleteLattice β] [WellFoundedLT β] (f : α → β) : ∃ t : Finset α, t.inf f = ⨅ a, f a
Full source
theorem exists_inf_eq_iInf [CompleteLattice β] [WellFoundedLT β] (f : α → β) :
    ∃ t : Finset α, t.inf f = ⨅ a, f a :=
  exists_sup_eq_iSup (β := βᵒᵈ) _
Finite Infimum Attains Indexed Infimum in Complete Lattices
Informal description
Let $\beta$ be a complete lattice with a well-founded strict less-than relation. For any function $f \colon \alpha \to \beta$, there exists a finite subset $t \subseteq \alpha$ such that the infimum of $f$ over $t$ equals the infimum of $f$ over all of $\alpha$, i.e., $\inf_{x \in t} f(x) = \bigsqcap_{a \in \alpha} f(a)$.
Finset.sup_of_mem theorem
{s : Finset β} (f : β → α) {b : β} (h : b ∈ s) : ∃ a : α, s.sup ((↑) ∘ f : β → WithBot α) = ↑a
Full source
theorem sup_of_mem {s : Finset β} (f : β → α) {b : β} (h : b ∈ s) :
    ∃ a : α, s.sup ((↑) ∘ f : β → WithBot α) = ↑a :=
  Exists.imp (fun _ => And.left) (@le_sup (WithBot α) _ _ _ _ _ _ h (f b) rfl)
Existence of Supremum Representative in Join-Semilattice for Finite Set Element
Informal description
Let $s$ be a finite set of elements of type $\beta$ and $f : \beta \to \alpha$ a function, where $\alpha$ is a join-semilattice. For any element $b \in s$, there exists an element $a \in \alpha$ such that the supremum of $f$ over $s$ (computed in $\text{WithBot }\alpha$) is equal to the embedding of $a$ in $\text{WithBot }\alpha$, i.e., \[ \sup_{x \in s} f(x) = a \] where the supremum is taken in $\text{WithBot }\alpha$ and $a$ is the corresponding element in $\alpha$.
Finset.sup' definition
(s : Finset β) (H : s.Nonempty) (f : β → α) : α
Full source
/-- Given nonempty finset `s` then `s.sup' H f` is the supremum of its image under `f` in (possibly
unbounded) join-semilattice `α`, where `H` is a proof of nonemptiness. If `α` has a bottom element
you may instead use `Finset.sup` which does not require `s` nonempty. -/
def sup' (s : Finset β) (H : s.Nonempty) (f : β → α) : α :=
  WithBot.unbot (s.sup ((↑) ∘ f)) (by simpa using H)
Supremum of a nonempty finite set under a function in a join-semilattice
Informal description
Given a nonempty finite set $s$ of elements of type $\beta$ and a function $f : \beta \to \alpha$, where $\alpha$ is a join-semilattice, the supremum $\sup' s H f$ is the least upper bound of the images of the elements of $s$ under $f$. Here $H$ is a proof that $s$ is nonempty. This is defined by first computing the supremum in $\text{WithBot }\alpha$ (which always exists) and then extracting the underlying value in $\alpha$ using the nonemptiness proof.
Finset.coe_sup' theorem
: ((s.sup' H f : α) : WithBot α) = s.sup ((↑) ∘ f)
Full source
@[simp]
theorem coe_sup' : ((s.sup' H f : α) : WithBot α) = s.sup ((↑) ∘ f) := by
  rw [sup', WithBot.coe_unbot]
Embedding of Finite Supremum Commutes with Supremum in $\text{WithBot }\alpha$
Informal description
For a nonempty finite set $s$ of elements of type $\beta$ and a function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, the embedding of the supremum $\sup' s H f$ in $\alpha$ into $\text{WithBot }\alpha$ is equal to the supremum of the set $s$ under the composition of $f$ with the embedding of $\alpha$ into $\text{WithBot }\alpha$. That is, $$(\sup' s H f : \text{WithBot }\alpha) = \sup s (f \circ \text{some})$$ where $H$ is a proof that $s$ is nonempty and $\text{some} : \alpha \to \text{WithBot }\alpha$ is the embedding map.
Finset.sup'_cons theorem
{b : β} {hb : b ∉ s} : (cons b s hb).sup' (cons_nonempty hb) f = f b ⊔ s.sup' H f
Full source
@[simp]
theorem sup'_cons {b : β} {hb : b ∉ s} :
    (cons b s hb).sup' (cons_nonempty hb) f = f b ⊔ s.sup' H f := by
  rw [← WithBot.coe_eq_coe]
  simp [WithBot.coe_sup]
Supremum of Function over Finite Set with Insertion: $\sup'(\text{cons}(b, s, hb), f) = f(b) \sqcup \sup'(s, f)$
Informal description
For a nonempty finite set $s$ of elements of type $\beta$, a function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, and an element $b \in \beta$ such that $b \notin s$, the supremum of $f$ over the set obtained by inserting $b$ into $s$ is equal to the join of $f(b)$ and the supremum of $f$ over $s$. That is, \[ \sup'(\text{cons}(b, s, hb), f) = f(b) \sqcup \sup'(s, f), \] where $\text{cons}(b, s, hb)$ denotes the insertion of $b$ into $s$ under the assumption $hb : b \notin s$, and $\sup'$ is the supremum operation for nonempty finite sets.
Finset.sup'_insert theorem
[DecidableEq β] {b : β} : (insert b s).sup' (insert_nonempty _ _) f = f b ⊔ s.sup' H f
Full source
@[simp]
theorem sup'_insert [DecidableEq β] {b : β} :
    (insert b s).sup' (insert_nonempty _ _) f = f b ⊔ s.sup' H f := by
  rw [← WithBot.coe_eq_coe]
  simp [WithBot.coe_sup]
Supremum over Inserted Element Equals Join with Existing Supremum in Join-Semilattice
Informal description
Let $\alpha$ be a join-semilattice, $\beta$ a type with decidable equality, $s$ a finite subset of $\beta$, $H$ a proof that $s$ is nonempty, $f : \beta \to \alpha$ a function, and $b \in \beta$. Then the supremum of $f$ over the set $s \cup \{b\}$ equals the join of $f(b)$ and the supremum of $f$ over $s$, i.e., $$\sup'_{x \in s \cup \{b\}} f(x) = f(b) \sqcup \sup'_{x \in s} f(x).$$
Finset.sup'_singleton theorem
{b : β} : ({ b } : Finset β).sup' (singleton_nonempty _) f = f b
Full source
@[simp]
theorem sup'_singleton {b : β} : ({b} : Finset β).sup' (singleton_nonempty _) f = f b :=
  rfl
Supremum of a Function over a Singleton Set
Informal description
For any element $b$ of type $\beta$ and any function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, the supremum of $f$ over the singleton set $\{b\}$ is equal to $f(b)$. That is, $\sup' \{b\} f = f(b)$.
Finset.sup'_le_iff theorem
{a : α} : s.sup' H f ≤ a ↔ ∀ b ∈ s, f b ≤ a
Full source
@[simp]
theorem sup'_le_iff {a : α} : s.sup' H f ≤ a ↔ ∀ b ∈ s, f b ≤ a := by
  simp_rw [← @WithBot.coe_le_coe α, coe_sup', Finset.sup_le_iff]; rfl
Characterization of Supremum Bound: $\sup' s f \leq a \leftrightarrow \forall b \in s, f(b) \leq a$
Informal description
For a nonempty finite set $s$ in a join-semilattice $\alpha$, a function $f : \beta \to \alpha$, and an element $a \in \alpha$, the supremum $\sup' s H f$ is less than or equal to $a$ if and only if $f(b) \leq a$ for all $b \in s$.
Finset.le_sup' theorem
{b : β} (h : b ∈ s) : f b ≤ s.sup' ⟨b, h⟩ f
Full source
theorem le_sup' {b : β} (h : b ∈ s) : f b ≤ s.sup' ⟨b, h⟩ f :=
  (sup'_le_iff ⟨b, h⟩ f).1 le_rfl b h
Elementwise Bound by Supremum in Finite Sets
Informal description
For any element $b$ in a nonempty finite set $s$ and any function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, the value $f(b)$ is less than or equal to the supremum of $f$ over $s$. That is, $f(b) \leq \sup' s f$ for all $b \in s$.
Finset.isLUB_sup' theorem
{s : Finset α} (hs : s.Nonempty) : IsLUB s (sup' s hs id)
Full source
theorem isLUB_sup' {s : Finset α} (hs : s.Nonempty) : IsLUB s (sup' s hs id) :=
  ⟨fun x h => id_eq x ▸ le_sup' id h, fun _ h => Finset.sup'_le hs id h⟩
Supremum of a Finite Set is its Least Upper Bound
Informal description
For any nonempty finite set $s$ in a join-semilattice $\alpha$, the element $\sup' s \text{id}$ is the least upper bound of $s$. That is, $\sup' s \text{id}$ is an upper bound for all elements of $s$, and it is less than or equal to any other upper bound of $s$.
Finset.le_sup'_of_le theorem
{a : α} {b : β} (hb : b ∈ s) (h : a ≤ f b) : a ≤ s.sup' ⟨b, hb⟩ f
Full source
theorem le_sup'_of_le {a : α} {b : β} (hb : b ∈ s) (h : a ≤ f b) : a ≤ s.sup' ⟨b, hb⟩ f :=
  h.trans <| le_sup' _ hb
Transitivity of Supremum Bound in Finite Sets
Informal description
Let $s$ be a nonempty finite set of elements of type $\beta$, and let $f : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice. For any element $b \in s$ and any $a \in \alpha$ such that $a \leq f(b)$, we have $a \leq \sup' s f$, where $\sup' s f$ is the supremum of $f$ over $s$.
Finset.sup'_eq_of_forall theorem
{a : α} (h : ∀ b ∈ s, f b = a) : s.sup' H f = a
Full source
lemma sup'_eq_of_forall {a : α} (h : ∀ b ∈ s, f b = a) : s.sup' H f = a :=
  le_antisymm (sup'_le _ _ (fun _ hb ↦ (h _ hb).le))
    (le_sup'_of_le _ H.choose_spec (h _ H.choose_spec).ge)
Supremum of Constant Function on Nonempty Finite Set
Informal description
Let $s$ be a nonempty finite set of elements of type $\beta$, and let $f : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice. If for every element $b \in s$, the value $f(b)$ is equal to a fixed element $a \in \alpha$, then the supremum of $f$ over $s$ is equal to $a$.
Finset.sup'_const theorem
(a : α) : s.sup' H (fun _ => a) = a
Full source
@[simp]
theorem sup'_const (a : α) : s.sup' H (fun _ => a) = a := by
  apply le_antisymm
  · apply sup'_le
    intros
    exact le_rfl
  · apply le_sup' (fun _ => a) H.choose_spec
Supremum of a Constant Function on a Nonempty Finite Set
Informal description
For any nonempty finite set $s$ in a join-semilattice $\alpha$ and any constant element $a \in \alpha$, the supremum of the constant function $\lambda \_, a$ over $s$ is equal to $a$.
Finset.sup'_union theorem
[DecidableEq β] {s₁ s₂ : Finset β} (h₁ : s₁.Nonempty) (h₂ : s₂.Nonempty) (f : β → α) : (s₁ ∪ s₂).sup' (h₁.mono subset_union_left) f = s₁.sup' h₁ f ⊔ s₂.sup' h₂ f
Full source
theorem sup'_union [DecidableEq β] {s₁ s₂ : Finset β} (h₁ : s₁.Nonempty) (h₂ : s₂.Nonempty)
    (f : β → α) :
    (s₁ ∪ s₂).sup' (h₁.mono subset_union_left) f = s₁.sup' h₁ f ⊔ s₂.sup' h₂ f :=
  eq_of_forall_ge_iff fun a => by simp [or_imp, forall_and]
Supremum of Union of Nonempty Finite Sets in a Join-Semilattice
Informal description
Let $\beta$ be a type with decidable equality, and let $\alpha$ be a join-semilattice. Given two nonempty finite sets $s_1, s_2 \subseteq \beta$ and a function $f : \beta \to \alpha$, the supremum of $f$ over the union $s_1 \cup s_2$ is equal to the join of the suprema of $f$ over $s_1$ and $s_2$, i.e., \[ \sup' (s_1 \cup s_2) f = \sup' s_1 f \sqcup \sup' s_2 f. \] Here, $\sup'$ denotes the supremum operation for nonempty finite sets in $\alpha$.
Finset.sup'_comm theorem
{t : Finset γ} (hs : s.Nonempty) (ht : t.Nonempty) (f : β → γ → α) : (s.sup' hs fun b => t.sup' ht (f b)) = t.sup' ht fun c => s.sup' hs fun b => f b c
Full source
protected theorem sup'_comm {t : Finset γ} (hs : s.Nonempty) (ht : t.Nonempty) (f : β → γ → α) :
    (s.sup' hs fun b => t.sup' ht (f b)) = t.sup' ht fun c => s.sup' hs fun b => f b c :=
  eq_of_forall_ge_iff fun a => by simpa using forall₂_swap
Commutativity of Nested Suprema in Join-Semilattice
Informal description
Let $s$ be a nonempty finite set of elements of type $\beta$, $t$ a nonempty finite set of elements of type $\gamma$, and $f : \beta \to \gamma \to \alpha$ a function where $\alpha$ is a join-semilattice. Then the following equality holds: \[ \sup'_{b \in s} \left( \sup'_{c \in t} f(b, c) \right) = \sup'_{c \in t} \left( \sup'_{b \in s} f(b, c) \right) \] where $\sup'$ denotes the supremum operation for nonempty finite sets in the join-semilattice $\alpha$.
Finset.sup'_induction theorem
{p : α → Prop} (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊔ a₂)) (hs : ∀ b ∈ s, p (f b)) : p (s.sup' H f)
Full source
theorem sup'_induction {p : α → Prop} (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊔ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.sup' H f) := by
  show @WithBot.recBotCoe α (fun _ => Prop) True p ↑(s.sup' H f)
  rw [coe_sup']
  refine sup_induction trivial (fun a₁ h₁ a₂ h₂ ↦ ?_) hs
  match a₁, a₂ with
  | , _ => rwa [bot_sup_eq]
  | (a₁ : α),  => rwa [sup_bot_eq]
  | (a₁ : α), (a₂ : α) => exact hp a₁ h₁ a₂ h₂
Induction Principle for Supremum over Nonempty Finite Sets in a Join-Semilattice
Informal description
Let $\alpha$ be a join-semilattice, $s$ a nonempty finite set of elements of type $\beta$, and $f : \beta \to \alpha$ a function. For any predicate $p : \alpha \to \mathrm{Prop}$ such that: 1. For any $a_1, a_2 \in \alpha$, if $p(a_1)$ and $p(a_2)$ hold, then $p(a_1 \sqcup a_2)$ holds, 2. For every $b \in s$, $p(f(b))$ holds, then $p(\sup' s H f)$ holds, where $\sup'$ denotes the supremum operation for nonempty finite sets in $\alpha$.
Finset.sup'_mem theorem
(s : Set α) (w : ∀ᵉ (x ∈ s) (y ∈ s), x ⊔ y ∈ s) {ι : Type*} (t : Finset ι) (H : t.Nonempty) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.sup' H p ∈ s
Full source
theorem sup'_mem (s : Set α) (w : ∀ᵉ (x ∈ s) (y ∈ s), x ⊔ y ∈ s) {ι : Type*}
    (t : Finset ι) (H : t.Nonempty) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.sup' H p ∈ s :=
  sup'_induction H p w h
Supremum of a Function over a Nonempty Finite Set Preserves Membership in a Sup-Closed Set
Informal description
Let $\alpha$ be a join-semilattice and $s$ a subset of $\alpha$ such that for any $x, y \in s$, their supremum $x \sqcup y$ is also in $s$. Let $t$ be a nonempty finite set indexed by type $\iota$, and $p : \iota \to \alpha$ a function such that $p(i) \in s$ for all $i \in t$. Then the supremum $\sup' t H p$ is an element of $s$.
Finset.sup'_congr theorem
{t : Finset β} {f g : β → α} (h₁ : s = t) (h₂ : ∀ x ∈ s, f x = g x) : s.sup' H f = t.sup' (h₁ ▸ H) g
Full source
@[congr]
theorem sup'_congr {t : Finset β} {f g : β → α} (h₁ : s = t) (h₂ : ∀ x ∈ s, f x = g x) :
    s.sup' H f = t.sup' (h₁ ▸ H) g := by
  subst s
  refine eq_of_forall_ge_iff fun c => ?_
  simp +contextual only [sup'_le_iff, h₂]
Supremum Congruence for Nonempty Finite Sets
Informal description
Let $s$ and $t$ be nonempty finite sets of type $\beta$, and let $f, g : \beta \to \alpha$ be functions where $\alpha$ is a join-semilattice. If $s = t$ and for every $x \in s$ we have $f(x) = g(x)$, then the suprema $\sup' s H f$ and $\sup' t (h_1 \mapsto H) g$ are equal.
Finset.comp_sup'_eq_sup'_comp theorem
[SemilatticeSup γ] {s : Finset β} (H : s.Nonempty) {f : β → α} (g : α → γ) (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) : g (s.sup' H f) = s.sup' H (g ∘ f)
Full source
theorem comp_sup'_eq_sup'_comp [SemilatticeSup γ] {s : Finset β} (H : s.Nonempty) {f : β → α}
    (g : α → γ) (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) : g (s.sup' H f) = s.sup' H (g ∘ f) := by
  refine H.cons_induction ?_ ?_ <;> intros <;> simp [*]
Supremum Preservation under Function Composition: $g(\sup' s f) = \sup' s (g \circ f)$
Informal description
Let $\alpha$ and $\gamma$ be join-semilattices, $s$ a nonempty finite set of elements of type $\beta$, $f : \beta \to \alpha$ a function, and $g : \alpha \to \gamma$ a function that preserves suprema (i.e., $g(x \sqcup y) = g(x) \sqcup g(y)$ for all $x, y \in \alpha$). Then the image of the supremum of $f$ over $s$ under $g$ is equal to the supremum of $g \circ f$ over $s$: \[ g\left(\sup' s H f\right) = \sup' s H (g \circ f). \]
map_finset_sup' theorem
[SemilatticeSup β] [FunLike F α β] [SupHomClass F α β] (f : F) {s : Finset ι} (hs) (g : ι → α) : f (s.sup' hs g) = s.sup' hs (f ∘ g)
Full source
@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [FunLike F α β] [SupHomClass F α β]
    (f : F) {s : Finset ι} (hs) (g : ι → α) :
    f (s.sup' hs g) = s.sup' hs (f ∘ g) := by
  refine hs.cons_induction ?_ ?_ <;> intros <;> simp [*]
Supremum-Preserving Morphism Commutes with Finite Supremum: $f(\sup' s g) = \sup' s (f \circ g)$
Informal description
Let $\alpha$ and $\beta$ be join-semilattices, and let $F$ be a type of functions from $\alpha$ to $\beta$ that preserves suprema (i.e., for any $f \in F$ and $x, y \in \alpha$, $f(x \sqcup y) = f(x) \sqcup f(y)$). Given a nonempty finite set $s$ of elements of type $\iota$ and a function $g : \iota \to \alpha$, the image of the supremum of $g$ over $s$ under $f$ is equal to the supremum of the composition $f \circ g$ over $s$. That is, \[ f\left(\sup'_{x \in s} g(x)\right) = \sup'_{x \in s} (f \circ g)(x). \]
Finset.sup'_image theorem
[DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty) (g : β → α) : (s.image f).sup' hs g = s.sup' hs.of_image (g ∘ f)
Full source
/-- To rewrite from right to left, use `Finset.sup'_comp_eq_image`. -/
@[simp]
theorem sup'_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty)
    (g : β → α) :
    (s.image f).sup' hs g = s.sup' hs.of_image (g ∘ f) := by
  rw [← WithBot.coe_eq_coe]; simp only [coe_sup', sup_image, WithBot.coe_sup]; rfl
Supremum of Function over Image Equals Supremum of Composition for Nonempty Finite Sets
Informal description
Let $\alpha$ be a join-semilattice, $\beta$ and $\gamma$ types with decidable equality on $\beta$. Given a finite set $s \subseteq \gamma$, a function $f : \gamma \to \beta$, and a function $g : \beta \to \alpha$, if the image $f(s)$ is nonempty, then the supremum of $g$ over $f(s)$ equals the supremum of $g \circ f$ over $s$. That is, \[ \sup'_{x \in f(s)} g(x) = \sup'_{y \in s} g(f(y)), \] where $\sup'$ denotes the supremum operation for nonempty finite sets.
Finset.sup'_comp_eq_image theorem
[DecidableEq β] {s : Finset γ} {f : γ → β} (hs : s.Nonempty) (g : β → α) : s.sup' hs (g ∘ f) = (s.image f).sup' (hs.image f) g
Full source
/-- A version of `Finset.sup'_image` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma sup'_comp_eq_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : s.Nonempty) (g : β → α) :
    s.sup' hs (g ∘ f) = (s.image f).sup' (hs.image f) g :=
  .symm <| sup'_image _ _
Supremum of Composition Equals Supremum over Image for Nonempty Finite Sets
Informal description
Let $\alpha$ be a join-semilattice, $\beta$ and $\gamma$ types with decidable equality on $\beta$. Given a nonempty finite set $s \subseteq \gamma$, a function $f : \gamma \to \beta$, and a function $g : \beta \to \alpha$, the supremum of $g \circ f$ over $s$ equals the supremum of $g$ over the image $f(s)$. That is, \[ \sup'_{y \in s} g(f(y)) = \sup'_{x \in f(s)} g(x), \] where $\sup'$ denotes the supremum operation for nonempty finite sets.
Finset.sup'_map theorem
{s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty) : (s.map f).sup' hs g = s.sup' (map_nonempty.1 hs) (g ∘ f)
Full source
/-- To rewrite from right to left, use `Finset.sup'_comp_eq_map`. -/
@[simp]
theorem sup'_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty) :
    (s.map f).sup' hs g = s.sup' (map_nonempty.1 hs) (g ∘ f) := by
  rw [← WithBot.coe_eq_coe, coe_sup', sup_map, coe_sup']
  rfl
Supremum Preservation under Injective Mapping for Nonempty Finite Sets
Informal description
Let $s$ be a finite set of elements of type $\gamma$, $f : \gamma \hookrightarrow \beta$ be an injective function embedding, and $g : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice. If the image of $s$ under $f$ is nonempty, then the supremum of $g$ over $f(s)$ is equal to the supremum of $g \circ f$ over $s$, i.e., \[ \sup' (f(s)) \, g = \sup' s \, (g \circ f). \]
Finset.sup'_comp_eq_map theorem
{s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : s.Nonempty) : s.sup' hs (g ∘ f) = (s.map f).sup' (map_nonempty.2 hs) g
Full source
/-- A version of `Finset.sup'_map` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma sup'_comp_eq_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : s.Nonempty) :
    s.sup' hs (g ∘ f) = (s.map f).sup' (map_nonempty.2 hs) g :=
  .symm <| sup'_map _ _
Supremum of Composition Equals Supremum over Image for Nonempty Finite Sets
Informal description
Let $s$ be a nonempty finite set of elements of type $\gamma$, $f : \gamma \hookrightarrow \beta$ be an injective function embedding, and $g : \beta \to \alpha$ be a function where $\alpha$ is a join-semilattice. Then the supremum of $g \circ f$ over $s$ is equal to the supremum of $g$ over the image of $s$ under $f$, i.e., \[ \sup' s \, (g \circ f) = \sup' (f(s)) \, g. \]
Finset.sup'_mono theorem
{s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonempty) : s₁.sup' h₁ f ≤ s₂.sup' (h₁.mono h) f
Full source
@[gcongr]
theorem sup'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonempty) :
    s₁.sup' h₁ f ≤ s₂.sup' (h₁.mono h) f :=
  Finset.sup'_le h₁ _ (fun _ hb => le_sup' _ (h hb))
Monotonicity of Supremum under Set Inclusion for Nonempty Finite Sets
Informal description
Let $s₁$ and $s₂$ be finite sets of type $\beta$ such that $s₁ \subseteq s₂$, and let $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice. If $s₁$ is nonempty, then the supremum of $f$ over $s₁$ is less than or equal to the supremum of $f$ over $s₂$. That is, \[ \sup' s₁ f \leq \sup' s₂ f. \]
Finset.sup'_mono_fun theorem
{hs : s.Nonempty} {f g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.sup' hs f ≤ s.sup' hs g
Full source
@[gcongr]
lemma sup'_mono_fun {hs : s.Nonempty} {f g : β → α} (h : ∀ b ∈ s, f b ≤ g b) :
    s.sup' hs f ≤ s.sup' hs g := sup'_le _ _ fun b hb ↦ (h b hb).trans (le_sup' _ hb)
Monotonicity of Supremum under Pointwise Inequality
Informal description
Let $s$ be a nonempty finite set in a join-semilattice $\alpha$, and let $f, g : \beta \to \alpha$ be functions such that $f(b) \leq g(b)$ for all $b \in s$. Then the supremum of $f$ over $s$ is less than or equal to the supremum of $g$ over $s$, i.e., \[ \sup' s f \leq \sup' s g. \]
Finset.inf_of_mem theorem
{s : Finset β} (f : β → α) {b : β} (h : b ∈ s) : ∃ a : α, s.inf ((↑) ∘ f : β → WithTop α) = ↑a
Full source
theorem inf_of_mem {s : Finset β} (f : β → α) {b : β} (h : b ∈ s) :
    ∃ a : α, s.inf ((↑) ∘ f : β → WithTop α) = ↑a :=
  @sup_of_mem αᵒᵈ _ _ _ f _ h
Existence of Infimum Representative in Meet-Semilattice for Finite Set Element
Informal description
Let $s$ be a finite set of elements of type $\beta$, and let $f \colon \beta \to \alpha$ be a function where $\alpha$ is a meet-semilattice. For any element $b \in s$, there exists an element $a \in \alpha$ such that the infimum of $f$ over $s$ (computed in $\text{WithTop}\ \alpha$) is equal to the embedding of $a$ in $\text{WithTop}\ \alpha$, i.e., \[ \inf_{x \in s} f(x) = a \] where the infimum is taken in $\text{WithTop}\ \alpha$ and $a$ is the corresponding element in $\alpha$.
Finset.inf' definition
(s : Finset β) (H : s.Nonempty) (f : β → α) : α
Full source
/-- Given nonempty finset `s` then `s.inf' H f` is the infimum of its image under `f` in (possibly
unbounded) meet-semilattice `α`, where `H` is a proof of nonemptiness. If `α` has a top element you
may instead use `Finset.inf` which does not require `s` nonempty. -/
def inf' (s : Finset β) (H : s.Nonempty) (f : β → α) : α :=
  WithTop.untop (s.inf ((↑) ∘ f)) (by simpa using H)
Infimum over a nonempty finite set in a meet-semilattice
Informal description
Given a nonempty finite set $s$ in a meet-semilattice $\alpha$ and a function $f \colon \beta \to \alpha$, the infimum $\inf_{a \in s} f(a)$ is defined as the underlying element of $\alpha$ corresponding to the infimum of the image of $s$ under $f$ in $\text{WithTop}\ \alpha$. Here, the nonemptiness of $s$ is ensured by the hypothesis $H$. More concretely, for $s = \{a_1, \dots, a_n\}$, we have $\inf_{a \in s} f(a) = f(a_1) \sqcap \cdots \sqcap f(a_n)$, where the infimum is computed in $\alpha$ extended with a top element $\top$ and then projected back to $\alpha$.
Finset.coe_inf' theorem
: ((s.inf' H f : α) : WithTop α) = s.inf ((↑) ∘ f)
Full source
@[simp]
theorem coe_inf' : ((s.inf' H f : α) : WithTop α) = s.inf ((↑) ∘ f) :=
  @coe_sup' αᵒᵈ _ _ _ H f
Embedding of Finite Infimum Commutes with Infimum in $\text{WithTop }\alpha$
Informal description
For a nonempty finite set $s$ of elements of type $\beta$ and a function $f : \beta \to \alpha$ where $\alpha$ is a meet-semilattice, the embedding of the infimum $\inf' s H f$ in $\alpha$ into $\text{WithTop }\alpha$ is equal to the infimum of the set $s$ under the composition of $f$ with the embedding of $\alpha$ into $\text{WithTop }\alpha$. That is, $$(\inf' s H f : \text{WithTop }\alpha) = \inf s (f \circ \text{some})$$ where $H$ is a proof that $s$ is nonempty and $\text{some} : \alpha \to \text{WithTop }\alpha$ is the embedding map.
Finset.inf'_cons theorem
{b : β} {hb : b ∉ s} : (cons b s hb).inf' (cons_nonempty hb) f = f b ⊓ s.inf' H f
Full source
@[simp]
theorem inf'_cons {b : β} {hb : b ∉ s} :
    (cons b s hb).inf' (cons_nonempty hb) f = f b ⊓ s.inf' H f :=
  @sup'_cons αᵒᵈ _ _ _ H f _ _
Infimum of Function over Finite Set with Insertion: $\inf'(\text{cons}(b, s, hb), f) = f(b) \sqcap \inf'(s, f)$
Informal description
For a nonempty finite set $s$ in a meet-semilattice $\alpha$, a function $f \colon \beta \to \alpha$, and an element $b \in \beta$ such that $b \notin s$, the infimum of $f$ over the set obtained by inserting $b$ into $s$ equals the meet of $f(b)$ and the infimum of $f$ over $s$. That is, \[ \inf'(\text{cons}(b, s, hb), f) = f(b) \sqcap \inf'(s, f), \] where $\text{cons}(b, s, hb)$ denotes the insertion of $b$ into $s$ under the assumption $hb : b \notin s$, and $\inf'$ is the infimum operation for nonempty finite sets.
Finset.inf'_insert theorem
[DecidableEq β] {b : β} : (insert b s).inf' (insert_nonempty _ _) f = f b ⊓ s.inf' H f
Full source
@[simp]
theorem inf'_insert [DecidableEq β] {b : β} :
    (insert b s).inf' (insert_nonempty _ _) f = f b ⊓ s.inf' H f :=
  @sup'_insert αᵒᵈ _ _ _ H f _ _
Infimum over Inserted Element Equals Meet with Existing Infimum in Meet-Semilattice
Informal description
Let $\alpha$ be a meet-semilattice, $\beta$ a type with decidable equality, $s$ a finite subset of $\beta$, $H$ a proof that $s$ is nonempty, $f : \beta \to \alpha$ a function, and $b \in \beta$. Then the infimum of $f$ over the set $s \cup \{b\}$ equals the meet of $f(b)$ and the infimum of $f$ over $s$, i.e., $$\inf'_{x \in s \cup \{b\}} f(x) = f(b) \sqcap \inf'_{x \in s} f(x).$$
Finset.inf'_singleton theorem
{b : β} : ({ b } : Finset β).inf' (singleton_nonempty _) f = f b
Full source
@[simp]
theorem inf'_singleton {b : β} : ({b} : Finset β).inf' (singleton_nonempty _) f = f b :=
  rfl
Infimum over a Singleton Set Equals the Function Value
Informal description
For any element $b$ of type $\beta$ and any function $f \colon \beta \to \alpha$ where $\alpha$ is a meet-semilattice, the infimum of $f$ over the singleton set $\{b\}$ is equal to $f(b)$, i.e., $\inf_{a \in \{b\}} f(a) = f(b)$.
Finset.le_inf'_iff theorem
{a : α} : a ≤ s.inf' H f ↔ ∀ b ∈ s, a ≤ f b
Full source
@[simp]
theorem le_inf'_iff {a : α} : a ≤ s.inf' H f ↔ ∀ b ∈ s, a ≤ f b :=
  sup'_le_iff (α := αᵒᵈ) H f
Characterization of Infimum Bound: $a \leq \inf' s f \leftrightarrow \forall b \in s, a \leq f(b)$
Informal description
For a nonempty finite set $s$ in a meet-semilattice $\alpha$, a function $f \colon \beta \to \alpha$, and an element $a \in \alpha$, we have $a \leq \inf_{b \in s} f(b)$ if and only if $a \leq f(b)$ for all $b \in s$.
Finset.le_inf' theorem
{a : α} (hs : ∀ b ∈ s, a ≤ f b) : a ≤ s.inf' H f
Full source
theorem le_inf' {a : α} (hs : ∀ b ∈ s, a ≤ f b) : a ≤ s.inf' H f :=
  sup'_le (α := αᵒᵈ) H f hs
Lower Bound Property of Infimum over Finite Set
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set of type $\beta$, and $f \colon \beta \to \alpha$ a function. If an element $a \in \alpha$ satisfies $a \leq f(b)$ for all $b \in s$, then $a$ is less than or equal to the infimum of $f$ over $s$, i.e., $a \leq \inf_{b \in s} f(b)$.
Finset.inf'_le theorem
{b : β} (h : b ∈ s) : s.inf' ⟨b, h⟩ f ≤ f b
Full source
theorem inf'_le {b : β} (h : b ∈ s) : s.inf' ⟨b, h⟩ f ≤ f b :=
  le_sup' (α := αᵒᵈ) f h
Infimum is a Lower Bound in Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set of type $\beta$, and $f \colon \beta \to \alpha$ a function. For any element $b \in s$, the infimum of $f$ over $s$ is less than or equal to $f(b)$, i.e., \[ \inf_{a \in s} f(a) \leq f(b). \]
Finset.isGLB_inf' theorem
{s : Finset α} (hs : s.Nonempty) : IsGLB s (inf' s hs id)
Full source
theorem isGLB_inf' {s : Finset α} (hs : s.Nonempty) : IsGLB s (inf' s hs id) :=
  ⟨fun x h => id_eq x ▸ inf'_le id h, fun _ h => Finset.le_inf' hs id h⟩
Infimum of Nonempty Finite Set is Greatest Lower Bound
Informal description
For any nonempty finite set $s$ in a meet-semilattice $\alpha$, the infimum of $s$ (computed as $\inf' s \text{id}$) is the greatest lower bound of $s$. That is, $\inf' s \text{id}$ is a lower bound for $s$ and is greater than or equal to any other lower bound of $s$.
Finset.inf'_le_of_le theorem
{a : α} {b : β} (hb : b ∈ s) (h : f b ≤ a) : s.inf' ⟨b, hb⟩ f ≤ a
Full source
theorem inf'_le_of_le {a : α} {b : β} (hb : b ∈ s) (h : f b ≤ a) :
    s.inf' ⟨b, hb⟩ f ≤ a := (inf'_le _ hb).trans h
Infimum is Below Any Upper Bound in Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set of type $\beta$, and $f \colon \beta \to \alpha$ a function. For any element $b \in s$ and any $a \in \alpha$, if $f(b) \leq a$, then the infimum of $f$ over $s$ is less than or equal to $a$, i.e., \[ \inf_{a' \in s} f(a') \leq a. \]
Finset.inf'_eq_of_forall theorem
{a : α} (h : ∀ b ∈ s, f b = a) : s.inf' H f = a
Full source
lemma inf'_eq_of_forall {a : α} (h : ∀ b ∈ s, f b = a) : s.inf' H f = a :=
  sup'_eq_of_forall (α := αᵒᵈ) H f h
Infimum of Constant Function on Nonempty Finite Set
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set of type $\beta$, and $f \colon \beta \to \alpha$ a function. If for every element $b \in s$, the value $f(b)$ is equal to a fixed element $a \in \alpha$, then the infimum of $f$ over $s$ is equal to $a$, i.e., \[ \inf_{b \in s} f(b) = a. \]
Finset.inf'_const theorem
(a : α) : (s.inf' H fun _ => a) = a
Full source
@[simp]
theorem inf'_const (a : α) : (s.inf' H fun _ => a) = a :=
  sup'_const (α := αᵒᵈ) H a
Infimum of a Constant Function on a Nonempty Finite Set
Informal description
For any nonempty finite set $s$ in a meet-semilattice $\alpha$ and any constant element $a \in \alpha$, the infimum of the constant function $\lambda \_, a$ over $s$ is equal to $a$.
Finset.inf'_union theorem
[DecidableEq β] {s₁ s₂ : Finset β} (h₁ : s₁.Nonempty) (h₂ : s₂.Nonempty) (f : β → α) : (s₁ ∪ s₂).inf' (h₁.mono subset_union_left) f = s₁.inf' h₁ f ⊓ s₂.inf' h₂ f
Full source
theorem inf'_union [DecidableEq β] {s₁ s₂ : Finset β} (h₁ : s₁.Nonempty) (h₂ : s₂.Nonempty)
    (f : β → α) :
    (s₁ ∪ s₂).inf' (h₁.mono subset_union_left) f = s₁.inf' h₁ f ⊓ s₂.inf' h₂ f :=
  @sup'_union αᵒᵈ _ _ _ _ _ h₁ h₂ _
Infimum of Union of Nonempty Finite Sets in a Meet-Semilattice
Informal description
Let $\beta$ be a type with decidable equality, and let $\alpha$ be a meet-semilattice. Given two nonempty finite sets $s_1, s_2 \subseteq \beta$ and a function $f : \beta \to \alpha$, the infimum of $f$ over the union $s_1 \cup s_2$ is equal to the meet of the infima of $f$ over $s_1$ and $s_2$, i.e., \[ \inf' (s_1 \cup s_2) f = \inf' s_1 f \sqcap \inf' s_2 f. \] Here, $\inf'$ denotes the infimum operation for nonempty finite sets in $\alpha$.
Finset.inf'_comm theorem
{t : Finset γ} (hs : s.Nonempty) (ht : t.Nonempty) (f : β → γ → α) : (s.inf' hs fun b => t.inf' ht (f b)) = t.inf' ht fun c => s.inf' hs fun b => f b c
Full source
protected theorem inf'_comm {t : Finset γ} (hs : s.Nonempty) (ht : t.Nonempty) (f : β → γ → α) :
    (s.inf' hs fun b => t.inf' ht (f b)) = t.inf' ht fun c => s.inf' hs fun b => f b c :=
  @Finset.sup'_comm αᵒᵈ _ _ _ _ _ hs ht _
Commutativity of Nested Infima in Meet-Semilattice
Informal description
Let $s$ be a nonempty finite set of elements of type $\beta$, $t$ a nonempty finite set of elements of type $\gamma$, and $f : \beta \to \gamma \to \alpha$ a function where $\alpha$ is a meet-semilattice. Then the following equality holds: \[ \inf'_{b \in s} \left( \inf'_{c \in t} f(b, c) \right) = \inf'_{c \in t} \left( \inf'_{b \in s} f(b, c) \right) \] where $\inf'$ denotes the infimum operation for nonempty finite sets in the meet-semilattice $\alpha$.
Finset.comp_inf'_eq_inf'_comp theorem
[SemilatticeInf γ] {s : Finset β} (H : s.Nonempty) {f : β → α} (g : α → γ) (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) : g (s.inf' H f) = s.inf' H (g ∘ f)
Full source
theorem comp_inf'_eq_inf'_comp [SemilatticeInf γ] {s : Finset β} (H : s.Nonempty) {f : β → α}
    (g : α → γ) (g_inf : ∀ x y, g (x ⊓ y) = g x ⊓ g y) : g (s.inf' H f) = s.inf' H (g ∘ f) :=
  comp_sup'_eq_sup'_comp (α := αᵒᵈ) (γ := γᵒᵈ) H g g_inf
Infimum Preservation under Function Composition: $g(\inf' s f) = \inf' s (g \circ f)$
Informal description
Let $\alpha$ and $\gamma$ be meet-semilattices, $s$ a nonempty finite set of elements of type $\beta$, $f : \beta \to \alpha$ a function, and $g : \alpha \to \gamma$ a function that preserves infima (i.e., $g(x \sqcap y) = g(x) \sqcap g(y)$ for all $x, y \in \alpha$). Then the image of the infimum of $f$ over $s$ under $g$ is equal to the infimum of $g \circ f$ over $s$: \[ g\left(\inf' s H f\right) = \inf' s H (g \circ f). \]
Finset.inf'_induction theorem
{p : α → Prop} (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊓ a₂)) (hs : ∀ b ∈ s, p (f b)) : p (s.inf' H f)
Full source
theorem inf'_induction {p : α → Prop} (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊓ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.inf' H f) :=
  sup'_induction (α := αᵒᵈ) H f hp hs
Induction Principle for Infimum over Nonempty Finite Sets in a Meet-Semilattice
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set of elements of type $\beta$, and $f : \beta \to \alpha$ a function. For any predicate $p : \alpha \to \mathrm{Prop}$ such that: 1. For any $a_1, a_2 \in \alpha$, if $p(a_1)$ and $p(a_2)$ hold, then $p(a_1 \sqcap a_2)$ holds, 2. For every $b \in s$, $p(f(b))$ holds, then $p(\inf'_{b \in s} f(b))$ holds, where $\inf'$ denotes the infimum operation for nonempty finite sets in $\alpha$.
Finset.inf'_mem theorem
(s : Set α) (w : ∀ᵉ (x ∈ s) (y ∈ s), x ⊓ y ∈ s) {ι : Type*} (t : Finset ι) (H : t.Nonempty) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.inf' H p ∈ s
Full source
theorem inf'_mem (s : Set α) (w : ∀ᵉ (x ∈ s) (y ∈ s), x ⊓ y ∈ s) {ι : Type*}
    (t : Finset ι) (H : t.Nonempty) (p : ι → α) (h : ∀ i ∈ t, p i ∈ s) : t.inf' H p ∈ s :=
  inf'_induction H p w h
Closure of Meet-Closed Set under Finite Infima
Informal description
Let $\alpha$ be a meet-semilattice and $s \subseteq \alpha$ a subset closed under meets (i.e., for any $x, y \in s$, we have $x \sqcap y \in s$). For any nonempty finite set $t$ indexed by type $\iota$ and any function $p \colon \iota \to \alpha$ such that $p(i) \in s$ for all $i \in t$, the infimum $\inf'_{i \in t} p(i)$ belongs to $s$.
Finset.inf'_congr theorem
{t : Finset β} {f g : β → α} (h₁ : s = t) (h₂ : ∀ x ∈ s, f x = g x) : s.inf' H f = t.inf' (h₁ ▸ H) g
Full source
@[congr]
theorem inf'_congr {t : Finset β} {f g : β → α} (h₁ : s = t) (h₂ : ∀ x ∈ s, f x = g x) :
    s.inf' H f = t.inf' (h₁ ▸ H) g :=
  sup'_congr (α := αᵒᵈ) H h₁ h₂
Infimum Congruence for Nonempty Finite Sets in a Meet-Semilattice
Informal description
Let $s$ and $t$ be nonempty finite sets of type $\beta$ in a meet-semilattice $\alpha$, and let $f, g \colon \beta \to \alpha$ be functions. If $s = t$ and for every $x \in s$ we have $f(x) = g(x)$, then the infima $\inf'_{x \in s} f(x)$ and $\inf'_{x \in t} g(x)$ are equal.
map_finset_inf' theorem
[SemilatticeInf β] [FunLike F α β] [InfHomClass F α β] (f : F) {s : Finset ι} (hs) (g : ι → α) : f (s.inf' hs g) = s.inf' hs (f ∘ g)
Full source
@[simp]
theorem _root_.map_finset_inf' [SemilatticeInf β] [FunLike F α β] [InfHomClass F α β]
    (f : F) {s : Finset ι} (hs) (g : ι → α) :
    f (s.inf' hs g) = s.inf' hs (f ∘ g) := by
  refine hs.cons_induction ?_ ?_ <;> intros <;> simp [*]
Infimum-Preserving Function Commutes with Finite Infima: $f(\inf_{x \in s} g(x)) = \inf_{x \in s} f(g(x))$
Informal description
Let $\alpha$ and $\beta$ be meet-semilattices, and let $F$ be a type of functions from $\alpha$ to $\beta$ that preserves infima (i.e., $f(x \sqcap y) = f(x) \sqcap f(y)$ for all $x, y \in \alpha$). For any nonempty finite set $s$ of type $\iota$ and any function $g \colon \iota \to \alpha$, the infimum-preserving function $f \colon F$ satisfies: \[ f\left(\inf_{x \in s} g(x)\right) = \inf_{x \in s} (f \circ g)(x), \] where $\inf$ denotes the infimum operation for nonempty finite sets.
Finset.inf'_image theorem
[DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty) (g : β → α) : (s.image f).inf' hs g = s.inf' hs.of_image (g ∘ f)
Full source
/-- To rewrite from right to left, use `Finset.inf'_comp_eq_image`. -/
@[simp]
theorem inf'_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty)
    (g : β → α) :
    (s.image f).inf' hs g = s.inf' hs.of_image (g ∘ f) :=
  @sup'_image αᵒᵈ _ _ _ _ _ _ hs _
Infimum of Function over Image Equals Infimum of Composition for Nonempty Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice, $\beta$ and $\gamma$ types with decidable equality on $\beta$. Given a finite set $s \subseteq \gamma$, a function $f : \gamma \to \beta$, and a function $g : \beta \to \alpha$, if the image $f(s)$ is nonempty, then the infimum of $g$ over $f(s)$ equals the infimum of $g \circ f$ over $s$. That is, \[ \inf'_{x \in f(s)} g(x) = \inf'_{y \in s} g(f(y)), \] where $\inf'$ denotes the infimum operation for nonempty finite sets.
Finset.inf'_comp_eq_image theorem
[DecidableEq β] {s : Finset γ} {f : γ → β} (hs : s.Nonempty) (g : β → α) : s.inf' hs (g ∘ f) = (s.image f).inf' (hs.image f) g
Full source
/-- A version of `Finset.inf'_image` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma inf'_comp_eq_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : s.Nonempty) (g : β → α) :
    s.inf' hs (g ∘ f) = (s.image f).inf' (hs.image f) g :=
  sup'_comp_eq_image (α := αᵒᵈ) hs g
Infimum of Composition Equals Infimum over Image for Nonempty Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice, $\beta$ and $\gamma$ types with decidable equality on $\beta$. Given a nonempty finite set $s \subseteq \gamma$, a function $f : \gamma \to \beta$, and a function $g : \beta \to \alpha$, the infimum of $g \circ f$ over $s$ equals the infimum of $g$ over the image $f(s)$. That is, \[ \inf'_{y \in s} g(f(y)) = \inf'_{x \in f(s)} g(x), \] where $\inf'$ denotes the infimum operation for nonempty finite sets.
Finset.inf'_map theorem
{s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty) : (s.map f).inf' hs g = s.inf' (map_nonempty.1 hs) (g ∘ f)
Full source
/-- To rewrite from right to left, use `Finset.inf'_comp_eq_map`. -/
@[simp]
theorem inf'_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty) :
    (s.map f).inf' hs g = s.inf' (map_nonempty.1 hs) (g ∘ f) :=
  sup'_map (α := αᵒᵈ) _ hs
Infimum Preservation under Injective Mapping for Nonempty Finite Sets
Informal description
Let $s$ be a finite set of elements of type $\gamma$, $f : \gamma \hookrightarrow \beta$ be an injective function embedding, and $g : \beta \to \alpha$ be a function where $\alpha$ is a meet-semilattice. If the image of $s$ under $f$ is nonempty, then the infimum of $g$ over $f(s)$ is equal to the infimum of $g \circ f$ over $s$, i.e., \[ \inf' (f(s)) \, g = \inf' s \, (g \circ f). \]
Finset.inf'_comp_eq_map theorem
{s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : s.Nonempty) : s.inf' hs (g ∘ f) = (s.map f).inf' (map_nonempty.2 hs) g
Full source
/-- A version of `Finset.inf'_map` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma inf'_comp_eq_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : s.Nonempty) :
    s.inf' hs (g ∘ f) = (s.map f).inf' (map_nonempty.2 hs) g :=
  sup'_comp_eq_map (α := αᵒᵈ) g hs
Infimum of Composition Equals Infimum over Image for Nonempty Finite Sets
Informal description
Let $s$ be a nonempty finite set of elements of type $\gamma$, $f : \gamma \hookrightarrow \beta$ be an injective function embedding, and $g : \beta \to \alpha$ be a function where $\alpha$ is a meet-semilattice. Then the infimum of $g \circ f$ over $s$ is equal to the infimum of $g$ over the image of $s$ under $f$, i.e., \[ \inf' s \, (g \circ f) = \inf' (f(s)) \, g. \]
Finset.inf'_mono theorem
{s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonempty) : s₂.inf' (h₁.mono h) f ≤ s₁.inf' h₁ f
Full source
@[gcongr]
theorem inf'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonempty) :
    s₂.inf' (h₁.mono h) f ≤ s₁.inf' h₁ f :=
  Finset.le_inf' h₁ _ (fun _ hb => inf'_le _ (h hb))
Monotonicity of Infimum under Subset Inclusion for Nonempty Finite Sets
Informal description
Let $\alpha$ be a meet-semilattice, $s_1$ and $s_2$ be finite sets of elements of type $\beta$ such that $s_1 \subseteq s_2$, and $f : \beta \to \alpha$ be a function. If $s_1$ is nonempty, then the infimum of $f$ over $s_2$ is less than or equal to the infimum of $f$ over $s_1$, i.e., \[ \inf_{b \in s_2} f(b) \leq \inf_{b \in s_1} f(b). \]
Finset.sup'_eq_sup theorem
{s : Finset β} (H : s.Nonempty) (f : β → α) : s.sup' H f = s.sup f
Full source
theorem sup'_eq_sup {s : Finset β} (H : s.Nonempty) (f : β → α) : s.sup' H f = s.sup f :=
  le_antisymm (sup'_le H f fun _ => le_sup) (Finset.sup_le fun _ => le_sup' f)
Equality of Nonempty Finite Suprema: $\sup' s f = \sup s f$ for Nonempty $s$
Informal description
For any nonempty finite set $s$ of elements of type $\beta$ and any function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, the supremum $\sup' s f$ (defined using the nonemptiness proof $H$) is equal to the supremum $\sup s f$.
Finset.coe_sup_of_nonempty theorem
{s : Finset β} (h : s.Nonempty) (f : β → α) : (↑(s.sup f) : WithBot α) = s.sup ((↑) ∘ f)
Full source
theorem coe_sup_of_nonempty {s : Finset β} (h : s.Nonempty) (f : β → α) :
    (↑(s.sup f) : WithBot α) = s.sup ((↑) ∘ f) := by simp only [← sup'_eq_sup h, coe_sup' h]
Embedding Commutes with Supremum for Nonempty Finite Sets
Informal description
For any nonempty finite set $s$ of elements of type $\beta$ and any function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, the embedding of the supremum $\sup s f$ in $\alpha$ into $\text{WithBot }\alpha$ is equal to the supremum of the set $s$ under the composition of $f$ with the embedding of $\alpha$ into $\text{WithBot }\alpha$. That is, $$(\sup s f : \text{WithBot }\alpha) = \sup s (f \circ \text{some})$$ where $\text{some} : \alpha \to \text{WithBot }\alpha$ is the embedding map.
Finset.inf'_eq_inf theorem
{s : Finset β} (H : s.Nonempty) (f : β → α) : s.inf' H f = s.inf f
Full source
theorem inf'_eq_inf {s : Finset β} (H : s.Nonempty) (f : β → α) : s.inf' H f = s.inf f :=
  sup'_eq_sup (α := αᵒᵈ) H f
Equality of Nonempty Finite Infima: $\inf' s f = \inf s f$ for Nonempty $s$
Informal description
For any nonempty finite set $s$ of elements of type $\beta$ and any function $f \colon \beta \to \alpha$ where $\alpha$ is a meet-semilattice with a top element, the infimum $\inf' s f$ (defined using the nonemptiness proof $H$) is equal to the infimum $\inf s f$.
Finset.coe_inf_of_nonempty theorem
{s : Finset β} (h : s.Nonempty) (f : β → α) : (↑(s.inf f) : WithTop α) = s.inf ((↑) ∘ f)
Full source
theorem coe_inf_of_nonempty {s : Finset β} (h : s.Nonempty) (f : β → α) :
    (↑(s.inf f) : WithTop α) = s.inf ((↑) ∘ f) :=
  coe_sup_of_nonempty (α := αᵒᵈ) h f
Embedding Commutes with Infimum for Nonempty Finite Sets
Informal description
For any nonempty finite set $s$ of elements of type $\beta$ and any function $f \colon \beta \to \alpha$ where $\alpha$ is a meet-semilattice with a top element, the embedding of the infimum $\inf_{a \in s} f(a)$ in $\alpha$ into $\text{WithTop}\ \alpha$ is equal to the infimum of the set $s$ under the composition of $f$ with the embedding of $\alpha$ into $\text{WithTop}\ \alpha$. That is, $$(\inf_{a \in s} f(a) : \text{WithTop}\ \alpha) = \inf_{a \in s} (f(a) : \text{WithTop}\ \alpha)$$ where the embedding $\alpha \to \text{WithTop}\ \alpha$ is the canonical injection.
Finset.sup_apply theorem
{C : β → Type*} [∀ b : β, SemilatticeSup (C b)] [∀ b : β, OrderBot (C b)] (s : Finset α) (f : α → ∀ b : β, C b) (b : β) : s.sup f b = s.sup fun a => f a b
Full source
@[simp]
protected theorem sup_apply {C : β → Type*} [∀ b : β, SemilatticeSup (C b)]
    [∀ b : β, OrderBot (C b)] (s : Finset α) (f : α → ∀ b : β, C b) (b : β) :
    s.sup f b = s.sup fun a => f a b :=
  comp_sup_eq_sup_comp (fun x : ∀ b : β, C b => x b) (fun _ _ => rfl) rfl
Pointwise Supremum of a Function over a Finite Set
Informal description
Let $\beta$ be a type, and for each $b \in \beta$, let $C(b)$ be a join-semilattice with a bottom element $\bot_{C(b)}$. Given a finite set $s \subseteq \alpha$ and a function $f : \alpha \to \prod_{b \in \beta} C(b)$, the supremum of $f$ over $s$ evaluated at any $b \in \beta$ is equal to the supremum over $s$ of the function $a \mapsto f(a)(b)$. In other words, for any $b \in \beta$, \[ \left(\sup_{a \in s} f(a)\right)(b) = \sup_{a \in s} f(a)(b). \]
Finset.inf_apply theorem
{C : β → Type*} [∀ b : β, SemilatticeInf (C b)] [∀ b : β, OrderTop (C b)] (s : Finset α) (f : α → ∀ b : β, C b) (b : β) : s.inf f b = s.inf fun a => f a b
Full source
@[simp]
protected theorem inf_apply {C : β → Type*} [∀ b : β, SemilatticeInf (C b)]
    [∀ b : β, OrderTop (C b)] (s : Finset α) (f : α → ∀ b : β, C b) (b : β) :
    s.inf f b = s.inf fun a => f a b :=
  Finset.sup_apply (C := fun b => (C b)ᵒᵈ) s f b
Pointwise Infimum of a Function over a Finite Set
Informal description
Let $\beta$ be a type, and for each $b \in \beta$, let $C(b)$ be a meet-semilattice with a greatest element $\top_{C(b)}$. Given a finite set $s \subseteq \alpha$ and a function $f : \alpha \to \prod_{b \in \beta} C(b)$, the infimum of $f$ over $s$ evaluated at any $b \in \beta$ is equal to the infimum over $s$ of the function $a \mapsto f(a)(b)$. In other words, for any $b \in \beta$, \[ \left(\inf_{a \in s} f(a)\right)(b) = \inf_{a \in s} f(a)(b). \]
Finset.sup'_apply theorem
{C : β → Type*} [∀ b : β, SemilatticeSup (C b)] {s : Finset α} (H : s.Nonempty) (f : α → ∀ b : β, C b) (b : β) : s.sup' H f b = s.sup' H fun a => f a b
Full source
@[simp]
protected theorem sup'_apply {C : β → Type*} [∀ b : β, SemilatticeSup (C b)]
    {s : Finset α} (H : s.Nonempty) (f : α → ∀ b : β, C b) (b : β) :
    s.sup' H f b = s.sup' H fun a => f a b :=
  comp_sup'_eq_sup'_comp H (fun x : ∀ b : β, C b => x b) fun _ _ => rfl
Pointwise Supremum of a Function over a Nonempty Finite Set
Informal description
Let $\beta$ be a type, and for each $b \in \beta$, let $C(b)$ be a join-semilattice. Given a nonempty finite set $s \subseteq \alpha$ and a function $f : \alpha \to \prod_{b \in \beta} C(b)$, the supremum of $f$ over $s$ evaluated at any $b \in \beta$ is equal to the supremum over $s$ of the function $a \mapsto f(a)(b)$. That is, for any $b \in \beta$, \[ \left(\sup_{a \in s} f(a)\right)(b) = \sup_{a \in s} f(a)(b). \]
Finset.inf'_apply theorem
{C : β → Type*} [∀ b : β, SemilatticeInf (C b)] {s : Finset α} (H : s.Nonempty) (f : α → ∀ b : β, C b) (b : β) : s.inf' H f b = s.inf' H fun a => f a b
Full source
@[simp]
protected theorem inf'_apply {C : β → Type*} [∀ b : β, SemilatticeInf (C b)]
    {s : Finset α} (H : s.Nonempty) (f : α → ∀ b : β, C b) (b : β) :
    s.inf' H f b = s.inf' H fun a => f a b :=
  Finset.sup'_apply (C := fun b => (C b)ᵒᵈ) H f b
Pointwise Infimum of a Function over a Nonempty Finite Set
Informal description
Let $\beta$ be a type, and for each $b \in \beta$, let $C(b)$ be a meet-semilattice. Given a nonempty finite set $s \subseteq \alpha$ and a function $f : \alpha \to \prod_{b \in \beta} C(b)$, the infimum of $f$ over $s$ evaluated at any $b \in \beta$ is equal to the infimum over $s$ of the function $a \mapsto f(a)(b)$. That is, for any $b \in \beta$, \[ \left(\inf_{a \in s} f(a)\right)(b) = \inf_{a \in s} f(a)(b). \]
Finset.toDual_sup' theorem
[SemilatticeSup α] {s : Finset ι} (hs : s.Nonempty) (f : ι → α) : toDual (s.sup' hs f) = s.inf' hs (toDual ∘ f)
Full source
@[simp]
theorem toDual_sup' [SemilatticeSup α] {s : Finset ι} (hs : s.Nonempty) (f : ι → α) :
    toDual (s.sup' hs f) = s.inf' hs (toDualtoDual ∘ f) :=
  rfl
Duality between Supremum and Infimum via Order Dual
Informal description
Let $\alpha$ be a join-semilattice, $s$ be a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. Then, the order dual of the supremum of $f$ over $s$ is equal to the infimum of the order dual of $f$ over $s$. In symbols: \[ \text{toDual}\left(\sup_{i \in s} f(i)\right) = \inf_{i \in s} \text{toDual}(f(i)), \] where $\text{toDual} \colon \alpha \to \alpha^{\text{op}}$ is the canonical order-reversing bijection.
Finset.toDual_inf' theorem
[SemilatticeInf α] {s : Finset ι} (hs : s.Nonempty) (f : ι → α) : toDual (s.inf' hs f) = s.sup' hs (toDual ∘ f)
Full source
@[simp]
theorem toDual_inf' [SemilatticeInf α] {s : Finset ι} (hs : s.Nonempty) (f : ι → α) :
    toDual (s.inf' hs f) = s.sup' hs (toDualtoDual ∘ f) :=
  rfl
Duality between infimum and supremum under order reversal
Informal description
Let $\alpha$ be a meet-semilattice, $s$ be a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha$ be a function. Then the order dual of the infimum of $f$ over $s$ equals the supremum of the order dual of $f$ over $s$. In symbols: $$ \text{toDual}\left(\inf_{a \in s} f(a)\right) = \sup_{a \in s} \text{toDual}(f(a)) $$ where $\text{toDual} \colon \alpha \to \alpha^{\text{op}}$ is the canonical order-reversing bijection.
Finset.ofDual_sup' theorem
[SemilatticeInf α] {s : Finset ι} (hs : s.Nonempty) (f : ι → αᵒᵈ) : ofDual (s.sup' hs f) = s.inf' hs (ofDual ∘ f)
Full source
@[simp]
theorem ofDual_sup' [SemilatticeInf α] {s : Finset ι} (hs : s.Nonempty) (f : ι → αᵒᵈ) :
    ofDual (s.sup' hs f) = s.inf' hs (ofDualofDual ∘ f) :=
  rfl
Duality between Supremum and Infimum under Order Reversal
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set indexed by $\iota$, and $f \colon \iota \to \alpha^{\text{op}}$ a function. Then the image under the order duality map $\text{ofDual}$ of the supremum of $f$ over $s$ equals the infimum of $\text{ofDual} \circ f$ over $s$. In symbols: \[ \text{ofDual}\left(\sup_{i \in s} f(i)\right) = \inf_{i \in s} \text{ofDual}(f(i)) \]
Finset.ofDual_inf' theorem
[SemilatticeSup α] {s : Finset ι} (hs : s.Nonempty) (f : ι → αᵒᵈ) : ofDual (s.inf' hs f) = s.sup' hs (ofDual ∘ f)
Full source
@[simp]
theorem ofDual_inf' [SemilatticeSup α] {s : Finset ι} (hs : s.Nonempty) (f : ι → αᵒᵈ) :
    ofDual (s.inf' hs f) = s.sup' hs (ofDualofDual ∘ f) :=
  rfl
Order Dual Infimum-Supremum Equivalence for Finite Sets
Informal description
Let $\alpha$ be a join-semilattice and $s$ be a nonempty finite set of indices. For any function $f \colon \iota \to \alpha^{\text{op}}$, the image of the infimum of $f$ over $s$ under the order dual map $\text{ofDual} \colon \alpha^{\text{op}} \to \alpha$ is equal to the supremum of $\text{ofDual} \circ f$ over $s$. In symbols: \[ \text{ofDual}\left(\inf_{i \in s} f(i)\right) = \sup_{i \in s} \text{ofDual}(f(i)) \]
Finset.sup'_inf_distrib_left theorem
(f : ι → α) (a : α) : a ⊓ s.sup' hs f = s.sup' hs fun i ↦ a ⊓ f i
Full source
theorem sup'_inf_distrib_left (f : ι → α) (a : α) :
    a ⊓ s.sup' hs f = s.sup' hs fun i ↦ a ⊓ f i := by
  induction hs using Finset.Nonempty.cons_induction with
  | singleton => simp
  | cons _ _ _ hs ih => simp_rw [sup'_cons hs, inf_sup_left, ih]
Left Distributivity of Meet over Finite Supremum: $a \sqcap \left(\sup_{i \in s} f(i)\right) = \sup_{i \in s} (a \sqcap f(i))$
Informal description
Let $\alpha$ be a distributive lattice, $s$ a nonempty finite set of indices, and $f \colon \iota \to \alpha$ a function. For any element $a \in \alpha$, the meet of $a$ with the supremum of $f$ over $s$ equals the supremum over $s$ of the meets of $a$ with each $f(i)$. In symbols: \[ a \sqcap \left(\sup_{i \in s} f(i)\right) = \sup_{i \in s} (a \sqcap f(i)) \]
Finset.sup'_inf_distrib_right theorem
(f : ι → α) (a : α) : s.sup' hs f ⊓ a = s.sup' hs fun i => f i ⊓ a
Full source
theorem sup'_inf_distrib_right (f : ι → α) (a : α) :
    s.sup' hs f ⊓ a = s.sup' hs fun i => f i ⊓ a := by
  rw [inf_comm, sup'_inf_distrib_left]; simp_rw [inf_comm]
Right Distributivity of Meet over Finite Supremum: $\left(\sup_{i \in s} f(i)\right) \sqcap a = \sup_{i \in s} (f(i) \sqcap a)$
Informal description
Let $\alpha$ be a distributive lattice, $s$ a nonempty finite set of indices, and $f \colon \iota \to \alpha$ a function. For any element $a \in \alpha$, the meet of the supremum of $f$ over $s$ with $a$ equals the supremum over $s$ of the meets of each $f(i)$ with $a$. In symbols: \[ \left(\sup_{i \in s} f(i)\right) \sqcap a = \sup_{i \in s} (f(i) \sqcap a) \]
Finset.inf'_sup_distrib_left theorem
(f : ι → α) (a : α) : a ⊔ s.inf' hs f = s.inf' hs fun i => a ⊔ f i
Full source
theorem inf'_sup_distrib_left (f : ι → α) (a : α) : a ⊔ s.inf' hs f = s.inf' hs fun i => a ⊔ f i :=
  @sup'_inf_distrib_left αᵒᵈ _ _ _ hs _ _
Left Distributivity of Join over Finite Infimum: $a \sqcup \left(\inf_{i \in s} f(i)\right) = \inf_{i \in s} (a \sqcup f(i))$
Informal description
Let $\alpha$ be a distributive lattice, $s$ a nonempty finite set of indices, and $f \colon \iota \to \alpha$ a function. For any element $a \in \alpha$, the join of $a$ with the infimum of $f$ over $s$ equals the infimum over $s$ of the joins of $a$ with each $f(i)$. In symbols: \[ a \sqcup \left(\inf_{i \in s} f(i)\right) = \inf_{i \in s} (a \sqcup f(i)) \]
Finset.inf'_sup_distrib_right theorem
(f : ι → α) (a : α) : s.inf' hs f ⊔ a = s.inf' hs fun i => f i ⊔ a
Full source
theorem inf'_sup_distrib_right (f : ι → α) (a : α) : s.inf' hs f ⊔ a = s.inf' hs fun i => f i ⊔ a :=
  @sup'_inf_distrib_right αᵒᵈ _ _ _ hs _ _
Right Distributivity of Join over Finite Infimum: $\left(\inf_{i \in s} f(i)\right) \sqcup a = \inf_{i \in s} (f(i) \sqcup a)$
Informal description
Let $\alpha$ be a distributive lattice, $s$ a nonempty finite set of indices, and $f \colon \iota \to \alpha$ a function. For any element $a \in \alpha$, the join of the infimum of $f$ over $s$ with $a$ equals the infimum over $s$ of the joins of each $f(i)$ with $a$. In symbols: \[ \left(\inf_{i \in s} f(i)\right) \sqcup a = \inf_{i \in s} (f(i) \sqcup a) \]
Finset.comp_sup_eq_sup_comp_of_nonempty theorem
[OrderBot α] [SemilatticeSup β] [OrderBot β] {g : α → β} (mono_g : Monotone g) (H : s.Nonempty) : g (s.sup f) = s.sup (g ∘ f)
Full source
theorem comp_sup_eq_sup_comp_of_nonempty [OrderBot α] [SemilatticeSup β] [OrderBot β]
    {g : α → β} (mono_g : Monotone g) (H : s.Nonempty) : g (s.sup f) = s.sup (g ∘ f) := by
  rw [← Finset.sup'_eq_sup H, ← Finset.sup'_eq_sup H]
  exact Finset.comp_sup'_eq_sup'_comp H g (fun x y ↦ Monotone.map_sup mono_g x y)
Monotone Functions Preserve Finite Suprema: $g(\sup s f) = \sup s (g \circ f)$ for Nonempty $s$
Informal description
Let $\alpha$ and $\beta$ be join-semilattices with bottom elements $\bot_\alpha$ and $\bot_\beta$ respectively. Given a nonempty finite set $s$ of elements of type $\iota$, a function $f : \iota \to \alpha$, and a monotone function $g : \alpha \to \beta$, the image of the supremum of $f$ over $s$ under $g$ is equal to the supremum of $g \circ f$ over $s$: \[ g\left(\sup s f\right) = \sup s (g \circ f). \]
Finset.le_sup'_iff theorem
: a ≤ s.sup' H f ↔ ∃ b ∈ s, a ≤ f b
Full source
@[simp]
theorem le_sup'_iff : a ≤ s.sup' H f ↔ ∃ b ∈ s, a ≤ f b := by
  rw [← WithBot.coe_le_coe, coe_sup', Finset.le_sup_iff (WithBot.bot_lt_coe a)]
  exact exists_congr (fun _ => and_congr_right' WithBot.coe_le_coe)
Characterization of Supremum in Nonempty Finite Sets: $a \leq \sup' s f \leftrightarrow \exists b \in s, a \leq f(b)$
Informal description
For a nonempty finite set $s$ of elements of type $\beta$, a function $f : \beta \to \alpha$ where $\alpha$ is a join-semilattice, and an element $a \in \alpha$, we have \[ a \leq \sup' s H f \quad \text{if and only if} \quad \exists b \in s, \ a \leq f(b), \] where $H$ is a proof that $s$ is nonempty.
Finset.lt_sup'_iff theorem
: a < s.sup' H f ↔ ∃ b ∈ s, a < f b
Full source
@[simp]
theorem lt_sup'_iff : a < s.sup' H f ↔ ∃ b ∈ s, a < f b := by
  rw [← WithBot.coe_lt_coe, coe_sup', Finset.lt_sup_iff]
  exact exists_congr (fun _ => and_congr_right' WithBot.coe_lt_coe)
Characterization of Strict Inequality Under Finite Supremum: $a < \sup'_s f \leftrightarrow \exists b \in s, a < f(b)$
Informal description
For any element $a$ in a join-semilattice $\alpha$, a nonempty finite set $s$ of elements of type $\beta$, and a function $f : \beta \to \alpha$, the inequality $a < \sup'_{x \in s} f(x)$ holds if and only if there exists an element $b \in s$ such that $a < f(b)$.
Finset.sup'_lt_iff theorem
: s.sup' H f < a ↔ ∀ i ∈ s, f i < a
Full source
@[simp]
theorem sup'_lt_iff : s.sup' H f < a ↔ ∀ i ∈ s, f i < a := by
  rw [← WithBot.coe_lt_coe, coe_sup', Finset.sup_lt_iff (WithBot.bot_lt_coe a)]
  exact forall₂_congr (fun _ _ => WithBot.coe_lt_coe)
Supremum Strictly Less Than Criterion for Nonempty Finite Sets: $\sup'_s f < a \leftrightarrow \forall i \in s, f(i) < a$
Informal description
Let $\alpha$ be a join-semilattice, $s$ a nonempty finite set of elements of type $\beta$, $f : \beta \to \alpha$ a function, and $H$ a proof that $s$ is nonempty. For any $a \in \alpha$, the supremum $\sup' s H f$ is strictly less than $a$ if and only if for every $i \in s$, $f(i) < a$. That is, \[ \sup' s H f < a \leftrightarrow \forall i \in s, f(i) < a. \]
Finset.inf'_le_iff theorem
: s.inf' H f ≤ a ↔ ∃ i ∈ s, f i ≤ a
Full source
@[simp]
theorem inf'_le_iff : s.inf' H f ≤ a ↔ ∃ i ∈ s, f i ≤ a :=
  le_sup'_iff (α := αᵒᵈ) H
Characterization of Infimum in Nonempty Finite Sets: $\inf' s f \leq a \leftrightarrow \exists i \in s, f(i) \leq a$
Informal description
For a nonempty finite set $s$ in a meet-semilattice $\alpha$, a function $f \colon \beta \to \alpha$, and an element $a \in \alpha$, the infimum $\inf' s H f$ is less than or equal to $a$ if and only if there exists an element $i \in s$ such that $f(i) \leq a$.
Finset.inf'_lt_iff theorem
: s.inf' H f < a ↔ ∃ i ∈ s, f i < a
Full source
@[simp]
theorem inf'_lt_iff : s.inf' H f < a ↔ ∃ i ∈ s, f i < a :=
  lt_sup'_iff (α := αᵒᵈ) H
Characterization of Strict Inequality Under Finite Infimum: $\inf'_s f < a \leftrightarrow \exists i \in s, f(i) < a$
Informal description
For a nonempty finite set $s$ in a meet-semilattice $\alpha$, a function $f \colon \beta \to \alpha$, and an element $a \in \alpha$, the infimum $\inf'_{x \in s} f(x)$ is strictly less than $a$ if and only if there exists an element $i \in s$ such that $f(i) < a$. In symbols: \[ \inf'_{x \in s} f(x) < a \leftrightarrow \exists i \in s, f(i) < a. \]
Finset.lt_inf'_iff theorem
: a < s.inf' H f ↔ ∀ i ∈ s, a < f i
Full source
@[simp]
theorem lt_inf'_iff : a < s.inf' H f ↔ ∀ i ∈ s, a < f i :=
  sup'_lt_iff (α := αᵒᵈ) H
Strictly Less Than Infimum Criterion for Nonempty Finite Sets: $a < \inf'_s f \leftrightarrow \forall i \in s, a < f(i)$
Informal description
Let $\alpha$ be a meet-semilattice, $s$ a nonempty finite set of elements of type $\beta$, $f : \beta \to \alpha$ a function, and $H$ a proof that $s$ is nonempty. For any $a \in \alpha$, the element $a$ is strictly less than the infimum $\inf' s H f$ if and only if for every $i \in s$, $a$ is strictly less than $f(i)$. That is, \[ a < \inf' s H f \leftrightarrow \forall i \in s, a < f(i). \]
Finset.exists_mem_eq_sup' theorem
(f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i
Full source
theorem exists_mem_eq_sup' (f : ι → α) : ∃ i, i ∈ s ∧ s.sup' H f = f i := by
  induction H using Finset.Nonempty.cons_induction with
  | singleton c =>  exact ⟨c, mem_singleton_self c, rfl⟩
  | cons c s hcs hs ih =>
    rcases ih with ⟨b, hb, h'⟩
    rw [sup'_cons hs, h']
    cases le_total (f b) (f c) with
    | inl h => exact ⟨c, mem_cons.2 (Or.inl rfl), sup_eq_left.2 h⟩
    | inr h => exact ⟨b, mem_cons.2 (Or.inr hb), sup_eq_right.2 h⟩
Existence of a Member Achieving the Supremum in a Finite Set
Informal description
For any nonempty finite set $s$ of elements of type $\iota$ and any function $f : \iota \to \alpha$ where $\alpha$ is a join-semilattice, there exists an element $i \in s$ such that the supremum of $f$ over $s$ equals $f(i)$. In other words, the supremum is achieved by some element in the set.
Finset.exists_mem_eq_inf' theorem
(f : ι → α) : ∃ i, i ∈ s ∧ s.inf' H f = f i
Full source
theorem exists_mem_eq_inf' (f : ι → α) : ∃ i, i ∈ s ∧ s.inf' H f = f i :=
  exists_mem_eq_sup' (α := αᵒᵈ) H f
Existence of a Member Achieving the Infimum in a Finite Set
Informal description
For any nonempty finite set $s$ of elements of type $\iota$ and any function $f : \iota \to \alpha$ where $\alpha$ is a meet-semilattice, there exists an element $i \in s$ such that the infimum of $f$ over $s$ equals $f(i)$. In other words, the infimum is achieved by some element in the set.
Finset.exists_mem_eq_sup theorem
[OrderBot α] (s : Finset ι) (h : s.Nonempty) (f : ι → α) : ∃ i, i ∈ s ∧ s.sup f = f i
Full source
theorem exists_mem_eq_sup [OrderBot α] (s : Finset ι) (h : s.Nonempty) (f : ι → α) :
    ∃ i, i ∈ s ∧ s.sup f = f i :=
  sup'_eq_sup h f ▸ exists_mem_eq_sup' h f
Existence of a Member Achieving the Supremum in a Nonempty Finite Set
Informal description
Let $\alpha$ be a join-semilattice with a bottom element $\bot$, and let $s$ be a nonempty finite set of elements of type $\iota$. For any function $f : \iota \to \alpha$, there exists an element $i \in s$ such that the supremum of $f$ over $s$ equals $f(i)$, i.e., $\sup_{x \in s} f(x) = f(i)$.
Finset.exists_mem_eq_inf theorem
[OrderTop α] (s : Finset ι) (h : s.Nonempty) (f : ι → α) : ∃ i, i ∈ s ∧ s.inf f = f i
Full source
theorem exists_mem_eq_inf [OrderTop α] (s : Finset ι) (h : s.Nonempty) (f : ι → α) :
    ∃ i, i ∈ s ∧ s.inf f = f i :=
  exists_mem_eq_sup (α := αᵒᵈ) s h f
Existence of a Member Achieving the Infimum in a Nonempty Finite Set
Informal description
Let $\alpha$ be a meet-semilattice with a top element $\top$, and let $s$ be a nonempty finite set of elements of type $\iota$. For any function $f : \iota \to \alpha$, there exists an element $i \in s$ such that the infimum of $f$ over $s$ equals $f(i)$, i.e., $\inf_{x \in s} f(x) = f(i)$.
Multiset.map_finset_sup theorem
[DecidableEq α] [DecidableEq β] (s : Finset γ) (f : γ → Multiset β) (g : β → α) (hg : Function.Injective g) : map g (s.sup f) = s.sup (map g ∘ f)
Full source
theorem map_finset_sup [DecidableEq α] [DecidableEq β] (s : Finset γ) (f : γ → Multiset β)
    (g : β → α) (hg : Function.Injective g) : map g (s.sup f) = s.sup (mapmap g ∘ f) :=
  Finset.comp_sup_eq_sup_comp _ (fun _ _ => map_union hg) (map_zero _)
Image of Multiset Supremum under Injective Map Equals Supremum of Images
Informal description
Let $\alpha$, $\beta$, and $\gamma$ be types with decidable equality. Given a finite set $s \subseteq \gamma$, a function $f : \gamma \to \text{Multiset}(\beta)$, and an injective function $g : \beta \to \alpha$, the image under $g$ of the supremum of $f$ over $s$ is equal to the supremum of $g \circ f$ over $s$. That is, \[ \text{map}\, g \left( \sup_{x \in s} f(x) \right) = \sup_{x \in s} \text{map}\, g (f(x)). \]
Multiset.count_finset_sup theorem
[DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) : count b (s.sup f) = s.sup fun a => count b (f a)
Full source
theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a) := by
  letI := Classical.decEq α
  refine s.induction ?_ ?_
  · exact count_zero _
  · intro i s _ ih
    rw [Finset.sup_insert, sup_eq_union, count_union, Finset.sup_insert, ih]
Multiplicity in Supremum of Multiset-Valued Function Equals Supremum of Multiplicities
Informal description
Let $\alpha$ and $\beta$ be types with decidable equality. Given a finite set $s \subseteq \alpha$, a function $f : \alpha \to \text{Multiset}(\beta)$, and an element $b \in \beta$, the multiplicity of $b$ in the supremum of $f$ over $s$ is equal to the supremum over $s$ of the multiplicities of $b$ in $f(a)$ for each $a \in s$. That is, \[ \text{count}(b, \sup_{a \in s} f(a)) = \sup_{a \in s} \text{count}(b, f(a)). \]
Multiset.mem_sup theorem
{α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} : x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v
Full source
theorem mem_sup {α β} [DecidableEq β] {s : Finset α} {f : α → Multiset β} {x : β} :
    x ∈ s.sup fx ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v := by
  induction s using Finset.cons_induction <;> simp [*]
Membership in Supremum of Multiset-Valued Function over Finite Set
Informal description
Let $\alpha$ and $\beta$ be types with decidable equality on $\beta$, let $s$ be a finite set of elements of type $\alpha$, and let $f : \alpha \to \text{Multiset}(\beta)$ be a function. For any element $x \in \beta$, we have that $x$ is in the supremum of $f$ over $s$ if and only if there exists an element $v \in s$ such that $x$ is in $f(v)$. In symbols: \[ x \in \sup_{v \in s} f(v) \leftrightarrow \exists v \in s, x \in f(v). \]
Finset.mem_sup' theorem
(hs) : a ∈ s.sup' hs f ↔ ∃ i ∈ s, a ∈ f i
Full source
@[simp] lemma mem_sup' (hs) : a ∈ s.sup' hs fa ∈ s.sup' hs f ↔ ∃ i ∈ s, a ∈ f i := by
  induction' hs using Nonempty.cons_induction <;> simp [*]
Membership in Nonempty Finite Supremum: $a \in \sup' s f \leftrightarrow \exists i \in s, a \in f(i)$
Informal description
For a nonempty finite set $s$ and a function $f : \beta \to \alpha$, an element $a \in \alpha$ belongs to the supremum $\sup' s f$ (where $\sup'$ requires a proof $hs$ that $s$ is nonempty) if and only if there exists an element $i \in s$ such that $a \in f(i)$. In symbols: \[ a \in \sup' s f \leftrightarrow \exists i \in s, a \in f(i). \]
Finset.mem_inf' theorem
(hs) : a ∈ s.inf' hs f ↔ ∀ i ∈ s, a ∈ f i
Full source
@[simp] lemma mem_inf' (hs) : a ∈ s.inf' hs fa ∈ s.inf' hs f ↔ ∀ i ∈ s, a ∈ f i := by
  induction' hs using Nonempty.cons_induction <;> simp [*]
Characterization of Membership in Nonempty Finite Infimum: $a \in \inf' s f \leftrightarrow \forall i \in s, a \in f(i)$
Informal description
For a nonempty finite set $s$ in a meet-semilattice $\alpha$ and a function $f \colon \beta \to \alpha$, an element $a \in \alpha$ belongs to the infimum $\inf' s f$ (where $\inf'$ requires a proof $hs$ that $s$ is nonempty) if and only if for every element $i \in s$, $a$ belongs to $f(i)$. In symbols: \[ a \in \inf' s f \leftrightarrow \forall i \in s, a \in f(i). \]
Finset.mem_sup theorem
: a ∈ s.sup f ↔ ∃ i ∈ s, a ∈ f i
Full source
@[simp] lemma mem_sup : a ∈ s.sup fa ∈ s.sup f ↔ ∃ i ∈ s, a ∈ f i := by
  induction' s using cons_induction <;> simp [*]
Characterization of Membership in Finite Supremum: $a \in \sup s f \leftrightarrow \exists i \in s, a \in f(i)$
Informal description
For a finite set $s$ and a function $f : \beta \to \alpha$, an element $a \in \alpha$ belongs to the supremum $\sup s f$ if and only if there exists an element $i \in s$ such that $a \in f(i)$.
Finset.sup_singleton'' theorem
(s : Finset β) (f : β → α) : (s.sup fun b => {f b}) = s.image f
Full source
@[simp]
theorem sup_singleton'' (s : Finset β) (f : β → α) :
    (s.sup fun b => {f b}) = s.image f := by
  ext a
  rw [mem_sup, mem_image]
  simp only [mem_singleton, eq_comm]
Supremum of Singletons Equals Image of Finite Set
Informal description
For any finite set $s$ of elements of type $\beta$ and any function $f : \beta \to \alpha$, the supremum of the singleton sets $\{f(b)\}$ over all $b \in s$ is equal to the image of $s$ under $f$, i.e., \[ \sup_{b \in s} \{f(b)\} = f(s). \]
Finset.sup_singleton' theorem
(s : Finset α) : s.sup singleton = s
Full source
@[simp]
theorem sup_singleton' (s : Finset α) : s.sup singleton = s :=
  (s.sup_singleton'' _).trans image_id
Supremum of Singletons over Finite Set Equals the Set Itself
Informal description
For any finite set $s$ of elements of type $\alpha$, the supremum of the singleton sets $\{a\}$ over all $a \in s$ is equal to $s$ itself, i.e., \[ \sup_{a \in s} \{a\} = s. \]