The areas / V01. The language of Mathlib
Mathlib.Basic.TwoPointing
36 declarations. Mathlib docs · Source
Two-pointings
This file defines TwoPointing α, the type of two pointings of α. A two-pointing is the data of
two distinct terms.
This is morally a Type-valued Nontrivial. Another type which is quite close in essence is Sym2.
Categorically speaking, prod is a cospan in the category of types. This forms the category of
bipointed types. Two-pointed types form a full subcategory of those.
References
- [nLab, Coalgebra of the real interval] (https://ncatlab.org/nlab/show/coalgebra+of+the+real+interval)
theorem TwoPointing.mk.inj E1 #
∀ {α : Type u_3} {toProd : α × α} {fst_ne_snd : toProd.1 ≠ toProd.2} {toProd_1 : α × α}
{fst_ne_snd_1 : toProd_1.1 ≠ toProd_1.2},
{ toProd := toProd, fst_ne_snd := fst_ne_snd } = { toProd := toProd_1, fst_ne_snd := fst_ne_snd_1 } →
toProd = toProd_1
def TwoPointing.ctorIdx E1 #
{α : Type u_3} → TwoPointing α → ℕ
theorem TwoPointing.mk.injEq E0 #
∀ {α : Type u_3} (toProd : α × α) (fst_ne_snd : toProd.1 ≠ toProd.2) (toProd_1 : α × α)
(fst_ne_snd_1 : toProd_1.1 ≠ toProd_1.2),
({ toProd := toProd, fst_ne_snd := fst_ne_snd } = { toProd := toProd_1, fst_ne_snd := fst_ne_snd_1 }) =
(toProd = toProd_1)
structure TwoPointing E1 #
Type u_3 → Type u_3
Two-pointing of a type. This is a Type-valued termed Nontrivial.
theorem TwoPointing.ext_iff E0 #
∀ {α : Type u_3} {x y : TwoPointing α}, x = y ↔ x.toProd.1 = y.toProd.1 ∧ x.toProd.2 = y.toProd.2
theorem TwoPointing.ext E1 #
∀ {α : Type u_3} {x y : TwoPointing α}, x.toProd.1 = y.toProd.1 → x.toProd.2 = y.toProd.2 → x = y
ctor TwoPointing.mk E0 #
{α : Type u_3} → (toProd : α × α) → toProd.1 ≠ toProd.2 → TwoPointing α
abbrev TwoPointing.toProd E1 #
{α : Type u_3} → TwoPointing α → α × α
theorem TwoPointing.fst_ne_snd E1 #
∀ {α : Type u_3} (self : TwoPointing α), self.toProd.1 ≠ self.toProd.2
fst and snd are distinct terms
instance instDecidableEqTwoPointing E0 #
{α : Type u_3} → [DecidableEq α] → DecidableEq (TwoPointing α)
def instDecidableEqTwoPointing.decEq E1 #
{α : Type u_3} → [DecidableEq α] → (x x_1 : TwoPointing α) → Decidable (x = x_1)
theorem TwoPointing.snd_ne_fst E1 #
∀ {α : Type u_1} (p : TwoPointing α), p.toProd.2 ≠ p.toProd.1
def TwoPointing.swap E1 #
{α : Type u_1} → TwoPointing α → TwoPointing α
Swaps the two pointed elements.
theorem TwoPointing.swap_toProd E0 #
∀ {α : Type u_1} (p : TwoPointing α), p.swap.toProd = (p.toProd.2, p.toProd.1)
theorem TwoPointing.swap_fst E1 #
∀ {α : Type u_1} (p : TwoPointing α), p.swap.toProd.1 = p.toProd.2
theorem TwoPointing.swap_snd E1 #
∀ {α : Type u_1} (p : TwoPointing α), p.swap.toProd.2 = p.toProd.1
theorem TwoPointing.swap_swap E0 #
∀ {α : Type u_1} (p : TwoPointing α), p.swap.swap = p
theorem TwoPointing.to_nontrivial E1 #
∀ {α : Type u_1} (p : TwoPointing α), Nontrivial α
instance TwoPointing.instNonemptyOfNontrivial E0 #
∀ {α : Type u_1} [Nontrivial α], Nonempty (TwoPointing α)
theorem TwoPointing.nonempty_two_pointing_iff E0 #
∀ {α : Type u_1}, Nonempty (TwoPointing α) ↔ Nontrivial α
def TwoPointing.pi E1 #
(α : Type u_1) → {β : Type u_2} → TwoPointing β → [Nonempty α] → TwoPointing (α → β)
The two-pointing of constant functions.
theorem TwoPointing.pi_fst E0 #
∀ (α : Type u_1) {β : Type u_2} (q : TwoPointing β) [inst : Nonempty α],
(TwoPointing.pi α q).toProd.1 = Function.const α q.toProd.1
theorem TwoPointing.pi_snd E0 #
∀ (α : Type u_1) {β : Type u_2} (q : TwoPointing β) [inst : Nonempty α],
(TwoPointing.pi α q).toProd.2 = Function.const α q.toProd.2
def TwoPointing.prod E1 #
{α : Type u_1} → {β : Type u_2} → TwoPointing α → TwoPointing β → TwoPointing (α × β)
The product of two two-pointings.
theorem TwoPointing.prod_fst E0 #
∀ {α : Type u_1} {β : Type u_2} (p : TwoPointing α) (q : TwoPointing β), (p.prod q).toProd.1 = (p.toProd.1, q.toProd.1)
theorem TwoPointing.prod_snd E0 #
∀ {α : Type u_1} {β : Type u_2} (p : TwoPointing α) (q : TwoPointing β), (p.prod q).toProd.2 = (p.toProd.2, q.toProd.2)
def TwoPointing.sum E1 #
{α : Type u_1} → {β : Type u_2} → TwoPointing α → TwoPointing β → TwoPointing (α ⊕ β)
The sum of two pointings. Keeps the first point from the left and the second point from the right.
theorem TwoPointing.sum_fst E0 #
∀ {α : Type u_1} {β : Type u_2} (p : TwoPointing α) (q : TwoPointing β), (p.sum q).toProd.1 = Sum.inl p.toProd.1
theorem TwoPointing.sum_snd E0 #
∀ {α : Type u_1} {β : Type u_2} (p : TwoPointing α) (q : TwoPointing β), (p.sum q).toProd.2 = Sum.inr q.toProd.2
def TwoPointing.bool E1 #
TwoPointing Bool
The false, true two-pointing of Bool.
theorem TwoPointing.bool_fst E0 #
TwoPointing.bool.toProd.1 = false
theorem TwoPointing.bool_snd E0 #
TwoPointing.bool.toProd.2 = true
instance TwoPointing.instInhabitedBool E0 #
Inhabited (TwoPointing Bool)
def TwoPointing.prop E1 #
TwoPointing Prop
The False, True two-pointing of Prop.
theorem TwoPointing.prop_fst E0 #
TwoPointing.prop.toProd.1 = False
theorem TwoPointing.prop_snd E0 #
TwoPointing.prop.toProd.2 = True