I have these two definitions. Why are they unfolding differently? How can I prove the "oops"-ed lemmas? (And in general, what is the difference between these two definitions in Isabelle, internally?)
(Please don't direct me to external links because I usually get swamped by the information there.)
definition "f x y = x+y"
definition "g ≡ λx y. x+y"
value "f 1 2" (* "1 + (1 + 1)" :: "'a" *)
value "g 1 2" (* "1 + (1 + 1)" :: "'a" *)
value "f 1" (* "op + 1" :: "'a ⇒ 'a" *)
value "g 1" (* "op + 1" :: "'a ⇒ 'a" *)
value "f" (* "op +" :: "'a ⇒ 'a ⇒ 'a" *)
value "g" (* "op +" :: "'a ⇒ 'a ⇒ 'a" *)
lemma "f x y≡g x y"
apply (simp add:f_def g_def)
done
lemma "f x ≡g x"
apply (simp add:f_def g_def)
(* f x ≡ op + x *)
oops
lemma "f ≡ g"
apply (simp add:f_def g_def)
(* f ≡ op + *)
oops