Injective functions #
- toFun : α → β
An embedding as a function. Use coercion instead.
- inj' : Function.Injective s.toFun
An embedding is an injective function. Use
Function.Embedding.injective
instead.
α ↪ β
is a bundled injective function.
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
- Function.instEmbeddingLikeEmbedding = EmbeddingLike.mk (_ : ∀ (self : α ↪ β), Function.Injective self.toFun)
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' := (_ : Function.Injective ↑f) }
Instances For
Equations
- Equiv.Perm.coeEmbedding = Equiv.coeEmbedding
The identity map as a Function.Embedding
.
Equations
- Function.Embedding.refl α = { toFun := id, inj' := (_ : Function.Injective id) }
Instances For
Composition of f : α ↪ β
and g : β ↪ γ
.
Equations
- Function.Embedding.trans f g = { toFun := ↑g ∘ ↑f, inj' := (_ : Function.Injective (↑g ∘ ↑f)) }
Instances For
Equations
- Function.Embedding.instTransSortSortSortEmbeddingEmbeddingEmbedding = { trans := fun {a} {b} {c} => 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' := (_ : Function.Injective (Function.surjInv hf)) }
Instances For
Convert a surjective Embedding
to an Equiv
Equations
- Function.Embedding.equivOfSurjective f hf = Equiv.ofBijective ↑f (_ : Function.Injective ↑f ∧ Function.Surjective ↑f)
Instances For
There is always an embedding from an empty type.
Equations
- Function.Embedding.ofIsEmpty = { toFun := fun a => isEmptyElim a, inj' := (_ : ∀ (a : α) ⦃a₂ : α⦄, (fun a => isEmptyElim a) a = (fun a => isEmptyElim a) a₂ → a = a₂) }
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
- One or more equations did not get rendered due to their size.
Instances For
Embedding into Option α
using some
.
Equations
- Function.Embedding.some = { toFun := some, inj' := (_ : Function.Injective some) }
Instances For
A version of Option.map
for Function.Embedding
s.
Equations
- Function.Embedding.optionMap f = { toFun := Option.map ↑f, inj' := (_ : Function.Injective (Option.map ↑f)) }
Instances For
Quotient.out
as an embedding.
Equations
- Function.Embedding.quotientOut α = { toFun := Quotient.out, inj' := (_ : Function.Injective Quotient.out) }
Instances For
Choosing an element b : β
gives an embedding of PUnit
into β
.
Equations
- Function.Embedding.punit b = { toFun := fun x => b, inj' := (_ : ∀ ⦃a₁ a₂ : PUnit.{u_2}⦄, (fun x => b) a₁ = (fun x => b) a₂ → a₁ = a₂) }
Instances For
If e₁
and e₂
are embeddings, then so is prod.map e₁ e₂ : (a, b) ↦ (e₁ a, e₂ b)
.
Equations
- Function.Embedding.prodMap e₁ e₂ = { toFun := Prod.map ↑e₁ ↑e₂, inj' := (_ : Function.Injective (Prod.map ↑e₁ ↑e₂)) }
Instances For
If e₁
and e₂
are embeddings, then so is λ ⟨a, b⟩, ⟨e₁ a, e₂ b⟩ : PProd α γ → PProd β δ
.
Equations
- Function.Embedding.pprodMap e₁ e₂ = { toFun := fun x => { fst := ↑e₁ x.fst, snd := ↑e₂ x.snd }, inj' := (_ : Function.Injective fun x => { fst := ↑e₁ x.fst, snd := ↑e₂ x.snd }) }
Instances For
If e₁
and e₂
are embeddings, then so is Sum.map e₁ e₂
.
Equations
- Function.Embedding.sumMap e₁ e₂ = { toFun := Sum.map ↑e₁ ↑e₂, inj' := (_ : Function.Injective (Sum.map ↑e₁ ↑e₂)) }
Instances For
Sigma.mk
as a Function.Embedding
.
Equations
- Function.Embedding.sigmaMk a = { toFun := Sigma.mk a, inj' := (_ : Function.Injective (Sigma.mk a)) }
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' := (_ : Function.Injective (Sigma.map ↑f fun a => ↑(g a))) }
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 => ↑(e a) (f a), inj' := (_ : ∀ (x x_1 : (a : α) → β a), (fun f a => ↑(e a) (f a)) x = (fun f a => ↑(e a) (f a)) x_1 → x = x_1) }
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
- One or more equations did not get rendered due to their size.
Instances For
Restrict both domain and codomain of an embedding.
Equations
- Function.Embedding.subtypeMap f h = { toFun := Subtype.map (↑f) h, inj' := (_ : Function.Injective (Subtype.map (fun a => ↑f a) h)) }
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
- One or more equations did not get rendered due to their size.