text‹
Isabelle/Isar cite‹"Wenzel:1999:TPHOL" and "Wenzel-PhD" and
"Nipkow-TYPES02" and "Wiedijk:1999:Mizar" and "Wenzel-Paulson:2006" and
"Wenzel:2006:Festschrift"› is a generic framework for developing formal
mathematical documents with full proof checking. Definitions, statements and
proofs are organized as theories. A collection of theories sources may be
presented as a printed document; see also \chref{ch:document-prep}.
The main concern of Isar is the design of a human-readable structured proof
language, which is called the ``primary proof format'' in Isar terminology.
Such a primary proof language is somewhere in the middle between the
extremes of primitive proof objects and actual natural language.
Thus Isar challenges the traditional way of recording informal proofs in
mathematical prose, as well as the common tendency to see fully formal
proofs directly as objects of some logical calculus (e.g.\ ‹λ›-terms in a
version of type theory). Technically, Isar is an interpreter of a simple
block-structured language for describing the data flow of local facts and
goals, interspersed with occasional invocations of proof methods. Everything
is reduced to logical inferences internally, but these steps are somewhat
marginal compared to the overall bookkeeping of the interpretation process.
Thanks to careful design of the syntax and semantics of Isar language
elements, a formal record of Isar commands may later appear as an
intelligible text to the human reader.
The Isar proof language has emerged from careful analysis of some inherent
virtues of the logical framework Isabelle/Pure cite‹"paulson-found" and
"paulson700"›, notably composition of higher-order natural deduction rules,
which is a generalization of Gentzen's original calculus cite‹"Gentzen:1935"›. The approach of generic inference systems in Pure is
continued by Isar towards actual proof texts. See also \figref{fig:natural-deduction}
\textbf{Isabelle/Pure:} \begin{center} \begin{tabular}{l@ {\qquad}l} ‹(A ⟶ B) ==> A ==> B› & ‹(A ==> B) ==> A ⟶ B› \end{tabular} \end{center}
\textbf{Isabelle/Isar:} \begin{center} \begin{minipage}[t]{0.4\textwidth}
@{theory_text [display, indent = 2] ‹have "A ⟶ B" 🚫
have A 🚫
have B .›} \end{minipage} \begin{minipage}[t]{0.4\textwidth}
@{theory_text [display, indent = 2] ‹have "A ⟶ B"
assume A
then show B 🚫 ›} \end{minipage} \end{center}
\end{minipage} \end{center}
\caption{Natural Deduction via inferences according to Gentzen, rules in
Isabelle/Pure, and proofs in Isabelle/Isar}\label{fig:natural-deduction}
\end{figure}
┉
Concrete applications require another intermediate layer: an object-logic.
Isabelle/HOL cite‹"isa-tutorial"› (simply-typed set-theory) is most
commonly used; elementary examples are given in the directories 🚫‹~~/src/Pure/Examples› and 🚫‹~~/src/HOL/Examples›. Some examples
demonstrate how to start a fresh object-logic from Isabelle/Pure, and use
Isar proofs from the very start, despite the lack of advanced proof tools at
such an early stage (e.g.\ see 🚫‹~~/src/Pure/Examples/Higher_Order_Logic.thy›). Isabelle/FOL cite‹"isabelle-logics"› and Isabelle/ZF cite‹"isabelle-ZF"› also work, but are
much less developed.
In order to illustrate natural deduction in Isar, we shall subsequently
refer to the background theory and library of Isabelle/HOL. This includes
common notions of predicate logic, naive set-theory etc.\ using fairly
standard mathematical notation. From the perspective of generic natural
deduction there is nothing special about the logical connectives of HOL
(‹∧›, ‹∨›, ‹∀›, ‹∃›, etc.), only the resulting reasoning principles are
relevant to the user. There are similar rules available for set-theory
operators (‹∩›, ‹∪›, ‹∩›, ‹∪›, etc.), or any other theory developed in the
library (lattice theory, topology etc.).
Subsequently we briefly review fragments of Isar proof texts corresponding
directly to such general deduction schemes. The examples shall refer to
set-theory, to minimize the danger of understanding connectives of predicate
logic as something special.
┉
The following deduction performs ‹∩›-introduction, working forwards from
assumptions towards the conclusion. We give both the Isar text, and depict
the primitive rule involved, as determined by unification of fact and goal
statements against rules that are declared in the library context. ›
text_raw‹\medskip\begin{minipage}{0.6\textwidth}›
(*<*)
notepad begin fix x :: 'a and A B (*>*) assume"x ∈ A"and"x ∈ B" thenhave"x ∈ A ∩ B" .. (*<*) end (*>*)
text‹ ┉
Note that 🚫‹assume› augments the proof context, 🚫‹then› indicates that the
current fact shall be used in the next step, and 🚫‹have› states an
intermediate goal. The two dots ``🚫‹..›'' refer to a complete proof of this
claim, using the indicated facts and a canonical rule from the context. We
could have been more explicit here by spelling out the final proof step via
the 🚫‹by› command: ›
(*<*)
notepad begin fix x :: 'a and A B (*>*) assume"x ∈ A"and"x ∈ B" thenhave"x ∈ A ∩ B"by (rule IntI) (*<*) end (*>*)
text‹
The format of the ‹∩›-introduction rule represents the most basic inference,
which proceeds from given premises to a conclusion, without any nested proof
context involved.
The next example performs backwards introduction of ‹∩A›, the intersection
of all sets within a given set. This requires a nested proof of set
membership within a local context, where ‹A› is an arbitrary-but-fixed
member of the collection: ›
text_raw‹\medskip\begin{minipage}{0.6\textwidth}›
(*<*)
notepad begin fix x :: 'a andA (*>*) have"x ∈∩A" proof fix A assume"A ∈A" show"x ∈ A"🚫 qed (*<*) end (*>*)
text‹ ┉
This Isar reasoning pattern again refers to the primitive rule depicted
above. The system determines it in the ``🚫‹proof›'' step, which could have
been spelled out more explicitly as ``🚫‹proof (rule InterI)›''. Note that
the rule involves both a local parameter ‹A› and an assumption ‹A ∈A› in
the nested reasoning. Such compound rules typically demands a genuine
subproof in Isar, working backwards rather than forwards as seen before. In
the proof body we encounter the 🚫‹fix›-🚫‹assume›-🚫‹show› outline of nested
subproofs that is typical for Isar. The final 🚫‹show› is like 🚫‹have›
followed by an additional refinement of the enclosing claim, using the rule
derived from the proof body.
┉
The next example involves ‹∪A›, which can be characterized as the set of
all ‹x› such that ‹∃A. x ∈ A ∧ A ∈A›. The elimination rule for ‹x ∈∪A›
does not mention ‹∃› and ‹∧› at all, but admits to obtain directly a local ‹A› such that ‹x ∈ A› and ‹A ∈A› hold. This corresponds to the following
Isar proof and inference rule, respectively: ›
text_raw‹\medskip\begin{minipage}{0.6\textwidth}›
(*<*)
notepad begin fix x :: 'a andA C (*>*) assume"x ∈∪A" thenhave C proof fix A assume"x ∈ A"and"A ∈A" show C 🚫 qed (*<*) end (*>*)
text‹ \infer{‹C›}{‹x ∈∪A› & \infer*{‹C›~}{‹[A][x ∈ A, A ∈A]›}} ›
text_raw‹\end{minipage}›
text‹ ┉
Although the Isar proof follows the natural deduction rule closely, the text
reads not as natural as anticipated. There is a double occurrence of an
arbitrary conclusion ‹C›, which represents the final result, but is
irrelevant for now. This issue arises for any elimination rule involving
local parameters. Isar provides the derived language element 🚫‹obtain›,
which is able to perform the same elimination proof more conveniently: ›
(*<*)
notepad begin fix x :: 'a andA (*>*) assume"x ∈∪A" thenobtain A where"x ∈ A"and"A ∈A" .. (*<*) end (*>*)
text‹
Here we avoid to mention the final conclusion ‹C› and return to plain
forward reasoning. The rule involved in the ``🚫‹..›'' proof is the same as
before. ›
section‹The Pure framework \label{sec:framework-pure}›
text‹
The Pure logic cite‹"paulson-found" and "paulson700"› is an intuitionistic
fragment of higher-order logic cite‹"church40"›. In type-theoretic
parlance, there are three levels of ‹λ›-calculus with corresponding arrows ‹→›/‹∧›/‹==>›:
┉ \begin{tabular}{ll} ‹α → β› & syntactic function space (terms depending on terms) \\ ‹∧x. B(x)› & universal quantification (proofs depending on terms) \\ ‹A ==> B› & implication (proofs depending on proofs) \\ \end{tabular} ┉
Here only the types of syntactic terms, and the propositions of proof terms
have been shown. The ‹λ›-structure of proofs can be recorded as an optional
feature of the Pure inference kernel cite‹"Berghofer-Nipkow:2000:TPHOL"›,
but the formal system can never depend on them due to ∗‹proof irrelevance›.
On top of this most primitive layer of proofs, Pure implements a generic
calculus for nested natural deduction rules, similar to cite‹"Schroeder-Heister:1984"›. Here object-logic inferences are internalized as
formulae over ‹∧› and ‹==>›. Combining such rule statements may involve
higher-order unification cite‹"paulson-natural"›. ›
subsection‹Primitive inferences›
text‹
Term syntax provides explicit notation for abstraction ‹λx :: α. b(x)› and
application ‹b a›, while types are usually implicit thanks to
type-inference; terms of type ‹prop› are called propositions. Logical
statements are composed via ‹∧x :: α. B(x)› and ‹A ==> B›. Primitive reasoning
operates on judgments of the form ‹Γ ⊨ φ›, with standard introduction and
elimination rules for ‹∧› and ‹==>› that refer to fixed parameters ‹x1, …,
xm› and hypotheses ‹A1, …, An› from the context ‹Γ›; the corresponding
proof terms are left implicit. The subsequent inference rules define ‹Γ ⊨ φ›
inductively, relative to a collection of axioms from the implicit background
theory:
\[ \infer{‹Γ - A ⊨ A ==> B›}{‹Γ ⊨ B›} \qquad \infer{‹Γ1∪ Γ2⊨ B›}{‹Γ1⊨ A ==> B› & ‹Γ2⊨ A›} \]
Furthermore, Pure provides a built-in equality ‹≡ :: α → α → prop› with
axioms for reflexivity, substitution, extensionality, and ‹αβη›-conversion
on ‹λ›-terms.
┉
An object-logic introduces another layer on top of Pure, e.g.\ with types ‹i› for individuals and ‹o› for propositions, term constants ‹Trueprop :: o → prop› as (implicit) derivability judgment and connectives like ‹∧ :: o → o → o› or ‹∀ :: (i → o) → o›, and axioms for object-level rules such as ‹conjI: A ==> B ==> A ∧ B› or ‹allI: (∧x. B x) ==>∀x. B x›. Derived object rules
are represented as theorems of Pure. After the initial object-logic setup,
further axiomatizations are usually avoided: definitional principles are
used instead (e.g.\ 🚫‹definition›, 🚫‹inductive›, 🚫‹fun›, 🚫‹function›). ›
subsection‹Reasoning with rules \label{sec:framework-resolution}›
text‹
Primitive inferences mostly serve foundational purposes. The main reasoning
mechanisms of Pure operate on nested natural deduction rules expressed as
formulae, using ‹∧› to bind local parameters and ‹==>› to express entailment.
Multiple parameters and premises are represented by repeating these
connectives in a right-associative manner.
Thanks to the Pure theorem prop‹(A ==> (∧x. B x)) ≡ (∧x. A ==> B x)› the
connectives ‹∧› and ‹==>› commute. So we may assume w.l.o.g.\ that rule
statements always observe the normal form where quantifiers are pulled in
front of implications at each level of nesting. This means that any Pure
proposition may be presented as a ∗‹Hereditary Harrop Formula›cite‹"Miller:1991"› which is of the form ‹∧x1… xm. H1==>… Hn==> A› for ‹m, n ≥ 0›, and ‹A› atomic, and ‹H1, …, Hn› being recursively of the same
format. Following the convention that outermost quantifiers are implicit,
Horn clauses ‹A1==>… An==> A› are a special case of this.
For example, the ‹∩›-introduction rule encountered before is represented as
a Pure theorem as follows: \[ ‹IntI:›~prop‹x ∈ A ==> x ∈ B ==> x ∈ A ∩ B› \]
This is a plain Horn clause, since no further nesting on the left is
involved. The general ‹∩›-introduction corresponds to a Hereditary Harrop
Formula with one additional level of nesting: \[ ‹InterI:›~prop‹(∧A. A ∈A==> x ∈ A) ==> x ∈∩A› \]
┉
Goals are also represented as rules: ‹A1==>… An==> C› states that the
subgoals ‹A1, …, An› entail the result ‹C›; for ‹n = 0› the goal is
finished. To allow ‹C› being a rule statement itself, there is an internal
protective marker ‹# :: prop → prop›, which is defined as identity and
hidden from the user. We initialize and finish goal states as follows:
Goal states are refined in intermediate proof steps until a finished form is
achieved. Here the two main reasoning principles are @{inference
resolution}, for back-chaining a rule against a subgoal (replacing it by
zero or more subgoals), and @{inference assumption}, for solving a subgoal
(finding a short-circuit with local assumptions). Below ‹🚫x› stands
for ‹x1, …, xn› (for ‹n ≥ 0›).
The following trace illustrates goal-oriented reasoning in
Isabelle/Pure:
{\footnotesize ┉ \begin{tabular}{r@ {\quad}l} ‹(A ∧ B ==> B ∧ A) ==> #(A ∧ B ==> B ∧ A)› & ‹(init)›\\ ‹(A ∧ B ==> B) ==> (A ∧ B ==> A) ==> #…› & ‹(resolution B==> A ==> B ∧ A)›\\ ‹(A ∧ B ==> A ∧ B) ==> (A ∧ B ==> A) ==> #…› & ‹(resolution A ∧ B ==> B)›\\ ‹(A ∧ B ==> A) ==> #…› & ‹(assumption)›\\ ‹(A ∧ B ==> A ∧ B) ==> #…› & ‹(resolution A ∧ B ==> A)›\\ ‹#…› & ‹(assumption)›\\ ‹A ∧ B ==> B ∧ A› & ‹(finish)›\\ \end{tabular} ┉
}
Compositions of @{inference assumption} after @{inference resolution} occurs
quite often, typically in elimination steps. Traditional Isabelle tactics
accommodate this by a combined @{inference_def elim_resolution} principle.
In contrast, Isar uses a combined refinement rule as follows:\footnote{For
simplicity and clarity, the presentation ignores ∗‹weak premises› as
introduced via 🚫‹presume› or 🚫‹show … when›.}
{\small \[ \infer[(@{inference refinement})]
{‹C🚫›}
{\begin{tabular}{rl} ‹subgoal:› & ‹(∧🚫x. 🚫H 🚫x ==> B' 🚫x) ==> C›\\ ‹subproof:› & ‹🚫G 🚫a ==> B 🚫a›\quad for schematic ‹🚫a›\\ ‹concl unifier:› & ‹(λ🚫x. B (🚫a 🚫x))🚫 = B'🚫›\\ ‹assm unifiers:› & ‹(λ🚫x. Gj (🚫a 🚫x))🚫 = Hi🚫›\quad for each ‹Gj› some ‹Hi›\\ \end{tabular}} \]}
Here the ‹subproof› rule stems from the main 🚫‹fix›-🚫‹assume›-🚫‹show›
outline of Isar (cf.\ \secref{sec:framework-subproof}): each assumption
indicated in the text results in a marked premise ‹G› above. Consequently, 🚫‹fix›-🚫‹assume›-🚫‹show› enables to fit the result of a subproof quite robustlyintoapendingsubgoal,whilemaintainingagoodmeasureof flexibility:thesubproofonlyneedstofitmodulounification,andits assumptionsmaybeapropersubsetofthesubgoalpremises(see \secref{sec:framework-subproof}). \<close>
(*<*) next (*>*) have"\<And>xy.Ax\<Longrightarrow>By\<Longrightarrow>Cxy" proof- fixyassume"By" fixxassume"Ax" show"Cxy"\<proof> qed
text_raw\<open>\end{minipage}\begin{minipage}{0.5\textwidth}\<close> (*<*) next (*>*) have"\<And>xy.Ax\<Longrightarrow>By\<Longrightarrow>Cxy" proof- fixyassume"By" fixx show"Cxy"\<proof> qed (*<*) end (*>*)
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.79Bemerkung:
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.