Theorem: HahnSeries.isUnit_iff
File: Mathlib/RingTheory/HahnSeries.lean

tactic: constructor
state_before: Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
⊢ IsUnit x ↔ IsUnit (coeff x (order x))

tactic: rintro ⟨⟨u, i, ui, iu⟩, rfl⟩
state_before: case mp
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
⊢ IsUnit x → IsUnit (coeff x (order x))

tactic: refine'
  isUnit_of_mul_eq_one (u.coeff u.order) (i.coeff i.order)
    ((mul_coeff_order_add_order u i).symm.trans _)
state_before: case mp.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
u i : HahnSeries Γ R
ui : u * i = 1
iu : i * u = 1
⊢ IsUnit
    (coeff (↑{ val := u, inv := i, val_inv := ui, inv_val := iu })
      (order ↑{ val := u, inv := i, val_inv := ui, inv_val := iu }))

tactic: rw [ui, one_coeff, if_pos]
state_before: case mp.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
u i : HahnSeries Γ R
ui : u * i = 1
iu : i * u = 1
⊢ coeff (u * i) (order u + order i) = 1

tactic: rw [← order_mul (left_ne_zero_of_mul_eq_one ui) (right_ne_zero_of_mul_eq_one ui), ui, order_one]
state_before: case mp.intro.mk.hc
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
u i : HahnSeries Γ R
ui : u * i = 1
iu : i * u = 1
⊢ order u + order i = 0

tactic: rintro ⟨⟨u, i, ui, iu⟩, h⟩
state_before: case mpr
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
⊢ IsUnit (coeff x (order x)) → IsUnit x

tactic: rw [Units.val_mk] at h
state_before: case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * u = 1
h : ↑{ val := u, inv := i, val_inv := ui, inv_val := iu } = coeff x (order x)
⊢ IsUnit x

tactic: rw [h] at iu
state_before: case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * u = 1
h : u = coeff x (order x)
⊢ IsUnit x

tactic: have h := SummableFamily.one_sub_self_mul_hsum_powers (unit_aux x iu)
state_before: case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * coeff x (order x) = 1
h : u = coeff x (order x)
⊢ IsUnit x

tactic: rw [sub_sub_cancel] at h
state_before: case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * coeff x (order x) = 1
h✝ : u = coeff x (order x)
h :
  (1 - (1 - ↑C i * ↑(single (-order x)) 1 * x)) *
      SummableFamily.hsum
        (SummableFamily.powers (1 - ↑C i * ↑(single (-order x)) 1 * x)
          (_ : 0 < ↑(addVal Γ R) (1 - ↑C i * ↑(single (-order x)) 1 * x))) =
    1
⊢ IsUnit x

tactic: exact isUnit_of_mul_isUnit_right (isUnit_of_mul_eq_one _ _ h)
state_before: case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * coeff x (order x) = 1
h✝ : u = coeff x (order x)
h :
  ↑C i * ↑(single (-order x)) 1 * x *
      SummableFamily.hsum
        (SummableFamily.powers (1 - ↑C i * ↑(single (-order x)) 1 * x)
          (_ : 0 < ↑(addVal Γ R) (1 - ↑C i * ↑(single (-order x)) 1 * x))) =
    1
⊢ IsUnit x