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
subchain : Set (List α) := { l | l.IsChain (· < ·) ∧ ∀ i ∈ l, i ∈ s } @[simp]
def
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
subchain
The set of strictly ascending lists of `α` contained in a `Set α`.
nil_mem_subchain : [] ∈ s.subchain := ⟨.nil, fun _ ↦ nofun⟩ variable {s} {l : List α} {a : α}
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
nil_mem_subchain
null
cons_mem_subchain_iff : (a::l) ∈ s.subchain ↔ a ∈ s ∧ l ∈ s.subchain ∧ ∀ b ∈ l.head?, a < b := by simp only [subchain, mem_setOf_eq, forall_mem_cons, isChain_cons', and_left_comm, and_comm, and_assoc] @[simp]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
cons_mem_subchain_iff
null
singleton_mem_subchain_iff : [a] ∈ s.subchain ↔ a ∈ s := by simp [cons_mem_subchain_iff]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
singleton_mem_subchain_iff
null
noncomputable chainHeight : ℕ∞ := ⨆ l ∈ s.subchain, length l
def
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight
The maximal length of a strictly ascending sequence in a partial order.
chainHeight_eq_iSup_subtype : s.chainHeight = ⨆ l : s.subchain, ↑l.1.length := iSup_subtype'
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_eq_iSup_subtype
null
exists_chain_of_le_chainHeight {n : ℕ} (hn : ↑n ≤ s.chainHeight) : ∃ l ∈ s.subchain, length l = n := by rcases (le_top : s.chainHeight ≤ ⊤).eq_or_lt with ha | ha <;> rw [chainHeight_eq_iSup_subtype] at ha · obtain ⟨_, ⟨⟨l, h₁, h₂⟩, rfl⟩, h₃⟩ := not_bddAbove_iff'.mp (WithTop.iSup_coe_eq_top.1 ha) n ...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
exists_chain_of_le_chainHeight
null
le_chainHeight_TFAE (n : ℕ) : TFAE [↑n ≤ s.chainHeight, ∃ l ∈ s.subchain, length l = n, ∃ l ∈ s.subchain, n ≤ length l] := by tfae_have 1 → 2 := s.exists_chain_of_le_chainHeight tfae_have 2 → 3 := fun ⟨l, hls, he⟩ ↦ ⟨l, hls, he.ge⟩ tfae_have 3 → 1 := fun ⟨l, hs, hn⟩ ↦ le_iSup₂_of_le l hs (WithTop.coe_le_coe.2...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
le_chainHeight_TFAE
null
le_chainHeight_iff {n : ℕ} : ↑n ≤ s.chainHeight ↔ ∃ l ∈ s.subchain, length l = n := (le_chainHeight_TFAE s n).out 0 1
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
le_chainHeight_iff
null
length_le_chainHeight_of_mem_subchain (hl : l ∈ s.subchain) : ↑l.length ≤ s.chainHeight := le_chainHeight_iff.mpr ⟨l, hl, rfl⟩
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
length_le_chainHeight_of_mem_subchain
null
chainHeight_eq_top_iff : s.chainHeight = ⊤ ↔ ∀ n, ∃ l ∈ s.subchain, length l = n := by refine ⟨fun h n ↦ le_chainHeight_iff.1 (le_top.trans_eq h.symm), fun h ↦ ?_⟩ contrapose! h; obtain ⟨n, hn⟩ := WithTop.ne_top_iff_exists.1 h exact ⟨n + 1, fun l hs ↦ (Nat.lt_succ_iff.2 <| Nat.cast_le.1 <| (length_le_chainHei...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_eq_top_iff
null
one_le_chainHeight_iff : 1 ≤ s.chainHeight ↔ s.Nonempty := by rw [← Nat.cast_one, Set.le_chainHeight_iff] simp only [length_eq_one_iff, @and_comm (_ ∈ _), @eq_comm _ _ [_], exists_exists_eq_and, singleton_mem_subchain_iff, Set.Nonempty] @[simp]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
one_le_chainHeight_iff
null
chainHeight_eq_zero_iff : s.chainHeight = 0 ↔ s = ∅ := by rw [← not_iff_not, ← Ne, ← ENat.one_le_iff_ne_zero, one_le_chainHeight_iff, nonempty_iff_ne_empty] @[simp]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_eq_zero_iff
null
chainHeight_empty : (∅ : Set α).chainHeight = 0 := chainHeight_eq_zero_iff.2 rfl @[simp]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_empty
null
chainHeight_of_isEmpty [IsEmpty α] : s.chainHeight = 0 := chainHeight_eq_zero_iff.mpr (Subsingleton.elim _ _)
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_of_isEmpty
null
le_chainHeight_add_nat_iff {n m : ℕ} : ↑n ≤ s.chainHeight + m ↔ ∃ l ∈ s.subchain, n ≤ length l + m := by simp_rw [← tsub_le_iff_right, ← ENat.coe_sub, (le_chainHeight_TFAE s (n - m)).out 0 2]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
le_chainHeight_add_nat_iff
null
chainHeight_add_le_chainHeight_add (s : Set α) (t : Set β) (n m : ℕ) : s.chainHeight + n ≤ t.chainHeight + m ↔ ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, length l + n ≤ length l' + m := by refine ⟨fun e l h ↦ le_chainHeight_add_nat_iff.1 ((add_le_add_right (length_le_chainHeight_of_mem_subchain ...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_add_le_chainHeight_add
null
chainHeight_le_chainHeight_TFAE (s : Set α) (t : Set β) : TFAE [s.chainHeight ≤ t.chainHeight, ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, length l = length l', ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, length l ≤ length l'] := by tfae_have 1 ↔ 3 := by convert ← chainHeight_add_le_chainHeight_add s t 0 0 <;> apply ...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_le_chainHeight_TFAE
null
chainHeight_le_chainHeight_iff {t : Set β} : s.chainHeight ≤ t.chainHeight ↔ ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, length l = length l' := (chainHeight_le_chainHeight_TFAE s t).out 0 1
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_le_chainHeight_iff
null
chainHeight_le_chainHeight_iff_le {t : Set β} : s.chainHeight ≤ t.chainHeight ↔ ∀ l ∈ s.subchain, ∃ l' ∈ t.subchain, length l ≤ length l' := (chainHeight_le_chainHeight_TFAE s t).out 0 2
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_le_chainHeight_iff_le
null
chainHeight_mono (h : s ⊆ t) : s.chainHeight ≤ t.chainHeight := chainHeight_le_chainHeight_iff.2 fun l hl ↦ ⟨l, ⟨hl.1, fun i hi ↦ h <| hl.2 i hi⟩, rfl⟩
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_mono
null
chainHeight_image (f : α → β) (hf : ∀ {x y}, x < y ↔ f x < f y) (s : Set α) : (f '' s).chainHeight = s.chainHeight := by apply le_antisymm <;> rw [chainHeight_le_chainHeight_iff] · suffices ∀ l ∈ (f '' s).subchain, ∃ l' ∈ s.subchain, map f l' = l by intro l hl obtain ⟨l', h₁, rfl⟩ := this l hl ...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_image
null
chainHeight_dual : (ofDual ⁻¹' s).chainHeight = s.chainHeight := by apply le_antisymm <;> · rw [chainHeight_le_chainHeight_iff] rintro l ⟨h₁, h₂⟩ exact ⟨l.reverse, ⟨isChain_reverse.mpr h₁, fun i h ↦ h₂ i (mem_reverse.mp h)⟩, length_reverse.symm⟩
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_dual
null
chainHeight_eq_iSup_Ici : s.chainHeight = ⨆ i ∈ s, (s ∩ Set.Ici i).chainHeight := by apply le_antisymm · refine iSup₂_le ?_ rintro (_ | ⟨x, xs⟩) h · exact zero_le _ · apply le_trans _ (le_iSup₂ x (cons_mem_subchain_iff.mp h).1) apply length_le_chainHeight_of_mem_subchain refine ⟨h.1, fun i h...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_eq_iSup_Ici
null
chainHeight_eq_iSup_Iic : s.chainHeight = ⨆ i ∈ s, (s ∩ Set.Iic i).chainHeight := by simp_rw [← chainHeight_dual (_ ∩ _)] rw [← chainHeight_dual, chainHeight_eq_iSup_Ici] rfl variable {s t}
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_eq_iSup_Iic
null
chainHeight_insert_of_forall_gt (a : α) (hx : ∀ b ∈ s, a < b) : (insert a s).chainHeight = s.chainHeight + 1 := by rw [← add_zero (insert a s).chainHeight] change (insert a s).chainHeight + (0 : ℕ) = s.chainHeight + (1 : ℕ) apply le_antisymm <;> rw [chainHeight_add_le_chainHeight_add] · rintro (_ | ⟨y, ys⟩)...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_insert_of_forall_gt
null
chainHeight_insert_of_forall_lt (a : α) (ha : ∀ b ∈ s, b < a) : (insert a s).chainHeight = s.chainHeight + 1 := by rw [← chainHeight_dual, ← chainHeight_dual s] exact chainHeight_insert_of_forall_gt _ ha
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_insert_of_forall_lt
null
chainHeight_union_le : (s ∪ t).chainHeight ≤ s.chainHeight + t.chainHeight := by classical refine iSup₂_le fun l hl ↦ ?_ let l₁ := l.filter (· ∈ s) let l₂ := l.filter (· ∈ t) have hl₁ : ↑l₁.length ≤ s.chainHeight := by apply Set.length_le_chainHeight_of_mem_subchain exact ⟨hl.1.sublist fil...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_union_le
null
chainHeight_union_eq (s t : Set α) (H : ∀ a ∈ s, ∀ b ∈ t, a < b) : (s ∪ t).chainHeight = s.chainHeight + t.chainHeight := by cases h : t.chainHeight · rw [add_top, eq_top_iff, ← h] exact Set.chainHeight_mono subset_union_right apply le_antisymm · rw [← h] exact chainHeight_union_le rw [← add_zero ...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
chainHeight_union_eq
null
wellFoundedGT_of_chainHeight_ne_top (s : Set α) (hs : s.chainHeight ≠ ⊤) : WellFoundedGT s := by haveI : IsTrans { x // x ∈ s } (↑· < ↑·) := inferInstance obtain ⟨n, hn⟩ := WithTop.ne_top_iff_exists.1 hs refine ⟨RelEmbedding.wellFounded_iff_isEmpty.2 ⟨fun f ↦ ?_⟩⟩ refine n.lt_succ_self.not_ge (WithTop.coe_l...
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
wellFoundedGT_of_chainHeight_ne_top
null
wellFoundedLT_of_chainHeight_ne_top (s : Set α) (hs : s.chainHeight ≠ ⊤) : WellFoundedLT s := wellFoundedGT_of_chainHeight_ne_top (ofDual ⁻¹' s) <| by rwa [chainHeight_dual]
theorem
Order
[ "Mathlib.Data.ENat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Tactic.TFAE" ]
Mathlib/Order/Height.lean
wellFoundedLT_of_chainHeight_ne_top
null
Ideal (P) [LE P] extends LowerSet P where /-- The ideal is nonempty. -/ nonempty' : carrier.Nonempty /-- The ideal is upward directed. -/ directed' : DirectedOn (· ≤ ·) carrier initialize_simps_projections Ideal (+toLowerSet, -carrier)
structure
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
Ideal
An ideal on an order `P` is a subset of `P` that is - nonempty - upward directed (any pair of elements in the ideal has an upper bound in the ideal) - downward closed (any element less than an element of the ideal is in the ideal).
@[mk_iff] IsIdeal {P} [LE P] (I : Set P) : Prop where /-- The ideal is downward closed. -/ IsLowerSet : IsLowerSet I /-- The ideal is nonempty. -/ Nonempty : I.Nonempty /-- The ideal is upward directed. -/ Directed : DirectedOn (· ≤ ·) I
structure
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
IsIdeal
A subset of a preorder `P` is an ideal if it is - nonempty - upward directed (any pair of elements in the ideal has an upper bound in the ideal) - downward closed (any element less than an element of the ideal is in the ideal).
IsIdeal.toIdeal [LE P] {I : Set P} (h : IsIdeal I) : Ideal P := ⟨⟨I, h.IsLowerSet⟩, h.Nonempty, h.Directed⟩
def
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
IsIdeal.toIdeal
Create an element of type `Order.Ideal` from a set satisfying the predicate `Order.IsIdeal`.
toLowerSet_injective : Injective (toLowerSet : Ideal P → LowerSet P) := fun s t _ ↦ by cases s cases t congr
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
toLowerSet_injective
null
@[ext] ext {s t : Ideal P} : (s : Set P) = t → s = t := SetLike.ext' @[simp]
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
ext
null
carrier_eq_coe (s : Ideal P) : s.carrier = s := rfl @[simp]
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
carrier_eq_coe
null
coe_toLowerSet (s : Ideal P) : (s.toLowerSet : Set P) = s := rfl
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
coe_toLowerSet
null
protected lower (s : Ideal P) : IsLowerSet (s : Set P) := s.lower'
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
lower
null
protected nonempty (s : Ideal P) : (s : Set P).Nonempty := s.nonempty'
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
nonempty
null
protected directed (s : Ideal P) : DirectedOn (· ≤ ·) (s : Set P) := s.directed'
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
directed
null
protected isIdeal (s : Ideal P) : IsIdeal (s : Set P) := ⟨s.lower, s.nonempty, s.directed⟩
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
isIdeal
null
mem_compl_of_ge {x y : P} : x ≤ y → x ∈ (I : Set P)ᶜ → y ∈ (I : Set P)ᶜ := fun h ↦ mt <| I.lower h
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
mem_compl_of_ge
null
instPartialOrderIdeal : PartialOrder (Ideal P) := PartialOrder.lift SetLike.coe SetLike.coe_injective
instance
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
instPartialOrderIdeal
The partial ordering by subset inclusion, inherited from `Set P`.
coe_subset_coe : (s : Set P) ⊆ t ↔ s ≤ t := Iff.rfl
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
coe_subset_coe
null
coe_ssubset_coe : (s : Set P) ⊂ t ↔ s < t := Iff.rfl @[trans]
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
coe_ssubset_coe
null
mem_of_mem_of_le {x : P} {I J : Ideal P} : x ∈ I → I ≤ J → x ∈ J := @Set.mem_of_mem_of_subset P x I J
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
mem_of_mem_of_le
null
@[mk_iff] IsProper (I : Ideal P) : Prop where /-- This ideal is not the whole set. -/ ne_univ : (I : Set P) ≠ univ
class
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
IsProper
A proper ideal is one that is not the whole set. Note that the whole set might not be an ideal.
isProper_of_notMem {I : Ideal P} {p : P} (notMem : p ∉ I) : IsProper I := ⟨fun hp ↦ by have := mem_univ p rw [← hp] at this exact notMem this⟩ @[deprecated (since := "2025-05-23")] alias isProper_of_not_mem := isProper_of_notMem
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
isProper_of_notMem
null
@[mk_iff] IsMaximal (I : Ideal P) : Prop extends IsProper I where /-- This ideal is maximal in the collection of proper ideals. -/ maximal_proper : ∀ ⦃J : Ideal P⦄, I < J → (J : Set P) = univ
class
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
IsMaximal
An ideal is maximal if it is maximal in the collection of proper ideals. Note that `IsCoatom` is less general because ideals only have a top element when `P` is directed and nonempty.
inter_nonempty [IsDirected P (· ≥ ·)] (I J : Ideal P) : (I ∩ J : Set P).Nonempty := by obtain ⟨a, ha⟩ := I.nonempty obtain ⟨b, hb⟩ := J.nonempty obtain ⟨c, hac, hbc⟩ := exists_le_le a b exact ⟨c, I.lower hac ha, J.lower hbc hb⟩
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
inter_nonempty
null
@[simps] principal (p : P) : Ideal P where toLowerSet := LowerSet.Iic p nonempty' := nonempty_Iic directed' _ hx _ hy := ⟨p, le_rfl, hx, hy⟩
def
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
principal
In a directed and nonempty order, the top ideal of a is `univ`. -/ instance : OrderTop (Ideal P) where top := ⟨⊤, univ_nonempty, directedOn_univ⟩ le_top _ _ _ := LowerSet.mem_top @[simp] theorem top_toLowerSet : (⊤ : Ideal P).toLowerSet = ⊤ := rfl @[simp] theorem coe_top : ((⊤ : Ideal P) : Set P) = univ := rf...
@[simp] principal_le_iff : principal x ≤ I ↔ x ∈ I := ⟨fun h ↦ h le_rfl, fun hx _ hy ↦ I.lower hy hx⟩ @[simp]
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
principal_le_iff
null
mem_principal : x ∈ principal y ↔ x ≤ y := Iff.rfl
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
mem_principal
null
mem_principal_self : x ∈ principal x := mem_principal.2 (le_refl x)
lemma
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
mem_principal_self
null
sup_mem (hx : x ∈ s) (hy : y ∈ s) : x ⊔ y ∈ s := let ⟨_, hz, hx, hy⟩ := s.directed x hx y hy s.lower (sup_le hx hy) hz @[simp]
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
sup_mem
There is a bottom ideal when `P` has a bottom element. -/ instance : OrderBot (Ideal P) where bot := principal ⊥ bot_le := by simp @[simp] theorem principal_bot : principal (⊥ : P) = ⊥ := rfl end OrderBot section OrderTop variable [OrderTop P] @[simp] theorem principal_top : principal (⊤ : P) = ⊤ := toLowe...
sup_mem_iff : x ⊔ y ∈ I ↔ x ∈ I ∧ y ∈ I := ⟨fun h ↦ ⟨I.lower le_sup_left h, I.lower le_sup_right h⟩, fun h ↦ sup_mem h.1 h.2⟩ @[simp]
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
sup_mem_iff
null
finsetSup_mem_iff {P : Type*} [SemilatticeSup P] [OrderBot P] (t : Ideal P) {ι : Type*} {f : ι → P} {s : Finset ι} : s.sup f ∈ t ↔ ∀ i ∈ s, f i ∈ t := by classical induction s using Finset.induction_on <;> simp [*]
lemma
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
finsetSup_mem_iff
null
Cofinal (P) [Preorder P] where /-- The carrier of a `Cofinal` is the underlying set. -/ carrier : Set P /-- The `Cofinal` contains arbitrarily large elements. -/ isCofinal : IsCofinal carrier
structure
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
Cofinal
The infimum of two ideals of a co-directed order is their intersection. -/ instance : Min (Ideal P) := ⟨fun I J ↦ { toLowerSet := I.toLowerSet ⊓ J.toLowerSet nonempty' := inter_nonempty I J directed' := fun x hx y hy ↦ ⟨x ⊔ y, ⟨sup_mem hx.1 hy.1, sup_mem hx.2 hy.2⟩, by simp⟩ }⟩ /-- The supremum of tw...
noncomputable above : P := Classical.choose <| D.isCofinal x
def
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
above
A (noncomputable) element of a cofinal set lying above a given element.
above_mem : D.above x ∈ D := (Classical.choose_spec <| D.isCofinal x).1
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
above_mem
null
le_above : x ≤ D.above x := (Classical.choose_spec <| D.isCofinal x).2
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
le_above
null
noncomputable sequenceOfCofinals : ℕ → P | 0 => p | n + 1 => match Encodable.decode n with | none => sequenceOfCofinals n | some i => (𝒟 i).above (sequenceOfCofinals n)
def
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
sequenceOfCofinals
Given a starting point, and a countable family of cofinal sets, this is an increasing sequence that intersects each cofinal set.
sequenceOfCofinals.monotone : Monotone (sequenceOfCofinals p 𝒟) := by apply monotone_nat_of_le_succ intro n dsimp only [sequenceOfCofinals, Nat.add] cases (Encodable.decode n : Option ι) · rfl · apply Cofinal.le_above
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
sequenceOfCofinals.monotone
null
sequenceOfCofinals.encode_mem (i : ι) : sequenceOfCofinals p 𝒟 (Encodable.encode i + 1) ∈ 𝒟 i := by dsimp only [sequenceOfCofinals, Nat.add] rw [Encodable.encodek] apply Cofinal.above_mem
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
sequenceOfCofinals.encode_mem
null
idealOfCofinals : Ideal P where carrier := { x : P | ∃ n, x ≤ sequenceOfCofinals p 𝒟 n } lower' := fun _ _ hxy ⟨n, hn⟩ ↦ ⟨n, le_trans hxy hn⟩ nonempty' := ⟨p, 0, le_rfl⟩ directed' := fun _ ⟨n, hn⟩ _ ⟨m, hm⟩ ↦ ⟨_, ⟨max n m, le_rfl⟩, le_trans hn <| sequenceOfCofinals.monotone p 𝒟 (le_max_left _ _), le...
def
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
idealOfCofinals
Given an element `p : P` and a family `𝒟` of cofinal subsets of a preorder `P`, indexed by a countable type, `idealOfCofinals p 𝒟` is an ideal in `P` which - contains `p`, according to `mem_idealOfCofinals p 𝒟`, and - intersects every set in `𝒟`, according to `cofinal_meets_idealOfCofinals p 𝒟`. This prov...
mem_idealOfCofinals : p ∈ idealOfCofinals p 𝒟 := ⟨0, le_rfl⟩
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
mem_idealOfCofinals
null
cofinal_meets_idealOfCofinals (i : ι) : ∃ x : P, x ∈ 𝒟 i ∧ x ∈ idealOfCofinals p 𝒟 := ⟨_, sequenceOfCofinals.encode_mem p 𝒟 i, _, le_rfl⟩
theorem
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
cofinal_meets_idealOfCofinals
`idealOfCofinals p 𝒟` is `𝒟`-generic.
isIdeal_sUnion_of_directedOn {C : Set (Set P)} (hidl : ∀ I ∈ C, IsIdeal I) (hD : DirectedOn (· ⊆ ·) C) (hNe : C.Nonempty) : IsIdeal C.sUnion := by refine ⟨isLowerSet_sUnion (fun I hI ↦ (hidl I hI).1), Set.nonempty_sUnion.2 ?_, directedOn_sUnion hD (fun J hJ => (hidl J hJ).3)⟩ let ⟨I, hI⟩ := hNe exact ⟨I, ...
lemma
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
isIdeal_sUnion_of_directedOn
A non-empty directed union of ideals of sets in a preorder is an ideal.
isIdeal_sUnion_of_isChain {C : Set (Set P)} (hidl : ∀ I ∈ C, IsIdeal I) (hC : IsChain (· ⊆ ·) C) (hNe : C.Nonempty) : IsIdeal C.sUnion := isIdeal_sUnion_of_directedOn hidl hC.directedOn hNe
lemma
Order
[ "Mathlib.Data.Finset.Lattice.Fold", "Mathlib.Logic.Encodable.Basic", "Mathlib.Order.Atoms", "Mathlib.Order.Cofinal", "Mathlib.Order.UpperLower.Principal" ]
Mathlib/Order/Ideal.lean
isIdeal_sUnion_of_isChain
A union of a nonempty chain of ideals of sets is an ideal.
InitialSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where /-- The order embedding is an initial segment -/ mem_range_of_rel' : ∀ a b, s b (toRelEmbedding a) → b ∈ Set.range toRelEmbedding @[inherit_doc] scoped[InitialSeg] infixl:25 " ≼i " => InitialSeg
structure
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
InitialSeg
If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order embedding whose `Set.range` is a lower set. That is, whenever `b < f a` in `β` then `b` is in the range of `f`.
toOrderEmbedding [PartialOrder α] [PartialOrder β] (f : α ≤i β) : α ↪o β := f.orderEmbeddingOfLTEmbedding @[simp]
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
toOrderEmbedding
An `InitialSeg` between the `<` relations of two types. -/ notation:25 α:24 " ≤i " β:25 => @InitialSeg α β (· < ·) (· < ·) namespace InitialSeg instance : Coe (r ≼i s) (r ↪r s) := ⟨InitialSeg.toRelEmbedding⟩ instance : FunLike (r ≼i s) α β where coe f := f.toFun coe_injective' := by rintro ⟨f, hf⟩ ⟨g, hg⟩ ...
toOrderEmbedding_apply [PartialOrder α] [PartialOrder β] (f : α ≤i β) (x : α) : f.toOrderEmbedding x = f x := rfl @[simp]
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
toOrderEmbedding_apply
null
coe_toOrderEmbedding [PartialOrder α] [PartialOrder β] (f : α ≤i β) : (f.toOrderEmbedding : α → β) = f := rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
coe_toOrderEmbedding
null
@[ext] ext {f g : r ≼i s} (h : ∀ x, f x = g x) : f = g := DFunLike.ext f g h @[simp]
lemma
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
ext
null
coe_coe_fn (f : r ≼i s) : ((f : r ↪r s) : α → β) = f := rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
coe_coe_fn
null
mem_range_of_rel (f : r ≼i s) {a : α} {b : β} : s b (f a) → b ∈ Set.range f := f.mem_range_of_rel' _ _
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
mem_range_of_rel
null
map_rel_iff {a b : α} (f : r ≼i s) : s (f a) (f b) ↔ r a b := f.map_rel_iff'
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
map_rel_iff
null
inj (f : r ≼i s) {a b : α} : f a = f b ↔ a = b := f.toRelEmbedding.inj
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
inj
null
exists_eq_iff_rel (f : r ≼i s) {a : α} {b : β} : s b (f a) ↔ ∃ a', f a' = b ∧ r a' a := ⟨fun h => by rcases f.mem_range_of_rel h with ⟨a', rfl⟩ exact ⟨a', rfl, f.map_rel_iff.1 h⟩, fun ⟨_, e, h⟩ => e ▸ f.map_rel_iff.2 h⟩
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
exists_eq_iff_rel
null
@[simps!] _root_.RelIso.toInitialSeg (f : r ≃r s) : r ≼i s := ⟨f, by simp⟩
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
_root_.RelIso.toInitialSeg
A relation isomorphism is an initial segment embedding
@[refl] protected refl (r : α → α → Prop) : r ≼i r := (RelIso.refl r).toInitialSeg
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
refl
The identity function shows that `≼i` is reflexive
@[trans] protected trans (f : r ≼i s) (g : s ≼i t) : r ≼i t := ⟨f.1.trans g.1, fun a c h => by simp only [RelEmbedding.coe_trans, coe_coe_fn, comp_apply] at h ⊢ rcases g.2 _ _ h with ⟨b, rfl⟩; have h := g.map_rel_iff.1 h rcases f.2 _ _ h with ⟨a', rfl⟩; exact ⟨a', rfl⟩⟩ @[simp]
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
trans
Composition of functions shows that `≼i` is transitive
refl_apply (x : α) : InitialSeg.refl r x = x := rfl @[simp]
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
refl_apply
null
trans_apply (f : r ≼i s) (g : s ≼i t) (a : α) : (f.trans g) a = g (f a) := rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
trans_apply
null
subsingleton_of_trichotomous_of_irrefl [IsTrichotomous β s] [IsIrrefl β s] [IsWellFounded α r] : Subsingleton (r ≼i s) where allEq f g := by ext a refine IsWellFounded.induction r a fun b IH => extensional_of_trichotomous_of_irrefl s fun x => ?_ rw [f.exists_eq_iff_rel, g.exists_eq_iff_rel] ...
instance
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
subsingleton_of_trichotomous_of_irrefl
null
antisymm [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) : r ≃r s := have := f.toRelEmbedding.isWellOrder ⟨⟨f, g, antisymm_aux f g, antisymm_aux g f⟩, f.map_rel_iff'⟩ @[simp]
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
antisymm
Given a well order `s`, there is at most one initial segment embedding of `r` into `s`. -/ instance [IsWellOrder β s] : Subsingleton (r ≼i s) := ⟨fun a => have := a.isWellFounded; Subsingleton.elim a⟩ protected theorem eq [IsWellOrder β s] (f g : r ≼i s) (a) : f a = g a := by rw [Subsingleton.elim f g] theorem eq...
antisymm_toFun [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) : (antisymm f g : α → β) = f := rfl @[simp]
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
antisymm_toFun
null
antisymm_symm [IsWellOrder α r] [IsWellOrder β s] (f : r ≼i s) (g : s ≼i r) : (antisymm f g).symm = antisymm g f := RelIso.coe_fn_injective rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
antisymm_symm
null
eq_or_principal [IsWellOrder β s] (f : r ≼i s) : Surjective f ∨ ∃ b, ∀ x, x ∈ Set.range f ↔ s x b := by apply or_iff_not_imp_right.2 intro h b push_neg at h apply IsWellFounded.induction s b intro x IH obtain ⟨y, ⟨hy, hs⟩ | ⟨hy, hs⟩⟩ := h x · obtain (rfl | h) := (trichotomous y x).resolve_left hs ...
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
eq_or_principal
An initial segment embedding is either an isomorphism, or a principal segment embedding. See also `InitialSeg.ltOrEq`.
codRestrict (p : Set β) (f : r ≼i s) (H : ∀ a, f a ∈ p) : r ≼i Subrel s (· ∈ p) := ⟨RelEmbedding.codRestrict p f H, fun a ⟨b, m⟩ h => let ⟨a', e⟩ := f.mem_range_of_rel h ⟨a', by subst e; rfl⟩⟩ @[simp]
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
codRestrict
Restrict the codomain of an initial segment
codRestrict_apply (p) (f : r ≼i s) (H a) : codRestrict p f H a = ⟨f a, H a⟩ := rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
codRestrict_apply
null
ofIsEmpty (r : α → α → Prop) (s : β → β → Prop) [IsEmpty α] : r ≼i s := ⟨RelEmbedding.ofIsEmpty r s, isEmptyElim⟩
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
ofIsEmpty
Initial segment embedding from an empty type.
leAdd (r : α → α → Prop) (s : β → β → Prop) : r ≼i Sum.Lex r s := ⟨⟨⟨Sum.inl, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩, fun a b => by cases b <;> [exact fun _ => ⟨_, rfl⟩; exact False.elim ∘ Sum.lex_inr_inl]⟩ @[simp]
def
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
leAdd
Initial segment embedding of an order `r` into the disjoint union of `r` and `s`.
leAdd_apply (r : α → α → Prop) (s : β → β → Prop) (a) : leAdd r s a = Sum.inl a := rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
leAdd_apply
null
protected acc (f : r ≼i s) (a : α) : Acc r a ↔ Acc s (f a) := ⟨by refine fun h => Acc.recOn h fun a _ ha => Acc.intro _ fun b hb => ?_ obtain ⟨a', rfl⟩ := f.mem_range_of_rel hb exact ha _ (f.map_rel_iff.mp hb), f.toRelEmbedding.acc a⟩
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
acc
null
PrincipalSeg {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where /-- The supremum of the principal segment -/ top : β /-- The range of the order embedding is the set of elements `b` such that `s b top` -/ mem_range_iff_rel' : ∀ b, b ∈ Set.range toRelEmbedding ↔ s b top @[inherit_doc] scoped...
structure
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
PrincipalSeg
If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an initial segment embedding whose range is `Set.Iio x` for some element `x`. If `β` is a well order, this is equivalent to the embedding not being surjective.
hasCoeInitialSeg [IsTrans β s] : Coe (r ≺i s) (r ≼i s) := ⟨fun f => ⟨f.toRelEmbedding, fun _ _ => f.mem_range_of_rel⟩⟩
instance
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
hasCoeInitialSeg
A `PrincipalSeg` between the `<` relations of two types. -/ notation:25 α:24 " <i " β:25 => @PrincipalSeg α β (· < ·) (· < ·) open scoped InitialSeg namespace PrincipalSeg instance : CoeOut (r ≺i s) (r ↪r s) := ⟨PrincipalSeg.toRelEmbedding⟩ instance : CoeFun (r ≺i s) fun _ => α → β := ⟨fun f => f⟩ theorem toRe...
coe_coe_fn' [IsTrans β s] (f : r ≺i s) : ((f : r ≼i s) : α → β) = f := rfl
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
coe_coe_fn'
null
_root_.InitialSeg.eq_principalSeg [IsWellOrder β s] (f : r ≼i s) (g : r ≺i s) (a : α) : g a = f a := InitialSeg.eq g f a
theorem
Order
[ "Mathlib.Data.Sum.Order", "Mathlib.Order.Hom.Lex", "Mathlib.Order.RelIso.Set", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.WellFounded" ]
Mathlib/Order/InitialSeg.lean
_root_.InitialSeg.eq_principalSeg
null