\
\ subst_rec(u,Var(n),p) = Var(n #- 1)";
by (asm_simp_tac (simpset() addsimps [subst_rec_def]) 1);
qed "subst_gt";
-Goal "[|n:nat; u:redexes; p:nat; n \
+Goal "[|n:nat; u:redexes; p:nat; n
\
\ subst_rec(u,Var(n),p) = Var(n)";
by (asm_simp_tac (simpset() addsimps [subst_rec_def, gt_not_eq, leI]) 1);
qed "subst_lt";
-Goal "[|p:nat; u:redexes|]==> \
+Goal "[|p:nat; u:redexes|] ==> \
\ subst_rec(u,Fun(t),p) = Fun(subst_rec(lift(u),t,succ(p))) ";
by (asm_simp_tac (simpset() addsimps [subst_rec_def]) 1);
qed "subst_Fun";
-Goal "[|p:nat; u:redexes|]==> \
+Goal "[|p:nat; u:redexes|] ==> \
\ subst_rec(u,App(b,f,a),p) = App(b,subst_rec(u,f,p),subst_rec(u,a,p))";
by (asm_simp_tac (simpset() addsimps [subst_rec_def]) 1);
qed "subst_App";
@@ -133,7 +135,7 @@
by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [lift_rec_Var, leI])));
qed "lift_lift_rec";
-Goal "[|u:redexes; n:nat|]==> \
+Goal "[|u:redexes; n:nat|] ==> \
\ lift_rec(lift(u),succ(n)) = lift(lift_rec(u,n))";
by (asm_simp_tac (simpset() addsimps [lift_lift_rec]) 1);
qed "lift_lift";
@@ -158,7 +160,7 @@
by (asm_simp_tac (simpset() addsimps [leI]) 1);
qed "lift_rec_subst_rec";
-Goal "[|v:redexes; u:redexes; n:nat|]==> \
+Goal "[|v:redexes; u:redexes; n:nat|] ==> \
\ lift_rec(u/v,n) = lift_rec(u,n)/lift_rec(v,succ(n))";
by (asm_simp_tac (simpset() addsimps [lift_rec_subst_rec]) 1);
qed "lift_subst";
@@ -221,7 +223,7 @@
qed "subst_rec_subst_rec";
-Goal "[|v:redexes; u:redexes; w:redexes; n:nat|]==> \
+Goal "[|v:redexes; u:redexes; w:redexes; n:nat|] ==> \
\ subst_rec(w,u,n)/subst_rec(lift(w),v,succ(n)) = subst_rec(w,u/v,n)";
by (asm_simp_tac (simpset() addsimps [subst_rec_subst_rec]) 1);
qed "substitution";
@@ -232,7 +234,7 @@
(* ------------------------------------------------------------------------- *)
-Goal "[|n:nat; u ~ v|]==> ALL m:nat. lift_rec(u,m) ~ lift_rec(v,m)";
+Goal "[|n:nat; u ~ v|] ==> ALL m:nat. lift_rec(u,m) ~ lift_rec(v,m)";
by (etac Scomp.induct 1);
by (ALLGOALS(asm_simp_tac (simpset() addsimps [comp_refl])));
qed "lift_rec_preserve_comp";
diff -r 0f8ab32093ae -r 2d8f3e1f1151 src/ZF/Resid/Substitution.thy
--- a/src/ZF/Resid/Substitution.thy Wed Jan 06 15:00:12 1999 +0100
+++ b/src/ZF/Resid/Substitution.thy Thu Jan 07 10:56:05 1999 +0100
@@ -17,7 +17,7 @@
lift_rec :: [i,i]=> i
"lift_rec(r,k) == lift_aux(r)`k"
- subst_rec :: [i,i,i]=> i
+ subst_rec :: [i,i,i]=> i (**NOTE THE ARGUMENT ORDER BELOW**)
"subst_rec(u,r,k) == subst_aux(r)`u`k"
translations
@@ -29,7 +29,7 @@
in the recursive calls ***)
primrec
- "lift_aux(Var(i)) = (lam k:nat. if(i o) => i (binder "THE " 10)
- if :: [o, i, i] => i
+ If :: [o, i, i] => i ("(if (_)/ then (_)/ else (_))" [10] 10)
+
+syntax
+ old_if :: [o, i, i] => i ("if '(_,_,_')")
+translations
+ "if(P,a,b)" => "If(P,a,b)"
+
+
+consts
(* Finite Sets *)
Upair, cons :: [i, i] => i
diff -r 0f8ab32093ae -r 2d8f3e1f1151 src/ZF/equalities.ML
--- a/src/ZF/equalities.ML Wed Jan 06 15:00:12 1999 +0100
+++ b/src/ZF/equalities.ML Thu Jan 07 10:56:05 1999 +0100
@@ -602,7 +602,8 @@
by (Blast_tac 1);
qed "Collect_Diff";
-Goal "{x:cons(a,B). P(x)} = if(P(a), cons(a, {x:B. P(x)}), {x:B. P(x)})";
+Goal "{x:cons(a,B). P(x)} = \
+\ (if P(a) then cons(a, {x:B. P(x)}) else {x:B. P(x)})";
by (simp_tac (simpset() addsplits [split_if]) 1);
by (Blast_tac 1);
qed "Collect_cons";
diff -r 0f8ab32093ae -r 2d8f3e1f1151 src/ZF/ex/Mutil.ML
--- a/src/ZF/ex/Mutil.ML Wed Jan 06 15:00:12 1999 +0100
+++ b/src/ZF/ex/Mutil.ML Thu Jan 07 10:56:05 1999 +0100
@@ -32,7 +32,7 @@
Goalw [evnodd_def]
"evnodd(cons(,C), b) = \
-\ if((i#+j) mod 2 = b, cons(, evnodd(C,b)), evnodd(C,b))";
+\ (if (i#+j) mod 2 = b then cons(, evnodd(C,b)) else evnodd(C,b))";
by (asm_simp_tac (simpset() addsimps [evnodd_def, Collect_cons]) 1);
qed "evnodd_cons";
diff -r 0f8ab32093ae -r 2d8f3e1f1151 src/ZF/ex/PropLog.ML
--- a/src/ZF/ex/PropLog.ML Wed Jan 06 15:00:12 1999 +0100
+++ b/src/ZF/ex/PropLog.ML Thu Jan 07 10:56:05 1999 +0100
@@ -126,7 +126,7 @@
qed "Imp_Fls";
(*Typical example of strengthening the induction formula*)
-Goal "p: prop ==> hyps(p,t) |- if(is_true(p,t), p, p=>Fls)";
+Goal "p: prop ==> hyps(p,t) |- (if is_true(p,t) then p else p=>Fls)";
by (Simp_tac 1);
by (etac prop.induct 1);
by (ALLGOALS (asm_simp_tac (simpset() addsimps [thms_I, thms.H])));
diff -r 0f8ab32093ae -r 2d8f3e1f1151 src/ZF/ex/PropLog.thy
--- a/src/ZF/ex/PropLog.thy Wed Jan 06 15:00:12 1999 +0100
+++ b/src/ZF/ex/PropLog.thy Thu Jan 07 10:56:05 1999 +0100
@@ -56,12 +56,13 @@
primrec (** A finite set of hypotheses from t and the Vars in p **)
"hyps(Fls, t) = 0"
- "hyps(Var(v), t) = if(v:t, {#v}, {#v=>Fls})"
+ "hyps(Var(v), t) = (if v:t then {#v} else {#v=>Fls})"
"hyps(p=>q, t) = hyps(p,t) Un hyps(q,t)"
primrec (** Semantics of propositional logic **)
"is_true_fun(Fls, t) = 0"
- "is_true_fun(Var(v), t) = if(v:t, 1, 0)"
- "is_true_fun(p=>q, t) = if(is_true_fun(p,t)=1, is_true_fun(q,t), 1)"
+ "is_true_fun(Var(v), t) = (if v:t then 1 else 0)"
+ "is_true_fun(p=>q, t) = (if is_true_fun(p,t)=1 then is_true_fun(q,t)
+ else 1)"
end
diff -r 0f8ab32093ae -r 2d8f3e1f1151 src/ZF/upair.ML
--- a/src/ZF/upair.ML Wed Jan 06 15:00:12 1999 +0100
+++ b/src/ZF/upair.ML Thu Jan 07 10:56:05 1999 +0100
@@ -234,34 +234,35 @@
(*** if -- a conditional expression for formulae ***)
-Goalw [if_def] "if(True,a,b) = a";
+Goalw [if_def] "(if True then a else b) = a";
by (Blast_tac 1);
qed "if_true";
-Goalw [if_def] "if(False,a,b) = b";
+Goalw [if_def] "(if False then a else b) = b";
by (Blast_tac 1);
qed "if_false";
(*Never use with case splitting, or if P is known to be true or false*)
val prems = Goalw [if_def]
- "[| P<->Q; Q ==> a=c; ~Q ==> b=d |] ==> if(P,a,b) = if(Q,c,d)";
+ "[| P<->Q; Q ==> a=c; ~Q ==> b=d |] \
+\ ==> (if P then a else b) = (if Q then c else d)";
by (simp_tac (simpset() addsimps prems addcongs [conj_cong]) 1);
qed "if_cong";
(*Not needed for rewriting, since P would rewrite to True anyway*)
-Goalw [if_def] "P ==> if(P,a,b) = a";
+Goalw [if_def] "P ==> (if P then a else b) = a";
by (Blast_tac 1);
qed "if_P";
(*Not needed for rewriting, since P would rewrite to False anyway*)
-Goalw [if_def] "~P ==> if(P,a,b) = b";
+Goalw [if_def] "~P ==> (if P then a else b) = b";
by (Blast_tac 1);
qed "if_not_P";
Addsimps [if_true, if_false];
qed_goal "split_if" thy
- "P(if(Q,x,y)) <-> ((Q --> P(x)) & (~Q --> P(y)))"
+ "P(if Q then x else y) <-> ((Q --> P(x)) & (~Q --> P(y)))"
(fn _=> [ (case_tac "Q" 1),
(Asm_simp_tac 1),
(Asm_simp_tac 1) ]);
@@ -280,11 +281,11 @@
split_if_mem1, split_if_mem2];
(*Logically equivalent to split_if_mem2*)
-qed_goal "if_iff" thy "a: if(P,x,y) <-> P & a:x | ~P & a:y"
+qed_goal "if_iff" thy "a: (if P then x else y) <-> P & a:x | ~P & a:y"
(fn _=> [ (simp_tac (simpset() addsplits [split_if]) 1) ]);
qed_goal "if_type" thy
- "[| P ==> a: A; ~P ==> b: A |] ==> if(P,a,b): A"
+ "[| P ==> a: A; ~P ==> b: A |] ==> (if P then a else b): A"
(fn prems=> [ (simp_tac
(simpset() addsimps prems addsplits [split_if]) 1) ]);