[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (↑e (some x)) = true
⊢ isSome (↑e none) = true
[PROOFSTEP]
rw [← Option.ne_none_iff_isSome]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (↑e (some x)) = true
⊢ ↑e none ≠ none
[PROOFSTEP]
intro hn
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (↑e (some x)) = true
hn : ↑e none = none
⊢ False
[PROOFSTEP]
rw [Option.not_isSome_iff_eq_none, ← hn] at h 
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = ↑e none
hn : ↑e none = none
⊢ False
[PROOFSTEP]
exact
  Option.some_ne_none _
    (e.injective h)
      -- Porting note: private
      -- #align equiv.remove_none_aux Equiv.removeNone_aux
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ∃ x', ↑e (some x) = some x'
⊢ some (removeNone_aux e x) = ↑e (some x)
[PROOFSTEP]
simp [removeNone_aux, Option.isSome_iff_exists.mpr h]
  -- Porting note: private
  -- #align equiv.remove_none_aux_some Equiv.removeNone_aux_some
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = none
⊢ some (removeNone_aux e x) = ↑e none
[PROOFSTEP]
simp [removeNone_aux, Option.not_isSome_iff_eq_none.mpr h]
  -- Porting note: private
  -- #align equiv.remove_none_aux_none Equiv.removeNone_aux_none
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
cases h1 : e.symm (some (removeNone_aux e x))
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
cases h2 : e (some x)
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
cases h2 : e (some x)
[GOAL]
case none.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
h2 : ↑e (some x) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_none _ h1]
[GOAL]
case none.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
h2 : ↑e (some x) = none
⊢ ↑e.symm none = some x
[PROOFSTEP]
exact (e.eq_symm_apply.mpr h2).symm
[GOAL]
case none.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (some (removeNone_aux e x)) = none
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_some _ ⟨_, h2⟩] at h1 
[GOAL]
case none.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h1 : ↑e.symm (↑e (some x)) = none
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
simp at h1 
[GOAL]
case some.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝
h2 : ↑e (some x) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_none _ h2] at h1 
[GOAL]
case some.none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝ : α
h1 : ↑e.symm (↑e none) = some val✝
h2 : ↑e (some x) = none
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
simp at h1 
[GOAL]
case some.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝¹ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝¹
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_some _ ⟨_, h1⟩]
[GOAL]
case some.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝¹ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝¹
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ ↑e.symm (some (removeNone_aux e x)) = some x
[PROOFSTEP]
rw [removeNone_aux_some _ ⟨_, h2⟩]
[GOAL]
case some.some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x val✝¹ : α
h1 : ↑e.symm (some (removeNone_aux e x)) = some val✝¹
val✝ : β
h2 : ↑e (some x) = some val✝
⊢ ↑e.symm (↑e (some x)) = some x
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
h : ↑e.symm none = none
⊢ ↑e none = none
[PROOFSTEP]
simpa using (congr_arg e h).symm
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
h : ↑e none = none
⊢ ↑e.symm none = none
[PROOFSTEP]
simpa using (congr_arg e.symm h).symm
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
⊢ some (↑(removeNone e) x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
cases' h : e (some x) with a
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = none
⊢ some (↑(removeNone e) x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
rw [removeNone_none _ h]
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ↑e (some x) = none
⊢ ↑e none = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
simpa using (congr_arg e.symm h).symm
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
⊢ some (↑(removeNone e) x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
rw [removeNone_some _ ⟨a, h⟩]
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
⊢ ↑e (some x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
have h1 := congr_arg e.symm h
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
h1 : ↑e.symm (↑e (some x)) = ↑e.symm (some a)
⊢ ↑e (some x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
rw [symm_apply_apply] at h1 
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
h1 : some x = ↑e.symm (some a)
⊢ ↑e (some x) = ↑e none ↔ ↑e.symm none = some x
[PROOFSTEP]
simp only [false_iff_iff, apply_eq_iff_eq]
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
a : β
h : ↑e (some x) = some a
h1 : some x = ↑e.symm (some a)
⊢ ¬↑e.symm none = some x
[PROOFSTEP]
simp [h1, apply_eq_iff_eq]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
e✝ : Option α ≃ Option β
e : α ≃ β
x : α
⊢ ↑(optionCongr e) (some x) = some (↑e x)
[PROOFSTEP]
simp [EquivFunctor.map]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
a : α
⊢ (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
      ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
    a
[PROOFSTEP]
rw [← some_inj, some_get]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
a : α
⊢ ↑(↑e).symm ↑((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) = some a
[PROOFSTEP]
exact symm_apply_apply (e : Option α ≃ β) a
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
      ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
    b
[PROOFSTEP]
ext
[GOAL]
case a
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ ↑((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
        ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b)) =
    ↑b
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : Option α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
    a
[PROOFSTEP]
cases a with
| none => simp
| some a =>
  simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
  exact if_neg (e a).property
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : Option α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
    a
[PROOFSTEP]
cases a with
| none => simp
| some a =>
  simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
  exact if_neg (e a).property
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) none) =
    none
[PROOFSTEP]

| none => simp
[GOAL]
case none
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) none) =
    none
[PROOFSTEP]
simp
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) (some a)) =
    some a
[PROOFSTEP]

| some a =>
  simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
  exact if_neg (e a).property
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) (some a)) =
    some a
