1) You can define non-terminating (i.e. partial) functions in Isabelle (cf. Function package manual (section 8)). However, partial functions are more difficult to reason about, because whenever you want to use its definition equations (the psimps
rules, which replace the simps
rules of a normal function), you have to show that the function terminates on that particular input first.
In general, things like non-definedness and non-termination are always problematic in a logic – consider, for instance, the function ‘definition’ f x = f x + 1
. If we were to take this as an equation on ℤ (integers), we could subtract f x
from both sides and get 0 = 1
. In Haskell, this problem is ‘solved’ by saying that this is not an equation on ℤ, but rather on ℤ ∪ ⊥ (the integers plus bottom) and the non-terminating function f
evaluates to ⊥, and ‘⊥ + 1 = ⊥’, so everything works out fine.
However, if every single expression in your logic could potentially evaluate to ⊥ instead of a ‘proper‘ value, reasoning in this logic will become very tedious. This is why Isabelle/HOL chooses to restrict itself to total functions; things like partiality have to be emulated with things like undefined
(which is an arbitrary value that you know nothing about) or option types.
2) I'm not an expert on Isabelle/Pure (the meta logic), but the most important symbols are definitely
⋀
(the universal meta quantifier)
⟹
(meta implication)
≡
(meta equality)
&&&
(meta conjunction, defined in terms of ⟹
)
Pure.term
, Pure.prop
, Pure.type
, Pure.dummy_pattern
, Pure.sort_constraint
, which fulfil certain internal internal functions that I don't know much about.
You can find some information on this in the Isabelle/Isar Reference Manual in section 2.1, and probably more elsewhere in the manual.
Everything else (that includes ∀ and ∃, which indeed operate on boolean expressions) is defined in the object logic (HOL, usually). You can find the definitions, of rather the axiomatisations, in ~~/src/HOL/HOL.thy
(where ~~
denotes the Isabelle root directory):
All_def: "All P ≡ (P = (λx. True))"
Ex_def: "Ex P ≡ ∀Q. (∀x. P x ⟶ Q) ⟶ Q"
Also note that many, if not most Isabelle functions are typically not computable. Isabelle is not a programming language, although it does have a code generator that allows exporting Isabelle functions as code to programming languages as long as you can give code equations for all the functions involved.
3)
Isabelle theorems are a complex datatype (cf. ~~/src/Pure/thm.ML
) containing a lot of information, but the most important part, of course, is the proposition. A proposition is something from Isabelle/Pure, which in fact only has propositions and functions. (and itself
and dummy
, but you can ignore those).
Propositions are not booleans – in fact, there isn't even a way to state that a proposition does not hold in Isabelle/Pure.
HOL then defines (or rather axiomatises) booleans and also axiomatises a coercion from booleans to propositions: Trueprop :: bool ⇒ prop
4) Isabelle is not a programming language, and apart from that, totality does not mean you have to restrict yourself to finite structures. Even in a total programming language, you can have infinite lists. (cf. Idris's codata
)
Isabelle is a theorem prover, and logically, infinite objects can be treated by axiomatising them and then reasoning about them using the axioms and rules that you have.
For instance, HOL assumes the existence of an infinite type and defines the natural numbers on that. That already gives you access to functions nat ⇒ 'a
, which are essentially infinite lists.
You can also define infinite lists and other infinite data structures as codatatypes with the (co-)datatype package, which is based on bounded natural functors.
undefined
is a valid Isabelle term inhabiting any type. So the standard type-theoretic argument "if we had full recursion we would be able to inhabit everything, hence prove everything" does not suffice. I know little about Isabelle, but coming from type theory it looks quite distant in some parts. – chisorry
for "cheating", asAdmitted
is used in Coq. AFAIK,undefined
alone does not lead to inconsistencies in Isabelle, since all types must be inhabited anyway. I'm quite uncertain about the exact relationship Isabelle<->type theory, but it looks as if propositions are not types in Isabelle. I hope some Isabelle expert can clarify some points. – chi