-- Mathlib/NumberTheory/LSeries/HurwitzZeta.lean
/-- Functional equation for the exponential zeta function. -/
lemma expZeta_one_sub (a : UnitAddCircle) {s : ℂ} (hs : ∀ (n : ℕ), s ≠ 1 - n) :
    expZeta a (1 - s) = (2 * π) ^ (-s) * Gamma s *
    (exp (π * I * s / 2) * hurwitzZeta a s + exp (-π * I * s / 2) * hurwitzZeta (-a) s)

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y z : ℂ
⊢ x * Complex.Gamma s * y * hurwitzZetaEven a s - x * Complex.Gamma s * y * I ^ 2 * hurwitzZetaOdd a s +
        x * Complex.Gamma s * z * hurwitzZetaEven a s +
      x * Complex.Gamma s * z * I ^ 2 * hurwitzZetaOdd a s =
    x * Complex.Gamma s * y * hurwitzZetaEven a s + x * Complex.Gamma s * y * hurwitzZetaOdd a s +
      (x * Complex.Gamma s * z * hurwitzZetaEven a s - x * Complex.Gamma s * z * hurwitzZetaOdd a s)

Tactic:
rw [I_sq]

Result:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y z : ℂ
⊢ x * Complex.Gamma s * y * hurwitzZetaEven a s - x * Complex.Gamma s * y * -1 * hurwitzZetaOdd a s +
        x * Complex.Gamma s * z * hurwitzZetaEven a s +
      x * Complex.Gamma s * z * -1 * hurwitzZetaOdd a s =
    x * Complex.Gamma s * y * hurwitzZetaEven a s + x * Complex.Gamma s * y * hurwitzZetaOdd a s +
      (x * Complex.Gamma s * z * hurwitzZetaEven a s - x * Complex.Gamma s * z * hurwitzZetaOdd a s)

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y z : ℂ
⊢ 2 * x * Complex.Gamma s * ((y + z) / 2) * hurwitzZetaEven a s +
      I * (2 * x * Complex.Gamma s * ((z - y) * I / 2) * hurwitzZetaOdd a s) =
    x * Complex.Gamma s *
      (y * (hurwitzZetaEven a s + hurwitzZetaOdd a s) + z * (hurwitzZetaEven a s + -hurwitzZetaOdd a s))

Tactic:
ring_nf

Result:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y z : ℂ
⊢ x * Complex.Gamma s * y * hurwitzZetaEven a s - x * Complex.Gamma s * y * I ^ 2 * hurwitzZetaOdd a s +
        x * Complex.Gamma s * z * hurwitzZetaEven a s +
      x * Complex.Gamma s * z * I ^ 2 * hurwitzZetaOdd a s =
    x * Complex.Gamma s * y * hurwitzZetaEven a s + x * Complex.Gamma s * y * hurwitzZetaOdd a s +
      (x * Complex.Gamma s * z * hurwitzZetaEven a s - x * Complex.Gamma s * z * hurwitzZetaOdd a s)

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x : ℂ
⊢ 2 * x * Complex.Gamma s * ((cexp (↑π * s / 2 * I) + cexp (-(↑π * s / 2) * I)) / 2) * hurwitzZetaEven a s +
      I *
        (2 * x * Complex.Gamma s * ((cexp (-(↑π * s / 2) * I) - cexp (↑π * s / 2 * I)) * I / 2) * hurwitzZetaOdd a s) =
    x * Complex.Gamma s *
      (cexp (↑π * s / 2 * I) * (hurwitzZetaEven a s + hurwitzZetaOdd a s) +
        cexp (-(↑π * s / 2) * I) * (hurwitzZetaEven a s + -hurwitzZetaOdd a s))

Tactic:
generalize (↑π * s / 2 * I).exp = y

Result:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y : ℂ
⊢ 2 * x * Complex.Gamma s * ((y + cexp (-(↑π * s / 2) * I)) / 2) * hurwitzZetaEven a s +
      I * (2 * x * Complex.Gamma s * ((cexp (-(↑π * s / 2) * I) - y) * I / 2) * hurwitzZetaOdd a s) =
    x * Complex.Gamma s *
      (y * (hurwitzZetaEven a s + hurwitzZetaOdd a s) +
        cexp (-(↑π * s / 2) * I) * (hurwitzZetaEven a s + -hurwitzZetaOdd a s))

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y z : ℂ
⊢ x * Complex.Gamma s * y * hurwitzZetaEven a s - x * Complex.Gamma s * y * -1 * hurwitzZetaOdd a s +
        x * Complex.Gamma s * z * hurwitzZetaEven a s +
      x * Complex.Gamma s * z * -1 * hurwitzZetaOdd a s =
    x * Complex.Gamma s * y * hurwitzZetaEven a s + x * Complex.Gamma s * y * hurwitzZetaOdd a s +
      (x * Complex.Gamma s * z * hurwitzZetaEven a s - x * Complex.Gamma s * z * hurwitzZetaOdd a s)

