Mathematics of the Law

Lawyers are given no special training in mathematics, but in their everyday work they use mathematical concepts that would stretch current mathematics beyond breaking point. All the concepts they use have been learnt by inference, from studying legal texts. It may seem strange that mathematics, which should underpin and support nearly everything that a lawyer does, serves them so poorly. The cause is the level of integration of the many different strands of mathematics that exist in a legal document. It is relatively easy to fasten on one small facet of mathematics and provide powerful theories on narrowly defined symbols. It is much harder to synthesise across many facets simultaneously. It is easier to prove what cannot be done in some narrow domain (rather like proving that, with both hands tied behind your back, you cannot scratch your nose), or that a particular formulation is valid, instead of showing, in a constructionist sense, how all the facets can be fitted together. If we are to give a computer the ability to manipulate these mathematical concepts, we need to formalise what the lawyer knows intuitively so the machine can handle the problem analytically. This is the realm of business analysis – examine the application area, then work backwards to provide the mathematics to support it, although legal documents would have to be one of the most difficult areas, due to their breadth and depth, and the complexity and longevity of the relations they describe – there are many opportunities for something unforeseen to go wrong in a thirty year lease. We will use examples from contracts and from legislation, or from general speech, to illustrate different aspects.

Some of the areas:


The lawyer uses logic, but it is not the simple first order logic of science or mathematics. It is many-layered and continually qualified, with paths leading deep into other areas. It is closely and deeply interwoven with existence and time – "If it can be done before..." – so there is no point in looking for a fudge of first order logic that might represent some part of the logic in a legal document. Currently unknowable or Bayesian logical states (states between True and False) are also regularly used – "The Contractor may elect....".


There have been attempts to turn existential elements (such as "he can win") into logical elements ("it is possible he will win" of modal logic), but existence is a precursor to logic – you work out whether something can be, then use entirely different reasoning to work out whether it is, so each relation requires two separate states for existential and logical states. It would be tedious in the extreme to say each time "If it exists, and if it is valid, then...", when the statement being valid forces the existence, but sometimes we are willing to say even this – "He can and should...". Sometimes existence needs to be verified first before the statement is used, otherwise an error may occur on handling a null set - "the costs (if any) shall be....". Logic and existence produce similar states, although for a single relation, the states are not in phase, and need to be kept consistent – there is no point assessing the validity of something if it does not exist. Logical connectives are often called upon to combine both kinds of state – "he has excellent technique and can win the race".


Time and duration are routinely described in legal documents in all their complexity – before, commencing on, during, while, until, the earlier of. Again, there have been mathematical attempts to graft time onto first order logic, but the results are crude and have a narrow use.

Objects and Relations

In law, objects and relations are treated virtually interchangeably, with complex objects – a person, a car – having an assembly relation giving them the same time and duration properties as any other relation (the person can be alive, have the potential to be alive, or be deceased). In mathematics, a relation over a relation is treated as higher order logic, and is usually shunned as being too hard, it being considered that first order logic is adequate for almost all mathematical statements. In law, the opposite applies – almost no statement can be represented in first order logic. This should not be surprising, given that there is an overlay of intention in almost everything a human does.

Object Groups

"Jack and Jill" is an object group – so are "null and void" and "breaking and entering" and "owned and operated". They are not just sets, but expose the properties of the objects, depending on the conjunction. A typical use is the compression of many sentences into one, with each pass through the sentence pulling out a different thread.

Set Handling

Set handling is particularly complex, in that directives as to the extent of the set can be given while the document has not been completely read, and the directives can be conditional on what is found. As an example: "Tenant's lease of ..... shall be subject to all of the terms and conditions of this Lease, except that ....., except as hereinafter provided." This is one example of storing up a search until the entire document has been read. There will often be a flavour of "The set of all sets that are not members of a set" in the description of which provisions should be included or excluded, particularly whether the provision generating the set of provisions is part of the set so generated. Mathematicians have laboured for well over a century to handle set constructions that the lawyer grapples with every day, unaided.

