(* A simple comment *) theory Demo1 imports Main begin text {* This is also a comment but it generates nice \LaTeX-text! *} text {* Note that free variables (eg x), bound variables (eg %n) and constants (eg Suc) are displayed differently. *} term "x" term "Suc x" term "Succ x" term "Suc x = Succ y" prop "Suc y = Suc y" text{* To display types: menu Isabelle/Isar -> Settings -> Show Types *} text {* Warning: 0 and + are overloaded: *} prop "n + n = 0" term "0" prop "(n::nat) + n = 0" prop "n + n = Suc m" text{* A bound variable: *} prop "map (\n. Suc n + 1) [0, 1] = [2, 3]"; prop "\ a; b \ \ a \ b" (* Try this: *) (* term "Suc n = True" *) (* Terms must be type correct! *) lemma lemma_a : "a \ b \ a \ b" apply (auto) done lemma lemma_b : "((a \ b) \ c) = ((a \ c) \ (b \ c))" apply (auto) done lemma lemma_c : "(a \ b) \ c = (a \ c) \ (b \ c)" (* Note the counter-example. Why? *) sorry end