theory Demo02 imports Main begin text "lambda terms" term "\x. x" text "alpha" thm refl lemma "(\x. x) = (\y. y)" apply (rule refl) done text "eta" term "\x. f x" text "beta" term "(\x. x y) t" text "beta with renaming" term "(\z. (\x. f x z)) x" text "definitions and unfold" definition my_true :: "'a \ 'b \ 'a" where "my_true \ \x y. x" definition my_false :: "'a \ 'b \ 'b" where "my_false \ \x y. y" definition my_if :: "('a \ 'b \ 'c) \ 'a \ 'b \ 'c" where "my_if \ \z x y. z x y" text "unfolding a definition" lemma "my_true = (\x y. x)" unfolding my_true_def apply (rule refl) done lemma "my_if my_false x y = y" unfolding my_if_def my_false_def apply (rule refl) done end