Layeringoptiontoextend.jpg (66489 bytes)

A sentence can easily contain many layers of control – "The Contractor may elect to exercise the option to extend the contract". Logical and existential connections come down from the discourse level to control the sentence, and this control can be passed down through clausal verbs in the sentence, as shown in the diagram.

Structural Reference

A legal document can be treated as a partitioned container, with references to the entire container – "described herein" – to a section or clause – Section 13 - to the most narrow sliver – Section 13.3(a)(ii) – or to a rolling context – Section 13.3(b) foll. The reference can pick up an object, a relation, a logical or existential structure, or a general context. The reference is not just a pointer – one part of the document can control the existence of another part – an example of a definition in Anti Money Laundering –

(6) For the purposes of paragraph (2)(j) of this clause:
    (a) subsection 20(2) has effect as if each reference in that subsection to a country included a reference to:
        (i) a Territory; and
        (ii) a Commonwealth place; and
    (b) ignore subsection 20(3).

This ability for one part of the document to control the existence of another part through structural reference, which may then control the validity of another part through a defined term, which may then control the existence of another part, makes reading legal documents so confusing for the uninitiated. The ease and precision of structural reference gives us an insight into how a legal document would need to be represented for a computer to successfully manage its analysis.


A common mathematical approach when moving into a new area, is to devise a new symbolism, giving each symbol highly specific and precise meanings, and then derive some theory on the basis of the symbols, the theory being worthless without carefully crafted symbols. Such symbolisms are typically flat – a string of symbols can be written out as shown in Figure 1,

inference rules1.bmp (53454 bytes)

Figure 1 - First order logic

(which typically start with "For all x " or "There exists an x such that ...") but they do not allow layering without limit. In law, there is already a complete set of symbols, many of which are in accordance with ordinary natural language text. Attempting to create a new set would introduce many errors in the conversion, given that the existing set of symbols allows description of situations which are at the limit of what can be understood by a skilled practitioner, after careful thought. What is characteristic about legal language is its complete freedom of intermixture of different concepts. If we adopted some symbolic representation of a narrow aspect, we would fail in what we wish to do – provide an integrated formalism of all of legal language. There is one other characteristic of legal concepts that is different to ordinary mathematics – the almost perfect symmetry along every dimension – logic, existence, sets. Mathematicians usually seek to exploit asymmetry that is deliberately embedded in the symbolisation to make proving things easier (and then spend decades arguing about what to do with the symmetrical case they have excluded), but this technique cannot be used for law (the need for near-perfect symmetry forces a much more rigorous and ultimately far more general and extensible approach).

If we are to use the existing symbols, we have to handle the ambiguity that comes with them – "Fred leased the house" – did Fred lease the house to someone, or lease it from someone? This is a small price to pay for the benefit that most of the population can understand existing legal documents to some degree. A mathematical synthesis using the existing natural language symbols would provide many benefits, not the least of which would be to provide a much stronger basis for mathematics to support the complex and dynamic analysis required for processes controlled by legal documents. The ubiquitous and powerful use of structural reference in such documents indicates that a structural representation is at least part of the solution. By combining objects and relations, logic and existence and numbers and time (and document structure) into an integrated structure, we can transmit objects and sets and states and values through the structure, and the states and values can change the topology of the structure – allowing the structure to be active in its own creation.

If we seek to formalise the language of law, we need to recognise how greedy of resources it is, the massive detail that needs to be captured, how there is no room for the abstraction and simplification to a few variables that too often attends mathematical analysis in other, less demanding, areas. Before computers with very large memories were available, there was really no point in attempting a complete synthesis of legal language, as too little could be captured to make the effort worthwhile, and no point at all in a partial synthesis. Evolution of computers has now reached the point where the meaning of a legal document of up to about one hundred pages can be captured in its entirety.

        Contract Driven Enterprise