src/ZF/Update.ML
author nipkow
Mon, 06 Aug 2001 13:43:24 +0200
changeset 11464 ddea204de5bc
parent 9907 473a6604da94
permissions -rw-r--r--
turned translation for 1::nat into def. introduced 1' and replaced most occurrences of 1 by 1'.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9907
473a6604da94 tuned ML code (the_context, bind_thms(s));
wenzelm
parents: 6068
diff changeset
     1
(*  Title:      ZF/Update.ML
5157
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     2
    ID:         $Id$
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     5
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     6
Function updates: like theory Map, but for ordinary functions
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     7
*)
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
     8
6068
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 6048
diff changeset
     9
Goal "f(x:=y) ` z = (if z=x then y else f`z)";
5157
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    10
by (simp_tac (simpset() addsimps [update_def]) 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    11
by (case_tac "z : domain(f)" 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    12
by (Asm_simp_tac 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    13
by (asm_simp_tac (simpset() addsimps [apply_0]) 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    14
qed "update_apply";
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    15
Addsimps [update_apply];
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    16
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    17
Goalw [update_def] "[| f`x = y;  f: Pi(A,B);  x: A |] ==> f(x:=y) = f";
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    18
by (asm_simp_tac (simpset() addsimps [domain_of_fun, cons_absorb]) 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    19
by (rtac fun_extension 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    20
by (best_tac (claset() addIs [apply_type, if_type, lam_type]) 1);
5168
adafef6eb295 isatool expandshort;
wenzelm
parents: 5157
diff changeset
    21
by (assume_tac 1);
5157
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    22
by (Asm_simp_tac 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    23
qed "update_idem";
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    24
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    25
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    26
(* [| f: Pi(A, B); x:A |] ==> f(x := f`x) = f *)
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    27
Addsimps [refl RS update_idem];
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    28
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    29
Goalw [update_def] "domain(f(x:=y)) = cons(x, domain(f))";
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    30
by (Asm_simp_tac 1);
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    31
qed "domain_update";
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    32
Addsimps [domain_update];
6e03de8ec2b4 as in HOL
paulson
parents:
diff changeset
    33
6048
88e6e55dd168 new theorem update_type
paulson
parents: 5168
diff changeset
    34
Goalw [update_def] "[| f: A -> B;  x : A;  y: B |] ==> f(x:=y) : A -> B";
88e6e55dd168 new theorem update_type
paulson
parents: 5168
diff changeset
    35
by (asm_simp_tac (simpset() addsimps [domain_of_fun, cons_absorb, 
88e6e55dd168 new theorem update_type
paulson
parents: 5168
diff changeset
    36
				      apply_funtype, lam_type]) 1);
88e6e55dd168 new theorem update_type
paulson
parents: 5168
diff changeset
    37
qed "update_type";
88e6e55dd168 new theorem update_type
paulson
parents: 5168
diff changeset
    38
88e6e55dd168 new theorem update_type
paulson
parents: 5168
diff changeset
    39