l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f := by
  induction U using Opposite.rec'
  induction V using Opposite.rec'
  let g := i.unop; have : i = g.op := rfl; clear_value g; subst this
  ext; constructor
  · rintro ⟨x, hx : IsUnit _, rfl⟩
    

Proof state:
case h.h.h.h.mp.intro.intro
X : RingedSpace
X✝¹ : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op X✝¹))
X✝ : Opens ↑↑X.toPresheafedSpace
g : (op X✝).unop ⟶ (op X✝¹).unop
x : ↥(op X✝).unop
hx : IsUnit ((germ X.presheaf x) ((X.presheaf.map g.op) f))
⊢ ↑x ∈ ↑((op X✝).unop ⊓ basicOpen X f)

Next tactic:
erw [X.presheaf.germ_res_apply _ _ _] at hx
@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f := by
  induction U using Opposite.rec'
  induction V using Opposite.rec'
  let g := i.unop; have : i = g.op := rfl; clear_value g; subst this
  ext; constructor
  · rintro ⟨x, hx : IsUnit _, rfl⟩
    erw [X.presheaf.germ_res_apply _ _ _] at hx
    

Proof state:
case h.h.h.h.mp.intro.intro
X : RingedSpace
X✝¹ : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op X✝¹))
X✝ : Opens ↑↑X.toPresheafedSpace
g : (op X✝).unop ⟶ (op X✝¹).unop
x : ↥(op X✝).unop
hx : IsUnit ((germ X.presheaf ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑(op X✝¹).unop) }) x)) f)
⊢ ↑x ∈ ↑((op X✝).unop ⊓ basicOpen X f)

Next tactic:
exact ⟨x.2, g x, hx, rfl⟩
@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f := by
  induction U using Opposite.rec'
  induction V using Opposite.rec'
  let g := i.unop; have : i = g.op := rfl; clear_value g; subst this
  ext; constructor
  · rintro ⟨x, hx : IsUnit _, rfl⟩
    erw [X.presheaf.germ_res_apply _ _ _] at hx
    exact ⟨x.2, g x, hx, rfl⟩
  · 

Proof state:
case h.h.h.h.mpr
X : RingedSpace
X✝¹ : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op X✝¹))
X✝ : Opens ↑↑X.toPresheafedSpace
g : (op X✝).unop ⟶ (op X✝¹).unop
x✝ : ↑↑X.toPresheafedSpace
⊢ x✝ ∈ ↑((op X✝).unop ⊓ basicOpen X f) → x✝ ∈ ↑(basicOpen X ((X.presheaf.map g.op) f))

Next tactic:
rintro ⟨hxV, x, hx, rfl⟩
@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f := by
  induction U using Opposite.rec'
  induction V using Opposite.rec'
  let g := i.unop; have : i = g.op := rfl; clear_value g; subst this
  ext; constructor
  · rintro ⟨x, hx : IsUnit _, rfl⟩
    erw [X.presheaf.germ_res_apply _ _ _] at hx
    exact ⟨x.2, g x, hx, rfl⟩
  · rintro ⟨hxV, x, hx, rfl⟩
    

Proof state:
case h.h.h.h.mpr.intro.intro.intro
X : RingedSpace
X✝¹ : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op X✝¹))
X✝ : Opens ↑↑X.toPresheafedSpace
g : (op X✝).unop ⟶ (op X✝¹).unop
x : ↥(op X✝¹).unop
hx : x ∈ {x | IsUnit ((germ X.presheaf x) f)}
hxV : ↑x ∈ ↑(op X✝).unop
⊢ ↑x ∈ ↑(basicOpen X ((X.presheaf.map g.op) f))

Next tactic:
refine' ⟨⟨x, hxV⟩, (_ : IsUnit _), rfl⟩
@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f := by
  induction U using Opposite.rec'
  induction V using Opposite.rec'
  let g := i.unop; have : i = g.op := rfl; clear_value g; subst this
  ext; constructor
  · rintro ⟨x, hx : IsUnit _, rfl⟩
    erw [X.presheaf.germ_res_apply _ _ _] at hx
    exact ⟨x.2, g x, hx, rfl⟩
  · rintro ⟨hxV, x, hx, rfl⟩
    refine' ⟨⟨x, hxV⟩, (_ : IsUnit _), rfl⟩
    

