Equivalence between types #
In this file we define two types:
Equiv α βa.k.a.α ≃ β: a bijective mapα → βbundled with its inverse map; we use this (and not equality!) to express that variousTypes orSorts are equivalent.Equiv.Perm α: the group of permutationsα ≃ α. More lemmas aboutEquiv.Permcan be found inMathlib/GroupTheory/Perm/.
Then we define
canonical isomorphisms between various types: e.g.,
Equiv.refl αis the identity map interpreted asα ≃ α;
operations on equivalences: e.g.,
Equiv.symm e : β ≃ αis the inverse ofe : α ≃ β;Equiv.trans e₁ e₂ : α ≃ γis the composition ofe₁ : α ≃ βande₂ : β ≃ γ(note the order of the arguments!);
definitions that transfer some instances along an equivalence. By convention, we transfer instances from right to left.
Equiv.inhabitedtakese : α ≃ βand[Inhabited β]and returnsInhabited α;Equiv.uniquetakese : α ≃ βand[Unique β]and returnsUnique α;Equiv.decidableEqtakese : α ≃ βand[DecidableEq β]and returnsDecidableEq α.
More definitions of this kind can be found in other files. E.g.,
Mathlib/Algebra/Group/TransferInstance.leandoes it forGroup,Mathlib/Algebra/Module/TransferInstance.leandoes it forModule, and similar files exist for other algebraic type classes.
Many more such isomorphisms and operations are defined in Mathlib/Logic/Equiv/Basic.lean.
Tags #
equivalence, congruence, bijective map
α ≃ β is the type of functions from α → β with a two-sided inverse.
- toFun : α → β
The forward map of an equivalence.
Do NOT use directly. Use the coercion instead.
- invFun : β → α
- left_inv : Function.LeftInverse self.invFun self.toFun
- right_inv : Function.RightInverse self.invFun self.toFun
Instances For
α ≃ β is the type of functions from α → β with a two-sided inverse.
Equations
Instances For
Any type satisfying EquivLike can be cast into Equiv via EquivLike.toEquiv.
Equations
Equations
The map (r ≃ s) → (r → s) is injective.
Any type is equivalent to itself.
Equations
Instances For
Inverse of an equivalence e : α ≃ β.
Equations
Instances For
See Note [custom simps projection]
Equations
Instances For
Restatement of Equiv.left_inv in terms of Function.LeftInverse.
Restatement of Equiv.right_inv in terms of Function.RightInverse.
Composition of equivalences e₁ : α ≃ β and e₂ : β ≃ γ.
Equations
Instances For
If α ≃ β and β is inhabited, then so is α.
Equations
Instances For
If α ≃ β and β is a singleton type, then so is α.
Equations
Instances For
Equivalence between equal types.
Equations
Instances For
This cannot be a simp lemmas as it incorrectly matches against e : α ≃ synonym α, when
synonym α is semireducible. This makes a mess of Multiplicative.ofAdd etc.
Two empty types are equivalent.
Equations
Instances For
If α is an empty type, then it is equivalent to the PEmpty type in any universe.
Equations
Instances For
α is equivalent to an empty type iff α is empty.
Equations
Instances For
If both α and β have a unique element, then α ≃ β.
Equations
Instances For
equivalence of propositions is the same as iff
Equations
Instances For
A version of Equiv.arrowCongr in Type, rather than Sort.
The equiv_rw tactic is not able to use the default Sort level Equiv.arrowCongr,
because Lean's universe rules will not unify ?l_1 with imax (1 ?m_1).
Equations
Instances For
Conjugate a map f : α → α by an equivalence α ≃ β.
Equations
Instances For
The sort of maps to PUnit.{v} is equivalent to PUnit.{w}.
Equations
Instances For
The equivalence (∀ i, β i) ≃ β ⋆ when the domain of β only contains ⋆
Equations
Instances For
If α has a unique term, then the type of function α → β is equivalent to β.
Equations
Instances For
A family of equivalences Π a, β₁ a ≃ β₂ a generates an equivalence between Σ' a, β₁ a and
Σ' a, β₂ a.
Equations
Instances For
A family of equivalences Π a, β₁ a ≃ β₂ a generates an equivalence between Σ a, β₁ a and
Σ a, β₂ a.
Equations
Instances For
A Sigma with fun i ↦ ULift (PLift (P i)) fibers is equivalent to { x // P x }.
Variant of sigmaPLiftEquivSubtype.
Equations
Instances For
Function.swap as an equivalence.
Equations
Instances For
An equivalence f : α₁ ≃ α₂ generates an equivalence between Σ a, β (f a) and Σ a, β a.
Equations
Instances For
Transporting a sigma type through an equivalence of the base
Equations
Instances For
The dependent product of types is associative up to an equivalence.
Equations
Instances For
The dependent product of sorts is associative up to an equivalence.
Equations
Instances For
If f is a bijective function, then its domain is equivalent to its codomain.
Equations
Instances For
Quotients are congruent on equivalences under equality of their relation.
An alternative is just to use rewriting with eq, but then computational proofs get stuck.
Equations
Instances For
An equivalence e : α ≃ β generates an equivalence between the quotient space of α
by a relation ra and the quotient space of β by the image of this relation under e.
Equations
Instances For
Quotients are congruent on equivalences under equality of their relation.
An alternative is just to use rewriting with eq, but then computational proofs get stuck.