(The HOL formulas for that other answer on limits are wrong. I don't have access to that user account. I submitted an edited answer, but I don't know if it'll show up. I have y x
instead of x y
. I didn't fix it, because I don't know how. I just made a few extra comments at the top.)
(Don't accept this as an answer. You should wait to see if one of the experts will show up. The Europeans aren't up yet.)
When I plug in your lemma, Nitpick tells me it found a counter example:
Auto Nitpick found a counterexample for
card "'a∷{inverse,minus,plus,ord}" = 2:
That's because I have "Auto Nitpick" enabled. You go to the options page, then the "Isabelle / General" settings. I usually have enabled "Auto Nitpick", "Auto Quickcheck", and "Auto Solve Direct".
I just now noticed I don't have "Auto Methods" enabled. It must have been sucking up too much CPU for some reason, but it's generally good to enable it, too.
If your CPU is running full bore, and you don't think it should be, then you disable "Auto Methods" to see if that's the problem. I don't use "Auto Sledgehammer". It's pretty demanding on the CPU, and I run it directly.
Auto Nitpick saves me a lot of trouble sometimes. It just pops up when I don't expect it. For some reason I never remember to run it directly anymore. You do that with nitpick
. See the PDF for more details on the options.
As to why your lemma fails, I don't know. Maybe someone else will know.
What I'm looking at right now is the sort for your variables. Eventually, you have to get an understanding about type classes and sorts. There are different ways to get more information. I use declare
, where sometimes I get too much info:
declare[[show_sorts=true, show_consts=true]]
In the output panel, I see what it showed in the counterexample. The sort of your type is this:
'a :: {inverse,minus,plus,ord}
Your variables, for example w
, are w :: 'a :: {inverse,minus,plus,ord}
. Those 4 sorts describe the algebraic properties that your variables have. You need to understand what limitations those sorts put on the use of your functions. You might need additional sorts to get what you want.