A message you do not understand? See Troubleshooting. A word you do not know? See
the Glossary. The numbers in the last column of each table are sections of the modules:
7.2.2 is Module 7, Section 7.2.2. The Isabelle text on this page is copied from the modules, where Isabelle
checked it.
In Isabelle/jEdit, type a symbol’s abbreviation, or a backslash and its name, and accept the completion
with Tab; Return does not accept it. The Symbols panel at the bottom of the window
inserts any symbol with a click, and text copied from these pages works as it is.
| Symbol |
Type |
Or |
Meaning |
Section |
| ¬ |
~ |
\not |
not |
2.1 |
| ∧ |
& or /\ |
\and |
and |
1.6 |
| ∨ |
| or \/ |
\or |
or |
1.6 |
| ⟶ |
--> |
\longrightarrow |
implies |
2.1 |
| ⟷ |
<--> |
\longleftrightarrow |
if and only if |
2.1 |
| ∀ |
! |
\forall |
for all |
3.2.3 |
| ∃ |
? |
\exists |
there exists |
3.2.3 |
| ∃! |
∃ then ! |
|
there is exactly one |
3.6 |
| ∄ |
~? |
|
there is no |
4.4.3 |
| ≠ |
~= |
\noteq |
not equal |
1.6 |
| ≤ |
<= |
|
less than or equal |
1.6 |
| ⇒ |
=> |
\Rightarrow |
function type; case branches |
1.6 |
| λ |
% |
\lambda |
a function without a name |
8.2.1 |
| ⟹ |
==> |
\Longrightarrow |
from … infer (Pure) |
7.1.1 |
| ⋀ |
!! |
\And |
for an arbitrary … (Pure) |
7.1.1 |
| ≡ |
== |
\equiv |
is defined as (Pure) |
7.1.1 |
| ⟦ ⟧ |
[| and |] |
|
the premises of a rule |
7.1.1 |
| ∈ |
: |
\in |
is an element of |
4.1.4 |
| ∉ |
~: |
\notin |
is not an element of |
4.1.4 |
| ⊆ |
(= |
\subseteq |
is a subset of |
4.1.4 |
| ∪ |
Un |
\union |
union |
4.1.4 |
| ∩ |
Int |
\inter |
intersection |
4.1.4 |
| × |
<*>, or write * |
\times |
pairs, products |
8.1.1 |
| ∘ |
|
\circ |
composition of functions |
4.6.3 |
| ¯ |
^-1 |
|
converse of a relation |
4.2.4 |
| ⇧+, ⇧* |
^+, ^* |
|
transitive, reflexive–transitive closure |
4.5.1 |
| ← |
<- |
|
generator in a list comprehension |
8.5.2 |
| ⦇ ⦈ |
(| and |) |
|
record values and updates |
13.4.1 |
| ‹ › |
a back-quote, then the completion |
|
a fact named by its statement |
10.3.2 |
| … |
... |
|
the previous right-hand side |
10.4.1 |
Watch out
Type ⟷ as <-->. The shorter <-> is also the abbreviation of ↔, which jEdit offers first and HOL
rejects.
| Notation |
Read it as |
Section |
| ¬A |
“not A” |
2.1 |
| A ∧ B |
“A and B” |
2.1 |
| A ∨ B |
“A or B” |
2.1 |
| A ⟶ B |
“A implies B”, “if A then B” |
2.1 |
| A ⟷ B |
“A if and only if B”; Isabelle prints it as = |
2.2.2 |
| φ ≡ ψ |
“φ is equivalent to ψ” |
2.5 |
| φ₁, …, φₙ ⊨ ψ |
“φ₁, …, φₙ entail ψ” |
2.6 |
| ∀x. φ |
“for all x, φ” |
3.2.3 |
| ∃x. φ |
“there exists an x such that φ” |
3.2.3 |
| ∃!x. P x |
“there is exactly one x such that P x” |
3.6 |
| M⊨φ |
“φ is true in M” |
3.3 |
| φ[t/x] |
“φ with t for x” |
3.5.2 |
| x ∈ A |
“x is an element of A”, “x is in A” |
4.1.1 |
| {x. P x} |
“the set of all x such that P x” |
4.1.1 |
| A ∪ B, A ∩ B, A − B, −A |
“A union B”, “A intersect B”, “A minus B”, “the complement of A” |
4.1.2 |
| x R y |
“x is related to y by R” |
4.2.2 |
| g ∘ f |
“g after f” |
4.6.3 |
Suc n |
“successor of n” |
5.1.1 |
x # xs |
“x cons xs” |
5.2.1 |
'a list |
“alpha list” |
5.2.1 |
| ∀m < n. P(m) |
“for all m less than n, P of m” |
5.6 |
| Γ ⊢ A |
“Γ derives A”, “A is derivable from Γ” |
6.2 |
| ⊥ |
“bottom” or “falsum”; Isabelle writes False |
6.4.5 |
A ⟹ B |
“from A, infer B” |
7.1.1 |
⟦A₁; A₂; …; Aₙ⟧ ⟹ C |
“from the premises A₁ to Aₙ, infer the conclusion C” |
7.1.1 |
⋀x. P x |
“for an arbitrary x, P x” |
7.1.1 |
a ≡ b |
“a is defined as b” |
7.1.1 |
?P |
a schematic variable: any term may replace it |
7.2.1 |
t :: τ |
“t has type τ” |
8.1.1 |
λx. x + 1 |
“lambda x, x plus 1” |
8.2.1 |
?thesis |
“the thesis”: the statement being proved |
10.2.5 |
?case |
“the case”: the claim of the current case |
10.6.1 |
‹A› |
“the fact A” |
10.3.2 |
'a::linorder |
“any type 'a in the class linorder” |
12.2.1 |
∀y∈set ys. P y |
“for every y in ys, P of y” |
12.2.2 |
In Isabelle, ¬ binds most tightly, then ∧, then ∨, then ⟶ and ⟷, which group to the right; = binds more
tightly than all of them, and a quantifier’s scope runs as far to the right as possible. When you mix ⟶ and
⟷, write the parentheses (2.2.2, 3.2.4,
3.6).
Everything you write goes into a theory. The theory First lives in the file First.thy
(1.7.1):
theory First
imports Main
begin
end
A theory that needs a library theory outside Main names it after imports
(12.2.1):
theory Verify
imports Main "HOL-Library.Multiset"
begin
end
- Commands go between
begin and end, and Isabelle checks them as you type.
- Terms and types go between quotation marks (inner syntax); commands such as
value and lemma stay
outside (outer syntax) (1.7.2).
- A string is written between two pairs of single quotes:
''alice'' (4.2.4).
- Every theory of the series is in formal-methods-theories.zip.
Types
| Type |
Values, for example |
Section |
bool |
True, False |
8.1.1 |
nat |
0, Suc 0, 42 |
8.1.1 |
int |
-3, 7 |
8.1.1 |
'a list |
[], [1, 2, 3] |
8.1.1 |
'a × 'b |
(3, True) |
8.1.1 |
'a option |
None, Some 5 |
8.1.1 |
'a ⇒ 'b |
Suc, rev |
8.1.1 |
'a set |
{1, 2, 3}, {x. x < 5}, {}, UNIV |
4.1.4 |
string |
''x''; another name for char list |
14.2.1 |
- A type annotation fixes a type:
value "2 + 3 :: nat" (1.7.2,
8.1.2).
- On
nat, subtraction is truncated: (2::nat) - 3 is 0 (8.6.1).
a div 0 = 0 and a mod 0 = a for every a (8.6.1).
- Isabelle prints negative numbers with a space after the minus sign:
- 1
(8.6.1).
Sets, relations and functions
| You write |
Meaning |
Section |
{x ∈ {0..10}. x mod 3 = (0::nat)} |
the elements of a set that satisfy a condition |
4.1.4 |
Pow A, card A, finite A |
power set, number of elements, finiteness |
4.7.1 |
r O s, r¯ |
composition and converse of relations |
4.2.4 |
r `` S |
the image of the set S under r |
4.2.4 |
refl_on A r, sym r, trans r |
reflexive on A, symmetric, transitive |
4.2.4 |
equiv A r, A // r |
equivalence relation on A; the set of its classes |
4.3 |
wf r |
r is well-founded |
4.4.3 |
r⇧+, r⇧* |
transitive and reflexive–transitive closure |
4.5.1 |
inj f, surj f, bij f, inv f |
injective, surjective, bijective; inverse |
4.6.3 |
inj_on f A, bij_betw f A B |
the same properties on sets |
4.6.3 |
g ∘ f, range f |
composition; the set of all values of f |
4.6.3, 4.7.4 |
f(a := v) |
f, except that a is mapped to v |
14.2.2 |
Lists
| Function |
What it computes |
Section |
x # xs, xs @ ys |
x in front of xs; xs followed by ys |
5.2.1 |
length xs, rev xs, sum_list xs |
length, reverse, sum |
5.2.1 |
map f xs, filter P xs |
f applied to every element; the elements that satisfy P |
8.5.1 |
foldr f xs e |
the elements combined with f, from the right |
8.5.1 |
zip xs ys |
pairs of corresponding elements |
8.5.1 |
take n xs, drop n xs |
the first n elements; the rest |
8.5.1 |
xs ! n, [m..<n] |
element number n, from 0; the numbers m to n − 1 |
8.5.1 |
[e. x ← xs, P x] |
list comprehension |
8.5.2 |
set xs |
the set of the elements of xs |
10.6.2 |
sorted xs, mset xs |
xs is sorted; the multiset of its elements |
12.2.2 |
hd [] and xs ! n beyond the end are unspecified: value stops with an exception on them
(8.5.2).
Look and compute
| Command |
Example |
What it does |
Section |
value |
value "rev [1, 2, 3 :: nat]" |
evaluates a term and prints it with its type |
1.7.2 |
term |
term "x + (1::nat)" |
prints a term with its type, without evaluating it |
8.1.2 |
typ |
typ "nat ⇒ bool list" |
checks a type and prints it |
8.1.1 |
thm |
thm conjI |
shows a theorem by its name |
7.2.1 |
of |
thm conjI[of "door_closed" "lift_stopped"] |
replaces a theorem’s schematic variables, from left to right |
7.2.1 |
find_theorems |
find_theorems "rev (rev _)" |
searches the library |
9.6 |
find_consts |
find_consts "'a list ⇒ 'a set" |
finds functions by their type |
9.6 |
print_cases |
print_cases |
inside a proof: lists the cases of an induction |
10.6.2 |
declare |
declare [[show_sorts]] |
sets an option: here, sorts are shown in the output |
8.6.2 |
Search criteria for find_theorems, which you can combine (9.6):
| Criterion |
Finds theorems |
"pattern" |
that contain the pattern; use _ for any term |
name: s |
whose name contains s |
simp: "term" |
that are equations whose left side matches the term |
intro, elim, dest |
that could be applied as such a rule to the current goal |
- before a criterion |
that do not meet it |
Definitions
| Command |
Defines |
You get |
Section |
datatype |
a type and its constructors |
distinctness and injectivity as simp rules |
5.2.2, 8.3.1 |
fun |
a function by equations with patterns; termination is proved |
f.simps (simp rules), f.induct |
5.1.2, 8.4.2 |
primrec |
primitive recursion, one equation per constructor |
f.simps |
8.4.2 |
definition |
a non-recursive constant, one equation |
f_def, not a simp rule |
8.4.1 |
inductive |
the smallest predicate closed under rules |
for ev below: ev.intros, ev.induct, ev.cases |
11.6.1 |
inductive_cases |
an inversion rule for one shape of fact |
an elimination rule |
11.6.3 |
record |
a tuple with named fields |
selectors, s⦇cars := Amber⦈ updates |
13.4.1 |
type_synonym |
a new name for an existing type |
nothing new |
14.2.1 |
typedecl, consts |
a type and constants, without definitions |
uninterpreted symbols |
3.8 |
datatype 'a tree2 = Tip | Node "'a tree2" 'a "'a tree2"
fun mirror :: "'a tree2 ⇒ 'a tree2" where
"mirror Tip = Tip"
| "mirror (Node l x r) = Node (mirror r) x (mirror l)"
definition safe :: "light × light ⇒ bool" where
"safe p = (fst p = Red ∨ snd p = Red)"
inductive ev :: "nat ⇒ bool" where
ev_0: "ev 0"
| ev_SS: "ev n ⟹ ev (Suc (Suc n))"
Statements and proofs
| Command |
What it does |
Section |
lemma name: "…" |
states a claim; theorem and corollary mean the same |
1.7.3 |
lemma name [simp]: "…" |
also makes the proved lemma a simp rule |
5.5.3 |
assumes "…" shows "…" |
a lemma with named assumptions, available as assms |
10.2.5 |
fixes i n :: nat |
declares the lemma’s variables with their type |
10.4.2 |
by m, by m₁ m₂ |
a proof in one line; fails unless no subgoal is left |
5.4.3 |
apply m … done |
an apply script; done checks that nothing is left |
5.4.2 |
proof m … qed |
an Isar proof block |
10.2.1 |
oops |
abandons a proof |
1.7.5 |
sorry |
stands in for a missing proof while you work; a theory with sorry is not proved |
10.5.1 |
declare name [simp] |
makes a proved lemma a simp rule; [simp del] removes it |
9.2.3 |
using [[simp_trace]] by simp |
shows every rewriting step of the simplifier |
9.3.5 |
Testing
Test a claim before you try to prove it. Isabelle/jEdit runs Quickcheck on every new lemma by itself;
Nitpick and Sledgehammer run when you call them.
| Command |
Options, for example |
What it does |
Section |
quickcheck |
[random], [size = 5], [timeout = 30], [expect = counterexample] |
runs the claim on many small values |
1.7.5, 9.7.1 |
nitpick |
[card 'a = 2], [card = 6], [satisfy] |
searches for a finite countermodel with a SAT solver; the option show_consts also shows the values of constants |
2.4, 3.8, 9.7.2 |
sledgehammer |
[timeout = 60] |
asks external provers, and suggests a proof to paste |
9.8 |
Code
| Command |
What it does |
Section |
export_code next_light duration trace in Haskell module_name Traffic |
translates functions, and what they need, into Haskell |
8.8 |
in SML, in OCaml, in Scala |
the other target languages |
8.8 |
export_code open … |
also exports type classes and constructors |
12.7 |
imports Main "HOL-Library.Code_Target_Nat" |
the generated code uses the target language’s own integers |
8.8 |
The code appears as theory exports: click the link in the message to open it in the File Browser.
The simplifier
| Method |
Uses |
Section |
simp |
the simp set and the assumptions of the first subgoal |
9.2.4 |
simp add: a b |
the simp set, plus the theorems a and b |
9.2.4 |
simp del: a |
the simp set without a |
9.2.4 |
simp only: a b |
only a and b, plus the assumptions |
9.2.4 |
simp split: option.split |
also splits case on options in the conclusion; option.splits and if_splits work in the assumptions |
9.3.3 |
simp flip: name |
uses the rule name from right to left, for this call |
9.3.4 |
simp (no_asm) |
ignores the assumptions of the subgoal |
9.3.2 |
simp_all |
like simp, on every subgoal |
9.2.4 |
The simp set holds the equations of fun and primrec, the facts of datatype and every lemma marked
[simp], but not definitions: unfold those with simp add: f_def (9.2.3).
Logic, sets and search
| Method |
Works on |
When it fails |
Section |
auto |
all subgoals: simplifies, applies safe rules, searches a little |
leaves what it could not prove |
9.4.2 |
blast |
first subgoal: search in first-order logic, sets and relations |
fails, with no hint |
9.4.1 |
force, fastforce |
first subgoal: search with rewriting at every step |
fails, with no hint |
9.4.3 |
clarsimp |
first subgoal: safe rules and the simplifier |
does not try to finish; leaves the goal tidied |
9.4.4 |
metis |
a first-order proof from the facts you name |
fails, or runs for a long time |
9.8 |
sat |
propositional tautologies, with Isabelle’s own SAT solver |
fails with a countermodel |
2.8 |
auto, force, fastforce and clarsimp take the simplifier’s modifiers, written simp add:, simp del:
and split:, and rules for the search: intro:, elim: and dest:. Examples from the modules:
auto simp add: grant_def, auto split: if_splits, auto intro: step, auto elim: ev_SSE ev_1E,
blast intro: move.intros step stay (9.4.4). Modules 4 and 11 to 13 also
write auto simp: trans_def: simp: is short for simp add:.
Arithmetic
| Method |
Proves |
Section |
linarith |
linear arithmetic over nat, int and real |
9.5 |
presburger |
linear arithmetic with quantifiers, divisibility, div and mod by numbers |
9.5 |
arith |
linarith first, then presburger |
9.5 |
Products of variables, such as x * x ≤ y * y, are outside all three: find a library lemma
(9.6).
Rules by hand
| Situation |
Method |
Example |
Section |
| The conclusion has a connective to break up |
rule |
apply (rule conjI) |
7.3.2 |
| The conclusion is one of the assumptions |
assumption |
apply assumption |
7.3.3 |
| An assumption has a connective to take apart |
erule |
apply (erule disjE) |
7.4.1 |
| An assumption gives a new fact |
drule, or frule to keep it |
apply (drule mp) |
7.4.3 |
| Many steps of one kind |
intro, elim |
apply (intro impI conjI) |
7.4.4 |
| You must choose the instance yourself |
rule_tac, or of |
apply (rule_tac x = 3 in exI) |
7.6.4 |
Fix first, guess later: apply allI and exE, which fix variables, before exI, allE and spec, which
create unknowns (7.6.3).
Induction and cases
| Method |
What it does |
Section |
induction n |
induction on n, following its datatype |
5.4.2 |
induction xs arbitrary: acc |
the same, for every value of acc at once |
11.2.2 |
induction xs ys rule: merge.induct |
computation induction, following the recursion of merge |
11.5.3 |
induction rule: ev.induct |
rule induction on the first premise |
11.6.2 |
induction n rule: less_induct |
complete induction |
11.8 |
cases l |
one case per constructor |
8.3.1 |
cases "x < lo" |
the condition holds, or it does not |
10.5.1 |
cases |
with a fact I t passed to it: rule inversion |
11.6.3 |
The rules of Module 6 and their names in Isabelle, with the statements as thm prints them
(7.2.2). Question marks mark schematic variables.
| Rule |
In words |
Isabelle |
Statement |
| (∧I) |
to prove A ∧ B, prove A and prove B |
conjI |
⟦?P; ?Q⟧ ⟹ ?P ∧ ?Q |
| (∧E₁) |
from A ∧ B, conclude A |
conjunct1 |
?P ∧ ?Q ⟹ ?P |
| (∧E₂) |
from A ∧ B, conclude B |
conjunct2 |
?P ∧ ?Q ⟹ ?Q |
| (∧E₁) and (∧E₂) at once |
use both parts of A ∧ B |
conjE |
⟦?P ∧ ?Q; ⟦?P; ?Q⟧ ⟹ ?R⟧ ⟹ ?R |
| (∨I₁) |
to prove A ∨ B, prove A |
disjI1 |
?P ⟹ ?P ∨ ?Q |
| (∨I₂) |
to prove A ∨ B, prove B |
disjI2 |
?Q ⟹ ?P ∨ ?Q |
| (∨E) |
prove the goal from A, and from B |
disjE |
⟦?P ∨ ?Q; ?P ⟹ ?R; ?Q ⟹ ?R⟧ ⟹ ?R |
| (⟶I) |
assume A, prove B |
impI |
(?P ⟹ ?Q) ⟹ ?P ⟶ ?Q |
| (⟶E) |
modus ponens: from A ⟶ B and A, conclude B |
mp |
⟦?P ⟶ ?Q; ?P⟧ ⟹ ?Q |
| (⟶E), elimination form |
the same, for an assumption A ⟶ B |
impE |
⟦?P ⟶ ?Q; ?P; ?Q ⟹ ?R⟧ ⟹ ?R |
| (¬I) |
assume A, prove ⊥ |
notI |
(?P ⟹ False) ⟹ ¬ ?P |
| (¬E) |
from ¬A and A, conclude ⊥ (and then anything) |
notE |
⟦¬ ?P; ?P⟧ ⟹ ?R |
| (⊥E) |
from ⊥, conclude any formula |
FalseE |
False ⟹ ?P |
| (∀I) |
prove P a for a fresh a |
allI |
(⋀x. ?P x) ⟹ ∀x. ?P x |
| (∀E) |
from ∀x. P x, conclude P t for any t |
spec |
∀x. ?P x ⟹ ?P ?x |
| (∀E), elimination form |
the same, for an assumption ∀x. P x |
allE |
⟦∀x. ?P x; ?P ?x ⟹ ?R⟧ ⟹ ?R |
| (∃I) |
from P t, conclude ∃x. P x |
exI |
?P ?x ⟹ ∃x. ?P x |
| (∃E) |
name a witness a, assume P a, prove the goal |
exE |
⟦∃x. ?P x; ⋀x. ?P x ⟹ ?Q⟧ ⟹ ?Q |
| (RAA) |
assume ¬A, prove ⊥ |
ccontr |
(¬ ?P ⟹ False) ⟹ ?P |
| (RAA), variant |
assume ¬A, prove A |
classical |
(¬ ?P ⟹ ?P) ⟹ ?P |
| (=I) |
reflexivity: t = t |
refl |
?t = ?t |
| (=E) |
substitution: replace equals by equals |
subst |
⟦?s = ?t; ?P ?s⟧ ⟹ ?P ?t |
| (=E), right to left |
the same, with the equation reversed |
ssubst |
⟦?t = ?s; ?P ?s⟧ ⟹ ?P ?t |
| none |
prove A ⟷ B from both implications |
iffI |
⟦?P ⟹ ?Q; ?Q ⟹ ?P⟧ ⟹ ?P = ?Q |
| none |
use A ⟷ B in one direction |
iffD1, iffD2 |
⟦?Q = ?P; ?Q⟧ ⟹ ?P, ⟦?P = ?Q; ?Q⟧ ⟹ ?P |
The same rules as steps of an apply script and of an Isar proof (10.7.2).
ab, imp, a, b, na, all, pa and ex are the names of facts A ∧ B, A ⟶ B, A, B, ¬ A, ∀x. P x,
P a and ∃x. P x.
| Rule |
Apply step |
Isar |
| (⟶I) |
rule impI |
assume "A" … show "B" |
| (⟶E) |
erule impE |
from imp a have "B" by (rule mp) |
| (∧I) |
rule conjI |
from a b have "A ∧ B" by (rule conjI) |
| (∧E₁), (∧E₂) |
erule conjE |
from ab have "A" by (rule conjunct1) |
| (∨I₁) |
rule disjI1 |
from a have "A ∨ B" by (rule disjI1) |
| (∨E) |
erule disjE |
from ‹A ∨ B› show "C" proof … next … qed |
| (¬I) |
rule notI |
assume "A" … show False |
| (¬E) |
erule notE |
from na a show False by (rule notE) |
| (∀I) |
rule allI |
fix x … show "P x" |
| (∀E) |
erule allE |
from all have "P a" by (rule spec) |
| (∃I) |
rule exI |
from pa have "∃x. P x" by (rule exI) |
| (∃E) |
erule exE |
from ex obtain a where "P a" by blast |
| (RAA) |
rule ccontr |
proof (rule ccontr) assume "¬ A" … show False |
Two proofs from Module 10: natural deduction written forwards, and an induction whose step is a
calculation.
lemma "A ∧ B ⟶ B ∧ A"
proof (rule impI)
assume ab: "A ∧ B"
have b: "B" using ab by blast
have a: "A" using ab by blast
show "B ∧ A" using b a by blast
qed
lemma "mysum (xs @ ys) = mysum xs + mysum ys"
proof (induction xs)
case Nil
show ?case by simp
next
case (Cons x xs)
have "mysum ((x # xs) @ ys) = x + mysum (xs @ ys)" by simp
also have "… = x + (mysum xs + mysum ys)" using Cons.IH by simp
also have "… = mysum (x # xs) + mysum ys" by simp
finally show ?case .
qed
| Element |
What it does |
Section |
proof (rule r) |
starts a block by applying the rule r |
10.2.6 |
proof |
starts a block with the standard rule for the goal |
10.2.6 |
proof - |
starts a block without changing the goal |
10.2.5 |
qed |
closes the block once every pending goal is solved |
10.2.1 |
assume ab: "A ∧ B" |
assumes a premise of the goal, under a name |
10.2.1 |
fix x |
takes an arbitrary value x |
10.2.4 |
have b: "B" |
states an intermediate fact, with its own proof |
10.2.2 |
show "B ∧ A" |
states a claim that solves a pending goal |
10.2.1 |
next |
separates the proofs of different goals or cases |
10.2.3 |
then |
passes this, the last fact, to the next claim (from this) |
10.3.1 |
from a, with a, using a |
pass named facts; with a is from a this |
10.3.2 |
note both = b a |
collects facts under a name |
10.3.2 |
hence, thus |
old forms of then have and then show |
10.3.2 |
obtain a where "admin a" |
introduces a witness for an existential fact (∃E) |
10.3.4 |
moreover … ultimately |
collects facts, then passes them all |
10.3.5 |
also … finally |
builds a chain of (in)equations; … is the previous right-hand side |
10.4.1 |
., .. |
proof by the fact passed; proof by one standard rule step |
10.4.1, 10.7.1 |
assms, assms(i) |
the assumptions of the lemma |
10.2.5 |
proof (cases "x < lo") |
case True … next case False |
10.5.1 |
proof (cases xs) |
case Nil … next case (Cons z zs) |
10.5.2 |
consider (below) "x < lo" … |
your own cases, then proof cases and case below |
10.5.4 |
proof (induction xs) |
case Nil, case (Cons x xs), with ?case |
10.6.1 |
Cons.IH, Cons.prems |
the induction hypothesis; the premises of the claim |
10.6.2 |
ev_SS.hyps, "3.IH"(1) |
the premises of a rule; a numbered case, in quotes |
11.6.2, 11.5.3 |
What proof with no method does depends on the goal (10.2.6):
| Goal |
Standard rule |
Inside the block |
A ⟶ B |
impI |
assume "A" … show "B" |
A ∧ B |
conjI |
show "A" … next … show "B" |
A ⟷ B |
iffI |
assume "A" … show "B" next assume "B" … show "A" |
¬ A |
notI |
assume "A" … show False |
∀x. P x |
allI |
fix x … show "P x" |
∃x. P x |
exI |
show "P t" for a witness t of your choice |
Choose the induction from the shape of the goal (11.9):
| The goal is about |
Use |
In Isabelle |
Section |
| a function defined by one equation per constructor |
structural induction |
induction xs |
5.5 |
| a function whose recursion changes another argument |
structural induction, generalised |
induction xs arbitrary: acc |
11.2.2 |
| a function with its own pattern of recursion |
computation induction |
induction xs ys rule: f.induct |
11.5.3 |
a premise I x with I defined by inductive |
rule induction |
induction rule: I.induct |
11.6.2 |
what a single fact I t implies |
rule inversion |
cases, inductive_cases |
11.6.3 |
| a step that needs some smaller value |
complete induction |
induction n rule: less_induct |
11.8 |
- First try
by (induction xs) auto, on the argument that the function takes apart
(5.4.3, 5.5.1).
- In the proof state, read
⋀n. as “for an arbitrary n”; the induction hypothesis stands to the left of
⟹ (5.4.2).
- Rule induction works on the first premise, whose arguments must be variables
(11.7.1, 11.7.2).
- The cases are named after the constructors (
Nil, Cons, 0, Suc), the rules (ev_0, ev_SS), the
equations (1, 2, 3), or less for less_induct (10.6.1,
11.8).
When the induction gets stuck, read the goal that is left and compare the induction hypothesis with the
conclusion (11.9):
| The stuck goal shows |
Remedy |
Section |
| a term that no equation can rewrite |
prove the missing lemma first, as [simp] |
5.5.3, 11.3 |
the IH fixes an argument (0, [], acc) that the conclusion needs with another value |
generalise: a variable instead of the constant, and arbitrary: |
11.2 |
| an IH that is true but says too little |
strengthen the claim |
11.2.3, 5.6 |
| an IH about the wrong argument |
induction on another variable, or computation induction |
5.5.1, 11.5 |
| goals that make no sense after rule induction |
variables in the inductive premise |
11.7.2 |
| a fact about a term built from constructors |
rule inversion |
11.6.3 |
Panels
| Panel |
Where |
What it shows |
Section |
| Output |
bottom |
the messages of the command at the cursor; tick Proof state to see goals there |
1.6 |
| State |
right |
the proof state, while Proof state in the Output panel is not ticked |
– |
| Theories |
right |
Prover: ready, and the progress of each open theory |
1.6 |
| Documentation |
left |
the manuals; prog-prove is the tutorial Part III follows |
1.6 |
| Symbols |
bottom |
every symbol, inserted with a click |
1.6 |
| Query |
bottom |
the Find Theorems tab, with a Find: field and an Apply button |
9.6 |
| Sledgehammer |
bottom |
Apply runs the provers, Cancel stops them; click a proof to insert it |
9.8 |
| File Browser |
left |
generated code, under isabelle-export: |
8.8 |
Keys and mouse
| Keys |
Action |
Section |
| hover over underlined text |
shows its message |
1.6 |
| Ctrl and hover over a name |
shows its type and definition; click to jump there |
1.6 |
| Tab |
accepts a completion, such as a symbol |
1.6 |
| Ctrl+S |
saves the theory |
1.7.5 |
| Ctrl+Shift+B |
shows the tooltip at the cursor |
– |
| Ctrl+Shift+M |
shows the message at the cursor |
– |
| Ctrl+Shift+L |
lists the messages of the current line |
– |
| Ctrl+Shift+A, Ctrl+Shift+Z |
jumps to the first error, the last error |
– |
| Ctrl+Shift+N, Ctrl+Shift+P |
jumps to the next error, the previous error |
– |
On macOS, use Cmd instead of Ctrl.
Signs to read
| You see |
It means |
Section |
| a blue i in the gutter |
information, for example from Auto Quickcheck or Auto solve_direct |
1.7.5 |
| a red ! and a red underline |
an error in that command |
1.7.5 |
| ⌂ in a message |
a link to the position the message is about |
1.7.5 |
| a name in blue |
a free variable, perhaps a misspelt constant |
8.1.2 |
a line starting with theorem above a failed proof |
nothing: the red message is what counts |
1.7.5 |
| Proof outline with cases: |
a skeleton for the proof; click it to insert it |
10.5.1 |