File: Mathlib/Order/Circular.lean

full_name: Btw
code: /-- Syntax typeclass for a betweenness relation. -/
class Btw (α : Type*) where
  /-- Betweenness for circular orders. `btw a b c` states that `b` is between `a` and `c` (in that
  order). -/
  btw : α → α → α → Prop
goal: Type u_1

full_name: Btw.btw
code: /-- Syntax typeclass for a betweenness relation. -/
class Btw (α : Type*) where
  /-- Betweenness for circular orders. `btw a b c` states that `b` is between `a` and `c` (in that
  order). -/
  btw : α → α → α → Prop
goal: α → α → α → Prop

full_name: SBtw.sbtw
code: /-- Syntax typeclass for a strict betweenness relation. -/
class SBtw (α : Type*) where
  /-- Strict betweenness for circular orders. `sbtw a b c` states that `b` is strictly between `a`
  and `c` (in that order). -/
  sbtw : α → α → α → Prop
goal: α → α → α → Prop

full_name: SBtw
code: /-- Syntax typeclass for a strict betweenness relation. -/
class SBtw (α : Type*) where
  /-- Strict betweenness for circular orders. `sbtw a b c` states that `b` is strictly between `a`
  and `c` (in that order). -/
  sbtw : α → α → α → Prop
goal: Type u_1

full_name: CircularPreorder
code: /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
-/
class CircularPreorder (α : Type*) extends Btw α, SBtw α where
  /-- `a` is between `a` and `a`. -/
  btw_refl (a : α) : btw a a a
  /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
  This is motivated by imagining three points on a circle. -/
  btw_cyclic_left {a b c : α} : btw a b c → btw b c a
  sbtw := fun a b c => btw a b c ∧ ¬btw c b a
  /-- Strict betweenness is given by betweenness in one direction and non-betweenness in the other.

  I.e., if `b` is between `a` and `c` but not between `c` and `a`, then we say `b` is strictly
  between `a` and `c`. -/
  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by intros; rfl
  /-- For any fixed `c`, `fun a b ↦ sbtw a b c` is a transitive relation.

  I.e., given `a` `b` `d` `c` in that "order", if we have `b` strictly between `a` and `c`, and `d`
  strictly between `b` and `c`, then `d` is strictly between `a` and `c`. -/
  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c
goal: Type u_1

full_name: CircularPreorder.btw_cyclic_left
code: /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
-/
class CircularPreorder (α : Type*) extends Btw α, SBtw α where
  /-- `a` is between `a` and `a`. -/
  btw_refl (a : α) : btw a a a
  /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
  This is motivated by imagining three points on a circle. -/
  btw_cyclic_left {a b c : α} : btw a b c → btw b c a
  sbtw := fun a b c => btw a b c ∧ ¬btw c b a
  /-- Strict betweenness is given by betweenness in one direction and non-betweenness in the other.

  I.e., if `b` is between `a` and `c` but not between `c` and `a`, then we say `b` is strictly
  between `a` and `c`. -/
  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by intros; rfl
  /-- For any fixed `c`, `fun a b ↦ sbtw a b c` is a transitive relation.

  I.e., given `a` `b` `d` `c` in that "order", if we have `b` strictly between `a` and `c`, and `d`
  strictly between `b` and `c`, then `d` is strictly between `a` and `c`. -/
  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c
goal: btw a b c → btw b c a

full_name: CircularPreorder.sbtw_iff_btw_not_btw
code: /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
-/
class CircularPreorder (α : Type*) extends Btw α, SBtw α where
  /-- `a` is between `a` and `a`. -/
  btw_refl (a : α) : btw a a a
  /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
  This is motivated by imagining three points on a circle. -/
  btw_cyclic_left {a b c : α} : btw a b c → btw b c a
  sbtw := fun a b c => btw a b c ∧ ¬btw c b a
  /-- Strict betweenness is given by betweenness in one direction and non-betweenness in the other.

  I.e., if `b` is between `a` and `c` but not between `c` and `a`, then we say `b` is strictly
  between `a` and `c`. -/
  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by intros; rfl
  /-- For any fixed `c`, `fun a b ↦ sbtw a b c` is a transitive relation.

  I.e., given `a` `b` `d` `c` in that "order", if we have `b` strictly between `a` and `c`, and `d`
  strictly between `b` and `c`, then `d` is strictly between `a` and `c`. -/
  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c
goal: sbtw a b c ↔ btw a b c ∧ ¬btw c b a

