File: Mathlib/Order/Chain.lean

full_name: «_aux_Mathlib_Order_Chain___macroRules_term_≺__1»
code: /-- In this file, we use `≺` as a local notation for any relation `r`. -/
local infixl:50 " ≺ " => r
goal: Lean.Macro

full_name: IsChain
code: /-- A chain is a set `s` satisfying `x ≺ y ∨ x = y ∨ y ≺ x` for all `x y ∈ s`. -/
def IsChain (s : Set α) : Prop 
goal: Prop

full_name: SuperChain
code: /-- `SuperChain s t` means that `t` is a chain that strictly includes `s`. -/
def SuperChain (s t : Set α) : Prop 
goal: Prop

full_name: IsMaxChain
code: /-- A chain `s` is a maximal chain if there does not exists a chain strictly including `s`. -/
def IsMaxChain (s : Set α) : Prop 
goal: Prop

full_name: isChain_empty
code: theorem isChain_empty : IsChain r ∅ 
goal: IsChain r ∅

full_name: Set.Subsingleton.isChain
code: theorem Set.Subsingleton.isChain (hs : s.Subsingleton) : IsChain r s 
goal: IsChain r s

full_name: IsChain.mono
code: theorem IsChain.mono : s ⊆ t → IsChain r t → IsChain r s 
goal: s ⊆ t → IsChain r t → IsChain r s

full_name: IsChain.mono_rel
code: theorem IsChain.mono_rel {r' : α → α → Prop} (h : IsChain r s) (h_imp : ∀ x y, r x y → r' x y) :
    IsChain r' s 
goal: IsChain r' s

full_name: IsChain.symm
code: /-- This can be used to turn `IsChain (≥)` into `IsChain (≤)` and vice-versa. -/
theorem IsChain.symm (h : IsChain r s) : IsChain (flip r) s 
goal: IsChain (flip r) s

full_name: isChain_of_trichotomous
code: theorem isChain_of_trichotomous [IsTrichotomous α r] (s : Set α) : IsChain r s 
goal: IsChain r s

full_name: IsChain.insert
code: protected theorem IsChain.insert (hs : IsChain r s) (ha : ∀ b ∈ s, a ≠ b → a ≺ b ∨ b ≺ a) :
    IsChain r (insert a s) 
goal: IsChain r (insert a s)

full_name: isChain_univ_iff
code: theorem isChain_univ_iff : IsChain r (univ : Set α) ↔ IsTrichotomous α r 
goal: IsChain r Set.univ ↔ IsTrichotomous α r

full_name: IsChain.image
code: theorem IsChain.image (r : α → α → Prop) (s : β → β → Prop) (f : α → β)
    (h : ∀ x y, r x y → s (f x) (f y)) {c : Set α} (hrc : IsChain r c) : IsChain s (f '' c) 
goal: IsChain s (f '' c)

