l3lab/ntp-mathlib huggingface dataset:
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    

Proof state:
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g✝ : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
g : M →ₗ[R] Q
s : ↥S
q : Q
⊢ ∃! a, ↑s • a = q

Next tactic:
refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · 

Proof state:
case refine'_1
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g✝ : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
g : M →ₗ[R] Q
s : ↥S
q : Q
⊢ (fun a => ↑s • a = q) (IsLocalization.mk' A 1 s • q)

Next tactic:
simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · 

Proof state:
case refine'_2
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g✝ : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
g : M →ₗ[R] Q
s : ↥S
q : Q
⊢ ∀ (y : Q), (fun a => ↑s • a = q) y → y = IsLocalization.mk' A 1 s • q

Next tactic:
rintro q rfl
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · rintro q rfl
      

Proof state:
case refine'_2
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g✝ : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
g : M →ₗ[R] Q
s : ↥S
q : Q
⊢ q = IsLocalization.mk' A 1 s • ↑s • q

Next tactic:
simp only [smul_comm _ (s : R), ← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · rintro q rfl
      simp only [smul_comm _ (s : R), ← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
  

Proof state:
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g✝ : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
g : M →ₗ[R] Q
this : ∃! l, l ∘ₗ f = g
⊢ ∃! g', ↑R g' ∘ₗ f = g

Next tactic:
rcases this with ⟨ℓ, rfl, h₂⟩
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · rintro q rfl
      simp only [smul_comm _ (s : R), ← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
  rcases this with ⟨ℓ, rfl, h₂⟩
  

Proof state:
case intro.intro
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
ℓ : M' →ₗ[R] Q
h₂ : ∀ (y : M' →ₗ[R] Q), (fun l => l ∘ₗ f = ℓ ∘ₗ f) y → y = ℓ
⊢ ∃! g', ↑R g' ∘ₗ f = ℓ ∘ₗ f

Next tactic:
refine' ⟨ℓ.extendScalarsOfIsLocalization S A, by simp, fun g'' h ↦ _⟩
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · rintro q rfl
      simp only [smul_comm _ (s : R), ← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
  rcases this with ⟨ℓ, rfl, h₂⟩
  refine' ⟨ℓ.extendScalarsOfIsLocalization S A, by 

Proof state:
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
ℓ : M' →ₗ[R] Q
h₂ : ∀ (y : M' →ₗ[R] Q), (fun l => l ∘ₗ f = ℓ ∘ₗ f) y → y = ℓ
⊢ (fun g' => ↑R g' ∘ₗ f = ℓ ∘ₗ f) (LinearMap.extendScalarsOfIsLocalization S A ℓ)

Next tactic:
simp
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · rintro q rfl
      simp only [smul_comm _ (s : R), ← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
  rcases this with ⟨ℓ, rfl, h₂⟩
  refine' ⟨ℓ.extendScalarsOfIsLocalization S A, by simp, fun g'' h ↦ _⟩
  

Proof state:
case intro.intro
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
ℓ : M' →ₗ[R] Q
h₂ : ∀ (y : M' →ₗ[R] Q), (fun l => l ∘ₗ f = ℓ ∘ₗ f) y → y = ℓ
g'' : M' →ₗ[A] Q
h : (fun g' => ↑R g' ∘ₗ f = ℓ ∘ₗ f) g''
⊢ g'' = LinearMap.extendScalarsOfIsLocalization S A ℓ

Next tactic:
ext x
/-- If `(f : M →ₗ[R] M')` is a localization of modules, then the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isBaseChange : IsBaseChange A f := by
  refine' IsBaseChange.of_lift_unique _ (fun Q _ _ _ _ g ↦ _)
  have := IsLocalizedModule.is_universal S f g <| by
    intro s
    simp_rw [Module.End_isUnit_iff, Function.bijective_iff_existsUnique,
      Module.algebraMap_end_apply]
    intro q
    refine' ⟨(IsLocalization.mk' _ 1 s : A) • q, _, _⟩
    · simp only [← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
    · rintro q rfl
      simp only [smul_comm _ (s : R), ← smul_assoc, IsLocalization.smul_mk'_self, map_one, one_smul]
  rcases this with ⟨ℓ, rfl, h₂⟩
  refine' ⟨ℓ.extendScalarsOfIsLocalization S A, by simp, fun g'' h ↦ _⟩
  ext x
  

Proof state:
case intro.intro.h
R : Type u_1
inst✝¹² : CommRing R
S : Submonoid R
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid M'
inst✝⁹ : AddCommMonoid M''
inst✝⁸ : Module R M
inst✝⁷ : Module R M'
inst✝⁶ : Module R M''
f : M →ₗ[R] M'
g : M →ₗ[R] M''
inst✝⁵ : IsLocalizedModule S f
A : Type u_5
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : Module A M'
inst✝¹ : IsScalarTower R A M'
inst✝ : IsLocalization S A
Q : Type (max u_2 u_3 u_5)
x✝³ : AddCommMonoid Q
x✝² : Module R Q
x✝¹ : Module A Q
x✝ : IsScalarTower R A Q
ℓ : M' →ₗ[R] Q
h₂ : ∀ (y : M' →ₗ[R] Q), (fun l => l ∘ₗ f = ℓ ∘ₗ f) y → y = ℓ
g'' : M' →ₗ[A] Q
h : (fun g' => ↑R g' ∘ₗ f = ℓ ∘ₗ f) g''
x : M'
⊢ g'' x = (LinearMap.extendScalarsOfIsLocalization S A ℓ) x

Next tactic:
simp [← h₂ (LinearMap.restrictScalars R g'') h]
instance [Semiring R] : RingInvoClass (RingInvo R) R where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    

Proof state:
R : Type u_1
inst✝¹ inst✝ : Semiring R
e f : RingInvo R
h₁ : (fun f => f.toFun) e = (fun f => f.toFun) f
h₂ : (fun f => f.invFun) e = (fun f => f.invFun) f
⊢ e = f

Next tactic:
rcases e with ⟨⟨tE, _⟩, _⟩
instance [Semiring R] : RingInvoClass (RingInvo R) R where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    rcases e with ⟨⟨tE, _⟩, _⟩; 

Proof state:
case mk.mk
R : Type u_1
inst✝¹ inst✝ : Semiring R
f : RingInvo R
tE : R ≃ Rᵐᵒᵖ
map_mul'✝ : ∀ (x y : R), Equiv.toFun tE (x * y) = Equiv.toFun tE x * Equiv.toFun tE y
map_add'✝ : ∀ (x y : R), Equiv.toFun tE (x + y) = Equiv.toFun tE x + Equiv.toFun tE y
involution'✝ :
  ∀ (x : R),
    MulOpposite.unop
        (Equiv.toFun { toEquiv := tE, map_mul' := map_mul'✝, map_add' := map_add'✝ }.toEquiv
          (MulOpposite.unop (Equiv.toFun { toEquiv := tE, map_mul' := map_mul'✝, map_add' := map_add'✝ }.toEquiv x))) =
      x
h₁ :
  (fun f => f.toFun)
      { toRingEquiv := { toEquiv := tE, map_mul' := map_mul'✝, map_add' := map_add'✝ }, involution' := involution'✝ } =
    (fun f => f.toFun) f
h₂ :
  (fun f => f.invFun)
      { toRingEquiv := { toEquiv := tE, map_mul' := map_mul'✝, map_add' := map_add'✝ }, involution' := involution'✝ } =
    (fun f => f.invFun) f
⊢ { toRingEquiv := { toEquiv := tE, map_mul' := map_mul'✝, map_add' := map_add'✝ }, involution' := involution'✝ } = f

Next tactic:
rcases f with ⟨⟨tF, _⟩, _⟩
instance [Semiring R] : RingInvoClass (RingInvo R) R where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    rcases e with ⟨⟨tE, _⟩, _⟩; rcases f with ⟨⟨tF, _⟩, _⟩
    

Proof state:
case mk.mk.mk.mk
R : Type u_1
inst✝¹ inst✝ : Semiring R
tE : R ≃ Rᵐᵒᵖ
map_mul'✝¹ : ∀ (x y : R), Equiv.toFun tE (x * y) = Equiv.toFun tE x * Equiv.toFun tE y
map_add'✝¹ : ∀ (x y : R), Equiv.toFun tE (x + y) = Equiv.toFun tE x + Equiv.toFun tE y
involution'✝¹ :
  ∀ (x : R),
    MulOpposite.unop
        (Equiv.toFun { toEquiv := tE, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ }.toEquiv
          (MulOpposite.unop
            (Equiv.toFun { toEquiv := tE, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ }.toEquiv x))) =
      x
tF : R ≃ Rᵐᵒᵖ
map_mul'✝ : ∀ (x y : R), Equiv.toFun tF (x * y) = Equiv.toFun tF x * Equiv.toFun tF y
map_add'✝ : ∀ (x y : R), Equiv.toFun tF (x + y) = Equiv.toFun tF x + Equiv.toFun tF y
involution'✝ :
  ∀ (x : R),
    MulOpposite.unop
        (Equiv.toFun { toEquiv := tF, map_mul' := map_mul'✝, map_add' := map_add'✝ }.toEquiv
          (MulOpposite.unop (Equiv.toFun { toEquiv := tF, map_mul' := map_mul'✝, map_add' := map_add'✝ }.toEquiv x))) =
      x
h₁ :
  (fun f => f.toFun)
      { toRingEquiv := { toEquiv := tE, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ },
        involution' := involution'✝¹ } =
    (fun f => f.toFun)
      { toRingEquiv := { toEquiv := tF, map_mul' := map_mul'✝, map_add' := map_add'✝ }, involution' := involution'✝ }
h₂ :
  (fun f => f.invFun)
      { toRingEquiv := { toEquiv := tE, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ },
        involution' := involution'✝¹ } =
    (fun f => f.invFun)
      { toRingEquiv := { toEquiv := tF, map_mul' := map_mul'✝, map_add' := map_add'✝ }, involution' := involution'✝ }
⊢ { toRingEquiv := { toEquiv := tE, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ }, involution' := involution'✝¹ } =
    { toRingEquiv := { toEquiv := tF, map_mul' := map_mul'✝, map_add' := map_add'✝ }, involution' := involution'✝ }

Next tactic:
cases tE
theorem liftRel_destruct {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t → Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
  | ⟨R, h1, h2⟩ => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
R✝ : α → β → Prop
s : WSeq α
t : WSeq β
R : WSeq α → WSeq β → Prop
h1 : R s t
h2 : ∀ {s : WSeq α} {t : WSeq β}, R s t → Computation.LiftRel (LiftRelO R✝ R) (destruct s) (destruct t)
⊢ Computation.LiftRel (LiftRelO R✝ (LiftRel R✝)) (destruct s) (destruct t)

Next tactic:
refine' Computation.LiftRel.imp _ _ _ (h2 h1)
theorem liftRel_destruct {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t → Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
  | ⟨R, h1, h2⟩ => by
    refine' Computation.LiftRel.imp _ _ _ (h2 h1)
    

Proof state:
α : Type u
β : Type v
γ : Type w
R✝ : α → β → Prop
s : WSeq α
t : WSeq β
R : WSeq α → WSeq β → Prop
h1 : R s t
h2 : ∀ {s : WSeq α} {t : WSeq β}, R s t → Computation.LiftRel (LiftRelO R✝ R) (destruct s) (destruct t)
⊢ ∀ {a : Option (α × WSeq α)} {b : Option (β × WSeq β)}, LiftRelO R✝ R a b → LiftRelO R✝ (LiftRel R✝) a b

Next tactic:
apply LiftRelO.imp_right
theorem liftRel_destruct {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t → Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
  | ⟨R, h1, h2⟩ => by
    refine' Computation.LiftRel.imp _ _ _ (h2 h1)
    apply LiftRelO.imp_right
    

Proof state:
case H
α : Type u
β : Type v
γ : Type w
R✝ : α → β → Prop
s : WSeq α
t : WSeq β
R : WSeq α → WSeq β → Prop
h1 : R s t
h2 : ∀ {s : WSeq α} {t : WSeq β}, R s t → Computation.LiftRel (LiftRelO R✝ R) (destruct s) (destruct t)
⊢ ∀ (s : WSeq α) (t : WSeq β), R s t → LiftRel R✝ s t

Next tactic:
exact fun s' t' h' => ⟨R, h', @h2⟩
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s t
⊢ Computation.LiftRel
    (LiftRelO R fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t))
    (destruct s) (destruct t)

Next tactic:
have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        assumption
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s t
⊢ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)

Next tactic:
cases' h with h h
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        

Proof state:
case inl
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h : LiftRel R s t
⊢ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
case inr
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
⊢ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)

Next tactic:
exact liftRel_destruct h
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        

Proof state:
case inr
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
⊢ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)

Next tactic:
assumption
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        assumption
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝¹ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h✝ : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s t
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
⊢ Computation.LiftRel
    (LiftRelO R fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t))
    (destruct s) (destruct t)

Next tactic:
apply Computation.LiftRel.imp _ _ _ h