Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus.
On Mac, use
Cmd instead of
Ctrl .
/-
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
! This file was ported from Lean 3 source module data.fintype.lattice
! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Finset.Lattice
/-!
# Lemmas relating fintypes and order/lattice structure.
-/
open Function
open Nat
universe u v
variable { α β : Type _ }
namespace Finset
variable [ Fintype α ] { s : Finset α }
/-- A special case of `Finset.sup_eq_iSup` that omits the useless `x ∈ univ` binder. -/
theorem sup_univ_eq_iSup [ CompleteLattice : Type ?u.32 → Type ?u.32 CompleteLattice β ] ( f : α → β ) : Finset.univ . sup f = iSup : {α : Type ?u.158} → [inst : SupSet α ] → {ι : Sort ?u.157} → (ι → α ) → α iSup f :=
( sup_eq_iSup _ f ). trans : ∀ {α : Sort ?u.196} {a b c : α }, a = b → b = c → a = c trans <| congr_arg : ∀ {α : Sort ?u.219} {β : Sort ?u.218} {a₁ a₂ : α } (f : α → β ), a₁ = a₂ → f a₁ = f a₂ congr_arg _ <| funext : ∀ {α : Sort ?u.234} {β : α → Sort ?u.233 } {f g : (x : α ) → β x }, (∀ (x : α ), f x = g x ) → f = g funext fun _ => iSup_pos ( mem_univ : ∀ {α : Type ?u.255} [inst : Fintype α ] (x : α ), x ∈ univ mem_univ _ )
#align finset.sup_univ_eq_supr Finset.sup_univ_eq_iSup
/-- A special case of `Finset.inf_eq_iInf` that omits the useless `x ∈ univ` binder. -/
theorem inf_univ_eq_iInf [ CompleteLattice : Type ?u.367 → Type ?u.367 CompleteLattice β ] ( f : α → β ) : Finset.univ . inf f = iInf : {α : Type ?u.489} → [inst : InfSet α ] → {ι : Sort ?u.488} → (ι → α ) → α iInf f :=
@ sup_univ_eq_iSup _ β ᵒᵈ _ _ ( f : α → β ᵒᵈ)
#align finset.inf_univ_eq_infi Finset.inf_univ_eq_iInf
@[ simp ]
theorem fold_inf_univ [ SemilatticeInf : Type ?u.588 → Type ?u.588 SemilatticeInf α ] [ OrderBot : (α : Type ?u.591) → [inst : LE α ] → Type ?u.591 OrderBot α ] ( a : α ) :
-- Porting note: added `haveI`
haveI : IsCommutative : (α : Type ?u.913) → (α → α → α ) → Prop IsCommutative α (· ⊓ ·) := inferInstance : ∀ {α : Sort ?u.1136} [i : α ], α inferInstance
( Finset.univ . fold (· ⊓ ·) a fun x => x ) = ⊥ :=
eq_bot_iff . 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 <|
(( Finset.fold_op_rel_iff_and : ∀ {α : Type ?u.2451} {β : Type ?u.2452} {op : β → β → β } [hc : IsCommutative β op ] [ha : IsAssociative β op ] {f : α → β }
{b : β } {s : Finset α } {r : β → β → Prop },
(∀ {x y z : β }, r x (op y z ) ↔ r x y ∧ r x z ) → ∀ {c : β }, r c (fold op b f s ) ↔ r c b ∧ ∀ (x : α ), x ∈ s → r c (f x ) Finset.fold_op_rel_iff_and <| @ le_inf_iff α _). 1 : ∀ {a b : Prop }, (a ↔ b ) → a → b 1 le_rfl ). 2 : ∀ {a b : Prop }, a ∧ b → b 2 ⊥ <| Finset.mem_univ : ∀ {α : Type ?u.2853} [inst : Fintype α ] (x : α ), x ∈ univ Finset.mem_univ _
#align finset.fold_inf_univ Finset.fold_inf_univ
@[ simp ]
theorem fold_sup_univ [ SemilatticeSup : Type ?u.3263 → Type ?u.3263 SemilatticeSup α ] [ OrderTop : (α : Type ?u.3266) → [inst : LE α ] → Type ?u.3266 OrderTop α ] ( a : α ) :
-- Porting note: added `haveI`
haveI : IsCommutative : (α : Type ?u.3704) → (α → α → α ) → Prop IsCommutative α (· ⊔ ·) := inferInstance : ∀ {α : Sort ?u.3746} [i : α ], α inferInstance
( Finset.univ . fold (· ⊔ ·) a fun x => x ) = ⊤ :=
@ fold_inf_univ α ᵒᵈ _ _ _ _
#align finset.fold_sup_univ Finset.fold_sup_univ
end Finset
open Finset Function
theorem Finite.exists_max [ Finite α ] [ Nonempty α ] [ LinearOrder : Type ?u.4508 → Type ?u.4508 LinearOrder β ] ( f : α → β ) :
∃ x₀ : α , ∀ x , f x ≤ f x₀ := by
∃ x₀ , ∀ (x : α ), f x ≤ f x₀ cases nonempty_fintype α intro ∃ x₀ , ∀ (x : α ), f x ≤ f x₀
∃ x₀ , ∀ (x : α ), f x ≤ f x₀ simpa using exists_max_image univ f univ_nonempty
#align finite.exists_max Finite.exists_max
theorem Finite.exists_min [ Finite α ] [ Nonempty α ] [ LinearOrder : Type ?u.8585 → Type ?u.8585 LinearOrder β ] ( f : α → β ) :
∃ x₀ : α , ∀ x , f x₀ ≤ f x := by
∃ x₀ , ∀ (x : α ), f x₀ ≤ f x cases nonempty_fintype α intro ∃ x₀ , ∀ (x : α ), f x₀ ≤ f x
∃ x₀ , ∀ (x : α ), f x₀ ≤ f x simpa using exists_min_image univ f univ_nonempty
#align finite.exists_min Finite.exists_min