full_name: CircularPreorder.btw_refl
code: /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
-/
class CircularPreorder (α : Type*) extends Btw α, SBtw α where
  /-- `a` is between `a` and `a`. -/
  btw_refl (a : α) : btw a a a
  /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
  This is motivated by imagining three points on a circle. -/
  btw_cyclic_left {a b c : α} : btw a b c → btw b c a
  sbtw := fun a b c => btw a b c ∧ ¬btw c b a
  /-- Strict betweenness is given by betweenness in one direction and non-betweenness in the other.

  I.e., if `b` is between `a` and `c` but not between `c` and `a`, then we say `b` is strictly
  between `a` and `c`. -/
  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by intros; rfl
  /-- For any fixed `c`, `fun a b ↦ sbtw a b c` is a transitive relation.

  I.e., given `a` `b` `d` `c` in that "order", if we have `b` strictly between `a` and `c`, and `d`
  strictly between `b` and `c`, then `d` is strictly between `a` and `c`. -/
  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c
goal: btw a a a

full_name: CircularPreorder.sbtw_trans_left
code: /-- A circular preorder is the analogue of a preorder where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive and cyclic. `sbtw` is transitive.
-/
class CircularPreorder (α : Type*) extends Btw α, SBtw α where
  /-- `a` is between `a` and `a`. -/
  btw_refl (a : α) : btw a a a
  /-- If `b` is between `a` and `c`, then `c` is between `b` and `a`.
  This is motivated by imagining three points on a circle. -/
  btw_cyclic_left {a b c : α} : btw a b c → btw b c a
  sbtw := fun a b c => btw a b c ∧ ¬btw c b a
  /-- Strict betweenness is given by betweenness in one direction and non-betweenness in the other.

  I.e., if `b` is between `a` and `c` but not between `c` and `a`, then we say `b` is strictly
  between `a` and `c`. -/
  sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a := by intros; rfl
  /-- For any fixed `c`, `fun a b ↦ sbtw a b c` is a transitive relation.

  I.e., given `a` `b` `d` `c` in that "order", if we have `b` strictly between `a` and `c`, and `d`
  strictly between `b` and `c`, then `d` is strictly between `a` and `c`. -/
  sbtw_trans_left {a b c d : α} : sbtw a b c → sbtw b d c → sbtw a d c
goal: sbtw a b c → sbtw b d c → sbtw a d c

full_name: CircularPartialOrder
code: /-- A circular partial order is the analogue of a partial order where you can loop around. `≤` and
`<` are replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic and
antisymmetric. `sbtw` is transitive. -/
class CircularPartialOrder (α : Type*) extends CircularPreorder α where
  /-- If `b` is between `a` and `c` and also between `c` and `a`, then at least one pair of points
  among `a`, `b`, `c` are identical. -/
  btw_antisymm {a b c : α} : btw a b c → btw c b a → a = b ∨ b = c ∨ c = a
goal: Type u_1

full_name: CircularPartialOrder.btw_antisymm
code: /-- A circular partial order is the analogue of a partial order where you can loop around. `≤` and
`<` are replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic and
antisymmetric. `sbtw` is transitive. -/
class CircularPartialOrder (α : Type*) extends CircularPreorder α where
  /-- If `b` is between `a` and `c` and also between `c` and `a`, then at least one pair of points
  among `a`, `b`, `c` are identical. -/
  btw_antisymm {a b c : α} : btw a b c → btw c b a → a = b ∨ b = c ∨ c = a
goal: btw a b c → btw c b a → a = b ∨ b = c ∨ c = a

full_name: CircularOrder
code: /-- A circular order is the analogue of a linear order where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic, antisymmetric and total.
`sbtw` is transitive. -/
class CircularOrder (α : Type*) extends CircularPartialOrder α where
  /-- For any triple of points, the second is between the other two one way or another. -/
  btw_total : ∀ a b c : α, btw a b c ∨ btw c b a
goal: Type u_1

full_name: CircularOrder.btw_total
code: /-- A circular order is the analogue of a linear order where you can loop around. `≤` and `<` are
replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic, antisymmetric and total.
`sbtw` is transitive. -/
class CircularOrder (α : Type*) extends CircularPartialOrder α where
  /-- For any triple of points, the second is between the other two one way or another. -/
  btw_total : ∀ a b c : α, btw a b c ∨ btw c b a
goal: btw a b c ∨ btw c b a

