Equivalences for Option α #
We define
Equiv.optionCongr: theOption α ≃ Option βconstructed frome : α ≃ βby sendingnonetonone, and applyingeelsewhere.Equiv.removeNone: theα ≃ βconstructed fromOption α ≃ Option βby removingnonefrom both sides.
@[simp]
theorem
Equiv.optionCongr_apply
{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
:
∀ (a : Option α), ↑(Equiv.optionCongr e) a = Option.map (↑e) a
A universe-polymorphic version of EquivFunctor.mapEquiv Option e.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
Equiv.optionCongr_refl
{α : Type u_1}
:
Equiv.optionCongr (Equiv.refl α) = Equiv.refl (Option α)
@[simp]
theorem
Equiv.optionCongr_symm
{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
:
(Equiv.optionCongr e).symm = Equiv.optionCongr e.symm
@[simp]
theorem
Equiv.optionCongr_trans
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e₁ : α ≃ β)
(e₂ : β ≃ γ)
:
(Equiv.optionCongr e₁).trans (Equiv.optionCongr e₂) = Equiv.optionCongr (e₁.trans e₂)
When α and β are in the same universe, this is the same as the result of
EquivFunctor.mapEquiv.
If we have a value on one side of an Equiv of Option
we also have a value on the other side of the equivalence
Equations
- Equiv.removeNone_aux e x = if h : Option.isSome (↑e (some x)) = true then Option.get (↑e (some x)) h else Option.get (↑e none) (_ : Option.isSome (↑e none) = true)
Instances For
theorem
Equiv.removeNone_aux_inv
{α : Type u_1}
{β : Type u_2}
(e : Option α ≃ Option β)
(x : α)
:
Equiv.removeNone_aux e.symm (Equiv.removeNone_aux e x) = x
@[simp]
theorem
Equiv.removeNone_symm
{α : Type u_1}
{β : Type u_2}
(e : Option α ≃ Option β)
:
(Equiv.removeNone e).symm = Equiv.removeNone e.symm
@[simp]
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 // ↑e none = x })
(a : α)
(h : ↑↑e (some a) ≠ x)
:
↑(↑(Equiv.optionSubtype x) e) a = { val := ↑↑e (some a), property := h }
@[simp]
theorem
Equiv.coe_optionSubtype_apply_apply
{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e // ↑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 // ↑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)