diff -r ed18feb34c07 -r fae6051ec192 src/CTT/Bool.thy --- a/src/CTT/Bool.thy Sun Apr 09 19:03:55 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -(* Title: CTT/Bool.thy - Author: Lawrence C Paulson, Cambridge University Computer Laboratory - Copyright 1991 University of Cambridge -*) - -section \The two-element type (booleans and conditionals)\ - -theory Bool - imports CTT -begin - -definition Bool :: "t" - where "Bool \ T+T" - -definition true :: "i" - where "true \ inl(tt)" - -definition false :: "i" - where "false \ inr(tt)" - -definition cond :: "[i,i,i]\i" - where "cond(a,b,c) \ when(a, \_. b, \_. c)" - -lemmas bool_defs = Bool_def true_def false_def cond_def - - -subsection \Derivation of rules for the type \Bool\\ - -text \Formation rule.\ -lemma boolF: "Bool type" - unfolding bool_defs by typechk - -text \Introduction rules for \true\, \false\.\ - -lemma boolI_true: "true : Bool" - unfolding bool_defs by typechk - -lemma boolI_false: "false : Bool" - unfolding bool_defs by typechk - -text \Elimination rule: typing of \cond\.\ -lemma boolE: "\p:Bool; a : C(true); b : C(false)\ \ cond(p,a,b) : C(p)" - unfolding bool_defs - apply (typechk; erule TE) - apply typechk - done - -lemma boolEL: "\p = q : Bool; a = c : C(true); b = d : C(false)\ - \ cond(p,a,b) = cond(q,c,d) : C(p)" - unfolding bool_defs - apply (rule PlusEL) - apply (erule asm_rl refl_elem [THEN TEL])+ - done - -text \Computation rules for \true\, \false\.\ - -lemma boolC_true: "\a : C(true); b : C(false)\ \ cond(true,a,b) = a : C(true)" - unfolding bool_defs - apply (rule comp_rls) - apply typechk - apply (erule_tac [!] TE) - apply typechk - done - -lemma boolC_false: "\a : C(true); b : C(false)\ \ cond(false,a,b) = b : C(false)" - unfolding bool_defs - apply (rule comp_rls) - apply typechk - apply (erule_tac [!] TE) - apply typechk - done - -end