Quotient types #
This module extends the core library's treatment of quotient types (Init.Core
).
Tags #
quotient
Equations
- Quot.instInhabitedQuot r = { default := Quot.mk r default }
Recursion on two Quotient
arguments a
and b
, result type depends on ⟦a⟧
and ⟦b⟧
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Descends a function f : α → β → γ
to quotients of α
and β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Descends a function f : α → β → γ
to quotients of α
and β
and applies it.
Equations
- Quot.liftOn₂ p q f hr hs = Quot.lift₂ f hr hs p q
Instances For
Descends a function f : α → β → γ
to quotients of α
and β
with values in a quotient of
γ
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A binary version of Quot.recOnSubsingleton
.
Equations
- Quot.recOnSubsingleton₂ q₁ q₂ f = Quot.recOnSubsingleton q₁ fun a => Quot.recOnSubsingleton q₂ fun b => f a b
Instances For
Equations
- Quot.lift.decidablePred r f h q = Quot.recOnSubsingleton q hf
Note that this provides DecidableRel (Quot.Lift₂ f ha hb)
when α = β
.
Equations
- Quot.lift₂.decidablePred r s f ha hb q₁ q₂ = Quot.recOnSubsingleton₂ q₁ q₂ hf
Equations
- Quot.instDecidableLiftOnProp r q f h = Quot.lift.decidablePred (fun a b => r a b) f h q
Equations
- Quot.instDecidableLiftOn₂Prop r s q₁ q₂ f ha hb = Quot.lift₂.decidablePred (fun a₁ a₂ => r a₁ a₂) (fun b₁ b₂ => s b₁ b₂) f ha hb q₁ q₂
The canonical quotient map into a Quotient
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Quotient.instInhabitedQuotient s = { default := Quotient.mk s default }
Induction on two Quotient
arguments a
and b
, result type depends on ⟦a⟧
and ⟦b⟧
.
Equations
- Quotient.hrecOn₂ qa qb f c = Quot.hrecOn₂ qa qb f (_ : ∀ {b : β} {a₁ a₂ : α}, Setoid.r a₁ a₂ → HEq (f a₁ b) (f a₂ b)) (_ : ∀ {a : α} {b₁ b₂ : β}, Setoid.r b₁ b₂ → HEq (f a b₁) (f a b₂))
Instances For
Map a function f : α → β
that sends equivalent elements to equivalent elements
to a function Quotient sa → Quotient sb
. Useful to define unary operations on quotients.
Equations
- Quotient.map f h = Quot.map f h
Instances For
Map a function f : α → β → γ
that sends equivalent elements to equivalent elements
to a function f : Quotient sa → Quotient sb → Quotient sc
.
Useful to define binary operations on quotients.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Quotient.lift.decidablePred f h = Quot.lift.decidablePred (fun a b => a ≈ b) f h
Note that this provides DecidableRel (Quotient.lift₂ f h)
when α = β
.
Equations
- Quotient.lift₂.decidablePred f h q₁ q₂ = Quotient.recOnSubsingleton₂ q₁ q₂ hf
Equations
Equations
- Quotient.instDecidableLiftOn₂Prop q₁ q₂ f h = Quotient.lift₂.decidablePred f h q₁ q₂
Quot.mk r
is a surjective function.
Quotient.mk'
is a surjective function.
Given a function f : Π i, Quotient (S i)
, returns the class of functions Π i, α i
sending
each i
to an element of the class f i
.
Equations
- Quotient.choice f = Quotient.mk inferInstance fun i => Quotient.out (f i)
Instances For
Truncation #
Trunc α
is the quotient of α
by the always-true relation. This
is related to the propositional truncation in HoTT, and is similar
in effect to Nonempty α
, but unlike Nonempty α
, Trunc α
is data,
so the VM representation is the same as α
, and so this can be used to
maintain computability.
Instances For
Any constant function lifts to a function out of the truncation
Equations
- Trunc.lift f c = Quot.lift f fun a b x => c a b
Instances For
Lift a constant function on q : Trunc α
.
Equations
- Trunc.liftOn q f c = Trunc.lift f c q
Instances For
The bind
operator for the Trunc
monad.
Equations
- Trunc.bind q f = Trunc.liftOn q f (_ : ∀ (x x_1 : α), f x = f x_1)
Instances For
A version of Trunc.recOn
assuming the codomain is a Subsingleton
.
Equations
Instances For
Versions of quotient definitions and lemmas ending in '
use unification instead
of typeclass inference for inferring the Setoid
argument. This is useful when there are
several different quotient relations on a type, for example quotient groups, rings and modules.
A version of Quotient.mk
taking {s : Setoid α}
as an implicit argument instead of an
instance argument.
Equations
- Quotient.mk'' a = Quot.mk Setoid.r a
Instances For
Quotient.mk''
is a surjective function.
A version of Quotient.liftOn
taking {s : Setoid α}
as an implicit argument instead of an
instance argument.
Equations
- Quotient.liftOn' q f h = Quotient.liftOn q f h
Instances For
A version of Quotient.liftOn₂
taking {s₁ : Setoid α} {s₂ : Setoid β}
as implicit arguments
instead of instance arguments.
Equations
- Quotient.liftOn₂' q₁ q₂ f h = Quotient.liftOn₂ q₁ q₂ f h
Instances For
A version of Quotient.ind
taking {s : Setoid α}
as an implicit argument instead of an
instance argument.
A version of Quotient.ind₂
taking {s₁ : Setoid α} {s₂ : Setoid β}
as implicit arguments
instead of instance arguments.
A version of Quotient.inductionOn
taking {s : Setoid α}
as an implicit argument instead
of an instance argument.
A version of Quotient.inductionOn₂
taking {s₁ : Setoid α} {s₂ : Setoid β}
as implicit
arguments instead of instance arguments.
A version of Quotient.inductionOn₃
taking {s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}
as implicit arguments instead of instance arguments.
A version of Quotient.recOnSubsingleton
taking {s₁ : Setoid α}
as an implicit argument
instead of an instance argument.
Equations
Instances For
A version of Quotient.recOnSubsingleton₂
taking {s₁ : Setoid α} {s₂ : Setoid α}
as implicit arguments instead of instance arguments.
Equations
- Quotient.recOnSubsingleton₂' q₁ q₂ f = Quotient.recOnSubsingleton₂ q₁ q₂ f
Instances For
Recursion on a Quotient
argument a
, result type depends on ⟦a⟧
.
Equations
- Quotient.hrecOn' qa f c = Quot.hrecOn qa f c
Instances For
Recursion on two Quotient
arguments a
and b
, result type depends on ⟦a⟧
and ⟦b⟧
.
Equations
- Quotient.hrecOn₂' qa qb f c = Quotient.hrecOn₂ qa qb f c
Instances For
Map a function f : α → β
that sends equivalent elements to equivalent elements
to a function Quotient sa → Quotient sb
. Useful to define unary operations on quotients.
Equations
- Quotient.map' f h = Quot.map f h
Instances For
A version of Quotient.map₂
using curly braces and unification.
Equations
- Quotient.map₂' f h = Quotient.map₂ f h
Instances For
A version of Quotient.out
taking {s₁ : Setoid α}
as an implicit argument instead of an
instance argument.
Equations
Instances For
Equations
Equations
- Quotient.instDecidableLiftOn₂'Prop q₁ q₂ f h = Quotient.lift₂.decidablePred (fun a₁ b₁ => f a₁ b₁) h q₁ q₂