Tactic:
ring_nf

Result:
no goals

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
n : ℕ
⊢ s ≠ -↑n

Tactic:
convert hs (n + 1) using 1

Result:
case h.e'_3
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
n : ℕ
⊢ -↑n = 1 - ↑(n + 1)

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
⊢ expZeta a (1 - s) =
    (2 * ↑π) ^ (-s) * Complex.Gamma s *
      (cexp (↑π * I * s / 2) * hurwitzZeta a s + cexp (-↑π * I * s / 2) * hurwitzZeta (-a) s)

Tactic:
have hs' (n : ℕ) : s ≠ -↑n := by
  convert hs (n + 1) using 1
  push_cast
  ring

Result:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
⊢ expZeta a (1 - s) =
    (2 * ↑π) ^ (-s) * Complex.Gamma s *
      (cexp (↑π * I * s / 2) * hurwitzZeta a s + cexp (-↑π * I * s / 2) * hurwitzZeta (-a) s)

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
⊢ -↑π * I * s / 2 = -(↑π * s / 2) * I

Tactic:
ring

Result:
no goals

Proof state:
case h.e'_3
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
n : ℕ
⊢ -↑n = 1 - ↑(n + 1)

Tactic:
push_cast

Result:
case h.e'_3
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
n : ℕ
⊢ -↑n = 1 - (↑n + 1)

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
⊢ ↑π * I * s / 2 = ↑π * s / 2 * I

Tactic:
ring

Result:
no goals

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
⊢ expZeta a (1 - s) =
    (2 * ↑π) ^ (-s) * Complex.Gamma s *
      (cexp (↑π * I * s / 2) * hurwitzZeta a s + cexp (-↑π * I * s / 2) * hurwitzZeta (-a) s)

Tactic:
rw [expZeta, cosZeta_one_sub a hs, sinZeta_one_sub a hs', hurwitzZeta, hurwitzZeta,
  hurwitzZetaEven_neg, hurwitzZetaOdd_neg, Complex.cos, Complex.sin]

Result:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
⊢ 2 * (2 * ↑π) ^ (-s) * Complex.Gamma s * ((cexp (↑π * s / 2 * I) + cexp (-(↑π * s / 2) * I)) / 2) *
        hurwitzZetaEven a s +
      I *
        (2 * (2 * ↑π) ^ (-s) * Complex.Gamma s * ((cexp (-(↑π * s / 2) * I) - cexp (↑π * s / 2 * I)) * I / 2) *
          hurwitzZetaOdd a s) =
    (2 * ↑π) ^ (-s) * Complex.Gamma s *
      (cexp (↑π * I * s / 2) * (hurwitzZetaEven a s + hurwitzZetaOdd a s) +
        cexp (-↑π * I * s / 2) * (hurwitzZetaEven a s + -hurwitzZetaOdd a s))

Proof state:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y : ℂ
⊢ 2 * x * Complex.Gamma s * ((y + cexp (-(↑π * s / 2) * I)) / 2) * hurwitzZetaEven a s +
      I * (2 * x * Complex.Gamma s * ((cexp (-(↑π * s / 2) * I) - y) * I / 2) * hurwitzZetaOdd a s) =
    x * Complex.Gamma s *
      (y * (hurwitzZetaEven a s + hurwitzZetaOdd a s) +
        cexp (-(↑π * s / 2) * I) * (hurwitzZetaEven a s + -hurwitzZetaOdd a s))

Tactic:
generalize (-(↑π * s / 2) * I).exp = z

Result:
a : UnitAddCircle
s : ℂ
hs : ∀ (n : ℕ), s ≠ 1 - ↑n
hs' : ∀ (n : ℕ), s ≠ -↑n
x y z : ℂ
⊢ 2 * x * Complex.Gamma s * ((y + z) / 2) * hurwitzZetaEven a s +
      I * (2 * x * Complex.Gamma s * ((z - y) * I / 2) * hurwitzZetaOdd a s) =
    x * Complex.Gamma s *
      (y * (hurwitzZetaEven a s + hurwitzZetaOdd a s) + z * (hurwitzZetaEven a s + -hurwitzZetaOdd a s))