Equivalences for Option α
#
We define
Equiv.optionCongr
: theOption α ≃ Option β
constructed frome : α ≃ β
by sendingnone
tonone
, and applyinge
elsewhere.Equiv.removeNone
: theα ≃ β
constructed fromOption α ≃ Option β
by removingnone
from both sides.
A universe-polymorphic version of EquivFunctor.mapEquiv Option e
.
Equations
- e.optionCongr = { toFun := Option.map ⇑e, invFun := Option.map ⇑e.symm, left_inv := ⋯, right_inv := ⋯ }
Instances For
@[simp]
theorem
Equiv.optionCongr_apply
{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(a✝ : Option α)
:
e.optionCongr a✝ = Option.map (⇑e) a✝
@[simp]
theorem
Equiv.optionCongr_eq_equivFunctor_mapEquiv
{α β : Type u}
(e : α ≃ β)
:
e.optionCongr = EquivFunctor.mapEquiv Option e
When α
and β
are in the same universe, this is the same as the result of
EquivFunctor.mapEquiv
.
theorem
Equiv.optionCongr_injective
{α : Type u_1}
{β : Type u_2}
:
Function.Injective Equiv.optionCongr
Equivalences between Option α
and β
that send none
to x
are equivalent to
equivalences between α
and {y : β // y ≠ x}
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
Equiv.optionSubtype_apply_apply
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e : Option α ≃ β // e none = x })
(a : α)
(h : ↑e (some a) ≠ x)
:
((Equiv.optionSubtype x) e) a = ⟨↑e (some a), h⟩
@[simp]
theorem
Equiv.coe_optionSubtype_apply_apply
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e : Option α ≃ β // e none = x })
(a : α)
:
↑(((Equiv.optionSubtype x) e) a) = ↑e (some a)
@[simp]
theorem
Equiv.optionSubtype_apply_symm_apply
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e : Option α ≃ β // e none = x })
(b : { y : β // y ≠ x })
:
some (((Equiv.optionSubtype x) e).symm b) = (↑e).symm ↑b
@[simp]
theorem
Equiv.optionSubtype_symm_apply_apply_coe
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : α ≃ { y : β // y ≠ x })
(a : α)
:
↑((Equiv.optionSubtype x).symm e) (some a) = ↑(e a)
@[simp]
theorem
Equiv.optionSubtype_symm_apply_apply_some
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : α ≃ { y : β // y ≠ x })
(a : α)
:
↑((Equiv.optionSubtype x).symm e) (some a) = ↑(e a)
@[simp]
theorem
Equiv.optionSubtype_symm_apply_apply_none
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : α ≃ { y : β // y ≠ x })
:
↑((Equiv.optionSubtype x).symm e) none = x
@[simp]
theorem
Equiv.optionSubtype_symm_apply_symm_apply
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : α ≃ { y : β // y ≠ x })
(b : { y : β // y ≠ x })
:
(↑((Equiv.optionSubtype x).symm e)).symm ↑b = some (e.symm b)
Any type with a distinguished element is equivalent to an Option
type on the subtype excluding
that element.
Equations
- Equiv.optionSubtypeNe a = ↑((Equiv.optionSubtype a).symm (Equiv.refl { y : α // y ≠ a }))
Instances For
@[simp]
theorem
Equiv.optionSubtypeNe_symm_apply
{α : Type u_1}
[DecidableEq α]
(a b : α)
:
(Equiv.optionSubtypeNe a).symm b = if h : b = a then none else some ⟨b, h⟩
@[simp]
theorem
Equiv.optionSubtypeNe_apply
{α : Type u_1}
[DecidableEq α]
(a : α)
(a✝ : Option { y : α // y ≠ a })
:
(Equiv.optionSubtypeNe a) a✝ = a✝.casesOn' a Subtype.val
theorem
Equiv.optionSubtypeNe_symm_self
{α : Type u_1}
[DecidableEq α]
(a : α)
:
(Equiv.optionSubtypeNe a).symm a = none
theorem
Equiv.optionSubtypeNe_symm_of_ne
{α : Type u_1}
[DecidableEq α]
{a b : α}
(hba : b ≠ a)
:
(Equiv.optionSubtypeNe a).symm b = some ⟨b, hba⟩
@[simp]
theorem
Equiv.optionSubtypeNe_none
{α : Type u_1}
[DecidableEq α]
(a : α)
:
(Equiv.optionSubtypeNe a) none = a
@[simp]
theorem
Equiv.optionSubtypeNe_some
{α : Type u_1}
[DecidableEq α]
(a : α)
(b : { b : α // b ≠ a })
:
(Equiv.optionSubtypeNe a) (some b) = ↑b