Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Sample Controlled Natural Language text,

including real numbers and Sylows theorems

Thomas Hales

September 5, 2019

Remark. This is a preliminary text. It writes some mathematical state-


ments according to a controlled natural language for mathematics.

1
1 Generalities

Remark. This article is an experiment in writing mathematics in a


computer readable format. It is a preliminary step in the creation of a
controlled natural language based on English with semantics based on the
Calculus of Inductive Constructions (CiC). We have in mind the dialect
of CiC described in Carneiro’s CMU master’s thesis, and implemented
in the Lean theorem prover.

The controlled natural language is inspired by earlier CNLs such as


Mizar, Evidence Algorithm (EA), Forthel (formula theory language),
SAD (system of automated deduction), Naproche (natural language proof
checking), etc.

The mathematical content here is not important. What matters is the


language and the stages of transformation from English to CiC.

Text placed in remarks (such as this text) are not part of the controlled
natural language and are ignored by the translation engine.
Let x 6= y stand for ¬(x = y).

2
Remark. Structures (inductive types with a single constructor) are the
basic building block for all mathematical structures. Whenever a mathe-
matician defines a mathematical structure as an n-tuple satisfying a list
of axioms, we define the corresponding structure in CiC. The difference
is that the components of an n-tuple are distinguished by the ordering
of the components, but the components (that is fields) of a structure are
distinguished by naming each component.

In a structure declaration, a field marked as over can float out of the


structure and become an unbundled parameter to the structure. We are
relying here on an extension to CiC designed by the author last year
(called Cabarete mode), which facilitates the transformations between
bundled and unbundled structures.

A field marked as type means that when a value X of that structure


appears in syntax reserved for a type (for example x : X or f : X → α),
the value X is coerced to the type field.

A field marked as map means that when a value f appears in function


application syntax (say f x), the function f is coerced to the map field.

3
2 Set membership
In this section, let α, β denote types.

Definition 1 (set over). Let set over α be the type α → Prop.

Definition 2 (universe over). Let universe over α equal the function

fun (_ : α) := true.

Definition 3 (empty set). Let ∅ equal

fun (_ : α) := false,

inferring α.

Let empty set stand for ∅.

Remark. A set X over α is a subset of the universe over α. We follow


our general convention of using the preposition over with parameters to
a type.

Subsets are identified with their characteristic functions, taking values in


Prop. Thus, the universe over α is the constant function from α to Prop
taking value true for each input.

The empty set over α is the other extreme. It is the constant function
taking value false for each input.

In type theory, there is a universe and an empty set for each type: the
universe over the natural numbers, the empty set over the real numbers,
etc.

In the following, we remark that notation-subset is a type isomorphic


with binary-relation.

4
Remark. Notational structures are transient structure that assist in
parsing, but that are not passed through to the kernel for type checking.
Non-transient structure implement notations through field synonyms.

Field labels that are variables are anonymous and unify with any field of
the same type.

A field is labeled over when it may be dislodged into the position of a


structure parameter.

A field is labeled type when there is a coercion from values of the structure
to that field (which should be a type).

Definition 4 (notation in). A notation-in is a notational structure with

– (parameter) β

– (parameter) α

– notation-in : α → β → Prop.

Definition 5 (in). Let x ∈ X denote C.notation-in x X, inferring (C :


notation-in).

Definition 6 (notin). Let x ∈


/ X denote not(x ∈ X).

Definition 7 (notation-subset). A notation-subset is a notational structure


with

– (parameter, type) α

– notation-subseteq : α → α → Prop.

Definition 8 (subset notation). Let X ⊂ Y denote C.notation-subset X Y ,


inferring (C : notation-subset).

Remark. When one definition builds on another that has an implicit


variable, it is not necessary to mention the implicit variable again in the
new definition.

5
Let X ⊆ Y denote X ⊂ Y or (X = Y ).
Let X is a subset of Y stand for X ⊆ Y .
Let x is a member of X stand for x ∈ X.
Let the value of f at x stand for f (x).

Remark. In the following extension, we pull out the variables α and β


for purposes of naming. The resulting extension is equivalent to what
would be obtained by working with fully bundled structures.

