Theorem: Real.Wallis.W_eq_factorial_ratio
File: Mathlib/Data/Real/Pi/Wallis.lean

tactic: induction' n with n IH
state_before: n : ℕ
⊢ W n = ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))

tactic: simp only [W, prod_range_zero, Nat.factorial_zero, MulZeroClass.mul_zero, pow_zero,
  algebraMap.coe_one, one_pow, mul_one, algebraMap.coe_zero, zero_add, div_self, Ne.def,
  one_ne_zero, not_false_iff]
state_before: case zero

⊢ W Nat.zero = ↑(2 ^ (4 * Nat.zero)) * ↑(Nat.zero ! ^ 4) / (↑((2 * Nat.zero)! ^ 2) * (2 * ↑Nat.zero + 1))

tactic: norm_num
state_before: case zero

⊢ ∏ i in range Nat.zero, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * Nat.zero)) * ↑(Nat.zero ! ^ 4) / (↑((2 * Nat.zero)! ^ 2) * (2 * ↑Nat.zero + 1))

tactic: unfold W at IH ⊢
state_before: case succ
n : ℕ
IH : W n = ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ W (Nat.succ n) = ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) / (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1))

tactic: rw [prod_range_succ, IH, _root_.div_mul_div_comm, _root_.div_mul_div_comm]
state_before: case succ
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ∏ i in range (Nat.succ n), (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) / (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1))

tactic: refine' (div_eq_div_iff _ _).mpr _
state_before: case succ
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) /
      (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3))) =
    ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) / (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1))

tactic: any_goals exact ne_of_gt (by positivity)
state_before: case succ.refine'_1
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)) ≠ 0

case succ.refine'_2
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1) ≠ 0

case succ.refine'_3
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) * (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)) =
    ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) * (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))

tactic: simp_rw [Nat.mul_succ, Nat.factorial_succ, pow_succ]
state_before: case succ.refine'_3
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) * (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)) =
    ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) * (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))

tactic: push_cast
state_before: case succ.refine'_3
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑(2 ^ (4 * n)) * ↑(n ! * (n ! * (n ! * (n ! * n ! ^ 0)))) * ((2 * ↑n + 2) * (2 * ↑n + 2)) *
      (↑((2 * n + 1 + 1) * ((2 * n + 1) * (2 * n)!) *
            ((2 * n + 1 + 1) * ((2 * n + 1) * (2 * n)!) * ((2 * n + 1 + 1) * ((2 * n + 1) * (2 * n)!)) ^ 0)) *
        (2 * ↑(Nat.succ n) + 1)) =
    ↑(2 * (2 * (2 * (2 * 2 ^ (4 * n))))) *
        ↑((n + 1) * n ! * ((n + 1) * n ! * ((n + 1) * n ! * ((n + 1) * n ! * ((n + 1) * n !) ^ 0)))) *
      (↑((2 * n)! * ((2 * n)! * (2 * n)! ^ 0)) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))

tactic: ring_nf
state_before: case succ.refine'_3
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ 2 ^ (4 * n) * (↑n ! * (↑n ! * (↑n ! * (↑n ! * ↑n ! ^ 0)))) * ((2 * ↑n + 2) * (2 * ↑n + 2)) *
      ((2 * ↑n + 1 + 1) * ((2 * ↑n + 1) * ↑(2 * n)!) *
          ((2 * ↑n + 1 + 1) * ((2 * ↑n + 1) * ↑(2 * n)!) * ((2 * ↑n + 1 + 1) * ((2 * ↑n + 1) * ↑(2 * n)!)) ^ 0) *
        (2 * (↑n + 1) + 1)) =
    2 * (2 * (2 * (2 * 2 ^ (4 * n)))) *
        ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n !) ^ 0)))) *
      (↑(2 * n)! * (↑(2 * n)! * ↑(2 * n)! ^ 0) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))

tactic: exact ne_of_gt (by positivity)
state_before: case succ.refine'_3
n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) * (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)) =
    ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) * (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))

tactic: positivity
state_before: n : ℕ
IH :
  ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =
    ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))
⊢ ?m.20306 < ?m.20305