@[simp]
@[simp]
Index Types #
Index types are types which can serve as the index into a sequence.
Every index type is in bijection with Fin n.
N.B. this is equivalent to [Fintype] in mathlib, but [Fintype] has many instances with very bad computational complexity.
Instances
Instances For
@[simp]
theorem
Trestle.IndexType.toFin_fromFin
{ι : Type u_1}
[IndexType ι]
[LawfulIndexType ι]
(i : Fin (card ι))
:
@[simp]
@[simp]
Equations
- Trestle.IndexType.toEquiv = { toFun := Trestle.IndexType.toFin, invFun := Trestle.IndexType.fromFin, left_inv := ⋯, right_inv := ⋯ }
Instances For
@[simp]
@[simp]
theorem
Trestle.IndexType.mem_toList_univ
{α : Type u_1}
[IndexType α]
[LawfulIndexType α]
(x : α)
:
Equations
Equations
- Trestle.IndexType.instFintype = { elems := (Trestle.IndexType.toList ι).toFinset, complete := ⋯ }
Transport over equivalence #
Equations
- Trestle.IndexType.ofEquiv f = { card := Trestle.IndexType.card ι', toFin := Trestle.IndexType.toFin ∘ ⇑f.symm, fromFin := ⇑f ∘ Trestle.IndexType.fromFin }
Instances For
def
Trestle.IndexType.ofEquivLawful
{ι' : Type u_1}
{ι : Type u_2}
[I' : IndexType ι']
[LI' : LawfulIndexType ι']
(f : ι' ≃ ι)
:
Equations
- ⋯ = ⋯
Instances For
Unit #
Fin n #
Product #
instance
Trestle.IndexType.instLawfulIndexTypeProd
{α : Type u}
[IndexType α]
[LawfulIndexType α]
{β : Type v}
[IndexType β]
[LawfulIndexType β]
:
LawfulIndexType (α × β)
Sigma #
instance
Trestle.IndexType.instLawfulIndexTypeSigma
{α : Type u}
[IndexType α]
[LawfulIndexType α]
{β : Type v}
[IndexType β]
[LawfulIndexType β]
:
LawfulIndexType ((_ : α) × β)
Sum #
instance
Trestle.IndexType.instLawfulIndexTypeSum
{α : Type u}
[IndexType α]
[LawfulIndexType α]
{β : Type v}
[IndexType β]
[LawfulIndexType β]
:
LawfulIndexType (α ⊕ β)
Generic inductives #
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.