full_name: btw_rfl
code: theorem btw_rfl {a : α} : btw a a a 
goal: btw a a a

full_name: Btw.btw.cyclic_left
code: theorem Btw.btw.cyclic_left {a b c : α} (h : btw a b c) : btw b c a 
goal: btw b c a

full_name: btw_cyclic_right
code: theorem btw_cyclic_right {a b c : α} (h : btw a b c) : btw c a b 
goal: btw c a b

full_name: btw_cyclic
code: /-- The order of the `↔` has been chosen so that `rw [btw_cyclic]` cycles to the right while
`rw [← btw_cyclic]` cycles to the left (thus following the prepended arrow). -/
theorem btw_cyclic {a b c : α} : btw a b c ↔ btw c a b 
goal: btw a b c ↔ btw c a b

full_name: sbtw_iff_btw_not_btw
code: theorem sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a 
goal: sbtw a b c ↔ btw a b c ∧ ¬btw c b a

full_name: btw_of_sbtw
code: theorem btw_of_sbtw {a b c : α} (h : sbtw a b c) : btw a b c 
goal: btw a b c

full_name: not_btw_of_sbtw
code: theorem not_btw_of_sbtw {a b c : α} (h : sbtw a b c) : ¬btw c b a 
goal: ¬btw c b a

full_name: not_sbtw_of_btw
code: theorem not_sbtw_of_btw {a b c : α} (h : btw a b c) : ¬sbtw c b a 
goal: ¬sbtw c b a

full_name: sbtw_of_btw_not_btw
code: theorem sbtw_of_btw_not_btw {a b c : α} (habc : btw a b c) (hcba : ¬btw c b a) : sbtw a b c 
goal: sbtw a b c

full_name: sbtw_cyclic_left
code: theorem sbtw_cyclic_left {a b c : α} (h : sbtw a b c) : sbtw b c a 
goal: sbtw b c a

full_name: sbtw_cyclic_right
code: theorem sbtw_cyclic_right {a b c : α} (h : sbtw a b c) : sbtw c a b 
goal: sbtw c a b

full_name: sbtw_cyclic
code: /-- The order of the `↔` has been chosen so that `rw [sbtw_cyclic]` cycles to the right while
`rw [← sbtw_cyclic]` cycles to the left (thus following the prepended arrow). -/
theorem sbtw_cyclic {a b c : α} : sbtw a b c ↔ sbtw c a b 
goal: sbtw a b c ↔ sbtw c a b

full_name: SBtw.sbtw.trans_left
code: theorem SBtw.sbtw.trans_left {a b c d : α} (h : sbtw a b c) : sbtw b d c → sbtw a d c 
goal: sbtw b d c → sbtw a d c

full_name: sbtw_trans_right
code: theorem sbtw_trans_right {a b c d : α} (hbc : sbtw a b c) (hcd : sbtw a c d) : sbtw a b d 
goal: sbtw a b d

full_name: sbtw_asymm
code: theorem sbtw_asymm {a b c : α} (h : sbtw a b c) : ¬sbtw c b a 
goal: ¬sbtw c b a

full_name: sbtw_irrefl_left_right
code: theorem sbtw_irrefl_left_right {a b : α} : ¬sbtw a b a 
goal: ¬sbtw a b a

full_name: sbtw_irrefl_left
code: theorem sbtw_irrefl_left {a b : α} : ¬sbtw a a b 
goal: ¬sbtw a a b

full_name: sbtw_irrefl_right
code: theorem sbtw_irrefl_right {a b : α} : ¬sbtw a b b 
goal: ¬sbtw a b b

full_name: sbtw_irrefl
code: theorem sbtw_irrefl (a : α) : ¬sbtw a a a 
goal: ¬sbtw a a a

full_name: Btw.btw.antisymm
code: theorem Btw.btw.antisymm {a b c : α} (h : btw a b c) : btw c b a → a = b ∨ b = c ∨ c = a 
goal: btw c b a → a = b ∨ b = c ∨ c = a

full_name: btw_refl_left_right
code: theorem btw_refl_left_right (a b : α) : btw a b a 
goal: btw a b a

full_name: btw_rfl_left_right
code: theorem btw_rfl_left_right {a b : α} : btw a b a 
goal: btw a b a

full_name: btw_refl_left
code: theorem btw_refl_left (a b : α) : btw a a b 
goal: btw a a b

full_name: btw_rfl_left
code: theorem btw_rfl_left {a b : α} : btw a a b 
goal: btw a a b