[PROOFSTEP]
simp only [casesOn'_some, Function.comp_apply, Subtype.coe_eta, symm_apply_apply, dite_eq_ite]
[GOAL]
case some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ (if ↑(↑e a) = x then none else some a) = some a
[PROOFSTEP]
exact if_neg (e a).property
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : β
⊢ (fun a => casesOn' a x (Subtype.val ∘ ↑e))
      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
    b
[PROOFSTEP]
by_cases h : b = x
[GOAL]
case pos
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : β
h : b = x
⊢ (fun a => casesOn' a x (Subtype.val ∘ ↑e))
      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
    b
[PROOFSTEP]
simp [h]
[GOAL]
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : β
h : ¬b = x
⊢ (fun a => casesOn' a x (Subtype.val ∘ ↑e))
      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
    b
[PROOFSTEP]
simp [h]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
⊢ (fun e =>
        {
          val :=
            { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
              invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
              left_inv :=
                (_ :
                  ∀ (a : Option α),
                    (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                      a),
              right_inv :=
                (_ :
                  ∀ (b : β),
                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                        ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                      b) },
          property :=
            (_ :
              ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                      invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                      left_inv :=
                        (_ :
                          ∀ (a : Option α),
                            (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : β),
                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                              b) }
                  none =
                ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                      invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                      left_inv :=
                        (_ :
                          ∀ (a : Option α),
                            (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : β),
                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                              b) }
                  none) })
      ((fun e =>
          { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
            invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
            left_inv :=
              (_ :
                ∀ (a : α),
                  (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                      ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                    a),
            right_inv :=
              (_ :
                ∀ (b : { y // y ≠ x }),
                  (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                      ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                    b) })
        e) =
    e
[PROOFSTEP]
ext a
[GOAL]
case a.H
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
a : Option α
⊢ ↑↑((fun e =>
              {
                val :=
                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                    invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                    left_inv :=
                      (_ :
                        ∀ (a : Option α),
                          (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (b : β),
                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                              ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                            b) },
                property :=
                  (_ :
                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none =
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none) })
            ((fun e =>
                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                  left_inv :=
                    (_ :
                      ∀ (a : α),
                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                          a),
                  right_inv :=
                    (_ :
                      ∀ (b : { y // y ≠ x }),
                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                          b) })
              e))
      a =
    ↑↑e a
[PROOFSTEP]
cases a
[GOAL]
case a.H.none
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
⊢ ↑↑((fun e =>
              {
                val :=
                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                    invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                    left_inv :=
                      (_ :
                        ∀ (a : Option α),
                          (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (b : β),
                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                              ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                            b) },
                property :=
                  (_ :
                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none =
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none) })
            ((fun e =>
                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                  left_inv :=
                    (_ :
                      ∀ (a : α),
                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                          a),
                  right_inv :=
                    (_ :
                      ∀ (b : { y // y ≠ x }),
                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                          b) })
              e))
      none =
    ↑↑e none
[PROOFSTEP]
simpa using e.property.symm
[GOAL]
case a.H.some
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
val✝ : α
⊢ ↑↑((fun e =>
              {
                val :=
                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                    invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                    left_inv :=
                      (_ :
                        ∀ (a : Option α),
                          (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (b : β),
                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                              ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                            b) },
                property :=
                  (_ :
                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none =
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                            invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                            left_inv :=
                              (_ :
                                ∀ (a : Option α),
                                  (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                    a),
                            right_inv :=
                              (_ :
                                ∀ (b : β),
                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                      ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        b) =
                                    b) }
                        none) })
            ((fun e =>
                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                  left_inv :=
                    (_ :
                      ∀ (a : α),
                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                          a),
                  right_inv :=
                    (_ :
                      ∀ (b : { y // y ≠ x }),
                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                          b) })
              e))
      (some val✝) =
    ↑↑e (some val✝)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
⊢ (fun e =>
        { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
          invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
          left_inv :=
            (_ :
              ∀ (a : α),
                (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                    ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                  a),
          right_inv :=
            (_ :
              ∀ (b : { y // y ≠ x }),
                (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                    ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                  b) })
      ((fun e =>
          {
            val :=
              { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                left_inv :=
                  (_ :
                    ∀ (a : Option α),
                      (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                          ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                        a),
                right_inv :=
                  (_ :
                    ∀ (b : β),
                      (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                          ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                        b) },
            property :=
              (_ :
                ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                        invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                        left_inv :=
                          (_ :
                            ∀ (a : Option α),
                              (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                  ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                a),
                        right_inv :=
                          (_ :
                            ∀ (b : β),
                              (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                  ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                    b) =
                                b) }
                    none =
                  ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                        invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                        left_inv :=
                          (_ :
                            ∀ (a : Option α),
                              (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                  ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                a),
                        right_inv :=
                          (_ :
                            ∀ (b : β),
                              (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                  ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                    b) =
                                b) }
                    none) })
        e) =
    e
[PROOFSTEP]
ext a
[GOAL]
case H.a
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
a : α
⊢ ↑(↑((fun e =>
              { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                left_inv :=
                  (_ :
                    ∀ (a : α),
                      (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                          ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                        a),
                right_inv :=
                  (_ :
                    ∀ (b : { y // y ≠ x }),
                      (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                          ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                        b) })
            ((fun e =>
                {
                  val :=
                    { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                      invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                      left_inv :=
                        (_ :
                          ∀ (a : Option α),
                            (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : β),
                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h })) b) =
                              b) },
                  property :=
                    (_ :
                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                              invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                              left_inv :=
                                (_ :
                                  ∀ (a : Option α),
                                    (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                      a),
                              right_inv :=
                                (_ :
                                  ∀ (b : β),
                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                        ((fun b =>
                                            if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                          b) =
                                      b) }
                          none =
                        ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                              invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                              left_inv :=
                                (_ :
                                  ∀ (a : Option α),
                                    (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                      a),
                              right_inv :=
                                (_ :
                                  ∀ (b : β),
                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                        ((fun b =>
                                            if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                          b) =
                                      b) }
                          none) })
              e))
        a) =
    ↑(↑e a)
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ some (↑(↑(optionSubtype x) e).symm b) = ↑(↑e).symm ↑b
[PROOFSTEP]
dsimp only [optionSubtype]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : { e // ↑e none = x }
b : { y // y ≠ x }
⊢ some
      (↑(↑{
                  toFun := fun e =>
                    { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                      invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                      left_inv :=
                        (_ :
                          ∀ (a : α),
                            (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                              a),
                      right_inv :=
                        (_ :
                          ∀ (b : { y // y ≠ x }),
                            (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                                ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true)) b) =
                              b) },
                  invFun := fun e =>
                    {
                      val :=
                        { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                          invFun := fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }),
                          left_inv :=
                            (_ :
                              ∀ (a : Option α),
                                (fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                    ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                  a),
                          right_inv :=
                            (_ :
                              ∀ (b : β),
                                (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                    ((fun b => if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                      b) =
                                  b) },
                      property :=
                        (_ :
                          ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                  invFun := fun b =>
                                    if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                  left_inv :=
                                    (_ :
                                      ∀ (a : Option α),
                                        (fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                            ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                          a),
                                  right_inv :=
                                    (_ :
                                      ∀ (b : β),
                                        (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                            ((fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                              b) =
                                          b) }
                              none =
                            ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                  invFun := fun b =>
                                    if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                  left_inv :=
                                    (_ :
                                      ∀ (a : Option α),
                                        (fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                            ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                          a),
                                  right_inv :=
                                    (_ :
                                      ∀ (b : β),
                                        (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                            ((fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                              b) =
                                          b) }
                              none) },
                  left_inv :=
                    (_ :
                      ∀ (e : { e // ↑e none = x }),
                        (fun e =>
                              {
                                val :=
                                  { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                    invFun := fun b =>
                                      if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                    left_inv :=
                                      (_ :
                                        ∀ (a : Option α),
                                          (fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }))
                                              ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                            a),
                                    right_inv :=
                                      (_ :
                                        ∀ (b : β),
                                          (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                              ((fun b =>
                                                  if h : b = x then none
                                                  else some (↑e.symm { val := b, property := h }))
                                                b) =
                                            b) },
                                property :=
                                  (_ :
                                    ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                            invFun := fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                            left_inv :=
                                              (_ :
                                                ∀ (a : Option α),
                                                  (fun b =>
                                                        if h : b = x then none
                                                        else some (↑e.symm { val := b, property := h }))
                                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                    a),
                                            right_inv :=
                                              (_ :
                                                ∀ (b : β),
                                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                      ((fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        b) =
                                                    b) }
                                        none =
                                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                            invFun := fun b =>
                                              if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                            left_inv :=
                                              (_ :
                                                ∀ (a : Option α),
                                                  (fun b =>
                                                        if h : b = x then none
                                                        else some (↑e.symm { val := b, property := h }))
                                                      ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                    a),
                                            right_inv :=
                                              (_ :
                                                ∀ (b : β),
                                                  (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                      ((fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        b) =
                                                    b) }
                                        none) })
                            ((fun e =>
                                { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                                  invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                                  left_inv :=
                                    (_ :
                                      ∀ (a : α),
                                        (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                            ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                                          a),
                                  right_inv :=
                                    (_ :
                                      ∀ (b : { y // y ≠ x }),
                                        (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                                            ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                              b) =
                                          b) })
                              e) =
                          e),
                  right_inv :=
                    (_ :
                      ∀ (e : α ≃ { y // y ≠ x }),
                        (fun e =>
                              { toFun := fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) },
                                invFun := fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true),
                                left_inv :=
                                  (_ :
                                    ∀ (a : α),
                                      (fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                          ((fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) }) a) =
                                        a),
                                right_inv :=
                                  (_ :
                                    ∀ (b : { y // y ≠ x }),
                                      (fun a => { val := ↑↑e (some a), property := (_ : ↑↑e (some a) ≠ x) })
                                          ((fun b => Option.get (↑(↑e).symm ↑b) (_ : isSome (↑(↑e).symm ↑b) = true))
                                            b) =
                                        b) })
                            ((fun e =>
                                {
                                  val :=
                                    { toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                      invFun := fun b =>
                                        if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                      left_inv :=
                                        (_ :
                                          ∀ (a : Option α),
                                            (fun b =>
                                                  if h : b = x then none
                                                  else some (↑e.symm { val := b, property := h }))
                                                ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                              a),
                                      right_inv :=
                                        (_ :
                                          ∀ (b : β),
                                            (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                ((fun b =>
                                                    if h : b = x then none
                                                    else some (↑e.symm { val := b, property := h }))
                                                  b) =
                                              b) },
                                  property :=
                                    (_ :
                                      ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                              invFun := fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                              left_inv :=
                                                (_ :
                                                  ∀ (a : Option α),
                                                    (fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                      a),
                                              right_inv :=
                                                (_ :
                                                  ∀ (b : β),
                                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                        ((fun b =>
                                                            if h : b = x then none
                                                            else some (↑e.symm { val := b, property := h }))
                                                          b) =
                                                      b) }
                                          none =
                                        ↑{ toFun := fun a => casesOn' a x (Subtype.val ∘ ↑e),
                                              invFun := fun b =>
                                                if h : b = x then none else some (↑e.symm { val := b, property := h }),
                                              left_inv :=
                                                (_ :
                                                  ∀ (a : Option α),
                                                    (fun b =>
                                                          if h : b = x then none
                                                          else some (↑e.symm { val := b, property := h }))
                                                        ((fun a => casesOn' a x (Subtype.val ∘ ↑e)) a) =
                                                      a),
                                              right_inv :=
                                                (_ :
                                                  ∀ (b : β),
                                                    (fun a => casesOn' a x (Subtype.val ∘ ↑e))
                                                        ((fun b =>
                                                            if h : b = x then none
                                                            else some (↑e.symm { val := b, property := h }))
                                                          b) =
                                                      b) }
                                          none) })
                              e) =
                          e) }
              e).symm
        b) =
    ↑(↑e).symm ↑b
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : { y // y ≠ x }
⊢ ↑(↑(↑(optionSubtype x).symm e)).symm ↑b = some (↑e.symm b)
[PROOFSTEP]
simp only [optionSubtype, coe_fn_symm_mk, Subtype.coe_mk, Subtype.coe_eta, dite_eq_ite, ite_eq_right_iff]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq β
x : β
e : α ≃ { y // y ≠ x }
b : { y // y ≠ x }
⊢ ↑b = x → False
[PROOFSTEP]
exact fun h => False.elim (b.property h)
