moving "let" from ZF to FOL
authorpaulson
Wed Jan 15 16:44:21 2003 +0100 (2003-01-15)
changeset 137792a34dc5cf79e
parent 13778 61272514e3b5
child 13780 af7b79271364
moving "let" from ZF to FOL
src/FOL/IFOL.thy
     1.1 --- a/src/FOL/IFOL.thy	Wed Jan 15 16:43:12 2003 +0100
     1.2 +++ b/src/FOL/IFOL.thy	Wed Jan 15 16:44:21 2003 +0100
     1.3 @@ -112,6 +112,7 @@
     1.4    iff_reflection: "(P<->Q) ==> (P==Q)"
     1.5  
     1.6  
     1.7 +
     1.8  subsection {* Lemmas and proof tools *}
     1.9  
    1.10  setup Simplifier.setup
    1.11 @@ -244,4 +245,38 @@
    1.12    mp
    1.13    trans
    1.14  
    1.15 +
    1.16 +
    1.17 +subsection {* ``Let'' declarations *}
    1.18 +
    1.19 +nonterminals letbinds letbind
    1.20 +
    1.21 +constdefs
    1.22 +  Let :: "['a::logic, 'a => 'b] => ('b::logic)"
    1.23 +    "Let(s, f) == f(s)"
    1.24 +
    1.25 +syntax
    1.26 +  "_bind"       :: "[pttrn, 'a] => letbind"           ("(2_ =/ _)" 10)
    1.27 +  ""            :: "letbind => letbinds"              ("_")
    1.28 +  "_binds"      :: "[letbind, letbinds] => letbinds"  ("_;/ _")
    1.29 +  "_Let"        :: "[letbinds, 'a] => 'a"             ("(let (_)/ in (_))" 10)
    1.30 +
    1.31 +translations
    1.32 +  "_Let(_binds(b, bs), e)"  == "_Let(b, _Let(bs, e))"
    1.33 +  "let x = a in e"          == "Let(a, %x. e)"
    1.34 +
    1.35 +
    1.36 +lemma LetI: 
    1.37 +    assumes prem: "(!!x. x=t ==> P(u(x)))"
    1.38 +    shows "P(let x=t in u(x))"
    1.39 +apply (unfold Let_def)
    1.40 +apply (rule refl [THEN prem])
    1.41 +done
    1.42 +
    1.43 +ML
    1.44 +{*
    1.45 +val Let_def = thm "Let_def";
    1.46 +val LetI = thm "LetI";
    1.47 +*}
    1.48 +
    1.49  end