Equivalence between types #
In this file we continue the work on equivalences begun in Mathlib/Logic/Equiv/Defs.lean, defining
a lot of equivalences between various types and operations on these equivalences.
More definitions of this kind can be found in other files.
E.g., Mathlib/Algebra/Group/TransferInstance.lean does it for Group,
Mathlib/Algebra/Module/TransferInstance.lean does it for Module, and similar files exist for
other algebraic type classes.
Tags #
equivalence, congruence, bijective map
The product over Option α of β a is the binary product of the
product over α of β (some α) and β none
Instances For
For a fixed function x₀ : {a // p a} → β defined on a subtype of α,
the subtype of functions x : α → β that agree with x₀ on the subtype {a // p a}
is naturally equivalent to the type of functions {a // ¬ p a} → β.
Instances For
A family of equivalences ∀ a, β₁ a ≃ β₂ a generates an equivalence between ∀ a, β₁ a and
∀ a, β₂ a.
Instances For
Given φ : α → β → Sort*, we have an equivalence between ∀ a b, φ a b and ∀ b a, φ a b.
This is Function.swap as an Equiv.
Instances For
Dependent curry equivalence: the type of dependent functions on Σ i, β i is equivalent
to the type of dependent functions of two arguments (i.e., functions to the space of functions).
This is Sigma.curry and Sigma.uncurry together as an equiv.
Instances For
A family of equivalences between fibers gives an equivalence between domains.
Instances For
An equivalence that separates out the 0th fiber of (Σ (n : ℕ), f n).
Instances For
The set of natural numbers is equivalent to ℕ ⊕ PUnit.
Instances For
ℕ ⊕ PUnit is equivalent to ℕ.
Instances For
The type of integer numbers is equivalent to ℕ ⊕ ℕ.
Instances For
If α is equivalent to β and the predicates p : α → Prop and q : β → Prop are equivalent
at corresponding points, then {a // p a} is equivalent to {b // q b}.
For the statement where α = β, that is, e : perm α, see Perm.subtypePerm.
Instances For
If two predicates p and q are pointwise equivalent, then {x // p x} is equivalent to
{x // q x}.
Instances For
If α ≃ β, then for any predicate p : β → Prop the subtype {a // p (e a)} is equivalent
to the subtype {b // p b}.
Instances For
If two predicates are equal, then the corresponding subtypes are equivalent.
Instances For
A subtype of a subtype is equivalent to the subtype of elements satisfying both predicates. This
version allows the “inner” predicate to depend on h : p a.
Instances For
A subtype of a subtype is equivalent to the subtype of elements satisfying both predicates.
Instances For
If the outer subtype has more restrictive predicate than the inner one, then we can drop the latter.
Instances For
If a proposition holds for all elements, then the subtype is equivalent to the original type.
Instances For
A subtype of a sigma-type is a sigma-type over a subtype.
Instances For
A sigma type over a subtype is equivalent to the sigma set over the original type, if the fiber is empty outside of the subset
Instances For
If a predicate p : β → Prop is true on the range of a map f : α → β, then
Σ y : {y // p y}, {x // f x = y} is equivalent to α.
Instances For
If for each x we have p x ↔ q (f x), then Σ y : {y // q y}, f ⁻¹' {y} is equivalent
to {x // p x}.
Instances For
A sigma type over an Option is equivalent to the sigma set over the original type,
if the fiber is empty at none.
Instances For
The Pi-type ∀ i, π i is equivalent to the type of sections f : ι → Σ i, π i of the
Sigma type such that for all i we have (f i).fst = i.
Instances For
The type of functions f : ∀ a, β a such that for all a we have p a (f a) is equivalent
to the type of functions ∀ a, {b : β a // p a b}.
Instances For
A sigma of a sigma whose second base does not depend on the first is equivalent to a sigma whose base is a product.
Instances For
A subtype of a sigma which pins down the base of the sigma is equivalent to the respective fiber.
Instances For
A subtype of a dependent triple which pins down both bases is equivalent to the respective fiber.
Instances For
A specialization of sigmaSigmaSubtype to the case where the second base
does not depend on the first, and the property being checked for is simple
equality. Useful e.g. when γ is Hom inside a category.
Instances For
The type of all functions X → Y with prescribed values for all x' ≠ x
is equivalent to the codomain Y.
Instances For
Extend the domain of e : Equiv.Perm α to one that is over β via f : α → Subtype p,
where p : β → Prop, permuting only the b : β that satisfy p b.
This can be used to extend the domain across a function f : α → β,
keeping everything outside of Set.range f fixed. For this use-case Equiv given by f can
be constructed by Equiv.of_leftInverse' or Equiv.of_leftInverse when there is a known
inverse, or Equiv.ofInjective in the general case.
Instances For
Subtype of the quotient is equivalent to the quotient of the subtype. Let α be a setoid with
equivalence relation ~. Let p₂ be a predicate on the quotient type α/~, and p₁ be the lift
of this predicate to α: p₁ a ↔ p₂ ⟦a⟧. Let ~₂ be the restriction of ~ to {x // p₁ x}.
Then {x // p₂ x} is equivalent to the quotient of {x // p₁ x} by ~₂.
Instances For
A helper function for Equiv.swap.
Instances For
swap a b is the permutation that swaps a and b and
leaves other values as is.
Instances For
A function is invariant to a swap if it is equal at both elements
Augment an equivalence with a prescribed mapping f a = b
Instances For
Convert an involutive function f to a permutation with toFun = invFun = f.
Instances For
Transport dependent functions through an equivalence of the base space.
Instances For
Note: the "obvious" statement (piCongrLeft' P e).symm g a = g (e a) doesn't typecheck: the
LHS would have type P a while the RHS would have type P (e.symm (e a)). For that reason,
we have to explicitly substitute along e.symm (e a) = a in the statement of this lemma.
This lemma is impractical to state in the dependent case.
Note: the "obvious" statement (piCongrLeft' P e).symm g a = g (e a) doesn't typecheck: the
LHS would have type P a while the RHS would have type P (e.symm (e a)). This lemma is a way
around it in the case where a is of the form e.symm b, so we can use g b instead of
g (e (e.symm b)).
Transporting dependent functions through an equivalence of the base, expressed as a "simplification".
Instances For
Note: the "obvious" statement (piCongrLeft P e) f b = f (e.symm b) doesn't typecheck: the
LHS would have type P b while the RHS would have type P (e (e.symm b)). For that reason,
we have to explicitly substitute along e (e.symm b) = b in the statement of this lemma.
Note: the "obvious" statement (piCongrLeft P e) f b = f (e.symm b) doesn't typecheck: the
LHS would have type P b while the RHS would have type P (e (e.symm b)). This lemma is a way
around it in the case where b is of the form e a, so we can use f a instead of
f (e.symm (e a)).
Let f : α → β be a function on index types. A family of equivalences, indexed by b : β,
between the product over the fiber of b under f given as
∀ (σ : { a : α // f a = b }) → γ₁ σ.1) ≃ γ₂ b lifts to an equivalence over the products
∀ a, γ₁ a ≃ ∀ b, γ₂ b.
Instances For
Transport dependent functions through an equality of sets.
Instances For
To give an equivalence between two subsingleton types, it is sufficient to give any two functions between them.
Instances For
A nonempty subsingleton type is (noncomputably) equivalent to PUnit.