Theorem: isQuasiregular_iff_isUnit
File: Mathlib/Algebra/Algebra/Quasispectrum.lean

tactic: refine ⟨IsQuasiregular.isUnit_one_add, fun hx ↦ ?_⟩
state_before: R : Type u_1
inst✝ : Ring R
x : R
⊢ IsQuasiregular x ↔ IsUnit (1 + x)
state_after: R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ IsQuasiregular x

tactic: rw [isQuasiregular_iff]
state_before: R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ IsQuasiregular x
state_after: R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ∃ y, y + x + x * y = 0 ∧ x + y + y * x = 0

tactic: use hx.unit⁻¹ - 1
state_before: R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ∃ y, y + x + x * y = 0 ∧ x + y + y * x = 0
state_after: case h
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0 ∧ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0

tactic: constructor
state_before: case h
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0 ∧ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0
state_after: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0

tactic: case' h.left => have := congr($(hx.mul_val_inv) - 1)
state_before: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0
state_after: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * ↑hx.unit⁻¹ - 1 = 1 - 1
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0

tactic: case' h.right => have := congr($(hx.val_inv_mul) - 1)
state_before: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * ↑hx.unit⁻¹ - 1 = 1 - 1
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0
state_after: case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : ↑hx.unit⁻¹ * (1 + x) - 1 = 1 - 1
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0

case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * ↑hx.unit⁻¹ - 1 = 1 - 1
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

tactic: all_goals
  rw [← sub_add_cancel (↑hx.unit⁻¹ : R) 1, sub_self] at this
  convert this using 1
  noncomm_ring
state_before: case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : ↑hx.unit⁻¹ * (1 + x) - 1 = 1 - 1
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0

case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * ↑hx.unit⁻¹ - 1 = 1 - 1
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0
state_after: no goals

tactic: have := congr($(hx.mul_val_inv) - 1)
state_before: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0
state_after: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * ↑hx.unit⁻¹ - 1 = 1 - 1
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

tactic: have := congr($(hx.val_inv_mul) - 1)
state_before: case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0
state_after: case h.right
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : ↑hx.unit⁻¹ * (1 + x) - 1 = 1 - 1
⊢ x + (↑hx.unit⁻¹ - 1) + (↑hx.unit⁻¹ - 1) * x = 0

tactic: rw [← sub_add_cancel (↑hx.unit⁻¹ : R) 1, sub_self] at this
state_before: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * ↑hx.unit⁻¹ - 1 = 1 - 1
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0
state_after: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * (↑hx.unit⁻¹ - 1 + 1) - 1 = 0
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0

tactic: convert this using 1
state_before: case h.left
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * (↑hx.unit⁻¹ - 1 + 1) - 1 = 0
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = 0
state_after: case h.e'_2
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * (↑hx.unit⁻¹ - 1 + 1) - 1 = 0
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = (1 + x) * (↑hx.unit⁻¹ - 1 + 1) - 1

tactic: noncomm_ring
state_before: case h.e'_2
R : Type u_1
inst✝ : Ring R
x : R
hx : IsUnit (1 + x)
this : (1 + x) * (↑hx.unit⁻¹ - 1 + 1) - 1 = 0
⊢ ↑hx.unit⁻¹ - 1 + x + x * (↑hx.unit⁻¹ - 1) = (1 + x) * (↑hx.unit⁻¹ - 1 + 1) - 1
state_after: no goals