Proof state:
case h.h.h.h.mpr.intro.intro.intro
X : RingedSpace
X✝¹ : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op X✝¹))
X✝ : Opens ↑↑X.toPresheafedSpace
g : (op X✝).unop ⟶ (op X✝¹).unop
x : ↥(op X✝¹).unop
hx : x ∈ {x | IsUnit ((germ X.presheaf x) f)}
hxV : ↑x ∈ ↑(op X✝).unop
⊢ IsUnit ((germ X.presheaf { val := ↑x, property := hxV }) ((X.presheaf.map g.op) f))

Next tactic:
erw [X.presheaf.germ_res_apply _ _ _]
@[simp]
theorem basicOpen_res {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = unop V ⊓ @basicOpen X (unop U) f := by
  induction U using Opposite.rec'
  induction V using Opposite.rec'
  let g := i.unop; have : i = g.op := rfl; clear_value g; subst this
  ext; constructor
  · rintro ⟨x, hx : IsUnit _, rfl⟩
    erw [X.presheaf.germ_res_apply _ _ _] at hx
    exact ⟨x.2, g x, hx, rfl⟩
  · rintro ⟨hxV, x, hx, rfl⟩
    refine' ⟨⟨x, hxV⟩, (_ : IsUnit _), rfl⟩
    erw [X.presheaf.germ_res_apply _ _ _]
    

Proof state:
case h.h.h.h.mpr.intro.intro.intro
X : RingedSpace
X✝¹ : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op X✝¹))
X✝ : Opens ↑↑X.toPresheafedSpace
g : (op X✝).unop ⟶ (op X✝¹).unop
x : ↥(op X✝¹).unop
hx : x ∈ {x | IsUnit ((germ X.presheaf x) f)}
hxV : ↑x ∈ ↑(op X✝).unop
⊢ IsUnit
    ((germ X.presheaf ((fun x => { val := ↑x, property := (_ : ↑x ∈ ↑(op X✝¹).unop) }) { val := ↑x, property := hxV }))
      f)

Next tactic:
exact hx
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  

Proof state:
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
⊢ basicOpen X ((X.presheaf.map i) f) = basicOpen X f

Next tactic:
apply le_antisymm
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  apply le_antisymm
  · 

Proof state:
case a
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
⊢ basicOpen X ((X.presheaf.map i) f) ≤ basicOpen X f

Next tactic:
rw [X.basicOpen_res i f]
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  apply le_antisymm
  · rw [X.basicOpen_res i f]; 

Proof state:
case a
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
⊢ V.unop ⊓ basicOpen X f ≤ basicOpen X f

Next tactic:
exact inf_le_right
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  apply le_antisymm
  · rw [X.basicOpen_res i f]; exact inf_le_right
  · 

Proof state:
case a
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
⊢ basicOpen X f ≤ basicOpen X ((X.presheaf.map i) f)

Next tactic:
have := X.basicOpen_res (inv i) (X.presheaf.map i f)
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  apply le_antisymm
  · rw [X.basicOpen_res i f]; exact inf_le_right
  · have := X.basicOpen_res (inv i) (X.presheaf.map i f)
    

Proof state:
case a
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
this : basicOpen X ((X.presheaf.map (inv i)) ((X.presheaf.map i) f)) = U.unop ⊓ basicOpen X ((X.presheaf.map i) f)
⊢ basicOpen X f ≤ basicOpen X ((X.presheaf.map i) f)

Next tactic:
rw [← comp_apply, ← X.presheaf.map_comp, IsIso.hom_inv_id, X.presheaf.map_id, id_apply] at this
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  apply le_antisymm
  · rw [X.basicOpen_res i f]; exact inf_le_right
  · have := X.basicOpen_res (inv i) (X.presheaf.map i f)
    rw [← comp_apply, ← X.presheaf.map_comp, IsIso.hom_inv_id, X.presheaf.map_id, id_apply] at this
    

