src/Pure/ex/Def_Examples.thy
changeset 74287 f79dfc7656ae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/ex/Def_Examples.thy	Fri Sep 10 22:46:41 2021 +0200
@@ -0,0 +1,43 @@
+(*  Title:      Pure/ex/Def_Examples.thy
+    Author:     Makarius
+
+Some examples for primitive definitions.
+*)
+
+theory Def_Examples
+  imports Def
+begin
+
+section \<open>Global definitions\<close>
+
+def "I x \<equiv> x"
+def "K x y \<equiv> x"
+def "S x y z \<equiv> (x z) (y z)"
+
+lemma "I (I x) \<equiv> x"
+  by simp
+
+lemma "K a x \<equiv> K a y"
+  by simp
+
+lemma "S K K \<equiv> I"
+  by simp
+
+
+section \<open>Locale definitions\<close>
+
+locale const =
+  fixes a :: 'a
+begin
+
+def "fun b \<equiv> a"
+
+lemma "fun x \<equiv> fun y"
+  by simp
+
+end
+
+lemma "const.fun a x \<equiv> const.fun a y"
+  by simp
+
+end