Injective functions #
- to_fun : α → β
- inj' : function.injective self.to_fun
α ↪ β is a bundled injective function.
Equations
Convert an α ≃ β to α ↪ β.
This is also available as a coercion equiv.coe_embedding.
The explicit equiv.to_embedding 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.to_embedding = 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.to_embedding := by simp
Equations
Equations
The identity map as a function.embedding.
Transfer an embedding along a pair of equivalences.
Equations
- function.embedding.congr e₁ e₂ f = e₁.symm.to_embedding.trans (f.trans e₂.to_embedding)
A right inverse surj_inv of a surjective function as an embedding.
Equations
- function.embedding.of_surjective f hf = {to_fun := function.surj_inv hf, inj' := _}
Convert a surjective embedding to an equiv
Equations
- f.equiv_of_surjective hf = equiv.of_bijective ⇑f _
There is always an embedding from an empty type. -
Equations
- function.embedding.of_is_empty = {to_fun := is_empty_elim (λ (a : α), β), inj' := _}
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.
Embedding into option α using coe. Usually the correct synctatical form for simp.
Equations
- function.embedding.coe_option = {to_fun := coe coe_to_lift, inj' := _}
Embedding into with_top α.
Equations
- function.embedding.coe_with_top = {to_fun := coe coe_to_lift, inj' := _}
Embedding of a subtype.
Equations
- function.embedding.subtype p = {to_fun := coe coe_to_lift, inj' := _}
Fixing an element b : β gives an embedding α ↪ α × β.
Equations
- function.embedding.sectl α b = {to_fun := λ (a : α), (a, b), inj' := _}
Fixing an element a : α gives an embedding β ↪ α × β.
Equations
- function.embedding.sectr a β = {to_fun := λ (b : β), (a, b), inj' := _}
If e₁ and e₂ are embeddings, then so is λ ⟨a, b⟩, ⟨e₁ a, e₂ b⟩ : pprod α γ → pprod β δ.
The embedding of α into the sum α ⊕ β.
The embedding of β into the sum α ⊕ β.
sigma.mk as an function.embedding.
If f : α ↪ α' is an embedding and g : Π a, β α ↪ β' (f α) is a family
of embeddings, then sigma.map f g is an embedding.
Define an embedding (Π a : α, β a) ↪ (Π a : α, γ a) from a family of embeddings
e : Π a, (β a ↪ γ a). This embedding sends f to λ a, e a (f a).
An embedding e : α ↪ β defines an embedding (γ → α) ↪ (γ → β) that sends each f
to e ∘ f.
Equations
- e.arrow_congr_right = function.embedding.Pi_congr_right (λ (_x : γ), e)
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
- e.arrow_congr_left = {to_fun := λ (f : α → γ), function.extend ⇑e f (λ (_x : β), default γ), inj' := _}
Restrict both domain and codomain of an embedding.
Equations
- f.subtype_map h = {to_fun := subtype.map ⇑f h, inj' := _}
The type of embeddings α ↪ β is equivalent to
the subtype of all injective functions α → β.
If α₁ ≃ α₂ and β₁ ≃ β₂, then the type of embeddings α₁ ↪ β₁
is equivalent to the type of embeddings α₂ ↪ β₂.
Equations
- h.embedding_congr h' = {to_fun := λ (f : α ↪ γ), function.embedding.congr h h' f, inv_fun := λ (f : β ↪ δ), function.embedding.congr h.symm h'.symm f, left_inv := _, right_inv := _}
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.
A subtype {x // p x ∨ q x} over a disjunction of p q : α → Prop is equivalent to a sum of
subtypes {x // p x} ⊕ {x // q x} such that ¬ p x is sent to the right, when
disjoint p q.
See also equiv.sum_compl, for when is_compl p q.
Equations
- subtype_or_equiv p q h = {to_fun := ⇑(subtype_or_left_embedding p q), inv_fun := sum.elim ⇑(subtype.imp_embedding (λ (x : α), p x) (λ (x : α), p x ∨ q x) _) ⇑(subtype.imp_embedding (λ (x : α), q x) (λ (x : α), p x ∨ q x) _), left_inv := _, right_inv := _}