# HG changeset patch # User wenzelm # Date 1434810236 -7200 # Node ID 7fb5b7dc8332d14e441f473a5ec74dd10ea15e13 # Parent 9cc91b8a6489c0617f52c2bdc7d45b250dedc4b9 misc tuning; diff -r 9cc91b8a6489 -r 7fb5b7dc8332 src/HOL/Induct/ABexp.thy --- a/src/HOL/Induct/ABexp.thy Sat Jun 20 16:08:47 2015 +0200 +++ b/src/HOL/Induct/ABexp.thy Sat Jun 20 16:23:56 2015 +0200 @@ -22,8 +22,8 @@ text \\medskip Evaluation of arithmetic and boolean expressions\ -primrec evala :: "('a => nat) => 'a aexp => nat" - and evalb :: "('a => nat) => 'a bexp => bool" +primrec evala :: "('a \ nat) \ 'a aexp \ nat" + and evalb :: "('a \ nat) \ 'a bexp \ bool" where "evala env (IF b a1 a2) = (if evalb env b then evala env a1 else evala env a2)" | "evala env (Sum a1 a2) = evala env a1 + evala env a2" @@ -38,8 +38,8 @@ text \\medskip Substitution on arithmetic and boolean expressions\ -primrec substa :: "('a => 'b aexp) => 'a aexp => 'b aexp" - and substb :: "('a => 'b aexp) => 'a bexp => 'b bexp" +primrec substa :: "('a \ 'b aexp) \ 'a aexp \ 'b aexp" + and substb :: "('a \ 'b aexp) \ 'a bexp \ 'b bexp" where "substa f (IF b a1 a2) = IF (substb f b) (substa f a1) (substa f a2)" | "substa f (Sum a1 a2) = Sum (substa f a1) (substa f a2)" diff -r 9cc91b8a6489 -r 7fb5b7dc8332 src/HOL/Induct/Ordinals.thy --- a/src/HOL/Induct/Ordinals.thy Sat Jun 20 16:08:47 2015 +0200 +++ b/src/HOL/Induct/Ordinals.thy Sat Jun 20 16:23:56 2015 +0200 @@ -17,39 +17,39 @@ datatype ordinal = Zero | Succ ordinal - | Limit "nat => ordinal" + | Limit "nat \ ordinal" -primrec pred :: "ordinal => nat => ordinal option" +primrec pred :: "ordinal \ nat \ ordinal option" where "pred Zero n = None" | "pred (Succ a) n = Some a" | "pred (Limit f) n = Some (f n)" -abbreviation (input) iter :: "('a => 'a) => nat => ('a => 'a)" +abbreviation (input) iter :: "('a \ 'a) \ nat \ ('a \ 'a)" where "iter f n \ f ^^ n" -definition OpLim :: "(nat => (ordinal => ordinal)) => (ordinal => ordinal)" +definition OpLim :: "(nat \ (ordinal \ ordinal)) \ (ordinal \ ordinal)" where "OpLim F a = Limit (\n. F n a)" -definition OpItw :: "(ordinal => ordinal) => (ordinal => ordinal)" ("\") +definition OpItw :: "(ordinal \ ordinal) \ (ordinal \ ordinal)" ("\") where "\f = OpLim (iter f)" -primrec cantor :: "ordinal => ordinal => ordinal" +primrec cantor :: "ordinal \ ordinal \ ordinal" where "cantor a Zero = Succ a" | "cantor a (Succ b) = \(\x. cantor x b) a" | "cantor a (Limit f) = Limit (\n. cantor a (f n))" -primrec Nabla :: "(ordinal => ordinal) => (ordinal => ordinal)" ("\") +primrec Nabla :: "(ordinal \ ordinal) \ (ordinal \ ordinal)" ("\") where "\f Zero = f Zero" | "\f (Succ a) = f (Succ (\f a))" | "\f (Limit h) = Limit (\n. \f (h n))" -definition deriv :: "(ordinal => ordinal) => (ordinal => ordinal)" +definition deriv :: "(ordinal \ ordinal) \ (ordinal \ ordinal)" where "deriv f = \(\f)" -primrec veblen :: "ordinal => ordinal => ordinal" +primrec veblen :: "ordinal \ ordinal \ ordinal" where "veblen Zero = \(OpLim (iter (cantor Zero)))" | "veblen (Succ a) = \(OpLim (iter (veblen a)))" diff -r 9cc91b8a6489 -r 7fb5b7dc8332 src/HOL/Induct/Sigma_Algebra.thy --- a/src/HOL/Induct/Sigma_Algebra.thy Sat Jun 20 16:08:47 2015 +0200 +++ b/src/HOL/Induct/Sigma_Algebra.thy Sat Jun 20 16:23:56 2015 +0200 @@ -14,12 +14,12 @@ \}-algebra over a given set of sets. \ -inductive_set \_algebra :: "'a set set => 'a set set" for A :: "'a set set" +inductive_set \_algebra :: "'a set set \ 'a set set" for A :: "'a set set" where - basic: "a \ A ==> a \ \_algebra A" + basic: "a \ A \ a \ \_algebra A" | UNIV: "UNIV \ \_algebra A" -| complement: "a \ \_algebra A ==> -a \ \_algebra A" -| Union: "(!!i::nat. a i \ \_algebra A) ==> (\i. a i) \ \_algebra A" +| complement: "a \ \_algebra A \ -a \ \_algebra A" +| Union: "(\i::nat. a i \ \_algebra A) \ (\i. a i) \ \_algebra A" text \ The following basic facts are consequences of the closure properties @@ -36,10 +36,10 @@ qed theorem sigma_algebra_Inter: - "(!!i::nat. a i \ \_algebra A) ==> (\i. a i) \ \_algebra A" + "(\i::nat. a i \ \_algebra A) \ (\i. a i) \ \_algebra A" proof - - assume "!!i::nat. a i \ \_algebra A" - then have "!!i::nat. -(a i) \ \_algebra A" by (rule \_algebra.complement) + assume "\i::nat. a i \ \_algebra A" + then have "\i::nat. -(a i) \ \_algebra A" by (rule \_algebra.complement) then have "(\i. -(a i)) \ \_algebra A" by (rule \_algebra.Union) then have "-(\i. -(a i)) \ \_algebra A" by (rule \_algebra.complement) also have "-(\i. -(a i)) = (\i. a i)" by simp diff -r 9cc91b8a6489 -r 7fb5b7dc8332 src/HOL/Induct/Term.thy --- a/src/HOL/Induct/Term.thy Sat Jun 20 16:08:47 2015 +0200 +++ b/src/HOL/Induct/Term.thy Sat Jun 20 16:23:56 2015 +0200 @@ -15,8 +15,8 @@ text \\medskip Substitution function on terms\ -primrec subst_term :: "('a => ('a, 'b) term) => ('a, 'b) term => ('a, 'b) term" - and subst_term_list :: "('a => ('a, 'b) term) => ('a, 'b) term list => ('a, 'b) term list" +primrec subst_term :: "('a \ ('a, 'b) term) \ ('a, 'b) term \ ('a, 'b) term" + and subst_term_list :: "('a \ ('a, 'b) term) \ ('a, 'b) term list \ ('a, 'b) term list" where "subst_term f (Var a) = f a" | "subst_term f (App b ts) = App b (subst_term_list f ts)" @@ -37,8 +37,8 @@ text \\medskip Alternative induction rule\ lemma - assumes var: "!!v. P (Var v)" - and app: "!!f ts. (\t \ set ts. P t) ==> P (App f ts)" + assumes var: "\v. P (Var v)" + and app: "\f ts. (\t \ set ts. P t) \ P (App f ts)" shows term_induct2: "P t" and "\t \ set ts. P t" apply (induct t and ts rule: subst_term.induct subst_term_list.induct) diff -r 9cc91b8a6489 -r 7fb5b7dc8332 src/HOL/Induct/Tree.thy --- a/src/HOL/Induct/Tree.thy Sat Jun 20 16:08:47 2015 +0200 +++ b/src/HOL/Induct/Tree.thy Sat Jun 20 16:23:56 2015 +0200 @@ -11,9 +11,9 @@ datatype 'a tree = Atom 'a - | Branch "nat => 'a tree" + | Branch "nat \ 'a tree" -primrec map_tree :: "('a => 'b) => 'a tree => 'b tree" +primrec map_tree :: "('a \ 'b) \ 'a tree \ 'b tree" where "map_tree f (Atom a) = Atom (f a)" | "map_tree f (Branch ts) = Branch (\x. map_tree f (ts x))" @@ -21,37 +21,37 @@ lemma tree_map_compose: "map_tree g (map_tree f t) = map_tree (g \ f) t" by (induct t) simp_all -primrec exists_tree :: "('a => bool) => 'a tree => bool" +primrec exists_tree :: "('a \ bool) \ 'a tree \ bool" where "exists_tree P (Atom a) = P a" | "exists_tree P (Branch ts) = (\x. exists_tree P (ts x))" lemma exists_map: - "(!!x. P x ==> Q (f x)) ==> - exists_tree P ts ==> exists_tree Q (map_tree f ts)" + "(\x. P x \ Q (f x)) \ + exists_tree P ts \ exists_tree Q (map_tree f ts)" by (induct ts) auto subsection\The Brouwer ordinals, as in ZF/Induct/Brouwer.thy.\ -datatype brouwer = Zero | Succ "brouwer" | Lim "nat => brouwer" +datatype brouwer = Zero | Succ brouwer | Lim "nat \ brouwer" -text\Addition of ordinals\ -primrec add :: "[brouwer,brouwer] => brouwer" +text \Addition of ordinals\ +primrec add :: "brouwer \ brouwer \ brouwer" where "add i Zero = i" | "add i (Succ j) = Succ (add i j)" -| "add i (Lim f) = Lim (%n. add i (f n))" +| "add i (Lim f) = Lim (\n. add i (f n))" lemma add_assoc: "add (add i j) k = add i (add j k)" by (induct k) auto -text\Multiplication of ordinals\ -primrec mult :: "[brouwer,brouwer] => brouwer" +text \Multiplication of ordinals\ +primrec mult :: "brouwer \ brouwer \ brouwer" where "mult i Zero = Zero" | "mult i (Succ j) = add (mult i j) i" -| "mult i (Lim f) = Lim (%n. mult i (f n))" +| "mult i (Lim f) = Lim (\n. mult i (f n))" lemma add_mult_distrib: "mult i (add j k) = add (mult i j) (mult i k)" by (induct k) (auto simp add: add_assoc) @@ -59,35 +59,40 @@ lemma mult_assoc: "mult (mult i j) k = mult i (mult j k)" by (induct k) (auto simp add: add_mult_distrib) -text\We could probably instantiate some axiomatic type classes and use -the standard infix operators.\ +text \We could probably instantiate some axiomatic type classes and use + the standard infix operators.\ -subsection\A WF Ordering for The Brouwer ordinals (Michael Compton)\ + +subsection \A WF Ordering for The Brouwer ordinals (Michael Compton)\ -text\To use the function package we need an ordering on the Brouwer - ordinals. Start with a predecessor relation and form its transitive - closure.\ +text \To use the function package we need an ordering on the Brouwer + ordinals. Start with a predecessor relation and form its transitive + closure.\ -definition brouwer_pred :: "(brouwer * brouwer) set" - where "brouwer_pred = (\i. {(m,n). n = Succ m \ (EX f. n = Lim f & m = f i)})" +definition brouwer_pred :: "(brouwer \ brouwer) set" + where "brouwer_pred = (\i. {(m, n). n = Succ m \ (\f. n = Lim f \ m = f i)})" -definition brouwer_order :: "(brouwer * brouwer) set" +definition brouwer_order :: "(brouwer \ brouwer) set" where "brouwer_order = brouwer_pred^+" lemma wf_brouwer_pred: "wf brouwer_pred" - by(unfold wf_def brouwer_pred_def, clarify, induct_tac x, blast+) + unfolding wf_def brouwer_pred_def + apply clarify + apply (induct_tac x) + apply blast+ + done lemma wf_brouwer_order[simp]: "wf brouwer_order" - by(unfold brouwer_order_def, rule wf_trancl[OF wf_brouwer_pred]) - -lemma [simp]: "(j, Succ j) : brouwer_order" - by(auto simp add: brouwer_order_def brouwer_pred_def) + unfolding brouwer_order_def + by (rule wf_trancl[OF wf_brouwer_pred]) -lemma [simp]: "(f n, Lim f) : brouwer_order" - by(auto simp add: brouwer_order_def brouwer_pred_def) +lemma [simp]: "(j, Succ j) \ brouwer_order" + by (auto simp add: brouwer_order_def brouwer_pred_def) -text\Example of a general function\ +lemma [simp]: "(f n, Lim f) \ brouwer_order" + by (auto simp add: brouwer_order_def brouwer_pred_def) +text \Example of a general function\ function add2 :: "brouwer \ brouwer \ brouwer" where "add2 i Zero = i"