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_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
    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) :