src/HOL/Power.thy
author wenzelm
Tue May 09 14:33:43 2000 +0200 (2000-05-09)
changeset 8844 db71c334e854
parent 7843 077d305615df
child 14348 744c868ee0b7
permissions -rw-r--r--
named "op ^" definitions;
paulson@3390
     1
(*  Title:      HOL/Power.thy
paulson@3390
     2
    ID:         $Id$
paulson@3390
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@3390
     4
    Copyright   1997  University of Cambridge
paulson@3390
     5
paulson@3390
     6
The (overloaded) exponentiation operator, ^ :: [nat,nat]=>nat
paulson@3390
     7
Also binomial coefficents
paulson@3390
     8
*)
paulson@3390
     9
paulson@3390
    10
Power = Divides + 
paulson@3390
    11
consts
paulson@7843
    12
  binomial :: "[nat,nat] => nat"      (infixl "choose" 65)
paulson@3390
    13
wenzelm@8844
    14
primrec (power)
paulson@3390
    15
  "p ^ 0 = 1"
paulson@3390
    16
  "p ^ (Suc n) = (p::nat) * (p ^ n)"
paulson@3390
    17
  
berghofe@5183
    18
primrec
paulson@3390
    19
  binomial_0   "(0     choose k) = (if k = 0 then 1 else 0)"
paulson@3390
    20
paulson@3390
    21
  binomial_Suc "(Suc n choose k) =
wenzelm@4628
    22
                (if k = 0 then 1 else (n choose (k - 1)) + (n choose k))"
paulson@3390
    23
paulson@3390
    24
end
paulson@3390
    25