Say I have proven some basic proposition of intuitionistic propositional logic in Isabelle/HOL:
theorem ‹(A ⟶ B) ⟶ ((B ⟶ C) ⟶ (A ⟶ C))›
proof -
{
assume ‹A ⟶ B›
{
assume ‹B ⟶ C›
{
assume ‹A›
with ‹A ⟶ B› have ‹B› by (rule mp)
with ‹B ⟶ C› have ‹C› by (rule mp)
}
hence ‹A ⟶ C› by (rule impI)
}
hence ‹(B ⟶ C) ⟶ (A ⟶ C)› by (rule impI)
}
thus ?thesis by (rule impI)
qed
I know from the Curry-Howard correspondence that the proposition corresponds to some type (a -> b) -> ((b -> c) -> (a -> c))
, and the proof to some term, all inside some type theory (say, in the simply-typed λ-calculus). From the structure of the proof, I know the corresponding simply-typed λ-term is λf:a→b. λg:b→c. λx:a. f(g(x))
.
Is there a way to get Isabelle to construct this for me?
I have looked up program extraction in Isabelle, and from what I can tell it largely refers to something else: where you write functional programs in Isabelle, prove things about them and then it provides some kind of translation to Haskell or ML.
I also know that HOL is not the same thing as dependent type theory, which I'm given to understand has a stronger Curry-Howard flavour to it. I know that HOL itself is conceptually somewhat like polymorphic λ-calculus, and I found some brief notes about how HOL is a shallow encoding of logic in type theory, but some more context would be greatly appreciated. I've barely been able to piece together how all these different proof assistants and their associated foundations relate together, and perhaps some more historical context would help too. Unfortunately, the documentation around Isabelle, Coq, etc. all seems a bit all over the place; for Isabelle in particular, I seem to regularly find information that is 20 years out of date.