The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.Nat.Factorial.DoubleFactorial

14 declarations. Mathlib docs · Source

Double factorials

This file defines the double factorial, n‼ := n * (n - 2) * (n - 4) * ....

Main declarations

  • Nat.doubleFactorial: The double factorial.

theorem Nat.doubleFactorial.match_1.congr_eq_3 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (k : ℕ) → motive k.succ.succ)
  (k : ℕ),
  x = k.succ.succ →
    (match x with
      | 0 => h_1 ()
      | 1 => h_2 ()
      | k.succ.succ => h_3 k) ≍
      h_3 k

theorem Nat.doubleFactorial.match_1.congr_eq_1 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (k : ℕ) → motive k.succ.succ),
  x = 0 →
    (match x with
      | 0 => h_1 ()
      | 1 => h_2 ()
      | k.succ.succ => h_3 k) ≍
      h_1 ()

theorem Nat.doubleFactorial.match_1.congr_eq_2 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (k : ℕ) → motive k.succ.succ),
  x = 1 →
    (match x with
      | 0 => h_1 ()
      | 1 => h_2 ()
      | k.succ.succ => h_3 k) ≍
      h_2 ()

def Nat.doubleFactorial E3 #

ℕ → ℕ

Nat.doubleFactorial n is the double factorial of n.

def Nat.«term_‼» E1 #

Lean.TrailingParserDescr

Nat.doubleFactorial n is the double factorial of n.

theorem Nat.doubleFactorial_pos E1 #

∀ (n : ℕ), 0 < n.doubleFactorial

theorem Nat.doubleFactorial_add_two E1 #

∀ (n : ℕ), (n + 2).doubleFactorial = (n + 2) * n.doubleFactorial

theorem Nat.doubleFactorial_add_one E1 #

∀ (n : ℕ), (n + 1).doubleFactorial = (n + 1) * (n - 1).doubleFactorial

theorem Nat.factorial_eq_mul_doubleFactorial E1 #

∀ (n : ℕ), (n + 1).factorial = (n + 1).doubleFactorial * n.doubleFactorial

theorem Nat.doubleFactorial_le_factorial E1 #

∀ (n : ℕ), n.doubleFactorial ≤ n.factorial

theorem Nat.doubleFactorial_two_mul E1 #

∀ (n : ℕ), (2 * n).doubleFactorial = 2 ^ n * n.factorial

theorem Nat.doubleFactorial_eq_prod_even E1 #

∀ (n : ℕ), (2 * n).doubleFactorial = ∏ i ∈ Finset.range n, 2 * (i + 1)

theorem Nat.doubleFactorial_eq_prod_odd E1 #

∀ (n : ℕ), (2 * n + 1).doubleFactorial = ∏ i ∈ Finset.range n, (2 * (i + 1) + 1)

def Mathlib.Meta.Positivity.evalDoubleFactorial E1 #

Mathlib.Meta.Positivity.PositivityExt

Extension for Nat.doubleFactorial.