Proof state:
case a
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
this : basicOpen X f = U.unop ⊓ basicOpen X ((X.presheaf.map i) f)
⊢ basicOpen X f ≤ basicOpen X ((X.presheaf.map i) f)

Next tactic:
rw [this]
@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f := by
  apply le_antisymm
  · rw [X.basicOpen_res i f]; exact inf_le_right
  · have := X.basicOpen_res (inv i) (X.presheaf.map i f)
    rw [← comp_apply, ← X.presheaf.map_comp, IsIso.hom_inv_id, X.presheaf.map_id, id_apply] at this
    rw [this]
    

Proof state:
case a
X : RingedSpace
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
inst✝ : IsIso i
f : ↑(X.presheaf.obj U)
this : basicOpen X f = U.unop ⊓ basicOpen X ((X.presheaf.map i) f)
⊢ U.unop ⊓ basicOpen X ((X.presheaf.map i) f) ≤ basicOpen X ((X.presheaf.map i) f)

Next tactic:
exact inf_le_right
@[simp]
theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) :
    X.basicOpen (f * g) = X.basicOpen f ⊓ X.basicOpen g := by
  

Proof state:
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f g : ↑(X.presheaf.obj (op U))
⊢ basicOpen X (f * g) = basicOpen X f ⊓ basicOpen X g

Next tactic:
ext1
@[simp]
theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) :
    X.basicOpen (f * g) = X.basicOpen f ⊓ X.basicOpen g := by
  ext1
  

Proof state:
case h
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f g : ↑(X.presheaf.obj (op U))
⊢ ↑(basicOpen X (f * g)) = ↑(basicOpen X f ⊓ basicOpen X g)

Next tactic:
dsimp [RingedSpace.basicOpen]
@[simp]
theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) :
    X.basicOpen (f * g) = X.basicOpen f ⊓ X.basicOpen g := by
  ext1
  dsimp [RingedSpace.basicOpen]
  

Proof state:
case h
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f g : ↑(X.presheaf.obj (op U))
⊢ Subtype.val '' {x | IsUnit ((germ X.presheaf x) (f * g))} =
    Subtype.val '' {x | IsUnit ((germ X.presheaf x) f)} ∩ Subtype.val '' {x | IsUnit ((germ X.presheaf x) g)}

Next tactic:
rw [← Set.image_inter Subtype.coe_injective]
@[simp]
theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) :
    X.basicOpen (f * g) = X.basicOpen f ⊓ X.basicOpen g := by
  ext1
  dsimp [RingedSpace.basicOpen]
  rw [← Set.image_inter Subtype.coe_injective]
  

Proof state:
case h
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f g : ↑(X.presheaf.obj (op U))
⊢ Subtype.val '' {x | IsUnit ((germ X.presheaf x) (f * g))} =
    (fun a => ↑a) '' ({x | IsUnit ((germ X.presheaf x) f)} ∩ {x | IsUnit ((germ X.presheaf x) g)})

Next tactic:
congr
@[simp]
theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) :
    X.basicOpen (f * g) = X.basicOpen f ⊓ X.basicOpen g := by
  ext1
  dsimp [RingedSpace.basicOpen]
  rw [← Set.image_inter Subtype.coe_injective]
  congr
  

Proof state:
case h
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f g : ↑(X.presheaf.obj (op U))
⊢ Subtype.val '' {x | IsUnit ((germ X.presheaf x) (f * g))} =
    (fun a => ↑a) '' ({x | IsUnit ((germ X.presheaf x) f)} ∩ {x | IsUnit ((germ X.presheaf x) g)})

Next tactic:
ext x
@[simp]
theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) :
    X.basicOpen (f * g) = X.basicOpen f ⊓ X.basicOpen g := by
  ext1
  dsimp [RingedSpace.basicOpen]
  rw [← Set.image_inter Subtype.coe_injective]
  congr
  ext x
  

Proof state:
case h.h
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f g : ↑(X.presheaf.obj (op U))
x : ↑↑X.toPresheafedSpace
⊢ x ∈ Subtype.val '' {x | IsUnit ((germ X.presheaf x) (f * g))} ↔
    x ∈ (fun a => ↑a) '' ({x | IsUnit ((germ X.presheaf x) f)} ∩ {x | IsUnit ((germ X.presheaf x) g)})

