It's pretty easy to prove something like this:
theory Scratch imports Main begin
theorem "foldl (λ x y. x) a b = a"
apply (induction b)
by auto
However, rewording the theorem using the universal quantifier makes it not work any more:
theorem "∀ a b. foldl (λ x y. x) a b = a"
apply (rule allI, rule allI)
apply (induction b) (* Unable to figure out induct rule *)
by auto (* Failed to apply initial proof method *)
The b
in induction b
appears to be a separate b
to the b
in the goal. (This is a guess, from looking at how more complicated examples behave.) When I try to use a simpler example (e.g. ∀ x :: nat. x < x + 1
), by simp
just solves it automatically – which means I can't see how it's done.
How can I introduce variables in Isabelle?