A structure is embedded (following the terminology of golang) if all the


fields of that structure are inserted into the structure being declared.
The insertion is flat. That is the fields appear at the top level (rather
than nested) in the structure being declared.
We record a coercion

{α; β} (notation-in over β, α) : (notation-subset over β) :=

a structure with

– a notation-subset over β with properties

– for all (X Y : β), we have (X ⊆ Y ↔ for all x, x ∈ X → x ∈ Y ).

This exists and is unique.

6
3 Natural Number

Remark. Here we construct the semiring of natural numbers with its


standard notation. Each inductive type, such as the type of natural
numbers, comes wrapped as an object of type typical (with the inductive
type as a field marked type to create automatic type coercions to the
underlying inductive type).

Definition 9 (typical structure). A typical-structure is a structure with

– (type) α : Type.

Definition 10 (notation zero). A notation-zero is a notational structure with

– α : Type

– notation-zero : α.

Let 0 stand for C.notation-zero, inferring (C : notation-zero).

Definition 11 (notation one). A notation-one is a notational structure with

– α : Type

– notation-one : α.

Let 1 stand for C.notation-one, inferring (C : notation-one).

Definition 12 (notation add). A notation-add is a notational structure with

– α : Type

– notation-add : α → α → α.

Definition 13 (notation add). let x + y stand for C.notation-add x y with


precedence 30 and left associativity, inferring (C : notation-add).

Definition 14 (notation numeral). A notation-numeral is a notational struc-


ture with

7
– notation-one

– notation-add.

Remark. A structure that satisfies notation numeral has automated


support for positive numerals

1, 2, 3, 4, . . . = 1, 1 + 1, (1 + 1) + 1, ((1 + 1) + 1) + 1, . . .

Definition 15 (notation mul). A notation-mul is a notational structure with

– α : Type

– notation-mul : α → α → α.

Definition 16 (notation mul). Let x y stand for C.notation-mul x y with


precedence 40 and left associativity, inferring (C : notation-mul).

Definition 17 (natural numbers). Let N be the inductive type


| zero : N
| succ : N→N
with

– (notation) notation-zero := zero

– (notation) notation-one := succ 0.

Definition 18 (natural number addition). We define add (m : N)(n : N) :=


match n with
|0 := m
| succ k := succ (add m k).
This exists by recursion.

Moreover, N implements

8
– (notation) notation-add := add

Definition 19 (natural number multiplication). We define mul (m : N)(n :


N) :=
match n with
|0 := 0
| k+1 := succ (mul m k + m).
This exists by recursion.

Moreover, N implements

– (notation) notation-mul := mul

9
4 List

Remark. Intuitively, a list is a finite sequence of elements of the same


type. Lists are one of the fundamental inductive types. This section
introduces lists, basic operations on lists, and notation.
In this section, let α denote a type.

Definition 20 (list). Let list {α} be the inductive type


| null : list
| cons : α → list → list.

Definition 21 (null list). Let [] equal

null : list α.

Definition 22 (cons). Let (x : α) :: (X : list α) stand for

list.cons {α} x X.

Definition 23 (length). Let list.length {α} : list → N =


function
| [] := 0
| a :: A := 1 + length A.
This exists by recursion.

Definition 24 (list.in). Let list.in (x : α) : list → B =


function
| [] := false
| a :: A := (x = a) ∨ (in x A).
This exists by recursion.

Moreover, list implements

– (notation) notation-in (x : α) (X : list) := in x X

10
Remark. The drop function removes the first occurrence of an element
from a list (but does nothing if the element does not belong to the list).

Definition 25 (list.drop). Let list.drop (x : α) : list → list :=


function
| [] := []
| a :: A := if (x = a) then A else a :: (drop x A).
This exists by recursion.

Remark. We implement a function that determines whether one list is a


reordering of another list. The function is-permutation is an equivalence
relation on lists. We are thus able to form a quotient of lists by this
equivalence relation. The resulting type is the type of multisets, or lists
up to permutation. By construction a multiset has an enumeration by a
list.

Definition 26 (is-permutation). Let list.is-permutation X Y : B :=


