(* 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‹Examples with elimination rules›
theory Elimination imports"../CTT" begin
text‹This finds the functions fst and snd!›
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‹Double negation of the Excluded Middle›
schematic_goal "A type \ ?a : ((A + (A\F)) \ F) \ F" apply intr apply (rule ProdE) apply assumption apply pc done
text‹Experiment: the proof above in Isar› 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‹Binary sums and products›
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‹Martin-Löf (1984), page 48: axiom of sum-elimination (uncurry)›
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 und die Messung sind noch experimentell.