full_name: btw_refl_right
code: theorem btw_refl_right (a b : α) : btw a b b 
goal: btw a b b

full_name: btw_rfl_right
code: theorem btw_rfl_right {a b : α} : btw a b b 
goal: btw a b b

full_name: sbtw_iff_not_btw
code: theorem sbtw_iff_not_btw {a b c : α} : sbtw a b c ↔ ¬btw c b a 
goal: sbtw a b c ↔ ¬btw c b a

full_name: btw_iff_not_sbtw
code: theorem btw_iff_not_sbtw {a b c : α} : btw a b c ↔ ¬sbtw c b a 
goal: btw a b c ↔ ¬sbtw c b a

full_name: Set.cIcc
code: /-- Closed-closed circular interval -/
def cIcc (a b : α) : Set α 
goal: Set α

full_name: Set.cIoo
code: /-- Open-open circular interval -/
def cIoo (a b : α) : Set α 
goal: Set α

full_name: Set.mem_cIcc
code: @[simp]
theorem mem_cIcc {a b x : α} : x ∈ cIcc a b ↔ btw a x b 
goal: x ∈ Set.cIcc a b ↔ btw a x b

full_name: Set.mem_cIoo
code: @[simp]
theorem mem_cIoo {a b x : α} : x ∈ cIoo a b ↔ sbtw a x b 
goal: x ∈ Set.cIoo a b ↔ sbtw a x b

full_name: Set.left_mem_cIcc
code: theorem left_mem_cIcc (a b : α) : a ∈ cIcc a b 
goal: a ∈ Set.cIcc a b

full_name: Set.right_mem_cIcc
code: theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b 
goal: b ∈ Set.cIcc a b

full_name: Set.compl_cIcc
code: theorem compl_cIcc {a b : α} : (cIcc a b)ᶜ = cIoo b a 
goal: (Set.cIcc a b)ᶜ = Set.cIoo b a

full_name: Set.compl_cIoo
code: theorem compl_cIoo {a b : α} : (cIoo a b)ᶜ = cIcc b a 
goal: (Set.cIoo a b)ᶜ = Set.cIcc b a

full_name: LE.toBtw
code: /-- The betweenness relation obtained from "looping around" `≤`.
See note [reducible non-instances]. -/
abbrev LE.toBtw (α : Type*) [LE α] : Btw α 
goal: Btw α

full_name: LT.toSBtw
code: /-- The strict betweenness relation obtained from "looping around" `<`.
See note [reducible non-instances]. -/
abbrev LT.toSBtw (α : Type*) [LT α] : SBtw α 
goal: SBtw α

full_name: Preorder.toCircularPreorder
code: /-- The circular preorder obtained from "looping around" a preorder.
See note [reducible non-instances]. -/
abbrev Preorder.toCircularPreorder (α : Type*) [Preorder α] : CircularPreorder α 
goal: CircularPreorder α

full_name: PartialOrder.toCircularPartialOrder
code: /-- The circular partial order obtained from "looping around" a partial order.
See note [reducible non-instances]. -/
abbrev PartialOrder.toCircularPartialOrder (α : Type*) [PartialOrder α] : CircularPartialOrder α 
goal: CircularPartialOrder α

full_name: LinearOrder.toCircularOrder
code: /-- The circular order obtained from "looping around" a linear order.
See note [reducible non-instances]. -/
abbrev LinearOrder.toCircularOrder (α : Type*) [LinearOrder α] : CircularOrder α 
goal: CircularOrder α

full_name: OrderDual.btw
code: instance btw (α : Type*) [Btw α] : Btw αᵒᵈ 
goal: Btw αᵒᵈ

full_name: OrderDual.sbtw
code: instance sbtw (α : Type*) [SBtw α] : SBtw αᵒᵈ 
goal: SBtw αᵒᵈ

full_name: OrderDual.circularPreorder
code: instance circularPreorder (α : Type*) [CircularPreorder α] : CircularPreorder αᵒᵈ 
goal: CircularPreorder αᵒᵈ

full_name: OrderDual.circularPartialOrder
code: instance circularPartialOrder (α : Type*) [CircularPartialOrder α] : CircularPartialOrder αᵒᵈ 
goal: CircularPartialOrder αᵒᵈ

full_name: OrderDual.instCircularOrder
code: instance (α : Type*) [CircularOrder α] : CircularOrder αᵒᵈ 
goal: CircularOrder αᵒᵈ