This document describes the elementary pieces of documentation.
Philosophy
A piece of documentation may be informal and define no more than a structured
object -- one that can be referred to in other pieces of documentation but
not manipulated with any reliable results.
A formal piece of documentation is not true or false as such - it is a named
collection of assumptions plus the conclusions that are entailed by those
assumptions. In other words it is a logic, logistic system, axiomatic
system, algebra,... It is like a building - it exists and has a
structure. The structure determines what it can be used for. It is built
on a foundation. It may be beautiful or ugly, simple or complex, useful or
useless, boring or entertaining,... Like a building it must be made so that
it it fits together - if the foundations are in solid ground than it is
guaranteed to stand tall.
The idea that philosophical statements have an (elegant) structure independently of whether they refer to anything real or not goes back to at least Sir Francis Bacon's New Organum:
A test of good documentation is its validity. This term is defined later - See [ notn_14_Docn_Semantics.html ] elsewhere.
However a piece of documentation can be part of a formula that can be true or false. It can also imply that a formula has a particular value. It can also be matched up as a model of a data or observations. See Notation.15 Using Documentation and Notation.8 Evidence and Notation.9 Structure.
Two special kinds of document occur often. A simple piece of documentation has variables (parameters) but no definitions or axioms (and so no theorems). A basic piece of documentation has no theorems or definitions. A simple piece of documentation defines an unconstrained or universal set. A basic piece of document has the property that it is easy to predict the effect of removing an axiom.
Syntax
Uses
A MATHS document has many pieces,
Some pieces are sections (see structure) and other are elementary:
This is one of the few areas where layout is important in MATHS. All formal parts have simple, recognizable patterns. Definitions and declarations have two adjacent colons, formulas are either labeled, indented or have an "|-" in front of them.
pi ::real= 3.14159.
paragraph_tag ::= "<p>".
cos ::trig_function= sqrt(1-(sin)^2).
Here are some example forms.
For v1:T1, v2:T2, A. Abbreviation for For (v1,v2):T1><T2, A
For v:T, A,B,C. Abbreviation for For v:T, A. For v:T, B. For v:T, C.
For v:T, W(v). Universal proposition for all v:T ( W(v) ).
For v:T, t::=e. Definition of term For v:T, e::`type of e`, For v:T, t=e.
For v:T, e::S. Type inference - the type of expression e is S whenever v is of type T
For T:Types, v:T, e::S. Generic type inference, S will have T in it and e will have v
.Road_works_ahead
Conditional assertions are wffs anyway!
If a piece of documentation D contains the following conditional documentation:
If E then L.and L contains a declaration
v:T
Abelian::=for all x,y(x+y=y+x).
Hence conditional_definition
If E then V::T=e.
Hence the form
If E then N.where N is the name of of another piece of documentation.
Also
If E then either a or b.which introduces to mutually exclusive boolean variables a:@ and b:@.
. . . . . . . . . ( end of section Conditional documentation) <<Contents | End>>
}
In an ideal typesetting system the occurrences of variables and terms inside commentary text will be automatically typeset in italics. For example in English comments it is only necessary to mark the words "a" and "I" as variables, all other words of form (letter #digit #prime) is a clearly a mathematical variable.
Glosses
A gloss provides useful clues as to the meaning of a term without
giving a formal definition of the term. The only difference between a
formal definition and the less formal or informal gloss is that a gloss
can link a term to any balanced text -- one with balance open
and close brackets and with no unbracketed commas or periods.
pi ::real= ratio of circumference divided by radius.
A reference can also be a dollar sign followed by an identifier.
When writing formulas from another source (1) take time to give the reference and (2) be careful to avoid ambiguity or misinterpretation:
"E=M*c^2,[Einstein35]" refers to Einstein's famous formula.
"E=M*c^2[Einstein35]," is a strange formula.
Declarations
Declarations introduce a new variable. Unlike a variable in a program however
it has a fixed, but unknown, value. In fact all declared variables act more
like parameters in a generic piece of code than program variables. A variable
can be replaced by an expression of the same type
throughout its scope and if the expression satisfies the resulting assumptions
then a new and correct document is produced.
A declaration, say t::S, means that t is a member of S. Each set determines the type of its elements, so if S is of type @T then t is of type T - but with an unspecified value. In essence, t is declared to be of type T and the axiom t ∈ S is simultaneously asserted.
Multiple declarations - notice that it is legal for the same identifier t to appear in more than one declaration. Suppose that a piece of documentation has both t::S1 and t::S2 in it. First, when S1 and S2 have differing types T1 and T2 respectively then t is a polymorphic identifier with disambiguated forms t.T1 and 't.T2`. Second when S1 and S2 have the the same type of element(T say), then the effect is of a single declaration of type t::T plus the two axioms: `t ∈ S1 and t ∈ S2`. So in this case it as if there is the single declaration: t::S1 & S2.
It might seem simpler to disallow multiple declarations, but the question comes up the moment we allow the reuse of documentation with declared variables. Rather than complicate the rules for reuse, it seems more basic to resolve the issue as a question of multiple declarations at this level. It is part of the general idea that the parts of a document are conjoined together with a logical and. This helps for handling some context dependent definitions and for interpreting the meaning of so called 'recursive' definitions as simultaneous equations.
For more see
[ notin_16_Clasification.html ]
Declarations and Definitions
Definitions - t::S=e and t::=e - are in essence, short hand for a
declaration ( t::S and t:type(e) respectively) and an axiom t=e.
Similarly for parameterized definitions For x, t::S=e which is short for
For x, t::S. For x(t=e). and conditional (partial) definitions.
Constrained Declarations
One common way to introduce a new term is to declare it and add enough
constraints that it is well defined. This needs care and knowledge of
how the type of term works:
x::Real where 3*x+1 = 2.These are essentially the same as a normal definition. The above can be rewritten:
x::Real=the{x:real || 3*x+1 =2}.
So
v :: T where P.means
v::T = the{v:T. P}.
Here is a more complex example:
x::Complex where following
Remote Definitions
There is a specialized but useful notation that quotes and reuses
a definition that is given elsewhere on the World Wide Web:
This is really a specialized short_definition. A remote_definition like
t::T=ucan be considered an abbreviation for
t::T= following
.See R
One the other hand the existing evidence can allow to deduce or prove an assertion from what we have already assumed and/or proved. Then we call the result a theorem. Non-theorems are conjectures and axioms. An axiom is a proposition that is assumed to be true without providing any formal justification. In other words it is a premise.
Explicitly labeling axioms makes it easier to process MATHS documentation.
If a term t has a definition D then implicitly the definition D is labeled definition(t). If a term t has a definition in context T then the definition is labeled (automatically and implicitly) definition(t:T). The effect is similar to writing a nested definition of the expression and then using the label:
(L): Axiom.is rather like:
L::=Axiom.
L.However... there is no definition(L) here in reality
|-(L): Axiomis rather like:
L::=Axiom
|-L.Again... there is no definition(L) here in reality,
(premises) |-(L): Theorem.is rather like:
L::=Theorem.
(premises)|-L.Again... there is no definition(L). Better documentation will have a section named "Proof of L" for most if not all of its theorems. There should be hypertext links between the assertion symbol "|-" and the proof.
.Po $formula
...
.Close.Po
Proof
Theorems, by definition require proofs. A theorem labeled l must have a
section of documentation called proof of l that is in the form of an
argument:
Wffs and propositions
A wff is mapped into a proposition by first replacing "for" by "for all"
plus bindings for all free variables in the following propositions. Second
a pair of matching parentheses are put round the final proposition. Third,
every other simple proposition has "if" is put in front of it, and "then"
after it, and the comma deleted. Finally where ever a "then" is followed by
a binding then "for all" is inserted between the "then" and the binding.
For example, "for x=y+1, y=x-1" becomes "for all x,y, if x=y+1 then
(y=x-1)".
Resolving ambiguous labels.
If a wff has label 'l' inside one piece of documentation called N and also
another wff has the same label inside document M then outside N N's version
can be referred to as N.l and M's as M.l. If two wffs have the same label
(commonly something like '*') then the label refers to the first
occurrence up to where the second one appears. After that, it refers to
the second one. And so on if there are more... Outside that piece of
documentation, both labels are invisible - hidden by the ambiguity. A
helpful feature would be a system to spot and highlight such attempts to
refer to something inside a document which does not have a unique
identifier, and help the user resolve the difficulty.
Proof and arguments are a special type of documentation which are essential in any project that involves matters of life and death. In MATHS an argument often proceeds by documenting some assumptions, defining some terms and deriving an assertion that is true in that context. This proves that the assumptions imply the derived conclusions ... thus
Given ".Let" x:S, P, ... "|- " Q ".Close.Let"
Therefore "for all" x:S, "if" P "then" Q.A useful feature to include in a MATHS environment is to quickly show and hide arguments at the viewer's request.
In theory and mathematical research any set of assumptions can be considered, as long as they are interesting or lead to new consequence. In the design of complex systems however some reason should be supplied for assumptions. So some explanation should be given of assertions that are made about real situations. For example some of the following might be used:
A special kind of definition is used to attach a formal term to a piece of documentation. .Warning Work is in progress in this area.
All definitions use two colons and an equal sign.
Definers and binders are very similar to binders, see [ binding ]
The sole purpose of a long_definition is to give a name to set of documentation. A useful convention is that these names of documentation are natural identifiers made of capital letters. See Conveniences and Re-use.
A short definition must be short enough for tools (like grep for example) and mailers to handle in a line. There are four typical forms:
In theory the forms are equivalent and can be translated from one to the other. In practice it is more writable and readable to use the long form for complex structure and systems. The short form is best used for quick reference. Ideally a piece of documentation should have both.
. . . . . . . . . ( end of section Algebra) <<Contents | End>>
In this form the items can be simple declarations ( id:type ) or simple well-formed-formulae. Declarations can be abreviated if the type is "Sets". Example
Older form
The older form made it harder to recognize short definitions unambiguously
from documentation.
Deprecated
A definition simultaneously declares a variable and also asserts that it equals a particular value depending on various parameters in the term defined.
Here are some examples.
Table of Definition types
Definition Declaration Assertion Notes
t::= e t::Te t=e e has typeTe
t::T= e t.T::T t.T=e t.Treplaces t in a context that needs a T
Parameterized Definition
For v:T, t(v) ::S=e t::(S^T)=map [v:T](e)
For v:T, t(v) ::=e t::(Te^T)=map [v:T](e)
Notice that MATHS allows the simultaneous definition of all the parts of a structured term. This can be used to simultaneously develop the concrete and abstract syntax of a language, or to define a translation from one (grammatical) structure to another one, for example.
. . . . . . . . . ( end of section Definitions) <<Contents | End>>
Semantics of a piece of documentation
[ notn_14_Docn_Semantics.html ]
. . . . . . . . . ( end of section Documentation in MATHS) <<Contents | End>>
Notes on MATHS Notation
Special characters are defined in
[ intro_characters.html ]
that also outlines the syntax of expressions and a document.
Proofs follow a natural deduction style that start with assumptions ("Let") and continue to a consequence ("Close Let") and then discard the assumptions and deduce a conclusion. Look here [ Block Structure in logic_25_Proofs ] for more on the structure and rules.
The notation also allows you to create a new network of variables and constraints. A "Net" has a number of variables (including none) and a number of properties (including none) that connect variables. You can give them a name and then reuse them. The schema, formal system, or an elementary piece of documentation starts with "Net" and finishes "End of Net". For more, see [ notn_13_Docn_Syntax.html ] for these ways of defining and reusing pieces of logic and algebra in your documents. A quick example: a circle = Net{radius:Positive Real, center:Point}.
For a complete listing of pages in this part of my site by topic see [ home.html ]
Notes on the Underlying Logic of MATHS
The notation used here is a formal language with syntax
and a semantics described using traditional formal logic
[ logic_0_Intro.html ]
plus sets, functions, relations, and other mathematical extensions.
For a more rigorous description of the standard notations see