Theorem: MulChar.inv_apply
File: Mathlib/NumberTheory/MulChar/Basic.lean

tactic: by_cases ha : IsUnit a
state_before: R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
⊢ χ⁻¹ a = χ (Ring.inverse a)
state_after: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
⊢ χ⁻¹ a = χ (Ring.inverse a)

case neg
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : ¬IsUnit a
⊢ χ⁻¹ a = χ (Ring.inverse a)

tactic: rw [inv_apply_eq_inv]
state_before: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
⊢ χ⁻¹ a = χ (Ring.inverse a)
state_after: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
⊢ Ring.inverse (χ a) = χ (Ring.inverse a)

tactic: have h := IsUnit.map χ ha
state_before: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
⊢ Ring.inverse (χ a) = χ (Ring.inverse a)
state_after: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
h : IsUnit (χ a)
⊢ Ring.inverse (χ a) = χ (Ring.inverse a)

tactic: dsimp only
state_before: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
h : IsUnit (χ a)
⊢ (fun x => χ a * x) (Ring.inverse (χ a)) = (fun x => χ a * x) (χ (Ring.inverse a))
state_after: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
h : IsUnit (χ a)
⊢ χ a * Ring.inverse (χ a) = χ a * χ (Ring.inverse a)

tactic: rw [Ring.mul_inverse_cancel _ h, ← map_mul, Ring.mul_inverse_cancel _ ha, map_one]
state_before: case pos
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : IsUnit a
h : IsUnit (χ a)
⊢ χ a * Ring.inverse (χ a) = χ a * χ (Ring.inverse a)
state_after: no goals

tactic: revert ha
state_before: case neg
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
ha : ¬IsUnit a
⊢ χ⁻¹ a = χ (Ring.inverse a)
state_after: case neg
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
⊢ ¬IsUnit a → χ⁻¹ a = χ (Ring.inverse a)

tactic: nontriviality R
state_before: case neg
R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
⊢ ¬IsUnit a → χ⁻¹ a = χ (Ring.inverse a)
state_after: R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
a✝ : Nontrivial R
⊢ ¬IsUnit a → χ⁻¹ a = χ (Ring.inverse a)

tactic: intro ha
state_before: R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
a✝ : Nontrivial R
⊢ ¬IsUnit a → χ⁻¹ a = χ (Ring.inverse a)
state_after: R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
a✝ : Nontrivial R
ha : ¬IsUnit a
⊢ χ⁻¹ a = χ (Ring.inverse a)

tactic: rw [map_nonunit _ ha, Ring.inverse_non_unit a ha, MulChar.map_zero χ]
state_before: R✝ : Type u_1
inst✝² : CommMonoid R✝
R' : Type u_2
inst✝¹ : CommMonoidWithZero R'
R : Type u_3
inst✝ : CommMonoidWithZero R
χ : MulChar R R'
a : R
a✝ : Nontrivial R
ha : ¬IsUnit a
⊢ χ⁻¹ a = χ (Ring.inverse a)
state_after: no goals