diff -r 5b067c681989 -r b4b11391c676 src/HOL/NSA/StarDef.thy --- a/src/HOL/NSA/StarDef.thy Wed Dec 30 11:32:56 2015 +0100 +++ b/src/HOL/NSA/StarDef.thy Wed Dec 30 11:37:29 2015 +0100 @@ -2,13 +2,13 @@ Author : Jacques D. Fleuriot and Brian Huffman *) -section {* Construction of Star Types Using Ultrafilters *} +section \Construction of Star Types Using Ultrafilters\ theory StarDef imports Free_Ultrafilter begin -subsection {* A Free Ultrafilter over the Naturals *} +subsection \A Free Ultrafilter over the Naturals\ definition FreeUltrafilterNat :: "nat filter" ("\") where @@ -24,7 +24,7 @@ interpretation FreeUltrafilterNat: freeultrafilter FreeUltrafilterNat by (rule freeultrafilter_FreeUltrafilterNat) -subsection {* Definition of @{text star} type constructor *} +subsection \Definition of \star\ type constructor\ definition starrel :: "((nat \ 'a) \ (nat \ 'a)) set" where @@ -49,7 +49,7 @@ lemma ex_star_eq: "(\x. P x) = (\X. P (star_n X))" by (auto, rule_tac x=x in star_cases, auto) -text {* Proving that @{term starrel} is an equivalence relation *} +text \Proving that @{term starrel} is an equivalence relation\ lemma starrel_iff [iff]: "((X,Y) \ starrel) = (eventually (\n. X n = Y n) \)" by (simp add: starrel_def) @@ -71,23 +71,23 @@ by (simp add: star_n_def Abs_star_inject starrel_in_star equiv_starrel_iff) -subsection {* Transfer principle *} +subsection \Transfer principle\ -text {* This introduction rule starts each transfer proof. *} +text \This introduction rule starts each transfer proof.\ lemma transfer_start: "P \ eventually (\n. Q) \ \ Trueprop P \ Trueprop Q" by (simp add: FreeUltrafilterNat.proper) -text {*Initialize transfer tactic.*} +text \Initialize transfer tactic.\ ML_file "transfer.ML" -method_setup transfer = {* +method_setup transfer = \ Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (Transfer_Principle.transfer_tac ctxt ths)) -*} "transfer principle" +\ "transfer principle" -text {* Transfer introduction rules. *} +text \Transfer introduction rules.\ lemma transfer_ex [transfer_intro]: "\\X. p (star_n X) \ eventually (\n. P n (X n)) \\ @@ -152,7 +152,7 @@ by (simp add: FreeUltrafilterNat.proper) -subsection {* Standard elements *} +subsection \Standard elements\ definition star_of :: "'a \ 'a star" where @@ -162,8 +162,8 @@ Standard :: "'a star set" where "Standard = range star_of" -text {* Transfer tactic should remove occurrences of @{term star_of} *} -setup {* Transfer_Principle.add_const @{const_name star_of} *} +text \Transfer tactic should remove occurrences of @{term star_of}\ +setup \Transfer_Principle.add_const @{const_name star_of}\ declare star_of_def [transfer_intro] @@ -174,7 +174,7 @@ by (simp add: Standard_def) -subsection {* Internal functions *} +subsection \Internal functions\ definition Ifun :: "('a \ 'b) star \ 'a star \ 'b star" ("_ \ _" [300,301] 300) where @@ -189,8 +189,8 @@ by (simp add: Ifun_def star_n_def Abs_star_inverse starrel_in_star UN_equiv_class2 [OF equiv_starrel equiv_starrel Ifun_congruent2]) -text {* Transfer tactic should remove occurrences of @{term Ifun} *} -setup {* Transfer_Principle.add_const @{const_name Ifun} *} +text \Transfer tactic should remove occurrences of @{term Ifun}\ +setup \Transfer_Principle.add_const @{const_name Ifun}\ lemma transfer_Ifun [transfer_intro]: "\f \ star_n F; x \ star_n X\ \ f \ x \ star_n (\n. F n (X n))" @@ -203,7 +203,7 @@ "\f \ Standard; x \ Standard\ \ f \ x \ Standard" by (auto simp add: Standard_def) -text {* Nonstandard extensions of functions *} +text \Nonstandard extensions of functions\ definition starfun :: "('a \ 'b) \ ('a star \ 'b star)" ("*f* _" [80] 80) where @@ -285,7 +285,7 @@ qed -subsection {* Internal predicates *} +subsection \Internal predicates\ definition unstar :: "bool star \ bool" where "unstar b \ b = star_of True" @@ -296,8 +296,8 @@ lemma unstar_star_of [simp]: "unstar (star_of p) = p" by (simp add: unstar_def star_of_inject) -text {* Transfer tactic should remove occurrences of @{term unstar} *} -setup {* Transfer_Principle.add_const @{const_name unstar} *} +text \Transfer tactic should remove occurrences of @{term unstar}\ +setup \Transfer_Principle.add_const @{const_name unstar}\ lemma transfer_unstar [transfer_intro]: "p \ star_n P \ unstar p \ eventually P \" @@ -328,7 +328,7 @@ by (transfer, rule refl) -subsection {* Internal sets *} +subsection \Internal sets\ definition Iset :: "'a set star \ 'a star set" where @@ -338,8 +338,8 @@ "(star_n X \ Iset (star_n A)) = (eventually (\n. X n \ A n) \)" by (simp add: Iset_def starP2_star_n) -text {* Transfer tactic should remove occurrences of @{term Iset} *} -setup {* Transfer_Principle.add_const @{const_name Iset} *} +text \Transfer tactic should remove occurrences of @{term Iset}\ +setup \Transfer_Principle.add_const @{const_name Iset}\ lemma transfer_mem [transfer_intro]: "\x \ star_n X; a \ Iset (star_n A)\ @@ -370,7 +370,7 @@ "\a \ star_n A\ \ Iset a \ Iset (star_n (\n. A n))" by simp -text {* Nonstandard extensions of sets. *} +text \Nonstandard extensions of sets.\ definition starset :: "'a set \ 'a star set" ("*s* _" [80] 80) where @@ -423,7 +423,7 @@ starset_subset starset_eq -subsection {* Syntactic classes *} +subsection \Syntactic classes\ instantiation star :: (zero) zero begin @@ -557,7 +557,7 @@ star_le_def star_less_def star_abs_def star_sgn_def star_mod_def -text {* Class operations preserve standard elements *} +text \Class operations preserve standard elements\ lemma Standard_zero: "0 \ Standard" by (simp add: star_zero_def) @@ -595,7 +595,7 @@ Standard_mult Standard_divide Standard_inverse Standard_abs Standard_mod -text {* @{term star_of} preserves class operations *} +text \@{term star_of} preserves class operations\ lemma star_of_add: "star_of (x + y) = star_of x + star_of y" by transfer (rule refl) @@ -621,7 +621,7 @@ lemma star_of_abs: "star_of \x\ = \star_of x\" by transfer (rule refl) -text {* @{term star_of} preserves numerals *} +text \@{term star_of} preserves numerals\ lemma star_of_zero: "star_of 0 = 0" by transfer (rule refl) @@ -629,7 +629,7 @@ lemma star_of_one: "star_of 1 = 1" by transfer (rule refl) -text {* @{term star_of} preserves orderings *} +text \@{term star_of} preserves orderings\ lemma star_of_less: "(star_of x < star_of y) = (x < y)" by transfer (rule refl) @@ -640,7 +640,7 @@ lemma star_of_eq: "(star_of x = star_of y) = (x = y)" by transfer (rule refl) -text{*As above, for 0*} +text\As above, for 0\ lemmas star_of_0_less = star_of_less [of 0, simplified star_of_zero] lemmas star_of_0_le = star_of_le [of 0, simplified star_of_zero] @@ -650,7 +650,7 @@ lemmas star_of_le_0 = star_of_le [of _ 0, simplified star_of_zero] lemmas star_of_eq_0 = star_of_eq [of _ 0, simplified star_of_zero] -text{*As above, for 1*} +text\As above, for 1\ lemmas star_of_1_less = star_of_less [of 1, simplified star_of_one] lemmas star_of_1_le = star_of_le [of 1, simplified star_of_one] @@ -671,7 +671,7 @@ star_of_1_less star_of_1_le star_of_1_eq star_of_less_1 star_of_le_1 star_of_eq_1 -subsection {* Ordering and lattice classes *} +subsection \Ordering and lattice classes\ instance star :: (order) order apply (intro_classes) @@ -752,7 +752,7 @@ by transfer (rule refl) -subsection {* Ordered group classes *} +subsection \Ordered group classes\ instance star :: (semigroup_add) semigroup_add by (intro_classes, transfer, rule add.assoc) @@ -815,7 +815,7 @@ instance star :: (linordered_cancel_ab_semigroup_add) linordered_cancel_ab_semigroup_add .. -subsection {* Ring and field classes *} +subsection \Ring and field classes\ instance star :: (semiring) semiring by (intro_classes; transfer) (fact distrib_right distrib_left)+ @@ -913,7 +913,7 @@ instance star :: (linordered_idom) linordered_idom .. instance star :: (linordered_field) linordered_field .. -subsection {* Power *} +subsection \Power\ lemma star_power_def [transfer_unfold]: "(op ^) \ \x n. ( *f* (\x. x ^ n)) x" @@ -940,7 +940,7 @@ by transfer (rule refl) -subsection {* Number classes *} +subsection \Number classes\ instance star :: (numeral) numeral .. @@ -1046,7 +1046,7 @@ declare divmod_algorithm_code [where ?'a = "'a::semiring_numeral_div star", code] -subsection {* Finite class *} +subsection \Finite class\ lemma starset_finite: "finite A \ *s* A = star_of ` A" by (erule finite_induct, simp_all)