Organization of `thy` files that come with Isabelle
I'm relatively new to Isabelle and I'm puzzled by the organization of the thy files that come with Isabelle. Why are some files that pertaing to the same body of knowledge in ~~src/HOL, whereas others are in ~~src/HOL/<theoryname>? E.g. Why is GCD is in ~~src/HOL and not in ~~src/HOL/Number_Theory? Similar question: What is the difference between the ex folder and the Isar_Examples folder in ~~src/HOL? Wouldn't it have been more natural to merge them? Also, what is the document folder from ~~src/HOL for?
Isabelle is almost 30 years old and has changed considerably in that time. The GCD.thy file, for instance, was created 12 years ago and only provided the constant gcd :: nat ⇒ nat ⇒ nat. Back then, I don't think the Number_Theory directory even existed. In fact, HOL/Number_Theory is also something of a misnomer nowadays: I reorganised much of it together with Florian Haftmann within the last few years and now things like GCD and primality are defined not only on numbers, but on any factorial ring. A better categorisation would be HOL/Algebra, but that is already taken by another formalisation that has a very different (more abstract) flavour than what we did. So, you see, much of the organisation of the distribution is mostly a historic accident. Occasionally, people will generalise/clean up/reorganise things, but there are oddly-placed theories due to such things sometimes. Just to mention a few sub-directories: Very general stuff is in the main directory of HOL. (new files are rarely added there, I would say) Things concerning prime numbers and related concepts are in HOL/Number_Theory Abstract algebra is in HOL/Algebra. Advanced analysis and measure theory is in HOL/Analysis. Probability theory is in HOL/Probability More specialised things of general interest are in HOL/Library HOL/Decision_Procs contains some decision procedures for specialised classes of properties (e.g. approximating real functions, linear real arithmetic) that are essentially ‘press button to prove theorem’. HOL/Word contains facts about finite-size integers (i.e. with fixed bit length) HOL/ex contains all kind of stuff. I think this directory was the place to put all kinds of small, more specialised developments before the AFP existed. Isar_Examples, I think, is essentially Makarius Wenzel's collection of theories to demonstrate the capabilities of the structured proof language Isar, i.e. typical patterns and case studies in how to write nicely-structured Isar proofs. The ROOT file of a directory specifies sessions, which are collections of theories to be ‘bundled up’. For instance, the HOL image is the one that Isabelle loads by default on startup so that you don't have to wait for several minutes until all the basic theories are re-processed. If you e.g. use stuff from HOL/Analysis, it is a good idea to build the HOL-Analysis session image and load that with isabelle jedit -l HOL-Analysis so that you don't have to wait for all of the theories to be built every time you start up Isabelle. The document directory works in combination with the ROOT file. It contains some LaTeX template into which Isabelle's LaTeX output is embedded, and from that, some PDFs (the proof outline and proof document) are generated. Personally, I don't find these terribly useful (in my opinion, it's easier to just look at the code directly in Isabelle/jEdit). More information about document preparation and sessions can be found in the Isabelle systems manual.
Isabelle function to find the longest sequence of members of a relation
Is it possible to run Isabelle 2005 proofs with Proof General?
Multicast using Isabelle
Mutual recursion in primcofix
How to prove that addition of a new variable to the expression doesn't change its semantics?
How to define functions with overlapping patterns?
Non-terminating inductive predicates
Parts of mathematics not yet formalized / Isabelle wishlist
Instantiating theorems in Isabelle
Proving a basic identity in Isabelle
Error in an Isabelle function definition taken from lecture notes
Proving the cardinality of a more involved set
Function returns 0 when it should return 1, eliminating parantheses
Isabelle return numbers instead of Suc(Suc( … 0 ))
Finding the `card` function
Time derivative for vectors and matrixes on the real field