Theorem: Stirling.stirlingSeq_pow_four_div_stirlingSeq_pow_two_eq
File: Mathlib/Analysis/SpecialFunctions/Stirling.lean

tactic: have : 4 = 2 * 2 := by rfl
state_before: n : ℕ
hn : n ≠ 0
⊢ stirlingSeq n ^ 4 / stirlingSeq (2 * n) ^ 2 * (↑n / (2 * ↑n + 1)) = Wallis.W n

tactic: rw [stirlingSeq, this, pow_mul, stirlingSeq, Wallis.W_eq_factorial_ratio]
state_before: n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ stirlingSeq n ^ 4 / stirlingSeq (2 * n) ^ 2 * (↑n / (2 * ↑n + 1)) = Wallis.W n

tactic: simp_rw [div_pow, mul_pow]
state_before: n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ ((↑n ! / (Real.sqrt (2 * ↑n) * (↑n / exp 1) ^ n)) ^ 2) ^ 2 /
        (↑(2 * n)! / (Real.sqrt (2 * ↑(2 * n)) * (↑(2 * n) / exp 1) ^ (2 * n))) ^ 2 *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: rw [sq_sqrt, sq_sqrt]
state_before: n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ (↑n ! ^ 2) ^ 2 / ((Real.sqrt (2 * ↑n) ^ 2) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (Real.sqrt (2 * ↑(2 * n)) ^ 2 * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: any_goals positivity
state_before: n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ (↑n ! ^ 2) ^ 2 / ((2 * ↑n) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (2 * ↑(2 * n) * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ 0 ≤ 2 * ↑(2 * n)

n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ 0 ≤ 2 * ↑n

tactic: have : (n : ℝ) ≠ 0 := cast_ne_zero.mpr hn
state_before: n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ (↑n ! ^ 2) ^ 2 / ((2 * ↑n) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (2 * ↑(2 * n) * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: have : exp 1 ≠ 0 := exp_ne_zero 1
state_before: n : ℕ
hn : n ≠ 0
this✝ : 4 = 2 * 2
this : ↑n ≠ 0
⊢ (↑n ! ^ 2) ^ 2 / ((2 * ↑n) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (2 * ↑(2 * n) * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: have : ((2 * n)! : ℝ) ≠ 0 := cast_ne_zero.mpr (factorial_ne_zero (2 * n))
state_before: n : ℕ
hn : n ≠ 0
this✝¹ : 4 = 2 * 2
this✝ : ↑n ≠ 0
this : exp 1 ≠ 0
⊢ (↑n ! ^ 2) ^ 2 / ((2 * ↑n) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (2 * ↑(2 * n) * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: have : 2 * (n : ℝ) + 1 ≠ 0 := by norm_cast; exact succ_ne_zero (2 * n)
state_before: n : ℕ
hn : n ≠ 0
this✝² : 4 = 2 * 2
this✝¹ : ↑n ≠ 0
this✝ : exp 1 ≠ 0
this : ↑(2 * n)! ≠ 0
⊢ (↑n ! ^ 2) ^ 2 / ((2 * ↑n) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (2 * ↑(2 * n) * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: field_simp
state_before: n : ℕ
hn : n ≠ 0
this✝³ : 4 = 2 * 2
this✝² : ↑n ≠ 0
this✝¹ : exp 1 ≠ 0
this✝ : ↑(2 * n)! ≠ 0
this : 2 * ↑n + 1 ≠ 0
⊢ (↑n ! ^ 2) ^ 2 / ((2 * ↑n) ^ 2 * ((↑n ^ n / exp 1 ^ n) ^ 2) ^ 2) /
        (↑(2 * n)! ^ 2 / (2 * ↑(2 * n) * (↑(2 * n) ^ (2 * n) / exp 1 ^ (2 * n)) ^ 2)) *
      (↑n / (2 * ↑n + 1)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: simp only [mul_pow, mul_comm 2 n, mul_comm 4 n, pow_mul]
state_before: n : ℕ
hn : n ≠ 0
this✝³ : 4 = 2 * 2
this✝² : ↑n ≠ 0
this✝¹ : exp 1 ≠ 0
this✝ : ↑(2 * n)! ≠ 0
this : 2 * ↑n + 1 ≠ 0
⊢ (↑n ! ^ 2) ^ 2 * ((exp 1 ^ n) ^ 2) ^ 2 * (2 * (2 * ↑n) * ((2 * ↑n) ^ (2 * n)) ^ 2) * ↑n *
      (↑(2 * n)! ^ 2 * (2 * ↑n + 1)) =
    2 ^ (4 * n) * ↑n ! ^ 4 *
      ((2 * ↑n) ^ 2 * ((↑n ^ n) ^ 2) ^ 2 * (↑(2 * n)! ^ 2 * (exp 1 ^ (2 * n)) ^ 2) * (2 * ↑n + 1))

tactic: ring
state_before: n : ℕ
hn : n ≠ 0
this✝³ : 4 = 2 * 2
this✝² : ↑n ≠ 0
this✝¹ : exp 1 ≠ 0
this✝ : ↑(2 * n)! ≠ 0
this : 2 * ↑n + 1 ≠ 0
⊢ (↑n ! ^ 2) ^ 2 * ((exp 1 ^ n) ^ 2) ^ 2 * (2 * (2 * ↑n) * (((2 ^ n) ^ 2) ^ 2 * ((↑n ^ n) ^ 2) ^ 2)) * ↑n *
      (↑(n * 2)! ^ 2 * (2 * ↑n + 1)) =
    (2 ^ n) ^ 4 * ↑n ! ^ 4 *
      (2 ^ 2 * ↑n ^ 2 * ((↑n ^ n) ^ 2) ^ 2 * (↑(n * 2)! ^ 2 * ((exp 1 ^ n) ^ 2) ^ 2) * (2 * ↑n + 1))

tactic: rfl
state_before: n : ℕ
hn : n ≠ 0
⊢ 4 = 2 * 2

tactic: positivity
state_before: n : ℕ
hn : n ≠ 0
this : 4 = 2 * 2
⊢ 0 ≤ 2 * ↑n

tactic: norm_cast
state_before: n : ℕ
hn : n ≠ 0
this✝² : 4 = 2 * 2
this✝¹ : ↑n ≠ 0
this✝ : exp 1 ≠ 0
this : ↑(2 * n)! ≠ 0
⊢ 2 * ↑n + 1 ≠ 0

tactic: exact succ_ne_zero (2 * n)
state_before: n : ℕ
hn : n ≠ 0
this✝² : 4 = 2 * 2
this✝¹ : ↑n ≠ 0
this✝ : exp 1 ≠ 0
this : ↑(2 * n)! ≠ 0
⊢ ¬2 * n + 1 = 0