Next tactic:
simp [map_mul, Set.mem_image]
theorem basicOpen_of_isUnit {U : Opens X} {f : X.presheaf.obj (op U)} (hf : IsUnit f) :
    X.basicOpen f = U := by
  

Proof state:
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op U))
hf : IsUnit f
⊢ basicOpen X f = U

Next tactic:
apply le_antisymm
theorem basicOpen_of_isUnit {U : Opens X} {f : X.presheaf.obj (op U)} (hf : IsUnit f) :
    X.basicOpen f = U := by
  apply le_antisymm
  · 

Proof state:
case a
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op U))
hf : IsUnit f
⊢ basicOpen X f ≤ U

Next tactic:
exact X.basicOpen_le f
theorem basicOpen_of_isUnit {U : Opens X} {f : X.presheaf.obj (op U)} (hf : IsUnit f) :
    X.basicOpen f = U := by
  apply le_antisymm
  · exact X.basicOpen_le f
  

Proof state:
case a
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op U))
hf : IsUnit f
⊢ U ≤ basicOpen X f

Next tactic:
intro x hx
theorem basicOpen_of_isUnit {U : Opens X} {f : X.presheaf.obj (op U)} (hf : IsUnit f) :
    X.basicOpen f = U := by
  apply le_antisymm
  · exact X.basicOpen_le f
  intro x hx
  

Proof state:
case a
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op U))
hf : IsUnit f
x : ↑↑X.toPresheafedSpace
hx : x ∈ ↑U
⊢ x ∈ ↑(basicOpen X f)

Next tactic:
erw [X.mem_basicOpen f (⟨x, hx⟩ : U)]
theorem basicOpen_of_isUnit {U : Opens X} {f : X.presheaf.obj (op U)} (hf : IsUnit f) :
    X.basicOpen f = U := by
  apply le_antisymm
  · exact X.basicOpen_le f
  intro x hx
  erw [X.mem_basicOpen f (⟨x, hx⟩ : U)]
  

Proof state:
case a
X : RingedSpace
U : Opens ↑↑X.toPresheafedSpace
f : ↑(X.presheaf.obj (op U))
hf : IsUnit f
x : ↑↑X.toPresheafedSpace
hx : x ∈ ↑U
⊢ IsUnit ((germ X.presheaf { val := x, property := hx }) f)

Next tactic:
exact RingHom.isUnit_map _ hf
set_option linter.deprecated false in
@[simp]
theorem zpow_bit1_neg (a : α) (n : ℤ) : (-a) ^ bit1 n = -a ^ bit1 n := by
  

Proof state:
α : Type u_1
inst✝ : DivisionRing α
n✝ : ℤ
a : α
n : ℤ
⊢ (-a) ^ bit1 n = -a ^ bit1 n

Next tactic:
rw [zpow_bit1', zpow_bit1', neg_mul_neg, neg_mul_eq_mul_neg]
theorem Odd.neg_zpow (h : Odd n) (a : α) : (-a) ^ n = -a ^ n := by
  

Proof state:
α : Type u_1
inst✝ : DivisionRing α
n : ℤ
h : Odd n
a : α
⊢ (-a) ^ n = -a ^ n

Next tactic:
obtain ⟨k, rfl⟩ := h.exists_bit1
theorem Odd.neg_zpow (h : Odd n) (a : α) : (-a) ^ n = -a ^ n := by
  obtain ⟨k, rfl⟩ := h.exists_bit1
  

Proof state:
case intro
α : Type u_1
inst✝ : DivisionRing α
a : α
k : ℤ
h : Odd (bit1 k)
⊢ (-a) ^ bit1 k = -a ^ bit1 k

Next tactic:
exact zpow_bit1_neg _ _
theorem Odd.neg_one_zpow (h : Odd n) : (-1 : α) ^ n = -1 := by 

Proof state:
α : Type u_1
inst✝ : DivisionRing α
n : ℤ
h : Odd n
⊢ (-1) ^ n = -1

