Partial Equivalences #
In this file, we define partial equivalences PEquiv
, which are a bijection between a subset of α
and a subset of β
. Notationally, a PEquiv
is denoted by "≃.
" (note that the full stop is part
of the notation). The way we store these internally is with two functions f : α → Option β
and
the reverse function g : β → Option α
, with the condition that if f a
is some b
,
then g b
is some a
.
Main results #
PEquiv.ofSet
: creates aPEquiv
from a sets
, which sends an element to itself if it is ins
.PEquiv.single
: given two elementsa : α
andb : β
, create aPEquiv
that sends them to each other, and ignores all other elements.PEquiv.injective_of_forall_ne_isSome
/injective_of_forall_isSome
: If the domain of aPEquiv
is all ofα
(except possibly one point), itstoFun
is injective.
Canonical order #
PEquiv
is canonically ordered by inclusion; that is, if a function f
defined on a subset s
is equal to g
on that subset, but g
is also defined on a larger set, then f ≤ g
. We also have
a definition of ⊥
, which is the empty PEquiv
(sends all to none
), which in the end gives us a
SemilatticeInf
with an OrderBot
instance.
Tags #
pequiv, partial equivalence
A PEquiv
is a partial equivalence, a representation of a bijection between a subset
of α
and a subset of β
. See also PartialEquiv
for a version that requires toFun
and
invFun
to be globally defined functions and has source
and target
sets as extra fields.
- toFun : α → Option β
The underlying partial function of a
PEquiv
- invFun : β → Option α
The partial inverse of
toFun
Instances For
A PEquiv
is a partial equivalence, a representation of a bijection between a subset
of α
and a subset of β
. See also PartialEquiv
for a version that requires toFun
and
invFun
to be globally defined functions and has source
and target
sets as extra fields.
Equations
- «term_≃._» = Lean.ParserDescr.trailingNode `term_≃._ 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≃. ") (Lean.ParserDescr.cat `term 25))
Instances For
The identity map as a partial equivalence.
Equations
- PEquiv.refl α = { toFun := some, invFun := some, inv := ⋯ }
Instances For
The inverse partial equivalence.
Equations
- PEquiv.symm f = { toFun := f.invFun, invFun := f.toFun, inv := ⋯ }
Instances For
Composition of partial equivalences f : α ≃. β
and g : β ≃. γ
.
Equations
- PEquiv.trans f g = { toFun := fun (a : α) => Option.bind (f a) ⇑g, invFun := fun (a : γ) => Option.bind ((PEquiv.symm g) a) ⇑(PEquiv.symm f), inv := ⋯ }
Instances For
If the domain of a PEquiv
is α
except a point, its forward direction is injective.
If the domain of a PEquiv
is all of α
, its forward direction is injective.
Equations
- PEquiv.instPartialOrderPEquiv = PartialOrder.mk ⋯
Equations
- PEquiv.instOrderBotPEquivToLEToPreorderInstPartialOrderPEquiv = let __src := PEquiv.instBotPEquiv; OrderBot.mk ⋯
Equations
- PEquiv.instSemilatticeInfPEquiv = let __src := PEquiv.instPartialOrderPEquiv; SemilatticeInf.mk ⋯ ⋯ ⋯