full_name: Monotone.isChain_range
code: theorem Monotone.isChain_range [LinearOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    IsChain (· ≤ ·) (range f) 
goal: IsChain (fun x x_1 => x ≤ x_1) (Set.range f)

full_name: IsChain.lt_of_le
code: theorem IsChain.lt_of_le [PartialOrder α] {s : Set α} (h : IsChain (· ≤ ·) s) :
    IsChain (· < ·) s 
goal: IsChain (fun x x_1 => x < x_1) s

full_name: IsChain.total
code: theorem IsChain.total (h : IsChain r s) (hx : x ∈ s) (hy : y ∈ s) : x ≺ y ∨ y ≺ x 
goal: r x y ∨ r y x

full_name: IsChain.directedOn
code: theorem IsChain.directedOn (H : IsChain r s) : DirectedOn r s 
goal: DirectedOn r s

full_name: IsChain.directed
code: protected theorem IsChain.directed {f : β → α} {c : Set β} (h : IsChain (f ⁻¹'o r) c) :
    Directed r fun x : { a : β // a ∈ c } => f x 
goal: Directed r fun x => f ↑x

full_name: IsChain.exists3
code: theorem IsChain.exists3 (hchain : IsChain r s) [IsTrans α r] {a b c} (mem1 : a ∈ s) (mem2 : b ∈ s)
    (mem3 : c ∈ s) : ∃ (z : _) (_ : z ∈ s), r a z ∧ r b z ∧ r c z 
goal: ∃ z, ∃ (_ : z ∈ s), r a z ∧ r b z ∧ r c z

full_name: IsMaxChain.isChain
code: theorem IsMaxChain.isChain (h : IsMaxChain r s) : IsChain r s 
goal: IsChain r s

full_name: IsMaxChain.not_superChain
code: theorem IsMaxChain.not_superChain (h : IsMaxChain r s) : ¬SuperChain r s t 
goal: ¬SuperChain r s t

full_name: IsMaxChain.bot_mem
code: theorem IsMaxChain.bot_mem [LE α] [OrderBot α] (h : IsMaxChain (· ≤ ·) s) : ⊥ ∈ s 
goal: ⊥ ∈ s

full_name: IsMaxChain.top_mem
code: theorem IsMaxChain.top_mem [LE α] [OrderTop α] (h : IsMaxChain (· ≤ ·) s) : ⊤ ∈ s 
goal: ⊤ ∈ s

full_name: SuccChain
code: /-- 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`. -/
def SuccChain (r : α → α → Prop) (s : Set α) : Set α 
goal: Set α

full_name: succChain_spec
code: theorem succChain_spec (h : ∃ t, IsChain r s ∧ SuperChain r s t) :
    SuperChain r s (SuccChain r s) 
goal: SuperChain r s (SuccChain r s)

full_name: IsChain.succ
code: theorem IsChain.succ (hs : IsChain r s) : IsChain r (SuccChain r s) 
goal: IsChain r (SuccChain r s)

full_name: IsChain.superChain_succChain
code: theorem IsChain.superChain_succChain (hs₁ : IsChain r s) (hs₂ : ¬IsMaxChain r s) :
    SuperChain r s (SuccChain r s) 
goal: SuperChain r s (SuccChain r s)

full_name: subset_succChain
code: theorem subset_succChain : s ⊆ SuccChain r s 
goal: s ⊆ SuccChain r s

full_name: ChainClosure.succ
code: /-- Predicate for whether a set is reachable from `∅` using `SuccChain` and `⋃₀`. -/
inductive ChainClosure (r : α → α → Prop) : Set α → Prop
  | succ : ∀ {s}, ChainClosure r s → ChainClosure r (SuccChain r s)
  | union : ∀ {s}, (∀ a ∈ s, ChainClosure r a) → ChainClosure r (⋃₀s)
goal: ChainClosure r s → ChainClosure r (SuccChain r s)

full_name: ChainClosure.union
code: /-- Predicate for whether a set is reachable from `∅` using `SuccChain` and `⋃₀`. -/
inductive ChainClosure (r : α → α → Prop) : Set α → Prop
  | succ : ∀ {s}, ChainClosure r s → ChainClosure r (SuccChain r s)
  | union : ∀ {s}, (∀ a ∈ s, ChainClosure r a) → ChainClosure r (⋃₀s)
goal: (∀ a ∈ s, ChainClosure r a) → ChainClosure r (⋃₀ s)

full_name: ChainClosure
code: /-- Predicate for whether a set is reachable from `∅` using `SuccChain` and `⋃₀`. -/
inductive ChainClosure (r : α → α → Prop) : Set α → Prop
  | succ : ∀ {s}, ChainClosure r s → ChainClosure r (SuccChain r s)
  | union : ∀ {s}, (∀ a ∈ s, ChainClosure r a) → ChainClosure r (⋃₀s)
goal: Set α → Prop

full_name: maxChain
code: /-- An explicit maximal chain. `maxChain` is taken to be the union of all sets in `ChainClosure`.
-/
def maxChain (r : α → α → Prop) : Set α 
goal: Set α

full_name: chainClosure_empty
code: theorem chainClosure_empty : ChainClosure r ∅ 
goal: ChainClosure r ∅

full_name: chainClosure_maxChain
code: theorem chainClosure_maxChain : ChainClosure r (maxChain r) 
goal: ChainClosure r (maxChain r)

full_name: _private.Mathlib.Order.Chain.0.chainClosure_succ_total_aux
code: private theorem chainClosure_succ_total_aux (hc₁ : ChainClosure r c₁)
    (h : ∀ ⦃c₃⦄, ChainClosure r c₃ → c₃ ⊆ c₂ → c₂ = c₃ ∨ SuccChain r c₃ ⊆ c₂) :
    SuccChain r c₂ ⊆ c₁ ∨ c₁ ⊆ c₂ 
goal: SuccChain r c₂ ⊆ c₁ ∨ c₁ ⊆ c₂

full_name: _private.Mathlib.Order.Chain.0.chainClosure_succ_total
code: private theorem chainClosure_succ_total (hc₁ : ChainClosure r c₁) (hc₂ : ChainClosure r c₂)
    (h : c₁ ⊆ c₂) : c₂ = c₁ ∨ SuccChain r c₁ ⊆ c₂ 
goal: c₂ = c₁ ∨ SuccChain r c₁ ⊆ c₂

full_name: ChainClosure.total
code: theorem ChainClosure.total (hc₁ : ChainClosure r c₁) (hc₂ : ChainClosure r c₂) :
    c₁ ⊆ c₂ ∨ c₂ ⊆ c₁ 
goal: c₁ ⊆ c₂ ∨ c₂ ⊆ c₁

full_name: ChainClosure.succ_fixpoint
code: theorem ChainClosure.succ_fixpoint (hc₁ : ChainClosure r c₁) (hc₂ : ChainClosure r c₂)
    (hc : SuccChain r c₂ = c₂) : c₁ ⊆ c₂ 
goal: c₁ ⊆ c₂

full_name: ChainClosure.succ_fixpoint_iff
code: theorem ChainClosure.succ_fixpoint_iff (hc : ChainClosure r c) :
    SuccChain r c = c ↔ c = maxChain r 
goal: SuccChain r c = c ↔ c = maxChain r

full_name: ChainClosure.isChain
code: theorem ChainClosure.isChain (hc : ChainClosure r c) : IsChain r c 
goal: IsChain r c

full_name: maxChain_spec
code: /-- **Hausdorff's maximality principle**

There exists a maximal totally ordered set of `α`.
Note that we do not require `α` to be partially ordered by `r`. -/
theorem maxChain_spec : IsMaxChain r (maxChain r) 
goal: IsMaxChain r (maxChain r)

full_name: Flag
code: /-- The type of flags, aka maximal chains, of an order. -/
structure Flag (α : Type*) [LE α] where
  /-- The `carrier` of a flag is the underlying set. -/
  carrier : Set α
  /-- By definition, a flag is a chain -/
  Chain' : IsChain (· ≤ ·) carrier
  /-- By definition, a flag is a maximal chain -/
  max_chain' : ∀ ⦃s⦄, IsChain (· ≤ ·) s → carrier ⊆ s → carrier = s
goal: Type u_3

full_name: Flag.Chain'
code: /-- The type of flags, aka maximal chains, of an order. -/
structure Flag (α : Type*) [LE α] where
  /-- The `carrier` of a flag is the underlying set. -/
  carrier : Set α
  /-- By definition, a flag is a chain -/
  Chain' : IsChain (· ≤ ·) carrier
  /-- By definition, a flag is a maximal chain -/
  max_chain' : ∀ ⦃s⦄, IsChain (· ≤ ·) s → carrier ⊆ s → carrier = s
goal: IsChain (fun x x_1 => x ≤ x_1) self.carrier

full_name: Flag.max_chain'
code: /-- The type of flags, aka maximal chains, of an order. -/
structure Flag (α : Type*) [LE α] where
  /-- The `carrier` of a flag is the underlying set. -/
  carrier : Set α
  /-- By definition, a flag is a chain -/
  Chain' : IsChain (· ≤ ·) carrier
  /-- By definition, a flag is a maximal chain -/
  max_chain' : ∀ ⦃s⦄, IsChain (· ≤ ·) s → carrier ⊆ s → carrier = s
goal: IsChain (fun x x_1 => x ≤ x_1) s → self.carrier ⊆ s → self.carrier = s

full_name: Flag.carrier
code: /-- The type of flags, aka maximal chains, of an order. -/
structure Flag (α : Type*) [LE α] where
  /-- The `carrier` of a flag is the underlying set. -/
  carrier : Set α
  /-- By definition, a flag is a chain -/
  Chain' : IsChain (· ≤ ·) carrier
  /-- By definition, a flag is a maximal chain -/
  max_chain' : ∀ ⦃s⦄, IsChain (· ≤ ·) s → carrier ⊆ s → carrier = s
goal: Set α

full_name: Flag.instSetLike
code: instance : SetLike (Flag α) α 
goal: SetLike (Flag α) α

full_name: Flag.ext
code: @[ext]
theorem ext : (s : Set α) = t → s = t 
goal: ↑s = ↑t → s = t

full_name: Flag.mem_coe_iff
code: theorem mem_coe_iff : a ∈ (s : Set α) ↔ a ∈ s 
goal: a ∈ ↑s ↔ a ∈ s

full_name: Flag.coe_mk
code: @[simp]
theorem coe_mk (s : Set α) (h₁ h₂) : (mk s h₁ h₂ : Set α) = s 
goal: ↑{ carrier := s, Chain' := h₁, max_chain' := h₂ } = s

full_name: Flag.mk_coe
code: @[simp]
theorem mk_coe (s : Flag α) : mk (s : Set α) s.Chain' s.max_chain' = s 
goal: { carrier := ↑s, Chain' := ⋯, max_chain' := ⋯ } = s

full_name: Flag.chain_le
code: theorem chain_le (s : Flag α) : IsChain (· ≤ ·) (s : Set α) 
goal: IsChain (fun x x_1 => x ≤ x_1) ↑s

full_name: Flag.maxChain
code: protected theorem maxChain (s : Flag α) : IsMaxChain (· ≤ ·) (s : Set α) 
goal: IsMaxChain (fun x x_1 => x ≤ x_1) ↑s

full_name: Flag.top_mem
code: theorem top_mem [OrderTop α] (s : Flag α) : (⊤ : α) ∈ s 
goal: ⊤ ∈ s

full_name: Flag.bot_mem
code: theorem bot_mem [OrderBot α] (s : Flag α) : (⊥ : α) ∈ s 
goal: ⊥ ∈ s

full_name: Flag.le_or_le
code: protected theorem le_or_le (s : Flag α) (ha : a ∈ s) (hb : b ∈ s) : a ≤ b ∨ b ≤ a 
goal: a ≤ b ∨ b ≤ a

full_name: Flag.instOrderTopSubtypeMem
code: instance [OrderTop α] (s : Flag α) : OrderTop s 
goal: OrderTop ↥s

full_name: Flag.instOrderBotSubtypeMem
code: instance [OrderBot α] (s : Flag α) : OrderBot s 
goal: OrderBot ↥s

full_name: Flag.instBoundedOrderSubtypeMem
code: instance [BoundedOrder α] (s : Flag α) : BoundedOrder s 
goal: BoundedOrder ↥s

full_name: Flag.chain_lt
code: theorem chain_lt (s : Flag α) : IsChain (· < ·) (s : Set α) 
goal: IsChain (fun x x_1 => x < x_1) ↑s

full_name: Flag.instLinearOrderSubtypeMemOfLeOfDecidableRelLt
code: instance [@DecidableRel α (· ≤ ·)] [@DecidableRel α (· < ·)] (s : Flag α) :
    LinearOrder s 
goal: LinearOrder ↥s

full_name: Flag.instUnique
code: instance [LinearOrder α] : Unique (Flag α) 
goal: Unique (Flag α)