-- Lean 4 proof step from Mathlib.Algebra.Star.StarRingHom (goal)
Goal:
A : Type u_1
B : Type u_2
C : Type u_3
inst : Add A
inst_1 : Add B
inst_2 : Mul A
inst_3 : Mul B
inst_4 : Star A
inst_5 : Star B
inst_6 : Add C
inst_7 : Mul C
inst_8 : Star C
g : A ≃⋆+* B
toFun : A → B
invFun : B → A
left_inv : Function.LeftInverse invFun toFun
right_inv : Function.RightInverse invFun toFun
map_mul' :
  ∀ (x y : A),
    { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv : A ≃ B }.toFun (x * y) =
      { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv : A ≃ B }.toFun x *
        { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv : A ≃ B }.toFun y
map_add' :
  ∀ (x y : A),
    { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv : A ≃ B }.toFun (x + y) =
      { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv : A ≃ B }.toFun x +
        { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv : A ≃ B }.toFun y
map_star' :
  ∀ (a : A),
    { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
            map_add' := map_add' : A ≃+* B }.toFun
        (star a) =
      star
        ({ toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
              map_add' := map_add' : A ≃+* B }.toFun
          a)
h₁ :
  { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
        map_add' := map_add', map_star' := map_star' : A ≃⋆+* B }.toFun =
    g.toFun
h₂ :
  { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
        map_add' := map_add', map_star' := map_star' : A ≃⋆+* B }.invFun =
    g.invFun
⊢ { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
      map_add' := map_add', map_star' := map_star' : A ≃⋆+* B } =
    g
have rcases : ∀ (toFun_1 : A → B) (invFun_1 : B → A) (left_inv_1 : Function.LeftInverse invFun_1 toFun_1)
  (right_inv_1 : Function.RightInverse invFun_1 toFun_1)
  (map_mul'_1 :
    ∀ (x y : A),
      { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1 : A ≃ B }.toFun (x * y) =
        { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1 : A ≃ B }.toFun x *
          { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1 : A ≃ B }.toFun y)
  (map_add'_1 :
    ∀ (x y : A),
      { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1 : A ≃ B }.toFun (x + y) =
        { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1 : A ≃ B }.toFun x +
          { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1 : A ≃ B }.toFun y)
  (map_star'_1 :
    ∀ (a : A),
      { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1, map_mul' := map_mul'_1,
              map_add' := map_add'_1 : A ≃+* B }.toFun
          (star a) =
        star
          ({ toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1,
                map_mul' := map_mul'_1, map_add' := map_add'_1 : A ≃+* B }.toFun
            a))
  (h₁ :
    { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
          map_add' := map_add', map_star' := map_star' : A ≃⋆+* B }.toFun =
      { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1, map_mul' := map_mul'_1,
          map_add' := map_add'_1, map_star' := map_star'_1 : A ≃⋆+* B }.toFun)
  (h₂ :
    { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
          map_add' := map_add', map_star' := map_star' : A ≃⋆+* B }.invFun =
      { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1, map_mul' := map_mul'_1,
          map_add' := map_add'_1, map_star' := map_star'_1 : A ≃⋆+* B }.invFun),
  { toFun := toFun, invFun := invFun, left_inv := left_inv, right_inv := right_inv, map_mul' := map_mul',
      map_add' := map_add', map_star' := map_star' : A ≃⋆+* B } =
    { toFun := toFun_1, invFun := invFun_1, left_inv := left_inv_1, right_inv := right_inv_1, map_mul' := map_mul'_1,
      map_add' := map_add'_1, map_star' := map_star'_1 }
Tactic: rcases g with ⟨⟨⟨_, _, _⟩, _⟩, _⟩
Cleared hypotheses: g, h₁, h₂