-- Mathlib/LinearAlgebra/Reflection.lean
/-- A formula for $(r_1 r_2)^m z$, where $m$ is a natural number and $z \in M$. -/
lemma reflection_mul_reflection_pow_apply (m : ℕ) (z : M)
    (t : R := f y * g x - 2) (ht : t = f y * g x - 2

Proof state:
case succ
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
x y : M
f g : Dual R M
hf : f x = 2
hg : g y = 2
z : M
t : optParam R (f y * g x - 2)
ht : autoParam (t = f y * g x - 2) _auto✝
m : ℕ
S_eval_t_sub_two :
  ∀ (k : ℤ), Polynomial.eval t (S R (k - 2)) = t * Polynomial.eval t (S R (k - 1)) - Polynomial.eval t (S R k)
S_eval_t_sq_add_S_eval_t_sq :
  ∀ (k : ℤ),
    Polynomial.eval t (S R k) ^ 2 + Polynomial.eval t (S R (k + 1)) ^ 2 -
        t * Polynomial.eval t (S R k) * Polynomial.eval t (S R (k + 1)) =
      1
k : ℤ := ↑m / 2
ih :
  ((reflection hf * reflection hg) ^ m) z =
    z +
        (Polynomial.eval t (S R ((↑m - 2) / 2)) *
            (Polynomial.eval t (S R ((↑m - 1) / 2)) + Polynomial.eval t (S R ((↑m - 3) / 2)))) •
          ((g x * f z - g z) • y - f z • x) +
      (Polynomial.eval t (S R ((↑m - 1) / 2)) * (Polynomial.eval t (S R k) + Polynomial.eval t (S R ((↑m - 2) / 2)))) •
        ((f y * g z - f z) • x - g z • y)
e : ℤ
he : e = 0 ∨ e = 1
⊢ z - f z • x - g z • (y - f y • x) +
        (Polynomial.eval t (S R ((e - 2) / 2 + k)) *
            (Polynomial.eval t (S R ((e - 1) / 2 + k)) + Polynomial.eval t (S R ((e - 3) / 2 + k)))) •
          ((g x * f z - g z) • (y - f y • x - 2 • (y - f y • x)) - f z • (x - 2 • x - g x • (y - f y • x))) +
      (Polynomial.eval t (S R ((e - 1) / 2 + k)) *
          (Polynomial.eval t (S R (e / 2 + k)) + Polynomial.eval t (S R ((e - 2) / 2 + k)))) •
        ((f y * g z - f z) • (x - 2 • x - g x • (y - f y • x)) - g z • (y - f y • x - 2 • (y - f y • x))) =
    z +
        (Polynomial.eval t (S R ((e + 1 - 2) / 2 + k)) *
            (Polynomial.eval t (S R ((e + 1 - 1) / 2 + k)) + Polynomial.eval t (S R ((e + 1 - 3) / 2 + k)))) •
          ((g x * f z - g z) • y - f z • x) +
      (Polynomial.eval t (S R ((e + 1 - 1) / 2 + k)) *
          (Polynomial.eval t (S R ((e + 1) / 2 + k)) + Polynomial.eval t (S R ((e + 1 - 2) / 2 + k)))) •
        ((f y * g z - f z) • x - g z • y)

Tactic:
match_scalars

Result:
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
x y : M
f g : Dual R M
hf : f x = 2
hg : g y = 2
z : M
t : optParam R (f y * g x - 2)
ht : autoParam (t = f y * g x - 2) _auto✝
m : ℕ
S_eval_t_sub_two :
  ∀ (k : ℤ), Polynomial.eval t (S R (k - 2)) = t * Polynomial.eval t (S R (k - 1)) - Polynomial.eval t (S R k)
S_eval_t_sq_add_S_eval_t_sq :
  ∀ (k : ℤ),
    Polynomial.eval t (S R k) ^ 2 + Polynomial.eval t (S R (k + 1)) ^ 2 -
        t * Polynomial.eval t (S R k) * Polynomial.eval t (S R (k + 1)) =
      1
k : ℤ := ↑m / 2
ih :
  ((reflection hf * reflection hg) ^ m) z =
    z +
        (Polynomial.eval t (S R ((↑m - 2) / 2)) *
            (Polynomial.eval t (S R ((↑m - 1) / 2)) + Polynomial.eval t (S R ((↑m - 3) / 2)))) •
          ((g x * f z - g z) • y - f z • x) +
      (Polynomial.eval t (S R ((↑m - 1) / 2)) * (Polynomial.eval t (S R k) + Polynomial.eval t (S R ((↑m - 2) / 2)))) •
        ((f y * g z - f z) • x - g z • y)
e : ℤ
he : e = 0 ∨ e = 1
⊢ 1 = 1

R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
x y : M
f g : Dual R M
hf : f x = 2
hg : g y = 2
z : M
t : optParam R (f y * g x - 2)
ht : autoParam (t = f y * g x - 2) _auto✝
m : ℕ
S_eval_t_sub_two :
  ∀ (k : ℤ), Polynomial.eval t (S R (k - 2)) = t * Polynomial.eval t (S R (k - 1)) - Polynomial.eval t (S R k)
S_eval_t_sq_add_S_eval_t_sq :
  ∀ (k : ℤ),
    Polynomial.eval t (S R k) ^ 2 + Polynomial.eval t (S R (k + 1)) ^ 2 -
        t * Polynomial.eval t (S R k) * Polynomial.eval t (S R (k + 1)) =
      1
k : ℤ := ↑m / 2
ih :
  ((reflection hf * reflection hg) ^ m) z =
    z +
        (Polynomial.eval t (S R ((↑m - 2) / 2)) *
            (Polynomial.eval t (S R ((↑m - 1) / 2)) + Polynomial.eval t (S R ((↑m - 3) / 2)))) •
          ((g x * f z - g z) • y - f z • x) +
      (Polynomial.eval t (S R ((↑m - 1) / 2)) * (Polynomial.eval t (S R k) + Polynomial.eval t (S R ((↑m - 2) / 2)))) •
        ((f y * g z - f z) • x - g z • y)
e : ℤ
he : e = 0 ∨ e = 1
⊢ -(f z * 1) - g z * -(f y * 1) +
        Polynomial.eval t (S R ((e - 2) / 2 + k)) *
            (Polynomial.eval t (S R ((e - 1) / 2 + k)) + Polynomial.eval t (S R ((e - 3) / 2 + k))) *
          ((g x * f z - g z) * (-(f y * 1) - 2 * -(f y * 1)) - f z * (1 - 2 * 1 - g x * -(f y * 1))) +
      Polynomial.eval t (S R ((e - 1) / 2 + k)) *
          (Polynomial.eval t (S R (e / 2 + k)) + Polynomial.eval t (S R ((e - 2) / 2 + k))) *
        ((f y * g z - f z) * (1 - 2 * 1 - g x * -(f y * 1)) - g z * (-(f y * 1) - 2 * -(f y * 1))) =
    Polynomial.eval t (S R ((e + 1 - 2) / 2 + k)) *
          (Polynomial.eval t (S R ((e + 1 - 1) / 2 + k)) + Polynomial.eval t (S R ((e + 1 - 3) / 2 + k))) *
        -(f z * 1) +
      Polynomial.eval t (S R ((e + 1 - 1) / 2 + k)) *
          (Polynomial.eval t (S R ((e + 1) / 2 + k)) + Polynomial.eval t (S R ((e + 1 - 2) / 2 + k))) *
        ((f y * g z - f z) * 1)

R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
x y : M
f g : Dual R M
hf : f x = 2
hg : g y = 2
z : M
t : optParam R (f y * g x - 2)
ht : autoParam (t = f y * g x - 2) _auto✝
m : ℕ
S_eval_t_sub_two :
  ∀ (k : ℤ), Polynomial.eval t (S R (k - 2)) = t * Polynomial.eval t (S R (k - 1)) - Polynomial.eval t (S R k)
S_eval_t_sq_add_S_eval_t_sq :
  ∀ (k : ℤ),
    Polynomial.eval t (S R k) ^ 2 + Polynomial.eval t (S R (k + 1)) ^ 2 -
        t * Polynomial.eval t (S R k) * Polynomial.eval t (S R (k + 1)) =
      1
k : ℤ := ↑m / 2
ih :
  ((reflection hf * reflection hg) ^ m) z =
    z +
        (Polynomial.eval t (S R ((↑m - 2) / 2)) *
            (Polynomial.eval t (S R ((↑m - 1) / 2)) + Polynomial.eval t (S R ((↑m - 3) / 2)))) •
          ((g x * f z - g z) • y - f z • x) +
      (Polynomial.eval t (S R ((↑m - 1) / 2)) * (Polynomial.eval t (S R k) + Polynomial.eval t (S R ((↑m - 2) / 2)))) •
        ((f y * g z - f z) • x - g z • y)
e : ℤ
he : e = 0 ∨ e = 1
⊢ -(g z * 1) +
        Polynomial.eval t (S R ((e - 2) / 2 + k)) *
            (Polynomial.eval t (S R ((e - 1) / 2 + k)) + Polynomial.eval t (S R ((e - 3) / 2 + k))) *
          ((g x * f z - g z) * (1 - 2 * 1) - f z * -(g x * 1)) +
      Polynomial.eval t (S R ((e - 1) / 2 + k)) *
          (Polynomial.eval t (S R (e / 2 + k)) + Polynomial.eval t (S R ((e - 2) / 2 + k))) *
        ((f y * g z - f z) * -(g x * 1) - g z * (1 - 2 * 1)) =
    Polynomial.eval t (S R ((e + 1 - 2) / 2 + k)) *
          (Polynomial.eval t (S R ((e + 1 - 1) / 2 + k)) + Polynomial.eval t (S R ((e + 1 - 3) / 2 + k))) *
        ((g x * f z - g z) * 1) +
      Polynomial.eval t (S R ((e + 1 - 1) / 2 + k)) *
          (Polynomial.eval t (S R ((e + 1) / 2 + k)) + Polynomial.eval t (S R ((e + 1 - 2) / 2 + k))) *
        -(g z * 1)

Proof state:
case zero
R : Type u_1
M : Type u_2
inst✝² : CommRing R
inst✝¹ : AddCommGroup M
inst✝ : Module R M
x y : M
f g : Dual R M
hf : f x = 2
hg : g y = 2
z : M
t : optParam R (f y * g x - 2)
ht : autoParam (t = f y * g x - 2) _auto✝
⊢ ((reflection hf * reflection hg) ^ 0) z =
    z +
        (Polynomial.eval t (S R ((↑0 - 2) / 2)) *
            (Polynomial.eval t (S R ((↑0 - 1) / 2)) + Polynomial.eval t (S R ((↑0 - 3) / 2)))) •
          ((g x * f z - g z) • y - f z • x) +
      (Polynomial.eval t (S R ((↑0 - 1) / 2)) *
          (Polynomial.eval t (S R (↑0 / 2)) + Polynomial.eval t (S R ((↑0 - 2) / 2)))) •
        ((f y * g z - f z) • x - g z • y)

Tactic:
simp

Result:
no goals