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
gc_upperPolar_lowerPolar : GaloisConnection (toDual ∘ upperPolar r) (lowerPolar r ∘ ofDual) := fun _ _ => subset_upperPolar_iff_subset_lowerPolar @[deprecated (since := "2025-07-10")] alias gc_intentClosure_extentClosure := gc_upperPolar_lowerPolar
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
gc_upperPolar_lowerPolar
null
upperPolar_swap (t : Set β) : upperPolar (swap r) t = lowerPolar r t := rfl @[deprecated (since := "2025-07-10")] alias intentClosure_swap := upperPolar_swap
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_swap
null
lowerPolar_swap (s : Set α) : lowerPolar (swap r) s = upperPolar r s := rfl @[deprecated (since := "2025-07-10")] alias extentClosure_swap := lowerPolar_swap @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_swap
null
upperPolar_empty : upperPolar r ∅ = univ := eq_univ_of_forall fun _ _ => False.elim @[deprecated (since := "2025-07-10")] alias intentClosure_empty := upperPolar_empty @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_empty
null
lowerPolar_empty : lowerPolar r ∅ = univ := upperPolar_empty _ @[deprecated (since := "2025-07-10")] alias extentClosure_empty := lowerPolar_empty @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_empty
null
upperPolar_union (s₁ s₂ : Set α) : upperPolar r (s₁ ∪ s₂) = upperPolar r s₁ ∩ upperPolar r s₂ := ext fun _ => forall₂_or_left @[deprecated (since := "2025-07-10")] alias intentClosure_union := upperPolar_union @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_union
null
lowerPolar_union (t₁ t₂ : Set β) : lowerPolar r (t₁ ∪ t₂) = lowerPolar r t₁ ∩ lowerPolar r t₂ := upperPolar_union .. @[deprecated (since := "2025-07-10")] alias extentClosure_union := lowerPolar_union @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_union
null
upperPolar_iUnion (f : ι → Set α) : upperPolar r (⋃ i, f i) = ⋂ i, upperPolar r (f i) := (gc_upperPolar_lowerPolar r).l_iSup @[deprecated (since := "2025-07-10")] alias intentClosure_iUnion := upperPolar_iUnion @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_iUnion
null
lowerPolar_iUnion (f : ι → Set β) : lowerPolar r (⋃ i, f i) = ⋂ i, lowerPolar r (f i) := upperPolar_iUnion .. @[deprecated (since := "2025-07-10")] alias extentClosure_iUnion := lowerPolar_iUnion
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_iUnion
null
upperPolar_iUnion₂ (f : ∀ i, κ i → Set α) : upperPolar r (⋃ (i) (j), f i j) = ⋂ (i) (j), upperPolar r (f i j) := (gc_upperPolar_lowerPolar r).l_iSup₂ @[deprecated (since := "2025-07-10")] alias intentClosure_iUnion₂ := upperPolar_iUnion₂
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_iUnion₂
null
lowerPolar_iUnion₂ (f : ∀ i, κ i → Set β) : lowerPolar r (⋃ (i) (j), f i j) = ⋂ (i) (j), lowerPolar r (f i j) := upperPolar_iUnion₂ .. @[deprecated (since := "2025-07-10")] alias extentClosure_iUnion₂ := lowerPolar_iUnion₂
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_iUnion₂
null
subset_lowerPolar_upperPolar (s : Set α) : s ⊆ lowerPolar r (upperPolar r s) := (gc_upperPolar_lowerPolar r).le_u_l _ @[deprecated (since := "2025-07-10")] alias subset_extentClosure_intentClosure := subset_lowerPolar_upperPolar
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
subset_lowerPolar_upperPolar
null
subset_upperPolar_lowerPolar (t : Set β) : t ⊆ upperPolar r (lowerPolar r t) := subset_lowerPolar_upperPolar _ t @[deprecated (since := "2025-07-10")] alias subset_intentClosure_extentClosure := subset_upperPolar_lowerPolar @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
subset_upperPolar_lowerPolar
null
upperPolar_lowerPolar_upperPolar (s : Set α) : upperPolar r (lowerPolar r <| upperPolar r s) = upperPolar r s := (gc_upperPolar_lowerPolar r).l_u_l_eq_l _ @[deprecated (since := "2025-07-10")] alias intentClosure_extentClosure_intentClosure := upperPolar_lowerPolar_upperPolar @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_lowerPolar_upperPolar
null
lowerPolar_upperPolar_lowerPolar (t : Set β) : lowerPolar r (upperPolar r <| lowerPolar r t) = lowerPolar r t := upperPolar_lowerPolar_upperPolar _ t @[deprecated (since := "2025-07-10")] alias extentClosure_intentClosure_extentClosure := lowerPolar_upperPolar_lowerPolar
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_upperPolar_lowerPolar
null
upperPolar_anti : Antitone (upperPolar r) := (gc_upperPolar_lowerPolar r).monotone_l @[deprecated (since := "2025-07-10")] alias intentClosure_anti := upperPolar_anti
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
upperPolar_anti
null
lowerPolar_anti : Antitone (lowerPolar r) := upperPolar_anti _ @[deprecated (since := "2025-07-10")] alias extentClosure_anti := lowerPolar_anti /-! ### Concepts -/ variable (α β)
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
lowerPolar_anti
null
Concept where /-- The extent of a concept. -/ extent : Set α /-- The intent of a concept. -/ intent : Set β /-- The intent consists of all elements related to all elements of the extent. -/ upperPolar_extent : upperPolar r extent = intent /-- The extent consists of all elements related to all elements of ...
structure
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
Concept
The formal concepts of a relation. A concept of `r : α → β → Prop` is a pair of sets `s`, `t` such that `s` is the set of all elements that are `r`-related to all of `t` and `t` is the set of all elements that are `r`-related to all of `s`.
@[ext] ext (h : c.extent = d.extent) : c = d := by obtain ⟨s₁, t₁, rfl, _⟩ := c obtain ⟨s₂, t₂, rfl, _⟩ := d substs h rfl
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
ext
null
ext' (h : c.intent = d.intent) : c = d := by obtain ⟨s₁, t₁, _, rfl⟩ := c obtain ⟨s₂, t₂, _, rfl⟩ := d substs h rfl
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
ext'
null
extent_injective : Injective (@extent α β r) := fun _ _ => ext @[deprecated (since := "2025-07-10")] alias fst_injective := extent_injective
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_injective
null
intent_injective : Injective (@intent α β r) := fun _ _ => ext' @[deprecated (since := "2025-07-10")] alias snd_injective := intent_injective
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_injective
null
rel_extent_intent {x y} (hx : x ∈ c.extent) (hy : y ∈ c.intent) : r x y := by rw [← c.upperPolar_extent] at hy exact hy hx
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
rel_extent_intent
null
disjoint_extent_intent [IsIrrefl α r'] : Disjoint c'.extent c'.intent := by rw [disjoint_iff_forall_ne] rintro x hx _ hx' rfl exact irrefl x (rel_extent_intent hx hx')
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
disjoint_extent_intent
Note that if `r'` is the `≤` relation, this theorem will often not be true!
mem_extent_of_rel_extent [IsTrans α r'] {x y} (hy : r' y x) (hx : x ∈ c'.extent) : y ∈ c'.extent := by rw [← lowerPolar_intent] exact fun z hz ↦ _root_.trans hy (rel_extent_intent hx hz)
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
mem_extent_of_rel_extent
null
mem_intent_of_intent_rel [IsTrans α r'] {x y} (hy : r' x y) (hx : x ∈ c'.intent) : y ∈ c'.intent := by rw [← upperPolar_extent] exact fun z hz ↦ _root_.trans (rel_extent_intent hz hx) hy
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
mem_intent_of_intent_rel
null
codisjoint_extent_intent [IsTrichotomous α r'] [IsTrans α r'] : Codisjoint c'.extent c'.intent := by rw [codisjoint_iff_le_sup] refine fun x _ ↦ or_iff_not_imp_left.2 fun hx ↦ ?_ rw [← upperPolar_extent] intro y hy obtain h | rfl | h := trichotomous_of r' x y · cases hx <| mem_extent_of_rel_extent h hy ...
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
codisjoint_extent_intent
null
instSupConcept : Max (Concept α β r) := ⟨fun c d => { extent := lowerPolar r (c.intent ∩ d.intent) intent := c.intent ∩ d.intent upperPolar_extent := by rw [← c.upperPolar_extent, ← d.upperPolar_extent, ← upperPolar_union, upperPolar_lowerPolar_upperPolar] lowerPolar_intent := ...
instance
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
instSupConcept
null
instInfConcept : Min (Concept α β r) := ⟨fun c d => { extent := c.extent ∩ d.extent intent := upperPolar r (c.extent ∩ d.extent) upperPolar_extent := rfl lowerPolar_intent := by rw [← c.lowerPolar_intent, ← d.lowerPolar_intent, ← lowerPolar_union, lowerPolar_upperPolar_lowerPol...
instance
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
instInfConcept
null
instSemilatticeInfConcept : SemilatticeInf (Concept α β r) := (extent_injective.semilatticeInf _) fun _ _ => rfl @[simp]
instance
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
instSemilatticeInfConcept
null
extent_subset_extent_iff : c.extent ⊆ d.extent ↔ c ≤ d := Iff.rfl @[deprecated (since := "2025-07-10")] alias fst_subset_fst_iff := extent_subset_extent_iff @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_subset_extent_iff
null
extent_ssubset_extent_iff : c.extent ⊂ d.extent ↔ c < d := Iff.rfl @[deprecated (since := "2025-07-10")] alias fst_ssubset_fst_iff := extent_ssubset_extent_iff @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_ssubset_extent_iff
null
intent_subset_intent_iff : c.intent ⊆ d.intent ↔ d ≤ c := by refine ⟨fun h => ?_, fun h => ?_⟩ · rw [← extent_subset_extent_iff, ← c.lowerPolar_intent, ← d.lowerPolar_intent] exact lowerPolar_anti _ h · rw [← c.upperPolar_extent, ← d.upperPolar_extent] exact upperPolar_anti _ h @[deprecated (since := "202...
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_subset_intent_iff
null
intent_ssubset_intent_iff : c.intent ⊂ d.intent ↔ d < c := by rw [ssubset_iff_subset_not_subset, lt_iff_le_not_ge, intent_subset_intent_iff, intent_subset_intent_iff] @[deprecated (since := "2025-07-10")] alias snd_ssubset_snd_iff := intent_ssubset_intent_iff
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_ssubset_intent_iff
null
strictMono_extent : StrictMono (@extent α β r) := fun _ _ => extent_ssubset_extent_iff.2 @[deprecated (since := "2025-07-10")] alias strictMono_fst := strictMono_extent
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
strictMono_extent
null
strictAnti_intent : StrictAnti (@intent α β r) := fun _ _ => intent_ssubset_intent_iff.2 @[deprecated (since := "2025-07-10")] alias strictMono_snd := strictAnti_intent
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
strictAnti_intent
null
instLatticeConcept : Lattice (Concept α β r) := { Concept.instSemilatticeInfConcept with sup := (· ⊔ ·) le_sup_left := fun _ _ => intent_subset_intent_iff.1 inter_subset_left le_sup_right := fun _ _ => intent_subset_intent_iff.1 inter_subset_right sup_le := fun c d e => by simp_rw [← intent_subs...
instance
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
instLatticeConcept
null
instBoundedOrderConcept : BoundedOrder (Concept α β r) where top := ⟨univ, upperPolar r univ, rfl, eq_univ_of_forall fun _ _ hb => hb trivial⟩ le_top _ := subset_univ _ bot := ⟨lowerPolar r univ, univ, eq_univ_of_forall fun _ _ ha => ha trivial, rfl⟩ bot_le _ := intent_subset_intent_iff.1 <| subset_univ _
instance
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
instBoundedOrderConcept
null
@[simp] extent_top : (⊤ : Concept α β r).extent = univ := rfl @[deprecated (since := "2025-07-10")] alias top_fst := extent_top @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_top
null
intent_top : (⊤ : Concept α β r).intent = upperPolar r univ := rfl @[deprecated (since := "2025-07-10")] alias top_snd := intent_top @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_top
null
extent_bot : (⊥ : Concept α β r).extent = lowerPolar r univ := rfl @[deprecated (since := "2025-07-10")] alias bot_fst := extent_bot @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_bot
null
intent_bot : (⊥ : Concept α β r).intent = univ := rfl @[deprecated (since := "2025-07-10")] alias bot_snd := intent_bot @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_bot
null
extent_sup (c d : Concept α β r) : (c ⊔ d).extent = lowerPolar r (c.intent ∩ d.intent) := rfl @[deprecated (since := "2025-07-10")] alias sup_fst := extent_top @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_sup
null
intent_sup (c d : Concept α β r) : (c ⊔ d).intent = c.intent ∩ d.intent := rfl @[deprecated (since := "2025-07-10")] alias sup_snd := intent_sup @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_sup
null
extent_inf (c d : Concept α β r) : (c ⊓ d).extent = c.extent ∩ d.extent := rfl @[deprecated (since := "2025-07-10")] alias inf_fst := extent_inf @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_inf
null
intent_inf (c d : Concept α β r) : (c ⊓ d).intent = upperPolar r (c.extent ∩ d.extent) := rfl @[deprecated (since := "2025-07-10")] alias inf_snd := intent_inf @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_inf
null
extent_sSup (S : Set (Concept α β r)) : (sSup S).extent = lowerPolar r (⋂ c ∈ S, intent c) := rfl @[deprecated (since := "2025-07-10")] alias sSup_fst := extent_sSup @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_sSup
null
intent_sSup (S : Set (Concept α β r)) : (sSup S).intent = ⋂ c ∈ S, intent c := rfl @[deprecated (since := "2025-07-10")] alias sSup_snd := intent_sSup @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_sSup
null
extent_sInf (S : Set (Concept α β r)) : (sInf S).extent = ⋂ c ∈ S, extent c := rfl @[deprecated (since := "2025-07-10")] alias sInf_fst := extent_sInf @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
extent_sInf
null
intent_sInf (S : Set (Concept α β r)) : (sInf S).intent = upperPolar r (⋂ c ∈ S, extent c) := rfl @[deprecated (since := "2025-07-10")] alias sInf_snd := intent_sInf
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
intent_sInf
null
@[simps] swap (c : Concept α β r) : Concept β α (swap r) := ⟨c.intent, c.extent, c.lowerPolar_intent, c.upperPolar_extent⟩ @[simp]
def
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
swap
Swap the sets of a concept to make it a concept of the dual context.
swap_swap (c : Concept α β r) : c.swap.swap = c := ext rfl @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
swap_swap
null
swap_le_swap_iff : c.swap ≤ d.swap ↔ d ≤ c := intent_subset_intent_iff @[simp]
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
swap_le_swap_iff
null
swap_lt_swap_iff : c.swap < d.swap ↔ d < c := intent_ssubset_intent_iff
theorem
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
swap_lt_swap_iff
null
@[simps] swapEquiv : (Concept α β r)ᵒᵈ ≃o Concept β α (Function.swap r) where toFun := swap ∘ ofDual invFun := toDual ∘ swap left_inv := swap_swap right_inv := swap_swap map_rel_iff' := swap_le_swap_iff
def
Order
[ "Mathlib.Data.Set.Lattice" ]
Mathlib/Order/Concept.lean
swapEquiv
The dual of a concept lattice is isomorphic to the concept lattice of the dual context.
OrderTop.copy {h : LE α} {h' : LE α} (c : @OrderTop α h') (top : α) (eq_top : top = (by infer_instance : Top α).top) (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @OrderTop α h := @OrderTop.mk α h { top := top } fun _ ↦ by simp [eq_top, le_eq]
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
OrderTop.copy
A function to create a provable equal copy of a top order with possibly different definitional equalities.
OrderBot.copy {h : LE α} {h' : LE α} (c : @OrderBot α h') (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @OrderBot α h := @OrderBot.mk α h { bot := bot } fun _ ↦ by simp [eq_bot, le_eq]
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
OrderBot.copy
A function to create a provable equal copy of a bottom order with possibly different definitional equalities.
BoundedOrder.copy {h : LE α} {h' : LE α} (c : @BoundedOrder α h') (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @BoundedOrder α h := @BoundedOrder.mk α h (@OrderTop.mk α h { top := top }...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
BoundedOrder.copy
A function to create a provable equal copy of a bounded order with possibly different definitional equalities.
Lattice.copy (c : Lattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf : inf = (by infer_instance : Min α).min) : Lattice α where le := le sup := sup inf := inf lt := fun a b ↦ le a b ...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
Lattice.copy
A function to create a provable equal copy of a lattice with possibly different definitional equalities.
DistribLattice.copy (c : DistribLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf : inf = (by infer_instance : Min α).min) : DistribLattice α where toLattice := Lattice.copy (@DistribLatt...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
DistribLattice.copy
A function to create a provable equal copy of a distributive lattice with possibly different definitional equalities.
GeneralizedHeytingAlgebra.copy (c : GeneralizedHeytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf : inf = (by infer_inst...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
GeneralizedHeytingAlgebra.copy
A function to create a provable equal copy of a generalised heyting algebra with possibly different definitional equalities.
GeneralizedCoheytingAlgebra.copy (c : GeneralizedCoheytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf : inf = (by infer_...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
GeneralizedCoheytingAlgebra.copy
A function to create a provable equal copy of a generalised co-Heyting algebra with possibly different definitional equalities.
HeytingAlgebra.copy (c : HeytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : ...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
HeytingAlgebra.copy
A function to create a provable equal copy of a heyting algebra with possibly different definitional equalities.
CoheytingAlgebra.copy (c : CoheytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (in...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
CoheytingAlgebra.copy
A function to create a provable equal copy of a co-Heyting algebra with possibly different definitional equalities.
BiheytingAlgebra.copy (c : BiheytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (in...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
BiheytingAlgebra.copy
A function to create a provable equal copy of a bi-Heyting algebra with possibly different definitional equalities.
CompleteLattice.copy (c : CompleteLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf ...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
CompleteLattice.copy
A function to create a provable equal copy of a complete lattice with possibly different definitional equalities.
Frame.copy (c : Frame α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf : i...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
Frame.copy
A function to create a provable equal copy of a frame with possibly different definitional equalities.
Coframe.copy (c : Coframe α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
Coframe.copy
A function to create a provable equal copy of a coframe with possibly different definitional equalities.
CompleteDistribLattice.copy (c : CompleteDistribLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α)....
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
CompleteDistribLattice.copy
A function to create a provable equal copy of a complete distributive lattice with possibly different definitional equalities.
ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) (inf : α → α → α) (eq_inf : inf = (by infer_instance : Min α).min) (sSup : Set α → α) (eq_sSup : sSup...
def
Order
[ "Mathlib.Order.ConditionallyCompleteLattice.Basic" ]
Mathlib/Order/Copy.lean
ConditionallyCompleteLattice.copy
A function to create a provable equal copy of a conditionally complete lattice with possibly different definitional equalities.
exists_between_finsets [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [nonem : Nonempty α] (lo hi : Finset α) (lo_lt_hi : ∀ x ∈ lo, ∀ y ∈ hi, x < y) : ∃ m : α, (∀ x ∈ lo, x < m) ∧ ∀ y ∈ hi, m < y := if nlo : lo.Nonempty then if nhi : hi.Nonempty then Exists.elim (exists_between (lo_lt_hi...
theorem
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
exists_between_finsets
Suppose `α` is a nonempty dense linear order without endpoints, and suppose `lo`, `hi`, are finite subsets with all of `lo` strictly before `hi`. Then there is an element of `α` strictly between `lo` and `hi`.
exists_orderEmbedding_insert [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [nonem : Nonempty β] (S : Finset α) (f : S ↪o β) (a : α) : ∃ (g : (insert a S : Finset α) ↪o β), g ∘ (Set.inclusion ((S.subset_insert a) : ↑S ⊆ ↑(insert a S))) = f := by let Slt := {x ∈ S.attach | x.val < a}.image f let Sgt ...
lemma
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
exists_orderEmbedding_insert
null
PartialIso : Type _ := { f : Finset (α × β) // ∀ p ∈ f, ∀ q ∈ f, cmp (Prod.fst p) (Prod.fst q) = cmp (Prod.snd p) (Prod.snd q) }
def
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
PartialIso
The type of partial order isomorphisms between `α` and `β` defined on finite subsets. A partial order isomorphism is encoded as a finite subset of `α × β`, consisting of pairs which should be identified.
exists_across [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] (f : PartialIso α β) (a : α) : ∃ b : β, ∀ p ∈ f.val, cmp (Prod.fst p) a = cmp (Prod.snd p) b := by by_cases h : ∃ b, (a, b) ∈ f.val · obtain ⟨b, hb⟩ := h exact ⟨b, fun p hp ↦ f.prop _ hp _ hb⟩ have : ∀ x ∈ {p ∈ f.val | p.f...
theorem
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
exists_across
For each `a`, we can find a `b` in the codomain, such that `a`'s relation to the domain of `f` is `b`'s relation to the image of `f`. Thus, if `a` is not already in `f`, then we can extend `f` by sending `a` to `b`.
protected comm : PartialIso α β → PartialIso β α := Subtype.map (Finset.image (Equiv.prodComm _ _)) fun f hf p hp q hq ↦ Eq.symm <| hf ((Equiv.prodComm α β).symm p) (by rw [← Finset.mem_coe, Finset.coe_image, Equiv.image_eq_preimage] at hp rwa [← Finset.mem_coe]) ((Equiv....
def
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
comm
A partial isomorphism between `α` and `β` is also a partial isomorphism between `β` and `α`.
definedAtLeft [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] (a : α) : Cofinal (PartialIso α β) where carrier := {f | ∃ b : β, (a, b) ∈ f.val} isCofinal f := by obtain ⟨b, a_b⟩ := exists_across f a refine ⟨⟨insert (a, b) f.val, fun p hp q hq ↦ ?_⟩, ⟨b, Finset.mem_insert_self _ _⟩, ...
def
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
definedAtLeft
The set of partial isomorphisms defined at `a : α`, together with a proof that any partial isomorphism can be extended to one defined at `a`.
definedAtRight [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [Nonempty α] (b : β) : Cofinal (PartialIso α β) where carrier := {f | ∃ a, (a, b) ∈ f.val} isCofinal f := by rcases (definedAtLeft α b).isCofinal f.comm with ⟨f', ⟨a, ha⟩, hl⟩ refine ⟨f'.comm, ⟨a, ?_⟩, ?_⟩ · change (a, b) ∈ f'.val.image...
def
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
definedAtRight
The set of partial isomorphisms defined at `b : β`, together with a proof that any partial isomorphism can be extended to include `b`. We prove this by symmetry.
funOfIdeal [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] (a : α) (I : Ideal (PartialIso α β)) : (∃ f, f ∈ definedAtLeft β a ∧ f ∈ I) → { b // ∃ f ∈ I, (a, b) ∈ Subtype.val f } := Classical.indefiniteDescription _ ∘ fun ⟨f, ⟨b, hb⟩, hf⟩ ↦ ⟨b, f, hf, hb⟩
def
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
funOfIdeal
Given an ideal which intersects `definedAtLeft β a`, pick `b : β` such that some partial function in the ideal maps `a` to `b`.
invOfIdeal [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [Nonempty α] (b : β) (I : Ideal (PartialIso α β)) : (∃ f, f ∈ definedAtRight α b ∧ f ∈ I) → { a // ∃ f ∈ I, (a, b) ∈ Subtype.val f } := Classical.indefiniteDescription _ ∘ fun ⟨f, ⟨a, ha⟩, hf⟩ ↦ ⟨a, f, hf, ha⟩
def
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
invOfIdeal
Given an ideal which intersects `definedAtRight α b`, pick `a : α` such that some partial function in the ideal maps `a` to `b`.
embedding_from_countable_to_dense [Countable α] [DenselyOrdered β] [Nontrivial β] : Nonempty (α ↪o β) := by cases nonempty_encodable α rcases exists_pair_lt β with ⟨x, y, hxy⟩ obtain ⟨a, ha⟩ := exists_between hxy haveI : Nonempty (Set.Ioo x y) := ⟨⟨a, ha⟩⟩ let our_ideal : Ideal (PartialIso α _) := ide...
theorem
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
embedding_from_countable_to_dense
Any countable linear order embeds in any nontrivial dense linear order.
iso_of_countable_dense [Countable α] [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [Nonempty α] [Countable β] [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] : Nonempty (α ≃o β) := by cases nonempty_encodable α cases nonempty_encodable β let to_cofinal : α ⊕ β → Cofinal (PartialIso α β) :...
theorem
Order
[ "Mathlib.Order.Ideal", "Mathlib.Data.Finset.Max" ]
Mathlib/Order/CountableDenseLinearOrder.lean
iso_of_countable_dense
Any two countable dense, nonempty linear orders without endpoints are order isomorphic. This is also known as **Cantor's isomorphism theorem**.
WCovBy.le (h : a ⩿ b) : a ≤ b := h.1
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.le
null
WCovBy.refl (a : α) : a ⩿ a := ⟨le_rfl, fun _ hc => hc.not_gt⟩ @[simp] lemma WCovBy.rfl : a ⩿ a := WCovBy.refl a
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.refl
null
protected Eq.wcovBy (h : a = b) : a ⩿ b := h ▸ WCovBy.rfl
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
Eq.wcovBy
null
wcovBy_of_le_of_le (h1 : a ≤ b) (h2 : b ≤ a) : a ⩿ b := ⟨h1, fun _ hac hcb => (hac.trans hcb).not_ge h2⟩ alias LE.le.wcovBy_of_le := wcovBy_of_le_of_le
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
wcovBy_of_le_of_le
null
AntisymmRel.wcovBy (h : AntisymmRel (· ≤ ·) a b) : a ⩿ b := wcovBy_of_le_of_le h.1 h.2
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
AntisymmRel.wcovBy
null
WCovBy.wcovBy_iff_le (hab : a ⩿ b) : b ⩿ a ↔ b ≤ a := ⟨fun h => h.le, fun h => h.wcovBy_of_le hab.le⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.wcovBy_iff_le
null
wcovBy_of_eq_or_eq (hab : a ≤ b) (h : ∀ c, a ≤ c → c ≤ b → c = a ∨ c = b) : a ⩿ b := ⟨hab, fun c ha hb => (h c ha.le hb.le).elim ha.ne' hb.ne⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
wcovBy_of_eq_or_eq
null
AntisymmRel.trans_wcovBy (hab : AntisymmRel (· ≤ ·) a b) (hbc : b ⩿ c) : a ⩿ c := ⟨hab.1.trans hbc.le, fun _ had hdc => hbc.2 (hab.2.trans_lt had) hdc⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
AntisymmRel.trans_wcovBy
null
wcovBy_congr_left (hab : AntisymmRel (· ≤ ·) a b) : a ⩿ c ↔ b ⩿ c := ⟨hab.symm.trans_wcovBy, hab.trans_wcovBy⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
wcovBy_congr_left
null
WCovBy.trans_antisymm_rel (hab : a ⩿ b) (hbc : AntisymmRel (· ≤ ·) b c) : a ⩿ c := ⟨hab.le.trans hbc.1, fun _ had hdc => hab.2 had <| hdc.trans_le hbc.2⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.trans_antisymm_rel
null
wcovBy_congr_right (hab : AntisymmRel (· ≤ ·) a b) : c ⩿ a ↔ c ⩿ b := ⟨fun h => h.trans_antisymm_rel hab, fun h => h.trans_antisymm_rel hab.symm⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
wcovBy_congr_right
null
not_wcovBy_iff (h : a ≤ b) : ¬a ⩿ b ↔ ∃ c, a < c ∧ c < b := by simp_rw [WCovBy, h, true_and, not_forall, exists_prop, not_not]
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
not_wcovBy_iff
If `a ≤ b`, then `b` does not cover `a` iff there's an element in between.
WCovBy.isRefl : IsRefl α (· ⩿ ·) := ⟨WCovBy.refl⟩
instance
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.isRefl
null
WCovBy.Ioo_eq (h : a ⩿ b) : Ioo a b = ∅ := eq_empty_iff_forall_notMem.2 fun _ hx => h.2 hx.1 hx.2
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.Ioo_eq
null
wcovBy_iff_Ioo_eq : a ⩿ b ↔ a ≤ b ∧ Ioo a b = ∅ := and_congr_right' <| by simp [eq_empty_iff_forall_notMem]
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
wcovBy_iff_Ioo_eq
null
WCovBy.of_le_of_le (hac : a ⩿ c) (hab : a ≤ b) (hbc : b ≤ c) : b ⩿ c := ⟨hbc, fun _x hbx hxc ↦ hac.2 (hab.trans_lt hbx) hxc⟩
lemma
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.of_le_of_le
null
WCovBy.of_le_of_le' (hac : a ⩿ c) (hab : a ≤ b) (hbc : b ≤ c) : a ⩿ b := ⟨hab, fun _x hax hxb ↦ hac.2 hax <| hxb.trans_le hbc⟩
lemma
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.of_le_of_le'
null
WCovBy.of_image (f : α ↪o β) (h : f a ⩿ f b) : a ⩿ b := ⟨f.le_iff_le.mp h.le, fun _ hac hcb => h.2 (f.lt_iff_lt.mpr hac) (f.lt_iff_lt.mpr hcb)⟩
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.of_image
null
WCovBy.image (f : α ↪o β) (hab : a ⩿ b) (h : (range f).OrdConnected) : f a ⩿ f b := by refine ⟨f.monotone hab.le, fun c ha hb => ?_⟩ obtain ⟨c, rfl⟩ := h.out (mem_range_self _) (mem_range_self _) ⟨ha.le, hb.le⟩ rw [f.lt_iff_lt] at ha hb exact hab.2 ha hb
theorem
Order
[ "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Hom.WithTopBot", "Mathlib.Order.Interval.Set.OrdConnected", "Mathlib.Order.Interval.Set.WithBotTop" ]
Mathlib/Order/Cover.lean
WCovBy.image
null