Questions tagged [isar]

Intelligible semi-automated reasoning (Isar) is an approach to human readable formal proof documents (as opposed to state-based scripting).

95 questions
1
vote
1 answer

Induction on second argument Isar

inductive T :: "alpha list ⇒ bool" where Tε : "T []" | TaTb : "T l ⟹ T r ⟹ T (l @ a#(r @ [b]))" lemma Tapp: "⟦T l; T r⟧ ⟹ T (l@r)" proof (induction r rule: T.induct) I get 'Failed to apply initial proof method⌂' In Isabelle one could use…
cxandru
  • 158
  • 8
1
vote
1 answer

Induction introduces 'bad name'

In the below code: inductive T :: "alpha list ⇒ bool" where Tε : "T []" | TaTb : "T l ⟹ T r ⟹ T (l @ a#(r @ [b]))" lemma Tapp: "⟦T l; T r⟧ ⟹ T (l@r)" proof (induction l arbitrary: r rule: T.induct) case Tε then show ?case by (simp add:…
cxandru
  • 158
  • 8
1
vote
2 answers

Fragile rule application in Isabelle

I was playing around with an example from the Isabelle/HOL tutorial to get a better understanding on the correspondence between Isar and Tactics proofs. This is a version which works: lemma rtrancl_converseD: "(x,y) ∈ (r ^-1 )^* ⟹ (y,x) ∈ r^*…
Taren
  • 674
  • 5
  • 11
1
vote
0 answers

Applying elimination rule as many times as possible in Isabelle/Isar

Suppose I have a premise such as A ∨ B ∨ C, and want to prove P. The natural way to prove it is by proving that A ⟹ P, B ⟹ P and C ⟹ P. However, disjE is made for 2 cases, so I have to apply it twice: lemma foo: assumes "A ∨ B ∨ C" shows…
Luiz Martins
  • 1,644
  • 10
  • 24
1
vote
2 answers

How to prove the existence of inverse functions in Isabelle/HOL?

I am trying to prove the following basic theorem about the existence of the inverse function of a bijective function (to learn theorem-proving with Isabelle/HOL): For any set S and its identity map 1_S, α:S→T is bijective iff there exists a map β:…
thor
  • 21,418
  • 31
  • 87
  • 173
1
vote
1 answer

Can Isabelle lemma be used for stating fact about definition?

I have Isabelle definition: definition two_integer_max_case_def :: "nat ⇒ nat ⇒ nat" where "two_integer_max_case_def a b = (case a > b of True ⇒ a | False ⇒ b)" with output consts two_integer_max_case_def :: "nat ⇒ nat ⇒ nat And I can get value…
TomR
  • 2,696
  • 6
  • 34
  • 87
1
vote
2 answers

What does the "note" command do in Isabelle and when is it necessary?

I am trying to learn the Isar language (as of Isabelle 2020), and understand the note command. It seems to be a fundamental element of the language since a lot of the "Derived elements" are defined based on it. I am not sure what it does in terms of…
thor
  • 21,418
  • 31
  • 87
  • 173
1
vote
0 answers

How does one display an arbitrary programming language (e.g. Isabelle/Isar) in latex in their native display in *.pdf format?

I want to display the Isabelle/Isar and Coq languages in Latex, e.g. when I do coding format in a *.pdf format (for an academic paper). How do I do this? (I hope this generalizes to other languages like Python and Coq, so that is useful to…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
1
vote
2 answers

Simplifying if-then-else in summations or products

While doing some basic algebra, I frequently arrive at a subgoal of the following type (sometimes with a finite sum, sometimes with a finite product). lemma foo: fixes N :: nat fixes a :: "nat ⇒ nat" shows "(a 0) = (∑x = 0..N. (if x = 0 then 1…
Marco
  • 330
  • 3
  • 12
1
vote
1 answer

Local assumptions in "state" mode

Frequently, when proving a statement in "prove" mode, I find myself in need of some intermediate statements that are not yet stated nor proved. To state them, I usually make use of the subgoal command, followed by proof- to change to "state" mode.…
Benedikt
  • 67
  • 4
1
vote
0 answers

The type of oops in Isabelle

Section 6.1.3 of the Isar Reference Manual states that the type of oops is proof → local_theory | theory What is this type proof? Is this the umbrella type for proof(prove), proof(state) and proof(chain)?
Gergely
  • 6,879
  • 6
  • 25
  • 35
1
vote
1 answer

How does one use basic propositional rules in Isar to prove `A ⟶ A ∨ B`?

I wanted to transform this proof to Isar as ab exercise (for myself to learn Isar) using only basic natural deduction rules (ND) from propositional logic (e.g. notI, notE, impI, impE... etc). I can do it in an apply script easily: lemma…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
1
vote
1 answer

Is it possible to write non-automatic formalizations in Isar?

I have the following: lemma assumes p: "P" assumes pimpq: "P⟶Q" shows "P∧Q" proof - from pimpq p have q: "Q" by (rule impE) from p q show ?thesis by (rule conjI) qed I have thought that this is down to basic inference rules but reading…
Gergely
  • 6,879
  • 6
  • 25
  • 35
1
vote
1 answer

Rule induction in Isar

I want to do a rule induction in Isabelle/Isar. I find that proof (rule_tac P="λn. f n ≥ n ∧ f n ≥ 1" in f.induct) or proof (rule f.induct[of "λn. f n ≥ n ∧ f n ≥ 1"]) do exactly what I want. But how can I write that line using "new style" Isar?…
John Wickerson
  • 1,204
  • 12
  • 23
1
vote
0 answers

Nuances of type theory of Isabelle Proof Assistant

I've read this paper http://www21.in.tum.de/~berghofe/papers/TYPES2002_slides.pdf . It contains calculus for Isabelle type system on page 7. In this calculus "term has type" and "proof has term". 1) Does exist more detailed paper on this…
ged
  • 687
  • 7
  • 19