# HG changeset patch # User haftmann # Date 1258037341 -3600 # Node ID 9f7280e0c231cfa2fd67ab9e3aa9befa1820e69a # Parent 6ea8a4cce9e7c175627b1df9bd31b1b4d79a80b1 explicit code lemmas produce nices code diff -r 6ea8a4cce9e7 -r 9f7280e0c231 src/HOL/Datatype.thy --- a/src/HOL/Datatype.thy Thu Nov 12 15:48:44 2009 +0100 +++ b/src/HOL/Datatype.thy Thu Nov 12 15:49:01 2009 +0100 @@ -562,6 +562,14 @@ Sumr :: "('b => 'c) => 'a + 'b => 'c" "Sumr == sum_case undefined" +lemma [code]: + "Suml f (Inl x) = f x" + by (simp add: Suml_def) + +lemma [code]: + "Sumr f (Inr x) = f x" + by (simp add: Sumr_def) + lemma Suml_inject: "Suml f = Suml g ==> f = g" by (unfold Suml_def) (erule sum_case_inject)