Documentation

Mathlib.Tactic.NormNum.NatFactorial

norm_num extensions for factorials #

Extensions for norm_num that compute Nat.factorial, Nat.ascFactorial and Nat.descFactorial.

This is done by reducing each of these to ascFactorial, which is computed using a divide and conquer strategy that improves performance and avoids exceeding the recursion depth.

theorem Mathlib.Meta.NormNum.asc_factorial_aux (n l m a b : ) (h₁ : n.ascFactorial l = a) (h₂ : (n + l).ascFactorial m = b) :
n.ascFactorial (l + m) = a * b
partial def Mathlib.Meta.NormNum.proveAscFactorial (n l : ) (en el : Q()) :
× (eresult : Q()) × Q(«$en».ascFactorial «$el» = «$eresult»)

Calculate n.ascFactorial l and return this value along with a proof of the result.

theorem Mathlib.Meta.NormNum.isNat_factorial {n x : } (h₁ : IsNat n x) (a : ) (h₂ : Nat.ascFactorial 1 x = a) :

Evaluates the Nat.factorial function.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Mathlib.Meta.NormNum.isNat_ascFactorial {n x l y : } (h₁ : IsNat n x) (h₂ : IsNat l y) (a : ) (p : x.ascFactorial y = a) :

    Evaluates the Nat.ascFactorial function.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Mathlib.Meta.NormNum.isNat_descFactorial {n x l y : } (z : ) (h₁ : IsNat n x) (h₂ : IsNat l y) (h₃ : x = z + y) (a : ) (p : (z + 1).ascFactorial y = a) :
      theorem Mathlib.Meta.NormNum.isNat_descFactorial_zero {n x l y : } (z : ) (h₁ : IsNat n x) (h₂ : IsNat l y) (h₃ : y = z + x + 1) :

      Evaluates the Nat.descFactorial function.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For