(* Title: CTT/ex/Elimination.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Copyright 1991 University of Cambridge
Some examples taken from P. Martin-Löf, Intuitionistic type theory (Bibliopolis, 1984).
*)
section \<open>Examples with elimination rules\<close>
theory Elimination imports"../CTT" begin
text\<open>This finds the functions fst and snd!\<close>
schematic_goal [folded basic_defs]: "A type \ ?a : (A \ A) \ A" apply pc done
schematic_goal [folded basic_defs]: "A type \ ?a : (A \ A) \ A" apply pc back done
text\<open>Double negation of the Excluded Middle\<close>
schematic_goal "A type \ ?a : ((A + (A\F)) \ F) \ F" apply intr apply (rule ProdE) apply assumption apply pc done
text\<open>Experiment: the proof above in Isar\<close> lemma assumes"A type"shows"(\<^bold>\f. f ` inr(\<^bold>\y. f ` inl(y))) : ((A + (A\F)) \ F) \ F" proof intr fix f assume f: "f : A + (A \ F) \ F" with assms have"inr(\<^bold>\y. f ` inl(y)) : A + (A \ F)" by pc thenshow"f ` inr(\<^bold>\y. f ` inl(y)) : F" by (rule ProdE [OF f]) qed (rule assms)+
schematic_goal "\A type; B type\ \ ?a : (A \ B) \ (B \ A)" apply pc done (*The sequent version (ITT) could produce an interesting alternative
by backtracking. No longer.*)
text\<open>Binary sums and products\<close>
schematic_goal "\A type; B type; C type\ \ ?a : (A + B \ C) \ (A \ C) \ (B \ C)" apply pc done
(*A distributive law*)
schematic_goal "\A type; B type; C type\ \ ?a : A \ (B + C) \ (A \ B + A \ C)" by pc
text\<open>Martin-Löf (1984), page 48: axiom of sum-elimination (uncurry)\<close>
schematic_goal "\A type; B type; C type\ \ ?a : (A \ (B \ C)) \ (A \ B \ C)" apply pc done
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.