# HG changeset patch # User bulwahn # Date 1333092738 -7200 # Node ID d3168cf76258551e926464c3363e74b486c06363 # Parent 34e8b7347ddae5904e386ba9f21d58cde130a14f# Parent 69cee87927f074ac208539d654993843aa1f9f72 merged diff -r 34e8b7347dda -r d3168cf76258 NEWS --- a/NEWS Fri Mar 30 08:44:01 2012 +0200 +++ b/NEWS Fri Mar 30 09:32:18 2012 +0200 @@ -163,7 +163,8 @@ mod_mult_distrib2 ~> mult_mod_right * More default pred/set conversions on a couple of relation operations -and predicates. Consolidation of some relation theorems: +and predicates. Added powers of predicate relations. +Consolidation of some relation theorems: converse_def ~> converse_unfold rel_comp_def ~> rel_comp_unfold diff -r 34e8b7347dda -r d3168cf76258 src/HOL/Transitive_Closure.thy --- a/src/HOL/Transitive_Closure.thy Fri Mar 30 08:44:01 2012 +0200 +++ b/src/HOL/Transitive_Closure.thy Fri Mar 30 09:32:18 2012 +0200 @@ -710,14 +710,24 @@ overloading relpow == "compow :: nat \ ('a \ 'a) set \ ('a \ 'a) set" + relpowp == "compow :: nat \ ('a \ 'a \ bool) \ ('a \ 'a \ bool)" begin primrec relpow :: "nat \ ('a \ 'a) set \ ('a \ 'a) set" where "relpow 0 R = Id" | "relpow (Suc n) R = (R ^^ n) O R" +primrec relpowp :: "nat \ ('a \ 'a \ bool) \ ('a \ 'a \ bool)" where + "relpowp 0 R = HOL.eq" + | "relpowp (Suc n) R = (R ^^ n) OO R" + end +lemma relpowp_relpow_eq [pred_set_conv]: + fixes R :: "'a rel" + shows "(\x y. (x, y) \ R) ^^ n = (\x y. (x, y) \ R ^^ n)" + by (induct n) (simp_all add: rel_compp_rel_comp_eq) + text {* for code generation *} definition relpow :: "nat \ ('a \ 'a) set \ ('a \ 'a) set" where