l3lab/ntp-mathlib huggingface dataset:
theorem support_eq : Function.support f = Metric.ball c f.rOut := by
  simp only [toFun, support_comp_eq_preimage, ContDiffBumpBase.support _ _ f.one_lt_rOut_div_rIn]
  ext x
  

Proof state:
case h
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
x : E
⊢ x ∈ (fun x => f.rIn⁻¹ • (x - c)) ⁻¹' ball 0 (f.rOut / f.rIn) ↔ x ∈ ball c f.rOut

Next tactic:
simp only [mem_ball_iff_norm, sub_zero, norm_smul, mem_preimage, Real.norm_eq_abs, abs_inv,
    abs_of_pos f.rIn_pos, ← div_eq_inv_mul, div_lt_div_right f.rIn_pos]
theorem tsupport_eq : tsupport f = closedBall c f.rOut := by
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
⊢ tsupport ↑f = closedBall c f.rOut

Next tactic:
simp_rw [tsupport, f.support_eq, closure_ball _ f.rOut_pos.ne']
theorem pos_of_mem_ball (hx : x ∈ ball c f.rOut) : 0 < f x :=
  f.nonneg.lt_of_ne' <| by 

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
hx : x ∈ ball c f.rOut
⊢ ↑f x ≠ 0

Next tactic:
rwa [← support_eq, mem_support] at hx
theorem zero_of_le_dist (hx : f.rOut ≤ dist x c) : f x = 0 := by
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
hx : f.rOut ≤ dist x c
⊢ ↑f x = 0

Next tactic:
rwa [← nmem_support, support_eq, mem_ball, not_lt]
protected theorem hasCompactSupport [FiniteDimensional ℝ E] : HasCompactSupport f := by
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedAddCommGroup X
inst✝² : NormedSpace ℝ X
inst✝¹ : HasContDiffBump E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
inst✝ : FiniteDimensional ℝ E
⊢ HasCompactSupport ↑f

Next tactic:
simp_rw [HasCompactSupport, f.tsupport_eq, isCompact_closedBall]
/-- `ContDiffBump` is `𝒞ⁿ` in all its arguments. -/
protected theorem _root_.ContDiffWithinAt.contDiffBump {c g : X → E} {s : Set X}
    {f : ∀ x, ContDiffBump (c x)} {x : X} (hc : ContDiffWithinAt ℝ n c s x)
    (hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x)
    (hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x)
    (hg : ContDiffWithinAt ℝ n g s x) :
    ContDiffWithinAt ℝ n (fun x => f x (g x)) s x := by
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c✝ : E
f✝ : ContDiffBump c✝
x✝ : E
n : ℕ∞
c g : X → E
s : Set X
f : (x : X) → ContDiffBump (c x)
x : X
hc : ContDiffWithinAt ℝ n c s x
hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x
hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x
hg : ContDiffWithinAt ℝ n g s x
⊢ ContDiffWithinAt ℝ n (fun x => ↑(f x) (g x)) s x

Next tactic:
change ContDiffWithinAt ℝ n (uncurry (someContDiffBumpBase E).toFun ∘ fun x : X =>
    ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x
/-- `ContDiffBump` is `𝒞ⁿ` in all its arguments. -/
protected theorem _root_.ContDiffWithinAt.contDiffBump {c g : X → E} {s : Set X}
    {f : ∀ x, ContDiffBump (c x)} {x : X} (hc : ContDiffWithinAt ℝ n c s x)
    (hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x)
    (hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x)
    (hg : ContDiffWithinAt ℝ n g s x) :
    ContDiffWithinAt ℝ n (fun x => f x (g x)) s x := by
  change ContDiffWithinAt ℝ n (uncurry (someContDiffBumpBase E).toFun ∘ fun x : X =>
    ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c✝ : E
f✝ : ContDiffBump c✝
x✝ : E
n : ℕ∞
c g : X → E
s : Set X
f : (x : X) → ContDiffBump (c x)
x : X
hc : ContDiffWithinAt ℝ n c s x
hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x
hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x
hg : ContDiffWithinAt ℝ n g s x
⊢ ContDiffWithinAt ℝ n
    (uncurry (someContDiffBumpBase E).toFun ∘ fun x => ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x

Next tactic:
refine (((someContDiffBumpBase E).smooth.contDiffAt ?_).of_le le_top).comp_contDiffWithinAt x ?_
/-- `ContDiffBump` is `𝒞ⁿ` in all its arguments. -/
protected theorem _root_.ContDiffWithinAt.contDiffBump {c g : X → E} {s : Set X}
    {f : ∀ x, ContDiffBump (c x)} {x : X} (hc : ContDiffWithinAt ℝ n c s x)
    (hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x)
    (hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x)
    (hg : ContDiffWithinAt ℝ n g s x) :
    ContDiffWithinAt ℝ n (fun x => f x (g x)) s x := by
  change ContDiffWithinAt ℝ n (uncurry (someContDiffBumpBase E).toFun ∘ fun x : X =>
    ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x
  refine (((someContDiffBumpBase E).smooth.contDiffAt ?_).of_le le_top).comp_contDiffWithinAt x ?_
  · 

Proof state:
case refine_1
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c✝ : E
f✝ : ContDiffBump c✝
x✝ : E
n : ℕ∞
c g : X → E
s : Set X
f : (x : X) → ContDiffBump (c x)
x : X
hc : ContDiffWithinAt ℝ n c s x
hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x
hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x
hg : ContDiffWithinAt ℝ n g s x
⊢ Ioi 1 ×ˢ univ ∈ 𝓝 ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))

Next tactic:
exact prod_mem_nhds (Ioi_mem_nhds (f x).one_lt_rOut_div_rIn) univ_mem
/-- `ContDiffBump` is `𝒞ⁿ` in all its arguments. -/
protected theorem _root_.ContDiffWithinAt.contDiffBump {c g : X → E} {s : Set X}
    {f : ∀ x, ContDiffBump (c x)} {x : X} (hc : ContDiffWithinAt ℝ n c s x)
    (hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x)
    (hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x)
    (hg : ContDiffWithinAt ℝ n g s x) :
    ContDiffWithinAt ℝ n (fun x => f x (g x)) s x := by
  change ContDiffWithinAt ℝ n (uncurry (someContDiffBumpBase E).toFun ∘ fun x : X =>
    ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x
  refine (((someContDiffBumpBase E).smooth.contDiffAt ?_).of_le le_top).comp_contDiffWithinAt x ?_
  · exact prod_mem_nhds (Ioi_mem_nhds (f x).one_lt_rOut_div_rIn) univ_mem
  · 

Proof state:
case refine_2
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c✝ : E
f✝ : ContDiffBump c✝
x✝ : E
n : ℕ∞
c g : X → E
s : Set X
f : (x : X) → ContDiffBump (c x)
x : X
hc : ContDiffWithinAt ℝ n c s x
hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x
hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x
hg : ContDiffWithinAt ℝ n g s x
⊢ ContDiffWithinAt ℝ n (fun x => ((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x

Next tactic:
exact (hR.div hr (f x).rIn_pos.ne').prod ((hr.inv (f x).rIn_pos.ne').smul (hg.sub hc))
theorem _root_.ContDiff.contDiffBump {c g : X → E} {f : ∀ x, ContDiffBump (c x)}
    (hc : ContDiff ℝ n c) (hr : ContDiff ℝ n fun x => (f x).rIn)
    (hR : ContDiff ℝ n fun x => (f x).rOut) (hg : ContDiff ℝ n g) :
    ContDiff ℝ n fun x => f x (g x) := by
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c✝ : E
f✝ : ContDiffBump c✝
x : E
n : ℕ∞
c g : X → E
f : (x : X) → ContDiffBump (c x)
hc : ContDiff ℝ n c
hr : ContDiff ℝ n fun x => (f x).rIn
hR : ContDiff ℝ n fun x => (f x).rOut
hg : ContDiff ℝ n g
⊢ ContDiff ℝ n fun x => ↑(f x) (g x)

Next tactic:
rw [contDiff_iff_contDiffAt] at *
theorem _root_.ContDiff.contDiffBump {c g : X → E} {f : ∀ x, ContDiffBump (c x)}
    (hc : ContDiff ℝ n c) (hr : ContDiff ℝ n fun x => (f x).rIn)
    (hR : ContDiff ℝ n fun x => (f x).rOut) (hg : ContDiff ℝ n g) :
    ContDiff ℝ n fun x => f x (g x) := by
  rw [contDiff_iff_contDiffAt] at *
  

Proof state:
E : Type u_1
X : Type u_2
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : HasContDiffBump E
c✝ : E
f✝ : ContDiffBump c✝
x : E
n : ℕ∞
c g : X → E
f : (x : X) → ContDiffBump (c x)
hc : ∀ (x : X), ContDiffAt ℝ n c x
hr : ∀ (x : X), ContDiffAt ℝ n (fun x => (f x).rIn) x
hR : ∀ (x : X), ContDiffAt ℝ n (fun x => (f x).rOut) x
hg : ∀ (x : X), ContDiffAt ℝ n g x
⊢ ∀ (x : X), ContDiffAt ℝ n (fun x => ↑(f x) (g x)) x

Next tactic:
exact fun x => (hc x).contDiffBump (hr x) (hR x) (hg x)
instance : RingEquivClass (R ≃+* S) R S where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝⁵ : Mul R
inst✝⁴ : Mul S
inst✝³ : Add R
inst✝² : Add S
inst✝¹ : Mul S'
inst✝ : Add S'
e f : R ≃+* S
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:
cases e
instance : RingEquivClass (R ≃+* S) R S where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    cases e
    

Proof state:
case mk
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝⁵ : Mul R
inst✝⁴ : Mul S
inst✝³ : Add R
inst✝² : Add S
inst✝¹ : Mul S'
inst✝ : Add S'
f : R ≃+* S
toEquiv✝ : R ≃ S
map_mul'✝ : ∀ (x y : R), Equiv.toFun toEquiv✝ (x * y) = Equiv.toFun toEquiv✝ x * Equiv.toFun toEquiv✝ y
map_add'✝ : ∀ (x y : R), Equiv.toFun toEquiv✝ (x + y) = Equiv.toFun toEquiv✝ x + Equiv.toFun toEquiv✝ y
h₁ : (fun f => f.toFun) { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ } = (fun f => f.toFun) f
h₂ : (fun f => f.invFun) { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ } = (fun f => f.invFun) f
⊢ { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ } = f

Next tactic:
cases f
instance : RingEquivClass (R ≃+* S) R S where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    cases e
    cases f
    

Proof state:
case mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝⁵ : Mul R
inst✝⁴ : Mul S
inst✝³ : Add R
inst✝² : Add S
inst✝¹ : Mul S'
inst✝ : Add S'
toEquiv✝¹ : R ≃ S
map_mul'✝¹ : ∀ (x y : R), Equiv.toFun toEquiv✝¹ (x * y) = Equiv.toFun toEquiv✝¹ x * Equiv.toFun toEquiv✝¹ y
map_add'✝¹ : ∀ (x y : R), Equiv.toFun toEquiv✝¹ (x + y) = Equiv.toFun toEquiv✝¹ x + Equiv.toFun toEquiv✝¹ y
toEquiv✝ : R ≃ S
map_mul'✝ : ∀ (x y : R), Equiv.toFun toEquiv✝ (x * y) = Equiv.toFun toEquiv✝ x * Equiv.toFun toEquiv✝ y
map_add'✝ : ∀ (x y : R), Equiv.toFun toEquiv✝ (x + y) = Equiv.toFun toEquiv✝ x + Equiv.toFun toEquiv✝ y
h₁ :
  (fun f => f.toFun) { toEquiv := toEquiv✝¹, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ }
h₂ :
  (fun f => f.invFun) { toEquiv := toEquiv✝¹, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.invFun) { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ }
⊢ { toEquiv := toEquiv✝¹, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ } =
    { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ }

Next tactic:
congr
instance : RingEquivClass (R ≃+* S) R S where
  coe f := f.toFun
  inv f := f.invFun
  coe_injective' e f h₁ h₂ := by
    cases e
    cases f
    congr
    

Proof state:
case mk.mk.e_toEquiv
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝⁵ : Mul R
inst✝⁴ : Mul S
inst✝³ : Add R
inst✝² : Add S
inst✝¹ : Mul S'
inst✝ : Add S'
toEquiv✝¹ : R ≃ S
map_mul'✝¹ : ∀ (x y : R), Equiv.toFun toEquiv✝¹ (x * y) = Equiv.toFun toEquiv✝¹ x * Equiv.toFun toEquiv✝¹ y
map_add'✝¹ : ∀ (x y : R), Equiv.toFun toEquiv✝¹ (x + y) = Equiv.toFun toEquiv✝¹ x + Equiv.toFun toEquiv✝¹ y
toEquiv✝ : R ≃ S
map_mul'✝ : ∀ (x y : R), Equiv.toFun toEquiv✝ (x * y) = Equiv.toFun toEquiv✝ x * Equiv.toFun toEquiv✝ y
map_add'✝ : ∀ (x y : R), Equiv.toFun toEquiv✝ (x + y) = Equiv.toFun toEquiv✝ x + Equiv.toFun toEquiv✝ y
h₁ :
  (fun f => f.toFun) { toEquiv := toEquiv✝¹, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.toFun) { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ }
h₂ :
  (fun f => f.invFun) { toEquiv := toEquiv✝¹, map_mul' := map_mul'✝¹, map_add' := map_add'✝¹ } =
    (fun f => f.invFun) { toEquiv := toEquiv✝, map_mul' := map_mul'✝, map_add' := map_add'✝ }
⊢ toEquiv✝¹ = toEquiv✝

Next tactic:
apply Equiv.coe_fn_injective h₁
/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ) where
  toFun f := { AddEquiv.mulOp f.toAddEquiv, MulEquiv.op f.toMulEquiv with }
  invFun f := { AddEquiv.mulOp.symm f.toAddEquiv, MulEquiv.op.symm f.toMulEquiv with }
  left_inv f := by
    

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
α : Type ?u.46975
β : Type ?u.46981
inst✝³ : Add α
inst✝² : Mul α
inst✝¹ : Add β
inst✝ : Mul β
f : α ≃+* β
⊢ (fun f =>
        let src := AddEquiv.mulOp.symm (toAddEquiv f);
        let src_1 := MulEquiv.op.symm (toMulEquiv f);
        { toEquiv := src.toEquiv,
          map_mul' :=
            (_ :
              ∀ (x y : α),
                Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
          map_add' :=
            (_ :
              ∀ (x y : α), Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
      ((fun f =>
          let src := AddEquiv.mulOp (toAddEquiv f);
          let src_1 := MulEquiv.op (toMulEquiv f);
          { toEquiv := src.toEquiv,
            map_mul' :=
              (_ :
                ∀ (x y : αᵐᵒᵖ),
                  Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
            map_add' :=
              (_ :
                ∀ (x y : αᵐᵒᵖ),
                  Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
        f) =
    f

Next tactic:
ext
/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ) where
  toFun f := { AddEquiv.mulOp f.toAddEquiv, MulEquiv.op f.toMulEquiv with }
  invFun f := { AddEquiv.mulOp.symm f.toAddEquiv, MulEquiv.op.symm f.toMulEquiv with }
  left_inv f := by
    ext
    

Proof state:
case h
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
α : Type ?u.46975
β : Type ?u.46981
inst✝³ : Add α
inst✝² : Mul α
inst✝¹ : Add β
inst✝ : Mul β
f : α ≃+* β
x✝ : α
⊢ ((fun f =>
          let src := AddEquiv.mulOp.symm (toAddEquiv f);
          let src_1 := MulEquiv.op.symm (toMulEquiv f);
          { toEquiv := src.toEquiv,
            map_mul' :=
              (_ :
                ∀ (x y : α),
                  Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
            map_add' :=
              (_ :
                ∀ (x y : α), Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
        ((fun f =>
            let src := AddEquiv.mulOp (toAddEquiv f);
            let src_1 := MulEquiv.op (toMulEquiv f);
            { toEquiv := src.toEquiv,
              map_mul' :=
                (_ :
                  ∀ (x y : αᵐᵒᵖ),
                    Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
              map_add' :=
                (_ :
                  ∀ (x y : αᵐᵒᵖ),
                    Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
          f))
      x✝ =
    f x✝

Next tactic:
rfl
/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ) where
  toFun f := { AddEquiv.mulOp f.toAddEquiv, MulEquiv.op f.toMulEquiv with }
  invFun f := { AddEquiv.mulOp.symm f.toAddEquiv, MulEquiv.op.symm f.toMulEquiv with }
  left_inv f := by
    ext
    rfl
  right_inv f := by
    

Proof state:
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
α : Type ?u.46975
β : Type ?u.46981
inst✝³ : Add α
inst✝² : Mul α
inst✝¹ : Add β
inst✝ : Mul β
f : αᵐᵒᵖ ≃+* βᵐᵒᵖ
⊢ (fun f =>
        let src := AddEquiv.mulOp (toAddEquiv f);
        let src_1 := MulEquiv.op (toMulEquiv f);
        { toEquiv := src.toEquiv,
          map_mul' :=
            (_ :
              ∀ (x y : αᵐᵒᵖ),
                Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
          map_add' :=
            (_ :
              ∀ (x y : αᵐᵒᵖ),
                Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
      ((fun f =>
          let src := AddEquiv.mulOp.symm (toAddEquiv f);
          let src_1 := MulEquiv.op.symm (toMulEquiv f);
          { toEquiv := src.toEquiv,
            map_mul' :=
              (_ :
                ∀ (x y : α),
                  Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
            map_add' :=
              (_ :
                ∀ (x y : α), Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
        f) =
    f

Next tactic:
ext
/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ) where
  toFun f := { AddEquiv.mulOp f.toAddEquiv, MulEquiv.op f.toMulEquiv with }
  invFun f := { AddEquiv.mulOp.symm f.toAddEquiv, MulEquiv.op.symm f.toMulEquiv with }
  left_inv f := by
    ext
    rfl
  right_inv f := by
    ext
    

Proof state:
case h
F : Type u_1
α✝ : Type u_2
β✝ : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
α : Type ?u.46975
β : Type ?u.46981
inst✝³ : Add α
inst✝² : Mul α
inst✝¹ : Add β
inst✝ : Mul β
f : αᵐᵒᵖ ≃+* βᵐᵒᵖ
x✝ : αᵐᵒᵖ
⊢ ((fun f =>
          let src := AddEquiv.mulOp (toAddEquiv f);
          let src_1 := MulEquiv.op (toMulEquiv f);
          { toEquiv := src.toEquiv,
            map_mul' :=
              (_ :
                ∀ (x y : αᵐᵒᵖ),
                  Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
            map_add' :=
              (_ :
                ∀ (x y : αᵐᵒᵖ),
                  Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
        ((fun f =>
            let src := AddEquiv.mulOp.symm (toAddEquiv f);
            let src_1 := MulEquiv.op.symm (toMulEquiv f);
            { toEquiv := src.toEquiv,
              map_mul' :=
                (_ :
                  ∀ (x y : α),
                    Equiv.toFun src_1.toEquiv (x * y) = Equiv.toFun src_1.toEquiv x * Equiv.toFun src_1.toEquiv y),
              map_add' :=
                (_ :
                  ∀ (x y : α),
                    Equiv.toFun src.toEquiv (x + y) = Equiv.toFun src.toEquiv x + Equiv.toFun src.toEquiv y) })
          f))
      x✝ =
    f x✝

Next tactic:
rfl
theorem map_eq_neg_one_iff {x : R} : f x = -1 ↔ x = -1 := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝¹ : NonAssocRing R
inst✝ : NonAssocRing S
f : R ≃+* S
x✝ y x : R
⊢ f x = -1 ↔ x = -1

Next tactic:
rw [← neg_eq_iff_eq_neg, ← neg_eq_iff_eq_neg, ← map_neg, RingEquiv.map_eq_one_iff]
theorem coe_nonUnitalRingHom_inj_iff {R S : Type*} [NonUnitalNonAssocSemiring R]
    [NonUnitalNonAssocSemiring S] (f g : R ≃+* S) : f = g ↔ (f : R →ₙ+* S) = g :=
  ⟨fun h => by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R✝ : Type u_4
S✝ : Type u_5
S' : Type u_6
inst✝⁴ : NonUnitalNonAssocSemiring R✝
inst✝³ : NonUnitalNonAssocSemiring S✝
inst✝² : NonUnitalNonAssocSemiring S'
R : Type u_7
S : Type u_8
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NonUnitalNonAssocSemiring S
f g : R ≃+* S
h : f = g
⊢ ↑f = ↑g

Next tactic:
rw [h]
@[simp]
theorem toNonUnitalRingHomm_comp_symm_toNonUnitalRingHom (e : R ≃+* S) :
    e.toNonUnitalRingHom.comp e.symm.toNonUnitalRingHom = NonUnitalRingHom.id _ := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝² : NonUnitalNonAssocSemiring R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring S'
e : R ≃+* S
⊢ NonUnitalRingHom.comp (toNonUnitalRingHom e) (toNonUnitalRingHom (RingEquiv.symm e)) = NonUnitalRingHom.id S

Next tactic:
ext
@[simp]
theorem toNonUnitalRingHomm_comp_symm_toNonUnitalRingHom (e : R ≃+* S) :
    e.toNonUnitalRingHom.comp e.symm.toNonUnitalRingHom = NonUnitalRingHom.id _ := by
  ext
  

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝² : NonUnitalNonAssocSemiring R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring S'
e : R ≃+* S
x✝ : S
⊢ (NonUnitalRingHom.comp (toNonUnitalRingHom e) (toNonUnitalRingHom (RingEquiv.symm e))) x✝ = (NonUnitalRingHom.id S) x✝

Next tactic:
simp
@[simp]
theorem symm_toNonUnitalRingHom_comp_toNonUnitalRingHom (e : R ≃+* S) :
    e.symm.toNonUnitalRingHom.comp e.toNonUnitalRingHom = NonUnitalRingHom.id _ := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝² : NonUnitalNonAssocSemiring R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring S'
e : R ≃+* S
⊢ NonUnitalRingHom.comp (toNonUnitalRingHom (RingEquiv.symm e)) (toNonUnitalRingHom e) = NonUnitalRingHom.id R

Next tactic:
ext
@[simp]
theorem symm_toNonUnitalRingHom_comp_toNonUnitalRingHom (e : R ≃+* S) :
    e.symm.toNonUnitalRingHom.comp e.toNonUnitalRingHom = NonUnitalRingHom.id _ := by
  ext
  

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝² : NonUnitalNonAssocSemiring R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring S'
e : R ≃+* S
x✝ : R
⊢ (NonUnitalRingHom.comp (toNonUnitalRingHom (RingEquiv.symm e)) (toNonUnitalRingHom e)) x✝ = (NonUnitalRingHom.id R) x✝

Next tactic:
simp
theorem coe_ringHom_inj_iff {R S : Type*} [NonAssocSemiring R] [NonAssocSemiring S]
    (f g : R ≃+* S) : f = g ↔ (f : R →+* S) = g :=
  ⟨fun h => by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R✝ : Type u_4
S✝ : Type u_5
S' : Type u_6
inst✝⁴ : NonAssocSemiring R✝
inst✝³ : NonAssocSemiring S✝
inst✝² : NonAssocSemiring S'
R : Type u_7
S : Type u_8
inst✝¹ : NonAssocSemiring R
inst✝ : NonAssocSemiring S
f g : R ≃+* S
h : f = g
⊢ ↑f = ↑g

Next tactic:
rw [h]
theorem toRingHom_comp_symm_toRingHom (e : R ≃+* S) :
    e.toRingHom.comp e.symm.toRingHom = RingHom.id _ := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝² : NonAssocSemiring R
inst✝¹ : NonAssocSemiring S
inst✝ : NonAssocSemiring S'
e : R ≃+* S
⊢ RingHom.comp (toRingHom e) (toRingHom (RingEquiv.symm e)) = RingHom.id S

Next tactic:
ext
theorem toRingHom_comp_symm_toRingHom (e : R ≃+* S) :
    e.toRingHom.comp e.symm.toRingHom = RingHom.id _ := by
  ext
  

Proof state:
case a
F : Type u_1
α : Type u_2
β : Type u_3
R : Type u_4
S : Type u_5
S' : Type u_6
inst✝² : NonAssocSemiring R
inst✝¹ : NonAssocSemiring S
inst✝ : NonAssocSemiring S'
e : R ≃+* S
x✝ : S
⊢ (RingHom.comp (toRingHom e) (toRingHom (RingEquiv.symm e))) x✝ = (RingHom.id S) x✝

Next tactic:
simp