equal
deleted
inserted
replaced
801 constdefs |
801 constdefs |
802 setsum :: "('a => 'b) => 'a set => 'b::comm_monoid_add" |
802 setsum :: "('a => 'b) => 'a set => 'b::comm_monoid_add" |
803 "setsum f A == if finite A then fold (op +) f 0 A else 0" |
803 "setsum f A == if finite A then fold (op +) f 0 A else 0" |
804 |
804 |
805 abbreviation |
805 abbreviation |
806 Setsum ("\<Sum>_" [1000] 999) |
806 Setsum ("\<Sum>_" [1000] 999) where |
807 "\<Sum>A == setsum (%x. x) A" |
807 "\<Sum>A == setsum (%x. x) A" |
808 |
808 |
809 text{* Now: lot's of fancy syntax. First, @{term "setsum (%x. e) A"} is |
809 text{* Now: lot's of fancy syntax. First, @{term "setsum (%x. e) A"} is |
810 written @{text"\<Sum>x\<in>A. e"}. *} |
810 written @{text"\<Sum>x\<in>A. e"}. *} |
811 |
811 |
1273 constdefs |
1273 constdefs |
1274 setprod :: "('a => 'b) => 'a set => 'b::comm_monoid_mult" |
1274 setprod :: "('a => 'b) => 'a set => 'b::comm_monoid_mult" |
1275 "setprod f A == if finite A then fold (op *) f 1 A else 1" |
1275 "setprod f A == if finite A then fold (op *) f 1 A else 1" |
1276 |
1276 |
1277 abbreviation |
1277 abbreviation |
1278 Setprod ("\<Prod>_" [1000] 999) |
1278 Setprod ("\<Prod>_" [1000] 999) where |
1279 "\<Prod>A == setprod (%x. x) A" |
1279 "\<Prod>A == setprod (%x. x) A" |
1280 |
1280 |
1281 syntax |
1281 syntax |
1282 "_setprod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult" ("(3PROD _:_. _)" [0, 51, 10] 10) |
1282 "_setprod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult" ("(3PROD _:_. _)" [0, 51, 10] 10) |
1283 syntax (xsymbols) |
1283 syntax (xsymbols) |