Documentation

LeanCourse.MIL.C05_Elementary_Number_Theory.S02_Induction_and_Recursion

def fac :
Equations
Instances For
    theorem fac_pos (n : ) :
    0 < fac n
    theorem dvd_fac {i : } {n : } (ipos : 0 < i) (ile : i n) :
    i fac n
    theorem pow_two_le_fac (n : ) :
    2 ^ (n - 1) fac n
    theorem sum_id (n : ) :
    iFinset.range (n + 1), i = n * (n + 1) / 2
    theorem sum_sqr (n : ) :
    iFinset.range (n + 1), i ^ 2 = n * (n + 1) * (2 * n + 1) / 6
    inductive MyNat :
    Instances For
      def MyNat.add :
      MyNatMyNatMyNat
      Equations
      Instances For
        def MyNat.mul :
        MyNatMyNatMyNat
        Equations
        Instances For
          theorem MyNat.zero_add (n : MyNat) :
          MyNat.zero.add n = n
          theorem MyNat.succ_add (m : MyNat) (n : MyNat) :
          m.succ.add n = (m.add n).succ
          theorem MyNat.add_comm (m : MyNat) (n : MyNat) :
          m.add n = n.add m
          theorem MyNat.add_assoc (m : MyNat) (n : MyNat) (k : MyNat) :
          (m.add n).add k = m.add (n.add k)
          theorem MyNat.mul_add (m : MyNat) (n : MyNat) (k : MyNat) :
          m.mul (n.add k) = (m.mul n).add (m.mul k)
          theorem MyNat.succ_mul (m : MyNat) (n : MyNat) :
          m.succ.mul n = (m.mul n).add n
          theorem MyNat.mul_comm (m : MyNat) (n : MyNat) :
          m.mul n = n.mul m