Theorem: Submonoid.LocalizationMap.lift_left_inverse
File: Mathlib/GroupTheory/MonoidLocalization.lean

tactic: rw [lift_spec]
state_before: M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
⊢ ↑(lift k (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap f) ↑y)))
      (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z) =
    z

tactic: cases' f.surj z with x hx
state_before: M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
⊢ ↑(toMap f) (sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).fst =
    ↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * z

tactic: conv_rhs =>
  congr
  next => skip
  rw [f.eq_mk'_iff_mul_eq.2 hx]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f) (sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).fst =
    ↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * z

tactic: rw [mk', ← mul_assoc, mul_inv_right f.map_units, ← f.toMap.map_mul, ← f.toMap.map_mul]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f) (sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).fst =
    ↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * mk' f x.fst x.snd

tactic: apply k.eq_of_eq f.map_units
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f) ((sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).fst * ↑x.snd) =
    ↑(toMap f) (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * x.fst)

tactic: rw [k.toMap.map_mul, k.toMap.map_mul, ← sec_spec, mul_assoc, lift_spec_mul]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap k) ((sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).fst * ↑x.snd) =
    ↑(toMap k) (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * x.fst)

tactic: repeat' rw [← k.toMap.map_mul]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap k) (sec f z).fst *
      (↑(toMap k) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap k) ↑x.snd) =
    ↑(toMap k) ↑(sec f z).snd *
      (↑(toMap k) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap k) x.fst)

tactic: apply f.eq_of_eq k.map_units
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap k)
      ((sec f z).fst * (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑x.snd)) =
    ↑(toMap k)
      (↑(sec f z).snd * (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * x.fst))

tactic: repeat' rw [f.toMap.map_mul]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f)
      ((sec f z).fst * (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑x.snd)) =
    ↑(toMap f)
      (↑(sec f z).snd * (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * x.fst))

tactic: rw [sec_spec', ← hx]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f) (sec f z).fst *
      (↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap f) ↑x.snd) =
    ↑(toMap f) ↑(sec f z).snd *
      (↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap f) x.fst)

tactic: ac_rfl
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f) ↑(sec f z).snd * z *
      (↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap f) ↑x.snd) =
    ↑(toMap f) ↑(sec f z).snd *
      (↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd *
        (z * ↑(toMap f) ↑x.snd))

tactic: rw [← k.toMap.map_mul]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap k)
      ((sec f z).fst * (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑x.snd)) =
    ↑(toMap k)
      (↑(sec f z).snd * (↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * x.fst))

tactic: rw [f.toMap.map_mul]
state_before: case intro
M : Type u_1
inst✝² : CommMonoid M
S : Submonoid M
N : Type u_3
inst✝¹ : CommMonoid N
P : Type u_2
inst✝ : CommMonoid P
f : LocalizationMap S N
g : M →* P
hg : ∀ (y : { x // x ∈ S }), IsUnit (↑g ↑y)
k : LocalizationMap S P
z : N
x : M × { x // x ∈ S }
hx : z * ↑(toMap f) ↑x.snd = ↑(toMap f) x.fst
⊢ ↑(toMap f) (sec f z).fst *
      (↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap f) ↑x.snd) =
    ↑(toMap f) ↑(sec f z).snd *
      (↑(toMap f) ↑(sec k (↑(lift f (_ : ∀ (y : { x // x ∈ S }), IsUnit (↑(toMap k) ↑y))) z)).snd * ↑(toMap f) x.fst)