(* Title: ZF/ex/NatSum.thy Author: Tobias Nipkow & Lawrence C Paulson A summation operator. sum(f,n+1) is the sum of all f(i), i=0...n. Note: n is a natural number but the sum is an integer, and f maps integers to integers Summing natural numbers, squares, cubes, etc. Originally demonstrated permutative rewriting, but add_ac is no longer needed thanks to new simprocs. Thanks to Sloane's On-Line Encyclopedia of Integer Sequences, http://www.research.att.com/¬njas/sequences/ *)
(*The sum of the first n odd numbers equals n squared.*) lemma sum_of_odds: "n ∈ nat ==> sum (λi. i $+ i $+ #1, n) = $#n $* $#n" by (induct_tac "n", auto)
(*The sum of the first n odd squares*) lemma sum_of_odd_squares: "n ∈ nat ==> #3 $* sum (λi. (i $+ i $+ #1) $* (i $+ i $+ #1), n) = $#n $* (#4 $* $#n $* $#n $- #1)" by (induct_tac "n", auto)
(*The sum of the first n odd cubes*) lemma sum_of_odd_cubes: "n ∈ nat ==> sum (λi. (i $+ i $+ #1) $* (i $+ i $+ #1) $* (i $+ i $+ #1), n) = $#n $* $#n $* (#2 $* $#n $* $#n $- #1)" by (induct_tac "n", auto)
(*The sum of the first n positive integers equals n(n+1)/2.*) lemma sum_of_naturals: "n ∈ nat ==> #2 $* sum(λi. i, succ(n)) = $#n $* $#succ(n)" by (induct_tac "n", auto)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.