Injective functions #
α ↪ β
is a bundled injective function.
- toFun : α → β
An embedding as a function. Use coercion instead.
- inj' : Function.Injective self.toFun
An embedding is an injective function. Use
Function.Embedding.injective
instead.
Instances For
An embedding, a.k.a. a bundled injective function.
Equations
- Function.«term_↪_» = Lean.ParserDescr.trailingNode `Function.term_↪_ 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↪ ") (Lean.ParserDescr.cat `term 25))
Instances For
Equations
- ⋯ = ⋯
Convert an α ≃ β
to α ↪ β
.
This is also available as a coercion Equiv.coeEmbedding
.
The explicit Equiv.toEmbedding
version is preferred though, since the coercion can have issues
inferring the type of the resulting embedding. For example:
-- Works:
example (s : Finset (Fin 3)) (f : Equiv.Perm (Fin 3)) : s.map f.toEmbedding = s.map f := by simp
-- Error, `f` has type `Fin 3 ≃ Fin 3` but is expected to have type `Fin 3 ↪ ?m_1 : Type ?`
example (s : Finset (Fin 3)) (f : Equiv.Perm (Fin 3)) : s.map f = s.map f.toEmbedding := by simp
Equations
- Equiv.toEmbedding f = { toFun := ⇑f, inj' := ⋯ }
Instances For
Equations
- Equiv.Perm.coeEmbedding = Equiv.coeEmbedding
Equations
- Function.Embedding.instUniqueEmbedding = { toInhabited := { default := { toFun := fun (a : α) => isEmptyElim a, inj' := ⋯ } }, uniq := ⋯ }
The identity map as a Function.Embedding
.
Equations
- Function.Embedding.refl α = { toFun := id, inj' := ⋯ }
Instances For
Equations
- Function.Embedding.instTransSortSortSortEmbeddingEmbeddingEmbedding = { trans := fun {a : Sort u_1} {b : Sort u_2} {c : Sort u_3} => Function.Embedding.trans }
Transfer an embedding along a pair of equivalences.
Equations
- Function.Embedding.congr e₁ e₂ f = Function.Embedding.trans (Equiv.toEmbedding e₁.symm) (Function.Embedding.trans f (Equiv.toEmbedding e₂))
Instances For
A right inverse surjInv
of a surjective function as an Embedding
.
Equations
- Function.Embedding.ofSurjective f hf = { toFun := Function.surjInv hf, inj' := ⋯ }
Instances For
Convert a surjective Embedding
to an Equiv
Equations
Instances For
There is always an embedding from an empty type.
Equations
- Function.Embedding.ofIsEmpty = { toFun := fun (a : α) => isEmptyElim a, inj' := ⋯ }
Instances For
Change the value of an embedding f
at one point. If the prescribed image
is already occupied by some f a'
, then swap the values at these two points.
Equations
- Function.Embedding.setValue f a b = { toFun := fun (a' : α) => if a' = a then b else if f a' = b then f a else f a', inj' := ⋯ }
Instances For
A version of Option.map
for Function.Embedding
s.
Equations
- Function.Embedding.optionMap f = { toFun := Option.map ⇑f, inj' := ⋯ }
Instances For
Embedding of a Subtype
.
Equations
- Function.Embedding.subtype p = { toFun := Subtype.val, inj' := ⋯ }
Instances For
Quotient.out
as an embedding.
Equations
- Function.Embedding.quotientOut α = { toFun := Quotient.out, inj' := ⋯ }
Instances For
Choosing an element b : β
gives an embedding of PUnit
into β
.
Equations
- Function.Embedding.punit b = { toFun := fun (x : PUnit.{u_2}) => b, inj' := ⋯ }
Instances For
Fixing an element b : β
gives an embedding α ↪ α × β
.
Equations
- Function.Embedding.sectl α b = { toFun := fun (a : α) => (a, b), inj' := ⋯ }
Instances For
Fixing an element a : α
gives an embedding β ↪ α × β
.
Equations
- Function.Embedding.sectr a β = { toFun := fun (b : β) => (a, b), inj' := ⋯ }
Instances For
If e₁
and e₂
are embeddings,
then so is fun ⟨a, b⟩ ↦ ⟨e₁ a, e₂ b⟩ : PProd α γ → PProd β δ
.
Equations
- Function.Embedding.pprodMap e₁ e₂ = { toFun := fun (x : PProd α γ) => { fst := e₁ x.fst, snd := e₂ x.snd }, inj' := ⋯ }
Instances For
Sigma.mk
as a Function.Embedding
.
Equations
- Function.Embedding.sigmaMk a = { toFun := Sigma.mk a, inj' := ⋯ }
Instances For
If f : α ↪ α'
is an embedding and g : Π a, β α ↪ β' (f α)
is a family
of embeddings, then Sigma.map f g
is an embedding.
Equations
- Function.Embedding.sigmaMap f g = { toFun := Sigma.map ⇑f fun (a : α) => ⇑(g a), inj' := ⋯ }
Instances For
Define an embedding (Π a : α, β a) ↪ (Π a : α, γ a)
from a family of embeddings
e : Π a, (β a ↪ γ a)
. This embedding sends f
to fun a ↦ e a (f a)
.
Equations
- Function.Embedding.piCongrRight e = { toFun := fun (f : (a : α) → β a) (a : α) => (e a) (f a), inj' := ⋯ }
Instances For
An embedding e : α ↪ β
defines an embedding (γ → α) ↪ (γ → β)
that sends each f
to e ∘ f
.
Equations
- Function.Embedding.arrowCongrRight e = Function.Embedding.piCongrRight fun (x : γ) => e
Instances For
An embedding e : α ↪ β
defines an embedding (α → γ) ↪ (β → γ)
for any inhabited type γ
.
This embedding sends each f : α → γ
to a function g : β → γ
such that g ∘ e = f
and
g y = default
whenever y ∉ range e
.
Equations
- Function.Embedding.arrowCongrLeft e = { toFun := fun (f : α → γ) => Function.extend (⇑e) f default, inj' := ⋯ }
Instances For
Restrict both domain and codomain of an embedding.
Equations
- Function.Embedding.subtypeMap f h = { toFun := Subtype.map (⇑f) h, inj' := ⋯ }
Instances For
Given an equivalence to a subtype, produce an embedding to the elements of the corresponding set.
Equations
Instances For
The type of embeddings α ↪ β
is equivalent to
the subtype of all injective functions α → β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If α₁ ≃ α₂
and β₁ ≃ β₂
, then the type of embeddings α₁ ↪ β₁
is equivalent to the type of embeddings α₂ ↪ β₂
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A subtype {x // p x ∨ q x}
over a disjunction of p q : α → Prop
can be injectively split
into a sum of subtypes {x // p x} ⊕ {x // q x}
such that ¬ p x
is sent to the right.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A subtype {x // p x}
can be injectively sent to into a subtype {x // q x}
,
if p x → q x
for all x : α
.
Equations
- Subtype.impEmbedding p q h = { toFun := fun (x : { x : α // p x }) => { val := ↑x, property := ⋯ }, inj' := ⋯ }