Next tactic:
rw [h.neg_zpow, one_zpow]
/-- 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
-/
def removeNone_aux (x : α) : β :=
  if h : (e (some x)).isSome then Option.get _ h
  else
    Option.get _ <|
      show (e none).isSome by
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (e (some x)) = true
⊢ isSome (e none) = true

Next tactic:
rw [← Option.ne_none_iff_isSome]
/-- 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
-/
def removeNone_aux (x : α) : β :=
  if h : (e (some x)).isSome then Option.get _ h
  else
    Option.get _ <|
      show (e none).isSome by
        rw [← Option.ne_none_iff_isSome]
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (e (some x)) = true
⊢ e none ≠ none

Next tactic:
intro hn
/-- 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
-/
def removeNone_aux (x : α) : β :=
  if h : (e (some x)).isSome then Option.get _ h
  else
    Option.get _ <|
      show (e none).isSome by
        rw [← Option.ne_none_iff_isSome]
        intro hn
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : ¬isSome (e (some x)) = true
hn : e none = none
⊢ False

Next tactic:
rw [Option.not_isSome_iff_eq_none, ← hn] at h
/-- 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
-/
def removeNone_aux (x : α) : β :=
  if h : (e (some x)).isSome then Option.get _ h
  else
    Option.get _ <|
      show (e none).isSome by
        rw [← Option.ne_none_iff_isSome]
        intro hn
        rw [Option.not_isSome_iff_eq_none, ← hn] at h
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
h : e (some x) = e none
hn : e none = none
⊢ False

Next tactic:
exact Option.some_ne_none _ (e.injective h)
theorem removeNone_aux_some {x : α} (h : ∃ x', e (some x) = some x') :
    some (removeNone_aux e x) = e (some x) :=
  by 

Proof state:
α : 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)

Next tactic:
simp [removeNone_aux, Option.isSome_iff_exists.mpr h]
theorem removeNone_aux_none {x : α} (h : e (some x) = none) :
    some (removeNone_aux e x) = e none := by
  

Proof state:
α : 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

Next tactic:
simp [removeNone_aux, Option.not_isSome_iff_eq_none.mpr h]
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Option α ≃ Option β
x : α
⊢ some (removeNone_aux e.symm (removeNone_aux e x)) = some x

Next tactic:
cases h1 : e.symm (some (removeNone_aux e x))
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> 

Proof state:
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

Next tactic:
cases h2 : e (some x)
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> 

Proof state:
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

Next tactic:
cases h2 : e (some x)
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · 

Proof state:
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

Next tactic:
rw [removeNone_aux_none _ h1]
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        

Proof state:
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

Next tactic:
exact (e.eq_symm_apply.mpr h2).symm
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · 

Proof state:
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

Next tactic:
rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
        

Proof state:
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

Next tactic:
simp at h1
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
        simp at h1

      · 

Proof state:
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

Next tactic:
rw [removeNone_aux_none _ h2] at h1
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
        simp at h1

      · rw [removeNone_aux_none _ h2] at h1
        

Proof state:
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

Next tactic:
simp at h1
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
        simp at h1

      · rw [removeNone_aux_none _ h2] at h1
        simp at h1

      · 

Proof state:
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

Next tactic:
rw [removeNone_aux_some _ ⟨_, h1⟩]
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
        simp at h1

      · rw [removeNone_aux_none _ h2] at h1
        simp at h1

      · rw [removeNone_aux_some _ ⟨_, h1⟩]
        

Proof state:
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

Next tactic:
rw [removeNone_aux_some _ ⟨_, h2⟩]
theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
  Option.some_injective _
    (by
      cases h1 : e.symm (some (removeNone_aux e x)) <;> cases h2 : e (some x)
      · rw [removeNone_aux_none _ h1]
        exact (e.eq_symm_apply.mpr h2).symm

      · rw [removeNone_aux_some _ ⟨_, h2⟩] at h1
        simp at h1

      · rw [removeNone_aux_none _ h2] at h1
        simp at h1

      · rw [removeNone_aux_some _ ⟨_, h1⟩]
        rw [removeNone_aux_some _ ⟨_, h2⟩]
        

Proof state:
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

Next tactic:
simp