Module docstring
{"# Injective functions "}
{"# Injective functions "}
Function.Embedding
structure
(α : Sort*) (β : Sort*)
Function.term_↪_
definition
: Lean.TrailingParserDescr✝
Function.instFunLikeEmbedding
instance
{α : Sort u} {β : Sort v} : FunLike (α ↪ β) α β
instance {α : Sort u} {β : Sort v} : FunLike (α ↪ β) α β where
coe := Embedding.toFun
coe_injective' f g h := by { cases f; cases g; congr }
Function.instEmbeddingLikeEmbedding
instance
{α : Sort u} {β : Sort v} : EmbeddingLike (α ↪ β) α β
instance {α : Sort u} {β : Sort v} : EmbeddingLike (α ↪ β) α β where
injective' := Embedding.inj'
Function.instCanLiftForallEmbeddingCoeInjective
instance
{α β : Sort*} : CanLift (α → β) (α ↪ β) (↑) Injective
instance {α β : Sort*} : CanLift (α → β) (α ↪ β) (↑) Injective where prf f hf := ⟨⟨f, hf⟩, rfl⟩
Function.exists_surjective_iff
theorem
{α β : Sort*} : (∃ f : α → β, Surjective f) ↔ Nonempty (α → β) ∧ Nonempty (β ↪ α)
theorem exists_surjective_iff {α β : Sort*} :
(∃ f : α → β, Surjective f) ↔ Nonempty (α → β) ∧ Nonempty (β ↪ α) :=
⟨fun ⟨f, h⟩ ↦ ⟨⟨f⟩, ⟨⟨_, injective_surjInv h⟩⟩⟩, fun ⟨h, ⟨e⟩⟩ ↦ (nonempty_fun.mp h).elim
(fun _ ↦ ⟨isEmptyElim, (isEmptyElim <| e ·)⟩) fun _ ↦ ⟨_, invFun_surjective e.inj'⟩⟩
Function.instCanLiftForallEmbeddingCoeInjective_1
instance
{α β : Sort*} : CanLift (α → β) (α ↪ β) (↑) Injective
instance {α β : Sort*} : CanLift (α → β) (α ↪ β) (↑) Injective where
prf _ h := ⟨⟨_, h⟩, rfl⟩
Equiv.toEmbedding
definition
: α ↪ β
/-- 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:
```lean
-- 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
```
-/
protected def Equiv.toEmbedding : α ↪ β :=
⟨f, f.injective⟩
Equiv.coe_toEmbedding
theorem
: (f.toEmbedding : α → β) = f
@[simp]
theorem Equiv.coe_toEmbedding : (f.toEmbedding : α → β) = f :=
rfl
Equiv.toEmbedding_apply
theorem
(a : α) : f.toEmbedding a = f a
theorem Equiv.toEmbedding_apply (a : α) : f.toEmbedding a = f a :=
rfl
Equiv.toEmbedding_injective
theorem
: Function.Injective (Equiv.toEmbedding : (α ≃ β) → (α ↪ β))
theorem Equiv.toEmbedding_injective : Function.Injective (Equiv.toEmbedding : (α ≃ β) → (α ↪ β)) :=
fun _ _ h ↦ by rwa [DFunLike.ext'_iff] at h ⊢
Equiv.coeEmbedding
instance
: Coe (α ≃ β) (α ↪ β)
instance Equiv.coeEmbedding : Coe (α ≃ β) (α ↪ β) :=
⟨Equiv.toEmbedding⟩
Equiv.Perm.coeEmbedding
abbrev
: Coe (Equiv.Perm α) (α ↪ α)
@[instance] abbrev Equiv.Perm.coeEmbedding : Coe (Equiv.Perm α) (α ↪ α) :=
Equiv.coeEmbedding
Function.Embedding.coe_injective
theorem
{α β} : @Injective (α ↪ β) (α → β) (fun f ↦ ↑f)
theorem coe_injective {α β} : @Injective (α ↪ β) (α → β) (fun f ↦ ↑f) :=
DFunLike.coe_injective
Function.Embedding.ext
theorem
{α β} {f g : Embedding α β} (h : ∀ x, f x = g x) : f = g
@[ext]
theorem ext {α β} {f g : Embedding α β} (h : ∀ x, f x = g x) : f = g :=
DFunLike.ext f g h
Function.Embedding.instUniqueOfIsEmpty
instance
{α β : Sort*} [IsEmpty α] : Unique (α ↪ β)
instance {α β : Sort*} [IsEmpty α] : Unique (α ↪ β) where
default := ⟨isEmptyElim, Function.injective_of_subsingleton _⟩
uniq := by intro; ext v; exact isEmptyElim v
Function.Embedding.toFun_eq_coe
theorem
{α β} (f : α ↪ β) : toFun f = f
@[simp]
theorem toFun_eq_coe {α β} (f : α ↪ β) : toFun f = f :=
rfl
Function.Embedding.coeFn_mk
theorem
{α β} (f : α → β) (i) : (@mk _ _ f i : α → β) = f
Function.Embedding.mk_coe
theorem
{α β : Type*} (f : α ↪ β) (inj) : (⟨f, inj⟩ : α ↪ β) = f
Function.Embedding.injective
theorem
{α β} (f : α ↪ β) : Injective f
protected theorem injective {α β} (f : α ↪ β) : Injective f :=
EmbeddingLike.injective f
Function.Embedding.apply_eq_iff_eq
theorem
{α β} (f : α ↪ β) (x y : α) : f x = f y ↔ x = y
theorem apply_eq_iff_eq {α β} (f : α ↪ β) (x y : α) : f x = f y ↔ x = y :=
EmbeddingLike.apply_eq_iff_eq f
Function.Embedding.refl
definition
(α : Sort*) : α ↪ α
/-- The identity map as a `Function.Embedding`. -/
@[refl, simps +simpRhs]
protected def refl (α : Sort*) : α ↪ α :=
⟨id, injective_id⟩
Function.Embedding.trans
definition
{α β γ} (f : α ↪ β) (g : β ↪ γ) : α ↪ γ
Function.Embedding.instTrans
instance
: Trans Embedding Embedding Embedding
Function.Embedding.mk_id
theorem
{α} : mk id injective_id = .refl α
Function.Embedding.mk_trans_mk
theorem
{α β γ} (f : α → β) (g : β → γ) (hf hg) : (mk f hf).trans (mk g hg) = mk (g ∘ f) (hg.comp hf)
Function.Embedding.equiv_toEmbedding_trans_symm_toEmbedding
theorem
{α β : Sort*} (e : α ≃ β) : e.toEmbedding.trans e.symm.toEmbedding = Embedding.refl _
@[simp]
theorem equiv_toEmbedding_trans_symm_toEmbedding {α β : Sort*} (e : α ≃ β) :
e.toEmbedding.trans e.symm.toEmbedding = Embedding.refl _ := by
ext
simp
Function.Embedding.equiv_symm_toEmbedding_trans_toEmbedding
theorem
{α β : Sort*} (e : α ≃ β) : e.symm.toEmbedding.trans e.toEmbedding = Embedding.refl _
@[simp]
theorem equiv_symm_toEmbedding_trans_toEmbedding {α β : Sort*} (e : α ≃ β) :
e.symm.toEmbedding.trans e.toEmbedding = Embedding.refl _ := by
ext
simp
Function.Embedding.congr
definition
{α : Sort u} {β : Sort v} {γ : Sort w} {δ : Sort x} (e₁ : α ≃ β) (e₂ : γ ≃ δ) (f : α ↪ γ) : β ↪ δ
/-- Transfer an embedding along a pair of equivalences. -/
@[simps! -fullyApplied +simpRhs]
protected def congr {α : Sort u} {β : Sort v} {γ : Sort w} {δ : Sort x} (e₁ : α ≃ β) (e₂ : γ ≃ δ)
(f : α ↪ γ) : β ↪ δ :=
(Equiv.toEmbedding e₁.symm).trans (f.trans e₂.toEmbedding)
Function.Embedding.ofSurjective
definition
{α β} (f : β → α) (hf : Surjective f) : α ↪ β
/-- A right inverse `surjInv` of a surjective function as an `Embedding`. -/
protected noncomputable def ofSurjective {α β} (f : β → α) (hf : Surjective f) : α ↪ β :=
⟨surjInv hf, injective_surjInv _⟩
Function.Embedding.equivOfSurjective
definition
{α β} (f : α ↪ β) (hf : Surjective f) : α ≃ β
/-- Convert a surjective `Embedding` to an `Equiv` -/
protected noncomputable def equivOfSurjective {α β} (f : α ↪ β) (hf : Surjective f) : α ≃ β :=
Equiv.ofBijective f ⟨f.injective, hf⟩
Function.Embedding.ofIsEmpty
definition
{α β} [IsEmpty α] : α ↪ β
/-- There is always an embedding from an empty type. -/
protected def ofIsEmpty {α β} [IsEmpty α] : α ↪ β :=
⟨isEmptyElim, isEmptyElim⟩
Function.Embedding.setValue
definition
{α β : Sort*} (f : α ↪ β) (a : α) (b : β) [∀ a', Decidable (a' = a)] [∀ a', Decidable (f a' = b)] : α ↪ β
/-- 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. -/
def setValue {α β : Sort*} (f : α ↪ β) (a : α) (b : β) [∀ a', Decidable (a' = a)]
[∀ a', Decidable (f a' = b)] : α ↪ β :=
⟨fun a' => if a' = a then b else if f a' = b then f a else f a', by
intro x y (h : ite _ _ _ = ite _ _ _)
split_ifs at h <;> (try subst b) <;> (try simp only [f.injective.eq_iff] at *) <;> cc⟩
Function.Embedding.setValue_eq
theorem
{α β} (f : α ↪ β) (a : α) (b : β) [∀ a', Decidable (a' = a)] [∀ a', Decidable (f a' = b)] : setValue f a b a = b
Function.Embedding.setValue_eq_iff
theorem
{α β} (f : α ↪ β) {a a' : α} {b : β} [∀ a', Decidable (a' = a)] [∀ a', Decidable (f a' = b)] :
setValue f a b a' = b ↔ a' = a
@[simp]
theorem setValue_eq_iff {α β} (f : α ↪ β) {a a' : α} {b : β} [∀ a', Decidable (a' = a)]
[∀ a', Decidable (f a' = b)] : setValuesetValue f a b a' = b ↔ a' = a :=
(setValue f a b).injective.eq_iff' <| setValue_eq ..
Function.Embedding.setValue_eq_of_ne
theorem
{α β} {f : α ↪ β} {a : α} {b : β} {c : α} [∀ a', Decidable (a' = a)] [∀ a', Decidable (f a' = b)] (hc : c ≠ a)
(hb : f c ≠ b) : setValue f a b c = f c
Function.Embedding.setValue_right_apply_eq
theorem
{α β} (f : α ↪ β) (a c : α) [∀ a', Decidable (a' = a)] [∀ a', Decidable (f a' = f c)] : setValue f a (f c) c = f a
Function.Embedding.some
definition
{α} : α ↪ Option α
/-- Embedding into `Option α` using `some`. -/
@[simps -fullyApplied]
protected def some {α} : α ↪ Option α :=
⟨some, Option.some_injective α⟩
Function.Embedding.optionMap
definition
{α β} (f : α ↪ β) : Option α ↪ Option β
/-- A version of `Option.map` for `Function.Embedding`s. -/
@[simps -fullyApplied]
def optionMap {α β} (f : α ↪ β) : OptionOption α ↪ Option β :=
⟨Option.map f, Option.map_injective f.injective⟩
Function.Embedding.subtype
definition
{α} (p : α → Prop) : Subtype p ↪ α
/-- Embedding of a `Subtype`. -/
def subtype {α} (p : α → Prop) : SubtypeSubtype p ↪ α :=
⟨Subtype.val, fun _ _ => Subtype.ext⟩
Function.Embedding.subtype_apply
theorem
{α} {p : α → Prop} (x : Subtype p) : subtype p x = x
@[simp]
theorem subtype_apply {α} {p : α → Prop} (x : Subtype p) : subtype p x = x :=
rfl
Function.Embedding.subtype_injective
theorem
{α} (p : α → Prop) : Function.Injective (subtype p)
theorem subtype_injective {α} (p : α → Prop) : Function.Injective (subtype p) :=
Subtype.coe_injective
Function.Embedding.coe_subtype
theorem
{α} (p : α → Prop) : ↑(subtype p) = Subtype.val
@[simp]
theorem coe_subtype {α} (p : α → Prop) : ↑(subtype p) = Subtype.val :=
rfl
Function.Embedding.quotientOut
definition
(α) [s : Setoid α] : Quotient s ↪ α
/-- `Quotient.out` as an embedding. -/
noncomputable def quotientOut (α) [s : Setoid α] : QuotientQuotient s ↪ α :=
⟨_, Quotient.out_injective⟩
Function.Embedding.coe_quotientOut
theorem
(α) [Setoid α] : ↑(quotientOut α) = Quotient.out
@[simp]
theorem coe_quotientOut (α) [Setoid α] : ↑(quotientOut α) = Quotient.out :=
rfl
Function.Embedding.punit
definition
{β : Sort*} (b : β) : PUnit ↪ β
/-- Choosing an element `b : β` gives an embedding of `PUnit` into `β`. -/
def punit {β : Sort*} (b : β) : PUnitPUnit ↪ β :=
⟨fun _ => b, by
rintro ⟨⟩ ⟨⟩ _
rfl⟩
Function.Embedding.sectL
definition
(α : Sort _) {β : Sort _} (b : β) : α ↪ α × β
/-- Fixing an element `b : β` gives an embedding `α ↪ α × β`. -/
@[simps]
def sectL (α : Sort _) {β : Sort _} (b : β) : α ↪ α × β :=
⟨fun a => (a, b), fun _ _ h => congr_arg Prod.fst h⟩
Function.Embedding.sectR
definition
{α : Sort _} (a : α) (β : Sort _) : β ↪ α × β
/-- Fixing an element `a : α` gives an embedding `β ↪ α × β`. -/
@[simps]
def sectR {α : Sort _} (a : α) (β : Sort _) : β ↪ α × β :=
⟨fun b => (a, b), fun _ _ h => congr_arg Prod.snd h⟩
Function.Embedding.prodMap
definition
{α β γ δ : Type*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : α × γ ↪ β × δ
/-- If `e₁` and `e₂` are embeddings, then so is `Prod.map e₁ e₂ : (a, b) ↦ (e₁ a, e₂ b)`. -/
def prodMap {α β γ δ : Type*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : α × γα × γ ↪ β × δ :=
⟨Prod.map e₁ e₂, e₁.injective.prodMap e₂.injective⟩
Function.Embedding.coe_prodMap
theorem
{α β γ δ : Type*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : e₁.prodMap e₂ = Prod.map e₁ e₂
Function.Embedding.pprodMap
definition
{α β γ δ : Sort*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : PProd α γ ↪ PProd β δ
/-- If `e₁` and `e₂` are embeddings,
then so is `fun ⟨a, b⟩ ↦ ⟨e₁ a, e₂ b⟩ : PProd α γ → PProd β δ`. -/
def pprodMap {α β γ δ : Sort*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : PProdPProd α γ ↪ PProd β δ :=
⟨fun x => ⟨e₁ x.1, e₂ x.2⟩, e₁.injective.pprod_map e₂.injective⟩
Function.Embedding.sumMap
definition
{α β γ δ : Type*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : α ⊕ γ ↪ β ⊕ δ
/-- If `e₁` and `e₂` are embeddings, then so is `Sum.map e₁ e₂`. -/
def sumMap {α β γ δ : Type*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : α ⊕ γα ⊕ γ ↪ β ⊕ δ :=
⟨Sum.map e₁ e₂, e₁.injective.sumMap e₂.injective⟩
Function.Embedding.coe_sumMap
theorem
{α β γ δ} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : sumMap e₁ e₂ = Sum.map e₁ e₂
Function.Embedding.inl
definition
{α β : Type*} : α ↪ α ⊕ β
/-- The embedding of `α` into the sum `α ⊕ β`. -/
@[simps]
def inl {α β : Type*} : α ↪ α ⊕ β :=
⟨Sum.inl, fun _ _ => Sum.inl.inj⟩
Function.Embedding.inr
definition
{α β : Type*} : β ↪ α ⊕ β
/-- The embedding of `β` into the sum `α ⊕ β`. -/
@[simps]
def inr {α β : Type*} : β ↪ α ⊕ β :=
⟨Sum.inr, fun _ _ => Sum.inr.inj⟩
Function.Embedding.sigmaMk
definition
(a : α) : β a ↪ Σ x, β x
/-- `Sigma.mk` as a `Function.Embedding`. -/
@[simps apply]
def sigmaMk (a : α) : β a ↪ Σx, β x :=
⟨Sigma.mk a, sigma_mk_injective⟩
Function.Embedding.sigmaMap
definition
(f : α ↪ α') (g : ∀ a, β a ↪ β' (f a)) : (Σ a, β a) ↪ Σ a', β' a'
/-- If `f : α ↪ α'` is an embedding and `g : Π a, β α ↪ β' (f α)` is a family
of embeddings, then `Sigma.map f g` is an embedding. -/
@[simps apply]
def sigmaMap (f : α ↪ α') (g : ∀ a, β a ↪ β' (f a)) : (Σa, β a) ↪ Σa', β' a' :=
⟨Sigma.map f fun a => g a, f.injective.sigma_map fun a => (g a).injective⟩
Function.Embedding.piCongrRight
definition
{α : Sort*} {β γ : α → Sort*} (e : ∀ a, β a ↪ γ a) : (∀ a, β a) ↪ ∀ a, γ a
/-- 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)`. -/
@[simps]
def piCongrRight {α : Sort*} {β γ : α → Sort*} (e : ∀ a, β a ↪ γ a) : (∀ a, β a) ↪ ∀ a, γ a :=
⟨fun f a => e a (f a), fun _ _ h => funext fun a => (e a).injective (congr_fun h a)⟩
Function.Embedding.arrowCongrRight
definition
{α : Sort u} {β : Sort v} {γ : Sort w} (e : α ↪ β) : (γ → α) ↪ γ → β
/-- An embedding `e : α ↪ β` defines an embedding `(γ → α) ↪ (γ → β)` that sends each `f`
to `e ∘ f`. -/
def arrowCongrRight {α : Sort u} {β : Sort v} {γ : Sort w} (e : α ↪ β) : (γ → α) ↪ γ → β :=
piCongrRight fun _ => e
Function.Embedding.arrowCongrRight_apply
theorem
{α : Sort u} {β : Sort v} {γ : Sort w} (e : α ↪ β) (f : γ → α) : arrowCongrRight e f = e ∘ f
@[simp]
theorem arrowCongrRight_apply {α : Sort u} {β : Sort v} {γ : Sort w} (e : α ↪ β) (f : γ → α) :
arrowCongrRight e f = e ∘ f :=
rfl
Function.Embedding.arrowCongrLeft
definition
{α : Sort u} {β : Sort v} {γ : Sort w} [Inhabited γ] (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`. -/
noncomputable def arrowCongrLeft {α : Sort u} {β : Sort v} {γ : Sort w} [Inhabited γ] (e : α ↪ β) :
(α → γ) ↪ β → γ :=
⟨fun f => extend e f default, fun f₁ f₂ h =>
funext fun x => by simpa only [e.injective.extend_apply] using congr_fun h (e x)⟩
Function.Embedding.subtypeMap
definition
{α β} {p : α → Prop} {q : β → Prop} (f : α ↪ β) (h : ∀ ⦃x⦄, p x → q (f x)) : { x : α // p x } ↪ { y : β // q y }
/-- Restrict both domain and codomain of an embedding. -/
protected def subtypeMap {α β} {p : α → Prop} {q : β → Prop} (f : α ↪ β)
(h : ∀ ⦃x⦄, p x → q (f x)) :
{ x : α // p x }{ x : α // p x } ↪ { y : β // q y } :=
⟨Subtype.map f h, Subtype.map_injective h f.2⟩
Function.Embedding.swap_apply
theorem
{α β : Type*} [DecidableEq α] [DecidableEq β] (f : α ↪ β) (x y z : α) :
Equiv.swap (f x) (f y) (f z) = f (Equiv.swap x y z)
theorem swap_apply {α β : Type*} [DecidableEq α] [DecidableEq β] (f : α ↪ β) (x y z : α) :
Equiv.swap (f x) (f y) (f z) = f (Equiv.swap x y z) :=
f.injective.swap_apply x y z
Function.Embedding.swap_comp
theorem
{α β : Type*} [DecidableEq α] [DecidableEq β] (f : α ↪ β) (x y : α) : Equiv.swap (f x) (f y) ∘ f = f ∘ Equiv.swap x y
theorem swap_comp {α β : Type*} [DecidableEq α] [DecidableEq β] (f : α ↪ β) (x y : α) :
Equiv.swapEquiv.swap (f x) (f y) ∘ f = f ∘ Equiv.swap x y :=
f.injective.swap_comp x y
Equiv.asEmbedding
definition
{β α : Sort*} {p : β → Prop} (e : α ≃ Subtype p) : α ↪ β
/-- Given an equivalence to a subtype, produce an embedding to the elements of the corresponding
set. -/
@[simps!]
def asEmbedding {β α : Sort*} {p : β → Prop} (e : α ≃ Subtype p) : α ↪ β :=
e.toEmbedding.trans (subtype p)
Equiv.subtypeInjectiveEquivEmbedding
definition
(α β : Sort*) : { f : α → β // Injective f } ≃ (α ↪ β)
/-- The type of embeddings `α ↪ β` is equivalent to
the subtype of all injective functions `α → β`. -/
def subtypeInjectiveEquivEmbedding (α β : Sort*) :
{ f : α → β // Injective f }{ f : α → β // Injective f } ≃ (α ↪ β) where
toFun f := ⟨f.val, f.property⟩
invFun f := ⟨f, f.injective⟩
left_inv _ := rfl
right_inv _ := rfl
Equiv.embeddingCongr
definition
{α β γ δ : Sort*} (h : α ≃ β) (h' : γ ≃ δ) : (α ↪ γ) ≃ (β ↪ δ)
/-- If `α₁ ≃ α₂` and `β₁ ≃ β₂`, then the type of embeddings `α₁ ↪ β₁`
is equivalent to the type of embeddings `α₂ ↪ β₂`. -/
@[simps apply]
def embeddingCongr {α β γ δ : Sort*} (h : α ≃ β) (h' : γ ≃ δ) : (α ↪ γ) ≃ (β ↪ δ) where
toFun f := f.congr h h'
invFun f := f.congr h.symm h'.symm
left_inv x := by
ext
simp
right_inv x := by
ext
simp
Equiv.embeddingCongr_refl
theorem
{α β : Sort*} : embeddingCongr (Equiv.refl α) (Equiv.refl β) = Equiv.refl (α ↪ β)
@[simp]
theorem embeddingCongr_refl {α β : Sort*} :
embeddingCongr (Equiv.refl α) (Equiv.refl β) = Equiv.refl (α ↪ β) :=
rfl
Equiv.embeddingCongr_trans
theorem
{α₁ β₁ α₂ β₂ α₃ β₃ : Sort*} (e₁ : α₁ ≃ α₂) (e₁' : β₁ ≃ β₂) (e₂ : α₂ ≃ α₃) (e₂' : β₂ ≃ β₃) :
embeddingCongr (e₁.trans e₂) (e₁'.trans e₂') = (embeddingCongr e₁ e₁').trans (embeddingCongr e₂ e₂')
@[simp]
theorem embeddingCongr_trans {α₁ β₁ α₂ β₂ α₃ β₃ : Sort*} (e₁ : α₁ ≃ α₂) (e₁' : β₁ ≃ β₂)
(e₂ : α₂ ≃ α₃) (e₂' : β₂ ≃ β₃) :
embeddingCongr (e₁.trans e₂) (e₁'.trans e₂') =
(embeddingCongr e₁ e₁').trans (embeddingCongr e₂ e₂') :=
rfl
Equiv.embeddingCongr_symm
theorem
{α₁ β₁ α₂ β₂ : Sort*} (e₁ : α₁ ≃ α₂) (e₂ : β₁ ≃ β₂) : (embeddingCongr e₁ e₂).symm = embeddingCongr e₁.symm e₂.symm
@[simp]
theorem embeddingCongr_symm {α₁ β₁ α₂ β₂ : Sort*} (e₁ : α₁ ≃ α₂) (e₂ : β₁ ≃ β₂) :
(embeddingCongr e₁ e₂).symm = embeddingCongr e₁.symm e₂.symm :=
rfl
Equiv.embeddingCongr_apply_trans
theorem
{α₁ β₁ γ₁ α₂ β₂ γ₂ : Sort*} (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂) (ec : γ₁ ≃ γ₂) (f : α₁ ↪ β₁) (g : β₁ ↪ γ₁) :
Equiv.embeddingCongr ea ec (f.trans g) = (Equiv.embeddingCongr ea eb f).trans (Equiv.embeddingCongr eb ec g)
theorem embeddingCongr_apply_trans {α₁ β₁ γ₁ α₂ β₂ γ₂ : Sort*} (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂)
(ec : γ₁ ≃ γ₂) (f : α₁ ↪ β₁) (g : β₁ ↪ γ₁) :
Equiv.embeddingCongr ea ec (f.trans g) =
(Equiv.embeddingCongr ea eb f).trans (Equiv.embeddingCongr eb ec g) := by
ext
simp
Equiv.refl_toEmbedding
theorem
{α : Type*} : (Equiv.refl α).toEmbedding = Embedding.refl α
@[simp]
theorem refl_toEmbedding {α : Type*} : (Equiv.refl α).toEmbedding = Embedding.refl α :=
rfl
Equiv.trans_toEmbedding
theorem
{α β γ : Type*} (e : α ≃ β) (f : β ≃ γ) : (e.trans f).toEmbedding = e.toEmbedding.trans f.toEmbedding
@[simp]
theorem trans_toEmbedding {α β γ : Type*} (e : α ≃ β) (f : β ≃ γ) :
(e.trans f).toEmbedding = e.toEmbedding.trans f.toEmbedding :=
rfl
subtypeOrLeftEmbedding
definition
(p q : α → Prop) [DecidablePred p] : { x // p x ∨ q x } ↪ { x // p x } ⊕ { x // q x }
/-- 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. -/
def subtypeOrLeftEmbedding (p q : α → Prop) [DecidablePred p] :
{ x // p x ∨ q x }{ x // p x ∨ q x } ↪ { x // p x } ⊕ { x // q x } :=
⟨fun x => if h : p x then Sum.inl ⟨x, h⟩ else Sum.inr ⟨x, x.prop.resolve_left h⟩, by
intro x y
dsimp only
split_ifs <;> simp [Subtype.ext_iff]⟩
subtypeOrLeftEmbedding_apply_left
theorem
{p q : α → Prop} [DecidablePred p] (x : { x // p x ∨ q x }) (hx : p x) : subtypeOrLeftEmbedding p q x = Sum.inl ⟨x, hx⟩
theorem subtypeOrLeftEmbedding_apply_left {p q : α → Prop} [DecidablePred p]
(x : { x // p x ∨ q x }) (hx : p x) :
subtypeOrLeftEmbedding p q x = Sum.inl ⟨x, hx⟩ :=
dif_pos hx
subtypeOrLeftEmbedding_apply_right
theorem
{p q : α → Prop} [DecidablePred p] (x : { x // p x ∨ q x }) (hx : ¬p x) :
subtypeOrLeftEmbedding p q x = Sum.inr ⟨x, x.prop.resolve_left hx⟩
theorem subtypeOrLeftEmbedding_apply_right {p q : α → Prop} [DecidablePred p]
(x : { x // p x ∨ q x }) (hx : ¬p x) :
subtypeOrLeftEmbedding p q x = Sum.inr ⟨x, x.prop.resolve_left hx⟩ :=
dif_neg hx
Subtype.impEmbedding
definition
(p q : α → Prop) (h : ∀ x, p x → q x) : { x // p x } ↪ { x // q x }
/-- A subtype `{x // p x}` can be injectively sent to into a subtype `{x // q x}`,
if `p x → q x` for all `x : α`. -/
@[simps]
def Subtype.impEmbedding (p q : α → Prop) (h : ∀ x, p x → q x) : { x // p x }{ x // p x } ↪ { x // q x } :=
⟨fun x => ⟨x, h x x.prop⟩, fun x y => by simp [Subtype.ext_iff]⟩