match(X, Y ) with
| ([], []) := true
(
if (x = y) then is-permutation X Y
| (x :: X, y :: Y ) :=
else (x ∈ Y ) ∧ is-permutation X (c :: (drop x Y )).
This exists by recursion.

Definition 27 (multiset). Let multiset {α} denote the quotient of list {α}
by the equivalence relation is-permutation. This exists.

Definition 28 (length). Let multiset.length (X : multiset) denote the length


of Y for each and every X = quot Y is-permutation. This exists and is
welldefined.

11
5 Finiteness
In this section, let α stand for a type.

Remark. This section relies on results about lists.

Every list is constructed by a finite process of consing x :: X to the head


of a list. This finite process can be used to say what it means for other
types to be finite.

A value of type duplicate free multiset over α represents an enumerated


finite set.
[synonym size/length]
[synonym element/point/carrier]
Definition 29 (nodup multiset). A duplicate free multiset is a structure with

– (parameter) element : Type


– support : multiset {element}
– length := the length of the support, with property
– noduplicate : nodup support.

Remark. We can specify a bijection from duplicate free multiset to


finite sets.

The function takes a simple form, thanks to our notation ∈ for multisets,
and curly bracket notation for sets.

Once we have a bijection, there are two ways to interpret ∈ for


duplicate free multisets. We need compatibility.
Definition 30 (set of nodup multiset). We record a coercion
set-of-duplicate free multiset {α} (X : duplicate free multiset over α) : set over α
:= {x | x ∈ support of X}.

12
Definition 31 (finite). Assume that (X : set over α). We say that X is
finite iff X is a member of the image of set-of-duplicate free multiset.

Let an equivalence f : α → β stand for a bijection f .


We record an equivalence
set-of-duplicate free multiset {α} (X : duplicate free multiset over α) :
finite set over α

Remark. We give infrastructure support for bijective functions that


have been recorded in the form of coercions in both directions between
the two.

The function set-of-duplicate free multiset is an equivalence. By record-


ing it as an equivalence, definitions involving duplicate free multiset au-
tomatically extend to finite sets.

Remark. Because of the equivalence, size and support are now defined
on finite sets.

5.1 finite types

Remark. We extend the preceding notions from sets to types by using


the universe of a type. We do not state these definitions formally over
concerns that the parser might have difficulty with the ambiguities these
definitions would create.

We say that α is a finite type iff the universe over α is finite.

Assume that α is a finite type. The size of α is the size of the universe
over α. This exists and is unique.

Assume that α is a finite type. The support of α is the support of the


universe over α. This exists and is unique.

13
6 Order
Definition 32 (binary relation). A binary relation is a structure with

– (parameter, type) element : Type

– a relation : element → element → Prop.

In this section, fix a binary relation R.


In this section, let (s x y z : R.element).
In this section, let x ≤ y stand for R.relation x y.

Definition 33 (reflexive). We say R is reflexive iff for all x, x ≤ x.

Definition 34 (transitive). We say R is transitive iff for all x y z, x ≤


y ∧ y ≤ z → x ≤ z.

Definition 35 (symmetric). We say R is symmetric iff for all x y, x ≤


y → y ≤ x.

Definition 36 (preorder). We say R is a preorder iff R is symmetric and


transitive.

Definition 37 (equivalence relation). We say R is an equivalence relation


iff R is reflexive, symmetric and transitive.

Definition 38 (antisymmetric). We say R is antisymmetric iff for all


x y, x ≤ y and y ≤ x imply x = y.

Definition 39 (total). Assume that R is a preorder. We say that R is total


iff for all (x y), x ≤ y or y ≤ x.

Definition 40 (poset). We say that R is a poset iff R is an antisymmetric


preorder.

Let partially ordered set stand for poset.

Definition 41 (linear order). We say that R is a linear order iff R is a


total poset.

14
Let total order denote linear order.
[synonym greatest/maximum/top]
Definition 42 (greatest element). We say that y is a greatest element in
R iff for all x, x ≤ y.

[synonym least/minimum/bottom]
Definition 43 (least element). We say that y is a least element in R iff
for all x, y ≤ x.

Let x < y stand for x ≤ y and x 6= y.


Definition 44 (maximal element). We say that y is a maximal element
in R iff there exists no x such that y < x.
Definition 45 (minimal element). We say that y is a minimal element in
R iff there exists no x such that x < y.
Definition 46 (irreflexive). We say that R is irreflexive iff there exists no
x such that x < x.
Definition 47 (asymmetric). We say that R is asymmetric iff for all
x y, x < y implies that not y < x.
Definition 48 (strict partial order). We say that R is a strict partial order
iff R is irreflexive, transitive, and asymmetric.

Let S denote a set over R.


Definition 49 (upper bound). We say x is an upper bound of S in R iff
s ≤ x for all s ∈ S.
Definition 50 (lower bound). We say x is a lower bound of S in R iff
x ≤ s for all s ∈ S.
Definition 51 (wellfounded). We say that R is wellfounded iff for every
S such that S 6= ∅ there exists a lower bound s of S such that s ∈ S.

[synonym least upper bound/join/supremum]


[synonym greatest lower bound/meet/infimum]

15
Definition 52 (least upper bound). We say x is a least upper bound of
S in R iff x is an upper bound of S such that for every upper bound y of S
we have x ≤ y.

Definition 53 (greatest lower bound). We say x is a greatest lower bound


of S in R iff x is a lower bound of S such that for every lower bound y of S
we have y ≤ x.

Definition 54 (join semilattice). We say R is a join semilattice iff for


every (x y), there exists a least upper bound of {x, y} in R.

Definition 55 (meet semilattice). We say R is a meet semilattice iff for


every x, y there exists a greatest lower bound of {x, y} in R.

Definition 56 (join). Assume R is a join semilattice. Let join x y be the


least upper bound of {x, y} in R. This exists and is unique.

Definition 57 (meet). Assume R is a meet semilattice. Let meet x y be


the greatest lower bound of {x, y} in R. This exists and is unique.

Definition 58 (lattice). R is a lattice iff R is a join semilattice and a meet


semilattice.

16
7 Order Notation
Definition 59 (notation le). A notation-le is a notational structure with

– (type) α : Type

– notation-le : α → α → Prop.

Let x ≤ y denote C.notation-le x y, inferring (C : notation-le).


Let x < y stand for x ≤ y and x 6= y.
Let x ≥ y stand for y ≤ x.
Let x > y stand for y < x.
Let m is at most n stand for m ≤ n.
Let n is at least m stand for n ≥ m.
Let m is less than n stand for m < n.
Let n is greater than m stand for n > m.

17
8 More on Natural Numbers
In this section, let m, n, d, p, r denote natural numbers.

Definition 60 (nat le). We say that nat-le m n iff there exists d such that
m + d = n.

We record a wellfounded total order, where

– relation := nat-le

– (notation) notation-le := relation

This exists and is unique.

Remark. The numbers 0, ±1, ±2, . . . can be interpreted in any structure


that additionally satisfies notation-neg.
[synonym number/-s]
Let natural number stand for N.

Definition 61 (divides). We say that d divides m iff d 6= 0 and there exists


r such that m = d r.

Let d | m stand for d divides m.


Let d is a divisor of m stand for d divides m.

Definition 62 (natpow). Assume that b, n are natural numbers. We define


bn :=
match n with
|0 := 1
| m + 1 := b bm .
This exists by recursion.

Definition 63 (prime). Assume that p is a natural number greater than 1.


We say that p is a prime iff each divisor of p is equal to 1 or is equal to p.

18
Definition 64 (multiplicity). The multiplicity of p in n is the natural
number m such that

pm divides n and pm+1 does not divide n.

This exists and is unique.

19
9 Group theory
Definition 65 (magma). A magma is a structure with

– (type, parameter) element : Type

– an op : element → element → element

– (notation) notation-mul := op.

Remark. XX The following definition has problems. The notation-in is


a dependent type, where the order of the arguments is switched.

We record a coercion (G : group) : notation-in :=

– β := group

– α := G.element

Definition 66 (abelian). Assume that (M : magma). M is abelian iff for


all (x y : M ), x y = y x.
Definition 67 (semigroup). A semigroup is a structure with

– a magma with property

– associativity : for all (x y z : element), x y z = (x y) z.


Definition 68 (monoid). A monoid is a structure with

– a semigroup

– a unit: element

– (notation) notation-one := unit with property

– for all x, x 1 = 1 x = x.

20
Definition 69 (notation inverse). A notation-inverse is a notational struc-
ture with

– (parameter) α : Type

– notation-inverse : α → α.

Let x−1 stand for C.notation-inverse x, inferring (C : notation-inverse),

Definition 70 (group). A group is a structure with

– a monoid

– an inv : C → C with properties

– (notation) notation-inverse := inv

– ∀(x : C), x x−1 = x−1 x = 1,

where {C := element}.

21
10 Ring and modules

Remark. An additive group is just a group in which the surface notation


has been altered. Additive group and group satisfy each other (but the
notational fields drop out).

Definition 71 (notation neg). A notation-neg is a notational structure with

– α : Type

– notation-neg : α → α.

Let −x stand for C.notation-neg x, inferring (C : notation-neg).

Definition 72 (additive group). An additive group is a structure with

– a group without notation

– (notation) notation-zero := unit

– (notation) notation-add := op

– (notation) notation-neg := inv.

Definition 73 (ring). A ring is a structure with

– an abelian additive group

– an op’ : C → C → C

– a unit’ : C

– (notation) notation-mul := op’

– (notation) notation-one := unit’ with properties

– unit-axiom’ : ∀ x : C, 1 x = x 1 = x

– mul-associativity : ∀ x y z : C, x y z = x (y z)

– right-distributivity : ∀ x y z : C, (x + y) z = x z + y z

22
– left-distributivity: ∀ x y z : C, z (x + y) = z x + z y,

where {C := element}.

Remark. By construction, a ring satisfies a group (with additive struc-


ture). There is a separate map from ring to monoid (with multiplicative
structure), which is achieved with an explicit function call.

Definition 74 (monoid of ring). We make monoid-of-ring (R: ring) : monoid :=

– unit := R.unit’

– op := R.op’

– _

Definition 75 (commutative). Assume that R is a ring. We say that R is


commutative iff for every (x y : R), x y = y x.

Definition 76 (nontrivial). Assume that R is a ring. We say that R is


nontrivial iff (0 : R) 6= (1 : R).

Definition 77 (unit). Assume that R is a commutative ring. Assume that


(x : R). We say that x is a unit in R iff there exists (y : R) such that
x y = y x = 1.

Definition 78 (notation dot). A notation-dot is a notational structure with

– (parameter, type) α, β : Type

– (notation) notation-dot : α → β → β.

Let r·x stand for C.notation-dot r x with precedence 50 and left associativity,
inferring (C : notation-dot).

Definition 79 (left module). A left module is a structure with

– (parameter) R : ring

23
– an additive group

– a scalar-multiplication : R.element → element → element

– (notation) notation-dot := scalar-multiplication with properties

– left-linear : for all r, x, y, r · (x + y) = r · x + r · y

– right-linear : for all r, s, x, (r + s) · x = r · x + s · x

– multiplicative : for all r, s, x, (r s) · x = r · (s · x)

– unital : for all x, 1 · x = x.

24
11 The field of real numbers
Definition 80 (field). A field R is a nontrivial commutative ring such that
for all x 6= 0, x is a unit in R.
Definition 81 (vector space). A vector space is a structure with

– a left module
– (parameter) R : field.
Definition 82 (ordered ring). An ordered ring is a structure with

– a ring
– a linear order with properties
– (notation) notation-le := relation
– for all (x y z), if x ≤ y then x + z ≤ y + z
– for all (x y), if 0 ≤ a and 0 ≤ b, then 0 ≤ a b.

Remark. See https://en.wikipedia.org/wiki/Ordered-ring


Definition 83 (ordered field). An ordered field is a a structure with

– an ordered ring
– a field.
Definition 84 (complete). Assume that F is an ordered field. We say that
F is complete iff for every subset S of the universe of F , if S 6= ∅ and S
has an upper bound in F then S has a least upper bound in F .
Definition 85 (absolute value). Let ordered-field.absolute-value (x : element) :
element := 
 x if 0 ≤ x
−x otherwise.

This exists and is unique and total.

25
Definition 86 (isomorphism of complete ordered fields). Assume that F and
G are complete ordered fields. An isomorphism of complete ordered fields
F, G is a bijection
f :F →G
such that
∀x y, f (x + y) = f (x) + f (y) ∧ f (x y) = f (x) f (y) ∧
∀x y, x ≤ y ↔ f (x) ≤ f (y).

Remark. For every complete ordered fields F, G, there exists a unique


isomorphism of complete ordered fields F, G. We may transport struc-
ture across these isomorphisms.
Definition 87 (real). Let R be the complete ordered field. This exists and is
canonical.

11.1 norms

Let |(x : R)| denote absolute-value x.


Definition 88 (normed commutative ring). A normed commutative ring
is a structure with

– a commutative ring
– an absolute-value : element → R with properties
– non-negativity : for all x, A x = 0 ↔ x = 0
– triangle-inequality : for all x y, A(x + y) ≤ A x + A y
– submultiplicative : for all x y, A(x y) ≤ (A x) (A y),

where {A := absolute-value}.
Definition 89 (normed field). A normed field is a structure with

– a normed commutative ring


– a field.

26
11.2 meet semilattice of subgroups

Remark. We introduce the semilattice of subgroups explicitly. Each


subgroup is characterized by its set of elements. A subgroup is not liter-
ally a group. It would take a coercion to make it so.

Because of the way parameters work, we say that H is a subgroup over


G.

Definition 90 (subgroup). A subgroup is a structure with

– (parameter) ambient-group : group

– (type) support : set over ambient-group with properties

– nonempty : 1 ∈ support and

– closure : for all x, y ∈ support, x y −1 ∈ support.

Definition 91 (subgroup semilattice). Let subgroup-semilattice (G : group) :


meet-semilattice :=

– element := subgroup over G

– relation H1 H2 := for all x, x ∈ H1 → x ∈ H2

– _

This exists and is unique.

Remark. At this point, we could introduce notation ⊆, ∩, etc. for


subgroups over a given group.

In the following definition of subgroup order, the parentheses around


(subgroup) indicate that the qualifier subgroup appears in the LATEX file,
but is not displayed in the pdf.
Assume that G is a finite group, let the order of G stand for the size of G.

27
Definition 92 (subgroup order). Assume that H is a subgroup over a finite
group G. The (subgroup) order of H is the size of the support of H. This
exists and is well subtyped (that is, H is finite).

28
12 Sylows Theorems
In this section, let G denote a fixed finite group.
In this section, let gXg −1 stand for
{g x g −1 | x ∈ X},
where (g : G) (X : set G).
Definition 93 (conjugate). Assume that (g : G). Assume that H is a sub-
group over G. The conjugate of H by g in G is the subgroup gHg −1 over
G.
Definition 94 (normalizer). Assume that H is a subgroup over G. The
normalizer of H in G is the subgroup N over G such that for all x, x ∈
N ↔ xHx−1 = H. This exists and is unique.

Let |G| denote the order of G.


In this section, let p denote a fixed prime number.
In this section, let m denote the multiplicity of p in |G|.
Definition 95 (Sylow). A Sylow p subgroup of G is a subgroup P over
G such that the order of P is pm .
Definition 96. Let Sylp (G) = {P | (P is a Sylow p subgroup of G)}.

Let np (G) denote the size of Sylp (G). This is well subtyped (that is, there
are finitely many Sylow p subgroups).
Definition 97. Let |N (p, G)| be equal to the size of the normalizer of each
and every Sylow p subgroup of G. This exists, is unique, and is well-defined.
Theorem 98 (Sylow1). There exists a Sylow p subgroup of G.
Theorem 99 (Sylow 2). If P, P 0 are Sylow p subgroups of G then there exists
(g : G) such that P 0 = gP g −1 .
Theorem 100 (Sylow 3a). Assume that |G| = p0 pm . We have np (G) divides
p0 .
Theorem 101 (Sylow 3b). We have p divides (np (G) − 1).
Theorem 102 (Sylow 3c). We have np (G) |N (p, G)| = |G|.

29

You might also like