fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
isPWO_sup [Preorder α] (s : Finset ι) {f : ι → Set α} : (s.sup f).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO := s.partiallyWellOrderedOn_sup @[simp]
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
isPWO_sup
null
wellFoundedOn_bUnion [IsStrictOrder α r] (s : Finset ι) {f : ι → Set α} : (⋃ i ∈ s, f i).WellFoundedOn r ↔ ∀ i ∈ s, (f i).WellFoundedOn r := by simpa only [Finset.sup_eq_iSup] using s.wellFoundedOn_sup @[simp]
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
wellFoundedOn_bUnion
null
partiallyWellOrderedOn_bUnion (s : Finset ι) {f : ι → Set α} : (⋃ i ∈ s, f i).PartiallyWellOrderedOn r ↔ ∀ i ∈ s, (f i).PartiallyWellOrderedOn r := by simpa only [Finset.sup_eq_iSup] using s.partiallyWellOrderedOn_sup @[simp]
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
partiallyWellOrderedOn_bUnion
null
isWF_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} : (⋃ i ∈ s, f i).IsWF ↔ ∀ i ∈ s, (f i).IsWF := s.wellFoundedOn_bUnion @[simp]
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
isWF_bUnion
null
isPWO_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} : (⋃ i ∈ s, f i).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO := s.partiallyWellOrderedOn_bUnion
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
isPWO_bUnion
null
IsBadSeq (r : α → α → Prop) (s : Set α) (f : ℕ → α) : Prop := (∀ n, f n ∈ s) ∧ ∀ m n : ℕ, m < n → ¬r (f m) (f n)
def
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
IsBadSeq
`Set.IsWF.min` returns a minimal element of a nonempty well-founded set. -/ noncomputable nonrec def IsWF.min (hs : IsWF s) (hn : s.Nonempty) : α := hs.min univ (nonempty_iff_univ_nonempty.1 hn.to_subtype) theorem IsWF.min_mem (hs : IsWF s) (hn : s.Nonempty) : hs.min hn ∈ s := (WellFounded.min hs univ (nonempty_if...
iff_forall_not_isBadSeq (r : α → α → Prop) (s : Set α) : s.PartiallyWellOrderedOn r ↔ ∀ f, ¬IsBadSeq r s f := by rw [partiallyWellOrderedOn_iff_exists_lt] exact forall_congr' fun f => by simp [IsBadSeq]
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
iff_forall_not_isBadSeq
null
IsMinBadSeq (r : α → α → Prop) (rk : α → ℕ) (s : Set α) (n : ℕ) (f : ℕ → α) : Prop := ∀ g : ℕ → α, (∀ m : ℕ, m < n → f m = g m) → rk (g n) < rk (f n) → ¬IsBadSeq r s g
def
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
IsMinBadSeq
This indicates that every bad sequence `g` that agrees with `f` on the first `n` terms has `rk (f n) ≤ rk (g n)`.
noncomputable minBadSeqOfBadSeq (r : α → α → Prop) (rk : α → ℕ) (s : Set α) (n : ℕ) (f : ℕ → α) (hf : IsBadSeq r s f) : { g : ℕ → α // (∀ m : ℕ, m < n → f m = g m) ∧ IsBadSeq r s g ∧ IsMinBadSeq r rk s n g } := by classical have h : ∃ (k : ℕ) (g : ℕ → α), (∀ m, m < n → f m = g m) ∧ IsBadSeq r s g ∧ rk (g ...
def
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
minBadSeqOfBadSeq
Given a bad sequence `f`, this constructs a bad sequence that agrees with `f` on the first `n` terms and is minimal at `n`.
exists_min_bad_of_exists_bad (r : α → α → Prop) (rk : α → ℕ) (s : Set α) : (∃ f, IsBadSeq r s f) → ∃ f, IsBadSeq r s f ∧ ∀ n, IsMinBadSeq r rk s n f := by rintro ⟨f0, hf0 : IsBadSeq r s f0⟩ let fs : ∀ n : ℕ, { f : ℕ → α // IsBadSeq r s f ∧ IsMinBadSeq r rk s n f } := by refine Nat.rec ?_ fun n fn => ?_ ...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
exists_min_bad_of_exists_bad
null
iff_not_exists_isMinBadSeq (rk : α → ℕ) {s : Set α} : s.PartiallyWellOrderedOn r ↔ ¬∃ f, IsBadSeq r s f ∧ ∀ n, IsMinBadSeq r rk s n f := by rw [iff_forall_not_isBadSeq, ← not_exists, not_congr] constructor · apply exists_min_bad_of_exists_bad · rintro ⟨f, hf1, -⟩ exact ⟨f, hf1⟩
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
iff_not_exists_isMinBadSeq
null
partiallyWellOrderedOn_sublistForall₂ (r : α → α → Prop) [IsPreorder α r] {s : Set α} (h : s.PartiallyWellOrderedOn r) : { l : List α | ∀ x, x ∈ l → x ∈ s }.PartiallyWellOrderedOn (List.SublistForall₂ r) := by rcases isEmpty_or_nonempty α · exact subsingleton_of_subsingleton.partiallyWellOrderedOn inhabit...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
partiallyWellOrderedOn_sublistForall₂
Higman's Lemma, which states that for any reflexive, transitive relation `r` which is partially well-ordered on a set `s`, the relation `List.SublistForall₂ r` is partially well-ordered on the set of lists of elements of `s`. That relation is defined so that `List.SublistForall₂ r l₁ l₂` whenever `l₁` related poi...
subsetProdLex [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)} (hα : ((fun (x : α ×ₗ β) => (ofLex x).1) '' s).IsPWO) (hβ : ∀ a, {y | toLex (a, y) ∈ s}.IsPWO) : s.IsPWO := by rw [IsPWO, partiallyWellOrderedOn_iff_exists_lt] intro f hf rw [isPWO_iff_exists_monotone_subseq] at hα obtain ⟨g, hg⟩ : ∃ (g : (ℕ...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
subsetProdLex
null
imageProdLex [Preorder α] [Preorder β] {s : Set (α ×ₗ β)} (hαβ : s.IsPWO) : ((fun (x : α ×ₗ β) => (ofLex x).1)'' s).IsPWO := IsPWO.image_of_monotone hαβ Prod.Lex.monotone_fst
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
imageProdLex
null
fiberProdLex [Preorder α] [Preorder β] {s : Set (α ×ₗ β)} (hαβ : s.IsPWO) (a : α) : {y | toLex (a, y) ∈ s}.IsPWO := by let f : α ×ₗ β → β := fun x => (ofLex x).2 have h : {y | toLex (a, y) ∈ s} = f '' (s ∩ (fun x ↦ (ofLex x).1) ⁻¹' {a}) := by ext x simp [f] rw [h] apply IsPWO.image_of_monotoneOn (hα...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
fiberProdLex
null
ProdLex_iff [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)} : s.IsPWO ↔ ((fun (x : α ×ₗ β) ↦ (ofLex x).1) '' s).IsPWO ∧ ∀ a, {y | toLex (a, y) ∈ s}.IsPWO := ⟨fun h ↦ ⟨imageProdLex h, fiberProdLex h⟩, fun h ↦ subsetProdLex h.1 h.2⟩
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
ProdLex_iff
null
Pi.isPWO {α : ι → Type*} [∀ i, LinearOrder (α i)] [∀ i, IsWellOrder (α i) (· < ·)] [Finite ι] (s : Set (∀ i, α i)) : s.IsPWO := by cases nonempty_fintype ι suffices ∀ (s : Finset ι) (f : ℕ → ∀ s, α s), ∃ g : ℕ ↪o ℕ, ∀ ⦃a b : ℕ⦄, a ≤ b → ∀ x, x ∈ s → (f ∘ g) a x ≤ (f ∘ g) b x by refine isPWO_iff_exists_m...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
Pi.isPWO
A version of **Dickson's lemma** any subset of functions `Π s : σ, α s` is partially well ordered, when `σ` is a `Fintype` and each `α s` is a linear well order. This includes the classical case of Dickson's lemma that `ℕ ^ n` is a well partial order. Some generalizations would be possible based on this proof, to inclu...
WellFounded.prod_lex_of_wellFoundedOn_fiber (hα : WellFounded (rα on f)) (hβ : ∀ a, (f ⁻¹' {a}).WellFoundedOn (rβ on g)) : WellFounded (Prod.Lex rα rβ on fun c => (f c, g c)) := by refine ((psigma_lex (wellFoundedOn_range.2 hα) fun a => hβ a).onFun (f := fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩)).mono fun c c' h =>...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
WellFounded.prod_lex_of_wellFoundedOn_fiber
Stronger version of `WellFounded.prod_lex`. Instead of requiring `rβ on g` to be well-founded, we only require it to be well-founded on fibers of `f`.
Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber (hα : s.WellFoundedOn (rα on f)) (hβ : ∀ a, (s ∩ f ⁻¹' {a}).WellFoundedOn (rβ on g)) : s.WellFoundedOn (Prod.Lex rα rβ on fun c => (f c, g c)) := WellFounded.prod_lex_of_wellFoundedOn_fiber hα fun a ↦ ((hβ a).onFun (f := fun x => ⟨x, x.1.2, x.2⟩)).mono (fu...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
Set.WellFoundedOn.prod_lex_of_wellFoundedOn_fiber
null
WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f)) (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) : WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) := by refine ((psigma_lex (wellFoundedOn_range.2 hι) fun a => hπ a).onFun (f := fun c => ⟨⟨_, c, rfl⟩, c, rfl⟩)).mono f...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
WellFounded.sigma_lex_of_wellFoundedOn_fiber
Stronger version of `PSigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only require it to be well-founded on fibers of `f`.
Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber (hι : s.WellFoundedOn (rι on f)) (hπ : ∀ i, (s ∩ f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) : s.WellFoundedOn (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩) := by change WellFounded (Sigma.Lex rι rπ on fun c : s => ⟨f c, g (f c) c⟩) exact @WellFounded.sigm...
theorem
Order
[ "Mathlib.Data.Prod.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.WellQuasiOrder", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/WellFoundedSet.lean
Set.WellFoundedOn.sigma_lex_of_wellFoundedOn_fiber
null
WellQuasiOrdered (r : α → α → Prop) : Prop := ∀ f : ℕ → α, ∃ m n : ℕ, m < n ∧ r (f m) (f n)
def
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
WellQuasiOrdered
A well quasi-order or WQO is a relation such that any infinite sequence contains an infinite monotonic subsequence, or equivalently, two elements `f m` and `f n` with `m < n` and `r (f m) (f n)`. For a preorder, this is equivalent to having a well-founded order with no infinite antichains. Despite the nomenclature, w...
wellQuasiOrdered_of_isEmpty [IsEmpty α] (r : α → α → Prop) : WellQuasiOrdered r := fun f ↦ isEmptyElim (f 0)
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
wellQuasiOrdered_of_isEmpty
null
IsAntichain.finite_of_wellQuasiOrdered {s : Set α} (hs : IsAntichain r s) (hr : WellQuasiOrdered r) : s.Finite := by refine Set.not_infinite.1 fun hi => ?_ obtain ⟨m, n, hmn, h⟩ := hr fun n => hi.natEmbedding _ n exact hmn.ne ((hi.natEmbedding _).injective <| Subtype.val_injective <| hs.eq (hi.natEmbeddin...
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
IsAntichain.finite_of_wellQuasiOrdered
null
Finite.wellQuasiOrdered (r : α → α → Prop) [Finite α] [IsRefl α r] : WellQuasiOrdered r := by intro f obtain ⟨m, n, h, hf⟩ := Set.finite_univ.exists_lt_map_eq_of_forall_mem (f := f) fun _ ↦ Set.mem_univ _ exact ⟨m, n, h, hf ▸ refl _⟩
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
Finite.wellQuasiOrdered
null
WellQuasiOrdered.exists_monotone_subseq [IsPreorder α r] (h : WellQuasiOrdered r) (f : ℕ → α) : ∃ g : ℕ ↪o ℕ, ∀ m n, m ≤ n → r (f (g m)) (f (g n)) := by obtain ⟨g, h1 | h2⟩ := exists_increasing_or_nonincreasing_subseq r f · refine ⟨g, fun m n hle => ?_⟩ obtain hlt | rfl := hle.lt_or_eq exacts [h1 m n hl...
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
WellQuasiOrdered.exists_monotone_subseq
null
wellQuasiOrdered_iff_exists_monotone_subseq [IsPreorder α r] : WellQuasiOrdered r ↔ ∀ f : ℕ → α, ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n)) := by constructor <;> intro h f · exact h.exists_monotone_subseq f · obtain ⟨g, gmon⟩ := h f exact ⟨_, _, g.strictMono Nat.zero_lt_one, gmon _ _ (Nat.zero...
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
wellQuasiOrdered_iff_exists_monotone_subseq
null
WellQuasiOrdered.prod [IsPreorder α r] (hr : WellQuasiOrdered r) (hs : WellQuasiOrdered s) : WellQuasiOrdered fun a b : α × β ↦ r a.1 b.1 ∧ s a.2 b.2 := by intro f obtain ⟨g, h₁⟩ := hr.exists_monotone_subseq (Prod.fst ∘ f) obtain ⟨m, n, h, hf⟩ := hs (Prod.snd ∘ f ∘ g) exact ⟨g m, g n, g.strictMono h, h₁ _ _...
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
WellQuasiOrdered.prod
null
@[mk_iff wellQuasiOrderedLE_def] WellQuasiOrderedLE (α : Type*) [LE α] where wqo : @WellQuasiOrdered α (· ≤ ·)
class
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
WellQuasiOrderedLE
A typeclass for an order with a well-quasi-ordered `≤` relation. Note that this is unlike `WellFoundedLT`, which instead takes a `<` relation.
wellQuasiOrdered_le [LE α] [h : WellQuasiOrderedLE α] : @WellQuasiOrdered α (· ≤ ·) := h.wqo
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
wellQuasiOrdered_le
null
Finite.to_wellQuasiOrderedLE [Finite α] : WellQuasiOrderedLE α where wqo := Finite.wellQuasiOrdered _
lemma
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
Finite.to_wellQuasiOrderedLE
null
WellQuasiOrdered.wellFounded {α : Type*} {r : α → α → Prop} [IsPreorder α r] (h : WellQuasiOrdered r) : WellFounded fun a b ↦ r a b ∧ ¬ r b a := by let _ : Preorder α := { le := r le_refl := refl_of r le_trans := fun _ _ _ => trans_of r } have : WellQuasiOrderedLE α := ⟨h⟩ exact wellFounded_lt
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
WellQuasiOrdered.wellFounded
null
WellQuasiOrderedLE.finite_of_isAntichain [WellQuasiOrderedLE α] {s : Set α} (h : IsAntichain (· ≤ ·) s) : s.Finite := h.finite_of_wellQuasiOrdered wellQuasiOrdered_le
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
WellQuasiOrderedLE.finite_of_isAntichain
null
wellQuasiOrderedLE_iff : WellQuasiOrderedLE α ↔ WellFoundedLT α ∧ ∀ s : Set α, IsAntichain (· ≤ ·) s → s.Finite := by refine ⟨fun h ↦ ⟨h.to_wellFoundedLT, fun s ↦ h.finite_of_isAntichain⟩, fun ⟨hwf, hc⟩ ↦ ⟨fun f ↦ ?_⟩⟩ obtain ⟨g, h1 | h2⟩ := exists_increasing_or_nonincreasing_subseq (· > ·) f · exfalso ...
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
wellQuasiOrderedLE_iff
A preorder is well quasi-ordered iff it's well-founded and has no infinite antichains.
wellQuasiOrderedLE_iff_wellFoundedLT : WellQuasiOrderedLE α ↔ WellFoundedLT α := by rw [wellQuasiOrderedLE_iff, and_iff_left_iff_imp] exact fun _ s hs ↦ hs.subsingleton.finite
theorem
Order
[ "Mathlib.Data.Fintype.Card", "Mathlib.Data.Set.Finite.Basic", "Mathlib.Order.Antichain", "Mathlib.Order.OrderIsoNat" ]
Mathlib/Order/WellQuasiOrder.lean
wellQuasiOrderedLE_iff_wellFoundedLT
A linear WQO is the same thing as a well-order.
nontrivial [Nonempty α] : Nontrivial (WithBot α) := Option.nontrivial open Function
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
nontrivial
null
coe_injective : Injective ((↑) : α → WithBot α) := Option.some_injective _ @[simp, norm_cast]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_injective
null
coe_inj : (a : WithBot α) = b ↔ a = b := Option.some_inj
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_inj
null
none_eq_bot : (none : WithBot α) = (⊥ : WithBot α) := rfl
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
none_eq_bot
null
some_eq_coe (a : α) : (Option.some a : WithBot α) = (↑a : WithBot α) := rfl @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
some_eq_coe
null
bot_ne_coe : ⊥ ≠ (a : WithBot α) := nofun @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
bot_ne_coe
null
coe_ne_bot : (a : WithBot α) ≠ ⊥ := nofun
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_ne_bot
null
unbotD (d : α) (x : WithBot α) : α := recBotCoe d id x @[simp]
def
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD
Specialization of `Option.getD` to values in `WithBot α` that respects API boundaries.
unbotD_bot {α} (d : α) : unbotD d ⊥ = d := rfl @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_bot
null
unbotD_coe {α} (d x : α) : unbotD d x = x := rfl
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_coe
null
coe_eq_coe : (a : WithBot α) = b ↔ a = b := coe_inj
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_eq_coe
null
unbotD_eq_iff {d y : α} {x : WithBot α} : unbotD d x = y ↔ x = y ∨ x = ⊥ ∧ y = d := by induction x <;> simp [@eq_comm _ d] @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_eq_iff
null
unbotD_eq_self_iff {d : α} {x : WithBot α} : unbotD d x = d ↔ x = d ∨ x = ⊥ := by simp [unbotD_eq_iff]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_eq_self_iff
null
unbotD_eq_unbotD_iff {d : α} {x y : WithBot α} : unbotD d x = unbotD d y ↔ x = y ∨ x = d ∧ y = ⊥ ∨ x = ⊥ ∧ y = d := by induction y <;> simp [unbotD_eq_iff, or_comm]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_eq_unbotD_iff
null
map (f : α → β) : WithBot α → WithBot β := Option.map f @[simp]
def
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map
Lift a map `f : α → β` to `WithBot α → WithBot β`. Implemented using `Option.map`.
map_bot (f : α → β) : map f ⊥ = ⊥ := rfl @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_bot
null
map_coe (f : α → β) (a : α) : map f a = f a := rfl @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_coe
null
map_eq_bot_iff {f : α → β} {a : WithBot α} : map f a = ⊥ ↔ a = ⊥ := Option.map_eq_none_iff
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_eq_bot_iff
null
map_eq_some_iff {f : α → β} {y : β} {v : WithBot α} : WithBot.map f v = .some y ↔ ∃ x, v = .some x ∧ f x = y := Option.map_eq_some_iff
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_eq_some_iff
null
some_eq_map_iff {f : α → β} {y : β} {v : WithBot α} : .some y = WithBot.map f v ↔ ∃ x, v = .some x ∧ f x = y := by cases v <;> simp [eq_comm]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
some_eq_map_iff
null
map_id : map (id : α → α) = id := Option.map_id @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_id
null
map_map (h : β → γ) (g : α → β) (a : WithBot α) : map h (map g a) = map (h ∘ g) a := Option.map_map h g a
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_map
null
comp_map (h : β → γ) (g : α → β) (x : WithBot α) : x.map (h ∘ g) = (x.map g).map h := (map_map ..).symm @[simp] theorem map_comp_map (f : α → β) (g : β → γ) : WithBot.map g ∘ WithBot.map f = WithBot.map (g ∘ f) := Option.map_comp_map f g
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
comp_map
null
map_comm {f₁ : α → β} {f₂ : α → γ} {g₁ : β → δ} {g₂ : γ → δ} (h : g₁ ∘ f₁ = g₂ ∘ f₂) (a : α) : map g₁ (map f₁ a) = map g₂ (map f₂ a) := Option.map_comm h _
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_comm
null
map_injective {f : α → β} (Hf : Injective f) : Injective (WithBot.map f) := Option.map_injective Hf
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map_injective
null
map₂ : (α → β → γ) → WithBot α → WithBot β → WithBot γ := Option.map₂
def
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map₂
The image of a binary function `f : α → β → γ` as a function `WithBot α → WithBot β → WithBot γ`. Mathematically this should be thought of as the image of the corresponding function `α × β → γ`.
map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b := rfl @[simp] lemma map₂_bot_left (f : α → β → γ) (b) : map₂ f ⊥ b = ⊥ := rfl @[simp] lemma map₂_bot_right (f : α → β → γ) (a) : map₂ f a ⊥ = ⊥ := by cases a <;> rfl @[simp] lemma map₂_coe_left (f : α → β → γ) (a : α) (b) : map₂ f a b = b.map fun b ↦ f ...
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
map₂_coe_coe
null
ne_bot_iff_exists {x : WithBot α} : x ≠ ⊥ ↔ ∃ a : α, ↑a = x := Option.ne_none_iff_exists
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
ne_bot_iff_exists
null
eq_bot_iff_forall_ne {x : WithBot α} : x = ⊥ ↔ ∀ a : α, ↑a ≠ x := Option.eq_none_iff_forall_some_ne @[deprecated (since := "2025-03-19")] alias forall_ne_iff_eq_bot := eq_bot_iff_forall_ne
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
eq_bot_iff_forall_ne
null
unbot : ∀ x : WithBot α, x ≠ ⊥ → α | (x : α), _ => x @[simp] lemma coe_unbot : ∀ (x : WithBot α) hx, x.unbot hx = x | (x : α), _ => rfl @[simp]
def
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbot
Deconstruct a `x : WithBot α` to the underlying value in `α`, given a proof that `x ≠ ⊥`.
unbot_coe (x : α) (h : (x : WithBot α) ≠ ⊥ := coe_ne_bot) : (x : WithBot α).unbot h = x := rfl
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbot_coe
null
canLift : CanLift (WithBot α) α (↑) fun r => r ≠ ⊥ where prf x h := ⟨x.unbot h, coe_unbot _ _⟩
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
canLift
null
instTop [Top α] : Top (WithBot α) where top := (⊤ : α) @[simp, norm_cast] lemma coe_top [Top α] : ((⊤ : α) : WithBot α) = ⊤ := rfl @[simp, norm_cast] lemma coe_eq_top [Top α] {a : α} : (a : WithBot α) = ⊤ ↔ a = ⊤ := coe_eq_coe @[simp, norm_cast] lemma top_eq_coe [Top α] {a : α} : ⊤ = (a : WithBot α) ↔ ⊤ = a := coe_eq...
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
instTop
null
unbot_eq_iff {a : WithBot α} {b : α} (h : a ≠ ⊥) : a.unbot h = b ↔ a = b := by induction a · simpa using h rfl · simp
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbot_eq_iff
null
eq_unbot_iff {a : α} {b : WithBot α} (h : b ≠ ⊥) : a = b.unbot h ↔ a = b := by induction b · simpa using h rfl · simp
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
eq_unbot_iff
null
@[simps] _root_.Equiv.withBotSubtypeNe : {y : WithBot α // y ≠ ⊥} ≃ α where toFun := fun ⟨x,h⟩ => WithBot.unbot x h invFun x := ⟨x, WithBot.coe_ne_bot⟩ left_inv _ := by simp right_inv _ := by simp
def
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
_root_.Equiv.withBotSubtypeNe
The equivalence between the non-bottom elements of `WithBot α` and `α`.
@[simps apply] withBotCongr (e : α ≃ β) : WithBot α ≃ WithBot β where toFun := WithBot.map e invFun := WithBot.map e.symm left_inv x := by cases x <;> simp right_inv x := by cases x <;> simp attribute [grind =] withBotCongr_apply @[simp]
def
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
withBotCongr
A universe-polymorphic version of `EquivFunctor.mapEquiv WithBot e`.
withBotCongr_refl : withBotCongr (Equiv.refl α) = Equiv.refl _ := Equiv.ext <| congr_fun WithBot.map_id @[simp, grind =]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
withBotCongr_refl
null
withBotCongr_symm (e : α ≃ β) : withBotCongr e.symm = (withBotCongr e).symm := rfl @[simp]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
withBotCongr_symm
null
withBotCongr_trans (e₁ : α ≃ β) (e₂ : β ≃ γ) : withBotCongr (e₁.trans e₂) = (withBotCongr e₁).trans (withBotCongr e₂) := by ext x simp
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
withBotCongr_trans
null
le_def : x ≤ y ↔ ∀ a : α, x = ↑a → ∃ b : α, y = ↑b ∧ a ≤ b := .rfl @[simp, norm_cast] lemma coe_le_coe : (a : WithBot α) ≤ b ↔ a ≤ b := by simp [le_def]
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
le_def
null
not_coe_le_bot (a : α) : ¬(a : WithBot α) ≤ ⊥ := by simp [le_def]
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
not_coe_le_bot
null
orderBot : OrderBot (WithBot α) where bot_le := by simp [le_def]
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
orderBot
null
orderTop [OrderTop α] : OrderTop (WithBot α) where le_top x := by cases x <;> simp [le_def]
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
orderTop
null
instBoundedOrder [OrderTop α] : BoundedOrder (WithBot α) := { WithBot.orderBot, WithBot.orderTop with }
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
instBoundedOrder
null
@[simp] protected le_bot_iff : ∀ {a : WithBot α}, a ≤ ⊥ ↔ a = ⊥ | (a : α) => by simp [not_coe_le_bot _] | ⊥ => by simp
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
le_bot_iff
There is a general version `le_bot_iff`, but this lemma does not require a `PartialOrder`.
coe_le : ∀ {o : Option α}, b ∈ o → ((a : WithBot α) ≤ o ↔ a ≤ b) | _, rfl => coe_le_coe
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_le
null
coe_le_iff : a ≤ x ↔ ∃ b : α, x = b ∧ a ≤ b := by simp [le_def]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_le_iff
null
le_coe_iff : x ≤ b ↔ ∀ a : α, x = ↑a → a ≤ b := by simp [le_def]
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
le_coe_iff
null
protected _root_.IsMax.withBot (h : IsMax a) : IsMax (a : WithBot α) := fun x ↦ by cases x <;> simp; simpa using @h _
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
_root_.IsMax.withBot
null
le_unbot_iff (hy : y ≠ ⊥) : a ≤ unbot y hy ↔ a ≤ y := by lift y to α using id hy; simp
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
le_unbot_iff
null
unbot_le_iff (hx : x ≠ ⊥) : unbot x hx ≤ b ↔ x ≤ b := by lift x to α using id hx; simp
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbot_le_iff
null
unbotD_le_iff (hx : x = ⊥ → a ≤ b) : x.unbotD a ≤ b ↔ x ≤ b := by cases x <;> simp [hx]
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_le_iff
null
lt_def : x < y ↔ ∃ b : α, y = ↑b ∧ ∀ a : α, x = ↑a → a < b := .rfl @[simp, norm_cast] lemma coe_lt_coe : (a : WithBot α) < b ↔ a < b := by simp [lt_def] @[simp] lemma bot_lt_coe (a : α) : ⊥ < (a : WithBot α) := by simp [lt_def] @[simp] protected lemma not_lt_bot (a : WithBot α) : ¬a < ⊥ := by simp [lt_def]
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
lt_def
null
lt_iff_exists_coe : x < y ↔ ∃ b : α, y = b ∧ x < b := by cases y <;> simp
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
lt_iff_exists_coe
null
lt_coe_iff : x < b ↔ ∀ a : α, x = a → a < b := by simp [lt_def]
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
lt_coe_iff
null
protected bot_lt_iff_ne_bot : ⊥ < x ↔ x ≠ ⊥ := by cases x <;> simp
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
bot_lt_iff_ne_bot
A version of `bot_lt_iff_ne_bot` for `WithBot` that only requires `LT α`, not `PartialOrder α`.
lt_unbot_iff (hy : y ≠ ⊥) : a < unbot y hy ↔ a < y := by lift y to α using id hy; simp
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
lt_unbot_iff
null
unbot_lt_iff (hx : x ≠ ⊥) : unbot x hx < b ↔ x < b := by lift x to α using id hx; simp
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbot_lt_iff
null
unbotD_lt_iff (hx : x = ⊥ → a < b) : x.unbotD a < b ↔ x < b := by cases x <;> simp [hx]
lemma
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
unbotD_lt_iff
null
preorder [Preorder α] : Preorder (WithBot α) where lt_iff_le_not_ge x y := by cases x <;> cases y <;> simp [lt_iff_le_not_ge] le_refl x := by cases x <;> simp [le_def] le_trans x y z := by cases x <;> cases y <;> cases z <;> simp [le_def]; simpa using le_trans
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
preorder
null
partialOrder [PartialOrder α] : PartialOrder (WithBot α) where le_antisymm x y := by cases x <;> cases y <;> simp [le_def]; simpa using le_antisymm
instance
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
partialOrder
null
coe_strictMono : StrictMono (fun (a : α) => (a : WithBot α)) := fun _ _ => coe_lt_coe.2
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_strictMono
null
coe_mono : Monotone (fun (a : α) => (a : WithBot α)) := fun _ _ => coe_le_coe.2
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
coe_mono
null
monotone_iff {f : WithBot α → β} : Monotone f ↔ Monotone (fun a ↦ f a : α → β) ∧ ∀ x : α, f ⊥ ≤ f x := ⟨fun h ↦ ⟨h.comp WithBot.coe_mono, fun _ ↦ h bot_le⟩, fun h ↦ WithBot.forall.2 ⟨WithBot.forall.2 ⟨fun _ => le_rfl, fun x _ => h.2 x⟩, fun _ => WithBot.forall.2 ⟨fun h => (not_coe_le_bot _ h).el...
theorem
Order
[ "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Order.TypeTags", "Mathlib.Data.Option.NAry", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.Lift", "Mathlib.Data.Option.Basic", "Mathlib.Order.Lattice", "Mathlib.Order.BoundedOrder.Basic" ]
Mathlib/Order/WithBot.lean
monotone_iff
null