The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V04. Order and lattices

Mathlib.Order.Preorder.Chain

91 declarations. Mathlib docs · Source

Chains and flags

This file defines chains for an arbitrary relation and flags for an order.

Main declarations

  • IsChain s: A chain s is a set of comparable elements.
  • Flag: The type of flags, aka maximal chains, of an order.

Notes

Originally ported from Isabelle/HOL. The original file was written by Jacques D. Fleuriot, Tobias Nipkow, Christian Sternagel.

Chains

Flags

theorem Flag.mk.injEq E0 #

∀ {α : Type u_4} [inst : LE α] (carrier : Set α) (Chain' : IsChain (fun x1 x2 ↦ x1 ≤ x2) carrier)
  (max_chain' : ∀ ⦃s : Set α⦄, IsChain (fun x1 x2 ↦ x1 ≤ x2) s → carrier ⊆ s → carrier = s) (carrier_1 : Set α)
  (Chain'_1 : IsChain (fun x1 x2 ↦ x1 ≤ x2) carrier_1)
  (max_chain'_1 : ∀ ⦃s : Set α⦄, IsChain (fun x1 x2 ↦ x1 ≤ x2) s → carrier_1 ⊆ s → carrier_1 = s),
  ({ carrier := carrier, Chain' := Chain', max_chain' := max_chain' } =
      { carrier := carrier_1, Chain' := Chain'_1, max_chain' := max_chain'_1 }) =
    (carrier = carrier_1)

theorem Flag.mk.inj E1 #

∀ {α : Type u_4} {inst : LE α} {carrier : Set α} {Chain' : IsChain (fun x1 x2 ↦ x1 ≤ x2) carrier}
  {max_chain' : ∀ ⦃s : Set α⦄, IsChain (fun x1 x2 ↦ x1 ≤ x2) s → carrier ⊆ s → carrier = s} {carrier_1 : Set α}
  {Chain'_1 : IsChain (fun x1 x2 ↦ x1 ≤ x2) carrier_1}
  {max_chain'_1 : ∀ ⦃s : Set α⦄, IsChain (fun x1 x2 ↦ x1 ≤ x2) s → carrier_1 ⊆ s → carrier_1 = s},
  { carrier := carrier, Chain' := Chain', max_chain' := max_chain' } =
      { carrier := carrier_1, Chain' := Chain'_1, max_chain' := max_chain'_1 } →
    carrier = carrier_1

def Flag.ctorIdx E1 #

{α : Type u_4} → {inst : LE α} → Flag α → ℕ

def IsChain E1 #

{α : Type u_1} → (α → α → Prop) → Set α → Prop

A chain is a set s satisfying x ≺ y ∨ x = y ∨ y ≺ x for all x y ∈ s.

def SuperChain E1 #

{α : Type u_1} → (α → α → Prop) → Set α → Set α → Prop

SuperChain s t means that t is a chain that strictly includes s.

def IsMaxChain E1 #

{α : Type u_1} → (α → α → Prop) → Set α → Prop

A chain s is a maximal chain if there does not exists a chain strictly including s.

theorem IsChain.empty E0 #

∀ {α : Type u_1} {r : α → α → Prop}, IsChain r ∅

theorem IsChain.singleton E0 #

∀ {α : Type u_1} {r : α → α → Prop} {a : α}, IsChain r {a}

theorem Set.Subsingleton.isChain E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, s.Subsingleton → IsChain r s

theorem IsChain.mono E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s t : Set α}, s ⊆ t → IsChain r t → IsChain r s

theorem IsChain.mono_rel E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α} {r' : α → α → Prop},
  IsChain r s → (∀ (x y : α), r x y → r' x y) → IsChain r' s

theorem IsChain.symm E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsChain r s → IsChain (flip r) s

This can be used to turn IsChain (≥) into IsChain (≤) and vice-versa.

theorem isChain_of_trichotomous E1 #

∀ {α : Type u_1} {r : α → α → Prop} [Std.Trichotomous r] (s : Set α), IsChain r s

theorem IsChain.insert E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α} {a : α},
  IsChain r s → (∀ b ∈ s, a ≠ b → r a b ∨ r b a) → IsChain r (insert a s)

theorem IsChain.pair E1 #

∀ {α : Type u_1} {r : α → α → Prop} {a b : α}, r a b → IsChain r {a, b}

theorem isChain_univ_iff E0 #

∀ {α : Type u_1} {r : α → α → Prop}, IsChain r Set.univ ↔ Std.Trichotomous r

theorem IsChain.image_of_map_rel E1 #

∀ {α : Type u_1} {β : Type u_2} (r : α → α → Prop) (s : β → β → Prop) (f : α → β),
  (∀ (x y : α), r x y → s (f x) (f y)) → ∀ {c : Set α}, IsChain r c → IsChain s (f '' c)

theorem IsChain.preimage E1 #

∀ {α : Type u_1} {β : Type u_2} (r : α → α → Prop) (s : β → β → Prop) (f : α → β),
  Function.Injective f → (∀ (x y : α), s (f x) (f y) → r x y) → ∀ {c : Set β}, IsChain s c → IsChain r (f ⁻¹' c)

theorem isChain_union E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s t : Set α},
  IsChain r (s ∪ t) ↔ IsChain r s ∧ IsChain r t ∧ ∀ a ∈ s, ∀ b ∈ t, a ≠ b → r a b ∨ r b a

theorem Monotone.isChain_image E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] {s : Set α} {f : α → β},
  Monotone f → IsChain (fun x1 x2 ↦ x1 ≤ x2) s → IsChain (fun x1 x2 ↦ x1 ≤ x2) (f '' s)

theorem Monotone.isChain_range E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β},
  Monotone f → IsChain (fun x1 x2 ↦ x1 ≤ x2) (Set.range f)

theorem Antitone.isChain_image E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] {s : Set α} {f : α → β},
  Antitone f → IsChain (fun x1 x2 ↦ x1 ≤ x2) s → IsChain (fun x1 x2 ↦ x1 ≤ x2) (f '' s)

theorem Antitone.isChain_range E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β},
  Antitone f → IsChain (fun x1 x2 ↦ x1 ≤ x2) (Set.range f)

theorem IsChain.lt_of_le E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {s : Set α}, IsChain (fun x1 x2 ↦ x1 ≤ x2) s → IsChain (fun x1 x2 ↦ x1 < x2) s

theorem IsChain.diff E0 #

∀ {α : Type u_1} {r : α → α → Prop} {s t : Set α}, IsChain r s → IsChain r (s \ t)

theorem isChain_preimage_subtypeVal E1 #

∀ {α : Type u_1} {r : α → α → Prop} (s t : Set α),
  IsChain (fun x1 x2 ↦ r ↑x1 ↑x2) (Subtype.val ⁻¹' t) ↔ IsChain r (s ∩ t)

theorem isChain_coe_univ_iff E0 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsChain (fun x1 x2 ↦ r ↑x1 ↑x2) Set.univ ↔ IsChain r s

theorem IsChain.image E1 #

∀ {α : Type u_1} {β : Type u_2} {F : Type u_3} {r : α → α → Prop} {r' : β → β → Prop} {s : Set α} [inst : FunLike F α β]
  [RelHomClass F r r'], IsChain r s → ∀ (φ : F), IsChain r' (⇑φ '' s)

theorem IsChain.preimage_relEmbedding E1 #

∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {r' : β → β → Prop} {t : Set β},
  IsChain r' t → ∀ (φ : r ↪r r'), IsChain r (⇑φ ⁻¹' t)

theorem IsChain.preimage_relIso E1 #

∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {r' : β → β → Prop} {t : Set β},
  IsChain r' t → ∀ (φ : r ≃r r'), IsChain r (⇑φ ⁻¹' t)

theorem IsChain.image_relEmbedding_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {r' : β → β → Prop} {s : Set α} {φ : r ↪r r'},
  IsChain r' (⇑φ '' s) ↔ IsChain r s

theorem IsChain.image_relIso_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {r' : β → β → Prop} {s : Set α} {φ : r ≃r r'},
  IsChain r' (⇑φ '' s) ↔ IsChain r s

theorem IsChain.preimage_embedding E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LE α] [inst_1 : LE β] {t : Set β},
  IsChain (fun x1 x2 ↦ x1 ≤ x2) t → ∀ (φ : α ↪o β), IsChain (fun x1 x2 ↦ x1 ≤ x2) (⇑φ ⁻¹' t)

theorem IsChain.image_embedding_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} [inst : LE α] [inst_1 : LE β] {φ : α ↪o β},
  IsChain (fun x1 x2 ↦ x1 ≤ x2) (⇑φ '' s) ↔ IsChain (fun x1 x2 ↦ x1 ≤ x2) s

theorem IsChain.image_iso_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} [inst : LE α] [inst_1 : LE β] {φ : α ≃o β},
  IsChain (fun x1 x2 ↦ x1 ≤ x2) (⇑φ '' s) ↔ IsChain (fun x1 x2 ↦ x1 ≤ x2) s

theorem IsChain.preimage_iso E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LE α] [inst_1 : LE β] {t : Set β},
  IsChain (fun x1 x2 ↦ x1 ≤ x2) t → ∀ (φ : α ≃o β), IsChain (fun x1 x2 ↦ x1 ≤ x2) (⇑φ ⁻¹' t)

theorem IsChain.preimage_iso_iff E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : LE α] [inst_1 : LE β] {t : Set β} {φ : α ≃o β},
  IsChain (fun x1 x2 ↦ x1 ≤ x2) (⇑φ ⁻¹' t) ↔ IsChain (fun x1 x2 ↦ x1 ≤ x2) t

theorem IsChain.total E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α} {x y : α} [Std.Refl r], IsChain r s → x ∈ s → y ∈ s → r x y ∨ r y x

theorem IsChain.directedOn E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α} [Std.Refl r], IsChain r s → DirectedOn r s

theorem IsChain.directed E1 #

∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [Std.Refl r] {f : β → α} {c : Set β},
  IsChain (f ⁻¹'o r) c → Directed r fun x ↦ f ↑x

theorem IsChain.exists3 E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α} [Std.Refl r],
  IsChain r s → ∀ [IsTrans α r] {a b c : α}, a ∈ s → b ∈ s → c ∈ s → ∃ z, ∃ (_ : z ∈ s), r a z ∧ r b z ∧ r c z

def IsChain.linearOrder E1 #

{α : Type u_1} → [inst : Preorder α] → [DecidableLE α] → {s : Set α} → IsChain (fun x1 x2 ↦ x1 < x2) s → LinearOrder ↑s

A chain in a preorder is a linear order.

theorem IsChain.le_of_not_gt E1 #

∀ {α : Type u_1} {s : Set α} [inst : Preorder α],
  IsChain (fun x1 x2 ↦ x1 ≤ x2) s → ∀ {x y : α}, x ∈ s → y ∈ s → ¬x < y → y ≤ x

theorem IsChain.not_lt E1 #

∀ {α : Type u_1} {s : Set α} [inst : Preorder α],
  IsChain (fun x1 x2 ↦ x1 ≤ x2) s → ∀ {x y : α}, x ∈ s → y ∈ s → (¬x < y ↔ y ≤ x)

theorem IsChain.lt_of_not_ge E1 #

∀ {α : Type u_1} {s : Set α} [inst : Preorder α],
  IsChain (fun x1 x2 ↦ x1 ≤ x2) s → ∀ {x y : α}, x ∈ s → y ∈ s → ¬x ≤ y → y < x

theorem IsChain.not_le E1 #

∀ {α : Type u_1} {s : Set α} [inst : Preorder α],
  IsChain (fun x1 x2 ↦ x1 ≤ x2) s → ∀ {x y : α}, x ∈ s → y ∈ s → (¬x ≤ y ↔ y < x)

theorem IsMaxChain.isChain E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsMaxChain r s → IsChain r s

theorem IsMaxChain.not_superChain E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s t : Set α}, IsMaxChain r s → ¬SuperChain r s t

theorem maximal_isChain_iff E0 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, Maximal (IsChain r) s ↔ IsMaxChain r s

theorem IsMaxChain.maximal_isChain E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsMaxChain r s → Maximal (IsChain r) s

Alias of the reverse direction of maximal_isChain_iff.

theorem IsMaxChain.bot_mem E1 #

∀ {α : Type u_1} {s : Set α} [inst : LE α] [inst_1 : OrderBot α], IsMaxChain (fun x1 x2 ↦ x1 ≤ x2) s → ⊥ ∈ s

theorem IsMaxChain.top_mem E1 #

∀ {α : Type u_1} {s : Set α} [inst : LE α] [inst_1 : OrderTop α], IsMaxChain (fun x1 x2 ↦ x1 ≤ x2) s → ⊤ ∈ s

theorem IsMaxChain.image E1 #

∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {s : β → β → Prop} (e : r ≃r s) {c : Set α},
  IsMaxChain r c → IsMaxChain s (⇑e '' c)

theorem IsMaxChain.isEmpty_iff E0 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsMaxChain r s → (IsEmpty α ↔ s = ∅)

theorem IsMaxChain.nonempty_iff E0 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsMaxChain r s → (Nonempty α ↔ s.Nonempty)

theorem IsMaxChain.symm E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsMaxChain r s → IsMaxChain (flip r) s

def SuccChain E1 #

{α : Type u_1} → (α → α → Prop) → Set α → Set α

Given a set s, if there exists a chain t strictly including s, then SuccChain s is one of these chains. Otherwise it is s.

theorem succChain_spec E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, (∃ t, IsChain r s ∧ SuperChain r s t) → SuperChain r s (SuccChain r s)

theorem IsChain.succ E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsChain r s → IsChain r (SuccChain r s)

theorem IsChain.superChain_succChain E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, IsChain r s → ¬IsMaxChain r s → SuperChain r s (SuccChain r s)

theorem subset_succChain E1 #

∀ {α : Type u_1} {r : α → α → Prop} {s : Set α}, s ⊆ SuccChain r s

theorem List.IsChain.isChain_setOfPred_mem E1 #

∀ {α : Type u_1} {r : α → α → Prop} [IsTrans α r] {l : List α}, List.IsChain r l → IsChain r {a | a ∈ l}

structure Flag E3 #

(α : Type u_4) → [LE α] → Type u_4

The type of flags, aka maximal chains, of an order.

ctor Flag.mk E0 #

{α : Type u_4} →
  [inst : LE α] →
    (carrier : Set α) →
      IsChain (fun x1 x2 ↦ x1 ≤ x2) carrier →
        (∀ ⦃s : Set α⦄, IsChain (fun x1 x2 ↦ x1 ≤ x2) s → carrier ⊆ s → carrier = s) → Flag α

abbrev Flag.carrier E1 #

{α : Type u_4} → [inst : LE α] → Flag α → Set α

The carrier of a flag is the underlying set.

theorem Flag.Chain' E1 #

∀ {α : Type u_4} [inst : LE α] (self : Flag α), IsChain (fun x1 x2 ↦ x1 ≤ x2) self.carrier

By definition, a flag is a chain

theorem Flag.max_chain' E1 #

∀ {α : Type u_4} [inst : LE α] (self : Flag α) ⦃s : Set α⦄,
  IsChain (fun x1 x2 ↦ x1 ≤ x2) s → self.carrier ⊆ s → self.carrier = s

By definition, a flag is a maximal chain

instance Flag.instSetLike E0 #

{α : Type u_1} → [inst : LE α] → SetLike (Flag α) α

instance Flag.instPartialOrder E0 #

{α : Type u_1} → [inst : LE α] → PartialOrder (Flag α)

theorem Flag.ext_iff E0 #

∀ {α : Type u_1} [inst : LE α] {s t : Flag α}, s = t ↔ ↑s = ↑t

theorem Flag.ext E1 #

∀ {α : Type u_1} [inst : LE α] {s t : Flag α}, ↑s = ↑t → s = t

theorem Flag.mem_coe_iff E0 #

∀ {α : Type u_1} [inst : LE α] {s : Flag α} {a : α}, a ∈ ↑s ↔ a ∈ s

theorem Flag.coe_mk E0 #

∀ {α : Type u_1} [inst : LE α] (s : Set α) (h₁ : IsChain (fun x1 x2 ↦ x1 ≤ x2) s)
  (h₂ : ∀ ⦃s_1 : Set α⦄, IsChain (fun x1 x2 ↦ x1 ≤ x2) s_1 → s ⊆ s_1 → s = s_1),
  ↑{ carrier := s, Chain' := h₁, max_chain' := h₂ } = s

theorem Flag.mk_coe E0 #

∀ {α : Type u_1} [inst : LE α] (s : Flag α), { carrier := ↑s, Chain' := ⋯, max_chain' := ⋯ } = s

theorem Flag.chain_le E1 #

∀ {α : Type u_1} [inst : LE α] (s : Flag α), IsChain (fun x1 x2 ↦ x1 ≤ x2) ↑s

theorem Flag.maxChain E1 #

∀ {α : Type u_1} [inst : LE α] (s : Flag α), IsMaxChain (fun x1 x2 ↦ x1 ≤ x2) ↑s

theorem Flag.top_mem E1 #

∀ {α : Type u_1} [inst : LE α] [inst_1 : OrderTop α] (s : Flag α), ⊤ ∈ s

theorem Flag.bot_mem E1 #

∀ {α : Type u_1} [inst : LE α] [inst_1 : OrderBot α] (s : Flag α), ⊥ ∈ s

def Flag.ofIsMaxChain E1 #

{α : Type u_1} → [inst : LE α] → (c : Set α) → IsMaxChain (fun x1 x2 ↦ x1 ≤ x2) c → Flag α

Reinterpret a maximal chain as a flag.

theorem Flag.coe_ofIsMaxChain E0 #

∀ {α : Type u_1} [inst : LE α] (c : Set α) (hc : IsMaxChain (fun x1 x2 ↦ x1 ≤ x2) c), ↑(Flag.ofIsMaxChain c hc) = c

theorem Flag.le_or_le E1 #

∀ {α : Type u_1} [inst : Preorder α] {a b : α} (s : Flag α), a ∈ s → b ∈ s → a ≤ b ∨ b ≤ a

instance Flag.instOrderTopSubtypeMem E0 #

{α : Type u_1} → [inst : Preorder α] → [OrderTop α] → (s : Flag α) → OrderTop ↥s

instance Flag.instOrderBotSubtypeMem E0 #

{α : Type u_1} → [inst : Preorder α] → [OrderBot α] → (s : Flag α) → OrderBot ↥s

instance Flag.instBoundedOrderSubtypeMem E0 #

{α : Type u_1} → [inst : Preorder α] → [BoundedOrder α] → (s : Flag α) → BoundedOrder ↥s

theorem Flag.mem_iff_forall_le_or_ge E0 #

∀ {α : Type u_1} [inst : Preorder α] {a : α} {s : Flag α}, a ∈ s ↔ ∀ ⦃b : α⦄, b ∈ s → a ≤ b ∨ b ≤ a

def Flag.map E1 #

{α : Type u_1} → {β : Type u_2} → [inst : Preorder α] → [inst_1 : Preorder β] → α ≃o β → Flag α ≃ Flag β

Flags are preserved under order isomorphisms.

theorem Flag.coe_map E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ≃o β) (s : Flag α),
  ↑((Flag.map e) s) = ⇑e '' ↑s

theorem Flag.symm_map E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ≃o β),
  (Flag.map e).symm = Flag.map e.symm

theorem Flag.chain_lt E1 #

∀ {α : Type u_1} [inst : PartialOrder α] (s : Flag α), IsChain (fun x1 x2 ↦ x1 < x2) ↑s

instance Flag.instLinearOrderSubtypeMemOfDecidableLEOfDecidableLTOfDecidableEq E0 #

{α : Type u_1} →
  [inst : PartialOrder α] → [DecidableLE α] → [DecidableLT α] → [DecidableEq α] → (s : Flag α) → LinearOrder ↥s

instance Flag.instUnique E0 #

{α : Type u_1} → [inst : LinearOrder α] → Unique (Flag α)