Local equivalences #
This files defines equivalences between subsets of given types.
An element e
of LocalEquiv α β
is made of two maps e.toFun
and e.invFun
respectively
from α to β and from β to α (just like equivs), which are inverse to each other on the subsets
e.source
and e.target
of respectively α and β.
They are designed in particular to define charts on manifolds.
The main functionality is e.trans f
, which composes the two local equivalences by restricting
the source and target to the maximal set where the composition makes sense.
As for equivs, we register a coercion to functions and use it in our simp normal form: we write
e x
and e.symm y
instead of e.toFun x
and e.invFun y
.
Main definitions #
Equiv.toLocalEquiv
: associating a local equiv to an equiv, with source = target = univ
LocalEquiv.symm
: the inverse of a local equiv
LocalEquiv.trans
: the composition of two local equivs
LocalEquiv.refl
: the identity local equiv
LocalEquiv.ofSet
: the identity on a set s
EqOnSource
: equivalence relation describing the "right" notion of equality for local
equivs (see below in implementation notes)
Implementation notes #
There are at least three possible implementations of local equivalences:
- equivs on subtypes
- pairs of functions taking values in
Option α
andOption β
, equal to none where the local equivalence is not defined - pairs of functions defined everywhere, keeping the source and target as additional data
Each of these implementations has pros and cons.
- When dealing with subtypes, one still need to define additional API for composition and
restriction of domains. Checking that one always belongs to the right subtype makes things very
tedious, and leads quickly to DTT hell (as the subtype
u ∩ v
is not the "same" asv ∩ u
, for instance). - With option-valued functions, the composition is very neat (it is just the usual composition, and
the domain is restricted automatically). These are implemented in
PEquiv.lean
. For manifolds, where one wants to discuss thoroughly the smoothness of the maps, this creates however a lot of overhead as one would need to extend all classes of smoothness to option-valued maps. - The
LocalEquiv
version as explained above is easier to use for manifolds. The drawback is that there is extra useless data (the values oftoFun
andinvFun
outside ofsource
andtarget
). In particular, the equality notion between local equivs is not "the right one", i.e., coinciding source and target and equality there. Moreover, there are no local equivs in this sense between an empty type and a nonempty type. Since empty types are not that useful, and since one almost never needs to talk about equal local equivs, this is not an issue in practice. Still, we introduce an equivalence relationEqOnSource
that captures this right notion of equality, and show that many properties are invariant under this equivalence relation.
Local coding conventions #
If a lemma deals with the intersection of a set with either source or target of a LocalEquiv
,
then it should use e.source ∩ s
or e.target ∩ t
, not s ∩ e.source
or t ∩ e.target
.
Implementation of the mfld_set_tac
tactic for working with the domains of partially-defined
functions (LocalEquiv
, LocalHomeomorph
, etc).
This is in a separate file from Mathlib.Logic.Equiv.MfldSimpsAttr
because attributes need a new
file to become functional.
Common @[simps]
configuration options used for manifold-related declarations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A very basic tactic to show that sets showing up in manifolds coincide or are included in one another.
Equations
- Tactic.MfldSetTac.mfldSetTac = Lean.ParserDescr.node `Tactic.MfldSetTac.mfldSetTac 1024 (Lean.ParserDescr.nonReservedSymbol "mfld_set_tac" false)
Instances For
- toFun : α → β
The global function which has a local inverse. Its value outside of the
source
subset is irrelevant. - invFun : β → α
- source : Set α
The domain of the local equivalence.
- target : Set β
The codomain of the local equivalence.
- map_target' : ∀ ⦃x : β⦄, x ∈ s.target → LocalEquiv.invFun s x ∈ s.source
- left_inv' : ∀ ⦃x : α⦄, x ∈ s.source → LocalEquiv.invFun s (↑s x) = x
- right_inv' : ∀ ⦃x : β⦄, x ∈ s.target → ↑s (LocalEquiv.invFun s x) = x
Local equivalence between subsets source
and target
of α
and β
respectively. The
(global) maps toFun : α → β
and invFun : β → α
map source
to target
and conversely, and are
inverse to each other there. The values of toFun
outside of source
and of invFun
outside of
target
are irrelevant.
Instances For
Equations
- One or more equations did not get rendered due to their size.
The inverse of a local equiv
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LocalEquiv.instCoeFunLocalEquivForAll = { coe := LocalEquiv.toFun }
See Note [custom simps projection]
Equations
Instances For
Interpret an Equiv
as a LocalEquiv
by restricting it to s
in the domain
and to t
in the codomain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Associate a LocalEquiv
to an Equiv
.
Equations
- Equiv.toLocalEquiv e = Equiv.toLocalEquivOfImageEq e Set.univ Set.univ (_ : ↑e '' Set.univ = Set.univ)
Instances For
Equations
- LocalEquiv.inhabitedOfEmpty = { default := Equiv.toLocalEquiv ((Equiv.equivEmpty α).trans (Equiv.equivEmpty β).symm) }
Create a copy of a LocalEquiv
providing better definitional equalities.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Associate to a LocalEquiv
an Equiv
between the source and the target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
We say that t : Set β
is an image of s : Set α
under a local equivalence if
any of the following equivalent conditions hold:
e '' (e.source ∩ s) = e.target ∩ t
;e.source ∩ e ⁻¹ t = e.source ∩ s
;∀ x ∈ e.source, e x ∈ t ↔ x ∈ s
(this one is used in the definition).
Instances For
Restrict a LocalEquiv
to a pair of corresponding sets.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Alias of the reverse direction of LocalEquiv.IsImage.iff_preimage_eq
.
Alias of the forward direction of LocalEquiv.IsImage.iff_preimage_eq
.
Alias of the forward direction of LocalEquiv.IsImage.iff_symm_preimage_eq
.
Alias of the reverse direction of LocalEquiv.IsImage.iff_symm_preimage_eq
.
Two local equivs that have the same source
, same toFun
and same invFun
, coincide.
Restricting a local equivalence to e.source ∩ s
Equations
- LocalEquiv.restr e s = LocalEquiv.IsImage.restr (_ : LocalEquiv.IsImage e s (↑(LocalEquiv.symm e) ⁻¹' s))
Instances For
The identity local equiv
Equations
Instances For
The identity local equiv on a set s
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composing two local equivs if the target of the first coincides with the source of the second.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composing two local equivs, by restricting to the maximal domain where their composition is well defined.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A lemma commonly useful when e
and e'
are charts of a manifold.
Postcompose a local equivalence with an equivalence. We modify the source and target to have better definitional behavior.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Precompose a local equivalence with an equivalence. We modify the source and target to have better definitional behavior.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EqOnSource e e'
means that e
and e'
have the same source, and coincide there. Then e
and e'
should really be considered the same local equiv.
Equations
- LocalEquiv.EqOnSource e e' = (e.source = e'.source ∧ Set.EqOn (↑e) (↑e') e.source)
Instances For
EqOnSource
is an equivalence relation. This instance provides the ≈
notation between two
LocalEquiv
s.
Equations
- LocalEquiv.eqOnSourceSetoid = { r := LocalEquiv.EqOnSource, iseqv := (_ : Equivalence LocalEquiv.EqOnSource) }
Two equivalent local equivs have the same source
Two equivalent local equivs coincide on the source
Two equivalent local equivs have the same target
If two local equivs are equivalent, so are their inverses.
Two equivalent local equivs have coinciding inverses on the target
Composition of local equivs respects equivalence
Restriction of local equivs respects equivalence
Preimages are respected by equivalence
Composition of a local equiv and its inverse is equivalent to the restriction of the identity to the source
Composition of the inverse of a local equiv and this local equiv is equivalent to the restriction of the identity to the target
Two equivalent local equivs are equal when the source and target are univ
The product of two local equivs, as a local equiv on the product.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Combine two LocalEquiv
s using Set.piecewise
. The source of the new LocalEquiv
is
s.ite e.source e'.source = e.source ∩ s ∪ e'.source \ s
, and similarly for target. The function
sends e.source ∩ s
to e.target ∩ t
using e
and e'.source \ s
to e'.target \ t
using e'
,
and similarly for the inverse function. The definition assumes e.isImage s t
and
e'.isImage s t
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Combine two LocalEquiv
s with disjoint sources and disjoint targets. We reuse
LocalEquiv.piecewise
, then override source
and target
to ensure better definitional
equalities.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The product of a family of local equivs, as a local equiv on the pi type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A bijection between two sets s : Set α
and t : Set β
provides a local equivalence
between α
and β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A map injective on a subset of its domain provides a local equivalence.
Equations
- Set.InjOn.toLocalEquiv f s hf = Set.BijOn.toLocalEquiv f s (f '' s) (_ : Set.BijOn f s (f '' s))