theory Foo imports Complex_Main begin consts F :: "('a \ 'a) \ 'c" definition "g x = x" lemma F_g: "F (\x::'a. f (g x)) = F (\x::'a. f x)" by (simp add: g_def) notepad begin have "F (\x::'a. g x) = F (\x::'a. x)" (* apply (simp only: F_g) <- does not work *) apply (subst F_g, rule refl) (* <- works *) done end end