IsarMathLib
Slawomir Kolodyński, Daniel de la Concepción Sáez
February 3, 2020

Abstract
This is the proof document of the IsarMathLib project version
1.11.0. IsarMathLib is a library of formalized mathematics for Isabelle2019 (ZF logic).

Contents
1 Introduction to the IsarMathLib project1.1 How to read IsarMathLib proofs - a tutorial . . . . . . . . . .
1.2 Overview of the project . . . . . . . . . . . . . . . . . . . . .

9
10
11

2 First Order Logic
15
2.1 Notions and lemmas in FOL . . . . . . . . . . . . . . . . . . . 15
3 ZF set theory basics
18
3.1 Lemmas in Zermelo-Fraenkel set theory . . . . . . . . . . . . 18
4 Natural numbers in IsarMathLib
24
4.1 Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5 Order relations - introduction30
5.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.2 Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 Bounded sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6 More on order relations
42
6.1 Definitions and basic properties . . . . . . . . . . . . . . . . . 42
6.2 Properties of (strict) total orders . . . . . . . . . . . . . . . . 44
7 Even more on order relations
47
7.1 Maximum and minimum of a set . . . . . . . . . . . . . . . . 47
7.2 Supremum and Infimum . . . . . . . . . . . . . . . . . . . . . 54
7.3 Strict versions of order relations . . . . . . . . . . . . . . . . . 57
1

8 Order on natural numbers
60
8.1 Order on natural numbers . . . . . . . . . . . . . . . . . . . . 60
9 Functions - introduction
61
9.1 Properties of functions, function spaces and (inverse) images. 62
9.2 Functions restricted to a set . . . . . . . . . . . . . . . . . . . 76
9.3 Constant functions . . . . . . . . . . . . . . . . . . . . . . . . 78
9.4 Injections, surjections, bijections etc. . . . . . . . . . . . . . . 79
9.5 Functions of two variables . . . . . . . . . . . . . . . . . . . . 87
10 Binary operations
91
10.1 Lifting operations to a function space . . . . . . . . . . . . . 91
10.2 Associative and commutative operations . . . . . . . . . . . . 93
10.3 Restricting operations . . . . . . . . . . . . . . . . . . . . . . 96
10.4 Compositions . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
10.5 Identity function . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.6 Lifting to subsets . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.7 Distributive operations . . . . . . . . . . . . . . . . . . . . . . 106
11 More on functions
107
11.1 Functions and order . . . . . . . . . . . . . . . . . . . . . . . 107
11.2 Projections in cartesian products . . . . . . . . . . . . . . . . 112
11.3 Induced relations and order isomorphisms . . . . . . . . . . . 112
12 Finite sets - introduction120
12.1 Definition and basic properties of finite powerset . . . . . . . 120
13 Finite sets
129
13.1 Finite powerset . . . . . . . . . . . . . . . . . . . . . . . . . . 129
13.2 Finite range functions . . . . . . . . . . . . . . . . . . . . . . 137
14 Finite sets 1
138
14.1 Finite vs. bounded sets . . . . . . . . . . . . . . . . . . . . . 138
15 Finite sets and order relations
141
15.1 Finite vs. bounded sets . . . . . . . . . . . . . . . . . . . . . 142
15.2 Order isomorphisms of finite sets . . . . . . . . . . . . . . . . 143
16 Equivalence relations
149
16.1 Congruent functions and projections on the quotient . . . . . 149
16.2 Projecting commutative, associative and distributive operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
16.3 Saturated sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

2

17 Finite sequences160
17.1 Lists as finite sequences . . . . . . . . . . . . . . . . . . . . . 160
17.2 Lists and cartesian products . . . . . . . . . . . . . . . . . . . 174
18 Inductive sequences177
18.1 Sequences defined by induction . . . . . . . . . . . . . . . . . 177
18.2 Images of inductive sequences . . . . . . . . . . . . . . . . . . 185
18.3 Subsets generated by a binary operation . . . . . . . . . . . . 185
18.4 Inductive sequences with changing generating function . . . . 188
19 Folding in ZF
192
19.1 Folding in ZF . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
20 Partitions of sets
196
20.1 Bisections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
20.2 Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
21 Enumerations
200
21.1 Enumerations: definition and notation . . . . . . . . . . . . . 201
21.2 Properties of enumerations . . . . . . . . . . . . . . . . . . . 202
22 Semigroups
204
22.1 Products of sequences of semigroup elements . . . . . . . . . 205
22.2 Products over sets of indices . . . . . . . . . . . . . . . . . . . 209
22.3 Commutative semigroups . . . . . . . . . . . . . . . . . . . . 212
23 Commutative Semigroups
223
23.1 Sum of a function over a set . . . . . . . . . . . . . . . . . . . 224
24 Monoids
227
24.1 Definition and basic properties . . . . . . . . . . . . . . . . . 227
25 Groups - introduction
232
25.1 Definition and basic properties of groups . . . . . . . . . . . . 232
25.2 Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
26 Groups 1
248
26.1 Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
26.2 Odd functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
27 Groups - and alternative definition
256
27.1 An alternative definition of group . . . . . . . . . . . . . . . . 257
28 Abelian Group
258
28.1 Rearrangement formulae . . . . . . . . . . . . . . . . . . . . . 259

3

29 Groups 2
271
29.1 Lifting groups to function spaces . . . . . . . . . . . . . . . . 271
29.2 Equivalence relations on groups . . . . . . . . . . . . . . . . . 276
29.3 Normal subgroups and quotient groups . . . . . . . . . . . . . 279
29.4 Function spaces as monoids . . . . . . . . . . . . . . . . . . . 284
30 Groups 3285
30.1 Group valued finite range functions . . . . . . . . . . . . . . . 285
30.2 Almost homomorphisms . . . . . . . . . . . . . . . . . . . . . 287
30.3 The classes of almost homomorphisms . . . . . . . . . . . . . 296
30.4 Compositions of almost homomorphisms . . . . . . . . . . . . 298
30.5 Shifting almost homomorphisms . . . . . . . . . . . . . . . . 307
31 Direct product308
31.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
31.2 Associative and commutative operations . . . . . . . . . . . . 309
32 Ordered groups - introduction
310
32.1 Ordered groups . . . . . . . . . . . . . . . . . . . . . . . . . . 310
32.2 Inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
32.3 The set of positive elements . . . . . . . . . . . . . . . . . . . 328
32.4 Intervals and bounded sets . . . . . . . . . . . . . . . . . . . . 335
33 More on ordered groups
341
33.1 Absolute value and the triangle inequality . . . . . . . . . . . 341
33.2 Maximum absolute value of a set . . . . . . . . . . . . . . . . 353
33.3 Alternative definitions . . . . . . . . . . . . . . . . . . . . . . 355
33.4 Odd Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . 359
33.5 Functions with infinite limits . . . . . . . . . . . . . . . . . . 361
34 Rings - introduction364
34.1 Definition and basic properties . . . . . . . . . . . . . . . . . 364
34.2 Rearrangement lemmas . . . . . . . . . . . . . . . . . . . . . 372
35 More on rings
375
35.1 The ring of classes of almost homomorphisms . . . . . . . . . 375
36 Ordered rings
378
36.1 Definition and notation . . . . . . . . . . . . . . . . . . . . . 378
36.2 Absolute value for ordered rings . . . . . . . . . . . . . . . . . 386
36.3 Positivity in ordered rings . . . . . . . . . . . . . . . . . . . . 388

4

37 Cardinal numbers
395
37.1 Some new ideas on cardinals . . . . . . . . . . . . . . . . . . . 395
37.2 Main result on cardinals (without the Axiom of Choice) . . . 399
37.3 Choice axioms . . . . . . . . . . . . . . . . . . . . . . . . . . 402
38 Groups 4407
38.1 Conjugation of subgroups . . . . . . . . . . . . . . . . . . . . 407
38.2 Finite groups . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
38.3 Subgroups generated by sets . . . . . . . . . . . . . . . . . . . 416
38.4 Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . 417
38.5 First isomorphism theorem . . . . . . . . . . . . . . . . . . . 423
39 Fields - introduction
431
39.1 Definition and basic properties . . . . . . . . . . . . . . . . . 431
39.2 Equations and identities . . . . . . . . . . . . . . . . . . . . . 434
39.3 1/0=0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
40 Ordered fields
436
40.1 Definition and basic properties . . . . . . . . . . . . . . . . . 437
40.2 Inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
40.3 Definition of real numbers . . . . . . . . . . . . . . . . . . . . 443
41 Integers - introduction444
41.1 Addition and multiplication as ZF-functions. . . . . . . . . . 444
41.2 Integers as an ordered group . . . . . . . . . . . . . . . . . . . 451
41.3 Induction on integers. . . . . . . . . . . . . . . . . . . . . . . 463
41.4 Bounded vs. finite subsets of integers . . . . . . . . . . . . . . 467
42 Integers 1
470
42.1 Integers as a ring . . . . . . . . . . . . . . . . . . . . . . . . . 470
42.2 Rearrangement lemmas . . . . . . . . . . . . . . . . . . . . . 472
42.3 Integers as an ordered ring . . . . . . . . . . . . . . . . . . . . 479
42.4 Maximum and minimum of a set of integers . . . . . . . . . . 490
42.5 The set of nonnegative integers . . . . . . . . . . . . . . . . . 494
42.6 Functions with infinite limits . . . . . . . . . . . . . . . . . . 500
42.7 Miscelaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
43 Division on integers
507
43.1 Quotient and reminder . . . . . . . . . . . . . . . . . . . . . . 507
44 Integers 2509
44.1 Slopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
44.2 Composing slopes . . . . . . . . . . . . . . . . . . . . . . . . . 531

5

45 Integers 3537
45.1 Positive slopes . . . . . . . . . . . . . . . . . . . . . . . . . . 537
45.2 Inverting slopes . . . . . . . . . . . . . . . . . . . . . . . . . . 548
45.3 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
46 Construction real numbers - the generic part562
46.1 The definition of real numbers . . . . . . . . . . . . . . . . . . 563
47 Construction of real numbers
570
47.1 Definitions and notation . . . . . . . . . . . . . . . . . . . . . 570
47.2 Multiplication of real numbers . . . . . . . . . . . . . . . . . 573
47.3 The order on reals . . . . . . . . . . . . . . . . . . . . . . . . 576
47.4 Inverting reals . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
47.5 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
48 Complex numbers
609
48.1 From complete ordered fields to complex numbers . . . . . . 609
48.2 Axioms of complex numbers . . . . . . . . . . . . . . . . . . . 613
49 Topology - introduction
626
49.1 Basic definitions and properties . . . . . . . . . . . . . . . . . 626
49.2 Interior of a set . . . . . . . . . . . . . . . . . . . . . . . . . . 630
49.3 Closed sets, closure, boundary. . . . . . . . . . . . . . . . . . 631
50 Topology 1
636
50.1 Separation axioms. . . . . . . . . . . . . . . . . . . . . . . . . 636
50.2 Bases and subbases. . . . . . . . . . . . . . . . . . . . . . . . 638
50.3 Product topology . . . . . . . . . . . . . . . . . . . . . . . . . 642
51 Topology 1b64751.1 Compact sets are closed - no need for AC . . . . . . . . . . . 647
52 Topology 264952.1 Continuous functions. . . . . . . . . . . . . . . . . . . . . . . 649
52.2 Homeomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . 654
52.3 Topologies induced by mappings . . . . . . . . . . . . . . . . 656
52.4 Partial functions and continuity . . . . . . . . . . . . . . . . . 658
52.5 Product topology and continuity . . . . . . . . . . . . . . . . 661
52.6 Pasting lemma . . . . . . . . . . . . . . . . . . . . . . . . . . 664
53 Topology 3
666
53.1 The base of the product topology . . . . . . . . . . . . . . . . 667
53.2 Finite product of topologies . . . . . . . . . . . . . . . . . . . 669

6

54 Topology 467854.1 Nets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
54.2 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
54.3 Relation between nets and filters . . . . . . . . . . . . . . . . 687
55 Topology and neighborhoods
698
55.1 Neighborhood systems . . . . . . . . . . . . . . . . . . . . . . 698
55.2 Topology from neighborhood systems . . . . . . . . . . . . . . 699
55.3 Neighborhood system from topology . . . . . . . . . . . . . . 701
56 Topology - examples
703
56.1 CoCardinal Topology . . . . . . . . . . . . . . . . . . . . . . . 703
56.2 Total set, Closed sets, Interior, Closure and Boundary . . . . 705
56.3 Excluded Set Topology . . . . . . . . . . . . . . . . . . . . . . 711
56.4 Total set, closed sets, interior, closure and boundary . . . . . 712
56.5 Special cases and subspaces . . . . . . . . . . . . . . . . . . . 716
56.6 Included Set Topology . . . . . . . . . . . . . . . . . . . . . . 717
56.7 Basic topological notions in included set topology . . . . . . . 718
56.8 Special cases and subspaces . . . . . . . . . . . . . . . . . . . 721
57 More examples in topology
723
57.1 New ideas using a base for a topology . . . . . . . . . . . . . 723
57.2 The topology of a base . . . . . . . . . . . . . . . . . . . . . . 723
57.3 Dual Base for Closed Sets . . . . . . . . . . . . . . . . . . . . 727
57.4 Partition topology . . . . . . . . . . . . . . . . . . . . . . . . 729
57.5 Partition topology is a topology. . . . . . . . . . . . . . . . . 731
57.6 Total set, Closed sets, Interior, Closure and Boundary . . . . 731
57.7 Special cases and subspaces . . . . . . . . . . . . . . . . . . . 737
57.8 Order topologies . . . . . . . . . . . . . . . . . . . . . . . . . 739
57.9 Order topology is a topology . . . . . . . . . . . . . . . . . . 739
57.10Total set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
57.11Right order and Left order topologies. . . . . . . . . . . . . . 751
57.11.1 Right and Left Order topologies are topologies . . . . 752
57.11.2 Total set . . . . . . . . . . . . . . . . . . . . . . . . . . 753
57.12Union of Topologies . . . . . . . . . . . . . . . . . . . . . . . 753
58 Properties in Topology
755
58.1 Properties of compactness . . . . . . . . . . . . . . . . . . . . 755
58.2 Properties of numerability . . . . . . . . . . . . . . . . . . . . 759
58.3 Relations between numerability properties and choice principles761
58.4 Relation between numerability and compactness . . . . . . . 767

7

59 Topology 5780
59.1 Some results for separation axioms . . . . . . . . . . . . . . . 780
59.2 Hereditability . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
59.3 Spectrum and anti-properties . . . . . . . . . . . . . . . . . . 800
60 Topology 683060.1 Image filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
60.2 Continuous at a point vs. globally continuous . . . . . . . . . 832
60.3 Continuous functions and filters . . . . . . . . . . . . . . . . . 833
61 Topology 7
836
61.1 Connection Properties . . . . . . . . . . . . . . . . . . . . . . 836
62 Topology 886762.1 Definition of quotient topology . . . . . . . . . . . . . . . . . 868
62.2 Quotient topologies from equivalence relations . . . . . . . . . 870
63 Topology 987863.1 Group of homeomorphisms . . . . . . . . . . . . . . . . . . . 878
63.2 Examples computed . . . . . . . . . . . . . . . . . . . . . . . 880
63.3 Properties preserved by functions . . . . . . . . . . . . . . . . 892
64 Topology 1089764.1 Closure and closed sets in product space . . . . . . . . . . . . 897
64.2 Separation properties in product space . . . . . . . . . . . . . 899
64.3 Connection properties in product space . . . . . . . . . . . . 904
65 Topology 11
908
65.1 Order topologies . . . . . . . . . . . . . . . . . . . . . . . . . 908
65.2 Separation properties . . . . . . . . . . . . . . . . . . . . . . . 908
65.3 Connectedness properties . . . . . . . . . . . . . . . . . . . . 911
65.4 Numerability axioms . . . . . . . . . . . . . . . . . . . . . . . 931
66 Uniform spaces
940
66.1 Definition and motivation . . . . . . . . . . . . . . . . . . . . 940
67 Topological groups - introduction
944
67.1 Topological group: definition and notation . . . . . . . . . . . 944
67.2 Interval arithmetic, translations and inverse of set . . . . . . 948
67.3 Neighborhoods of zero . . . . . . . . . . . . . . . . . . . . . . 949
67.4 Closure in topological groups . . . . . . . . . . . . . . . . . . 950
67.5 Sums of sequences of elements and subsets . . . . . . . . . . . 952

8

68 Properties in topology 2
955
68.1 Local properties. . . . . . . . . . . . . . . . . . . . . . . . . . 955
68.2 First examples . . . . . . . . . . . . . . . . . . . . . . . . . . 956
68.3 Local compactness . . . . . . . . . . . . . . . . . . . . . . . . 957
68.4 Compactification by one point . . . . . . . . . . . . . . . . . . 965
68.5 Hereditary properties and local properties . . . . . . . . . . . 975
69 Topological groups 1
1008
69.1 Separation properties of topological groups . . . . . . . . . . 1008
69.2 Existence of nice neighbourhoods. . . . . . . . . . . . . . . . . 1011
69.3 Rest of separation axioms . . . . . . . . . . . . . . . . . . . . 1014
69.4 Local properties . . . . . . . . . . . . . . . . . . . . . . . . . . 1019
70 Topological groups 2
1020
70.1 Quotients of topological groups . . . . . . . . . . . . . . . . . 1020
71 Topological groups 3
1026
71.1 Subgroups topologies . . . . . . . . . . . . . . . . . . . . . . . 1026
72 Metamath introduction
1035
72.1 Importing from Metamath - how is it done . . . . . . . . . . 1036
72.2 The context for Metamath theorems . . . . . . . . . . . . . . 1037
73 Logic and sets in Metamatah1039
73.1 Basic Metamath theorems . . . . . . . . . . . . . . . . . . . . 1040
74 Complex numbers in Metamatah - introduction

1091

75 Metamath examples

1213

76 Metamath interface
1218
76.1 MMisar0 and complex0 contexts. . . . . . . . . . . . . . . . . 1218
77 Metamath sampler
1224
77.1 Extended reals and order . . . . . . . . . . . . . . . . . . . . 1225
77.2 Natural real numbers . . . . . . . . . . . . . . . . . . . . . . . 1229
77.3 Infimum and supremum in real numbers . . . . . . . . . . . . 1231

1

Introduction to the IsarMathLib project

theory Introduction imports ZF.equalities
beginThis theory does not contain any formalized mathematics used in othertheories, but is an introduction to IsarMathLib project.
91.1

How to read IsarMathLib proofs - a tutorial

Isar (the Isabelle’s formal proof language) was designed to be similar tothe standard language of mathematics. Any person able to read proofs ina typical mathematical paper should be able to read and understand Isar
proofs without having to learn a special proof language. However, Isar isa formal proof language and as such it does contain a couple of constructs
whose meaning is hard to guess. In this tutorial we will define a notion
and prove an example theorem about that notion, explaining Isar syntax
along the way. This tutorial may also serve as a style guide for IsarMathLib
contributors. Note that this tutorial aims to help in reading the presentationof the Isar language that is used in IsarMathLib proof document and HTMLrendering on the FormalMath.org site, but does not teach how to write proofs
that can be verified by Isabelle. This presentation is different than thesource processed by Isabelle (the concept that the source and presentation
look different should be familiar to any LaTeX user). To learn how to write
Isar proofs one needs to study the source of this tutorial as well.
The first thing that mathematicians typically do is to define notions. In Isar
this is done with the definition keyword. In our case we define a notion of
two sets being disjoint. We will use the infix notation, i.e. the string {isdisjoint with} put between two sets to denote our notion of disjointness.
The left side of the ≡ symbol is the notion being defined, the right side says
how we define it. In Isabelle/ZF 0 is used to denote both zero (of natural
numbers) and the empty set, which is not surprising as those two things are
the same in set theory.
definition
AreDisjoint (infix {is disjoint with} 90) whereA {is disjoint with} B ≡ A ∩ B = 0

We are ready to prove a theorem. Here we show that the relation of being disjoint is symmetric. We start with one of the keywords ”theorem”,”lemma” or ”corollary”. In Isar they are synonymous. Then we provide aname for the theorem. In standard mathematics theorems are numbered. In
Isar we can do that too, but it is considered better to give theorems meaningful names. After the ”shows” keyword we give the statement to show.
The ←→ symbol denotes the equivalence in Isabelle/ZF. Here we want toshow that ”A is disjoint with B iff and only if B is disjoint with A”. To prove
this fact we show two implications - the first one that A {is disjoint with}
B implies B {is disjoint with} A and then the converse one. Each of these
implications is formulated as a statement to be proved and then proved in a
subproof like a mini-theorem. Each subproof uses a proof block to show the
implication. Proof blocks are delimited with curly brackets in Isar. Proof
block is one of the constructs that does not exist in informal mathematics,
so it may be confusing. When reading a proof containing a proof block I sug10

gest to focus first on what is that we are proving in it. This can be done bylooking at the first line or two of the block and then at the last statement. In
our case the block starts with ”assume A {is disjoint with} B and the laststatement is ”then have B {is disjoint with} A”. It is a typical patternwhen someone needs to prove an implication: one assumes the antecedentand then shows that the consequent follows from this assumption. Implications are denoted with the −→ symbol in Isabelle. After we prove both
implications we collect them using the ”moreover” construct. The keyword”ultimately” indicates that what follows is the conclusion of the statements
collected with ”moreover”. The ”show” keyword is like ”have”, except thatit indicates that we have arrived at the claim of the theorem (or a subproof).
theorem disjointness_symmetric:
shows A {is disjoint with} B ←→ B {is disjoint with} A
proof have A {is disjoint with} B −→ B {is disjoint with} A
proof { assume A {is disjoint with} Bthen have A ∩ B = 0 using AreDisjoint_def by simp
hence B ∩ A = 0 by auto
then have B {is disjoint with} A
using AreDisjoint_def by simp
} thus thesis by simp
qed
moreover have B {is disjoint with} A −→ A {is disjoint with} B
proof { assume B {is disjoint with} A
then have B ∩ A = 0 using AreDisjoint_def by simp
hence A ∩ B = 0 by auto
then have A {is disjoint with} B
using AreDisjoint_def by simp
} thus thesis by simp
qed
ultimately show thesis by blast
qed

1.2

Overview of the project

The Fol1, ZF1 and Nat_ZF_IML theory files contain some background material
that is needed for the remaining theories.
Order_ZF and Order_ZF_1a reformulate material from standard Isabelle’s
Order theory in terms of non-strict (less-or-equal) order relations. Order_ZF_1
on the other hand directly continues the Order theory file using strict orderrelations (less and not equal). This is useful for translating theorems from
Metamath.
In NatOrder_ZF we prove that the usual order on natural numbers is linear.
The func1 theory provides basic facts about functions. func_ZF continues
11this development with more advanced topics that relate to algebraic properties of binary operations, like lifting a binary operation to a function space,associative, commutative and distributive operations and properties of functions related to order relations. func_ZF_1 is about properties of functions
related to order relations.
The standard Isabelle’s Finite theory defines the finite powerset of a set
as a certain ”datatype” (?) with some recursive properties. IsarMathLib’s
Finite1 and Finite_ZF_1 theories develop more facts about this notion.
These two theories are obsolete now. They will be gradually replaced by
an approach based on set theory rather than tools specific to Isabelle. Thisapproach is presented in Finite_ZF theory file.
In FinOrd_ZF we talk about ordered finite sets.
The EquivClass1 theory file is a reformulation of the material in the standard
Isabelle’s EquivClass theory in the spirit of ZF set theory.
FiniteSeq_ZF discusses the notion of finite sequences (a.k.a. lists).
InductiveSeq_ZF provides the definition and properties of (what is known inbasic calculus as) sequences defined by induction, i. e. by a formula of theform a0 = x, an+1 = f (an ).
Fold_ZF shows how the familiar from functional programming notion of foldcan be interpreted in set theory.
Partitions_ZF is about splitting a set into non-overlapping subsets. This is
a common trick in proofs.
Semigroup_ZF treats the expressions of the form a0 · a1 · .. · an , (i.e. productsof finite sequences), where ”·” is an associative binary operation.
CommutativeSemigroup_ZF is another take on a similar subject. This time
we consider the case when the operation is commutative and the result ofdepends only on the set of elements we are summing (additively speaking),
but not the order.
The Topology_ZF series covers basics of general topology: interior, closure,boundary, compact sets, separation axioms and continuous functions.
Group_ZF, Group_ZF_1, Group_ZF_1b and Group_ZF_2 provide basic facts of thegroup theory. Group_ZF_3 considers the notion of almost homomorphismsthat is nedeed for the real numbers construction in Real_ZF.
The TopologicalGroup connects the Topology_ZF and Group_ZF series andstarts the subject of topological groups with some basic definitions and facts.
In DirectProduct_ZF we define direct product of groups and show some its
basic properties.
The OrderedGroup_ZF theory treats ordered groups. This is a suprisingly
large theory for such relatively obscure topic.
Ring_ZF defines rings. Ring_ZF_1 covers the properties of rings that are
specific to the real numbers construction in Real_ZF.
12

The OrderedRing_ZF theory looks at the consequences of adding a linear
order to the ring algebraic structure.
Field_ZF and OrderedField_ZF contain basic facts about (you guessed it)
fields and ordered fields.
Int_ZF_IML theory considers the integers as a monoid (multiplication) and an
abelian ordered group (addition). In Int_ZF_1 we show that integers form
a commutative ring. Int_ZF_2 contains some facts about slopes (almost
homomorphisms on integers) needed for real numbers construction, used in
Real_ZF_1.
In the IntDiv_ZF_IML theory we translate some properties of the integer
quotient and reminder functions studied in the standard Isabelle’s IntDiv_ZF
theory to the notation used in IsarMathLib.
The Real_ZF and Real_ZF_1 theories contain the construction of real numbers
based on the paper [2] by R. D. Arthan (not Cauchy sequences, not Dedekind
sections). The heavy lifting is done mostly in Group_ZF_3, Ring_ZF_1 and
Int_ZF_2. Real_ZF contains the part of the construction that can be done
starting from generic abelian groups (rather than additive group of integers).
This allows to show that real numbers form a ring. Real_ZF_1 continues theconstruction using properties specific to the integers and showing that real
numbers constructed this way form a complete ordered field.
Cardinal_ZF provides a couple of theorems about cardinals that are mostly
used for studying properties of topological properties (yes, this is kind ofmeta). The main result (proven without AC) is that if two sets can beinjectively mapped into an infinite cardinal, then so can be their union.
There is also a definition of the Axiom of Choice specific for a given cardinal(so that the choice function exists for families of sets of given cardinality).
Some properties are proven for such predicates, like that for finite families ofsets the choice function always exists (in ZF) and that the axiom of choice
for a larger cardinal implies one for a smaller cardinal.
Group_ZF_4 considers conjugate of subgroup and defines simple groups. A
nice theorem here is that endomorphisms of an abelian group form a ring.
The first isomorphism theorem (a group homomorphism h induces an isomorphism between the group divided by the kernel of h and the image of h)is proven.
Turns out given a property of a topological space one can define a local version of a property in general. This is studied in the the Topology_ZF_properties_2
theory and applied to local versions of the property of being finite or compact or Hausdorff (i.e. locally finite, locally compact, locally Hausdorff).
There are a couple of nice applications, like one-point compactification thatallows to show that every locally compact Hausdorff space is regular. Also
there are some results on the interplay between hereditability of a property
and local properties.

13

For a given surjection f : X → Y , where X is a topological space one canconsider the weakest topology on Y which makes f continuous, let’s call ita quotient topology generated by f . The quotient topology generated by anequivalence relation r on X is actually a special case of this setup, where fis the natural projection of X on the quotient X/r. The properties of these
two ways of getting new topologies are studied in Topology_ZF_8 theory.
The main result is that any quotient topology generated by a function is
homeomorphic to a topology given by an equivalence relation, so these two
approaches to quotient topologies are kind of equivalent.
As we all know, automorphisms of a topological space form a group. This
fact is proven in Topology_ZF_9 and the automorphism groups for co-cardinal,
included-set, and excluded-set topologies are identified. For order topologies
it is shown that order isomorphisms are homeomorphisms of the topology
induced by the order. Properties preserved by continuous functions are studied and as an application it is shown for example that quotient topologicalspaces of compact (or connected) spaces are compact (or connected, resp.)
The Topology_ZF_10 theory is about products of two topological spaces. It
is proven that if two spaces are T0 (or T1 , T2 , regular, connected) then theirproduct is as well.
Given a total order on a set one can define a natural topology on it generated by taking the rays and intervals as the base. The Topology_ZF_11 theory studies relations between the order and various properties of generated
topology. For example one can show that if the order topology is connected,
then the order is complete (in the sense that for each set bounded fromabove the set of upper bounds has a minimum). For a given cardinal κ we
can consider generalized notion of κ−separability. Turns out κ-separability
is related to (order) density of sets of cardinality κ for order topologies.
Being a topological group imposes additional structure on the topology of thegroup, in particular its separation properties. In Topological_Group_ZF_1.thytheory it is shown that if a topology is T0 , then it must be T3 , and that the
topology in a topological group is always regular.
For a given normal subgroup of a topological group we can define a topology
on the quotient group in a natural way. At the end of the Topological_Group_ZF_2.thytheory it is shown that such topology on the quotient group makes it a topological group.
The Topological_Group_ZF_3.thy theory studies the topologies on subgroups
of a topological group. A couple of nice basic properties are shown, likethat the closure of a subgroup is a subgroup, closure of a normal subgroupis normal and, a bit more surprising (to me) property that every locallycompact subgroup of a T0 group is closed.
In Complex_ZF we construct complex numbers starting from a complete ordered field (a model of real numbers). We also define the notation for writing

14

about complex numbers and prove that the structure of complex numbers
constructed there satisfies the axioms of complex numbers used in Metamath.
MMI_prelude defines the mmisar0 context in which most theorems translated
from Metamath are proven. It also contains a chapter explaining how thetranslation works.
In the Metamath_interface theory we prove a theorem that the mmisar0
context is valid (can be used) in the complex0 context. All theories using the translated results will import the Metamath_interface theory. The
Metamath_sampler theory provides some examples of using the translated
theorems in the complex0 context.
The theories MMI_logic_and_sets, MMI_Complex, MMI_Complex_1 and MMI_Complex_2
contain the theorems imported from the Metamath’s set.mm database. As
the translated proofs are rather verbose these theories are not printed inthis proof document. The full list of translated facts can be found in the
Metamath_theorems.txt file included in the IsarMathLib distribution. The
MMI_examples provides some theorems imported from Metamath that are
printed in this proof document as examples of how translated proofs look
like.
end

2

First Order Logic

theory Fol1 imports ZF.Trancl
begin

Isabelle/ZF builds on the first order logic. Almost everything one would
like to have in this area is covered in the standard Isabelle libraries. The
material in this theory provides some lemmas that are missing or allow fora more readable proof style.

2.1

Notions and lemmas in FOLThis section contains mostly shortcuts and workarounds that allow to use
more readable coding style.
The next lemma serves as a workaround to problems with applying thedefinition of transitivity (of a relation) in our coding style (any attempt todo something like using trans_def puts Isabelle in an infinite loop).
lemma Fol1_L2: assumes
A1: ∀ x y z. hx, yi ∈ r ∧ hy, zi ∈ r −→ hx, zi ∈ rshows trans(r)proof -

15

from A1 have
∀ x y z. hx, yi ∈ r −→ hy, zi ∈ r −→ hx, zi ∈ rusing imp_conj by blast
then show thesis unfolding trans_def by blast
qed

Another workaround for the problem of Isabelle simplifier looping when thetransitivity definition is used.
lemma Fol1_L3: assumes A1: trans(r) and A2: h a,bi ∈ r ∧ h b,ci ∈ rshows h a,ci ∈ r
proof from A1 have ∀ x y z. hx, yi ∈ r −→ hy, zi ∈ r −→ hx, zi ∈ runfolding trans_def by blast
with A2 show thesis using imp_conj by fast
qed

There is a problem with application of the definition of asymetry for relations. The next lemma is a workaround.
lemma Fol1_L4:
assumes A1: antisym(r) and A2: h a,bi ∈ r
h b,ai ∈ rshows a=b
proof from A1 have ∀ x y. h x,yi ∈ r −→ h y,xi ∈ r −→ x=y
unfolding antisym_def by blast
with A2 show a=b using imp_conj by fastqed

The definition below implements a common idiom that states that (perhaps
under some assumptions) exactly one of given three statements is true.
definition
Exactly_1_of_3_holds(p,q,r) ≡(p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→ ¬p ∧ ¬q)

The next lemma allows to prove statements of the form Exactly_1_of_3_holds(p,q,r).
lemma Fol1_L5:
assumes p∨q∨r
and p −→ ¬q ∧ ¬r
and q −→ ¬p ∧ ¬r
and r −→ ¬p ∧ ¬qshows Exactly_1_of_3_holds(p,q,r)
proof from assms have(p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→ ¬p ∧ ¬q)by blast
then show Exactly_1_of_3_holds (p,q,r)
unfolding Exactly_1_of_3_holds_def by fastqed

If exactly one of p, q, r holds and p is not true, then q or r.
16

lemma Fol1_L6:
assumes A1: ¬p and A2: Exactly_1_of_3_holds(p,q,r)shows q∨r
proof from A2 have(p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→ ¬p ∧ ¬q)unfolding Exactly_1_of_3_holds_def by fasthence p ∨ q ∨ r by blast
with A1 show q ∨ r by simp
qed

If exactly one of p, q, r holds and q is true, then r can not be true.
lemma Fol1_L7:
assumes A1: q and A2: Exactly_1_of_3_holds(p,q,r)shows ¬r
proof from A2 have(p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→ ¬p ∧ ¬q)unfolding Exactly_1_of_3_holds_def by fastwith A1 show ¬r by blastqed

The next lemma demonstrates an elegant form of the Exactly_1_of_3_holds(p,q,r)predicate.
lemma Fol1_L8:
shows Exactly_1_of_3_holds(p,q,r) ←→ (p←→q←→r) ∧ ¬(p∧q∧r)
proof
assume Exactly_1_of_3_holds(p,q,r)then have(p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→ ¬p ∧ ¬q)unfolding Exactly_1_of_3_holds_def by fast
thus (p←→q←→r) ∧ ¬(p∧q∧r) by blast
next assume (p←→q←→r) ∧ ¬(p∧q∧r)
hence(p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→ ¬p ∧ ¬q)by autothen show Exactly_1_of_3_holds(p,q,r)
unfolding Exactly_1_of_3_holds_def by fastqed

A property of the Exactly_1_of_3_holds predicate.
lemma Fol1_L8A: assumes A1: Exactly_1_of_3_holds(p,q,r)shows p ←→ ¬(q ∨ r)
proof from A1 have (p∨q∨r) ∧ (p −→ ¬q ∧ ¬r) ∧ (q −→ ¬p ∧ ¬r) ∧ (r −→¬p ∧ ¬q)unfolding Exactly_1_of_3_holds_def by fastthen show p ←→ ¬(q ∨ r) by blast
qed

17

Exclusive or definition. There is one also defined in the standard Isabelle,
denoted xor, but it relates to boolean values, which are sets. Here we definea logical functor.
definition
Xor (infixl Xor 66) where
p Xor q ≡ (p∨q) ∧ ¬(p ∧ q)

The ”exclusive or” is the same as negation of equivalence.
lemma Fol1_L9: shows p Xor q ←→ ¬(p←→q)using Xor_def by auto

Equivalence relations are symmetric.
lemma equiv_is_sym: assumes A1: equiv(X,r) and A2: hx,yi ∈ rshows hy,xi ∈ r
proof from A1 have sym(r) using equiv_def by simp
then have ∀ x y. hx,yi ∈ r −→ hy,xi ∈ runfolding sym_def by fastwith A2 show hy,xi ∈ r by blast
qed

end

3

ZF set theory basics

theory ZF1 imports ZF.equalities
begin

The standard Isabelle distribution contains lots of facts about basic set
theory. This theory file adds some more.

3.1

Lemmas in Zermelo-Fraenkel set theory

Here we put lemmas from the set theory that we could not find in thestandard Isabelle distribution.
If one collection is contained in another, then we can say the same about
their unions.
lemma collection_contain: assumes A⊆B shows
proofS
fix x assume x ∈Athen obtain X where x∈X
S and X∈A by autowith assms show x ∈B by auto
qed

18

S

A ⊆

S

B

If all sets of a nonempty collection are the same, then its union is the same.
lemma ZF1_1_L1:
assumes C6=0 and ∀ y∈C. b(y) = A
S
shows ( y∈C. b(y)) = A using assms by blast

The union af all values of a constant meta-function belongs to the same set
as the constant.
lemma ZF1_1_L2: assumes A1:C6=0 and A2: ∀ x∈C. b(x) ∈ A
and A3: S∀ x y. x∈C ∧ y∈C −→ b(x) = b(y)shows ( x∈C. b(x))∈A
proof from A1 obtain x where D1: x∈C by autowith A3 have ∀S
y∈C. b(y) = b(x) by blast
with A1 have ( y∈C. b(y)) = b(x)using ZF1_1_L1 by simp
with D1 A2 show thesis by simp
qed

If two meta-functions are the same on a cartesian product, then the subsets
defined by them are the same. I am surprised Isabelle can not handle thisautomatically.
lemma ZF1_1_L4: assumes A1: ∀ x∈X.∀ y∈Y. a(x,y) = b(x,y)
shows {a(x,y). hx,yi ∈ X×Y} = {b(x,y). hx,yi ∈ X×Y}
proof
show {a(x, y). hx,yi ∈ X × Y} ⊆ {b(x, y). hx,yi ∈ X × Y}
proof
fix z assume z ∈ {a(x, y) . hx,yi ∈ X × Y}
with A1 show z ∈ {b(x,y).hx,yi ∈ X×Y} by autoqedshow {b(x, y). hx,yi ∈ X × Y} ⊆ {a(x, y). hx,yi ∈ X × Y}
proof
fix z assume z ∈ {b(x, y). hx,yi ∈ X × Y}
with A1 show z ∈ {a(x,y).hx,yi ∈ X×Y} by autoqed
qed

If two meta-functions are the same on a cartesian product, then the subsets
defined by them are the same. This is similar to ZF1_1_L4, except that theset definition varies over p∈X×Y rather than h x,yi∈X×Y.
lemma ZF1_1_L4A: assumes A1: ∀ x∈X.∀ y∈Y. a(h x,yi) = b(x,y)
shows {a(p). p ∈ X×Y} = {b(x,y). hx,yi ∈ X×Y}
proof
{ fix z assume z ∈ {a(p). p∈X×Y}
then obtain p where D1: z=a(p) p∈X×Y by auto
let x = fst(p) let y = snd(p)from A1 D1 have z ∈ {b(x,y). hx,yi ∈ X×Y} by auto
} then show {a(p). p ∈ X×Y} ⊆ {b(x,y). hx,yi ∈ X×Y} by blastnext{ fix z assume z ∈ {b(x,y). hx,yi ∈ X×Y}

19

then obtain x y where D1: hx,yi ∈ X×Y z=b(x,y) by auto
let p = h x,yi
from A1 D1 have p∈X×Y z = a(p) by auto
then have z ∈ {a(p). p ∈ X×Y} by auto
} then show {b(x,y). hx,yi ∈ X×Y} ⊆ {a(p). p ∈ X×Y} by blastqed

A lemma about inclusion in cartesian products. Included here to rememberthat we need the U × V 6= ∅ assumption.
lemma prod_subset: assumes U×V6=0 U×V ⊆ X×Y shows U⊆X and V⊆Yusing assms by auto

A technical lemma about sections in cartesian products.
lemma section_proj: assumes A ⊆ X×Y and U×V ⊆ A and x ∈ Ushows U ⊆ {t∈X. ht,yi ∈ A} and V ⊆ {t∈Y. hx,ti ∈ A}
using assms by autoy ∈ V

If two meta-functions are the same on a set, then they define the same set
by separation.
lemma ZF1_1_L4B: assumes ∀ x∈X. a(x) = b(x)shows {a(x). x∈X} = {b(x). x∈X}
using assms by simp

A set defined by a constant meta-function is a singleton.
lemma ZF1_1_L5: assumes X6=0 and ∀ x∈X. b(x) = c
shows {b(x). x∈X} = {c} using assms by blast

Most of the time, auto does this job, but there are strange cases when thenext lemma is needed.
lemma subset_with_property: assumes Y = {x∈X. b(x)}shows Y ⊆ X
using assms by auto

We can choose an element from a nonempty set.
lemma nonempty_has_element: assumes X6=0 shows ∃ x. x∈Xusing assms by auto

In Isabelle/ZF the intersection of an empty family is empty. This is exactly
lemma Inter_0 from Isabelle’s equalities theory. We repeat this lemma
here as it is very difficult to find. This is one reason we need comments
before every theorem: so that we can search for keywords.
lemma inter_empty_empty: showsT

0 = 0 by (rule Inter_0)

If an intersection of a collection is not empty, then the collection is not
empty. We are (ab)using the fact the the intersection of empty collection isdefined to be empty.
20

lemma inter_nempty_nempty: assumes
using assms by autoT

A 6= 0 shows A6=0

For two collections S, T of sets we define the product collection as the collections of cartesian products A × B, where A ∈ S, B ∈ T .
definition
S
ProductCollection(T,S) ≡U∈T.{U×V. V∈S}

The union
S of theSproduct collection of collections S, T is the cartesian product of S and T .
SSSlemma ZF1_1_L6: shows
ProductCollection(S,T) =S ×Tusing ProductCollection_def by auto

An intersection of subsets is a subset.
lemma ZF1_1_L7:
assumes A1: I6=0 and A2: ∀ i∈I. P(i) ⊆ X
Ti∈I. P(i) ) ⊆ X
shows (
proof from A1 obtain i
T0 where i0 ∈ I by autowith A2 have (i∈I. P(i) ) ⊆ P(i0 ) and P(i0 ) ⊆ X
by autoT
thus (i∈I. P(i) ) ⊆ X by autoqed

Isabelle/ZF has a ”THE” construct that allows to define an element if there
is only one such that is satisfies given predicate. In pure ZF we can express
something similar using the indentity proven below.
lemma ZF1_1_L8: showsS{x} = x by auto

Some properties of singletons.
lemma ZF1_1_L9: assumes A1: ∃ ! x. x∈A ∧ ϕ(x)shows
∃ a. {x∈A. ϕ(x)} = {a}S
S{x∈A. ϕ(x)} ∈ A
ϕ({x∈A. ϕ(x)})
proof from A1 show ∃ a. {x∈A. ϕ(x)} = {a} by auto
then obtainS a where I: {x∈A. ϕ(x)} = {a} by auto
then have{x∈A. ϕ(x)} = a by auto
moreoverfrom I have a ∈ {x∈A. ϕ(x)} by simp
hence a∈A and ϕ(a)S by autoS
ultimately show{x∈A. ϕ(x)} ∈ A and ϕ({x∈A. ϕ(x)})
by autoqed

A simple version of ZF1_1_L9.
corollary singleton_extract: assumes

21∃ ! x. x∈AS
shows (A) ∈ A
proof from assms Shave ∃ ! x. x∈A ∧ True by simp
then have{x∈A. True} ∈ A by (rule ZF1_1_L9)
Sthus (A) ∈ A by simpqed

A criterion for when a set defined by comprehension is a singleton.
lemma singleton_comprehension:
assumesSA1: y∈X and A2: ∀ x∈X. ∀ y∈X. P(x) = P(y)shows ( {P(x). x∈X}) = P(y)proof let A = {P(x). x∈X}
have ∃ ! c. c ∈ A
prooffrom A1 show ∃ c. c ∈ A by autonext
fix a b assume a ∈ A and b ∈ Athen obtain x t wherex ∈ X a = P(x) and t ∈ X b = P(t)by autowith A2 show a=b by blast
qed
Sthen have ( A) ∈ A by (rule singleton_extract)S
then obtain x where x ∈ X and ( A) = P(x)by autofrom A1 A2 hx ∈ Xi have P(x) = P(y)by blast
S
S
with h( A) = P(x)i show ( A) = P(y) by simp
qed

Adding an element of a set to that set does not change the set.
lemma set_elem_add: assumes x∈X shows X ∪ {x} = X using assms
by autoHere we define a restriction of a collection of sets to a given set. In romantic
math this is typically denoted X ∩ M and means {X ∩ A : A ∈ M }. Notethere is also restrict(f, A) defined for relations in ZF.thy.
definition
RestrictedTo (infixl {restricted to} 70) where
M {restricted to} X ≡ {X ∩ A . A ∈ M}

A lemma on a union of a restriction of a collection to a set.
lemma union_restrict:
S
S
shows
(M {restricted to} X) = ( M) ∩ X
using RestrictedTo_def by auto

Next we show a technical identity that is used to prove sufficiency of somecondition for a collection of sets to be a base for a topology.
22

S
lemma ZF1_1_L10:
A1: ∀ U∈C. ∃ A∈B.
U =AS S S assumes S
S
shows{ {A∈B. U =A}. U∈C} =C
proof S S
SSSshow S ( U∈C.
A}) ⊆S S {A ∈ SB . U =S C by blastshow
C ⊆( U∈C.
{A ∈ B . U =
A})
proof
S
fix x assume
x ∈
CS
S S
S
show x ∈( U∈C.
{A ∈ B . U =A})proof S
from hx ∈Ci obtain U where U∈C S∧ x∈U by autowith A1 obtain A where A∈B ∧U=
A by auto
S
S S
ShU∈C ∧ x∈Ui hA∈B ∧ U =i show x∈
fromA( U∈C.
{A ∈ B . U
S=A})
by auto
qed
qed
qed

Standard Isabelle uses a notion of cons(A,a) that can be thought of as
A ∪ {a}.
lemma consdef: shows cons(a,A) = A ∪ {a}using cons_def by auto

If a difference between a set and a singleton is empty, then the set is empty
or it is equal to the singleton.
lemma singl_diff_empty: assumes A - {x} = 0
shows A = 0 ∨ A = {x}using assms by auto

If a difference between a set and a singleton is the set, then the only elementof the singleton is not in the set.
lemma singl_diff_eq: assumes A1: A - {x} = A
shows x ∈/ A
proof have x ∈/ A - {x} by autowith A1 show x ∈/ A by simpqed

A basic property of sets defined by comprehension.
lemma comprehension: assumes a ∈ {x∈X. p(x)}shows a∈X and p(a) using assms by auto

The image of a set by a greater relation is greater.
lemma image_rel_mono: assumes r⊆s shows r(A) ⊆ s(A)using assms by auto

A technical lemma about relations: if x is in its image by a relation U andthat image is contained in some set C, then the image of the singleton {x}by the relation U ∪ C × C equals C.
23

lemma image_greater_rel:
assumes x ∈ U{x} and U{x} ⊆ Cshows (U ∪ C×C){x} = C
using assms image_Un_left by blastend

4

Natural numbers in IsarMathLib

theory Nat_ZF_IML imports ZF.Arith
begin

The ZF set theory constructs natural numbers from the empty set and thenotion of a one-element set. Namely, zero of natural numbers is definedas the empty set. For each natural number n the next natural number isdefined as n ∪ {n}. With this definition for every non-zero natural number
we get the identity n = {0, 1, 2, .., n − 1}. It is good to remember that when
we see an expression like f : n → X. Also, with this definition the relation”less or equal than” becomes ”⊆” and the relation ”less than” becomes ”∈”.

4.1

Induction

The induction lemmas in the standard Isabelle’s Nat.thy file like for example
nat_induct require the induction step to be a higher order statement (theone that uses the =⇒ sign). I found it difficult to apply from Isar, whichis perhaps more of an indication of my Isar skills than anything else. Anyway, here we provide a first order version that is easier to reference in Isardeclarative style proofs.
The next theorem is a version of induction on natural numbers that I wasthought in school.
theorem ind_on_nat:
assumes A1: n∈nat and A2: P(0) and A3: ∀ k∈nat. P(k)−→P(succ(k))
shows P(n)proof note A1 A2
moreover{ fix xassume x∈nat P(x)with A3 have P(succ(x)) by simp }ultimately show P(n) by (rule nat_induct)qed

A nonzero natural number has a predecessor.
lemma Nat_ZF_1_L3: assumes A1: n ∈ nat and A2: n6=0

24

shows ∃ k∈nat. n = succ(k)proof from A1 have n ∈ {0} ∪ {succ(k). k∈nat}using nat_unfold by simp
with A2 show thesis by simp
qed

What is succ, anyway?
lemma succ_explained: shows succ(n) = n ∪ {n}using succ_iff by auto

Empty set is an element of every natural number which is not zero.
lemma empty_in_every_succ: assumes A1: n ∈ nat
shows 0 ∈ succ(n)proof note A1
moreover have 0 ∈ succ(0) by simp
moreover{ fix k assume k ∈ nat and A2: 0 ∈ succ(k)then have succ(k) ⊆ succ(succ(k)) by autowith A2 have 0 ∈ succ(succ(k)) by auto
} then have ∀ k ∈ nat. 0 ∈ succ(k) −→ 0 ∈ succ(succ(k))
by simpultimately show 0 ∈ succ(n) by (rule ind_on_nat)qed

If one natural number is less than another then their successors are in thesame relation.
lemma succ_ineq: assumes A1: n ∈ nat
shows ∀ i ∈ n. succ(i) ∈ succ(n)proof note A1
moreover have ∀ k ∈ 0. succ(k) ∈ succ(0) by simp
moreover{ fix k assume A2: ∀ i∈k. succ(i) ∈ succ(k){ fix i assume i ∈ succ(k)then have i ∈ k ∨ i = k by auto
moreover{ assume i∈kwith A2 have succ(i) ∈ succ(k) by simp
hence succ(i) ∈ succ(succ(k)) by auto }moreover{ assume i = kthen have succ(i) ∈ succ(succ(k)) by auto }
ultimately have succ(i) ∈ succ(succ(k)) by auto
} then have ∀ i ∈ succ(k). succ(i) ∈ succ(succ(k))
by simp} then have ∀ k ∈ nat.

25

( (∀ i∈k. succ(i) ∈ succ(k)) −→ (∀ i ∈ succ(k). succ(i) ∈ succ(succ(k))))
by simpultimately show ∀ i ∈ n. succ(i) ∈ succ(n) by (rule ind_on_nat)qed

For natural numbers if k ⊆ n the similar holds for their successors.
lemma succ_subset: assumes A1: k ∈ nat n ∈ nat and A2: k⊆nshows succ(k) ⊆ succ(n)proof from A1 have T: Ord(k) and Ord(n)using nat_into_Ord by autowith A2 have succ(k) ≤ succ(n)using subset_imp_le by simp
then show succ(k) ⊆ succ(n) using le_imp_subset
by simpqed

For any two natural numbers one of them is contained in the other.
lemma nat_incl_total: assumes A1: i ∈ nat j ∈ nat
shows i ⊆ j ∨ j ⊆ iproof from A1 have T: Ord(i)Ord(j)
using nat_into_Ord by auto
then have i∈j ∨ i=j ∨ j∈i using Ord_linear
by simpmoreover{ assume i∈jwith T have i⊆j ∨ j⊆iusing lt_def leI le_imp_subset by simp }moreover{ assume i=jthen have i⊆j ∨ j⊆i by simp }moreover{ assume j∈iwith T have i⊆j ∨ j⊆iusing lt_def leI le_imp_subset by simp }ultimately show i ⊆ j ∨ j ⊆ i by autoqed

The set of natural numbers is the union of all successors of natural numbers.
Slemma nat_union_succ: shows nat = ( n ∈ nat. succ(n))
proofSshow nat ⊆ ( n ∈ nat. succ(n)) by autonext
S{ fix k assume A2: k ∈ ( n ∈ nat. succ(n))
then obtain n where T: n ∈ nat and I: k ∈ succ(n)by autothen have k ≤ n using nat_into_Ord lt_def

26

by simp
with T have kS∈ nat using le_in_nat by simp
} then show ( n ∈ nat. succ(n)) ⊆ nat by autoqed

Successors of natural numbers are subsets of the set of natural numbers.
lemma succnat_subset_nat: assumes A1: n ∈ nat shows succ(n) ⊆ nat
proof S
from A1 have succ(n) ⊆ ( n ∈ nat. succ(n)) by auto
then show succ(n) ⊆ nat using nat_union_succ by simp
qed

Element of a natural number is a natural number.
lemma elem_nat_is_nat: assumes A1: n ∈ nat and A2: k∈nshows k < n k ∈ nat k ≤ n hk,ni ∈ Le
proof from A1 A2 show k < n using nat_into_Ord lt_def by simp
with A1 show k ∈ nat using lt_nat_in_nat by simp
from hk < ni show k ≤ n using leI by simp
with A1 hk ∈ nati show hk,ni ∈ Le using Le_def
by simpqed

The set of natural numbers is the union of its elements.
lemma nat_union_nat: shows nat =using elem_nat_is_nat by blastSnat

A natural number is a subset of the set of natural numbers.
lemma nat_subset_nat: assumes A1: n ∈ nat shows n ⊆ nat
proof S
from A1 have n ⊆nat by auto
then show n ⊆ nat using nat_union_nat by simp
qed

Adding natural numbers does not decrease what we add to.
lemma add_nat_le: assumes A1: n ∈ nat and A2: k ∈ nat
showsn ≤ n #+ kn ⊆ n #+ kn ⊆ k #+ nproof from A1 A2 have n ≤ n 0 ≤ k n ∈ nat k ∈ nat
using nat_le_refl nat_0_le by auto
then have n #+ 0 ≤ n #+ k by (rule add_le_mono)with A1 show n ≤ n #+ k using add_0_right by simp
then show n ⊆ n #+ k using le_imp_subset by simp
then show n ⊆ k #+ n using add_commute by simpqed27

Result of adding an element of k is smaller than of adding k.
lemma add_lt_mono:assumes k ∈ nat and j∈kshows(n #+ j) < (n #+ k)(n #+ j) ∈ (n #+ k)proof from assms have j < k using elem_nat_is_nat by blast
moreover note hk ∈ nati
ultimately show (n #+ j) < (n #+ k)(n #+ j) ∈ (n #+ k)using add_lt_mono2 ltD by autoqed

A technical lemma about a decomposition of a sum of two natural numbers:
if a number i is from m + n then it is either from m or can be written as asum of m and a number from n. The proof by induction w.r.t. to m seems
to be a bit heavy-handed, but I could not figure out how to do this directlyfrom results from standard Isabelle/ZF.
lemma nat_sum_decomp: assumes A1: n ∈ nat and A2: m ∈ nat
shows ∀ i ∈ m #+ n. i ∈ m ∨ (∃ j ∈ n. i = m #+ j)proof note A1
moreover from A2 have ∀ i ∈ m #+ 0. i ∈ m ∨ (∃ j ∈ 0. i = m #+ j)using add_0_right by simp
moreover have ∀ k∈nat.
(∀ i ∈ m #+ k. i ∈ m ∨ (∃ j ∈ k. i = m #+ j)) −→(∀ i ∈ m #+ succ(k). i ∈ m ∨ (∃ j ∈ succ(k). i = m #+ j))
proof { fix k assume A3: k ∈ nat{ assume A4: ∀ i ∈ m #+ k. i ∈ m ∨ (∃ j ∈ k. i = m #+ j){ fix i assume i ∈ m #+ succ(k)then have i ∈ m #+ k ∨ i = m #+ k using add_succ_rightby automoreover from A4 A3 havei ∈ m #+ k −→ i ∈ m ∨ (∃ j ∈ succ(k). i = m #+ j)by autoultimately have i ∈ m ∨ (∃ j ∈ succ(k). i = m #+ j)by auto} then have ∀ i ∈ m #+ succ(k). i ∈ m ∨ (∃ j ∈ succ(k). i = m #+ j)by simp} then have (∀ i ∈ m #+ k. i ∈ m ∨ (∃ j ∈ k. i = m #+ j)) −→(∀ i ∈ m #+ succ(k). i ∈ m ∨ (∃ j ∈ succ(k). i = m #+ j))
by simp} then show thesis by simp
qed
ultimately show ∀ i ∈ m #+ n. i ∈ m ∨ (∃ j ∈ n. i = m #+ j)by (rule ind_on_nat)qed28

A variant of induction useful for finite sequences.
lemma fin_nat_ind: assumes A1: n ∈ nat and A2: k ∈ succ(n)and A3: P(0) and A4: ∀ j∈n. P(j) −→ P(succ(j))
shows P(k)proof from A2 have k ∈ n ∨ k=n by autowith A1 have k ∈ nat using elem_nat_is_nat by blast
moreover from A3 have 0 ∈ succ(n) −→ P(0) by simp
moreover from A1 A4 have∀ k ∈ nat. (k ∈ succ(n) −→ P(k)) −→ (succ(k) ∈ succ(n) −→ P(succ(k)))
using nat_into_Ord Ord_succ_mem_iff by auto
ultimately have k ∈ succ(n) −→ P(k)by (rule ind_on_nat)with A2 show P(k) by simp
qedSome properties of positive natural numbers.
lemma succ_plus: assumes n ∈ nat k ∈ natshows
succ(n #+ j) ∈ nat
succ(n) #+ succ(j) = succ(succ(n #+ j))
using assms by auto

4.2

Intervals

In this section we consider intervals of natural numbers i.e. sets of the form
{n + j : j ∈ 0..k − 1}.
The interval is determined by two parameters: starting point and length.
Recall that in standard Isabelle’s Arith.thy the symbol #+ is defined as thesum of natural numbers.
definition
NatInterval(n,k) ≡ {n #+ j. j∈k}

Subtracting the beginning af the interval results in a number from the lengthof the interval. It may sound weird, but note that the length of such interval
is a natural number, hence a set.
lemma inter_diff_in_len:
assumes A1: k ∈ nat and A2: i ∈ NatInterval(n,k)
shows i #- n ∈ kproof from A2 obtain j where I: i = n #+ j and II: j ∈ kusing NatInterval_def by autofrom A1 II have j ∈ nat using elem_nat_is_nat by blast
moreover from I have i #- n = natify(j) using diff_add_inverseby simp29

ultimately have i #- n = j by simp
with II show thesis by simp
qedIntervals don’t overlap with their starting point and the union of an intervalwith its starting point is the sum of the starting point and the length of theinterval.
lemma length_start_decomp: assumes A1: n ∈ nat k ∈ nat
showsn ∩ NatInterval(n,k) = 0
n ∪ NatInterval(n,k) = n #+ kproof { fix i assume A2: i ∈ n and i ∈ NatInterval(n,k)
then obtain j where I: i = n #+ j and II: j ∈ kusing NatInterval_def by autofrom A1 have k ∈ nat using elem_nat_is_nat by blast
with II have j ∈ nat using elem_nat_is_nat by blast
with A1 I have n ≤ i using add_nat_le by simp
moreover from A1 A2 have i < n using elem_nat_is_nat by blast
ultimately have False using le_imp_not_lt by blast} thus n ∩ NatInterval(n,k) = 0 by autofrom A1 have n ⊆ n #+ k using add_nat_le by simp
moreover{ fix i assume i ∈ NatInterval(n,k)
then obtain j where III: i = n #+ j and IV: j ∈ kusing NatInterval_def by autowith A1 have j < k using elem_nat_is_nat by blast
with A1 III have i ∈ n #+ k using add_lt_mono2 ltD
by simp }
ultimately have n ∪ NatInterval(n,k) ⊆ n #+ k by auto
moreover from A1 have n #+ k ⊆ n ∪ NatInterval(n,k)
using nat_sum_decomp NatInterval_def by auto
ultimately show n ∪ NatInterval(n,k) = n #+ k by autoqed

Sme properties of three adjacent intervals.
lemma adjacent_intervals3: assumes n ∈ nat k ∈ nat m ∈ nat
showsn #+ k #+ m = (n #+ k) ∪ NatInterval(n #+ k,m)
n #+ k #+ m = n ∪ NatInterval(n,k #+ m)n #+ k #+ m = n ∪ NatInterval(n,k) ∪ NatInterval(n #+ k,m)using assms add_assoc length_start_decomp by auto
end

5

Order relations - introduction

theory Order_ZF imports Fol130

beginThis theory file considers various notion related to order. We redefine thenotions of a total order, linear order and partial order to have the same
terminology as Wikipedia (I found it very consistent across different areasof math). We also define and study the notions of intervals and bounded sets.
We show the inclusion relations between the intervals with endpoints being
in certain order. We also show that union of bounded sets are bounded.
This allows to show in Finite_ZF.thy that finite sets are bounded.

5.1

Definitions

In this section we formulate the definitions related to order relations.
A relation r is ”total” on a set X if for all elements a, b of X we have a isin relation with b or b is in relation with a. An example is the ≤ relation onnumbers.
definition
IsTotal (infixl {is total on} 65) wherer {is total on} X ≡ (∀ a∈X.∀ b∈X. h a,bi ∈ r ∨ h b,ai ∈ r)

A relation r is a partial order on X if it is reflexive on X (i.e. hx, xi forevery x ∈ X), antisymmetric (if hx, yi ∈ r and hy, xi ∈ r, then x = y) andtransitive hx, yi ∈ r and hy, zi ∈ r implies hx, zi ∈ r).
definition
IsPartOrder(X,r) ≡ (refl(X,r) ∧ antisym(r) ∧ trans(r))

We define a linear order as a binary relation that is antisymmetric, transitive
and total. Note that this terminology is different than the one used thestandard Order.thy file.
definition
IsLinOrder(X,r) ≡ ( antisym(r) ∧ trans(r) ∧ (r {is total on} X))

A set is bounded above if there is that is an upper bound for it, i.e. there
are some u such that hx, ui ∈ r for all x ∈ A. In addition, the empty set isdefined as bounded.
definition
IsBoundedAbove(A,r) ≡ ( A=0 ∨ (∃ u. ∀ x∈A. h x,ui ∈ r))

We define sets bounded below analogously.
definition
IsBoundedBelow(A,r) ≡ (A=0 ∨ (∃ l. ∀ x∈A. h l,xi ∈ r))

A set is bounded if it is bounded below and above.
definition

31

IsBounded(A,r) ≡ (IsBoundedAbove(A,r) ∧ IsBoundedBelow(A,r))

The notation for the definition of an interval may be mysterious for somereaders, see lemma Order_ZF_2_L1 for more intuitive notation.
definition
Interval(r,a,b) ≡ r{a} ∩ r-{b}We also define the maximum (the greater of) two elemnts in the obvious
way.
definition
GreaterOf(r,a,b) ≡ (if h a,bi ∈ r then b else a)

The definition a a minimum (the smaller of) two elements.
definition
SmallerOf(r,a,b) ≡ (if h a,bi ∈ r then a else b)

We say that a set has a maximum if it has an element that is not smallerthat any other one. We show that under some conditions this element of
the set is unique (if exists).
definition
HasAmaximum(r,A) ≡ ∃ M∈A.∀ x∈A. h x,Mi ∈ r

A similar definition what it means that a set has a minimum.
definition
HasAminimum(r,A) ≡ ∃ m∈A.∀ x∈A. h m,xi ∈ rDefinition of the maximum of a set.
definition
Maximum(r,A) ≡ THE M. M∈A ∧ (∀ x∈A. h x,Mi ∈ r)

Definition of a minimum of a set.
definition
Minimum(r,A) ≡ THE m. m∈A ∧ (∀ x∈A. h m,xi ∈ r)

The supremum of a set A is defined as the Tminimum of the set of upperbounds, i.e. the set {u.∀a∈A ha, ui ∈ r} = a∈A r{a}. Recall that in Isabelle/ZF r-(A) denotes the inverse image of the set A by relation r (i.e.
r-(A)={x : hx, yi ∈ r for some y ∈ A}).
definition
T
Supremum(r,A) ≡ Minimum(r, a∈A. r{a})Infimum is defined analogously.
definition
T
Infimum(r,A) ≡ Maximum(r, a∈A. r-{a})We define a relation to be complete if every nonempty bounded above set
has a supremum.
32definition
IsComplete (_ {is complete}) wherer {is complete} ≡T∀ A. IsBoundedAbove(A,r) ∧ A6=0 −→ HasAminimum(r, a∈A. r{a})The essential condition to show that a total relation is reflexive.
lemma Order_ZF_1_L1: assumes r {is total on} X and a∈Xshows ha,ai ∈ r using assms IsTotal_def by auto

A total relation is reflexive.
lemma total_is_refl:assumes r {is total on} X
shows refl(X,r) using assms Order_ZF_1_L1 refl_def by simp

A linear order is partial order.
lemma Order_ZF_1_L2: assumes IsLinOrder(X,r)
shows IsPartOrder(X,r)
using assms IsLinOrder_def IsPartOrder_def refl_def Order_ZF_1_L1
by autoPartial order that is total is linear.
lemma Order_ZF_1_L3:
assumes IsPartOrder(X,r) and r {is total on} X
shows IsLinOrder(X,r)
using assms IsPartOrder_def IsLinOrder_def
by simp

Relation that is total on a set is total on any subset.
lemma Order_ZF_1_L4: assumes r {is total on} X and A⊆X
shows r {is total on} A
using assms IsTotal_def by auto

A linear relation is linear on any subset.
lemma ord_linear_subset: assumes IsLinOrder(X,r) and A⊆X
shows IsLinOrder(A,r)
using assms IsLinOrder_def Order_ZF_1_L4 by blast

If the relation is total, then every set is a union of those elements that arenongreater than a given one and nonsmaller than a given one.
lemma Order_ZF_1_L5:
assumes r {is total on} X and A⊆X and a∈Xshows A = {x∈A. hx,ai ∈ r} ∪ {x∈A. ha,xi ∈ r}using assms IsTotal_def by auto

A technical fact about reflexive relations.
lemma refl_add_point:
assumes refl(X,r) and A ⊆ B ∪ {x} and B ⊆ X and33

x ∈ X and ∀ y∈B. hy,xi ∈ rshows ∀ a∈A. ha,xi ∈ rusing assms refl_def by auto

5.2

Intervals

In this section we discuss intervals.
The next lemma explains the notation of the definition of an interval.
lemma Order_ZF_2_L1:
shows x ∈ Interval(r,a,b) ←→ h a,xi ∈ r ∧ h x,bi ∈ rusing Interval_def by auto

Since there are some problems with applying the above lemma (seems that
simp and auto don’t handle equivalence very well), we split Order_ZF_2_L1
into two lemmas.
lemma Order_ZF_2_L1A: assumes x ∈ Interval(r,a,b)
shows h a,xi ∈ r h x,bi ∈ rusing assms Order_ZF_2_L1 by auto
Order_ZF_2_L1, implication from right to left.
lemma Order_ZF_2_L1B: assumes h a,xi ∈ rshows x ∈ Interval(r,a,b)
using assms Order_ZF_2_L1 by simp

h x,bi ∈ r

If the relation is reflexive, the endpoints belong to the interval.
lemma Order_ZF_2_L2: assumes refl(X,r)
and a∈X b∈X and h a,bi ∈ rshowsa ∈ Interval(r,a,b)b ∈ Interval(r,a,b)
using assms refl_def Order_ZF_2_L1 by auto

Under the assumptions of Order_ZF_2_L2, the interval is nonempty.
lemma Order_ZF_2_L2A: assumes refl(X,r)
and a∈X b∈X and h a,bi ∈ rshows Interval(r,a,b) 6= 0
proof from assms have a ∈ Interval(r,a,b)
using Order_ZF_2_L2 by simp
then show Interval(r,a,b) 6= 0 by autoqed

If a, b, c, d are in this order, then [b, c] ⊆ [a, d]. We only need trasitivity forthis to be true.
lemma Order_ZF_2_L3:
assumes A1: trans(r) and A2:h a,bi∈r34

h b,ci∈r

h c,di∈rshows Interval(r,b,c) ⊆ Interval(r,a,d)
proof
fix x assume A3: x ∈ Interval(r, b, c)
note A1
moreover from A2 A3 have h a,bi ∈ r ∧ h b,xi ∈ r using Order_ZF_2_L1A
by simpultimately have T1: h a,xi ∈ r by (rule Fol1_L3)
note A1
moreover from A2 A3 have h x,ci ∈ r ∧ h c,di ∈ r using Order_ZF_2_L1A
by simpultimately have h x,di ∈ r by (rule Fol1_L3)
with T1 show x ∈ Interval(r,a,d) using Order_ZF_2_L1B
by simpqed

For reflexive and antisymmetric relations the interval with equal endpoints
consists only of that endpoint.
lemma Order_ZF_2_L4:
assumes A1: refl(X,r) and A2: antisym(r) and A3: a∈Xshows Interval(r,a,a) = {a}prooffrom A1 A3 have h a,ai ∈ r using refl_def by simp
with A1 A3 show {a} ⊆ Interval(r,a,a) using Order_ZF_2_L2 by simp
from A2 show Interval(r,a,a) ⊆ {a} using Order_ZF_2_L1A Fol1_L4
by fastqed

For transitive relations the endpoints have to be in the relation for theinterval to be nonempty.
lemma Order_ZF_2_L5: assumes A1: trans(r) and A2: h a,bi ∈/ rshows Interval(r,a,b) = 0
proof { assume Interval(r,a,b)6=0 then obtain x where x ∈ Interval(r,a,b)
by autowith A1 A2 have False using Order_ZF_2_L1A Fol1_L3 by fast
} thus thesis by autoqed

If a relation is defined on a set, then intervals are subsets of that set.
lemma Order_ZF_2_L6: assumes A1: r ⊆ X×X
shows Interval(r,a,b) ⊆ X
using assms Interval_def by auto

5.3

Bounded sets

In this section we consider properties of bounded sets.
For reflexive relations singletons are bounded.
35

lemma Order_ZF_3_L1: assumes refl(X,r) and a∈Xshows IsBounded({a},r)using assms refl_def IsBoundedAbove_def IsBoundedBelow_def
IsBounded_def by auto

Sets that are bounded above are contained in the domain of the relation.
lemma Order_ZF_3_L1A: assumes r ⊆ X×X
and IsBoundedAbove(A,r)
shows A⊆X using assms IsBoundedAbove_def by auto

Sets that are bounded below are contained in the domain of the relation.
lemma Order_ZF_3_L1B: assumes r ⊆ X×X
and IsBoundedBelow(A,r)
shows A⊆X using assms IsBoundedBelow_def by auto

For a total relation, the greater of two elements, as defined above, is indeed
greater of any of the two.
lemma Order_ZF_3_L2: assumes r {is total on} X
and x∈X y∈X
showshx,GreaterOf(r,x,y)i ∈ rhy,GreaterOf(r,x,y)i ∈ r
hSmallerOf(r,x,y),xi ∈ r
hSmallerOf(r,x,y),yi ∈ rusing assms IsTotal_def Order_ZF_1_L1 GreaterOf_def SmallerOf_def
by autoIf A is bounded above by u, B is bounded above by w, then A∪B is bounded
above by the greater of u, w.
lemma Order_ZF_3_L2B:
assumes A1: r {is total on} X and A2: trans(r)and A3: u∈X w∈X
and A4: ∀ x∈A. h x,ui ∈ r ∀ x∈B. h x,wi ∈ rshows ∀ x∈A∪B. hx,GreaterOf(r,u,w)i ∈ r
proof
let v = GreaterOf(r,u,w)
from A1 A3 have T1: h u,vi ∈ r and T2: h w,vi ∈ rusing Order_ZF_3_L2 by auto
fix x assume A5: x∈A∪B show hx,vi ∈ r
proof { assume x∈Awith A4 T1 have h x,ui ∈ r ∧ h u,vi ∈ r by simp
with A2 have hx,vi ∈ r by (rule Fol1_L3) }moreover{ assume x∈A/with A5 A4 T2 have h x,wi ∈ r ∧ h w,vi ∈ r by simp
with A2 have hx,vi ∈ r by (rule Fol1_L3) }ultimately show thesis by auto

36

qed
qed

For total and transitive relation the union of two sets bounded above isbounded above.
lemma Order_ZF_3_L3:
assumes A1: r {is total on} X and A2: trans(r)and A3: IsBoundedAbove(A,r) IsBoundedAbove(B,r)
and A4: r ⊆ X×X
shows IsBoundedAbove(A∪B,r)proof { assume A=0 ∨ B=0
with A3 have IsBoundedAbove(A∪B,r) by auto }moreover{ assume ¬ (A = 0 ∨ B = 0)then have T1: A6=0 B6=0 by autowith A3 obtain u w where D1: ∀ x∈A. h x,ui ∈ r ∀ x∈B. h x,wi ∈ rusing IsBoundedAbove_def by auto
let U = GreaterOf(r,u,w)
from T1 A4 D1 have u∈X w∈X by autowith A1 A2 D1 have ∀ x∈A∪B.h x,Ui ∈ rusing Order_ZF_3_L2B by blast
then have IsBoundedAbove(A∪B,r)using IsBoundedAbove_def by auto }
ultimately show thesis by autoqed

For total and transitive relations if a set A is bounded above then A ∪ {a}is bounded above.
lemma Order_ZF_3_L4:
assumes A1: r {is total on} X and A2: trans(r)and A3: IsBoundedAbove(A,r) and A4: a∈X and A5: r ⊆ X×X
shows IsBoundedAbove(A∪{a},r)
proof from A1 have refl(X,r)
using total_is_refl by simp
with assms show thesis using
Order_ZF_3_L1 IsBounded_def Order_ZF_3_L3 by simp
qed

If A is bounded below by l, B is bounded below by m, then A∪B is bounded
below by the smaller of u, w.
lemma Order_ZF_3_L5B:
assumes A1: r {is total on} X and A2: trans(r)and A3: l∈X m∈X
and A4: ∀ x∈A. h l,xi ∈ r ∀ x∈B. h m,xi ∈ rshows ∀ x∈A∪B. hSmallerOf(r,l,m),xi ∈ r
proof

37

let k = SmallerOf(r,l,m)from A1 A3 have T1: h k,li ∈ r and T2: h k,mi ∈ rusing Order_ZF_3_L2 by auto
fix x assume A5: x∈A∪B show hk,xi ∈ r
proof { assume x∈Awith A4 T1 have h k,li ∈ r ∧ h l,xi ∈ r by simp
with A2 have hk,xi ∈ r by (rule Fol1_L3) }moreover{ assume x∈A/with A5 A4 T2 have h k,mi ∈ r ∧ h m,xi ∈ r by simp
with A2 have hk,xi ∈ r by (rule Fol1_L3) }ultimately show thesis by autoqed
qed

For total and transitive relation the union of two sets bounded below isbounded below.
lemma Order_ZF_3_L6:
assumes A1: r {is total on} X and A2: trans(r)and A3: IsBoundedBelow(A,r) IsBoundedBelow(B,r)
and A4: r ⊆ X×X
shows IsBoundedBelow(A∪B,r)proof { assume A=0 ∨ B=0
with A3 have thesis by auto }moreover{ assume ¬ (A = 0 ∨ B = 0)then have T1: A6=0 B6=0 by autowith A3 obtain l m where D1: ∀ x∈A. h l,xi ∈ r ∀ x∈B. h m,xi ∈ rusing IsBoundedBelow_def by auto
let L = SmallerOf(r,l,m)from T1 A4 D1 have T1: l∈X m∈X by autowith A1 A2 D1 have ∀ x∈A∪B.h L,xi ∈ rusing Order_ZF_3_L5B by blast
then have IsBoundedBelow(A∪B,r)using IsBoundedBelow_def by auto }
ultimately show thesis by autoqed

For total and transitive relations if a set A is bounded below then A ∪ {a}is bounded below.
lemma Order_ZF_3_L7:
assumes A1: r {is total on} X and A2: trans(r)and A3: IsBoundedBelow(A,r) and A4: a∈X and A5: r ⊆ X×X
shows IsBoundedBelow(A∪{a},r)
proof from A1 have refl(X,r)
using total_is_refl by simp

38

with assms show thesis using
Order_ZF_3_L1 IsBounded_def Order_ZF_3_L6 by simp
qed

For total and transitive relations unions of two bounded sets are bounded.
theorem Order_ZF_3_T1:
assumes r {is total on} X and trans(r)and IsBounded(A,r) IsBounded(B,r)
and r ⊆ X×X
shows IsBounded(A∪B,r)using assms Order_ZF_3_L3 Order_ZF_3_L6 Order_ZF_3_L7 IsBounded_def
by simp

For total and transitive relations if a set A is bounded then A ∪ {a} isbounded.
lemma Order_ZF_3_L8:
assumes r {is total on} X and trans(r)and IsBounded(A,r) and a∈X and r ⊆ X×X
shows IsBounded(A∪{a},r)using assms total_is_refl Order_ZF_3_L1 Order_ZF_3_T1 by blast

A sufficient condition for a set to be bounded below.
lemma Order_ZF_3_L9: assumes A1: ∀ a∈A. hl,ai ∈ rshows IsBoundedBelow(A,r)
proof from A1 have ∃ l. ∀ x∈A. hl,xi ∈ r
by autothen show IsBoundedBelow(A,r)
using IsBoundedBelow_def by simpqed

A sufficient condition for a set to be bounded above.
lemma Order_ZF_3_L10: assumes A1: ∀ a∈A. ha,ui ∈ rshows IsBoundedAbove(A,r)
proof from A1 have ∃ u. ∀ x∈A. hx,ui ∈ r
by autothen show IsBoundedAbove(A,r)
using IsBoundedAbove_def by simp
qedIntervals are bounded.
lemma Order_ZF_3_L11: shows
IsBoundedAbove(Interval(r,a,b),r)
IsBoundedBelow(Interval(r,a,b),r)
IsBounded(Interval(r,a,b),r)
proof { fix x assume x ∈ Interval(r,a,b)

39

then have h x,bi ∈ r h a,xi ∈ rusing Order_ZF_2_L1A by auto
} then have
∃ u. ∀ x∈Interval(r,a,b). h x,ui ∈ r∃ l. ∀ x∈Interval(r,a,b). h l,xi ∈ r
by autothen show
IsBoundedAbove(Interval(r,a,b),r)
IsBoundedBelow(Interval(r,a,b),r)
IsBounded(Interval(r,a,b),r)
using IsBoundedAbove_def IsBoundedBelow_def IsBounded_def
by autoqed

A subset of a set that is bounded below is bounded below.
lemma Order_ZF_3_L12: assumes A1: IsBoundedBelow(A,r) and A2: B⊆Ashows IsBoundedBelow(B,r)
proof { assume A = 0
with assms have IsBoundedBelow(B,r)
using IsBoundedBelow_def by auto }moreover{ assume A 6= 0
with A1 have ∃ l. ∀ x∈A. hl,xi ∈ rusing IsBoundedBelow_def by simp
with A2 have ∃ l.∀ x∈B. hl,xi ∈ r by auto
then have IsBoundedBelow(B,r) using IsBoundedBelow_def
by auto }ultimately show IsBoundedBelow(B,r) by autoqed

A subset of a set that is bounded above is bounded above.
lemma Order_ZF_3_L13: assumes A1: IsBoundedAbove(A,r) and A2: B⊆Ashows IsBoundedAbove(B,r)
proof { assume A = 0
with assms have IsBoundedAbove(B,r)
using IsBoundedAbove_def by auto }moreover{ assume A 6= 0
with A1 have ∃ u. ∀ x∈A. hx,ui ∈ rusing IsBoundedAbove_def by simp
with A2 have ∃ u.∀ x∈B. hx,ui ∈ r by auto
then have IsBoundedAbove(B,r) using IsBoundedAbove_def
by auto }ultimately show IsBoundedAbove(B,r) by autoqed

If for every element of X we can find one in A that is greater, then the A40

can not be bounded above. Works for relations that are total, transitive andantisymmetric, (i.e. for linear order relations).
lemma Order_ZF_3_L14:
assumes A1: r {is total on} X
and A2: trans(r) and A3: antisym(r)and A4: r ⊆ X×X and A5: X6=0
and A6: ∀ x∈X. ∃ a∈A. x6=a ∧ hx,ai ∈ rshows ¬IsBoundedAbove(A,r)
proof { from A5 A6 have I: A6=0 by auto
moreover assume IsBoundedAbove(A,r)
ultimately obtain u where II: ∀ x∈A. h x,ui ∈ rusing IsBounded_def IsBoundedAbove_def by autowith A4 I have u∈X by autowith A6 obtain b where b∈A and III: u6=b and hu,bi ∈ r
by autowith II have hb,ui ∈ r hu,bi ∈ r by autowith A3 have b=u by (rule Fol1_L4)
with III have False by simp
} thus ¬IsBoundedAbove(A,r) by autoqed

The set of elements in a set A that are nongreater than a given element isbounded above.
lemma Order_ZF_3_L15: shows IsBoundedAbove({x∈A. hx,ai ∈ r},r)using IsBoundedAbove_def by auto

If A is bounded below, then the set of elements in a set A that are nongreaterthan a given element is bounded.
lemma Order_ZF_3_L16: assumes A1: IsBoundedBelow(A,r)
shows IsBounded({x∈A. hx,ai ∈ r},r)proof { assume A=0
then have IsBounded({x∈A. hx,ai ∈ r},r)using IsBoundedBelow_def IsBoundedAbove_def IsBounded_def
by auto }moreover{ assume A6=0
with A1 obtain l where I: ∀ x∈A. hl,xi ∈ rusing IsBoundedBelow_def by auto
then have ∀ y∈{x∈A. hx,ai ∈ r}. hl,yi ∈ r by simp
then have IsBoundedBelow({x∈A. hx,ai ∈ r},r)by (rule Order_ZF_3_L9)
then have IsBounded({x∈A. hx,ai ∈ r},r)using Order_ZF_3_L15 IsBounded_def by simp }ultimately show thesis by blast
qed
end

41

6

More on order relations

theory Order_ZF_1 imports ZF.Order ZF1
begin

In Order_ZF we define some notions related to order relations based on the
nonstrict orders (≤ type). Some people however prefer to talk about thesenotions in terms of the strict order relation (< type). This is the case for the
standard Isabelle Order.thy and also for Metamath. In this theory file we
repeat some developments from Order_ZF using the strict order relation asa basis.This is mostly useful for Metamath translation, but is also of some
general interest. The names of theorems are copied from Metamath.

6.1

Definitions and basic properties

In this section we introduce some definitions taken from Metamath andrelate them to the ones used by the standard Isabelle Order.thy.
The next definition is the strict version of the linear order. What we write
as R Orders A is written ROrdA in Metamath.
definition
StrictOrder (infix Orders 65) where
R Orders A ≡ ∀ x y z. (x∈A ∧ y∈A ∧ z∈A) −→(hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R)

The definition of supremum for a (strict) linear order.
definition
Sup(B,A,R)≡
S{x ∈ A. (∀ y∈B. hx,yi ∈/ R) ∧(∀ y∈A. hy,xi ∈ R −→ (∃ z∈B. hy,zi ∈ R))}

Definition of infimum for a linear order. It is defined in terms of supremum.
definition
Infim(B,A,R) ≡ Sup(B,A,converse(R))

If relation R orders a set A, (in Metamath sense) then R is irreflexive,transitive and linear therefore is a total order on A (in Isabelle sense).
lemma orders_imp_tot_ord: assumes A1: R Orders A
shows
irrefl(A,R)
trans[A](R)
part_ord(A,R)
linear(A,R)
tot_ord(A,R)
proof -

42

from A1 have I:∀ x y z. (x∈A ∧ y∈A ∧ z∈A) −→(hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R)
unfolding StrictOrder_def by simp
then have ∀ x∈A. hx,xi ∈/ R by blast
then show irrefl(A,R) using irrefl_def by simp
moreoverfrom I have
∀ x∈A. ∀ y∈A. ∀ z∈A. hx,yi ∈ R −→ hy,zi ∈ R −→ hx,zi ∈ R
by blast
then show trans[A](R) unfolding trans_on_def by blast
ultimately show part_ord(A,R) using part_ord_def
by simpmoreoverfrom I have
∀ x∈A. ∀ y∈A. hx,yi ∈ R ∨ x=y ∨ hy,xi ∈ R
by blast
then show linear(A,R) unfolding linear_def by blast
ultimately show tot_ord(A,R) using tot_ord_def
by simpqed

A converse of orders_imp_tot_ord. Together with that theorem this showsthat Metamath’s notion of an order relation is equivalent to Isabelles tot_ord
predicate.
lemma tot_ord_imp_orders: assumes A1: tot_ord(A,R)
shows R Orders A
proof from A1 have
I: linear(A,R) and
II: irrefl(A,R) andIII: trans[A](R) andIV: part_ord(A,R)
using tot_ord_def part_ord_def by autofrom IV have asym(R ∩ A×A)
using part_ord_Imp_asym by simp
then have V: ∀ x y. hx,yi ∈ (R ∩ A×A) −→ ¬(hy,xi ∈ (R ∩ A×A))
unfolding asym_def by blastfrom I have VI: ∀ x∈A. ∀ y∈A. hx,yi ∈ R ∨ x=y ∨ hy,xi ∈ R
unfolding linear_def by blastfrom III have VII:
∀ x∈A. ∀ y∈A. ∀ z∈A. hx,yi ∈ R −→ hy,zi ∈ R −→ hx,zi ∈ R
unfolding trans_on_def by blast{ fix x y z
assume T: x∈A y∈A z∈A
have hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)
proof
assume A2: hx,yi ∈ R

43with V T have ¬(hy,xi ∈ R) by blast
moreover from II T A2 have x6=y using irrefl_def
by autoultimately show ¬(x=y ∨ hy,xi ∈ R) by simp
next assume ¬(x=y ∨ hy,xi ∈ R)
with VI T show hx,yi ∈ R by autoqed
moreover from VII T havehx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R
by blast
ultimately have (hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R)
by simp} then have ∀ x y z. (x∈A ∧ y∈A ∧ z∈A) −→(hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R)
by autothen show R Orders A using StrictOrder_def by simp
qed

6.2

Properties of (strict) total orders

In this section we discuss the properties of strict order relations. This continues the development contained in the standard Isabelle’s Order.thy witha view towards using the theorems translated from Metamath.
A relation orders a set iff the converse relation orders a set. Going one
way we can use the the lemma tot_od_converse from the standard Isabelle’s
Order.thy.The other way is a bit more complicated (note that in Isabelle forconverse(converse(r)) = r one needs r to consist of ordered pairs, which
does not follow from the StrictOrder definition above).
lemma cnvso: shows R Orders A ←→ converse(R) Orders A
proof
let r = converse(R)assume R Orders A
then have tot_ord(A,r) using orders_imp_tot_ord tot_ord_converseby simpthen show r Orders A using tot_ord_imp_orders
by simpnext
let r = converse(R)assume r Orders A
then have A2: ∀ x y z. (x∈A ∧ y∈A ∧ z∈A) −→(hx,yi ∈ r ←→ ¬(x=y ∨ hy,xi ∈ r)) ∧(hx,yi ∈ r ∧ hy,zi ∈ r −→ hx,zi ∈ r)using StrictOrder_def by simp
{ fix x y z
assume x∈A ∧ y∈A ∧ z∈A

44

with A2 have
I: hy,xi ∈ r ←→ ¬(x=y ∨ hx,yi ∈ r) andII: hy,xi ∈ r ∧ hz,yi ∈ r −→ hz,xi ∈ r
by autofrom I have hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)
by automoreover from II have hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R
by autoultimately have (hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R) by simp
} then have ∀ x y z. (x∈A ∧ y∈A ∧ z∈A) −→(hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R)
by autothen show R Orders A using StrictOrder_def by simp
qed

Supremum is unique, if it exists.
lemma supeu: assumes A1: R Orders A and A2: x∈A andA3: ∀ y∈B. hx,yi ∈/ R and A4: ∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi ∈ R)shows
∃ !x. x∈A∧(∀ y∈B. hx,yi ∈/ R) ∧ (∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi ∈
R))
proof
from A2 A3 A4 show
∃ x. x∈A∧(∀ y∈B. hx,yi ∈/ R) ∧ (∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi∈ R))
by autonext fix x1 x2
assume A5:
x1 ∈ A ∧ (∀ y∈B. hx1 ,yi ∈/ R) ∧ (∀ y∈A. hy,x1 i ∈ R −→ ( ∃ z∈B. hy,zi∈ R))
x2 ∈ A ∧ (∀ y∈B. hx2 ,yi ∈/ R) ∧ (∀ y∈A. hy,x2 i ∈ R −→ ( ∃ z∈B. hy,zi∈ R))from A1 have linear(A,R) using orders_imp_tot_ord tot_ord_def
by simpthen have ∀ x∈A. ∀ y∈A. hx,yi ∈ R ∨ x=y ∨ hy,xi ∈ R
unfolding linear_def by blast
with A5 have hx1 ,x2 i ∈ R ∨ x1 =x2 ∨ hx2 ,x1 i ∈ R by blast
moreover{ assume hx1 ,x2 i ∈ Rwith A5 obtain z where z∈B and hx1 ,zi ∈ R by autowith A5 have False by auto }moreover{ assume hx2 ,x1 i ∈ Rwith A5 obtain z where z∈B and hx2 ,zi ∈ R by autowith A5 have False by auto }
ultimately show x1 = x2 by autoqed

45

Supremum has expected properties if it exists.
lemma sup_props: assumes A1: R Orders A andA2: ∃ x∈A. (∀ y∈B. hx,yi ∈/ R) ∧ (∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi ∈
R))
shows
Sup(B,A,R) ∈ A∀ y∈B. hSup(B,A,R),yi ∈/ R∀ y∈A. hy,Sup(B,A,R)i ∈ R −→ ( ∃ z∈B. hy,zi ∈ R )proof let S = {x∈A. (∀ y∈B. hx,yi ∈/ R) ∧ (∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi∈ R ) ) }from A2 obtain x wherex∈A and (∀ y∈B. hx,yi ∈/ R) and ∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi∈ R)
by autowith A1 have I:∃ !x. x∈A∧(∀ y∈B. hx,yi ∈/ R) ∧ (∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi∈ R))using supeuSby simp
then have (S ) ∈ A by (rule ZF1_1_L9)
then show Sup(B,A,R) ∈ A using Sup_def by simp
from I have
S II:S(∀ y∈B. h S ,yi ∈/ R) ∧ (∀ y∈A. hy, Si ∈ R −→ ( ∃ z∈B. hy,zi ∈ R))
by (rule ZF1_1_L9)
Shence ∀ y∈B. h S,yi ∈/SR by blast
moreover have III: ( S) = Sup(B,A,R) using Sup_def by simp
ultimately show ∀ y∈B. hSup(B,A,R),yi∈/ R by simp
S
from II have IV: ∀ y∈A. hy, Si ∈ R −→ ( ∃ z∈B. hy,zi ∈ R)
by blast{ fix y assume A3: y∈A
S and hy,Sup(B,A,R)i ∈ Rwith III have hy, Si ∈ R by simp
with IV A3 have ∃ z∈B. hy,zi ∈ R by blast} thus ∀ y∈A. hy,Sup(B,A,R)i ∈ R −→ ( ∃ z∈B. hy,zi ∈ R )by simpqed

Elements greater or equal than any element of B are greater or equal thansupremum of B.
lemma supnub: assumes A1: R Orders A and A2:∃ x∈A. (∀ y∈B. hx,yi ∈/ R) ∧ (∀ y∈A. hy,xi ∈ R −→ ( ∃ z∈B. hy,zi ∈ R))
and A3: c ∈ A and A4: ∀ z∈B. hc,zi ∈/ Rshows hc, Sup(B,A,R)i ∈/ R
proof from A1 A2 have
∀ y∈A. hy,Sup(B,A,R)i ∈ R −→ ( ∃ z∈B. hy,zi ∈ R )by (rule sup_props)
with A3 A4 show hc, Sup(B,A,R)i ∈/ R by auto
qed

46

end

7

Even more on order relations

theory Order_ZF_1a imports Order_ZF
begin

This theory is a continuation of Order_ZF and talks about maximuma andminimum of a set, supremum and infimum and strict (not reflexive) versionsof order relations.

7.1

Maximum and minimum of a set

In this section we show that maximum and minimum are unique if they
exist. We also show that union of sets that have maxima (minima) has amaximum (minimum). We also show that singletons have maximum andminimum. All this allows to show (in Finite_ZF) that every finite set has
well-defined maximum and minimum.
For antisymmetric relations maximum of a set is unique if it exists.
lemma Order_ZF_4_L1: assumes A1: antisym(r) and A2: HasAmaximum(r,A)
shows ∃ !M. M∈A ∧ (∀ x∈A. h x,Mi ∈ r)
proof
from A2 show ∃ M. M ∈ A ∧ (∀ x∈A. hx, Mi ∈ r)using HasAmaximum_def by auto
fix M1 M2 assume
A2: M1 ∈ A ∧ (∀ x∈A. hx, M1i ∈ r) M2 ∈ A ∧ (∀ x∈A. hx, M2i ∈ r)then have hM1,M2i ∈ r hM2,M1i ∈ r by autowith A1 show M1=M2 by (rule Fol1_L4)
qed

For antisymmetric relations minimum of a set is unique if it exists.
lemma Order_ZF_4_L2: assumes A1: antisym(r) and A2: HasAminimum(r,A)
shows ∃ !m. m∈A ∧ (∀ x∈A. h m,xi ∈ r)
proof
from A2 show ∃ m. m ∈ A ∧ (∀ x∈A. hm, xi ∈ r)using HasAminimum_def by auto
fix m1 m2 assume
A2: m1 ∈ A ∧ (∀ x∈A. hm1, xi ∈ r) m2 ∈ A ∧ (∀ x∈A. hm2, xi ∈ r)then have hm1,m2i ∈ r hm2,m1i ∈ r by autowith A1 show m1=m2 by (rule Fol1_L4)
qed

Maximum of a set has desired properties.
lemma Order_ZF_4_L3: assumes A1: antisym(r) and A2: HasAmaximum(r,A)
shows Maximum(r,A) ∈ A ∀ x∈A. hx,Maximum(r,A)i ∈ r47

proof let Max = THE M. M∈A ∧ (∀ x∈A. h x,Mi ∈ r)from A1 A2 have ∃ !M. M∈A ∧ (∀ x∈A. h x,Mi ∈ r)by (rule Order_ZF_4_L1)
then have Max ∈ A ∧ (∀ x∈A. h x,Maxi ∈ r)by (rule theI)
then show Maximum(r,A) ∈ A ∀ x∈A. hx,Maximum(r,A)i ∈ rusing Maximum_def by autoqed

Minimum of a set has desired properties.
lemma Order_ZF_4_L4: assumes A1: antisym(r) and A2: HasAminimum(r,A)
shows Minimum(r,A) ∈ A ∀ x∈A. hMinimum(r,A),xi ∈ r
proof let Min = THE m. m∈A ∧ (∀ x∈A. h m,xi ∈ r)from A1 A2 have ∃ !m. m∈A ∧ (∀ x∈A. h m,xi ∈ r)by (rule Order_ZF_4_L2)
then have Min ∈ A ∧ (∀ x∈A. h Min,xi ∈ r)by (rule theI)
then show Minimum(r,A) ∈ A ∀ x∈A. hMinimum(r,A),xi ∈ rusing Minimum_def by autoqed

For total and transitive relations a union a of two sets that have maxima
has a maximum.
lemma Order_ZF_4_L5:
assumes A1: r {is total on} (A∪B) and A2: trans(r)and A3: HasAmaximum(r,A) HasAmaximum(r,B)
shows HasAmaximum(r,A∪B)
proof from A3 obtain M K where
D1: M∈A ∧ (∀ x∈A. h x,Mi ∈ r) K∈B ∧ (∀ x∈B. h x,Ki ∈ r)using HasAmaximum_def by auto
let L = GreaterOf(r,M,K)
from D1 have T1: M ∈ A∪B K ∈ A∪B∀ x∈A. h x,Mi ∈ r ∀ x∈B. h x,Ki ∈ r
by autowith A1 A2 have ∀ x∈A∪B.h x,Li ∈ r by (rule Order_ZF_3_L2B)
moreover from T1 have L ∈ A∪B using GreaterOf_def IsTotal_def
by simpultimately show HasAmaximum(r,A∪B) using HasAmaximum_def by autoqed

For total and transitive relations A union a of two sets that have minima
has a minimum.
lemma Order_ZF_4_L6:
assumes A1: r {is total on} (A∪B) and A2: trans(r)and A3: HasAminimum(r,A) HasAminimum(r,B)

48

shows HasAminimum(r,A∪B)
proof from A3 obtain m k where
D1: m∈A ∧ (∀ x∈A. h m,xi ∈ r) k∈B ∧ (∀ x∈B. h k,xi ∈ r)using HasAminimum_def by auto
let l = SmallerOf(r,m,k)from D1 have T1: m ∈ A∪B k ∈ A∪B∀ x∈A. h m,xi ∈ r ∀ x∈B. h k,xi ∈ r
by autowith A1 A2 have ∀ x∈A∪B.h l,xi ∈ r by (rule Order_ZF_3_L5B)
moreover from T1 have l ∈ A∪B using SmallerOf_def IsTotal_def
by simpultimately show HasAminimum(r,A∪B) using HasAminimum_def by autoqed

Set that has a maximum is bounded above.
lemma Order_ZF_4_L7:
assumes HasAmaximum(r,A)
shows IsBoundedAbove(A,r)
using assms HasAmaximum_def IsBoundedAbove_def by auto

Set that has a minimum is bounded below.
lemma Order_ZF_4_L8A:
assumes HasAminimum(r,A)
shows IsBoundedBelow(A,r)
using assms HasAminimum_def IsBoundedBelow_def by auto

For reflexive relations singletons have a minimum and maximum.
lemma Order_ZF_4_L8: assumes refl(X,r) and a∈Xshows HasAmaximum(r,{a}) HasAminimum(r,{a})using assms refl_def HasAmaximum_def HasAminimum_def by auto

For total and transitive relations if we add an element to a set that has amaximum, the set still has a maximum.
lemma Order_ZF_4_L9:
assumes A1: r {is total on} X and A2: trans(r)and A3: A⊆X and A4: a∈X and A5: HasAmaximum(r,A)
shows HasAmaximum(r,A∪{a})proof from A3 A4 have A∪{a} ⊆ X by autowith A1 have r {is total on} (A∪{a})using Order_ZF_1_L4 by blast
moreover from A1 A2 A4 A5 havetrans(r) HasAmaximum(r,A) by auto
moreover from A1 A4 have HasAmaximum(r,{a})using total_is_refl Order_ZF_4_L8 by blast
ultimately show HasAmaximum(r,A∪{a}) by (rule Order_ZF_4_L5)
qed

49

For total and transitive relations if we add an element to a set that has aminimum, the set still has a minimum.
lemma Order_ZF_4_L10:
assumes A1: r {is total on} X and A2: trans(r)and A3: A⊆X and A4: a∈X and A5: HasAminimum(r,A)
shows HasAminimum(r,A∪{a})proof from A3 A4 have A∪{a} ⊆ X by autowith A1 have r {is total on} (A∪{a})using Order_ZF_1_L4 by blast
moreover from A1 A2 A4 A5 havetrans(r) HasAminimum(r,A) by auto
moreover from A1 A4 have HasAminimum(r,{a})using total_is_refl Order_ZF_4_L8 by blast
ultimately show HasAminimum(r,A∪{a}) by (rule Order_ZF_4_L6)
qed

If the order relation has a property that every nonempty bounded set attains
a minimum (for example integers are like that), then every nonempty set
bounded below attains a minimum.
lemma Order_ZF_4_L11:
assumes A1: r {is total on} X andA2: trans(r) andA3: r ⊆ X×X andA4: ∀ A. IsBounded(A,r) ∧ A6=0 −→ HasAminimum(r,A) andA5: B6=0 and A6: IsBoundedBelow(B,r)
shows HasAminimum(r,B)
proof from A5 obtain b where T: b∈B by auto
let L = {x∈B. hx,bi ∈ r}from A3 A6 T have T1: b∈X using Order_ZF_3_L1B by blast
with A1 T have T2: b ∈ Lusing total_is_refl refl_def by simp
then have L 6= 0 by auto
moreover have IsBounded(L,r)
proof have L ⊆ B by autowith A6 have IsBoundedBelow(L,r)
using Order_ZF_3_L12 by simp
moreover have IsBoundedAbove(L,r)
by (rule Order_ZF_3_L15)
ultimately have IsBoundedAbove(L,r) ∧ IsBoundedBelow(L,r)
by blast
then show IsBounded(L,r) using IsBounded_def
by simpqed
ultimately have IsBounded(L,r) ∧ L 6= 0 by blast
with A4 have HasAminimum(r,L) by simp
then obtain m where I: m∈L and II: ∀ x∈L. h m,xi ∈ r50

using HasAminimum_def by auto
then have III: hm,bi ∈ r by simp
from I have m∈B by simp
moreover have ∀ x∈B. hm,xi ∈ r
proof
fix x assume A7: x∈Bfrom A3 A6 have B⊆X using Order_ZF_3_L1B by blast
with A1 A7 T1 have x ∈ L ∪ {x∈B. hb,xi ∈ r}using Order_ZF_1_L5 by simp
then have x∈L ∨ hb,xi ∈ r by auto
moreover{ assume x∈Lwith II have hm,xi ∈ r by simp }moreover{ assume hb,xi ∈ rwith A2 III have trans(r) and hm,bi ∈ r ∧ hb,xi ∈ r
by autothen have hm,xi ∈ r by (rule Fol1_L3) }ultimately show hm,xi ∈ r by autoqed
ultimately show HasAminimum(r,B) using HasAminimum_def
by autoqed

A dual to Order_ZF_4_L11: If the order relation has a property that every
nonempty bounded set attains a maximum (for example integers are likethat), then every nonempty set bounded above attains a maximum.
lemma Order_ZF_4_L11A:
assumes A1: r {is total on} X andA2: trans(r) andA3: r ⊆ X×X andA4: ∀ A. IsBounded(A,r) ∧ A6=0 −→ HasAmaximum(r,A) andA5: B6=0 and A6: IsBoundedAbove(B,r)
shows HasAmaximum(r,B)
proof from A5 obtain b where T: b∈B by auto
let U = {x∈B. hb,xi ∈ r}from A3 A6 T have T1: b∈X using Order_ZF_3_L1A by blast
with A1 T have T2: b ∈ Uusing total_is_refl refl_def by simp
then have U 6= 0 by auto
moreover have IsBounded(U,r)
proof have U ⊆ B by autowith A6 have IsBoundedAbove(U,r)
using Order_ZF_3_L13 by blast
moreover have IsBoundedBelow(U,r)
using IsBoundedBelow_def by auto
ultimately have IsBoundedAbove(U,r) ∧ IsBoundedBelow(U,r)

51

by blastthen show IsBounded(U,r) using IsBounded_def
by simpqed
ultimately have IsBounded(U,r) ∧ U 6= 0 by blast
with A4 have HasAmaximum(r,U) by simp
then obtain m where I: m∈U and II: ∀ x∈U. hx,mi ∈ rusing HasAmaximum_def by auto
then have III: hb,mi ∈ r by simp
from I have m∈B by simp
moreover have ∀ x∈B. hx,mi ∈ r
proof
fix x assume A7: x∈Bfrom A3 A6 have B⊆X using Order_ZF_3_L1A by blast
with A1 A7 T1 have x ∈ {x∈B. hx,bi ∈ r} ∪ Uusing Order_ZF_1_L5 by simp
then have x∈U ∨ hx,bi ∈ r by auto
moreover{ assume x∈Uwith II have hx,mi ∈ r by simp }moreover{ assume hx,bi ∈ rwith A2 III have trans(r) and hx,bi ∈ r ∧ hb,mi ∈ r
by autothen have hx,mi ∈ r by (rule Fol1_L3) }ultimately show hx,mi ∈ r by autoqed
ultimately show HasAmaximum(r,B) using HasAmaximum_def
by autoqed

If a set has a minimum and L is less or equal than all elements of the set,
then L is less or equal than the minimum.
lemma Order_ZF_4_L12:
assumes antisym(r) and HasAminimum(r,A) and ∀ a∈A. hL,ai ∈ rshows hL,Minimum(r,A)i ∈ rusing assms Order_ZF_4_L4 by simp

If a set has a maximum and all its elements are less or equal than M , thenthe maximum of the set is less or equal than M .
lemma Order_ZF_4_L13:
assumes antisym(r) and HasAmaximum(r,A) and ∀ a∈A. ha,Mi ∈ rshows hMaximum(r,A),Mi ∈ rusing assms Order_ZF_4_L3 by simp

If an element belongs to a set and is greater or equal than all elements ofthat set, then it is the maximum of that set.
lemma Order_ZF_4_L14:52

assumes A1: antisym(r) and A2: M ∈ A andA3: ∀ a∈A. ha,Mi ∈ rshows Maximum(r,A) = M
proof from A2 A3 have I: HasAmaximum(r,A) using HasAmaximum_def
by autowith A1 have ∃ !M. M∈A ∧ (∀ x∈A. hx,Mi ∈ r)using Order_ZF_4_L1 by simp
moreover from A2 A3 have M∈A ∧ (∀ x∈A. hx,Mi ∈ r) by simp
moreover from A1 I have
Maximum(r,A) ∈ A ∧ (∀ x∈A. hx,Maximum(r,A)i ∈ r)using Order_ZF_4_L3 by simp
ultimately show Maximum(r,A) = M by autoqed

If an element belongs to a set and is less or equal than all elements of thatset, then it is the minimum of that set.
lemma Order_ZF_4_L15:
assumes A1: antisym(r) and A2: m ∈ A andA3: ∀ a∈A. hm,ai ∈ rshows Minimum(r,A) = m
proof from A2 A3 have I: HasAminimum(r,A) using HasAminimum_def
by autowith A1 have ∃ !m. m∈A ∧ (∀ x∈A. hm,xi ∈ r)using Order_ZF_4_L2 by simp
moreover from A2 A3 have m∈A ∧ (∀ x∈A. hm,xi ∈ r) by simp
moreover from A1 I have
Minimum(r,A) ∈ A ∧ (∀ x∈A. hMinimum(r,A),xi ∈ r)using Order_ZF_4_L4 by simp
ultimately show Minimum(r,A) = m by autoqed

If a set does not have a maximum, then for any its element we can find onethat is (strictly) greater.
lemma Order_ZF_4_L16:
assumes A1: antisym(r) and A2: r {is total on} X andA3: A⊆X andA4: ¬HasAmaximum(r,A) andA5: x∈A
shows ∃ y∈A. hx,yi ∈ r ∧ y6=xproof { assume A6: ∀ y∈A. hx,yi ∈/ r ∨ y=x
have ∀ y∈A. hy,xi ∈ r
proof
fix y assume A7: y∈Awith A6 have hx,yi ∈/ r ∨ y=x by simp
with A2 A3 A5 A7 show hy,xi ∈ rusing IsTotal_def Order_ZF_1_L1 by auto

53

qed
with A5 have ∃ x∈A.∀ y∈A. hy,xi ∈ r
by autowith A4 have False using HasAmaximum_def by simp
} then show ∃ y∈A. hx,yi ∈ r ∧ y6=x by auto
qed

7.2

Supremum and Infimum

In this section we consider the notions of supremum and infimum a set.
Elements of the set of upper bounds are indeed upper bounds. Isabelle also
thinks it is obvious.
Tlemma Order_ZF_5_L1: assumes u ∈ ( a∈A. r{a}) and a∈Ashows ha,ui ∈ rusing assms by auto

Elements of the set of lower bounds are indeed lower bounds. Isabelle also
thinks it is obvious.
Tlemma Order_ZF_5_L2: assumes l ∈ ( a∈A. r-{a}) and a∈Ashows hl,ai ∈ rusing assms by auto

If the set of upper bounds has a minimum, then the supremum is less or equal
than any upper bound. We can probably do away with the assumption that
A is not empty, (ab)using the fact that intersection over an empty family isdefined in Isabelle to be empty.
lemma Order_ZF_5_L3:
T assumes A1: antisym(r) and A2: A6=0 and
A3: HasAminimum(r, a∈A. r{a}) andA4: ∀ a∈A. ha,ui ∈ rshows hSupremum(r,A),ui ∈ r
proof - T
let U =a∈A. r{a}from A4 have ∀ a∈A. u ∈ r{a} using image_singleton_iff
by simpwith A2 have u∈U by autowith A1 A3 show hSupremum(r,A),ui ∈ rusing Order_ZF_4_L4 Supremum_def by simp
qed

Infimum is greater or equal than any lower bound.
lemma Order_ZF_5_L4:
T assumes A1: antisym(r) and A2: A6=0 and
A3: HasAmaximum(r, a∈A. r-{a}) andA4: ∀ a∈A. hl,ai ∈ rshows hl,Infimum(r,A)i ∈ r
proof - T
let L =a∈A. r-{a}from A4 have ∀ a∈A. l ∈ r-{a} using vimage_singleton_iff54

by simp
with A2 have l∈L by autowith A1 A3 show hl,Infimum(r,A)i ∈ rusing Order_ZF_4_L3 Infimum_def by simpqed

If z is an upper bound for A and is greater or equal than any other upperbound, then z is the supremum of A.
lemma Order_ZF_5_L5: assumes A1: antisym(r) and A2: A6=0 andA3: ∀ x∈A. hx,zi ∈ r andA4: ∀ y. (∀ x∈A. hx,yi ∈ r) −→ hz,yi ∈ rshowsT
HasAminimum(r, a∈A. r{a})z = Supremum(r,A)
proof - T
let B =a∈A. r{a}from A2 A3 A4 have I: z ∈ B∀ y∈B. hz,yi ∈ r
by autoTthen show HasAminimum(r, a∈A. r{a})using HasAminimum_def by autofrom A1 I show z = Supremum(r,A)
using Order_ZF_4_L15 Supremum_def by simp
qed

If a set has a maximum, then the maximum is the supremum.
lemma Order_ZF_5_L6:
assumes A1: antisym(r) and A2: A6=0 and
A3: HasAmaximum(r,A)
shows
T
HasAminimum(r, a∈A. r{a})Maximum(r,A) = Supremum(r,A)
proof let M = Maximum(r,A)
from A1 A3 have I: M ∈ A and II: ∀ x∈A. hx,Mi ∈ rusing Order_ZF_4_L3 by autofrom I have III: ∀ y. (∀ x∈A. hx,yi ∈ r) −→ hM,yi ∈ r
by simpTwith A1 A2 II show HasAminimum(r, a∈A. r{a})by (rule Order_ZF_5_L5)from A1 A2 II III show M = Supremum(r,A)
by (rule Order_ZF_5_L5)
qed

Properties of supremum of a set for complete relations.
lemma Order_ZF_5_L7:
assumes A1: r ⊆ X×X and A2: antisym(r) andA3: r {is complete} and
A4: A⊆X A6=0 and A5: ∃ x∈X. ∀ y∈A. hy,xi ∈ r
shows

55

Supremum(r,A) ∈ X∀ x∈A. hx,Supremum(r,A)i ∈ r
proof from A5 have IsBoundedAbove(A,r) using IsBoundedAbove_def
by autoTwith A3 A4 have HasAminimum(r, a∈A. r{a})using IsComplete_def by
T simpT
with A2 have Minimum(r, a∈A. r{a}) ∈ (a∈A. r{a} )using Order_ZF_4_L4 by T
simp
moreover have Minimum(r, a∈A. r{a}) = Supremum(r,A)
using Supremum_def by simp
Tultimately have I: Supremum(r,A) ∈ (a∈A. r{a} )by simpmoreover from A4 obtain a where a∈A by auto
ultimately have ha,Supremum(r,A)i ∈ r using Order_ZF_5_L1
by simpwith A1 show Supremum(r,A) ∈ X by autofrom I show ∀ x∈A. hx,Supremum(r,A)i ∈ r using Order_ZF_5_L1
by simpqed

If the relation is a linear order then for any element y smaller than thesupremum of a set we can find one element of the set that is greater than y.
lemma Order_ZF_5_L8:
assumes A1: r ⊆ X×X and A2: IsLinOrder(X,r) andA3: r {is complete} and
A4: A⊆X A6=0 and A5: ∃ x∈X. ∀ y∈A. hy,xi ∈ r andA6: hy,Supremum(r,A)i ∈ r
y 6= Supremum(r,A)
shows ∃ z∈A. hy,zi ∈ r ∧ y 6= z
proof from A2 have
I: antisym(r) andII: trans(r) andIII: r {is total on} X
using IsLinOrder_def by autofrom A1 A6 have T1: y∈X by auto
{ assume A7: ∀ z ∈ A. hy,zi ∈/ r ∨ y=z
from A4 I have antisym(r) and A6=0 by auto
moreover have ∀ x∈A. hx,yi ∈ r
proof
fix x assume A8: x∈Awith A4 have T2: x∈X by autofrom A7 A8 have hy,xi ∈/ r ∨ y=x by simp
with III T1 T2 show hx,yi ∈ rusing IsTotal_def total_is_refl refl_def by autoqed
moreover have ∀ u. (∀ x∈A. hx,ui ∈ r) −→ hy,ui ∈ r
proof { fix u assume A9: ∀ x∈A. hx,ui ∈ r56

from A4 A5 have IsBoundedAbove(A,r) and A6=0
using IsBoundedAbove_def by autowith A3 A4 A6 I A9 havehy,Supremum(r,A)i ∈ r ∧ hSupremum(r,A),ui ∈ rusing IsComplete_def Order_ZF_5_L3 by simp
with II have hy,ui ∈ r by (rule Fol1_L3)} then show ∀ u. (∀ x∈A. hx,ui ∈ r) −→ hy,ui ∈ r
by simpqed
ultimately have y = Supremum(r,A)
by (rule Order_ZF_5_L5)with A6 have False by simp
} then show ∃ z∈A. hy,zi ∈ r ∧ y 6= z by auto
qed

7.3

Strict versions of order relations

One of the problems with translating formalized mathematics from Metamath to IsarMathLib is that Metamath uses strict orders (of the < type)while in IsarMathLib we mostly use nonstrict orders (of the ≤ type). This
doesn’t really make any difference, but is annoying as we have to prove
many theorems twice. In this section we prove some theorems to make iteasier to translate the statements about strict orders to statements about
the corresponding non-strict order and vice versa.
We define a strict version of a relation by removing the y = x line from therelation.
definition
StrictVersion(r) ≡ r - {hx,xi. x ∈ domain(r)}A reformulation of the definition of a strict version of an order.
lemma def_of_strict_ver: showshx,yi ∈ StrictVersion(r) ←→ hx,yi ∈ r ∧ x6=yusing StrictVersion_def domain_def by auto

The next lemma is about the strict version of an antisymmetric relation.
lemma strict_of_antisym:
assumes A1: antisym(r) and A2: ha,bi ∈ StrictVersion(r)shows hb,ai ∈/ StrictVersion(r)proof { assume A3: hb,ai ∈ StrictVersion(r)with A2 have ha,bi ∈ r and hb,ai ∈ rusing def_of_strict_ver by autowith A1 have a=b by (rule Fol1_L4)
with A2 have False using def_of_strict_verby simp} then show hb,ai ∈/ StrictVersion(r) by autoqed

57

The strict version of totality.
lemma strict_of_tot:
assumes r {is total on} X and a∈X b∈X a6=bshows ha,bi ∈ StrictVersion(r) ∨ hb,ai ∈ StrictVersion(r)using assms IsTotal_def def_of_strict_ver by auto

A trichotomy law for the strict version of a total and antisymmetric relation.
It is kind of interesting that one does not need the full linear order for this.
lemma strict_ans_tot_trich:assumes A1: antisym(r) and A2: r {is total on} X
and A3: a∈X b∈X
and A4: s = StrictVersion(r)shows Exactly_1_of_3_holds(ha,bi ∈ s, a=b,hb,ai ∈ s)
proof let p = ha,bi ∈ s
let q = a=b
let r = hb,ai ∈ sfrom A2 A3 A4 have p ∨ q ∨ rusing strict_of_tot by auto
moreover from A1 A4 have p −→ ¬q ∧ ¬rusing def_of_strict_ver strict_of_antisym by simp
moreover from A4 have q −→ ¬p ∧ ¬rusing def_of_strict_ver by simp
moreover from A1 A4 have r −→ ¬p ∧ ¬qusing def_of_strict_ver strict_of_antisym by auto
ultimately show Exactly_1_of_3_holds(p, q, r)
by (rule Fol1_L5)
qed

A trichotomy law for linear order. This is a special case of strict_ans_tot_trich.
corollary strict_lin_trich: assumes A1: IsLinOrder(X,r) andA2: a∈X b∈X andA3: s = StrictVersion(r)shows Exactly_1_of_3_holds(ha,bi ∈ s, a=b,hb,ai ∈ s)using assms IsLinOrder_def strict_ans_tot_trich by auto

For an antisymmetric relation if a pair is in relation then the reversed pairis not in the strict version of the relation.
lemma geq_impl_not_less:assumes A1: antisym(r) and A2: ha,bi ∈ rshows hb,ai ∈/ StrictVersion(r)proof { assume A3: hb,ai ∈ StrictVersion(r)with A2 have ha,bi ∈ StrictVersion(r)using def_of_strict_ver by autowith A1 A3 have False using strict_of_antisym
by blast} then show hb,ai ∈/ StrictVersion(r) by auto

58

qed

If an antisymmetric relation is transitive, then the strict version is alsotransitive, an explicit version strict_of_transB below.
lemma strict_of_transA:
assumes A1: trans(r) and A2: antisym(r) andA3: s= StrictVersion(r) and A4: ha,bi ∈ s hb,ci ∈ sshows ha,ci ∈ s
proof from A3 A4 have I: ha,bi ∈ r ∧ hb,ci ∈ rusing def_of_strict_ver by simp
with A1 have ha,ci ∈ r by (rule Fol1_L3)
moreover{ assume a=c
with I have ha,bi ∈ r and hb,ai ∈ r by autowith A2 have a=b by (rule Fol1_L4)
with A3 A4 have False using def_of_strict_ver by simp
} then have a6=c by auto
ultimately have ha,ci ∈ StrictVersion(r)using def_of_strict_ver by simp
with A3 show thesis by simpqed

If an antisymmetric relation is transitive, then the strict version is alsotransitive.
lemma strict_of_transB:
assumes A1: trans(r) and A2: antisym(r)shows trans(StrictVersion(r))
proof let s = StrictVersion(r)from A1 A2 have
∀ x y z. hx, yi ∈ s ∧ hy, zi ∈ s −→ hx, zi ∈ susing strict_of_transA by blast
then show trans(StrictVersion(r)) by (rule Fol1_L2)
qed

The next lemma provides a condition that is satisfied by the strict version
of a relation if the original relation is a complete linear order.
lemma strict_of_compl:
assumes A1: r ⊆ X×X and A2: IsLinOrder(X,r) andA3: r {is complete} and
A4: A⊆X A6=0 and A5: s = StrictVersion(r) andA6: ∃ u∈X. ∀ y∈A. hy,ui ∈ sshows∃ x∈X. ( ∀ y∈A. hx,yi ∈/ s ) ∧ (∀ y∈X. hy,xi ∈ s −→ (∃ z∈A. hy,zi ∈ s))
proof let x = Supremum(r,A)
from A2 have I: antisym(r) using IsLinOrder_def

59

by simp
moreover from A5 A6 have ∃ u∈X. ∀ y∈A. hy,ui ∈ rusing def_of_strict_ver by auto
moreover note A1 A3 A4
ultimately have II: x ∈ X∀ y∈A. hy,xi ∈ rusing Order_ZF_5_L7 by auto
then have III: ∃ x∈X. ∀ y∈A. hy,xi ∈ r by autofrom A5 I II have x ∈ X∀ y∈A. hx,yi ∈/ susing geq_impl_not_less by auto
moreover from A1 A2 A3 A4 A5 III have
∀ y∈X. hy,xi ∈ s −→ (∃ z∈A. hy,zi ∈ s)using def_of_strict_ver Order_ZF_5_L8 by simp
ultimately show
∃ x∈X. ( ∀ y∈A. hx,yi ∈/ s ) ∧ (∀ y∈X. hy,xi ∈ s −→ (∃ z∈A. hy,zi ∈s))by autoqed

Strict version of a relation on a set is a relation on that set.
lemma strict_ver_rel: assumes A1: r ⊆ A×A
shows StrictVersion(r) ⊆ A×A
using assms StrictVersion_def by auto
end

8

Order on natural numbers

theory NatOrder_ZF imports Nat_ZF_IML Order_ZF
begin

This theory proves that ≤ is a linear order on N. ≤ is defined in Isabelle’s
Nat theory, and linear order is defined in Order_ZF theory. Contributed by
Seo Sanghyeon.

8.1

Order on natural numbers

This is the only section in this theory.
To prove that ≤ is a total order, we use a result on ordinals.
lemma NatOrder_ZF_1_L1:
assumes a∈nat and b∈natshows a ≤ b ∨ b ≤ a
proof from assms have I: Ord(a) ∧ Ord(b)using nat_into_Ord by auto
then have a ∈ b ∨ a = b ∨ b ∈ ausing Ord_linear by simp

60

with I have a < b ∨ a = b ∨ b < ausing ltI by autowith I show a ≤ b ∨ b ≤ ausing le_iff by autoqed

≤ is antisymmetric, transitive, total, and linear. Proofs by rewrite using
definitions.
lemma NatOrder_ZF_1_L2:
shows
antisym(Le)trans(Le)Le {is total on} nat
IsLinOrder(nat,Le)
proof show antisym(Le)using antisym_def Le_def le_anti_sym by auto
moreover show trans(Le)using trans_def Le_def le_trans by blast
moreover show Le {is total on} nat
using IsTotal_def Le_def NatOrder_ZF_1_L1 by simp
ultimately show IsLinOrder(nat,Le)using IsLinOrder_def by simp
qed

The order on natural numbers is linear on every natural number. Recall
that each natural number is a subset of the set of all natural numbers (aswell as a member).
lemma natord_lin_on_each_nat:
assumes A1: n ∈ nat shows IsLinOrder(n,Le)
proof from A1 have n ⊆ nat using nat_subset_nat
by simpthen show thesis using NatOrder_ZF_1_L2 ord_linear_subset
by blast
qed
end

9

Functions - introduction

theory func1 imports ZF.func Fol1 ZF1
begin

This theory covers basic properties of function spaces. A set of functions
with domain X and values in the set Y is denoted in Isabelle as X → Y . It
just happens that the colon ”:” is a synonym of the set membership symbol61∈ in Isabelle/ZF so we can write f : X → Y instead of f ∈ X → Y . This is
the only case that we use the colon instead of the regular set membershipsymbol.

9.1

Properties of functions, function spaces and (inverse) images.

Functions in ZF are sets of pairs. This means that if f : X → Y thenf ⊆ X ×Y . This section is mostly about consequences of this understandingof the notion of function.
We define the notion of function that preserves a collection here. Given twocollection of sets a function preserves the collections if the inverse imageof sets in one collection belongs to the second one. This notion does nothave a name in romantic math. It is used to define continuous functions
in Topology_ZF_2 theory. We define it here so that we can use it for otherpurposes, like defining measurable functions. Recall that f-(A) means theinverse image of the set A.
definition
PresColl(f,S,T) ≡ ∀ A∈T. f-(A)∈S

A definition that allows to get the first factor of the domain of a binary
function f : X × Y → Z.
definition
fstdom(f) ≡ domain(domain(f))

If a function maps A into another set, then A is the domain of the function.
lemma func1_1_L1: assumes f:A→C shows domain(f) = A
using assms domain_of_fun by simp

Standard Isabelle defines a function(f) predicate. The next lemma showsthat our functions satisfy that predicate. It is a special version of Isabelle’s
fun_is_function.
lemma fun_is_fun: assumes f:X→Y shows function(f)using assms fun_is_function by simp

A lemma explains what fstdom is for.
lemma fstdomdef: assumes A1: f: X×Y → Z and A2: Y6=0
shows fstdom(f) = X
proof from A1 have domain(f) = X×Y using func1_1_L1
by simpwith A2 show fstdom(f) = X unfolding fstdom_def by autoqed

A version of the Pi_type lemma from the standard Isabelle/ZF library.
62lemma func1_1_L1A: assumes A1: f:X→Y and A2: ∀ x∈X. f(x) ∈ Z
shows f:X→Z
proof { fix x assume x∈Xwith A2 have f(x) ∈ Z by simp }with A1 show f:X→Z by (rule Pi_type)qed

A variant of func1_1_L1A.
lemma func1_1_L1B: assumes A1: f:X→Y and A2: Y⊆Z
shows f:X→Z
proof from A1 A2 have ∀ x∈X. f(x) ∈ Z
using apply_funtype by autowith A1 show f:X→Z using func1_1_L1A by blast
qed

There is a value for each argument.
lemma func1_1_L2: assumes A1: f:X→Y x∈X
shows ∃ y∈Y. hx,yi ∈ fproof from A1 have f(x) ∈ Y using apply_type by simp
moreover from A1 have h x,f(x)i∈ f using apply_Pair by simp
ultimately show thesis by autoqed

The inverse image is the image of converse. True for relations as well.
lemma vimage_converse: shows r-(A) = converse(r)(A)using vimage_iff image_iff converse_iff by auto

The image is the inverse image of converse.
lemma image_converse: shows converse(r)-(A) = r(A)using vimage_iff image_iff converse_iff by auto

The inverse image by a composition is the composition of inverse images.
lemma vimage_comp: shows (r O s)-(A) = s-(r-(A))
using vimage_converse converse_comp image_comp image_converse by simp

A version of vimage_comp for three functions.
lemma vimage_comp3: shows (r O s O t)-(A) = t-(s-(r-(A)))
using vimage_comp by simp

Inverse image of any set is contained in the domain.
lemma func1_1_L3: assumes A1: f:X→Y shows f-(D) ⊆ X
proof have ∀ x. x∈f-(D) −→ x ∈ domain(f)using vimage_iff domain_iff by autowith A1 have ∀ x. (x ∈ f-(D)) −→ (x∈X) using func1_1_L1 by simp

63

then show thesis by autoqed

The inverse image of the range is the domain.
lemma func1_1_L4: assumes f:X→Y shows f-(Y) = X
using assms func1_1_L3 func1_1_L2 vimage_iff by blast

The arguments belongs to the domain and values to the range.
lemma func1_1_L5:
assumes A1: h x,yi ∈ f and A2: f:X→Yshows x∈X ∧ y∈Y
prooffrom A1 A2 show x∈X using apply_iff by simp
with A2 have f(x)∈ Y using apply_type by simp
with A1 A2 show y∈Y using apply_iff by simp
qed

Function is a subset of cartesian product.
lemma fun_subset_prod: assumes A1: f:X→Y shows f ⊆ X×Y
proof
fix p assume p ∈ fwith A1 have ∃ x∈X. p = hx, f(x)iusing Pi_memberD by simp
then obtain x where I: p = hx, f(x)i
by autowith A1 hp ∈ fi have x∈X ∧ f(x) ∈ Y
using func1_1_L5 by blast
with I show p ∈ X×Y by autoqed

The (argument, value) pair belongs to the graph of the function.
lemma func1_1_L5A:
assumes A1: f:X→Y x∈X y = f(x)shows hx,yi ∈ f y ∈ range(f)proof from A1 show hx,yi ∈ f using apply_Pair by simp
then show y ∈ range(f) using rangeI by simp
qed

The next theorem illustrates the meaning of the concept of function in ZF.
theorem fun_is_set_of_pairs: assumes A1: f:X→Yshows f = {hx, f(x)i. x ∈ X}
prooffrom A1 show {hx, f(x)i. x ∈ X} ⊆ f using func1_1_L5A
by autonext{ fix p assume p ∈ fwith A1 have p ∈ X×Y using fun_subset_prod64

by auto
with A1 hp ∈ fi have p ∈ {hx, f(x)i. x ∈ X}
using apply_equality by auto
} thus f ⊆ {hx, f(x)i. x ∈ X} by autoqed

The range of function that maps X into Y is contained in Y .
lemma func1_1_L5B:
assumes A1: f:X→Y shows range(f) ⊆ Y
proof
fix y assume y ∈ range(f)then obtain x where h x,yi ∈ fusing range_def converse_def domain_def by autowith A1 show y∈Y using func1_1_L5 by blastqed

The image of any set is contained in the range.
lemma func1_1_L6: assumes A1: f:X→Yshows f(B) ⊆ range(f) and f(B) ⊆ Y
proof show f(B) ⊆ range(f) using image_iff rangeI by autowith A1 show f(B) ⊆ Y using func1_1_L5B by blastqed

The inverse image of any set is contained in the domain.
lemma func1_1_L6A: assumes A1: f:X→Y shows f-(A)⊆X
proof
fix x
assume A2: x∈f-(A) then obtain y where h x,yi ∈ fusing vimage_iff by autowith A1 show x∈X using func1_1_L5 by fast
qed

Image of a greater set is greater.
lemma func1_1_L8: assumes A1: A⊆B
using assms image_Un by autoshows f(A)⊆ f(B)A set is contained in the the inverse image of its image. There is similar
theorem in equalities.thy (function_image_vimage) which shows that theimage of inverse image of a set is contained in the set.
lemma func1_1_L9: assumes A1: f:X→Y and A2: A⊆X
shows A ⊆ f-(f(A))
proof from A1 A2 have ∀ x∈A. h x,f(x)i ∈ f using apply_Pair by auto
then show thesis using image_iff by autoqed

The inverse image of the image of the domain is the domain.
65

lemma inv_im_dom: assumes A1: f:X→Y shows f-(f(X)) = X
prooffrom A1 show f-(f(X)) ⊆ X using func1_1_L3 by simp
from A1 show X ⊆ f-(f(X)) using func1_1_L9 by simpqed

A technical lemma needed to make the func1_1_L11 proof more clear.
lemma func1_1_L10:
assumes A1: f ⊆ X×Y and A2: ∃ !y. (y∈Y ∧ hx,yi ∈ f)shows ∃ !y. hx,yi ∈ f
prooffrom A2 show ∃ y. hx, yi ∈ f by auto
fix y n assume hx,yi ∈ f and hx,ni ∈ fwith A1 A2 show y=n by autoqed

If f ⊆ X × Y and for every x ∈ X there is exactly one y ∈ Y such that(x, y) ∈ f then f maps X to Y .
lemma func1_1_L11:
assumes f ⊆ X×Y and ∀ x∈X. ∃ !y. y∈Y ∧ hx,yi ∈ fshows f: X→Y using assms func1_1_L10 Pi_iff_old by simp

A set defined by a lambda-type expression is a fuction. There is a similar
lemma in func.thy, but I had problems with lambda expressions syntax so I
could not apply it. This lemma is a workaround for this. Besides, lambda
expressions are not readable.
lemma func1_1_L11A: assumes A1: ∀ x∈X. b(x) ∈ Yshows {h x,yi ∈ X×Y. b(x) = y} : X→Y
proof let f = {h x,yi ∈ X×Y. b(x) = y}have f ⊆ X×Y by auto
moreover have ∀ x∈X. ∃ !y. y∈Y ∧ h x,yi ∈ f
proof
fix x assume A2: x∈Xshow ∃ !y. y∈Y ∧ hx, yi ∈ {hx,yi ∈ X×Y . b(x) = y}prooffrom A2 A1 show
∃ y. y∈Y ∧ hx, yi ∈ {hx,yi ∈ X×Y . b(x) = y}by simpnext
fix y y1assume y∈Y ∧ hx, yi ∈ {hx,yi ∈ X×Y . b(x) = y}and y1∈Y ∧ hx, y1i ∈ {hx,yi ∈ X×Y . b(x) = y}then show y = y1 by simp
qed
qed
ultimately show {h x,yi ∈ X×Y. b(x) = y} : X→Yusing func1_1_L11 by simp

66

qed

The next lemma will replace func1_1_L11A one day.
lemma ZF_fun_from_total: assumes A1: ∀ x∈X. b(x) ∈ Yshows {hx,b(x)i. x∈X} : X→Y
proof let f = {hx,b(x)i. x∈X}{ fix x assume A2: x∈X
have ∃ !y. y∈Y ∧ hx, yi ∈ f
prooffrom A1 A2 show ∃ y. y∈Y ∧ hx, yi ∈ f
by simpnext fix y y1 assume y∈Y ∧ hx, yi ∈ f
and y1∈Y ∧ hx, y1i ∈ fthen show y = y1 by simpqed
} then have ∀ x∈X. ∃ !y. y∈Y ∧ h x,yi ∈ f
by simpmoreover from A1 have f ⊆ X×Y by auto
ultimately show thesis using func1_1_L11
by simpqed

The value of a function defined by a meta-function is this meta-function.
lemma func1_1_L11B:
assumes A1: f:X→Yx∈X
and A2: f = {h x,yi ∈ X×Y. b(x) = y}shows f(x) = b(x)proof from A1 have h x,f(x)i ∈ f using apply_iff by simp
with A2 show thesis by simp
qed

The next lemma will replace func1_1_L11B one day.
lemma ZF_fun_from_tot_val:
assumes A1: f:X→Yx∈X
and A2: f = {hx,b(x)i. x∈X}
shows f(x) = b(x)proof from A1 have h x,f(x)i ∈ f using apply_iff by simp
with A2 show thesis by simp
qed

Identical meaning as ZF_fun_from_tot_val, but phrased a bit differently.
lemma ZF_fun_from_tot_val0:
assumes f:X→Y and f = {hx,b(x)i. x∈X}
shows ∀ x∈X. f(x) = b(x)using assms ZF_fun_from_tot_val by simp

67

Another way of expressing that lambda expression is a function.
lemma lam_is_fun_range: assumes f={hx,g(x)i. x∈X}
shows f:X→range(f)proof have ∀ x∈X. g(x) ∈ range({hx,g(x)i. x∈X}) unfolding range_def
by autothen have {hx,g(x)i. x∈X} : X→range({hx,g(x)i. x∈X}) by (rule ZF_fun_from_total)
with assms show thesis by autoqed

Yet another way of expressing value of a function.
lemma ZF_fun_from_tot_val1:
assumes x∈X shows {hx,b(x)i. x∈X}(x)=b(x)proof let f = {hx,b(x)i. x∈X}
have f:X→range(f) using lam_is_fun_range by simp
with assms show thesis using ZF_fun_from_tot_val0 by simpqed

We can extend a function by specifying its values on a set disjoint with thedomain.
lemma func1_1_L11C: assumes A1: f:X→Y and A2: ∀ x∈A. b(x)∈B
and A3: X∩A = 0 and Dg: g = f ∪ {hx,b(x)i. x∈A}shows
g : X∪A → Y∪B∀ x∈X. g(x) = f(x)∀ x∈A. g(x) = b(x)proof let h = {hx,b(x)i. x∈A}
from A1 A2 A3 have
I: f:X→Y h : A→B X∩A = 0
using ZF_fun_from_total by auto
then have f∪h : X∪A → Y∪B
by (rule fun_disjoint_Un)
with Dg show g : X∪A → Y∪B by simp
{ fix x assume A4: x∈Awith A1 A3 have (f∪h)(x) = h(x)using func1_1_L1 fun_disjoint_apply2
by blast
moreover from I A4 have h(x) = b(x)using ZF_fun_from_tot_val by simp
ultimately have (f∪h)(x) = b(x)by simp} with Dg show ∀ x∈A. g(x) = b(x) by simp
{ fix x assume A5: x∈Xwith A3 I have x ∈/ domain(h)using func1_1_L1 by auto
then have (f∪h)(x) = f(x)68using fun_disjoint_apply1 by simp
} with Dg show ∀ x∈X. g(x) = f(x) by simpqed

We can extend a function by specifying its value at a point that does notbelong to the domain.
lemma func1_1_L11D: assumes A1: f:X→Y and A2: a∈X/
and Dg: g = f ∪ {ha,bi}
shows
g : X∪{a} → Y∪{b}∀ x∈X. g(x) = f(x)g(a) = b
proof let h = {ha,bi}
from A1 A2 Dg have I:
f:X→Y ∀ x∈{a}. b∈{b} X∩{a} = 0 g = f ∪ {hx,bi. x∈{a}}by autothen show g : X∪{a} → Y∪{b}by (rule func1_1_L11C)
from I show ∀ x∈X. g(x) = f(x)by (rule func1_1_L11C)
from I have ∀ x∈{a}. g(x) = b
by (rule func1_1_L11C)
then show g(a) = b by autoqed

A technical lemma about extending a function both by defining on a set
disjoint with the domain and on a point that does not belong to any of
those sets.
lemma func1_1_L11E:
assumes A1: f:X→Y andA2: ∀ x∈A. b(x)∈B and
A3: X∩A = 0 and A4: a∈/ X∪Aand Dg: g = f ∪ {hx,b(x)i. x∈A} ∪ {ha,ci}
shows
g : X∪A∪{a} → Y∪B∪{c}∀ x∈X. g(x) = f(x)∀ x∈A. g(x) = b(x)g(a) = cproof let h = f ∪ {hx,b(x)i. x∈A}
from assms show g : X∪A∪{a} → Y∪B∪{c}using func1_1_L11C func1_1_L11D by simp
from A1 A2 A3 have I:
f:X→Y ∀ x∈A. b(x)∈B X∩A = 0 h = f ∪ {hx,b(x)i. x∈A}
by autofrom assms have
II: h : X∪A → Y∪B a∈/ X∪A g = h ∪ {ha,ci}
using func1_1_L11C by auto69

then have III: ∀ x∈X∪A. g(x) = h(x) by (rule func1_1_L11D)
moreover from I have ∀ x∈X. h(x) = f(x)by (rule func1_1_L11C)
ultimately show ∀ x∈X. g(x) = f(x) by simp
from I have ∀ x∈A. h(x) = b(x) by (rule func1_1_L11C)
with III show ∀ x∈A. g(x) = b(x) by simp
from II show g(a) = c by (rule func1_1_L11D)qed

A way of defining a function on a union of two possibly overlapping sets. We
decompose the union into two differences and the intersection and define afunction separately on each part.
lemma fun_union_overlap: assumes ∀ x∈A∩B. h(x) ∈ Y ∀ x∈A-B. f(x) ∈Y ∀ x∈B-A. g(x) ∈ Yshows {hx,if x∈A-B then f(x) else if x∈B-A then g(x) else h(x)i. x∈ A∪B}: A∪B → Y
proof let F = {hx,if x∈A-B then f(x) else if x∈B-A then g(x) else h(x)i. x∈ A∩B}
from assms have ∀ x∈A∪B. (if x∈A-B then f(x) else if x∈B-A then g(x)else h(x)) ∈ Y
by autothen show thesis by (rule ZF_fun_from_total)
qed

Inverse image of intersection is the intersection of inverse images.
lemma invim_inter_inter_invim: assumes f:X→Yshows f-(A∩B) = f-(A) ∩ f-(B)using assms fun_is_fun function_vimage_Int by simp

The inverse image of an intersection of a nonempty collection of sets is theintersection of the inverse images. This generalizes invim_inter_inter_invim
which is proven for the case of two sets.
lemma func1_1_L12:
assumes A1:
and A2: B6=0 and A3: f:X→Y
T B ⊆ Pow(Y)Tshows f-( B) = ( U∈B. f-(U))
proof
T
T
from A2T show f-( B) ⊆ (T U∈B. f-(U)) by blast
show ( U∈B. f-(U)) ⊆ f-( B)proofTfix x assume A4: x ∈ ( U∈B. f-(U))
from A3 have ∀ U∈B. f-(U) ⊆ X using func1_1_L6A by simp
with A4 have ∀ U∈B. x∈X by autowith A2 have x∈X by autowith A3 have ∃ !y. h x,yiT∈ f using Pi_iff_old by simp
with A2 A4 show x ∈ f-( B) using vimage_iff by blast
qed
qed

70

The inverse image of a set does not change when we intersect the set with
the image of the domain.
lemma inv_im_inter_im: assumes f:X→Yshows f-(A ∩ f(X)) = f-(A)using assms invim_inter_inter_invim inv_im_dom func1_1_L6A
by blast

If the inverse image of a set is not empty, then the set is not empty. Proofby contradiction.
lemma func1_1_L13: assumes A1:f-(A) 6= 0 shows A6=0
using assms by auto

If the image of a set is not empty, then the set is not empty. Proof bycontradiction.
lemma func1_1_L13A: assumes A1: f(A)6=0 shows A6=0
using assms by auto

What is the inverse image of a singleton?
lemma func1_1_L14: assumes f∈X→Yshows f-({y}) = {x∈X. f(x) = y}using assms func1_1_L6A vimage_singleton_iff apply_iff by auto

A lemma that can be used instead fun_extension_iff to show that twofunctions are equallemma func_eq: assumes f: X→Y g: X→Zand ∀ x∈X. f(x) = g(x)shows f = g using assms fun_extension_iff by simp

Function defined on a singleton is a single pair.
lemma func_singleton_pair: assumes A1: f : {a}→Xshows f = {ha, f(a)i}
proof let g = {ha, f(a)i}note A1
moreover have g : {a} → {f(a)} using singleton_fun by simp
moreover have ∀ x ∈ {a}. f(x) = g(x) using singleton_apply
by simpultimately show f = g by (rule func_eq)
qed

A single pair is a function on a singleton. This is similar to singleton_fun
from standard Isabelle/ZF.
lemma pair_func_singleton: assumes A1: y ∈ Yshows {hx,yi} : {x} → Y
proof have {hx,yi} : {x} → {y} using singleton_fun by simp
moreover from A1 have {y} ⊆ Y by simp

71

ultimately show {hx,yi} : {x} → Y
by (rule func1_1_L1B)qed

The value of a pair on the first element is the second one.
lemma pair_val: shows {hx,yi}(x) = yusing singleton_fun apply_equality by simp

A more familiar definition of inverse image.
lemma func1_1_L15: assumes A1: f:X→Yshows f-(A) = {x∈X. f(x) ∈ A}
proof S
have f-(A) = ( y∈A . f-{y})by (rule vimage_eq_UN)
with A1 show thesis using func1_1_L14 by autoqed

A more familiar definition of image.
lemma func_imagedef: assumes A1: f:X→Y and A2: A⊆X
shows f(A) = {f(x). x ∈ A}
proof
from A1 show f(A) ⊆ {f(x). x ∈ A}
using image_iff apply_iff by autoshow {f(x). x ∈ A} ⊆ f(A)proof
fix y assume y ∈ {f(x). x ∈ A}
then obtain x where x∈A and y = f(x)by autowith A1 A2 have hx,yi ∈ f using apply_iff by force
with A1 A2 hx∈Ai show y ∈ f(A) using image_iff by autoqed
qed

The image of a set contained in domain under identity is the same set.
lemma image_id_same: assumes A⊆X shows id(X)(A) = A
using assms id_type id_conv by auto

The inverse image of a set contained in domain under identity is the sameset.
lemma vimage_id_same: assumes A⊆X shows id(X)-(A) = A
using assms id_type id_conv by auto

What is the image of a singleton?
lemma singleton_image:assumes f∈X→Y and x∈Xshows f{x} = {f(x)}using assms func_imagedef by auto72

If an element of the domain of a function belongs to a set, then its value
belongs to the imgage of that set.
lemma func1_1_L15D: assumes f:X→Yshows f(x) ∈ f(A)using assms func_imagedef by auto

x∈A

A⊆X

Range is the image of the domain. Isabelle/ZF defines range(f) as domain(converse(f)),
and that’s why we have something to prove here.
lemma range_image_domain:
assumes A1: f:X→Y shows f(X) = range(f)proofshow f(X) ⊆ range(f) using image_def by auto
{ fix y assume y ∈ range(f)then obtain x where hy,xi ∈ converse(f) by autowith A1 have x∈X using func1_1_L5 by blast
with A1 have f(x) ∈ f(X) using func_imagedef
by autowith A1 hhy,xi ∈ converse(f)i have y ∈ f(X)using apply_equality by auto
} then show range(f) ⊆ f(X) by autoqed

The difference of images is contained in the image of difference.
lemma diff_image_diff: assumes A1: f: X→Y and A2: A⊆X
shows f(X) - f(A) ⊆ f(X-A)
proof
fix y assume y ∈ f(X) - f(A)hence y ∈ f(X) and I: y ∈/ f(A) by autowith A1 obtain x where x∈X and II: y = f(x)using func_imagedef by autowith A1 A2 I have x∈A/using func1_1_L15D by autowith hx∈Xi have x ∈ X-A X-A ⊆ X by autowith A1 II show y ∈ f(X-A)
using func1_1_L15D by simp
qed

The image of an intersection is contained in the intersection of the images.
lemma image_of_Inter: assumes A1: f:X→Y and
A2: I6=0 and
T A3: ∀ i∈I. P(i)T ⊆ Xshows f( i∈I. P(i)) ⊆ (i∈I. f(P(i)) )proof
Tfix y assume A4: y ∈ f(
T i∈I. P(i))
T
from A1 A2 A3 have f( i∈I. P(i)) = {f(x). x ∈ (i∈I. P(i) )}using ZF1_1_L7 func_imagedef Tby simp
with A4 obtain x where x ∈ (i∈I. P(i) ) and y = f(x)by autoTwith A1 A2 A3 show y ∈ (i∈I. f(P(i)) ) using func_imagedef73

by autoqed

The image of union is the union of images.
lemma image_of_Union:
assumes A1: f:X→Y and A2: ∀ A∈M. A⊆XSSshows f( M) ={f(A). A∈M}
proof
S
from A2 haveM ⊆ XSby auto{ fix y assume
y
∈
f(
M)
S
S
with A1 h M ⊆ Xi obtain x where x∈ M and I: y = f(x)using func_imagedef by auto
then obtain A where A∈M
S and x∈A by autowith assms
I
have
y
∈
{f(A). A∈M} using func_imagedef by autoSS
} thus f( M) ⊆{f(A).
A∈M}
by autoS{ fix y assume y ∈{f(A). A∈M}
then obtain S
A where A∈M and y ∈S f(A) by autowith S
assms h M ⊆ Xi haveS y ∈ f( M) using func_imagedef by auto
} thus{f(A). A∈M} ⊆ f( M) by autoqed

The image of a nonempty subset of domain is nonempty.
lemma func1_1_L15A:
assumes A1: f: X→Y and A2: A⊆X and A3: A6=0
shows f(A) 6= 0
proof from A3 obtain x where x∈A by autowith A1 A2 have f(x) ∈ f(A)using func_imagedef by auto
then show f(A) 6= 0 by autoqed

The next lemma allows to prove statements about the values in the domainof a function given a statement about values in the range.
lemma func1_1_L15B:
assumes f:X→Y and A⊆X and ∀ y∈f(A). P(y)shows ∀ x∈A. P(f(x))
using assms func_imagedef by simp

An image of an image is the image of a composition.
lemma func1_1_L15C: assumes A1: f:X→Y and A2: g:Y→Z
and A3: A⊆X
showsg(f(A)) = {g(f(x)). x∈A}g(f(A)) = (g O f)(A)proof from A1 A3 have {f(x). x∈A} ⊆ Yusing apply_funtype by autowith A2 have g{f(x). x∈A} = {g(f(x)). x∈A}

74

using func_imagedef by autowith A1 A3 show I: g(f(A)) = {g(f(x)). x∈A}
using func_imagedef by simp
from A1 A3 have ∀ x∈A. (g O f)(x) = g(f(x))
using comp_fun_apply by autowith I have g(f(A)) = {(g O f)(x). x∈A}
by simpmoreover from A1 A2 A3 have (g O f)(A) = {(g O f)(x). x∈A}
using comp_fun func_imagedef by blast
ultimately show g(f(A)) = (g O f)(A)by simpqed

What is the image of a set defined by a meta-fuction?
lemma func1_1_L17:
assumes A1: f ∈ X→Y and A2: ∀ x∈A. b(x) ∈ X
shows f({b(x). x∈A}) = {f(b(x)). x∈A}
proof from A2 have {b(x). x∈A} ⊆ X by autowith A1 show thesis using func_imagedef by autoqedWhat are the values of composition of three functions?
lemma func1_1_L18: assumes A1: f:A→B g:B→C h:C→D
and A2: x∈Ashows(h O g O f)(x) ∈ D(h O g O f)(x) = h(g(f(x)))
proof from A1 have (h O g O f) : A→Dusing comp_fun by blast
with A2 show (h O g O f)(x) ∈ D using apply_funtype
by simpfrom A1 A2 have (h O g O f)(x) = h( (g O f)(x))
using comp_fun comp_fun_apply by blast
with A1 A2 show (h O g O f)(x) = h(g(f(x)))
using comp_fun_apply by simp
qed

A composition of functions is a function. This is a slight generalization ofstandard Isabelle’s comp_fun
lemma comp_fun_subset:
assumes A1: g:A→B and A2: f:C→D and A3: B ⊆ Cshows f O g : A → D
proof from A1 A3 have g:A→C by (rule func1_1_L1B)
with A2 show f O g : A → D using comp_fun by simp
qed75

This lemma supersedes the lemma comp_eq_id_iff in Isabelle/ZF. Contributed by Victor Porton.
lemma comp_eq_id_iff1: assumes A1: g: B→A and A2: f: A→Cshows (∀ y∈B. f(g(y)) = y) ←→ f O g = id(B)proof from assms have f O g: B→C and id(B): B→B
using comp_fun id_type by auto
then have (∀ y∈B. (f O g)y = id(B)(y)) ←→ f O g = id(B)by (rule fun_extension_iff)
moreover from A1 have∀ y∈B. (f O g)y = f(gy) and ∀ y∈B. id(B)(y) = y
by autoultimately show (∀ y∈B. f(gy) = y) ←→ f O g = id(B) by simp
qed

A lemma about a value of a function that is a union of some collection offunctions.
Slemma fun_Union_apply: assumes A1:
F : X→Y andA2: f∈F Sand A3: f:A→B and A4: x∈Ashows ( F)(x) = f(x)proof from A3 A4 have hx, f(x)i ∈ f using apply_Pairby simpS
with A2 have hx,
F by auto
S f(x)i ∈with A1 show ( F)(x) = f(x) using apply_equality
by simpqed

9.2

Functions restricted to a set

Standard Isabelle/ZF defines the notion restrict(f,A) of to mean a function(or relation) f restricted to a set. This means that if f is a function definedon X and A is a subset of X then restrict(f,A) is a function whith thesame values as f , but whose domain is A.
What is the inverse image of a set under a restricted fuction?
lemma func1_2_L1: assumes A1: f:X→Y and A2: B⊆Xshows restrict(f,B)-(A) = f-(A) ∩ B
proof let g = restrict(f,B)
from A1 A2 have g:B→Yusing restrict_type2 by simp
with A2 A1 show g-(A) = f-(A) ∩ B
using func1_1_L15 restrict_if by autoqed

A criterion for when one function is a restriction of another. The lemma76below provides a result useful in the actual proof of the criterion and applications.
lemma func1_2_L2:
assumes A1: f:X→Y and A2: g ∈ A→Z
and A3: A⊆X and A4: f ∩ A×Z = gshows ∀ x∈A. g(x) = f(x)proof
fix x assume x∈Awith A2 have h x,g(x)i ∈ g using apply_Pair by simp
with A4 A1 show g(x) = f(x) using apply_iff by autoqed

Here is the actual criterion.
lemma func1_2_L3:
assumes A1: f:X→Y and A2: g:A→Z
and A3: A⊆X and A4: f ∩ A×Z = gshows g = restrict(f,A)
prooffrom A4 show g ⊆ restrict(f, A) using restrict_iff by autoshow restrict(f, A) ⊆ g
proof
fix z assume A5:z ∈ restrict(f,A)
then obtain x y where D1:z∈f ∧ x∈A ∧ z = hx,yiusing restrict_iff by autowith A1 have y = f(x) using apply_iff by autowith A1 A2 A3 A4 D1 have y = g(x) using func1_2_L2 by simp
with A2 D1 show z∈g using apply_Pair by simp
qed
qed

Which function space a restricted function belongs to?
lemma func1_2_L4:
assumes A1: f:X→Y and A2: A⊆X and A3: ∀ x∈A. f(x) ∈ Z
shows restrict(f,A) : A→Z
proof let g = restrict(f,A)
from A1 A2 have g : A→Yusing restrict_type2 by simp
moreover {fix x assume x∈Awith A1 A3 have g(x) ∈ Z using restrict by simp}
ultimately show thesis by (rule Pi_type)qed

A simpler case of func1_2_L4, where the range of the original and restrictedfunction are the same.
corollary restrict_fun: assumes A1: f:X→Y and A2: A⊆X
shows restrict(f,A) : A → Y

77proof from assms have ∀ x∈A. f(x) ∈ Y using apply_funtype
by autowith assms show thesis using func1_2_L4 by simp
qed

A composition of two functions is the same as composition with a restriction.
lemma comp_restrict:assumes A1: f : A→B and A2: g : X → C and A3: B⊆Xshows g O f = restrict(g,B) O f
proof from assms have g O f : A → C using comp_fun_subset
by simpmoreover from assms have restrict(g,B) O f : A → C
using restrict_fun comp_fun by simp
moreover from A1 have
∀ x∈A. (g O f)(x) = (restrict(g,B) O f)(x)using comp_fun_apply apply_funtype restrictby simpultimately show g O f = restrict(g,B) O fby (rule func_eq)
qed

A way to look at restriction. Contributed by Victor Porton.
lemma right_comp_id_any: shows r O id(C) = restrict(r,C)
unfolding restrict_def by auto

9.3

Constant functions

Constant functions are trivial, but still we need to prove some properties toshorten proofs.
We define constant(= c) functions on a set X in a natural way as ConstantFunction(X, c).
definition
ConstantFunction(X,c) ≡ X×{c}Constant function belongs to the function space.
lemma func1_3_L1:
assumes A1: c∈Y shows ConstantFunction(X,c) : X→Y
proof from A1 have X×{c} = {h x,yi ∈ X×Y. c = y}by autowith A1 show thesis using func1_1_L11A ConstantFunction_def
by simpqed

Constant function is equal to the constant on its domain.
lemma func1_3_L2: assumes A1: x∈X78

shows ConstantFunction(X,c)(x) = c
proof have ConstantFunction(X,c) ∈ X→{c}using func1_3_L1 by simp
moreover from A1 have h x,ci ∈ ConstantFunction(X,c)
using ConstantFunction_def by simp
ultimately show thesis using apply_iff by simp
qed

9.4

Injections, surjections, bijections etc.

In this section we prove the properties of the spaces of injections, surjections
and bijections that we can’t find in the standard Isabelle’s Perm.thy.
For injections the image a difference of two sets is the difference of images
lemma inj_image_dif:
assumes A1: f ∈ inj(A,B) and A2: C ⊆ A
shows f(A-C) = f(A) - f(C)proofshow f(A - C) ⊆ f(A) - f(C)proof
fix y assume A3: y ∈ f(A - C)from A1 have f:A→B using inj_def by simp
moreover have A-C ⊆ A by auto
ultimately have f(A-C) = {f(x). x ∈ A-C}
using func_imagedef by simp
with A3 obtain x where I: f(x) = y and x ∈ A-C
by autohence x∈A by autowith hf:A→Bi I have y ∈ f(A)using func_imagedef by auto
moreover have y ∈/ f(C)
proof { assume y ∈ f(C)with A2 hf:A→Bi obtain x0
where II: f(x0 ) = y and x0 ∈ Cusing func_imagedef by autowith A1 A2 I hx∈Ai havef ∈ inj(A,B) f(x) = f(x0 ) x∈A x0 ∈ A
by autothen have x = x0 by (rule inj_apply_equality)with hx ∈ A-Ci hx0 ∈ Ci have False by simp
} thus thesis by autoqed
ultimately show y ∈ f(A) - f(C) by simp
qedfrom A1 A2 show f(A) - f(C) ⊆ f(A-C)
using inj_def diff_image_diff by autoqed

79For injections the image of intersection is the intersection of images.
lemma inj_image_inter: assumes A1: f ∈ inj(X,Y) and A2: A⊆X B⊆X
shows f(A∩B) = f(A) ∩ f(B)proofshow f(A∩B) ⊆ f(A) ∩ f(B) using image_Int_subset by simp
{ from A1 have f:X→Y using inj_def by simp
fix y assume y ∈ f(A) ∩ f(B)then have y ∈ f(A) and y ∈ f(B) by autowith A2 hf:X→Yi obtain xA xB wherexA ∈ A xB ∈ B and I: y = f(xA ) y = f(xB )using func_imagedef by autowith A2 have xA ∈ X xB ∈ X and f(xA ) = f(xB ) by autowith A1 have xA = xB using inj_def by autowith hxA ∈ Ai hxB ∈ Bi have f(xA ) ∈ {f(x). x ∈ A∩B} by auto
moreover from A2 hf:X→Yi have f(A∩B) = {f(x). x ∈ A∩B}
using func_imagedef by blast
ultimately have f(xA ) ∈ f(A∩B) by simp
with I have y ∈ f(A∩B) by simp
} thus f(A) ∩ f(B) ⊆ f(A ∩ B) by autoqed

For surjection from A to B the image of the domain is B.
lemma surj_range_image_domain: assumes A1: f ∈ surj(A,B)
shows f(A) = B
proof from A1 have f(A) = range(f)using surj_def range_image_domain by autowith A1 show f(A) = B using surj_range
by simpqed

For injections the inverse image of an image is the same set.
lemma inj_vimage_image: assumes f ∈ inj(X,Y) and A⊆X
shows f-(f(A)) = A
proof have f-(f(A)) = (converse(f) O f)(A)using vimage_converse image_comp by simp
with assms show thesis using left_comp_inverse image_id_same
by simpqed

For surjections the image of an inverse image is the same set.
lemma surj_image_vimage: assumes A1: f ∈ surj(X,Y) and A2: A⊆Yshows f(f-(A)) = A
proof have f(f-(A)) = (f O converse(f))(A)
using vimage_converse image_comp by simp
with assms show thesis using right_comp_inverse image_id_same80

by simp
qed

A lemma about how a surjection maps collections of subsets in domain andrangge.
lemma surj_subsets: assumes A1: f ∈ surj(X,Y) and A2: B ⊆ Pow(Y)shows { f(U). U ∈ {f-(V). V∈B} } = B
proof{ fix W assume W ∈ { f(U). U ∈ {f-(V). V∈B} }then obtain U where I: U ∈ {f-(V). V∈B} and II: W = f(U) by auto
then obtain V where V∈B and U = f-(V) by autowith II have W = f(f-(V)) by simp
moreover from assms hV∈Bi have f ∈ surj(X,Y) and V⊆Y by auto
ultimately have W=V using surj_image_vimage by simp
with hV∈Bi have W ∈ B by simp
} thus { f(U). U ∈ {f-(V). V∈B} } ⊆ B by auto
{ fix W assume W∈B
let U = f-(W)from hW∈Bi have U ∈ {f-(V). V∈B} by auto
moreover from A1 A2 hW∈Bi have W = f(U) using surj_image_vimage by
auto
ultimately have W ∈ { f(U). U ∈ {f-(V). V∈B} } by auto
} thus B ⊆ { f(U). U ∈ {f-(V). V∈B} } by autoqed

Restriction of an bijection to a set without a point is a a bijection.
lemma bij_restrict_rem:
assumes A1: f ∈ bij(A,B) and A2: a∈Ashows restrict(f, A-{a}) ∈ bij(A-{a}, B-{f(a)})
proof let C = A-{a}from A1 have f ∈ inj(A,B) C ⊆ A
using bij_def by auto
then have restrict(f,C) ∈ bij(C, f(C))
using restrict_bij by simp
moreover have f(C) = B-{f(a)}proof from A2 hf ∈ inj(A,B)i have f(C) = f(A) - f{a}using inj_image_dif by simp
moreover from A1 have f(A) = B
using bij_def surj_range_image_domain by auto
moreover from A1 A2 have f{a} = {f(a)}using bij_is_fun singleton_image by blast
ultimately show f(C) = B-{f(a)} by simp
qed
ultimately show thesis by simp
qed

The domain of a bijection between X and Y is X.
81

lemma domain_of_bij:
assumes A1: f ∈ bij(X,Y) shows domain(f) = X
proof from A1 have f:X→Y using bij_is_fun by simp
then show domain(f) = X using func1_1_L1 by simp
qed

The value of the inverse of an injection on a point of the image of a set
belongs to that set.
lemma inj_inv_back_in_set:
assumes A1: f ∈ inj(A,B) and A2: C⊆A and A3: y ∈ f(C)showsconverse(f)(y) ∈ C
f(converse(f)(y)) = y
proof from A1 have I: f:A→B using inj_is_fun by simp
with A2 A3 obtain x where II: x∈C
y = f(x)using func_imagedef by autowith A1 A2 show converse(f)(y) ∈ C using left_inverseby autofrom A1 A2 I II show f(converse(f)(y)) = yusing func1_1_L5A right_inverse by autoqed

For injections if a value at a point belongs to the image of a set, then the
point belongs to the set.
lemma inj_point_of_image:assumes A1: f ∈ inj(A,B) and A2: C⊆A andA3: x∈A and A4: f(x) ∈ f(C)shows x ∈ C
proof from A1 A2 A4 have converse(f)(f(x)) ∈ Cusing inj_inv_back_in_set by simp
moreover from A1 A3 have converse(f)(f(x)) = x
using left_inverse_eq by simp
ultimately show x ∈ C by simp
qed

For injections the image of intersection is the intersection of images.
lemma inj_image_of_Inter: assumes A1: f ∈ inj(A,B) and
A2: I6=0 and
T A3: ∀ i∈I. P(i)T ⊆ Ashows f( i∈I. P(i)) = (i∈I. f(P(i)) )
proof
T
T
from A1 A2 A3 show f( i∈I. P(i)) ⊆ (i∈I. f(P(i)) )using inj_is_fun image_of_Inter by
autoTfrom A1 A2 A3 have f:A→B and (i∈I. P(i) ) ⊆ A
using inj_is_fun
ZF1_1_L7
by
auto
T
T
then have I: f( i∈I. P(i)) = { f(x). x ∈ (i∈I. P(i) ) }82

using func_imagedef by simpT
{ fix y assume A4: y ∈ (i∈I. f(P(i)) )let x = converse(f)(y)from A2 obtain i0 where i0 ∈ I by autowith A1 A4 have II: y ∈ range(f) using inj_is_fun func1_1_L6
by autowith A1 have III: f(x) = y using right_inverse by simp
from A1 II have IV: x ∈ A using inj_converse_fun apply_funtype
by blast{ fix i assume i∈Iwith A3 A4 III have P(i) ⊆ A and f(x) ∈ f(P(i))
by autowith A1 IV have x ∈ P(i) using inj_point_of_image
by blast} then have ∀ i∈I. x ∈ P(i)T by simp
with A2 I have f(x) ∈ f(i∈I. P(i) )by autoTwith III haveTy ∈ f(i∈I. P(i) ) Tby simp} then show (i∈I. f(P(i)) ) ⊆ f(i∈I. P(i) )by autoqed

An injection is injective onto its range. Suggested by Victor Porton.
lemma inj_inj_range: assumes f ∈ inj(A,B)
shows f ∈ inj(A,range(f))
using assms inj_def range_of_fun by auto

An injection is a bijection on its range. Suggested by Victor Porton.
lemma inj_bij_range: assumes f ∈ inj(A,B)
shows f ∈ bij(A,range(f))
proof from assms have f ∈ surj(A,range(f)) using inj_def fun_is_surj
by autowith assms show thesis using inj_inj_range bij_def by simp
qed

A lemma about extending a surjection by one point.
lemma surj_extend_point:
assumes A1: f ∈ surj(X,Y) and A2: a∈X/ andA3: g = f ∪ {ha,bi}
shows g ∈ surj(X∪{a},Y∪{b})
proof from A1 A2 A3 have g : X∪{a} → Y∪{b}using surj_def func1_1_L11D by simp
moreover have ∀ y ∈ Y∪{b}. ∃ x ∈ X∪{a}. y = g(x)proof
fix y assume y ∈ Y ∪ {b}then have y ∈ Y ∨ y = b by auto
moreover83

{ assume y ∈ Ywith A1 obtain x where x∈X and y = f(x)using surj_def by autowith A1 A2 A3 have x ∈ X∪{a} and y = g(x)using surj_def func1_1_L11D by auto
then have ∃ x ∈ X∪{a}. y = g(x) by auto }moreover{ assume y = b
with A1 A2 A3 have y = g(a)using surj_def func1_1_L11D by auto
then have ∃ x ∈ X∪{a}. y = g(x) by auto }
ultimately show ∃ x ∈ X∪{a}. y = g(x)by autoqed
ultimately show g ∈ surj(X∪{a},Y∪{b})using surj_def by autoqed

A lemma about extending an injection by one point. Essentially the sameas standard Isabelle’s inj_extend.
lemma inj_extend_point: assumes f ∈ inj(X,Y) a∈X/ b∈Y/shows (f ∪ {ha,bi}) ∈ inj(X∪{a},Y∪{b})
proof from assms have cons(ha,bi,f) ∈ inj(cons(a, X), cons(b, Y))
using assms inj_extend by simp
moreover have cons(ha,bi,f) = f ∪ {ha,bi} andcons(a, X) = X∪{a} and cons(b, Y) = Y∪{b}
by autoultimately show thesis by simp
qed

A lemma about extending a bijection by one point.
lemma bij_extend_point: assumes f ∈ bij(X,Y) a∈X/ b∈Y/shows (f ∪ {ha,bi}) ∈ bij(X∪{a},Y∪{b})using assms surj_extend_point inj_extend_point bij_def
by simp

A quite general form of the a−1 b = 1 implies a = b law.
lemma comp_inv_id_eq:
assumes A1: converse(b) O a = id(A) andA2: a ⊆ A×B b ∈ surj(A,B)
shows a = b
proof from A1 have (b O converse(b)) O a = b O id(A)using comp_assoc by simp
with A2 have id(B) O a = b O id(A)using right_comp_inverse by simp
moreoverfrom A2 have a ⊆ A×B and b ⊆ A×B

84

using surj_def fun_subset_prodby autothen have id(B) O a = a and b O id(A) = b
using left_comp_id right_comp_id by auto
ultimately show a = b by simp
qed

A special case of comp_inv_id_eq - the a−1 b = 1 implies a = b law forbijections.
lemma comp_inv_id_eq_bij:
assumes A1: a ∈ bij(A,B) b ∈ bij(A,B) andA2: converse(b) O a = id(A)shows a = b
proof from A1 have a ⊆ A×B and b ∈ surj(A,B)
using bij_def surj_def fun_subset_prodby autowith A2 show a = b by (rule comp_inv_id_eq)
qed

Converse of a converse of a bijection is the same bijection. This is a special
case of converse_converse from standard Isabelle’s equalities theory where
it is proved for relations.
lemma bij_converse_converse: assumes a ∈ bij(A,B)
shows converse(converse(a)) = a
proof from assms have a ⊆ A×B using bij_def surj_def fun_subset_prod bysimp
then show thesis using converse_converse by simp
qed

If a composition of bijections is identity, then one is the inverse of the other.
lemma comp_id_conv: assumes A1: a ∈ bij(A,B) b ∈ bij(B,A) andA2: b O a = id(A)shows a = converse(b) and b = converse(a)proof from A1 have a ∈ bij(A,B) and converse(b) ∈ bij(A,B) using bij_converse_bij
by automoreover from assms have converse(converse(b)) O a = id(A)using bij_converse_converse by simp
ultimately show a = converse(b) by (rule comp_inv_id_eq_bij)with assms show b = converse(a) using bij_converse_converse by simp
qed

A version of comp_id_conv with weaker assumptions.
lemma comp_conv_id: assumes A1: a ∈ bij(A,B) and A2: b:B→A andA3: ∀ x∈A. b(a(x)) = x

85

shows b ∈ bij(B,A) and a = converse(b) and b = converse(a)proof have b ∈ surj(B,A)
proof have ∀ x∈A. ∃ y∈B. b(y) = x
proof { fix x assume x∈A
let y = a(x)from A1 A3 hx∈Ai have y∈B and b(y) = x
using bij_def inj_def apply_funtype by auto
hence ∃ y∈B. b(y) = x by auto
} thus thesis by simp
qedwith A2 show b ∈ surj(B,A) using surj_def by simp
qed
moreover have b ∈ inj(B,A)
proof have ∀ w∈B.∀ y∈B. b(w) = b(y) −→ w=y
proof { fix w y assume w∈B y∈B and I: b(w) = b(y)from A1 have a ∈ surj(A,B) unfolding bij_def by simp
with hw∈Bi obtain xw where xw ∈ A and II: a(xw ) = w
using surj_def by autowith I have b(a(xw )) = b(y) by simp
moreover from ha ∈ surj(A,B)i hy∈Bi obtain xy wherexy ∈ A and III: a(xy ) = yusing surj_def by auto
moreover from A3 hxw ∈ Ai hxy ∈ Ai have b(a(xw )) = xw and b(a(xy ))= xyby autoultimately have xw = xy by simp
with II III have w=y by simp
} thus thesis by autoqedwith A2 show b ∈ inj(B,A) using inj_def by autoqed
ultimately show b ∈ bij(B,A) using bij_def by simp
from assms have b O a = id(A) using bij_def inj_def comp_eq_id_iff1
by autowith A1 hb ∈ bij(B,A)i show a = converse(b) and b = converse(a)using comp_id_conv by autoqed

For a surjection the union if images of singletons is the whole range.
lemma surj_singleton_image:assumes A1: f ∈ surj(X,Y)
S
shows ( x∈X. {f(x)}) = Y
proof
Sfrom A1 show ( x∈X. {f(x)}) ⊆ Y
using surj_def apply_funtype by auto

86

next
{ fix y assume y ∈ Y S
with A1 have y ∈ ( x∈X. {f(x)})
using surj_def by
S auto} then show Y ⊆ ( x∈X. {f(x)}) by auto
qed

9.5

Functions of two variables

In this section we consider functions whose domain is a cartesian productof two sets. Such functions are called functions of two variables (althoughreally in ZF all functions admit only one argument). For every function of
two variables we can define families of functions of one variable by fixing theother variable. This section establishes basic definitions and results for thisconcept.
We can create functions of two variables by combining functions of one
variable.
lemma cart_prod_fun: assumes f1 :X1 →Y1 f2 :X2 →Y2 andg = {hp,hf1 (fst(p)),f2 (snd(p))ii. p ∈ X1 ×X2 }shows g: X1 ×X2 → Y1 ×Y2 using assms apply_funtype ZF_fun_from_total
by simpA reformulation of cart_prod_fun above in a sligtly different notation.
lemma prod_fun:assumes f:X1 →X2 g:X3 →X4shows {hhx,yi,hfx,gyii. hx,yi∈X1 ×X3 }:X1 ×X3 →X2 ×X4
proof have {hhx,yi,hfx,gyii. hx,yi∈X1 ×X3 } = {hp,hf(fst(p)),g(snd(p))ii. p ∈X1 ×X3 }by autowith assms show thesis using cart_prod_fun by simp
qed

Product of two surjections is a surjection.
theorem prod_functions_surj:
assumes f∈surj(A,B) g∈surj(C,D)
shows {hha1,a2i,hfa1,ga2ii.ha1,a2i∈A×C} ∈ surj(A×C,B×D)
proof let h = {hhx, yi, f(x), g(y)i . hx,yi ∈ A × C}from assms have fun: f:A→Bg:C→D unfolding surj_def by auto
then have pfun: h : A × C → B × D using prod_fun by auto{
fix b assume b∈B×D
then obtain b1 b2 where b=hb1,b2i b1∈B b2∈D by autowith assms obtain a1 a2 where f(a1)=b1 g(a2)=b2 a1∈A a2∈C
unfolding surj_def by blast
hence hha1,a2i,hb1,b2ii ∈ h by auto87with pfun have hha1,a2i=hb1,b2i using apply_equality by autowith hb=hb1,b2ii ha1∈Ai ha2∈Ci have ∃ a∈A×C. h(a)=b
by auto} hence ∀ b∈B×D. ∃ a∈A×C. h(a) = b by autowith pfun show thesis unfolding surj_def by autoqed

For a function of two variables created from functions of one variable as in
cart_prod_fun above, the inverse image of a cartesian product of sets is thecartesian product of inverse images.
lemma cart_prod_fun_vimage: assumes f1 :X1 →Y1 f2 :X2 →Y2 andg = {hp,hf1 (fst(p)),f2 (snd(p))ii. p ∈ X1 ×X2 }shows g-(A1 ×A2 ) = f1 -(A1 ) × f2 -(A2 )proof from assms have g: X1 ×X2 → Y1 ×Y2 using cart_prod_fun
by simpthen have g-(A1 ×A2 ) = {p ∈ X1 ×X2 . g(p) ∈ A1 ×A2 } using func1_1_L15
by simpwith assms hg: X1 ×X2 → Y1 ×Y2 i show g-(A1 ×A2 ) = f1 -(A1 ) × f2 -(A2 )using ZF_fun_from_tot_val func1_1_L15 by autoqed

For a function of two variables defined on X × Y , if we fix an x ∈ X we
obtain a function on Y . Note that if domain(f) is X × Y , range(domain(f))
extracts Y from X × Y .
definition
Fix1stVar(f,x) ≡ {hy,fhx,yii. y ∈ range(domain(f))}

For every y ∈ Y we can fix the second variable in a binary function f :X × Y → Z to get a function on X.
definition
Fix2ndVar(f,y) ≡ {hx,fhx,yii. x ∈ domain(domain(f))}

We defined Fix1stVar and Fix2ndVar so that the domain of the function is
not listed in the arguments, but is recovered from the function. The next
lemma is a technical fact that makes it easier to use this definition.
lemma fix_var_fun_domain: assumes A1: f : X×Y → Z
showsx∈X −→ Fix1stVar(f,x) = {hy,fhx,yii. y ∈ Y}y∈Y −→ Fix2ndVar(f,y) = {hx,fhx,yii. x ∈ X}
proof from A1 have I: domain(f) = X×Y using func1_1_L1 by simp
{ assume x∈Xwith I have range(domain(f)) = Y by auto
then have Fix1stVar(f,x) = {hy,fhx,yii. y ∈ Y}
using Fix1stVar_def by simp

88} then show x∈X −→ Fix1stVar(f,x) = {hy,fhx,yii. y ∈ Y}
by simp{ assume y∈Ywith I have domain(domain(f)) = X by auto
then have Fix2ndVar(f,y) = {hx,fhx,yii. x ∈ X}
using Fix2ndVar_def by simp
} then show y∈Y −→ Fix2ndVar(f,y) = {hx,fhx,yii. x ∈ X}
by simpqed

If we fix the first variable, we get a function of the second variable.
lemma fix_1st_var_fun: assumes A1: f : X×Y → Z and A2: x∈Xshows Fix1stVar(f,x) : Y → Z
proof from A1 A2 have ∀ y∈Y. fhx,yi ∈ Zusing apply_funtype by simp
then have {hy,fhx,yii. y ∈ Y} : Y → Z using ZF_fun_from_total by simp
with A1 A2 show Fix1stVar(f,x) : Y → Z using fix_var_fun_domain by
simp
qed

If we fix the second variable, we get a function of the first variable.
lemma fix_2nd_var_fun: assumes A1: f : X×Y → Z and A2: y∈Yshows Fix2ndVar(f,y) : X → Z
proof from A1 A2 have ∀ x∈X. fhx,yi ∈ Zusing apply_funtype by simp
then have {hx,fhx,yii. x ∈ X} : X → Z
using ZF_fun_from_total by simp
with A1 A2 show Fix2ndVar(f,y) : X → Z
using fix_var_fun_domain by simp
qed

What is the value of Fix1stVar(f,x) at y ∈ Y and the value of Fix2ndVar(f,y)
at x ∈ X”?
lemma fix_var_val:
assumes A1: f : X×Y → Z and A2: x∈X
shows
Fix1stVar(f,x)(y) = fhx,yi
Fix2ndVar(f,y)(x) = fhx,yi
proof let f1 = {hy,fhx,yii. y ∈ Y}
let f2 = {hx,fhx,yii. x ∈ X}
from A1 A2 have I:
Fix1stVar(f,x) = f1
Fix2ndVar(f,y) = f2
using fix_var_fun_domain by auto
moreover from A1 A2 haveFix1stVar(f,x) : Y → Z

89

y∈Y

Fix2ndVar(f,y) : X → Z
using fix_1st_var_fun fix_2nd_var_fun by auto
ultimately have f1 : Y → Z and f2 : X → Z
by autowith A2 have f1 (y) = fhx,yi and f2 (x) = fhx,yiusing ZF_fun_from_tot_val by autowith I show
Fix1stVar(f,x)(y) = fhx,yi
Fix2ndVar(f,y)(x) = fhx,yi
by autoqed

Fixing the second variable commutes with restrictig the domain.
lemma fix_2nd_var_restr_comm:assumes A1: f : X×Y → Z and A2: y∈Y and A3: X1 ⊆ Xshows Fix2ndVar(restrict(f,X1 ×Y),y) = restrict(Fix2ndVar(f,y),X1 )proof let g = Fix2ndVar(restrict(f,X1 ×Y),y)let h = restrict(Fix2ndVar(f,y),X1 )from A3 have I: X1 ×Y ⊆ X×Y by autowith A1 have II: restrict(f,X1 ×Y) : X1 ×Y → Z
using restrict_type2 by simp
with A2 have g : X1 → Z
using fix_2nd_var_fun by simp
moreoverfrom A1 A2 have III: Fix2ndVar(f,y) : X → Z
using fix_2nd_var_fun by simp
with A3 have h : X1 → Z
using restrict_type2 by simp
moreover{ fix z assume A4: z ∈ X1
with A2 I II have g(z) = fhz,yiusing restrict fix_var_val by simp
also from A1 A2 A3 A4 have fhz,yi = h(z)using restrict fix_var_val by auto
finally have g(z) = h(z) by simp
} then have ∀ z ∈ X1 . g(z) = h(z) by simp
ultimately show g = h by (rule func_eq)
qed

The next lemma expresses the inverse image of a set by function with fixed
first variable in terms of the original function.
lemma fix_1st_var_vimage:assumes A1: f : X×Y → Z and A2: x∈Xshows Fix1stVar(f,x)-(A) = {y∈Y. hx,yi ∈ f-(A)}proof from assms have Fix1stVar(f,x)-(A) = {y∈Y. Fix1stVar(f,x)(y) ∈ A}
using fix_1st_var_fun func1_1_L15 by blast
with assms show thesis using fix_var_val func1_1_L15 by auto

90

qed

The next lemma expresses the inverse image of a set by function with fixed
second variable in terms of the original function.
lemma fix_2nd_var_vimage:assumes A1: f : X×Y → Z and A2: y∈Yshows Fix2ndVar(f,y)-(A) = {x∈X. hx,yi ∈ f-(A)}proof from assms have I: Fix2ndVar(f,y)-(A) = {x∈X. Fix2ndVar(f,y)(x) ∈ A}
using fix_2nd_var_fun func1_1_L15 by blast
with assms show thesis using fix_var_val func1_1_L15 by auto
qed
end

10

Binary operations

theory func_ZF imports func1
begin

In this theory we consider properties of functions that are binary operations,that is they map X × X into X.

10.1

Lifting operations to a function space

It happens quite often that we have a binary operation on some set and
we need a similar operation that is defined for functions on that set. For
example once we know how to add real numbers we also know how to add
real-valued functions: for f, g : X → R we define (f + g)(x) = f (x) + g(x).
Note that formally the + means something different on the left hand side ofthis equality than on the right hand side. This section aims at formalizing
this process. We will call it ”lifting to a function space”, if you have asuggestion for a better name, please let me know.
Since we are writing in generic set notation, the definition below is a bitcomplicated. Here it what it says: Given a set X and another set f (thatrepresents a binary function on X) we are defining f lifted to function spaceover X as the binary function (a set of pairs) on the space F = X → range(f )such that the value of this function on pair ha, bi of functions on X is anotherfunction c on X with values defined by c(x) = f ha(x), b(x)i.
definition
Lift2FcnSpce (infix {lifted to function space over} 65) wheref {lifted to function space over} X ≡{h p,{hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X}i.
p ∈ (X→range(f))×(X→range(f))}

91

The result of the lift belongs to the function space.
lemma func_ZF_1_L1:
assumes A1: f : Y×Y→Y
and A2: p ∈(X→range(f))×(X→range(f))
shows{hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X} : X→range(f)proof have ∀ x∈X. fhfst(p)(x),snd(p)(x)i ∈ range(f)proof
fix x assume x∈X
let p = hfst(p)(x),snd(p)(x)i
from A2 hx∈Xi havefst(p)(x) ∈ range(f) snd(p)(x) ∈ range(f)using apply_type by autowith A1 have p ∈ Y×Y
using func1_1_L5B by blast
with A1 have hp, f(p)i ∈ fusing apply_Pair by simp
with A1 showf(p) ∈ range(f)using rangeI by simp
qedthen show thesis using ZF_fun_from_total by simp
qed

The values of the lift are defined by the value of the liftee in a natural way.
lemma func_ZF_1_L2:
assumes A1: f : Y×Y→Y
and A2: p ∈ (X→range(f))×(X→range(f)) and A3: x∈X
and A4: P = {hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X}
shows P(x) = fhfst(p)(x),snd(p)(x)i
proof from A1 A2 have{hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X} : X → range(f)using func_ZF_1_L1 by simp
with A4 have P : X → range(f) by simp
with A3 A4 show P(x) = fhfst(p)(x),snd(p)(x)iusing ZF_fun_from_tot_val by simp
qed

Function lifted to a function space results in function space operator.
theorem func_ZF_1_L3:
assumes f : Y×Y→Yand F = f {lifted to function space over} X
shows F : (X→range(f))×(X→range(f))→(X→range(f))
using assms Lift2FcnSpce_def func_ZF_1_L1 ZF_fun_from_total
by simp

The values of the lift are defined by the values of the liftee in the natural
92

way.
theorem func_ZF_1_L4:
assumes A1: f : Y×Y→Y
and A2: F = f {lifted to function space over} X
and A3: s:X→range(f) r:X→range(f)and A4: x∈Xshows (Fhs,ri)(x) = fhs(x),r(x)i
proof let p = hs,ri
let P = {hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X}
from A1 A3 A4 havef : Y×Y→Y p ∈ (X→range(f))×(X→range(f))
x∈X P = {hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X}
by autothen have P(x) = fhfst(p)(x),snd(p)(x)iby (rule func_ZF_1_L2)
hence P(x) = fhs(x),r(x)i by auto
moreover have P = Fhs,ri
proof from A1 A2 have F : (X→range(f))×(X→range(f))→(X→range(f))
using func_ZF_1_L3 by simp
moreover from A3 have p ∈ (X→range(f))×(X→range(f))
by automoreover from A2 have
F = {hp,{hx,fhfst(p)(x),snd(p)(x)ii. x ∈ X}i.
p ∈ (X→range(f))×(X→range(f))}
using Lift2FcnSpce_def by simp
ultimately show thesis using ZF_fun_from_tot_val
by simpqed
ultimately show (Fhs,ri)(x) = fhs(x),r(x)i by auto
qed

10.2

Associative and commutative operations

In this section we define associative and commutative operations and provethat they remain such when we lift them to a function space.
Typically we say that a binary operation ”·” on a set G is ”associative” if(x · y) · z = x · (y · z) for all x, y, z ∈ G. Our actual definition below does
not use the multiplicative notation so that we can apply it equally to theadditive notation + or whatever infix symbol we may want to use. Instead,
we use the generic set theory notation and write P hx, yi to denote the valueof the operation P on a pair hx, yi ∈ G × G.
definition
IsAssociative (infix {is associative on} 65) where
P {is associative on} G ≡ P : G×G→G ∧(∀ x ∈ G. ∀ y ∈ G. ∀ z ∈ G.

93

( P(hP(hx,yi),zi) = P( hx,P(hy,zi)i )))A binary function f : X × X → Y is commutative if f hx, yi = f hy, xi. Notethat in the definition of associativity above we talk about binary ”operation”
and here we say use the term binary ”function”. This is not set in stone,
but usually the word ”operation” is used when the range is a factor ofthe domain, while the word ”function” allows the range to be a completely
unrelated set.
definition
IsCommutative (infix {is commutative on} 65) wheref {is commutative on} G ≡ ∀ x∈G. ∀ y∈G. fhx,yi = fhy,xi

The lift of a commutative function is commutative.
lemma func_ZF_2_L1:
assumes A1: f : G×G→Gand A2: F = f {lifted to function space over} X
and A3: s : X→range(f) r : X→range(f)and A4: f {is commutative on} G
shows Fhs,ri = Fhr,si
proof from A1 A2 haveF : (X→range(f))×(X→range(f))→(X→range(f))
using func_ZF_1_L3 by simp
with A3 haveFhs,ri : X→range(f) and Fhr,si : X→range(f)using apply_type by auto
moreover have
∀ x∈X. (Fhs,ri)(x) = (Fhr,si)(x)proof
fix x assume x∈Xfrom A1 have range(f)⊆Gusing func1_1_L5B by simp
with A3 hx∈Xi have s(x) ∈ G and r(x) ∈ G
using apply_type by autowith A1 A2 A3 A4 hx∈Xi show
(Fhs,ri)(x) = (Fhr,si)(x)using func_ZF_1_L4 IsCommutative_def by simp
qed
ultimately show thesis using fun_extension_iff
by simpqed

The lift of a commutative function is commutative on the function space.
lemma func_ZF_2_L2:
assumes f : G×G→Gand f {is commutative on} G
and F = f {lifted to function space over} X
shows F {is commutative on} (X→range(f))

94using assms IsCommutative_def func_ZF_2_L1 by simp

The lift of an associative function is associative.
lemma func_ZF_2_L3:
assumes A2: F = f {lifted to function space over} X
and A3: s : X→range(f) r : X→range(f) q : X→range(f)and A4: f {is associative on} G
shows FhFhs,ri,qi = Fhs,Fhr,qii
proof from A4 A2 haveF : (X→range(f))×(X→range(f))→(X→range(f))
using IsAssociative_def func_ZF_1_L3 by autowith A3 have I:
Fhs,ri : X→range(f)Fhr,qi : X→range(f)FhFhs,ri,qi : X→range(f)Fhs,Fhr,qii: X→range(f)using apply_type by auto
moreover have
∀ x∈X. (FhFhs,ri,qi)(x) = (Fhs,Fhr,qii)(x)proof
fix x assume x∈Xfrom A4 have f:G×G→Gusing IsAssociative_def by simp
then have range(f)⊆Gusing func1_1_L5B by simp
with A3 hx∈Xi haves(x) ∈ G r(x) ∈ G q(x) ∈ G
using apply_type by autowith A2 I A3 A4 hx∈Xi hf:G×G→Gi show
(FhFhs,ri,qi)(x) = (Fhs,Fhr,qii)(x)using func_ZF_1_L4 IsAssociative_def by simp
qed
ultimately show thesis using fun_extension_iff
by simpqed

The lift of an associative function is associative on the function space.
lemma func_ZF_2_L4:
assumes A1: f {is associative on} G
and A2: F = f {lifted to function space over} X
shows F {is associative on} (X→range(f))
proof from A1 A2 haveF : (X→range(f))×(X→range(f))→(X→range(f))
using IsAssociative_def func_ZF_1_L3 by auto
moreover from A1 A2 have∀ s ∈ X→range(f). ∀ r ∈ X→range(f). ∀ q ∈ X→range(f).
FhFhs,ri,qi = Fhs,Fhr,qii

95

using func_ZF_2_L3 by simp
ultimately show thesis using IsAssociative_def
by simpqed

10.3

Restricting operations

In this section we consider conditions under which restriction of the operation to a set inherits properties like commutativity and associativity.
The commutativity is inherited when restricting a function to a set.
lemma func_ZF_4_L1:
assumes A1: f:X×X→Y and A2: A⊆X
and A3: f {is commutative on} X
shows restrict(f,A×A) {is commutative on} A
proof { fix x y assume x∈A and y∈Awith A2 have x∈X and y∈X by autowith A3 hx∈Ai hy∈Ai haverestrict(f,A×A)hx,yi = restrict(f,A×A)hy,xi
using IsCommutative_def restrict_if by simp }then show thesis using IsCommutative_def by simp
qed

Next we define what it means that a set is closed with respect to an operation.
definition
IsOpClosed (infix {is closed under} 65) whereA {is closed under} f ≡ ∀ x∈A. ∀ y∈A. fhx,yi ∈ A

Associative operation restricted to a set that is closed with resp. to thisoperation is associative.
lemma func_ZF_4_L2:assumes A1: f {is associative on} X
and A2: A⊆X and A3: A {is closed under} f
and A4: x∈A y∈A z∈A
and A5: g = restrict(f,A×A)
shows ghghx,yi,zi = ghx,ghy,zii
proof from A4 A2 have I: x∈X y∈X z∈X
by autofrom A3 A4 A5 haveghghx,yi,zi = fhfhx,yi,zi
ghx,ghy,zii = fhx,fhy,zii
using IsOpClosed_def restrict_if by auto
moreover from A1 I havefhfhx,yi,zi = fhx,fhy,zii
using IsAssociative_def by simp
ultimately show thesis by simp

96

qed

An associative operation restricted to a set that is closed with resp. to thisoperation is associative on the set.
lemma func_ZF_4_L3: assumes A1: f {is associative on} X
and A2: A⊆X and A3: A {is closed under} fshows restrict(f,A×A) {is associative on} A
proof let g = restrict(f,A×A)
from A1 have f:X×X→X
using IsAssociative_def by simp
moreover from A2 have A×A ⊆ X×X by auto
moreover from A3 have ∀ p ∈ A×A. g(p) ∈ A
using IsOpClosed_def restrict_if by auto
ultimately have g : A×A→A
using func1_2_L4 by simp
moreover from A1 A2 A3 have∀ x ∈ A. ∀ y ∈ A. ∀ z ∈ A.
ghghx,yi,zi = gh x,ghy,zii
using func_ZF_4_L2 by simp
ultimately show thesis
using IsAssociative_def by simp
qed

The essential condition to show that if a set A is closed with respect to an
operation, then it is closed under this operation restricted to any supersetof A.
lemma func_ZF_4_L4: assumes A {is closed under} f
and A⊆B and x∈A y∈A and g = restrict(f,B×B)
shows ghx,yi ∈ Ausing assms IsOpClosed_def restrict by auto

If a set A is closed under an operation, then it is closed under this operation
restricted to any superset of A.
lemma func_ZF_4_L5:
assumes A1: A {is closed under} f
and A2: A⊆B
shows A {is closed under} restrict(f,B×B)
proof let g = restrict(f,B×B)
from A1 A2 have ∀ x∈A. ∀ y∈A. ghx,yi ∈ Ausing func_ZF_4_L4 by simp
then show thesis using IsOpClosed_def by simp
qed

The essential condition to show that intersection of sets that are closed withrespect to an operation is closed with respect to the operation.
lemma func_ZF_4_L6:

97

assumes A {is closed under} f
and B {is closed under} fand x ∈ A∩B y∈ A∩B
shows fhx,yi ∈ A∩B using assms IsOpClosed_def by auto

Intersection of sets that are closed with respect to an operation is closed
under the operation.
lemma func_ZF_4_L7:
assumes A {is closed under} f
B {is closed under} fshows A∩B {is closed under} fusing assms IsOpClosed_def by simp

10.4

Compositions

For any set X we can consider a binary operation on the set of functions f :X → X defined by C(f, g) = f ◦ g. Composition of functions (or relations)is defined in the standard Isabelle distribution as a higher order function
and denoted with the letter O. In this section we consider the corresponding
two-argument ZF-function (binary operation), that is a subset of ((X →X) × (X → X)) × (X → X).
We define the notion of composition on the set X as the binary operationon the function space X → X that takes two functions and creates the theircomposition.
definition
Composition(X) ≡{hp,fst(p) O snd(p)i. p ∈ (X→X)×(X→X)}

Composition operation is a function that maps (X → X) × (X → X) into
X → X.
lemma func_ZF_5_L1: shows Composition(X) : (X→X)×(X→X)→(X→X)
using comp_fun Composition_def ZF_fun_from_total by simp

The value of the composition operation is the composition of arguments.
lemma func_ZF_5_L2: assumes f:X→X and g:X→X
shows Composition(X)hf,gi = f O g
proof from assms have
Composition(X) : (X→X)×(X→X)→(X→X)
hf,gi ∈ (X→X)×(X→X)
Composition(X) = {hp,fst(p) O snd(p)i. p ∈ (X→X)×(X→X)}
using func_ZF_5_L1 Composition_def by auto
then show Composition(X)hf,gi = f O gusing ZF_fun_from_tot_val by autoqedWhat is the value of a composition on an argument?
98lemma func_ZF_5_L3: assumes f:X→X and g:X→X and x∈Xshows (Composition(X)hf,gi)(x) = f(g(x))
using assms func_ZF_5_L2 comp_fun_apply by simp

The essential condition to show that composition is associative.
lemma func_ZF_5_L4: assumes A1: f:X→X g:X→X h:X→X
and A2: C = Composition(X)shows ChChf,gi,hi = Ch f,Chg,hii
proof from A2 have C : ((X→X)×(X→X))→(X→X)
using func_ZF_5_L1 by simp
with A1 have I:
Chf,gi : X→X
Chg,hi : X→X
ChChf,gi,hi : X→X
Ch f,Chg,hii : X→X
using apply_funtype by auto
moreover have∀ x ∈ X. ChChf,gi,hi(x) = Chf,Chg,hii(x)proof
fix x assume x∈Xwith A1 A2 I have
ChChf,gi,hi (x) = f(g(h(x)))
Ch f,Chg,hii(x) = f(g(h(x)))
using func_ZF_5_L3 apply_funtype by auto
then show ChChf,gi,hi(x) = Ch f,Chg,hii(x)by simpqed
ultimately show thesis using fun_extension_iff by simp
qedComposition is an associative operation on X → X (the space of functions
that map X into itself).
lemma func_ZF_5_L5: shows Composition(X) {is associative on} (X→X)
proof let C = Composition(X)have ∀ f∈X→X. ∀ g∈X→X. ∀ h∈X→X.
ChChf,gi,hi = Chf,Chg,hii
using func_ZF_5_L4 by simp
then show thesis using func_ZF_5_L1 IsAssociative_def
by simpqed

10.5

Identity function

In this section we show some additional facts about the identity function
defined in the standard Isabelle’s Perm theory.
A function that maps every point to itself is the identity on its domain.
99

lemma indentity_fun: assumes A1: f:X→Y and A2:∀ x∈X. f(x)=x
shows f = id(X)proof from assms have f:X→Y and id(X):X→X and ∀ x∈X. f(x) = id(X)(x)using id_type id_conv by auto
then show thesis by (rule func_eq)
qed

Composing a function with identity does not change the function.
lemma func_ZF_6_L1A: assumes A1: f : X→X
shows Composition(X)hf,id(X)i = f
Composition(X)hid(X),fi = f
proof have Composition(X) : (X→X)×(X→X)→(X→X)
using func_ZF_5_L1 by simp
with A1 have Composition(X)hid(X),fi : X→X
Composition(X)hf,id(X)i : X→X
using id_type apply_funtype by auto
moreover note A1
moreover from A1 have
∀ x∈X. (Composition(X)hid(X),fi)(x) = f(x)∀ x∈X. (Composition(X)hf,id(X)i)(x) = f(x)using id_type func_ZF_5_L3 apply_funtype id_conv
by autoultimately show Composition(X)hid(X),fi = f
Composition(X)hf,id(X)i = fusing fun_extension_iff by autoqed

An intuitively clear, but surprsingly nontrivial fact:identity is the only function from a singleton to itself.
lemma singleton_fun_id: shows ({x} → {x}) = {id({x})}proofshow {id({x})} ⊆ ({x} → {x})using id_def by simp
{ let g = id({x})
fix f assume f : {x} → {x}then have f : {x} → {x} and g : {x} → {x}using id_def by auto
moreover from hf : {x} → {x}i have ∀ x ∈ {x}. f(x) = g(x)using apply_funtype id_def by auto
ultimately have f = g by (rule func_eq)} then show ({x} → {x}) ⊆ {id({x})} by autoqed

Another trivial fact: identity is the only bijection of a singleton with itself.
lemma single_bij_id: shows bij({x},{x}) = {id({x})}proofshow {id({x})} ⊆ bij({x},{x}) using id_bij

100

by simp{ fix f assume f ∈ bij({x},{x})then have f : {x} → {x} using bij_is_fun
by simpthen have f ∈ {id({x})} using singleton_fun_id
by simp} then show bij({x},{x}) ⊆ {id({x})} by autoqed

A kind of induction for the identity: if a function f is the identity on a set
with a fixpoint of f removed, then it is the indentity on the whole set.
lemma id_fixpoint_rem: assumes A1: f:X→X andA2: p∈X and A3: f(p) = p andA4: restrict(f, X-{p}) = id(X-{p})shows f = id(X)proof from A1 have f: X→X and id(X) : X→X
using id_def by auto
moreover{ fix x assume x∈X{ assume x ∈ X-{p}then have f(x) = restrict(f, X-{p})(x)using restrict by simp
with A4 hx ∈ X-{p}i have f(x) = x
using id_def by simp }with A2 A3 hx∈Xi have f(x) = x by auto
} then have ∀ x∈X. f(x) = id(X)(x)using id_def by simp
ultimately show f = id(X) by (rule func_eq)
qed

10.6

Lifting to subsets

Suppose we have a binary operation f : X × X → X written additively as
f hx, yi = x + y. Such operation naturally defines another binary operationon the subsets of X that satisfies A + B = {x + y : x ∈ A, y ∈ B}. This new
operation which we will call ”f lifted to subsets” inherits many properties off , such as associativity, commutativity and existence of the neutral element.
This notion is useful for considering interval arithmetics.
The next definition describes the notion of a binary operation lifted to subsets. It is written in a way that might be a bit unexpected, but really it is thesame as the intuitive definition, but shorter. In the definition we take a pairp ∈ P ow(X) × P ow(X), say p = hA, Bi, where A, B ⊆ X. Then we assign
this pair of sets the set {f hx, yi : x ∈ A, y ∈ B} = {f (x0 ) : x0 ∈ A × B} The
set on the right hand side is the same as the image of A × B under f . In thedefinition we don’t use A and B symbols, but write fst(p) and snd(p), resp.
Recall that in Isabelle/ZF fst(p) and snd(p) denote the first and second
101components of an ordered pair p. See the lemma lift_subsets_explained
for a more intuitive notation.
definition
Lift2Subsets (infix {lifted to subsets of} 65) wheref {lifted to subsets of} X ≡{hp, f(fst(p)×snd(p))i. p ∈ Pow(X)×Pow(X)}The lift to subsets defines a binary operation on the subsets.
lemma lift_subsets_binop: assumes A1: f : X × X → Yshows (f {lifted to subsets of} X) : Pow(X) × Pow(X) → Pow(Y)proof let F = {hp, f(fst(p)×snd(p))i. p ∈ Pow(X)×Pow(X)}from A1 have ∀ p ∈ Pow(X) × Pow(X). f(fst(p)×snd(p)) ∈ Pow(Y)using func1_1_L6 by simp
then have F : Pow(X) × Pow(X) → Pow(Y)by (rule ZF_fun_from_total)then show thesis unfolding Lift2Subsets_def by simp
qed

The definition of the lift to subsets rewritten in a more intuitive notation.
We would like to write the last assertion as FhA,Bi = {fhx,yi. x ∈ A, y ∈B}, but Isabelle/ZF does not allow such syntax.
lemma lift_subsets_explained: assumes A1: f : X×X → Y
and A2: A ⊆ X B ⊆ X and A3: F = f {lifted to subsets of} X
shows
FhA,Bi ⊆ Y and
FhA,Bi = f(A×B)
FhA,Bi = {f(p). p ∈ A×B}
FhA,Bi = {fhx,yi . hx,yi ∈ A×B}
proof let p = hA,Bifrom assms have
I: F : Pow(X) × Pow(X) → Pow(Y) and p ∈ Pow(X) × Pow(X)using lift_subsets_binop by auto
moreover from A3 have F = {hp, f(fst(p)×snd(p))i. p ∈ Pow(X)×Pow(X)}unfolding Lift2Subsets_def by simp
ultimately show FhA,Bi = f(A×B)
using ZF_fun_from_tot_val by auto
also
from A1 A2 have A×B ⊆ X×X by autowith A1 have f(A×B) = {f(p). p ∈ A×B}
by (rule func_imagedef)
finally show FhA,Bi = {f(p) . p ∈ A×B} by simp
also
have ∀ x∈A. ∀ y ∈ B. fhx,yi = fhx,yi by simp
then have {f(p). p ∈ A×B} = {fhx,yi. hx,yi ∈ A×B}
by (rule ZF1_1_L4A)
finally show FhA,Bi = {fhx,yi . hx,yi ∈ A×B}

102

by simp
from A2 I show FhA,Bi ⊆ Y using apply_funtype by blastqed

A sufficient condition for a point to belong to a result of lifting to subsets.
lemma lift_subset_suff: assumes A1: f : X × X → Y andA2: A ⊆ X B ⊆ X and A3: x∈A y∈B and
A4: F = f {lifted to subsets of} X
shows fhx,yi ∈ FhA,Bi
proof from A3 have fhx,yi ∈ {f(p) . p ∈ A×B} by auto
moreover from A1 A2 A4 have {f(p). p ∈ A×B} = FhA,Biusing lift_subsets_explained by simp
ultimately show fhx,yi ∈ FhA,Bi by simpqed

A kind of converse of lift_subset_apply, providing a necessary condition
for a point to be in the result of lifting to subsets.
lemma lift_subset_nec: assumes A1: f : X × X → Y andA2: A ⊆ X B ⊆ X andA3: F = f {lifted to subsets of} X andA4: z ∈ FhA,Bishows ∃ x y. x∈A ∧ y∈B ∧ z = fhx,yi
proof from A1 A2 A3 have FhA,Bi = {f(p). p ∈ A×B}
using lift_subsets_explained by simp
with A4 show thesis by autoqed

Lifting to subsets inherits commutativity.
lemma lift_subset_comm: assumes A1: f : X × X → Y andA2: f {is commutative on} X andA3: F = f {lifted to subsets of} X
shows F {is commutative on} Pow(X)proof have ∀ A ∈ Pow(X). ∀ B ∈ Pow(X). FhA,Bi = FhB,Ai
proof { fix A assume A ∈ Pow(X)fix B assume B ∈ Pow(X)have FhA,Bi = FhB,Ai
proof have ∀ z ∈ FhA,Bi. z ∈ FhB,Ai
proof
fix z assume I: z ∈ FhA,Bi
with A1 A3 hA ∈ Pow(X)i hB ∈ Pow(X)i have
∃ x y. x∈A ∧ y∈B ∧ z = fhx,yiusing lift_subset_nec by simp
then obtain x y where x∈A and y∈B and z = fhx,yi
by auto103

with A2 hA ∈ Pow(X)i hB ∈ Pow(X)i have z = fhy,xi
using IsCommutative_def by autowith A1 A3 I hA ∈ Pow(X)i hB ∈ Pow(X)i hx∈Ai hy∈Bishow z ∈ FhB,Ai using lift_subset_suff by simp
qed
moreover have ∀ z ∈ FhB,Ai. z ∈ FhA,Bi
proof
fix z assume I: z ∈ FhB,Ai
with A1 A3 hA ∈ Pow(X)i hB ∈ Pow(X)i have
∃ x y. x∈B ∧ y∈A ∧ z = fhx,yiusing lift_subset_nec by simp
then obtain x y where x∈B and y∈A and z = fhx,yi
by autowith A2 hA ∈ Pow(X)i hB ∈ Pow(X)i have z = fhy,xi
using IsCommutative_def by autowith A1 A3 I hA ∈ Pow(X)i hB ∈ Pow(X)i hx∈Bi hy∈Aishow z ∈ FhA,Bi using lift_subset_suff by simp
qed
ultimately show FhA,Bi = FhB,Ai by autoqed
} thus thesis by autoqed
then show F {is commutative on} Pow(X)unfolding IsCommutative_def by autoqed

Lifting to subsets inherits associativity. To show that F hhA, BiCi = F hA, F hB, Cii
we prove two inclusions and the proof of the second inclusion is very similar
to the proof of the first one.
lemma lift_subset_assoc: assumes A1: f : X × X → X andA2: f {is associative on} X andA3: F = f {lifted to subsets of} X
shows F {is associative on} Pow(X)proof from A1 A3 have F : Pow(X)×Pow(X) → Pow(X)using lift_subsets_binop by simp
moreover have ∀ A ∈ Pow(X).∀ B ∈ Pow(X). ∀ C ∈ Pow(X).
FhFhA,Bi,Ci = FhA,FhB,Cii
proof { fix A B C
assume A ∈ Pow(X) B ∈ Pow(X) C ∈ Pow(X)have FhFhA,Bi,Ci ⊆ FhA,FhB,Cii
proof
fix z assume I: z ∈ FhFhA,Bi,Cifrom A1 A3 hA ∈ Pow(X)i hB ∈ Pow(X)ihave FhA,Bi ∈ Pow(X)using lift_subsets_binop apply_funtype by blast
with A1 A3 hC ∈ Pow(X)i I have
∃ x y. x ∈ FhA,Bi ∧ y ∈ C ∧ z = fhx,yi

104using lift_subset_nec by simp
then obtain x y where
II: x ∈ FhA,Bi and y ∈ C and III: z = fhx,yi
by autofrom A1 A3 hA ∈ Pow(X)i hB ∈ Pow(X)i II have
∃ s t. s ∈ A ∧ t ∈ B ∧ x = fhs,tiusing lift_subset_nec by auto
then obtain s t where s∈A and t∈B and x = fhs,ti
by autowith A2 hA ∈ Pow(X)i hB ∈ Pow(X)i hC ∈ Pow(X)i III
hs∈Ai ht∈Bi hy∈Ci have IV: z = fhs, fht,yii
using IsAssociative_def by blastfrom A1 A3 hB ∈ Pow(X)i hC ∈ Pow(X)i ht∈Bi hy∈Cihave fht,yi ∈ FhB,Ci using lift_subset_suff by simp
moreover from A1 A3 hB ∈ Pow(X)i hC ∈ Pow(X)ihave FhB,Ci ⊆ X using lift_subsets_binop apply_funtype
by blast
moreover note A1 A3 hA ∈ Pow(X)i hs∈Ai IV
ultimately show z ∈ FhA,FhB,Cii
using lift_subset_suff by simp
qed
moreover have FhA,FhB,Cii ⊆ FhFhA,Bi,Ci
proof
fix z assume I: z ∈ FhA,FhB,Cii
from A1 A3 hB ∈ Pow(X)i hC ∈ Pow(X)ihave FhB,Ci ∈ Pow(X)using lift_subsets_binop apply_funtype by blast
with A1 A3 hA ∈ Pow(X)i I have
∃ x y. x ∈ A ∧ y ∈ FhB,Ci ∧ z = fhx,yiusing lift_subset_nec by simp
then obtain x y wherex ∈ A and II: y ∈ FhB,Ci and III: z = fhx,yi
by autofrom A1 A3 hB ∈ Pow(X)i hC ∈ Pow(X)i II have
∃ s t. s ∈ B ∧ t ∈ C ∧ y = fhs,tiusing lift_subset_nec by auto
then obtain s t where s∈B and t∈C and y = fhs,ti
by autowith III have z = fhx,fhs,tii by simp
moreover from A2 hA ∈ Pow(X)i hB ∈ Pow(X)i hC ∈ Pow(X)ihx∈Ai hs∈Bi ht∈Ci have fhfhx,si,ti = fhx,fhs,tii
using IsAssociative_def by blast
ultimately have IV: z = fhfhx,si,ti by simp
from A1 A3 hA ∈ Pow(X)i hB ∈ Pow(X)i hx∈Ai hs∈Bi
have fhx,si ∈ FhA,Bi using lift_subset_suff by simp
moreover from A1 A3 hA ∈ Pow(X)i hB ∈ Pow(X)ihave FhA,Bi ⊆ X using lift_subsets_binop apply_funtype
by blast
moreover note A1 A3 hC ∈ Pow(X)i ht∈Ci IV

105

ultimately show z ∈ FhFhA,Bi,Ciusing lift_subset_suff by simp
qed
ultimately have FhFhA,Bi,Ci = FhA,FhB,Cii by auto
} thus thesis by autoqed
ultimately show thesis unfolding IsAssociative_def
by autoqed

10.7

Distributive operations

In this section we deal with pairs of operations such that one is distributive
with respect to the other, that is a·(b+c) = a·b+a·c and (b+c)·a = b·a+c·a.
We show that this property is preserved under restriction to a set closedwith respect to both operations. In EquivClass1 theory we show that thisproperty is preserved by projections to the quotient space if both operations
are congruent with respect to the equivalence relation.
We define distributivity as a statement about three sets. The first set is theset on which the operations act. The second set is the additive operation (aZF function) and the third is the multiplicative operation.
definition
IsDistributive(X,A,M) ≡ (∀ a∈X.∀ b∈X.∀ c∈X.
Mha,Ahb,cii = AhMha,bi,Mha,cii ∧MhAhb,ci,ai = AhMhb,ai,Mhc,ai i)

The essential condition to show that distributivity is preserved by restrictions to sets that are closed with respect to both operations.
lemma func_ZF_7_L1:
assumes A1: IsDistributive(X,A,M)
and A2: Y⊆X
and A3: Y {is closed under} A Y {is closed under} M
and A4: Ar = restrict(A,Y×Y) Mr = restrict(M,Y×Y)
and A5: a∈Y b∈Y c∈Yshows Mr h a,Ar hb,ci i = Ar h Mr ha,bi,Mr ha,ci i ∧Mr h Ar hb,ci,a i = Ar h Mr hb,ai, Mr hc,ai i
proof from A3 A5 have Ahb,ci ∈ Y Mha,bi ∈ Y Mha,ci ∈ Y
Mhb,ai ∈ Y Mhc,ai ∈ Y using IsOpClosed_def by autowith A5 A4 have
Ar hb,ci ∈ Y Mr ha,bi ∈ Y Mr ha,ci ∈ Y
Mr hb,ai ∈ Y Mr hc,ai ∈ Yusing restrict by autowith A1 A2 A4 A5 show thesis
using restrict IsDistributive_def by auto
qed

106

Distributivity is preserved by restrictions to sets that are closed with respect
to both operations.
lemma func_ZF_7_L2:
assumes IsDistributive(X,A,M)
and Y⊆X
and Y {is closed under} A
Y {is closed under} M
and Ar = restrict(A,Y×Y) Mr = restrict(M,Y×Y)
shows IsDistributive(Y,Ar ,Mr )proof from assms have ∀ a∈Y.∀ b∈Y.∀ c∈Y.
Mr h a,Ar hb,ci i = Ar h Mr ha,bi,Mr ha,ci i ∧Mr h Ar hb,ci,a i = Ar h Mr hb,ai,Mr hc,aii
using func_ZF_7_L1 by simp
then show thesis using IsDistributive_def by simp
qed

end

11

More on functions

theory func_ZF_1 imports ZF.Order Order_ZF_1a func_ZF
begin

In this theory we consider some properties of functions related to orderrelations

11.1

Functions and orderThis section deals with functions between ordered sets.
If every value of a function on a set is bounded below by a constant, thenthe image of the set is bounded below.
lemma func_ZF_8_L1:
assumes f:X→Y and A⊆X and ∀ x∈A. hL,f(x)i ∈ rshows IsBoundedBelow(f(A),r)
proof from assms have ∀ y ∈ f(A). hL,yi ∈ rusing func_imagedef by simp
then show IsBoundedBelow(f(A),r)by (rule Order_ZF_3_L9)
qed

If every value of a function on a set is bounded above by a constant, thenthe image of the set is bounded above.
107

lemma func_ZF_8_L2:
assumes f:X→Y and A⊆X and ∀ x∈A. hf(x),Ui ∈ rshows IsBoundedAbove(f(A),r)
proof from assms have ∀ y ∈ f(A). hy,Ui ∈ rusing func_imagedef by simp
then show IsBoundedAbove(f(A),r)by (rule Order_ZF_3_L10)
qed

Identity is an order isomorphism.
lemma id_ord_iso: shows id(X) ∈ ord_iso(X,r,X,r)using id_bij id_def ord_iso_def by simp

Identity is the only order automorphism of a singleton.
lemma id_ord_auto_singleton:shows ord_iso({x},r,{x},r) = {id({x})}using id_ord_iso ord_iso_def single_bij_id
by autoThe image of a maximum by an order isomorphism is a maximum. Notethat from the fact the r is antisymmetric and f is an order isomorphism
between (A, r) and (B, R) we can not conclude that R is antisymmetric (wecan only show that R ∩ (B × B) is).
lemma max_image_ord_iso:assumes A1: antisym(r) and A2: antisym(R) andA3: f ∈ ord_iso(A,r,B,R) andA4: HasAmaximum(r,A)
shows HasAmaximum(R,B) and Maximum(R,B) = f(Maximum(r,A))
proof let M = Maximum(r,A)
from A1 A4 have M ∈ A using Order_ZF_4_L3 by simp
from A3 have f:A→B using ord_iso_def bij_is_fun
by simpwith hM ∈ Ai have I: f(M) ∈ B
using apply_funtype by simp
{ fix y assume y ∈ B
let x = converse(f)(y)from A3 have converse(f) ∈ ord_iso(B,R,A,r)using ord_iso_sym by simp
then have converse(f): B → A
using ord_iso_def bij_is_fun by simp
with hy ∈ Bi have x ∈ A
by simpwith A1 A3 A4 hx ∈ Ai hM ∈ Ai have hf(x), f(M)i ∈ R
using Order_ZF_4_L3 ord_iso_apply by simp
with A3 hy ∈ Bi have hy, f(M)i ∈ R
using right_inverse_bij ord_iso_def by auto108

} then have II: ∀ y ∈ B. hy, f(M)i ∈ R by simp
with A2 I show Maximum(R,B) = f(M)by (rule Order_ZF_4_L14)
from I II show HasAmaximum(R,B)
using HasAmaximum_def by autoqed

Maximum is a fixpoint of order automorphism.
lemma max_auto_fixpoint:
assumes antisym(r) and f ∈ ord_iso(A,r,A,r)and HasAmaximum(r,A)
shows Maximum(r,A) = f(Maximum(r,A))
using assms max_image_ord_iso by blast

If two sets are order isomorphic and we remove x and f (x), respectively,from the sets, then they are still order isomorphic.
lemma ord_iso_rem_point:
assumes A1: f ∈ ord_iso(A,r,B,R) and A2: a ∈ Ashows restrict(f,A-{a}) ∈ ord_iso(A-{a},r,B-{f(a)},R)
proof let f0 = restrict(f,A-{a})have A-{a} ⊆ A by autowith A1 have f0 ∈ ord_iso(A-{a},r,f(A-{a}),R)
using ord_iso_restrict_image by simp
moreoverfrom A1 have f ∈ inj(A,B)
using ord_iso_def bij_def by simp
with A2 have f(A-{a}) = f(A) - f{a}using inj_image_dif by simp
moreover from A1 have f(A) = B
using ord_iso_def bij_def surj_range_image_domain
by automoreoverfrom A1 have f: A→B
using ord_iso_def bij_is_fun by simp
with A2 have f{a} = {f(a)}using singleton_image by simp
ultimately show thesis by simp
qed

If two sets are order isomorphic and we remove maxima from the sets, thenthey are still order isomorphic.
corollary ord_iso_rem_max:
assumes A1: antisym(r) and f ∈ ord_iso(A,r,B,R) andA4: HasAmaximum(r,A) and A5: M = Maximum(r,A)
shows restrict(f,A-{M}) ∈ ord_iso(A-{M}, r, B-{f(M)},R)
using assms Order_ZF_4_L3 ord_iso_rem_point by simp

Lemma about extending order isomorphisms by adding one point to the109domain.
lemma ord_iso_extend: assumes A1: f ∈ ord_iso(A,r,B,R) andA2: MA ∈/ A MB ∈/ B andA3: ∀ a∈A. ha, MA i ∈ r ∀ b∈B. hb, MB i ∈ R and
A4: antisym(r) antisym(R) andA5: hMA ,MA i ∈ r ←→ hMB ,MB i ∈ Rshows f ∪ {h MA ,MB i} ∈ ord_iso(A∪{MA } ,r,B∪{MB } ,R)
proof let g = f ∪ {h MA ,MB i}from A1 A2 haveg : A∪{MA } → B∪{MB } andI: ∀ x∈A. g(x) = f(x) and II: g(MA ) = MBusing ord_iso_def bij_def inj_def func1_1_L11D
by autofrom A1 A2 have g ∈ bij(A∪{MA },B∪{MB })using ord_iso_def bij_extend_point by simp
moreover have ∀ x ∈ A∪{MA }. ∀ y ∈ A∪{MA }.
hx,yi ∈ r ←→ hg(x), g(y)i ∈ R
proof { fix x yassume x ∈ A∪{MA } and y ∈ A∪{MA }then have x∈A ∧ y ∈ A ∨ x∈A ∧ y = MA ∨x = MA ∧ y ∈ A ∨ x = MA ∧ y = MA
by automoreover{ assume x∈A ∧ y ∈ Awith A1 I have hx,yi ∈ r ←→ hg(x), g(y)i ∈ R
using ord_iso_def by simp }moreover{ assume x∈A ∧ y = MAwith A1 A3 I II have hx,yi ∈ r ←→ hg(x), g(y)i ∈ R
using ord_iso_def bij_def inj_def apply_funtype
by auto }moreover{ assume x = MA ∧ y ∈ Awith A2 A3 A4 have hx,yi ∈/ rusing antisym_def by auto
moreover{ assume A6: hg(x), g(y)i ∈ Rfrom A1 I II hx = MA ∧ y ∈ Ai have
III: g(y) ∈ B g(x) = MBusing ord_iso_def bij_def inj_def apply_funtype
by autowith A3 have hg(y), g(x)i ∈ R by simp
with A4 A6 have g(y) = g(x) using antisym_def
by autowith A2 III have False by simp
} hence hg(x), g(y)i ∈/ R by auto
ultimately have hx,yi ∈ r ←→ hg(x), g(y)i ∈ R

110

by simp }moreover{ assume x = MA ∧ y = MAwith A5 II have hx,yi ∈ r ←→ hg(x), g(y)i ∈ R
by simp }
ultimately have hx,yi ∈ r ←→ hg(x), g(y)i ∈ R
by auto} thus thesis by autoqed
ultimately show thesis using ord_iso_def
by simpqed

A kind of converse to ord_iso_rem_max: if two linearly ordered sets sets areorder isomorphic after removing the maxima, then they are order isomorphic.
lemma rem_max_ord_iso:assumes A1: IsLinOrder(X,r) IsLinOrder(Y,R) andA2: HasAmaximum(r,X) HasAmaximum(R,Y)
ord_iso(X - {Maximum(r,X)},r,Y - {Maximum(R,Y)},R) 6= 0
shows ord_iso(X,r,Y,R) 6= 0
proof let MA = Maximum(r,X)
let A = X - {MA }let MB = Maximum(R,Y)
let B = Y - {MB }from A2 obtain f where f ∈ ord_iso(A,r,B,R)
by automoreover have MA ∈/ A and MB ∈/ B
by automoreover from A1 A2 have
∀ a∈A. ha,MA i ∈ r and ∀ b∈B. hb,MB i ∈ R
using IsLinOrder_def Order_ZF_4_L3 by auto
moreover from A1 have antisym(r) and antisym(R)using IsLinOrder_def by auto
moreover from A1 A2 have hMA ,MA i ∈ r ←→ hMB ,MB i ∈ R
using IsLinOrder_def Order_ZF_4_L3 IsLinOrder_def
total_is_refl refl_def by auto
ultimately havef ∪ {h MA ,MB i} ∈ ord_iso(A∪{MA } ,r,B∪{MB } ,R)by (rule ord_iso_extend)moreover from A1 A2 haveA∪{MA } = X and B∪{MB } = Y
using IsLinOrder_def Order_ZF_4_L3 by auto
ultimately show ord_iso(X,r,Y,R) 6= 0
using ord_iso_extend by auto
qed

111

11.2

Projections in cartesian products

In this section we consider maps arising naturally in cartesian products.
There is a natural bijection etween X = Y × {y} (a ”slice”) and Y . We willcall this the SliceProjection(Y×{y}). This is really the ZF equivalent of
the meta-function fst(x).
definition
SliceProjection(X) ≡ {hp,fst(p)i. p ∈ X }A slice projection is a bijection between X × {y} and X.
lemma slice_proj_bij: shows
SliceProjection(X×{y}): X×{y} → X
domain(SliceProjection(X×{y})) = X×{y}∀ p∈X×{y}. SliceProjection(X×{y})(p) = fst(p)SliceProjection(X×{y}) ∈ bij(X×{y},X)
proof let P = SliceProjection(X×{y})have ∀ p ∈ X×{y}. fst(p) ∈ X by simp
moreover from this have
{hp,fst(p)i. p ∈ X×{y} } : X×{y} → X
by (rule ZF_fun_from_total)
ultimately show
I: P: X×{y} → X and II: ∀ p∈X×{y}. P(p) = fst(p)using ZF_fun_from_tot_val SliceProjection_def by autohence
∀ a ∈ X×{y}. ∀ b ∈ X×{y}. P(a) = P(b) −→ a=b
by autowith I have P ∈ inj(X×{y},X) using inj_def
by simpmoreover from II have ∀ x∈X. ∃ p∈X×{y}. P(p) = x
by simpwith I have P ∈ surj(X×{y},X) using surj_def
by simpultimately show P ∈ bij(X×{y},X)using bij_def by simp
from I show domain(SliceProjection(X×{y})) = X×{y}using func1_1_L1 by simp
qed

11.3

Induced relations and order isomorphisms

When we have two sets X, Y , function f : X → Y and a relation R on
Y we can define a relation r on X by saying that x r y if and only if
f (x) R f (y). This is especially interesting when f is a bijection as all
reasonable properties of R are inherited by r. This section treats mostly
the case when R is an order relation and f is a bijection. The standard
Isabelle’s Order theory defines the notion of a space of order isomorphisms
112between two sets relative to a relation. We expand that material provingthat order isomrphisms preserve interesting properties of the relation.
We call the relation created by a relation on Y and a mapping f : X → Y
the InducedRelation(f,R).
definition
InducedRelation(f,R) ≡{p ∈ domain(f)×domain(f). hf(fst(p)),f(snd(p))i ∈ R}

A reformulation of the definition of the relation induced by a function.
lemma def_of_ind_relA:assumes hx,yi ∈ InducedRelation(f,R)
shows hf(x),f(y)i ∈ R
using assms InducedRelation_def by simp

A reformulation of the definition of the relation induced by a function, kindof converse of def_of_ind_relA.
lemma def_of_ind_relB: assumes f:A→B andx∈A y∈A and hf(x),f(y)i ∈ Rshows hx,yi ∈ InducedRelation(f,R)
using assms func1_1_L1 InducedRelation_def by simp

A property of order isomorphisms that is missing from standard Isabelle’s
Order.thy.
lemma ord_iso_apply_conv:
assumes f ∈ ord_iso(A,r,B,R) andhf(x),f(y)i ∈ R and x∈A y∈Ashows hx,yi ∈ rusing assms ord_iso_def by simp

The next lemma tells us where the induced relation is definedlemma ind_rel_domain:
assumes R ⊆ B×B and f:A→Bshows InducedRelation(f,R) ⊆ A×A
using assms func1_1_L1 InducedRelation_def
by autoA bijection is an order homomorphisms between a relation and the inducedone.
lemma bij_is_ord_iso: assumes A1: f ∈ bij(A,B)
shows f ∈ ord_iso(A,InducedRelation(f,R),B,R)
proof let r = InducedRelation(f,R){ fix x y assume A2: x∈A y∈A
have hx,yi ∈ r ←→ hf(x),f(y)i ∈ R
proofassume hx,yi ∈ r then show hf(x),f(y)i ∈ R

113using def_of_ind_relA by simp
next assume hf(x),f(y)i ∈ Rwith A1 A2 show hx,yi ∈ rusing bij_is_fun def_of_ind_relB by blastqed }with A1 show f ∈ ord_iso(A,InducedRelation(f,R),B,R)
using ord_isoI by simp
qed

An order isomoprhism preserves antisymmetry.
lemma ord_iso_pres_antsym: assumes A1: f ∈ ord_iso(A,r,B,R) andA2: r ⊆ A×A and A3: antisym(R)shows antisym(r)proof { fix x yassume A4: hx,yi ∈ rhy,xi ∈ rfrom A1 have f ∈ inj(A,B)
using ord_iso_is_bij bij_is_inj by simp
moreoverfrom A1 A2 A4 havehf(x), f(y)i ∈ R and hf(y), f(x)i ∈ R
using ord_iso_apply by autowith A3 have f(x) = f(y) by (rule Fol1_L4)
moreover from A2 A4 have x∈A y∈A by auto
ultimately have x=y by (rule inj_apply_equality)} then have ∀ x y. hx,yi ∈ r ∧ hy,xi ∈ r −→ x=y by auto
then show antisym(r) using imp_conj antisym_def
by simpqed

Order isomoprhisms preserve transitivity.
lemma ord_iso_pres_trans: assumes A1: f ∈ ord_iso(A,r,B,R) andA2: r ⊆ A×A and A3: trans(R)shows trans(r)proof { fix x y z
assume A4: hx, yi ∈ rhy, zi ∈ rnote A1
moreoverfrom A1 A2 A4 havehf(x), f(y)i ∈ R ∧ hf(y), f(z)i ∈ R
using ord_iso_apply by autowith A3 have hf(x),f(z)i ∈ R by (rule Fol1_L3)
moreover from A2 A4 have x∈A z∈A by auto
ultimately have hx, zi ∈ r using ord_iso_apply_conv
by simp} then have ∀ x y z. hx, yi ∈ r ∧ hy, zi ∈ r −→ hx, zi ∈ rby blast
then show trans(r) by (rule Fol1_L2)

114

qed

Order isomorphisms preserve totality.
lemma ord_iso_pres_tot: assumes A1: f ∈ ord_iso(A,r,B,R) andA2: r ⊆ A×A and A3: R {is total on} Bshows r {is total on} A
proof { fix x yassume x∈A y∈A hx,yi ∈/ rwith A1 have hf(x),f(y)i ∈/ R using ord_iso_apply_conv
by automoreoverfrom A1 have f:A→B using ord_iso_is_bij bij_is_fun
by simpwith A3 hx∈Ai hy∈Ai havehf(x),f(y)i ∈ R ∨ hf(y),f(x)i ∈ R
using apply_funtype IsTotal_def by simp
ultimately have hf(y),f(x)i ∈ R by simp
with A1 hx∈Ai hy∈Ai have hy,xi ∈ rusing ord_iso_apply_conv by simp
} then have ∀ x∈A. ∀ y∈A. hx,yi ∈ r ∨ hy,xi ∈ rby blast
then show r {is total on} A using IsTotal_def
by simpqed

Order isomorphisms preserve linearity.
lemma ord_iso_pres_lin: assumes f ∈ ord_iso(A,r,B,R) andr ⊆ A×A and IsLinOrder(B,R)
shows IsLinOrder(A,r)
using assms ord_iso_pres_antsym ord_iso_pres_trans ord_iso_pres_tot
IsLinOrder_def by simp

If a relation is a linear order, then the relation induced on another set by abijection is also a linear order.
lemma ind_rel_pres_lin:
assumes A1: f ∈ bij(A,B) and A2: IsLinOrder(B,R)
shows IsLinOrder(A,InducedRelation(f,R))
proof let r = InducedRelation(f,R)
from A1 have f ∈ ord_iso(A,r,B,R) and r ⊆ A×A
using bij_is_ord_iso domain_of_bij InducedRelation_def
by autowith A2 show IsLinOrder(A,r) using ord_iso_pres_lin
by simpqed

The image by an order isomorphism of a bounded above and nonempty set
is bounded above.
115

lemma ord_iso_pres_bound_above:
assumes A1: f ∈ ord_iso(A,r,B,R) and A2: r ⊆ A×A and
A3: IsBoundedAbove(C,r)
C6=0
shows IsBoundedAbove(f(C),R)
f(C) 6= 0
proof from A3 obtain u where I: ∀ x∈C. hx,ui ∈ rusing IsBoundedAbove_def by autofrom A1 have f:A→B using ord_iso_is_bij bij_is_fun
by simpfrom A2 A3 have C⊆A using Order_ZF_3_L1A by blastfrom A3 obtain x where x∈C by autowith A2 I have u∈A by auto
{ fix y assume y ∈ f(C)with hf:A→Bi hC⊆Ai obtain x where x∈C and y = f(x)using func_imagedef by autowith A1 I hC⊆Ai hu∈Ai have hy,f(u)i ∈ R
using ord_iso_apply by auto
} then have ∀ y ∈ f(C). hy,f(u)i ∈ R by simp
then show IsBoundedAbove(f(C),R) by (rule Order_ZF_3_L10)
from A3 hf:A→Bi hC⊆Ai show f(C) 6= 0 using func1_1_L15A
by simpqed

Order isomorphisms preserve the property of having a minimum.
lemma ord_iso_pres_has_min:assumes A1: f ∈ ord_iso(A,r,B,R) and A2: r ⊆ A×A andA3: C⊆A and A4: HasAminimum(R,f(C))
shows HasAminimum(r,C)
proof from A4 obtain m where
I: m ∈ f(C) and II: ∀ y ∈ f(C). hm,yi ∈ R
using HasAminimum_def by auto
let k = converse(f)(m)from A1 have f:A→B using ord_iso_is_bij bij_is_fun
by simpfrom A1 have f ∈ inj(A,B) using ord_iso_is_bij bij_is_inj
by simpwith A3 I have k ∈ C and III: f(k) = m
using inj_inv_back_in_set by auto
moreover{ fix x assume A5: x∈Cwith A3 II hf:A→Bi hk ∈ Ci III havek ∈ Ax∈A hf(k),f(x)i ∈ R
using func_imagedef by autowith A1 have hk,xi ∈ r using ord_iso_apply_conv
by simp} then have ∀ x∈C. hk,xi ∈ r by simp
ultimately show HasAminimum(r,C) using HasAminimum_def by auto
qed

116

Order isomorhisms preserve the images of relations. In other words taking
the image of a point by a relation commutes with the function.
lemma ord_iso_pres_rel_image:assumes A1: f ∈ ord_iso(A,r,B,R) andA2: r ⊆ A×A R ⊆ B×B andA3: a∈A
shows f(r{a}) = R{f(a)}prooffrom A1 have f:A→B using ord_iso_is_bij bij_is_fun
by simpmoreover from A2 A3 have I: r{a} ⊆ A by auto
ultimately have I: f(r{a}) = {f(x). x ∈ r{a} }using func_imagedef by simp
{ fix y assume A4: y ∈ f(r{a})with I obtain x wherex ∈ r{a} and II: y = f(x)by autowith A1 A2 have hf(a),f(x)i ∈ R using ord_iso_apply
by autowith II have y ∈ R{f(a)} by auto
} then show f(r{a}) ⊆ R{f(a)} by auto
{ fix y assume A5: y ∈ R{f(a)}let x = converse(f)(y)from A2 A5 havehf(a),yi ∈ R f(a) ∈ B and IV: y∈B
by autowith A1 have III: hconverse(f)(f(a)),xi ∈ rusing ord_iso_converse by simp
moreover from A1 A3 have converse(f)(f(a)) = a
using ord_iso_is_bij left_inverse_bij by blast
ultimately have f(x) ∈ {f(x). x ∈ r{a} }by automoreover from A1 IV have f(x) = yusing ord_iso_is_bij right_inverse_bij by blast
moreover from A1 I have f(r{a}) = {f(x). x ∈ r{a} }using ord_iso_is_bij bij_is_fun func_imagedef by blast
ultimately have y ∈ f(r{a}) by simp
} then show R{f(a)} ⊆ f(r{a}) by auto
qed

Order isomorphisms preserve collections of upper bounds.
lemma ord_iso_pres_up_bounds:
assumes A1: f ∈ ord_iso(A,r,B,R) andA2: r ⊆ A×A R ⊆ B×B and
A3: C⊆A
shows {f(r{a}). a∈C} = {R{b}. b ∈ f(C)}prooffrom A1 have f:A→B
using ord_iso_is_bij bij_is_fun by simp117

{ fix Y assume Y ∈ {f(r{a}). a∈C}then obtain a where a∈C and I: Y = f(r{a})by autofrom A3 ha∈Ci have a∈A by autowith A1 A2 have f(r{a}) = R{f(a)}using ord_iso_pres_rel_image by simp
moreover from A3 hf:A→Bi ha∈Ci have f(a) ∈ f(C)using func_imagedef by auto
ultimately have f(r{a}) ∈ { R{b}. b ∈ f(C) }by autowith I have Y ∈ { R{b}. b ∈ f(C) } by simp
} then show {f(r{a}). a∈C} ⊆ {R{b}. b ∈ f(C)}by blast{ fix Y assume Y ∈ {R{b}. b ∈ f(C)}then obtain b where b ∈ f(C) and II: Y = R{b}by autowith A3 hf:A→Bi obtain a where a∈C and b = f(a)using func_imagedef by autowith A3 II have a∈A and Y = R{f(a)} by autowith A1 A2 have Y = f(r{a})using ord_iso_pres_rel_image by simp
with ha∈Ci have Y ∈ {f(r{a}). a∈C} by auto
} then show {R{b}. b ∈ f(C)} ⊆ {f(r{a}). a∈C}
by autoqed

The image of the set of upper bounds is the set of upper bounds of theimage.
lemma ord_iso_pres_min_up_bounds:
assumes A1: f ∈ ord_iso(A,r,B,R) and A2: r ⊆ A×A
A3: C⊆A andT A4: C6=0
T
shows f( a∈C. r{a}) = ( b∈f(C). R{b})proof from A1 have f ∈ inj(A,B)
using ord_iso_is_bij bij_is_inj by simp
moreover note A4
moreover from A2 A3 have ∀ a∈C. r{a} ⊆ A by auto
ultimately
haveTTf( a∈C. r{a}) = (a∈C. f(r{a}) )using inj_image_of_Inter by simp
also T
from A1 A2 A3 have T(
a∈C. f(r{a}) ) = (b∈f(C). R{b} )using ord_iso_pres_up_bounds
by simpTT
finally show f( a∈C. r{a}) = ( b∈f(C). R{b})by simpqed

Order isomorphisms preserve completeness.
lemma ord_iso_pres_compl:

118

R ⊆ B×B andassumes A1: f ∈ ord_iso(A,r,B,R) andA2: r ⊆ A×A R ⊆ B×B and A3: R {is complete}
shows r {is complete}
proof { fix C
assume A4: IsBoundedAbove(C,r) C6=0
with A1 A2 A3 haveT
HasAminimum(R, b ∈ f(C). R{b})using ord_iso_pres_bound_above IsComplete_def
by simpmoreoverfrom A2 hIsBoundedAbove(C,r)i have I: C ⊆ A using Order_ZF_3_L1A
by blastTTwith A1 A2 hC6=0i have f( a∈C. r{a}) = ( b∈f(C). R{b})using ord_iso_pres_min_up_bounds
T by simp
ultimately have HasAminimum(R,f( a∈C. r{a}))by simpmoreoverfrom A2 have ∀ a∈C. r{a} ⊆ A
by autoTwith hC6=0i have (a∈C. r{a} ) ⊆ A using ZF1_1_L7
by simpmoreover note A1 A2
T
ultimately have HasAminimum(r,a∈C. r{a} )using ord_iso_pres_has_min by simp
} then show r {is complete} using IsComplete_def
by simpqed

If the original relation is complete, then the induced one is complete.
lemma ind_rel_pres_compl: assumes A1: f ∈ bij(A,B)
and A2: R ⊆ B×B and A3: R {is complete}
shows InducedRelation(f,R) {is complete}
proof let r = InducedRelation(f,R)
from A1 have f ∈ ord_iso(A,r,B,R)
using bij_is_ord_iso by simp
moreover from A1 A2 have r ⊆ A×A
using bij_is_fun ind_rel_domain by simp
moreover note A2 A3
ultimately show r {is complete}using ord_iso_pres_compl by simp
qed

end

119

12

Finite sets - introduction

theory Finite_ZF imports ZF1 Nat_ZF_IML ZF.Cardinal
beginStandard Isabelle Finite.thy contains a very useful notion of finite powerset:
the set of finite subsets of a given set. The definition, however, is specificto Isabelle and based on the notion of ”datatype”, obviously not something that belongs to ZF set theory. This theory file devolops the notionof finite powerset similarly as in Finite.thy, but based on standard library’s
Cardinal.thy. This theory file is intended to replace IsarMathLib’s Finite1
and Finite_ZF_1 theories that are currently derived from the ”datatype”
approach.

12.1

Definition and basic properties of finite powerset

The goal of this section is to prove an induction theorem about finite powersets: if the empty set has some property and this property is preservedby adding a single element of a set, then this property is true for all finite
subsets of this set.
We defined the finite powerset FinPow(X) as those elements of the powerset
that are finite.
definition
FinPow(X) ≡ {A ∈ Pow(X). Finite(A)}The cardinality of an element of finite powerset is a natural number.
lemma card_fin_is_nat: assumes A ∈ FinPow(X)shows |A| ∈ nat and A ≈ |A|using assms FinPow_def Finite_def cardinal_cong nat_into_Card
Card_cardinal_eq by auto

A reformulation of card_fin_is_nat: for a finit set A there is a bijection
between |A| and A.
lemma fin_bij_card: assumes A1: A ∈ FinPow(X)shows ∃ b. b ∈ bij(|A|, A)
proof from A1 have |A| ≈ A using card_fin_is_nat eqpoll_sym
by blast
then show thesis using eqpoll_def by autoqed

If a set has the same number of elements as n ∈ N, then its cardinality is n.
Recall that in set theory a natural number n is a set that has n elements.
lemma card_card: assumes A ≈ n and n ∈ nat120

shows |A| = nusing assms cardinal_cong nat_into_Card Card_cardinal_eq
by autoIf we add a point to a finite set, the cardinality increases by one. To understand the second assertion |A ∪ {a}| = |A| ∪ {|A|} recall that the cardinality|A| of A is a natural number and for natural numbers we have n+1 = n∪{n}.
lemma card_fin_add_one: assumes A1: A ∈ FinPow(X) and A2: a ∈ X-A
shows|A ∪ {a}| = succ( |A| )|A ∪ {a}| = |A| ∪ {|A|}proof from A1 A2 have cons(a,A) ≈ cons( |A|, |A| )using card_fin_is_nat mem_not_refl cons_eqpoll_cong
by automoreover have cons(a,A) = A ∪ {a} by (rule consdef)
moreover have cons( |A|, |A| ) = |A| ∪ {|A|}by (rule consdef)
ultimately have A∪{a} ≈ succ( |A| ) using succ_explainedby simpwith A1 show
|A ∪ {a}| = succ( |A| ) and |A ∪ {a}| = |A| ∪ {|A|}using card_fin_is_nat card_card by autoqed

We can decompose the finite powerset into collection of sets of the same
natural cardinalities.
lemma finpow_decomp: S
shows FinPow(X) = ( n ∈ nat. {A ∈ Pow(X). A ≈ n})using Finite_def FinPow_def by auto

Finite powerset is the union of sets of cardinality bounded by natural numbers.
lemma finpow_union_card_nat:
Sshows FinPow(X) = ( n ∈ nat. {A ∈ Pow(X). A . n})
proof S
have FinPow(X) ⊆ ( n ∈ nat. {A ∈ Pow(X). A . n})using finpow_decomp FinPow_def eqpoll_imp_lepoll
by automoreoverhaveS( n ∈ nat. {A ∈ Pow(X). A . n}) ⊆ FinPow(X)using lepoll_nat_imp_Finite FinPow_def by auto
ultimately show thesis by autoqed

A different form of finpow_union_card_nat (see above) - a subset that has
not more elements than a given natural number is in the finite powerset.
lemma lepoll_nat_in_finpow:

121

assumes n ∈ nat
A ⊆ X A . nshows A ∈ FinPow(X)using assms finpow_union_card_nat by auto

Natural numbers are finite subsets of the set of natural numbers.
lemma nat_finpow_nat: assumes n ∈ nat shows n ∈ FinPow(nat)using assms nat_into_Finite nat_subset_nat FinPow_def
by simpA finite subset is a finite subset of itself.
lemma fin_finpow_self: assumes A ∈ FinPow(X) shows A ∈ FinPow(A)using assms FinPow_def by autoIf we remove an element and put it back we get the set back.
lemma rem_add_eq: assumes a∈A shows (A-{a}) ∪ {a} = A
using assms by auto

Induction for finite powerset.
Fin_induct.

This is smilar to the standard Isabelle’s

theorem FinPow_induct: assumes A1: P(0) andA2: ∀ A ∈ FinPow(X). P(A) −→ (∀ a∈X. P(A ∪ {a})) andA3: B ∈ FinPow(X)shows P(B)proof { fix n assume n ∈ nat
moreover from A1 have I: ∀ B∈Pow(X). B . 0 −→ P(B)using lepoll_0_is_0 by auto
moreover have ∀ k ∈ nat.
(∀ B ∈ Pow(X). (B . k −→ P(B))) −→(∀ B ∈ Pow(X). (B . succ(k) −→ P(B)))
proof { fix k assume A4: k ∈ nat
assume A5: ∀ B ∈ Pow(X). (B . k −→ P(B))
fix B assume A6: B ∈ Pow(X) B . succ(k)have P(B)proof have B = 0 −→ P(B)proof { assume B = 0
then have B . 0 using lepoll_0_iff
by simpwith I A6 have P(B) by simp
} thus B = 0 −→ P(B) by simp
qed
moreover have B6=0 −→ P(B)proof { assume B 6= 0
then obtain a where II: a∈B by auto

122

let A = B - {a}from A6 II have A ⊆ X and A . kusing Diff_sing_lepoll by autowith A4 A5 have A ∈ FinPow(X) and P(A)using lepoll_nat_in_finpow finpow_decompby autowith A2 A6 II have P(A ∪ {a})by automoreover from II have A ∪ {a} = B
by autoultimately have P(B) by simp
} thus B6=0 −→ P(B) by simp
qed
ultimately show P(B) by autoqed
} thus thesis by blast
qed
ultimately have ∀ B ∈ Pow(X). (B . n −→ P(B))
by (rule ind_on_nat)} then have ∀ n ∈ nat. ∀ B ∈ Pow(X). (B . n −→ P(B))
by autowith A3 show P(B) using finpow_union_card_nat
by autoqed

A subset of a finite subset is a finite subset.
lemma subset_finpow: assumes A ∈ FinPow(X) and B ⊆ A
shows B ∈ FinPow(X)using assms FinPow_def subset_Finite by autoIf we subtract anything from a finite set, the resulting set is finite.
lemma diff_finpow:
assumes A ∈ FinPow(X) shows A-B ∈ FinPow(X)using assms subset_finpow by blast

If we remove a point from a finites subset, we get a finite subset.
corollary fin_rem_point_fin: assumes A ∈ FinPow(X)shows A - {a} ∈ FinPow(X)using assms diff_finpow by simp

Cardinality of a nonempty finite set is a successsor of some natural number.
lemma card_non_empty_succ:
assumes A1: A ∈ FinPow(X) and A2: A 6= 0
shows ∃ n ∈ nat. |A| = succ(n)proof from A2 obtain a where a ∈ A by auto
let B = A - {a}from A1 ha ∈ Ai have123B ∈ FinPow(X) and a ∈ X - B
using FinPow_def fin_rem_point_fin by auto
then have |B ∪ {a}| = succ( |B| )using card_fin_add_one by auto
moreover from ha ∈ Ai hB ∈ FinPow(X)i have
A = B ∪ {a} and |B| ∈ nat
using card_fin_is_nat by auto
ultimately show ∃ n ∈ nat. |A| = succ(n) by autoqed

Nonempty set has non-zero cardinality. This is probably true without theassumption that the set is finite, but I couldn’t derive it from standard
Isabelle theorems.
lemma card_non_empty_non_zero:
assumes A ∈ FinPow(X) and A 6= 0
shows |A| 6= 0
proof from assms obtain n where |A| = succ(n)using card_non_empty_succ by auto
then show |A| 6= 0 using succ_not_0
by simpqed

Another variation on the induction theme: If we can show something holds
for the empty set and if it holds for all finite sets with at most k elements
then it holds for all finite sets with at most k + 1 elements, the it holds for
all finite sets.
theorem FinPow_card_ind: assumes A1: P(0) andA2: ∀ k∈nat.
(∀ A ∈ FinPow(X). A . k −→ P(A)) −→(∀ A ∈ FinPow(X). A . succ(k) −→ P(A))
and A3: A ∈ FinPow(X) shows P(A)proof from A3 have |A| ∈ nat and A ∈ FinPow(X) and A . |A|using card_fin_is_nat eqpoll_imp_lepoll by auto
moreover have ∀ n ∈ nat. (∀ A ∈ FinPow(X).
A . n −→ P(A))
proof
fix n assume n ∈ nat
moreover from A1 have ∀ A ∈ FinPow(X). A . 0 −→ P(A)using lepoll_0_is_0 by auto
moreover note A2
ultimately show
∀ A ∈ FinPow(X). A . n −→ P(A)by (rule ind_on_nat)qed
ultimately show P(A) by simp
qed

124

Another type of induction (or, maybe recursion). In the induction step wetry to find a point in the set that if we remove it, the fact that the property
holds for the smaller set implies that the property holds for the whole set.
lemma FinPow_ind_rem_one: assumes A1: P(0) andA2: ∀ A ∈ FinPow(X). A 6= 0 −→ (∃ a∈A. P(A-{a}) −→ P(A))
and A3: B ∈ FinPow(X)shows P(B)proof note A1
moreover have ∀ k∈nat.
(∀ B ∈ FinPow(X). B . k −→ P(B)) −→(∀ C ∈ FinPow(X). C . succ(k) −→ P(C))
proof { fix k assume k ∈ nat
assume A4: ∀ B ∈ FinPow(X). B . k −→ P(B)have ∀ C ∈ FinPow(X). C . succ(k) −→ P(C)proof { fix C assume C ∈ FinPow(X)assume C . succ(k)note A1
moreover{ assume C 6= 0
with A2 hC ∈ FinPow(X)i obtain a wherea∈C and P(C-{a}) −→ P(C)by autowith A4 hC ∈ FinPow(X)i hC . succ(k)ihave P(C) using Diff_sing_lepoll fin_rem_point_fin
by simp }
ultimately have P(C) by auto
} thus thesis by simp
qed
} thus thesis by blast
qed
moreover note A3
ultimately show P(B) by (rule FinPow_card_ind)qed

Yet another induction theorem. This is similar, but slightly more complicated than FinPow_ind_rem_one. The difference is in the treatment of theempty set to allow to show properties that are not true for empty set.
lemma FinPow_rem_ind: assumes A1: ∀ A ∈ FinPow(X).
A = 0 ∨ (∃ a∈A. A = {a} ∨ P(A-{a}) −→ P(A))
and A2: A ∈ FinPow(X) and A3: A6=0
shows P(A)proof have 0 = 0 ∨ P(0) by simp
moreover have∀ k∈nat.

125

(∀ B ∈ FinPow(X). B . k −→ (B=0 ∨ P(B))) −→(∀ A ∈ FinPow(X). A . succ(k) −→ (A=0 ∨ P(A)))
proof { fix k assume k ∈ nat
assume A4: ∀ B ∈ FinPow(X). B . k −→ (B=0 ∨ P(B))
have ∀ A ∈ FinPow(X). A . succ(k) −→ (A=0 ∨ P(A))
proof { fix A assume A ∈ FinPow(X)assume A . succ(k) A6=0
from A1 hA ∈ FinPow(X)i hA6=0i obtain awhere a∈A and A = {a} ∨ P(A-{a}) −→ P(A)by autolet B = A-{a}from A4 hA ∈ FinPow(X)i hA . succ(k)i ha∈Ai
have B = 0 ∨ P(B)using Diff_sing_lepoll fin_rem_point_fin
by simpwith ha∈Ai hA = {a} ∨ P(A-{a}) −→ P(A)ihave P(A) by auto
} thus thesis by autoqed
} thus thesis by blast
qed
moreover note A2
ultimately have A=0 ∨ P(A) by (rule FinPow_card_ind)with A3 show P(A) by simp
qed

If a family of sets is closed with respect to taking intersections of two setsthen it is closed with respect to taking intersections of any nonempty finite
collection.
lemma inter_two_inter_fin:
assumes A1: ∀ V∈T. ∀ W∈T. V ∩ W ∈ T and
A2: N 6= T0 and A3: N ∈ FinPow(T)shows ( N ∈ T)
proof T
have 0 = 0 ∨ ( 0 ∈ T) by simpTmoreover have ∀ M ∈ FinPow(T).
(M = 0 ∨M ∈ T) −→T(∀ W ∈ T. M∪{W} = 0 ∨(M ∪ {W}) ∈ T)
proof { fix M assume M ∈ FinPow(T)Tassume A4: M = 0 ∨M ∈ T{ assume M = 0
Thence ∀ W ∈ T. M∪{W} = 0 ∨(M ∪ {W}) ∈ T
by auto }moreover{ assumeTM 6= 0
with A4 haveM ∈ T by simp
{ fix W assume W ∈ T

126

T
T
from hM 6= 0i have(M ∪ {W}) = ( M) ∩ W
by autoT
Twith A1 h M ∈ Ti hW ∈ Ti have(M ∪ {W}) ∈ T
by simpT} hence ∀ W ∈ T. M∪{W} = 0 ∨(M ∪ {W}) ∈ T
by simp }Tultimately have ∀ W ∈ T. M∪{W} = 0 ∨(M ∪ {W}) ∈ T
by blast} thus thesis by simp
qedi
moreover note hN ∈ FinPow(T)Tultimately have N = 0 ∨ ( N ∈ T)
by (rule FinPow_induct)Twith A2 show ( N ∈ T) by simp
qed

If a family of sets contains the empty set and is closed with respect to taking
unions of two sets then it is closed with respect to taking unions of any finite
collection.
lemma union_two_union_fin:
assumes A1: 0 ∈ C and A2: ∀ A∈C. ∀ B∈C. A∪B ∈ C andA3: N ∈S FinPow(C)
shows
N ∈ C
proof S
from h0 ∈ Ci have0 ∈ C by simp
SS
moreover have ∀ M ∈ FinPow(C).
M ∈ C −→ (∀ A∈C.
(M ∪ {A}) ∈ C)
proof { fix M assume
M ∈ FinPow(C)S
assumeM ∈ C
fix A S
assume A∈CS
have(MS∪ {A}) = ( M) ∪ A by
S autowith A2 h M ∈ Ci hA∈Ci have(M ∪ {A}) ∈ C
by simp} thus thesis by simp
qed
moreover note hNS∈ FinPow(C)i
ultimately show
N ∈ C by (rule FinPow_induct)qed

Empty set is in finite power set.
lemma empty_in_finpow: shows 0 ∈ FinPow(X)using FinPow_def by simp

Singleton is in the finite powerset.
lemma singleton_in_finpow: assumes x ∈ Xshows {x} ∈ FinPow(X) using assms FinPow_def by simp

Union of two finite subsets is a finite subset.

127

lemma union_finpow: assumes A ∈ FinPow(X) and B ∈ FinPow(X)shows A ∪ B ∈ FinPow(X)using assms FinPow_def by auto

Union of finite number of finite sets is finite.
lemma fin_union_finpow:
assumes M ∈ FinPow(FinPow(X))
Sshows
M ∈ FinPow(X)using assms empty_in_finpow union_finpow union_two_union_fin
by simp

If a set is finite after removing one element, then it is finite.
lemma rem_point_fin_fin:
assumes A1: x ∈ X and A2: A - {x} ∈ FinPow(X)shows A ∈ FinPow(X)proof from assms have (A - {x}) ∪ {x} ∈ FinPow(X)using singleton_in_finpow union_finpow by simp
moreover have A ⊆ (A - {x}) ∪ {x} by auto
ultimately show A ∈ FinPow(X)using FinPow_def subset_Finite by autoqed

An image of a finite set is finite.
lemma fin_image_fin: assumes ∀ V∈B. K(V)∈C and N ∈ FinPow(B)shows {K(V). V∈N} ∈ FinPow(C)proof have {K(V). V∈0} ∈ FinPow(C) using FinPow_def
by automoreover have ∀ A ∈ FinPow(B).
{K(V). V∈A} ∈ FinPow(C) −→ (∀ a∈B. {K(V). V ∈ (A ∪ {a})} ∈ FinPow(C))
proof { fix A assume A ∈ FinPow(B)assume {K(V). V∈A} ∈ FinPow(C)fix a assume a∈Bhave {K(V). V ∈ (A ∪ {a})} ∈ FinPow(C)proof have {K(V). V ∈ (A ∪ {a})} = {K(V). V∈A} ∪ {K(a)}by automoreover note h{K(V). V∈A} ∈ FinPow(C)imoreover from h∀ V∈B. K(V) ∈ Ci ha∈Bi have {K(a)} ∈ FinPow(C)using singleton_in_finpow by simp
ultimately show thesis using union_finpow by simp
qed
} thus thesis by simp
qed
moreover note hN ∈ FinPow(B)i
ultimately show {K(V). V∈N} ∈ FinPow(C)by (rule FinPow_induct)
qed

128

Union of a finite indexed family of finite sets is finite.
lemma union_fin_list_fin:
assumes A1: n ∈ nat and A2: ∀ k ∈ n. N(k) ∈ FinPow(X)showsS{N(k). k ∈ n} ∈ FinPow(FinPow(X)) and ( k ∈ n. N(k)) ∈ FinPow(X)proof from A1 have n ∈ FinPow(n)using nat_finpow_nat fin_finpow_self by autowith A2 show {N(k). k ∈ n} ∈ FinPow(FinPow(X))
by (rule fin_image_fin)Sthen show ( k ∈ n. N(k)) ∈ FinPow(X)using fin_union_finpow by simp
qed
end

13

Finite setstheory Finite1 imports ZF.EquivClass ZF.Finite func1 ZF1
begin

This theory extends Isabelle standard Finite theory. It is obsolete andshould not be used for new development. Use the Finite_ZF instead.

13.1

Finite powerset

In this section we consider various properties of Fin datatype (even though
there are no datatypes in ZF set theory).
In Topology_ZF theory we consider induced topology that is obtained bytaking a subset of a topological space. To show that a topology restricted
to a subset is also a topology on that subset we may need a fact that if T isa collection of sets and A is a set then every finite collection {Vi } is of theform Vi = Ui ∩ A, where {Ui } is a finite subcollection of T . This is one ofthose trivial facts that require suprisingly long formal proof. Actually, theneed for this fact is avoided by requiring intersection two open sets to beopen (rather than intersection of a finite number of open sets). Still, the factis left here as an example of a proof by induction. We will use Fin_induct
lemma from Finite.thy. First we define a property of finite sets that we want
to show.
definition
Prfin(T,A,M) ≡ ( (M = 0) | (∃ N∈ Fin(T). ∀ V∈ M. ∃ U∈ N. (V = U∩A)))

Now we show the main induction step in a separate lemma. This will makethe proof of the theorem FinRestr below look short and nice. The premises
129

of the ind_step lemma are those needed by the main induction step in lemma
Fin_induct (see standard Isabelle’s Finite.thy).
lemma ind_step: assumes A: ∀ V∈ TA. ∃ U∈T. V=U∩A
and A1: W∈TA and A2: M∈ Fin(TA)and A3: W∈M/ and A4: Prfin(T,A,M)
shows Prfin(T,A,cons(W,M))
proof { assume A7: M=0 have Prfin(T, A, cons(W, M))proof from A1 A obtain U where A5: U∈T and A6: W=U∩A by fast
let N = {U}from A5 have T1: N ∈ Fin(T) by simp
from A7 A6 have T2: ∀ V∈ cons(W,M). ∃ U∈N. V=U∩A by simp
from A7 T1 T2 show Prfin(T, A, cons(W, M))
using Prfin_def by autoqed }
moreover{ assume A8:M6=0 have Prfin(T, A, cons(W, M))proof from A1 A obtain U where A5: U∈T and A6:W=U∩A by fastfrom A8 A4 obtain N0
where A9: N0∈ Fin(T) and A10: ∀ V∈ M. ∃ U0∈ N0. (V = U0∩A)
using Prfin_def by auto
let N = cons(U,N0)
from A5 A9 have N ∈ Fin(T) by simp
moreover from A10 A6 have ∀ V∈ cons(W,M). ∃ U∈N. V=U∩A by simp
ultimately have ∃ N∈ Fin(T).∀ V∈ cons(W,M). ∃ U∈N. V=U∩A by autowith A8 show Prfin(T, A, cons(W, M))
using Prfin_def by simp
qed }
ultimately show thesis by autoqed

Now we are ready to prove the statement we need.
theorem FinRestr0: assumes A: ∀ V ∈ TA. ∃ U∈ T. V=U∩Ashows ∀ M∈ Fin(TA). Prfin(T,A,M)
proof { fix M
assume M ∈ Fin(TA)moreover have Prfin(T,A,0) using Prfin_def by simp
moreover{ fix W M assume W∈TA M∈ Fin(TA) W∈M/ Prfin(T,A,M)
with A have Prfin(T,A,cons(W,M)) by (rule ind_step) }ultimately have Prfin(T,A,M) by (rule Fin_induct)} thus thesis by simp
qedThis is a different form of the above theorem:
theorem ZF1FinRestr:

130

assumes A1:M∈ Fin(TA) and A2: M6=0
and A3: ∀ V∈ TA. ∃ U∈ T. V=U∩Ashows ∃ N∈ Fin(T). (∀ V∈ M. ∃ U∈ N. (V = U∩A)) ∧ N6=0
proof from A3 A1 have Prfin(T,A,M) using FinRestr0 by blast
then have ∃ N∈ Fin(T). ∀ V∈ M. ∃ U∈ N. (V = U∩A)
using A2 Prfin_def by simp
then obtain N where
D1:N∈ Fin(T) ∧ (∀ V∈ M. ∃ U∈ N. (V = U∩A)) by autowith A2 have N6=0 by autowith D1 show thesis by autoqed

Purely technical lemma used in Topology_ZF_1 to show that if a topology is
T2 , then it is T1 .
lemma Finite1_L2:
assumes A:∃ U V. (U∈T ∧ V∈T ∧ x∈U ∧ y∈V ∧ U∩V=0)
shows ∃ U∈T. (x∈U ∧ y∈U)/
proof from A obtain U V where D1:U∈T ∧ V∈T ∧ x∈U ∧ y∈V ∧ U∩V=0 by autowith D1 show thesis by autoqed

A collection closed with respect to taking a union of two sets is closed undertaking finite unions. Proof by induction with the induction step formulated
in a separate lemma.
lemma Finite1_L3_IndStep:
assumes A1:∀ A B. ((A∈C ∧ B∈C) −→ A∪B∈C)S
and A2:S A∈C and A3: N∈Fin(C) and A4:A∈N/ and A5: N ∈ C
showscons(A,N) ∈ C
proof - SS
havecons(A,N) = A∪
N by blast
with A1 A2 A5 show thesis by simp
qed

The lemma: a collection closed with respect to taking a union of two sets is
closed under taking finite unions.
lemma Finite1_L3:
assumes A1: 0 ∈ C and A2: ∀ A B. ((A∈C ∧ B∈C) −→ A∪B∈C) andA3: N∈ SFin(C)
shows
N∈C
proof note A3
S
moreover from A1 have0 ∈ C by simp
moreover{ fix A N
S
assume A∈C N∈Fin(C)
A∈N
/
N ∈ C
S
with A2 havecons(A,N) ∈ C by (rule Finite1_L3_IndStep) }131

ultimately show
qed

SN∈ C by (rule Fin_induct)

A collection closed with respect to taking a intersection of two sets is closed
under taking finite intersections. Proof by induction with the induction
step formulated in a separate lemma. This is sligltly more involved thanthe union case in Finite1_L3, because the intersection of empty collectionis undefined (or should be treated as such). To simplify notation we define
the property to be proven for finite sets as a separate notion.
definition
T
IntPr(T,N) ≡ (N = 0 |N ∈ T)The induction step.
lemma Finite1_L4_IndStep:
assumes A1: ∀ A B. ((A∈T ∧ B∈T) −→ A∩B∈T)
and A2: A∈T and A3:N∈Fin(T) and A4:A∈N/ and A5:IntPr(T,N)
shows IntPr(T,cons(A,N))
proof { assume A6: N=0
with A2 have IntPr(T,cons(A,N))
using IntPr_def by simp }moreover{ assume A7: N6=0 have IntPr(T, cons(A, N))
proof T
from A7 A5 A2 A1 have TN ∩ A ∈ T using
T IntPr_def by simp
moreover from A7 havecons(A, N) =N ∩ A by auto
ultimately show IntPr(T, cons(A, N)) using IntPr_def by simp
qed }
ultimately show thesis by autoqed

The lemma.
lemma Finite1_L4:
assumes A1: ∀ A B. A∈T ∧ B∈T −→ A∩B ∈ T
and A2: N∈Fin(T)shows IntPr(T,N)
proof note A2
moreover have IntPr(T,0) using IntPr_def by simp
moreover{ fix A N
assume A∈T N∈Fin(T) A∈N/ IntPr(T,N)
with A1 have IntPr(T,cons(A,N)) by (rule Finite1_L4_IndStep) }ultimately show IntPr(T,N) by (rule Fin_induct)
qed

Next is a restatement of the above lemma that does not depend on the IntPr
meta-function.
132lemma Finite1_L5:
assumes A1: ∀ A B. ((A∈T ∧ B∈T) −→ A∩B∈T)
and A2:T N6=0 and A3: N∈Fin(T)
shows
N ∈ T
proof from A1 A3 have IntPr(T,N) using Finite1_L4 by simp
with A2 show thesis using IntPr_def by simp
qed

The images of finite subsets by a meta-function are finite. For example intopology if we have a finite collection of sets, then closing each of them
results in a finite collection of closed sets. This is a very useful lemma withmany unexpected applications. The proof is by induction. The next lemmais the induction step.
lemma fin_image_fin_IndStep:
assumes ∀ V∈B. K(V)∈C
and U∈B and N∈Fin(B) and U∈N/ and {K(V). V∈N}∈Fin(C)shows {K(V). V∈cons(U,N)} ∈ Fin(C)using assms by simp

The lemma:
lemma fin_image_fin:
assumes A1: ∀ V∈B. K(V)∈C and A2: N∈Fin(B)shows {K(V). V∈N} ∈ Fin(C)proof note A2
moreover have {K(V). V∈0} ∈ Fin(C) by simp
moreover{ fix U N
assume U∈B N∈Fin(B) U∈N/ {K(V). V∈N}∈Fin(C)with A1 have {K(V). V∈cons(U,N)} ∈ Fin(C)by (rule fin_image_fin_IndStep) }ultimately show thesis by (rule Fin_induct)qed

The image of a finite set is finite.
lemma Finite1_L6A: assumes A1: f:X→Y and A2: N ∈ Fin(X)shows f(N) ∈ Fin(Y)proof from A1 have ∀ x∈X. f(x) ∈ Y
using apply_type by simp
moreover note A2
ultimately have {f(x). x∈N} ∈ Fin(Y)by (rule fin_image_fin)with A1 A2 show thesis
using FinD func_imagedef by simp
qed

133

If the set defined by a meta-function is finite, then every set defined by acomposition of this meta function with another one is finite.
lemma Finite1_L6B:
assumes A1: ∀ x∈X. a(x) ∈ Y and A2: {b(y).y∈Y} ∈ Fin(Z)shows {b(a(x)).x∈X} ∈ Fin(Z)proof from A1 have {b(a(x)).x∈X} ⊆ {b(y).y∈Y} by autowith A2 show thesis using Fin_subset_lemma by blastqed

If the set defined by a meta-function is finite, then every set defined by acomposition of this meta function with another one is finite.
lemma Finite1_L6C:
assumes A1: ∀ y∈Y. b(y) ∈ Z and A2: {a(x). x∈X} ∈ Fin(Y)shows {b(a(x)).x∈X} ∈ Fin(Z)proof let N = {a(x). x∈X}
from A1 A2 have {b(y). y ∈ N} ∈ Fin(Z)by (rule fin_image_fin)
moreover have {b(a(x)). x∈X} = {b(y). y∈ N}
by autoultimately show thesis by simp
qed

Cartesian product of finite sets is finite.
lemma Finite1_L12: assumes A1: A ∈ Fin(A) and A2: B ∈ Fin(B)shows A×B ∈ Fin(A×B)
proof have T1:∀ a∈A. ∀ b∈B. {h a,bi} ∈ Fin(A×B) by simp
have ∀ a∈A. {{h a,bi}. b ∈ B} ∈ Fin(Fin(A×B))
proof
fix a assume A3: a ∈ Awith T1 have ∀ b∈B. {h a,bi} ∈ Fin(A×B)
by simpmoreover note A2
ultimately show {{h a,bi}. b ∈ B} ∈ Fin(Fin(A×B))
by (rule fin_image_fin)qedSthen have ∀ a∈A.
{{h a,bi}. b ∈ B} ∈ Fin(A×B)
using Fin_UnionI by simp
moreoverShave∀ a∈A.
{{h a,bi}. b ∈ B} = {a}× B by blast
ultimately have ∀ a∈A. {a}× B ∈ Fin(A×B) by simp
moreover note A1
ultimately have {{a}× B. a∈A} ∈ Fin(Fin(A×B))
by (rule Sfin_image_fin)then have{{a}× B. a∈A} ∈ Fin(A×B)
using Fin_UnionI by simp

134

S
moreover have{{a}× B. a∈A} = A×B by blast
ultimately show thesis by simpqed

We define the characterisic meta-function that is the identity on a set andassigns a default value everywhere else.
definition
Characteristic(A,default,x) ≡ (if x∈A then x else default)

A finite subset is a finite subset of itself.
lemma Finite1_L13:
assumes A1:A ∈ Fin(X) shows A ∈ Fin(A)proof { assume A=0 hence A ∈ Fin(A) by simp }moreover{ assume A2: A6=0 then obtain c where D1:c∈A
by autothen have ∀ x∈X. Characteristic(A,c,x) ∈ A
using Characteristic_def by simp
moreover note A1
ultimately have{Characteristic(A,c,x). x∈A} ∈ Fin(A) by (rule fin_image_fin)
moreover from D1 have{Characteristic(A,c,x). x∈A} = A using Characteristic_def by simp
ultimately have A ∈ Fin(A) by simp }ultimately show thesis by blast
qed

Cartesian product of finite subsets is a finite subset of cartesian product.
lemma Finite1_L14: assumes A1: A ∈ Fin(X) B ∈ Fin(Y)shows A×B ∈ Fin(X×Y)
proof from A1 have A×B ⊆ X×Y using FinD by auto
then have Fin(A×B) ⊆ Fin(X×Y) using Fin_mono by simp
moreover from A1 have A×B ∈ Fin(A×B)
using Finite1_L13 Finite1_L12 by simp
ultimately show thesis by autoqed

The next lemma is needed in the Group_ZF_3 theory in a couple of places.
lemma Finite1_L15:
assumes A1: {b(x). x∈A} ∈ Fin(B) {c(x). x∈A} ∈ Fin(C)and A2: f : B×C→E
shows {fh b(x),c(x)i. x∈A} ∈ Fin(E)proof from A1 have {b(x). x∈A}×{c(x). x∈A} ∈ Fin(B×C)
using Finite1_L14 by simp
moreover have135{h b(x),c(x)i. x∈A} ⊆ {b(x). x∈A}×{c(x). x∈A}
by blast
ultimately have T0: {h b(x),c(x)i. x∈A} ∈ Fin(B×C)
by (rule Fin_subset_lemma)with A2 have T1: f{h b(x),c(x)i. x∈A} ∈ Fin(E)using Finite1_L6A by autofrom T0 have ∀ x∈A. h b(x),c(x)i ∈ B×C
using FinD by autowith A2 havef{h b(x),c(x)i. x∈A} = {fh b(x),c(x)i. x∈A}
using func1_1_L17 by simp
with T1 show thesis by simp
qedSingletons are in the finite powerset.
lemma Finite1_L16: assumes x∈X shows {x} ∈ Fin(X)using assms emptyI consI by simp

A special case of Finite1_L15 where the second set is a singleton. In
Group_ZF_3 theory this corresponds to the situation where we multiply by aconstant.
lemma Finite1_L16AA: assumes {b(x). x∈A} ∈ Fin(B)and c∈C and f : B×C→E
shows {fh b(x),ci. x∈A} ∈ Fin(E)proof from assms have∀ y∈B. fhy,ci ∈ E{b(x). x∈A} ∈ Fin(B)using apply_funtype by auto
then show thesis by (rule Finite1_L6C)
qed

First order version of the induction for the finite powerset.
lemma Finite1_L16B: assumes A1: P(0) and A2: B∈Fin(X)and A3: ∀ A∈Fin(X).∀ x∈X. x∈A/ ∧ P(A)−→P(A∪{x})shows P(B)proof note hB∈Fin(X)i and hP(0)i
moreover{ fix A x
assume x ∈ X A ∈ Fin(X) x ∈/ A P(A)moreover have cons(x,A) = A∪{x} by auto
moreover note A3
ultimately have P(cons(x,A)) by simp }ultimately show P(B) by (rule Fin_induct)
qed

136

13.2

Finite range functions

In this section we define functions f : X → Y , with the property thatf (X) is a finite subset of Y . Such functions play a important role in theconstruction of real numbers in the Real_ZF series.
Definition of finite range functions.
definition
FinRangeFunctions(X,Y) ≡ {f:X→Y. f(X) ∈ Fin(Y)}Constant functions have finite range.
lemma Finite1_L17: assumes c∈Y and X6=0
shows ConstantFunction(X,c) ∈ FinRangeFunctions(X,Y)
using assms func1_3_L1 func_imagedef func1_3_L2 Finite1_L16
FinRangeFunctions_def by simp

Finite range functions have finite range.
lemma Finite1_L18: assumes f ∈ FinRangeFunctions(X,Y)
shows {f(x). x∈X} ∈ Fin(Y)using assms FinRangeFunctions_def func_imagedef by simp

An alternative form of the definition of finite range functions.
lemma Finite1_L19: assumes f:X→Yand {f(x). x∈X} ∈ Fin(Y)shows f ∈ FinRangeFunctions(X,Y)
using assms func_imagedef FinRangeFunctions_def by simp

A composition of a finite range function with another function is a finite
range function.
lemma Finite1_L20: assumes A1:f ∈ FinRangeFunctions(X,Y)
and A2: g : Y→Z
shows g O f ∈ FinRangeFunctions(X,Z)
proof from A1 A2 have g{f(x). x∈X} ∈ Fin(Z)using Finite1_L18 Finite1_L6A
by simpwith A1 A2 have {(g O f)(x). x∈X} ∈ Fin(Z)using FinRangeFunctions_def apply_funtype
func1_1_L17 comp_fun_apply by autowith A1 A2 show thesis using
FinRangeFunctions_def comp_fun Finite1_L19
by autoqed

Image of any subset of the domain of a finite range function is finite.
lemma Finite1_L21:
assumes f ∈ FinRangeFunctions(X,Y) and A⊆X137

shows f(A) ∈ Fin(Y)proof from assms have f(X) ∈ Fin(Y) f(A) ⊆ f(X)using FinRangeFunctions_def func1_1_L8
by autothen show f(A) ∈ Fin(Y) using Fin_subset_lemmaby blast
qed
end

14

Finite sets 1

theory Finite_ZF_1 imports Finite1 Order_ZF_1a
begin

This theory is based on Finite1 theory and is obsolete. It contains propertiesof finite sets related to order relations. See the FinOrd theory for a better
approach.

14.1

Finite vs. bounded sets

The goal of this section is to show that finite sets are bounded and havemaxima and minima.
Finite set has a maximum - induction step.
lemma Finite_ZF_1_1_L1:
assumes A1: r {is total on} X and A2: trans(r)and A3: A∈Fin(X) and A4: x∈X and A5: A=0 ∨ HasAmaximum(r,A)
shows A∪{x} = 0 ∨ HasAmaximum(r,A∪{x})
proof { assume A=0 then have T1: A∪{x} = {x} by simp
from A1 have refl(X,r) using total_is_refl by simp
with T1 A4 have A∪{x} = 0 ∨ HasAmaximum(r,A∪{x})using Order_ZF_4_L8 by simp }moreover{ assume A6=0
with A1 A2 A3 A4 A5 have A∪{x} = 0 ∨ HasAmaximum(r,A∪{x})using FinD Order_ZF_4_L9 by simp }ultimately show thesis by blastqed

For total and transitive relations finite set has a maximum.
theorem Finite_ZF_1_1_T1A:
assumes A1: r {is total on} X and A2: trans(r)and A3: B∈Fin(X)138

shows B=0 ∨ HasAmaximum(r,B)
proof have 0=0 ∨ HasAmaximum(r,0) by simp
moreover note A3
moreover from A1 A2 have ∀ A∈Fin(X). ∀ x∈X.
x∈A
/ ∧ (A=0 ∨ HasAmaximum(r,A)) −→ (A∪{x}=0 ∨ HasAmaximum(r,A∪{x}))using Finite_ZF_1_1_L1 by simp
ultimately show B=0 ∨ HasAmaximum(r,B) by (rule Finite1_L16B)
qed

Finite set has a minimum - induction step.
lemma Finite_ZF_1_1_L2:
assumes A1: r {is total on} X and A2: trans(r)and A3: A∈Fin(X) and A4: x∈X and A5: A=0 ∨ HasAminimum(r,A)
shows A∪{x} = 0 ∨ HasAminimum(r,A∪{x})
proof { assume A=0 then have T1: A∪{x} = {x} by simp
from A1 have refl(X,r) using total_is_refl by simp
with T1 A4 have A∪{x} = 0 ∨ HasAminimum(r,A∪{x})using Order_ZF_4_L8 by simp }moreover{ assume A6=0
with A1 A2 A3 A4 A5 have A∪{x} = 0 ∨ HasAminimum(r,A∪{x})using FinD Order_ZF_4_L10 by simp }ultimately show thesis by blastqed

For total and transitive relations finite set has a minimum.
theorem Finite_ZF_1_1_T1B:
assumes A1: r {is total on} X and A2: trans(r)and A3: B ∈ Fin(X)shows B=0 ∨ HasAminimum(r,B)
proof have 0=0 ∨ HasAminimum(r,0) by simp
moreover note A3
moreover from A1 A2 have ∀ A∈Fin(X). ∀ x∈X.
x∈A
/ ∧ (A=0 ∨ HasAminimum(r,A)) −→ (A∪{x}=0 ∨ HasAminimum(r,A∪{x}))using Finite_ZF_1_1_L2 by simp
ultimately show B=0 ∨ HasAminimum(r,B) by (rule Finite1_L16B)qed

For transitive and total relations finite sets are bounded.
theorem Finite_ZF_1_T1:
assumes A1: r {is total on} X and A2: trans(r)and A3: B∈Fin(X)shows IsBounded(B,r)
proof from A1 A2 A3 have B=0 ∨ HasAminimum(r,B) B=0 ∨ HasAmaximum(r,B)
using Finite_ZF_1_1_T1A Finite_ZF_1_1_T1B by auto139

then have
B = 0 ∨ IsBoundedBelow(B,r) B = 0 ∨ IsBoundedAbove(B,r)
using Order_ZF_4_L7 Order_ZF_4_L8A by auto
then show IsBounded(B,r) using
IsBounded_def IsBoundedBelow_def IsBoundedAbove_def
by simpqed

For linearly ordered finite sets maximum and minimum have desired properties. The reason we need linear order is that we need the order to be total
and transitive for the finite sets to have a maximum and minimum and thenwe also need antisymmetry for the maximum and minimum to be unique.
theorem Finite_ZF_1_T2:
assumes A1: IsLinOrder(X,r) and A2: A ∈ Fin(X) and A3: A6=0
shows
Maximum(r,A) ∈ A
Minimum(r,A) ∈ A∀ x∈A. hx,Maximum(r,A)i ∈ r∀ x∈A. hMinimum(r,A),xi ∈ r
proof from A1 have T1: r {is total on} X trans(r) antisym(r)using IsLinOrder_def by auto
moreover from T1 A2 A3 have HasAmaximum(r,A)
using Finite_ZF_1_1_T1A by auto
moreover from T1 A2 A3 have HasAminimum(r,A)
using Finite_ZF_1_1_T1B by auto
ultimately show
Maximum(r,A) ∈ A
Minimum(r,A) ∈ A∀ x∈A. hx,Maximum(r,A)i ∈ r ∀ x∈A. hMinimum(r,A),xi ∈ rusing Order_ZF_4_L3 Order_ZF_4_L4 by autoqed

A special case of Finite_ZF_1_T2 when the set has three elements.
corollary Finite_ZF_1_L2A:
assumes A1: IsLinOrder(X,r) and A2: a∈X b∈X c∈X
shows
Maximum(r,{a,b,c}) ∈ {a,b,c}
Minimum(r,{a,b,c}) ∈ {a,b,c}Maximum(r,{a,b,c}) ∈ X
Minimum(r,{a,b,c}) ∈ X
ha,Maximum(r,{a,b,c})i ∈ r
hb,Maximum(r,{a,b,c})i ∈ rhc,Maximum(r,{a,b,c})i ∈ r
proof from A2 have I: {a,b,c} ∈ Fin(X) {a,b,c} 6= 0
by autowith A1 show II: Maximum(r,{a,b,c}) ∈ {a,b,c}by (rule Finite_ZF_1_T2)

140

moreover from A1 I show III: Minimum(r,{a,b,c}) ∈ {a,b,c}by (rule Finite_ZF_1_T2)
moreover from A2 have {a,b,c} ⊆ X
by autoultimately show
Maximum(r,{a,b,c}) ∈ X
Minimum(r,{a,b,c}) ∈ X
by autofrom A1 I have ∀ x∈{a,b,c}. hx,Maximum(r,{a,b,c})i ∈ r
by (rule Finite_ZF_1_T2)
then show
ha,Maximum(r,{a,b,c})i ∈ r
hb,Maximum(r,{a,b,c})i ∈ rhc,Maximum(r,{a,b,c})i ∈ r
by autoqed

If for every element of X we can find one in A that is greater, then the A
can not be finite. Works for relations that are total, transitive and antisymmetric.
lemma Finite_ZF_1_1_L3:
assumes A1: r {is total on} X
and A2: trans(r) and A3: antisym(r)and A4: r ⊆ X×X and A5: X6=0
and A6: ∀ x∈X. ∃ a∈A. x6=a ∧ hx,ai ∈ rshows A ∈/ Fin(X)
proof from assms have ¬IsBounded(A,r)
using Order_ZF_3_L14 IsBounded_def
by simpwith A1 A2 show A ∈/ Fin(X)using Finite_ZF_1_T1 by auto
qed
end

15

Finite sets and order relations

theory FinOrd_ZF imports Finite_ZF func_ZF_1
begin

This theory file contains properties of finite sets related to order relations.
Part of this is similar to what is done in Finite_ZF_1 except that the development is based on the notion of finite powerset defined in Finite_ZF rather
the one defined in standard Isabelle Finite theory.

141

15.1

Finite vs. bounded sets

The goal of this section is to show that finite sets are bounded and havemaxima and minima.
For total and transitive relations nonempty finite set has a maximum.
theorem fin_has_max:
assumes A1: r {is total on} X and A2: trans(r)and A3: B ∈ FinPow(X) and A4: B 6= 0
shows HasAmaximum(r,B)
proof have 0=0 ∨ HasAmaximum(r,0) by simp
moreover have
∀ A ∈ FinPow(X). A=0 ∨ HasAmaximum(r,A) −→(∀ x∈X. (A ∪ {x}) = 0 ∨ HasAmaximum(r,A ∪ {x}))proof { fix A
assume A ∈ FinPow(X) A = 0 ∨ HasAmaximum(r,A)
have ∀ x∈X. (A ∪ {x}) = 0 ∨ HasAmaximum(r,A ∪ {x})proof { fix x assume x∈Xnote hA = 0 ∨ HasAmaximum(r,A)i
moreover{ assume A = 0
then have A∪{x} = {x} by simp
from A1 have refl(X,r) using total_is_refl
by simpwith hx∈Xi hA∪{x} = {x}i have HasAmaximum(r,A∪{x})using Order_ZF_4_L8 by simp }moreover{ assume HasAmaximum(r,A)
with A1 A2 hA ∈ FinPow(X)i hx∈Xi
have HasAmaximum(r,A∪{x})using FinPow_def Order_ZF_4_L9 by simp }ultimately have A ∪ {x} = 0 ∨ HasAmaximum(r,A ∪ {x})by auto} thus ∀ x∈X. (A ∪ {x}) = 0 ∨ HasAmaximum(r,A ∪ {x})by simpqed} thus thesis by simp
qed
moreover note A3
ultimately have B = 0 ∨ HasAmaximum(r,B)
by (rule FinPow_induct)with A4 show HasAmaximum(r,B) by simp
qed

For linearly ordered nonempty finite sets the maximum is in the set andindeed it is the greatest element of the set.
142

lemma linord_max_props: assumes A1: IsLinOrder(X,r) andA2: A ∈ FinPow(X) A 6= 0
shows
Maximum(r,A) ∈ A
Maximum(r,A) ∈ X∀ a∈A. ha,Maximum(r,A)i ∈ r
proof from A1 A2 show
Maximum(r,A) ∈ A and ∀ a∈A. ha,Maximum(r,A)i ∈ rusing IsLinOrder_def fin_has_max Order_ZF_4_L3
by autowith A2 show Maximum(r,A) ∈ X using FinPow_def
by autoqed

15.2

Order isomorphisms of finite sets

In this section we eastablish that if two linearly ordered finite sets have thesame number of elements, then they are order-isomorphic and the isomorphism is unique. This allows us to talk about ”enumeration” of a linearlyordered finite set. We define the enumeration as the order isomorphism
between the number of elements of the set (which is a natural numbern = {0, 1, .., n − 1}) and the set.
A really weird corner case - empty set is order isomorphic with itself.
lemma empty_ord_iso: shows ord_iso(0,r,0,R) 6= 0
proof have 0 ≈ 0 using eqpoll_refl by simp
then obtain f where f ∈ bij(0,0)
using eqpoll_def by blast
then show thesis using ord_iso_def by autoqed

Even weirder than empty_ord_iso The order automorphism of the empty set
is unique.
lemma empty_ord_iso_uniq:
assumes f ∈ ord_iso(0,r,0,R) g ∈ ord_iso(0,r,0,R)
shows f = g
proof from assms have f : 0 → 0 and g: 0 → 0
using ord_iso_def bij_def surj_def by auto
moreover have ∀ x∈0. f(x) = g(x) by simp
ultimately show f = g by (rule func_eq)
qed

The empty set is the only order automorphism of itself.
lemma empty_ord_iso_empty: shows ord_iso(0,r,0,R) = {0}proof -

143

have 0 ∈ ord_iso(0,r,0,R)
proof have ord_iso(0,r,0,R) 6= 0 by (rule empty_ord_iso)then obtain f where f ∈ ord_iso(0,r,0,R) by auto
then show 0 ∈ ord_iso(0,r,0,R)
using ord_iso_def bij_def surj_def fun_subset_prodby autoqed
then show ord_iso(0,r,0,R) = {0} using empty_ord_iso_uniq
by blast
qed

An induction (or maybe recursion?) scheme for linearly ordered sets. The
induction step is that we show that if the property holds when the set isa singleton or for a set with the maximum removed, then it holds for theset. The idea is that since we can build any finite set by adding elements on
the right, then if the property holds for the empty set and is invariant withrespect to this operation, then it must hold for all finite sets.
lemma fin_ord_induction:
assumes A1: IsLinOrder(X,r) and A2: P(0) andA3: ∀ A ∈ FinPow(X). A 6= 0 −→ (P(A - {Maximum(r,A)}) −→ P(A))
and A4: B ∈ FinPow(X) shows P(B)proof note A2
moreover have ∀ A ∈ FinPow(X). A 6= 0 −→ (∃ a∈A. P(A-{a}) −→ P(A))
proof { fix A assume A ∈ FinPow(X) and A 6= 0
with A1 A3 have ∃ a∈A. P(A-{a}) −→ P(A)using IsLinOrder_def fin_has_max
IsLinOrder_def Order_ZF_4_L3
by blast} thus thesis by simp
qed
moreover note A4
ultimately show P(B) by (rule FinPow_ind_rem_one)qed

A sligltly more complicated version of fin_ord_induction that allows toprove properties that are not true for the empty set.
lemma fin_ord_ind:assumes A1: IsLinOrder(X,r) and A2: ∀ A ∈ FinPow(X).
A = 0 ∨ (A = {Maximum(r,A)} ∨ P(A - {Maximum(r,A)}) −→ P(A))
and A3: B ∈ FinPow(X) and A4: B6=0
shows P(B)proof { fix A assume A ∈ FinPow(X) and A 6= 0
with A1 A2 have
∃ a∈A. A = {a} ∨ P(A-{a}) −→ P(A)144

using IsLinOrder_def fin_has_max
IsLinOrder_def Order_ZF_4_L3
by blast} then have ∀ A ∈ FinPow(X).
A = 0 ∨ (∃ a∈A. A = {a} ∨ P(A-{a}) −→ P(A))
by autowith A3 A4 show P(B) using FinPow_rem_ind
by simpqed

Yet another induction scheme. We build a linearly ordered set by adding
elements that are greater than all elements in the set.
lemma fin_ind_add_max:
assumes A1: IsLinOrder(X,r) and A2: P(0) and A3: ∀ A ∈ FinPow(X).
( ∀ x ∈ X-A. P(A) ∧ (∀ a∈A. ha,xi ∈ r ) −→ P(A ∪ {x}))and A4: B ∈ FinPow(X)shows P(B)proof note A1 A2
moreover have
∀ C ∈ FinPow(X). C 6= 0 −→ (P(C - {Maximum(r,C)}) −→ P(C))
proof { fix C assume C ∈ FinPow(X) and C 6= 0
let x = Maximum(r,C)
let A = C - {x}assume P(A)moreover from hC ∈ FinPow(X)i have A ∈ FinPow(X)using fin_rem_point_fin by simp
moreover from A1 hC ∈ FinPow(X)i hC 6= 0i havex ∈ C and x ∈ X - A and ∀ a∈A. ha,xi ∈ rusing linord_max_props by auto
moreover note A3
ultimately have P(A ∪ {x}) by auto
moreover from hx ∈ Ci have A ∪ {x} = C
by autoultimately have P(C) by simp
} thus thesis by simp
qed
moreover note A4
ultimately show P(B) by (rule fin_ord_induction)qed

The only order automorphism of a linearly ordered finite set is the identity.
theorem fin_ord_auto_id: assumes A1: IsLinOrder(X,r)
and A2: B ∈ FinPow(X) and A3: B6=0
shows ord_iso(B,r,B,r) = {id(B)}proof note A1

145

moreover{ fix A assume A ∈ FinPow(X) A6=0
let M = Maximum(r,A)
let A0 = A - {M}assume A = {M} ∨ ord_iso(A0 ,r,A0 ,r) = {id(A0 )}moreover{ assume A = {M}have ord_iso({M},r,{M},r) = {id({M})}using id_ord_auto_singleton by simp
with hA = {M}i have ord_iso(A,r,A,r) = {id(A)}by simp }moreover{ assume ord_iso(A0 ,r,A0 ,r) = {id(A0 )}have ord_iso(A,r,A,r) = {id(A)}proofshow {id(A)} ⊆ ord_iso(A,r,A,r)using id_ord_iso by simp
{ fix f assume f ∈ ord_iso(A,r,A,r)with A1 hA ∈ FinPow(X)i hA6=0i haverestrict(f,A0 ) ∈ ord_iso(A0 , r, A-{f(M)},r)
using IsLinOrder_def fin_has_max ord_iso_rem_max
by autowith A1 hA ∈ FinPow(X)i hA6=0i hf ∈ ord_iso(A,r,A,r)ihord_iso(A ,r,A ,r) = {id(A )}i000
have restrict(f,A0 ) = id(A0 )using IsLinOrder_def fin_has_max max_auto_fixpointby automoreover from A1 hf ∈ ord_iso(A,r,A,r)ihA ∈FinPow(X)i hA6=0i havef : A → A and M ∈ A and f(M) = M
using ord_iso_def bij_is_fun IsLinOrder_def
fin_has_max Order_ZF_4_L3 max_auto_fixpointby autoultimately have f = id(A) using id_fixpoint_rem
by simp} then show ord_iso(A,r,A,r) ⊆ {id(A)}by autoqed}
ultimately have ord_iso(A,r,A,r) = {id(A)}by auto} then have ∀ A ∈ FinPow(X). A = 0 ∨(A = {Maximum(r,A)} ∨ord_iso(A-{Maximum(r,A)},r,A-{Maximum(r,A)},r) ={id(A-{Maximum(r,A)})} −→ ord_iso(A,r,A,r) = {id(A)})
by automoreover note A2 A3
ultimately show ord_iso(B,r,B,r) = {id(B)}by (rule fin_ord_ind)

146

qed

Every two finite linearly ordered sets are order isomorphic. The statement
is formulated to make the proof by induction on the size of the set easier,see fin_ord_iso_ex for an alternative formulation.
lemma fin_order_iso:assumes A1: IsLinOrder(X,r) IsLinOrder(Y,R) andA2: n ∈ nat
shows ∀ A ∈ FinPow(X). ∀ B ∈ FinPow(Y).
A ≈ n ∧ B ≈ n −→ ord_iso(A,r,B,R) 6= 0
proof note A2
moreover have ∀ A ∈ FinPow(X). ∀ B ∈ FinPow(Y).
A ≈ 0 ∧ B ≈ 0 −→ ord_iso(A,r,B,R) 6= 0
using eqpoll_0_is_0 empty_ord_iso by blast
moreover have ∀ k ∈ nat.
(∀ A ∈ FinPow(X). ∀ B ∈ FinPow(Y).
A ≈ k ∧ B ≈ k −→ ord_iso(A,r,B,R) 6= 0) −→(∀ C ∈ FinPow(X). ∀ D ∈ FinPow(Y).
C ≈ succ(k) ∧ D ≈ succ(k) −→ ord_iso(C,r,D,R) 6= 0)
proof { fix k assume k ∈ nat
assume A3: ∀ A ∈ FinPow(X). ∀ B ∈ FinPow(Y).
A ≈ k ∧ B ≈ k −→ ord_iso(A,r,B,R) 6= 0
have ∀ C ∈ FinPow(X). ∀ D ∈ FinPow(Y).
C ≈ succ(k) ∧ D ≈ succ(k) −→ ord_iso(C,r,D,R) 6= 0
proof { fix C assume C ∈ FinPow(X)fix D assume D ∈ FinPow(Y)assume C ≈ succ(k) D ≈ succ(k)then have C 6= 0 and D6= 0
using eqpoll_succ_imp_not_empty by auto
let MC = Maximum(r,C)
let MD = Maximum(R,D)
let C0 = C - {MC }let D0 = D - {MD }from hC ∈ FinPow(X)i have C ⊆ X
using FinPow_def by simp
with A1 have IsLinOrder(C,r)
using ord_linear_subset by blastfrom hD ∈ FinPow(Y)i have D ⊆ Yusing FinPow_def by simp
with A1 have IsLinOrder(D,R)
using ord_linear_subset by blastfrom A1 hC ∈ FinPow(X)i hD ∈ FinPow(Y)ihC 6= 0i hD6= 0i have
HasAmaximum(r,C) and HasAmaximum(R,D)
using IsLinOrder_def fin_has_max
by auto147

with A1 have MC ∈ C and MD ∈ Dusing IsLinOrder_def Order_ZF_4_L3 by autowith hC ≈ succ(k)i hD ≈ succ(k)i haveC0 ≈ k and D0 ≈ k using Diff_sing_eqpoll by autofrom hC ∈ FinPow(X)i hD ∈ FinPow(Y)ihave C0 ∈ FinPow(X) and D0 ∈ FinPow(Y)using fin_rem_point_fin by autowith A3 hC0 ≈ ki hD0 ≈ ki haveord_iso(C0 ,r,D0 ,R) 6= 0 by simp
with hIsLinOrder(C,r)i hIsLinOrder(D,R)ihHasAmaximum(r,C)i hHasAmaximum(R,D)ihave ord_iso(C,r,D,R) 6= 0
by (rule rem_max_ord_iso)} thus thesis by simp
qed
} thus thesis by blast
qed
ultimately show thesis by (rule ind_on_nat)qed

Every two finite linearly ordered sets are order isomorphic.
lemma fin_ord_iso_ex:
assumes A1: IsLinOrder(X,r) IsLinOrder(Y,R) andA2: A ∈ FinPow(X) B ∈ FinPow(Y) and A3: B ≈ A
shows ord_iso(A,r,B,R) 6= 0
proof from A2 obtain n where n ∈ nat and A ≈ nusing finpow_decomp by autofrom A3 hA ≈ ni have B ≈ n by (rule eqpoll_trans)with A1 A2 hA ≈ ni hn ∈ nati show ord_iso(A,r,B,R) 6= 0
using fin_order_iso by simp
qed

Existence and uniqueness of order isomorphism for two linearly ordered setswith the same number of elements.
theorem fin_ord_iso_ex_uniq:
assumes A1: IsLinOrder(X,r) IsLinOrder(Y,R) andA2: A ∈ FinPow(X) B ∈ FinPow(Y) and A3: B ≈ A
shows ∃ !f. f ∈ ord_iso(A,r,B,R)
proof
from assms show ∃ f. f ∈ ord_iso(A,r,B,R)
using fin_ord_iso_ex by blast
fix f gassume A4: f ∈ ord_iso(A,r,B,R) g ∈ ord_iso(A,r,B,R)
then have converse(g) ∈ ord_iso(B,R,A,r)using ord_iso_sym by simp
with hf ∈ ord_iso(A,r,B,R)i have
I: converse(g) O f ∈ ord_iso(A,r,A,r)by (rule ord_iso_trans)148

{ assume A 6= 0
with A1 A2 I have converse(g) O f = id(A)using fin_ord_auto_id by autowith A4 have f = g
using ord_iso_def comp_inv_id_eq_bij by auto }moreover{ assume A = 0
then have A ≈ 0 using eqpoll_0_iff
by simpwith A3 have B ≈ 0 by (rule eqpoll_trans)with A4 hA = 0i havef ∈ ord_iso(0,r,0,R) and g ∈ ord_iso(0,r,0,R)
using eqpoll_0_iff by auto
then have f = g by (rule empty_ord_iso_uniq) }ultimately show f = g
using ord_iso_def comp_inv_id_eq_bij
by auto
qed

end

16

Equivalence relations

theory EquivClass1 imports ZF.EquivClass func_ZF ZF1
begin

In this theory file we extend the work on equivalence relations done in thestandard Isabelle’s EquivClass theory. That development is very good andall, but we really would prefer an approach contained within the a standard
ZF set theory, without extensions specific to Isabelle. That is why thistheory is written.

16.1

Congruent functions and projections on the quotient

Suppose we have a set X with a relation r ⊆ X × X and a function f : X →X. The function f can be compatible (congruent) with r in the sense that if
two elements x, y are related then the values f (x), f (x) are also related. Thisis especially useful if r is an equivalence relation as it allows to ”project”
the function to the quotient space X/r (the set of equivalence classes ofr) and create a new function F that satifies the formula F ([x]r ) = [f (x)]r .
When f is congruent with respect to r such definition of the value of F on theequivalence class [x]r does not depend on which x we choose to represent theclass. In this section we also consider binary operations that are congruent
with respect to a relation. These are important in algebra - the congruency
149

condition allows to project the operation to obtain the operation on thequotient space.
First we define the notion of function that maps equivalent elements to equivalent values. We use similar names as in the Isabelle’s standard EquivClass
theory to indicate the conceptual correspondence of the notions.
definition
Congruent(r,f) ≡(∀ x y. hx,yi ∈ r −→ hf(x),f(y)i ∈ r)

Now we will define the projection of a function onto the quotient space. In
standard math the equivalence class of x with respect to relation r is usuallydenoted [x]r . Here we reuse notation r{x} instead. This means the imageof the set {x} with respect to the relation, which, for equivalence relations
is exactly its equivalence class if you think about it.
definition
ProjFun(A,r,f)≡S{hc, x∈c. r{f(x)}i. c ∈ (A//r)}

Elements of equivalence classes belong to the set.
lemma EquivClass_1_L1:
assumes A1: equiv(A,r) and A2: C ∈ A//r and A3: x∈Cshows x∈A
proof S
from A2 have C ⊆(A//r) by autowith A1 A3 show x∈Ausing Union_quotient by autoqed

The image of a subset of X under projection is a subset of A/r.
lemma EquivClass_1_L1A:
assumes A⊆X shows {r{x}. x∈A} ⊆ X//r
using assms quotientI by auto

If an element belongs to an equivalence class, then its image under relationis this equivalence class.
lemma EquivClass_1_L2:
assumes A1: equiv(A,r) C ∈ A//r and A2: x∈Cshows r{x} = C
proof from A1 A2 have x ∈ r{x}using EquivClass_1_L1 equiv_class_self by simp
with A2 have I: r{x}∩C 6= 0 by autofrom A1 A2 have r{x} ∈ A//r
using EquivClass_1_L1 quotientI by simp
with A1 I show thesis
using quotient_disj by blast

150

qed

Elements that belong to the same equivalence class are equivalent.
lemma EquivClass_1_L2A:
assumes equiv(A,r) C ∈ A//r x∈C y∈Cshows hx,yi ∈ rusing assms EquivClass_1_L2 EquivClass_1_L1 equiv_class_eq_iff
by simp

Every x is in the class of y, then they are equivalent.
lemma EquivClass_1_L2B:
assumes A1: equiv(A,r) and A2: y∈A and A3: x ∈ r{y}shows hx,yi ∈ r
proof from A2 have r{y} ∈ A//r
using quotientI by simp
with A1 A3 show thesis using
EquivClass_1_L1 equiv_class_self equiv_class_nondisjoint by blastqed

If a function is congruent then the equivalence classes of the values thatcome from the arguments from the same class are the same.
lemma EquivClass_1_L3:
assumes A1: equiv(A,r) and A2: Congruent(r,f)
and A3: C ∈ A//r x∈C y∈Cshows r{f(x)} = r{f(y)}proof from A1 A3 have hx,yi ∈ rusing EquivClass_1_L2A by simp
with A2 have hf(x),f(y)i ∈ rusing Congruent_def by simp
with A1 show thesis using equiv_class_eq by simp
qed

The values of congruent functions are in the space.
lemma EquivClass_1_L4:
assumes A1: equiv(A,r) and A2: C ∈ A//r x∈C
and A3: Congruent(r,f)
shows f(x) ∈ A
proof from A1 A2 have x∈Ausing EquivClass_1_L1 by simp
with A1 have hx,xi ∈ rusing equiv_def refl_def by simp
with A3 have hf(x),f(x)i ∈ rusing Congruent_def by simp
with A1 show thesis using equiv_type by auto
qed

151

Equivalence classes are not empty.
lemma EquivClass_1_L5:
assumes A1: refl(A,r) and A2: C ∈ A//rshows C6=0
proof from A2 obtain x where I: C = r{x} and x∈Ausing quotient_def by autofrom A1 hx∈Ai have x ∈ r{x} using refl_def by autowith I show thesis by autoqed

To avoidSusing an axiom of choice, we define the projection using the expression x∈C r({f (x)}). The next lemma shows that for congruent function
this is in the quotient space A/r.
lemma EquivClass_1_L6:
assumes A1: equiv(A,r) and A2: Congruent(r,f)
and A3: SC ∈ A//rshows ( x∈C. r{f(x)}) ∈ A//r
proof from A1 have refl(A,r) unfolding equiv_def by simp
with A3 have C6=0 using EquivClass_1_L5 by simp
moreover from A2 A3 A1 have ∀ x∈C. r{f(x)} ∈ A//r
using EquivClass_1_L4 quotientI by auto
moreover from A1 A2 A3 have
∀ x y. x∈C ∧ y∈C −→ r{f(x)} = r{f(y)}using EquivClass_1_L3 by blast
ultimately show thesis by (rule ZF1_1_L2)
qed

Congruent functions can be projected.
lemma EquivClass_1_T0:
assumes equiv(A,r) Congruent(r,f)
shows ProjFun(A,r,f) : A//r → A//r
using assms EquivClass_1_L6 ProjFun_def ZF_fun_from_total
by simpWe now define congruent functions of two variables (binary funtions). The
predicate Congruent2 corresponds to congruent2 in Isabelle’s standard EquivClass
theory, but uses ZF-functions rather than meta-functions.
definition
Congruent2(r,f) ≡(∀ x1 x2 y1 y2 . hx1 ,x2 i ∈ r ∧ hy1 ,y2 i ∈ r
hfhx1 ,y1 i, fhx2 ,y2 i i ∈ r)−→

Next we define the notion of projecting a binary operation to the quotient
space. This is a very important concept that allows to define quotientgroups, among other things.

152

definition
ProjFun2(A,r,f)≡
S{hp,z ∈ fst(p)×snd(p). r{f(z)}i. p ∈ (A//r)×(A//r) }The following lemma is a two-variables equivalent of EquivClass_1_L3.
lemma EquivClass_1_L7:
assumes A1: equiv(A,r) and A2: Congruent2(r,f)
and A3: C1 ∈ A//r C2 ∈ A//r
and A4: z1 ∈ C1 ×C2 z2 ∈ C1 ×C2
shows r{f(z1 )} = r{f(z2 )}proof from A4 obtain x1 y1 x2 y2 wherex1 ∈C1 and y1 ∈C2 and z1 = hx1 ,y1 i andx2 ∈C1 and y2 ∈C2 and z2 = hx2 ,y2 i
by autowith A1 A3 have hx1 ,x2 i ∈ r and hy1 ,y2 i ∈ rusing EquivClass_1_L2A by autowith A2 have hfhx1 ,y1 i,fhx2 ,y2 ii ∈ rusing Congruent2_def by simp
with A1 hz1 = hx1 ,y1 ii hz2 = hx2 ,y2 ii show thesis
using equiv_class_eq by simp
qed

The values of congruent functions of two variables are in the space.
lemma EquivClass_1_L8:
assumes A1: equiv(A,r) and A2: C1 ∈ A//r and A3: C2 ∈ A//r
and A4: z ∈ C1 ×C2 and A5: Congruent2(r,f)
shows f(z) ∈ A
proof from A4 obtain x y where x∈C1 and y∈C2 and z = hx,yi
by autowith A1 A2 A3 have x∈A and y∈Ausing EquivClass_1_L1 by autowith A1 A4 have hx,xi ∈ r and hy,yi ∈ rusing equiv_def refl_def by autowith A5 have hfhx,yi, fhx,yi i ∈ rusing Congruent2_def by simp
with A1 hz = hx,yii show thesis using equiv_type by autoqed

The values of congruent functions are in the space. Note that although thislemma is intended to be used with functions, we don’t need to assume thatf is a function.
lemma EquivClass_1_L8A:
assumes A1: equiv(A,r) and A2: x∈A
and A3: Congruent2(r,f)
shows fhx,yi ∈ A
proof -153y∈A

from A1 A2 have r{x} ∈ A//r r{y} ∈ A//rhx,yi ∈ r{x}×r{y}using equiv_class_self quotientI by autowith A1 A3 show thesis using EquivClass_1_L8 by simp
qed

The following lemma is a two-variables equivalent of EquivClass_1_L6.
lemma EquivClass_1_L9:
assumes A1: equiv(A,r) and A2: Congruent2(r,f)
and A3: Sp ∈ (A//r)×(A//r)shows (z ∈ fst(p)×snd(p). r{f(z)}) ∈ A//r
proof from A3 have fst(p) ∈ A//r and snd(p) ∈ A//r
by autowith A1 A2 have
I: ∀ z ∈ fst(p)×snd(p). f(z) ∈ A
using EquivClass_1_L8 by simp
from A3 A1 have fst(p)×snd(p) 6= 0
using equiv_def EquivClass_1_L5 Sigma_empty_iff
by automoreover from A1 I have∀ z ∈ fst(p)×snd(p). r{f(z)} ∈ A//r
using quotientI by simp
moreover from A1 A2 hfst(p) ∈ A//ri hsnd(p) ∈ A//ri have∀ z1 z2 . z1 ∈ fst(p)×snd(p) ∧ z2 ∈ fst(p)×snd(p) −→r{f(z1 )} = r{f(z2 )}using EquivClass_1_L7 by blast
ultimately show thesis by (rule ZF1_1_L2)
qed

Congruent functions of two variables can be projected.
theorem EquivClass_1_T1:
assumes equiv(A,r) Congruent2(r,f)
shows ProjFun2(A,r,f) : (A//r)×(A//r) → A//r
using assms EquivClass_1_L9 ProjFun2_def ZF_fun_from_total
by simp

The projection diagram commutes. I wish I knew how to draw this diagramin LaTeX.
lemma EquivClass_1_L10:
assumes A1: equiv(A,r) and A2: Congruent2(r,f)
and A3: x∈A y∈Ashows ProjFun2(A,r,f)hr{x},r{y}i = r{fhx,yi}
proof from A3 A1 have r{x} × r{y} 6= 0
using quotientI equiv_def EquivClass_1_L5 Sigma_empty_iff
by automoreover have∀ z ∈ r{x}×r{y}. r{f(z)} = r{fhx,yi}

154

prooffix z assume A4: z ∈ r{x}×r{y}from A1 A3 haver{x} ∈ A//r r{y} ∈ A//rhx,yi ∈ r{x}×r{y}using quotientI equiv_class_self by autowith A1 A2 A4 showr{f(z)} = r{fhx,yi}
using EquivClass_1_L7 by blast
qed
ultimately
haveS( z ∈ r{x}×r{y}. r{f(z)}) = r{fhx,yi}by (rule ZF1_1_L1)
moreover haveS
ProjFun2(A,r,f)hr{x},r{y}i = ( z ∈ r{x}×r{y}. r{f(z)})
proof from assms have
ProjFun2(A,r,f) : (A//r)×(A//r) → A//r
hr{x},r{y}i ∈ (A//r)×(A//r)
using EquivClass_1_T1 quotientI by auto
then show thesis using ProjFun2_def ZF_fun_from_tot_val
by autoqed
ultimately show thesis by simp
qed

16.2

Projecting commutative, associative and distributive
operations.

In this section we show that if the operations are congruent with respect toan equivalence relation then the projection to the quotient space preservescommutativity, associativity and distributivity.
The projection of commutative operation is commutative.
lemma EquivClass_2_L1: assumes
A1: equiv(A,r) and A2: Congruent2(r,f)
and A3: f {is commutative on} A
and A4: c1 ∈ A//r c2 ∈ A//rshows ProjFun2(A,r,f)hc1,c2i = ProjFun2(A,r,f)hc2,c1i
proof from A4 obtain x y where D1:
c1 = r{x} c2 = r{y}x∈A y∈A
using quotient_def by autowith A1 A2 have ProjFun2(A,r,f)hc1,c2i = r{fhx,yi}
using EquivClass_1_L10 by simp
also from A3 D1 haver{fhx,yi} = r{fhy,xi}
using IsCommutative_def by simp

155

also from A1 A2 D1 haver{fhy,xi} = ProjFun2(A,r,f) hc2,c1i
using EquivClass_1_L10 by simp
finally show thesis by simp
qed

The projection of commutative operation is commutative.
theorem EquivClass_2_T1:
assumes equiv(A,r) and Congruent2(r,f)
and f {is commutative on} Ashows ProjFun2(A,r,f) {is commutative on} A//r
using assms IsCommutative_def EquivClass_2_L1 by simp

The projection of an associative operation is associative.
lemma EquivClass_2_L2:
assumes A1: equiv(A,r) and A2: Congruent2(r,f)
and A3: f {is associative on} A
and A4: c1 ∈ A//r c2 ∈ A//r c3 ∈ A//r
and A5: g = ProjFun2(A,r,f)
shows ghghc1,c2i,c3i = ghc1,ghc2,c3ii
proof from A4 obtain x y z where D1:
c1 = r{x} c2 = r{y} c3 = r{z}x∈A y∈A z∈A
using quotient_def by autowith A3 have T1:fhx,yi ∈ A fhy,zi ∈ Ausing IsAssociative_def apply_type by autowith A1 A2 D1 A5 haveghghc1,c2i,c3i = r{fhfhx,yi,zi}
using EquivClass_1_L10 by simp
also from D1 A3 have
. . . = r{fhx,fhy,zi i}using IsAssociative_def by simp
also from T1 A1 A2 D1 A5 have
. . . = ghc1,ghc2,c3ii
using EquivClass_1_L10 by simp
finally show thesis by simp
qed

The projection of an associative operation is associative on the quotient.
theorem EquivClass_2_T2:
assumes A1: equiv(A,r) and A2: Congruent2(r,f)
and A3: f {is associative on} Ashows ProjFun2(A,r,f) {is associative on} A//r
proof let g = ProjFun2(A,r,f)from A1 A2 haveg ∈ (A//r)×(A//r) → A//r
using EquivClass_1_T1 by simp

156

moreover from A1 A2 A3 have∀ c1 ∈ A//r.∀ c2 ∈ A//r.∀ c3 ∈ A//r.
ghghc1,c2i,c3i = ghc1,ghc2,c3ii
using EquivClass_2_L2 by simp
ultimately show thesis
using IsAssociative_def by simp
qed

The essential condition to show that distributivity is preserved by projections to quotient spaces, provided both operations are congruent with respect
to the equivalence relation.
lemma EquivClass_2_L3:
assumes A1: IsDistributive(X,A,M)
and A2: equiv(X,r)
and A3: Congruent2(r,A) Congruent2(r,M)
and A4: a ∈ X//r b ∈ X//r c ∈ X//r
and A5: Ap = ProjFun2(X,r,A) Mp = ProjFun2(X,r,M)
shows Mp ha,Ap hb,cii = Ap h Mp ha,bi,Mp ha,cii ∧Mp h Ap hb,ci,a i = Ap h Mp hb,ai, Mp hc,aii
prooffrom A4 obtain x y z where x∈X y∈X z∈X
a = r{x} b = r{y} c = r{z}using quotient_def by autowith A1 A2 A3 A5 show
Mp ha,Ap hb,cii = Ap h Mp ha,bi,Mp ha,cii and
Mp h Ap hb,ci,a i = Ap h Mp hb,ai, Mp hc,aii
using EquivClass_1_L8A EquivClass_1_L10 IsDistributive_def
by autoqed

Distributivity is preserved by projections to quotient spaces, provided both
operations are congruent with respect to the equivalence relation.
lemma EquivClass_2_L4: assumes A1: IsDistributive(X,A,M)
and A2: equiv(X,r)
and A3: Congruent2(r,A) Congruent2(r,M)
shows IsDistributive(X//r,ProjFun2(X,r,A),ProjFun2(X,r,M))
proof let Ap = ProjFun2(X,r,A)
let Mp = ProjFun2(X,r,M)from A1 A2 A3 have
∀ a∈X//r.∀ b∈X//r.∀ c∈X//r.
Mp ha,Ap hb,cii = Ap hMp ha,bi,Mp ha,cii ∧Mp hAp hb,ci,ai = Ap hMp hb,ai,Mp hc,aii
using EquivClass_2_L3 by simp
then show thesis using IsDistributive_def by simp
qed

157

16.3

Saturated sets

In this section we consider sets that are saturated with respect to an equivalence relation. A set A is saturated with respect to a relation r if A =r−1 (r(A)). For equivalence relations saturated sets are unions of equivalence classes. This makes them useful as a tool to define subsets of thequoutient space using properties of representants. Namely, we often define
a set B ⊆ X/r by saying that [x]r ∈ B iff x ∈ A. If A is a saturated set, thisdefinition is consistent in the sense that it does not depend on the choice ofx to represent [x]r .
The following defines the notion of a saturated set. Recall that in Isabeller-(A) is the inverse image of A with respect to relation r. This definition is
not specific to equivalence relations.
definition
IsSaturated(r,A) ≡ A = r-(r(A))

For equivalence relations a set is saturated iff it is an image of itself.
lemma EquivClass_3_L1: assumes A1: equiv(X,r)
shows IsSaturated(r,A) ←→ A = r(A)proofassume IsSaturated(r,A)
then have A = (converse(r) O r)(A)using IsSaturated_def vimage_def image_compby simp
also from A1 have . . . = r(A)using equiv_comp_eq by simp
finally show A = r(A) by simp
next assume A = r(A)with A1 have A = (converse(r) O r)(A)using equiv_comp_eq by simp
also have . . . = r-(r(A))
using vimage_def image_comp by simp
finally have A = r-(r(A)) by simp
then show IsSaturated(r,A) using IsSaturated_def
by simpqed

For equivalence relations sets are contained in their images.
lemma EquivClass_3_L2: assumes A1: equiv(X,r) and A2: A⊆X
shows A ⊆ r(A)proof
fix a assume a∈Awith A1 A2 have a ∈ r{a}using equiv_class_self by autowith ha∈Ai show a ∈ r(A) by auto
qed

158

The next lemma shows that if ”∼” is an equivalence relation and a set A issuch that a ∈ A and a ∼ b implies b ∈ A, then A is saturated with respect
to the relation.
lemma EquivClass_3_L3: assumes A1: equiv(X,r)
and A2: r ⊆ X×X and A3: A⊆X
and A4: ∀ x∈A. ∀ y∈X. hx,yi ∈ r −→ y∈Ashows IsSaturated(r,A)
proof from A2 A4 have r(A) ⊆ A
using image_iff by blast
moreover from A1 A3 have A ⊆ r(A)using EquivClass_3_L2 by simp
ultimately have A = r(A) by autowith A1 show IsSaturated(r,A) using EquivClass_3_L1
by simpqed

If A ⊆ X and A is saturated and x ∼ y, then x ∈ A iff y ∈ A. Here we show
only one direction.
lemma EquivClass_3_L4: assumes A1: equiv(X,r)
and A2: IsSaturated(r,A) and A3: A⊆X
and A4: hx,yi ∈ r
and A5: x∈X y∈Ashows x∈A
proof from A1 A5 have x ∈ r{x}using equiv_class_self by simp
with A1 A3 A4 A5 have x ∈ r(A)using equiv_class_eq equiv_class_selfby autowith A1 A2 show x∈Ausing EquivClass_3_L1 by simp
qed

If A ⊆ X and A is saturated and x ∼ y, then x ∈ A iff y ∈ A.
lemma EquivClass_3_L5: assumes A1: equiv(X,r)
and A2: IsSaturated(r,A) and A3: A⊆X
and A4: x∈X y∈X
and A5: hx,yi ∈ rshows x∈A ←→ y∈A
proof
assume y∈Awith assms show x∈A using EquivClass_3_L4
by simpnext assume x∈Afrom A1 A5 have hy,xi ∈ rusing equiv_is_sym by blast
with A1 A2 A3 A4 hx∈Ai show y∈A

159

using EquivClass_3_L4 by simp
qed

If A is saturated then x ∈ A iff its class is in the projection of A.
lemma EquivClass_3_L6: assumes A1: equiv(X,r)
and A2: IsSaturated(r,A) and A3: A⊆X and A4: x∈X
and A5: B = {r{x}. x∈A}
shows x∈A ←→ r{x} ∈ B
proof
assume x∈Awith A5 show r{x} ∈ B by auto
next assume r{x} ∈ Bwith A5 obtain y where y ∈ A and r{x} = r{y}by autowith A1 A3 have hx,yi ∈ rusing eq_equiv_class by autowith A1 A2 A3 A4 hy ∈ Ai show x∈Ausing EquivClass_3_L4 by simpqed

A technical lemma involving a projection of a saturated set and a logicalepression with exclusive or. Note that we don’t really care what Xor is here,
this is true for any predicate.
lemma EquivClass_3_L7: assumes equiv(X,r)
and IsSaturated(r,A) and A⊆X
and x∈X y∈X
and B = {r{x}. x∈A}
and (x∈A) Xor (y∈A)
shows (r{x} ∈ B) Xor (r{y} ∈ B)
using assms EquivClass_3_L6 by simp
end

17

Finite sequences

theory FiniteSeq_ZF imports Nat_ZF_IML func1
beginThis theory treats finite sequences (i.e. maps n → X, where n = {0, 1, .., n−1} is a natural number) as lists. It defines and proves the properties of basic
operations on lists: concatenation, appending and element etc.

17.1

Lists as finite sequences

A natural way of representing (finite) lists in set theory is through (finite)sequences. In such view a list of elements of a set X is a function that maps
160the set {0, 1, ..n−1} into X. Since natural numbers in set theory are definedso that n = {0, 1, ..n − 1}, a list of length n can be understood as an elementof the function space n → X.
We define the set of lists with values in set X as Lists(X).
definitionS
Lists(X) ≡n∈nat.(n→X)

The set of nonempty X-value listst will be called NELists(X).
definitionS
NELists(X) ≡n∈nat.(succ(n)→X)

We first define the shift that moves the second sequence to the domain{n, .., n + k − 1}, where n, k are the lengths of the first and the second
sequence, resp. To understand the notation in the definitions below recall
that in Isabelle/ZF pred(n) is the previous natural number and denotes thedifference between natural numbers n and k.
definition
ShiftedSeq(b,n) ≡ {hj, b(j #- n)i. j ∈ NatInterval(n,domain(b))}

We define concatenation of two sequences as the union of the first sequencewith the shifted second sequence. The result of concatenating lists a and b
is called Concat(a,b).
definition
Concat(a,b) ≡ a ∪ ShiftedSeq(b,domain(a))

For a finite sequence we define the sequence of all elements except the firstone. This corresponds to the ”tail” function in Haskell. We call it Tail here
as well.
definition
Tail(a) ≡ {hk, a(succ(k))i. k ∈ pred(domain(a))}

A dual notion to Tail is the list of all elements of a list except the last one.
Borrowing the terminology from Haskell again, we will call this Init.
definition
Init(a) ≡ restrict(a,pred(domain(a)))

Another obvious operation we can talk about is appending an element at
the end of a sequence. This is called Append.
definition
Append(a,x) ≡ a ∪ {hdomain(a),xi}

If lists are modeled as finite sequences (i.e. functions on natural intervals{0, 1, .., n − 1} = n) it is easy to get the first element of a list as the valueof the sequence at 0. The last element is the value at n − 1. To hide thisbehind a familiar name we define the Last element of a list.
161

definition
Last(a) ≡ a(pred(domain(a)))

Shifted sequence is a function on a the interval of natural numbers.
lemma shifted_seq_props:
assumes A1: n ∈ nat k ∈ nat and A2: b:k→X
shows
ShiftedSeq(b,n): NatInterval(n,k) → X∀ i ∈ NatInterval(n,k). ShiftedSeq(b,n)(i) = b(i #- n)∀ j∈k. ShiftedSeq(b,n)(n #+ j) = b(j)proof let I = NatInterval(n,domain(b))
from A2 have Fact: I = NatInterval(n,k) using func1_1_L1 by simp
with A1 A2 have ∀ j∈ I. b(j #- n) ∈ X
using inter_diff_in_len apply_funtype by simp
then have{hj, b(j #- n)i. j ∈ I} : I → X by (rule ZF_fun_from_total)
with Fact show thesis_1: ShiftedSeq(b,n): NatInterval(n,k) → X
using ShiftedSeq_def by simp
{ fix ifrom Fact thesis_1 have ShiftedSeq(b,n): I → X by simp
moreoverassume i ∈ NatInterval(n,k)
with Fact have i ∈ I by simp
moreover from Fact have
ShiftedSeq(b,n) = {hi, b(i #- n)i. i ∈ I}
using ShiftedSeq_def by simp
ultimately have ShiftedSeq(b,n)(i) = b(i #- n)by (rule ZF_fun_from_tot_val)} then show thesis1:∀ i ∈ NatInterval(n,k). ShiftedSeq(b,n)(i) = b(i #- n)by simp{ fix jlet i = n #+ jassume A3: j∈kwith A1 have j ∈ nat using elem_nat_is_nat by blast
then have i #- n = j using diff_add_inverse by simp
with A3 thesis1 have ShiftedSeq(b,n)(i) = b(j)using NatInterval_def by auto
} then show ∀ j∈k. ShiftedSeq(b,n)(n #+ j) = b(j)by simpqed

Basis properties of the contatenation of two finite sequences.
theorem concat_props:
assumes A1: n ∈ nat k ∈ nat and A2: a:n→Xshows
Concat(a,b): n #+ k → X∀ i∈n. Concat(a,b)(i) = a(i)

162

b:k→X

∀ i ∈ NatInterval(n,k). Concat(a,b)(i) = b(i #- n)∀ j ∈ k. Concat(a,b)(n #+ j) = b(j)proof from A1 A2 have
a:n→X and I: ShiftedSeq(b,n): NatInterval(n,k) → X
and n ∩ NatInterval(n,k) = 0
using shifted_seq_props length_start_decomp by auto
then havea ∪ ShiftedSeq(b,n): n ∪ NatInterval(n,k) → X ∪ X
by (rule fun_disjoint_Un)
with A1 A2 show Concat(a,b): n #+ k → X
using func1_1_L1 Concat_def length_start_decomp by auto
{ fix i assume i ∈ nwith A1 I have i ∈/ domain(ShiftedSeq(b,n))using length_start_decomp func1_1_L1 by autowith A2 have Concat(a,b)(i) = a(i)using func1_1_L1 fun_disjoint_apply1 Concat_def by simp
} thus ∀ i∈n. Concat(a,b)(i) = a(i) by simp
{ fix i assume A3: i ∈ NatInterval(n,k)
with A1 A2 have i ∈/ domain(a)using length_start_decomp func1_1_L1 by autowith A1 A2 A3 have Concat(a,b)(i) = b(i #- n)using func1_1_L1 fun_disjoint_apply2 Concat_def shifted_seq_props
by simp} thus II: ∀ i ∈ NatInterval(n,k). Concat(a,b)(i) = b(i #- n)by simp{ fix jlet i = n #+ jassume A3: j∈kwith A1 have j ∈ nat using elem_nat_is_nat by blast
then have i #- n = j using diff_add_inverse by simp
with A3 II have Concat(a,b)(i) = b(j)using NatInterval_def by auto
} thus ∀ j ∈ k. Concat(a,b)(n #+ j) = b(j)by simpqed

Properties of concatenating three lists.
lemma concat_concat_list:
assumes A1: n ∈ nat k ∈ nat m ∈ nat andA2: a:n→X
b:k→X c:m→X andA3: d = Concat(Concat(a,b),c)shows
d : n #+k #+ m → X∀ j ∈ n. d(j) = a(j)∀ j ∈ k. d(n #+ j) = b(j)∀ j ∈ m. d(n #+ k #+ j) = c(j)proof from A1 A2 have I:163

n #+ k ∈ natm ∈ natConcat(a,b): n #+ k → X
c:m→Xusing concat_props by autowith A3 show d: n #+k #+ m → X
using concat_props by simp
from I have II: ∀ i ∈ n #+ k.
Concat(Concat(a,b),c)(i) = Concat(a,b)(i)by (rule concat_props){ fix j assume A4: j ∈ nmoreover from A1 have n ⊆ n #+ k using add_nat_le by simp
ultimately have j ∈ n #+ k by autowith A3 II have d(j) = Concat(a,b)(j) by simp
with A1 A2 A4 have d(j) = a(j)using concat_props by simp
} thus ∀ j ∈ n. d(j) = a(j) by simp
{ fix j assume A5: j ∈ kwith A1 A3 II have d(n #+ j) = Concat(a,b)(n #+ j)using add_lt_mono by simp
also from A1 A2 A5 have . . . = b(j)using concat_props by simp
finally have d(n #+ j) = b(j) by simp
} thus ∀ j ∈ k. d(n #+ j) = b(j) by simp
from I have ∀ j ∈ m. Concat(Concat(a,b),c)(n #+ k #+ j) = c(j)by (rule concat_props)
with A3 show ∀ j ∈ m. d(n #+ k #+ j) = c(j)by simpqed

Properties of concatenating a list with a concatenation of two other lists.
lemma concat_list_concat:
assumes A1: n ∈ nat k ∈ nat m ∈ nat andA2: a:n→X
b:k→X c:m→X andA3: e = Concat(a, Concat(b,c))shows
e : n #+k #+ m → X∀ j ∈ n. e(j) = a(j)∀ j ∈ k. e(n #+ j) = b(j)∀ j ∈ m. e(n #+ k #+ j) = c(j)proof from A1 A2 have I:n ∈ nat k #+ m ∈ nat
a:n→X Concat(b,c): k #+ m → X
using concat_props by autowith A3 show e : n #+k #+ m → X
using concat_props add_assoc by simp
from I have ∀ j ∈ n. Concat(a, Concat(b,c))(j) = a(j)by (rule concat_props)
with A3 show ∀ j ∈ n. e(j) = a(j) by simp
from I have II:164∀ j ∈ k #+ m. Concat(a, Concat(b,c))(n #+ j) = Concat(b,c)(j)by (rule concat_props){ fix j assume A4: j ∈ kmoreover from A1 have k ⊆ k #+ m using add_nat_le by simp
ultimately have j ∈ k #+ m by autowith A3 II have e(n #+ j) = Concat(b,c)(j) by simp
also from A1 A2 A4 have . . . = b(j)using concat_props by simp
finally have e(n #+ j) = b(j) by simp
} thus ∀ j ∈ k. e(n #+ j) = b(j) by simp
{ fix j assume A5: j ∈ mwith A1 II A3 have e(n #+ k #+ j) = Concat(b,c)(k #+ j)using add_lt_mono add_assoc by simp
also from A1 A2 A5 have . . . = c(j)using concat_props by simp
finally have e(n #+ k #+ j) = c(j) by simp
} then show ∀ j ∈ m. e(n #+ k #+ j) = c(j)by simpqed

Concatenation is associative.
theorem concat_assoc:
assumes A1: n ∈ nat k ∈ nat m ∈ nat andA2: a:n→X
b:k→X
c:m→X
shows Concat(Concat(a,b),c) = Concat(a, Concat(b,c))
proof let d = Concat(Concat(a,b),c)
let e = Concat(a, Concat(b,c))from A1 A2 haved : n #+k #+ m → X and e : n #+k #+ m → X
using concat_concat_list concat_list_concat by auto
moreover have ∀ i ∈ n #+k #+ m. d(i) = e(i)proof { fix i assume i ∈ n #+k #+ mmoreover from A1 haven #+k #+ m = n ∪ NatInterval(n,k) ∪ NatInterval(n #+ k,m)using adjacent_intervals3 by simp
ultimately havei ∈ n ∨ i ∈ NatInterval(n,k) ∨ i ∈ NatInterval(n #+ k,m)by simpmoreover{ assume i ∈ nwith A1 A2 have d(i) = e(i)using concat_concat_list concat_list_concat by simp }moreover{ assume i ∈ NatInterval(n,k)
then obtain j where j∈k and i = n #+ jusing NatInterval_def by autowith A1 A2 have d(i) = e(i)165using concat_concat_list concat_list_concat by simp }moreover{ assume i ∈ NatInterval(n #+ k,m)then obtain j where j ∈ m and i = n #+ k #+ jusing NatInterval_def by autowith A1 A2 have d(i) = e(i)using concat_concat_list concat_list_concat by simp }ultimately have d(i) = e(i) by auto
} thus thesis by simp
qed
ultimately show d = e by (rule func_eq)
qed

Properties of Tail.
theorem tail_props:
assumes A1: n ∈ nat and A2: a: succ(n) → X
shows
Tail(a) : n → X∀ k ∈ n. Tail(a)(k) = a(succ(k))
proof from A1 A2 have ∀ k ∈ n. a(succ(k)) ∈ X
using succ_ineq apply_funtype by simp
then have {hk, a(succ(k))i. k ∈ n} : n → X
by (rule ZF_fun_from_total)
with A2 show I: Tail(a) : n → X
using func1_1_L1 pred_succ_eq Tail_def by simp
moreover from A2 have Tail(a) = {hk, a(succ(k))i. k ∈ n}using func1_1_L1 pred_succ_eq Tail_def by simp
ultimately show ∀ k ∈ n. Tail(a)(k) = a(succ(k))
by (rule ZF_fun_from_tot_val0)
qed

Properties of Append. It is a bit surprising that the we don’t need to assume
that n is a natural number.
theorem append_props:
assumes A1: a: n → X and A2: x∈X and A3: b = Append(a,x)
showsb : succ(n) → X∀ k∈n. b(k) = a(k)b(n) = x
proof note A1
moreover have I: n ∈/ n using mem_not_refl by simp
moreover from A1 A3 have II: b = a ∪ {hn,xi}
using func1_1_L1 Append_def by simp
ultimately have b : n ∪ {n} → X ∪ {x}by (rule func1_1_L11D)
with A2 show b : succ(n) → X
using succ_explained set_elem_add by simp

166

from A1 I II show ∀ k∈n. b(k) = a(k) and b(n) = x
using func1_1_L11D by autoqed

A special case of append_props: appending to a nonempty list does notchange the head (first element) of the list.
corollary head_of_append:assumes n∈ nat and a: succ(n) → X and x∈Xshows Append(a,x)(0) = a(0)using assms append_props empty_in_every_succ by auto
Tail commutes with Append.
theorem tail_append_commute:assumes A1: n ∈ nat and A2: a: succ(n) → X and A3: x∈Xshows Append(Tail(a),x) = Tail(Append(a,x))
proof let b = Append(Tail(a),x)
let c = Tail(Append(a,x))from A1 A2 have I: Tail(a) : n → X using tail_props
by simpfrom A1 A2 A3 havesucc(n) ∈ nat and Append(a,x) : succ(succ(n)) → X
using append_props by auto
then have II: ∀ k ∈ succ(n). c(k) = Append(a,x)(succ(k))
by (rule tail_props)
from assms haveb : succ(n) → X and c : succ(n) → X
using tail_props append_props by auto
moreover have ∀ k ∈ succ(n). b(k) = c(k)proof { fix k assume k ∈ succ(n)hence k ∈ n ∨ k = n by auto
moreover{ assume A4: k ∈ nwith assms II have c(k) = a(succ(k))
using succ_ineq append_props by simp
moreoverfrom A3 I have ∀ k∈n. b(k) = Tail(a)(k)using append_props by simp
with A1 A2 A4 have b(k) = a(succ(k))
using tail_props by simp
ultimately have b(k) = c(k) by simp }moreover{ assume A5: k = n
with A2 A3 I II have b(k) = c(k)using append_props by auto }
ultimately have b(k) = c(k) by auto
} thus thesis by simp
qed

167

ultimately show b = c by (rule func_eq)
qed

Properties of Init.
theorem init_props:
assumes A1: n ∈ nat and A2: a: succ(n) → X
shows
Init(a) : n → X∀ k∈n. Init(a)(k) = a(k)a = Append(Init(a), a(n))
proof have n ⊆ succ(n) by autowith A2 have restrict(a,n): n → X
using restrict_type2 by simp
moreover from A1 A2 have I: restrict(a,n) = Init(a)using func1_1_L1 pred_succ_eq Init_def by simp
ultimately show thesis1: Init(a) : n → X by simp
{ fix k assume k∈nthen have restrict(a,n)(k) = a(k)using restrict by simp
with I have Init(a)(k) = a(k) by simp
} then show thesis2: ∀ k∈n. Init(a)(k) = a(k) by simp
let b = Append(Init(a), a(n))
from A2 thesis1 have II:
Init(a) : n → X
a(n) ∈ X
b = Append(Init(a), a(n))
using apply_funtype by auto
note A2
moreover from II have b : succ(n) → X
by (rule append_props)
moreover have ∀ k ∈ succ(n). a(k) = b(k)proof { fix k assume A3: k ∈ nfrom II have ∀ j∈n. b(j) = Init(a)(j)by (rule append_props)
with thesis2 A3 have a(k) = b(k) by simp }moreoverfrom II have b(n) = a(n)by (rule append_props)
hence a(n) = b(n) by simp
ultimately show ∀ k ∈ succ(n). a(k) = b(k)by simpqed
ultimately show a = b by (rule func_eq)
qed

If we take init of the result of append, we get back the same list.
lemma init_append: assumes A1: n ∈ nat and A2: a:n→X and A3: x ∈ Xshows Init(Append(a,x)) = a

168

proof from A2 A3 have Append(a,x): succ(n)→X using append_props by simp
with A1 have Init(Append(a,x)):n→X and ∀ k∈n. Init(Append(a,x))(k)= Append(a,x)(k)using init_props by autowith A2 A3 have ∀ k∈n. Init(Append(a,x))(k) = a(k) using append_props
by simpwith hInit(Append(a,x)):n→Xi A2 show thesis by (rule func_eq)
qed

A reformulation of definition of Init.
lemma init_def: assumes n ∈ nat and x:succ(n)→Xshows Init(x) = restrict(x,n)
using assms func1_1_L1 Init_def by simp

A lemma about extending a finite sequence by one more value. This is justa more explicit version of append_props.
lemma finseq_extend:
assumes a:n→Xy∈Xb = a ∪ {hn,yi}
shows
b: succ(n) → X∀ k∈n. b(k) = a(k)b(n) = yusing assms Append_def func1_1_L1 append_props by auto

The next lemma is a bit displaced as it is mainly about finite sets. It is
proven here because it uses the notion of Append. Suppose we have a list ofelement of A is a bijection. Then for every element that does not belong to
A we can we can construct a bijection for the set A ∪ {x} by appending x.
This is just a specialised version of lemma bij_extend_point from func1.thy.
lemma bij_append_point:
assumes A1: n ∈ nat and A2: b ∈ bij(n,X) and A3: x ∈/ Xshows Append(b,x) ∈ bij(succ(n), X ∪ {x})proof from A2 A3 have b ∪ {hn,xi} ∈ bij(n ∪ {n},X ∪ {x})using mem_not_refl bij_extend_point by simp
moreover have Append(b,x) = b ∪ {hn,xi}
proof from A2 have b:n→Xusing bij_def surj_def by simp
then have b : n → X ∪ {x} using func1_1_L1B
by blast
then show Append(b,x) = b ∪ {hn,xi}
using Append_def func1_1_L1 by simp
qed
ultimately show thesis using succ_explained by auto
qed

169

The next lemma rephrases the definition of Last. Recall that in ZF we have{0, 1, 2, .., n} = n + 1 =succ(n).
lemma last_seq_elem: assumes a: succ(n) → X shows Last(a) = a(n)using assms func1_1_L1 pred_succ_eq Last_def by simp

If two finite sequences are the same when restricted to domain one shorter
than the original and have the same value on the last element, then they are
equal.
lemma finseq_restr_eq: assumes A1: n ∈ nat andA2: a: succ(n) → X b: succ(n) → X andA3: restrict(a,n) = restrict(b,n) andA4: a(n) = b(n)shows a = b
proof { fix k assume k ∈ succ(n)then have k ∈ n ∨ k = n by auto
moreover{ assume k ∈ nthen haverestrict(a,n)(k) = a(k) and restrict(b,n)(k) = b(k)using restrict by autowith A3 have a(k) = b(k) by simp }moreover{ assume k = n
with A4 have a(k) = b(k) by simp }ultimately have a(k) = b(k) by auto
} then have ∀ k ∈ succ(n). a(k) = b(k) by simp
with A2 show a = b by (rule func_eq)
qed

Concatenating a list of length 1 is the same as appending its first (and only)
element. Recall that in ZF set theory 1 = {0}.
lemma append_1elem: assumes A1: n ∈ nat andA2: a: n → X and A3: b : 1 → X
shows Concat(a,b) = Append(a,b(0))
proof let C = Concat(a,b)
let A = Append(a,b(0))
from A1 A2 A3 have I:n ∈ nat 1 ∈ nat
a:n→X
b:1→X by auto
have C : succ(n) → X
proof from I have C : n #+ 1 → X
by (rule concat_props)
with A1 show C : succ(n) → X by simp
qed
moreover from A2 A3 have A : succ(n) → X

170

using apply_funtype append_props by simp
moreover have ∀ k ∈ succ(n). C(k) = A(k)proof
fix k assume k ∈ succ(n)moreover{ assume k ∈ nmoreover from I have ∀ i ∈ n. C(i) = a(i)by (rule concat_props)
moreover from A2 A3 have ∀ i∈n. A(i) = a(i)using apply_funtype append_props by simp
ultimately have C(k) = A(k) by simp }moreover have C(n) = A(n)proof from I have ∀ j ∈ 1. C(n #+ j) = b(j)by (rule concat_props)
with A1 A2 A3 show C(n) = A(n)using apply_funtype append_props by simp
qed
ultimately show C(k) = A(k) by autoqed
ultimately show C = A by (rule func_eq)
qed

A simple lemma about lists of length 1.
lemma list_len1_singleton: assumes A1: x∈Xshows {h0,xi} : 1 → X
proof from A1 have {h0,xi} : {0} → X using pair_func_singleton
by simpmoreover have {0} = 1 by auto
ultimately show thesis by simpqed

A singleton list is in fact a singleton set with a pair as the only element.
lemma list_singleton_pair: assumes A1: x:1→X shows x = {h0,x(0)i}
proof from A1 have x = {ht,x(t)i. t∈1} by (rule fun_is_set_of_pairs)
hence x = {ht,x(t)i. t∈{0} } by simp
thus thesis by simp
qed

When we append an element to the empty list we get a list with length 1.
lemma empty_append1: assumes A1: x∈Xshows Append(0,x): 1 → X and Append(0,x)(0) = x
proof let a = Append(0,x)
have a = {h0,xi} using Append_def by autowith A1 show a : 1 → X and a(0) = x
using list_len1_singleton pair_func_singleton

171

by autoqed

Appending an element is the same as concatenating with certain pair.
lemma append_concat_pair:assumes n ∈ nat and a: n → X and x∈Xshows Append(a,x) = Concat(a,{h0,xi})
using assms list_len1_singleton append_1elem pair_val
by simp

An associativity property involving concatenation and appending. For proof
we just convert appending to concatenation and use concat_assoc.
lemma concat_append_assoc: assumes A1: n ∈ nat k ∈ nat andA2: a:n→X
b:k→X and A3: x ∈ Xshows Append(Concat(a,b),x) = Concat(a, Append(b,x))
proof from A1 A2 A3 haven #+ k ∈ nat
Concat(a,b) : n #+ k → X
x ∈ X
using concat_props by auto
then have
Append(Concat(a,b),x) = Concat(Concat(a,b),{h0,xi})by (rule append_concat_pair)moreoverfrom A1 A2 A3 haven ∈ nat k ∈ nat 1 ∈ nat
a:n→X
b:k→X {h0,xi} : 1 → X
using list_len1_singleton by auto
then have
Concat(Concat(a,b),{h0,xi}) = Concat(a, Concat(b,{h0,xi}))by (rule concat_assoc)
moreover from A1 A2 A3 have Concat(b,{h0,xi}) = Append(b,x)
using list_len1_singleton append_1elem pair_val by simp
ultimately show Append(Concat(a,b),x) = Concat(a, Append(b,x))
by simpqed

An identity involving concatenating with init and appending the last element.
lemma concat_init_last_elem:
assumes n ∈ nat k ∈ nat anda: n → X and b : succ(k) → X
shows Append(Concat(a,Init(b)),b(k)) = Concat(a,b)
using assms init_props apply_funtype concat_append_assoc
by simpA lemma about creating lists by composition and how Append behaves insuch case.
lemma list_compose_append:172

assumes A1: n ∈ nat and A2: a : n → X andA3: x ∈ X and A4: c : X → Y
shows
c O Append(a,x) : succ(n) → Y
c O Append(a,x) = Append(c O a, c(x))
proof let b = Append(a,x)
let d = Append(c O a, c(x))
from A2 A4 have c O a : n → Yusing comp_fun by simp
from A2 A3 have b : succ(n) → X
using append_props by simp
with A4 show c O b : succ(n) → Y
using comp_fun by simp
moreover from A3 A4 hc O a : n → Yi haved: succ(n) → Y
using apply_funtype append_props by simp
moreover have ∀ k ∈ succ(n). (c O b) (k) = d(k)proof { fix k assume k ∈ succ(n)with hb : succ(n) → Xi have(c O b) (k) = c(b(k))
using comp_fun_apply by simp
with A2 A3 A4 hc O a : n → Yi hc O a : n → Yi hk ∈ succ(n)ihave (c O b) (k) = d(k)using append_props comp_fun_apply apply_funtype
by auto} thus thesis by simp
qed
ultimately show c O b = d by (rule func_eq)
qed

A lemma about appending an element to a list defined by set comprehension.
lemma set_list_append: assumes
A1: ∀ i ∈ succ(k). b(i) ∈ X andA2: a = {hi,b(i)i. i ∈ succ(k)}showsa: succ(k) → X{hi,b(i)i. i ∈ k}: k → X
a = Append({hi,b(i)i. i ∈ k},b(k))
proof from A1 have {hi,b(i)i. i ∈ succ(k)} : succ(k) → X
by (rule ZF_fun_from_total)
with A2 show a: succ(k) → X by simp
from A1 have ∀ i ∈ k. b(i) ∈ X
by simpthen show {hi,b(i)i. i ∈ k}: k → X
by (rule ZF_fun_from_total)
with A2 show a = Append({hi,b(i)i. i ∈ k},b(k))

173using func1_1_L1 Append_def by autoqed

An induction theorem for lists.
lemma list_induct: assumes A1: ∀ b∈1→X. P(b) andA2: ∀ b∈NELists(X). P(b) −→ (∀ x∈X. P(Append(b,x))) andA3: d ∈ NELists(X)shows P(d)proof { fix nassume n∈nat
moreover from A1 have ∀ b∈succ(0)→X. P(b) by simp
moreover have ∀ k∈nat. ((∀ b∈succ(k)→X. P(b)) −→ (∀ c∈succ(succ(k))→X.
P(c)))
proof { fix k assume k ∈ nat assume ∀ b∈succ(k)→X. P(b)have ∀ c∈succ(succ(k))→X. P(c)proof
fix c assume c: succ(succ(k))→X
let b = Init(c)let x = c(succ(k))
from hk ∈ nati hc: succ(succ(k))→Xi have b:succ(k)→X
using init_props by simp
with A2 hk ∈ nati h∀ b∈succ(k)→X. P(b)i have ∀ x∈X. P(Append(b,x))
using NELists_def by autowith hc: succ(succ(k))→Xi have P(Append(b,x)) using apply_funtype
by simpwith hk ∈ nati hc: succ(succ(k))→Xi show P(c)using init_props by simp
qed
} thus thesis by simp
qed
ultimately have ∀ b∈succ(n)→X. P(b) by (rule ind_on_nat)} with A3 show thesis using NELists_def by auto
qed

17.2

Lists and cartesian products

Lists of length n of elements of some set X can be thought of as a model ofthe cartesian product X n which is more convenient in many applications.
There is a natural bijection between the space (n + 1) → X of lists of lengthn + 1 of elements of X and the cartesian product (n → X) × X.
lemma lists_cart_prod: assumes n ∈ nat
shows {hx,hInit(x),x(n)ii. x ∈ succ(n)→X} ∈ bij(succ(n)→X,(n→X)×X)
proof let f = {hx,hInit(x),x(n)ii. x ∈ succ(n)→X}
from assms have ∀ x ∈ succ(n)→X. hInit(x),x(n)i ∈ (n→X)×X
using init_props succ_iff apply_funtype by simp

174

then have I: f: (succ(n)→X)→((n→X)×X) by (rule ZF_fun_from_total)
moreover from assms I have ∀ x∈succ(n)→X.∀ y∈succ(n)→X. f(x)=f(y)−→ x=yusing ZF_fun_from_tot_val init_def finseq_restr_eq by auto
moreover have ∀ p∈(n→X)×X.∃ x∈succ(n)→X. f(x) = p
proof
fix p assume p ∈ (n→X)×X
let x = Append(fst(p),snd(p))
from assms hp ∈ (n→X)×Xi have x:succ(n)→X using append_props by
simpwith I have f(x) = hInit(x),x(n)i using succ_iff ZF_fun_from_tot_val
by simpmoreover from assms hp ∈ (n→X)×Xi have Init(x) = fst(p) and x(n)= snd(p)using init_append append_props by auto
ultimately have f(x) = hfst(p),snd(p)i by autowith hp ∈ (n→X)×Xi hx:succ(n)→Xi show ∃ x∈succ(n)→X. f(x) = p by
auto
qedultimately show thesis using inj_def surj_def bij_def by autoqed

We can identify a set X with lists of length one of elements of X.
lemma singleton_list_bij: shows {hx,x(0)i. x∈1→X} ∈ bij(1→X,X)
proof let f = {hx,x(0)i. x∈1→X}
have ∀ x∈1→X. x(0) ∈ X using apply_funtype by simp
then have I: f:(1→X)→X by (rule ZF_fun_from_total)
moreover have ∀ x∈1→X.∀ y∈1→X. f(x) = f(y) −→ x=y
proof { fix x yassume x:1→X y:1→X and f(x) = f(y)with I have x(0) = y(0) using ZF_fun_from_tot_val by auto
moreover from hx:1→Xi hy:1→Xi have x = {h0,x(0)i} and y = {h0,y(0)i}using list_singleton_pair by auto
ultimately have x=y by simp
} thus thesis by autoqed
moreover have ∀ y∈X. ∃ x∈1→X. f(x)=y
proof
fix y assume y∈X
let x = {h0,yi}
from I hy∈Xi have x:1→X and f(x) = yusing list_len1_singleton ZF_fun_from_tot_val pair_val by auto
thus ∃ x∈1→X. f(x)=y by autoqed
ultimately show thesis using inj_def surj_def bij_def by simp
qed

175

We can identify a set of X-valued lists of length with X.
lemma list_singleton_bij: shows{hx,{h0,xi}i.x∈X} ∈ bij(X,1→X) and{hy,y(0)i. y∈1→X} = converse({hx,{h0,xi}i.x∈X}) and{hx,{h0,xi}i.x∈X} = converse({hy,y(0)i. y∈1→X})
proof let f = {hy,y(0)i. y∈1→X}
let g = {hx,{h0,xi}i.x∈X}
have 1 = {0} by auto
then have f ∈ bij(1→X,X) and g:X→(1→X)
using singleton_list_bij pair_func_singleton ZF_fun_from_total
by automoreover have ∀ y∈1→X.g(f(y)) = y
proof
fix y assume y:1→X
have f:(1→X)→X using singleton_list_bij bij_def inj_def by simp
with h1 = {0}i hy:1→Xi hg:X→(1→X)i show g(f(y)) = yusing ZF_fun_from_tot_val apply_funtype func_singleton_pair
by simpqed
ultimately show g ∈ bij(X,1→X) and f = converse(g) and g = converse(f)using comp_conv_id by autoqedWhat is the inverse image of a set by the natural bijection between X-valued
singleton lists and X?
lemma singleton_vimage: assumes U⊆X shows {x∈1→X. x(0) ∈ U} = { {h0,yi}.
y∈U}
proof
have 1 = {0} by auto
{ fix x assume x ∈ {x∈1→X. x(0) ∈ U}
with h1 = {0}i have x = {h0, x(0)i} using func_singleton_pair by auto
} thus {x∈1→X. x(0) ∈ U} ⊆ { {h0,yi}. y∈U} by auto
{ fix x assume x ∈ { {h0,yi}. y∈U}then obtain y where x = {h0,yi} and y∈U by autowith h1 = {0}i assms have x:1→X using pair_func_singleton by auto
} thus { {h0,yi}. y∈U} ⊆ {x∈1→X. x(0) ∈ U} by autoqed

A technical lemma about extending a list by values from a set.
lemma list_append_from: assumes A1: n ∈ nat and A2: U ⊆ n→X and A3:
V ⊆ X
shows
S
{x ∈ succ(n)→X. Init(x) ∈ U ∧ x(n) ∈ V} = ( y∈V.{Append(x,y).x∈U})
proof { fix x assume x ∈ {x ∈ succ(n)→X. Init(x) ∈ U ∧ x(n) ∈ V}
then have x ∈ succ(n)→X and Init(x) ∈ U and I: x(n) ∈ V

176

by auto
let y = x(n)from A1 and hx ∈ succ(n)→Xi have x = Append(Init(x),y)using init_props by simp
Swith I and hInit(x) ∈ Ui have x ∈ ( y∈V.{Append(a,y).a∈U}) by auto}
moreoverS{ fix x assume x ∈ ( y∈V.{Append(a,y).a∈U})then obtain a y where y∈V and a∈U and x = Append(a,y) by autowith A2 A3 have x: succ(n)→X using append_props by blastfrom A2 A3 hy∈Vi ha∈Ui have a:n→X and y∈X by autowith A1 ha∈Ui hy∈Vi hx = Append(a,y)i have Init(x) ∈ U and x(n) ∈Vusing append_props init_append by autowith hx: succ(n)→Xi have x ∈ {x ∈ succ(n)→X. Init(x) ∈ U ∧ x(n)∈ V}
by auto}ultimately show thesis by blast
qed
end

18

Inductive sequences

theory InductiveSeq_ZF imports Nat_ZF_IML FiniteSeq_ZF
begin

In this theory we discuss sequences defined by conditions of the form a0 =x, an+1 = f (an ) and similar.

18.1

Sequences defined by induction

One way of defining a sequence (that is a function a : N → X) is to provide
the first element of the sequence and a function to find the next value when
we have the current one. This is usually called ”defining a sequence by
induction”. In this section we set up the notion of a sequence defined byinduction and prove the theorems needed to use it.
First we define a helper notion of the sequence defined inductively up to agiven natural number n.
definition
InductiveSequenceN(x,f,n) ≡THE a. a: succ(n) → domain(f) ∧ a(0) = x ∧ (∀ k∈n. a(succ(k)) = f(a(k)))

From that we define the inductive sequence on the whole set of natural

177

numbers. Recall that in Isabelle/ZF the set of natural numbers is denotednat.
definition
S
InductiveSequence(x,f) ≡n∈nat. InductiveSequenceN(x,f,n)First we will consider the question of existence and uniqueness of finite
inductive sequences. The proof is by induction and the next lemma is theP (0) step. To understand the notation recall that for natural numbers in
set theory we have n = {0, 1, .., n − 1} and succ(n)= {0, 1, .., n}.
lemma indseq_exun0: assumes A1: f: X→X and A2: x∈Xshows∃ ! a. a: succ(0) → X ∧ a(0) = x ∧ ( ∀ k∈0. a(succ(k)) = f(a(k)) )proof
fix a bassume A3:
a: succ(0) → X ∧ a(0) = x ∧ ( ∀ k∈0. a(succ(k)) = f(a(k)) )b: succ(0) → X ∧ b(0) = x ∧ ( ∀ k∈0. b(succ(k)) = f(b(k)) )moreover have succ(0) = {0} by auto
ultimately have a: {0} → X b: {0} → X by auto
then have a = {h0, a(0)i}b = {h0, b(0)i} using func_singleton_pair
by autowith A3 show a=b by simp
next
let a = {h0,xi}
have a : {0} → {x} using singleton_fun by simp
moreover from A1 A2 have {x} ⊆ X by simp
ultimately have a : {0} → X
using func1_1_L1B by blast
moreover have {0} = succ(0) by auto
ultimately have a : succ(0) → X by simp
with A1 show
∃ a. a: succ(0) → X ∧ a(0) = x ∧ (∀ k∈0. a(succ(k)) = f(a(k)))
using singleton_apply by autoqed

A lemma about restricting finite sequences needed for the proof of the inductive step of the existence and uniqueness of finite inductive seqences.
lemma indseq_restrict:assumes A1: f: X→X and A2: x∈X and A3: n ∈ nat andA4: a: succ(succ(n))→ X ∧ a(0) = x ∧ (∀ k∈succ(n). a(succ(k)) = f(a(k)))
and A5: ar = restrict(a,succ(n))
showsar : succ(n) → X ∧ ar (0) = x ∧ ( ∀ k∈n. ar (succ(k)) = f(ar (k)) )proof from A3 have succ(n) ⊆ succ(succ(n)) by autowith A4 A5 have ar : succ(n) → X using restrict_type2 by auto
moreoverfrom A3 have 0 ∈ succ(n) using empty_in_every_succ by simp

178with A4 A5 have ar (0) = x using restrict_if by simp
moreover from A3 A4 A5 have ∀ k∈n. ar (succ(k)) = f(ar (k))
using succ_ineq restrict_if by auto
ultimately show thesis by simp
qed

Existence and uniqueness of finite inductive sequences. The proof is by
induction and the next lemma is the inductive step.
lemma indseq_exun_ind:assumes A1: f: X→X and A2: x∈X and A3: n ∈ nat andA4: ∃ ! a. a: succ(n) → X ∧ a(0) = x ∧ (∀ k∈n. a(succ(k)) = f(a(k)))
shows∃ ! a. a: succ(succ(n)) → X ∧ a(0) = x ∧( ∀ k∈succ(n). a(succ(k)) = f(a(k)) )proof
fix a b assume
A5: a: succ(succ(n)) → X ∧ a(0) = x ∧( ∀ k∈succ(n). a(succ(k)) = f(a(k)) ) andA6: b: succ(succ(n)) → X ∧ b(0) = x ∧( ∀ k∈succ(n). b(succ(k)) = f(b(k)) )show a = b
proof let ar = restrict(a,succ(n))
let br = restrict(b,succ(n))
note A1 A2 A3 A5
moreover have ar = restrict(a,succ(n)) by simp
ultimately have I:
ar : succ(n) → X ∧ ar (0) = x ∧ ( ∀ k∈n. ar (succ(k)) = f(ar (k)) )by (rule indseq_restrict)note A1 A2 A3 A6
moreover have br = restrict(b,succ(n)) by simp
ultimately havebr : succ(n) → X ∧ br (0) = x ∧ ( ∀ k∈n. br (succ(k)) = f(br (k)) )by (rule indseq_restrict)with A4 I have II: ar = br by blastfrom A3 have succ(n) ∈ nat by simp
moreover from A5 A6 havea: succ(succ(n)) → X and b: succ(succ(n)) → X
by automoreover note II
moreoverhave T: n ∈ succ(n) by simp
then have ar (n) = a(n) and br (n) = b(n) using restrictby autowith A5 A6 II T have a(succ(n)) = b(succ(n)) by simp
ultimately show a = b by (rule finseq_restr_eq)
qed
next show∃ a. a: succ(succ(n)) → X ∧ a(0) = x ∧179

( ∀ k∈succ(n). a(succ(k)) = f(a(k)) )proof from A4 obtain a where III: a: succ(n) → X and IV: a(0) = x
and V: ∀ k∈n. a(succ(k)) = f(a(k)) by auto
let b = a ∪ {hsucc(n), f(a(n))i}from A1 III have
VI: b : succ(succ(n)) → X andVII: ∀ k ∈ succ(n). b(k) = a(k) andVIII: b(succ(n)) = f(a(n))
using apply_funtype finseq_extend by autofrom A3 have 0 ∈ succ(n) using empty_in_every_succ by simp
with IV VII have IX: b(0) = x by auto
{ fix k assume k ∈ succ(n)then have k∈n ∨ k = n by auto
moreover{ assume A7: k ∈ nwith A3 VII have b(succ(k)) = a(succ(k))
using succ_ineq by auto
also from A7 V VII have a(succ(k)) = f(b(k)) by simp
finally have b(succ(k)) = f(b(k)) by simp }moreover{ assume A8: k = n
with VIII have b(succ(k)) = f(a(k)) by simp
with A8 VII VIII have b(succ(k)) = f(b(k)) by simp }ultimately have b(succ(k)) = f(b(k)) by auto
} then have ∀ k ∈ succ(n). b(succ(k)) = f(b(k)) by simp
with VI IX show thesis by autoqed
qed

The next lemma combines indseq_exun0 and indseq_exun_ind to show theexistence and uniqueness of finite sequences defined by induction.
lemma indseq_exun:
assumes A1: f: X→X and A2: x∈X and A3: n ∈ natshows∃ ! a. a: succ(n) → X ∧ a(0) = x ∧ (∀ k∈n. a(succ(k)) = f(a(k)))
proof note A3
moreover from A1 A2 have
∃ ! a. a: succ(0) → X ∧ a(0) = x ∧ ( ∀ k∈0. a(succ(k)) = f(a(k)) )using indseq_exun0 by simp
moreover from A1 A2 have ∀ k ∈ nat.
( ∃ ! a. a: succ(k) → X ∧ a(0) = x ∧( ∀ i∈k. a(succ(i)) = f(a(i)) )) −→( ∃ ! a. a: succ(succ(k)) → X ∧ a(0) = x ∧( ∀ i∈succ(k). a(succ(i)) = f(a(i)) ) )using indseq_exun_ind by simp
ultimately show
∃ ! a. a: succ(n) → X ∧ a(0) = x ∧ ( ∀ k∈n. a(succ(k)) = f(a(k)) )180

by (rule ind_on_nat)qed

We are now ready to prove the main theorem about finite inductive sequences.
theorem fin_indseq_props:
assumes A1: f: X→X and A2: x∈X and A3: n ∈ nat andA4: a = InductiveSequenceN(x,f,n)
shows
a: succ(n) → X
a(0) = x∀ k∈n. a(succ(k)) = f(a(k))
proof let i = THE a. a: succ(n) → X ∧ a(0) = x ∧( ∀ k∈n. a(succ(k)) = f(a(k)) )from A1 A2 A3 have
∃ ! a. a: succ(n) → X ∧ a(0) = x ∧ ( ∀ k∈n. a(succ(k)) = f(a(k)) )using indseq_exun by simp
then havei: succ(n) → X ∧ i(0) = x ∧ ( ∀ k∈n. i(succ(k)) = f(i(k)) )by (rule theI)moreover from A1 A4 have a = iusing InductiveSequenceN_def func1_1_L1 by simp
ultimately show
a: succ(n) → X
a(0) = x∀ k∈n. a(succ(k)) = f(a(k))
by autoqed

A corollary about the domain of a finite inductive sequence.
corollary fin_indseq_domain:
assumes A1: f: X→X and A2: x∈X and A3: n ∈ nat
shows domain(InductiveSequenceN(x,f,n)) = succ(n)proof from assms have InductiveSequenceN(x,f,n) : succ(n) → X
using fin_indseq_props by simp
then show thesis using func1_1_L1 by simp
qed

The collection of finite sequences defined by induction is consistent in thesense that the restriction of the sequence defined on a larger set to thesmaller set is the same as the sequence defined on the smaller set.
lemma indseq_consistent: assumes A1: f: X→X and A2: x∈X andA3: i ∈ nat j ∈ nat and A4: i ⊆ jshowsrestrict(InductiveSequenceN(x,f,j),succ(i)) = InductiveSequenceN(x,f,i)
proof let a = InductiveSequenceN(x,f,j)
let b = restrict(InductiveSequenceN(x,f,j),succ(i))

181let c = InductiveSequenceN(x,f,i)from A1 A2 A3 havea: succ(j) → X a(0) = x∀ k∈j. a(succ(k)) = f(a(k))
using fin_indseq_props by autowith A3 A4 haveb: succ(i) → X ∧ b(0) = x ∧ ( ∀ k∈i. b(succ(k)) = f(b(k)))
using succ_subset restrict_type2 empty_in_every_succ restrict succ_ineq
by automoreover from A1 A2 A3 havec: succ(i) → X ∧ c(0) = x ∧ ( ∀ k∈i. c(succ(k)) = f(c(k)))
using fin_indseq_props by simp
moreover from A1 A2 A3 have
∃ ! a. a: succ(i) → X ∧ a(0) = x ∧ ( ∀ k∈i. a(succ(k)) = f(a(k)) )using indseq_exun by simp
ultimately show b = c by blast
qed

For any two natural numbers one of the corresponding inductive sequences
is contained in the other.
lemma indseq_subsets: assumes A1: f: X→X and A2: x∈X andA3: i ∈ nat j ∈ nat andA4: a = InductiveSequenceN(x,f,i) b = InductiveSequenceN(x,f,j)shows a ⊆ b ∨ b ⊆ a
proof from A3 have i⊆j ∨ j⊆i using nat_incl_total by simp
moreover{ assume i⊆jwith A1 A2 A3 A4 have restrict(b,succ(i)) = a
using indseq_consistent by simp
moreover have restrict(b,succ(i)) ⊆ busing restrict_subset by simp
ultimately have a ⊆ b ∨ b ⊆ a by simp }moreover{ assume j⊆iwith A1 A2 A3 A4 have restrict(a,succ(j)) = b
using indseq_consistent by simp
moreover have restrict(a,succ(j)) ⊆ ausing restrict_subset by simp
ultimately have a ⊆ b ∨ b ⊆ a by simp }ultimately show a ⊆ b ∨ b ⊆ a by autoqed

The first theorem about properties of infinite inductive sequences: inductive
sequence is a indeed a sequence (i.e. a function on the set of natural numbers.
theorem indseq_seq: assumes A1: f: X→X and A2: x∈Xshows InductiveSequence(x,f) : nat → X
proof let S = {InductiveSequenceN(x,f,n). n ∈ nat}
{ fix a assume a∈S

182

then obtain n where n ∈ nat and a = InductiveSequenceN(x,f,n)
by autowith A1 A2 have a : succ(n)→X using fin_indseq_props
by simpthen have ∃ A B. a:A→B by auto
} then have ∀ a ∈ S. ∃ A B. a:A→B by auto
moreover{ fix a b assume a∈Sb∈Sthen obtain i j where i∈nat j∈nat anda = InductiveSequenceN(x,f,i)b = InductiveSequenceN(x,f,j)
by autowith A1 A2 have a⊆b ∨ b⊆a using indseq_subsets by simp
} then have ∀ a∈S.
S ∀ b∈S. a⊆bS∨ b⊆a by autoS
ultimately haveS : domain( S) → range( S)using fun_Union byS simp
Swith A1 A2 have I:
S : nat → range( S)using domain_UN fin_indseq_domain nat_union_succ by simp
moreover{ fix k assume
A3: k ∈ nat
S
let y = ( S)(k)note I A3
S
moreover have y = ( S)(k)S by simp
ultimately have hk,yi ∈ ( S) by (rule func1_1_L5A)
then obtain n where n ∈ nat and II: hk,yi ∈ InductiveSequenceN(x,f,n)
by autowith A1 A2 have InductiveSequenceN(x,f,n): succ(n) → X
using fin_indseq_props by simp
with II have y ∈ X using
S func1_1_L5 by blast} then have ∀ k ∈nat.
(S)(k) ∈ X by simp
Sultimately have
S : nat → X using func1_1_L1A
by blast
then show InductiveSequence(x,f) : nat → X
using InductiveSequence_def by simp
qed

Restriction of an inductive sequence to a finite domain is the corresponding
finite inductive sequence.
lemma indseq_restr_eq:
assumes A1: f: X→X and A2: x∈X and A3: n ∈ nat
shows
restrict(InductiveSequence(x,f),succ(n)) = InductiveSequenceN(x,f,n)
proof let a = InductiveSequence(x,f)
let b = InductiveSequenceN(x,f,n)let S = {InductiveSequenceN(x,f,n). n ∈ nat}from A1 A2 A3 have
I: a : nat → X and succ(n) ⊆ nat
using indseq_seq succnat_subset_nat by auto
then have restrict(a,succ(n)) : succ(n) → X

183

using restrict_type2 by simp
moreover from A1 A2 A3 have b : succ(n) → X
using fin_indseq_props by simp
moreover{ fix k assume A4: k ∈ succ(n)fromS A1 A2 A3 I have
S : nat → X
b ∈ S b : succ(n) → X
using InductiveSequence_def fin_indseq_props by autowith A4 have restrict(a,succ(n))(k) = b(k)using fun_Union_apply InductiveSequence_def restrict_if
by simp} then have ∀ k ∈ succ(n). restrict(a,succ(n))(k) = b(k)by simpultimately show thesis by (rule func_eq)
qed

The first element of the inductive sequence starting at x and generated by
f is indeed x.
theorem indseq_valat0: assumes A1: f: X→X and A2: x∈Xshows InductiveSequence(x,f)(0) = x
proof let a = InductiveSequence(x,f)
let b = InductiveSequenceN(x,f,0)
have T: 0∈nat 0 ∈ succ(0) by autowith A1 A2 have b(0) = x
using fin_indseq_props by simp
moreover from T have restrict(a,succ(0))(0) = a(0)using restrict_if by simp
moreover from A1 A2 T haverestrict(a,succ(0)) = b
using indseq_restr_eq by simp
ultimately show a(0) = x by simp
qed

An infinite inductive sequence satisfies the inductive relation that defines it.
theorem indseq_vals:
assumes A1: f: X→X and A2: x∈X and A3: n ∈ nat
shows
InductiveSequence(x,f)(succ(n)) = f(InductiveSequence(x,f)(n))
proof let a = InductiveSequence(x,f)
let b = InductiveSequenceN(x,f,succ(n))
from A3 have T:
succ(n) ∈ succ(succ(n))
succ(succ(n)) ∈ natn ∈ succ(succ(n))
by autothen have a(succ(n)) = restrict(a,succ(succ(n)))(succ(n))
using restrict_if by simp

184

also from A1 A2 T have . . . = f(restrict(a,succ(succ(n)))(n))
using indseq_restr_eq fin_indseq_props by simp
also from T have . . . = f(a(n)) using restrict_if by simp
finally show a(succ(n)) = f(a(n)) by simp
qed

18.2

Images of inductive sequences

In this section we consider the properties of sets that are images of inductive
sequences, that is are of the form {f (n) (x) : n ∈ N } for some x in the domainof f , where f (n) denotes the n’th iteration of the function f . For a function
f : X → X and a point x ∈ X such set is set is sometimes called the orbitof x generated by f .
The basic properties of orbits.
theorem ind_seq_image: assumes A1: f: X→X and A2: x∈X andA3: A = InductiveSequence(x,f)(nat)shows x∈A and ∀ y∈A. f(y) ∈ A
proof let a = InductiveSequence(x,f)
from A1 A2 have a : nat → X using indseq_seq
by simpwith A3 have I: A = {a(n). n ∈ nat} using func_imagedef
by auto hence a(0) ∈ A by autowith A1 A2 show x∈A using indseq_valat0 by simp
{ fix y assume y∈Awith I obtain n where II: n ∈ nat and III: y = a(n)by autowith A1 A2 have a(succ(n)) = f(y)using indseq_vals by simp
moreover from I II have a(succ(n)) ∈ A by auto
ultimately have f(y) ∈ A by simp
} then show ∀ y∈A. f(y) ∈ A by simp
qed

18.3

Subsets generated by a binary operation

In algebra we often talk about sets ”generated” by an element, that is setsof the form (in multiplicative notation) {an |n ∈ Z}. This is a related to a
general notion of ”power” (as in an = a · a · .. · a ) or multiplicity n · a =a + a + .. + a. The intuitive meaning of such notions is obvious, but we needto do some work to be able to use it in the formalized setting. This sections
is devoted to sequences that are created by repeatedly applying a binary
operation with the second argument fixed to some constant.
Basic propertes of sets generated by binary operations.
theorem binop_gen_set:

185assumes A1: f: X×Y → X and A2: x∈X y∈Y andA3: a = InductiveSequence(x,Fix2ndVar(f,y))shows
a : nat → Xa(nat) ∈ Pow(X)x ∈ a(nat)∀ z ∈ a(nat). Fix2ndVar(f,y)(z) ∈ a(nat)proof let g = Fix2ndVar(f,y)
from A1 A2 have I: g : X→X
using fix_2nd_var_fun by simp
with A2 A3 show a : nat → X
using indseq_seq by simp
then show a(nat) ∈ Pow(X) using func1_1_L6 by simp
from A2 A3 I show x ∈ a(nat) using ind_seq_image by blastfrom A2 A3 I haveg : X→X x∈X a(nat) = InductiveSequence(x,g)(nat)by autothen show ∀ z ∈ a(nat). Fix2ndVar(f,y)(z) ∈ a(nat)by (rule ind_seq_image)qed

A simple corollary to the theorem binop_gen_set: a set that contains all
iterations of the application of a binary operation exists.
lemma binop_gen_set_ex: assumes A1: f: X×Y → X and A2: x∈X y∈Yshows {A ∈ Pow(X). x∈A ∧ (∀ z ∈ A. fhz,yi ∈ A) } 6= 0
proof let a = InductiveSequence(x,Fix2ndVar(f,y))let A = a(nat)from A1 A2 have I: A ∈ Pow(X) and x ∈ A using binop_gen_set
by automoreover{ fix z assume T: z∈Awith A1 A2 have Fix2ndVar(f,y)(z) ∈ A
using binop_gen_set by simp
moreoverfrom I T have z ∈ X by autowith A1 A2 have Fix2ndVar(f,y)(z) = fhz,yiusing fix_var_val by simp
ultimately have fhz,yi ∈ A by simp
} then have ∀ z ∈ A. fhz,yi ∈ A by simp
ultimately show thesis by autoqed

A more general version of binop_gen_set where the generating binary operation acts on a larger set.
theorem binop_gen_set1: assumes A1: f: X×Y → X andA2: X1 ⊆ X and A3: x∈X1 y∈Y andA4: ∀ t∈X1 . fht,yi ∈ X1 and186

A5: a = InductiveSequence(x,Fix2ndVar(restrict(f,X1 ×Y),y))shows
a : nat → X1a(nat) ∈ Pow(X1 )x ∈ a(nat)∀ z ∈ a(nat). Fix2ndVar(f,y)(z) ∈ a(nat)∀ z ∈ a(nat). fhz,yi ∈ a(nat)proof let h = restrict(f,X1 ×Y)
let g = Fix2ndVar(h,y)
from A2 have X1 ×Y ⊆ X×Y by autowith A1 have I: h : X1 ×Y → X
using restrict_type2 by simp
with A3 have II: g: X1 → X using fix_2nd_var_fun by simp
from A3 A4 I have ∀ t∈X1 . g(t) ∈ X1
using restrict fix_var_val by simp
with II have III: g : X1 → X1 using func1_1_L1A by blast
with A3 A5 show a : nat → X1 using indseq_seq by simp
then show IV: a(nat) ∈ Pow(X1 ) using func1_1_L6 by simp
from A3 A5 III show x ∈ a(nat) using ind_seq_image by blastfrom A3 A5 III haveg : X1 → X1
x∈X1 a(nat) = InductiveSequence(x,g)(nat)by autothen have ∀ z ∈ a(nat). Fix2ndVar(h,y)(z) ∈ a(nat)by (rule ind_seq_image)moreover{ fix z assume z ∈ a(nat)with IV have z ∈ X1 by autowith A1 A2 A3 have g(z) = Fix2ndVar(f,y)(z)using fix_2nd_var_restr_comm restrict by simp
} then have ∀ z ∈ a(nat). g(z) = Fix2ndVar(f,y)(z) by simp
ultimately show ∀ z ∈ a(nat). Fix2ndVar(f,y)(z) ∈ a(nat) by simp
moreover{ fix z assume z ∈ a(nat)with A2 IV have z∈X by autowith A1 A3 have Fix2ndVar(f,y)(z) = fhz,yiusing fix_var_val by simp
} then have ∀ z ∈ a(nat). Fix2ndVar(f,y)(z) = fhz,yi
by simpultimately show ∀ z ∈ a(nat). fhz,yi ∈ a(nat)by simpqed

A generalization of binop_gen_set_ex that applies when the binary operationacts on a larger set. This is used in our Metamath translation to provethe existence of the set of real natural numbers. Metamath defines the realnatural numbers as the smallest set that cantains 1 and is closed with respect
to operation of adding 1.
lemma binop_gen_set_ex1: assumes A1: f: X×Y → X and187

A2: X1 ⊆ X and A3: x∈X1 y∈Y andA4: ∀ t∈X1 . fht,yi ∈ X1
shows {A ∈ Pow(X1 ). x∈A ∧ (∀ z ∈ A. fhz,yi ∈ A) } 6= 0
proof let a = InductiveSequence(x,Fix2ndVar(restrict(f,X1 ×Y),y))let A = a(nat)from A1 A2 A3 A4 haveA ∈ Pow(X1 )x ∈ A∀ z ∈ A. fhz,yi ∈ Ausing binop_gen_set1 by auto
thus thesis by auto
qed

18.4

Inductive sequences with changing generating function

A seemingly more general form of a sequence defined by induction is asequence generated by the difference equation xn+1 = fn (xn ) where n 7→ fn
is a given sequence of functions such that each maps X into inself. For
example when fn (x) := x + xPn then the equation Sn+1 = fn (Sn ) describes
the sequence n 7→ Sn = s0 + ni=0 xn , i.e. the sequence of partial sums of
the sequence {s0 , x0 , x1 , x3 , ..}.
The situation where the function that we iterate changes with n can bederived from the simpler case if we define the generating function appropriately. Namely, we replace the generating function in the definitionsof InductiveSequenceN by the function f : X × n → X × n, f hx, ki =hfk (x), k + 1i if k < n, hfk (x), ki otherwise. The first notion defines theexpression we will use to define the generating function. To understand thenotation recall that in standard Isabelle/ZF for a pair s = hx, ni we havefst(s) = x and snd(s) = n.
definition
StateTransfFunNMeta(F,n,s) ≡if (snd(s) ∈ n) then hF(snd(s))(fst(s)), succ(snd(s))i else s

Then we define the actual generating function on sets of pairs from X ×{0, 1, .., n}.
definition
StateTransfFunN(X,F,n) ≡ {hs, StateTransfFunNMeta(F,n,s)i. s ∈ X×succ(n)}Having the generating function we can define the expression that we cen use
to define the inductive sequence generates.
definition
StatesSeq(x,X,F,n) ≡InductiveSequenceN(hx,0i, StateTransfFunN(X,F,n),n)Finally we can define the sequence given by a initial point x, and a sequence
F of n functions.

188definition
InductiveSeqVarFN(x,X,F,n) ≡ {hk,fst(StatesSeq(x,X,F,n)(k))i. k ∈ succ(n)}The state transformation function (StateTransfFunN is a function that transforms X × n into itself.
lemma state_trans_fun: assumes A1: n ∈ nat and A2: F: n → (X→X)
shows StateTransfFunN(X,F,n): X×succ(n) → X×succ(n)proof { fix s assume A3: s ∈ X×succ(n)let x = fst(s)let k = snd(s)let S = StateTransfFunNMeta(F,n,s)from A3 have T: x ∈ X k ∈ succ(n) and hx,ki = s by auto
{ assume A4: k ∈ nwith A1 have succ(k) ∈ succ(n) using succ_ineq by simp
with A2 T A4 have S ∈ X×succ(n)using apply_funtype StateTransfFunNMeta_def by simp }with A2 A3 T have S ∈ X×succ(n)using apply_funtype StateTransfFunNMeta_def by auto
} then have ∀ s ∈ X×succ(n). StateTransfFunNMeta(F,n,s) ∈ X×succ(n)by simpthen have{hs, StateTransfFunNMeta(F,n,s)i. s ∈ X×succ(n)} : X×succ(n) → X×succ(n)by (rule ZF_fun_from_total)then show StateTransfFunN(X,F,n): X×succ(n) → X×succ(n)using StateTransfFunN_def by simpqed

We can apply fin_indseq_props to the sequence used in the definition ofInductiveSeqVarFN to get the properties of the sequence of states generated
by the StateTransfFunN.
lemma states_seq_props:
assumes A1: n ∈ nat and A2: F: n → (X→X) and A3: x∈X andA4: b = StatesSeq(x,X,F,n)shows
b : succ(n) → X×succ(n)b(0) = hx,0i∀ k ∈ succ(n). snd(b(k)) = k∀ k∈n. b(succ(k)) = hF(k)(fst(b(k))), succ(k)i
proof let f = StateTransfFunN(X,F,n)from A1 A2 have I: f : X×succ(n) → X×succ(n)using state_trans_fun by simp
moreover from A1 A3 have II: hx,0i ∈ X×succ(n)using empty_in_every_succ by simp
moreover note A1
moreover from A4 have III: b = InductiveSequenceN(hx,0i,f,n)using StatesSeq_def by simp
ultimately show IV: b : succ(n) → X×succ(n)189

by (rule fin_indseq_props)
from I II A1 III show V: b(0) = hx,0i
by (rule fin_indseq_props)
from I II A1 III have VI: ∀ k∈n. b(succ(k)) = f(b(k))
by (rule fin_indseq_props){ fix knote I
moreoverassume A5: k ∈ n hence k ∈ succ(n) by autowith IV have b(k) ∈ X×succ(n) using apply_funtype by simp
moreover have f = {hs, StateTransfFunNMeta(F,n,s)i. s ∈ X×succ(n)}using StateTransfFunN_def by simp
ultimately have f(b(k)) = StateTransfFunNMeta(F,n,b(k))
by (rule ZF_fun_from_tot_val)} then have VII: ∀ k ∈ n. f(b(k)) = StateTransfFunNMeta(F,n,b(k))
by simp{ fix k assume A5: k ∈ succ(n)note A1 A5
moreover from V have snd(b(0)) = 0 by simp
moreover from VI VII have
∀ j∈n. snd(b(j)) = j −→ snd(b(succ(j))) = succ(j)using StateTransfFunNMeta_def by auto
ultimately have snd(b(k)) = k by (rule fin_nat_ind)} then show ∀ k ∈ succ(n). snd(b(k)) = k by simp
with VI VII show ∀ k∈n. b(succ(k)) = hF(k)(fst(b(k))), succ(k)iusing StateTransfFunNMeta_def by autoqed

Basic properties of sequences defined by equation xn+1 = fn (xn ).
theorem fin_indseq_var_f_props:
assumes A1: n ∈ nat and A2: x∈X and A3: F: n → (X→X) andA4: a = InductiveSeqVarFN(x,X,F,n)
shows
a: succ(n) → X
a(0) = x∀ k∈n. a(succ(k)) = F(k)(a(k))
proof let f = StateTransfFunN(X,F,n)
let b = StatesSeq(x,X,F,n)from A1 A2 A3 have b : succ(n) → X×succ(n)using states_seq_props by simp
then have ∀ k ∈ succ(n). b(k) ∈ X×succ(n)using apply_funtype by simp
hence ∀ k ∈ succ(n). fst(b(k)) ∈ X by auto
then have I: {hk,fst(b(k))i. k ∈ succ(n)} : succ(n) → X
by (rule ZF_fun_from_total)
with A4 show II: a: succ(n) → X using InductiveSeqVarFN_def
by simpmoreover from A1 have 0 ∈ succ(n) using empty_in_every_succ

190

by simp
moreover from A4 have III:a = {hk,fst(StatesSeq(x,X,F,n)(k))i. k ∈ succ(n)}using InductiveSeqVarFN_def by simp
ultimately have a(0) = fst(b(0))
by (rule ZF_fun_from_tot_val)
with A1 A2 A3 show a(0) = x using states_seq_props by auto
{ fix kassume A5: k ∈ nwith A1 have T1: succ(k) ∈ succ(n) and T2: k ∈ succ(n)using succ_ineq by autofrom II T1 III have a(succ(k)) = fst(b(succ(k)))
by (rule ZF_fun_from_tot_val)
with A1 A2 A3 A5 have a(succ(k)) = F(k)(fst(b(k)))
using states_seq_props by simp
moreover from II T2 III have a(k) = fst(b(k))
by (rule ZF_fun_from_tot_val)
ultimately have a(succ(k)) = F(k)(a(k))
by simp} then show ∀ k∈n. a(succ(k)) = F(k)(a(k))
by simpqed

A consistency condition: if we make the sequence of generating functions
shorter, then we get a shorter inductive sequence with the same values as in
the original sequence.
lemma fin_indseq_var_f_restrict: assumes
A1: n ∈ nat i ∈ nat x∈X F: n → (X→X)
G: i → (X→X)
and A2: i ⊆ n and A3: ∀ j∈i. G(j) = F(j) and A4: k ∈ succ(i)shows InductiveSeqVarFN(x,X,G,i)(k) = InductiveSeqVarFN(x,X,F,n)(k)proof let a = InductiveSeqVarFN(x,X,F,n)
let b = InductiveSeqVarFN(x,X,G,i)from A1 A4 have i ∈ nat k ∈ succ(i) by auto
moreover from A1 have b(0) = a(0)using fin_indseq_var_f_props by simp
moreover from A1 A2 A3 have
∀ j∈i. b(j) = a(j) −→ b(succ(j)) = a(succ(j))
using fin_indseq_var_f_props by auto
ultimately show b(k) = a(k)by (rule fin_nat_ind)
qed

end

191

19

Folding in ZF

theory Fold_ZF imports InductiveSeq_ZF
begin

Suppose we have a binary operation P : X ×X → X written multiplicatively
as P hx, yi = x·y. In informal mathematics we can take a sequence {xk }k∈0..nof elements of X and consider the product x0 ·x1 ·..·xn . To do the same thingin formalized mathematics we have to define precisely what is meant by that”·..·”. The definitition we want to use is based on the notion of sequence
defined by induction discussed in InductiveSeq_ZF. We don’t really want toderive the terminology for this from the word ”product” as that would tie it
conceptually to the multiplicative notation. This would be awkward when
we want to reuse the same notions to talk about sums like x0 + x1 + .. + xn .
In functional programming there is something called ”fold”. Namely for afunction f , initial point a and list [b, c, d] the expression fold(f, a, [b,c,d])
is defined to be f(f(f(a,b),c),d) (in Haskell something like this is called
foldl). If we write f in multiplicative notation we get a · b · c · d, so thisis exactly what we need. The notion of folds in functional programmingis actually much more general that what we need here (not that I know
anything about that). In this theory file we just make a slight generalizationand talk about folding a list with a binary operation f : X × Y → X with
X not necessarily the same as Y .

19.1

Folding in ZF

Suppose we have a binary operation f : X × Y → X. Then every y ∈ Ydefines a transformation of X defined by Ty (x) = f hx, yi. In IsarMathLib
such transformation is called as Fix2ndVar(f,y). Using this notion, given afunction f : X × Y → X and a sequence y = {yk }k∈N of elements of X we
can get a sequence of transformations of X. This is defined in Seq2TransSeq
below. Then we use that sequence of tranformations to define the sequenceof partial folds (called FoldSeq) by means of InductiveSeqVarFN (defined inInductiveSeq_ZF theory) which implements the inductive sequence determined by a starting point and a sequence of transformations. Finally, wedefine the fold of a sequence as the last element of the sequence of the partial
folds.
Definition that specifies how to convert a sequence a of elements of Y into asequence of transformations of X, given a binary operation f : X × Y → X.
definition
Seq2TrSeq(f,a) ≡ {hk,Fix2ndVar(f,a(k))i. k ∈ domain(a)}Definition of a sequence of partial folds.
192

definition
FoldSeq(f,x,a) ≡InductiveSeqVarFN(x,fstdom(f),Seq2TrSeq(f,a),domain(a))

Definition of a fold.
definition
Fold(f,x,a) ≡ Last(FoldSeq(f,x,a))

If X is a set with a binary operation f : X×Y → X then Seq2TransSeqN(f,a)
converts a sequence a of elements of Y into the sequence of correspondingtransformations of X.
lemma seq2trans_seq_props:
assumes A1: n ∈ nat and A2: f : X×Y → X and A3: a:n→Y and
A4: T = Seq2TrSeq(f,a)
shows
T : n → (X→X) and∀ k∈n. ∀ x∈X. (T(k))(x) = fhx,a(k)i
proof from ha:n→Yi have D: domain(a) = n using func1_1_L1 by simp
with A2 A3 A4 show T : n → (X→X)
using apply_funtype fix_2nd_var_fun ZF_fun_from_total Seq2TrSeq_def
by simpwith A4 D have I: ∀ k ∈ n. T(k) = Fix2ndVar(f,a(k))
using Seq2TrSeq_def ZF_fun_from_tot_val0 by simp
{ fix k fix x assume A5: k∈n x∈Xwith A1 A3 have a(k) ∈ Y using apply_funtype
by autowith A2 A5 I have (T(k))(x) = fhx,a(k)iusing fix_var_val by simp
} thus ∀ k∈n. ∀ x∈X. (T(k))(x) = fhx,a(k)i
by simpqed

Basic properties of the sequence of partial folds of a sequence a = {yk }k∈{0,..,n} .
theorem fold_seq_props:
assumes A1: n ∈ nat and A2: f : X×Y → X andA3: y:n→Y and A4: x∈X and A5: Y6=0 and
A6: F = FoldSeq(f,x,y)shows
F: succ(n) → X
F(0) = x and∀ k∈n. F(succ(k)) = fhF(k), y(k)i
proof let T = Seq2TrSeq(f,y)
from A1 A3 have D: domain(y) = n
using func1_1_L1 by simp
from hf : X×Y → Xi hY6=0i have I: fstdom(f) = X
using fstdomdef by simp

193

with A1 A2 A3 A4 A6 D show
II: F: succ(n) → X and F(0) = x
using seq2trans_seq_props FoldSeq_def fin_indseq_var_f_props
by autofrom A1 A2 A3 A4 A6 I D have ∀ k∈n. F(succ(k)) = T(k)(F(k))
using seq2trans_seq_props FoldSeq_def fin_indseq_var_f_props
by simpmoreover{ fix k assume A5: k∈n hence k ∈ succ(n) by autowith A1 A2 A3 II A5 have (T(k))(F(k)) = fhF(k),y(k)iusing apply_funtype seq2trans_seq_props by simp }ultimately show ∀ k∈n. F(succ(k)) = fhF(k), y(k)i
by simpqed

A consistency condition: if we make the list shorter, then we get a shorter
sequence of partial folds with the same values as in the original sequence.
This can be proven as a special case of fin_indseq_var_f_restrict but a
proof using fold_seq_props and induction turns out to be shorter.
lemma foldseq_restrict: assumesn ∈ natk ∈ succ(n) andi ∈ nat f : X×Y → X a : n → Y b : i → Y andn ⊆ i∀ j ∈ n. b(j) = a(j)x ∈ X
Y 6= 0shows FoldSeq(f,x,b)(k) = FoldSeq(f,x,a)(k)proof let P = FoldSeq(f,x,a)let Q = FoldSeq(f,x,b)from assms haven ∈ natk ∈ succ(n)Q(0) = P(0) and∀ j ∈ n. Q(j) = P(j) −→ Q(succ(j)) = P(succ(j))
using fold_seq_props by auto
then show Q(k) = P(k) by (rule fin_nat_ind)qed

A special case of foldseq_restrict when the longer sequence is created fromthe shorter one by appending one element.
corollary fold_seq_append:assumes n ∈ nat
f : X×Y → X
a:n → Y andx∈Xk ∈ succ(n)y∈Yshows FoldSeq(f,x,Append(a,y))(k) = FoldSeq(f,x,a)(k)proof let b = Append(a,y)
from assms have b : succ(n) → Y ∀ j ∈ n. b(j) = a(j)using append_props by autowith assms show thesis using foldseq_restrict by blast
qed

What we really will be using is the notion of the fold of a sequence, which we194define as the last element of (inductively defined) sequence of partial folds.
The next theorem lists some properties of the product of the fold operation.
theorem fold_props:
assumes A1: n ∈ nat andA2: f : X×Y → X a:n → Y x∈X Y6=0
shows
Fold(f,x,a) = FoldSeq(f,x,a)(n) andFold(f,x,a) ∈ X
proof from assms have FoldSeq(f,x,a) : succ(n) → X
using fold_seq_props by simp
with A1 show
Fold(f,x,a) = FoldSeq(f,x,a)(n) and Fold(f,x,a) ∈ X
using last_seq_elem apply_funtype Fold_def by autoqed

A corner case: what happens when we fold an empty list?
theorem fold_empty: assumes A1: f : X×Y → X andA2: a:0→Y x∈X Y6=0
shows Fold(f,x,a) = x
proof let F = FoldSeq(f,x,a)from assms have I:
0 ∈ nat f : X×Y → X a:0→Y x∈X Y6=0
by autothen have Fold(f,x,a) = F(0) by (rule fold_props)
moreoverfrom I have0 ∈ nat f : X×Y → X a:0→Y x∈X Y6=0 and
F = FoldSeq(f,x,a) by auto
then have F(0) = x by (rule fold_seq_props)
ultimately show Fold(f,x,a) = x by simp
qed

The next theorem tells us what happens to the fold of a sequence when we
add one more element to it.
theorem fold_append:assumes A1: n ∈ nat and A2: f : X×Y → X andA3: a:n→Y and A4: x∈X and A5: y∈Y
shows
FoldSeq(f,x,Append(a,y))(n) = Fold(f,x,a) andFold(f,x,Append(a,y)) = fhFold(f,x,a), yi
proof let b = Append(a,y)
let P = FoldSeq(f,x,b)from A5 have I: Y 6= 0 by autowith assms show thesis1: P(n) = Fold(f,x,a)using fold_seq_append fold_props by simp

195

from assms I have II:
succ(n) ∈ nat
f : X×Y → X
b : succ(n) → Y
x∈X Y 6= 0
P = FoldSeq(f,x,b)using append_props by auto
then have∀ k ∈ succ(n). P(succ(k)) = fhP(k), b(k)iby (rule fold_seq_props)
with A3 A5 thesis1 have P(succ(n)) = fh Fold(f,x,a), yi
using append_props by auto
moreoverfrom II have P : succ(succ(n)) → X
by (rule fold_seq_props)
then have Fold(f,x,b) = P(succ(n))
using last_seq_elem Fold_def by simp
ultimately show Fold(f,x,Append(a,y)) = fhFold(f,x,a), yi
by simp
qed

end

20

Partitions of setstheory Partitions_ZF imports Finite_ZF FiniteSeq_ZF
begin

It is a common trick in proofs that we divide a set into non-overlapping
subsets. The first case is when we split the set into two nonempty disjoint
sets. Here this is modeled as an ordered pair of sets and the set of such
divisions of set X is called Bisections(X). The second variation on thistheme is a set-valued function (aren’t they all in ZF?) whose values arenonempty and mutually disjoint.

20.1

Bisections

This section is about dividing sets into two non-overlapping subsets.
The set of bisections of a given set A is a set of pairs of nonempty subsets
of A that do not overlap and their union is equal to A.
definition
Bisections(X) = {p ∈ Pow(X)×Pow(X).
fst(p)6=0 ∧ snd(p)6=0 ∧ fst(p)∩snd(p) = 0 ∧ fst(p)∪snd(p) = X}

Properties of bisections.
lemma bisec_props: assumes hA,Bi ∈ Bisections(X) shows196

A6=0 B6=0 A ⊆ X B ⊆ X A ∩ B = 0 A ∪ B = X
using assms Bisections_def by auto

X 6= 0Kind of inverse of bisec_props: a pair of nonempty disjoint sets form abisection of their union.
lemma is_bisec:
assumes A6=0 B6=0 A ∩ B = 0
shows hA,Bi ∈ Bisections(A∪B) using assms Bisections_def
by autoBisection of X is a pair of subsets of X.
lemma bisec_is_pair: assumes Q ∈ Bisections(X)shows Q = hfst(Q), snd(Q)iusing assms Bisections_def by auto

The set of bisections of the empty set is empty.
lemma bisec_empty: shows Bisections(0) = 0
using Bisections_def by auto

The next lemma shows what can we say about bisections of a set withanother element added.
lemma bisec_add_point:
assumes A1: x ∈/ X and A2: hA,Bi ∈ Bisections(X ∪ {x})shows (A = {x} ∨ B = {x}) ∨ (hA - {x}, B - {x}i ∈ Bisections(X))
proof { assume A 6= {x} and B 6= {x}with A2 have A - {x} 6= 0 and B - {x} 6= 0
using singl_diff_empty Bisections_def
by automoreover have (A - {x}) ∪ (B - {x}) = X
proof have (A - {x}) ∪ (B - {x}) = (A ∪ B) - {x}by autoalso from assms have (A ∪ B) - {x} = X
using Bisections_def by auto
finally show thesis by simp
qed
moreover from A2 have (A - {x}) ∩ (B - {x}) = 0
using Bisections_def by auto
ultimately have hA - {x}, B - {x}i ∈ Bisections(X)using Bisections_def by auto
} thus thesis by autoqed

A continuation of the lemma bisec_add_point that refines the case when thepair with removed point bisects the original set.
lemma bisec_add_point_case3:
assumes A1: hA,Bi ∈ Bisections(X ∪ {x})197and A2: hA - {x}, B - {x}i ∈ Bisections(X)shows(hA, B - {x}i ∈ Bisections(X) ∧ x ∈ B) ∨(hA - {x}, Bi ∈ Bisections(X) ∧ x ∈ A)
proof from A1 have x ∈ A ∪ B
using Bisections_def by auto
hence x∈A ∨ x∈B by simp
from A1 have A - {x} = A ∨ B - {x} = B
using Bisections_def by auto
moreover{ assume A - {x} = A
with A2 hx ∈ A ∪ Bi have
hA, B - {x}i ∈ Bisections(X) ∧ x ∈ Busing singl_diff_eq by simp }moreover{ assume B - {x} = B
with A2 hx ∈ A ∪ Bi havehA - {x}, Bi ∈ Bisections(X) ∧ x ∈ Ausing singl_diff_eq by simp }ultimately show thesis by autoqed

Another lemma about bisecting a set with an added point.
lemma point_set_bisec:
assumes A1: x ∈/ X and A2: h{x}, Ai ∈ Bisections(X ∪ {x})shows A = X and X 6= 0
proof from A2 have A ⊆ X using Bisections_def by auto
moreover{ fix a assume a∈Xwith A2 have a ∈ {x} ∪ A using Bisections_def by simp
with A1 ha∈Xi have a ∈ A by auto }
ultimately show A = X by autowith A2 show X 6= 0 using Bisections_def by simp
qed

Yet another lemma about bisecting a set with an added point, very similar
to point_set_bisec with almost the same proof.
lemma set_point_bisec:
assumes A1: x ∈/ X and A2: hA, {x}i ∈ Bisections(X ∪ {x})shows A = X and X 6= 0
proof from A2 have A ⊆ X using Bisections_def by auto
moreover{ fix a assume a∈Xwith A2 have a ∈ A ∪ {x} using Bisections_def by simp
with A1 ha∈Xi have a ∈ A by auto }
ultimately show A = X by auto

198

with A2 show X 6= 0 using Bisections_def by simp
qed

If a pair of sets bisects a finite set, then both elements of the pair are finite.
lemma bisect_fin:
assumes A1: A ∈ FinPow(X) and A2: Q ∈ Bisections(A)shows fst(Q) ∈ FinPow(X) and snd(Q) ∈ FinPow(X)proof from A2 have hfst(Q), snd(Q)i ∈ Bisections(A)using bisec_is_pair by simp
then have fst(Q) ⊆ A and snd(Q) ⊆ A
using bisec_props by autowith A1 show fst(Q) ∈ FinPow(X) and snd(Q) ∈ FinPow(X)using FinPow_def subset_Finite by auto
qed

20.2

Partitions

This sections covers the situation when we have an arbitrary number of sets
we want to partition into.
We define a notion of a partition as a set valued function such that the values
for different arguments are disjoint. The name is derived from the fact thatsuch function ”partitions” the union of its arguments. Please let me know
if you have a better idea for a name for such notion. We would prefer tosay ”is a partition”, but that reserves the letter ”a” as a keyword(?) whichcauses problems.
definition
Partition (_ {is partition} [90] 91) where
P {is partition} ≡ ∀ x ∈ domain(P).
P(x) 6= 0 ∧ (∀ y ∈ domain(P). x6=y −→ P(x) ∩ P(y) = 0)

A fact about lists of mutually disjoint sets.
lemma list_partition: assumes A1: n ∈ nat andA2: a : S
succ(n) → X
a {is partition}shows ( i∈n. a(i)) ∩ a(n) = 0
proof S{ assume ( i∈n. a(i))S ∩ a(n) 6= 0
then have ∃ x. x ∈ ( i∈n. a(i)) ∩ a(n)by (rule nonempty_has_element)
Sthen obtain x where x ∈ ( i∈n. a(i)) and I: x ∈ a(n)by autothen obtain i where i ∈ n and x ∈ a(i) by autowith A2 I have False
using mem_imp_not_eq func1_1_L1 Partition_def
by auto} thus thesis by auto
qed

199

We can turn every injection into a partition.
lemma inj_partition:
assumes A1: b ∈ inj(X,Y)
shows∀ x ∈ X. {hx, {b(x)}i. x ∈ X}(x) = {b(x)} and{hx, {b(x)}i. x ∈ X} {is partition}
proof let p = {hx, {b(x)}i. x ∈ X}
{ fix x assume x ∈ Xfrom A1 have b : X → Y using inj_def
by simpwith hx ∈ Xi have {b(x)} ∈ Pow(Y)using apply_funtype by simp
} hence ∀ x ∈ X. {b(x)} ∈ Pow(Y) by simp
then have p : X → Pow(Y) using ZF_fun_from_total
by simpthen have domain(p) = X using func1_1_L1
by simpfrom hp : X → Pow(Y)i show I: ∀ x ∈ X. p(x) = {b(x)}using ZF_fun_from_tot_val0 by simp
{ fix x assume x ∈ Xwith I have p(x) = {b(x)} by simp
hence p(x) 6= 0 by simp
moreover{ fix t assume t ∈ X and x 6= twith A1 hx ∈ Xi have b(x) 6= b(t) using inj_def
by autowith I hx∈Xi ht ∈ Xi have p(x) ∩ p(t) = 0
by auto }ultimately havep(x) 6= 0 ∧ (∀ t ∈ X. x6=t −→ p(x) ∩ p(t) = 0)
by simp} with hdomain(p) = Xi show {hx, {b(x)}i. x ∈ X} {is partition}using Partition_def by simp
qed

end

21

Enumerations

theory Enumeration_ZF imports NatOrder_ZF FiniteSeq_ZF FinOrd_ZF
begin

Suppose r is a linear order on a set A that has n elements, where n ∈ N .
In the FinOrd_ZF theory we prove a theorem stating that there is a unique200

order isomorphism between n = {0, 1, .., n − 1} (with natural order) and A.
Another way of stating that is that there is a unique way of counting theelements of A in the order increasing according to relation r. Yet anotherway of stating the same thing is that there is a unique sorted list of elementsof A. We will call this list the Enumeration of A.

21.1

Enumerations: definition and notation

In this section we introduce the notion of enumeration and define a proof
context (a ”locale” in Isabelle terms) that sets up the notation for writing
about enumarations.
We define enumeration as the only order isomorphism S
beween a set A andthe number of its elements. We are using the formula {x} = x to extract
the only element from a singleton. Le is the (natural) order on natural
numbers, defined is Nat_ZF theory in the standard Isabelle library.
definition
S
Enumeration(A,r) ≡ord_iso(|A|,Le,A,r)To set up the notation we define a locale enums. In this locale we will assume
that r is a linear order on some set X. In most applications this set will
be just the set of natural numbers. Standard Isabelle uses ≤ to denotethe ”less or equal” relation on natural numbers. We will use the ≤ symbol
to denote the relation r. Those two symbols usually look the same in thepresentation, but they are different in the source.To shorten the notation theenumeration Enumeration(A,r) will be denoted as σ(A). Similarly as in the
Semigroup theory we will write a ←- x for the result of appending an element
x to the finite sequence (list) a. Finally, a t b will denote the concatenationof the lists a and b.
locale enums =fixes X r
assumes linord: IsLinOrder(X,r)
fixes ler (infix ≤ 70)
defines ler_def[simp]: x ≤ y ≡ hx,yi ∈ rfixes σdefines σ_def [simp]: σ(A) ≡ Enumeration(A,r)
fixes append (infix ←- 72)
defines append_def[simp]: a ←- x ≡ Append(a,x)
fixes concat (infixl t 69)
defines concat_def[simp]: a t b ≡ Concat(a,b)

201

21.2

Properties of enumerations

In this section we prove basic facts about enumerations.
A special case of the existence and uniqueess of the order isomorphism for
finite sets when the first set is a natural number.
lemma (in enums) ord_iso_nat_fin:
assumes A ∈ FinPow(X) and n ∈ nat and A ≈ nshows ∃ !f. f ∈ ord_iso(n,Le,A,r)using assms NatOrder_ZF_1_L2 linord nat_finpow_nat
fin_ord_iso_ex_uniq by simp

An enumeration is an order isomorhism, a bijection, and a list.
lemma (in enums) enum_props: assumes A ∈ FinPow(X)shows
σ(A) ∈ ord_iso(|A|,Le, A,r)σ(A) ∈ bij(|A|,A)
σ(A) : |A| → A
proof from assms have
IsLinOrder(nat,Le) and |A| ∈ FinPow(nat) and A ≈ |A|using NatOrder_ZF_1_L2 card_fin_is_nat nat_finpow_nat
by autowith assms show σ(A) ∈ ord_iso(|A|,Le, A,r)using linord fin_ord_iso_ex_uniq singleton_extract
Enumeration_def by simp
then show σ(A) ∈ bij(|A|,A) and σ(A) : |A| → A
using ord_iso_def bij_def surj_def
by autoqed

A corollary from enum_props. Could have been attached as another assertion,
but this slows down verification of some other proofs.
lemma (in enums) enum_fun: assumes A ∈ FinPow(X)shows σ(A) : |A| → X
proof from assms have σ(A) : |A| → A and A⊆X
using enum_props FinPow_def by auto
then show σ(A) : |A| → X by (rule func1_1_L1B)
qed

If a list is an order isomorphism then it must be the enumeration.
lemma (in enums) ord_iso_enum: assumes A1: A ∈ FinPow(X) andA2: n ∈ nat and A3: f ∈ ord_iso(n,Le,A,r)shows f = σ(A)proof from A3 have n ≈ A using ord_iso_def eqpoll_def
by auto202

then have A ≈ n by (rule eqpoll_sym)
with A1 A2 have ∃ !f. f ∈ ord_iso(n,Le,A,r)using ord_iso_nat_fin by simp
with assms hA ≈ ni show f = σ(A)using enum_props card_card by blast
qed

What is the enumeration of the empty set?
lemma (in enums) empty_enum: shows σ(0) = 0
proof have0 ∈ FinPow(X) and 0 ∈ nat and 0 ∈ ord_iso(0,Le,0,r)using empty_in_finpow empty_ord_iso_empty
by autothen show σ(0) = 0 using ord_iso_enumby blast
qed

Adding a new maximum to a set appends it to the enumeration.
lemma (in enums) enum_append:assumes A1: A ∈ FinPow(X) and A2: b ∈ X-A andA3: ∀ a∈A. a≤bshows σ(A ∪ {b}) = σ(A)←- b
proof let f = σ(A) ∪ {h|A|,bi}from A1 have |A| ∈ nat using card_fin_is_nat
by simpfrom A1 A2 have A ∪ {b} ∈ FinPow(X)using singleton_in_finpow union_finpow by simp
moreover from this have |A ∪ {b}| ∈ nat
using card_fin_is_nat by simp
moreover have f ∈ ord_iso(|A ∪ {b}| , Le, A ∪ {b} ,r)proof from A1 A2 haveσ(A) ∈ ord_iso(|A|,Le, A,r) and|A| ∈/ |A| and b ∈/ Ausing enum_props mem_not_refl by auto
moreover from h|A| ∈ nati have∀ k ∈ |A|. hk, |A|i ∈ Le
using elem_nat_is_nat by blast
moreover from A3 have ∀ a∈A. ha,bi ∈ r by simp
moreover have antisym(Le) and antisym(r)using linord NatOrder_ZF_1_L2 IsLinOrder_def by auto
moreoverfrom A2 h|A| ∈ nati haveh|A|,|A|i ∈ Le and hb,bi ∈ rusing linord NatOrder_ZF_1_L2 IsLinOrder_def
total_is_refl refl_def by auto
hence h|A|,|A|i ∈ Le ←→ hb,bi ∈ r by simp

203

ultimately have f ∈ ord_iso(|A| ∪ {|A|} , Le, A ∪ {b} ,r)by (rule ord_iso_extend)with A1 A2 show f ∈ ord_iso(|A ∪ {b}| , Le, A ∪ {b} ,r)using card_fin_add_one by simp
qed
ultimately have f = σ(A ∪ {b})using ord_iso_enum by simp
moreover have σ(A)←- b = f
proof have σ(A)←- b = σ(A) ∪ {hdomain(σ(A)),bi}
using Append_def by simp
moreover from A1 have domain(σ(A)) = |A|using enum_props func1_1_L1 by blast
ultimately show σ(A)←- b = f by simp
qed
ultimately show σ(A ∪ {b}) = σ(A)←- b by simp
qed

What is the enumeration of a singleton?
lemma (in enums) enum_singleton:
assumes A1: x∈X shows σ({x}): 1 → X and σ({x})(0) = x
proof from A1 have0 ∈ FinPow(X) and x ∈ (X - 0) and ∀ a∈0. a≤xusing empty_in_finpow by auto
then have σ(0 ∪ {x}) = σ(0)←- x by (rule enum_append)with A1 show σ({x}): 1 → X and σ({x})(0) = x
using empty_enum empty_append1 by auto
qed

end

22

Semigroups

theory Semigroup_ZF imports Partitions_ZF Fold_ZF Enumeration_ZF
begin

It seems that the minimal setup needed to talk about a product of a sequenceis a set with a binary operation. Such object is called ”magma”. However,interesting properties show up when the binary operation is associative andsuch alebraic structure is called a semigroup. In this theory file we define andstudy sequences of partial products of sequences of magma and semigroupelements.

204

22.1

Products of sequences of semigroup elements

Semigroup is a a magma in which the binary operation is associative. In thissection we mostly study the products of sequences of elements of semigroup.
The goal is to establish the fact that taking the product of a sequence isdistributive with respect to concatenation
Q of sequences,
Q i.eQfor two sequencesa, b of the semigroup elements we have (atb) = ( a)·( b), where ”atb”
is concatenation of a and b (a++b in Haskell notation). Less formally, wewant to show that we can discard parantheses in expressions of the form
(a0 · a1 · .. · an ) · (b0 · .. · bk ).
First we define a notion similar to Fold, except that that the initial elementof the fold is given by the first element of sequence. By analogy with Haskell
fold we call that Fold1
definition
Fold1(f,a) ≡ Fold(f,a(0),Tail(a))

The definition of the semigr0 context below introduces notation for writing
about finite sequences and semigroup products. In the context we fix thecarrier and denote it G. The binary operation on G is called f . All theorems
proven in the context semigr0 will implicitly assume that f is an associative
operation on G. We will use multiplicative notation
for the semigroup operQ
ation. The product of a sequence a is denoted a. We will write a ←- x forthe result of appending an element x to the finite sequence (list) a. This is a
bit nonstandard, but I don’t have a better idea for the ”append” notation.
Finally, a t b will denote the concatenation of the lists a and b.
locale semigr0 =fixes G f
assumes assoc_assum: f {is associative on} G
fixes prod (infixl · 72)
defines prod_def [simp]: x · y ≡ fhx,yiQfixes seqprod (_ 71)
Qdefines seqprod_def [simp]:a ≡ Fold1(f,a)
fixes append (infix ←- 72)
defines append_def [simp]: a ←- x ≡ Append(a,x)
fixes concat (infixl t 69)
defines concat_def [simp]: a t b ≡ Concat(a,b)

The next lemma shows our assumption on the associativity of the semigroup
operation in the notation defined in in the semigr0 context.
lemma (in semigr0) semigr_assoc: assumes x ∈ G

205

y ∈ G

z ∈ G

shows x·y·z = x·(y·z)
using assms assoc_assum IsAssociative_def by simp

In the way we define associativity the assumption that f is associative on
G also implies that it is a binary operation on X.
lemma (in semigr0) semigr_binop: shows f : G×G → G
using assoc_assum IsAssociative_def by simp

Semigroup operation is closed.
lemma (in semigr0) semigr_closed:
assumes a∈G b∈G shows a·b ∈ Gusing assms semigr_binop apply_funtype by simp

Lemma append_1elem written in the notation used in the semigr0 context.
lemma (in semigr0) append_1elem_nice:assumes n ∈ nat and a: n → X and b : 1 → X
shows a t b = a ←- b(0)using assms append_1elem by simp

Lemma concat_init_last_elem rewritten in the notation used in the semigr0
context.
lemma (in semigr0) concat_init_last:assumes n ∈ nat k ∈ nat anda: n → X and b : succ(k) → X
shows (a t Init(b)) ←- b(k) = a t busing assms concat_init_last_elem by simp

The product of semigroup (actually, magma – we don’t need associativity
for this) elements is in the semigroup.
lemma (in semigr0) prod_type:assumesQn ∈ nat and a : succ(n) → G
shows (a) ∈ G
proof from assms havesucc(n) ∈ nat f : G×G → G Tail(a) : n → G
using semigr_binop tail_props by auto
moreover from assms have a(0) ∈ G and G 6= 0
using empty_in_every_succ apply_funtype
by autoQ
ultimately show (a) ∈ G using Fold1_def fold_props
by simpqed

What is the product of one element list?
lemma (inQsemigr0) prod_of_1elem: assumes A1: a: 1 → Gshows (a) = a(0)proof -

206

have f : G×G → G using semigr_binop by simp
moreover from A1 have Tail(a) : 0 → G using tail_props
by blast
moreover from A1 have a(0) ∈ G and G 6= 0
using apply_funtype
Q by auto
ultimately show (a) = a(0) using fold_empty Fold1_def
by simpqed

What happens to the product of a list when we append an element to thelist?
lemma (in semigr0) prod_append: assumes A1: n ∈ nat andA2: a : Q
succ(n) → GQand A3: x∈Gshows (a←-x) = (a) · x
proof from A1 A2 have I: Tail(a) : n → G a(0) ∈ G
using tail_props empty_in_every_succ apply_funtype
by autoQ
from assms have (a←-x) = Fold(f,a(0),Tail(a)←-x)using head_of_append tail_append_commute Fold1_def
by simpQ
also from A1 A3 I have . . . = (a) · xusing semigr_binop fold_append Fold1_def
by simp
finally show thesis by simp
qed

The main theorem of the section: taking the product of a sequence is distributive with respect to concatenation of sequences. The proof is by induction on the length of the second list.
theorem (in semigr0) prod_conc_distr:
assumes A1: n ∈ nat k ∈ nat andA2: a : Q
succ(n) →b:Qsucc(k) → G
Q G
shows (
a) · (b) =(a t b)proof from A1 have k ∈ nat by simp
Q
Q
Q
moreover have ∀ b ∈ succ(0) → G. (a) · (b) =(a t b)proof { fix b assume A3: b : succ(0) → G
with A1 A2 havesucc(n) ∈ nat a : succ(n) → G b : 1 → G
by autothen have a t b = a Q←- b(0) by
Q (ruleQappend_1elem_nice)with A1 A2 A3 have (a) · (b) =(a t b)using apply_funtype prod_append semigr_binop prod_of_1elemby simp} thus thesis by simp
qed
moreover have ∀ j ∈ nat.

207

Q
Q
Q
(∀ b ∈ succ(j) → G. (
a) Q
· (
b) Q
=
(a Q
t b)) −→(∀ b ∈ succ(succ(j)) → G. (a) · (b) =(a t b))proof { fix j assume A4: j ∈ nat Q
andQ
Q
A5: (∀ b ∈ succ(j) → G. (a) · (b) =(a t b)){ fix b assume A6: b : succ(succ(j)) → G
let c = Init(b)from A4 A6 have T: b(succ(j)) ∈ G and
I: c : succ(j) → G and II: b = c←-b(succ(j))
using apply_funtype init_props by autofrom A1 A2 A4 A6 havesucc(n) ∈ nat succ(j) ∈ nat
a : succ(n) → G b : succ(succ(j)) → G
by autothen have III: (a t c) ←- b(succ(j)) = a t b
by (rule concat_init_last)Q
Q
from A4 I T have (c←-b(succ(j))) = (c) · b(succ(j))
by (rule prod_append)
with
Q II haveQQQ(a) · (b) = (
a) · ((c) · b(succ(j)))
by simpmoreoverfrom A1Q
Q A2 A4 T I have(a) ∈ G (c) ∈ G b(succ(j)) ∈ G
using prod_type by auto
ultimately
have
Q
Q
Q
Q
(
a) · (b) = ((
a) · (c)) · b(succ(j))
using semigr_assoc
by
auto
Q
Q
Q
with A5 I have (a) · (b) = ((a t c))·b(succ(j))
by simpmoreoverfrom A1 A2 A4 I haveT1: succ(n) ∈ nat succ(j) ∈ nat anda : succ(n) → G
c : succ(j) → G
by autothen have Concat(a,c): succ(n) #+ succ(j) → G
by (rule concat_props)
with A1 A4 T havesucc(n #+ j) ∈ nat
a t c : succ(succ(n #+j)) → Gb(succ(j)) ∈ G
using succ_plus by autothen
Q haveQ((a t c)←-b(succ(j))) = ((a t c))·b(succ(j))
by (rule prod_append)
Q
Q
with III have ((a t c))·b(succ(j)) =(a t b)by simpQ
Q
Q
ultimately have (a) · (b) =(a t b)by simpQ
Q
Q} hence (∀ b ∈ succ(succ(j)) → G. (a) · (b) =(a t b))208

by simp} thus thesis by blast
qed
Q
Q
Q
ultimately have ∀ b ∈ succ(k) → G. (a) · (b) =(a t b)by (rule ind_on_nat)
Q
Q
Q
with A2 show (a) · (b) =(a t b) by simp
qed

22.2

Products over sets of indicesQ
In this section we study the properties of expressions of the form i∈Λ ai =Q
ai0 · ai1 · .. · ai−1 , i.e. what we denote as (Λ,a). Λ here is a finite subset ofsome set X and a is a function defined on X with values in the semigroup
G.
Suppose a : X → G is an indexed family of elements of a semigroup G
andQ Λ = {i0 , i1 , .., in−1 } ⊆ N is a finite set of indices. We want to definei∈Λ ai = ai0 · ai1 · .. · ai−1 . To do that we use the notion of Enumeration
defined in the Enumeration_ZF theory file that takes a set of indices and lists
them in increasing order, thus converting it to list. Then we use the Fold1
to multiply the resulting list. Recall that in Isabelle/ZF the capital letter”O” denotes the composition of two functions (or relations).
definition
SetFold(f,a,Λ,r) = Fold1(f,a O Enumeration(Λ,r))For a finite subset Λ of a linearly ordered set X we will write σ(Λ) to denotethe enumeration of the elements of Λ, i.e. the only order isomorphism |Λ| →Λ, where |Λ| ∈ N is the number of elements of Λ. We also define notation
for taking a product over a set of indices of some sequence of semigroupelements. The product of semigroup Q
elements over some set Λ ⊆ X of
Q
indices of a sequence a : X → G (i.e.
(Λ,a). In thei∈Λ ai ) is denoted
semigr1 context we assume that a is a function defined on some linearlyordered set X with values in the semigroup G.
locale semigr1 = semigr0 +fixes X r
assumes linord: IsLinOrder(X,r)
fixes aassumes a_is_fun: a : X → G
fixes σdefines σ_def [simp]: σ(A) ≡ Enumeration(A,r)
Q
fixes setpr ( )Qdefines setpr_def [simp]: (Λ,b) ≡ SetFold(f,b,Λ,r)209

We can use the enums locale in the semigr0 context.
lemma (in semigr1) enums_valid_in_semigr1: shows enums(X,r)
using linord enums_def by simp

Definition of product over a set expressed in notation of the semigr0 locale.
lemma (inQ semigr1)Qsetproddef:
shows (Λ,a) =(a O σ(Λ))
using SetFold_def by simp

A composition of enumeration of a nonempty finite subset of N with a sequence of elements of G is a nonempty list of elements of G. This implies
that a product over set of a finite set of indices belongs to the (carrier of)
semigroup.
lemma (in semigr1) setprod_type: assumes
A1: Λ ∈ FinPow(X) and A2: Λ6=0
shows
∃ n ∈Qnat . |Λ| = succ(n) ∧ a O σ(Λ) : succ(n) → G
and (Λ,a) ∈ G
proof from assms obtain n where n ∈ nat and |Λ| = succ(n)using card_non_empty_succ by autofrom A1 have σ(Λ) : |Λ| → Λusing enums_valid_in_semigr1 enums.enum_props
by simpwith A1 have a O σ(Λ): |Λ| → G
using a_is_fun FinPow_def comp_fun_subset
by simpwith hn ∈ nati and h|Λ| = succ(n)i show
∃ n ∈ nat . |Λ| = succ(n) ∧ a O σ(Λ) : succ(n) → G
by autohn ∈ nati h|Λ| = succ(n)i ha O σ(Λ): |Λ| → Gifrom Q
show (Λ,a) ∈ G using prod_type setproddef
by autoqed

The enum_append lemma from the Enemeration theory specialized for natural
numbers.
lemma (in semigr1) semigr1_enum_append:assumes Λ ∈ FinPow(X) andn ∈ X - Λ and ∀ k∈Λ. hk,ni ∈ rshows σ(Λ ∪ {n}) = σ(Λ)←- nusing assms FinPow_def enums_valid_in_semigr1
enums.enum_append by simp

What is product over a singleton?
lemma (in semigr1) gen_prod_singleton:
assumes A1: x ∈ X

210

Q
shows
({x},a) = a(x)proof from A1 have σ({x}): 1 → X and σ({x})(0) = x
using enums_valid_in_semigr1 enums.enum_singleton
by auto Q
then show ({x},a) = a(x)using a_is_fun comp_fun setproddef prod_of_1elem
comp_fun_apply by simpqed

A generalization of prod_append to the products over sets of indices.
lemma (in semigr1) gen_prod_append:assumes
A1: Λ ∈ FinPow(X) and A2: Λ 6= 0 and
A3: n ∈ X - Λ andA4: ∀ k∈Λ.
Q hk,ni ∈ rQshows (Λ ∪ {n}, a) = ( (Λ,a)) · a(n)proof - Q
Q
have (Λ ∪ {n}, a) =(a O σ(Λ ∪ {n}))using setproddef by simp
Q
also from A1 A3 A4 have . . . =(a O (σ(Λ)←- n))using semigr1_enum_append
by
simp
Q
also have . . . =((a O σ(Λ))←- a(n))
proof from A1 A3 have|Λ| ∈ nat and σ(Λ) : |Λ| → X and n ∈ Xusing card_fin_is_nat enums_valid_in_semigr1 enums.enum_fun
by autothen show thesis using a_is_fun list_compose_append
by simpqed
Qalso from assms have . . . = ((a O σ(Λ)))·a(n)using a_is_fun setprod_type apply_funtype prod_append
by blast
Q
also have . . . = ( (Λ,a)) · a(n)using SetFold_def
by simpQ
Q
finally show (Λ ∪ {n}, a) = ( (Λ,a)) · a(n)by simpqed

Very similar to gen_prod_append: a relation between a product over a set ofindices and the product over the set with the maximum removed.
lemma (in semigr1) gen_product_rem_point:
assumes A1: A ∈ FinPow(X) andA2: n ∈ A and A4: A - {n} 6= 0 andA3: ∀ k∈A. hk, ni ∈ r
shows
Q
Q
( (A - {n},a)) · a(n) = (A, a)
proof -

211

let Λ = A - {n}from A1 A2 have Λ ∈ FinPow(X) and n ∈ X - Λusing fin_rem_point_fin
FinPow_def
Q
Q by autowith A3 A4 have (Λ ∪ {n}, a) = ( (Λ,a)) · a(n)using a_is_fun gen_prod_append by blast
with A2 show thesis using rem_add_eq by simp
qed

22.3

Commutative semigroups

Commutative semigroups are those whose operation is commutative, i.e.
a·b = b·Q
a. This implies that for any permutation s : n → n we have
Q
n
n
a
=
j=0 j Q j=0 a
Qs(j) , or, closer to the notation we are using in the semigr0
context,a = (a ◦ s). Maybe one day we will be able to prove this,but for now the goal is to prove something simpler: that if the semigroup
operation is commutative taking the product of a sequence Q is distributive

Qn
Qn
n
a
)
b
)
with respect to the operation: j=0 (aj ·bj ) =j=0 j
j=0 j . Manyof the rearrangements (namely those that don’t use the inverse) proven in
the AbelianGroup_ZF theory hold in fact in semigroups. Some of them will
be reproven in this section.
A rearrangement with 3 elements.
lemma (in semigr0) rearr3elems:
assumes f {is commutative on} G and a∈G b∈G c∈Gshows a·b·c = a·c·b
using assms semigr_assoc IsCommutative_def by simp

A rearrangement of four elements.
lemma (in semigr0) rearr4elems:
assumes A1: f {is commutative on} G andA2: a∈G b∈G c∈G d∈Gshows a·b·(c·d) = a·c·(b·d)
proof from A2 have a·b·(c·d) = a·b·c·dusing semigr_closed semigr_assoc by simp
also have a·b·c·d = a·c·(b·d)
proof from A1 A2 have a·b·c·d = c·(a·b)·d
using IsCommutative_def semigr_closed
by simp
also from A2 have . . . = c·a·b·d
using semigr_closed semigr_assoc
by simp
also from A1 A2 have . . . = a·c·b·dusing IsCommutative_def semigr_closed
by simp
also from A2 have . . . = a·c·(b·d)

212using semigr_closed semigr_assoc
by simp
finally show a·b·c·d = a·c·(b·d) by simp
qed
finally show a·b·(c·d) = a·c·(b·d)
by simpqed

We start with a version of prod_append that will shorten a bit the proof ofthe main theorem.
lemma (in semigr0) shorter_seq: assumes A1: k ∈ nat andA2: a ∈ Q
succ(succ(k))→ GQshows (a) = (
Init(a)) · a(succ(k))
proof let x = Init(a)from assms havea(succ(k)) ∈ G and x : succ(k) → G
using apply_funtype
init_props by Q
auto
Q
with A1 have (x←-a(succ(k))) = (x) · a(succ(k))
using prod_append by simp
with assms show thesis using init_props
by simpqed

A lemma useful in the induction step of the main theorem.
lemma (in semigr0) prod_distr_ind_step:
assumes A1: k ∈ nat andA2: a : succ(succ(k)) → G andA3: b : succ(succ(k)) → G andA4: c : succ(succ(k)) → G andA5: ∀ j∈succ(succ(k)). c(j) = a(j) · b(j)shows
Init(a) : succ(k) → G
Init(b) : succ(k) → G
Init(c) : succ(k) → G∀ j∈succ(k). Init(c)(j) = Init(a)(j) · Init(b)(j)proof from A1 A2 A3 A4 show
Init(a) : succ(k) → G
Init(b) : succ(k) → G
Init(c) : succ(k) → G
using init_props by autofrom A1 have T: succ(k) ∈ nat by simp
from T A2 have ∀ j∈succ(k). Init(a)(j) = a(j)by (rule init_props)
moreover from T A3 have ∀ j∈succ(k). Init(b)(j) = b(j)by (rule init_props)
moreover from T A4 have ∀ j∈succ(k). Init(c)(j) = c(j)by (rule init_props)213moreover from A5 have ∀ j∈succ(k). c(j) = a(j) · b(j)by simpultimately show ∀ j∈succ(k). Init(c)(j) = Init(a)(j) · Init(b)(j)by simpqed

For commutative operations taking the product of a sequence is distributive
with respect to the operation. This version will probably not be used inapplications, it is formulated in a way that is easier to prove by induction.
For a more convenient formulation see prod_comm_distrib. The proof by
induction on the length of the sequence.
theorem (in semigr0) prod_comm_distr:
assumes A1: f {is commutative on} G and A2: n∈nat
shows ∀ a b c.
(a : succ(n)→G ∧ b : succ(n)→G ∧ c : succ(n)→G ∧(∀Qj∈succ(n).
Q c(j) =Q a(j) · b(j))) −→(c) = (
a) · (b)
proof note A2
moreover have ∀ a b c.
(a : succ(0)→G ∧ b : succ(0)→G ∧ c : succ(0)→G ∧(∀Qj∈succ(0).
Q c(j) =Q a(j) · b(j))) −→(c) = (
a) · (b)
proof { fix a b c
assume a : succ(0)→G ∧ b : succ(0)→G ∧ c : succ(0)→G ∧(∀ j∈succ(0). c(j) = a(j) · b(j))
then have
I: a : 1→G b : 1→G c : 1→G and
II: c(0) = a(0) · b(0) by auto
Q from I have Q
Q(a) = a(0) and (b) = b(0) and (c) = c(0)using prod_of_1elem Q
by auto Q
Q
with II have (c) = (
a) · (b) by simp
} then show thesis using Fold1_def by simp
qed
moreover have ∀ k ∈ nat.
(∀ a b c.
(a : succ(k)→G ∧ b : succ(k)→G ∧ c : succ(k)→G ∧(∀Qj∈succ(k).
Q c(j) =Q a(j) · b(j))) −→(c) = (
a) · (b)) −→(∀ a b c.
(a : succ(succ(k))→G ∧ b : succ(succ(k))→G ∧ c : succ(succ(k))→G∧(∀
Qj∈succ(succ(k)).
Q
Qc(j) = a(j) · b(j))) −→(c) = (
a) · (b))
proof
fix k assume k ∈ natshow (∀ a b c.

214a ∈ succ(k) → G ∧b ∈ succ(k) → G ∧ c ∈ succ(k) → G ∧(∀Qj∈succ(k).
Q c(j) =Q a(j) · b(j)) −→(c) = (
a) · (b)) −→(∀ a b c.
a ∈ succ(succ(k)) → G ∧b ∈ succ(succ(k)) → G ∧c ∈ succ(succ(k)) → G ∧(∀Qj∈succ(succ(k)).
Q
Qc(j) = a(j) · b(j)) −→(c) = (
a) · (b))
proof
assume A3: ∀ a b c.
a ∈ succ(k) → G ∧b ∈ succ(k) → G ∧ c ∈ succ(k) → G ∧(∀Qj∈succ(k).
Q c(j) =Q a(j) · b(j)) −→(c) = (
a) · (b)
show ∀ a b c.
a ∈ succ(succ(k)) → G ∧b ∈ succ(succ(k)) → G ∧c ∈ succ(succ(k)) → G ∧(∀Qj∈succ(succ(k)).
Q
Qc(j) = a(j) · b(j)) −→(c) = (
a) · (b)
proof { fix a b c
assumea ∈ succ(succ(k)) → G ∧b ∈ succ(succ(k)) → G ∧c ∈ succ(succ(k)) → G ∧(∀ j∈succ(succ(k)). c(j) = a(j) · b(j))
with hk ∈ nati have I:
a : succ(succ(k)) → Gb : succ(succ(k)) → G
c : succ(succ(k)) → G
and II: ∀ j∈succ(succ(k)). c(j) = a(j) · b(j)by autolet x = Init(a)let y = Init(b)let z = Init(c)hk ∈ nati I have III:fromQ
Q(Q a) = (Q x) · a(succ(k))
(
b)
y)
Q= (
Q · b(succ(k)) andIV: (c) = (z) · c(succ(k))
using shorter_seq by auto
moreoverfrom hk ∈ nati I II havex : succ(k) → G
y : succ(k) → G
z : succ(k) → G and∀ j∈succ(k). z(j) = x(j) · y(j)215using prod_distr_ind_step by autowith
Q A3 II IV
Q have Q(c) = (x)·(y)·(a(succ(k)) · b(succ(k)))
by simpmoreoverfrom A1 hk ∈ nati I III haveQQ(Q x)·( Qy)·(a(succ(k)) · b(succ(k)))=(a) · (b)
using init_props prod_type apply_funtype
rearr4elems by
Q simpQ
Q
ultimately have (c) = (
a) · (
b)
by simp} thus thesis by auto
qed
qed
qed
ultimately show thesis by (rule ind_on_nat)qed

A reformulation of prod_comm_distr that is more convenient in applications.
theorem (in semigr0) prod_comm_distrib:assumes f {is commutative on} G and n∈nat anda : succ(n)→G b : succ(n)→G c : succ(n)→G and∀ j∈succ(n).
c(j)Q= a(j) · Qb(j)Qshows (c) = (
a) · (b)
using assms prod_comm_distr by simp

A product of two products over disjoint sets of indices is the product overthe union.
lemma (in semigr1) prod_bisect:assumes A1: f {is commutative on} G and A2: Λ ∈ FinPow(X)
shows
Q
Q
Q
∀ P ∈ Bisections(Λ). (Λ,a) = ( (fst(P),a))·( (snd(P),a))proof have IsLinOrder(X,r) using linord by simp
moreover haveQ
QQ
∀ P ∈ Bisections(0). (0,a) = ( (fst(P),a))·( (snd(P),a))using bisec_empty by simp
moreover have ∀ A ∈ FinPow(X).
( ∀ n ∈ X - A.
Q
Q
Q(∀ P ∈ Bisections(A). (A,a) = ( (fst(P),a))·( (snd(P),a)))∧ (∀ k∈A. hk,ni ∈ r ) −→(∀Q Q ∈ Bisections(AQ ∪ {n}).
Q(A ∪ {n},a) = ( (fst(Q),a))·( (snd(Q),a))))proof { fix A assume A ∈ FinPow(X)fix n assume n ∈ X - A
have (Q∀ P ∈ Bisections(A).
Q
Q(A,a) = ( (fst(P),a))·( (snd(P),a)))∧ (∀ k∈A. hk,ni ∈ r ) −→

216

(∀
Q Q ∈ Bisections(AQ ∪ {n}).
Q(A ∪ {n},a) = ( (fst(Q),a))·( (snd(Q),a)))proof { assume I:QQQ∀ P ∈ Bisections(A). (A,a) = ( (fst(P),a))·( (snd(P),a))and II: ∀ k∈A. hk,ni ∈ rhave∪ {n}). Q
Q ∀ Q ∈ Bisections(AQ(A ∪ {n},a) = ( (fst(Q),a))·( (snd(Q),a))proof { fix Q assume Q ∈ Bisections(A ∪ {n})let Q0 = fst(Q)let Q1 = snd(Q)from hA ∈ FinPow(X)i hn ∈ X - Ai have A ∪ {n} ∈ FinPow(X)using singleton_in_finpow union_finpow by autowith hQ ∈ Bisections(A ∪ {n})i haveQ0 ∈ FinPow(X) Q0 6= 0 and Q1 ∈ FinPow(X) Q1 6= 0
using bisect_finQbisec_is_pair Bisections_def
by autoQ
then have (Q0 ,a) ∈ G and (Q1 ,a) ∈ G
using a_is_fun setprod_type by autofrom hQ ∈ Bisections(A ∪ {n})i hA ∈ FinPow(X)i hn ∈ X-Ai
have refl(X,r) Q0 ⊆ A ∪ {n} Q1 ⊆ A ∪ {n}A ⊆ X and n ∈ Xusing linord IsLinOrder_def total_is_refl Bisections_def
FinPow_def by autofrom hrefl(X,r)i hQ0 ⊆ A ∪ {n}i hA ⊆ Xi hn ∈ Xi II
have III: ∀ k ∈ Q0 . hk, ni ∈ r by (rule refl_add_point)
from hrefl(X,r)i hQ1 ⊆ A ∪ {n}i hA ⊆ Xi hn ∈ Xi II
have IV: ∀ k ∈ Q1 . hk, ni ∈ r by (rule refl_add_point)
from hn ∈ X - Ai hQ ∈ Bisections(A ∪ {n})i haveQ0 = {n} ∨ Q1 = {n} ∨ hQ0 - {n},Q1 -{n}i ∈ Bisections(A)using bisec_is_pair bisec_add_point by simp
moreover{ assume Q1 = {n}from hn ∈ X - Ai have n ∈/ A by auto
moreoverfrom hQ ∈ Bisections(A ∪ {n})ihave hQ0 ,Q1 i ∈ Bisections(A ∪ {n})using bisec_is_pair by simp
with hQ1 = {n}i have hQ0 , {n}i ∈ Bisections(A ∪ {n})by simpultimately have Q0 = A and A 6= 0
using set_point_bisec by autowith hQA ∈ FinPow(X)i hn Q
∈ X - Ai Q
II hQ1 = {n}ihave (A ∪ {n},a) = ( (Q0 ,a))· (Q1 ,a)using a_is_fun gen_prod_append gen_prod_singleton
by simp }moreover{ assume Q0 = {n}from hn ∈ X - Ai have n ∈ X by auto217

then have {n} ∈ FinPow(X) and {n} 6= 0
using singleton_in_finpow by autofrom hn ∈ X - Ai have n ∈/ A by auto
moreoverfrom hQ ∈ Bisections(A ∪ {n})ihave hQ0 , Q1 i ∈ Bisections(A ∪ {n})using bisec_is_pair by simp
with hQ0 = {n}i have h{n}, Q1 i ∈ Bisections(A ∪ {n})by simpultimately have Q1 = A and A 6= 0 using point_set_bisec
by autowith A1 hA ∈ FinPow(X)i hn ∈ X - Ai II
h{n} ∈ FinPow(X)ih{n} 6= 0i hQ= {n}i0Q
Q
Q
have (A ∪ {n},a) = ( (Q0 ,a))·( (Q1 ,a))using a_is_fun gen_prod_append gen_prod_singleton
setprod_type IsCommutative_def by auto }moreover{ assume A4: hQ0 - {n},Q1 - {n}i ∈ Bisections(A)with hA ∈ FinPow(X)i haveQ0 - {n} ∈ FinPow(X) Q0 - {n} 6= 0 and
Q1 - {n} ∈ FinPow(X) Q1 - {n} 6= 0
using FinPow_def Bisections_def by autohiwith
Q n ∈ X - A have Q(Q0 - {n},a) ∈ G(Q1 - {n},a) ∈ G and
T: a(n) ∈ G
using a_is_fun setprod_type apply_funtype by autofrom hQ ∈ Bisections(A ∪ {n})i A4 have
(hQ0 , Q1 - {n}i ∈ Bisections(A) ∧ n ∈ Q1 ) ∨(hQ0 - {n}, Q1 i ∈ Bisections(A) ∧ n ∈ Q0 )using bisec_is_pair bisec_add_point_case3 by auto
moreover{ assume hQ0 , Q1 - {n}i ∈ Bisections(A) and n ∈ Q1
then have A 6= 0 using bisec_props by simp
with A2 hA ∈ FinPow(X)i hn ∈ X - Ai QI II T IV
hhQ , Q
1 - {n}i ∈ Bisections(A)i h (Q0 ,a) ∈ Gi
Q0h
(Q1 - {n},a) ∈ Gi hQ1 ∈ FinPow(X)ihn ∈ Q i hQ
i
1 - {n} 6= 0
Q1
QQ
have (A ∪ {n},a) = ( (Q0 ,a))·( (Q1 ,a))using gen_prod_append semigr_assoc gen_product_rem_pointby simp }moreover{ assume hQ0 - {n}, Q1 i ∈ Bisections(A) and n ∈ Q0
then have A 6= 0 using bisec_props by simp
with A1 A2 hA ∈ FinPow(X)i hn ∈ XQ- Ai I II III T
hhQ
i h(Q0 - {n},a)∈Gi
Q0 - {n}, Q1 i∈Bisections(A)hi hQi hn ∈ Q i hQ -{n}6=0i
(Q
,a)
∈
G
∈
FinPow(X)
0
0
0
Q1
Q
Q
have (A ∪ {n},a) = ( (Q0 ,a))·( (Q1 ,a))using gen_prod_append rearr3elems gen_product_rem_pointby simp }218

ultimately
have
Q
Q
Q
(A ∪ {n},a) = ( (Q0 ,a))·( (Q1 ,a))by auto }Q
Q
Q
ultimately have (A ∪ {n},a) = ( (Q0 ,a))·( (Q1 ,a))by auto} thus thesis by simp
qed
} thus thesis by simp
qed
} thus thesis by simp
qed
moreover note A2
ultimately show thesis by (rule fin_ind_add_max)qed

A better looking reformulation of prod_bisect.
theorem (in semigr1) prod_disjoint: assumes
A1: f {is commutative on} G and
A2: A ∈ FinPow(X) A 6= 0 and
A3: B ∈ FinPow(X) B 6= 0 and
A4: A ∩QB = 0
Q
Q
shows (A∪B,a) = ( (A,a))·( (B,a))proof from A2 A3 A4 have hA,Bi ∈ Bisections(A∪B)
using is_bisec by simp
with A1 A2 A3 show thesis
using a_is_fun union_finpow prod_bisect by simpqed

A generalization of prod_disjoint.
lemma (in semigr1) prod_list_of_lists: assumes
A1: f {is commutative on} G and A2: n ∈ nat
shows ∀ M ∈ succ(n) → FinPow(X).
MQ{is partition}
−→
Q
(Q S
{hi, (M(i),a)i. i ∈ succ(n)}) =( ( i ∈ succ(n). M(i),a))proof note A2
moreover have ∀ M ∈ succ(0) → FinPow(X).
MQ{is partition}
−→
Q
Q S
(
{hi, (M(i),a)i. i ∈ succ(0)}) = ( ( i ∈ succ(0). M(i),a))using a_is_fun func1_1_L1 Partition_def apply_funtype setprod_type
list_len1_singleton prod_of_1elemby simpmoreover have ∀ k ∈ nat.
(∀ M ∈ succ(k) → FinPow(X).
MQ{is partition}
−→
Q
(Q S
{hi, (M(i),a)i. i ∈ succ(k)}) =( ( i ∈ succ(k). M(i),a))) −→219

(∀ M ∈ succ(succ(k)) → FinPow(X).
MQ{is partition}
−→
Q
(Q S
{hi, (M(i),a)i. i ∈ succ(succ(k))}) =( ( i ∈ succ(succ(k)). M(i),a)))proof { fix k assume k ∈ nat
assume A3: ∀ M ∈ succ(k) → FinPow(X).
MQ{is partition}
−→
Q
(Q S
{hi, (M(i),a)i. i ∈ succ(k)}) =( ( i ∈ succ(k). M(i),a))have (∀ N ∈ succ(succ(k)) → FinPow(X).
NQ{is partition}
−→
Q
(Q S
{hi, (N(i),a)i. i ∈ succ(succ(k))}) =( ( i ∈ succ(succ(k)). N(i),a)))proof { fix N assume A4: N : succ(succ(k)) → FinPow(X)assume A5: N {is partition}with A4 have I: ∀ i ∈ succ(succ(k)). N(i) 6= 0
using func1_1_L1
Partition_def by simpQ
let b = {hi,Q(N(i),a)i. i ∈ succ(succ(k))}
let c = {hi, (N(i),a)i. i ∈ succ(k)}Qhave II: ∀ i ∈ succ(succ(k)). (N(i),a) ∈ G
proof
fix i assume i ∈ succ(succ(k))
with A4 I have N(i) ∈ FinPow(X) and N(i) 6= 0
using apply_funtype
by autoQ
then show (N(i),a) ∈ G using setprod_type
by simpqed
Qhence ∀ i ∈ succ(k).
(N(i),a) ∈ G by auto
then have c :Qsucc(k) → G by (rule ZF_fun_from_total)have b = {hi, (N(i),a)i. i ∈ succ(succ(k))}
by simpQ
with II have b = Append(c, (N(succ(k)),a))by (rule set_list_append)hi hc : succ(k) → Giwith IIQ k ∈ nat
Q
Q
have (b) = (c)·( (N(succ(k)),a))using prod_append by simp
also have Q S
Q. . . = ( ( i ∈ succ(k). N(i),a))·( (N(succ(k)),a))proof let M = restrict(N,succ(k))
have succ(k) ⊆ succ(succ(k)) by autowith hN : succ(succ(k)) → FinPow(X)ihave M : succ(k) → FinPow(X) andIII: ∀ i ∈ succ(k). M(i) = N(i)using restrict_type2 restrict apply_funtype
by autowith A5 hM : succ(k) → FinPow(X)ihave M {is partition}

220

using func1_1_L1 Partition_def by simphiwith
Q A3 MQ: succ(k) → FinPow(X) have
(Q S{hi, (M(i),a)i. i ∈ succ(k)}) =( ( i ∈ succ(k). M(i),a))by blastwith III show thesis by simpqed
Q S
also have . . . = ( ( i ∈ succ(succ(k)). N(i),a))proof - S
let A =i ∈ succ(k). N(i)let B = N(succ(k))
from A4 hk ∈ nati have succ(k) ∈ nat and∀ i ∈ succ(k). N(i) ∈ FinPow(X)using apply_funtype by auto
then have A ∈ FinPow(X) by (rule union_fin_list_fin)
moreover from I have A 6= 0 by auto
moreover from A4 I haveN(succ(k)) ∈ FinPow(X) and N(succ(k)) 6= 0
using apply_funtype by auto
moreover from hsucc(k) ∈ nati A4 A5 have A ∩ B = 0
by (rule list_partition)
moreover note A1Q
Q
Q
ultimately have (A∪B,a) = ( (A,a))·( (B,a))using prod_disjoint by Ssimp
moreover have A ∪ B = ( i ∈ succ(succ(k)). N(i))
by autoultimately show thesis by simp
qed
QQ
finally{hi, (N(i),a)i. i ∈ succ(succ(k))}) =Q Shave (( ( i ∈ succ(succ(k)). N(i),a))by simp} thus thesis by autoqed
} thus thesis by simp
qed
ultimately show thesis by (rule ind_on_nat)qed

A more convenient reformulation of prod_list_of_lists.
theorem (in semigr1) prod_list_of_sets:
assumes A1: f {is commutative on} G and
A2: n ∈ nat n 6= 0 and
A3: M : n → FinPow(X)M {is partition}
shows
Q
Q
Q S
(
{hi, (M(i),a)i. i ∈ n}) = ( ( i ∈ n. M(i),a))proof from A2 obtain k where k ∈ nat and n = succ(k)using Nat_ZF_1_L3 by autowith A1 A3 show thesis using prod_list_of_lists

221by simp
qed
Q

The definition of the product (A,a) ≡ SetFold(f,a,A,r) of a some (finite)
set of semigroup elements requires that r is a linear order on the set of indicesA. This is necessary so that we know in which order we aretheQ multiplyingQ
elements. The product over A is defined so that we have A a = a ◦ σ(A)where σ : |A| → A is the enumeration of A (the only order isomorphism
between the number of elements in A and A), see lemma setproddef. However, if the operation is commutative, the order is irrelevant. The next
theorem formalizes that fact stating that we can replace the enumeration
σ(A) by any bijection between |A| and A. In a way this is a generalizationof setproddef. The proof is based on application of prod_list_of_sets tothe finite collection of singletons that comprise A.
theorem (in semigr1) prod_order_irr:
assumes A1: f {is commutative on} G and
A2: A ∈ FinPow(X) A 6= 0 andA3: b ∈ Q
bij(|A|,A)
Q
shows ((a O b)) = (A,a)
proof let n = |A|
let M =Q{hk, {b(k)}i. kQ∈ n} Q
have ((a O b)) = ({hi, (M(i),a)i. i ∈ n})
proof Q
have ∀ i ∈ n. (M(i),a) = (a O b)(i)
proof
fix i assume i ∈ nwith A2 A3 hi ∈ ni have b(i) ∈ X
using bij_def inj_def apply_funtype FinPow_def
by autoQ
then have ({b(i)},a) = a(b(i))
using gen_prod_singleton by
Q simpwith A3 hi ∈ ni have ({b(i)},a) = (a O b)(i)using bij_def inj_def comp_fun_apply
by autoQ
with hi ∈ ni A3 show (M(i),a) = (a O b)(i)using bij_def inj_partition by autoqedQ
hence {hi, (M(i),a)i. i ∈ n} = {hi,(a O b)(i)i. i ∈ n}
by simpmoreover have {hi,(a O b)(i)i. i ∈ n} = a O b
proof from A3 have b : n → A using bij_def inj_def by simp
moreover from A2 have A ⊆ X using FinPow_def by simp
ultimately have b : n → X by (rule func1_1_L1B)
then have a O b: n → G using a_is_fun comp_fun
by simpthen show {hi,(a O b)(i)i. i ∈ n} = a O b
using fun_is_set_of_pairs by simp

222

qed
ultimately show thesis by simpqed
Q S
also have . . . = ( ( i ∈ n. M(i),a))proof note A1
moreover from A2 have n ∈ nat and n 6= 0
using card_fin_is_nat card_non_empty_non_zero by auto
moreover have M : n → FinPow(X) and M {is partition}
proof from A2 A3 have ∀ k ∈ n. {b(k)} ∈ FinPow(X)using bij_def inj_def apply_funtype FinPow_def
singleton_in_finpow by auto
then show M : n → FinPow(X) using ZF_fun_from_total
by simpfrom A3 show M {is partition} using bij_def inj_partition
by autoqed
ultimately
Q
Qshow
Q S
(
{hi, (M(i),a)i. i ∈ n}) = ( ( i ∈ n. M(i),a))by (rule prod_list_of_sets)
qed
Q S
Q
also from A3 have ( ( i ∈ n. M(i),a)) = (A,a)
using bij_def inj_partition surj_singleton_image
by autofinally show thesis by simp
qed

Another way of expressing the fact that the product dos not depend on theorder.
corollary (in semigr1) prod_bij_same:
assumes f {is commutative on} G andA ∈ FinPow(X) A 6= 0 andb ∈ bij(|A|,A)c ∈ bij(|A|,A)
Q
Q
shows ((a O b)) = ((a O c))using assms prod_order_irr by simp
end

23

Commutative Semigroups

theory CommutativeSemigroup_ZF imports Semigroup_ZF
begin

In the Semigroup theory we introduced a notion of SetFold(f,a,Λ,r) that
represents the sum of values of some function a valued in a semigroup where
the arguments of that function vary over some set Λ. Using the additive

223

P
notation something like this would be expressed as x∈Λ f (x) in informal
mathematics. This theory considers an alternative to that notion that ismore specific to commutative semigroups.

23.1

Sum of a function over a set

The r parameter in the definition of SetFold(f,a,Λ,r) (from Semigroup_ZF)
represents a linear order relation on Λ that is needed to indicate in whatorder we are summing the values f (x). If the semigroup operation is commutative the order does not matter and the relation r is not needed. In thissection we define a notion of summing up values of some function a : X → G
over a finite set of indices Γ ⊆ X, without using any order relation on X.
We define the sum of values of a function a : X → G over a set Λ as the only
element of the set of sums of lists that are bijections between the number ofvalues in Λ (which is a natural number n = {0, 1, .., n − 1} if Λ is finite) andΛ. The notion of Fold1(f,c) is defined in Semigroup_ZF as the fold (sum) of
the list c starting from the first element of that list. The intention is to use
the fact that since the result of summing up a list does not depend on theorder, the set {Fold1(f,a O b). b ∈ bij( |Λ|, Λ)} is a singleton and we
can extract its only value by taking its union.
definitionS
CommSetFold(f,a,Λ) ={Fold1(f,a O b). b ∈ bij(|Λ|, Λ)}

the next locale sets up notation for writing about summation in commutative
semigroups. We define two kinds of sums. One is the sum of elements of a list
(which are just functions defined on a natural number) and the second one
represents a more general notion the sum of values of a semigroup valued
function over some set of arguments. Since those two types of sums aredifferent notions they are represented by different symbols.
P However in thepresentations they are both intended to be printed as .
locale commsemigr =fixes G f
assumes csgassoc: f {is associative on} G
assumes csgcomm: f {is commutative on} G
fixes csgsum (infixl + 69)
defines csgsum_def[simp]: x + y ≡ fhx,yifixes X a
assumes csgaisfun: a : X → G
Pfixes csglistsum (
_ 70)

224

defines csglistsum_def[simp]:Pk ≡ Fold1(f,k)

P
fixes csgsetsum ( )Pdefines csgsetsum_def[simp]:(A,h) ≡ CommSetFold(f,h,A)Definition of a sum of function over a set in notation defined in the commsemigr
locale.
lemma (inPcommsemigr)SCommSetFolddef:
Pshows ( (A,a)) = ( { (a O b). b ∈ bij(|A|, A)})
using CommSetFold_def by simp

The next lemma states that the result of a sum does not depend on the orderwe calculate it. This is similar to lemma prod_order_irr in the Semigrouptheory, except that the semigr1 locale assumes that the domain of the function we sum up is linearly ordered, while in commsemigr we don’t have thisassumption.
lemma (in commsemigr) sum_over_set_bij:
assumesPA1: A ∈ FinPow(X)A 6= 0 and A2: b ∈ bij(|A|,A)
P
shows ( (A,a)) = ((a O b))proof havePP
∀ c ∈ bij(|A|,A). ∀ d ∈ bij(|A|,A). ( (a O c)) = ( (a O d))
proof { fix c assume c ∈ bij(|A|,A)
fix d assume d ∈ bij(|A|,A)
let r = InducedRelation(converse(c), Le)have semigr1(G,f,A,r,restrict(a, A))
proof have semigr0(G,f) using csgassoc semigr0_def by simp
moreover from A1 hc ∈ bij(|A|,A)i have IsLinOrder(A,r)
using bij_converse_bij card_fin_is_nat
natord_lin_on_each_nat ind_rel_pres_lin by simp
moreover from A1 have restrict(a, A) : A → G
using FinPow_def csgaisfun restrict_fun by simp
ultimately show thesis using semigr1_axioms.intro semigr1_def
by simpqed
moreover have f {is commutative on} G using csgcomm
by simpmoreover from A1 have A ∈ FinPow(A) A 6= 0
using FinPow_def by auto
moreover note hc ∈ bij(|A|,A)i hd ∈ bij(|A|,A)i
ultimately have
Fold1(f,restrict(a,A) O c) = Fold1(f,restrict(a,A) O d)by (rule semigr1.prod_bij_same)PP
hence (
(restrict(a,A) O c)) = ((restrict(a,A) O d))by simpmoreover from A1 hc ∈ bij(|A|,A)i hd ∈ bij(|A|,A)i

225

have
restrict(a,A) O c = a O c and restrict(a,A) O d = a O dusing bij_def surj_def csgaisfun FinPow_def comp_restrictby autoPP
ultimately have ( (a O c)) = ( (a O d)) by simp
} thus thesis by blast
qed
S P
P
with A2 have ( { (a O b). b ∈ bij(|A|, A)}) = ((a O b))by (rule singleton_comprehension)then show thesis using CommSetFolddef by simp
qed

The result of a sum is in the semigroup. Also, as the second assertion
we show that every semigroup valued function generates a homomorphism
between the finite subsets of a semigroup and the semigroup. Adding anelement to a set coresponds to adding a value.
lemma (in commsemigr) sum_over_set_add_point:
assumes
P A1: A ∈ FinPow(X) A 6= 0
shows
(A,a)
P ∈ G andP
∀ x ∈ X-A.
(A ∪ {x},a) = ( (A,a)) + a(x)proof from A1 obtain b where b ∈ bij(|A|,A)
using fin_bij_cardby autoP
Pwith A1 have(A,a) = ((a O b))using sum_over_set_bij by simp
from A1 have |A| ∈ nat using card_fin_is_nat by simp
have semigr0(G,f) using csgassoc semigr0_def by simp
moreoverfrom A1 obtain n where n ∈ nat and |A| = succ(n)using card_non_empty_succ by autowith A1 hb ∈ bij(|A|,A)i haven ∈ nat and a O b : succ(n) → G
using bij_def inj_def FinPow_def comp_fun_subset csgaisfun
by autoultimately
have Fold1(f,aO b) ∈ G byPP
P (rule semigr0.prod_type)with h (A,a) = ((a O b))i show(A,a) ∈ G
by simp{ fix x assume x ∈ X-A
with A1 have (A ∪ {x}) ∈ FinPow(X) and A ∪ {x} 6= 0
using singleton_in_finpow union_finpow by auto
moreover have Append(b,x) ∈ bij(|A ∪ {x}|, A ∪ {x})proof note h|A| ∈ nati hb ∈ bij(|A|,A)i
moreover from hx ∈ X-Ai have x ∈/ A by simp
ultimately have Append(b,x) ∈ bij(succ(|A|), A ∪ {x})by (rule bij_append_point)with A1 hx ∈ X-Ai show thesis
using card_fin_add_one by auto
qed

226

P
P
ultimately have ( (A ∪ {x},a)) = ((a O Append(b,x)))using sum_over_set_bij
by
simp
P
also have . . . = (Append(a O b, a(x)))
proof note h|A| ∈ nati
moreoverfrom A1 hb ∈ bij(|A|, A)i haveb : |A| → A and A ⊆ X
using bij_def inj_def using FinPow_def by auto
then have b : |A| → X by (rule func1_1_L1B)
moreover from hx ∈ X-Ai have x ∈ X and a : X → G
using csgaisfun by auto
ultimately show thesis using list_compose_append
by simpqed
P
also have . . . = ( (A,a)) + a(x)proof note hsemigr0(G,f)i hn ∈ nati ha O b : succ(n) → Gi
moreover from hx ∈ X-Ai have a(x) ∈ G
using csgaisfun apply_funtype by simp
ultimately have
Fold1(f,Append(a O b, a(x))) = fhFold1(f,a O b),a(x)iby (rule semigr0.prod_append)with A1 hb ∈ bij(|A|,A)i show thesis
using sum_over_set_bij by simp
qedPP
finally have ( (A ∪ {x},a)) = ( (A,a)) + a(x)by simpPP} thus ∀ x ∈ X-A.
(A ∪ {x},a) = ( (A,a)) + a(x)by simp
qed
end

24

Monoids

theory Monoid_ZF imports func_ZF
begin

This theory provides basic facts about monoids.

24.1

Definition and basic properties

In this section we talk about monoids. The notion of a monoid is similar to
the notion of a semigroup except that we require the existence of a neutral
element. It is also similar to the notion of group except that we don’t require
existence of the inverse.
227

Monoid is a set G with an associative operation and a neutral element. The
operation is a function on G × G with values in G. In the context of ZF set
theory this means that it is a set of pairs hx, yi, where x ∈ G × G and y ∈ G.
In other words the operation is a certain subset of (G × G) × G. We express
all this by defing a predicate IsAmonoid(G,f). Here G is the ”carrier” of thegroup and f is the binary operation on it.
definition
IsAmonoid(G,f) ≡f {is associative on} G ∧(∃ e∈G. (∀ g∈G. ( (f(he,gi) = g) ∧ (f(hg,ei) = g))))

The next locale called ”monoid0” defines a context for theorems that concern
monoids. In this contex we assume that the pair (G, f ) is a monoid. We will
use the ⊕ symbol to denote the monoid operation (for no particular reason).
locale monoid0 =fixes G
fixes fassumes monoidAsssum: IsAmonoid(G,f)
fixes monoper (infixl ⊕ 70)
defines monoper_def [simp]: a ⊕ b ≡ fha,bi

The result of the monoid operation is in the monoid (carrier).
lemma (in monoid0) group0_1_L1:
assumes a∈G b∈G shows a⊕b ∈ Gusing assms monoidAsssum IsAmonoid_def IsAssociative_def apply_funtype
by auto

There is only one neutral element in a monoid.
lemma (in monoid0) group0_1_L2: shows∃ !e. e∈G ∧ (∀ g∈G. ( (e⊕g = g) ∧ g⊕e = g))
proof
fix e yassume e ∈ G ∧ (∀ g∈G. e ⊕ g = g ∧ g ⊕ e = g)and y ∈ G ∧ (∀ g∈G. y ⊕ g = g ∧ g ⊕ y = g)then have y⊕e = y y⊕e = e by auto
thus e = y by simp
next from monoidAsssum show
∃ e. e∈ G ∧ (∀ g∈G. e⊕g = g ∧ g⊕e = g)using IsAmonoid_def by autoqed

We could put the definition of neutral element anywhere, but it is only usable
in conjuction with the above lemma.
definition
TheNeutralElement(G,f) ≡( THE e. e∈G ∧ (∀ g∈G. fhe,gi = g ∧ fhg,ei = g))

228

The neutral element is neutral.
lemma (in monoid0) unit_is_neutral:assumes A1: e = TheNeutralElement(G,f)
shows e ∈ G ∧ (∀ g∈G. e ⊕ g = g ∧ g ⊕ e = g)
proof let n = THE b. b∈ G ∧ (∀ g∈G. b⊕g = g ∧ g⊕b = g)have ∃ !b. b∈ G ∧ (∀ g∈G. b⊕g = g ∧ g⊕b = g)using group0_1_L2 by simp
then have n∈ G ∧ (∀ g∈G. n⊕g = g ∧ g⊕n = g)by (rule theI)with A1 show thesis
using TheNeutralElement_def by simp
qed

The monoid carrier is not empty.
lemma (in monoid0) group0_1_L3A: shows G6=0
proof have TheNeutralElement(G,f) ∈ G using unit_is_neutral
by simpthus thesis by autoqed

The range of the monoid operation is the whole monoid carrier.
lemma (in monoid0) group0_1_L3B: shows range(f) = G
prooffrom monoidAsssum have f : G×G→Gusing IsAmonoid_def IsAssociative_def by simp
then show range(f) ⊆ G
using func1_1_L5B by simp
show G ⊆ range(f)prooffix g assume A1: g∈Glet e = TheNeutralElement(G,f)
from A1 have he,gi ∈ G×G g = fhe,giusing unit_is_neutral by autowith hf : G×G→Gi show g ∈ range(f)using func1_1_L5A by blast
qed
qed

Another way to state that the range of the monoid operation is the whole
monoid carrier.
lemma (in monoid0) range_carr: shows f(G×G) = G
using monoidAsssum IsAmonoid_def IsAssociative_defgroup0_1_L3B range_image_domain by auto

In a monoid any neutral element is the neutral element.
lemma (in monoid0) group0_1_L4:229

assumes A1: e ∈ G ∧ (∀ g∈G. e ⊕ g = g ∧ g ⊕ e = g)shows e = TheNeutralElement(G,f)
proof let n = THE b. b∈ G ∧ (∀ g∈G. b⊕g = g ∧ g⊕b = g)have ∃ !b. b∈ G ∧ (∀ g∈G. b⊕g = g ∧ g⊕b = g)using group0_1_L2 by simp
moreover note A1
ultimately have n = e by (rule the_equality2)then show thesis using TheNeutralElement_def by simp
qed

The next lemma shows that if the if we restrict the monoid operation to a
subset of G that contains the neutral element, then the neutral element of
the monoid operation is also neutral with the restricted operation.
lemma (in monoid0) group0_1_L5:
assumes A1: ∀ x∈H.∀ y∈H. x⊕y ∈ H
and A2: H⊆G
and A3: e = TheNeutralElement(G,f)
and A4: g = restrict(f,H×H)
and A5: e∈H
and A6: h∈Hshows ghe,hi = h ∧ ghh,ei = h
proof from A4 A6 A5 haveghe,hi = e⊕h ∧ ghh,ei = h⊕eusing restrict_if by simp
with A3 A4 A6 A2 show
ghe,hi = h ∧ ghh,ei = husing unit_is_neutral by autoqed

The next theorem shows that if the monoid operation is closed on a subset
of G then this set is a (sub)monoid (although we do not define this notion).
This fact will be useful when we study subgroups.
theorem (in monoid0) group0_1_T1:
assumes A1: H {is closed under} f
and A2: H⊆G
and A3: TheNeutralElement(G,f) ∈ H
shows IsAmonoid(H,restrict(f,H×H))
proof let g = restrict(f,H×H)
let e = TheNeutralElement(G,f)
from monoidAsssum have f ∈ G×G→Gusing IsAmonoid_def IsAssociative_def by simp
moreover from A2 have H×H ⊆ G×G by auto
moreover from A1 have ∀ p ∈ H×H. f(p) ∈ H
using IsOpClosed_def by auto
ultimately have g ∈ H×H→H
using func1_2_L4 by simp

230

moreover have ∀ x∈H.∀ y∈H.∀ z∈H.
ghghx,yi ,zi = ghx,ghy,zii
proof from A1 have ∀ x∈H.∀ y∈H.∀ z∈H.
ghghx,yi,zi = x⊕y⊕z
using IsOpClosed_def restrict_if by simp
moreover have ∀ x∈H.∀ y∈H.∀ z∈H. x⊕y⊕z = x⊕(y⊕z)
proof from monoidAsssum have
∀ x∈G.∀ y∈G.∀ z∈G. x⊕y⊕z = x⊕(y⊕z)
using IsAmonoid_def IsAssociative_def
by simpwith A2 show thesis by autoqed
moreover from A1 have
∀ x∈H.∀ y∈H.∀ z∈H. x⊕(y⊕z) = gh x,ghy,zi iusing IsOpClosed_def restrict_if by simp
ultimately show thesis by simp
qed
moreover have∃ n∈H. (∀ h∈H. ghn,hi = h ∧ ghh,ni = h)proof from A1 have ∀ x∈H.∀ y∈H. x⊕y ∈ Husing IsOpClosed_def by simp
with A2 A3 have∀ h∈H. ghe,hi = h ∧ ghh,ei = husing group0_1_L5 by blast
with A3 show thesis by autoqed
ultimately show thesis using IsAmonoid_def IsAssociative_def
by simpqed

Under the assumptions of group0_1_T1 the neutral element of a submonoid
is the same as that of the monoid.
lemma group0_1_L6:
assumes A1: IsAmonoid(G,f)
and A2: H {is closed under} f
and A3: H⊆G
and A4: TheNeutralElement(G,f) ∈ H
shows TheNeutralElement(H,restrict(f,H×H)) = TheNeutralElement(G,f)
proof let e = TheNeutralElement(G,f)
let g = restrict(f,H×H)
from assms have monoid0(H,g)
using monoid0_def monoid0.group0_1_T1
by simpmoreover havee ∈ H ∧ (∀ h∈H. ghe,hi = h ∧ ghh,ei = h)231

proof { fix h assume h ∈ Hwith assms havemonoid0(G,f) ∀ x∈H.∀ y∈H. fhx,yi ∈ H
H⊆G e = TheNeutralElement(G,f) g = restrict(f,H×H)e ∈ H h ∈ Husing monoid0_def IsOpClosed_def by auto
then have ghe,hi = h ∧ ghh,ei = h
by (rule monoid0.group0_1_L5)} hence ∀ h∈H. ghe,hi = h ∧ ghh,ei = h by simp
with A4 show thesis by simp
qed
ultimately have e = TheNeutralElement(H,g)
by (rule monoid0.group0_1_L4)
thus thesis by simp
qed

If a sum of two elements is not zero, then at least one has to be nonzero.
lemma (in monoid0) sum_nonzero_elmnt_nonzero:
assumes a ⊕ b 6= TheNeutralElement(G,f)
shows a 6= TheNeutralElement(G,f) ∨ b 6= TheNeutralElement(G,f)
using assms unit_is_neutral by autoend

25Groups - introduction

theory Group_ZF imports Monoid_ZF
begin

This theory file covers basics of group theory.

25.1

Definition and basic properties of groups

In this section we define the notion of a group and set up the notation for
discussing groups. We prove some basic theorems about groups.
To define a group we take a monoid and add a requirement that the rightinverse needs to exist for every element of the group.
definition
IsAgroup(G,f) ≡(IsAmonoid(G,f) ∧ (∀ g∈G. ∃ b∈G. fhg,bi = TheNeutralElement(G,f)))

We define the group inverse as the set {hx, yi ∈ G × G : x · y = e}, where
e is the neutral element of the group. This set (which can be written as(·)−1 {e}) is a certain relation on the group (carrier). Since, as we show232later, for every x ∈ G there is exactly one y ∈ G such that x · y = e thisrelation is in fact a function from G to G.
definition
GroupInv(G,f) ≡ {hx,yi ∈ G×G. fhx,yi = TheNeutralElement(G,f)}

We will use the miltiplicative notation for groups. The neutral element isdenoted 1.
locale group0 =fixes G
fixes Passumes groupAssum: IsAgroup(G,P)
fixes neut (1)defines neut_def[simp]: 1 ≡ TheNeutralElement(G,P)
fixes groper (infixl · 70)
defines groper_def[simp]: a · b ≡ Pha,bifixes inv (_−1 [90] 91)
defines inv_def[simp]: x−1 ≡ GroupInv(G,P)(x)First we show a lemma that says that we can use theorems proven in themonoid0 context (locale).
lemma (in group0) group0_2_L1: shows monoid0(G,P)
using groupAssum IsAgroup_def monoid0_def by simp

In some strange cases Isabelle has difficulties with applying the definition ofa group. The next lemma defines a rule to be applied in such cases.
lemma definition_of_group: assumes IsAmonoid(G,f)
and ∀ g∈G. ∃ b∈G. fhg,bi = TheNeutralElement(G,f)
shows IsAgroup(G,f)
using assms IsAgroup_def by simp

A technical lemma that allows to use 1 as the neutral element of the group
without referencing a list of lemmas and definitions.
lemma (in group0) group0_2_L2:
shows 1∈G ∧ (∀ g∈G.(1·g = g ∧ g·1 = g))using group0_2_L1 monoid0.unit_is_neutral by simp

The group is closed under the group operation. Used all the time, useful tohave handy.
lemma (in group0) group_op_closed: assumes a∈G b∈Gshows a·b ∈ G using assms group0_2_L1 monoid0.group0_1_L1
by simp

The group operation is associative. This is another technical lemma thatallows to shorten the list of referenced lemmas in some proofs.
233lemma (in group0) group_oper_assoc:
assumes a∈G b∈G c∈G shows a·(b·c) = a·b·c
using groupAssum assms IsAgroup_def IsAmonoid_def
IsAssociative_def group_op_closed by simp

The group operation maps G × G into G. It is conveniet to have this fact
easily accessible in the group0 context.
lemma (in group0) group_oper_assocA: shows P : G×G→Gusing groupAssum IsAgroup_def IsAmonoid_def IsAssociative_def
by simp

The definition of a group requires the existence of the right inverse. We
show that this is also the left inverse.
theorem (in group0) group0_2_T1:
assumes A1: g∈G and A2: b∈G and A3: g·b = 1
shows b·g = 1
proof from A2 groupAssum obtain c where I: c ∈ G ∧ b·c = 1
using IsAgroup_def by auto
then have c∈G by simp
have 1∈G using group0_2_L2 by simp
with A1 A2 I have b·g = b·(g·(b·c))using group_op_closed group0_2_L2 group_oper_assoc
by simp
also from A1 A2 hc∈Gi have b·(g·(b·c)) = b·(g·b·c)
using group_oper_assoc by simp
also from A3 A2 I have b·(g·b·c)= 1 using group0_2_L2 by simp
finally show b·g = 1 by simp
qed

For every element of a group there is only one inverse.
lemma (in group0) group0_2_L4:
assumes A1: x∈G shows ∃ !y. y∈G ∧ x·y = 1
prooffrom A1 groupAssum show ∃ y. y∈G ∧ x·y = 1
using IsAgroup_def by auto
fix y nassume A2: y∈G ∧ x·y = 1 and A3:n∈G ∧ x·n = 1 show y=n
proof from A1 A2 have T1: y·x = 1
using group0_2_T1 by simp
from A2 A3 have y = y·(x·n)
using group0_2_L2 by simp
also from A1 A2 A3 have . . . = (y·x)·nusing group_oper_assoc by blast
also from T1 A3 have . . . = nusing group0_2_L2 by simp
finally show y=n by simp

234

qed
qed

The group inverse is a function that maps G into G.
theorem group0_2_T2:
assumes A1: IsAgroup(G,f) shows GroupInv(G,f) : G→G
proof have GroupInv(G,f) ⊆ G×G using GroupInv_def by auto
moreover from A1 have
∀ x∈G. ∃ !y. y∈G ∧ hx,yi ∈ GroupInv(G,f)
using group0_def group0.group0_2_L4 GroupInv_def by simp
ultimately show thesis using func1_1_L11 by simpqed

We can think about the group inverse (the function) as the inverse image ofthe neutral element. Recall that in Isabelle f-(A) denotes the inverse imageof the set A.
theorem (in group0) group0_2_T3: shows P-{1} = GroupInv(G,P)
proof from groupAssum have P : G×G → G
using IsAgroup_def IsAmonoid_def IsAssociative_def
by simpthen show P-{1} = GroupInv(G,P)
using func1_1_L14 GroupInv_def by autoqed

The inverse is in the group.
lemma (in group0) inverse_in_group: assumes A1: x∈G shows x−1 ∈Gproof from groupAssum have GroupInv(G,P) : G→G using group0_2_T2 by simp
with A1 show thesis using apply_type by simp
qed

The notation for the inverse means what it is supposed to mean.
lemma (in group0) group0_2_L6:
assumes A1: x∈G shows x·x−1 = 1 ∧ x−1 ·x = 1
proof
from groupAssum have GroupInv(G,P) : G→Gusing group0_2_T2 by simp
with A1 have hx,x−1 i ∈ GroupInv(G,P)
using apply_Pair by simp
then show x·x−1 = 1 using GroupInv_def by simp
with A1 show x−1 ·x = 1 using inverse_in_group group0_2_T1
by blast
qed

The next two lemmas state that unless we multiply by the neutral element,
the result is always different than any of the operands.
235

lemma (in group0) group0_2_L7:
assumes A1: a∈G and A2: b∈G and A3: a·b = ashows b=1
proof from A3 have a−1 · (a·b) = a−1 ·a by simp
with A1 A2 show thesis using
inverse_in_group group_oper_assoc group0_2_L6 group0_2_L2
by simpqed

See the comment to group0_2_L7.
lemma (in group0) group0_2_L8:
assumes A1: a∈G and A2: b∈G and A3: a·b = b
shows a=1
proof from A3 have (a·b)·b−1 = b·b−1 by simp
with A1 A2 have a·(b·b−1 ) = b·b−1 using
inverse_in_group group_oper_assoc by simp
with A1 A2 show thesis
using group0_2_L6 group0_2_L2 by simp
qed

The inverse of the neutral element is the neutral element.
lemma (in group0) group_inv_of_one: shows 1−1 = 1
using group0_2_L2 inverse_in_group group0_2_L6 group0_2_L7 by blast

if a−1 = 1, then a = 1.
lemma (in group0) group0_2_L8A:
assumes A1: a∈G and A2: a−1 = 1
shows a = 1
proof from A1 have a·a−1 = 1 using group0_2_L6 by simp
with A1 A2 show a = 1 using group0_2_L2 by simp
qed

If a is not a unit, then its inverse is not a unit either.
lemma (in group0) group0_2_L8B:
assumes a∈G and a 6= 1
shows a−1 6= 1 using assms group0_2_L8A by auto

If a−1 is not a unit, then a is not a unit either.
lemma (in group0) group0_2_L8C:
assumes a∈G and a−1 6= 1
shows a6=1
using assms group0_2_L8A group_inv_of_one by auto

If a product of two elements of a group is equal to the neutral element thenthey are inverses of each other.
236

lemma (in group0) group0_2_L9:
assumes A1: a∈G and A2: b∈G and A3: a·b = 1
shows a = b−1 and b = a−1
proof from A3 have a·b·b−1 = 1·b−1 by simp
with A1 A2 have a·(b·b−1 ) = 1·b−1 using
inverse_in_group group_oper_assoc by simp
with A1 A2 show a = b−1 usinggroup0_2_L6 inverse_in_group group0_2_L2 by simp
from A3 have a−1 ·(a·b) = a−1 ·1 by simp
with A1 A2 show b = a−1 using
inverse_in_group group_oper_assoc group0_2_L6 group0_2_L2
by simpqed

It happens quite often that we know what is (have a meta-function for) theright inverse in a group. The next lemma shows that the value of the groupinverse (function) is equal to the right inverse (meta-function).
lemma (in group0) group0_2_L9A:
assumes A1: ∀ g∈G. b(g) ∈ G ∧ g·b(g) = 1
shows ∀ g∈G. b(g) = g−1
proof
fix g assume g∈G
moreover from A1 hg∈Gi have b(g) ∈ G by simp
moreover from A1 hg∈Gi have g·b(g) = 1 by simp
ultimately show b(g) = g−1 by (rule group0_2_L9)
qed

What is the inverse of a product?
lemma (in group0) group_inv_of_two:
assumes A1: a∈G and A2: b∈Gshows b−1 ·a−1 = (a·b)−1
proof from A1 A2 haveb−1 ∈G a−1 ∈G a·b∈G b−1 ·a−1 ∈ Gusing inverse_in_group group_op_closedby autofrom A1 A2 hb−1 ·a−1 ∈ Gi have a·b·(b−1 ·a−1 ) = a·(b·(b−1 ·a−1 ))using group_oper_assoc by simp
moreover from A2 hb−1 ∈Gi ha−1 ∈Gi have b·(b−1 ·a−1 ) = b·b−1 ·a−1
using group_oper_assoc by simp
moreover from A2 ha−1 ∈Gi have b·b−1 ·a−1 = a−1
using group0_2_L6 group0_2_L2 by simp
ultimately have a·b·(b−1 ·a−1 ) = a·a−1
by simpwith A1 have a·b·(b−1 ·a−1 ) = 1
using group0_2_L6 by simp
with ha·b ∈ Gi hb−1 ·a−1 ∈ Gi show b−1 ·a−1 = (a·b)−1
using group0_2_L9 by simp

237

qed

What is the inverse of a product of three elements?
lemma (in group0) group_inv_of_three:assumes A1: a∈G b∈G c∈Gshows(a·b·c)−1 = c−1 ·(a·b)−1(a·b·c)−1 = c−1 ·(b−1 ·a−1 )(a·b·c)−1 = c−1 ·b−1 ·a−1
proof from A1 have T:
a·b ∈ G a−1 ∈ G b−1 ∈ G
c−1 ∈ G
using group_op_closed inverse_in_group by autowith A1 show
(a·b·c)−1 = c−1 ·(a·b)−1 and (a·b·c)−1 = c−1 ·(b−1 ·a−1 )using group_inv_of_two by autowith T show (a·b·c)−1 = c−1 ·b−1 ·a−1 using group_oper_assoc
by simpqed

The inverse of the inverse is the element.
lemma (in group0) group_inv_of_inv:
assumes a∈G shows a = (a−1 )−1using assms inverse_in_group group0_2_L6 group0_2_L9
by simpGroup inverse is nilpotent, therefore a bijection and involution.
lemma (in group0) group_inv_bij:
shows GroupInv(G,P) O GroupInv(G,P) = id(G) and GroupInv(G,P) ∈ bij(G,G)
andGroupInv(G,P) = converse(GroupInv(G,P))
proof have I: GroupInv(G,P): G→G using groupAssum group0_2_T2 by simp
then have GroupInv(G,P) O GroupInv(G,P): G→G and id(G):G→G
using comp_fun id_type by auto
moreover{ fix g assume g∈Gwith I have (GroupInv(G,P) O GroupInv(G,P))(g) = id(G)(g)using comp_fun_apply group_inv_of_inv id_conv by simp
} hence ∀ g∈G. (GroupInv(G,P) O GroupInv(G,P))(g) = id(G)(g) by simp
ultimately show GroupInv(G,P) O GroupInv(G,P) = id(G)by (rule func_eq)
with I show GroupInv(G,P) ∈ bij(G,G) using nilpotent_imp_bijectiveby simpwith hGroupInv(G,P) O GroupInv(G,P) = id(G)i show
GroupInv(G,P) = converse(GroupInv(G,P)) using comp_id_conv by simp
qed

For the group inverse the image is the same as inverse image.
238

lemma (in group0) inv_image_vimage: shows GroupInv(G,P)(V) = GroupInv(G,P)-(V)using group_inv_bij vimage_converse by simp

If the unit is in a set then it is in the inverse of that set.
lemma (in group0) neut_inv_neut: assumes A⊆G and 1∈A
shows 1 ∈ GroupInv(G,P)(A)
proof have GroupInv(G,P):G→G using groupAssum group0_2_T2 by simp
with assms have 1−1 ∈ GroupInv(G,P)(A) using func_imagedef by auto
then show thesis using group_inv_of_one by simp
qed

The group inverse is onto.
lemma (in group0) group_inv_surj: shows GroupInv(G,P)(G) = G
using group_inv_bij bij_def surj_range_image_domain by auto

If a−1 · b = 1, then a = b.
lemma (in group0) group0_2_L11:
assumes A1: a∈G b∈G and A2: a−1 ·b = 1
shows a=b
proof from A1 A2 have a−1 ∈ G b∈G a−1 ·b = 1
using inverse_in_group by auto
then have b = (a−1 )−1 by (rule group0_2_L9)
with A1 show a=b using group_inv_of_inv by simp
qed

If a · b−1 = 1, then a = b.
lemma (in group0) group0_2_L11A:
assumes A1: a∈G b∈G and A2: a·b−1 = 1
shows a=b
proof from A1 A2 have a ∈ G b−1 ∈G a·b−1 = 1
using inverse_in_group by auto
then have a = (b−1 )−1 by (rule group0_2_L9)
with A1 show a=b using group_inv_of_inv by simpqed

If if the inverse of b is different than a, then the inverse of a is different thanb.
lemma (in group0) group0_2_L11B:
assumes A1: a∈G and A2: b−1 6= ashows a−1 6= b
proof { assume a−1 = bthen have (a−1 )−1 = b−1 by simp
with A1 A2 have False using group_inv_of_inv
by simp239

} then show a−1 6= b by autoqedWhat is the inverse of ab−1 ?
lemma (in group0) group0_2_L12:
assumes A1: a∈G b∈Gshows(a·b−1 )−1 = b·a−1(a−1 ·b)−1 = b−1 ·aproof from A1 have(a·b−1 )−1 = (b−1 )−1 · a−1 and (a−1 ·b)−1 = b−1 ·(a−1 )−1using inverse_in_group group_inv_of_two by autowith A1 show (a·b−1 )−1 = b·a−1 (a−1 ·b)−1 = b−1 ·ausing group_inv_of_inv by autoqed

A couple useful rearrangements with three elements: we can insert a b · b−1
between two group elements (another version) and one about a product ofan element and inverse of a product, and two others.
lemma (in group0) group0_2_L14A:
assumes A1: a∈G b∈G c∈Gshowsa·c−1 = (a·b−1 )·(b·c−1 )a−1 ·c = (a−1 ·b)·(b−1 ·c)
a·(b·c)−1 = a·c−1 ·b−1
a·(b·c−1 ) = a·b·c−1(a·b−1 ·c−1 )−1 = c·b·a−1
a·b·c−1 ·(c·b−1 ) = a
a·(b·c)·c−1 = a·b
proof from A1 have T:
a−1 ∈ G b−1 ∈G c−1 ∈G
a−1 ·b ∈ G a·b−1 ∈ G a·b ∈ G
c·b−1 ∈ G b·c ∈ Gusing inverse_in_group group_op_closedby autofrom A1 T havea·c−1 = a·(b−1 ·b)·c−1
a−1 ·c = a−1 ·(b·b−1 )·c
using group0_2_L2 group0_2_L6 by autowith A1 T show
a·c−1 = (a·b−1 )·(b·c−1 )a−1 ·c = (a−1 ·b)·(b−1 ·c)using group_oper_assoc by autofrom A1 have a·(b·c)−1 = a·(c−1 ·b−1 )using group_inv_of_two by simp
with A1 T show a·(b·c)−1 =a·c−1 ·b−1
using group_oper_assoc by simp

240

from A1 T show a·(b·c−1 ) = a·b·c−1
using group_oper_assoc by simp
from A1 T show (a·b−1 ·c−1 )−1 = c·b·a−1
using group_inv_of_three group_inv_of_inv
by simpfrom T have a·b·c−1 ·(c·b−1 ) = a·b·(c−1 ·(c·b−1 ))using group_oper_assoc by simp
also from A1 T have . . . = a·b·b−1
using group_oper_assoc group0_2_L6 group0_2_L2
by simp
also from A1 T have . . . = a·(b·b−1 )using group_oper_assoc by simp
also from A1 have . . . = ausing group0_2_L6 group0_2_L2 by simp
finally show a·b·c−1 ·(c·b−1 ) = a by simp
from A1 T have a·(b·c)·c−1 = a·(b·(c·c−1 ))using group_oper_assoc by simp
also from A1 T have . . . = a·busing group0_2_L6 group0_2_L2 by simp
finally show a·(b·c)·c−1 = a·b
by simpqed

Another lemma about rearranging a product of four group elements.
lemma (in group0) group0_2_L15:
assumes A1: a∈G b∈G c∈G d∈Gshows (a·b)·(c·d)−1 = a·(b·d−1 )·a−1 ·(a·c−1 )proof from A1 have T1:
d−1 ∈G c−1 ∈G a·b∈G a·(b·d−1 )∈G
using inverse_in_group group_op_closedby autowith A1 have (a·b)·(c·d)−1 = (a·b)·(d−1 ·c−1 )using group_inv_of_two by simp
also from A1 T1 have . . . = a·(b·d−1 )·c−1
using group_oper_assoc by simp
also from A1 T1 have . . . = a·(b·d−1 )·a−1 ·(a·c−1 )using group0_2_L14A by blast
finally show thesis by simpqed

We can cancel an element with its inverse that is written next to it.
lemma (in group0) inv_cancel_two:
assumes A1: a∈G b∈Gshowsa·b−1 ·b = aa·b·b−1 = aa−1 ·(a·b) = b
a·(a−1 ·b) = b

241

proof from A1 havea·b−1 ·b = a·(b−1 ·b)
a·b·b−1 = a·(b·b−1 )−1−1
a ·(a·b) = a ·a·b
a·(a−1 ·b) = a·a−1 ·busing inverse_in_group group_oper_assoc by autowith A1 show
a·b−1 ·b = aa·b·b−1 = aa−1 ·(a·b) = b
a·(a−1 ·b) = b
using group0_2_L6 group0_2_L2 by autoqed

Another lemma about cancelling with two group elements.
lemma (in group0) group0_2_L16A:
assumes A1: a∈G b∈Gshows a·(b·a)−1 = b−1
proof from A1 have (b·a)−1 = a−1 ·b−1 b−1 ∈ Gusing group_inv_of_two inverse_in_group by autowith A1 show a·(b·a)−1 = b−1 using inv_cancel_two
by simpqed

Adding a neutral element to a set that is closed under the group operation
results in a set that is closed under the group operation.
lemma (in group0) group0_2_L17:
assumes H⊆G
and H {is closed under} Pshows (H ∪ {1}) {is closed under} P
using assms IsOpClosed_def group0_2_L2 by auto

We can put an element on the other side of an equation.
lemma (in group0) group0_2_L18:
assumes A1: a∈G b∈G c∈Gand A2: c = a·b
shows c·b−1 = a a−1 ·c = b
proof from A2 A1 have c·b−1 = a·(b·b−1 ) a−1 ·c = (a−1 ·a)·b
using inverse_in_group group_oper_assoc by auto
moreover from A1 have a·(b·b−1 ) = a (a−1 ·a)·b = b
using group0_2_L6 group0_2_L2 by auto
ultimately show c·b−1 = a a−1 ·c = b
by autoqed

Multiplying different group elements by the same factor results in different
group elements.

242

lemma (in group0) group0_2_L19:
assumes A1: a∈G b∈G c∈G and A2: a6=bshows a·c 6= b·c and c·a 6= c·b
proof { assume a·c = b·c ∨ c·a =c·b
then have a·c·c−1 = b·c·c−1 ∨ c−1 ·(c·a) = c−1 ·(c·b)
by autowith A1 A2 have False using inv_cancel_two by simp
} then show a·c 6= b·c and c·a 6= c·b by auto
qed

25.2

Subgroups

There are two common ways to define subgroups. One requires that thegroup operation is closed in the subgroup. The second one defines subgroupas a subset of a group which is itself a group under the group operations.
We use the second approach because it results in shorter definition.
The rest of this section is devoted to proving the equivalence of these two
definitions of the notion of a subgroup.
A pair (H, P ) is a subgroup if H forms a group with the operation P restricted to H × H. It may be surprising that we don’t require H to be asubset of G. This however can be inferred from the definition if the pair
(G, P ) is a group, see lemma group0_3_L2.
definition
IsAsubgroup(H,P) ≡ IsAgroup(H, restrict(P,H×H))

Formally the group operation in a subgroup is different than in the group as
they have different domains. Of course we want to use the original operation
with the associated notation in the subgroup. The next couple of lemmas
will allow for that.
The next lemma states that the neutral element of a subgroup is in thesubgroup and it is both right and left neutral there. The notation is very
ugly because we don’t want to introduce a separate notation for the subgroup
operation.
lemma group0_3_L1:
assumes A1: IsAsubgroup(H,f)
and A2: n = TheNeutralElement(H,restrict(f,H×H))shows n ∈ H∀ h∈H. restrict(f,H×H)hn,h i = h∀ h∈H. restrict(f,H×H)hh,ni = h
proof let b = restrict(f,H×H)
let e = TheNeutralElement(H,restrict(f,H×H))
from A1 have group0(H,b)
using IsAsubgroup_def group0_def by simp

243then have I:e ∈ H ∧ (∀ h∈H. (bhe,h i = h ∧ bhh,ei = h))by (rule group0.group0_2_L2)with A2 show n ∈ H by simp
from A2 I show ∀ h∈H. bhn,hi = h and ∀ h∈H. bhh,ni = h
by autoqed

A subgroup is contained in the group.
lemma (in group0) group0_3_L2:
assumes A1: IsAsubgroup(H,P)
shows H ⊆ G
proof
fix h assume h∈Hlet b = restrict(P,H×H)
let n = TheNeutralElement(H,restrict(P,H×H))
from A1 have b ∈ H×H→H
using IsAsubgroup_def IsAgroup_def
IsAmonoid_def IsAssociative_def by simp
moreover from A1 hh∈Hi have h n,hi ∈ H×H
using group0_3_L1 by simp
moreover from A1 hh∈Hi have h = bhn,h iusing group0_3_L1 by simp
ultimately have hhn,hi,hi ∈ busing func1_1_L5A by blast
then have hhn,hi,hi ∈ P using restrict_subset by auto
moreover from groupAssum have P:G×G→Gusing IsAgroup_def IsAmonoid_def IsAssociative_def
by simpultimately show h∈G using func1_1_L5
by blast
qed

The group’s neutral element (denoted 1 in the group0 context) is a neutral
element for the subgroup with respect to the group action.
lemma (in group0) group0_3_L3:
assumes IsAsubgroup(H,P)
shows ∀ h∈H. 1·h = h ∧ h·1 = husing assms groupAssum group0_3_L2 group0_2_L2
by auto

The neutral element of a subgroup is the same as that of the group.
lemma (in group0) group0_3_L4: assumes A1: IsAsubgroup(H,P)
shows TheNeutralElement(H,restrict(P,H×H)) = 1
proof let n = TheNeutralElement(H,restrict(P,H×H))
from A1 have n ∈ H using group0_3_L1 by simp
with groupAssum A1 have n∈G using group0_3_L2 by autowith A1 hn ∈ Hi show thesis using244

group0_3_L1 restrict_if group0_2_L7 by simp
qed

The neutral element of the group (denoted 1 in the group0 context) belongs
to every subgroup.
lemma (in group0) group0_3_L5: assumes A1: IsAsubgroup(H,P)
shows 1 ∈ H
proof from A1 show 1∈H using group0_3_L1 group0_3_L4
by fastqed

Subgroups are closed with respect to the group operation.
lemma (in group0) group0_3_L6: assumes A1: IsAsubgroup(H,P)
and A2: a∈H b∈Hshows a·b ∈ H
proof let f = restrict(P,H×H)
from A1 have monoid0(H,f) using
IsAsubgroup_def IsAgroup_def monoid0_def by simp
with A2 have f (ha,bi) ∈ H using monoid0.group0_1_L1
by blastwith A2 show a·b ∈ H using restrict_if by simp
qed

A preliminary lemma that we need to show that taking the inverse in thesubgroup is the same as taking the inverse in the group.
lemma group0_3_L7A:
assumes A1: IsAgroup(G,f)
and A2: IsAsubgroup(H,f) and A3: g = restrict(f,H×H)
shows GroupInv(G,f) ∩ H×H = GroupInv(H,g)
proof let e = TheNeutralElement(G,f)
let e1 = TheNeutralElement(H,g)
from A1 have group0(G,f) using group0_def by simp
from A2 A3 have group0(H,g)
using IsAsubgroup_def group0_def by simp
from hgroup0(G,f)i A2 A3 have GroupInv(G,f) = f-{e1 }using group0.group0_3_L4 group0.group0_2_T3
by simpmoreover have g-{e1 } = f-{e1 } ∩ H×H
proof from A1 have f ∈ G×G→Gusing IsAgroup_def IsAmonoid_def IsAssociative_def
by simpmoreover from A2 hgroup0(G,f)i have H×H ⊆ G×G
using group0.group0_3_L2 by auto
ultimately show g-{e1 } = f-{e1 } ∩ H×H

245

using A3 func1_2_L1 by simp
qed
moreover from A3 hgroup0(H,g)i have GroupInv(H,g) = g-{e1 }using group0.group0_2_T3 by simp
ultimately show thesis by simp
qed

Using the lemma above we can show the actual statement: taking the inversein the subgroup is the same as taking the inverse in the group.
theorem (in group0) group0_3_T1:
assumes A1: IsAsubgroup(H,P)
and A2: g = restrict(P,H×H)
shows GroupInv(H,g) = restrict(GroupInv(G,P),H)
proof from groupAssum have GroupInv(G,P) : G→Gusing group0_2_T2 by simp
moreover from A1 A2 have GroupInv(H,g) : H→Husing IsAsubgroup_def group0_2_T2 by simp
moreover from A1 have H ⊆ Gusing group0_3_L2 by simp
moreover from groupAssum A1 A2 haveGroupInv(G,P) ∩ H×H = GroupInv(H,g)
using group0_3_L7A by simp
ultimately show thesis
using func1_2_L3 by simp
qed

A sligtly weaker, but more convenient in applications, reformulation of theabove theorem.
theorem (in group0) group0_3_T2:
assumes IsAsubgroup(H,P)
and g = restrict(P,H×H)
shows ∀ h∈H. GroupInv(H,g)(h) = h−1
using assms group0_3_T1 restrict_if by simp

Subgroups are closed with respect to taking the group inverse.
theorem (in group0) group0_3_T3A:
assumes A1: IsAsubgroup(H,P) and A2: h∈Hshows h−1 ∈ H
proof let g = restrict(P,H×H)
from A1 have GroupInv(H,g) ∈ H→H
using IsAsubgroup_def group0_2_T2 by simp
with A2 have GroupInv(H,g)(h) ∈ H
using apply_type by simp
with A1 A2 show h−1 ∈ H using group0_3_T2 by simp
qed

The next theorem states that a nonempty subset of a group G that is closed
246

under the group operation and taking the inverse is a subgroup of the group.
theorem (in group0) group0_3_T3:
assumes A1: H6=0
and A2: H⊆G
and A3: H {is closed under} P
and A4: ∀ x∈H. x−1 ∈ Hshows IsAsubgroup(H,P)
proof let g = restrict(P,H×H)
let n = TheNeutralElement(H,g)
from A3 have I: ∀ x∈H.∀ y∈H. x·y ∈ Husing IsOpClosed_def by simp
from A1 obtain x where x∈H by autowith A4 I A2 have 1∈Husing group0_2_L6 by blast
with A3 A2 have T2: IsAmonoid(H,g)
using group0_2_L1 monoid0.group0_1_T1
by simpmoreover have ∀ h∈H.∃ b∈H. ghh,bi = n
proof
fix h assume h∈Hwith A4 A2 have h·h−1 = 1
using group0_2_L6 by auto
moreover from groupAssum A2 A3 h1∈Hi have 1 = nusing IsAgroup_def group0_1_L6 by auto
moreover from A4 hh∈Hi have ghh,h−1 i = h·h−1
using restrict_if by simp
ultimately have ghh,h−1 i = n by simp
with A4 hh∈Hi show ∃ b∈H. ghh,bi = n by autoqed
ultimately show IsAsubgroup(H,P) using
IsAsubgroup_def IsAgroup_def by simp
qedIntersection of subgroups is a subgroup.
lemma group0_3_L7:
assumes A1: IsAgroup(G,f)
and A2: IsAsubgroup(H1 ,f)and A3: IsAsubgroup(H2 ,f)shows IsAsubgroup(H1 ∩H2 ,restrict(f,H1 ×H1 ))proof let e = TheNeutralElement(G,f)
let g = restrict(f,H1 ×H1 )from A1 have I: group0(G,f)
using group0_def by simp
from A2 have group0(H1 ,g)using IsAsubgroup_def group0_def by simp
moreover have H1 ∩H2 6= 0
proof -

247

from A1 A2 A3 have e ∈ H1 ∩H2using group0_def group0.group0_3_L5 by simp
thus thesis by autoqed
moreover have H1 ∩H2 ⊆ H1 by auto
moreover from A2 A3 I hH1 ∩H2 ⊆ H1 i have
H1 ∩H2 {is closed under} gusing group0.group0_3_L6 IsOpClosed_def
func_ZF_4_L7 func_ZF_4_L5 by simp
moreover from A2 A3 I have∀ x ∈ H1 ∩H2 . GroupInv(H1 ,g)(x) ∈ H1 ∩H2using group0.group0_3_T2 group0.group0_3_T3A
by simpultimately show thesis
using group0.group0_3_T3 by simp
qed

The range of the subgroup operation is the whole subgroup.
lemma image_subgr_op: assumes A1: IsAsubgroup(H,P)
shows restrict(P,H×H)(H×H) = H
proof from A1 have monoid0(H,restrict(P,H×H))
using IsAsubgroup_def IsAgroup_def monoid0_def
by simpthen show thesis by (rule monoid0.range_carr)qed

If we restrict the inverse to a subgroup, then the restricted inverse is onto
the subgroup.
lemma (in group0) restr_inv_onto: assumes A1: IsAsubgroup(H,P)
shows restrict(GroupInv(G,P),H)(H) = H
proof from A1 have GroupInv(H,restrict(P,H×H))(H) = H
using IsAsubgroup_def group0_def group0.group_inv_surj
by simpwith A1 show thesis using group0_3_T1 by simp
qed
end

26

Groups 1

theory Group_ZF_1 imports Group_ZF
begin

In this theory we consider right and left translations and odd functions.

248

26.1

Translations

In this section we consider translations. Translations are maps T : G → G
of the form Tg (a) = g · a or Tg (a) = a · g. We also consider two-dimensionaltranslations Tg : G × G → G × G, where Tg (a, b) = (a · g, b · g) or Tg (a, b) =(g · a, g · b).
For an element a ∈ G the right translation is defined a function (set of pairs)such that its value (the second element of a pair) is the value of the group
operation on the first element of the pair and g. This looks a bit strange inthe raw set notation, when we write a function explicitely as a set of pairs
and value of the group operation on the pair ha, bi as Pha,bi instead of theusual infix a · b or a + b.
definition
RightTranslation(G,P,g) ≡ {h a,bi ∈ G×G. Pha,gi = b}

A similar definition of the left translation.
definition
LeftTranslation(G,P,g) ≡ {ha,bi ∈ G×G. Phg,ai = b}

Translations map G into G. Two dimensional translations map G × G into
itself.
lemma (in group0) group0_5_L1: assumes A1: g∈Gshows RightTranslation(G,P,g) : G→G and LeftTranslation(G,P,g) :G→G
proof from A1 have ∀ a∈G. a·g ∈ G and ∀ a∈G. g·a ∈ Gusing group_oper_assocA apply_funtype by auto
then show
RightTranslation(G,P,g) : G→G
LeftTranslation(G,P,g) : G→Gusing RightTranslation_def LeftTranslation_def func1_1_L11A
by autoqed

The values of the translations are what we expect.
lemma (in group0) group0_5_L2: assumes g∈G a∈G
shows
RightTranslation(G,P,g)(a) = a·g
LeftTranslation(G,P,g)(a) = g·ausing assms group0_5_L1 RightTranslation_def LeftTranslation_def
func1_1_L11B by auto

Composition of left translations is a left translation by the product.
lemma (in group0) group0_5_L4: assumes A1: g∈G h∈G a∈G and
A2: Tg = LeftTranslation(G,P,g) Th = LeftTranslation(G,P,h)
shows

249

Tg (Th (a)) = g·h·a
Tg (Th (a)) = LeftTranslation(G,P,g·h)(a)proof from A1 have I: h·a∈G g·h∈Gusing group_oper_assocA apply_funtype by autowith A1 A2 show Tg (Th (a)) = g·h·a
using group0_5_L2 group_oper_assoc by simp
with A1 A2 I show
Tg (Th (a)) = LeftTranslation(G,P,g·h)(a)using group0_5_L2 group_oper_assoc by simp
qedComposition of right translations is a right translation by the product.
lemma (in group0) group0_5_L5: assumes A1: g∈G h∈G a∈G and
A2: Tg = RightTranslation(G,P,g) Th = RightTranslation(G,P,h)shows
Tg (Th (a)) = a·h·g
Tg (Th (a)) = RightTranslation(G,P,h·g)(a)proof from A1 have I: a·h∈G h·g ∈Gusing group_oper_assocA apply_funtype by autowith A1 A2 show Tg (Th (a)) = a·h·g
using group0_5_L2 group_oper_assoc by simp
with A1 A2 I show
Tg (Th (a)) = RightTranslation(G,P,h·g)(a)using group0_5_L2 group_oper_assoc by simp
qed

Point free version of group0_5_L4 and group0_5_L5.
lemma (in group0) trans_comp: assumes g∈G h∈G shows
RightTranslation(G,P,g) O RightTranslation(G,P,h) = RightTranslation(G,P,h·g)
LeftTranslation(G,P,g) O LeftTranslation(G,P,h) = LeftTranslation(G,P,g·h)
proof let Tg = RightTranslation(G,P,g)
let Th = RightTranslation(G,P,h)from assms have Tg :G→G and Th :G→G
using group0_5_L1 by auto
then have Tg O Th :G→G using comp_fun by simp
moreover from assms have RightTranslation(G,P,h·g):G→G
using group_op_closed group0_5_L1 by simp
moreover from assms hTh :G→Gi have
∀ a∈G. (Tg O Th )(a) = RightTranslation(G,P,h·g)(a)using comp_fun_apply group0_5_L5 by simp
ultimately show Tg O Th = RightTranslation(G,P,h·g)
by (rule func_eq)
next
let Tg = LeftTranslation(G,P,g)
let Th = LeftTranslation(G,P,h)from assms have Tg :G→G and Th :G→G

250

using group0_5_L1 by auto
then have Tg O Th :G→G using comp_fun by simp
moreover from assms have LeftTranslation(G,P,g·h):G→G
using group_op_closed group0_5_L1 by simp
moreover from assms hTh :G→Gi have
∀ a∈G. (Tg O Th )(a) = LeftTranslation(G,P,g·h)(a)using comp_fun_apply group0_5_L4 by simp
ultimately show Tg O Th = LeftTranslation(G,P,g·h)by (rule func_eq)
qed

The image of a set under a composition of translations is the same as theimage under translation by a product.
lemma (in group0) trans_comp_image: assumes A1: g∈G h∈G and
A2: Tg = LeftTranslation(G,P,g) Th = LeftTranslation(G,P,h)shows Tg (Th (A)) = LeftTranslation(G,P,g·h)(A)proof from A2 have Tg (Th (A)) = (Tg O Th )(A)
using image_comp by simp
with assms show thesis using trans_comp by simp
qed

Another form of the image of a set under a composition of translations
lemma (in group0) group0_5_L6:
assumes A1: g∈G h∈G and A2: A⊆G and
A3: Tg = RightTranslation(G,P,g) Th = RightTranslation(G,P,h)shows Tg (Th (A)) = {a·h·g. a∈A}
proof from A2 have ∀ a∈A. a∈G by autofrom A1 A3 have Tg : G→G Th : G→Gusing group0_5_L1 by autowith assms h∀ a∈A. a∈Gi show
Tg (Th (A)) = {a·h·g. a∈A}
using func1_1_L15C group0_5_L5 by autoqed

The translation by neutral element is the identity on group.
lemma (in group0) trans_neutral: shows
RightTranslation(G,P,1) = id(G) and LeftTranslation(G,P,1) = id(G)proof have RightTranslation(G,P,1):G→G and ∀ a∈G. RightTranslation(G,P,1)(a)= ausing group0_2_L2 group0_5_L1 group0_5_L2 by auto
then show RightTranslation(G,P,1) = id(G) by (rule indentity_fun)
have LeftTranslation(G,P,1):G→G and ∀ a∈G. LeftTranslation(G,P,1)(a)= ausing group0_2_L2 group0_5_L1 group0_5_L2 by auto
then show LeftTranslation(G,P,1) = id(G) by (rule indentity_fun)
qed

251

Composition of translations by an element and its inverse is identity.
lemma (in group0) trans_comp_id: assumes g∈G shows
RightTranslation(G,P,g) O RightTranslation(G,P,g−1 ) = id(G) andRightTranslation(G,P,g−1 ) O RightTranslation(G,P,g) = id(G) and
LeftTranslation(G,P,g) O LeftTranslation(G,P,g−1 ) = id(G) and
LeftTranslation(G,P,g−1 ) O LeftTranslation(G,P,g) = id(G)using assms inverse_in_group trans_comp group0_2_L6 trans_neutral by
auto

Translations are bijective.
lemma (in group0) trans_bij: assumes g∈G shows
RightTranslation(G,P,g) ∈ bij(G,G) and LeftTranslation(G,P,g) ∈ bij(G,G)
proof from assms have
RightTranslation(G,P,g):G→G andRightTranslation(G,P,g−1 ):G→G andRightTranslation(G,P,g) O RightTranslation(G,P,g−1 ) = id(G)RightTranslation(G,P,g−1 ) O RightTranslation(G,P,g) = id(G)using inverse_in_group group0_5_L1 trans_comp_id by auto
then show RightTranslation(G,P,g) ∈ bij(G,G) using fg_imp_bijectiveby simpfrom assms have
LeftTranslation(G,P,g):G→G and
LeftTranslation(G,P,g−1 ):G→G and
LeftTranslation(G,P,g) O LeftTranslation(G,P,g−1 ) = id(G)LeftTranslation(G,P,g−1 ) O LeftTranslation(G,P,g) = id(G)using inverse_in_group group0_5_L1 trans_comp_id by auto
then show LeftTranslation(G,P,g) ∈ bij(G,G) using fg_imp_bijectiveby simpqed

Converse of a translation is translation by the inverse.
lemma (in group0) trans_conv_inv: assumes g∈G showsconverse(RightTranslation(G,P,g)) = RightTranslation(G,P,g−1 ) andconverse(LeftTranslation(G,P,g)) = LeftTranslation(G,P,g−1 ) and
LeftTranslation(G,P,g) = converse(LeftTranslation(G,P,g−1 )) andRightTranslation(G,P,g) = converse(RightTranslation(G,P,g−1 ))proof from assms have
RightTranslation(G,P,g) ∈ bij(G,G) RightTranslation(G,P,g−1 ) ∈ bij(G,G)
andLeftTranslation(G,P,g) ∈ bij(G,G) LeftTranslation(G,P,g−1 ) ∈ bij(G,G)
using trans_bij inverse_in_group by auto
moreover from assms have
RightTranslation(G,P,g−1 ) O RightTranslation(G,P,g) = id(G) and
LeftTranslation(G,P,g−1 ) O LeftTranslation(G,P,g) = id(G) and
LeftTranslation(G,P,g) O LeftTranslation(G,P,g−1 ) = id(G) and
LeftTranslation(G,P,g−1 ) O LeftTranslation(G,P,g) = id(G)using trans_comp_id by auto252

ultimately show
converse(RightTranslation(G,P,g)) = RightTranslation(G,P,g−1 ) andconverse(LeftTranslation(G,P,g)) = LeftTranslation(G,P,g−1 ) and
LeftTranslation(G,P,g) = converse(LeftTranslation(G,P,g−1 )) andRightTranslation(G,P,g) = converse(RightTranslation(G,P,g−1 ))using comp_id_conv by autoqed

The image of a set by translation is the same as the inverse image by by the
inverse element translation.
lemma (in group0) trans_image_vimage: assumes g∈G shows
LeftTranslation(G,P,g)(A) = LeftTranslation(G,P,g−1 )-(A) andRightTranslation(G,P,g)(A) = RightTranslation(G,P,g−1 )-(A)using assms trans_conv_inv vimage_converse by auto

Another way of looking at translations is that they are sections of the group
operation.
lemma (in group0) trans_eq_section: assumes g∈G shows
RightTranslation(G,P,g) = Fix2ndVar(P,g) and
LeftTranslation(G,P,g) = Fix1stVar(P,g)
proof let T = RightTranslation(G,P,g)
let F = Fix2ndVar(P,g)
from assms have T: G→G and F: G→Gusing group0_5_L1 group_oper_assocA fix_2nd_var_fun by auto
moreover from assms have ∀ a∈G. T(a) = F(a)using group0_5_L2 group_oper_assocA fix_var_val by simp
ultimately show T = F by (rule func_eq)
next
let T = LeftTranslation(G,P,g)
let F = Fix1stVar(P,g)
from assms have T: G→G and F: G→Gusing group0_5_L1 group_oper_assocA fix_1st_var_fun by auto
moreover from assms have ∀ a∈G. T(a) = F(a)using group0_5_L2 group_oper_assocA fix_var_val by simp
ultimately show T = F by (rule func_eq)
qed

A lemma about translating sets.
lemma (in group0) ltrans_image: assumes A1: V⊆G and A2: x∈Gshows LeftTranslation(G,P,x)(V) = {x·v. v∈V}
proof from assms have LeftTranslation(G,P,x)(V) = {LeftTranslation(G,P,x)(v).
v∈V}using group0_5_L1 func_imagedef by blast
moreover from assms have ∀ v∈V. LeftTranslation(G,P,x)(v) = x·v
using group0_5_L2 by auto
ultimately show thesis by auto

253

qed

A technical lemma about solving equations with translations.
lemma (in group0) ltrans_inv_in: assumes A1: V⊆G and A2: y∈G andA3: x ∈ LeftTranslation(G,P,y)(GroupInv(G,P)(V))
shows y ∈ LeftTranslation(G,P,x)(V)
proof have x∈Gproof from A2 have LeftTranslation(G,P,y):G→G using group0_5_L1 by simp
then have LeftTranslation(G,P,y)(GroupInv(G,P)(V)) ⊆ G
using func1_1_L6 by simp
with A3 show x∈G by autoqed
have ∃ v∈V. x = y·v−1
proof have GroupInv(G,P): G→G using groupAssum group0_2_T2
by simpwith assms obtain z where z ∈ GroupInv(G,P)(V) and x = y·z
using func1_1_L6 ltrans_image by autowith A1 hGroupInv(G,P): G→Gi show thesis using func_imagedef by autoqed
then obtain v where v∈V and x = y·v−1 by autowith A1 A2 have y = x·v using inv_cancel_two by autowith assms hx∈Gi hv∈Vi show thesis using ltrans_image by autoqed

We can look at the result of interval arithmetic operation as union of translated sets.
lemma (in group0) image_ltrans_union: Sassumes A⊆G B⊆G shows(P {lifted to subsets of} G)hA,Bi = ( a∈A. LeftTranslation(G,P,a)(B))
proof
from assms have I: (P {lifted to subsets of} G)hA,Bi = {a·b . ha,bi ∈A×B}using group_oper_assocA lift_subsets_explained by simp
{ fix c assume c ∈ (P {lifted to subsets of} G)hA,Bi
with I obtain a b where c = a·b and a∈A b∈B by auto
hence c ∈ {a·b. b∈B} by auto
moreover from assms ha∈Ai have
LeftTranslation(G,P,a)(B) = {a·b. b∈B} using ltrans_image by auto
ultimately have c ∈ LeftTranslation(G,P,a)(B)by simpS
with ha∈Ai have c ∈ ( a∈A. LeftTranslation(G,P,a)(B))
by autoS} thus (P {lifted to subsets of} G)hA,Bi ⊆ ( a∈A. LeftTranslation(G,P,a)(B))
by autoS{ fix c assume c ∈ ( a∈A. LeftTranslation(G,P,a)(B))
then obtain a where a∈A and c ∈ LeftTranslation(G,P,a)(B)by automoreover from assms ha∈Ai have LeftTranslation(G,P,a)(B) = {a·b.
b∈B}

254

using ltrans_image by auto
ultimately obtain b where b∈B and c = a·b by autowith ISha∈Ai have c ∈ (P {lifted to subsets of} G)hA,Bi by auto
} thus ( a∈A. LeftTranslation(G,P,a)(B)) ⊆ (P {lifted to subsets of}G)hA,Biby autoqed

If the neutral element belongs to a set, then an element of group belongs
the translation of that set.
lemma (in group0) neut_trans_elem:
assumes A1: A⊆G g∈G and A2: 1∈Ashows g ∈ LeftTranslation(G,P,g)(A)proof from assms have g·1 ∈ LeftTranslation(G,P,g)(A)using ltrans_image by autowith A1 show thesis using group0_2_L2 by simp
qed

The neutral element belongs to the translation of a set by the inverse of anelement that belongs to it.
lemma (in group0) elem_trans_neut: assumes A1: A⊆G and A2: g∈Ashows 1 ∈ LeftTranslation(G,P,g−1 )(A)
proof from assms have g−1 ∈ G using inverse_in_group by autowith assms have g−1 ·g ∈ LeftTranslation(G,P,g−1 )(A)
using ltrans_image by auto
moreover from assms have g−1 ·g = 1 using group0_2_L6 by auto
ultimately show thesis by simp
qed

26.2

Odd functions

This section is about odd functions.
Odd functions are those that commute with the group inverse: f (a−1 ) =(f (a))−1 .
definition
IsOdd(G,P,f) ≡ (∀ a∈G. f(GroupInv(G,P)(a)) = GroupInv(G,P)(f(a)) )Let’s see the definition of an odd function in a more readable notation.
lemma (in group0) group0_6_L1:
shows IsOdd(G,P,p) ←→ ( ∀ a∈G. p(a−1 ) = (p(a))−1 )using IsOdd_def by simp

We can express the definition of an odd function in two ways.
lemma (in group0) group0_6_L2:

255

assumes A1: p : G→Gshows(∀ a∈G. p(a−1 ) = (p(a))−1 ) ←→ (∀ a∈G. (p(a−1 ))−1 = p(a))
proofassume ∀ a∈G. p(a−1 ) = (p(a))−1
with A1 show ∀ a∈G. (p(a−1 ))−1 = p(a)using apply_funtype group_inv_of_inv by simp
next assume A2: ∀ a∈G. (p(a−1 ))−1 = p(a){ fix a assume a∈Gwith A1 A2 havep(a−1 ) ∈ G and ((p(a−1 ))−1 )−1 = (p(a))−1
using apply_funtype inverse_in_group by auto
then have p(a−1 ) = (p(a))−1
using group_inv_of_inv by simp
} then show ∀ a∈G. p(a−1 ) = (p(a))−1 by simp
qed
end

27

Groups - and alternative definition

theory Group_ZF_1b imports Group_ZF
begin

In a typical textbook a group is defined as a set G with an associative
operation such that two conditions hold:
A: there is an element e ∈ G such that for all g ∈ G we have e · g = g and
g · e = g. We call this element a ”unit” or a ”neutral element” of the group.
B: for every a ∈ G there exists a b ∈ G such that a · b = e, where e is theelement of G whose existence is guaranteed by A.
The validity of this definition is rather dubious to me, as condition A does
not define any specific element e that can be referred to in condition B it merely states that a set of such units e is not empty. Of course it does
work in the end as we can prove that the set of such neutral elements has
exactly one element, but still the definition by itself is not valid. You just
can’t reference a variable bound by a quantifier outside of the scope of thatquantifier.
One way around this is to first use condition A to define the notion of a
monoid, then prove the uniqueness of e and then use the condition B todefine groups.
Another way is to write conditions A and B together as follows:∃e∈G (∀g∈G e · g = g ∧ g · e = g) ∧ (∀a∈G ∃b∈G a · b = e).
This is rather ugly.
What I want to talk about is an amusing way to define groups directly256without any reference to the neutral elements. Namely, we can define agroup as a non-empty set G with an associative operation ”·” such that
C: for every a, b ∈ G the equations a · x = b and y · a = b can be solved in G.
This theory file aims at proving the equivalence of this alternative definition
with the usual definition of the group, as formulated in Group_ZF.thy. The
informal proofs come from an Aug. 14, 2005 post by buli on the matematyka.org forum.

27.1

An alternative definition of groupFirst we will define notation for writing about groups.
We will use the multiplicative notation for the group operation. To do this,we define a context (locale) that tells Isabelle to interpret a · b as the valueof function P on the pair ha, bi.
locale group2 =fixes P
fixes dot (infixl · 70)
defines dot_def [simp]: a · b ≡ Pha,bi

The next theorem states that a set G with an associative operation thatsatisfies condition C is a group, as defined in IsarMathLib Group_ZF theory.
theorem (in group2) altgroup_is_group:
assumes A1: G6=0 and A2: P {is associative on} G
and A3: ∀ a∈G.∀ b∈G. ∃ x∈G. a·x = b
and A4: ∀ a∈G.∀ b∈G. ∃ y∈G. y·a = b
shows IsAgroup(G,P)
proof from A1 obtain a where a∈G by autowith A3 obtain x where x∈G and a·x = a
by autofrom A4 ha∈Gi obtain y where y∈G and y·a = a
by autohave I: ∀ b∈G. b = b·x ∧ b = y·b
proof
fix b assume b∈Gwith A4 ha∈Gi obtain yb where yb ∈G
and yb ·a = b by autofrom A3 ha∈Gi hb∈Gi obtain xb where xb ∈G
and a·xb = b by autofrom ha·x = ai hy·a = ai hyb ·a = bi ha·xb = bihave b = yb ·(a·x) and b = (y·a)·xb
by automoreover from A2 ha∈Gi hx∈Gi hy∈Gi hxb ∈Gi hyb ∈Gi have(y·a)·xb = y·(a·xb ) yb ·(a·x) = (yb ·a)·x
using IsAssociative_def by auto
moreover from hyb ·a = bi ha·xb = bi have257

(yb ·a)·x = b·x y·(a·xb ) = y·b
by autoultimately show b = b·x ∧ b = y·b by simp
qed
moreover have x = y
proof from hx∈Gi I have x = y·x by simp
also from hy∈Gi I have y·x = y by simp
finally show x = y by simp
qed
ultimately have ∀ b∈G. b·x = b ∧ x·b = b by simp
with A2 hx∈Gi have IsAmonoid(G,P) using IsAmonoid_def by autowith A3 show IsAgroup(G,P)
using monoid0_def monoid0.unit_is_neutral IsAgroup_def
by simpqed

The converse of altgroup_is_group: in every (classically defined) group condition C holds. In informal mathematics we can say ”Obviously condition C
holds in any group.” In formalized mathematics the word ”obviously” is notin the language. The next theorem is proven in the context called group0
defined in the theory Group_ZF.thy. Similarly to the group2 that context
defines a · b as P ha, bi It also defines notation related to the group inverse
and adds an assumption that the pair (G, P ) is a group to all its theorems.
This is why in the next theorem we don’t explicitely assume that (G, P ) isa group - this assumption is implicit in the context.
theorem (in group0) group_is_altgroup: shows∀ a∈G.∀ b∈G. ∃ x∈G. a·x = b and ∀ a∈G.∀ b∈G. ∃ y∈G. y·a = b
proof { fix a b assume a∈G b∈G
let x = a−1 · b
let y = b·a−1
from ha∈Gi hb∈Gi havex ∈ G y ∈ G and a·x = b y·a = b
using inverse_in_group group_op_closed inv_cancel_two
by autohence ∃ x∈G. a·x = b and ∃ y∈G. y·a = b by auto
} thus∀ a∈G.∀ b∈G. ∃ x∈G. a·x = b and∀ a∈G.∀ b∈G. ∃ y∈G. y·a = b
by auto
qed
end

28

Abelian Group

theory AbelianGroup_ZF imports Group_ZF

258

beginA group is called “abelian“ if its operation is commutative, i.e. P ha, bi =P ha, bi for all group elements a, b, where P is the group operation. It is
customary to use the additive notation for abelian groups, so this condition
is typically written as a + b = b + a. We will be using multiplicative notation
though (in which the commutativity condition of the operation is written asa · b = b · a), just to avoid the hassle of changing the notation we used forgeneral groups.

28.1

Rearrangement formulaeThis section is not interesting and should not be read. Here we will prove
formulas is which right hand side uses the same factors as the left hand side,
just in different order. These facts are obvious in informal math sense, but
Isabelle prover is not able to derive them automatically, so we have to provethem by hand.
Proving the facts about associative and commutative operations is quite
tedious in formalized mathematics. To a human the thing is simple: we canarrange the elements in any order and put parantheses wherever we want,
it is all the same. However, formalizing this statement would be rather
difficult (I think). The next lemma attempts a quasi-algorithmic approachto this type of problem. To prove that two expressions are equal, we first
strip one from parantheses, then rearrange the elements in proper order,
then put the parantheses where we want them to be. The algorithm forrearrangement is easy to describe: we keep putting the first element (fromthe right) that is in the wrong place at the left-most position until we get
the proper arrangement. As far removing parantheses is concerned Isabelle
does its job automatically.
lemma (in group0) group0_4_L2:
assumes A1:P {is commutative on} G
and A2:a∈G b∈G c∈G d∈G E∈G F∈Gshows (a·b)·(c·d)·(E·F) = (a·(d·F))·(b·(c·E))
proof from A2 have (a·b)·(c·d)·(E·F) = a·b·c·d·E·F
using group_op_closed group_oper_assoc
by simp
also have a·b·c·d·E·F = a·d·F·b·c·E
proof from A1 A2 have a·b·c·d·E·F = F·(a·b·c·d·E)
using IsCommutative_def group_op_closed
by simp
also from A2 have F·(a·b·c·d·E) = F·a·b·c·d·E
using group_op_closed group_oper_assoc259

by simp
also from A1 A2 have F·a·b·c·d·E = d·(F·a·b·c)·E
using IsCommutative_def group_op_closed
by simp
also from A2 have d·(F·a·b·c)·E = d·F·a·b·c·E
using group_op_closed group_oper_assoc
by simp
also from A1 A2 have d·F·a·b·c·E = a·(d·F)·b·c·E
using IsCommutative_def group_op_closed
by simp
also from A2 have a·(d·F)·b·c·E = a·d·F·b·c·E
using group_op_closed group_oper_assoc
by simp
finally show thesis by simp
qedalso from A2 have a·d·F·b·c·E = (a·(d·F))·(b·(c·E))
using group_op_closed group_oper_assoc
by simp
finally show thesis by simp
qed

Another useful rearrangement.
lemma (in group0) group0_4_L3:
assumes A1:P {is commutative on} G
and A2: a∈G b∈G and A3: c∈G d∈G E∈G F∈Gshows a·b·((c·d)−1 ·(E·F)−1 ) = (a·(E·c)−1 )·(b·(F·d)−1 )proof from A3 have T1:
c−1 ∈G d−1 ∈G E−1 ∈G F−1 ∈G (c·d)−1 ∈G (E·F)−1 ∈Gusing inverse_in_group group_op_closedby autofrom A2 T1 havea·b·((c·d)−1 ·(E·F)−1 ) = a·b·(c·d)−1 ·(E·F)−1
using group_op_closed group_oper_assoc
by simp
also from A2 A3 havea·b·(c·d)−1 ·(E·F)−1 = (a·b)·(d−1 ·c−1 )·(F−1 ·E−1 )using group_inv_of_two by simp
also from A1 A2 T1 have(a·b)·(d−1 ·c−1 )·(F−1 ·E−1 ) = (a·(c−1 ·E−1 ))·(b·(d−1 ·F−1 ))using group0_4_L2 by simp
also from A2 A3 have(a·(c−1 ·E−1 ))·(b·(d−1 ·F−1 )) = (a·(E·c)−1 )·(b·(F·d)−1 )using group_inv_of_two by simp
finally show thesis by simp
qedSome useful rearrangements for two elements of a group.
lemma (in group0) group0_4_L4:260

assumes A1:P {is commutative on} G
and A2: a∈G b∈Gshowsb−1 ·a−1 = a−1 ·b−1(a·b)−1 = a−1 ·b−1
(a·b−1 )−1 = a−1 ·bproof from A2 have T1: b−1 ∈G a−1 ∈G using inverse_in_group by autowith A1 show b−1 ·a−1 = a−1 ·b−1 using IsCommutative_def by simp
with A2 show (a·b)−1 = a−1 ·b−1 using group_inv_of_two by simp
from A2 T1 have (a·b−1 )−1 = (b−1 )−1 ·a−1 using group_inv_of_two by simp
with A1 A2 T1 show (a·b−1 )−1 = a−1 ·busing group_inv_of_inv IsCommutative_def by simp
qed

Another bunch of useful rearrangements with three elements.
lemma (in group0) group0_4_L4A:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈Gshowsa·b·c = c·a·b
a−1 ·(b−1 ·c−1 )−1 = (a·(b·c)−1 )−1a·(b·c)−1 = a·b−1 ·c−1
a·(b·c−1 )−1 = a·b−1 ·c
a·b−1 ·c−1 = a·c−1 ·b−1
proof from A1 A2 have a·b·c = c·(a·b)
using IsCommutative_def group_op_closed
by simpwith A2 show a·b·c = c·a·b usinggroup_op_closed group_oper_assoc
by simpfrom A2 have T:
b−1 ∈G c−1 ∈G b−1 ·c−1 ∈ G a·b ∈ Gusing inverse_in_group group_op_closedby autowith A1 A2 show a−1 ·(b−1 ·c−1 )−1 = (a·(b·c)−1 )−1using group_inv_of_two IsCommutative_def
by simpfrom A1 A2 T have a·(b·c)−1 = a·(b−1 ·c−1 )using group_inv_of_two IsCommutative_def by simp
with A2 T show a·(b·c)−1 = a·b−1 ·c−1
using group_oper_assoc by simp
from A1 A2 T have a·(b·c−1 )−1 = a·(b−1 ·(c−1 )−1 )using group_inv_of_two IsCommutative_def by simp
with A2 T show a·(b·c−1 )−1 = a·b−1 ·cusing group_oper_assoc group_inv_of_inv by simp
from A1 A2 T have a·b−1 ·c−1 = a·(c−1 ·b−1 )using group_oper_assoc IsCommutative_def by simp

261

with A2 T show a·b−1 ·c−1 = a·c−1 ·b−1
using group_oper_assoc by simp
qed

Another useful rearrangement.
lemma (in group0) group0_4_L4B:
assumes P {is commutative on} G
and a∈G b∈G c∈Gshows a·b−1 ·(b·c−1 ) = a·c−1
using assms inverse_in_group group_op_closed
group0_4_L4 group_oper_assoc inv_cancel_two by simp

A couple of permutations of order for three alements.
lemma (in group0) group0_4_L4C:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈Gshowsa·b·c = c·a·b
a·b·c = a·(c·b)
a·b·c = c·(a·b)
a·b·c = c·b·a
proof from A1 A2 show I: a·b·c = c·a·b
using group0_4_L4A by simp
also from A1 A2 have c·a·b = a·c·b
using IsCommutative_def by simp
also from A2 have a·c·b = a·(c·b)
using group_oper_assoc by simp
finally show a·b·c = a·(c·b) by simp
from A2 I show a·b·c = c·(a·b)
using group_oper_assoc by simp
also from A1 A2 have c·(a·b) = c·(b·a)
using IsCommutative_def by simp
also from A2 have c·(b·a) = c·b·a
using group_oper_assoc by simp
finally show a·b·c = c·b·a by simp
qedSome rearangement with three elements and inverse.
lemma (in group0) group0_4_L4D:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈Gshows
a−1 ·b−1 ·c = c·a−1 ·b−1
b−1 ·a−1 ·c = c·a−1 ·b−1
(a−1 ·b·c)−1 = a·b−1 ·c−1
proof from A2 have T:
a−1 ∈ G b−1 ∈ G c−1 ∈G

262

using inverse_in_group by autowith A1 A2 show
a−1 ·b−1 ·c = c·a−1 ·b−1
b−1 ·a−1 ·c = c·a−1 ·b−1
using group0_4_L4A by autofrom A1 A2 T show (a−1 ·b·c)−1 = a·b−1 ·c−1
using group_inv_of_three group_inv_of_inv group0_4_L4C
by simpqed

Another rearrangement lemma with three elements and equation.
lemma (in group0) group0_4_L5: assumes A1:P {is commutative on} G
and A2: a∈G b∈G c∈Gand A3: c = a·b−1
shows a = b·c
proof from A2 A3 have c·(b−1 )−1 = ausing inverse_in_group group0_2_L18
by simpwith A1 A2 show thesis usinggroup_inv_of_inv IsCommutative_def by simp
qed

In abelian groups we can cancel an element with its inverse even if separated
by another element.
lemma (in group0) group0_4_L6A: assumes A1: P {is commutative on} G
and A2: a∈G b∈Gshowsa·b·a−1 = b
a−1 ·b·a = b
a−1 ·(b·a) = b
a·(b·a−1 ) = b
proof from A1 A2 havea·b·a−1 = a−1 ·a·b
using inverse_in_group group0_4_L4A by blast
also from A2 have . . . = b
using group0_2_L6 group0_2_L2 by simp
finally show a·b·a−1 = b by simp
from A1 A2 havea−1 ·b·a = a·a−1 ·busing inverse_in_group group0_4_L4A by blast
also from A2 have . . . = b
using group0_2_L6 group0_2_L2 by simp
finally show a−1 ·b·a = b by simp
moreover from A2 have a−1 ·b·a = a−1 ·(b·a)
using inverse_in_group group_oper_assoc by simp
ultimately show a−1 ·(b·a) = b by simp
from A1 A2 show a·(b·a−1 ) = b

263

using inverse_in_group IsCommutative_def inv_cancel_two
by simpqed

Another lemma about cancelling with two elements.
lemma (in group0) group0_4_L6AA:
assumes A1: P {is commutative on} G and A2: a∈Gshows a·b−1 ·a−1 = b−1
using assms inverse_in_group group0_4_L6A
by autob∈G

Another lemma about cancelling with two elements.
lemma (in group0) group0_4_L6AB:
assumes A1: P {is commutative on} G and A2: a∈G b∈Gshowsa·(a·b)−1 = b−1
a·(b·a−1 ) = b
proof from A2 have a·(a·b)−1 = a·(b−1 ·a−1 )using group_inv_of_two by simp
also from A2 have . . . = a·b−1 ·a−1
using inverse_in_group group_oper_assoc by simp
also from A1 A2 have . . . = b−1
using group0_4_L6AA by simp
finally show a·(a·b)−1 = b−1 by simp
from A1 A2 have a·(b·a−1 ) = a·(a−1 ·b)
using inverse_in_group IsCommutative_def by simp
also from A2 have . . . = b
using inverse_in_group group_oper_assoc group0_2_L6 group0_2_L2
by simp
finally show a·(b·a−1 ) = b by simp
qed

Another lemma about cancelling with two elements.
lemma (in group0) group0_4_L6AC:
assumes P {is commutative on} G and a∈G b∈Gshows a·(a·b−1 )−1 = b
using assms inverse_in_group group0_4_L6AB group_inv_of_inv
by simpIn abelian groups we can cancel an element with its inverse even if separated
by two other elements.
lemma (in group0) group0_4_L6B: assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈Gshowsa·b·c·a−1 = b·c
a−1 ·b·c·a = b·c
proof -

264

from A2 havea·b·c·a−1 = a·(b·c)·a−1
a−1 ·b·c·a = a−1 ·(b·c)·a
using group_op_closed group_oper_assoc inverse_in_groupby autowith A1 A2 show
a·b·c·a−1 = b·c
a−1 ·b·c·a = b·cusing group_op_closed group0_4_L6A
by autoqed

In abelian groups we can cancel an element with its inverse even if separated
by three other elements.
lemma (in group0) group0_4_L6C: assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈Gshows a·b·c·d·a−1 = b·c·d
proof from A2 have a·b·c·d·a−1 = a·(b·c·d)·a−1
using group_op_closed group_oper_assoc
by simpwith A1 A2 show thesis
using group_op_closed group0_4_L6A
by simpqed

Another couple of useful rearrangements of three elements and cancelling.
lemma (in group0) group0_4_L6D:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈Gshowsa·b−1 ·(a·c−1 )−1 = c·b−1(a·c)−1 ·(b·c) = a−1 ·ba·(b·(c·a−1 ·b−1 )) = c
a·b·c−1 ·(c·a−1 ) = b
proof from A2 have T:
a−1 ∈ G b−1 ∈ G c−1 ∈ G
a·b ∈ G a·b−1 ∈ G c−1 ·a−1 ∈ G c·a−1 ∈ Gusing inverse_in_group group_op_closed by autowith A1 A2 show a·b−1 ·(a·c−1 )−1 = c·b−1
using group0_2_L12 group_oper_assoc group0_4_L6B
IsCommutative_def by simp
from A2 T have (a·c)−1 ·(b·c) = c−1 ·a−1 ·b·c
using group_inv_of_two group_oper_assoc by simp
also from A1 A2 T have . . . = a−1 ·busing group0_4_L6B by simp
finally show (a·c)−1 ·(b·c) = a−1 ·bby simp265

from A1 A2 T show a·(b·(c·a−1 ·b−1 )) = c
using group_oper_assoc group0_4_L6B group0_4_L6A
by simpfrom T have a·b·c−1 ·(c·a−1 ) = a·b·(c−1 ·(c·a−1 ))using group_oper_assoc by simp
also from A1 A2 T have . . . = b
using group_oper_assoc group0_2_L6 group0_2_L2 group0_4_L6A
by simp
finally show a·b·c−1 ·(c·a−1 ) = b by simp
qed

Another useful rearrangement of three elements and cancelling.
lemma (in group0) group0_4_L6E:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈Gshowsa·b·(a·c)−1 = b·c−1
proof from A2 have T: b−1 ∈ G c−1 ∈ Gusing inverse_in_group by autowith A1 A2 havea·(b−1 )−1 ·(a·(c−1 )−1 )−1 = c−1 ·(b−1 )−1using group0_4_L6D by simp
with A1 A2 T show a·b·(a·c)−1 = b·c−1
using group_inv_of_inv IsCommutative_def
by simpqed

A rearrangement with two elements and canceelling, special case of group0_4_L6D
when c = b−1 .
lemma (in group0) group0_4_L6F:
assumes A1: P {is commutative on} G
and A2: a∈G b∈Gshows a·b−1 ·(a·b)−1 = b−1 ·b−1
proof from A2 have b−1 ∈ Gusing inverse_in_group by simp
with A1 A2 have a·b−1 ·(a·(b−1 )−1 )−1 = b−1 ·b−1
using group0_4_L6D by simp
with A2 show a·b−1 ·(a·b)−1 = b−1 ·b−1
using group_inv_of_inv by simp
qedSome other rearrangements with four elements. The algorithm for proof as
in group0_4_L2 works very well here.
lemma (in group0) rearr_ab_gr_4_elemA:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈G

266

showsa·b·c·d = a·d·b·c
a·b·c·d = a·c·(b·d)
proof from A1 A2 have a·b·c·d = d·(a·b·c)
using IsCommutative_def group_op_closed
by simp
also from A2 have . . . = d·a·b·c
using group_op_closed group_oper_assoc
by simp
also from A1 A2 have . . . = a·d·b·c
using IsCommutative_def group_op_closed
by simp
finally show a·b·c·d = a·d·b·c
by simpfrom A1 A2 have a·b·c·d = c·(a·b)·d
using IsCommutative_def group_op_closed
by simp
also from A2 have . . . = c·a·b·d
using group_op_closed group_oper_assoc
by simp
also from A1 A2 have . . . = a·c·b·dusing IsCommutative_def group_op_closed
by simp
also from A2 have . . . = a·c·(b·d)
using group_op_closed group_oper_assoc
by simp
finally show a·b·c·d = a·c·(b·d)
by simpqed

Some rearrangements with four elements and inverse that are applicationsof rearr_ab_gr_4_elem
lemma (in group0) rearr_ab_gr_4_elemB:assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈Gshowsa·b−1 ·c−1 ·d−1 = a·d−1 ·b−1 ·c−1
a·b·c·d−1 = a·d−1 ·b·c
a·b·c−1 ·d−1 = a·c−1 ·(b·d−1 )proof from A2 have T: b−1 ∈ G c−1 ∈ G d−1 ∈ Gusing inverse_in_group by autowith A1 A2 show
a·b−1 ·c−1 ·d−1 = a·d−1 ·b−1 ·c−1
a·b·c·d−1 = a·d−1 ·b·c
a·b·c−1 ·d−1 = a·c−1 ·(b·d−1 )using rearr_ab_gr_4_elemA by auto
qed

267

Some rearrangement lemmas with four elements.
lemma (in group0) group0_4_L7:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈Gshowsa·b·c·d−1 = a·d−1 · b·c
a·d·(b·d·(c·d))−1 = a·(b·c)−1 ·d−1
a·(b·c)·d = a·b·d·c
proof from A2 have T:
b·c ∈ G d−1 ∈ G b−1 ∈G c−1 ∈G
d−1 ·b ∈ G c−1 ·d ∈ G (b·c)−1 ∈ G
b·d ∈ G b·d·c ∈ G (b·d·c)−1 ∈ G
a·d ∈ G b·c ∈ Gusing group_op_closed inverse_in_groupby autowith A1 A2 have a·b·c·d−1 = a·(d−1 ·b·c)
using group_oper_assoc group0_4_L4A by simp
also from A2 T have a·(d−1 ·b·c) = a·d−1 ·b·c
using group_oper_assoc by simp
finally show a·b·c·d−1 = a·d−1 · b·c by simp
from A2 T have a·d·(b·d·(c·d))−1 = a·d·(d−1 ·(b·d·c)−1 )using group_oper_assoc group_inv_of_two by simp
also from A2 T have . . . = a·(b·d·c)−1
using group_oper_assoc inv_cancel_two by simp
also from A1 A2 have . . . = a·(d·(b·c))−1
using IsCommutative_def group_oper_assoc by simp
also from A2 T have . . . = a·((b·c)−1 ·d−1 )using group_inv_of_two by simp
also from A2 T have . . . = a·(b·c)−1 ·d−1
using group_oper_assoc by simp
finally show a·d·(b·d·(c·d))−1 = a·(b·c)−1 ·d−1
by simpfrom A2 have a·(b·c)·d = a·(b·(c·d))using group_op_closed group_oper_assoc by simp
also from A1 A2 have . . . = a·(b·(d·c))using IsCommutative_def group_op_closed by simp
also from A2 have . . . = a·b·d·c
using group_op_closed group_oper_assoc by simp
finally show a·(b·c)·d = a·b·d·c by simp
qedSome other rearrangements with four elements.
lemma (in group0) group0_4_L8:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈Gshowsa·(b·c)−1 = (a·d−1 ·c−1 )·(d·b−1 )a·b·(c·d) = c·a·(b·d)

268a·b·(c·d) = a·c·(b·d)
a·(b·c−1 )·d = a·b·d·c−1(a·b)·(c·d)−1 ·(b·d−1 )−1 = a·c−1
proof from A2 have T:
b·c ∈ G a·b ∈ G d−1 ∈ G b−1 ∈G c−1 ∈G
d−1 ·b ∈ G c−1 ·d ∈ G (b·c)−1 ∈ G
a·b ∈ G (c·d)−1 ∈ G (b·d−1 )−1 ∈ G d·b−1 ∈ Gusing group_op_closed inverse_in_groupby autofrom A2 have a·(b·c)−1 = a·c−1 ·b−1 using group0_2_L14A by blast
moreover from A2 have a·c−1 = (a·d−1 )·(d·c−1 ) using group0_2_L14A
by blast
ultimately have a·(b·c)−1 = (a·d−1 )·(d·c−1 )·b−1 by simp
with A1 A2 T have a·(b·c)−1 = a·d−1 ·(c−1 ·d)·b−1
using IsCommutative_def by simp
with A2 T show a·(b·c)−1 = (a·d−1 ·c−1 )·(d·b−1 )using group_op_closed group_oper_assoc by simp
from A2 T have a·b·(c·d) = a·b·c·dusing group_oper_assoc by simp
also have a·b·c·d = c·a·b·d
proof from A1 A2 have a·b·c·d = c·(a·b)·d
using IsCommutative_def group_op_closed
by simp
also from A2 have . . . = c·a·b·d
using group_op_closed group_oper_assoc
by simp
finally show thesis by simp
qedalso from A2 have c·a·b·d = c·a·(b·d)
using group_op_closed group_oper_assoc
by simp
finally show a·b·(c·d) = c·a·(b·d) by simp
with A1 A2 show a·b·(c·d) = a·c·(b·d)
using IsCommutative_def by simp
from A1 A2 T show a·(b·c−1 )·d = a·b·d·c−1
using group0_4_L7 by simp
from T have (a·b)·(c·d)−1 ·(b·d−1 )−1 = (a·b)·((c·d)−1 ·(b·d−1 )−1 )using group_oper_assoc by simp
also from A1 A2 T have . . . = (a·b)·(c−1 ·d−1 ·(d·b−1 ))using group_inv_of_two group0_2_L12 IsCommutative_def
by simp
also from T have . . . = (a·b)·(c−1 ·(d−1 ·(d·b−1 )))using group_oper_assoc by simp
also from A1 A2 T have . . . = a·c−1
using group_oper_assoc group0_2_L6 group0_2_L2 IsCommutative_def
inv_cancel_two by simp
finally show (a·b)·(c·d)−1 ·(b·d−1 )−1 = a·c−1269

by simp
qed

Some other rearrangements with four elements.
lemma (in group0) group0_4_L8A:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈Gshowsa·b−1 ·(c·d−1 ) = a·c·(b−1 ·d−1 )a·b−1 ·(c·d−1 ) = a·c·b−1 ·d−1
proof from A2 have
T: a∈G b−1 ∈ G c∈G d−1 ∈ Gusing inverse_in_group by autowith A1 show a·b−1 ·(c·d−1 ) = a·c·(b−1 ·d−1 )by (rule group0_4_L8)
with A2 T show a·b−1 ·(c·d−1 ) = a·c·b−1 ·d−1
using group_op_closed group_oper_assoc
by simpqed

Some rearrangements with an equation.
lemma (in group0) group0_4_L9:
assumes A1: P {is commutative on} G
and A2: a∈G b∈G c∈G d∈Gand A3: a = b·c−1 ·d−1
shows
d = b·a−1 ·c−1
d = a−1 ·b·c−1
b = a·d·c
proof from A2 have T:
a−1 ∈ G c−1 ∈ G d−1 ∈ G b·c−1 ∈ Gusing group_op_closed inverse_in_groupby autowith A2 A3 have a·(d−1 )−1 = b·c−1
using group0_2_L18 by simp
with A2 have b·c−1 = a·dusing group_inv_of_inv by simp
with A2 T have I: a−1 ·(b·c−1 ) = dusing group0_2_L18 by simp
with A1 A2 T showd = b·a−1 ·c−1
d = a−1 ·b·c−1
using group_oper_assoc IsCommutative_def by autofrom A3 have a·d·c = (b·c−1 ·d−1 )·d·c by simp
also from A2 T have . . . = b·c−1 ·(d−1 ·d)·c
using group_oper_assoc by simp
also from A2 T have . . . = b·c−1 ·c270using group0_2_L6 group0_2_L2 by simp
also from A2 T have . . . = b·(c−1 ·c)using group_oper_assoc by simp
also from A2 have . . . = b
using group0_2_L6 group0_2_L2 by simp
finally have a·d·c = b by simp
thus b = a·d·c by simp
qed
end

29

Groups 2

theory Group_ZF_2 imports AbelianGroup_ZF func_ZF EquivClass1
begin

This theory continues Group ZF.thy and considers lifting the group structure to function spaces and projecting the group structure to quotient spaces,in particular the quotient qroup.

29.1

Lifting groups to function spaces

If we have a monoid (group) G than we get a monoid (group) structure ona space of functions valued in in G by defining (f · g)(x) := f (x) · g(x). We
call this process ”lifting the monoid (group) to function space”. This section
formalizes this lifting.
The lifted operation is an operation on the function space.
lemma (in monoid0) Group_ZF_2_1_L0A:
assumes A1: F = f {lifted to function space over} X
shows F : (X→G)×(X→G)→(X→G)
proof from monoidAsssum have f : G×G→Gusing IsAmonoid_def IsAssociative_def by simp
with A1 show thesis
using func_ZF_1_L3 group0_1_L3B by autoqed

The result of the lifted operation is in the function space.
lemma (in monoid0) Group_ZF_2_1_L0:
assumes A1:F = f {lifted to function space over} X
and A2:s:X→G r:X→Gshows Fh s,ri : X→G
proof from A1 have F : (X→G)×(X→G)→(X→G)
using Group_ZF_2_1_L0A

271

by simp
with A2 show thesis using apply_funtype
by simpqed

The lifted monoid operation has a neutral element, namely the constantfunction with the neutral element as the value.
lemma (in monoid0) Group_ZF_2_1_L1:
assumes A1: F = f {lifted to function space over} X
and A2: E = ConstantFunction(X,TheNeutralElement(G,f))shows E : X→G ∧ (∀ s∈X→G. Fh E,si = s ∧ Fh s,Ei = s)
prooffrom A2 show T1:E : X→Gusing unit_is_neutral func1_3_L1 by simp
show ∀ s∈X→G. Fh E,si = s ∧ Fh s,Ei = s
proof
fix s assume A3:s:X→Gfrom monoidAsssum have T2:f : G×G→Gusing IsAmonoid_def IsAssociative_def by simp
from A3 A1 T1 have
Fh E,si : X→G Fh s,Ei : X→G s : X→Gusing Group_ZF_2_1_L0 by auto
moreover from T2 A1 T1 A2 A3 have
∀ x∈X. (Fh E,si)(x) = s(x)∀ x∈X. (Fh s,Ei)(x) = s(x)using func_ZF_1_L4 group0_1_L3B func1_3_L2
apply_type unit_is_neutral by auto
ultimately show
Fh E,si = s ∧ Fh s,Ei = s
using fun_extension_iff by autoqed
qed

Monoids can be lifted to a function space.
lemma (in monoid0) Group_ZF_2_1_T1:
assumes A1: F = f {lifted to function space over} X
shows IsAmonoid(X→G,F)
proof from monoidAsssum A1 haveF {is associative on} (X→G)
using IsAmonoid_def func_ZF_2_L4 group0_1_L3B
by automoreover from A1 have
∃ E ∈ X→G. ∀ s ∈ X→G. Fh E,si = s ∧ Fh s,Ei = s
using Group_ZF_2_1_L1 by blast
ultimately show thesis using IsAmonoid_def
by simpqed

272

The constant function with the neutral element as the value is the neutral
element of the lifted monoid.
lemma Group_ZF_2_1_L2:
assumes A1: IsAmonoid(G,f)
and A2: F = f {lifted to function space over} X
and A3: E = ConstantFunction(X,TheNeutralElement(G,f))shows E = TheNeutralElement(X→G,F)
proof from A1 A2 haveT1:monoid0(G,f) and T2:monoid0(X→G,F)
using monoid0_def monoid0.Group_ZF_2_1_T1
by autofrom T1 A2 A3 have
E : X→G ∧ (∀ s∈X→G. Fh E,si = s ∧ Fh s,Ei = s)using monoid0.Group_ZF_2_1_L1 by simp
with T2 show thesis
using monoid0.group0_1_L4 by autoqed

The lifted operation acts on the functions in a natural way defined by themonoid operation.
lemma (in monoid0) lifted_val:
assumes F = f {lifted to function space over} X
and s:X→G r:X→G
and x∈X
shows (Fhs,ri)(x) = s(x) ⊕ r(x)using monoidAsssum assms IsAmonoid_def IsAssociative_defgroup0_1_L3B func_ZF_1_L4
by autoThe lifted operation acts on the functions in a natural way defined by thegroup operation. This is the same as lifted_val, but in the group0 context.
lemma (in group0) Group_ZF_2_1_L3:
assumes F = P {lifted to function space over} X
and s:X→G r:X→G
and x∈X
shows (Fhs,ri)(x) = s(x)·r(x)using assms group0_2_L1 monoid0.lifted_val by simp

In the group0 context we can apply theorems proven in monoid0 context tothe lifted monoid.
lemma (in group0) Group_ZF_2_1_L4:
assumes A1: F = P {lifted to function space over} X
shows monoid0(X→G,F)
proof from A1 show thesis
using group0_2_L1 monoid0.Group_ZF_2_1_T1 monoid0_def
by simp273

qed

The compostion of a function f : X → G with the group inverse is a rightinverse for the lifted group.
lemma (in group0) Group_ZF_2_1_L5:
assumes A1: F = P {lifted to function space over} X
and A2: s : X→G
and A3: i = GroupInv(G,P) O s
shows i: X→G and Fh s,ii = TheNeutralElement(X→G,F)
proof let E = ConstantFunction(X,1)
have E : X→Gusing group0_2_L2 func1_3_L1 by simp
moreover from groupAssum A2 A3 A1 have
Fh s,ii : X→G using group0_2_T2 comp_fun
Group_ZF_2_1_L4 monoid0.group0_1_L1
by simpmoreover from groupAssum A2 A3 A1 have
∀ x∈X. (Fh s,ii)(x) = E(x)using group0_2_T2 comp_fun Group_ZF_2_1_L3
comp_fun_apply apply_funtype group0_2_L6 func1_3_L2
by simpmoreover from groupAssum A1 have
E = TheNeutralElement(X→G,F)
using IsAgroup_def Group_ZF_2_1_L2 by simp
ultimately show Fh s,ii = TheNeutralElement(X→G,F)
using fun_extension_iff IsAgroup_def Group_ZF_2_1_L2
by simpfrom groupAssum A2 A3 show i: X→Gusing group0_2_T2 comp_fun by simp
qedGroups can be lifted to the function space.
theorem (in group0) Group_ZF_2_1_T2:
assumes A1: F = P {lifted to function space over} X
shows IsAgroup(X→G,F)
proof from A1 have IsAmonoid(X→G,F)
using group0_2_L1 monoid0.Group_ZF_2_1_T1
by simpmoreover have
∀ s∈X→G. ∃ i∈X→G. Fh s,ii = TheNeutralElement(X→G,F)
proof
fix s assume A2: s : X→G
let i = GroupInv(G,P) O sfrom groupAssum A2 have i:X→Gusing group0_2_T2 comp_fun by simp
moreover from A1 A2 have
Fh s,ii = TheNeutralElement(X→G,F)

274

using Group_ZF_2_1_L5 by fast
ultimately show ∃ i∈X→G. Fh s,ii = TheNeutralElement(X→G,F)
by autoqed
ultimately show thesis using IsAgroup_def
by simpqed

What is the group inverse for the lifted group?
lemma (in group0) Group_ZF_2_1_L6:
assumes A1: F = P {lifted to function space over} X
shows ∀ s∈(X→G). GroupInv(X→G,F)(s) = GroupInv(G,P) O s
proof from A1 have group0(X→G,F)
using group0_def Group_ZF_2_1_T2
by simpmoreover from A1 have ∀ s∈X→G. GroupInv(G,P) O s : X→G ∧Fh s,GroupInv(G,P) O si = TheNeutralElement(X→G,F)
using Group_ZF_2_1_L5 by simp
ultimately have∀ s∈(X→G). GroupInv(G,P) O s = GroupInv(X→G,F)(s)by (rule group0.group0_2_L9A)
thus thesis by simp
qed

What is the value of the group inverse for the lifted group?
corollary (in group0) lift_gr_inv_val:
assumes F = P {lifted to function space over} X ands : X→G and x∈Xshows (GroupInv(X→G,F)(s))(x) = (s(x))−1
using groupAssum assms Group_ZF_2_1_L6 group0_2_T2 comp_fun_apply
by simp

What is the group inverse in a subgroup of the lifted group?
lemma (in group0) Group_ZF_2_1_L6A:
assumes A1: F = P {lifted to function space over} X
and A2: IsAsubgroup(H,F)
and A3: g = restrict(F,H×H)
and A4: s∈Hshows GroupInv(H,g)(s) = GroupInv(G,P) O s
proof from A1 have T1: group0(X→G,F)
using group0_def Group_ZF_2_1_T2
by simpwith A2 A3 A4 have GroupInv(H,g)(s) = GroupInv(X→G,F)(s)using group0.group0_3_T1 restrict by simp
moreover from T1 A1 A2 A4 haveGroupInv(X→G,F)(s) = GroupInv(G,P) O s
using group0.group0_3_L2 Group_ZF_2_1_L6 by blast

275

ultimately show thesis by simp
qed

If a group is abelian, then its lift to a function space is also abelian.
lemma (in group0) Group_ZF_2_1_L7:
assumes A1: F = P {lifted to function space over} X
and A2: P {is commutative on} G
shows F {is commutative on} (X→G)
proof from A1 A2 haveF {is commutative on} (X→range(P))
using group_oper_assocA func_ZF_2_L2
by simpmoreover from groupAssum have range(P) = G
using group0_2_L1 monoid0.group0_1_L3B
by simpultimately show thesis by simp
qed

29.2

Equivalence relations on groups

The goal of this section is to establish that (under some conditions) given
an equivalence relation on a group or (monoid )we can project the group(monoid) structure on the quotient and obtain another group.
The neutral element class is neutral in the projection.
lemma (in monoid0) Group_ZF_2_2_L1:
assumes A1: equiv(G,r) and A2:Congruent2(r,f)
and A3: F = ProjFun2(G,r,f)and A4: e = TheNeutralElement(G,f)
shows r{e} ∈ G//r ∧(∀ c ∈ G//r. Fh r{e},ci = c ∧ Fh c,r{e}i = c)
prooffrom A4 show T1:r{e} ∈ G//r
using unit_is_neutral quotientIby simpshow∀ c ∈ G//r. Fh r{e},ci = c ∧ Fh c,r{e}i = c
proof
fix c assume A5:c ∈ G//rthen obtain g where D1:g∈G c = r{g}using quotient_def by autowith A1 A2 A3 A4 D1 show
Fh r{e},ci = c ∧ Fh c,r{e}i = cusing unit_is_neutral EquivClass_1_L10
by simp
qed
qed

276

The projected structure is a monoid.
theorem (in monoid0) Group_ZF_2_2_T1:
assumes A1: equiv(G,r) and A2: Congruent2(r,f)
and A3: F = ProjFun2(G,r,f)
shows IsAmonoid(G//r,F)
proof let E = r{TheNeutralElement(G,f)}from A1 A2 A3 haveE ∈ G//r ∧ (∀ c∈G//r. Fh E,ci = c ∧ Fh c,Ei = c)using Group_ZF_2_2_L1 by simp
hence
∃ E∈G//r. ∀ c∈G//r. Fh E,ci = c ∧ Fh c,Ei = c
by autowith monoidAsssum A1 A2 A3 show thesis
using IsAmonoid_def EquivClass_2_T2
by simpqed

The class of the neutral element is the neutral element of the projectedmonoid.
lemma Group_ZF_2_2_L1:
assumes A1: IsAmonoid(G,f)
and A2: equiv(G,r) and A3: Congruent2(r,f)
and A4: F = ProjFun2(G,r,f)and A5: e = TheNeutralElement(G,f)
shows r{e} = TheNeutralElement(G//r,F)
proof from A1 A2 A3 A4 haveT1:monoid0(G,f) and T2:monoid0(G//r,F)
using monoid0_def monoid0.Group_ZF_2_2_T1 by autofrom T1 A2 A3 A4 A5 have r{e} ∈ G//r ∧(∀ c ∈ G//r. Fh r{e},ci = c ∧ Fh c,r{e}i = c)using monoid0.Group_ZF_2_2_L1 by simp
with T2 show thesis using monoid0.group0_1_L4
by autoqed

The projected operation can be defined in terms of the group operation on
representants in a natural way.
lemma (in group0) Group_ZF_2_2_L2:
assumes A1: equiv(G,r) and A2: Congruent2(r,P)
and A3: F = ProjFun2(G,r,P)
and A4: a∈G b∈Gshows Fh r{a},r{b}i = r{a·b}proof from A1 A2 A3 A4 show thesis
using EquivClass_1_L10 by simp
qed

277

The class of the inverse is a right inverse of the class.
lemma (in group0) Group_ZF_2_2_L3:
assumes A1: equiv(G,r) and A2: Congruent2(r,P)
and A3: F = ProjFun2(G,r,P)
and A4: a∈Gshows Fhr{a},r{a−1 }i = TheNeutralElement(G//r,F)
proof from A1 A2 A3 A4 have
Fhr{a},r{a−1 }i = r{1}using inverse_in_group Group_ZF_2_2_L2 group0_2_L6
by simpwith groupAssum A1 A2 A3 show thesis
using IsAgroup_def Group_ZF_2_2_L1 by simp
qed

The group structure can be projected to the quotient space.
theorem (in group0) Group_ZF_3_T2:
assumes A1: equiv(G,r) and A2: Congruent2(r,P)
shows IsAgroup(G//r,ProjFun2(G,r,P))
proof let F = ProjFun2(G,r,P)
let E = TheNeutralElement(G//r,F)from groupAssum A1 A2 have IsAmonoid(G//r,F)
using IsAgroup_def monoid0_def monoid0.Group_ZF_2_2_T1
by simpmoreover have
∀ c∈G//r. ∃ b∈G//r. Fh c,bi = E
proof
fix c assume A3: c ∈ G//rthen obtain g where D1: g∈G c = r{g}using quotient_def by auto
let b = r{g−1 }from D1 have b ∈ G//r
using inverse_in_group quotientIby simpmoreover from A1 A2 D1 have
Fh c,bi = E
using Group_ZF_2_2_L3 by simp
ultimately show ∃ b∈G//r. Fh c,bi = E
by autoqed
ultimately show thesis
using IsAgroup_def by simp
qed

The group inverse (in the projected group) of a class is the class of theinverse.
lemma (in group0) Group_ZF_2_2_L4:

278

assumes A1: equiv(G,r) andA2: Congruent2(r,P) andA3: F = ProjFun2(G,r,P) andA4: a∈G
shows r{a−1 } = GroupInv(G//r,F)(r{a})proof from A1 A2 A3 have group0(G//r,F)
using Group_ZF_3_T2 group0_def by simp
moreover from A4 haver{a} ∈ G//r r{a−1 } ∈ G//r
using inverse_in_group quotientI by auto
moreover from A1 A2 A3 A4 have
Fhr{a},r{a−1 }i = TheNeutralElement(G//r,F)
using Group_ZF_2_2_L3 by simp
ultimately show thesisby (rule group0.group0_2_L9)
qed

29.3

Normal subgroups and quotient groups

If H is a subgroup of G, then for every a ∈ G we can cosider the sets{a · h.h ∈ H} and {h · a.h ∈ H} (called a left and right ”coset of H”,
resp.) These sets sometimes form a group, called the ”quotient group”.
This section discusses the notion of quotient groups.
A normal subgorup N of a group G is such that aba−1 belongs to N if
a ∈ G, b ∈ N .
definition
IsAnormalSubgroup(G,P,N) ≡ IsAsubgroup(N,P) ∧(∀ n∈N.∀ g∈G. Ph Ph g,n i,GroupInv(G,P)(g) i ∈ N)

Having a group and a normal subgroup N we can create another groupconsisting of eqivalence classes of the relation a ∼ b ≡ a · b−1 ∈ N . We
will refer to this relation as the quotient group relation. The classes of thisrelation are in fact cosets of subgroup H.
definition
QuotientGroupRel(G,P,H) ≡{h a,bi ∈ G×G. Ph a, GroupInv(G,P)(b)i ∈ H}

Next we define the operation in the quotient group as the projection of thegroup operation on the classses of the quotient group relation.
definition
QuotientGroupOp(G,P,H) ≡ ProjFun2(G,QuotientGroupRel(G,P,H ),P)

Definition of a normal subgroup in a more readable notation.
lemma (in group0) Group_ZF_2_4_L0:
assumes IsAnormalSubgroup(G,P,H)

279

and g∈G n∈Hshows g·n·g−1 ∈ Husing assms IsAnormalSubgroup_def by simp

The quotient group relation is reflexive.
lemma (in group0) Group_ZF_2_4_L1:
assumes IsAsubgroup(H,P)
shows refl(G,QuotientGroupRel(G,P,H))
using assms group0_2_L6 group0_3_L5
QuotientGroupRel_def refl_def by simp

The quotient group relation is symmetric.
lemma (in group0) Group_ZF_2_4_L2:
assumes A1:IsAsubgroup(H,P)
shows sym(QuotientGroupRel(G,P,H))
proof {
fix a b assume A2: h a,bi ∈ QuotientGroupRel(G,P,H)
with A1 have (a·b−1 )−1 ∈ Husing QuotientGroupRel_def group0_3_T3A
by simpmoreover from A2 have (a·b−1 )−1 = b·a−1
using QuotientGroupRel_def group0_2_L12
by simpultimately have b·a−1 ∈ H by simp
with A2 have h b,ai ∈ QuotientGroupRel(G,P,H)
using QuotientGroupRel_def by simp}
then show thesis using symI by simp
qed

The quotient group relation is transistive.
lemma (in group0) Group_ZF_2_4_L3A:
assumes A1: IsAsubgroup(H,P) andA2: h a,bi ∈ QuotientGroupRel(G,P,H) andA3: h b,ci ∈ QuotientGroupRel(G,P,H)
shows h a,ci ∈ QuotientGroupRel(G,P,H)
proof let r = QuotientGroupRel(G,P,H)
from A2 A3 have T1:a∈G b∈G c∈Gusing QuotientGroupRel_def by autofrom A1 A2 A3 have (a·b−1 )·(b·c−1 ) ∈ H
using QuotientGroupRel_def group0_3_L6
by simpmoreover from T1 havea·c−1 = (a·b−1 )·(b·c−1 )using group0_2_L14A by blast
ultimately have a·c−1 ∈ H
by simp280

with T1 show thesis using QuotientGroupRel_def
by simpqed

The quotient group relation is an equivalence relation. Note we do not need
the subgroup to be normal for this to be true.
lemma (in group0) Group_ZF_2_4_L3: assumes A1:IsAsubgroup(H,P)
shows equiv(G,QuotientGroupRel(G,P,H))
proof let r = QuotientGroupRel(G,P,H)
from A1 have∀ a b c. (ha, bi ∈ r ∧ hb, ci ∈ r −→ ha, ci ∈ r)using Group_ZF_2_4_L3A by blast
then have trans(r)using Fol1_L2 by blast
with A1 show thesis
using Group_ZF_2_4_L1 Group_ZF_2_4_L2
QuotientGroupRel_def equiv_def
by autoqed

The next lemma states the essential condition for congruency of the group
operation with respect to the quotient group relation.
lemma (in group0) Group_ZF_2_4_L4:assumes A1: IsAnormalSubgroup(G,P,H)
and A2: ha1,a2i ∈ QuotientGroupRel(G,P,H)
and A3: hb1,b2i ∈ QuotientGroupRel(G,P,H)
shows ha1·b1, a2·b2i ∈ QuotientGroupRel(G,P,H)
proof from A2 A3 have T1:
a1∈G a2∈G b1∈G b2∈G
a1·b1 ∈ G a2·b2 ∈ G
b1·b2−1 ∈ H a1·a2−1 ∈ Husing QuotientGroupRel_def group0_2_L1 monoid0.group0_1_L1
by autowith A1 show thesis using
IsAnormalSubgroup_def group0_3_L6 group0_2_L15
QuotientGroupRel_def by simp
qed

If the subgroup is normal, the group operation is congruent with respect tothe quotient group relation.
lemma Group_ZF_2_4_L5A:
assumes IsAgroup(G,P)
and IsAnormalSubgroup(G,P,H)
shows Congruent2(QuotientGroupRel(G,P,H),P)
using assms group0_def group0.Group_ZF_2_4_L4 Congruent2_def
by simp281

The quotient group is indeed a group.
theorem Group_ZF_2_4_T1:
assumes IsAgroup(G,P) and IsAnormalSubgroup(G,P,H)
shows
IsAgroup(G//QuotientGroupRel(G,P,H),QuotientGroupOp(G,P,H))
using assms group0_def group0.Group_ZF_2_4_L3 IsAnormalSubgroup_def
Group_ZF_2_4_L5A group0.Group_ZF_3_T2 QuotientGroupOp_def
by simp

The class (coset) of the neutral element is the neutral element of the quotientgroup.
lemma Group_ZF_2_4_L5B:
assumes IsAgroup(G,P) and IsAnormalSubgroup(G,P,H)
and r = QuotientGroupRel(G,P,H)
and e = TheNeutralElement(G,P)
shows r{e} = TheNeutralElement(G//r,QuotientGroupOp(G,P,H))
using assms IsAnormalSubgroup_def group0_def
IsAgroup_def group0.Group_ZF_2_4_L3 Group_ZF_2_4_L5A
QuotientGroupOp_def Group_ZF_2_2_L1
by simp

A group element is equivalent to the neutral element iff it is in the subgroup
we divide the group by.
lemma (in group0) Group_ZF_2_4_L5C: assumes a∈Gshows ha,1i ∈ QuotientGroupRel(G,P,H) ←→ a∈Husing assms QuotientGroupRel_def group_inv_of_one group0_2_L2
by autoA group element is in H iff its class is the neutral element of G/H.
lemma (in group0) Group_ZF_2_4_L5D:
assumes A1: IsAnormalSubgroup(G,P,H) andA2: a∈G andA3: r = QuotientGroupRel(G,P,H) andA4: TheNeutralElement(G//r,QuotientGroupOp(G,P,H)) = e
shows r{a} = e ←→ ha,1i ∈ r
proofassume r{a} = ewith groupAssum assms haver{1} = r{a} and I: equiv(G,r)
using Group_ZF_2_4_L5B IsAnormalSubgroup_def Group_ZF_2_4_L3
by autowith A2 have h1,ai ∈ r using eq_equiv_classby simpwith I show ha,1i ∈ r by (rule equiv_is_sym)
next assume ha,1i ∈ rmoreover from A1 A3 have equiv(G,r)
using IsAnormalSubgroup_def Group_ZF_2_4_L3
by simp282

ultimately have r{a} = r{1}using equiv_class_eq by simp
with groupAssum A1 A3 A4 show r{a} = eusing Group_ZF_2_4_L5B by simp
qed

The class of a ∈ G is the neutral element of the quotient G/H iff a ∈ H.
lemma (in group0) Group_ZF_2_4_L5E:
assumes IsAnormalSubgroup(G,P,H) anda∈G and r = QuotientGroupRel(G,P,H) and
TheNeutralElement(G//r,QuotientGroupOp(G,P,H)) = e
shows r{a} = e ←→ a∈Husing assms Group_ZF_2_4_L5C Group_ZF_2_4_L5D
by simp

Essential condition to show that every subgroup of an abelian group is normal.
lemma (in group0) Group_ZF_2_4_L5:
assumes A1: P {is commutative on} G
and A2: IsAsubgroup(H,P)
and A3: g∈G h∈Hshows g·h·g−1 ∈ H
proof from A2 A3 have T1:h∈G g−1 ∈ Gusing group0_3_L2 inverse_in_group by autowith A3 A1 have g·h·g−1 = g−1 ·g·h
using group0_4_L4A by simp
with A3 T1 show thesis usinggroup0_2_L6 group0_2_L2
by simpqed

Every subgroup of an abelian group is normal. Moreover, the quotient groupis also abelian.
lemma Group_ZF_2_4_L6:
assumes A1: IsAgroup(G,P)
and A2: P {is commutative on} G
and A3: IsAsubgroup(H,P)
shows IsAnormalSubgroup(G,P,H)
QuotientGroupOp(G,P,H) {is commutative on} (G//QuotientGroupRel(G,P,H))
proof from A1 A2 A3 show T1: IsAnormalSubgroup(G,P,H) usinggroup0_def IsAnormalSubgroup_def group0.Group_ZF_2_4_L5
by simplet r = QuotientGroupRel(G,P,H)
from A1 A3 T1 have equiv(G,r) Congruent2(r,P)
using group0_def group0.Group_ZF_2_4_L3 Group_ZF_2_4_L5A
by auto283

with A2 show
QuotientGroupOp(G,P,H) {is commutative on} (G//QuotientGroupRel(G,P,H))
using EquivClass_2_T1 QuotientGroupOp_def
by simpqed

The group inverse (in the quotient group) of a class (coset) is the class of
the inverse.
lemma (in group0) Group_ZF_2_4_L7:
assumes IsAnormalSubgroup(G,P,H)
and a∈G and r = QuotientGroupRel(G,P,H)
and F = QuotientGroupOp(G,P,H)
shows r{a−1 } = GroupInv(G//r,F)(r{a})using groupAssum assms IsAnormalSubgroup_def Group_ZF_2_4_L3
Group_ZF_2_4_L5A QuotientGroupOp_def Group_ZF_2_2_L4
by simp29.4

Function spaces as monoids

On every space of functions {f : X → X} we can define a natural monoid
structure with composition as the operation. This section explores this fact.
The next lemma states that composition has a neutral element, namely theidentity function on X (the one that maps x ∈ X into itself).
lemma Group_ZF_2_5_L1: assumes A1: F = Composition(X)shows ∃ I∈(X→X). ∀ f∈(X→X). Fh I,fi = f ∧ Fh f,Ii = f
proof let I = id(X)from A1 haveI ∈ X→X ∧ (∀ f∈(X→X). Fh I,fi = f ∧ Fh f,Ii = f)using id_type func_ZF_6_L1A by simp
thus thesis by autoqed

The space of functions that map a set X into itsef is a monoid with composition as operation and the identity function as the neutral element.
lemma Group_ZF_2_5_L2: shows
IsAmonoid(X→X,Composition(X))
id(X) = TheNeutralElement(X→X,Composition(X))
proof let I = id(X)let F = Composition(X)show IsAmonoid(X→X,Composition(X))
using func_ZF_5_L5 Group_ZF_2_5_L1 IsAmonoid_def
by autothen have monoid0(X→X,F)
using monoid0_def by simp
moreover have284

I ∈ X→X ∧ (∀ f∈(X→X). Fh I,fi = f ∧ Fh f,Ii = f)using id_type func_ZF_6_L1A by simp
ultimately show I = TheNeutralElement(X→X,F)
using monoid0.group0_1_L4 by auto
qed
end

30

Groups 3

theory Group_ZF_3 imports Group_ZF_2 Finite1
begin

In this theory we consider notions in group theory that are useful for theconstruction of real numbers in the Real_ZF_x series of theories.

30.1

Group valued finite range functions

In this section show that the group valued functions f : X → G, with theproperty that f (X) is a finite subset of G, is a group. Such functions play
an important role in the construction of real numbers in the Real_ZF series.
The following proves the essential condition to show that the set of finite
range functions is closed with respect to the lifted group operation.
lemma (in group0) Group_ZF_3_1_L1:
assumes A1: F = P {lifted to function space over} X
and
A2: s ∈ FinRangeFunctions(X,G) r ∈ FinRangeFunctions(X,G)
shows Fh s,ri ∈ FinRangeFunctions(X,G)
proof let q = Fh s,ri
from A2 have T1:s:X→G r:X→Gusing FinRangeFunctions_def by autowith A1 have T2:q : X→Gusing group0_2_L1 monoid0.Group_ZF_2_1_L0
by simpmoreover have q(X) ∈ Fin(G)proof from A2 have{s(x). x∈X} ∈ Fin(G){r(x). x∈X} ∈ Fin(G)using Finite1_L18 by autowith A1 T1 T2 show thesis usinggroup_oper_assocA Finite1_L15 Group_ZF_2_1_L3 func_imagedef
by simpqed
ultimately show thesis using FinRangeFunctions_def

285

by simp
qed

The set of group valued finite range functions is closed with respect to thelifted group operation.
lemma (in group0) Group_ZF_3_1_L2:
assumes A1: F = P {lifted to function space over} X
shows FinRangeFunctions(X,G) {is closed under} F
proof let A = FinRangeFunctions(X,G)
from A1 have ∀ x∈A. ∀ y∈A. Fh x,yi ∈ Ausing Group_ZF_3_1_L1 by simp
then show thesis using IsOpClosed_def by simp
qed

A composition of a finite range function with the group inverse is a finite
range function.
lemma (in group0) Group_ZF_3_1_L3:
assumes A1: s ∈ FinRangeFunctions(X,G)
shows GroupInv(G,P) O s ∈ FinRangeFunctions(X,G)
using groupAssum assms group0_2_T2 Finite1_L20 by simp

The set of finite range functions is s subgroup of the lifted group.
theorem Group_ZF_3_1_T1:
assumes A1: IsAgroup(G,P)
and A2: F = P {lifted to function space over} X
and A3: X6=0
shows IsAsubgroup(FinRangeFunctions(X,G),F)
proof let e = TheNeutralElement(G,P)
let S = FinRangeFunctions(X,G)
from A1 have T1: group0(G,P) using group0_def
by simpwith A1 A2 have T2:group0(X→G,F)
using group0.Group_ZF_2_1_T2 group0_def
by simpmoreover have S 6= 0
proof from T1 A3 have
ConstantFunction(X,e) ∈ S
using group0.group0_2_L1 monoid0.unit_is_neutral
Finite1_L17 by simp
thus thesis by autoqed
moreover have S ⊆ X→Gusing FinRangeFunctions_def by auto
moreover from A2 T1 have
S {is closed under} F

286

using group0.Group_ZF_3_1_L2
by simpmoreover from A1 A2 T1 have∀ s ∈ S. GroupInv(X→G,F)(s) ∈ S
using FinRangeFunctions_def group0.Group_ZF_2_1_L6
group0.Group_ZF_3_1_L3 by simp
ultimately show thesis
using group0.group0_3_T3 by simp
qed

30.2

Almost homomorphisms

An almost homomorphism is a group valued function defined on a monoid
M with the property that the set {f (m + n) − f (m) − f (n)}m,n∈M is finite.
This term is used by R. D. Arthan in ”The Eudoxus Real Numbers”. We
use this term in the general group context and use the A‘Campo’s term
”slopes” (see his ”A natural construction for the real numbers”) to meanan almost homomorphism mapping interegers into themselves. We consider
almost homomorphisms because we use slopes to define real numbers in the
Real_ZF_x series.
HomDiff is an acronym for ”homomorphism difference”. This is the expression s(mn)(s(m)s(n))−1 , or s(m + n) − s(m) − s(n) in the additive notation.
It is equal to the neutral element of the group if s is a homomorphism.
definition
HomDiff(G,f,s,x) ≡fhs(fh fst(x),snd(x)i) ,(GroupInv(G,f)(fh s(fst(x)),s(snd(x))i))i

Almost homomorphisms are defined as those maps s : G → G such that thehomomorphism difference takes only finite number of values on G × G.
definition
AlmostHoms(G,f) ≡{s ∈ G→G.{HomDiff(G,f,s,x). x ∈ G×G } ∈ Fin(G)}AlHomOp1(G, f ) is the group operation on almost homomorphisms definedin a natural way by (s · r)(n) = s(n) · r(n). In the terminology defined infunc1.thy this is the group operation f (on G) lifted to the function space
G → G and restricted to the set AlmostHoms(G, f ).
definition
AlHomOp1(G,f) ≡restrict(f {lifted to function space over} G,
AlmostHoms(G,f)×AlmostHoms(G,f))

We also define a composition (binary) operator on almost homomorphisms
in a natural way. We call that operator AlHomOp2 - the second operation on287

almost homomorphisms. Composition of almost homomorphisms is used todefine multiplication of real numbers in Real_ZF series.
definition
AlHomOp2(G,f) ≡restrict(Composition(G),AlmostHoms(G,f)×AlmostHoms(G,f))This lemma provides more readable notation for the HomDiff definition.
Not really intended to be used in proofs, but just to see the definition in thenotation defined in the group0 locale.
lemma (in group0) HomDiff_notation:shows HomDiff(G,P,s,h m,ni) = s(m·n)·(s(m)·s(n))−1
using HomDiff_def by simp

The next lemma shows the set from the definition of almost homomorphism
in a different form.
lemma (in group0) Group_ZF_3_2_L1A: shows{HomDiff(G,P,s,x). x ∈ G×G } = {s(m·n)·(s(m)·s(n))−1 . h m,ni ∈ G×G}
proof have ∀ m∈G.∀ n∈G. HomDiff(G,P,s,h m,ni) = s(m·n)·(s(m)·s(n))−1
using HomDiff_notation by simp
then show thesis by (rule ZF1_1_L4A)
qed

Let’s define some notation. We inherit the notation and assumptions fromthe group0 context (locale) and add some. We will use AH to denote theset of almost homomorphisms. ∼ is the inverse (negative if the group is
the group of integers) of almost homomorphisms, (∼ p)(n) = p(n)−1 . δ will
denote the homomorphism difference specific for the group (HomDiff(G, f )).
The notation s ≈ r will mean that s, r are almost equal, that is they are in
the equivalence relation defined by the group of finite range functions (thatis a normal subgroup of almost homomorphisms, if the group is abelian).
We show that this is equivalent to the set {s(n) · r(n)−1 : n ∈ G} being
finite. We also add an assumption that the G is abelian as many needed
properties do not hold without that.
locale group1 = group0 +assumes isAbelian: P {is commutative on} G
fixes AH
defines AH_def [simp]: AH ≡ AlmostHoms(G,P)
fixes Op1
defines Op1_def [simp]: Op1 ≡ AlHomOp1(G,P)
fixes Op2
defines Op2_def [simp]: Op2 ≡ AlHomOp2(G,P)

288

fixes FR
defines FR_def [simp]: FR ≡ FinRangeFunctions(G,G)
fixes neg (∼_ [90] 91)
defines neg_def [simp]: ∼s ≡ GroupInv(G,P) O s
fixes δdefines δ_def [simp]: δ(s,x) ≡ HomDiff(G,P,s,x)
fixes AHprod (infix · 69)
defines AHprod_def [simp]: s · r ≡AlHomOp1(G,P)hs,ri

fixes AHcomp (infix ◦ 70)
defines AHcomp_def [simp]: s ◦ r ≡AlHomOp2(G,P)hs,ri

fixes AlEq (infix ≈ 68)
defines AlEq_def [simp]:s ≈ r ≡ hs,ri ∈ QuotientGroupRel(AH,Op1,FR)

HomDiff is a homomorphism on the lifted group structure.
lemma (in group1) Group_ZF_3_2_L1:
assumes A1: s:G→G r:G→G
and A2: x ∈ G×G
and A3: F = P {lifted to function space over} Gshows δ(Fh s,ri,x) = δ(s,x)·δ(r,x)
proof let p = Fh s,ri
from A2 obtain m n whereD1: x = h m,ni m∈G n∈G
by autothen have T1:m·n ∈ Gusing group0_2_L1 monoid0.group0_1_L1 by simp
with A1 D1 have T2:
s(m)∈G s(n)∈G r(m)∈G
r(n)∈G s(m·n)∈G r(m·n)∈G
using apply_funtype by autofrom A3 A1 have T3:p : G→Gusing group0_2_L1 monoid0.Group_ZF_2_1_L0
by simpfrom D1 T3 haveδ(p,x) = p(m·n)·((p(n))−1 ·(p(m))−1 )using HomDiff_notation apply_funtype group_inv_of_two
by simp
also from A3 A1 D1 T1 isAbelian T2 have
. . . = δ(s,x)· δ(r,x)
using Group_ZF_2_1_L3 group0_4_L3 HomDiff_notation
by simp
finally show thesis by simp
qed

289

The group operation lifted to the function space over G preserves almost
homomorphisms.
lemma (in group1) Group_ZF_3_2_L2: assumes A1: s ∈ AH r ∈ AH
and A2: F = P {lifted to function space over} Gshows Fh s,ri ∈ AH
proof let p = Fh s,ri
from A1 A2 have p : G→Gusing AlmostHoms_def group0_2_L1 monoid0.Group_ZF_2_1_L0
by simpmoreover have{δ(p,x). x ∈ G×G} ∈ Fin(G)proof from A1 have{δ(s,x). x ∈ G×G } ∈ Fin(G){δ(r,x). x ∈ G×G } ∈ Fin(G)using AlmostHoms_def by autowith groupAssum A1 A2 show thesis
using IsAgroup_def IsAmonoid_def IsAssociative_def
Finite1_L15 AlmostHoms_def Group_ZF_3_2_L1
by autoqed
ultimately show thesis using AlmostHoms_def
by simpqed

The set of almost homomorphisms is closed under the lifted group operation.
lemma (in group1) Group_ZF_3_2_L3:
assumes F = P {lifted to function space over} Gshows AH {is closed under} F
using assms IsOpClosed_def Group_ZF_3_2_L2 by simp

The terms in the homomorphism difference for a function are in the group.
lemma (in group1) Group_ZF_3_2_L4:
assumes s:G→G and m∈G n∈Gshowsm·n ∈ Gs(m·n) ∈ G
s(m) ∈ G s(n) ∈ G
δ(s,h m,ni) ∈ G
s(m)·s(n) ∈ G
using assms group_op_closed inverse_in_group
apply_funtype HomDiff_def by auto

It is handy to have a version of Group_ZF_3_2_L4 specifically for almost homomorphisms.
corollary (in group1) Group_ZF_3_2_L4A:
assumes s ∈ AH and m∈G n∈G

290shows m·n ∈ Gs(m·n) ∈ G
s(m) ∈ G s(n) ∈ G
δ(s,h m,ni) ∈ G
s(m)·s(n) ∈ G
using assms AlmostHoms_def Group_ZF_3_2_L4
by auto

The terms in the homomorphism difference are in the group, a different
form.
lemma (in group1) Group_ZF_3_2_L4B:
assumes A1:s ∈ AH and A2:x∈G×G
shows fst(x)·snd(x) ∈ Gs(fst(x)·snd(x)) ∈ Gs(fst(x)) ∈ G s(snd(x)) ∈ G
δ(s,x) ∈ Gs(fst(x))·s(snd(x)) ∈ G
proof let m = fst(x)let n = snd(x)from A1 A2 showm·n ∈ G s(m·n) ∈ G
s(m) ∈ G s(n) ∈ G
s(m)·s(n) ∈ G
using Group_ZF_3_2_L4A
by autofrom A1 A2 have δ(s,h m,ni) ∈ G using Group_ZF_3_2_L4A
by simpmoreover from A2 have h m,ni = x by auto
ultimately show δ(s,x) ∈ G by simp
qed

What are the values of the inverse of an almost homomorphism?
lemma (in group1) Group_ZF_3_2_L5:
assumes s ∈ AH and n∈Gshows (∼s)(n) = (s(n))−1
using assms AlmostHoms_def comp_fun_apply by auto

Homomorphism difference commutes with the inverse for almost homomorphisms.
lemma (in group1) Group_ZF_3_2_L6:
assumes A1:s ∈ AH and A2:x∈G×G
shows δ(∼s,x) = (δ(s,x))−1
proof let m = fst(x)let n = snd(x)have δ(∼s,x) = (∼s)(m·n)·((∼s)(m)·(∼s)(n))−1
using HomDiff_def by simp

291

from A1 A2 isAbelian show thesis
using Group_ZF_3_2_L4B HomDiff_def
Group_ZF_3_2_L5 group0_4_L4A
by simpqed

The inverse of an almost homomorphism maps the group into itself.
lemma (in group1) Group_ZF_3_2_L7:
assumes s ∈ AH
shows ∼s : G→Gusing groupAssum assms AlmostHoms_def group0_2_T2 comp_fun by auto

The inverse of an almost homomorphism is an almost homomorphism.
lemma (in group1) Group_ZF_3_2_L8:
assumes A1: F = P {lifted to function space over} G
and A2: s ∈ AH
shows GroupInv(G→G,F)(s) ∈ AH
proof from A2 have {δ(s,x). x ∈ G×G} ∈ Fin(G)using AlmostHoms_def by simp
with groupAssum haveGroupInv(G,P){δ(s,x). x ∈ G×G} ∈ Fin(G)using group0_2_T2 Finite1_L6A by blast
moreover haveGroupInv(G,P){δ(s,x). x ∈ G×G} ={(δ(s,x))−1 . x ∈ G×G}
proof from groupAssum haveGroupInv(G,P) : G→Gusing group0_2_T2 by simp
moreover from A2 have
∀ x∈G×G. δ(s,x)∈G
using Group_ZF_3_2_L4B by simp
ultimately show thesis
using func1_1_L17 by simp
qed
ultimately have {(δ(s,x))−1 . x ∈ G×G} ∈ Fin(G)by simpmoreover from A2 have{(δ(s,x))−1 . x ∈ G×G} = {δ(∼s,x). x ∈ G×G}
using Group_ZF_3_2_L6 by simp
ultimately have {δ(∼s,x). x ∈ G×G} ∈ Fin(G)by simpwith A2 groupAssum A1 show thesis
using Group_ZF_3_2_L7 AlmostHoms_def Group_ZF_2_1_L6
by simpqed

The function that assigns the neutral element everywhere is an almost ho292

momorphism.
lemma (in group1) Group_ZF_3_2_L9: shows
ConstantFunction(G,1) ∈ AH and AH6=0
proof let z = ConstantFunction(G,1)
have G×G6=0 using group0_2_L1 monoid0.group0_1_L3A
by blast
moreover have ∀ x∈G×G. δ(z,x) = 1
proof
fix x assume A1:x ∈ G × G
then obtain m n where x = h m,ni m∈G n∈G
by autothen show δ(z,x) = 1
using group0_2_L1 monoid0.group0_1_L1
func1_3_L2 HomDiff_def group0_2_L2group_inv_of_one by simp
qed
ultimately have {δ(z,x). x∈G×G} = {1} by (rule ZF1_1_L5)
then show z ∈ AH using group0_2_L2 Finite1_L16
func1_3_L1 group0_2_L2 AlmostHoms_def by simp
then show AH6=0 by autoqed

If the group is abelian, then almost homomorphisms form a subgroup of thelifted group.
lemma Group_ZF_3_2_L10:
assumes A1: IsAgroup(G,P)
and A2: P {is commutative on} G
and A3: F = P {lifted to function space over} Gshows IsAsubgroup(AlmostHoms(G,P),F)
proof let AH = AlmostHoms(G,P)
from A2 A1 have T1: group1(G,P)
using group1_axioms.intro group0_def group1_def
by simpfrom A1 A3 have group0(G→G,F)
using group0_def group0.Group_ZF_2_1_T2 by simp
moreover from T1 have AH6=0
using group1.Group_ZF_3_2_L9 by simp
moreover have T2:AH ⊆ G→Gusing AlmostHoms_def by auto
moreover from T1 A3 have
AH {is closed under} F
using group1.Group_ZF_3_2_L3 by simp
moreover from T1 A3 have
∀ s∈AH. GroupInv(G→G,F)(s) ∈ AH
using group1.Group_ZF_3_2_L8 by simp
ultimately show IsAsubgroup(AlmostHoms(G,P),F)
using group0.group0_3_T3 by simp

293

qed

If the group is abelian, then almost homomorphisms form a group with thefirst operation, hence we can use theorems proven in group0 context aplied
to this group.
lemma (in group1) Group_ZF_3_2_L10A:
shows IsAgroup(AH,Op1) group0(AH,Op1)
using groupAssum isAbelian Group_ZF_3_2_L10 IsAsubgroup_def
AlHomOp1_def group0_def by auto

The group of almost homomorphisms is abelianlemma Group_ZF_3_2_L11: assumes A1: IsAgroup(G,f)
and A2: f {is commutative on} G
shows
IsAgroup(AlmostHoms(G,f),AlHomOp1(G,f))AlHomOp1(G,f) {is commutative on} AlmostHoms(G,f)
proof let AH = AlmostHoms(G,f)
let F = f {lifted to function space over} Gfrom A1 A2 have IsAsubgroup(AH,F)
using Group_ZF_3_2_L10 by simp
then show IsAgroup(AH,AlHomOp1(G,f))using IsAsubgroup_def AlHomOp1_def by simp
from A1 have F : (G→G)×(G→G)→(G→G)
using IsAgroup_def monoid0_def monoid0.Group_ZF_2_1_L0A
by simpmoreover have AH ⊆ G→Gusing AlmostHoms_def by auto
moreover from A1 A2 haveF {is commutative on} (G→G)
using group0_def group0.Group_ZF_2_1_L7
by simpultimately show
AlHomOp1(G,f){is commutative on} AH
using func_ZF_4_L1 AlHomOp1_def by simp
qed

The first operation on homomorphisms acts in a natural way on its operands.
lemma (in group1) Group_ZF_3_2_L12:
assumes s∈AH r∈AH and n∈Gshows (s·r)(n) = s(n)·r(n)using assms AlHomOp1_def restrict AlmostHoms_def Group_ZF_2_1_L3
by simp

What is the group inverse in the group of almost homomorphisms?
lemma (in group1) Group_ZF_3_2_L13:
assumes A1: s∈AH
shows

294

GroupInv(AH,Op1)(s) = GroupInv(G,P) O s
GroupInv(AH,Op1)(s) ∈ AH
GroupInv(G,P) O s ∈ AH
proof let F = P {lifted to function space over} Gfrom groupAssum isAbelian have IsAsubgroup(AH,F)
using Group_ZF_3_2_L10 by simp
with A1 show I: GroupInv(AH,Op1)(s) = GroupInv(G,P) O s
using AlHomOp1_def Group_ZF_2_1_L6A by simp
from A1 show GroupInv(AH,Op1)(s) ∈ AH
using Group_ZF_3_2_L10A group0.inverse_in_group by simp
with I show GroupInv(G,P) O s ∈ AH by simp
qed

The group inverse in the group of almost homomorphisms acts in a natural
way on its operand.
lemma (in group1) Group_ZF_3_2_L14:
assumes s∈AH and n∈Gshows (GroupInv(AH,Op1)(s))(n) = (s(n))−1
using isAbelian assms Group_ZF_3_2_L13 AlmostHoms_def comp_fun_apply
by auto

The next lemma states that if s, r are almost homomorphisms, then s · r−1
is also an almost homomorphism.
lemma Group_ZF_3_2_L15: assumes IsAgroup(G,f)
and f {is commutative on} G
and AH = AlmostHoms(G,f) Op1 = AlHomOp1(G,f)
and s ∈ AH r ∈ AH
shows
Op1h s,ri ∈ AH
GroupInv(AH,Op1)(r) ∈ AH
Op1h s,GroupInv(AH,Op1)(r)i ∈ AH
using assms group0_def group1_axioms.intro group1_defgroup1.Group_ZF_3_2_L10A group0.group0_2_L1
monoid0.group0_1_L1 group0.inverse_in_group by auto

A version of Group_ZF_3_2_L15 formulated in notation used in group1 context. States that the product of almost homomorphisms is an almost homomorphism and the the product of an almost homomorphism with a (pointwise) inverse of an almost homomorphism is an almost homomorphism.
corollary (in group1) Group_ZF_3_2_L16: assumes s ∈ AH r ∈ AH
shows s·r ∈ AH s·(∼r) ∈ AH
using assms isAbelian group0_def group1_axioms group1_def
Group_ZF_3_2_L15 Group_ZF_3_2_L13 by auto

295

30.3

The classes of almost homomorphisms

In the Real_ZF series we define real numbers as a quotient of the group of
integer almost homomorphisms by the integer finite range functions. In thissection we setup the background for that in the general group context.
Finite range functions are almost homomorphisms.
lemma (in group1) Group_ZF_3_3_L1: shows FR ⊆ AH
proof
fix s assume A1:s ∈ FR
then have T1:{s(n). n ∈ G} ∈ Fin(G){s(fst(x)). x∈G×G} ∈ Fin(G){s(snd(x)). x∈G×G} ∈ Fin(G)using Finite1_L18 Finite1_L6B by auto
have {s(fst(x)·snd(x)). x ∈ G×G} ∈ Fin(G)proof have ∀ x∈G×G. fst(x)·snd(x) ∈ G
using group0_2_L1 monoid0.group0_1_L1 by simp
moreover from T1 have {s(n). n ∈ G} ∈ Fin(G) by simp
ultimately show thesis by (rule Finite1_L6B)
qed
moreover have{(s(fst(x))·s(snd(x)))−1 . x∈G×G} ∈ Fin(G)proof have ∀ g∈G. g−1 ∈ G using inverse_in_groupby simpmoreover from T1 have{s(fst(x))·s(snd(x)). x∈G×G} ∈ Fin(G)using group_oper_assocA Finite1_L15 by simp
ultimately show thesisby (rule Finite1_L6C)
qed
ultimately have {δ(s,x). x∈G×G} ∈ Fin(G)using HomDiff_def Finite1_L15 group_oper_assocA
by simpwith A1 show s ∈ AH
using FinRangeFunctions_def AlmostHoms_def
by simpqed

Finite range functions valued in an abelian group form a normal subgroupof almost homomorphisms.
lemma Group_ZF_3_3_L2: assumes A1:IsAgroup(G,f)
and A2:f {is commutative on} G
shows
IsAsubgroup(FinRangeFunctions(G,G),AlHomOp1(G,f))
IsAnormalSubgroup(AlmostHoms(G,f),AlHomOp1(G,f),
FinRangeFunctions(G,G))
proof -

296

let H1 = AlmostHoms(G,f)
let H2 = FinRangeFunctions(G,G)
let F = f {lifted to function space over} Gfrom A1 A2 have T1:group0(G,f)
monoid0(G,f) group1(G,f)
using group0_def group0.group0_2_L1
group1_axioms.intro group1_def
by autowith A1 A2 have IsAgroup(G→G,F)
IsAsubgroup(H1,F) IsAsubgroup(H2,F)
using group0.Group_ZF_2_1_T2 Group_ZF_3_2_L10
monoid0.group0_1_L3A Group_ZF_3_1_T1
by autothen have
IsAsubgroup(H1∩H2,restrict(F,H1×H1))
using group0_3_L7 by simp
moreover from T1 have H1∩H2 = H2
using group1.Group_ZF_3_3_L1 by auto
ultimately show IsAsubgroup(H2,AlHomOp1(G,f))using AlHomOp1_def by simp
with A1 A2 show IsAnormalSubgroup(AlmostHoms(G,f),AlHomOp1(G,f),
FinRangeFunctions(G,G))
using Group_ZF_3_2_L11 Group_ZF_2_4_L6
by simpqed

The group of almost homomorphisms divided by the subgroup of finite rangefunctions is an abelian group.
theorem (in group1) Group_ZF_3_3_T1:
shows
IsAgroup(AH//QuotientGroupRel(AH,Op1,FR),QuotientGroupOp(AH,Op1,FR))andQuotientGroupOp(AH,Op1,FR) {is commutative on}(AH//QuotientGroupRel(AH,Op1,FR))using groupAssum isAbelian Group_ZF_3_3_L2 Group_ZF_3_2_L10A
Group_ZF_2_4_T1 Group_ZF_3_2_L10A Group_ZF_3_2_L11
Group_ZF_3_3_L2 IsAnormalSubgroup_def Group_ZF_2_4_L6 by auto

It is useful to have a direct statement that the quotient group relation is anequivalence relation for the group of AH and subgroup FR.
lemma (in group1) Group_ZF_3_3_L3: shows
QuotientGroupRel(AH,Op1,FR) ⊆ AH × AH andequiv(AH,QuotientGroupRel(AH,Op1,FR))using groupAssum isAbelian QuotientGroupRel_def
Group_ZF_3_3_L2 Group_ZF_3_2_L10A group0.Group_ZF_2_4_L3
by autoThe ”almost equal” relation is symmetric.
lemma (in group1) Group_ZF_3_3_L3A: assumes A1: s≈r

297

shows r≈sproof let R = QuotientGroupRel(AH,Op1,FR)from A1 have equiv(AH,R) and hs,ri ∈ R
using Group_ZF_3_3_L3 by auto
then have hr,si ∈ R by (rule equiv_is_sym)
then show r≈s by simp
qed

Although we have bypassed this fact when proving that group of almost
homomorphisms divided by the subgroup of finite range functions is a group,
it is still useful to know directly that the first group operation on AH iscongruent with respect to the quotient group relation.
lemma (in group1) Group_ZF_3_3_L4:
shows Congruent2(QuotientGroupRel(AH,Op1,FR),Op1)
using groupAssum isAbelian Group_ZF_3_2_L10A Group_ZF_3_3_L2
Group_ZF_2_4_L5A by simp

The class of an almost homomorphism s is the neutral element of the quotient group of almost homomorphisms iff s is a finite range function.
lemma (in group1) Group_ZF_3_3_L5: assumes s ∈ AH andr = QuotientGroupRel(AH,Op1,FR) and
TheNeutralElement(AH//r,QuotientGroupOp(AH,Op1,FR)) = e
shows r{s} = e ←→ s ∈ FR
using groupAssum isAbelian assms Group_ZF_3_2_L11
group0_def Group_ZF_3_3_L2 group0.Group_ZF_2_4_L5E
by simp

The group inverse of a class of an almost homomorphism f is the class of
the inverse of f .
lemma (in group1) Group_ZF_3_3_L6:
assumes A1: s ∈ AH andr = QuotientGroupRel(AH,Op1,FR) and
F = ProjFun2(AH,r,Op1)
shows r{∼s} = GroupInv(AH//r,F)(r{s})proof from groupAssum isAbelian assms haver{GroupInv(AH, Op1)(s)} = GroupInv(AH//r,F)(r {s})using Group_ZF_3_2_L10A Group_ZF_3_3_L2 QuotientGroupOp_defgroup0.Group_ZF_2_4_L7 by simp
with A1 show thesis using Group_ZF_3_2_L13
by simpqed

30.4

Compositions of almost homomorphisms

The goal of this section is to establish some facts about composition of almost
homomorphisms. needed for the real numbers construction in Real_ZF_x298

series. In particular we show that the set of almost homomorphisms is
closed under composition and that composition is congruent with respect
to the equivalence relation defined by the group of finite range functions (anormal subgroup of almost homomorphisms).
The next formula restates the definition of the homomorphism difference toexpress the value an almost homomorphism on a product.
lemma (in group1) Group_ZF_3_4_L1:
assumes s∈AH and m∈G n∈Gshows s(m·n) = s(m)·s(n)·δ(s,h m,ni)
using isAbelian assms Group_ZF_3_2_L4A HomDiff_def group0_4_L5
by simp

What is the value of a composition of almost homomorhisms?
lemma (in group1) Group_ZF_3_4_L2:
assumes s∈AH r∈AH and m∈Gshows (s◦r)(m) = s(r(m)) s(r(m)) ∈ G
using assms AlmostHoms_def func_ZF_5_L3 restrict AlHomOp2_def
apply_funtype by auto

What is the homomorphism difference of a composition?
lemma (in group1) Group_ZF_3_4_L3:
assumes A1: s∈AH r∈AH and A2: m∈G n∈Gshows δ(s◦r,h m,ni) =δ(s,h r(m),r(n)i)·s(δ(r,h m,ni))·δ(s,h r(m)·r(n),δ(r,h m,ni)i)
proof from A1 A2 have T1:s(r(m))· s(r(n)) ∈ G
δ(s,h r(m),r(n)i)∈ G s(δ(r,h m,ni)) ∈G
δ(s,h (r(m)·r(n)),δ(r,h m,ni)i) ∈ G
using Group_ZF_3_4_L2 AlmostHoms_def apply_funtype
Group_ZF_3_2_L4A group0_2_L1 monoid0.group0_1_L1
by autofrom A1 A2 have δ(s◦r,h m,ni) =s(r(m)·r(n)·δ(r,h m,ni))·(s((r(m)))·s(r(n)))−1
using HomDiff_def group0_2_L1 monoid0.group0_1_L1 Group_ZF_3_4_L2
Group_ZF_3_4_L1 by simp
moreover from A1 A2 haves(r(m)·r(n)·δ(r,h m,ni)) =s(r(m)·r(n))·s(δ(r,h m,ni))·δ(s,h (r(m)·r(n)),δ(r,h m,ni)i)s(r(m)·r(n)) = s(r(m))·s(r(n))·δ(s,h r(m),r(n)i)
using Group_ZF_3_2_L4A Group_ZF_3_4_L1 by auto
moreover from T1 isAbelian haves(r(m))·s(r(n))·δ(s,h r(m),r(n)i)·s(δ(r,h m,ni))·δ(s,h (r(m)·r(n)),δ(r,h m,ni)i)·(s((r(m)))·s(r(n)))−1 =δ(s,h r(m),r(n)i)·s(δ(r,h m,ni))·δ(s,h (r(m)·r(n)),δ(r,h m,ni)i)
using group0_4_L6C by simp299

ultimately show thesis by simp
qed

What is the homomorphism difference of a composition (another form)?
Here we split the homomorphism difference of a composition into a productof three factors. This will help us in proving that the range of homomorphism
difference for the composition is finite, as each factor has finite range.
lemma (in group1) Group_ZF_3_4_L4:assumes A1: s∈AH r∈AH and A2: x ∈ G×G
and A3:A = δ(s,h r(fst(x)),r(snd(x))i)
B = s(δ(r,x))C = δ(s,h (r(fst(x))·r(snd(x))),δ(r,x)i)
shows δ(s◦r,x) = A·B·C
proof let m = fst(x)let n = snd(x)note A1
moreover from A2 have m∈G n∈G
by autoultimately haveδ(s◦r,h m,ni) =δ(s,h r(m),r(n)i)·s(δ(r,h m,ni))·δ(s,h (r(m)·r(n)),δ(r,h m,ni)i)by (rule Group_ZF_3_4_L3)
with A1 A2 A3 show thesis
by autoqed

The range of the homomorphism difference of a composition of two almost
homomorphisms is finite. This is the essential condition to show that acomposition of almost homomorphisms is an almost homomorphism.
lemma (in group1) Group_ZF_3_4_L5:
assumes A1: s∈AH r∈AH
shows {δ(Composition(G)h s,ri,x). x ∈ G×G} ∈ Fin(G)proof from A1 have
∀ x∈G×G. h r(fst(x)),r(snd(x))i ∈ G×G
using Group_ZF_3_2_L4B by simp
moreover from A1 have{δ(s,x). x∈G×G} ∈ Fin(G)using AlmostHoms_def by simp
ultimately have{δ(s,h r(fst(x)),r(snd(x))i). x∈G×G} ∈ Fin(G)by (rule Finite1_L6B)
moreover have {s(δ(r,x)). x∈G×G} ∈ Fin(G)proof from A1 have ∀ m∈G. s(m) ∈ G

300

using AlmostHoms_def apply_funtype by auto
moreover from A1 have {δ(r,x). x∈G×G} ∈ Fin(G)using AlmostHoms_def by simp
ultimately show thesisby (rule Finite1_L6C)
qed
ultimately have{δ(s,h r(fst(x)),r(snd(x))i)·s(δ(r,x)). x∈G×G} ∈ Fin(G)using group_oper_assocA Finite1_L15 by simp
moreover have{δ(s,h (r(fst(x))·r(snd(x))),δ(r,x)i). x∈G×G} ∈ Fin(G)proof from A1 have
∀ x∈G×G. h (r(fst(x))·r(snd(x))),δ(r,x)i ∈ G×G
using Group_ZF_3_2_L4B by simp
moreover from A1 have{δ(s,x). x∈G×G} ∈ Fin(G)using AlmostHoms_def by simp
ultimately show thesis by (rule Finite1_L6B)
qed
ultimately have{δ(s,h r(fst(x)),r(snd(x))i)·s(δ(r,x))·δ(s,h (r(fst(x))·r(snd(x))),δ(r,x)i). x∈G×G} ∈ Fin(G)using group_oper_assocA Finite1_L15 by simp
moreover from A1 have {δ(s◦r,x). x∈G×G} ={δ(s,h r(fst(x)),r(snd(x))i)·s(δ(r,x))·δ(s,h (r(fst(x))·r(snd(x))),δ(r,x)i). x∈G×G}
using Group_ZF_3_4_L4 by simp
ultimately have {δ(s◦r,x). x∈G×G} ∈ Fin(G) by simp
with A1 show thesis using restrict AlHomOp2_def
by simpqed

Composition of almost homomorphisms is an almost homomorphism.
theorem (in group1) Group_ZF_3_4_T1:
assumes A1: s∈AH r∈AH
shows Composition(G)h s,ri ∈ AH s◦r ∈ AH
proof from A1 have h s,ri ∈ (G→G)×(G→G)
using AlmostHoms_def by simp
then have Composition(G)h s,ri : G→Gusing func_ZF_5_L1 apply_funtype by blast
with A1 show Composition(G)h s,ri ∈ AH
using Group_ZF_3_4_L5 AlmostHoms_def
by simpwith A1 show s◦r ∈ AH using AlHomOp2_def restrictby simpqed

The set of almost homomorphisms is closed under composition. The second
301operation on almost homomorphisms is associative.
lemma (in group1) Group_ZF_3_4_L6: shows
AH {is closed under} Composition(G)AlHomOp2(G,P) {is associative on} AH
proof show AH {is closed under} Composition(G)using Group_ZF_3_4_T1 IsOpClosed_def by simp
moreover have AH ⊆ G→G using AlmostHoms_def
by automoreover have
Composition(G) {is associative on} (G→G)
using func_ZF_5_L5 by simp
ultimately show AlHomOp2(G,P) {is associative on} AH
using func_ZF_4_L3 AlHomOp2_def by simp
qedType information related to the situation of two almost homomorphisms.
lemma (in group1) Group_ZF_3_4_L7:
assumes A1: s∈AH r∈AH and A2: n∈G
showss(n) ∈ G (r(n))−1 ∈ G
s(n)·(r(n))−1 ∈ G
s(r(n)) ∈ G
proof from A1 A2 shows(n) ∈ G(r(n))−1 ∈ G
s(r(n)) ∈ G
s(n)·(r(n))−1 ∈ Gusing AlmostHoms_def apply_type
group0_2_L1 monoid0.group0_1_L1 inverse_in_groupby autoqed

Type information related to the situation of three almost homomorphisms.
lemma (in group1) Group_ZF_3_4_L8:
assumes A1: s∈AH r∈AH q∈AH and A2: n∈G
showsq(n)∈Gs(r(n)) ∈ G
r(n)·(q(n))−1 ∈ G
s(r(n)·(q(n))−1 ) ∈ G
δ(s,h q(n),r(n)·(q(n))−1 i) ∈ G
proof from A1 A2 show
q(n)∈ G s(r(n)) ∈ G r(n)·(q(n))−1 ∈ Gusing AlmostHoms_def apply_type
group0_2_L1 monoid0.group0_1_L1 inverse_in_groupby autowith A1 A2 show s(r(n)·(q(n))−1 ) ∈ G302δ(s,h q(n),r(n)·(q(n))−1 i) ∈ G
using AlmostHoms_def apply_type Group_ZF_3_2_L4A
by autoqed

A formula useful in showing that the composition of almost homomorphisms
is congruent with respect to the quotient group relation.
lemma (in group1) Group_ZF_3_4_L9:
assumes A1: s1 ∈ AH r1 ∈ AH s2 ∈ AH r2 ∈ AH
and A2: n∈Gshows (s1◦r1)(n)·((s2◦r2)(n))−1 =s1(r2(n))· (s2(r2(n)))−1 ·s1(r1(n)·(r2(n))−1 )·δ(s1,h r2(n),r1(n)·(r2(n))−1 i)proof from A1 A2 isAbelian have(s1◦r1)(n)·((s2◦r2)(n))−1 =s1(r2(n)·(r1(n)·(r2(n))−1 ))·(s2(r2(n)))−1
using Group_ZF_3_4_L2 Group_ZF_3_4_L7 group0_4_L6A
group_oper_assoc by simp
with A1 A2 have (s1◦r1)(n)·((s2◦r2)(n))−1 = s1(r2(n))·
s1(r1(n)·(r2(n))−1 )·δ(s1,h r2(n),r1(n)·(r2(n))−1 i)·(s2(r2(n)))−1
using Group_ZF_3_4_L8 Group_ZF_3_4_L1 by simp
with A1 A2 isAbelian show thesis using
Group_ZF_3_4_L8 group0_4_L7 by simp
qed

The next lemma shows a formula that translates an expression in terms of
the first group operation on almost homomorphisms and the group inversein the group of almost homomorphisms to an expression using only theunderlying group operations.
lemma (in group1) Group_ZF_3_4_L10: assumes A1: s ∈ AH r ∈ AH
and A2: n ∈ Gshows (s·(GroupInv(AH,Op1)(r)))(n) = s(n)·(r(n))−1
proof from A1 A2 show thesis
using isAbelian Group_ZF_3_2_L13 Group_ZF_3_2_L12 Group_ZF_3_2_L14
by simpqed

A neccessary condition for two a. h. to be almost equal.
lemma (in group1) Group_ZF_3_4_L11:
assumes A1: s≈rshows {s(n)·(r(n))−1 . n∈G} ∈ Fin(G)proof from A1 have s∈AH r∈AH
using QuotientGroupRel_def by auto
moreover from A1 have303

{(s·(GroupInv(AH,Op1)(r)))(n). n∈G} ∈ Fin(G)using QuotientGroupRel_def Finite1_L18 by simp
ultimately show thesis
using Group_ZF_3_4_L10 by simpqed

A sufficient condition for two a. h. to be almost equal.
lemma (in group1) Group_ZF_3_4_L12: assumes A1: s∈AH
and A2: {s(n)·(r(n))−1 . n∈G} ∈ Fin(G)shows s≈r
proof from groupAssum isAbelian A1 A2 show thesis
using Group_ZF_3_2_L15 AlmostHoms_def
Group_ZF_3_4_L10 Finite1_L19 QuotientGroupRel_def
by simpqedr∈AH

Another sufficient consdition for two a.h. to be almost equal. It is actuallyjust an expansion of the definition of the quotient group relation.
lemma (in group1) Group_ZF_3_4_L12A: assumes s∈AH r∈AH
and s·(GroupInv(AH,Op1)(r)) ∈ FR
shows s≈r r≈s
proof from assms show s≈r using assms QuotientGroupRel_def
by simpthen show r≈s by (rule Group_ZF_3_3_L3A)
qed

Another necessary condition for two a.h. to be almost equal. It is actuallyjust an expansion of the definition of the quotient group relation.
lemma (in group1) Group_ZF_3_4_L12B: assumes s≈rshows s·(GroupInv(AH,Op1)(r)) ∈ FR
using assms QuotientGroupRel_def by simp

The next lemma states the essential condition for the composition of a. h.
to be congruent with respect to the quotient group relation for the subgroupof finite range functions.
lemma (in group1) Group_ZF_3_4_L13:
assumes A1: s1≈s2 r1≈r2
shows (s1◦r1) ≈ (s2◦r2)
proof have {s1(r2(n))· (s2(r2(n)))−1 . n∈G} ∈ Fin(G)proof from A1 have ∀ n∈G. r2(n) ∈ G
using QuotientGroupRel_def AlmostHoms_def apply_funtype
by automoreover from A1 have {s1(n)·(s2(n))−1 . n∈G} ∈ Fin(G)using Group_ZF_3_4_L11 by simp

304

ultimately show thesis by (rule Finite1_L6B)
qed
moreover have {s1(r1(n)·(r2(n))−1 ). n ∈ G} ∈ Fin(G)proof from A1 have ∀ n∈G. s1(n)∈G
using QuotientGroupRel_def AlmostHoms_def apply_funtype
by automoreover from A1 have {r1(n)·(r2(n))−1 . n∈G} ∈ Fin(G)using Group_ZF_3_4_L11 by simp
ultimately show thesis by (rule Finite1_L6C)
qed
ultimately have{s1(r2(n))· (s2(r2(n)))−1 ·s1(r1(n)·(r2(n))−1 ).
n∈G} ∈ Fin(G)using group_oper_assocA Finite1_L15 by simp
moreover have{δ(s1,h r2(n),r1(n)·(r2(n))−1 i). n∈G} ∈ Fin(G)proof from A1 have ∀ n∈G. h r2(n),r1(n)·(r2(n))−1 i ∈ G×G
using QuotientGroupRel_def Group_ZF_3_4_L7 by auto
moreover from A1 have {δ(s1,x). x ∈ G×G} ∈ Fin(G)using QuotientGroupRel_def AlmostHoms_def by simp
ultimately show thesis by (rule Finite1_L6B)
qed
ultimately have{s1(r2(n))· (s2(r2(n)))−1 ·s1(r1(n)·(r2(n))−1 )·δ(s1,h r2(n),r1(n)·(r2(n))−1 i). n∈G} ∈ Fin(G)using group_oper_assocA Finite1_L15 by simp
with A1 show thesis using
QuotientGroupRel_def Group_ZF_3_4_L9
Group_ZF_3_4_T1 Group_ZF_3_4_L12 by simp
qedComposition of a. h. to is congruent with respect to the quotient grouprelation for the subgroup of finite range functions. Recall that if an operationsay ”◦” on X is congruent with respect to an equivalence relation R then we
can define the operation on the quotient space X/R by [s]R ◦ [r]R := [s ◦ r]R
and this definition will be correct i.e. it will not depend on the choice ofrepresentants for the classes [x] and [y]. This is why we want it here.
lemma (in group1) Group_ZF_3_4_L13A: shows
Congruent2(QuotientGroupRel(AH,Op1,FR),Op2)
proof show thesis using Group_ZF_3_4_L13 Congruent2_def
by simpqed

The homomorphism difference for the identity function is equal to the neutral element of the group (denoted e in the group1 context).

305

lemma (in group1) Group_ZF_3_4_L14: assumes A1: x ∈ G×G
shows δ(id(G),x) = 1
proof from A1 show thesis usinggroup0_2_L1 monoid0.group0_1_L1 HomDiff_def id_conv group0_2_L6
by simpqed

The identity function (I(x) = x) on G is an almost homomorphism.
lemma (in group1) Group_ZF_3_4_L15: shows id(G) ∈ AH
proof have G×G 6= 0 using group0_2_L1 monoid0.group0_1_L3A
by blast
then show thesis using Group_ZF_3_4_L14 group0_2_L2
id_type AlmostHoms_def by simp
qed

Almost homomorphisms form a monoid with composition. The identity
function on the group is the neutral element there.
lemma (in group1) Group_ZF_3_4_L16:
shows
IsAmonoid(AH,Op2)
monoid0(AH,Op2)
id(G) = TheNeutralElement(AH,Op2)
proof let i = TheNeutralElement(G→G,Composition(G))
have
IsAmonoid(G→G,Composition(G))
monoid0(G→G,Composition(G))
using monoid0_def Group_ZF_2_5_L2 by auto
moreover have AH {is closed under} Composition(G)using Group_ZF_3_4_L6 by simp
moreover have AH ⊆ G→Gusing AlmostHoms_def by auto
moreover have i ∈ AH
using Group_ZF_2_5_L2 Group_ZF_3_4_L15 by simp
moreover have id(G) = i
using Group_ZF_2_5_L2 by simp
ultimately show
IsAmonoid(AH,Op2)
monoid0(AH,Op2)
id(G) = TheNeutralElement(AH,Op2)
using monoid0.group0_1_T1 group0_1_L6 AlHomOp2_def monoid0_def
by autoqed

We can project the monoid of almost homomorphisms with composition to
the group of almost homomorphisms divided by the subgroup of finite rangefunctions. The class of the identity function is the neutral element of the306

quotient (monoid).
theorem (in group1) Group_ZF_3_4_T2:
assumes A1: R = QuotientGroupRel(AH,Op1,FR)
shows
IsAmonoid(AH//R,ProjFun2(AH,R,Op2))
R{id(G)} = TheNeutralElement(AH//R,ProjFun2(AH,R,Op2))
proof have group0(AH,Op1) using Group_ZF_3_2_L10A group0_def
by simpwith A1 groupAssum isAbelian show
IsAmonoid(AH//R,ProjFun2(AH,R,Op2))
R{id(G)} = TheNeutralElement(AH//R,ProjFun2(AH,R,Op2))
using Group_ZF_3_3_L2 group0.Group_ZF_2_4_L3 Group_ZF_3_4_L13A
Group_ZF_3_4_L16 monoid0.Group_ZF_2_2_T1 Group_ZF_2_2_L1
by autoqed

30.5

Shifting almost homomorphisms

In this this section we consider what happens if we multiply an almost
homomorphism by a group element. We show that the resulting function is
also an a. h., and almost equal to the original one. This is used only forslopes (integer a.h.) in Int_ZF_2 where we need to correct a positive slopesby adding a constant, so that it is at least 2 on positive integers.
If s is an almost homomorphism and c is some constant from the group,
then s · c is an almost homomorphism.
lemma (in group1) Group_ZF_3_5_L1:
assumes A1: s ∈ AH and A2: c∈G andA3: r = {hx,s(x)·ci. x∈G}
shows
∀ x∈G. r(x) = s(x)·cr ∈ AHs ≈ rproof from A1 A2 A3 have I: r:G→Gusing AlmostHoms_def apply_funtype group_op_closed
ZF_fun_from_total by autowith A3 show II: ∀ x∈G. r(x) = s(x)·cusing ZF_fun_from_tot_val by simp
with isAbelian A1 A2 have III:∀ p ∈ G×G. δ(r,p) = δ(s,p)·c−1
using group_op_closed AlmostHoms_def apply_funtype
HomDiff_def group0_4_L7 by auto
have {δ(r,p). p ∈ G×G} ∈ Fin(G)proof from A1 A2 have{δ(s,p). p ∈ G×G} ∈ Fin(G)c−1 ∈G

307

using AlmostHoms_def inverse_in_group by auto
then have {δ(s,p)·c−1 . p ∈ G×G} ∈ Fin(G)using group_oper_assocA Finite1_L16AA
by simpmoreover from III have{δ(r,p). p ∈ G×G} = {δ(s,p)·c−1 . p ∈ G×G}
by (rule ZF1_1_L4B)
ultimately show thesis by simp
qedwith I show IV: r ∈ AH using AlmostHoms_def
by simpfrom isAbelian A1 A2 I II have∀ n ∈ G. s(n)·(r(n))−1 = c−1
using AlmostHoms_def apply_funtype group0_4_L6AB
by autothen have {s(n)·(r(n))−1 . n∈G} = {c−1 . n∈G}by (rule ZF1_1_L4B)
with A1 A2 IV show s ≈ rusing group0_2_L1 monoid0.group0_1_L3A
inverse_in_group Group_ZF_3_4_L12 by simp
qed
end

31

Direct producttheory DirectProduct_ZF imports func_ZF
begin

This theory considers the direct product of binary operations. Contributedby Seo Sanghyeon.

31.1

Definition

In group theory the notion of direct product provides a natural way ofcreating a new group from two given groups.
Given (G, ·) and (H, ◦) a new operation (G × H, ×) is defined as (g, h) ×
(g 0 , h0 ) = (g · g 0 , h ◦ h0 ).
definition
DirectProduct(P,Q,G,H) ≡{hx,hPhfst(fst(x)),fst(snd(x))i , Qhsnd(fst(x)),snd(snd(x))iii.
x ∈ (G×H)×(G×H)}

We define a context called direct0 which holds an assumption that P, Q are
binary operations on G, H, resp. and denotes R as the direct product of(G, P ) and (H, Q).
308

locale direct0 =fixes P Q G H
assumes Pfun: P : G×G→G
assumes Qfun: Q : H×H→H
fixes Rdefines Rdef [simp]: R ≡ DirectProduct(P,Q,G,H)

The direct product of binary operations is a binary operation.
lemma (in direct0) DirectProduct_ZF_1_L1:
shows R : (G×H)×(G×H)→G×H
proof from Pfun Qfun have ∀ x∈(G×H)×(G×H).
hPhfst(fst(x)),fst(snd(x))i,Qhsnd(fst(x)),snd(snd(x))ii ∈ G×H
by autothen show thesis using ZF_fun_from_total DirectProduct_def
by simpqed

And it has the intended value.
lemma (in direct0) DirectProduct_ZF_1_L2:
shows ∀ x∈(G×H). ∀ y∈(G×H).
Rhx,yi = hPhfst(x),fst(y)i,Qhsnd(x),snd(y)ii
using DirectProduct_def DirectProduct_ZF_1_L1 ZF_fun_from_tot_val
by simp

And the value belongs to the set the operation is defined on.
lemma (in direct0) DirectProduct_ZF_1_L3:
shows ∀ x∈(G×H). ∀ y∈(G×H). Rhx,yi ∈ G×H
using DirectProduct_ZF_1_L1 by simp

31.2

Associative and commutative operations

If P and Q are both associative or commutative operations, the direct product of P and Q has the same property.
Direct product of commutative operations is commutative.
lemma (in direct0) DirectProduct_ZF_2_L1:
assumes P {is commutative on} G and Q {is commutative on} H
shows R {is commutative on} G×H
proof from assms have ∀ x∈(G×H). ∀ y∈(G×H). Rhx,yi = Rhy,xi
using DirectProduct_ZF_1_L2 IsCommutative_def by simp
then show thesis using IsCommutative_def by simp
qed

Direct product of associative operations is associative.
lemma (in direct0) DirectProduct_ZF_2_L2:
assumes P {is associative on} G and Q {is associative on} H

309

shows R {is associative on} G×H
proof have ∀ x∈G×H. ∀ y∈G×H. ∀ z∈G×H. RhRhx,yi,zi =hPhPhfst(x),fst(y)i,fst(z)i,QhQhsnd(x),snd(y)i,snd(z)ii
using DirectProduct_ZF_1_L2 DirectProduct_ZF_1_L3
by automoreover have ∀ x∈G×H. ∀ y∈G×H. ∀ z∈G×H. Rhx,Rhy,zii =hPhfst(x),Phfst(y),fst(z)ii,Qhsnd(x),Qhsnd(y),snd(z)iii
using DirectProduct_ZF_1_L2 DirectProduct_ZF_1_L3 by auto
ultimately have ∀ x∈G×H. ∀ y∈G×H. ∀ z∈G×H. RhRhx,yi,zi = Rhx,Rhy,zii
using assms IsAssociative_def by simp
then show thesis
using DirectProduct_ZF_1_L1 IsAssociative_def by simp
qed
end

32

Ordered groups - introduction

theory OrderedGroup_ZF imports Group_ZF_1 AbelianGroup_ZF Order_ZF Finite_ZF_1
begin

This theory file defines and shows the basic properties of (partially or linearly) ordered groups. We define the set of nonnegative elements and theabsolute value function. We show that in linearly ordered groups finite sets
are bounded and provide a sufficient condition for bounded sets to be finite.
This allows to show in Int_ZF_IML.thy that subsets of integers are bounded
iff they are finite.

32.1

Ordered groups

This section defines ordered groups and various related notions.
An ordered group is a group equipped with a partial order that is ”translation invariant”, that is if a ≤ b then a · g ≤ b · g and g · a ≤ g · b.
definition
IsAnOrdGroup(G,P,r) ≡(IsAgroup(G,P) ∧ r⊆G×G ∧ IsPartOrder(G,r) ∧ (∀ g∈G. ∀ a b.
h a,bi ∈ r −→ h Ph a,gi,Ph b,gi i ∈ r ∧ h Ph g,ai,Ph g,bi i ∈ r ) )We define the set of nonnegative elements in the obvious way as G+ = {x ∈G : 1 ≤ x}.
definition
Nonnegative(G,P,r) ≡ {x∈G. h TheNeutralElement(G,P),xi ∈ r}

The PositiveSet(G,P,r) is a set similar to Nonnegative(G,P,r), but without
the unit.
310

definition
PositiveSet(G,P,r) ≡{x∈G. h TheNeutralElement(G,P),xi ∈ r ∧ TheNeutralElement(G,P)6= x}

We also define the absolute value as a ZF-function that is the identity on
G+ and the group inverse on the rest of the group.
definition
AbsoluteValue(G,P,r) ≡ id(Nonnegative(G,P,r)) ∪restrict(GroupInv(G,P),G - Nonnegative(G,P,r))The odd functions are defined as those having property f (a−1 ) = (f (a))−1 .
This looks a bit strange in the multiplicative notation, I have to admit. For
linearly oredered groups a function f defined on the set of positive elements
iniquely defines an odd function of the whole group. This function is called
an odd extension of f
definition
OddExtension(G,P,r,f) ≡(f ∪ {ha, GroupInv(G,P)(f(GroupInv(G,P)(a)))i.
a ∈ GroupInv(G,P)(PositiveSet(G,P,r))} ∪{hTheNeutralElement(G,P),TheNeutralElement(G,P)i})

We will use a similar notation for ordered groups as for the generic groups.
G+ denotes the set of nonnegative elements (that satisfy 1 ≤ a) and G+ isthe set of (strictly) positive elements. -A is the set inverses of elements from
A. I hope that using additive notation for this notion is not too shocking
here. The symbol f° denotes the odd extension of f . For a function definedon G+ this is the unique odd function on G that is equal to f on G+ .
locale group3 =fixes G and P and r
assumes ordGroupAssum: IsAnOrdGroup(G,P,r)fixes unit (1)defines unit_def [simp]: 1 ≡ TheNeutralElement(G,P)
fixes groper (infixl · 70)
defines groper_def [simp]: a · b ≡ Ph a,bi
fixes inv (_−1 [90] 91)
defines inv_def [simp]: x−1 ≡ GroupInv(G,P)(x)fixes lesseq (infix ≤ 68)
defines lesseq_def [simp]: a ≤ b ≡ h a,bi ∈ rfixes sless (infix < 68)
defines sless_def [simp]: a < b ≡ a≤b ∧ a6=b311

fixes nonnegative (G+ )defines nonnegative_def [simp]: G+ ≡ Nonnegative(G,P,r)fixes positive (G+ )defines positive_def [simp]: G+ ≡ PositiveSet(G,P,r)fixes setinv (- _ 72)
defines setninv_def [simp]: -A ≡ GroupInv(G,P)(A)
fixes abs (| _ |)defines abs_def [simp]: |a| ≡ AbsoluteValue(G,P,r)(a)fixes oddext (_ °)defines oddext_def [simp]: f° ≡ OddExtension(G,P,r,f)

In group3 context we can use the theorems proven in the group0 context.
lemma (in group3) OrderedGroup_ZF_1_L1: shows group0(G,P)
using ordGroupAssum IsAnOrdGroup_def group0_def by simp

Ordered group (carrier) is not empty. This is a property of monoids, but it
is good to have it handy in the group3 context.
lemma (in group3) OrderedGroup_ZF_1_L1A: shows G6=0
using OrderedGroup_ZF_1_L1 group0.group0_2_L1 monoid0.group0_1_L3A
by blast

The next lemma is just to see the definition of the nonnegative set in ournotation.
lemma (in group3) OrderedGroup_ZF_1_L2:
shows g∈G+ ←→ 1≤gusing ordGroupAssum IsAnOrdGroup_def Nonnegative_def
by auto

The next lemma is just to see the definition of the positive set in our notation.
lemma (in group3) OrderedGroup_ZF_1_L2A:
shows g∈G+ ←→ (1≤g ∧ g6=1)
using ordGroupAssum IsAnOrdGroup_def PositiveSet_def
by autoFor total order if g is not in G+ , then it has to be less or equal the unit.
lemma (in group3) OrderedGroup_ZF_1_L2B:
assumes A1: r {is total on} G and A2: a∈G-G+
shows a≤1
proof from A2 have a∈G
1 ∈ G ¬(1≤a)
using OrderedGroup_ZF_1_L1 group0.group0_2_L2 OrderedGroup_ZF_1_L2
by auto312with A1 show thesis using IsTotal_def by autoqed

The group order is reflexive.
lemma (in group3) OrderedGroup_ZF_1_L3: assumes g∈Gshows g≤gusing ordGroupAssum assms IsAnOrdGroup_def IsPartOrder_def refl_def
by simp

1 is nonnegative.
lemma (in group3) OrderedGroup_ZF_1_L3A: shows 1∈G+using OrderedGroup_ZF_1_L2 OrderedGroup_ZF_1_L3
OrderedGroup_ZF_1_L1 group0.group0_2_L2 by simp

In this context a ≤ b implies that both a and b belong to G.
lemma (in group3) OrderedGroup_ZF_1_L4:
assumes a≤b shows a∈G b∈Gusing ordGroupAssum assms IsAnOrdGroup_def by auto

It is good to have transitivity handy.
lemma (in group3) Group_order_transitive:
assumes A1: a≤b b≤c shows a≤c
proof from ordGroupAssum have trans(r)using IsAnOrdGroup_def IsPartOrder_def
by simpmoreover from A1 have h a,bi ∈ r ∧ h b,ci ∈ r by simp
ultimately have h a,ci ∈ r by (rule Fol1_L3)
thus thesis by simp
qed

The order in an ordered group is antisymmetric.
lemma (in group3) group_order_antisym:
assumes A1: a≤b b≤a shows a=b
proof from ordGroupAssum A1 haveantisym(r) h a,bi ∈ r h b,ai ∈ rusing IsAnOrdGroup_def IsPartOrder_def by auto
then show a=b by (rule Fol1_L4)
qed

Transitivity for the strict order: if a < b and b ≤ c, then a < c.
lemma (in group3) OrderedGroup_ZF_1_L4A:
assumes A1: a<b and A2: b≤cshows a<cproof from A1 A2 have a≤b b≤c by auto
then have a≤c by (rule Group_order_transitive)

313

moreover from A1 A2 have a6=c using group_order_antisym by auto
ultimately show a<c by simp
qed

Another version of transitivity for the strict order: if a ≤ b and b < c, thena < c.
lemma (in group3) group_strict_ord_transit:
assumes A1: a≤b and A2: b<cshows a<cproof from A1 A2 have a≤b b≤c by auto
then have a≤c by (rule Group_order_transitive)
moreover from A1 A2 have a6=c using group_order_antisym by auto
ultimately show a<c by simp
qed

Strict order is preserved by translations.
lemma (in group3) group_strict_ord_transl_inv:
assumes a<b and c∈Gshows
a·c < b·c
c·a < c·busing ordGroupAssum assms IsAnOrdGroup_def
OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1 group0.group0_2_L19
by autoIf the group order is total, then the group is ordered linearly.
lemma (in group3) group_ord_total_is_lin:
assumes r {is total on} G
shows IsLinOrder(G,r)
using assms ordGroupAssum IsAnOrdGroup_def Order_ZF_1_L3
by simp

For linearly ordered groups elements in the nonnegative set are greater thanthose in the complement.
lemma (in group3) OrderedGroup_ZF_1_L4B:
assumes r {is total on} G
and a∈G+ and b ∈ G-G+shows b≤a
proof from assms have b≤1 1≤ausing OrderedGroup_ZF_1_L2 OrderedGroup_ZF_1_L2B by auto
then show thesis by (rule Group_order_transitive)qed

If a ≤ 1 and a 6= 1, then a ∈ G \ G+ .
lemma (in group3) OrderedGroup_ZF_1_L4C:
assumes A1: a≤1 and A2: a6=1

314

shows a ∈ G-G+
proof { assume a ∈/ G-G+
with ordGroupAssum A1 A2 have False
using OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L2
OrderedGroup_ZF_1_L4 IsAnOrdGroup_def IsPartOrder_def antisym_def
by auto} thus thesis by autoqed

An element smaller than an element in G \ G+ is in G \ G+ .
lemma (in group3) OrderedGroup_ZF_1_L4D:
assumes A1: a∈G-G+ and A2: b≤ashows b∈G-G+
proof { assume b ∈/ G - G+
with A2 have 1≤b b≤ausing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L2 by auto
then have 1≤a by (rule Group_order_transitive)
with A1 have False using OrderedGroup_ZF_1_L2 by simp
} thus thesis by autoqed

The nonnegative set is contained in the group.
lemma (in group3) OrderedGroup_ZF_1_L4E: shows G+ ⊆ Gusing OrderedGroup_ZF_1_L2 OrderedGroup_ZF_1_L4 by auto

Taking the inverse on both sides reverses the inequality.
lemma (in group3) OrderedGroup_ZF_1_L5:
assumes A1: a≤b shows b−1 ≤a−1
proof from A1 have T1: a∈G b∈G a−1 ∈G b−1 ∈Gusing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1
group0.inverse_in_group by autowith A1 ordGroupAssum have a·a−1 ≤b·a−1 using IsAnOrdGroup_def
by simpwith T1 ordGroupAssum have b−1 ·1≤b−1 ·(b·a−1 )using OrderedGroup_ZF_1_L1 group0.group0_2_L6 IsAnOrdGroup_def
by simpwith T1 show thesis using
OrderedGroup_ZF_1_L1 group0.group0_2_L2 group0.group_oper_assoc
group0.group0_2_L6 by simpqed

If an element is smaller that the unit, then its inverse is greater.
lemma (in group3) OrderedGroup_ZF_1_L5A:
assumes A1: a≤1 shows 1≤a−1
proof -

315

from A1 have 1−1 ≤a−1 using OrderedGroup_ZF_1_L5
by simpthen show thesis using OrderedGroup_ZF_1_L1 group0.group_inv_of_one
by simpqed

If an the inverse of an element is greater that the unit, then the element issmaller.
lemma (in group3) OrderedGroup_ZF_1_L5AA:
assumes A1: a∈G and A2: 1≤a−1shows a≤1
proof from A2 have (a−1 )−1 ≤1−1 using OrderedGroup_ZF_1_L5
by simpwith A1 show a≤1
using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv group0.group_inv_of_one
by simpqed

If an element is nonnegative, then the inverse is not greater that the unit.
Also shows that nonnegative elements cannot be negativelemma (in group3) OrderedGroup_ZF_1_L5AB:
assumes A1: 1≤a shows a−1 ≤1 and ¬(a≤1 ∧ a6=1)
proof from A1 have a−1 ≤1−1
using OrderedGroup_ZF_1_L5 by simp
then show a−1 ≤1 using OrderedGroup_ZF_1_L1 group0.group_inv_of_one
by simp{ assume a≤1 and a6=1
with A1 have False using group_order_antisym
by blast} then show ¬(a≤1 ∧ a6=1) by autoqed

If two elements are greater or equal than the unit, then the inverse of one
is not greater than the other.
lemma (in group3) OrderedGroup_ZF_1_L5AC:
assumes A1: 1≤a 1≤bshows a−1 ≤ b
proof from A1 have a−1 ≤1 1≤busing OrderedGroup_ZF_1_L5AB by auto
then show a−1 ≤ b by (rule Group_order_transitive)
qed

32.2

Inequalities

This section developes some simple tools to deal with inequalities.
316

Taking negative on both sides reverses the inequality, case with an inverseon one side.
lemma (in group3) OrderedGroup_ZF_1_L5AD:
assumes A1: b ∈ G and A2: a≤b−1
shows b ≤ a−1
proof from A2 have (b−1 )−1 ≤ a−1
using OrderedGroup_ZF_1_L5 by simp
with A1 show b ≤ a−1
using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simpqed

We can cancel the same element on both sides of an inequality.
lemma (in group3) OrderedGroup_ZF_1_L5AE:
assumes A1: a∈G b∈G c∈G and A2: a·b ≤ a·cshows b≤c
proof from ordGroupAssum A1 A2 have a−1 ·(a·b) ≤ a−1 ·(a·c)
using OrderedGroup_ZF_1_L1 group0.inverse_in_group
IsAnOrdGroup_def by simp
with A1 show b≤cusing OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpqed

We can cancel the same element on both sides of an inequality, a version
with an inverse on both sides.
lemma (in group3) OrderedGroup_ZF_1_L5AF:
assumes A1: a∈G b∈G c∈G and A2: a·b−1 ≤ a·c−1
shows c≤b
proof from A1 A2 have (c−1 )−1 ≤ (b−1 )−1using OrderedGroup_ZF_1_L1 group0.inverse_in_group
OrderedGroup_ZF_1_L5AE OrderedGroup_ZF_1_L5 by simp
with A1 show c≤busing OrderedGroup_ZF_1_L1 group0.group_inv_of_inv by simp
qed

Taking negative on both sides reverses the inequality, another case with aninverse on one side.
lemma (in group3) OrderedGroup_ZF_1_L5AG:
assumes A1: a ∈ G and A2: a−1 ≤bshows b−1 ≤ aproof from A2 have b−1 ≤ (a−1 )−1using OrderedGroup_ZF_1_L5 by simp
with A1 show b−1 ≤ a

317

using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simpqed

We can multiply the sides of two inequalities.
lemma (in group3) OrderedGroup_ZF_1_L5B:
assumes A1: a≤b and A2: c≤dshows a·c ≤ b·d
proof from A1 A2 have c∈G b∈G using OrderedGroup_ZF_1_L4 by autowith A1 A2 ordGroupAssum have a·c≤ b·c b·c≤b·dusing IsAnOrdGroup_def by auto
then show a·c ≤ b·d by (rule Group_order_transitive)qed

We can replace first of the factors on one side of an inequality with a greaterone.
lemma (in group3) OrderedGroup_ZF_1_L5C:
assumes A1: c∈G and A2: a≤b·c and A3: b≤b1
shows a≤b1 ·c
proof from A1 A3 have b·c ≤ b1 ·cusing OrderedGroup_ZF_1_L3 OrderedGroup_ZF_1_L5B by simp
with A2 show a≤b1 ·c by (rule Group_order_transitive)qed

We can replace second of the factors on one side of an inequality with agreater one.
lemma (in group3) OrderedGroup_ZF_1_L5D:
assumes A1: b∈G and A2: a ≤ b·c and A3: c≤b1
shows a ≤ b·b1
proof from A1 A3 have b·c ≤ b·b1
using OrderedGroup_ZF_1_L3 OrderedGroup_ZF_1_L5B by autowith A2 show a≤b·b1 by (rule Group_order_transitive)qed

We can replace factors on one side of an inequality with greater ones.
lemma (in group3) OrderedGroup_ZF_1_L5E:
assumes A1: a ≤ b·c and A2: b≤b1 c≤c1
shows a ≤ b1 ·c1
proof from A2 have b·c ≤ b1 ·c1 using OrderedGroup_ZF_1_L5B
by simpwith A1 show a≤b1 ·c1 by (rule Group_order_transitive)qed

We don’t decrease an element of the group by multiplying by one that isnonnegative.
318

lemma (in group3) OrderedGroup_ZF_1_L5F:
assumes A1: 1≤a and A2: b∈Gshows b≤a·b b≤b·a
proof from ordGroupAssum A1 A2 have
1·b≤a·b b·1≤b·ausing IsAnOrdGroup_def by autowith A2 show b≤a·b b≤b·ausing OrderedGroup_ZF_1_L1 group0.group0_2_L2
by autoqed

We can multiply the right hand side of an inequality by a nonnegative element.
lemma (in group3) OrderedGroup_ZF_1_L5G: assumes A1: a≤band A2: 1≤c shows a≤b·c a≤c·b
proof from A1 A2 have I: b≤b·c and II: b≤c·busing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L5F by autofrom A1 I show a≤b·c by (rule Group_order_transitive)
from A1 II show a≤c·b by (rule Group_order_transitive)qed

We can put two elements on the other side of inequality, changing their sign.
lemma (in group3) OrderedGroup_ZF_1_L5H:
assumes A1: a∈G b∈G and A2: a·b−1 ≤ cshowsa ≤ c·bc−1 ·a ≤ b
proof from A2 have T: c∈G c−1 ∈ Gusing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1
group0.inverse_in_group by autofrom ordGroupAssum A1 A2 have a·b−1 ·b ≤ c·b
using IsAnOrdGroup_def by simp
with A1 show a ≤ c·b
using OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpwith ordGroupAssum A2 T have c−1 ·a ≤ c−1 ·(c·b)
using IsAnOrdGroup_def by simp
with A1 T show c−1 ·a ≤ busing OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpqed

We can multiply the sides of one inequality by inverse of another.
lemma (in group3) OrderedGroup_ZF_1_L5I:
assumes a≤b and c≤dshows a·d−1 ≤ b·c−1

319

using assms OrderedGroup_ZF_1_L5 OrderedGroup_ZF_1_L5B
by simp

We can put an element on the other side of an inequality changing its sign,version with the inverse.
lemma (in group3) OrderedGroup_ZF_1_L5J:
assumes A1: a∈G b∈G and A2: c ≤ a·b−1
shows c·b ≤ a
proof from ordGroupAssum A1 A2 have c·b ≤ a·b−1 ·busing IsAnOrdGroup_def by simp
with A1 show c·b ≤ ausing OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpqed

We can put an element on the other side of an inequality changing its sign,version with the inverse.
lemma (in group3) OrderedGroup_ZF_1_L5JA:
assumes A1: a∈G b∈G and A2: c ≤ a−1 ·bshows a·c≤ b
proof from ordGroupAssum A1 A2 have a·c ≤ a·(a−1 ·b)
using IsAnOrdGroup_def by simp
with A1 show a·c≤ busing OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpqed

A special case of OrderedGroup_ZF_1_L5J where c = 1.
corollary (in group3) OrderedGroup_ZF_1_L5K:
assumes A1: a∈G b∈G and A2: 1 ≤ a·b−1
shows b ≤ a
proof from A1 A2 have 1·b ≤ ausing OrderedGroup_ZF_1_L5J by simp
with A1 show b ≤ ausing OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpqed

A special case of OrderedGroup_ZF_1_L5JA where c = 1.
corollary (in group3) OrderedGroup_ZF_1_L5KA:
assumes A1: a∈G b∈G and A2: 1 ≤ a−1 ·bshows a ≤ b
proof from A1 A2 have a·1 ≤ busing OrderedGroup_ZF_1_L5JA by simp

320

with A1 show a ≤ busing OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpqed

If the order is total, the elements that do not belong to the positive set are
negative. We also show here that the group inverse of an element that does
not belong to the nonnegative set does belong to the nonnegative set.
lemma (in group3) OrderedGroup_ZF_1_L6:
assumes A1: r {is total on} G and A2: a∈G-G+
shows a≤1 a−1 ∈ G+ restrict(GroupInv(G,P),G-G+ )(a) ∈ G+
proof from A2 have T1: a∈G a∈G/ + 1∈G
using OrderedGroup_ZF_1_L1 group0.group0_2_L2 by autowith A1 show a≤1 using OrderedGroup_ZF_1_L2 IsTotal_def
by autothen show a−1 ∈ G+ using OrderedGroup_ZF_1_L5A OrderedGroup_ZF_1_L2
by simpwith A2 show restrict(GroupInv(G,P),G-G+ )(a) ∈ G+
using restrict by simp
qed

If a property is invariant with respect to taking the inverse and it is true on
the nonnegative set, than it is true on the whole group.
lemma (in group3) OrderedGroup_ZF_1_L7:
assumes A1: r {is total on} G
and A2: ∀ a∈G+ .∀ b∈G+ . Q(a,b)
and A3: ∀ a∈G.∀ b∈G. Q(a,b)−→Q(a−1 ,b)and A4: ∀ a∈G.∀ b∈G. Q(a,b)−→Q(a,b−1 )and A5: a∈G b∈Gshows Q(a,b)
proof { assume A6: a∈G+ have Q(a,b)
proof { assume b∈G+
with A6 A2 have Q(a,b) by simp }moreover{ assume b∈G/ +with A1 A2 A4 A5 A6 have Q(a,(b−1 )−1 )using OrderedGroup_ZF_1_L6 OrderedGroup_ZF_1_L1 group0.inverse_in_groupby simpwith A5 have Q(a,b) using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simp }
ultimately show Q(a,b) by autoqed }
moreover{ assume a∈G/ +with A1 A5 have T1: a−1 ∈ G+ using OrderedGroup_ZF_1_L6 by simp
have Q(a,b)

321

proof { assume b∈G+
with A2 A3 A5 T1 have Q((a−1 )−1 ,b)using OrderedGroup_ZF_1_L1 group0.inverse_in_group by simp
with A5 have Q(a,b) using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simp }moreover{ assume b∈G/ +with A1 A2 A3 A4 A5 T1 have Q((a−1 )−1 ,(b−1 )−1 )using OrderedGroup_ZF_1_L6 OrderedGroup_ZF_1_L1 group0.inverse_in_groupby simpwith A5 have Q(a,b) using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simp }
ultimately show Q(a,b) by autoqed }
ultimately show Q(a,b) by autoqed

A lemma about splitting the ordered group ”plane” into 6 subsets. Usefulfor proofs by cases.
lemma (in group3) OrdGroup_6cases: assumes A1: r {is total on} G
and A2: a∈G b∈Gshows
1≤a ∧ 1≤b ∨ a≤1 ∧ b≤1 ∨a≤1 ∧ 1≤b ∧ 1 ≤ a·b ∨ a≤1 ∧ 1≤b ∧ a·b ≤ 1 ∨1≤a ∧ b≤1 ∧ 1 ≤ a·b ∨ 1≤a ∧ b≤1 ∧ a·b ≤ 1
proof from A1 A2 have1≤a ∨ a≤11≤b ∨ b≤1
1 ≤ a·b ∨ a·b ≤ 1
using OrderedGroup_ZF_1_L1 group0.group_op_closed group0.group0_2_L2
IsTotal_def by auto
then show thesis by autoqed

The next lemma shows what happens when one element of a totally orderedgroup is not greater or equal than another.
lemma (in group3) OrderedGroup_ZF_1_L8:
assumes A1: r {is total on} G
and A2: a∈G b∈G
and A3: ¬(a≤b)
shows b ≤ a a−1 ≤ b−1 a6=b b<a
proof from A1 A2 A3 show I: b ≤ a using IsTotal_def
by autothen show a−1 ≤ b−1 using OrderedGroup_ZF_1_L5 by simp
from A2 have a ≤ a using OrderedGroup_ZF_1_L3 by simp

322

with I A3 show a6=bqed

b < a by auto

If one element is greater or equal and not equal to another, then it is not
smaller or equal.
lemma (in group3) OrderedGroup_ZF_1_L8AA:
assumes A1: a≤b and A2: a6=bshows ¬(b≤a)
proof { note A1
moreover assume b≤aultimately have a=b by (rule group_order_antisym)with A2 have False by simp
} thus ¬(b≤a) by autoqed

A special case of OrderedGroup_ZF_1_L8 when one of the elements is the unit.
corollary (in group3) OrderedGroup_ZF_1_L8A:
assumes A1: r {is total on} G
and A2: a∈G and A3: ¬(1≤a)
shows 1 ≤ a−1 16=a a≤1
proof from A1 A2 A3 have I:
r {is total on} G
1∈G a∈G¬(1≤a)
using OrderedGroup_ZF_1_L1 group0.group0_2_L2
by autothen have 1−1 ≤ a−1
by (rule OrderedGroup_ZF_1_L8)
then show 1 ≤ a−1
using OrderedGroup_ZF_1_L1 group0.group_inv_of_one by simp
from I show 16=a by (rule OrderedGroup_ZF_1_L8)
from A1 I show a≤1 using IsTotal_def
by autoqed

A negative element can not be nonnegative.
lemma (in group3) OrderedGroup_ZF_1_L8B:
assumes A1: a≤1 and A2: a6=1 shows ¬(1≤a)
proof { assume 1≤awith A1 have a=1 using group_order_antisym
by autowith A2 have False by simp
} thus thesis by autoqed

An element is greater or equal than another iff the difference is nonpositive.
323

lemma (in group3) OrderedGroup_ZF_1_L9:
assumes A1: a∈G b∈Gshows a≤b ←→ a·b−1 ≤ 1
proofassume a ≤ bwith ordGroupAssum A1 have a·b−1 ≤ b·b−1
using OrderedGroup_ZF_1_L1 group0.inverse_in_group
IsAnOrdGroup_def by simp
with A1 show a·b−1 ≤ 1
using OrderedGroup_ZF_1_L1 group0.group0_2_L6
by simpnext assume A2: a·b−1 ≤ 1with ordGroupAssum A1 have a·b−1 ·b ≤ 1·b
using IsAnOrdGroup_def by simp
with A1 show a ≤ busing OrderedGroup_ZF_1_L1
group0.inv_cancel_two group0.group0_2_L2
by simpqed

We can move an element to the other side of an inequality.
lemma (in group3) OrderedGroup_ZF_1_L9A:
assumes A1: a∈G b∈G c∈Gshows a·b ≤ c ←→ a ≤ c·b−1
proof
assume a·b ≤ cwith ordGroupAssum A1 have a·b·b−1 ≤ c·b−1
using OrderedGroup_ZF_1_L1 group0.inverse_in_group IsAnOrdGroup_def
by simpwith A1 show a ≤ c·b−1
using OrderedGroup_ZF_1_L1 group0.inv_cancel_two by simp
next assume a ≤ c·b−1
with ordGroupAssum A1 have a·b ≤ c·b−1 ·busing OrderedGroup_ZF_1_L1 group0.inverse_in_group IsAnOrdGroup_def
by simpwith A1 show a·b ≤ cusing OrderedGroup_ZF_1_L1 group0.inv_cancel_two by simpqed

A one side version of the previous lemma with weaker assuptions.
lemma (in group3) OrderedGroup_ZF_1_L9B:
assumes A1: a∈G b∈G and A2: a·b−1 ≤ cshows a ≤ c·b
proof from A1 A2 have a∈G b−1 ∈G c∈Gusing OrderedGroup_ZF_1_L1 group0.inverse_in_group
OrderedGroup_ZF_1_L4 by autowith A1 A2 show a ≤ c·b
using OrderedGroup_ZF_1_L9A OrderedGroup_ZF_1_L1

324

group0.group_inv_of_inv by simpqed

We can put en element on the other side of inequality, changing its sign.
lemma (in group3) OrderedGroup_ZF_1_L9C:
assumes A1: a∈G b∈G and A2: c≤a·bshows
c·b−1 ≤ aa−1 ·c ≤ bproof from ordGroupAssum A1 A2 havec·b−1 ≤ a·b·b−1
a−1 ·c ≤ a−1 ·(a·b)
using OrderedGroup_ZF_1_L1 group0.inverse_in_group IsAnOrdGroup_def
by autowith A1 showc·b−1 ≤ aa−1 ·c ≤ busing OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by autoqed

If an element is greater or equal than another then the difference is nonnegative.
lemma (in group3) OrderedGroup_ZF_1_L9D: assumes A1: a≤bshows 1 ≤ b·a−1
proof from A1 have T: a∈G b∈G
a−1 ∈ G
using OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1
group0.inverse_in_group by autowith ordGroupAssum A1 have a·a−1 ≤ b·a−1
using IsAnOrdGroup_def by simp
with T show 1 ≤ b·a−1
using OrderedGroup_ZF_1_L1 group0.group0_2_L6
by simpqed

If an element is greater than another then the difference is positive.
lemma (in group3) OrderedGroup_ZF_1_L9E:
assumes A1: a≤b a6=bshows 1 ≤ b·a−1 1 6= b·a−1 b·a−1 ∈ G+
proof from A1 have T: a∈G b∈G using OrderedGroup_ZF_1_L4
by autofrom A1 show I: 1 ≤ b·a−1 using OrderedGroup_ZF_1_L9D
by simp{ assume b·a−1 = 1
with T have a=b
using OrderedGroup_ZF_1_L1 group0.group0_2_L11A

325

by auto
with A1 have False by simp
} then show 1 6= b·a−1 by auto
then have b·a−1 6= 1 by autowith I show b·a−1 ∈ G+ using OrderedGroup_ZF_1_L2A
by simpqed

If the difference is nonnegative, then a ≤ b.
lemma (in group3) OrderedGroup_ZF_1_L9F:
assumes A1: a∈G b∈G and A2: 1 ≤ b·a−1
shows a≤b
proof from A1 A2 have 1·a ≤ busing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L9A
by simpwith A1 show a≤busing OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpqed

If we increase the middle term in a product, the whole product increases.
lemma (in group3) OrderedGroup_ZF_1_L10:
assumes a∈G b∈G and c≤dshows a·c·b ≤ a·d·b
using ordGroupAssum assms IsAnOrdGroup_def by simp

A product of (strictly) positive elements is not the unit.
lemma (in group3) OrderedGroup_ZF_1_L11:
assumes A1: 1≤a 1≤b
and A2: 1 6= a 1 6= b
shows 1 6= a·b
proof from A1 have T1: a∈G b∈Gusing OrderedGroup_ZF_1_L4 by auto
{ assume 1 = a·b
with A1 T1 have a≤1 1≤ausing OrderedGroup_ZF_1_L1 group0.group0_2_L9 OrderedGroup_ZF_1_L5AA
by autothen have a = 1 by (rule group_order_antisym)with A2 have False by simp
} then show 1 6= a·b by autoqed

A product of nonnegative elements is nonnegative.
lemma (in group3) OrderedGroup_ZF_1_L12:
assumes A1: 1 ≤ a 1 ≤ b

326

shows 1 ≤ a·b
proof from A1 have 1·1 ≤ a·b
using OrderedGroup_ZF_1_L5B by simp
then show 1 ≤ a·b
using OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpqed

If a is not greater than b, then 1 is not greater than b · a−1 .
lemma (in group3) OrderedGroup_ZF_1_L12A:
assumes A1: a≤b shows 1 ≤ b·a−1
proof from A1 have T: 1 ∈ G a∈G b∈Gusing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1 group0.group0_2_L2
by autowith A1 have 1·a ≤ busing OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpwith T show 1 ≤ b·a−1 using OrderedGroup_ZF_1_L9A
by simpqed

We can move an element to the other side of a strict inequality.
lemma (in group3) OrderedGroup_ZF_1_L12B:
assumes A1: a∈G b∈G and A2: a·b−1 < cshows a < c·b
proof from A1 A2 have a·b−1 ·b < c·busing group_strict_ord_transl_inv by auto
moreover from A1 have a·b−1 ·b = ausing OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpultimately show a < c·bby autoqed

We can multiply the sides of two inequalities, first of them strict and we geta strict inequality.
lemma (in group3) OrderedGroup_ZF_1_L12C:
assumes A1: a<b and A2: c≤dshows a·c < b·dproof from A1 A2 have T: a∈G b∈G c∈G d∈Gusing OrderedGroup_ZF_1_L4 by autowith ordGroupAssum A2 have a·c ≤ a·dusing IsAnOrdGroup_def by simp
moreover from A1 T have a·d < b·dusing group_strict_ord_transl_inv by simp

327

ultimately show a·c < b·dby (rule group_strict_ord_transit)qed

We can multiply the sides of two inequalities, second of them strict and we
get a strict inequality.
lemma (in group3) OrderedGroup_ZF_1_L12D:
assumes A1: a≤b and A2: c<dshows a·c < b·dproof from A1 A2 have T: a∈G b∈G c∈G d∈Gusing OrderedGroup_ZF_1_L4 by autowith A2 have a·c < a·dusing group_strict_ord_transl_inv by simp
moreover from ordGroupAssum A1 T have a·d ≤ b·dusing IsAnOrdGroup_def by simp
ultimately show a·c < b·dby (rule OrderedGroup_ZF_1_L4A)
qed

32.3

The set of positive elements

In this section we study G+ - the set of elements that are (strictly) greaterthan the unit. The most important result is that every linearly orderedgroup can decomposed into {1}, G+ and the set of those elements a ∈ Gsuch that a−1 ∈G+ . Another property of linearly ordered groups that weprove here is that if G+ 6= ∅, then it is infinite. This allows to show that
nontrivial linearly ordered groups are infinite.
The positive set is closed under the group operation.
lemma (in group3) OrderedGroup_ZF_1_L13: shows G+ {is closed under}P
proof { fix a b assume a∈G+ b∈G+then have T1: 1 ≤ a·b
and 1 6= a·busing PositiveSet_def OrderedGroup_ZF_1_L11 OrderedGroup_ZF_1_L12
by automoreover from T1 have a·b ∈ Gusing OrderedGroup_ZF_1_L4 by simp
ultimately have a·b ∈ G+ using PositiveSet_def by simp
} then show G+ {is closed under} P using IsOpClosed_def
by simpqed

For totally ordered groups every nonunit element is positive or its inverse ispositive.
lemma (in group3) OrderedGroup_ZF_1_L14:
assumes A1: r {is total on} G and A2: a∈G

328

shows a=1 ∨ a∈G+ ∨ a−1 ∈G+
proof { assume A3: a6=1
moreover from A1 A2 have a≤1 ∨ 1≤ausing IsTotal_def OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpmoreover from A3 A2 have T1: a−1 6= 1
using OrderedGroup_ZF_1_L1 group0.group0_2_L8B
by simpultimately have a−1 ∈G+ ∨ a∈G+using OrderedGroup_ZF_1_L5A OrderedGroup_ZF_1_L2A
by auto} thus a=1 ∨ a∈G+ ∨ a−1 ∈G+ by autoqed

If an element belongs to the positive set, then it is not the unit and its
inverse does not belong to the positive set.
lemma (in group3) OrderedGroup_ZF_1_L15:
assumes A1: a∈G+ shows a6=1 a−1 ∈G/ +proof from A1 show T1: a6=1 using PositiveSet_def by auto
{ assume a−1 ∈ G+
with A1 have a≤1 1≤ausing OrderedGroup_ZF_1_L5AA PositiveSet_def by auto
then have a=1 by (rule group_order_antisym)with T1 have False by simp
} then show a−1 ∈G/ + by autoqed

If a−1 is positive, then a can not be positive or the unit.
lemma (in group3) OrderedGroup_ZF_1_L16:
assumes A1: a∈G and A2: a−1 ∈G+ shows a6=1 a∈G/ +proof from A2 have a−1 6=1 (a−1 )−1 ∈/ G+using OrderedGroup_ZF_1_L15 by autowith A1 show a6=1 a∈G/ +using OrderedGroup_ZF_1_L1 group0.group0_2_L8C group0.group_inv_of_inv
by autoqed

For linearly ordered groups each element is either the unit, positive or its
inverse is positive.
lemma (in group3) OrdGroup_decomp:assumes A1: r {is total on} G and A2: a∈Gshows Exactly_1_of_3_holds (a=1,a∈G+ ,a−1 ∈G+ )proof from A1 A2 have a=1 ∨ a∈G+ ∨ a−1 ∈G+

329

using OrderedGroup_ZF_1_L14 by simp
moreover from A2 have a=1 −→ (a∈G
/ + ∧ a−1 ∈G/ +)using OrderedGroup_ZF_1_L1 group0.group_inv_of_one
PositiveSet_def by simp
moreover from A2 have a∈G+ −→ (a6=1 ∧ a−1 ∈G/ +)using OrderedGroup_ZF_1_L15 by simp
moreover from A2 have a−1 ∈G+ −→ (a6=1 ∧ a∈G/ +)using OrderedGroup_ZF_1_L16 by simp
ultimately show Exactly_1_of_3_holds (a=1,a∈G+ ,a−1 ∈G+ )by (rule Fol1_L5)
qed

A if a is a nonunit element that is not positive, then a−1 is is positive. Thisis useful for some proofs by cases.
lemma (in group3) OrdGroup_cases:
assumes A1: r {is total on} G and A2: a∈G
and A3: a6=1 a∈G/ +shows a−1 ∈ G+
proof from A1 A2 have a=1 ∨ a∈G+ ∨ a−1 ∈G+using OrderedGroup_ZF_1_L14 by simp
with A3 show a−1 ∈ G+ by autoqed

Elements from G \ G+ are not greater that the unit.
lemma (in group3) OrderedGroup_ZF_1_L17:
assumes A1: r {is total on} G and A2: a ∈ G-G+shows a≤1
proof { assume a=1
with A2 have a≤1 using OrderedGroup_ZF_1_L3 by simp }moreover{ assume a6=1
with A1 A2 have a≤1using PositiveSet_def OrderedGroup_ZF_1_L8A
by auto }ultimately show a≤1 by autoqed

The next lemma allows to split proofs that something holds for all a ∈ G
into cases a = 1, a ∈ G+ , −a ∈ G+ .
lemma (in group3) OrderedGroup_ZF_1_L18:
assumes A1: r {is total on} G and A2: b∈G
and A3: Q(1) and A4: ∀ a∈G+ . Q(a) and A5: ∀ a∈G+ . Q(a−1 )shows Q(b)proof from A1 A2 A3 A4 A5 have Q(b) ∨ Q((b−1 )−1 )using OrderedGroup_ZF_1_L14 by auto

330with A2 show Q(b) using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simpqed

All elements greater or equal than an element of G+ belong to G+ .
lemma (in group3) OrderedGroup_ZF_1_L19:
assumes A1: a ∈ G+ and A2: a≤bshows b ∈ G+
proof from A1 have I: 1≤a and II: a6=1
using OrderedGroup_ZF_1_L2A by autofrom I A2 have 1≤b by (rule Group_order_transitive)
moreover have b6=1
proof { assume b=1
with I A2 have 1≤a a≤1
by autothen have 1=a by (rule group_order_antisym)with II have False by simp
} then show b6=1 by autoqed
ultimately show b ∈ G+
using OrderedGroup_ZF_1_L2A by simp
qed

The inverse of an element of G+ cannot be in G+ .
lemma (in group3) OrderedGroup_ZF_1_L20:
assumes A1: r {is total on} G and A2: a ∈ G+
shows a−1 ∈/ G+proof from A2 have a∈G using PositiveSet_def
by simpwith A1 have Exactly_1_of_3_holds (a=1,a∈G+ ,a−1 ∈G+ )using OrdGroup_decomp by simp
with A2 show a−1 ∈/ G+ by (rule Fol1_L7)
qed

The set of positive elements of a nontrivial linearly ordered group is not
empty.
lemma (in group3) OrderedGroup_ZF_1_L21:
assumes A1: r {is total on} G and A2: G 6= {1}shows G+ 6= 0
proof have 1 ∈ G using OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpwith A2 obtain a where a∈G a6=1 by autowith A1 have a∈G+ ∨ a−1 ∈G+using OrderedGroup_ZF_1_L14 by auto
then show G+ 6= 0 by auto

331

qed

If b ∈G+ , then a < a · b. Multiplying a by a positive elemnt increases a.
lemma (in group3) OrderedGroup_ZF_1_L22:
assumes A1: a∈G b∈G+shows a≤a·b a 6= a·b a·b ∈ G
proof from ordGroupAssum A1 have a·1 ≤ a·b
using OrderedGroup_ZF_1_L2A IsAnOrdGroup_def
by simpwith A1 show a≤a·b
using OrderedGroup_ZF_1_L1 group0.group0_2_L2
by simpthen show a·b ∈ Gusing OrderedGroup_ZF_1_L4 by simp
{ from A1 have a∈G b∈Gusing PositiveSet_def by auto
moreover assume a = a·b
ultimately have b = 1
using OrderedGroup_ZF_1_L1 group0.group0_2_L7
by simpwith A1 have False using PositiveSet_def
by simp} then show a 6= a·b by autoqed

If G is a nontrivial linearly ordered hroup, then for every element of G we
can find one in G+ that is greater or equal.
lemma (in group3) OrderedGroup_ZF_1_L23:
assumes A1: r {is total on} G and A2: G 6= {1}and A3: a∈Gshows ∃ b∈G+ . a≤b
proof { assume A4: a∈G+ then have a≤ausing PositiveSet_def OrderedGroup_ZF_1_L3
by simpwith A4 have ∃ b∈G+ . a≤b by auto }moreover{ assume a∈G/ +with A1 A3 have I: a≤1 using OrderedGroup_ZF_1_L17
by simpfrom A1 A2 obtain b where II: b∈G+using OrderedGroup_ZF_1_L21 by auto
then have 1≤b using PositiveSet_def by simp
with I have a≤b by (rule Group_order_transitive)
with II have ∃ b∈G+ . a≤b by auto }
ultimately show thesis by auto
qed

332

The G+ is G+ plus the unit.
lemma (in group3) OrderedGroup_ZF_1_L24: shows G+ = G+ ∪{1}
using OrderedGroup_ZF_1_L2 OrderedGroup_ZF_1_L2A OrderedGroup_ZF_1_L3A
by auto

What is −G+ , really?
lemma (in group3) OrderedGroup_ZF_1_L25: shows(-G+ ) = {a−1 . a∈G+ }(-G+ ) ⊆ G
proof from ordGroupAssum have I: GroupInv(G,P) : G→Gusing IsAnOrdGroup_def group0_2_T2 by simp
moreover have G+ ⊆ G using PositiveSet_def by auto
ultimately show(-G+ ) = {a−1 . a∈G+ }(-G+ ) ⊆ G
using func_imagedef func1_1_L6 by autoqed

If the inverse of a is in G+ , then a is in the inverse of G+ .
lemma (in group3) OrderedGroup_ZF_1_L26:
assumes A1: a∈G and A2: a−1 ∈ G+
shows a ∈ (-G+ )proof from A1 have a−1 ∈ G a = (a−1 )−1 using OrderedGroup_ZF_1_L1
group0.inverse_in_group group0.group_inv_of_inv
by autowith A2 show a ∈ (-G+ ) using OrderedGroup_ZF_1_L25
by autoqed

If a is in the inverse of G+ , then its inverse is in G+ .
lemma (in group3) OrderedGroup_ZF_1_L27:
assumes a ∈ (-G+ )shows a−1 ∈ G+
using assms OrderedGroup_ZF_1_L25 PositiveSet_def
OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by autoA linearly ordered group can be decomposed into G+ , {1} and −G+lemma (in group3) OrdGroup_decomp2:
assumes A1: r {is total on} G
shows
G = G+ ∪ (-G+ )∪ {1}G+ ∩(-G+ ) = 0
1 ∈/ G+ ∪(-G+ )proof { fix a assume A2: a∈G

333

with A1 have a∈G+ ∨ a−1 ∈G+ ∨ a=1
using OrderedGroup_ZF_1_L14 by autowith A2 have a∈G+ ∨ a∈(-G+ ) ∨ a=1
using OrderedGroup_ZF_1_L26 by auto
then have a ∈ (G+ ∪ (-G+ )∪ {1})by auto} then have G ⊆ G+ ∪ (-G+ )∪ {1}by automoreover have G+ ∪ (-G+ )∪ {1} ⊆ Gusing OrderedGroup_ZF_1_L25 PositiveSet_def
OrderedGroup_ZF_1_L1 group0.group0_2_L2
by autoultimately show G = G+ ∪ (-G+ )∪ {1} by auto
{ let A = G+ ∩(-G+ )assume G+ ∩(-G+ ) 6= 0
then have A6=0 by simp
then obtain a where a∈A by blast
then have False using OrderedGroup_ZF_1_L15 OrderedGroup_ZF_1_L27
by auto} then show G+ ∩(-G+ ) = 0 by autoshow 1 ∈/ G+ ∪(-G+ )using OrderedGroup_ZF_1_L27
OrderedGroup_ZF_1_L1 group0.group_inv_of_one
OrderedGroup_ZF_1_L2A by autoqed

If a · b−1 is nonnegative, then b ≤ a. This maybe used to recover the orderfrom the set of nonnegative elements and serve as a way to define order byprescibing that set (see the ”Alternative definitions” section).
lemma (in group3) OrderedGroup_ZF_1_L28:
assumes A1: a∈G b∈G and A2: a·b−1 ∈ G+
shows b≤a
proof from A2 have 1 ≤ a·b−1 using OrderedGroup_ZF_1_L2
by simpwith A1 show b≤a using OrderedGroup_ZF_1_L5K
by simpqed

A special case of OrderedGroup_ZF_1_L28 when a · b−1 is positive.
corollary (in group3) OrderedGroup_ZF_1_L29:
assumes A1: a∈G b∈G and A2: a·b−1 ∈ G+
shows b≤a b6=aproof from A2 have 1 ≤ a·b−1 and I: a·b−1 6= 1
using OrderedGroup_ZF_1_L2A by autowith A1 show b≤a using OrderedGroup_ZF_1_L5K
by simpfrom A1 I show b6=a334

using OrderedGroup_ZF_1_L1 group0.group0_2_L6
by autoqed

A bit stronger that OrderedGroup_ZF_1_L29, adds case when two elements
are equal.
lemma (in group3) OrderedGroup_ZF_1_L30:
assumes a∈G b∈G and a=b ∨ b·a−1 ∈ G+
shows a≤busing assms OrderedGroup_ZF_1_L3 OrderedGroup_ZF_1_L29
by autoA different take on decomposition: we can have a = b or a < b or b < a.
lemma (in group3) OrderedGroup_ZF_1_L31:
assumes A1: r {is total on} G and A2: a∈G b∈Gshows a=b ∨ (a≤b ∧ a6=b) ∨ (b≤a ∧ b6=a)proof from A2 have a·b−1 ∈ G using OrderedGroup_ZF_1_L1
group0.inverse_in_group group0.group_op_closed
by simpwith A1 have a·b−1 = 1 ∨ a·b−1 ∈ G+ ∨ (a·b−1 )−1 ∈ G+
using OrderedGroup_ZF_1_L14 by simp
moreover{ assume a·b−1 = 1
then have a·b−1 ·b = 1·b by simp
with A2 have a=b ∨ (a≤b ∧ a6=b) ∨ (b≤a ∧ b6=a)using OrderedGroup_ZF_1_L1
group0.inv_cancel_two group0.group0_2_L2 by auto }moreover{ assume a·b−1 ∈ G+
with A2 have a=b ∨ (a≤b ∧ a6=b) ∨ (b≤a ∧ b6=a)using OrderedGroup_ZF_1_L29 by auto }moreover{ assume (a·b−1 )−1 ∈ G+
with A2 have b·a−1 ∈ G+ using OrderedGroup_ZF_1_L1
group0.group0_2_L12 by simp
with A2 have a=b ∨ (a≤b ∧ a6=b) ∨ (b≤a ∧ b6=a)using OrderedGroup_ZF_1_L29 by auto }
ultimately show a=b ∨ (a≤b ∧ a6=b) ∨ (b≤a ∧ b6=a)
by autoqed

32.4

Intervals and bounded sets

Intervals here are the closed intervals of the form {x ∈ G.a ≤ x ≤ b}.
A bounded set can be translated to put it in G+ and then it is still bounded
above.

335

lemma (in group3) OrderedGroup_ZF_2_L1:
assumes A1: ∀ g∈A. L≤g ∧ g≤M
and A2: S = RightTranslation(G,P,L−1 )and A3: a ∈ S(A)shows a ≤ M·L−11≤aproof from A3 have A6=0 using func1_1_L13A by fastthen obtain g where g∈A by autowith A1 have T1: L∈G M∈G L−1 ∈Gusing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1
group0.inverse_in_group by autowith A2 have S : G→G using OrderedGroup_ZF_1_L1 group0.group0_5_L1
by simpmoreover from A1 have T2: A⊆G using OrderedGroup_ZF_1_L4 by auto
ultimately have S(A) = {S(b). b∈A} using func_imagedef
by simpwith A3 obtain b where T3: b∈A a = S(b) by autowith A1 ordGroupAssum T1 have b·L−1 ≤M·L−1 L·L−1 ≤b·L−1
using IsAnOrdGroup_def by autowith T3 A2 T1 T2 show a≤M·L−1 1≤ausing OrderedGroup_ZF_1_L1 group0.group0_5_L2 group0.group0_2_L6
by autoqed

Every bounded set is an image of a subset of an interval that starts at 1.
lemma (in group3) OrderedGroup_ZF_2_L2:
assumes A1: IsBounded(A,r)
shows ∃ B.∃ g∈G+ .∃ T∈G→G. A = T(B) ∧ B ⊆ Interval(r,1,g)
proof { assume A2: A=0
let B = 0
let g = 1
let T = ConstantFunction(G,1)
have g∈G+ using OrderedGroup_ZF_1_L3A by simp
moreover have T : G→Gusing func1_3_L1 OrderedGroup_ZF_1_L1 group0.group0_2_L2 by simp
moreover from A2 have A = T(B) by simp
moreover have B ⊆ Interval(r,1,g) by simp
ultimately have
∃ B.∃ g∈G+ .∃ T∈G→G. A = T(B) ∧ B ⊆ Interval(r,1,g)
by auto }moreover{ assume A3: A6=0
with A1 have ∃ L. ∀ x∈A. L≤x and ∃ U. ∀ x∈A. x≤Uusing IsBounded_def IsBoundedBelow_def IsBoundedAbove_def
by autothen obtain L U where D1: ∀ x∈A. L≤x ∧ x≤U
by autowith A3 have T1: A⊆G using OrderedGroup_ZF_1_L4 by auto

336

from A3 obtain a where a∈A by autowith D1 have T2: L≤a a≤U by auto
then have T3: L∈G L−1 ∈ G U∈Gusing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1
group0.inverse_in_group by auto
let T = RightTranslation(G,P,L)
let B = RightTranslation(G,P,L−1 )(A)
let g = U·L−1
have g∈G+
proof from T2 have L≤U using Group_order_transitive by fastwith ordGroupAssum T3 have L·L−1 ≤gusing IsAnOrdGroup_def by simp
with T3 show thesis using OrderedGroup_ZF_1_L1 group0.group0_2_L6
OrderedGroup_ZF_1_L2 by simp
qed
moreover from T3 have T : G→Gusing OrderedGroup_ZF_1_L1 group0.group0_5_L1
by simpmoreover have A = T(B)proof from T3 T1 have T(B) = {a·L−1 ·L. a∈A}
using OrderedGroup_ZF_1_L1 group0.group0_5_L6
by simpmoreover from T3 T1 have ∀ a∈A. a·L−1 ·L = a·(L−1 ·L)
using OrderedGroup_ZF_1_L1 group0.group_oper_assoc by auto
ultimately have T(B) = {a·(L−1 ·L). a∈A} by simp
with T3 have T(B) = {a·1. a∈A}
using OrderedGroup_ZF_1_L1 group0.group0_2_L6 by simp
moreover from T1 have ∀ a∈A. a·1=ausing OrderedGroup_ZF_1_L1 group0.group0_2_L2 by auto
ultimately show thesis by simp
qed
moreover have B ⊆ Interval(r,1,g)
proof
fix y assume A4: y ∈ B
let S = RightTranslation(G,P,L−1 )from D1 have T4: ∀ x∈A. L≤x ∧ x≤U by simp
moreover have T5: S = RightTranslation(G,P,L−1 )by simpmoreover from A4 have T6: y ∈ S(A) by simp
ultimately have y≤U·L−1 using OrderedGroup_ZF_2_L1
by blast
moreover from T4 T5 T6 have 1≤y by (rule OrderedGroup_ZF_2_L1)
ultimately show y ∈ Interval(r,1,g) using Interval_def by autoqed
ultimately have
∃ B.∃ g∈G+ .∃ T∈G→G. A = T(B) ∧ B ⊆ Interval(r,1,g)
by auto }337

ultimately show thesis by autoqed

If every interval starting at 1 is finite, then every bounded set is finite. I
find it interesting that this does not require the group to be linearly ordered(the order to be total).
theorem (in group3) OrderedGroup_ZF_2_T1:
assumes A1: ∀ g∈G+ . Interval(r,1,g) ∈ Fin(G)and A2: IsBounded(A,r)
shows A ∈ Fin(G)proof from A2 have
∃ B.∃ g∈G+ .∃ T∈G→G. A = T(B) ∧ B ⊆ Interval(r,1,g)
using OrderedGroup_ZF_2_L2 by simp
then obtain B g T where D1: g∈G+ B ⊆ Interval(r,1,g)
and D2: T : G→G A = T(B) by autofrom D1 A1 have B∈Fin(G) using Fin_subset_lemma by blast
with D2 show thesis using Finite1_L6A by simp
qed

In linearly ordered groups finite sets are bounded.
theorem (in group3) ord_group_fin_bounded:assumes r {is total on} G and B∈Fin(G)shows IsBounded(B,r)
using ordGroupAssum assms IsAnOrdGroup_def IsPartOrder_def Finite_ZF_1_T1
by simp

For nontrivial linearly ordered groups if for every element G we can find one
in A that is greater or equal (not necessarily strictly greater), then A canneither be finite nor bounded above.
lemma (in group3) OrderedGroup_ZF_2_L2A:
assumes A1: r {is total on} G and A2: G 6= {1}and A3: ∀ a∈G. ∃ b∈A. a≤b
shows∀ a∈G. ∃ b∈A. a6=b ∧ a≤b¬IsBoundedAbove(A,r)
A ∈/ Fin(G)proof { fix afrom A1 A2 obtain c where c ∈ G+
using OrderedGroup_ZF_1_L21 by auto
moreover assume a∈Gultimately havea·c ∈ G and I: a < a·cusing OrderedGroup_ZF_1_L22 by autowith A3 obtain b where II: b∈A and III: a·c ≤ b
by automoreover from I III have a<b by (rule OrderedGroup_ZF_1_L4A)

338

ultimately have ∃ b∈A. a6=b ∧ a≤b by auto
} thus ∀ a∈G. ∃ b∈A. a6=b ∧ a≤b by simp
with ordGroupAssum A1 show
¬IsBoundedAbove(A,r)
A ∈/ Fin(G)using IsAnOrdGroup_def IsPartOrder_def
OrderedGroup_ZF_1_L1A Order_ZF_3_L14 Finite_ZF_1_1_L3
by autoqed

Nontrivial linearly ordered groups are infinite. Recall that Fin(A) is thecollection of finite subsets of A. In this lemma we show that G ∈/ Fin(G),that is that G is not a finite subset of itself. This is a way of saying that
G is infinite. We also show that for nontrivial linearly ordered groups G+ isinfinite.
theorem (in group3) Linord_group_infinite:assumes A1: r {is total on} G and A2: G 6= {1}
shows
G+ ∈
/ Fin(G)G ∈/ Fin(G)proof from A1 A2 show I: G+ ∈/ Fin(G)using OrderedGroup_ZF_1_L23 OrderedGroup_ZF_2_L2A
by simp{ assume G ∈ Fin(G)moreover have G+ ⊆ G using PositiveSet_def by auto
ultimately have G+ ∈ Fin(G) using Fin_subset_lemmaby blastwith I have False by simp
} then show G ∈/ Fin(G) by autoqed

A property of nonempty subsets of linearly ordered groups that don’t havea maximum: for any element in such subset we can find one that is strictly
greater.
lemma (in group3) OrderedGroup_ZF_2_L2B:
assumes A1: r {is total on} G and A2: A⊆G andA3: ¬HasAmaximum(r,A) and A4: x∈Ashows ∃ y∈A. x<yproof from ordGroupAssum assms haveantisym(r)r {is total on} GA⊆G ¬HasAmaximum(r,A) x∈Ausing IsAnOrdGroup_def IsPartOrder_def
by autothen have ∃ y∈A. hx,yi ∈ r ∧ y6=xusing Order_ZF_4_L16 by simp339

then show ∃ y∈A. x<y by autoqed

In linearly ordered groups G \ G+ is bounded above.
lemma (in group3) OrderedGroup_ZF_2_L3:
assumes A1: r {is total on} G shows IsBoundedAbove(G-G+ ,r)proof from A1 have ∀ a∈G-G+ . a≤1using OrderedGroup_ZF_1_L17 by simp
then show IsBoundedAbove(G-G+ ,r)using IsBoundedAbove_def by autoqed

In linearly ordered groups if A ∩ G+ is finite, then A is bounded above.
lemma (in group3) OrderedGroup_ZF_2_L4:
assumes A1: r {is total on} G and A2: A⊆G
and A3: A ∩ G+ ∈ Fin(G)shows IsBoundedAbove(A,r)
proof have A ∩ (G-G+ ) ⊆ G-G+ by autowith A1 have IsBoundedAbove(A ∩ (G-G+ ),r)using OrderedGroup_ZF_2_L3 Order_ZF_3_L13
by blast
moreover from A1 A3 have IsBoundedAbove(A ∩ G+ ,r)using ord_group_fin_bounded IsBounded_def
by simpmoreover from A1 ordGroupAssum haver {is total on} G trans(r) r⊆G×G
using IsAnOrdGroup_def IsPartOrder_def by auto
ultimately have IsBoundedAbove(A ∩ (G-G+ ) ∪ A ∩ G+ ,r)using Order_ZF_3_L3 by simp
moreover from A2 have A = A ∩ (G-G+ ) ∪ A ∩ G+
by autoultimately show IsBoundedAbove(A,r) by simp
qed

If a set −A ⊆ G is bounded above, then A is bounded below.
lemma (in group3) OrderedGroup_ZF_2_L5:
assumes A1: A⊆G and A2: IsBoundedAbove(-A,r)shows IsBoundedBelow(A,r)
proof { assume A = 0 then have IsBoundedBelow(A,r)
using IsBoundedBelow_def by auto }moreover{ assume A3: A6=0
from ordGroupAssum have I: GroupInv(G,P) : G→Gusing IsAnOrdGroup_def group0_2_T2 by simp
with A1 A2 A3 obtain u where D: ∀ a∈(-A). a≤uusing func1_1_L15A IsBoundedAbove_def by auto340

{ fix b assume b∈Awith A1 I D have b−1 ≤ u and T: b∈Gusing func_imagedef by auto
then have u−1 ≤(b−1 )−1 using OrderedGroup_ZF_1_L5
by simpwith T have u−1 ≤busing OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simp} then have ∀ b∈A. hu−1 ,bi ∈ r by simp
then have IsBoundedBelow(A,r)
using Order_ZF_3_L9 by blast }ultimately show thesis by autoqed

If a ≤ b, then the image of the interval a..b by any function is nonempty.
lemma (in group3) OrderedGroup_ZF_2_L6:
assumes a≤b and f:G→Gshows f(Interval(r,a,b)) 6= 0
using ordGroupAssum assms OrderedGroup_ZF_1_L4
Order_ZF_2_L6 Order_ZF_2_L2A
IsAnOrdGroup_def IsPartOrder_def func1_1_L15A
by autoend

33

More on ordered groups

theory OrderedGroup_ZF_1 imports OrderedGroup_ZF
begin

In this theory we continue the OrderedGroup_ZF theory development.

33.1

Absolute value and the triangle inequality

The goal of this section is to prove the triangle inequality for ordered groups.
Absolute value maps G into G.
lemma (in group3) OrderedGroup_ZF_3_L1:
shows AbsoluteValue(G,P,r) : G→G
proof let f = id(G+ )let g = restrict(GroupInv(G,P),G-G+ )have f : G+ →G+ using id_type by simp
then have f : G+ →G using OrderedGroup_ZF_1_L4E fun_weaken_typeby blast
moreover have g : G-G+ →G
proof -

341

from ordGroupAssum have GroupInv(G,P) : G→Gusing IsAnOrdGroup_def group0_2_T2 by simp
moreover have G-G+ ⊆ G by auto
ultimately show thesis using restrict_type2 by simp
qed
moreover have G+ ∩(G-G+ ) = 0 by blast
ultimately have f ∪ g : G+ ∪(G-G+ )→G∪G
by (rule fun_disjoint_Un)
moreover have G+ ∪(G-G+ ) = G using OrderedGroup_ZF_1_L4E
by autoultimately show AbsoluteValue(G,P,r) : G→Gusing AbsoluteValue_def by simp
qed

If a ∈ G+ , then |a| = a.
lemma (in group3) OrderedGroup_ZF_3_L2:
assumes A1: a∈G+ shows |a| = a
proof from ordGroupAssum have GroupInv(G,P) : G→Gusing IsAnOrdGroup_def group0_2_T2 by simp
with A1 show thesis using
func1_1_L1 OrderedGroup_ZF_1_L4E fun_disjoint_apply1
AbsoluteValue_def id_conv by simp
qed

The absolute value of the unit is the unit. In the additive totation thatwould be |0| = 0.
lemma (in group3) OrderedGroup_ZF_3_L2A:
shows |1| = 1 using OrderedGroup_ZF_1_L3A OrderedGroup_ZF_3_L2
by simp

If a is positive, then |a| = a.
lemma (in group3) OrderedGroup_ZF_3_L2B:
assumes a∈G+ shows |a| = ausing assms PositiveSet_def Nonnegative_def OrderedGroup_ZF_3_L2
by autoIf a ∈ G \ G+ , then |a| = a−1 .
lemma (in group3) OrderedGroup_ZF_3_L3:
assumes A1: a ∈ G-G+ shows |a| = a−1
proof have domain(id(G+ )) = G+using id_type func1_1_L1 by autowith A1 show thesis using fun_disjoint_apply2 AbsoluteValue_def
restrict by simp
qed

For elements that not greater than the unit, the absolute value is the inverse.
342

lemma (in group3) OrderedGroup_ZF_3_L3A:
assumes A1: a≤1
shows |a| = a−1
proof { assume a=1 then have |a| = a−1
using OrderedGroup_ZF_3_L2A OrderedGroup_ZF_1_L1 group0.group_inv_of_one
by simp }moreover{ assume a6=1
with A1 have |a| = a−1 using OrderedGroup_ZF_1_L4C OrderedGroup_ZF_3_L3
by simp }
ultimately show |a| = a−1 by blastqed

In linearly ordered groups the absolute value of any element is in G+ .
lemma (in group3) OrderedGroup_ZF_3_L3B:
assumes A1: r {is total on} G and A2: a∈Gshows |a| ∈ G+
proof { assume a ∈ G+ then have |a| ∈ G+
using OrderedGroup_ZF_3_L2 by simp }moreover{ assume a ∈/ G+with A1 A2 have |a| ∈ G+ using OrderedGroup_ZF_3_L3
OrderedGroup_ZF_1_L6 by simp }ultimately show |a| ∈ G+ by blast
qed

For linearly ordered groups (where the order is total), the absolute value
maps the group into the positive set.
lemma (in group3) OrderedGroup_ZF_3_L3C:
assumes A1: r {is total on} G
shows AbsoluteValue(G,P,r) : G→G+
proof have AbsoluteValue(G,P,r) : G→G using OrderedGroup_ZF_3_L1
by simpmoreover from A1 have T2:∀ g∈G. AbsoluteValue(G,P,r)(g) ∈ G+
using OrderedGroup_ZF_3_L3B by simp
ultimately show thesis by (rule func1_1_L1A)
qed

If the absolute value is the unit, then the elemnent is the unit.
lemma (in group3) OrderedGroup_ZF_3_L3D:
assumes A1: a∈G and A2: |a| = 1
shows a = 1
proof { assume a ∈ G+
with A2 have a = 1 using OrderedGroup_ZF_3_L2 by simp }343

moreover{ assume a ∈/ G+with A1 A2 have a = 1 using
OrderedGroup_ZF_3_L3 OrderedGroup_ZF_1_L1 group0.group0_2_L8A
by auto }ultimately show a = 1 by blastqed

In linearly ordered groups the unit is not greater than the absolute value ofany element.
lemma (in group3) OrderedGroup_ZF_3_L3E:
assumes r {is total on} G and a∈Gshows 1 ≤ |a|using assms OrderedGroup_ZF_3_L3B OrderedGroup_ZF_1_L2 by simp

If b is greater than both a and a−1 , then b is greater than |a|.
lemma (in group3) OrderedGroup_ZF_3_L4:
assumes A1: a≤b and A2: a−1 ≤ bshows |a|≤ b
proof { assume a∈G+
with A1 have |a|≤ b using OrderedGroup_ZF_3_L2 by simp }moreover{ assume a∈G/ +with A1 A2 have |a|≤ busing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_3_L3 by simp }ultimately show |a|≤ b by blastqed

In linearly ordered groups a ≤ |a|.
lemma (in group3) OrderedGroup_ZF_3_L5:
assumes A1: r {is total on} G and A2: a∈Gshows a ≤ |a|proof { assume a ∈ G+
with A2 have a ≤ |a|using OrderedGroup_ZF_3_L2 OrderedGroup_ZF_1_L3 by simp }moreover{ assume a ∈/ G+with A1 A2 have a ≤ |a|using OrderedGroup_ZF_3_L3B OrderedGroup_ZF_1_L4B by simp }ultimately show a ≤ |a| by blastqed

a−1 ≤ |a| (in additive notation it would be −a ≤ |a|.
lemma (in group3) OrderedGroup_ZF_3_L6:
assumes A1: a∈G shows a−1 ≤ |a|proof -344

{ assume a ∈ G+
then have T1: 1≤a and T2: |a| = a using OrderedGroup_ZF_1_L2
OrderedGroup_ZF_3_L2 by auto
then have a−1 ≤1−1 using OrderedGroup_ZF_1_L5 by simp
then have T3: a−1 ≤1using OrderedGroup_ZF_1_L1 group0.group_inv_of_one by simp
from T3 T1 have a−1 ≤a by (rule Group_order_transitive)
with T2 have a−1 ≤ |a| by simp }moreover{ assume A2: a ∈/ G+from A1 have |a| ∈ Gusing OrderedGroup_ZF_3_L1 apply_funtype by autowith ordGroupAssum have |a| ≤ |a|using IsAnOrdGroup_def IsPartOrder_def refl_def by simp
with A1 A2 have a−1 ≤ |a| using OrderedGroup_ZF_3_L3 by simp }ultimately show a−1 ≤ |a| by blast
qed

Some inequalities about the product of two elements of a linearly orderedgroup and its absolute value.
lemma (in group3) OrderedGroup_ZF_3_L6A:
assumes r {is total on} G and a∈G b∈Gshowsa·b ≤|a|·|b|a·b−1 ≤|a|·|b|a−1 ·b ≤|a|·|b|a−1 ·b−1 ≤|a|·|b|using assms OrderedGroup_ZF_3_L5 OrderedGroup_ZF_3_L6
OrderedGroup_ZF_1_L5B by auto|a−1 | ≤ |a|.
lemma (in group3) OrderedGroup_ZF_3_L7:
assumes r {is total on} G and a∈Gshows |a−1 |≤|a|using assms OrderedGroup_ZF_3_L5 OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
OrderedGroup_ZF_3_L6 OrderedGroup_ZF_3_L4 by simp|a−1 | = |a|.
lemma (in group3) OrderedGroup_ZF_3_L7A:
assumes A1: r {is total on} G and A2: a∈Gshows |a−1 | = |a|proof from A2 have a−1 ∈G using OrderedGroup_ZF_1_L1 group0.inverse_in_groupby simpwith A1 have |(a−1 )−1 | ≤ |a−1 | using OrderedGroup_ZF_3_L7 by simp
with A1 A2 have |a−1 | ≤ |a| |a| ≤ |a−1 |using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv OrderedGroup_ZF_3_L7
by autothen show thesis by (rule group_order_antisym)

345

qed

|a · b−1 | = |b · a−1 |. It doesn’t look so strange in the additive notation:|a − b| = |b − a|.
lemma (in group3) OrderedGroup_ZF_3_L7B:
assumes A1: r {is total on} G and A2: a∈G b∈Gshows |a·b−1 | = |b·a−1 |proof from A1 A2 have |(a·b−1 )−1 | = |a·b−1 | using
OrderedGroup_ZF_1_L1 group0.inverse_in_group group0.group0_2_L1
monoid0.group0_1_L1 OrderedGroup_ZF_3_L7A by simp
moreover from A2 have (a·b−1 )−1 = b·a−1
using OrderedGroup_ZF_1_L1 group0.group0_2_L12 by simp
ultimately show thesis by simp
qed

Triangle inequality for linearly ordered abelian groups. It would be nice todrop commutativity or give an example that shows we can’t do that.
theorem (in group3) OrdGroup_triangle_ineq:
assumes A1: P {is commutative on} G
and A2: r {is total on} G and A3: a∈G b∈Gshows |a·b| ≤ |a|·|b|proof from A1 A2 A3 havea ≤ |a| b ≤ |b| a−1 ≤ |a| b−1 ≤ |b|using OrderedGroup_ZF_3_L5 OrderedGroup_ZF_3_L6 by auto
then have a·b ≤ |a|·|b| a−1 ·b−1 ≤ |a|·|b|using OrderedGroup_ZF_1_L5B by autowith A1 A3 show |a·b| ≤ |a|·|b|using OrderedGroup_ZF_1_L1 group0.group_inv_of_two IsCommutative_def
OrderedGroup_ZF_3_L4 by simpqed

We can multiply the sides of an inequality with absolute value.
lemma (in group3) OrderedGroup_ZF_3_L7C:
assumes A1: P {is commutative on} G
and A2: r {is total on} G and A3: a∈G b∈G
and A4: |a| ≤ c |b| ≤ dshows |a·b| ≤ c·d
proof from A1 A2 A3 A4 have |a·b| ≤ |a|·|b|using OrderedGroup_ZF_1_L4 OrdGroup_triangle_ineq
by simpmoreover from A4 have |a|·|b| ≤ c·dusing OrderedGroup_ZF_1_L5B by simp
ultimately show thesis by (rule Group_order_transitive)
qed

346

A version of the OrderedGroup_ZF_3_L7C but with multiplying by the inverse.
lemma (in group3) OrderedGroup_ZF_3_L7CA:
assumes P {is commutative on} G
and r {is total on} G and a∈G b∈G
and |a| ≤ c |b| ≤ dshows |a·b−1 | ≤ c·dusing assms OrderedGroup_ZF_1_L1 group0.inverse_in_group
OrderedGroup_ZF_3_L7A OrderedGroup_ZF_3_L7C by simp

Triangle inequality with three integers.
lemma (in group3) OrdGroup_triangle_ineq3:
assumes A1: P {is commutative on} G
and A2: r {is total on} G and A3: a∈G b∈G c∈Gshows |a·b·c| ≤ |a|·|b|·|c|proof from A3 have T: a·b ∈ G |c| ∈ Gusing OrderedGroup_ZF_1_L1 group0.group_op_closed
OrderedGroup_ZF_3_L1 apply_funtype by autowith A1 A2 A3 have |a·b·c| ≤ |a·b|·|c|using OrdGroup_triangle_ineq by simp
moreover from ordGroupAssum A1 A2 A3 T have|a·b|·|c| ≤ |a|·|b|·|c|using OrdGroup_triangle_ineq IsAnOrdGroup_def by simp
ultimately show |a·b·c| ≤ |a|·|b|·|c|by (rule Group_order_transitive)
qed

Some variants of the triangle inequality.
lemma (in group3) OrderedGroup_ZF_3_L7D:
assumes A1: P {is commutative on} G
and A2: r {is total on} G and A3: a∈G b∈G
and A4: |a·b−1 | ≤ cshows|a| ≤ c·|b||a| ≤ |b|·cc−1 ·a ≤ b
a·c−1 ≤ ba ≤ b·c
proof from A3 A4 have
T: a·b−1 ∈ G |b| ∈ G c∈G c−1 ∈ Gusing OrderedGroup_ZF_1_L1
group0.inverse_in_group group0.group0_2_L1 monoid0.group0_1_L1
OrderedGroup_ZF_3_L1 apply_funtype OrderedGroup_ZF_1_L4
by autofrom A3 have |a| = |a·b−1 ·b|
using OrderedGroup_ZF_1_L1 group0.inv_cancel_two
by simpwith A1 A2 A3 T have |a| ≤ |a·b−1 |·|b|347

using OrdGroup_triangle_ineq by simp
with T A4 show |a| ≤ c·|b| using OrderedGroup_ZF_1_L5C
by blastwith T A1 show |a| ≤ |b|·cusing IsCommutative_def by simp
from A2 T have a·b−1 ≤ |a·b−1 |using OrderedGroup_ZF_3_L5 by simp
moreover note A4
ultimately have I: a·b−1 ≤ cby (rule Group_order_transitive)
with A3 show c−1 ·a ≤ busing OrderedGroup_ZF_1_L5H by simp
with A1 A3 T show a·c−1 ≤ busing IsCommutative_def by simp
from A1 A3 T I show a ≤ b·cusing OrderedGroup_ZF_1_L5H IsCommutative_def
by autoqed

Some more variants of the triangle inequality.
lemma (in group3) OrderedGroup_ZF_3_L7E:
assumes A1: P {is commutative on} G
and A2: r {is total on} G and A3: a∈G b∈G
and A4: |a·b−1 | ≤ cshows b·c−1 ≤ aproof from A3 have a·b−1 ∈ Gusing OrderedGroup_ZF_1_L1
group0.inverse_in_group group0.group_op_closedby autowith A2 have |(a·b−1 )−1 | = |a·b−1 |using OrderedGroup_ZF_3_L7A by simp
moreover from A3 have (a·b−1 )−1 = b·a−1
using OrderedGroup_ZF_1_L1 group0.group0_2_L12
by simpultimately have |b·a−1 | = |a·b−1 |by simpwith A1 A2 A3 A4 show b·c−1 ≤ ausing OrderedGroup_ZF_3_L7D by simp
qed

An application of the triangle inequality with four group elements.
lemma (in group3) OrderedGroup_ZF_3_L7F:
assumes A1: P {is commutative on} G
and A2: r {is total on} G andA3: a∈G b∈G c∈G d∈Gshows |a·c−1 | ≤ |a·b|·|c·d|·|b·d−1 |proof from A3 have T:348

a·c−1 ∈ G a·b ∈ G c·d ∈ G b·d−1 ∈ G(c·d)−1 ∈ G (b·d−1 )−1 ∈ Gusing OrderedGroup_ZF_1_L1
group0.inverse_in_group group0.group_op_closedby autowith A1 A2 have |(a·b)·(c·d)−1 ·(b·d−1 )−1 | ≤ |a·b|·|(c·d)−1 |·|(b·d−1 )−1 |using OrdGroup_triangle_ineq3 by simp
moreover from A2 T have |(c·d)−1 | =|c·d| and |(b·d−1 )−1 | = |b·d−1 |using OrderedGroup_ZF_3_L7A by auto
moreover from A1 A3 have (a·b)·(c·d)−1 ·(b·d−1 )−1 = a·c−1
using OrderedGroup_ZF_1_L1 group0.group0_4_L8
by simpultimately show |a·c−1 | ≤ |a·b|·|c·d|·|b·d−1 |by simpqed|a| ≤ L implies L−1 ≤ a (it would be −L ≤ a in the additive notation).
lemma (in group3) OrderedGroup_ZF_3_L8:
assumes A1: a∈G and A2: |a|≤Lshows
L−1 ≤aproof from A1 have I: a−1 ≤ |a| using OrderedGroup_ZF_3_L6 by simp
from I A2 have a−1 ≤ L by (rule Group_order_transitive)then have L−1 ≤(a−1 )−1 using OrderedGroup_ZF_1_L5 by simp
with A1 show L−1 ≤a using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simpqed

In linearly ordered groups |a| ≤ L implies a ≤ L (it would be a ≤ L in the
additive notation).
lemma (in group3) OrderedGroup_ZF_3_L8A:
assumes A1: r {is total on} G
and A2: a∈G and A3: |a|≤L
shows
a≤L
1≤L
proof from A1 A2 have I: a ≤ |a| using OrderedGroup_ZF_3_L5 by simp
from I A3 show a≤L by (rule Group_order_transitive)
from A1 A2 A3 have 1 ≤ |a| |a|≤Lusing OrderedGroup_ZF_3_L3B OrderedGroup_ZF_1_L2 by auto
then show 1≤L by (rule Group_order_transitive)qed

A somewhat generalized version of the above lemma.
lemma (in group3) OrderedGroup_ZF_3_L8B:
assumes A1: a∈G and A2: |a|≤L and A3: 1≤cshows (L·c)−1 ≤ a349

proof from A1 A2 A3 have c−1 ·L−1 ≤ 1·ausing OrderedGroup_ZF_3_L8 OrderedGroup_ZF_1_L5AB
OrderedGroup_ZF_1_L5B by simp
with A1 A2 A3 show (L·c)−1 ≤ ausing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_1_L1
group0.group_inv_of_two group0.group0_2_L2
by simpqed

If b is between a and a · c, then b · a−1 ≤ c.
lemma (in group3) OrderedGroup_ZF_3_L8C:
assumes A1: a≤b and A2: c∈G and A3: b≤c·ashows |b·a−1 | ≤ cproof from A1 A2 A3 have b·a−1 ≤ cusing OrderedGroup_ZF_1_L9C OrderedGroup_ZF_1_L4
by simpmoreover have (b·a−1 )−1 ≤ cproof from A1 have T: a∈G b∈Gusing OrderedGroup_ZF_1_L4 by autowith A1 have a·b−1 ≤ 1
using OrderedGroup_ZF_1_L9 by blast
moreoverfrom A1 A3 have a≤c·aby (rule Group_order_transitive)
with ordGroupAssum T have a·a−1 ≤ c·a·a−1
using OrderedGroup_ZF_1_L1 group0.inverse_in_group
IsAnOrdGroup_def by simp
with T A2 have 1 ≤ cusing OrderedGroup_ZF_1_L1
group0.group0_2_L6 group0.inv_cancel_two
by simpultimately have a·b−1 ≤ cby (rule Group_order_transitive)
with T show (b·a−1 )−1 ≤ cusing OrderedGroup_ZF_1_L1 group0.group0_2_L12
by simpqed
ultimately show |b·a−1 | ≤ cusing OrderedGroup_ZF_3_L4 by simp
qed

For linearly ordered groups if the absolute values of elements in a set arebounded, then the set is bounded.
lemma (in group3) OrderedGroup_ZF_3_L9:
assumes A1: r {is total on} G
and A2: A⊆G and A3: ∀ a∈A. |a| ≤ L

350

shows IsBounded(A,r)
proof from A1 A2 A3 have
∀ a∈A. a≤L ∀ a∈A. L−1 ≤ausing OrderedGroup_ZF_3_L8 OrderedGroup_ZF_3_L8A by auto
then show IsBounded(A,r) using
IsBoundedAbove_def IsBoundedBelow_def IsBounded_def
by autoqed

A slightly more general version of the previous lemma, stating the same fact
for a set defined by separation.
lemma (in group3) OrderedGroup_ZF_3_L9A:
assumes A1: r {is total on} G
and A2: ∀ x∈X. b(x)∈G ∧ |b(x)|≤Lshows IsBounded({b(x). x∈X},r)proof from A2 have {b(x). x∈X} ⊆ G ∀ a∈{b(x). x∈X}. |a| ≤ L
by autowith A1 show thesis using OrderedGroup_ZF_3_L9 by blastqed

A special form of the previous lemma stating a similar fact for an image ofa set by a function with values in a linearly ordered group.
lemma (in group3) OrderedGroup_ZF_3_L9B:
assumes A1: r {is total on} G
and A2: f:X→G and A3: A⊆X
and A4: ∀ x∈A. |f(x)| ≤ Lshows IsBounded(f(A),r)
proof from A2 A3 A4 have ∀ x∈A. f(x) ∈ G ∧ |f(x)| ≤ Lusing apply_funtype by autowith A1 have IsBounded({f(x). x∈A},r)by (rule OrderedGroup_ZF_3_L9A)
with A2 A3 show IsBounded(f(A),r)using func_imagedef by simp
qed

For linearly ordered groups if l ≤ a ≤ u then |a| is smaller than the greaterof |l|, |u|.
lemma (in group3) OrderedGroup_ZF_3_L10:
assumes A1: r {is total on} G
and A2: l≤a a≤ushows|a| ≤ GreaterOf(r,|l|,|u|)proof from A2 have T1: |l| ∈ G |a| ∈ G |u| ∈ Gusing OrderedGroup_ZF_1_L4 OrderedGroup_ZF_3_L1 apply_funtype351

by auto{ assume A3: a∈G+
with A2 have 1≤a a≤uusing OrderedGroup_ZF_1_L2 by auto
then have 1≤u by (rule Group_order_transitive)
with A2 A3 have |a|≤|u|using OrderedGroup_ZF_1_L2 OrderedGroup_ZF_3_L2 by simp
moreover from A1 T1 have |u| ≤ GreaterOf(r,|l|,|u|)using Order_ZF_3_L2 by simp
ultimately have |a| ≤ GreaterOf(r,|l|,|u|)by (rule Group_order_transitive) }moreover{ assume A4: a∈G/ +with A2 have T2:l∈G |l| ∈ G |a| ∈ G |u| ∈ G a ∈ G-G+
using OrderedGroup_ZF_1_L4 OrderedGroup_ZF_3_L1 apply_funtype
by autowith A2 have l ∈ G-G+ using OrderedGroup_ZF_1_L4D by fastwith T2 A2 have |a| ≤ |l|using OrderedGroup_ZF_3_L3 OrderedGroup_ZF_1_L5
by simpmoreover from A1 T2 have |l| ≤ GreaterOf(r,|l|,|u|)using Order_ZF_3_L2 by simp
ultimately have |a| ≤ GreaterOf(r,|l|,|u|)by (rule Group_order_transitive) }ultimately show thesis by blast
qed

For linearly ordered groups if a set is bounded then the absolute values arebounded.
lemma (in group3) OrderedGroup_ZF_3_L10A:
assumes A1: r {is total on} G
and A2: IsBounded(A,r)
shows ∃ L. ∀ a∈A. |a| ≤ Lproof { assume A = 0 then have thesis by auto }moreover{ assume A3: A6=0
with A2 have ∃ u. ∀ g∈A. g≤u and ∃ l.∀ g∈A. l≤gusing IsBounded_def IsBoundedAbove_def IsBoundedBelow_def
by autothen obtain u l where ∀ g∈A. l≤g ∧ g≤u
by autowith A1 have ∀ a∈A. |a| ≤ GreaterOf(r,|l|,|u|)using OrderedGroup_ZF_3_L10 by simp
then have thesis by auto }
ultimately show thesis by blast
qed

352

A slightly more general version of the previous lemma, stating the same fact
for a set defined by separation.
lemma (in group3) OrderedGroup_ZF_3_L11:
assumes r {is total on} G
and IsBounded({b(x).x∈X},r)shows ∃ L. ∀ x∈X. |b(x)| ≤ Lusing assms OrderedGroup_ZF_3_L10A by blast

Absolute values of elements of a finite image of a nonempty set are boundedby an element of the group.
lemma (in group3) OrderedGroup_ZF_3_L11A:
assumes A1: r {is total on} G
and A2: X6=0 and A3: {b(x). x∈X} ∈ Fin(G)shows ∃ L∈G. ∀ x∈X. |b(x)| ≤ Lproof from A1 A3 have ∃ L. ∀ x∈X. |b(x)| ≤ Lusing ord_group_fin_bounded OrderedGroup_ZF_3_L11
by simpthen obtain L where I: ∀ x∈X. |b(x)| ≤ Lusing OrderedGroup_ZF_3_L11 by autofrom A2 obtain x where x∈X by autowith I show thesis using OrderedGroup_ZF_1_L4
by blast
qed

In totally oredered groups the absolute value of a nonunit element is in G+ .
lemma (in group3) OrderedGroup_ZF_3_L12:
assumes A1: r {is total on} G
and A2: a∈G and A3: a6=1
shows |a| ∈ G+
proof from A1 A2 have |a| ∈ G 1 ≤ |a|using OrderedGroup_ZF_3_L1 apply_funtype
OrderedGroup_ZF_3_L3B OrderedGroup_ZF_1_L2
by automoreover from A2 A3 have |a| 6= 1
using OrderedGroup_ZF_3_L3D by auto
ultimately show |a| ∈ G+
using PositiveSet_def by auto
qed

33.2

Maximum absolute value of a set

Quite often when considering inequalities we prefer to talk about the absolute values instead of raw elements of a set. This section formalizes somematerial that is useful for that.
If a set has a maximum and minimum, then the greater of the absolute353

value of the maximum and minimum belongs to the image of the set by theabsolute value function.
lemma (in group3) OrderedGroup_ZF_4_L1:
assumes A ⊆ G
and HasAmaximum(r,A) HasAminimum(r,A)
and M = GreaterOf(r,|Minimum(r,A)|,|Maximum(r,A)|)
shows M ∈ AbsoluteValue(G,P,r)(A)using ordGroupAssum assms IsAnOrdGroup_def IsPartOrder_def
Order_ZF_4_L3 Order_ZF_4_L4 OrderedGroup_ZF_3_L1
func_imagedef GreaterOf_def by auto

If a set has a maximum and minimum, then the greater of the absolute valueof the maximum and minimum bounds absolute values of all elements of theset.
lemma (in group3) OrderedGroup_ZF_4_L2:
assumes A1: r {is total on} G
and A2: HasAmaximum(r,A) HasAminimum(r,A)
and A3: a∈Ashows |a|≤ GreaterOf(r,|Minimum(r,A)|,|Maximum(r,A)|)
proof from ordGroupAssum A2 A3 have
Minimum(r,A)≤ a a≤ Maximum(r,A)
using IsAnOrdGroup_def IsPartOrder_def Order_ZF_4_L3 Order_ZF_4_L4
by autowith A1 show thesis by (rule OrderedGroup_ZF_3_L10)
qed

If a set has a maximum and minimum, then the greater of the absolute valueof the maximum and minimum bounds absolute values of all elements of theset. In this lemma the absolute values of ekements of a set are represented
as the elements of the image of the set by the absolute value function.
lemma (in group3) OrderedGroup_ZF_4_L3:
assumes r {is total on} G and A ⊆ G
and HasAmaximum(r,A) HasAminimum(r,A)
and b ∈ AbsoluteValue(G,P,r)(A)shows b≤ GreaterOf(r,|Minimum(r,A)|,|Maximum(r,A)|)
using assms OrderedGroup_ZF_3_L1 func_imagedef OrderedGroup_ZF_4_L2
by autoIf a set has a maximum and minimum, then the set of absolute values also
has a maximum.
lemma (in group3) OrderedGroup_ZF_4_L4:assumes A1: r {is total on} G and A2: A ⊆ G
and A3: HasAmaximum(r,A) HasAminimum(r,A)
shows HasAmaximum(r,AbsoluteValue(G,P,r)(A))
proof let M = GreaterOf(r,|Minimum(r,A)|,|Maximum(r,A)|)354

from A2 A3 have M ∈ AbsoluteValue(G,P,r)(A)using OrderedGroup_ZF_4_L1 by simp
moreover from A1 A2 A3 have∀ b ∈ AbsoluteValue(G,P,r)(A). b ≤ Musing OrderedGroup_ZF_4_L3 by simp
ultimately show thesis using HasAmaximum_def by autoqed

If a set has a maximum and a minimum, then all absolute values are boundedby the maximum of the set of absolute values.
lemma (in group3) OrderedGroup_ZF_4_L5:
assumes A1: r {is total on} G and A2: A ⊆ G
and A3: HasAmaximum(r,A) HasAminimum(r,A)
and A4: a∈Ashows |a| ≤ Maximum(r,AbsoluteValue(G,P,r)(A))
proof from A2 A4 have |a| ∈ AbsoluteValue(G,P,r)(A)using OrderedGroup_ZF_3_L1 func_imagedef by autowith ordGroupAssum A1 A2 A3 show thesis using
IsAnOrdGroup_def IsPartOrder_def OrderedGroup_ZF_4_L4
Order_ZF_4_L3 by simp
qed

33.3

Alternative definitions

Sometimes it is usful to define the order by prescibing the set of positive
or nonnegative elements. This section deals with two such definitions. One
takes a subset H of G that is closed under the group operation, 1 ∈/ H and−1
for every a ∈ H we have either a ∈ H or a ∈ H. Then the order is defined
as a ≤ b iff a = b or a−1 b ∈ H. For abelian groups this makes a linearlyordered group. We will refer to order defined this way in the comments
as the order defined by a positive set. The context used in this section is
the group0 context defined in Group_ZF theory. Recall that f in that context
denotes the group operation (unlike in the previous sections where the group
operation was denoted P.
The order defined by a positive set is the same as the order defined by anonnegative set.
lemma (in group0) OrderedGroup_ZF_5_L1:
assumes A1: r = {p ∈ G×G. fst(p) = snd(p) ∨ fst(p)−1 ·snd(p) ∈ H}
shows ha,bi ∈ r ←→ a∈G ∧ b∈G ∧ a−1 ·b ∈ H ∪ {1}proofassume ha,bi ∈ rwith A1 show a∈G ∧ b∈G ∧ a−1 ·b ∈ H ∪ {1}using group0_2_L6 by auto
next assume a∈G ∧ b∈G ∧ a−1 ·b ∈ H ∪ {1}then have a∈G ∧ b∈G ∧ b=(a−1 )−1 ∨ a∈G ∧ b∈G ∧ a−1 ·b ∈ H

355

using inverse_in_group group0_2_L9 by autowith A1 show ha,bi ∈ r using group_inv_of_inv
by autoqed

The relation defined by a positive set is antisymmetric.
lemma (in group0) OrderedGroup_ZF_5_L2:
assumes A1: r = {p ∈ G×G. fst(p) = snd(p) ∨ fst(p)−1 ·snd(p) ∈ H}
and A2: ∀ a∈G. a6=1 −→ (a∈H) Xor (a−1 ∈H)shows antisym(r)proof { fix a b assume A3: ha,bi ∈ r hb,ai ∈ rwith A1 have T: a∈G b∈G by auto
{ assume A4: a6=bwith A1 A3 have a−1 ·b ∈ G a−1 ·b ∈ H (a−1 ·b)−1 ∈ Husing inverse_in_group group0_2_L1 monoid0.group0_1_L1 group0_2_L12
by autowith A2 have a−1 ·b = 1 using Xor_def by autowith T A4 have False using group0_2_L11 by auto
} then have a=b by auto
} then show antisym(r) by (rule antisymI)qed

The relation defined by a positive set is transitive.
lemma (in group0) OrderedGroup_ZF_5_L3:
assumes A1: r = {p ∈ G×G. fst(p) = snd(p) ∨ fst(p)−1 ·snd(p) ∈ H}
and A2: H⊆G H {is closed under} Pshows trans(r)proof { fix a b c assume ha,bi ∈ r hb,ci ∈ rwith A1 havea∈G ∧ b∈G ∧ a−1 ·b ∈ H ∪ {1}b∈G ∧ c∈G ∧ b−1 ·c ∈ H ∪ {1}using OrderedGroup_ZF_5_L1 by autowith A2 have
I: a∈G b∈G c∈G
and (a−1 ·b)·(b−1 ·c) ∈ H ∪ {1}using inverse_in_group group0_2_L17 IsOpClosed_def
by automoreover from I have a−1 ·c = (a−1 ·b)·(b−1 ·c)by (rule group0_2_L14A)
ultimately have ha,ci ∈ G×G a−1 ·c ∈ H ∪ {1}by autowith A1 have ha,ci ∈ r using OrderedGroup_ZF_5_L1
by auto} then have ∀ a b c. ha, bi ∈ r ∧ hb, ci ∈ r −→ ha, ci ∈ rby blast
then show trans(r) by (rule Fol1_L2)
qed

356

The relation defined by a positive set is translation invariant. With ourdefinition this step requires the group to be abelian.
lemma (in group0) OrderedGroup_ZF_5_L4:
assumes A1: r = {p ∈ G×G. fst(p) = snd(p) ∨ fst(p)−1 ·snd(p) ∈ H}
and A2: P {is commutative on} G
and A3: ha,bi ∈ r and A4: c∈Gshows ha·c,b·ci ∈ r ∧ hc·a,c·bi ∈ r
prooffrom A1 A3 A4 have
I: a∈G b∈G a·c ∈ G b·c ∈ G
and II: a−1 ·b ∈ H ∪ {1}using OrderedGroup_ZF_5_L1 group_op_closedby autowith A2 A4 have (a·c)−1 ·(b·c) ∈ H ∪ {1}using group0_4_L6D by simp
with A1 I show ha·c,b·ci ∈ r using OrderedGroup_ZF_5_L1
by autowith A2 A4 I show hc·a,c·bi ∈ rusing IsCommutative_def by simpqed

If H ⊆ G is closed under the group operation 1 ∈/ H and for every a ∈ H
we have either a ∈ H or a−1 ∈ H, then the relation ”≤” defined by a ≤ b ⇔a−1 b ∈ H orders the group G. In such order H may be the set of positive
or nonnegative elements.
lemma (in group0) OrderedGroup_ZF_5_L5:
assumes A1: P {is commutative on} G
and A2: H⊆G H {is closed under} P
and A3: ∀ a∈G. a6=1 −→ (a∈H) Xor (a−1 ∈H)
and A4: r = {p ∈ G×G. fst(p) = snd(p) ∨ fst(p)−1 ·snd(p) ∈ H}
shows
IsAnOrdGroup(G,P,r)r {is total on} G
Nonnegative(G,P,r) = PositiveSet(G,P,r) ∪ {1}proof from groupAssum A2 A3 A4 have
IsAgroup(G,P) r ⊆ G×G IsPartOrder(G,r)
using refl_def OrderedGroup_ZF_5_L2 OrderedGroup_ZF_5_L3
IsPartOrder_def by auto
moreover from A1 A4 have
∀ g∈G. ∀ a b. h a,bi ∈ r −→ ha·g,b·gi ∈ r ∧ hg·a,g·bi ∈ rusing OrderedGroup_ZF_5_L4 by blast
ultimately show IsAnOrdGroup(G,P,r)using IsAnOrdGroup_def by simp
then show Nonnegative(G,P,r) = PositiveSet(G,P,r) ∪ {1}using group3_def group3.OrderedGroup_ZF_1_L24
by simp{ fix a b

357

assume T: a∈G b∈Gthen have T1: a−1 ·b ∈ Gusing inverse_in_group group_op_closed by simp
{ assume h a,bi ∈/ rwith A4 T have I: a6=b and II: a−1 ·b ∈/ H
by autofrom A3 T T1 I have (a−1 ·b ∈ H) Xor ((a−1 ·b)−1 ∈ H)
using group0_2_L11 by autowith A4 T II have h b,ai ∈ rusing Xor_def group0_2_L12 by simp
} then have h a,bi ∈ r ∨ h b,ai ∈ r by auto
} then show r {is total on} G using IsTotal_def
by simpqed

If the set defined as in OrderedGroup_ZF_5_L4 does not contain the neutral
element, then it is the positive set for the resulting order.
lemma (in group0) OrderedGroup_ZF_5_L6:
assumes P {is commutative on} G
and H⊆G and 1 ∈/ H
and r = {p ∈ G×G. fst(p) = snd(p) ∨ fst(p)−1 ·snd(p) ∈ H}
shows PositiveSet(G,P,r) = H
using assms group_inv_of_one group0_2_L2 PositiveSet_def
by auto

The next definition describes how we construct an order relation from theprescribed set of positive elements.
definition
OrderFromPosSet(G,P,H) ≡{p ∈ G×G. fst(p) = snd(p) ∨ PhGroupInv(G,P)(fst(p)),snd(p)i ∈ H }The next theorem rephrases lemmas OrderedGroup_ZF_5_L5 and OrderedGroup_ZF_5_L6
using the definition of the order from the positive set OrderFromPosSet. Tosummarize, this is what it says: Suppose that H ⊆ G is a set closed underthat group operation such that 1 ∈/ H and for every nonunit group element aeither a ∈ H or a−1 ∈ H. Define the order as a ≤ b iff a = b or a−1 · b ∈ H.
Then this order makes G into a linearly ordered group such H is the setof positive elements (and then of course H ∪ {1} is the set of nonnegative
elements).
theorem (in group0) Group_ord_by_positive_set:
assumes P {is commutative on} G
and H⊆G
H {is closed under} P
1 ∈/ Hand ∀ a∈G. a6=1 −→ (a∈H) Xor (a−1 ∈H)
shows
IsAnOrdGroup(G,P,OrderFromPosSet(G,P,H))
OrderFromPosSet(G,P,H) {is total on} G
PositiveSet(G,P,OrderFromPosSet(G,P,H)) = H
Nonnegative(G,P,OrderFromPosSet(G,P,H)) = H ∪ {1}358using assms OrderFromPosSet_def OrderedGroup_ZF_5_L5 OrderedGroup_ZF_5_L6
by auto33.4

Odd Extensions

In this section we verify properties of odd extensions of functions defined on
G+ . An odd extension of a function f : G+ → G is a function f ◦ : G → G
defined by f ◦ (x) = f (x) if x ∈ G+ , f (1) = 1 and f ◦ (x) = (f (x−1 ))−1 forx < 1. Such function is the unique odd function that is equal to f whenrestricted to G+ .
The next lemma is just to see the definition of the odd extension in thenotation used in the group1 context.
lemma (in group3) OrderedGroup_ZF_6_L1:
shows f° = f ∪ {ha, (f(a−1 ))−1 i. a ∈ -G+ } ∪ {h1,1i}
using OddExtension_def by simp

A technical lemma that states that from a function defined on G+ with values
in G we have (f (a−1 ))−1 ∈ G.
lemma (in group3) OrderedGroup_ZF_6_L2:
assumes f: G+ →G and a∈-G+
showsf(a−1 ) ∈ G(f(a−1 ))−1 ∈ Gusing assms OrderedGroup_ZF_1_L27 apply_funtype
OrderedGroup_ZF_1_L1 group0.inverse_in_groupby autoThe main theorem about odd extensions. It basically says that the odd
extension of a function is what we want to to be.
lemma (in group3) odd_ext_props:
assumes A1: r {is total on} G and A2: f: G+ →G
shows
f° : G → G∀ a∈G+ . (f°)(a) = f(a)∀ a∈(-G+ ). (f°)(a) = (f(a−1 ))−1(f°)(1) = 1
proof from A1 A2 have I:
f: G+ →G
∀ a∈-G+ . (f(a−1 ))−1 ∈ G
G+ ∩(-G+ ) = 0
1 ∈/ G+ ∪(-G+ )f° = f ∪ {ha, (f(a−1 ))−1 i. a ∈ -G+ } ∪ {h1,1i}
using OrderedGroup_ZF_6_L2 OrdGroup_decomp2 OrderedGroup_ZF_6_L1
by autothen have f°: G+ ∪ (-G+ ) ∪ {1} →G∪G∪{1}by (rule func1_1_L11E)

359

moreover from A1 haveG+ ∪ (-G+ ) ∪ {1} = G
G∪G∪{1} = G
using OrdGroup_decomp2 OrderedGroup_ZF_1_L1 group0.group0_2_L2
by autoultimately show f° : G → G by simp
from I show ∀ a∈G+ . (f°)(a) = f(a)by (rule func1_1_L11E)
from I show ∀ a∈(-G+ ). (f°)(a) = (f(a−1 ))−1by (rule func1_1_L11E)
from I show (f°)(1) = 1
by (rule func1_1_L11E)
qed

Odd extensions are odd, of course.
lemma (in group3) oddext_is_odd:
assumes A1: r {is total on} G and A2: f: G+ →G
and A3: a∈Gshows (f°)(a−1 ) = ((f°)(a))−1
proof from A1 A3 have a∈G+ ∨ a ∈ (-G+ ) ∨ a=1
using OrdGroup_decomp2 by blast
moreover{ assume a∈G+
with A1 A2 have a−1 ∈ -G+ and (f°)(a) = f(a)using OrderedGroup_ZF_1_L25 odd_ext_props by autowith A1 A2 have(f°)(a−1 ) = (f((a−1 )−1 ))−1 and (f(a))−1 = ((f°)(a))−1
using odd_ext_props by autowith A3 have (f°)(a−1 ) = ((f°)(a))−1
using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simp }moreover{ assume A4: a ∈ -G+
with A1 A2 have a−1 ∈ G+ and (f°)(a) = (f(a−1 ))−1
using OrderedGroup_ZF_1_L27 odd_ext_props
by autowith A1 A2 A4 have (f°)(a−1 ) = ((f°)(a))−1
using odd_ext_props OrderedGroup_ZF_6_L2
OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simp }moreover{ assume a = 1
with A1 A2 have (f°)(a−1 ) = ((f°)(a))−1
using OrderedGroup_ZF_1_L1 group0.group_inv_of_one
odd_ext_props by simp}
ultimately show (f°)(a−1 ) = ((f°)(a))−1
by auto360

qed

Another way of saying that odd extensions are odd.
lemma (in group3) oddext_is_odd_alt:
assumes A1: r {is total on} G and A2: f: G+ →G
and A3: a∈Gshows ((f°)(a−1 ))−1 = (f°)(a)proof from A1 A2 havef° : G → G∀ a∈G. (f°)(a−1 ) = ((f°)(a))−1
using odd_ext_props oddext_is_odd by auto
then have ∀ a∈G. ((f°)(a−1 ))−1 = (f°)(a)using OrderedGroup_ZF_1_L1 group0.group0_6_L2 by simp
with A3 show ((f°)(a−1 ))−1 = (f°)(a) by simp
qed

33.5

Functions with infinite limits

In this section we consider functions f : G → G with the property that forf (x) is arbitrarily large for large enough x. More precisely, for every a ∈ Gthere exist b ∈ G+ such that for every x ≥ b we have f (x) ≥ a. In a sense
this means that limx→∞ f (x) = ∞, hence the title of this section. We also
prove dual statements for functions such that limx→−∞ f (x) = −∞.
If an image of a set by a function with infinite positive limit is bounded
above, then the set itself is bounded above.
lemma (in group3) OrderedGroup_ZF_7_L1:
assumes A1: r {is total on} G and A2: G 6= {1} andA3: f:G→G andA4: ∀ a∈G.∃ b∈G+ .∀ x. b≤x −→ a ≤ f(x) andA5: A⊆G and
A6: IsBoundedAbove(f(A),r)shows IsBoundedAbove(A,r)
proof { assume ¬IsBoundedAbove(A,r)
then have I: ∀ u. ∃ x∈A. ¬(x≤u)
using IsBoundedAbove_def by auto
have ∀ a∈G. ∃ y∈f(A). a≤yproof { fix a assume a∈Gwith A4 obtain b where
II: b∈G+ and III: ∀ x. b≤x −→ a ≤ f(x)by autofrom I obtain x where IV: x∈A and ¬(x≤b)
by autowith A1 A5 II haver {is total on} G361

x∈G b∈G ¬(x≤b)
using PositiveSet_def by autowith III have a ≤ f(x)using OrderedGroup_ZF_1_L8 by blast
with A3 A5 IV have ∃ y∈f(A). a≤yusing func_imagedef by auto
} thus thesis by simp
qedwith A1 A2 A6 have False using OrderedGroup_ZF_2_L2A
by simp} thus thesis by autoqed

If an image of a set defined by separation by a function with infinite positive
limit is bounded above, then the set itself is bounded above.
lemma (in group3) OrderedGroup_ZF_7_L2:
assumes A1: r {is total on} G and A2: G 6= {1} and
A3: X6=0 and A4: f:G→G andA5: ∀ a∈G.∃ b∈G+ .∀ y. b≤y −→ a ≤ f(y) andA6: ∀ x∈X. b(x) ∈ G ∧ f(b(x)) ≤ Ushows ∃ u.∀ x∈X. b(x) ≤ u
proof let A = {b(x). x∈X}
from A6 have I: A⊆G by auto
moreover note assms
moreover have IsBoundedAbove(f(A),r)
proof from A4 A6 I have ∀ z∈f(A). hz,Ui ∈ rusing func_imagedef by simp
then show IsBoundedAbove(f(A),r)by (rule Order_ZF_3_L10)
qed
ultimately have IsBoundedAbove(A,r) using OrderedGroup_ZF_7_L1
by simpwith A3 have ∃ u.∀ y∈A. y ≤ uusing IsBoundedAbove_def by simp
then show ∃ u.∀ x∈X. b(x) ≤ u by autoqed

If the image of a set defined by separation by a function with infinite negative
limit is bounded below, then the set itself is bounded above. This is dual toOrderedGroup_ZF_7_L2.
lemma (in group3) OrderedGroup_ZF_7_L3:
assumes A1: r {is total on} G and A2: G 6= {1} and
A3: X6=0 and A4: f:G→G andA5: ∀ a∈G.∃ b∈G+ .∀ y. b≤y −→ f(y−1 ) ≤ a andA6: ∀ x∈X. b(x) ∈ G ∧ L ≤ f(b(x))
shows ∃ l.∀ x∈X. l ≤ b(x)proof -

362

let g = GroupInv(G,P) O f O GroupInv(G,P)
from ordGroupAssum have I: GroupInv(G,P) : G→Gusing IsAnOrdGroup_def group0_2_T2 by simp
with A4 have II: ∀ x∈G. g(x) = (f(x−1 ))−1
using func1_1_L18 by simp
note A1 A2 A3
moreover from A4 I have g : G→Gusing comp_fun by blast
moreover have ∀ a∈G.∃ b∈G+ .∀ y. b≤y −→ a ≤ g(y)proof { fix a assume A7: a∈Gthen have a−1 ∈ Gusing OrderedGroup_ZF_1_L1 group0.inverse_in_groupby simpwith A5 obtain b where
III: b∈G+ and ∀ y. b≤y −→ f(y−1 ) ≤ a−1
by autowith II A7 have ∀ y. b≤y −→ a ≤ g(y)using OrderedGroup_ZF_1_L5AD OrderedGroup_ZF_1_L4
by simpwith III have ∃ b∈G+ .∀ y. b≤y −→ a ≤ g(y)by auto} then show ∀ a∈G.∃ b∈G+ .∀ y. b≤y −→ a ≤ g(y)by simpqed
moreover have ∀ x∈X. b(x)−1 ∈ G ∧ g(b(x)−1 ) ≤ L−1
proof { fix x assume x∈Xwith A6 have
T: b(x) ∈ G b(x)−1 ∈ G and L ≤ f(b(x))
using OrderedGroup_ZF_1_L1 group0.inverse_in_groupby autothen have (f(b(x)))−1 ≤ L−1
using OrderedGroup_ZF_1_L5 by simp
moreover from II T have (f(b(x)))−1 = g(b(x)−1 )using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv
by simpultimately have g(b(x)−1 ) ≤ L−1 by simp
with T have b(x)−1 ∈ G ∧ g(b(x)−1 ) ≤ L−1
by simp} then show ∀ x∈X. b(x)−1 ∈ G ∧ g(b(x)−1 ) ≤ L−1
by simpqed
ultimately have ∃ u.∀ x∈X. (b(x))−1 ≤ u
by (rule OrderedGroup_ZF_7_L2)
then have ∃ u.∀ x∈X. u−1 ≤ (b(x)−1 )−1using OrderedGroup_ZF_1_L5 by autowith A6 show ∃ l.∀ x∈X. l ≤ b(x)using OrderedGroup_ZF_1_L1 group0.group_inv_of_inv

363

by autoqed

The next lemma combines OrderedGroup_ZF_7_L2 and OrderedGroup_ZF_7_L3
to show that if an image of a set defined by separation by a function with
infinite limits is bounded, then the set itself i bounded.
lemma (in group3) OrderedGroup_ZF_7_L4:
assumes A1: r {is total on} G and A2: G 6= {1} and
A3: X6=0 and A4: f:G→G andA5: ∀ a∈G.∃ b∈G+ .∀ y. b≤y −→ a ≤ f(y) andA6: ∀ a∈G.∃ b∈G+ .∀ y. b≤y −→ f(y−1 ) ≤ a andA7: ∀ x∈X. b(x) ∈ G ∧ L ≤ f(b(x)) ∧ f(b(x)) ≤ Ushows ∃ M.∀ x∈X. |b(x)| ≤ Mproof from A7 have
I: ∀ x∈X. b(x) ∈ G ∧ f(b(x)) ≤ U andII: ∀ x∈X. b(x) ∈ G ∧ L ≤ f(b(x))
by autofrom A1 A2 A3 A4 A5 I have ∃ u.∀ x∈X. b(x) ≤ u
by (rule OrderedGroup_ZF_7_L2)
moreover from A1 A2 A3 A4 A6 II have ∃ l.∀ x∈X. l ≤ b(x)by (rule OrderedGroup_ZF_7_L3)
ultimately have ∃ u l. ∀ x∈X. l≤b(x) ∧ b(x) ≤ u
by autowith A1 have ∃ u l.∀ x∈X. |b(x)| ≤ GreaterOf(r,|l|,|u|)using OrderedGroup_ZF_3_L10 by blast
then show ∃ M.∀ x∈X. |b(x)| ≤ M
by auto
qed
end

34

Rings - introduction

theory Ring_ZF imports AbelianGroup_ZF
begin

This theory file covers basic facts about rings.

34.1

Definition and basic properties

In this section we define what is a ring and list the basic properties of rings.
We say that three sets (R, A, M ) form a ring if (R, A) is an abelian group,(R, M ) is a monoid and A is distributive with respect to M on R. A represents the additive operation on R. As such it is a subset of (R × R) × R(recall that in ZF set theory functions are sets). Similarly M represents the364multiplicative operation on R and is also a subset of (R × R) × R. We don’t
require the multiplicative operation to be commutative in the definition ofa ring.
definition
IsAring(R,A,M) ≡ IsAgroup(R,A) ∧ (A {is commutative on} R) ∧IsAmonoid(R,M) ∧ IsDistributive(R,A,M)

We also define the notion of having no zero divisors. In standard notation
the ring has no zero divisors if for all a, b ∈ R we have a · b = 0 implies a = 0
or b = 0.
definition
HasNoZeroDivs(R,A,M) ≡ (∀ a∈R. ∀ b∈R.
Mh a,bi = TheNeutralElement(R,A) −→a = TheNeutralElement(R,A) ∨ b = TheNeutralElement(R,A))

Next we define a locale that will be used when considering rings.
locale ring0 =fixes R and A and M
assumes ringAssum: IsAring(R,A,M)
fixes ringa (infixl + 90)
defines ringa_def [simp]: a+b ≡ Ah a,bi
fixes ringminus (- _ 89)
defines ringminus_def [simp]: (-a) ≡ GroupInv(R,A)(a)fixes ringsub (infixl - 90)
defines ringsub_def [simp]: a-b ≡ a+(-b)
fixes ringm (infixl · 95)
defines ringm_def [simp]: a·b ≡ Mh a,bi
fixes ringzero (0)defines ringzero_def [simp]: 0 ≡ TheNeutralElement(R,A)
fixes ringone (1)defines ringone_def [simp]: 1 ≡ TheNeutralElement(R,M)
fixes ringtwo (2)defines ringtwo_def [simp]: 2 ≡ 1+1
fixes ringsq (_2 [96] 97)
defines ringsq_def [simp]: a2 ≡ a·a

In the ring0 context we can use theorems proven in some other contexts.
lemma (in ring0) Ring_ZF_1_L1: shows365monoid0(R,M)
group0(R,A)
A {is commutative on} R
using ringAssum IsAring_def group0_def monoid0_def by auto

The additive operation in a ring is distributive with respect to the multiplicative operation.
lemma (in ring0) ring_oper_distr: assumes A1: a∈R b∈R c∈Rshows
a·(b+c) = a·b + a·c(b+c)·a = b·a + c·a
using ringAssum assms IsAring_def IsDistributive_def by auto

Zero and one of the ring are elements of the ring. The negative of zero iszero.
lemma (in ring0) Ring_ZF_1_L2:
shows 0∈R 1∈R(-0) = 0
using Ring_ZF_1_L1 group0.group0_2_L2 monoid0.unit_is_neutral
group0.group_inv_of_one by auto

The next lemma lists some properties of a ring that require one element ofa ring.
lemma (in ring0) Ring_ZF_1_L3: assumes a∈Rshows(-a) ∈ R(-(-a)) = a
a+0 = a0+a = aa·1 = a1·a = aa-a = 0a-0 = a2·a = a+a(-a)+a = 0
using assms Ring_ZF_1_L1 group0.inverse_in_group group0.group_inv_of_inv
group0.group0_2_L6 group0.group0_2_L2 monoid0.unit_is_neutral
Ring_ZF_1_L2 ring_oper_distrby auto

Properties that require two elements of a ring.
lemma (in ring0) Ring_ZF_1_L4: assumes A1: a∈R b∈R
shows
a+b ∈ Ra-b ∈ Ra·b ∈ Ra+b = b+a
using ringAssum assms Ring_ZF_1_L1 Ring_ZF_1_L3

366

group0.group0_2_L1 monoid0.group0_1_L1
IsAring_def IsCommutative_def
by autoCancellation of an element on both sides of equality. This is a property ofgroups, written in the (additive) notation we use for the additive operationin rings.
lemma (in ring0) ring_cancel_add:
assumes A1: a∈R b∈R and A2: a + b = ashows b = 0
using assms Ring_ZF_1_L1 group0.group0_2_L7 by simp

Any element of a ring multiplied by zero is zero.
lemma (in ring0) Ring_ZF_1_L6:
assumes A1: x∈R shows 0·x = 0
x·0 = 0
proof let a = x·1
let b = x·0
let c = 1·x
let d = 0·x
from A1 havea + b = x·(1 + 0)
c + d = (1 + 0)·x
using Ring_ZF_1_L2 ring_oper_distr by auto
moreover have x·(1 + 0) = a (1 + 0)·x = cusing Ring_ZF_1_L2 Ring_ZF_1_L3 by auto
ultimately have a + b = a and T1: c + d = c
by automoreover from A1 havea ∈ R b ∈ R and T2: c ∈ R d ∈ Rusing Ring_ZF_1_L2 Ring_ZF_1_L4 by auto
ultimately have b = 0 using ring_cancel_add
by blast
moreover from T2 T1 have d = 0 using ring_cancel_add
by blast
ultimately show x·0 = 0 0·x = 0 by auto
qed

Negative can be pulled out of a product.
lemma (in ring0) Ring_ZF_1_L7:
assumes A1: a∈R b∈Rshows(-a)·b = -(a·b)
a·(-b) = -(a·b)(-a)·b = a·(-b)
proof from A1 have I:
a·b ∈ R (-a) ∈ R ((-a)·b) ∈ R(-b) ∈ R a·(-b) ∈ R

367

using Ring_ZF_1_L3 Ring_ZF_1_L4 by auto
moreover have (-a)·b + a·b = 0
and II: a·(-b) + a·b = 0
proof from A1 I have(-a)·b + a·b = ((-a)+ a)·b
a·(-b) + a·b= a·((-b)+b)
using ring_oper_distr by auto
moreover from A1 have((-a)+ a)·b = 0
a·((-b)+b) = 0
using Ring_ZF_1_L1 group0.group0_2_L6 Ring_ZF_1_L6
by autoultimately show(-a)·b + a·b = 0
a·(-b) + a·b = 0
by autoqed
ultimately show (-a)·b = -(a·b)
using Ring_ZF_1_L1 group0.group0_2_L9 by simp
moreover from I II show a·(-b) = -(a·b)
using Ring_ZF_1_L1 group0.group0_2_L9 by simp
ultimately show (-a)·b = a·(-b) by simp
qed

Minus times minus is plus.
lemma (in ring0) Ring_ZF_1_L7A: assumes a∈R b∈R
shows (-a)·(-b) = a·busing assms Ring_ZF_1_L3 Ring_ZF_1_L7 Ring_ZF_1_L4
by simp

Subtraction is distributive with respect to multiplication.
lemma (in ring0) Ring_ZF_1_L8: assumes a∈R b∈R c∈R
shows
a·(b-c) = a·b - a·c(b-c)·a = b·a - c·ausing assms Ring_ZF_1_L3 ring_oper_distr Ring_ZF_1_L7 Ring_ZF_1_L4
by autoOther basic properties involving two elements of a ring.
lemma (in ring0) Ring_ZF_1_L9: assumes a∈R b∈Rshows(-b)-a = (-a)-b(-(a+b)) = (-a)-b(-(a-b)) = ((-a)+b)
a-(-b) = a+b
using assms ringAssum IsAring_def
Ring_ZF_1_L1 group0.group0_4_L4 group0.group_inv_of_inv
by auto368

If the difference of two element is zero, then those elements are equal.
lemma (in ring0) Ring_ZF_1_L9A:
assumes A1: a∈R b∈R and A2: a-b = 0
shows a=b
proof from A1 A2 havegroup0(R,A)
a∈R b∈R
Aha,GroupInv(R,A)(b)i = TheNeutralElement(R,A)
using Ring_ZF_1_L1 by auto
then show a=b by (rule group0.group0_2_L11A)
qed

Other basic properties involving three elements of a ring.
lemma (in ring0) Ring_ZF_1_L10:
assumes a∈R b∈R c∈R
shows
a+(b+c) = a+b+c
a-(b+c) = a-b-c
a-(b-c) = a-b+c
using assms ringAssum Ring_ZF_1_L1 group0.group_oper_assoc
IsAring_def group0.group0_4_L4A by auto

Another property with three elements.
lemma (in ring0) Ring_ZF_1_L10A:
assumes A1: a∈R b∈R c∈R
shows a+(b-c) = a+b-c
using assms Ring_ZF_1_L3 Ring_ZF_1_L10 by simp

Associativity of addition and multiplication.
lemma (in ring0) Ring_ZF_1_L11:
assumes a∈R b∈R c∈Rshows
a+b+c = a+(b+c)
a·b·c = a·(b·c)
using assms ringAssum Ring_ZF_1_L1 group0.group_oper_assoc
IsAring_def IsAmonoid_def IsAssociative_def
by autoAn interpretation of what it means that a ring has no zero divisors.
lemma (in ring0) Ring_ZF_1_L12:
assumes HasNoZeroDivs(R,A,M)
and a∈R a6=0 b∈R b6=0
shows a·b6=0
using assms HasNoZeroDivs_def by auto

In rings with no zero divisors we can cancel nonzero factors.
369

lemma (in ring0) Ring_ZF_1_L12A:
assumes A1: HasNoZeroDivs(R,A,M) and A2: a∈R b∈R c∈R
and A3: a·c = b·c and A4: c6=0
shows a=b
proof from A2 have T: a·c ∈ R a-b ∈ R
using Ring_ZF_1_L4 by autowith A1 A2 A3 have a-b = 0 ∨ c=0
using Ring_ZF_1_L3 Ring_ZF_1_L8 HasNoZeroDivs_def
by simpwith A2 A4 have a∈R b∈R a-b = 0
by autothen show a=b by (rule Ring_ZF_1_L9A)
qed

In rings with no zero divisors if two elements are different, then after multiplying by a nonzero element they are still different.
lemma (in ring0) Ring_ZF_1_L12B:
assumes A1: HasNoZeroDivs(R,A,M)
a∈R
b∈R
c∈R
a6=b
c6=0
shows a·c 6= b·cusing A1 Ring_ZF_1_L12A by auto

In rings with no zero divisors multiplying a nonzero element by a nonone
element changes the value.
lemma (in ring0) Ring_ZF_1_L12C:
assumes A1: HasNoZeroDivs(R,A,M) andA2: a∈R b∈R and A3: 06=a 16=b
shows a 6= a·b
proof { assume a = a·b
with A1 A2 have a = 0 ∨ b-1 = 0
using Ring_ZF_1_L3 Ring_ZF_1_L2 Ring_ZF_1_L8
Ring_ZF_1_L3 Ring_ZF_1_L2 Ring_ZF_1_L4 HasNoZeroDivs_def
by simpwith A2 A3 have False
using Ring_ZF_1_L2 Ring_ZF_1_L9A by auto
} then show a 6= a·b by autoqed

If a square is nonzero, then the element is nonzero.
lemma (in ring0) Ring_ZF_1_L13:
assumes a∈R and a2 6= 0
shows a6=0
using assms Ring_ZF_1_L2 Ring_ZF_1_L6 by auto

Square of an element and its opposite are the same.
lemma (in ring0) Ring_ZF_1_L14:

370

assumes a∈R shows (-a)2 = ((a)2 )using assms Ring_ZF_1_L7A by simp

Adding zero to a set that is closed under addition results in a set that is
also closed under addition. This is a property of groups.
lemma (in ring0) Ring_ZF_1_L15:
assumes H ⊆ R and H {is closed under} Ashows (H ∪ {0}) {is closed under} A
using assms Ring_ZF_1_L1 group0.group0_2_L17 by simp

Adding zero to a set that is closed under multiplication results in a set thatis also closed under multiplication.
lemma (in ring0) Ring_ZF_1_L16:
assumes A1: H ⊆ R and A2: H {is closed under} Mshows (H ∪ {0}) {is closed under} M
using assms Ring_ZF_1_L2 Ring_ZF_1_L6 IsOpClosed_def
by autoThe ring is trivial iff 0 = 1.
lemma (in ring0) Ring_ZF_1_L17: shows R = {0} ←→ 0=1
proof
assume R = {0}then show 0=1 using Ring_ZF_1_L2
by blast
next assume A1: 0 = 1
then have R ⊆ {0}using Ring_ZF_1_L3 Ring_ZF_1_L6 by auto
moreover have {0} ⊆ R using Ring_ZF_1_L2 by auto
ultimately show R = {0} by autoqed

The sets {m · x.x ∈ R} and {−m · x.x ∈ R} are the same.
lemma (in ring0) Ring_ZF_1_L18: assumes A1: m∈Rshows {m·x. x∈R} = {(-m)·x. x∈R}
proof
{ fix a assume a ∈ {m·x. x∈R}then obtain x where x∈R and a = m·x
by autowith A1 have (-x) ∈ R and a = (-m)·(-x)
using Ring_ZF_1_L3 Ring_ZF_1_L7A by auto
then have a ∈ {(-m)·x. x∈R}
by auto} then show {m·x. x∈R} ⊆ {(-m)·x. x∈R}
by autonext{ fix a assume a ∈ {(-m)·x. x∈R}then obtain x where x∈R and a = (-m)·x
by auto371

with A1 have (-x) ∈ R and a = m·(-x)
using Ring_ZF_1_L3 Ring_ZF_1_L7 by auto
then have a ∈ {m·x. x∈R} by auto
} then show {(-m)·x. x∈R} ⊆ {m·x. x∈R}
by autoqed

34.2

Rearrangement lemmas

In happens quite often that we want to show a fact like (a + b)c + d =(ac + d − e) + (bc + e)in rings. This is trivial in romantic math and probably
there is a way to make it trivial in formalized math. However, I don’t know
any other way than to tediously prove each such rearrangement when it isneeded. This section collects facts of this type.
Rearrangements with two elements of a ring.
lemma (in ring0) Ring_ZF_2_L1: assumes a∈R b∈R
shows a+b·a = (b+1)·ausing assms Ring_ZF_1_L2 ring_oper_distr Ring_ZF_1_L3 Ring_ZF_1_L4
by simp

Rearrangements with two elements and cancelling.
lemma (in ring0) Ring_ZF_2_L1A: assumes a∈R b∈Rshows
a-b+b = aa+b-a = b(-a)+b+a = b(-a)+(b+a) = b
a+(b-a) = b
using assms Ring_ZF_1_L1 group0.inv_cancel_two group0.group0_4_L6A
by autoIn commutative rings a−(b+1)c = (a−d−c)+(d−bc). For unknown reasons
we have to use the raw set notation in the proof, otherwise all methods fail.
lemma (in ring0) Ring_ZF_2_L2:
assumes A1: a∈R b∈R c∈R d∈Rshows a-(b+1)·c = (a-d-c)+(d-b·c)
proof let B = b·c
from ringAssum have A {is commutative on} R
using IsAring_def by simp
moreover from A1 have a∈R B ∈ R c∈R d∈R
using Ring_ZF_1_L4 by auto
ultimately have Aha, GroupInv(R,A)(AhB, ci)i =AhAhAha, GroupInv(R, A)(d)i,GroupInv(R, A)(c)i,
Ahd,GroupInv(R, A)(B)ii
using Ring_ZF_1_L1 group0.group0_4_L8 by blast
with A1 show thesis

372

using Ring_ZF_1_L2 ring_oper_distr Ring_ZF_1_L3 by simp
qed

Rerrangement about adding linear functions.
lemma (in ring0) Ring_ZF_2_L3:
assumes A1: a∈R b∈R c∈R d∈R x∈R
shows (a·x + b) + (c·x + d) = (a+c)·x + (b+d)
proof from A1 havegroup0(R,A)
A {is commutative on} R
a·x ∈ R b∈R c·x ∈ R d∈R
using Ring_ZF_1_L1 Ring_ZF_1_L4 by auto
then have AhAh a·x,bi,Ah c·x,dii = AhAh a·x,c·xi,Ah b,diiby (rule group0.group0_4_L8)
with A1 show(a·x + b) + (c·x + d) = (a+c)·x + (b+d)
using ring_oper_distr by simp
qed

Rearrangement with three elements
lemma (in ring0) Ring_ZF_2_L4:
assumes M {is commutative on} R
and a∈R b∈R c∈R
shows a·(b·c) = a·c·b
using assms IsCommutative_def Ring_ZF_1_L11
by simp

Some other rearrangements with three elements.
lemma (in ring0) ring_rearr_3_elemA:
assumes A1: M {is commutative on} R and
A2: a∈R b∈R c∈R
shows
a·(a·c) - b·(-b·c) = (a·a + b·b)·c
a·(-b·c) + b·(a·c) = 0
proof from A2 have T:
b·c ∈ R a·a ∈ R b·b ∈ R
b·(b·c) ∈ R a·(b·c) ∈ R
using Ring_ZF_1_L4 by autowith A2 showa·(a·c) - b·(-b·c) = (a·a + b·b)·c
using Ring_ZF_1_L7 Ring_ZF_1_L3 Ring_ZF_1_L11
ring_oper_distr by simp
from A2 T havea·(-b·c) + b·(a·c) = (-a·(b·c)) + b·a·c
using Ring_ZF_1_L7 Ring_ZF_1_L11 by simp
also from A1 A2 T have . . . = 0
using IsCommutative_def Ring_ZF_1_L11 Ring_ZF_1_L3

373

by simp
finally show a·(-b·c) + b·(a·c) = 0
by simpqed

Some rearrangements with four elements. Properties of abelian groups.
lemma (in ring0) Ring_ZF_2_L5:
assumes a∈R b∈R c∈R d∈Rshowsa - b - c - d = a - d - b - c
a + b + c - d = a - d + b + c
a + b - c - d = a - c + (b - d)a + b + c + d = a + c + (b + d)using assms Ring_ZF_1_L1 group0.rearr_ab_gr_4_elemBgroup0.rearr_ab_gr_4_elemA by auto

Two big rearranegements with six elements, useful for proving properties ofcomplex addition and multiplication.
lemma (in ring0) Ring_ZF_2_L6:
assumes A1: a∈R b∈R c∈R d∈R e∈R f∈R
showsa·(c·e - d·f) - b·(c·f + d·e) =(a·c - b·d)·e - (a·d + b·c)·fa·(c·f + d·e) + b·(c·e - d·f) =(a·c - b·d)·f + (a·d + b·c)·e
a·(c+e) - b·(d+f) = a·c - b·d + (a·e - b·f)
a·(d+f) + b·(c+e) = a·d + b·c + (a·f + b·e)
proof from A1 have T:
c·e ∈ R d·f ∈ R c·f ∈ R d·e ∈ R
a·c ∈ R b·d ∈ R a·d ∈ R b·c ∈ R
b·f ∈ R a·e ∈ R b·e ∈ R a·f ∈ R
a·c·e ∈ R a·d·f ∈ R
b·c·f ∈ R b·d·e ∈ R
b·c·e ∈ R b·d·f ∈ R
a·c·f ∈ R a·d·e ∈ R
a·c·e - a·d·f ∈ R
a·c·e - b·d·e ∈ R
a·c·f + a·d·e ∈ R
a·c·f - b·d·f ∈ R
a·c + a·e ∈ R
a·d + a·f ∈ Rusing Ring_ZF_1_L4 by autowith A1 show a·(c·e - d·f) - b·(c·f + d·e) =(a·c - b·d)·e - (a·d + b·c)·f
using Ring_ZF_1_L8 ring_oper_distr Ring_ZF_1_L11
Ring_ZF_1_L10 Ring_ZF_2_L5 by simp
from A1 T showa·(c·f + d·e) + b·(c·e - d·f) =374

(a·c - b·d)·f + (a·d + b·c)·e
using Ring_ZF_1_L8 ring_oper_distr Ring_ZF_1_L11
Ring_ZF_1_L10A Ring_ZF_2_L5 Ring_ZF_1_L10
by simpfrom A1 T show
a·(c+e) - b·(d+f) = a·c - b·d + (a·e - b·f)
a·(d+f) + b·(c+e) = a·d + b·c + (a·f + b·e)using ring_oper_distr Ring_ZF_1_L10 Ring_ZF_2_L5
by auto
qed
end

35

More on rings

theory Ring_ZF_1 imports Ring_ZF Group_ZF_3
begin

This theory is devoted to the part of ring theory specific the construction ofreal numbers in the Real_ZF_x series of theories. The goal is to show thatclasses of almost homomorphisms form a ring.

35.1

The ring of classes of almost homomorphisms

Almost homomorphisms do not form a ring as the regular homomorphisms
do because the lifted group operation is not distributive with respect tocomposition – we have s ◦ (r · q) 6= s ◦ r · s ◦ q in general. However, we dohave s ◦ (r · q) ≈ s ◦ r · s ◦ q in the sense of the equivalence relation definedby the group of finite range functions (that is a normal subgroup of almost
homomorphisms, if the group is abelian). This allows to define a naturalring structure on the classes of almost homomorphisms.
The next lemma provides a formula useful for proving that two sides of the
distributive law equation for almost homomorphisms are almost equal.
lemma (in group1) Ring_ZF_1_1_L1:
assumes A1: s∈AH r∈AH q∈AH and A2: n∈G
shows((s◦(r·q))(n))·(((s◦r)·(s◦q))(n))−1 = δ(s,h r(n),q(n)i)((r·q)◦s)(n) = ((r◦s)·(q◦s))(n)proof from groupAssum isAbelian A1 have T1:
r·q ∈ AH s◦r ∈ AH s◦q ∈ AH (s◦r)·(s◦q) ∈ AHr◦s ∈ AH q◦s ∈ AH (r◦s)·(q◦s) ∈ AH
using Group_ZF_3_2_L15 Group_ZF_3_4_T1 by autofrom A1 A2 have T2: r(n) ∈ G q(n) ∈ G s(n) ∈ Gs(r(n)) ∈ G s(q(n)) ∈ G δ(s,h r(n),q(n)i) ∈ G

375

s(r(n))·s(q(n)) ∈ G r(s(n)) ∈ G q(s(n)) ∈ Gr(s(n))·q(s(n)) ∈ G
using AlmostHoms_def apply_funtype Group_ZF_3_2_L4B
group0_2_L1 monoid0.group0_1_L1 by autowith T1 A1 A2 isAbelian show((s◦(r·q))(n))·(((s◦r)·(s◦q))(n))−1 = δ(s,h r(n),q(n)i)((r·q)◦s)(n) = ((r◦s)·(q◦s))(n)using Group_ZF_3_2_L12 Group_ZF_3_4_L2 Group_ZF_3_4_L1 group0_4_L6A
by autoqed

The sides of the distributive law equations for almost homomorphisms arealmost equal.
lemma (in group1) Ring_ZF_1_1_L2:
assumes A1: s∈AH r∈AH q∈AH
showss◦(r·q) ≈ (s◦r)·(s◦q)(r·q)◦s = (r◦s)·(q◦s)
proof from A1 have ∀ n∈G. h r(n),q(n)i ∈ G×G
using AlmostHoms_def apply_funtype by auto
moreover from A1 have {δ(s,x). x ∈ G×G} ∈ Fin(G)using AlmostHoms_def by simp
ultimately have {δ(s,h r(n),q(n)i). n∈G} ∈ Fin(G)by (rule Finite1_L6B)
with A1 have{((s◦(r·q))(n))·(((s◦r)·(s◦q))(n))−1 . n ∈ G} ∈ Fin(G)using Ring_ZF_1_1_L1 by simp
moreover from groupAssum isAbelian A1 A1 haves◦(r·q) ∈ AH (s◦r)·(s◦q) ∈ AH
using Group_ZF_3_2_L15 Group_ZF_3_4_T1 by auto
ultimately show s◦(r·q) ≈ (s◦r)·(s◦q)
using Group_ZF_3_4_L12 by simp
from groupAssum isAbelian A1 have(r·q)◦s : G→G (r◦s)·(q◦s) : G→Gusing Group_ZF_3_2_L15 Group_ZF_3_4_T1 AlmostHoms_def
by automoreover from A1 have
∀ n∈G. ((r·q)◦s)(n) = ((r◦s)·(q◦s))(n)using Ring_ZF_1_1_L1 by simp
ultimately show (r·q)◦s = (r◦s)·(q◦s)
using fun_extension_iff by simp
qed

The essential condition to show the distributivity for the operations definedon classes of almost homomorphisms.
lemma (in group1) Ring_ZF_1_1_L3:
assumes A1: R = QuotientGroupRel(AH,Op1,FR)
and A2: a ∈ AH//R b ∈ AH//R c ∈ AH//R

376

and A3: A = ProjFun2(AH,R,Op1) M = ProjFun2(AH,R,Op2)
shows Mha,Ah b,cii = AhMh a,bi,Mh a,cii ∧MhAh b,ci,ai = AhMh b,ai,Mh c,aii
prooffrom A2 obtain s q r where D1: s∈AH r∈AH q∈AH
a = R{s} b = R{q} c = R{r}using quotient_def by autofrom A1 have T1:equiv(AH,R)
using Group_ZF_3_3_L3 by simp
with A1 A3 D1 groupAssum isAbelian have
Mh a,Ah b,ci i = R{s◦(q·r)}using Group_ZF_3_3_L4 EquivClass_1_L10
Group_ZF_3_2_L15 Group_ZF_3_4_L13A by simp
also have R{s◦(q·r)} = R{(s◦q)·(s◦r)}
proof from T1 D1 have equiv(AH,R) s◦(q·r)≈(s◦q)·(s◦r)
using Ring_ZF_1_1_L2 by autowith A1 show thesis using equiv_class_eq by simp
qedalso from A1 T1 D1 A3 haveR{(s◦q)·(s◦r)} = AhMh a,bi,Mh a,cii
using Group_ZF_3_3_L4 Group_ZF_3_4_T1 EquivClass_1_L10
Group_ZF_3_3_L3 Group_ZF_3_4_L13A EquivClass_1_L10 Group_ZF_3_4_T1
by simp
finally show Mha,Ah b,cii = AhMh a,bi,Mh a,cii by simp
from A1 A3 T1 D1 groupAssum isAbelian show
MhAh b,ci,ai = AhMh b,ai,Mh c,aii
using Group_ZF_3_3_L4 EquivClass_1_L10 Group_ZF_3_4_L13A
Group_ZF_3_2_L15 Ring_ZF_1_1_L2 Group_ZF_3_4_T1 by simp
qed

The projection of the first group operation on almost homomorphisms is
distributive with respect to the second group operation.
lemma (in group1) Ring_ZF_1_1_L4:
assumes A1: R = QuotientGroupRel(AH,Op1,FR)
and A2: A = ProjFun2(AH,R,Op1) M = ProjFun2(AH,R,Op2)
shows IsDistributive(AH//R,A,M)
proof from A1 A2 have ∀ a∈(AH//R).∀ b∈(AH//R).∀ c∈(AH//R).
Mha,Ah b,cii = AhMh a,bi, Mh a,cii ∧MhAh b,ci, ai = AhMh b,ai,Mh c,aii
using Ring_ZF_1_1_L3 by simp
then show thesis using IsDistributive_def by simp
qed

The classes of almost homomorphisms form a ring.
theorem (in group1) Ring_ZF_1_1_T1:
assumes R = QuotientGroupRel(AH,Op1,FR)
and A = ProjFun2(AH,R,Op1) M = ProjFun2(AH,R,Op2)377

shows IsAring(AH//R,A,M)
using assms QuotientGroupOp_def Group_ZF_3_3_T1 Group_ZF_3_4_T2
Ring_ZF_1_1_L4 IsAring_def by simp
end

36

Ordered rings

theory OrderedRing_ZF imports Ring_ZF OrderedGroup_ZF_1
begin

In this theory file we consider ordered rings.

36.1

Definition and notation

This section defines ordered rings and sets up appriopriate notation.
We define ordered ring as a commutative ring with linear order that ispreserved by translations and such that the set of nonnegative elements is
closed under multiplication. Note that this definition does not guaranteethat there are no zero divisors in the ring.
definition
IsAnOrdRing(R,A,M,r) ≡( IsAring(R,A,M) ∧ (M {is commutative on} R) ∧r⊆R×R ∧ IsLinOrder(R,r) ∧(∀ a b. ∀ c∈R. h a,bi ∈ r −→ hAh a,ci,Ah b,cii ∈ r) ∧(Nonnegative(R,A,r) {is closed under} M))

The next context (locale) defines notation used for ordered rings. We dothat by extending the notation defined in the ring0 locale and adding someassumptions to make sure we are talking about ordered rings in this context.
locale ring1 = ring0 +assumes mult_commut: M {is commutative on} R
fixes rassumes ordincl: r ⊆ R×R
assumes linord: IsLinOrder(R,r)
fixes lesseq (infix ≤ 68)
defines lesseq_def [simp]: a ≤ b ≡ h a,bi ∈ rfixes sless (infix < 68)
defines sless_def [simp]: a < b ≡ a≤b ∧ a6=b378

assumes ordgroup: ∀ a b. ∀ c∈R. a≤b −→ a+c ≤ b+c
assumes pos_mult_closed: Nonnegative(R,A,r) {is closed under} M
fixes abs (| _ |)defines abs_def [simp]: |a| ≡ AbsoluteValue(R,A,r)(a)fixes positiveset (R+ )defines positiveset_def [simp]: R+ ≡ PositiveSet(R,A,r)

The next lemma assures us that we are talking about ordered rings in thering1 context.
lemma (in ring1) OrdRing_ZF_1_L1: shows IsAnOrdRing(R,A,M,r)using ring0_def ringAssum mult_commut ordincl linord ordgroup
pos_mult_closed IsAnOrdRing_def by simp

We can use theorems proven in the ring1 context whenever we talk about
an ordered ring.
lemma OrdRing_ZF_1_L2: assumes IsAnOrdRing(R,A,M,r)shows ring1(R,A,M,r)using assms IsAnOrdRing_def ring1_axioms.intro ring0_def ring1_def
by simpIn the ring1 context a ≤ b implies that a, b are elements of the ring.
lemma (in ring1) OrdRing_ZF_1_L3: assumes a≤bshows a∈R b∈R
using assms ordincl by auto

Ordered ring is an ordered group, hence we can use theorems proven in thegroup3 context.
lemma (in ring1) OrdRing_ZF_1_L4: shows
IsAnOrdGroup(R,A,r)r {is total on} R
A {is commutative on} R
group3(R,A,r)proof { fix a b g assume A1: g∈R and A2: a≤bwith ordgroup have a+g ≤ b+g
by simpmoreover from ringAssum A1 A2 have
a+g = g+a b+g = g+busing OrdRing_ZF_1_L3 IsAring_def IsCommutative_def by auto
ultimately havea+g ≤ b+g g+a ≤ g+b
by auto} hence∀ g∈R. ∀ a b. a≤b −→ a+g ≤ b+g ∧ g+a ≤ g+b379

by simp
with ringAssum ordincl linord show
IsAnOrdGroup(R,A,r)group3(R,A,r)r {is total on} R
A {is commutative on} R
using IsAring_def Order_ZF_1_L2 IsAnOrdGroup_def group3_def IsLinOrder_def
by autoqed

The order relation in rings is transitive.
lemma (in ring1) ring_ord_transitive: assumes A1: a≤b b≤cshows a≤c
proof from A1 havegroup3(R,A,r) ha,bi ∈ rhb,ci ∈ rusing OrdRing_ZF_1_L4 by auto
then have ha,ci ∈ r by (rule group3.Group_order_transitive)then show a≤c by simp
qedTransitivity for the strict order: if a < b and b ≤ c, then a < c. Property ofordered groups.
lemma (in ring1) ring_strict_ord_trans:
assumes A1: a<b and A2: b≤cshows a<cproof from A1 A2 havegroup3(R,A,r)ha,bi ∈ r ∧ a6=b hb,ci ∈ rusing OrdRing_ZF_1_L4 by auto
then have ha,ci ∈ r ∧ a6=c by (rule group3.OrderedGroup_ZF_1_L4A)
then show a<c by simp
qed

Another version of transitivity for the strict order: if a ≤ b and b < c, thena < c. Property of ordered groups.
lemma (in ring1) ring_strict_ord_transit:
assumes A1: a≤b and A2: b<cshows a<cproof from A1 A2 havegroup3(R,A,r)ha,bi ∈ r hb,ci ∈ r ∧ b6=cusing OrdRing_ZF_1_L4 by auto
then have ha,ci ∈ r ∧ a6=c by (rule group3.group_strict_ord_transit)
then show a<c by simp
qed

380

The next lemma shows what happens when one element of an ordered ringis not greater or equal than another.
lemma (in ring1) OrdRing_ZF_1_L4A: assumes A1: a∈R b∈R
and A2: ¬(a≤b)
shows b ≤ a (-a) ≤ (-b) a6=b
proof from A1 A2 have I:
group3(R,A,r)r {is total on} Ra ∈ R b ∈ R ha, bi ∈/ rusing OrdRing_ZF_1_L4 by auto
then have hb,ai ∈ r by (rule group3.OrderedGroup_ZF_1_L8)
then show b ≤ a by simp
from I have hGroupInv(R,A)(a),GroupInv(R,A)(b)i ∈ r
by (rule group3.OrderedGroup_ZF_1_L8)
then show (-a) ≤ (-b) by simp
from I show a6=b by (rule group3.OrderedGroup_ZF_1_L8)
qed

A special case of OrdRing_ZF_1_L4A when one of the constants is 0. This isuseful for many proofs by cases.
corollary (in ring1) ord_ring_split2: assumes A1: a∈Rshows a≤0 ∨ (0≤a ∧ a6=0)
proof { from A1 have I: a∈R 0∈R
using Ring_ZF_1_L2 by auto
moreover assume A2: ¬(a≤0)
ultimately have 0≤a by (rule OrdRing_ZF_1_L4A)
moreover from I A2 have a6=0 by (rule OrdRing_ZF_1_L4A)
ultimately have 0≤a ∧ a6=0 by simp}
then show thesis by auto
qed

Taking minus on both sides reverses an inequality.
lemma (in ring1) OrdRing_ZF_1_L4B: assumes a≤bshows (-b) ≤ (-a)
using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L5
by simp

The next lemma just expands the condition that requires the set of nonnegative elements to be closed with respect to multiplication. These areproperties of totally ordered groups.
lemma (in ring1) OrdRing_ZF_1_L5:
assumes 0≤a 0≤bshows 0 ≤ a·b
using pos_mult_closed assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L2
IsOpClosed_def by simp

381

Double nonnegative is nonnegative.
lemma (in ring1) OrdRing_ZF_1_L5A: assumes A1: 0≤ashows 0≤2·ausing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L5G
OrdRing_ZF_1_L3 Ring_ZF_1_L3 by simp

A sufficient (somewhat redundant) condition for a structure to be an orderedring. It says that a commutative ring that is a totally ordered group withrespect to the additive operation such that set of nonnegative elements is
closed under multiplication, is an ordered ring.
lemma OrdRing_ZF_1_L6:
assumes
IsAring(R,A,M)
M {is commutative on} R
Nonnegative(R,A,r) {is closed under} M
IsAnOrdGroup(R,A,r)r {is total on} R
shows IsAnOrdRing(R,A,M,r)using assms IsAnOrdGroup_def Order_ZF_1_L3 IsAnOrdRing_def
by simpa ≤ b iff a − b ≤ 0. This is a fact from OrderedGroup.thy, where it is statedin multiplicative notation.
lemma (in ring1) OrdRing_ZF_1_L7:
assumes a∈R b∈R
shows a≤b ←→ a-b ≤ 0
using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L9
by simp

Negative times positive is negative.
lemma (in ring1) OrdRing_ZF_1_L8:
assumes A1: a≤0 and A2: 0≤bshows a·b ≤ 0
proof from A1 A2 have T1: a∈R b∈R a·b ∈ R
using OrdRing_ZF_1_L3 Ring_ZF_1_L4 by autofrom A1 A2 have 0≤(-a)·b
using OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L5A OrdRing_ZF_1_L5
by simpwith T1 show a·b ≤ 0
using Ring_ZF_1_L7 OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L5AA
by simpqed

We can multiply both sides of an inequality by a nonnegative ring element.
This property is sometimes (not here) used to define ordered rings.
lemma (in ring1) OrdRing_ZF_1_L9:

382

assumes A1: a≤b and A2: 0≤c
showsa·c ≤ b·c
c·a ≤ c·b
proof from A1 A2 have T1:a∈R b∈R c∈R a·c ∈ R b·c ∈ Rusing OrdRing_ZF_1_L3 Ring_ZF_1_L4 by autowith A1 A2 have (a-b)·c ≤ 0
using OrdRing_ZF_1_L7 OrdRing_ZF_1_L8 by simp
with T1 show a·c ≤ b·cusing Ring_ZF_1_L8 OrdRing_ZF_1_L7 by simp
with mult_commut T1 show c·a ≤ c·b
using IsCommutative_def by simp
qed

A special case of OrdRing_ZF_1_L9: we can multiply an inequality by a positive ring element.
lemma (in ring1) OrdRing_ZF_1_L9A:
assumes A1: a≤b and A2: c∈R+shows
a·c ≤ b·c
c·a ≤ c·b
proof from A2 have 0 ≤ c using PositiveSet_def
by simpwith A1 show a·c ≤ b·c c·a ≤ c·b
using OrdRing_ZF_1_L9 by autoqed

A square is nonnegative.
lemma (in ring1) OrdRing_ZF_1_L10:
assumes A1: a∈R shows 0≤(a2 )proof { assume 0≤athen have 0≤(a2 ) using OrdRing_ZF_1_L5 by simp}
moreover{ assume ¬(0≤a)
with A1 have 0≤((-a)2 )using OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L8A
OrdRing_ZF_1_L5 by simp
with A1 have 0≤(a2 ) using Ring_ZF_1_L14 by simp }ultimately show thesis by blastqed

1 is nonnegative.
corollary (in ring1) ordring_one_is_nonneg: shows 0 ≤ 1
proof have 0 ≤ (12 ) using Ring_ZF_1_L2 OrdRing_ZF_1_L10

383

by simp
then show 0 ≤ 1 using Ring_ZF_1_L2 Ring_ZF_1_L3
by simpqed

In nontrivial rings one is positive.
lemma (in ring1) ordring_one_is_pos: assumes 06=1
shows 1 ∈ R+
using assms Ring_ZF_1_L2 ordring_one_is_nonneg PositiveSet_def
by autoNonnegative is not negative. Property of ordered groups.
lemma (in ring1) OrdRing_ZF_1_L11: assumes 0≤ashows ¬(a≤0 ∧ a6=0)
using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L5AB
by simpA negative element cannot be a square.
lemma (in ring1) OrdRing_ZF_1_L12:
assumes A1: a≤0 a6=0
shows ¬(∃ b∈R. a = (b2 ))proof { assume ∃ b∈R. a = (b2 )with A1 have False using OrdRing_ZF_1_L10 OrdRing_ZF_1_L11
by auto} then show thesis by autoqed

If a ≤ b, then 0 ≤ b − a.
lemma (in ring1) OrdRing_ZF_1_L13: assumes a≤bshows 0 ≤ b-a
using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L9D
by simp

If a < b, then 0 < b − a.
lemma (in ring1) OrdRing_ZF_1_L14: assumes a≤b a6=bshows
0 ≤ b-a 0 6= b-ab-a ∈ R+
using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L9E
by autoIf the difference is nonnegative, then a ≤ b.
lemma (in ring1) OrdRing_ZF_1_L15:
assumes a∈R b∈R and 0 ≤ b-a
shows a≤busing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L9F
by simp384

A nonnegative number is does not decrease when multiplied by a number
greater or equal 1.
lemma (in ring1) OrdRing_ZF_1_L16:
assumes A1: 0≤a and A2: 1≤bshows a≤a·b
proof from A1 A2 have T: a∈R b∈R a·b ∈ R
using OrdRing_ZF_1_L3 Ring_ZF_1_L4 by autofrom A1 A2 have 0 ≤ a·(b-1)
using OrdRing_ZF_1_L13 OrdRing_ZF_1_L5 by simp
with T show a≤a·b
using Ring_ZF_1_L8 Ring_ZF_1_L2 Ring_ZF_1_L3 OrdRing_ZF_1_L15
by simpqed

We can multiply the right hand side of an inequality between nonnegative
ring elements by an element greater or equal 1.
lemma (in ring1) OrdRing_ZF_1_L17:
assumes A1: 0≤a and A2: a≤b and A3: 1≤cshows a≤b·c
proof from A1 A2 have 0≤b by (rule ring_ord_transitive)
with A3 have b≤b·c using OrdRing_ZF_1_L16
by simpwith A2 show a≤b·c by (rule ring_ord_transitive)
qed

Strict order is preserved by translations.
lemma (in ring1) ring_strict_ord_trans_inv:
assumes a<b and c∈Rshows
a+c < b+c
c+a < c+b
using assms OrdRing_ZF_1_L4 group3.group_strict_ord_transl_inv
by autoWe can put an element on the other side of a strict inequality, changing its
sign.
lemma (in ring1) OrdRing_ZF_1_L18:
assumes a∈R b∈R and a-b < cshows a < c+busing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L12B
by simp

We can add the sides of two inequalities, the first of them strict, and we geta strict inequality. Property of ordered groups.
lemma (in ring1) OrdRing_ZF_1_L19:385

assumes a<b and c≤dshows a+c < b+dusing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L12C
by simp

We can add the sides of two inequalities, the second of them strict and we
get a strict inequality. Property of ordered groups.
lemma (in ring1) OrdRing_ZF_1_L20:
assumes a≤b and c<dshows a+c < b+dusing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L12D
by simp

36.2

Absolute value for ordered rings

Absolute value is defined for ordered groups as a function that is the identity
on the nonnegative set and the negative of the element (the inverse in themultiplicative notation) on the rest. In this section we consider propertiesof absolute value related to multiplication in ordered rings.
Absolute value of a product is the product of absolute values: the case whenboth elements of the ring are nonnegative.
lemma (in ring1) OrdRing_ZF_2_L1:
assumes 0≤a 0≤bshows |a·b| = |a|·|b|using assms OrdRing_ZF_1_L5 OrdRing_ZF_1_L4
group3.OrderedGroup_ZF_1_L2 group3.OrderedGroup_ZF_3_L2
by simp

The absolue value of an element and its negative are the same.
lemma (in ring1) OrdRing_ZF_2_L2: assumes a∈Rshows |-a| = |a|using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_3_L7A by simp

The next lemma states that |a · (−b)| = |(−a) · b| = |(−a) · (−b)| = |a · b|.
lemma (in ring1) OrdRing_ZF_2_L3:
assumes a∈R b∈Rshows|(-a)·b| = |a·b||a·(-b)| = |a·b||(-a)·(-b)| = |a·b|
using assms Ring_ZF_1_L4 Ring_ZF_1_L7 Ring_ZF_1_L7A
OrdRing_ZF_2_L2 by auto

This lemma allows to prove theorems for the case of positive and negative
elements of the ring separately.
lemma (in ring1) OrdRing_ZF_2_L4: assumes a∈R and ¬(0≤a)

386shows 0 ≤ (-a) 06=ausing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L8A
by autoAbsolute value of a product is the product of absolute values.
lemma (in ring1) OrdRing_ZF_2_L5:
assumes A1: a∈R b∈R
shows |a·b| = |a|·|b|proof { assume A2: 0≤a have |a·b| = |a|·|b|proof { assume 0≤bwith A2 have |a·b| = |a|·|b|using OrdRing_ZF_2_L1 by simp }moreover{ assume ¬(0≤b)
with A1 A2 have |a·(-b)| = |a|·|-b|using OrdRing_ZF_2_L4 OrdRing_ZF_2_L1 by simp
with A1 have |a·b| = |a|·|b|using OrdRing_ZF_2_L2 OrdRing_ZF_2_L3 by simp }ultimately show thesis by blastqed }moreover{ assume ¬(0≤a)
with A1 have A3: 0 ≤ (-a)
using OrdRing_ZF_2_L4 by simp
have |a·b| = |a|·|b|proof { assume 0≤bwith A3 have |(-a)·b| = |-a|·|b|using OrdRing_ZF_2_L1 by simp
with A1 have |a·b| = |a|·|b|using OrdRing_ZF_2_L2 OrdRing_ZF_2_L3 by simp }moreover{ assume ¬(0≤b)
with A1 A3 have |(-a)·(-b)| = |-a|·|-b|using OrdRing_ZF_2_L4 OrdRing_ZF_2_L1 by simp
with A1 have |a·b| = |a|·|b|using OrdRing_ZF_2_L2 OrdRing_ZF_2_L3 by simp }ultimately show thesis by blastqed }ultimately show thesis by blast
qed

Triangle inequality. Property of linearly ordered abelian groups.
lemma (in ring1) ord_ring_triangle_ineq: assumes a∈R b∈R
shows |a+b| ≤ |a|+|b|using assms OrdRing_ZF_1_L4 group3.OrdGroup_triangle_ineq
by simp387

If a ≤ c and b ≤ c, then a + b ≤ 2 · c.
lemma (in ring1) OrdRing_ZF_2_L6:
assumes a≤c b≤c shows a+b ≤ 2·cusing assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L5B
OrdRing_ZF_1_L3 Ring_ZF_1_L3 by simp

36.3

Positivity in ordered rings

This section is about properties of the set of positive elements R+ .
The set of positive elements is closed under ring addition. This is a propertyof ordered groups, we just reference a theorem from OrderedGroup_ZF theory
in the proof.
lemma (in ring1) OrdRing_ZF_3_L1: shows R+ {is closed under} A
using OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L13
by simp

Every element of a ring can be either in the postitive set, equal to zero or its
opposite (the additive inverse) is in the positive set. This is a property ofordered groups, we just reference a theorem from OrderedGroup_ZF theory.
lemma (in ring1) OrdRing_ZF_3_L2: assumes a∈Rshows Exactly_1_of_3_holds (a=0, a∈R+ , (-a) ∈ R+ )using assms OrdRing_ZF_1_L4 group3.OrdGroup_decomp
by simp

If a ring element a 6= 0, and it is not positive, then −a is positive.
lemma (in ring1) OrdRing_ZF_3_L2A: assumes a∈R a6=0
shows (-a) ∈ R+
using assms OrdRing_ZF_1_L4 group3.OrdGroup_cases
by simpa ∈/ R+

R+ is closed under multiplication iff the ring has no zero divisors.
lemma (in ring1) OrdRing_ZF_3_L3:
shows (R+ {is closed under} M)←→ HasNoZeroDivs(R,A,M)
proof
assume A1: HasNoZeroDivs(R,A,M){ fix a b assume a∈R+ b∈R+then have 0≤a a6=0 0≤b b6=0
using PositiveSet_def by autowith A1 have a·b ∈ R+
using OrdRing_ZF_1_L5 Ring_ZF_1_L2 OrdRing_ZF_1_L3 Ring_ZF_1_L12
OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L2A
by simp} then show R+ {is closed under} M using IsOpClosed_def
by simpnext assume A2: R+ {is closed under} M{ fix a b assume A3: a∈R b∈R and a6=0 b6=0

388

with A2 have |a·b| ∈ R+
using OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_3_L12 IsOpClosed_def
OrdRing_ZF_2_L5 by simp
with A3 have a·b 6= 0
using PositiveSet_def Ring_ZF_1_L4
OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_3_L2A
by auto} then show HasNoZeroDivs(R,A,M) using HasNoZeroDivs_def
by autoqed

Another (in addition to OrdRing_ZF_1_L6 sufficient condition that definesorder in an ordered ring starting from the positive set.
theorem (in ring0) ring_ord_by_positive_set:
assumes
A1: M {is commutative on} R and
A2: P⊆R P {is closed under} A 0 ∈/ P andA3: ∀ a∈R. a6=0 −→ (a∈P) Xor ((-a) ∈ P) and
A4: P {is closed under} M andA5: r = OrderFromPosSet(R,A,P)
shows
IsAnOrdGroup(R,A,r)IsAnOrdRing(R,A,M,r)r {is total on} R
PositiveSet(R,A,r) = P
Nonnegative(R,A,r) = P ∪ {0}HasNoZeroDivs(R,A,M)
proof from A2 A3 A5 show
I: IsAnOrdGroup(R,A,r) r {is total on} R and
II: PositiveSet(R,A,r) = P and
III: Nonnegative(R,A,r) = P ∪ {0}using Ring_ZF_1_L1 group0.Group_ord_by_positive_set
by autofrom A2 A4 III have Nonnegative(R,A,r) {is closed under} M
using Ring_ZF_1_L16 by simp
with ringAssum A1 I show IsAnOrdRing(R,A,M,r)using OrdRing_ZF_1_L6 by simp
with A4 II show HasNoZeroDivs(R,A,M)
using OrdRing_ZF_1_L2 ring1.OrdRing_ZF_3_L3
by autoqed

Nontrivial ordered rings are infinite. More precisely we assume that theneutral element of the additive operation is not equal to the multiplicative
neutral element and show that the the set of positive elements of the ring is
not a finite subset of the ring and the ring is not a finite subset of itself.
theorem (in ring1) ord_ring_infinite: assumes 06=1
shows

389

R+ ∈
/ Fin(R)R ∈/ Fin(R)using assms Ring_ZF_1_L17 OrdRing_ZF_1_L4 group3.Linord_group_infinite
by autoIf every element of a nontrivial ordered ring can be dominated by an elementfrom B, then we B is not bounded and not finite.
lemma (in ring1) OrdRing_ZF_3_L4:
assumes 06=1 and ∀ a∈R. ∃ b∈B. a≤b
shows¬IsBoundedAbove(B,r)
B ∈/ Fin(R)using assms Ring_ZF_1_L17 OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_2_L2A
by autoIf m is greater or equal the multiplicative unit, then the set {m · n : n ∈ R}
is infinite (unless the ring is trivial).
lemma (in ring1) OrdRing_ZF_3_L5: assumes A1: 06=1 and A2: 1≤m
shows{m·x. x∈R+ } ∈/ Fin(R){m·x. x∈R} ∈/ Fin(R){(-m)·x. x∈R} ∈/ Fin(R)proof from A2 have T: m∈R using OrdRing_ZF_1_L3 by simp
from A2 have 0≤1 1≤musing ordring_one_is_nonneg by auto
then have I: 0≤m by (rule ring_ord_transitive)
let B = {m·x. x∈R+ }{ fix a assume A3: a∈Rthen have a≤0 ∨ (0≤a ∧ a6=0)
using ord_ring_split2 by simp
moreover{ assume A4: a≤0from A1 have m·1 ∈ B using ordring_one_is_pos
by autowith T have m∈B using Ring_ZF_1_L3 by simp
moreover from A4 I have a≤m by (rule ring_ord_transitive)
ultimately have ∃ b∈B. a≤b by blast }moreover{ assume A4: 0≤a ∧ a6=0
with A3 have m·a ∈ B using PositiveSet_def
by automoreoverfrom A2 A4 have 1·a ≤ m·a using OrdRing_ZF_1_L9
by simpwith A3 have a ≤ m·a using Ring_ZF_1_L3
by simpultimately have ∃ b∈B. a≤b by auto }
ultimately have ∃ b∈B. a≤b by auto390

} then have ∀ a∈R. ∃ b∈B. a≤b
by simpwith A1 show B ∈/ Fin(R) using OrdRing_ZF_3_L4
by simpmoreover have B ⊆ {m·x. x∈R}
using PositiveSet_def by auto
ultimately show {m·x. x∈R} ∈/ Fin(R) using Fin_subset
by autowith T show {(-m)·x. x∈R} ∈/ Fin(R) using Ring_ZF_1_L18
by simpqed

If m is less or equal than the negative of multiplicative unit, then the set{m · n : n ∈ R} is infinite (unless the ring is trivial).
lemma (in ring1) OrdRing_ZF_3_L6: assumes A1: 06=1 and A2: m ≤ -1
shows {m·x. x∈R} ∈/ Fin(R)proof from A2 have (-(-1)) ≤ -musing OrdRing_ZF_1_L4B by simp
with A1 have {(-m)·x. x∈R} ∈/ Fin(R)using Ring_ZF_1_L2 Ring_ZF_1_L3 OrdRing_ZF_3_L5
by simpwith A2 show {m·x. x∈R} ∈/ Fin(R)using OrdRing_ZF_1_L3 Ring_ZF_1_L18 by simpqed

All elements greater or equal than an element of R+ belong to R+ . Propertyof ordered groups.
lemma (in ring1) OrdRing_ZF_3_L7: assumes A1: a ∈ R+ and A2: a≤bshows b ∈ R+
proof from A1 A2 havegroup3(R,A,r)a ∈ PositiveSet(R,A,r)ha,bi ∈ rusing OrdRing_ZF_1_L4 by auto
then have b ∈ PositiveSet(R,A,r)by (rule group3.OrderedGroup_ZF_1_L19)
then show b ∈ R+ by simp
qed

A special case of OrdRing_ZF_3_L7: a ring element greater or equal than 1 ispositive.
corollary (in ring1) OrdRing_ZF_3_L8: assumes A1: 06=1 and A2: 1≤ashows a ∈ R+
proof from A1 A2 have 1 ∈ R+ 1≤ausing ordring_one_is_pos by auto391

then show a ∈ R+ by (rule OrdRing_ZF_3_L7)
qed

Adding a positive element to a strictly increases a. Property of orderedgroups.
lemma (in ring1) OrdRing_ZF_3_L9: assumes A1: a∈R b∈R+
shows a ≤ a+b a 6= a+b
using assms OrdRing_ZF_1_L4 group3.OrderedGroup_ZF_1_L22
by autoA special case of OrdRing_ZF_3_L9: in nontrivial rings adding one to a increases a.
corollary (in ring1) OrdRing_ZF_3_L10: assumes A1: 06=1 and A2: a∈Rshows a ≤ a+1 a 6= a+1
using assms ordring_one_is_pos OrdRing_ZF_3_L9
by autoIf a is not greater than b, then it is strictly less than b + 1.
lemma (in ring1) OrdRing_ZF_3_L11: assumes A1: 06=1 and A2: a≤bshows a< b+1
proof from A1 A2 have I: b < b+1
using OrdRing_ZF_1_L3 OrdRing_ZF_3_L10 by autowith A2 show a< b+1 by (rule ring_strict_ord_transit)qed

For any ring element a the greater of a and 1 is a positive element that isgreater or equal than m. If we add 1 to it we get a positive element that isstrictly greater than m. This holds in nontrivial rings.
lemma (in ring1) OrdRing_ZF_3_L12: assumes A1: 06=1 and A2: a∈Rshowsa ≤ GreaterOf(r,1,a)GreaterOf(r,1,a) ∈ R+
GreaterOf(r,1,a) + 1 ∈ R+a ≤ GreaterOf(r,1,a) + 1 a 6= GreaterOf(r,1,a) + 1
proof from linord have r {is total on} R using IsLinOrder_def
by simpmoreover from A2 have 1 ∈ R a∈R
using Ring_ZF_1_L2 by auto
ultimately have
1 ≤ GreaterOf(r,1,a) and
I: a ≤ GreaterOf(r,1,a)using Order_ZF_3_L2 by autowith A1 showa ≤ GreaterOf(r,1,a) andGreaterOf(r,1,a) ∈ R+
using OrdRing_ZF_3_L8 by auto392

with A1 show GreaterOf(r,1,a) + 1 ∈ R+
using ordring_one_is_pos OrdRing_ZF_3_L1 IsOpClosed_def
by simpfrom A1 I showa ≤ GreaterOf(r,1,a) + 1 a 6= GreaterOf(r,1,a) + 1
using OrdRing_ZF_3_L11 by autoqed

We can multiply strict inequality by a positive element.
lemma (in ring1) OrdRing_ZF_3_L13:
assumes A1: HasNoZeroDivs(R,A,M) andA2: a<b and A3: c∈R+shows
a·c < b·c
c·a < c·b
proof from A2 A3 have T: a∈R b∈R c∈R c6=0
using OrdRing_ZF_1_L3 PositiveSet_def by autofrom A2 A3 have a·c ≤ b·c using OrdRing_ZF_1_L9A
by simpmoreover from A1 A2 T have a·c 6= b·cusing Ring_ZF_1_L12A by auto
ultimately show a·c < b·c by simp
moreover from mult_commut T have a·c = c·a and b·c = c·busing IsCommutative_def by auto
ultimately show c·a < c·b by simpqed

A sufficient condition for an element to be in the set of positive ring elements.
lemma (in ring1) OrdRing_ZF_3_L14: assumes 0≤a and a6=0
shows a ∈ R+
using assms OrdRing_ZF_1_L3 PositiveSet_def
by autoIf a ring has no zero divisors, the square of a nonzero element is positive.
lemma (in ring1) OrdRing_ZF_3_L15:
assumes HasNoZeroDivs(R,A,M) and a∈R a6=0
shows 0 ≤ a2 a2 6= 0 a2 ∈ R+
using assms OrdRing_ZF_1_L10 Ring_ZF_1_L12 OrdRing_ZF_3_L14
by autoIn rings with no zero divisors we can (strictly) increase a positive elementby multiplying it by an element that is greater than 1.
lemma (in ring1) OrdRing_ZF_3_L16:
assumes HasNoZeroDivs(R,A,M) and a ∈ R+ and 1≤b 16=b
shows a≤a·b a 6= a·busing assms PositiveSet_def OrdRing_ZF_1_L16 OrdRing_ZF_1_L3
Ring_ZF_1_L12C by auto393

If the right hand side of an inequality is positive we can multiply it by anumber that is greater than one.
lemma (in ring1) OrdRing_ZF_3_L17:
assumes A1: HasNoZeroDivs(R,A,M) and A2: b∈R+ andA3: a≤b and A4: 1<cshows a<b·c
proof from A1 A2 A4 have b < b·cusing OrdRing_ZF_3_L16 by autowith A3 show a<b·c by (rule ring_strict_ord_transit)qed

We can multiply a right hand side of an inequality between positive numbers
by a number that is greater than one.
lemma (in ring1) OrdRing_ZF_3_L18:
assumes A1: HasNoZeroDivs(R,A,M) and A2: a ∈ R+ andA3: a≤b and A4: 1<cshows a<b·c
proof from A2 A3 have b ∈ R+ using OrdRing_ZF_3_L7
by blastwith A1 A3 A4 show a<b·cusing OrdRing_ZF_3_L17 by simp
qed

In ordered rings with no zero divisors if at least one of a, b is not zero, then
0 < a2 + b2 , in particular a2 + b2 6= 0.
lemma (in ring1) OrdRing_ZF_3_L19:
assumes A1: HasNoZeroDivs(R,A,M) and A2: a∈R
A3: a 6= 0 ∨ b 6= 0
shows 0 < a2 + b2
proof { assume a 6= 0
with A1 A2 have 0 ≤ a2 a2 6= 0
using OrdRing_ZF_3_L15 by auto
then have 0 < a2 by auto
moreover from A2 have 0 ≤ b2
using OrdRing_ZF_1_L10 by simp
ultimately have 0 + 0 < a2 + b2
using OrdRing_ZF_1_L19 by simp
then have 0 < a2 + b2
using Ring_ZF_1_L2 Ring_ZF_1_L3 by simp }moreover{ assume A4: a = 0
then have a2 + b2 = 0 + b2
using Ring_ZF_1_L2 Ring_ZF_1_L6 by simp
also from A2 have . . . = b2
using Ring_ZF_1_L4 Ring_ZF_1_L3 by simp394b∈R andfinally have a2 + b2 = b2 by simp
moreoverfrom A3 A4 have b 6= 0 by simp
with A1 A2 have 0 ≤ b2 and b2 6= 0
using OrdRing_ZF_3_L15 by auto
hence 0 < b2 by auto
ultimately have 0 < a2 + b2 by simp }ultimately show 0 < a2 + b2
by auto
qed

end

37

Cardinal numbers

theory Cardinal_ZF imports ZF.CardinalArith func1
beginThis theory file deals with results on cardinal numbers (cardinals). Cardinals
are a genaralization of the natural numbers, used to measure the cardinality(size) of sets. Contributed by Daniel de la Concepcion.

37.1

Some new ideas on cardinals

All the results of this section are done without assuming the Axiom of
Choice. With the Axiom of Choice in play, the proofs become easier andsome of the assumptions may be dropped.
Since General Topology Theory is closely related to Set Theory, it is very
interesting to make use of all the possibilities of Set Theory to try to classify
homeomorphic topological spaces. These ideas are generally used to provethat two topological spaces are not homeomorphic.
There exist cardinals which are the successor of another cardinal, but; ashappens with ordinals, there are cardinals which are limit cardinal.
definition
LimitC(i) ≡ Card(i) ∧ 0<i ∧ (∀ y. (y<i∧Card(y)) −→ csucc(y)<i)

Simple fact used a couple of times in proofs.
lemma nat_less_infty: assumes n∈nat and InfCard(X) shows n<X
proof from assms have n<nat and nat≤X using lt_def InfCard_def by auto
then show n<X using lt_trans2 by blast

395

qed

There are three types of cardinals, the zero one, the succesors of other cardinals and the limit cardinals.
lemma Card_cases_disj:
assumes Card(i)shows i=0 | (∃ j. Card(j) ∧ i=csucc(j)) | LimitC(i)proof from assms have D: Ord(i) using Card_is_Ord by auto{
assume F: i6=0
assume Contr: ~LimitC(i)from F D have 0<i using Ord_0_lt by autowith Contr assms have ∃ y. y < i ∧ Card(y) ∧ ¬ csucc(y) < iusing LimitC_def by blast
then obtain y where y < i ∧ Card(y) ∧ ¬ csucc(y) < i by blast
with D have y < i i≤csucc(y) and O: Card(y)using not_lt_imp_le lt_Ord Card_csucc Card_is_Ordby autowith assms have csucc(y)≤ii≤csucc(y) using csucc_le by auto
then have i=csucc(y) using le_anti_sym by autowith O have ∃ j. Card(j) ∧ i=csucc(j) by auto
} thus thesis by auto
qed

Given an ordinal bounded by a cardinal in ordinal order, we can change tothe order of sets.
lemma le_imp_lesspoll:assumes Card(Q)shows A ≤ Q =⇒ A . Q
proof assume A ≤ Q
then have A<Q∨A=Q using le_iff by auto
then have A≈Q∨A< Q using eqpoll_refl by autowith assms have A≈Q∨A≺ Q using lt_Card_imp_lesspoll by auto
then show A.Q using lesspoll_def eqpoll_imp_lepoll by autoqed

There are two types of infinite cardinals, the natural numbers and those thathave at least one infinite strictly smaller cardinal.
lemma InfCard_cases_disj:
assumes InfCard(Q)shows Q=nat ∨ (∃ j. csucc(j).Q ∧ InfCard(j))
proof {
assume ∀ j. ¬ csucc(j) . Q ∨ ¬ InfCard(j)then have D: ¬ csucc(nat) . Q using InfCard_nat by autowith D assms have ¬(csucc(nat) ≤ Q) using le_imp_lesspoll InfCard_is_Card396

by auto
with assms have Q<(csucc(nat))using not_le_iff_lt Card_is_Ord Card_csucc Card_is_Ord
Card_is_Ord InfCard_is_Card Card_nat by autowith assms have Q≤nat using Card_lt_csucc_iff InfCard_is_Card Card_nat
by autowith assms have Q=nat using InfCard_def le_anti_sym by auto}
thus thesis by autoqed

A more readable version of standard Isabelle/ZF Ord_linear_lt
lemma Ord_linear_lt_IML: assumes Ord(i) Ord(j)shows i<j ∨ i=j ∨ j<iusing assms lt_def Ord_linear disjE by simp

A set is injective and not bijective to the successor of a cardinal if and only
if it is injective and possibly bijective to the cardinal.
lemma Card_less_csucc_eq_le:
assumes Card(m)shows A ≺ csucc(m) ←→ A . m
proofhave S: Ord(csucc(m)) using Card_csucc Card_is_Ord assms by auto{
assume A: A ≺ csucc(m)with S have |A|≈A using lesspoll_imp_eqpoll by auto
also from A have . . .≺ csucc(m) by auto
finally have |A|≺ csucc(m) by auto
then have |A|.csucc(m)~(|A|≈csucc(m)) using lesspoll_def by autowith S have ||A||≤csucc(m)|A|6=csucc(m) using lepoll_cardinal_leby autothen have |A|≤csucc(m) |A|6=csucc(m) using Card_def Card_cardinalby autothen have I: ~(csucc(m)<|A|) |A|6=csucc(m) using le_imp_not_lt by
auto
from S have csucc(m)<|A| ∨ |A|=csucc(m) ∨ |A|<csucc(m)using Card_cardinal Card_is_Ord Ord_linear_lt_IML by autowith I have |A|<csucc(m) by simp
with assms have |A|≤m using Card_lt_csucc_iff Card_cardinalby autothen have |A|=m∨ |A|< m using le_iff by auto
then have |A|≈m∨|A|< m using eqpoll_refl by auto
then have |A|≈m∨|A|≺ m using lt_Card_imp_lesspoll assms by auto
then have T:|A|.m using lesspoll_def eqpoll_imp_lepoll by autofrom A S have A≈|A| using lesspoll_imp_eqpoll eqpoll_sym by auto
also from T have . . ..m by auto
finally show A.m by simp
}

397

{
assume A: A.mfrom assms have m≺csucc(m) using lt_Card_imp_lesspoll Card_csucc
Card_is_Ord
lt_csucc by autowith A show A≺csucc(m) using lesspoll_trans1 by auto}qed

If the successor of a cardinal is infinite, so is the original cardinal.
lemma csucc_inf_imp_inf:
assumes Card(j) and InfCard(csucc(j))
shows InfCard(j)proof {
assume f:Finite (j)then obtain n where n∈nat j≈n using Finite_def by autowith assms(1) have TT: j=n n∈natusing cardinal_cong nat_into_Card Card_def by auto
then have Q:succ(j)∈nat using nat_succI by autowith f TT have T: Finite(succ(j)) Card(succ(j))
using nat_into_Card nat_succI by autofrom T(2) have Card(succ(j))∧ j<succ(j) using Card_is_Ord by auto
moreover from this have Ord(succ(j)) using Card_is_Ord by auto
moreover{ fix xassume A: x<succ(j){assume Card(x)∧ j<xwith A have False using lt_trans1 by auto}
hence ~(Card(x)∧ j<x) by auto}
ultimately have (µ L. Card(L) ∧ j < L)=succ(j)by (rule Least_equality)
then have csucc(j)=succ(j) using csucc_def by autowith Q have csucc(j)∈nat by auto
then have csucc(j)<nat using lt_def Card_nat Card_is_Ord by autowith assms(2) have False using InfCard_def lt_trans2 by auto}
then have ~(Finite (j)) by autowith assms(1) show thesis using Inf_Card_is_InfCard by auto
qed

Since all the cardinals previous to nat are finite, it cannot be a successor
cardinal; hence it is a LimitC cardinal.
corollary LimitC_nat:
shows LimitC(nat)proof -

398

note Card_nat
moreover have 0<nat using lt_def by auto
moreover{fix yassume AS: y<natCard(y)then have ord: Ord(y) unfolding lt_def by auto
then have Cacsucc: Card(csucc(y)) using Card_csucc by auto{
assume nat≤csucc(y)with Cacsucc have InfCard(csucc(y)) using InfCard_def by autowith AS(2) have InfCard(y) using csucc_inf_imp_inf by auto
then have nat≤y using InfCard_def by autowith AS(1) have False using lt_trans2 by auto}
hence ~(nat≤csucc(y)) by auto
then have csucc(y)<nat using not_le_iff_lt Ord_nat Cacsucc Card_is_Ordby auto}ultimately show thesis using LimitC_def by auto
qed

37.2

Main result on cardinals (without the Axiom of Choice)If two sets are strictly injective to an infinite cardinal, then so is its union.
For the case of successor cardinal, this theorem is done in the isabelle library
in a more general setting; but that theorem is of not use in the case where
LimitC(Q) and it also makes use of the Axiom of Choice. The mentioned
theorem is in the theory file Cardinal_AC.thy
Note that if Q is finite and different from 1, let’s assume Q = n, then theunion of A and B is not bounded by Q. Counterexample: two disjoint setsof n − 1 elements each have a union of 2n − 2 elements which are more thann.
Note also that if Q = 1 then A and B must be empty and the union is thenempty too; and Q cannot be 0 because no set is injective and not bijective
to 0.
The proof is divided in two parts, first the case when both sets A and B
are finite; and second, the part when at least one of them is infinite. In thefirst part, it is used the fact that a finite union of finite sets is finite. In thesecond part it is used the linear order on cardinals (ordinals). This proof
can not be generalized to a setting with an infinite union easily.
lemma less_less_imp_un_less:assumes A≺Q and B≺Q and InfCard(Q)shows A ∪ B≺Q
proof {

399

assume Finite (A) ∧ Finite(B)then have Finite(A ∪ B) using Finite_Un by auto
then obtain n where R: A ∪ B ≈n n∈nat using Finite_def
by autothen have |A ∪ B|<nat using lt_def cardinal_cong
nat_into_Card Card_def Card_nat Card_is_Ord by autowith assms(3) have T: |A ∪ B|<Q using InfCard_def lt_trans2 by autofrom R have Ord(n)A ∪ B . n using nat_into_Card Card_is_Ord eqpoll_imp_lepoll
by autothen have A ∪ B≈|A ∪ B| using lepoll_Ord_imp_eqpoll eqpoll_sym byauto
also from T assms(3) have . . .≺Q using lt_Card_imp_lesspoll InfCard_is_Cardby autofinally have A ∪ B≺Q by simp}
moreover{assume ~(Finite (A) ∧ Finite(B))
hence A: ~Finite (A) ∨ ~Finite(B) by autofrom assms have B: |A|≈A |B|≈B using lesspoll_imp_eqpoll lesspoll_imp_eqpoll
InfCard_is_Card Card_is_Ord by autofrom B(1) have Aeq: ∀ x. (|A|≈x) −→ (A≈x)
using eqpoll_sym eqpoll_trans by blastfrom B(2) have Beq: ∀ x. (|B|≈x) −→ (B≈x)
using eqpoll_sym eqpoll_trans by blast
with A Aeq have ~Finite(|A|)∨ ~Finite(|B|) using Finite_def
by autothen have D: InfCard(|A|)∨InfCard(|B|)
using Inf_Card_is_InfCard Inf_Card_is_InfCard Card_cardinal by blast{
assume AS: |A| < |B|{assume ~InfCard(|A|)
with D have InfCard(|B|) by auto}
moreover{assume InfCard(|A|)
then have nat≤|A| using InfCard_def by autowith AS have nat<|B| using lt_trans1 by auto
then have nat≤|B| using leI by auto
then have InfCard(|B|) using InfCard_def Card_cardinal by auto}
ultimately have INFB: InfCard(|B|) by auto
then have 2<|B| using nat_less_infty by simp
then have AG: 2.|B| using lt_Card_imp_lesspoll Card_cardinal lesspoll_def
by autofrom B(2) have |B|≈B by simp
also from assms(2) have . . .≺Q by auto

400

finally have TTT: |B|≺Q by simp
from B(1) have Card(|B|) A .|A| using eqpoll_sym Card_cardinal eqpoll_imp_lepoll
by autowith AS have A≺|B| using lt_Card_imp_lesspoll lesspoll_trans1 by
autothen have I1: A.|B| using lesspoll_def by autofrom B(2) have I2: B.|B| using eqpoll_sym eqpoll_imp_lepoll by
auto
have A ∪ B.A+B using Un_lepoll_sum by auto
also from I1 I2 have . . .. |B| + |B| using sum_lepoll_mono by auto
also from AG have . . ..|B| * |B| using sum_lepoll_prod by auto
also from assms(3) INFB have . . .≈|B| using InfCard_square_eqpoll
by autofinally have A ∪ B.|B| by simp
also from TTT have . . .≺Q by auto
finally have A ∪ B≺Q by simp}
moreover{assume AS: |B| < |A|{assume ~InfCard(|B|)
with D have InfCard(|A|) by auto}
moreover{assume InfCard(|B|)
then have nat≤|B| using InfCard_def by autowith AS have nat<|A| using lt_trans1 by auto
then have nat≤|A| using leI by auto
then have InfCard(|A|) using InfCard_def Card_cardinal by auto}
ultimately have INFB: InfCard(|A|) by auto
then have 2<|A| using nat_less_infty by simp
then have AG: 2.|A| using lt_Card_imp_lesspoll Card_cardinal lesspoll_def
by autofrom B(1) have |A|≈A by simp
also from assms(1) have . . .≺Q by auto
finally have TTT: |A|≺Q by simp
from B(2) have Card(|A|) B .|B| using eqpoll_sym Card_cardinal eqpoll_imp_lepoll
by autowith AS have B≺|A| using lt_Card_imp_lesspoll lesspoll_trans1 by
autothen have I1: B.|A| using lesspoll_def by autofrom B(1) have I2: A.|A| using eqpoll_sym eqpoll_imp_lepoll by auto
have A ∪ B.A+B using Un_lepoll_sum by auto
also from I1 I2 have . . .. |A| + |A| using sum_lepoll_mono by auto

401

also from AG have . . ..|A| * |A| using sum_lepoll_prod by auto
also from INFB assms(3) have . . .≈|A| using InfCard_square_eqpoll
by autofinally have A ∪ B.|A| by simp
also from TTT have . . .≺Q by auto
finally have A ∪ B≺Q by simp}
moreover{assume AS: |A|=|B|with D have INFB: InfCard(|A|) by auto
then have 2<|A| using nat_less_infty by simp
then have AG: 2.|A| using lt_Card_imp_lesspoll Card_cardinal using lesspoll_def
by autofrom B(1) have |A|≈A by simp
also from assms(1) have . . .≺Q by auto
finally have TTT: |A|≺Q by simp
from AS B have I1: A.|A|and I2:B.|A| using eqpoll_refl eqpoll_imp_lepoll
eqpoll_sym by auto
have A ∪ B.A+B using Un_lepoll_sum by auto
also from I1 I2 have . . .. |A| + |A| using sum_lepoll_mono by auto
also from AG have . . ..|A| * |A| using sum_lepoll_prod by auto
also from assms(3) INFB have . . .≈|A| using InfCard_square_eqpoll
by autofinally have A ∪ B.|A| by simp
also from TTT have . . .≺Q by auto
finally have A ∪ B≺Q by simp}
ultimately have A ∪ B≺Q using Ord_linear_lt_IML Card_cardinal Card_is_Ordby auto}ultimately show A ∪ B≺Q by auto
qed

37.3

Choice axioms

We want to prove some theorems assuming that some version of the Axiomof Choice holds. To avoid introducing it as an axiom we will defin an appropriate predicate and put that in the assumptions of the theorems. Thatway technically we stay inside ZF.
The first predicate we define states that the axiom of Q-choice holds for
subsets of K if we can find a choice function for every family of subsets of
K whose (that family’s) cardinality does not exceed Q.
definition
AxiomCardinalChoice ({the axiom of}_{choice holds for subsets}_) where{the axiom of} Q {choice holds for subsets}K ≡ Card(Q) ∧ (∀ M N. (M

402

.Q ∧

(∀ t∈M. Nt6=0 ∧ Nt⊆K)) −→ (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)))

Next we define a general form of Q choice where we don’t require a collectionof files to be included in a file.
definition
AxiomCardinalChoiceGen ({the axiom of}_{choice holds}) where{the axiom of} Q {choice holds} ≡ Card(Q) ∧ (∀ M N. (M .Q ∧Nt6=0)) −→ (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)))(∀ t∈M.

The axiom of finite choice always holds.
theorem finite_choice:assumes n∈nat
shows {the axiom of} n {choice holds}
proof note assms(1)moreover{fix M N assume M.0 ∀ t∈M. Nt6=0
then have M=0 using lepoll_0_is_0 by auto
then have {ht,0i. t∈M}:Pi(M,λt. Nt) unfolding Pi_def domain_def function_def
Sigma_def by auto
moreover from hM=0i have ∀ t∈M. {ht,0i. t∈M}t∈Nt by auto
ultimately have (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)) by auto}
then have (∀ M N. (M .0 ∧ (∀ t∈M. Nt6=0)) −→ (∃ f. f:Pi(M,λt. Nt)∧ (∀ t∈M. ft∈Nt)))by autothen have {the axiom of} 0 {choice holds} using AxiomCardinalChoiceGen_def
nat_into_Cardby automoreover {fix xassume as: x∈nat {the axiom of} x {choice holds}{
fix M N assume ass: M.succ(x) ∀ t∈M. Nt6=0{
assume M.x
from as(2) ass(2) have
(M . x ∧ (∀ t∈M. N t 6= 0)) −→ (∃ f. f ∈ Pi(M,λt. N t) ∧(∀ t∈M. f t ∈ N t))
unfolding AxiomCardinalChoiceGen_def by autowith hM.xi ass(2) have (∃ f. f ∈ Pi(M,λt. N t) ∧ (∀ t∈M. f t∈ N t))by auto}moreover{assume M≈succ(x)403then obtain f where f:f∈bij(succ(x),M) using eqpoll_sym eqpoll_def
by blast
moreoverhave x∈succ(x) unfolding succ_def by auto
ultimately have restrict(f,succ(x)-{x})∈bij(succ(x)-{x},M-{fx})using bij_restrict_rem
by automoreoverhave x∈x/ using mem_not_refl by auto
then have succ(x)-{x}=x unfolding succ_def by auto
ultimately have restrict(f,x)∈bij(x,M-{fx}) by auto
then have x≈M-{fx} unfolding eqpoll_def by auto
then have M-{fx}≈x using eqpoll_sym by auto
then have M-{fx}.x using eqpoll_imp_lepoll by autowith as(2) ass(2) have (∃ g. g ∈ Pi(M-{fx},λt. N t) ∧ (∀ t∈M-{fx}.
g t ∈ N t))
unfolding AxiomCardinalChoiceGen_def by auto
then obtain g where g: g∈ Pi(M-{fx},λt. N t) ∀ t∈M-{fx}. g t∈ N t
by autofrom f have ff: fx∈M using bij_def inj_def apply_funtype by autowith ass(2) have N(fx)6=0 by auto
then obtain y where y: y∈N(fx) by autofrom g(1) have gg: g⊆Sigma(M-{fx},()(N)) unfolding Pi_def by
autowith y ff have g ∪{hfx, yi}⊆Sigma(M, ()(N)) unfolding Sigma_def
by automoreoverfrom g(1) have dom: M-{fx}⊆domain(g) unfolding Pi_def by auto
then have M⊆domain(g ∪{hfx, yi}) unfolding domain_def by auto
moreoverfrom gg g(1) have noe: ~(∃ t. hfx,ti∈g) and function(g)unfolding domain_def Pi_def Sigma_def by autowith dom have fg: function(g ∪{hfx, yi}) unfolding function_def
by blast
ultimately have PP: g ∪{hfx, yi}∈Pi(M,λt. N t) unfolding Pi_def
by autohave hfx, yi ∈ g ∪{hfx, yi} by autofrom this fg have (g ∪{hfx, yi})(fx)=y by (rule function_apply_equality)with y have (g ∪{hfx, yi})(fx)∈N(fx) by auto
moreover{fix t assume A:t∈M-{fx}with g(1) have ht,gti∈g using apply_Pair by auto
then have ht,gti∈(g ∪{hfx, yi}) by auto
then have (g ∪{hfx, yi})t=gt using apply_equality PP by autowith A have (g ∪{hfx, yi})t∈Nt using g(2) by auto}404

ultimately have ∀ t∈M. (g ∪{hfx, yi})t∈Nt by autowith PP have ∃ g. g∈Pi(M,λt. N t) ∧ (∀ t∈M. gt∈Nt) by auto}
ultimately have ∃ g. g ∈ Pi(M, λt. Nt) ∧ (∀ t∈M. g t ∈ N t) using as(1) ass(1)lepoll_succ_disj by auto}
then have ∀ M N. M . succ(x)∧(∀ t∈M. Nt6=0)−→(∃ g. g ∈ Pi(M,λt. Nt) ∧ (∀ t∈M. g t ∈ N t))
by autothen have {the axiom of}succ(x){choice holds}
using AxiomCardinalChoiceGen_def nat_into_Card as(1) nat_succI by
auto}
ultimately show thesis by (rule nat_induct)qed

The axiom of choice holds if and only if the AxiomCardinalChoice holds forevery couple of a cardinal Q and a set K.
lemma choice_subset_imp_choice:shows {the axiom of} Q {choice holds} ←→ (∀ K. {the axiom of} Q {choiceholds for subsets}K)
unfolding AxiomCardinalChoice_def AxiomCardinalChoiceGen_def by blast

A choice axiom for greater cardinality implies one for smaller cardinality
lemma greater_choice_imp_smaller_choice:assumes Q.Q1 Card(Q)shows {the axiom of} Q1 {choice holds} −→ ({the axiom of} Q {choiceholds}) using assms
AxiomCardinalChoiceGen_def lepoll_trans by autoIf we have a surjective function from a set which is injective to a set ofordinals, then we can find an injection which goes the other way.
lemma surj_fun_inv:
assumes f ∈ surj(A,B) A⊆Q Ord(Q)shows B.A
proof let g = {hm,µ j. j∈A ∧ f(j)=mi. m∈B}
have g:B→range(g) using lam_is_fun_range by simp
then have fun: g:B→g(B) using range_image_domain by simp
from assms(2,3) have OA: ∀ j∈A. Ord(j) using lt_def Ord_in_Ord by auto{
fix x
assume x∈g(B)then have x∈range(g) and ∃ y∈B. hy,xi∈g by auto
then obtain y where T: x=(µ j. j∈A∧ f(j)=y) and y∈B by autowith assms(1) OA obtain z where P: z∈A ∧ f(z)=y Ord(z) unfolding
surj_def405

by auto
with T have x∈A ∧ f(x)=y using LeastI by simp
hence x∈A by simp}
then have g(B) ⊆ A by autowith fun have fun2: g:B→A using fun_weaken_type by auto
then have g∈inj(B,A)
proof {
fix w xassume AS: gw=gx w∈B x∈Bfrom assms(1) OA AS(2,3) obtain wz xz where
P1: wz∈A ∧ f(wz)=w Ord(wz) and P2: xz∈A ∧ f(xz)=x

Ord(xz)unfolding surj_def by blastfrom P1 have (µ j. j∈A∧ fj=w) ∈ A ∧ f(µ j. j∈A∧ fj=w)=w
by (rule LeastI)
moreover from P2 have (µ j. j∈A∧ fj=x) ∈ A ∧ f(µ j. j∈A∧ fj=x)=xby (rule LeastI)
ultimately have R: f(µ j. j∈A∧ fj=w)=w f(µ j. j∈A∧ fj=x)=x
by autofrom AS have (µ j. j∈A∧ f(j)=w)=(µ j. j∈A ∧ f(j)=x)
using apply_equality fun2 by auto
hence f(µ j. j∈A ∧ f(j)=w) = f(µ j. j∈A ∧ f(j)=x) by autowith R(1) have w = f(µ j. j∈A∧ fj=x) by autowith R(2) have w=x by auto}
hence ∀ w∈B. ∀ x∈B. g(w) = g(x) −→ w = x
by autowith fun2 show g∈inj(B,A) unfolding inj_def by autoqed
then show thesis unfolding lepoll_def by autoqed

The difference with the previous result is that in this one A is not a subset
of an ordinal, it is only injective with one.
theorem surj_fun_inv_2:
assumes f:surj(A,B) A.Q Ord(Q)shows B.A
proof from assms(2) obtain h where h_def: h∈inj(A,Q) using lepoll_def by
auto
then have bij: h∈bij(A,range(h)) using inj_bij_range by auto
then obtain h1 where h1∈bij(range(h),A) using bij_converse_bij by
auto
then have h1 ∈ surj(range(h),A) using bij_def by autowith assms(1) have (f O h1)∈surj(range(h),B) using comp_surj by auto
moreover{406

fix xassume p: x∈range(h)from bij have h∈surj(A,range(h)) using bij_def by autowith p obtain q where q∈A and h(q)=x using surj_def by auto
then have x∈Q using h_def inj_def by auto}
then have range(h)⊆Q by auto
ultimately have B.range(h) using surj_fun_inv assms(3) by auto
moreover have range(h)≈A using bij eqpoll_def eqpoll_sym by blast
ultimately show B.A using lepoll_eq_trans by auto
qed

end

38

Groups 4

theory Group_ZF_4 imports Group_ZF_1 Group_ZF_2 Finite_ZF Ring_ZF
Cardinal_ZF Semigroup_ZF
begin

This theory file deals with normal subgroup test and some finite group theory. Then we define group homomorphisms and prove that the set of endomorphisms forms a ring with unity and we also prove the first isomorphism
theorem.

38.1

Conjugation of subgroups

The conjugate of a subgroup is a subgroup.
theorem(in group0) semigr0:
shows semigr0(G,P)
unfolding semigr0_def using groupAssum IsAgroup_def IsAmonoid_def by
auto
theorem (in group0) conj_group_is_group:
assumes IsAsubgroup(H,P) g∈Gshows IsAsubgroup({g·(h·g−1 ). h∈H},P)
proof have sub:H⊆G using assms(1) group0_3_L2 by autofrom assms(2) have g−1 ∈G using inverse_in_group by auto{
fix r assume r∈{g·(h·g−1 ). h∈H}then obtain h where h:h∈H r=g·(h·(g−1 )) by autofrom h(1) have h−1 ∈H using group0_3_T3A assms(1) by autofrom h(1) sub have h∈G by auto
then have h−1 ∈G using inverse_in_group by autowith hg−1 ∈Gi have ((h−1 )·(g)−1 )∈G using group_op_closed by auto

407

from h(2) have r−1 =(g·(h·(g−1 )))−1 by auto moreoverfrom hh∈Gi hg−1 ∈Gi have s:h·(g−1 )∈G using group_op_closed by blast
ultimately have r−1 =(h·(g−1 ))−1 ·(g)−1 using group_inv_of_two[OF assms(2)]by automoreoverfrom s assms(2) h(2) have r:r∈G using group_op_closed by auto
have (h·(g−1 ))−1 =(g−1 )−1 ·h−1 using group_inv_of_two[OF hh∈Gihg−1 ∈Gi]by automoreover have (g−1 )−1 =g using group_inv_of_inv[OF assms(2)] by auto
ultimately have r−1 =(g·(h−1 ))·(g)−1 by auto
then have r−1 =g·((h−1 )·(g)−1 ) using group_oper_assoc[OF assms(2) hh−1 ∈Gihg−1 ∈Gi]by autowith hh−1 ∈Hi r have r−1 ∈{g·(h·g−1 ). h∈H} r∈G by auto}
then have ∀ r∈{g·(h·g−1 ). h∈H}. r−1 ∈{g·(h·g−1 ). h∈H} and {g·(h·g−1 ).
h∈H}⊆G by auto moreover{
fix s t assume s:s∈{g·(h·g−1 ). h∈H} and t:t∈{g·(h·g−1 ). h∈H}then obtain hs ht where hs:hs∈H s=g·(hs·(g−1 )) and ht:ht∈H t=g·(ht·(g−1 ))by autofrom hs(1) have hs∈G using sub by auto
then have g·hs∈G using group_op_closed assms(2) by auto
then have (g·hs)−1 ∈G using inverse_in_group by autofrom ht(1) have ht∈G using sub by autowith hg−1 :Gi have ht·(g−1 )∈G using group_op_closed by autofrom hs(2) ht(2) have s·t=(g·(hs·(g−1 )))·(g·(ht·(g−1 ))) by auto moreover
have g·(hs·(g−1 ))=g·hs·(g−1 ) using group_oper_assoc[OF assms(2) hhs∈Gi
hg−1 ∈Gi] by auto
then have (g·(hs·(g−1 )))·(g·(ht·(g−1 )))=(g·hs·(g−1 ))·(g·(ht·(g−1 ))) by
auto
then have (g·(hs·(g−1 )))·(g·(ht·(g−1 )))=(g·hs·(g−1 ))·(g−1−1 ·(ht·(g−1 )))using group_inv_of_inv[OF assms(2)] by auto
also have . . .=g·hs·(ht·(g−1 )) using group0_2_L14A(2)[OF h(g·hs)−1 ∈Gi
hg−1 ∈Gihht·(g−1 )∈Gi] group_inv_of_inv[OF h(g·hs)∈Gi]
by autoultimately have s·t=g·hs·(ht·(g−1 )) by auto moreover
have hs·(ht·(g−1 ))=(hs·ht)·(g−1 ) using group_oper_assoc[OF hhs∈Gihht∈Gihg−1 ∈Gi]by auto moreover
have g·hs·(ht·(g−1 ))=g·(hs·(ht·(g−1 ))) using group_oper_assoc[OF hg∈Gihhs∈Gih(ht·g−1 )∈Gi]
by autoultimately have s·t=g·((hs·ht)·(g−1 )) by auto moreoverfrom hs(1) ht(1) have hs·ht∈H using assms(1) group0_3_L6 by auto
ultimately have s·t∈{g·(h·g−1 ). h∈H} by auto}
then have {g·(h·g−1 ). h∈H} {is closed under}P unfolding IsOpClosed_def
by auto moreoverfrom assms(1) have 1∈H using group0_3_L5 by auto
then have g·(1·g−1 )∈{g·(h·g−1 ). h∈H} by auto408

then have {g·(h·g−1 ). h∈H}6=0 by auto ultimately
show thesis using group0_3_T3 by autoqed

Every set is equipollent with its conjugates.
theorem (in group0) conj_set_is_eqpoll:assumes H⊆G g∈Gshows H≈{g·(h·g−1 ). h∈H}
proof have fun:{hh,g·(h·g−1 )i. h∈H}:H→{g·(h·g−1 ). h∈H} unfolding Pi_def function_def
domain_def by auto{
fix h1 h2 assume h1∈Hh2∈H{hh,g·(h·g−1 )i. h∈H}h1={hh,g·(h·g−1 )i. h∈H}h2
with fun have g·(h1·g−1 )=g·(h2·g−1 )h1·g−1 ∈Gh2·g−1 ∈Gh1∈Gh2∈G using apply_equality
assms(1)group_op_closed[OF _ inverse_in_group[OF assms(2)]] by auto
then have h1·g−1 =h2·g−1 using group0_2_L19(2)[OF hh1·g−1 ∈Gi hh2·g−1 ∈Gi
assms(2)] by auto
then have h1=h2 using group0_2_L19(1)[OF hh1∈Gihh2∈Gi inverse_in_group[OFassms(2)]] by auto}
then have ∀ h1∈H. ∀ h2∈H. {hh,g·(h·g−1 )i. h∈H}h1={hh,g·(h·g−1 )i. h∈H}h2−→ h1=h2 by autowith fun have {hh,g·(h·g−1 )i. h∈H}∈inj(H,{g·(h·g−1 ). h∈H}) unfolding
inj_def by auto moreover{
fix ghg assume ghg∈{g·(h·g−1 ). h∈H}then obtain h where h∈H ghg=g·(h·g−1 ) by auto
then have hh,ghgi∈{hh,g·(h·g−1 )i. h∈H} by auto
then have {hh,g·(h·g−1 )i. h∈H}h=ghg using apply_equality fun by autowith hh∈Hi have ∃ h∈H. {hh,g·(h·g−1 )i. h∈H}h=ghg by auto}with fun have {hh,g·(h·g−1 )i. h∈H}∈surj(H,{g·(h·g−1 ). h∈H}) unfolding
surj_def by auto
ultimately have {hh,g·(h·g−1 )i. h∈H}∈bij(H,{g·(h·g−1 ). h∈H}) unfolding
bij_def by auto
then show thesis unfolding eqpoll_def by autoqed

Every normal subgroup contains its conjugate subgroups.
theorem (in group0) norm_group_cont_conj:
assumes IsAnormalSubgroup(G,P,H) g∈Gshows {g·(h·g−1 ). h∈H}⊆H
proof {
fix r assume r∈{g·(h·g−1 ). h∈H}then obtain h where r=g·(h·g−1 ) h∈H by auto moreover
then have h∈G using group0_3_L2 assms(1) unfolding IsAnormalSubgroup_def
by auto moreover409

from assms(2) have g−1 ∈G using inverse_in_group by auto
ultimately have r=g·h·g−1 h∈H using group_oper_assoc assms(2) by auto
then have r∈H using assms unfolding IsAnormalSubgroup_def by auto}
then show {g·(h·g−1 ). h∈H}⊆H by autoqed

If a subgroup contains all its conjugate subgroups, then it is normal.
theorem (in group0) cont_conj_is_normal:
assumes IsAsubgroup(H,P) ∀ g∈G. {g·(h·g−1 ). h∈H}⊆H
shows IsAnormalSubgroup(G,P,H)
proof {
fix h g assume h∈H g∈Gwith assms(2) have g·(h·g−1 )∈H by auto
moreover have h∈Gg−1 ∈G using group0_3_L2 assms(1) hg∈Gihh∈Hi inverse_in_groupby autoultimately have g·h·g−1 ∈H using group_oper_assoc hg∈Gi by auto}
then show thesis using assms(1) unfolding IsAnormalSubgroup_def by
auto
qed

If a group has only one subgroup of a given order, then this subgroup isnormal.
corollary(in group0) only_one_equipoll_sub:assumes IsAsubgroup(H,P) ∀ M. IsAsubgroup(M,P)∧ H≈M −→ M=Hshows IsAnormalSubgroup(G,P,H)
proof {
fix g assume g:g∈Gwith assms(1) have IsAsubgroup({g·(h·g−1 ). h∈H},P) using conj_group_is_groupby automoreoverfrom assms(1) g have H≈{g·(h·g−1 ). h∈H} using conj_set_is_eqpoll
group0_3_L2 by auto
ultimately have {g·(h·g−1 ). h∈H}=H using assms(2) by auto
then have {g·(h·g−1 ). h∈H}⊆H by auto}
then show thesis using cont_conj_is_normal assms(1) by autoqed

The trivial subgroup is then a normal subgroup.
corollary(in group0) trivial_normal_subgroup:
shows IsAnormalSubgroup(G,P,{1})proof have {1}⊆G using group0_2_L2 by auto
moreover have {1}6=0 by auto moreover{410

fix a b assume a∈{1}b∈{1}then have a=1b=1 by auto
then have Pha,bi=1·1 by auto
then have Pha,bi=1 using group0_2_L2 by auto
then have Pha,bi∈{1} by auto}
then have {1}{is closed under}P unfolding IsOpClosed_def by auto
moreover{fix a assume a∈{1}then have a=1 by auto
then have a−1 =1−1 by auto
then have a−1 =1 using group_inv_of_one by auto
then have a−1 ∈{1} by auto}
then have ∀ a∈{1}. a−1 ∈{1} by auto ultimately
have IsAsubgroup({1},P) using group0_3_T3 by auto moreover{
fix M assume M:IsAsubgroup(M,P) {1}≈Mthen have 1∈M M≈{1} using eqpoll_sym group0_3_L5 by auto
then obtain f where f∈bij(M,{1}) unfolding eqpoll_def by auto
then have inj:f∈inj(M,{1}) unfolding bij_def by auto
then have fun:f:M→{1} unfolding inj_def by auto{
fix b assume b∈Mb6=1
then have fb6=f1 using inj h1∈Mi unfolding inj_def by auto
then have False using hb∈Mi h1∈Mi apply_type[OF fun] by auto}
then have M={1} using h1∈Mi by auto}
ultimately show thesis using only_one_equipoll_sub by autoqed
lemma(in group0) whole_normal_subgroup:
shows IsAnormalSubgroup(G,P,G)
unfolding IsAnormalSubgroup_def
using group_op_closed inverse_in_groupusing group0_2_L2 group0_3_T3[of G] unfolding IsOpClosed_def
by autoSince the whole group and the trivial subgroup are normal, it is natural todefine simplicity of groups in the following way:
definition
IsSimple ([_,_]{is a simple group} 89)
where [G,f]{is a simple group} ≡ IsAgroup(G,f)∧(∀ M. IsAnormalSubgroup(G,f,M)−→ M=G∨M={TheNeutralElement(G,f)})From the definition follows that if a group has no subgroups, then it issimple.
411

corollary (in group0) noSubgroup_imp_simple:
assumes ∀ H. IsAsubgroup(H,P)−→ H=G∨H={1}shows [G,P]{is a simple group}
proof have IsAgroup(G,P) using groupAssum. moreover{
fix M assume IsAnormalSubgroup(G,P,M)
then have IsAsubgroup(M,P) unfolding IsAnormalSubgroup_def by autowith assms have M=G∨M={1} by auto}
ultimately show thesis unfolding IsSimple_def by auto
qed

Since every subgroup is normal in abelian groups, it follows that commutative simple groups do not have subgroups.
corollary (in group0) abelian_simple_noSubgroups:
assumes [G,P]{is a simple group} P{is commutative on}G
shows ∀ H. IsAsubgroup(H,P)−→ H=G∨H={1}proof (safe)
fix H assume A:IsAsubgroup(H,P)H 6= {1}then have IsAnormalSubgroup(G,P,H) using Group_ZF_2_4_L6(1) groupAssumassms(2)by autowith assms(1) A show H=G unfolding IsSimple_def by auto
qed

38.2

Finite groups

The subgroup of a finite group is finite.
lemma(in group0) finite_subgroup:
assumes Finite(G) IsAsubgroup(H,P)
shows Finite(H)using group0_3_L2 subset_Finite assms by force

The space of cosets is also finite. In particular, quotient groups.
lemma(in group0) finite_cosets:
assumes Finite(G) IsAsubgroup(H,P) r=QuotientGroupRel(G,P,H)
shows Finite(G//r)
proof have fun:{hg,r{g}i. g∈G}:G→(G//r) unfolding Pi_def function_def domain_def
by auto{fix C assume C:C∈G//rthen obtain c where c:c∈C using EquivClass_1_L5[OF Group_ZF_2_4_L1[OFassms(2)]] assms(3) by autowith C have r{c}=C using EquivClass_1_L2[OF Group_ZF_2_4_L3] assms(2,3)
by autowith c C have hc,Ci∈{hg,r{g}i. g∈G} using EquivClass_1_L1[OF Group_ZF_2_4_L3]
assms(2,3)

412

by auto
then have {hg,r{g}i. g∈G}c=C c∈G using apply_equality fun by auto
then have ∃ c∈G. {hg,r{g}i. g∈G}c=C by auto}with fun have surj:{hg,r{g}i. g∈G}∈surj(G,G//r) unfolding surj_def
by auto moreoverfrom assms(1) obtain n where n∈nat G≈n unfolding Finite_def by auto
then have G:G.n Ord(n) using eqpoll_imp_lepoll by auto
then have G//r.G using surj_fun_inv_2 surj by autowith G(1) have G//r.n using lepoll_trans by blast
then show Finite(G//r) using lepoll_nat_imp_Finite hn∈nati by autoqed

All the cosets are equipollent.

lemma(in group0) cosets_equipoll:assumes IsAsubgroup(H,P) r=QuotientGroupRel(G,P,H) g1∈Gg2∈Gshows r{g1}≈r{g2}
proof from assms(3,4) have GG:(g1−1 )·g2∈G using inverse_in_group group_op_closedby autothen have RightTranslation(G,P,(g1−1 )·g2)∈bij(G,G) using trans_bij(1)by auto moreover
have sub2:r{g2}⊆G using EquivClass_1_L1[OF Group_ZF_2_4_L3[OF assms(1)]]assms(2,4) unfolding quotient_def by auto
have sub:r{g1}⊆G using EquivClass_1_L1[OF Group_ZF_2_4_L3[OF assms(1)]]assms(2,3) unfolding quotient_def by auto
ultimately have restrict(RightTranslation(G,P,(g1−1 )·g2),r{g1})∈bij(r{g1},RightTranslation
using restrict_bij unfolding bij_def by auto
then have r{g1}≈RightTranslation(G,P,(g1−1 )·g2)(r{g1}) unfolding eqpoll_def
by autothen have A0:r{g1}≈{RightTranslation(G,P,(g1−1 )·g2)t. t∈r{g1}}using func_imagedef[OF group0_5_L1(1)[OF GG] sub] by auto{
fix t assume t∈{RightTranslation(G,P,(g1−1 )·g2)t. t∈r{g1}}then obtain q where q:t=RightTranslation(G,P,(g1−1 )·g2)q q∈r{g1}by autothen have hg1,qi∈r q∈G using image_iff sub by auto
then have g1·(q−1 )∈H q−1 ∈G using assms(2) inverse_in_group unfolding QuotientGroupRel_def by autofrom q(1) have t:t=q·((g1−1 )·g2) using group0_5_L2(1)[OF GG] q(2)sub by auto
then have g2·t−1 =g2·(q·((g1−1 )·g2))−1 by auto
then have g2·t−1 =g2·(((g1−1 )·g2)−1 ·q−1 ) using group_inv_of_two[OF hq∈Gi
GG] by auto
then have g2·t−1 =g2·(((g2−1 )·g1−1−1 )·q−1 ) using group_inv_of_two[OFinverse_in_group[OF assms(3)]assms(4)] by auto
then have g2·t−1 =g2·(((g2−1 )·g1)·q−1 ) using group_inv_of_inv assms(3)by auto moreover413

have t∈G using t hq∈Gi hg2∈Gi inverse_in_group[OF assms(3)] group_op_closedby autohave (g2−1 )·g1∈G using assms(3) inverse_in_group[OF assms(4)] group_op_closedby autowith assms(4) hq−1 ∈Gi have g2·(((g2−1 )·g1)·q−1 )=g2·((g2−1 )·g1)·q−1 using group_oper_assoc by auto
moreover have g2·((g2−1 )·g1)=g2·(g2−1 )·g1 using assms(3) inverse_in_group[OFassms(4)] assms(4)group_oper_assoc by auto
then have g2·((g2−1 )·g1)=g1 using group0_2_L6[OF assms(4)] group0_2_L2
assms(3) by auto ultimately
have g2·t−1 =g1·q−1 by autowith hg1·(q−1 )∈Hi have g2·t−1 ∈H by auto
then have hg2,ti∈r using assms(2) unfolding QuotientGroupRel_def using assms(4) ht∈Gi by auto
then have t∈r{g2} using image_iff assms(4) by auto}
then have A1:{RightTranslation(G,P,(g1−1 )·g2)t. t∈r{g1}}⊆r{g2} by auto{
fix t assume t∈r{g2}then have hg2,ti∈r t∈G using sub2 image_iff by auto
then have H:g2·t−1 ∈H using assms(2) unfolding QuotientGroupRel_def
by autothen have G:g2·t−1 ∈G using group0_3_L2 assms(1) by auto
then have g1·(g1−1 ·(g2·t−1 ))=g1·g1−1 ·(g2·t−1 ) using group_oper_assoc[OFassms(3) inverse_in_group[OF assms(3)]]by autothen have g1·(g1−1 ·(g2·t−1 ))=g2·t−1 using group0_2_L6[OF assms(3)]group0_2_L2 G by autowith H have HH:g1·(g1−1 ·(g2·t−1 ))∈H by auto
have GGG:t·g2−1 ∈G using ht∈Gi inverse_in_group[OF assms(4)] group_op_closedby autohave (t·g2−1 )−1 =g2−1−1 ·t−1 using group_inv_of_two[OF ht∈Gi inverse_in_group[OFassms(4)]] by auto
also have . . .=g2·t−1 using group_inv_of_inv[OF assms(4)] by auto
ultimately have (t·g2−1 )−1 =g2·t−1 by auto
then have g1−1 ·(t·g2−1 )−1 =g1−1 ·(g2·t−1 ) by auto
then have ((t·g2−1 )·g1)−1 =g1−1 ·(g2·t−1 ) using group_inv_of_two[OF GGG
assms(3)] by auto
then have HHH:g1·((t·g2−1 )·g1)−1 ∈H using HH by auto
have (t·g2−1 )·g1∈G using assms(3) ht∈Gi inverse_in_group[OF assms(4)]group_op_closed by autowith HHH have hg1,(t·g2−1 )·g1i∈r using assms(2,3) unfolding QuotientGroupRel_def
by autothen have rg1:t·g2−1 ·g1∈r{g1} using image_iff by auto
have t·g2−1 ·g1·((g1−1 )·g2)=t·(g2−1 ·g1)·((g1−1 )·g2) using group_oper_assoc[OFht∈Gi inverse_in_group[OF assms(4)] assms(3)]by autoalso have . . .=t·((g2−1 ·g1)·((g1−1 )·g2)) using group_oper_assoc[OF ht∈Gi414

group_op_closed[OF inverse_in_group[OF assms(4)] assms(3)] GG]
by autoalso have . . .=t·(g2−1 ·(g1·((g1−1 )·g2))) using group_oper_assoc[OF inverse_in_group[OFassms(4)] assms(3) GG] by auto
also have . . .=t·(g2−1 ·(g1·(g1−1 )·g2)) using group_oper_assoc[OF assms(3)inverse_in_group[OF assms(3)] assms(4)] by auto
also have . . .=t using group0_2_L6[OF assms(3)]group0_2_L6[OF assms(4)]group0_2_L2 ht∈Gi assms(4) by auto
ultimately have t·g2−1 ·g1·((g1−1 )·g2)=t by auto
then have RightTranslation(G,P,(g1−1 )·g2)(t·g2−1 ·g1)=t using group0_5_L2(1)[OFGG] h(t·g2−1 )·g1∈Gi by auto
then have t∈{RightTranslation(G,P,(g1−1 )·g2)t. t∈r{g1}} using rg1
by force}then have r{g2}⊆{RightTranslation(G,P,(g1−1 )·g2)t. t∈r{g1}} by blast
with A1 have r{g2}={RightTranslation(G,P,(g1−1 )·g2)t. t∈r{g1}} by autowith A0 show thesis by autoqed

The order of a subgroup multiplied by the order of the space of cosets is theorder of the group. We only prove the theorem for finite groups.
theorem(in group0) Lagrange:
assumes Finite(G) IsAsubgroup(H,P) r=QuotientGroupRel(G,P,H)
shows |G|=|H| #* |G//r|
proof have Finite(G//r)
using assms finite_cosets by auto moreoverS
have un: (G//r)=G using Union_quotient Group_ZF_2_4_L3 assms(2,3) byautoSthen have Finite( (G//r)) using assms(1) by auto moreover
have ∀ c1∈(G//r). ∀ c2∈(G//r). c16=c2 −→ c1∩c2=0 using quotient_disj[OFGroup_ZF_2_4_L3[OF assms(2)]]assms(3) by auto moreover
have ∀ aa∈G. aa∈H ←→ haa,1i∈r using Group_ZF_2_4_L5C assms(3) by auto
then have ∀ aa∈G. aa∈H ←→ h1,aai∈r using Group_ZF_2_4_L2 assms(2,3)
unfolding sym_def
by autothen have ∀ aa∈G. aa∈H ←→ aa∈r{1} using image_iff by auto
then have H:H=r{1} using group0_3_L2[OF assms(2)] assms(3) unfolding
QuotientGroupRel_def by auto{
fix c assume c∈(G//r)then obtain g where g∈G c=r{g} unfolding quotient_def by auto
then have c≈r{1} using cosets_equipoll[OF assms(2,3)] group0_2_L2
by autothen have |c|=|H| using H cardinal_cong by auto}
then have ∀ c∈(G//r). |c|=|H| by auto ultimately
show thesis using card_partition un by auto
qed

415

38.3

Subgroups generated by sets

Given a subset of a group, we can ask ourselves which is the smallest groupthat contains that set; if it even exists.
lemma(in group0) inter_subgroups:
assumes ∀ H∈H. IsAsubgroup(H,P)
H6=0
T
shows IsAsubgroup( H,P)
proof T
from assms Thave 1∈ H using group0_3_L5 by auto
then have
H6=0 by auto moreover{TT
fix A B assume A∈ HB∈ H
then have ∀ H∈H. A∈H∧B∈H by auto
then have ∀ H∈H.
T A·B∈H using assms(1) group0_3_L6 by auto
then have A·B∈ H using assms(2) by auto}T
then have ( H){is closed under}P using IsOpClosed_def by auto moreover{T
fix A assume A∈ H
then have ∀ H∈H. A∈H by auto−1
then have ∀ H∈H.
T A ∈H using assms(1) group0_3_T3A by auto−1
then have A ∈ H using assms(2) by auto}TT
then have∀ A∈ H. A−1 ∈ H by auto moreoverThave
H⊆G using assms(1,2) group0_3_L2 by force
ultimately show thesis using group0_3_T3 by autoqed

As the previous lemma states, the subgroup that contains a subset can be
defined as an intersection of subgroups.
definition(in group0)
SubgroupGenerated
T (h_iG 80)
where hXiG ≡{H∈Pow(G). X⊆H ∧ IsAsubgroup(H,P)}
theorem(in group0) subgroupGen_is_subgroup:
assumes X⊆Gshows IsAsubgroup(hXiG ,P)proof have restrict(P,G×G)=P using group_oper_assocA restrict_idem unfolding Pi_def by auto
then have IsAsubgroup(G,P) unfolding IsAsubgroup_def using groupAssumby autowith assms have G∈{H∈Pow(G). X⊆H ∧ IsAsubgroup(H,P)} by auto
then have {H∈Pow(G). X⊆H ∧ IsAsubgroup(H,P)}6=0 by auto
then show thesis using inter_subgroups unfolding SubgroupGenerated_def
by auto
qed

416

38.4

Homomorphisms

A homomorphism is a function between groups that preserves group operations.
definition
Homomor (_{is a homomorphism}{_,_}→{_,_} 85)
where IsAgroup(G,P) =⇒ IsAgroup(H,F) =⇒ Homomor(f,G,P,H,F) ≡ ∀ g1∈G.
∀ g2∈G. f(Phg1,g2i)=Fhfg1,fg2i

Now a lemma about the definition:lemma homomor_eq:
assumes IsAgroup(G,P) IsAgroup(H,F) Homomor(f,G,P,H,F) g1∈G g2∈Gshows f(Phg1,g2i)=Fhfg1,fg2i
using assms Homomor_def by auto

An endomorphism is a homomorphism from a group to the same group. In
case the group is abelian, it has a nice structure.
definitionEnd
where End(G,P) ≡ {f:G→G. Homomor(f,G,P,G,P)}The set of endomorphisms forms a submonoid of the monoid of function
from a set to that set under composition.
lemma(in group0) end_composition:
assumes f1∈End(G,P)f2∈End(G,P)
shows Composition(G)hf1,f2i∈End(G,P)
proof from assms have fun:f1:G→Gf2:G→G unfolding End_def by auto
then have fun2:f1 O f2:G→G using comp_fun by auto
have comp:Composition(G)hf1,f2i=f1 O f2 using func_ZF_5_L2 fun by auto{
fix g1 g2 assume AS2:g1∈Gg2∈Gthen have g1g2:g1·g2∈G using group_op_closed by autofrom fun2 have (f1 O f2)(g1·g2)=f1(f2(g1·g2)) using comp_fun_apply
fun(2) g1g2 by auto
also have . . .=f1((f2g1)·(f2g2)) using assms(2) unfolding End_def Homomor_def[OFgroupAssum groupAssum]
using AS2 by auto moreover
have f2g1∈Gf2g2∈G using fun(2) AS2 apply_type by auto ultimately
have (f1 O f2)(g1·g2)=(f1(f2g1))·(f1(f2g2)) using assms(1) unfolding End_def Homomor_def[OF groupAssum groupAssum]
using AS2 by auto
then have (f1 O f2)(g1·g2)=((f1 O f2)g1)·((f1 O f2)g2) using comp_fun_apply
fun(2) AS2 by auto}
then have ∀ g1∈G. ∀ g2∈G. (f1 O f2)(g1·g2)=((f1 O f2)g1)·((f1 O f2)g2)
by auto417

then have (f1 O f2)∈End(G,P) unfolding End_def Homomor_def[OF groupAssumgroupAssum] using fun2 by autowith comp show Composition(G)hf1,f2i∈End(G,P) by autoqed
theorem(in group0) end_comp_monoid:shows IsAmonoid(End(G,P),restrict(Composition(G),End(G,P)×End(G,P)))and TheNeutralElement(End(G,P),restrict(Composition(G),End(G,P)×End(G,P)))=id(G)proof have fun:id(G):G→G unfolding id_def by auto{
fix g h assume g∈Gh∈G
then have id:g·h∈Gid(G)g=gid(G)h=h using group_op_closed by auto
then have id(G)(g·h)=g·h unfolding id_def by autowith id(2,3) have id(G)(g·h)=(id(G)g)·(id(G)h) by auto}with fun have id(G)∈End(G,P) unfolding End_def Homomor_def[OF groupAssumgroupAssum] by auto moreoverfrom Group_ZF_2_5_L2(2) have A0:id(G)=TheNeutralElement(G → G, Composition(G))
by auto ultimately
have A1:TheNeutralElement(G → G, Composition(G))∈End(G,P) by auto
moreoverhave A2:End(G,P)⊆G→G unfolding End_def by auto moreoverfrom end_composition have A3:End(G,P){is closed under}Composition(G)unfolding IsOpClosed_def by auto
ultimately show IsAmonoid(End(G,P),restrict(Composition(G),End(G,P)×End(G,P)))

using monoid0.group0_1_T1 unfolding monoid0_def using Group_ZF_2_5_L2(1)by force
have IsAmonoid(G→G,Composition(G)) using Group_ZF_2_5_L2(1) by autowith A0 A1 A2 A3 show TheNeutralElement(End(G,P),restrict(Composition(G),End(G,P)×End(G,using group0_1_L6 by autoqed

The set of endomorphisms is closed under pointwise addition. This is so
because the group is abelian.
theorem(in group0) end_pointwise_addition:
assumes f∈End(G,P)g∈End(G,P)P{is commutative on}GF = P {lifted to function
space over} Gshows Fhf,gi∈End(G,P)
proof from assms(1,2) have fun:f∈G→Gg∈G→G unfolding End_def by auto
then have fun2:Fhf,gi:G→G using monoid0.Group_ZF_2_1_L0 group0_2_L1
assms(4) by auto{
fix g1 g2 assume AS:g1∈Gg2∈Gthen have g1·g2∈G using group_op_closed by auto
then have (Fhf,gi)(g1·g2)=(f(g1·g2))·(g(g1·g2)) using Group_ZF_2_1_L3
fun assms(4) by auto418

also have . . .=(f(g1)·f(g2))·(g(g1)·g(g2)) using assms unfolding End_def
Homomor_def[OF groupAssum groupAssum]
using AS by auto ultimately
have (Fhf,gi)(g1·g2)=(f(g1)·f(g2))·(g(g1)·g(g2)) by auto moreover
have fg1∈Gfg2∈Ggg1∈Ggg2∈G using fun apply_type AS by auto ultimately
have (Fhf,gi)(g1·g2)=(f(g1)·g(g1))·(f(g2)·g(g2)) using group0_4_L8(3)assms(3)by autowith AS have (Fhf,gi)(g1·g2)=((Fhf,gi)g1)·((Fhf,gi)g2)
using Group_ZF_2_1_L3 fun assms(4) by auto}with fun2 show thesis unfolding End_def Homomor_def[OF groupAssum groupAssum]
by autoqed

The inverse of an abelian group is an endomorphism.
lemma(in group0) end_inverse_group:
assumes P{is commutative on}G
shows GroupInv(G,P)∈End(G,P)
proof {
fix s t assume AS:s∈Gt∈G
then have elinv:s−1 ∈Gt−1 ∈G using inverse_in_group by auto
have (s·t)−1 =t−1 ·s−1 using group_inv_of_two AS by auto
then have (s·t)−1 =s−1 ·t−1 using assms(1) elinv unfolding IsCommutative_def
by auto}then have ∀ s∈G. ∀ t∈G. GroupInv(G,P)(s·t)=GroupInv(G,P)(s)·GroupInv(G,P)(t)by autowith group0_2_T2 groupAssum show thesis unfolding End_def using Homomor_def
by autoqed

The set of homomorphisms of an abelian group is an abelian subgroup of
the group of functions from a set to a group, under pointwise multiplication.
theorem(in group0) end_addition_group:
assumes P{is commutative on}G F = P {lifted to function space over}Gshows IsAgroup(End(G,P),restrict(F,End(G,P)×End(G,P))) restrict(F,End(G,P)×End(G,P)){iscommutative on}End(G,P)
proof from end_comp_monoid(1) monoid0.group0_1_L3A have End(G,P)6=0 unfolding monoid0_def by auto
moreover have End(G,P)⊆G→G unfolding End_def by auto moreover
have End(G,P){is closed under}F unfolding IsOpClosed_def using end_pointwise_addition
assms(1,2) by auto moreover{
fix ff assume AS:ff∈End(G,P)

419

then have restrict(Composition(G),End(G,P)×End(G,P))hGroupInv(G,P),
ffi∈End(G,P) using monoid0.group0_1_L1
unfolding monoid0_def using end_composition(1) end_inverse_group[OFassms(1)]by forcethen have Composition(G)hGroupInv(G,P), ffi∈End(G,P) using AS end_inverse_group[OFassms(1)]by autothen have GroupInv(G,P) O ff∈End(G,P) using func_ZF_5_L2 AS group0_2_T2
groupAssum unfolding
End_def by auto
then have GroupInv(G→G,F)ff∈End(G,P) using Group_ZF_2_1_L6 assms(2)AS unfolding End_def
by auto}then have ∀ ff∈End(G,P). GroupInv(G→G,F)ff∈End(G,P) by auto ultimately
show IsAgroup(End(G,P),restrict(F,End(G,P)×End(G,P))) using group0.group0_3_T3
Group_ZF_2_1_T2[OF assms(2)] unfolding IsAsubgroup_def group0_def
by autoshow restrict(F,End(G,P)×End(G,P)){is commutative on}End(G,P) using
Group_ZF_2_1_L7[OF assms(2,1)] unfolding End_def IsCommutative_def by
auto
qed

lemma(in group0) distributive_comp_pointwise:
assumes P{is commutative on}G F = P {lifted to function space over}Gshows IsDistributive(End(G,P),restrict(F,End(G,P)×End(G,P)),restrict(Composition(G),End(Gproof {
fix b c d assume AS:b∈End(G,P)c∈End(G,P)d∈End(G,P)
have ig1:Composition(G) hb, F hc, dii =b O (Fhc,di) using monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)]AS unfolding End_def using func_ZF_5_L2 by auto
have ig2:F hComposition(G) hb , ci,Composition(G) hb , dii=F hb O c,b
O di using AS unfolding End_def using func_ZF_5_L2 by auto
have comp1fun:(b O (Fhc,di)):G→G using monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)] comp_fun AS unfolding End_def by force
have comp2fun:(F hb O c,b O di):G→G using monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)] comp_fun AS unfolding End_def by force{
fix g assume gG:g∈Gthen have (b O (Fhc,di))g=b((Fhc,di)g) using comp_fun_apply monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)]AS(2,3) unfolding End_def by force
also have . . .=b(c(g)·d(g)) using Group_ZF_2_1_L3[OF assms(2)] AS(2,3)
gG unfolding End_def by auto
ultimately have (b O (Fhc,di))g=b(c(g)·d(g)) by auto moreover
have cg∈Gdg∈G using AS(2,3) unfolding End_def using apply_type420

gG by auto
ultimately have (b O (Fhc,di))g=(b(cg))·(b(dg)) using AS(1) unfolding End_def
Homomor_def[OF groupAssum groupAssum] by auto
then have (b O (Fhc,di))g=((b O c)g)·((b O d)g) using comp_fun_apply
gG AS(2,3)
unfolding End_def by auto
then have (b O (Fhc,di))g=(Fhb O c,b O di)g using gG Group_ZF_2_1_L3[OFassms(2) comp_fun comp_fun gG]
AS unfolding End_def by auto}
then have ∀ g∈G. (b O (Fhc,di))g=(Fhb O c,b O di)g by auto
then have b O (Fhc,di)=Fhb O c,b O di using fun_extension[OF comp1fun
comp2fun] by autowith ig1 ig2 have Composition(G) hb, F hc, dii =F hComposition(G)hb , ci,Composition(G) hb , dii by auto moreover
have F hc, di=restrict(F,End(G,P)×End(G,P)) hc, di using AS(2,3)
restrict by auto moreover
have Composition(G) hb , ci=restrict(Composition(G),End(G,P)×End(G,P))
hb , ci Composition(G) hb , di=restrict(Composition(G),End(G,P)×End(G,P))
hb , diusing restrict AS by auto moreover
have Composition(G) hb, F hc, dii =restrict(Composition(G),End(G,P)×End(G,P))hb, F hc, dii using AS(1)end_pointwise_addition[OF AS(2,3) assms] by auto
moreover have F hComposition(G) hb , ci,Composition(G) hb , dii=restrict(F,End(G,P)×End(
hComposition(G) hb , ci,Composition(G) hb , dii
using end_composition[OF AS(1,2)] end_composition[OF AS(1,3)] byauto ultimately
have eq1:restrict(Composition(G),End(G,P)×End(G,P)) hb, restrict(F,End(G,P)×End(G,P))hc, dii =restrict(F,End(G,P)×End(G,P)) hrestrict(Composition(G),End(G,P)×End(G,P))
hb , ci,restrict(Composition(G),End(G,P)×End(G,P))hb , diiby autohave ig1:Composition(G) h F hc, di,bi = (Fhc,di) O b using monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)]AS unfolding End_def using func_ZF_5_L2 by auto
have ig2:F hComposition(G) hc , bi,Composition(G) hd , bii=F hc O b,dO bi using AS unfolding End_def using func_ZF_5_L2 by auto
have comp1fun:((Fhc,di) O b):G→G using monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)] comp_fun AS unfolding End_def by force
have comp2fun:(F hc O b,d O bi):G→G using monoid0.Group_ZF_2_1_L0[OFgroup0_2_L1 assms(2)] comp_fun AS unfolding End_def by force{
fix g assume gG:g∈Gthen have bg:bg∈G using AS(1) unfolding End_def using apply_typeby autofrom gG have ((Fhc,di) O b)g=(Fhc,di)(bg) using comp_fun_apply AS(1)unfolding End_def by force
also have . . .=(c(bg))·(d(bg)) using Group_ZF_2_1_L3[OF assms(2)]421

AS(2,3) bg unfolding End_def by auto
also have . . .=((c O b)g)·((d O b)g) using comp_fun_apply gG AS unfolding End_def by auto
also have . . .=(Fhc O b,d O bi)g using gG Group_ZF_2_1_L3[OF assms(2)comp_fun comp_fun gG]
AS unfolding End_def by auto
ultimately have((Fhc,di) O b)g=(Fhc O b,d O bi)g by auto}
then have ∀ g∈G. ((Fhc,di) O b)g=(Fhc O b,d O bi)g by auto
then have (Fhc,di) O b=Fhc O b,d O bi using fun_extension[OF comp1fun
comp2fun] by autowith ig1 ig2 have Composition(G) hF hc, di,bi =F hComposition(G) hc, bi,Composition(G) hd , bii by auto moreover
have F hc, di=restrict(F,End(G,P)×End(G,P)) hc, di using AS(2,3)
restrict by auto moreover
have Composition(G) hc , bi=restrict(Composition(G),End(G,P)×End(G,P))
hc , bi Composition(G) hd , bi=restrict(Composition(G),End(G,P)×End(G,P))
hd , biusing restrict AS by auto moreover
have Composition(G) hF hc, di,bi =restrict(Composition(G),End(G,P)×End(G,P))hF hc, di,bi using AS(1)end_pointwise_addition[OF AS(2,3) assms] by auto
moreover have F hComposition(G) hc , bi,Composition(G) hd , bii=restrict(F,End(G,P)×End(
hComposition(G) hc , bi,Composition(G) hd , bii
using end_composition[OF AS(2,1)] end_composition[OF AS(3,1)] byauto ultimately
have eq2:restrict(Composition(G),End(G,P)×End(G,P)) h restrict(F,End(G,P)×End(G,P))hc, di,bi =restrict(F,End(G,P)×End(G,P)) hrestrict(Composition(G),End(G,P)×End(G,P))
hc ,bi,restrict(Composition(G),End(G,P)×End(G,P))hd , bii
by autowith eq1 have (restrict(Composition(G),End(G,P)×End(G,P)) hb, restrict(F,End(G,P)×End(Ghc, dii =restrict(F,End(G,P)×End(G,P)) hrestrict(Composition(G),End(G,P)×End(G,P))
hb , ci,restrict(Composition(G),End(G,P)×End(G,P))hb , dii)∧(restrict(Composition(G),End(G,P)×End(G,P)) h restrict(F,End(G,P)×End(G,P))hc, di,bi =restrict(F,End(G,P)×End(G,P)) hrestrict(Composition(G),End(G,P)×End(G,P))
hc ,bi,restrict(Composition(G),End(G,P)×End(G,P))hd , bii)by auto}then show thesis unfolding IsDistributive_def by autoqed

The endomorphisms of an abelian group is in fact a ring with the previous
operations.

theorem(in group0) end_is_ring:assumes P{is commutative on}G F = P {lifted to function space over}Gshows IsAring(End(G,P),restrict(F,End(G,P)×End(G,P)),restrict(Composition(G),End(G,P)×En
unfolding IsAring_def using end_addition_group[OF assms] end_comp_monoid(1)distributive_comp_pointwise[OF assms]422

by auto

38.5

First isomorphism theorem

Now we will prove that any homomorphism f : G → H defines a bijective
homomorphism between G/H and f (G).
A group homomorphism sends the neutral element to the neutral element
and commutes with the inverse.

lemma image_neutral:assumes IsAgroup(G,P) IsAgroup(H,F) Homomor(f,G,P,H,F) f:G→Hshows fTheNeutralElement(G,P)=TheNeutralElement(H,F)
proof have g:TheNeutralElement(G,P)=PhTheNeutralElement(G,P),TheNeutralElement(G,P)i
TheNeutralElement(G,P)∈G
using assms(1) group0.group0_2_L2 unfolding group0_def by autofrom g(1) have fTheNeutralElement(G,P)=f(PhTheNeutralElement(G,P),TheNeutralElement(G,P)i
by autoalso have . . .=FhfTheNeutralElement(G,P),fTheNeutralElement(G,P)i
using assms(3) unfolding Homomor_def[OF assms(1,2)] using g(2) by
auto
ultimately have fTheNeutralElement(G,P)=FhfTheNeutralElement(G,P),fTheNeutralElement(G,P)i
by auto moreover
have h:fTheNeutralElement(G,P)∈H using g(2) apply_type[OF assms(4)]by autothen have fTheNeutralElement(G,P)=FhfTheNeutralElement(G,P),TheNeutralElement(H,F)i
using assms(2) group0.group0_2_L2 unfolding group0_def by auto ultimately
have FhfTheNeutralElement(G,P),TheNeutralElement(H,F)i=FhfTheNeutralElement(G,P),fTheNeutr
by autowith h have LeftTranslation(H,F,fTheNeutralElement(G,P))TheNeutralElement(H,F)=LeftTransl
using group0.group0_5_L2(2)[OF _ h] assms(2) group0.group0_2_L2 unfolding group0_def by auto
moreover have LeftTranslation(H,F,fTheNeutralElement(G,P))∈bij(H,H)
using group0.trans_bij(2)assms(2) h unfolding group0_def by auto
then have LeftTranslation(H,F,fTheNeutralElement(G,P))∈inj(H,H) unfolding bij_def by auto ultimately
show fTheNeutralElement(G,P)=TheNeutralElement(H,F) using h assms(2)group0.group0_2_L2 unfolding inj_def group0_def
by forceqed
lemma image_inv:
assumes IsAgroup(G,P) IsAgroup(H,F) Homomor(f,G,P,H,F) f:G→H g∈Gshows f( GroupInv(G,P)g)=GroupInv(H,F) (fg)
proof have im:fg∈H using apply_type[OF assms(4,5)].

423

have inv:GroupInv(G,P)g∈G using group0.inverse_in_group[OF _ assms(5)]assms(1) unfolding group0_def by auto
then have inv2:f(GroupInv(G,P)g)∈Husing apply_type[OF assms(4)] by
auto
have fTheNeutralElement(G,P)=f(Phg,GroupInv(G,P)gi) using assms(1,5)
group0.group0_2_L6
unfolding group0_def by auto
also have . . .=Fhfg,f(GroupInv(G,P)g)i using assms(3) unfolding Homomor_def[OFassms(1,2)] using
assms(5) inv by auto
ultimately have TheNeutralElement(H,F)=Fhfg,f(GroupInv(G,P)g)i using
image_neutral[OF assms(1-4)]by autothen show thesis using group0.group0_2_L9(2)[OF _ im inv2] assms(2)unfolding group0_def by autoqed

The kernel of an homomorphism is a normal subgroup.
theorem kerner_normal_sub:assumes IsAgroup(G,P) IsAgroup(H,F) Homomor(f,G,P,H,F) f:G→Hshows IsAnormalSubgroup(G,P,f-{TheNeutralElement(H,F)})
proof have xy:∀ x y. hx, yi ∈ f −→ (∀ y’. hx, y’i ∈ f −→ y = y’) using assms(4)unfolding Pi_def function_def
by force{
fix g1 g2 assume g1∈f-{TheNeutralElement(H,F)}g2∈f-{TheNeutralElement(H,F)}
then have hg1,TheNeutralElement(H,F)i∈fhg2,TheNeutralElement(H,F)i∈fusing vimage_iff by auto moreover
then have G:g1∈Gg2∈G using assms(4) unfolding Pi_def by auto
then have hg1,fg1i∈fhg2,fg2i∈f using apply_Pair[OF assms(4)] by auto
moreovernote xy ultimately
have fg1=TheNeutralElement(H,F)fg2=TheNeutralElement(H,F) by auto
moreoverhave f(Phg1,g2i)=Fhfg1,fg2i using assms(3) G unfolding Homomor_def[OFassms(1,2)] by auto
ultimately have f(Phg1,g2i)=FhTheNeutralElement(H,F),TheNeutralElement(H,F)i
by autoalso have . . .=TheNeutralElement(H,F) using group0.group0_2_L2 assms(2)unfolding group0_def
by autoultimately have f(Phg1,g2i)=TheNeutralElement(H,F) by auto moreoverfrom G have Phg1,g2i∈G using group0.group_op_closed assms(1) unfolding group0_def by auto
ultimately have hPhg1,g2i,TheNeutralElement(H,F)i∈f using apply_Pair[OFassms(4)] by force
then have Phg1,g2i∈f-{TheNeutralElement(H,F)} using vimage_iff by
auto

424

}
then have f-{TheNeutralElement(H,F)} {is closed under}P unfolding IsOpClosed_def
by automoreover have A:f-{TheNeutralElement(H,F)} ⊆ G using func1_1_L3 assms(4)by automoreover have fTheNeutralElement(G,P)=TheNeutralElement(H,F) using
image_neutral
assms by auto
then have hTheNeutralElement(G,P),TheNeutralElement(H,F)i∈f using apply_Pair[OFassms(4)]group0.group0_2_L2 assms(1) unfolding group0_def by force
then have TheNeutralElement(G,P)∈f-{TheNeutralElement(H,F)} using vimage_iff
by autothen have f-{TheNeutralElement(H,F)}6=0 by auto moreover{
fix x assume x∈f-{TheNeutralElement(H,F)}
then have hx,TheNeutralElement(H,F)i∈f and x:x∈G using vimage_iff
A by auto moreoverfrom x have hx,fxi∈f using apply_Pair[OF assms(4)] by auto ultimately
have fx=TheNeutralElement(H,F) using xy by auto moreover
have f(GroupInv(G,P)x)=GroupInv(H,F)(fx) using x image_inv assms by
auto
ultimately have f(GroupInv(G,P)x)=GroupInv(H,F)TheNeutralElement(H,F)
by autothen have f(GroupInv(G,P)x)=TheNeutralElement(H,F) using group0.group_inv_of_one
assms(2) unfolding group0_def by auto moreover
have hGroupInv(G,P)x,f(GroupInv(G,P)x)i∈f using apply_Pair[OF assms(4)]x group0.inverse_in_group assms(1) unfolding group0_def by auto
ultimately have hGroupInv(G,P)x,TheNeutralElement(H,F)i∈f by auto
then have GroupInv(G,P)x∈f-{TheNeutralElement(H,F)} using vimage_iff
by auto}then have ∀ x∈f-{TheNeutralElement(H,F)}. GroupInv(G,P)x∈f-{TheNeutralElement(H,F)}
by autoultimately have SS:IsAsubgroup(f-{TheNeutralElement(H,F)},P) using group0.group0_3_T3
assms(1) unfolding group0_def by auto{
fix g h assume AS:g∈Gh∈f-{TheNeutralElement(H,F)}
from AS(1) have im:fg∈H using assms(4) apply_type by auto
then have iminv:GroupInv(H,F)(fg)∈H using assms(2) group0.inverse_in_group
unfolding group0_def by autofrom AS have h∈G and inv:GroupInv(G,P)g∈G using A group0.inverse_in_group
assms(1) unfolding group0_def by auto
then have P:Phh,GroupInv(G,P)gi∈G using assms(1) group0.group_op_closed
unfolding group0_def by autowith hg∈Gi have Phg,Phh,GroupInv(G,P)gi i∈G using assms(1) group0.group_op_closed
unfolding group0_def by auto
then have f(Phg,Phh,GroupInv(G,P)gi i)=Fhfg,f(Phh,GroupInv(G,P)gi)i
using assms(3) unfolding Homomor_def[OF assms(1,2)] using hg∈Gi P

425

by auto
also have . . .=Fhfg,F(hfh,f(GroupInv(G,P)g)i)i using assms(3) unfolding Homomor_def[OF assms(1,2)]
using hh∈Gi inv by auto
also have . . .=Fhfg,F(hfh,GroupInv(H,F)(fg)i)i using image_inv[OF assms
hg∈Gi] by auto
ultimately have f(Phg,Phh,GroupInv(G,P)gi i)=Fhfg,F(hfh,GroupInv(H,F)(fg)i)i
by automoreover from AS(2) have fh=TheNeutralElement(H,F) using func1_1_L15[OFassms(4)]by auto ultimately
have f(Phg,Phh,GroupInv(G,P)gi i)=Fhfg,F(hTheNeutralElement(H,F),GroupInv(H,F)(fg)i)i
by autoalso have . . .=Fhfg,GroupInv(H,F)(fg)i using assms(2) im group0.group0_2_L2
unfolding group0_def
using iminv by auto
also have . . .=TheNeutralElement(H,F) using assms(2) group0.group0_2_L6
imunfolding group0_def by auto
ultimately have f(Phg,Phh,GroupInv(G,P)gi i)=TheNeutralElement(H,F)
by auto moreoverfrom P hg∈Gi have Phg,Phh,GroupInv(G,P)gii∈G using group0.group_op_closed
assms(1) unfolding group0_def by auto
ultimately have Phg,Phh,GroupInv(G,P)gi i∈f-{TheNeutralElement(H,F)}
using func1_1_L15[OF assms(4)]by auto}then have ∀ g∈G. {Phg,Phh,GroupInv(G,P)gi i. h∈f-{TheNeutralElement(H,F)}}⊆f-{TheNeutralElby autothen show thesis using group0.cont_conj_is_normal assms(1) SS unfolding group0_def by autoqed

The image of a homomorphism is a subgroup.
theorem image_sub:assumes IsAgroup(G,P) IsAgroup(H,F) Homomor(f,G,P,H,F) f:G→Hshows IsAsubgroup(fG,F)
proof have TheNeutralElement(G,P)∈G using group0.group0_2_L2 assms(1) unfolding group0_def by auto
then have TheNeutralElement(H,F)∈fG using func_imagedef[OF assms(4),of
G] image_neutral[OF assms]
by forcethen have fG6=0 by auto moreover{
fix h1 h2 assume h1∈fGh2∈fGthen obtain g1 g2 where h1=fg1 h2=fg2 and p:g1∈Gg2∈G using func_imagedef[OFassms(4)] by auto
then have Fhh1,h2i=Fhfg1,fg2i by auto426

also have . . .=f(Phg1,g2i) using assms(3) unfolding Homomor_def[OF assms(1,2)]
using p by auto
ultimately have Fhh1,h2i=f(Phg1,g2i) by auto
moreover have Phg1,g2i∈G using p group0.group_op_closed assms(1)unfolding group0_def
by auto ultimately
have Fhh1,h2i∈fG using func_imagedef[OF assms(4)] by auto}
then have fG {is closed under} F unfolding IsOpClosed_def by auto
moreover have fG⊆H using func1_1_L6(2) assms(4) by auto moreover{
fix h assume h∈fGthen obtain g where h=fg and p:g∈G using func_imagedef[OF assms(4)]by autothen have GroupInv(H,F)h=GroupInv(H,F)(fg) by auto
then have GroupInv(H,F)h=f(GroupInv(G,P)g) using p image_inv[OF assms]
by autothen have GroupInv(H,F)h∈fG using p group0.inverse_in_group assms(1)unfolding group0_def
using func_imagedef[OF assms(4)] by auto}
then have ∀ h∈fG. GroupInv(H,F)h∈fG by auto ultimately
show thesis using group0.group0_3_T3 assms(2) unfolding group0_def
by autoqed

Now we are able to prove the first isomorphism theorem. This theorem
states that any group homomorphism f : G → H gives an isomorphism
between a quotient group of G and a subgroup of H.
theorem isomorphism_first_theorem:
assumes IsAgroup(G,P) IsAgroup(H,F) Homomor(f,G,P,H,F) f:G→H
defines r ≡ QuotientGroupRel(G,P,f-{TheNeutralElement(H,F)}) andPP ≡ QuotientGroupOp(G,P,f-{TheNeutralElement(H,F)})
shows ∃ ff. Homomor(ff,G//r,PP,fG,restrict(F,(fG)×(fG))) ∧ ff∈bij(G//r,fG)
proof let ff={hr{g},fgi. g∈G}{
fix t assume t∈{hr{g},fgi. g∈G}then obtain g where t=hr{g},fgi g∈G by auto
moreover then have r{g}∈G//r unfolding r_def quotient_def by auto
moreover from hg∈Gi have fg∈fG using func_imagedef[OF assms(4)] by
auto
ultimately have t∈(G//r)×fG by auto}
then have ff∈Pow((G//r)×fG) by auto
moreover have (G//r)⊆domain(ff) unfolding domain_def quotient_def
by auto moreover{
fix x y t assume A:hx,yi∈ff hx,ti∈ff

427

then obtain gy gr where hx, yi=hr{gy},fgyi hx, ti=hr{gr},fgri and p:gr∈Ggy∈G
by autothen have B:r{gy}=r{gr}y=fgyt=fgr by autofrom B(2,3) have q:y∈Ht∈H using apply_type p assms(4) by auto
have hgy,gri∈r using eq_equiv_class[OF B(1) _ p(1)] group0.Group_ZF_2_4_L3
kerner_normal_sub[OF assms(1-4)]
assms(1) unfolding group0_def IsAnormalSubgroup_def r_def by auto
then have Phgy,GroupInv(G,P)gri∈f-{TheNeutralElement(H,F)} unfolding r_def QuotientGroupRel_def by auto
then have eq:f(Phgy,GroupInv(G,P)gri)=TheNeutralElement(H,F) using
func1_1_L15[OF assms(4)] by autofrom B(2,3) have Fhy,GroupInv(H,F)ti=Fhfgy,GroupInv(H,F)(fgr)i by
auto
also have . . .=Fhfgy,f(GroupInv(G,P)gr)i using image_inv[OF assms(1-4)]p(1) by auto
also have . . .=f(Phgy,GroupInv(G,P)gri) using assms(3) unfolding Homomor_def[OFassms(1,2)] using p(2)group0.inverse_in_group assms(1) p(1) unfolding group0_def by auto
ultimately have Fhy,GroupInv(H,F)ti=TheNeutralElement(H,F) using eq
by autothen have y=t using assms(2) group0.group0_2_L11A q unfolding group0_def
by auto}then have ∀ x y. hx,yi∈ff −→ (∀ y’. hx,y’i∈ff −→ y=y’) by auto
ultimately have ff_fun:ff:G//r→fG unfolding Pi_def function_def by
auto{
fix a1 a2 assume AS:a1∈G//ra2∈G//rthen obtain g1 g2 where p:g1∈Gg2∈G and a:a1=r{g1}a2=r{g2} unfolding quotient_def by auto
have equiv(G,r) using group0.Group_ZF_2_4_L3 kerner_normal_sub[OFassms(1-4)]
assms(1) unfolding group0_def IsAnormalSubgroup_def r_def by auto
moreoverhave Congruent2(r,P) using Group_ZF_2_4_L5A[OF assms(1) kerner_normal_sub[OFassms(1-4)]]
unfolding r_def by auto moreover
have PP=ProjFun2(G,r,P) unfolding PP_def QuotientGroupOp_def r_def
by auto moreovernote a p ultimately have PPha1,a2i=r{Phg1,g2i} using group0.Group_ZF_2_2_L2
assms(1)unfolding group0_def by auto
then have hPPha1,a2i,f(Phg1,g2i)i∈ff using group0.group_op_closed[OF_ p] assms(1) unfolding group0_def
by autothen have eq:ff(PPha1,a2i)=f(Phg1,g2i) using apply_equality ff_fun
by autofrom p a have ha1,fg1i∈ffha2,fg2i∈ff by auto
then have ffa1=fg1ffa2=fg2 using apply_equality ff_fun by auto428then have Fhffa1,ffa2i=Fhfg1,fg2i by auto
also have . . .=f(Phg1,g2i) using assms(3) unfolding Homomor_def[OF assms(1,2)]
using p by auto
ultimately have Fhffa1,ffa2i=ff(PPha1,a2i) using eq by auto moreover
have ffa1∈fGffa2∈fG using ff_fun apply_type AS by auto ultimately
have restrict(F,fG×fG)hffa1,ffa2i=ff(PPha1,a2i) by auto}
then have r:∀ a1∈G//r. ∀ a2∈G//r. restrict(F,fG×fG)hffa1,ffa2i=ff(PPha1,a2i)
by autohave G:IsAgroup(G//r,PP) using Group_ZF_2_4_T1[OF assms(1) kerner_normal_sub[OFassms(1-4)]] unfolding r_def PP_def by auto
have H:IsAgroup(fG, restrict(F,fG×fG)) using image_sub[OF assms(1-4)]
unfolding IsAsubgroup_def .
have HOM:Homomor(ff,G//r,PP,fG,restrict(F,(fG)×(fG))) using r unfolding Homomor_def[OF G H] by auto{
fix b1 b2 assume AS:ffb1=ffb2b1∈G//rb2∈G//r
have invb2:GroupInv(G//r,PP)b2∈G//r using group0.inverse_in_group[OF_ AS(3)] G unfolding group0_def
by autowith AS(2) have PPhb1,GroupInv(G//r,PP)b2i∈G//r using group0.group_op_closed
G unfolding group0_def by auto moreover
then obtain gg where gg:gg∈GPPhb1,GroupInv(G//r,PP)b2i=r{gg} unfolding quotient_def by auto
ultimately have E:ff(PPhb1,GroupInv(G//r,PP)b2i)=fgg using apply_equality[OF_ ff_fun] by autofrom invb2 have pp:ff(GroupInv(G//r,PP)b2)∈fG using apply_type ff_fun
by autofrom AS(2,3) have fff:ffb1∈fGffb2∈fG using apply_type[OF ff_fun]by autofrom fff(1) pp have EE:Fhffb1,ff(GroupInv(G//r,PP)b2)i=restrict(F,fG×fG)hffb1,ff(GroupIby autofrom fff have fff2:ffb1∈Hffb2∈H using func1_1_L6(2)[OF assms(4)]by autowith AS(1) have TheNeutralElement(H,F)=Fhffb1,GroupInv(H,F)(ffb2)i
using group0.group0_2_L6(1)assms(2) unfolding group0_def by auto
also have . . .=Fhffb1,restrict(GroupInv(H,F),fG)(ffb2)i using restrict
fff(2) by auto
also have . . .=Fhffb1,ff(GroupInv(G//r,PP)b2)i using image_inv[OF G
H HOM ff_fun AS(3)]group0.group0_3_T1[OF _ image_sub[OF assms(1-4)]] assms(2) unfolding group0_def by auto
also have . . .=restrict(F,fG×fG)hffb1,ff(GroupInv(G//r,PP)b2)i using
EE by auto
also have . . .=ff(PPhb1,GroupInv(G//r,PP)b2i) using HOM unfolding Homomor_def[OFG H] using AS(2)group0.inverse_in_group[OF _ AS(3)] G unfolding group0_def by auto429

also have . . .=fgg using E by auto
ultimately have fgg=TheNeutralElement(H,F) by auto
then have gg∈f-{TheNeutralElement(H,F)} using func1_1_L15[OF assms(4)]hgg∈Gi by auto
then have r{gg}=TheNeutralElement(G//r,PP) using group0.Group_ZF_2_4_L5E[OF_ kerner_normal_sub[OF assms(1-4)]
hgg∈Gi ] using assms(1) unfolding group0_def r_def PP_def by autowith gg(2) have PPhb1,GroupInv(G//r,PP)b2i=TheNeutralElement(G//r,PP)
by autothen have b1=b2 using group0.group0_2_L11A[OF _ AS(2,3)] G unfolding group0_def by auto}
then have ff∈inj(G//r,fG) unfolding inj_def using ff_fun by auto moreover{
fix m assume m∈fGthen obtain g where g∈Gm=fg using func_imagedef[OF assms(4)] by
auto
then have hr{g},mi∈ff by auto
then have ff(r{g})=m using apply_equality ff_fun by auto
then have ∃ A∈G//r. ffA=m unfolding quotient_def using hg∈Gi by auto}
ultimately have ff∈bij(G//r,fG) unfolding bij_def surj_def using ff_fun
by autowith HOM show thesis by autoqed

As a last result, the inverse of a bijective homomorphism is an homomorphism. Meaning that in the previous result, the homomorphism we foundis an isomorphism.
theorem bij_homomor:
assumes f∈bij(G,H)IsAgroup(G,P)IsAgroup(H,F)Homomor(f,G,P,H,F)
shows Homomor(converse(f),H,F,G,P)
proof {
fix h1 h2 assume A:h1∈H h2∈Hfrom A(1) obtain g1 where g1:g1∈G fg1=h1 using assms(1) unfolding
bij_def surj_def by auto moreoverfrom A(2) obtain g2 where g2:g2∈G fg2=h2 using assms(1) unfolding
bij_def surj_def by auto ultimately
have Fhfg1,fg2i=Fhh1,h2i by auto
then have f(Phg1,g2i)=Fhh1,h2i using assms(2,3,4) homomor_eq g1(1)g2(1) by auto
then have converse(f)(f(Phg1,g2i))=converse(f)(Fhh1,h2i) by auto
then have Phg1,g2i=converse(f)(Fhh1,h2i) using left_inverse assms(1)group0.group_op_closed
assms(2) g1(1) g2(1) unfolding group0_def bij_def by auto moreover430

from g1(2) have converse(f)(fg1)=converse(f)h1 by auto
then have g1=converse(f)h1 using left_inverse assms(1) unfolding
bij_def using g1(1) by auto moreoverfrom g2(2) have converse(f)(fg2)=converse(f)h2 by auto
then have g2=converse(f)h2 using left_inverse assms(1) unfolding
bij_def using g2(1) by auto ultimately
have Phconverse(f)h1,converse(f)h2i=converse(f)(Fhh1,h2i) by auto}
then show thesis using assms(2,3) Homomor_def by auto
qed
end

39

Fields - introduction

theory Field_ZF imports Ring_ZF
begin

This theory covers basic facts about fields.

39.1

Definition and basic properties

In this section we define what is a field and list the basic properties of fields.
Field is a notrivial commutative ring such that all non-zero elements have an
inverse. We define the notion of being a field as a statement about three sets.
The first set, denoted K is the carrier of the field. The second set, denoted A
represents the additive operation on K (recall that in ZF set theory functions
are sets). The third set M represents the multiplicative operation on K.
definition
IsAfield(K,A,M) ≡(IsAring(K,A,M) ∧ (M {is commutative on} K) ∧TheNeutralElement(K,A) 6= TheNeutralElement(K,M) ∧(∀ a∈K. a6=TheNeutralElement(K,A)−→(∃ b∈K. Mha,bi = TheNeutralElement(K,M))))

The field0 context extends the ring0 context adding field-related assumptions and notation related to the multiplicative inverse.
locale field0 = ring0 K A M for K A M +assumes mult_commute: M {is commutative on} K
assumes not_triv: 0 6= 1
assumes inv_exists: ∀ a∈K. a6=0 −→ (∃ b∈K. a·b = 1)
fixes non_zero (K0 )431

defines non_zero_def[simp]: K0 ≡ K-{0}fixes inv (_−1 [96] 97)
defines inv_def[simp]: a−1 ≡ GroupInv(K0 ,restrict(M,K0 ×K0 ))(a)The next lemma assures us that we are talking fields in the field0 context.
lemma (in field0) Field_ZF_1_L1: shows IsAfield(K,A,M)
using ringAssum mult_commute not_triv inv_exists IsAfield_def
by simp

We can use theorems proven in the field0 context whenever we talk about
a field.
lemma field_field0: assumes IsAfield(K,A,M)
shows field0(K,A,M)
using assms IsAfield_def field0_axioms.intro ring0_def field0_def
by simp

Let’s have an explicit statement that the multiplication in fields is commutative.
lemma (in field0) field_mult_comm: assumes a∈K b∈Kshows a·b = b·ausing mult_commute assms IsCommutative_def by simp

Fields do not have zero divisors.
lemma (in field0) field_has_no_zero_divs: shows HasNoZeroDivs(K,A,M)
proof { fix a b assume A1: a∈K b∈K and A2: a·b = 0 and A3: b6=0
from inv_exists A1 A3 obtain c where I: c∈K and II: b·c = 1
by autofrom A2 have a·b·c = 0·c by simp
with A1 I have a·(b·c) = 0
using Ring_ZF_1_L11 Ring_ZF_1_L6 by simp
with A1 II have a=0 using Ring_ZF_1_L3 by simp }then have ∀ a∈K.∀ b∈K. a·b = 0 −→ a=0 ∨ b=0 by auto
then show thesis using HasNoZeroDivs_def by autoqed

K0 (the set of nonzero field elements is closed with respect to multiplication.
lemma (in field0) Field_ZF_1_L2:
shows K0 {is closed under} M
using Ring_ZF_1_L4 field_has_no_zero_divs Ring_ZF_1_L12
IsOpClosed_def by auto

Any nonzero element has a right inverse that is nonzero.
lemma (in field0) Field_ZF_1_L3: assumes A1: a∈K0
shows ∃ b∈K0 . a·b = 1
proof -

432

from inv_exists A1 obtain b where b∈K and a·b = 1
by autowith not_triv A1 show ∃ b∈K0 . a·b = 1
using Ring_ZF_1_L6 by autoqed

If we remove zero, the field with multiplication becomes a group and we canuse all theorems proven in group0 context.
theorem (in field0) Field_ZF_1_L4: shows
IsAgroup(K0 ,restrict(M,K0 ×K0 ))group0(K0 ,restrict(M,K0 ×K0 ))1 = TheNeutralElement(K0 ,restrict(M,K0 ×K0 ))proof let f = restrict(M,K0 ×K0 )have
M {is associative on} K
K0 ⊆ K K0 {is closed under} M
using Field_ZF_1_L1 IsAfield_def IsAring_def IsAgroup_def
IsAmonoid_def Field_ZF_1_L2 by auto
then have f {is associative on} K0
using func_ZF_4_L3 by simp
moreoverfrom not_triv have
I: 1∈K0 ∧ (∀ a∈K0 . fh1,ai = a ∧ fha,1i = a)using Ring_ZF_1_L2 Ring_ZF_1_L3 by auto
then have ∃ n∈K0 . ∀ a∈K0 . fhn,ai = a ∧ fha,ni = aby blast
ultimately have II: IsAmonoid(K0 ,f) using IsAmonoid_def
by simpthen have monoid0(K0 ,f) using monoid0_def by simp
moreover note I
ultimately show 1 = TheNeutralElement(K0 ,f)by (rule monoid0.group0_1_L4)
then have ∀ a∈K0 .∃ b∈K0 . fha,bi = TheNeutralElement(K0 ,f)using Field_ZF_1_L3 by autowith II show IsAgroup(K0 ,f) by (rule definition_of_group)
then show group0(K0 ,f) using group0_def by simp
qed

The inverse of a nonzero field element is nonzero.
lemma (in field0) Field_ZF_1_L5: assumes A1: a∈K a6=0
shows a−1 ∈ K0 (a−1 )2 ∈ K0
a−1 ∈ K a−1 6= 0
proof from A1 have a ∈ K0 by simp
then show a−1 ∈ K0 using Field_ZF_1_L4 group0.inverse_in_groupby autothen show (a−1 )2 ∈ K0 a−1 ∈ K a−1 6= 0
using Field_ZF_1_L2 IsOpClosed_def by auto
qed

433

The inverse is really the inverse.
lemma (in field0) Field_ZF_1_L6: assumes A1: a∈K a6=0
shows a·a−1 = 1 a−1 ·a = 1
proof let f = restrict(M,K0 ×K0 )from A1 havegroup0(K0 ,f)a ∈ K0using Field_ZF_1_L4 by auto
then have
fha,GroupInv(K0 , f)(a)i = TheNeutralElement(K0 ,f) ∧fhGroupInv(K0 ,f)(a),ai = TheNeutralElement(K0 , f)by (rule group0.group0_2_L6)
with A1 show a·a−1 = 1 a−1 ·a = 1
using Field_ZF_1_L5 Field_ZF_1_L4 by autoqed

A lemma with two field elements and cancelling.
lemma (in field0) Field_ZF_1_L7: assumes a∈K b∈K b6=0
shows
a·b·b−1 = aa·b−1 ·b = ausing assms Field_ZF_1_L5 Ring_ZF_1_L11 Field_ZF_1_L6 Ring_ZF_1_L3
by auto39.2

Equations and identities

This section deals with more specialized identities that are true in fields.
a/(a2 ) = 1/a.
lemma (in field0) Field_ZF_2_L1: assumes A1: a∈Kshows a·(a−1 )2 = a−1
proof have a·(a−1 )2 = a·(a−1 ·a−1 ) by simp
also from A1 have . . . = (a·a−1 )·a−1
using Field_ZF_1_L5 Ring_ZF_1_L11
by simp
also from A1 have . . . = a−1
using Field_ZF_1_L6 Field_ZF_1_L5 Ring_ZF_1_L3
by simp
finally show a·(a−1 )2 = a−1 by simp
qed

a6=0

If we multiply two different numbers by a nonzero number, the results will
be different.
lemma (in field0) Field_ZF_2_L2:
assumes a∈K b∈K c∈K a6=b c6=0
shows a·c−1 6= b·c−1

434using assms field_has_no_zero_divs Field_ZF_1_L5 Ring_ZF_1_L12B
by simp

We can put a nonzero factor on the other side of non-identity (is this thebest way to call it?) changing it to the inverse.
lemma (in field0) Field_ZF_2_L3:
assumes A1: a∈K b∈K b6=0 c∈K
and A2: a·b 6= cshows a 6= c·b−1
proof from A1 A2 have a·b·b−1 6= c·b−1
using Ring_ZF_1_L4 Field_ZF_2_L2 by simp
with A1 show a 6= c·b−1 using Field_ZF_1_L7
by simpqed

If if the inverse of b is different than a, then the inverse of a is different thanb.
lemma (in field0) Field_ZF_2_L4:
assumes a∈K a6=0 and b−1 6= ashows a−1 6= b
using assms Field_ZF_1_L4 group0.group0_2_L11B
by simp

An identity with two field elements, one and an inverse.
lemma (in field0) Field_ZF_2_L5:
assumes a∈K b∈K b6=0
shows (1 + a·b)·b−1 = a + b−1
using assms Ring_ZF_1_L4 Field_ZF_1_L5 Ring_ZF_1_L2 ring_oper_distrField_ZF_1_L7 Ring_ZF_1_L3 by simp

An identity with three field elements, inverse and cancelling.
lemma (in field0) Field_ZF_2_L6: assumes A1: a∈K b∈Kshows a·b·(c·b−1 ) = a·c
proof from A1 have T: a·b ∈ K b−1 ∈ Kusing Ring_ZF_1_L4 Field_ZF_1_L5 by autowith mult_commute A1 have a·b·(c·b−1 ) = a·b·(b−1 ·c)using IsCommutative_def by simp
moreoverfrom A1 T have a·b ∈ K b−1 ∈ K c∈K
by autothen have a·b·b−1 ·c = a·b·(b−1 ·c)by (rule Ring_ZF_1_L11)
ultimately have a·b·(c·b−1 ) = a·b·b−1 ·c by simp
with A1 show a·b·(c·b−1 ) = a·cusing Field_ZF_1_L7 by simp
qed

435

b6=0

c∈K

39.3

1/0=0

In ZF if f : X → Y and x ∈/ X we have f (x) = ∅. Since ∅ (the empty set)in ZF is the same as zero of natural numbers we can claim that 1/0 = 0
in certain sense. In this section we prove a theorem that makes makes it
explicit.
The next locale extends the field0 locale to introduce notation for division
operation.
locale fieldd = field0 +fixes division
defines division_def[simp]: division ≡ {hp,fst(p)·snd(p)−1 i. p∈K×K0 }fixes fdiv (infixl / 95)
defines fdiv_def[simp]: x/y ≡ divisionhx,yiDivision is a function on K × K0 with values in K.
lemma (in fieldd) div_fun: shows division: K×K0 → K
proof have ∀ p ∈ K×K0 . fst(p)·snd(p)−1 ∈ K
proof
fix p assume p ∈ K×K0
hence fst(p) ∈ K and snd(p) ∈ K0 by auto
then show fst(p)·snd(p)−1 ∈ K using Ring_ZF_1_L4 Field_ZF_1_L5 byauto
qedthen have {hp,fst(p)·snd(p)−1 i. p∈K×K0 }: K×K0 → K
by (rule ZF_fun_from_total)thus thesis by simp
qed

So, really 1/0 = 0. The essential lemma is apply_0 from standard Isabelle’s
func.thy.
theorem (in fieldd) one_over_zero: shows 1/0 = 0
proof have domain(division) = K×K0 using div_fun func1_1_L1
by simphence h1,0i ∈/ domain(division) by auto
then show thesis using apply_0 by simp
qed
end

40

Ordered fields

theory OrderedField_ZF imports OrderedRing_ZF Field_ZF
begin

436

This theory covers basic facts about ordered fiels.

40.1

Definition and basic properties

Here we define ordered fields and proove their basic properties.
Ordered field is a notrivial ordered ring such that all non-zero elements havean inverse. We define the notion of being a ordered field as a statement aboutfour sets. The first set, denoted K is the carrier of the field. The second set,
denoted A represents the additive operation on K (recall that in ZF set theory
functions are sets). The third set M represents the multiplicative operation
on K. The fourth set r is the order relation on K.
definition
IsAnOrdField(K,A,M,r) ≡ (IsAnOrdRing(K,A,M,r) ∧(M {is commutative on} K) ∧TheNeutralElement(K,A) 6= TheNeutralElement(K,M) ∧(∀ a∈K. a6=TheNeutralElement(K,A)−→(∃ b∈K. Mha,bi = TheNeutralElement(K,M))))

The next context (locale) defines notation used for ordered fields. We dothat by extending the notation defined in the ring1 context that is used fororedered rings and adding some assumptions to make sure we are talking
about ordered fields in this context. We should rename the carrier from R
used in the ring1 context to K, more appriopriate for fields. Theoreticallythe Isar locale facility supports such renaming, but we experienced diffculties
using some lemmas from ring1 locale after renaming.
locale field1 = ring1 +assumes mult_commute: M {is commutative on} R
assumes not_triv: 0 6= 1
assumes inv_exists: ∀ a∈R. a6=0 −→ (∃ b∈R. a·b = 1)
fixes non_zero (R0 )defines non_zero_def[simp]: R0 ≡ R-{0}fixes inv (_−1 [96] 97)
defines inv_def[simp]: a−1 ≡ GroupInv(R0 ,restrict(M,R0 ×R0 ))(a)The next lemma assures us that we are talking fields in the field1 context.
lemma (in field1) OrdField_ZF_1_L1: shows IsAnOrdField(R,A,M,r)using OrdRing_ZF_1_L1 mult_commute not_triv inv_exists IsAnOrdField_def
by simp

Ordered field is a field, of course.

437

lemma OrdField_ZF_1_L1A: assumes IsAnOrdField(K,A,M,r)shows IsAfield(K,A,M)
using assms IsAnOrdField_def IsAnOrdRing_def IsAfield_def
by simp

Theorems proven in field0 (about fields) context are valid in the field1
context (about ordered fields).
lemma (in field1) OrdField_ZF_1_L1B: shows field0(R,A,M)
using OrdField_ZF_1_L1 OrdField_ZF_1_L1A field_field0
by simp

We can use theorems proven in the field1 context whenever we talk about
an ordered field.
lemma OrdField_ZF_1_L2: assumes IsAnOrdField(K,A,M,r)shows field1(K,A,M,r)using assms IsAnOrdField_def OrdRing_ZF_1_L2 ring1_def
IsAnOrdField_def field1_axioms_def field1_def
by autoIn ordered rings the existence of a right inverse for all positive elements
implies the existence of an inverse for all non zero elements.
lemma (in ring1) OrdField_ZF_1_L3:
assumes A1: ∀ a∈R+ . ∃ b∈R. a·b = 1 and A2: c∈Rshows ∃ b∈R. c·b = 1
proof { assume c∈R+
with A1 have ∃ b∈R. c·b = 1 by simp }moreover{ assume c∈R/ +with A2 have (-c) ∈ R+
using OrdRing_ZF_3_L2A by simp
with A1 obtain b where b∈R and (-c)·b = 1
by autowith A2 have (-b) ∈ R c·(-b) = 1
using Ring_ZF_1_L3 Ring_ZF_1_L7 by auto
then have ∃ b∈R. c·b = 1 by auto }
ultimately show thesis by blast
qed

c6=0

Ordered fields are easier to deal with, because it is sufficient to show theexistence of an inverse for the set of positive elements.
lemma (in ring1) OrdField_ZF_1_L4:
assumes 0 6= 1 and M {is commutative on} Rand ∀ a∈R+ . ∃ b∈R. a·b = 1
shows IsAnOrdField(R,A,M,r)using assms OrdRing_ZF_1_L1 OrdField_ZF_1_L3 IsAnOrdField_def
by simp

The set of positive field elements is closed under multiplication.
438

lemma (in field1) OrdField_ZF_1_L5: shows R+ {is closed under} M
using OrdField_ZF_1_L1B field0.field_has_no_zero_divs OrdRing_ZF_3_L3
by simp

The set of positive field elements is closed under multiplication: the explicit
version.
lemma (in field1) pos_mul_closed:
assumes A1: 0 < a 0 < bshows 0 < a·b
proof from A1 have a ∈ R+ and b ∈ R+
using OrdRing_ZF_3_L14 by auto
then show 0 < a·busing OrdField_ZF_1_L5 IsOpClosed_def PositiveSet_def
by simpqed

In fields square of a nonzero element is positive.
lemma (in field1) OrdField_ZF_1_L6: assumes a∈R a6=0
shows a2 ∈ R+
using assms OrdField_ZF_1_L1B field0.field_has_no_zero_divs
OrdRing_ZF_3_L15 by simp

The next lemma restates the fact Field_ZF that out notation for the field
inverse means what it is supposed to mean.
lemma (in field1) OrdField_ZF_1_L7: assumes a∈R a6=0
shows a·(a−1 ) = 1 (a−1 )·a = 1
using assms OrdField_ZF_1_L1B field0.Field_ZF_1_L6
by autoA simple lemma about multiplication and cancelling of a positive field element.
lemma (in field1) OrdField_ZF_1_L7A:
assumes A1: a∈R b ∈ R+
shows
a·b·b−1 = aa·b−1 ·b = a
proof from A1 have b∈R b6=0 using PositiveSet_def
by autowith A1 show a·b·b−1 = a and a·b−1 ·b = ausing OrdField_ZF_1_L1B field0.Field_ZF_1_L7
by autoqed

Some properties of the inverse of a positive element.
lemma (in field1) OrdField_ZF_1_L8: assumes A1: a ∈ R+
shows a−1 ∈ R+ a·(a−1 ) = 1 (a−1 )·a = 1

439

proof from A1 have I: a∈R a6=0 using PositiveSet_def
by autowith A1 have a·(a−1 )2 ∈ R+
using OrdField_ZF_1_L1B field0.Field_ZF_1_L5 OrdField_ZF_1_L6
OrdField_ZF_1_L5 IsOpClosed_def by simp
with I show a−1 ∈ R+
using OrdField_ZF_1_L1B field0.Field_ZF_2_L1
by simpfrom I show a·(a−1 ) = 1 (a−1 )·a = 1
using OrdField_ZF_1_L7 by autoqed

If a < b, then (b − a)−1 is positive.
lemma (in field1) OrdField_ZF_1_L9: assumes a<bshows (b-a)−1 ∈ R+
using assms OrdRing_ZF_1_L14 OrdField_ZF_1_L8
by simpIn ordered fields if at least one of a, b is not zero, then a2 + b2 > 0, in
particular a2 + b2 6= 0 and exists the (multiplicative) inverse of a2 + b2 .
lemma (in field1) OrdField_ZF_1_L10:
assumes A1: a∈R b∈R and A2: a 6= 0 ∨ b 6= 0
shows 0 < a2 + b2 and ∃ c∈R. (a2 + b2 )·c = 1
proof from A1 A2 show 0 < a2 + b2
using OrdField_ZF_1_L1B field0.field_has_no_zero_divs
OrdRing_ZF_3_L19 by simp
then have(a2 + b2 )−1 ∈ R and (a2 + b2 )·(a2 + b2 )−1 = 1
using OrdRing_ZF_1_L3 PositiveSet_def OrdField_ZF_1_L8
by autothen show ∃ c∈R. (a2 + b2 )·c = 1 by auto
qed

40.2

Inequalities

In this section we develop tools to deal inequalities in fields.
We can multiply strict inequality by a positive element.
lemma (in field1) OrdField_ZF_2_L1:
assumes a<b and c∈R+shows a·c < b·cusing assms OrdField_ZF_1_L1B field0.field_has_no_zero_divs
OrdRing_ZF_3_L13
by simpA special case of OrdField_ZF_2_L1 when we multiply an inverse by an element.
440lemma (in field1) OrdField_ZF_2_L2:
assumes A1: a∈R+ and A2: a−1 < bshows 1 < b·a
proof from A1 A2 have (a−1 )·a < b·ausing OrdField_ZF_2_L1 by simp
with A1 show 1 < b·ausing OrdField_ZF_1_L8 by simpqed

We can multiply an inequality by the inverse of a positive element.
lemma (in field1) OrdField_ZF_2_L3:
assumes a≤b and c∈R+ shows a·(c−1 ) ≤ b·(c−1 )using assms OrdField_ZF_1_L8 OrdRing_ZF_1_L9A
by simp

We can multiply a strict inequality by a positive element or its inverse.
lemma (in field1) OrdField_ZF_2_L4:
assumes a<b and c∈R+shows
a·c < b·c
c·a < c·ba·c−1 < b·c−1
using assms OrdField_ZF_1_L1B field0.field_has_no_zero_divs
OrdField_ZF_1_L8 OrdRing_ZF_3_L13 by auto

We can put a positive factor on the other side of an inequality, changing it
to its inverse.
lemma (in field1) OrdField_ZF_2_L5:
assumes A1: a∈R b∈R+ and A2: a·b ≤ cshows a ≤ c·b−1
proof from A1 A2 have a·b·b−1 ≤ c·b−1
using OrdField_ZF_2_L3 by simp
with A1 show a ≤ c·b−1 using OrdField_ZF_1_L7A
by simpqed

We can put a positive factor on the other side of an inequality, changing it
to its inverse, version with a product initially on the right hand side.
lemma (in field1) OrdField_ZF_2_L5A:
assumes A1: b∈R c∈R+ and A2: a ≤ b·cshows a·c−1 ≤ b
proof from A1 A2 have a·c−1 ≤ b·c·c−1
using OrdField_ZF_2_L3 by simp
with A1 show a·c−1 ≤ b using OrdField_ZF_1_L7A
by simp441

qed

We can put a positive factor on the other side of a strict inequality, changing
it to its inverse, version with a product initially on the left hand side.
lemma (in field1) OrdField_ZF_2_L6:
assumes A1: a∈R b∈R+ and A2: a·b < cshows a < c·b−1
proof from A1 A2 have a·b·b−1 < c·b−1
using OrdField_ZF_2_L4 by simp
with A1 show a < c·b−1 using OrdField_ZF_1_L7A
by simpqed

We can put a positive factor on the other side of a strict inequality, changing
it to its inverse, version with a product initially on the right hand side.
lemma (in field1) OrdField_ZF_2_L6A:
assumes A1: b∈R c∈R+ and A2: a < b·cshows a·c−1 < bproof from A1 A2 have a·c−1 < b·c·c−1
using OrdField_ZF_2_L4 by simp
with A1 show a·c−1 < b using OrdField_ZF_1_L7A
by simpqed

Sometimes we can reverse an inequality by taking inverse on both sides.
lemma (in field1) OrdField_ZF_2_L7:
assumes A1: a∈R+ and A2: a−1 ≤ bshows b−1 ≤ aproof from A1 have a−1 ∈ R+ using OrdField_ZF_1_L8
by simpwith A2 have b ∈ R+ using OrdRing_ZF_3_L7
by blast
then have T: b ∈ R+ b−1 ∈ R+ using OrdField_ZF_1_L8
by autowith A1 A2 have b−1 ·a−1 ·a ≤ b−1 ·b·a
using OrdRing_ZF_1_L9A by simp
moreoverfrom A1 A2 T haveb−1 ∈ R a∈R a6=0 b∈R b6=0
using PositiveSet_def OrdRing_ZF_1_L3 by auto
then have b−1 ·a−1 ·a = b−1 and b−1 ·b·a = ausing OrdField_ZF_1_L1B field0.Field_ZF_1_L7
field0.Field_ZF_1_L6 Ring_ZF_1_L3
by autoultimately show b−1 ≤ a by simp

442

qed

Sometimes we can reverse a strict inequality by taking inverse on both sides.
lemma (in field1) OrdField_ZF_2_L8:
assumes A1: a∈R+ and A2: a−1 < bshows b−1 < aproof from A1 A2 have a−1 ∈ R+ a−1 ≤busing OrdField_ZF_1_L8 by auto
then have b ∈ R+ using OrdRing_ZF_3_L7
by blast
then have b∈R b6=0 using PositiveSet_def by autowith A2 have b−1 6= ausing OrdField_ZF_1_L1B field0.Field_ZF_2_L4
by simpwith A1 A2 show b−1 < ausing OrdField_ZF_2_L7 by simpqed

A technical lemma about solving a strict inequality with three field elements
and inverse of a difference.
lemma (in field1) OrdField_ZF_2_L9:
assumes A1: a<b and A2: (b-a)−1 < cshows 1 + a·c < b·c
proof from A1 A2 have (b-a)−1 ∈ R+ (b-a)−1 ≤ cusing OrdField_ZF_1_L9 by auto
then have T1: c ∈ R+ using OrdRing_ZF_3_L7 by blast
with A1 A2 have T2:a∈R b∈R c∈R c6=0
c−1 ∈ R
using OrdRing_ZF_1_L3 OrdField_ZF_1_L8 PositiveSet_def
by autowith A1 A2 have c−1 + a < b-a + ausing OrdRing_ZF_1_L14 OrdField_ZF_2_L8 ring_strict_ord_trans_inv
by simpwith T1 T2 have (c−1 + a)·c < b·cusing Ring_ZF_2_L1A OrdField_ZF_2_L1 by simp
with T1 T2 show 1 + a·c < b·cusing ring_oper_distr OrdField_ZF_1_L8
by simpqed

40.3

Definition of real numbers

The only purpose of this section is to define what does it mean to be a modelof real numbers.
We define model of real numbers as any quadruple of sets (K, A, M, r) suchthat (K, A, M, r) is an ordered field and the order relation r is complete,443

that is every set that is nonempty and bounded above in this relation has asupremum.
definition
IsAmodelOfReals(K,A,M,r) ≡ IsAnOrdField(K,A,M,r) ∧ (r {is complete})end

41Integers - introduction

theory Int_ZF_IML imports OrderedGroup_ZF_1 Finite_ZF_1 ZF.Int Nat_ZF_IML
begin

This theory file is an interface between the old-style Isabelle (ZF logic)
material on integers and the IsarMathLib project. Here we redefine themeta-level operations on integers (addition and multiplication) to convert
them to ZF-functions and show that integers form a commutative group withrespect to addition and commutative monoid with respect to multiplication.
Similarly, we redefine the order on integers as a relation, that is a subset of
Z × Z. We show that a subset of intergers is bounded iff it is finite. As
we are forced to use standard Isabelle notation with all these dollar signs,
sharps etc. to denote ”type coercions” (?) the notation is often ugly anddifficult to read.

41.1

Addition and multiplication as ZF-functions.

In this section we provide definitions of addition and multiplication as subsets of (Z×Z)×Z. We use the (higher order) relation defined in the standard
Int theory to define a subset of Z × Z that constitutes the ZF order relation
corresponding to it. We define the set of positive integers using the notionof positive set from the OrderedGroup_ZF theory.
Definition of addition of integers as a binary operation on int. Recall thatin standard Isabelle/ZF int is the set of integers and the sum of integers isdenoted by prependig + with a dollar sign.
definition
IntegerAddition ≡ { h x,ci ∈ (int×int)×int. fst(x) $+ snd(x) = c}Definition of multiplication of integers as a binary operation on int. In
standard Isabelle/ZF product of integers is denoted by prepending the dollar
sign to *.
definition
IntegerMultiplication ≡{ h x,ci ∈ (int×int)×int. fst(x) $* snd(x) = c}444

Definition of natural order on integers as a relation on int. In the standard
Isabelle/ZF the inequality relation on integers is denoted ≤ prepended withthe dollar sign.
definition
IntegerOrder ≡ {p ∈ int×int. fst(p) $≤ snd(p)}This defines the set of positive integers.
definition
PositiveIntegers ≡ PositiveSet(int,IntegerAddition,IntegerOrder)

IntegerAddition and IntegerMultiplication are functions on int × int.
lemma Int_ZF_1_L1: shows
IntegerAddition : int×int → int
IntegerMultiplication : int×int → int
proof have{h x,ci ∈ (int×int)×int. fst(x) $+ snd(x) = c} ∈ int×int→int{h x,ci ∈ (int×int)×int. fst(x) $* snd(x) = c} ∈ int×int→int
using func1_1_L11A by auto
then show IntegerAddition : int×int → int
IntegerMultiplication : int×int → int
using IntegerAddition_def IntegerMultiplication_def by autoqed

The next context (locale) defines notation used for integers. We define 0 to
denote the neutral element of addition, 1 as the unit of the multiplicative
monoid. We introduce notation m≤n for integers and write m..n to denotethe integer interval with endpoints in m and n. abs(m) means the absolutevalue of m. This is a function defined in OrderedGroup that assigns x toitself if x is positive and assigns the opposite of x if x ≤ 0. Unforunately wecannot use the |·| notation as in the OrderedGroup theory as this notation has
been hogged by the standard Isabelle’s Int theory. The notation -A where A
is a subset of integers means the set {−m : m ∈ A}. The symbol maxf(f,M)
denotes tha maximum of function f over the set A. We also introduce asimilar notation for the minimum.
locale int0 =fixes ints (ZZ)
defines ints_def [simp]: ZZ ≡ int
fixes ia (infixl + 69)
defines ia_def [simp]: a+b ≡ IntegerAdditionh a,bi
fixes iminus (- _ 72)
defines rminus_def [simp]: -a ≡ GroupInv(ZZ,IntegerAddition)(a)fixes isub (infixl - 69)445

defines isub_def [simp]: a-b ≡ a+ (- b)fixes imult (infixl · 70)
defines imult_def [simp]: a·b ≡ IntegerMultiplicationh a,bi
fixes setneg (- _ 72)
defines setneg_def [simp]: -A ≡ GroupInv(ZZ,IntegerAddition)(A)fixes izero (0)defines izero_def [simp]: 0 ≡ TheNeutralElement(ZZ,IntegerAddition)
fixes ione (1)defines ione_def [simp]: 1 ≡ TheNeutralElement(ZZ,IntegerMultiplication)
fixes itwo (2)defines itwo_def [simp]: 2 ≡ 1+1
fixes ithree (3)defines ithree_def [simp]: 3 ≡ 2+1
fixes nonnegative (ZZ+ )defines nonnegative_def [simp]:
ZZ+ ≡ Nonnegative(ZZ,IntegerAddition,IntegerOrder)
fixes positive (ZZ+ )defines positive_def [simp]:
ZZ+ ≡ PositiveSet(ZZ,IntegerAddition,IntegerOrder)
fixes abs
defines abs_def [simp]:
abs(m) ≡ AbsoluteValue(ZZ,IntegerAddition,IntegerOrder)(m)fixes lesseq (infix ≤ 60)
defines lesseq_def [simp]: m ≤ n ≡ hm,ni ∈ IntegerOrderfixes interval (infix .. 70)
defines interval_def [simp]: m..n ≡ Interval(IntegerOrder,m,n)fixes maxf
defines maxf_def [simp]: maxf(f,A) ≡ Maximum(IntegerOrder,f(A))
fixes minf
defines minf_def [simp]: minf(f,A) ≡ Minimum(IntegerOrder,f(A))

IntegerAddition adds integers and IntegerMultiplication multiplies integers.
This states that the ZF functions IntegerAddition and IntegerMultiplication
give the same results as the higher-order equivalents defined in the standard
Int theory.
lemma (in int0) Int_ZF_1_L2: assumes A1: a ∈ ZZ

446

b ∈ ZZshowsa+b = a $+ b
a·b = a $* b
proof let x = h a,bi
let c = a $+ b
let d = a $* bfrom A1 have
h x,ci ∈ {h x,ci ∈ (ZZ×ZZ)×ZZ. fst(x) $+ snd(x) = c}h x,di ∈ {h x,di ∈ (ZZ×ZZ)×ZZ. fst(x) $* snd(x) = d}by autothen show a+b = a $+ b a·b = a $* b
using IntegerAddition_def IntegerMultiplication_def
Int_ZF_1_L1 apply_iff by autoqedInteger addition and multiplication are associative.
lemma (in int0) Int_ZF_1_L3:
assumes x∈ZZ y∈ZZ z∈ZZ
shows x+y+z = x+(y+z) x·y·z = x·(y·z)
using assms Int_ZF_1_L2 zadd_assoc zmult_assoc by auto

Integer addition and multiplication are commutative.
lemma (in int0) Int_ZF_1_L4:
assumes x∈ZZ y∈ZZshows x+y = y+x x·y = y·x
using assms Int_ZF_1_L2 zadd_commute zmult_commuteby autoZero is neutral for addition and one for multiplication.
lemma (in int0) Int_ZF_1_L5: assumes A1:x∈ZZ
shows ($# 0) + x = x ∧ x + ($# 0) = x($# 1)·x = x ∧ x·($# 1) = x
proof from A1 show ($# 0) + x = x ∧ x + ($# 0) = x
using Int_ZF_1_L2 zadd_int0 Int_ZF_1_L4 by simp
from A1 have ($# 1)·x = x
using Int_ZF_1_L2 zmult_int1 by simp
with A1 show ($# 1)·x = x ∧ x·($# 1) = x
using Int_ZF_1_L4 by simp
qed

Zero is neutral for addition and one for multiplication.
lemma (in int0) Int_ZF_1_L6: shows ($# 0)∈ZZ ∧(∀ x∈ZZ. ($# 0)+x = x ∧ x+($# 0) = x)($# 1)∈ZZ ∧(∀ x∈ZZ. ($# 1)·x = x ∧ x·($# 1) = x)using Int_ZF_1_L5 by auto

447

Integers with addition and integers with multiplication form monoids.
theorem (in int0) Int_ZF_1_T1: shows
IsAmonoid(ZZ,IntegerAddition)
IsAmonoid(ZZ,IntegerMultiplication)
proof have
∃ e∈ZZ. ∀ x∈ZZ. e+x = x ∧ x+e = x∃ e∈ZZ. ∀ x∈ZZ. e·x = x ∧ x·e = x
using int0.Int_ZF_1_L6 by auto
then show IsAmonoid(ZZ,IntegerAddition)
IsAmonoid(ZZ,IntegerMultiplication) using
IsAmonoid_def IsAssociative_def Int_ZF_1_L1 Int_ZF_1_L3
by autoqed

Zero is the neutral element of the integers with addition and one is theneutral element of the integers with multiplication.
lemma (in int0) Int_ZF_1_L8: shows ($# 0) = 0 ($# 1) = 1
proof have monoid0(ZZ,IntegerAddition)using Int_ZF_1_T1 monoid0_def by simp
moreover have($# 0)∈ZZ ∧(∀ x∈ZZ. IntegerAdditionh$# 0,xi = x ∧IntegerAdditionhx ,$# 0i = x)using Int_ZF_1_L6 by auto
ultimately have ($# 0) = TheNeutralElement(ZZ,IntegerAddition)by (rule monoid0.group0_1_L4)
then show ($# 0) = 0 by simp
have monoid0(int,IntegerMultiplication)using Int_ZF_1_T1 monoid0_def by simp
moreover have ($# 1) ∈ int ∧(∀ x∈int. IntegerMultiplicationh$# 1, xi = x ∧IntegerMultiplicationhx ,$# 1i = x)using Int_ZF_1_L6 by auto
ultimately have($# 1) = TheNeutralElement(int,IntegerMultiplication)by (rule monoid0.group0_1_L4)
then show ($# 1) = 1 by simp
qed

0 and 1, as defined in int0 context, are integers.
lemma (in int0) Int_ZF_1_L8A: shows 0 ∈ ZZ 1 ∈ ZZ
proof have ($# 0) ∈ ZZ ($# 1) ∈ ZZ by auto
then show 0 ∈ ZZ 1 ∈ ZZ using Int_ZF_1_L8 by autoqed

Zero is not one.
448

lemma (in int0) int_zero_not_one: shows 0 6= 1
proof have ($# 0) 6= ($# 1) by simp
then show 0 6= 1 using Int_ZF_1_L8 by simp
qed

The set of integers is not empty, of course.
lemma (in int0) int_not_empty: shows ZZ 6= 0
using Int_ZF_1_L8A by auto

The set of integers has more than just zero in it.
lemma (in int0) int_not_trivial: shows ZZ 6= {0}using Int_ZF_1_L8A int_zero_not_one by blast

Each integer has an inverse (in the addition sense).
lemma (in int0) Int_ZF_1_L9: assumes A1: g ∈ ZZ
shows ∃ b∈ZZ. g+b = 0
proof from A1 have g+ $-g = 0
using Int_ZF_1_L2 Int_ZF_1_L8 by simp
thus thesis by autoqedIntegers with addition form an abelian group. This also shows that we canapply all theorems proven in the proof contexts (locales) that require theassumpion that some pair of sets form a group like locale group0.
theorem Int_ZF_1_T2: shows
IsAgroup(int,IntegerAddition)
IntegerAddition {is commutative on} int
group0(int,IntegerAddition)using int0.Int_ZF_1_T1 int0.Int_ZF_1_L9 IsAgroup_defgroup0_def int0.Int_ZF_1_L4 IsCommutative_def by auto

What is the additive group inverse in the group of integers?
lemma (in int0) Int_ZF_1_L9A: assumes A1: m∈ZZ
shows $-m = -m
proof from A1 have m∈int $-m ∈ int IntegerAdditionh m,$-mi =TheNeutralElement(int,IntegerAddition)using zminus_type Int_ZF_1_L2 Int_ZF_1_L8 by auto
then have $-m = GroupInv(int,IntegerAddition)(m)using Int_ZF_1_T2 group0.group0_2_L9 by blast
then show thesis by simp
qed

Subtracting integers corresponds to adding the negative.
lemma (in int0) Int_ZF_1_L10: assumes A1: m∈ZZ

449

n∈ZZ

shows m-n = m $+ $-n
using assms Int_ZF_1_T2
by simpgroup0.inverse_in_group Int_ZF_1_L9A Int_ZF_1_L2

Negative of zero is zero.
lemma (in int0) Int_ZF_1_L11: shows (-0) = 0
using Int_ZF_1_T2 group0.group_inv_of_one by simp

A trivial calculation lemma that allows to subtract and add one.
lemma Int_ZF_1_L12:
assumes m∈int shows m $- $#1 $+ $#1 = musing assms eq_zdiff_iff by auto

A trivial calculation lemma that allows to subtract and add one, version
with ZF-operation.
lemma (in int0) Int_ZF_1_L13: assumes m∈ZZ
shows (m $- $#1) + 1 = musing assms Int_ZF_1_L8A Int_ZF_1_L2 Int_ZF_1_L8 Int_ZF_1_L12
by simp

Adding or subtracing one changes integers.
lemma (in int0) Int_ZF_1_L14: assumes A1: m∈ZZ
shows
m+1 6= m
m-1 6= mproof { assume m+1 = m
with A1 havegroup0(ZZ,IntegerAddition)m∈ZZ 1∈ZZ
IntegerAdditionhm,1i = musing Int_ZF_1_T2 Int_ZF_1_L8A by auto
then have 1 = TheNeutralElement(ZZ,IntegerAddition)by (rule group0.group0_2_L7)
then have False using int_zero_not_one by simp
} then show I: m+1 6= m by auto
{ from A1 have m - 1 + 1 = musing Int_ZF_1_L8A Int_ZF_1_T2 group0.inv_cancel_two
by simpmoreover assume m-1 = m
ultimately have m + 1 = m by simp
with I have False by simp
} then show m-1 6= m by autoqed

If the difference is zero, the integers are equal.
lemma (in int0) Int_ZF_1_L15:
assumes A1: m∈ZZ n∈ZZ and A2: m-n = 0

450

shows m=n
proof let G = ZZ
let f = IntegerAddition
from A1 A2 havegroup0(G, f)m ∈ G n ∈ G
fhm, GroupInv(G, f)(n)i = TheNeutralElement(G, f)using Int_ZF_1_T2 by auto
then show m=n by (rule group0.group0_2_L11A)
qed

41.2

Integers as an ordered group

In this section we define order on integers as a relation, that is a subset of
Z × Z and show that integers form an ordered group.
The next lemma interprets the order definition one way.
lemma (in int0) Int_ZF_2_L1:
assumes A1: m∈ZZ n∈ZZ and A2: m $≤ nshows m ≤ nproof from A1 A2 have h m,ni ∈ {x∈ZZ×ZZ. fst(x) $≤ snd(x)}by simpthen show thesis using IntegerOrder_def by simp
qed

The next lemma interprets the definition the other way.
lemma (in int0) Int_ZF_2_L1A: assumes A1: m ≤ nshows m $≤ n m∈ZZ n∈ZZ
proof from A1 have h m,ni ∈ {p∈ZZ×ZZ. fst(p) $≤ snd(p)}using IntegerOrder_def by simp
thus m $≤ n m∈ZZ n∈ZZ by autoqedInteger order is a relation on integers.
lemma Int_ZF_2_L1B: shows IntegerOrder ⊆ int×int
proof
fix x assume x∈IntegerOrderthen have x ∈ {p∈int×int. fst(p) $≤ snd(p)}using IntegerOrder_def by simp
then show x∈int×int by simp
qed

The way we define the notion of being bounded below, its sufficient for the
relation to be on integers for all bounded below sets to be subsets of integers.
lemma (in int0) Int_ZF_2_L1C:

451

assumes A1: IsBoundedBelow(A,IntegerOrder)shows A⊆ZZ
proof from A1 have
IntegerOrder ⊆ ZZ×ZZ
IsBoundedBelow(A,IntegerOrder)using Int_ZF_2_L1B by auto
then show A⊆ZZ by (rule Order_ZF_3_L1B)qed

The order on integers is reflexive.
lemma (in int0) int_ord_is_refl: shows refl(ZZ,IntegerOrder)using Int_ZF_2_L1 zle_refl refl_def by auto

The essential condition to show antisymmetry of the order on integers.
lemma (in int0) Int_ZF_2_L3:
assumes A1: m ≤ n n ≤ mshows m=nproof from A1 have m $≤ n n $≤ m m∈ZZ n∈ZZusing Int_ZF_2_L1A by auto
then show m=n using zle_anti_sym by autoqed

The order on integers is antisymmetric.
lemma (in int0) Int_ZF_2_L4: shows antisym(IntegerOrder)
proof have ∀ m n. m ≤ n ∧ n ≤ m −→ m=nusing Int_ZF_2_L3 by auto
then show thesis using imp_conj antisym_def by simp
qed

The essential condition to show that the order on integers is transitive.
lemma Int_ZF_2_L5:
assumes A1: hm,ni ∈ IntegerOrder hn,ki ∈ IntegerOrdershows hm,ki ∈ IntegerOrder
proof from A1 have T1: m $≤ n n $≤ k and T2: m∈int k∈int
using int0.Int_ZF_2_L1A by autofrom T1 have m $≤ k by (rule zle_trans)with T2 show thesis using int0.Int_ZF_2_L1 by simp
qed

The order on integers is transitive. This version is stated in the int0 context
using notation for integers.
lemma (in int0) Int_order_transitive:
assumes A1: m≤n n≤kshows m≤k452

proof from A1 have h m,ni ∈ IntegerOrder h n,ki ∈ IntegerOrderby autothen have h m,ki ∈ IntegerOrder by (rule Int_ZF_2_L5)
then show m≤k by simp
qed

The order on integers is transitive.
lemma Int_ZF_2_L6: shows trans(IntegerOrder)
proof have ∀ m n k.
hm, ni ∈ IntegerOrder ∧ hn, ki ∈ IntegerOrder −→hm, ki ∈ IntegerOrderusing Int_ZF_2_L5 by blast
then show thesis by (rule Fol1_L2)
qed

The order on integers is a partial order.
lemma Int_ZF_2_L7: shows IsPartOrder(int,IntegerOrder)using int0.int_ord_is_refl int0.Int_ZF_2_L4
Int_ZF_2_L6 IsPartOrder_def by simp

The essential condition to show that the order on integers is preserved bytranslations.
lemma (in int0) int_ord_transl_inv:
assumes A1: k ∈ ZZ and A2: m ≤ nshows m+k ≤ n+k
k+m≤ k+n
proof from A2 have m $≤ n and m∈ZZ n∈ZZusing Int_ZF_2_L1A by autowith A1 show m+k ≤ n+k
k+m≤ k+nusing zadd_right_cancel_zle zadd_left_cancel_zle
Int_ZF_1_L2 Int_ZF_1_L1 apply_funtype
Int_ZF_1_L2 Int_ZF_2_L1 Int_ZF_1_L2 by autoqedIntegers form a linearly ordered group. We can apply all theorems provenin group3 context to integers.
theorem (in int0) Int_ZF_2_T1: shows
IsAnOrdGroup(ZZ,IntegerAddition,IntegerOrder)
IntegerOrder {is total on} ZZ
group3(ZZ,IntegerAddition,IntegerOrder)
IsLinOrder(ZZ,IntegerOrder)
proof have ∀ k∈ZZ. ∀ m n. m ≤ n −→m+k ≤ n+k ∧ k+m≤ k+nusing int_ord_transl_inv by simp
then show T1: IsAnOrdGroup(ZZ,IntegerAddition,IntegerOrder) using453

Int_ZF_1_T2 Int_ZF_2_L1B Int_ZF_2_L7 IsAnOrdGroup_def
by simpthen show group3(ZZ,IntegerAddition,IntegerOrder)using group3_def by simp
have ∀ n∈ZZ. ∀ m∈ZZ. n≤m ∨ m≤nusing zle_linear Int_ZF_2_L1 by auto
then show IntegerOrder {is total on} ZZ
using IsTotal_def by simp
with T1 show IsLinOrder(ZZ,IntegerOrder)using IsAnOrdGroup_def IsPartOrder_def IsLinOrder_def by simp
qed

If a pair (i, m) belongs to the order relation on integers and i 6= m, theni < m in the sense of defined in the standard Isabelle’s Int.thy.
lemma (in int0) Int_ZF_2_L9: assumes A1: i ≤ m and A2: i6=m
shows i $< mproof from A1 have i $≤ m i∈ZZ m∈ZZ
using Int_ZF_2_L1A by autowith A2 show i $< m using zle_def by simp
qedThis shows how Isabelle’s $< operator translates to IsarMathLib notation.
lemma (in int0) Int_ZF_2_L9AA: assumes A1: m∈ZZ
and A2: m $< nshows m≤n m 6= nusing assms zle_def Int_ZF_2_L1 by auton∈ZZ

A small technical lemma about putting one on the other side of an inequality.
lemma (in int0) Int_ZF_2_L9A:
assumes A1: k∈ZZ and A2: m ≤ k $- ($# 1)
shows m+1 ≤ k
proof from A2 have m+1 ≤ (k $- ($# 1)) + 1
using Int_ZF_1_L8A int_ord_transl_inv by simp
with A1 show m+1 ≤ kusing Int_ZF_1_L13 by simpqed

We can put any integer on the other side of an inequality reversing its sign.
lemma (in int0) Int_ZF_2_L9B: assumes i∈ZZ m∈ZZ k∈ZZshows i+m ≤ k ←→ i ≤ k-m
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L9A
by simpA special case of Int_ZF_2_L9B with weaker assumptions.
lemma (in int0) Int_ZF_2_L9C:
assumes i∈ZZ m∈ZZ and i-m ≤ k454

shows i ≤ k+musing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L9B
by simpTaking (higher order) minus on both sides of inequality reverses it.
lemma (in int0) Int_ZF_2_L10: assumes k ≤ ishows(-i) ≤ (-k)$-i ≤ $-kusing assms Int_ZF_2_L1A Int_ZF_1_L9A Int_ZF_2_T1
group3.OrderedGroup_ZF_1_L5 by auto

Taking minus on both sides of inequality reverses it, version with a negativeon one side.
lemma (in int0) Int_ZF_2_L10AA: assumes n∈ZZ m≤(-n)
shows n≤(-m)
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L5AD
by simp

We can cancel the same element on on both sides of an inequality, a version
with minus on both sides.
lemma (in int0) Int_ZF_2_L10AB:
assumes m∈ZZ n∈ZZ k∈ZZ and m-n ≤ m-k
shows k≤nusing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L5AF
by simp

If an integer is nonpositive, then its opposite is nonnegative.
lemma (in int0) Int_ZF_2_L10A: assumes k ≤ 0shows 0≤(-k)
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L5A by simp

If the opposite of an integers is nonnegative, then the integer is nonpositive.
lemma (in int0) Int_ZF_2_L10B:
assumes k∈ZZ and 0≤(-k)
shows k≤0
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L5AA by simp

Adding one to an integer corresponds to taking a successor for a natural
number.
lemma (in int0) Int_ZF_2_L11:
shows i $+ $# n $+ ($# 1) = i $+ $# succ(n)proof have $# succ(n) = $#1 $+ $# n using int_succ_int_1 by blast
then have i $+ $# succ(n) = i $+ ($# n $+ $#1)
using zadd_commute by simp
then show thesis using zadd_assoc by simp

455

qed

Adding a natural number increases integers.
lemma (in int0) Int_ZF_2_L12: assumes A1: i∈ZZ and A2: n∈nat
shows i ≤ i $+ $#n
proof { assume n = 0
with A1 have i ≤ i $+ $#n using zadd_int0 int_ord_is_refl refl_def
by simp }moreover{ assume n6=0
with A2 obtain k where k∈nat n = succ(k)using Nat_ZF_1_L3 by autowith A1 have i ≤ i $+ $#n
using zless_succ_zadd zless_imp_zle Int_ZF_2_L1 by simp }ultimately show thesis by blast
qed

Adding one increases integers.
lemma (in int0) Int_ZF_2_L12A: assumes A1: j≤kshows j ≤ k $+ $#1 j ≤ k+1
proof from A1 have T1:j∈ZZ k∈ZZ j $≤ kusing Int_ZF_2_L1A by auto
moreover from T1 have k $≤ k $+ $#1 using Int_ZF_2_L12 Int_ZF_2_L1A
by simpultimately have j $≤ k $+ $#1 using zle_trans by fastwith T1 show j ≤ k $+ $#1 using Int_ZF_2_L1 by simp
with T1 have j≤ k+$#1
using Int_ZF_1_L2 by simp
then show j ≤ k+1 using Int_ZF_1_L8 by simp
qed

Adding one increases integers, yet one more version.
lemma (in int0) Int_ZF_2_L12B: assumes A1: m∈ZZ shows m ≤ m+1
using assms int_ord_is_refl refl_def Int_ZF_2_L12A by simp

If k + 1 = m + n, where n is a non-zero natural number, then m ≤ k.
lemma (in int0) Int_ZF_2_L13:
assumes A1: k∈ZZ m∈ZZ and A2: n∈nat
and A3: k $+ ($# 1) = m $+ $# succ(n)shows m ≤ kproof from A1 have k∈ZZ m $+ $# n ∈ ZZ by auto
moreover from assms have k $+ $# 1 = m $+ $# n $+ $#1
using Int_ZF_2_L11 by simp
ultimately have k = m $+ $# n using zadd_right_cancel by simp
with A1 A2 show thesis using Int_ZF_2_L12 by simp

456

qed

The absolute value of an integer is an integer.
lemma (in int0) Int_ZF_2_L14: assumes A1: m∈ZZ
shows abs(m) ∈ ZZ
proof have AbsoluteValue(ZZ,IntegerAddition,IntegerOrder) : ZZ→ZZ
using Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L1 by simp
with A1 show thesis using apply_funtype by simp
qed

If two integers are nonnegative, then the opposite of one is less or equal thanthe other and the sum is also nonnegative.
lemma (in int0) Int_ZF_2_L14A:
assumes 0≤m 0≤nshows(-m) ≤ n
0 ≤ m + n
using assms Int_ZF_2_T1
group3.OrderedGroup_ZF_1_L5AC group3.OrderedGroup_ZF_1_L12
by autoWe can increase components in an estimate.
lemma (in int0) Int_ZF_2_L15:
assumes b≤b1 c≤c1 and a≤b+cshows a≤b1 +c1
proof from assms have group3(ZZ,IntegerAddition,IntegerOrder)
ha,IntegerAdditionh b,cii ∈ IntegerOrderhb,b1 i ∈ IntegerOrder hc,c1 i ∈ IntegerOrderusing Int_ZF_2_T1 by auto
then have ha,IntegerAdditionh b1 ,c1 ii ∈ IntegerOrderby (rule group3.OrderedGroup_ZF_1_L5E)
thus thesis by simpqed

We can add or subtract the sides of two inequalities.
lemma (in int0) int_ineq_add_sides:
assumes a≤b and c≤dshows
a+c ≤ b+d
a-d ≤ b-cusing assms Int_ZF_2_T1
group3.OrderedGroup_ZF_1_L5B group3.OrderedGroup_ZF_1_L5I
by autoWe can increase the second component in an estimate.
lemma (in int0) Int_ZF_2_L15A:

457

assumes b∈ZZ and a≤b+c and A3: c≤c1
shows a≤b+c1
proof from assms havegroup3(ZZ,IntegerAddition,IntegerOrder)b ∈ ZZ
ha,IntegerAdditionh b,cii ∈ IntegerOrderhc,c1 i ∈ IntegerOrderusing Int_ZF_2_T1 by auto
then have ha,IntegerAdditionh b,c1 ii ∈ IntegerOrderby (rule group3.OrderedGroup_ZF_1_L5D)
thus thesis by simpqed

If we increase the second component in a sum of three integers, the whole
sum inceases.
lemma (in int0) Int_ZF_2_L15C:
assumes A1: m∈ZZ n∈ZZ and A2: k ≤ Lshows m+k+n ≤ m+L+n
proof let P = IntegerAddition
from assms havegroup3(int,P,IntegerOrder)m ∈ int n ∈ int
hk,Li ∈ IntegerOrderusing Int_ZF_2_T1 by auto
then have hPhPh m,ki,ni, PhPh m,Li,ni i ∈ IntegerOrderby (rule group3.OrderedGroup_ZF_1_L10)
then show m+k+n ≤ m+L+n by simp
qed

We don’t decrease an integer by adding a nonnegative one.
lemma (in int0) Int_ZF_2_L15D:
assumes 0≤n m∈ZZ
shows m ≤ n+musing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L5F
by simp

Some inequalities about the sum of two integers and its absolute value.
lemma (in int0) Int_ZF_2_L15E:
assumes m∈ZZ n∈ZZ
showsm+n ≤ abs(m)+abs(n)m-n ≤ abs(m)+abs(n)(-m)+n ≤ abs(m)+abs(n)(-m)-n ≤ abs(m)+abs(n)using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L6A
by auto458

We can add a nonnegative integer to the right hand side of an inequality.
lemma (in int0) Int_ZF_2_L15F: assumes m≤k and 0≤nshows m ≤ k+n m ≤ n+kusing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L5G
by autoTriangle inequality for integers.
lemma (in int0) Int_triangle_ineq:
assumes m∈ZZ n∈ZZshows abs(m+n)≤abs(m)+abs(n)using assms Int_ZF_1_T2 Int_ZF_2_T1 group3.OrdGroup_triangle_ineq
by simpTaking absolute value does not change nonnegative integers.
lemma (in int0) Int_ZF_2_L16:
assumes 0≤m shows m∈ZZ+ and abs(m) = m
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L2
group3.OrderedGroup_ZF_3_L2 by auto0 ≤ 1, so |1| = 1.
lemma (in int0) Int_ZF_2_L16A: shows 0≤1 and abs(1) = 1
proof have ($# 0) ∈ ZZ ($# 1)∈ ZZ by auto
then have 0≤0 and T1: 1∈ZZ
using Int_ZF_1_L8 int_ord_is_refl refl_def by auto
then have 0≤0+1 using Int_ZF_2_L12A by simp
with T1 show 0≤1 using Int_ZF_1_T2 group0.group0_2_L2
by simpthen show abs(1) = 1 using Int_ZF_2_L16 by simpqed

1 ≤ 2.
lemma (in int0) Int_ZF_2_L16B: shows 1≤2
proof have ($# 1)∈ ZZ by simp
then show 1≤2
using Int_ZF_1_L8 int_ord_is_refl refl_def Int_ZF_2_L12A
by simpqed

Integers greater or equal one are greater or equal zero.
lemma (in int0) Int_ZF_2_L16C:
assumes A1: 1≤a shows0≤a a6=0
2 ≤ a+1
1 ≤ a+1
0 ≤ a+1
proof -

459

from A1 have 0≤1 and 1≤ausing Int_ZF_2_L16A by auto
then show 0≤a by (rule Int_order_transitive)
have I: 0≤1 using Int_ZF_2_L16A by simp
have 1≤2 using Int_ZF_2_L16B by simp
moreover from A1 show 2 ≤ a+1
using Int_ZF_1_L8A int_ord_transl_inv by simp
ultimately show 1 ≤ a+1 by (rule Int_order_transitive)
with I show 0 ≤ a+1 by (rule Int_order_transitive)
from A1 show a6=0 using
Int_ZF_2_L16A Int_ZF_2_L3 int_zero_not_one by autoqed

Absolute value is the same for an integer and its opposite.
lemma (in int0) Int_ZF_2_L17:
assumes m∈ZZ shows abs(-m) = abs(m)using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L7A by simp

The absolute value of zero is zero.
lemma (in int0) Int_ZF_2_L18: shows abs(0) = 0
using Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L2A by simp

A different version of the triangle inequality.
lemma (in int0) Int_triangle_ineq1:
assumes A1: m∈ZZ n∈ZZ
showsabs(m-n) ≤ abs(n)+abs(m)abs(m-n) ≤ abs(m)+abs(n)proof have $-n ∈ ZZ by simp
with A1 have abs(m-n) ≤ abs(m)+abs(-n)
using Int_ZF_1_L9A Int_triangle_ineq by simp
with A1 show
abs(m-n) ≤ abs(n)+abs(m)abs(m-n) ≤ abs(m)+abs(n)using Int_ZF_2_L17 Int_ZF_2_L14 Int_ZF_1_T2 IsCommutative_def
by autoqed

Another version of the triangle inequality.
lemma (in int0) Int_triangle_ineq2:
assumes m∈ZZ n∈ZZ
and abs(m-n) ≤ kshows
abs(m) ≤ abs(n)+km-k ≤ nm ≤ n+kn-k ≤ m460

using assms Int_ZF_1_T2 Int_ZF_2_T1
group3.OrderedGroup_ZF_3_L7D group3.OrderedGroup_ZF_3_L7E
by autoTriangle inequality with three integers. We could use OrdGroup_triangle_ineq3,
but since simp cannot translate the notation directly, it is simpler to reprove
it for integers.
lemma (in int0) Int_triangle_ineq3:
assumes A1: m∈ZZ n∈ZZ k∈ZZshows abs(m+n+k) ≤ abs(m)+abs(n)+abs(k)proof from A1 have T: m+n ∈ ZZ abs(k) ∈ ZZ
using Int_ZF_1_T2 group0.group_op_closed Int_ZF_2_L14
by autowith A1 have abs(m+n+k) ≤ abs(m+n) + abs(k)using Int_triangle_ineq by simp
moreover from A1 T haveabs(m+n) + abs(k) ≤ abs(m) + abs(n) + abs(k)using Int_triangle_ineq int_ord_transl_inv by simp
ultimately show thesis by (rule Int_order_transitive)qed

The next lemma shows what happens when one integers is not greater or
equal than another.
lemma (in int0) Int_ZF_2_L19:
assumes A1: m∈ZZ n∈ZZ and A2: ¬(n≤m)
shows m≤n (-n) ≤ (-m) m6=nproof from A1 A2 show m≤n using Int_ZF_2_T1 IsTotal_def
by autothen show (-n) ≤ (-m) using Int_ZF_2_L10
by simpfrom A1 have n ≤ n using int_ord_is_refl refl_def
by simpwith A2 show m6=n by autoqed

If one integer is greater or equal and not equal to another, then it is not
smaller or equal.
lemma (in int0) Int_ZF_2_L19AA: assumes A1: m≤n and A2: m6=nshows ¬(n≤m)
proof from A1 A2 havegroup3(ZZ, IntegerAddition, IntegerOrder)hm,ni ∈ IntegerOrderm6=nusing Int_ZF_2_T1 by auto
then have hn,mi ∈/ IntegerOrder461

by (rule group3.OrderedGroup_ZF_1_L8AA)
thus ¬(n≤m) by simp
qed

The next lemma allows to prove theorems for the case of positive and negative integers separately.
lemma (in int0) Int_ZF_2_L19A: assumes A1: m∈ZZ and A2: ¬(0≤m)
shows m≤0 0 ≤ (-m) m6=0
proof from A1 have T: 0 ∈ ZZ
using Int_ZF_1_T2 group0.group0_2_L2 by autowith A1 A2 show m≤0 using Int_ZF_2_L19 by blastfrom A1 T A2 show m6=0 by (rule Int_ZF_2_L19)
from A1 T A2 have (-0)≤(-m) by (rule Int_ZF_2_L19)
then show 0 ≤ (-m)
using Int_ZF_1_T2 group0.group_inv_of_one by simpqed

We can prove a theorem about integers by proving that it holds for m = 0,m ∈ZZ+ and −m ∈ZZ+ .
lemma (in int0) Int_ZF_2_L19B:
assumes m∈ZZ and Q(0) and ∀ n∈ZZ+ . Q(n) and ∀ n∈ZZ+ . Q(-n)
shows Q(m)proof let G = ZZ
let P = IntegerAddition
let r = IntegerOrder
let b = mfrom assms havegroup3(G, P, r)r {is total on} Gb ∈ GQ(TheNeutralElement(G, P))∀ a∈PositiveSet(G, P, r). Q(a)∀ a∈PositiveSet(G, P, r). Q(GroupInv(G, P)(a))
using Int_ZF_2_T1 by auto
then show Q(b) by (rule group3.OrderedGroup_ZF_1_L18)
qed

An integer is not greater than its absolute value.
lemma (in int0) Int_ZF_2_L19C: assumes A1: m∈ZZshowsm ≤ abs(m)(-m) ≤ abs(m)using assms Int_ZF_2_T1
group3.OrderedGroup_ZF_3_L5 group3.OrderedGroup_ZF_3_L6
by auto|m − n| = |n − m|.
462

lemma (in int0) Int_ZF_2_L20: assumes m∈ZZ n∈ZZshows abs(m-n) = abs(n-m)
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L7B by simp

We can add the sides of inequalities with absolute values.
lemma (in int0) Int_ZF_2_L21:
assumes A1: m∈ZZ n∈ZZ
and A2: abs(m) ≤ k abs(n) ≤ lshows
abs(m+n) ≤ k + labs(m-n) ≤ k + lusing assms Int_ZF_1_T2 Int_ZF_2_T1
group3.OrderedGroup_ZF_3_L7C group3.OrderedGroup_ZF_3_L7CA
by autoAbsolute value is nonnegative.
lemma (in int0) int_abs_nonneg: assumes A1: m∈ZZ
shows abs(m) ∈ ZZ+ 0 ≤ abs(m)proof have AbsoluteValue(ZZ,IntegerAddition,IntegerOrder) : ZZ→ZZ+
using Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L3C by simp
with A1 show abs(m) ∈ ZZ+ using apply_funtype
by simpthen show 0 ≤ abs(m)using Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L2 by simpqed

If an nonnegative integer is less or equal than another, then so is its absolutevalue.
lemma (in int0) Int_ZF_2_L23:
assumes 0≤mm≤kshows abs(m) ≤ kusing assms Int_ZF_2_L16 by simp

41.3

Induction on integers.

In this section we show some induction lemmas for integers. The basic tools
are the induction on natural numbers and the fact that integers can be
written as a sum of a smaller integer and a natural number.
An integer can be written a a sum of a smaller integer and a natural number.
lemma (in int0) Int_ZF_3_L2: assumes A1: i ≤ mshows ∃ n∈nat. m = i $+ $# nproof let n = 0{ assume A2: i=mfrom A1 A2 have n ∈ nat m = i $+ $# nusing Int_ZF_2_L1A zadd_int0_right by auto463

hence ∃ n∈nat. m = i $+ $# n by blast }moreover{ assume A3: i6=mwith A1 have i $< m i∈ZZ m∈ZZ
using Int_ZF_2_L9 Int_ZF_2_L1A by auto
then obtain k where D1: k∈nat m = i $+ $# succ(k)using zless_imp_succ_zadd_lemma by auto
let n = succ(k)from D1 have n∈nat m = i $+ $# n by auto
hence ∃ n∈nat. m = i $+ $# n by simp }ultimately show thesis by blast
qed

Induction for integers, the induction step.
lemma (in int0) Int_ZF_3_L6: assumes A1: i∈ZZ
and A2: ∀ m. i≤m ∧ Q(m) −→ Q(m $+ ($# 1))
shows ∀ k∈nat. Q(i $+ ($# k)) −→ Q(i $+ ($# succ(k)))
proof
fix k assume A3: k∈nat show Q(i $+ $# k) −→ Q(i $+ $# succ(k))
proofassume A4: Q(i $+ $# k)from A1 A3 have i≤ i $+ ($# k) using Int_ZF_2_L12
by simpwith A4 A2 have Q(i $+ ($# k) $+ ($# 1)) by simp
then show Q(i $+ ($# succ(k))) using Int_ZF_2_L11 by simp
qed
qed

Induction on integers, version with higher-order increment function.
lemma (in int0) Int_ZF_3_L7:
assumes A1: i≤k and A2: Q(i)and A3: ∀ m. i≤m ∧ Q(m) −→ Q(m $+ ($# 1))
shows Q(k)proof from A1 obtain n where D1: n∈nat and D2: k = i $+ $# nusing Int_ZF_3_L2 by autofrom A1 have T1: i∈ZZ using Int_ZF_2_L1A by simp
note hn∈nati
moreover from A1 A2 have Q(i $+ $#0)
using Int_ZF_2_L1A zadd_int0 by simp
moreover from T1 A3 have∀ k∈nat. Q(i $+ ($# k)) −→ Q(i $+ ($# succ(k)))
by (rule Int_ZF_3_L6)
ultimately have Q(i $+ ($# n)) by (rule ind_on_nat)with D2 show Q(k) by simp
qed

Induction on integer, implication between two forms of the induction step.
lemma (in int0) Int_ZF_3_L7A: assumes464

A1: ∀ m. i≤m ∧ Q(m) −→ Q(m+1)
shows ∀ m. i≤m ∧ Q(m) −→ Q(m $+ ($# 1))
proof { fix m assume i≤m ∧ Q(m)with A1 have T1: m∈ZZ Q(m+1) using Int_ZF_2_L1A by auto
then have m+1 = m+($# 1) using Int_ZF_1_L8 by simp
with T1 have Q(m $+ ($# 1)) using Int_ZF_1_L2
by simp} then show thesis by simp
qed

Induction on integers, version with ZF increment function.
theorem (in int0) Induction_on_int:
assumes A1: i≤k and A2: Q(i)and A3: ∀ m. i≤m ∧ Q(m) −→ Q(m+1)
shows Q(k)proof from A3 have ∀ m. i≤m ∧ Q(m) −→ Q(m $+ ($# 1))
by (rule Int_ZF_3_L7A)
with A1 A2 show thesis by (rule Int_ZF_3_L7)
qed

Another form of induction on integers. This rewrites the basic theorem
Int_ZF_3_L7 substituting P (−k) for Q(k).
lemma (in int0) Int_ZF_3_L7B: assumes A1: i≤k and A2: P($-i)
and A3: ∀ m. i≤m ∧ P($-m) −→ P($-(m $+ ($# 1)))shows P($-k)
proof from A1 A2 A3 show P($-k) by (rule Int_ZF_3_L7)
qed

Another induction on integers. This rewrites Int ZF 3 L7 substituting −k
for k and −i for i.
lemma (in int0) Int_ZF_3_L8: assumes A1: k≤i and A2: P(i)and A3: ∀ m. $-i≤m ∧ P($-m) −→ P($-(m $+ ($# 1)))shows P(k)proof from A1 have T1: $-i≤$-k using Int_ZF_2_L10 by simp
from A1 A2 have T2: P($- $- i) using Int_ZF_2_L1A zminus_zminusby simpfrom T1 T2 A3 have P($-($-k)) by (rule Int_ZF_3_L7)
with A1 show P(k) using Int_ZF_2_L1A zminus_zminus by simp
qed

An implication between two forms of induction steps.
lemma (in int0) Int_ZF_3_L9: assumes A1: i∈ZZ
and A2: ∀ n. n≤i ∧ P(n) −→ P(n $+ $-($#1))
shows ∀ m. $-i≤m ∧ P($-m) −→ P($-(m $+ ($# 1)))465

prooffix m show $-i≤m ∧ P($-m) −→ P($-(m $+ ($# 1)))
proof
assume A3: $- i ≤ m ∧ P($- m)then have $- i ≤ m by simp
then have $-m ≤ $- ($- i) by (rule Int_ZF_2_L10)
with A1 A2 A3 show P($-(m $+ ($# 1)))
using zminus_zminus zminus_zadd_distrib by simp
qed
qed

Backwards induction on integers, version with higher-order decrement function.
lemma (in int0) Int_ZF_3_L9A: assumes A1: k≤i and A2: P(i)and A3: ∀ n. n≤i ∧ P(n) −→P(n $+ $-($#1))
shows P(k)proof from A1 have T1: i∈ZZ using Int_ZF_2_L1A by simp
from T1 A3 have T2: ∀ m. $-i≤m ∧ P($-m) −→ P($-(m $+ ($# 1)))by (rule Int_ZF_3_L9)
from A1 A2 T2 show P(k) by (rule Int_ZF_3_L8)
qed

Induction on integers, implication between two forms of the induction step.
lemma (in int0) Int_ZF_3_L10: assumes
A1: ∀ n. n≤i ∧ P(n) −→ P(n-1)
shows ∀ n. n≤i ∧ P(n) −→ P(n $+ $-($#1))
proof { fix n assume n≤i ∧ P(n)with A1 have T1: n∈ZZ P(n-1) using Int_ZF_2_L1A by auto
then have n-1 = n-($# 1) using Int_ZF_1_L8 by simp
with T1 have P(n $+ $-($#1)) using Int_ZF_1_L10 by simp
} then show thesis by simp
qed

Backwards induction on integers.
theorem (in int0) Back_induct_on_int:
assumes A1: k≤i and A2: P(i)and A3: ∀ n. n≤i ∧ P(n) −→ P(n-1)
shows P(k)proof from A3 have ∀ n. n≤i ∧ P(n) −→ P(n $+ $-($#1))
by (rule Int_ZF_3_L10)
with A1 A2 show P(k) by (rule Int_ZF_3_L9A)
qed

466

41.4

Bounded vs. finite subsets of integers

The goal of this section is to establish that a subset of integers is boundedis and only is it is finite. The fact that all finite sets are bounded is alreadyshown for all linearly ordered groups in OrderedGroups_ZF.thy. To show theother implication we show that all intervals starting at 0 are finite and thenuse a result from OrderedGroups_ZF.thy.
There are no integers between k and k + 1.
lemma (in int0) Int_ZF_4_L1:
assumes A1: k∈ZZ m∈ZZ n∈nat and A2: k $+ $#1 = m $+ $#nshows m = k $+ $#1 ∨ m ≤ kproof { assume n=0with A1 A2 have m = k $+ $#1 ∨ m ≤ kusing zadd_int0 by simp }moreover{ assume n6=0
with A1 obtain j where D1: j∈nat n = succ(j)using Nat_ZF_1_L3 by autowith A1 A2 D1 have m = k $+ $#1 ∨ m ≤ kusing Int_ZF_2_L13 by simp }ultimately show thesis by blastqed

A trivial calculation lemma that allows to subtract and add one.
lemma Int_ZF_4_L1A:
assumes m∈int shows m $- $#1 $+ $#1 = musing assms eq_zdiff_iff by auto

There are no integers between k and k + 1, another formulation.
lemma (in int0) Int_ZF_4_L1B: assumes A1: m ≤ Lshows
m = L ∨ m+1 ≤ L
m = L ∨ m ≤ L-1
proof let k = L $- $#1
from A1 have T1: m∈ZZ L∈ZZ L = k $+ $#1
using Int_ZF_2_L1A Int_ZF_4_L1A by auto
moreover from A1 obtain n where D1: n∈nat L = m $+ $# nusing Int_ZF_3_L2 by auto
ultimately have m = L ∨ m ≤ kusing Int_ZF_4_L1 by simp
with T1 show m = L∨ m+1 ≤ L
using Int_ZF_2_L9A by autowith T1 show m = L ∨ m ≤ L-1
using Int_ZF_1_L8A Int_ZF_2_L9B by simp
qed

467

If j ∈ m..k + 1, then j ∈ m..n or j = k + 1.
lemma (in int0) Int_ZF_4_L2: assumes A1: k∈ZZ
and A2: j ∈ m..(k $+ $#1)
shows j ∈ m..k ∨ j ∈ {k $+ $#1}
proof from A2 have T1: m≤j j≤(k $+ $#1) using Order_ZF_2_L1A
by autothen have T2: m∈ZZ j∈ZZ using Int_ZF_2_L1A by autofrom T1 obtain n where n∈nat k $+ $#1 = j $+ $# nusing Int_ZF_3_L2 by autowith A1 T1 T2 have (m≤j ∧ j ≤ k) ∨ j ∈ {k $+ $#1}
using Int_ZF_4_L1 by auto
then show thesis using Order_ZF_2_L1B by autoqed

Extending an integer interval by one is the same as adding the new endpoint.
lemma (in int0) Int_ZF_4_L3: assumes A1: m≤ kshows m..(k $+ $#1) = m..k ∪ {k $+ $#1}
proof
from A1 have T1: m∈ZZ k∈ZZ using Int_ZF_2_L1A by auto
then show m .. (k $+ $# 1) ⊆ m .. k ∪ {k $+ $# 1}
using Int_ZF_4_L2 by autofrom T1 have m≤ m using Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L3
by simpwith T1 A1 have m .. k ⊆ m .. (k $+ $# 1)
using Int_ZF_2_L12 Int_ZF_2_L6 Order_ZF_2_L3 by simp
with T1 A1 show m..k ∪ {k $+ $#1} ⊆ m..(k $+ $#1)
using Int_ZF_2_L12A int_ord_is_refl Order_ZF_2_L2 by autoqedInteger intervals are finite - induction step.
lemma (in int0) Int_ZF_4_L4:assumes A1: i≤m and A2: i..m ∈ Fin(ZZ)shows i..(m $+ $#1) ∈ Fin(ZZ)
using assms Int_ZF_4_L3 by simp

Integer intervals are finite.
lemma (in int0) Int_ZF_4_L5: assumes A1: i∈ZZ k∈ZZshows i..k ∈ Fin(ZZ)
proof { assume A2: i≤kmoreover from A1 have i..i ∈ Fin(ZZ)
using int_ord_is_refl Int_ZF_2_L4 Order_ZF_2_L4 by simp
moreover from A2 have
∀ m. i≤m ∧ i..m ∈ Fin(ZZ) −→ i..(m $+ $#1) ∈ Fin(ZZ)
using Int_ZF_4_L4 by simp
ultimately have i..k ∈ Fin(ZZ) by (rule Int_ZF_3_L7) }moreover468

{ assume ¬ i ≤ kthen have i..k ∈ Fin(ZZ) using Int_ZF_2_L6 Order_ZF_2_L5
by simp }
ultimately show thesis by blast
qed

Bounded integer sets are finite.
lemma (in int0) Int_ZF_4_L6: assumes A1: IsBounded(A,IntegerOrder)shows A ∈ Fin(ZZ)
proof have T1: ∀ m ∈ Nonnegative(ZZ,IntegerAddition,IntegerOrder).
$#0..m ∈ Fin(ZZ)
proof
fix m assume m ∈ Nonnegative(ZZ,IntegerAddition,IntegerOrder)
then have m∈ZZ using Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L4E
by autothen show $#0..m ∈ Fin(ZZ) using Int_ZF_4_L5 by simp
qed
have group3(ZZ,IntegerAddition,IntegerOrder)using Int_ZF_2_T1 by simp
moreover from T1 have ∀ m ∈ Nonnegative(ZZ,IntegerAddition,IntegerOrder).
Interval(IntegerOrder,TheNeutralElement(ZZ,IntegerAddition),m)∈ Fin(ZZ) using Int_ZF_1_L8 by simp
moreover note A1
ultimately show A ∈ Fin(ZZ) by (rule group3.OrderedGroup_ZF_2_T1)
qed

A subset of integers is bounded iff it is finite.
theorem (in int0) Int_bounded_iff_fin:
shows IsBounded(A,IntegerOrder)←→ A∈Fin(ZZ)
using Int_ZF_4_L6 Int_ZF_2_T1 group3.ord_group_fin_boundedby blast

The image of an interval by any integer function is finite, hence bounded.
lemma (in int0) Int_ZF_4_L8:
assumes A1: i∈ZZ k∈ZZ and A2: f:ZZ→ZZ
showsf(i..k) ∈ Fin(ZZ)
IsBounded(f(i..k),IntegerOrder)using assms Int_ZF_4_L5 Finite1_L6A Int_bounded_iff_fin
by autoIf for every integer we can find one in A that is greater or equal, then A isis not bounded above, hence infinite.
lemma (in int0) Int_ZF_4_L9: assumes A1: ∀ m∈ZZ. ∃ k∈A. m≤kshows¬IsBoundedAbove(A,IntegerOrder)A ∈/ Fin(ZZ)469

proof have ZZ 6= {0}using Int_ZF_1_L8A int_zero_not_one by blast
with A1 show
¬IsBoundedAbove(A,IntegerOrder)A ∈/ Fin(ZZ)
using Int_ZF_2_T1 group3.OrderedGroup_ZF_2_L2A
by auto
qed

end

42

Integers 1

theory Int_ZF_1 imports Int_ZF_IML OrderedRing_ZF
begin

This theory file considers the set of integers as an ordered ring.

42.1

Integers as a ring

In this section we show that integers form a commutative ring.
The next lemma provides the condition to show that addition is distributive
with respect to multiplication.
lemma (in int0) Int_ZF_1_1_L1: assumes A1: a∈ZZ b∈ZZ c∈ZZ
showsa·(b+c) = a·b + a·c(b+c)·a = b·a + c·a
using assms Int_ZF_1_L2 zadd_zmult_distrib zadd_zmult_distrib2
by autoIntegers form a commutative ring, hence we can use theorems proven in
ring0 context (locale).
lemma (in int0) Int_ZF_1_1_L2: shows
IsAring(ZZ,IntegerAddition,IntegerMultiplication)
IntegerMultiplication {is commutative on} ZZ
ring0(ZZ,IntegerAddition,IntegerMultiplication)
proof have ∀ a∈ZZ.∀ b∈ZZ.∀ c∈ZZ.
a·(b+c) = a·b + a·c ∧ (b+c)·a = b·a + c·a
using Int_ZF_1_1_L1 by simp
then have IsDistributive(ZZ,IntegerAddition,IntegerMultiplication)using IsDistributive_def by simp
then show IsAring(ZZ,IntegerAddition,IntegerMultiplication)
ring0(ZZ,IntegerAddition,IntegerMultiplication)

470

using Int_ZF_1_T1 Int_ZF_1_T2 IsAring_def ring0_def
by autohave ∀ a∈ZZ.∀ b∈ZZ. a·b = b·a using Int_ZF_1_L4 by simp
then show IntegerMultiplication {is commutative on} ZZ
using IsCommutative_def by simp
qed

Zero and one are integers.
lemma (in int0) int_zero_one_are_int: shows 0∈ZZ
using Int_ZF_1_1_L2 ring0.Ring_ZF_1_L2 by auto

1∈ZZ

Negative of zero is zero.
lemma (in int0) int_zero_one_are_intA: shows (-0) = 0
using Int_ZF_1_T2 group0.group_inv_of_one by simp

Properties with one integer.
lemma (in int0) Int_ZF_1_1_L4: assumes A1: a ∈ ZZ
shows
a+0 = a0+a = aa·1 = a1·a = a0·a = 0a·0 = 0(-a) ∈ ZZ (-(-a)) = a
a-a = 0a-0 = a 2·a = a+a
proof from A1 show
a+0 = a0+a = aa·1 = a1·a = aa-a = 0a-0 = a(-a) ∈ ZZ 2·a = a+a(-(-a)) = a
using Int_ZF_1_1_L2 ring0.Ring_ZF_1_L3 by autofrom A1 show 0·a = 0
a·0 = 0using Int_ZF_1_1_L2 ring0.Ring_ZF_1_L6 by autoqed

Properties that require two integers.
lemma (in int0) Int_ZF_1_1_L5: assumes a∈ZZ
shows
a+b ∈ ZZ
a-b ∈ ZZ
a·b ∈ ZZ
a+b = b+aa·b = b·a(-b)-a = (-a)-b(-(a+b)) = (-a)-b(-(a-b)) = ((-a)+b)(-a)·b = -(a·b)
a·(-b) = -(a·b)(-a)·(-b) = a·b

471

b∈ZZ

using assms Int_ZF_1_1_L2 ring0.Ring_ZF_1_L4 ring0.Ring_ZF_1_L9
ring0.Ring_ZF_1_L7 ring0.Ring_ZF_1_L7A Int_ZF_1_L4 by auto

2 and 3 are integers.
lemma (in int0) int_two_three_are_int: shows 2 ∈ ZZ
using int_zero_one_are_int Int_ZF_1_1_L5 by auto

3 ∈ ZZ

Another property with two integers.
lemma (in int0) Int_ZF_1_1_L5B:
assumes a∈ZZ b∈ZZ
shows a-(-b) = a+b
using assms Int_ZF_1_1_L2 ring0.Ring_ZF_1_L9
by simp

Properties that require three integers.
lemma (in int0) Int_ZF_1_1_L6: assumes a∈ZZ b∈ZZ c∈ZZ
shows
a-(b+c) = a-b-c
a-(b-c) = a-b+c
a·(b-c) = a·b - a·c(b-c)·a = b·a - c·ausing assms Int_ZF_1_1_L2 ring0.Ring_ZF_1_L10 ring0.Ring_ZF_1_L8
by autoOne more property with three integers.
lemma (in int0) Int_ZF_1_1_L6A: assumes a∈ZZ b∈ZZ c∈ZZshows a+(b-c) = a+b-c
using assms Int_ZF_1_1_L2 ring0.Ring_ZF_1_L10A by simp

Associativity of addition and multiplication.
lemma (in int0) Int_ZF_1_1_L7: assumes a∈ZZ b∈ZZ c∈ZZ
shows
a+b+c = a+(b+c)
a·b·c = a·(b·c)
using assms Int_ZF_1_1_L2 ring0.Ring_ZF_1_L11 by auto

42.2

Rearrangement lemmas

In this section we collect lemmas about identities related to rearranging theterms in expresssions
A formula with a positive integer.
lemma (in int0) Int_ZF_1_2_L1: assumes 0≤ashows abs(a)+1 = abs(a+1)
using assms Int_ZF_2_L16 Int_ZF_2_L12A by simp

A formula with two integers, one positive.
472

lemma (in int0) Int_ZF_1_2_L2: assumes A1: a∈ZZ and A2: 0≤bshows a+(abs(b)+1)·a = (abs(b+1)+1)·a
proof from A2 have abs(b+1) ∈ ZZ
using Int_ZF_2_L12A Int_ZF_2_L1A Int_ZF_2_L14 by blast
with A1 A2 show thesis
using Int_ZF_1_2_L1 Int_ZF_1_1_L2 ring0.Ring_ZF_2_L1
by simpqed

A couple of formulae about canceling opposite integers.
lemma (in int0) Int_ZF_1_2_L3: assumes A1: a∈ZZ b∈ZZ
showsa+b-a = ba+(b-a) = b
a+b-b = aa-b+b = a(-a)+(a+b) = b
a+(b-a) = b(-b)+(a+b) = a
a-(b+a) = -ba-(a+b) = -ba-(a-b) = b
a-b-a = -b
a-b - (a+b) = (-b)-b
using assms Int_ZF_1_T2 group0.group0_4_L6A group0.inv_cancel_twogroup0.group0_2_L16A group0.group0_4_L6AA group0.group0_4_L6AB
group0.group0_4_L6F group0.group0_4_L6AC by auto

Subtracting one does not increase integers. This may be moved to a theory
about ordered rings one day.
lemma (in int0) Int_ZF_1_2_L3A: assumes A1: a≤bshows a-1 ≤ b
proof from A1 have b+1-1 = b
using Int_ZF_2_L1A int_zero_one_are_int Int_ZF_1_2_L3 by simp
moreover from A1 have a-1 ≤ b+1-1
using Int_ZF_2_L12A int_zero_one_are_int Int_ZF_1_1_L4 int_ord_transl_inv
by simpultimately show a-1 ≤ b by simp
qed

Subtracting one does not increase integers, special case.
lemma (in int0) Int_ZF_1_2_L3AA:
assumes A1: a∈ZZ showsa-1 ≤aa-1 6= a¬(a≤a-1)¬(a+1 ≤a)473¬(1+a ≤a)proof from A1 have a≤a using int_ord_is_refl refl_def
by simpthen show a-1 ≤a using Int_ZF_1_2_L3A
by simpmoreover from A1 show a-1 6= a using Int_ZF_1_L14 by simp
ultimately show I: ¬(a≤a-1) using Int_ZF_2_L19AA
by blastwith A1 show ¬(a+1 ≤a)using int_zero_one_are_int Int_ZF_2_L9B by simp
with A1 show ¬(1+a ≤a)using int_zero_one_are_int Int_ZF_1_1_L5 by simp
qed

A formula with a nonpositive integer.
lemma (in int0) Int_ZF_1_2_L4: assumes a≤0shows abs(a)+1 = abs(a-1)
using assms int_zero_one_are_int Int_ZF_1_2_L3A Int_ZF_2_T1
group3.OrderedGroup_ZF_3_L3A Int_ZF_2_L1A
int_zero_one_are_int Int_ZF_1_1_L5 by simp

A formula with two integers, one negative.
lemma (in int0) Int_ZF_1_2_L5: assumes A1: a∈ZZ and A2: b≤0
shows a+(abs(b)+1)·a = (abs(b-1)+1)·a
proof from A2 have abs(b-1) ∈ ZZ
using int_zero_one_are_int Int_ZF_1_2_L3A Int_ZF_2_L1A Int_ZF_2_L14
by blastwith A1 A2 show thesis
using Int_ZF_1_2_L4 Int_ZF_1_1_L2 ring0.Ring_ZF_2_L1
by simpqed

A rearrangement with four integers.
lemma (in int0) Int_ZF_1_2_L6:
assumes A1: a∈ZZ b∈ZZ c∈ZZ d∈ZZ
shows
a-(b-1)·c = (d-b·c)-(d-a-c)
proof from A1 have T1:(d-b·c) ∈ ZZ d-a ∈ ZZ (-(b·c)) ∈ ZZ
using Int_ZF_1_1_L5 Int_ZF_1_1_L4 by autowith A1 have(d-b·c)-(d-a-c) = (-(b·c))+a+c
using Int_ZF_1_1_L6 Int_ZF_1_2_L3 by simp
also from A1 T1 have (-(b·c))+a+c = a-(b-1)·c
using int_zero_one_are_int Int_ZF_1_1_L6 Int_ZF_1_1_L4 Int_ZF_1_1_L5474

by simp
finally show thesis by simp
qedSome other rearrangements with two integers.
lemma (in int0) Int_ZF_1_2_L7: assumes a∈ZZ b∈ZZ
showsa·b = (a-1)·b+ba·(b+1) = a·b+a(b+1)·a = b·a+a(b+1)·a = a+b·ausing assms Int_ZF_1_1_L1 Int_ZF_1_1_L5 int_zero_one_are_int
Int_ZF_1_1_L6 Int_ZF_1_1_L4 Int_ZF_1_T2 group0.inv_cancel_two
by auto

Another rearrangement with two integers.
lemma (in int0) Int_ZF_1_2_L8:
assumes A1: a∈ZZ b∈ZZ
shows a+1+(b+1) = b+a+2
using assms int_zero_one_are_int Int_ZF_1_T2 group0.group0_4_L8
by simpA couple of rearrangement with three integers.
lemma (in int0) Int_ZF_1_2_L9:
assumes a∈ZZ b∈ZZ c∈ZZ
shows(a-b)+(b-c) = a-c(a-b)-(a-c) = c-ba+(b+(c-a-b)) = c(-a)-b+c = c-a-b(-b)-a+c = c-a-b(-((-a)+b+c)) = a-b-c
a+b+c-a = b+ca+b-(a+c) = b-c
using assms Int_ZF_1_T2
group0.group0_4_L4B group0.group0_4_L6D group0.group0_4_L4D
group0.group0_4_L6B group0.group0_4_L6E
by auto

Another couple of rearrangements with three integers.
lemma (in int0) Int_ZF_1_2_L9A:
assumes A1: a∈ZZ b∈ZZ c∈ZZshows (-(a-b-c)) = c+b-a
proof from A1 have T:
a-b ∈ ZZ (-(a-b)) ∈ ZZ (-b) ∈ ZZ using
Int_ZF_1_1_L4 Int_ZF_1_1_L5 by autowith A1 have (-(a-b-c)) = c - ((-b)+a)

475

using Int_ZF_1_1_L5 by simp
also from A1 T have . . . = c+b-a
using Int_ZF_1_1_L6 Int_ZF_1_1_L5B
by simp
finally show (-(a-b-c)) = c+b-a
by simpqed

Another rearrangement with three integers.
lemma (in int0) Int_ZF_1_2_L10:
assumes A1: a∈ZZ b∈ZZ c∈ZZshows (a+1)·b + (c+1)·b = (c+a+2)·b
proof from A1 have a+1 ∈ ZZ c+1 ∈ ZZ
using int_zero_one_are_int Int_ZF_1_1_L5 by autowith A1 have(a+1)·b + (c+1)·b = (a+1+(c+1))·b
using Int_ZF_1_1_L1 by simp
also from A1 have . . . = (c+a+2)·b
using Int_ZF_1_2_L8 by simp
finally show thesis by simpqed

A technical rearrangement involing inequalities with absolute value.
lemma (in int0) Int_ZF_1_2_L10A:
assumes A1: a∈ZZ b∈ZZ c∈ZZ e∈ZZ
and A2: abs(a·b-c) ≤ d abs(b·a-e) ≤ fshows abs(c-e) ≤ f+d
proof from A1 A2 have T1:
d∈ZZ f∈ZZ a·b ∈ ZZ a·b-c ∈ ZZ b·a-e ∈ ZZ
using Int_ZF_2_L1A Int_ZF_1_1_L5 by autowith A2 haveabs((b·a-e)-(a·b-c)) ≤ f +dusing Int_ZF_2_L21 by simp
with A1 T1 show abs(c-e) ≤ f+dusing Int_ZF_1_1_L5 Int_ZF_1_2_L9 by simp
qedSome arithmetics.
lemma (in int0) Int_ZF_1_2_L11: assumes A1: a∈ZZ
shows
a+1+2 = a+3
a = 2·a - a
proof from A1 show a+1+2 = a+3
using int_zero_one_are_int int_two_three_are_int Int_ZF_1_T2 group0.group0_4_L4C
by simpfrom A1 show a = 2·a - a

476

using int_zero_one_are_int Int_ZF_1_1_L1 Int_ZF_1_1_L4 Int_ZF_1_T2
group0.inv_cancel_two
by simpqed

A simple rearrangement with three integers.
lemma (in int0) Int_ZF_1_2_L12:
assumes a∈ZZ b∈ZZ c∈ZZshows(b-c)·a = a·b - a·cusing assms Int_ZF_1_1_L6 Int_ZF_1_1_L5 by simp

A big rearrangement with five integers.
lemma (in int0) Int_ZF_1_2_L13:
assumes A1: a∈ZZ b∈ZZ c∈ZZ d∈ZZ x∈ZZ
shows (x+(a·x+b)+c)·d = d·(a+1)·x + (b·d+c·d)
proof from A1 have T1:
a·x ∈ ZZ
(a+1)·x ∈ ZZ
(a+1)·x + b ∈ ZZ
using Int_ZF_1_1_L5 int_zero_one_are_int by autowith A1 have (x+(a·x+b)+c)·d = ((a+1)·x + b)·d + c·dusing Int_ZF_1_1_L7 Int_ZF_1_2_L7 Int_ZF_1_1_L1
by simp
also from A1 T1 have . . . = (a+1)·x·d + b · d + c·dusing Int_ZF_1_1_L1 by simp
finally have (x+(a·x+b)+c)·d = (a+1)·x·d + b·d + c·d
by simpmoreover from A1 T1 have (a+1)·x·d = d·(a+1)·x
using int_zero_one_are_int Int_ZF_1_1_L5 Int_ZF_1_1_L7 by simp
ultimately have (x+(a·x+b)+c)·d = d·(a+1)·x + b·d + c·d
by simpmoreover from A1 T1 haved·(a+1)·x ∈ ZZ b·d ∈ ZZ c·d ∈ ZZ
using int_zero_one_are_int Int_ZF_1_1_L5 by auto
ultimately show thesis using Int_ZF_1_1_L7 by simp
qed

Rerrangement about adding linear functions.
lemma (in int0) Int_ZF_1_2_L14:
assumes a∈ZZ b∈ZZ c∈ZZ d∈ZZ x∈ZZ
shows (a·x + b) + (c·x + d) = (a+c)·x + (b+d)
using assms Int_ZF_1_1_L2 ring0.Ring_ZF_2_L3 by simp

A rearrangement with four integers. Again we have to use the generic set
notation to use a theorem proven in different context.
lemma (in int0) Int_ZF_1_2_L15: assumes A1: a∈ZZ
and A2: a = b-c-d

477

b∈ZZ

c∈ZZ d∈ZZshowsd = b-a-cd = (-a)+b-c
b = a+d+c
proof let G = int
let f = IntegerAddition
from A1 A2 have I:
group0(G, f)
f {is commutative on} Ga ∈ G b ∈ G c ∈ G d ∈ G
a = fhfhb,GroupInv(G, f)(c)i,GroupInv(G, f)(d)iusing Int_ZF_1_T2 by auto
then haved = fhfhb,GroupInv(G, f)(a)i,GroupInv(G,f)(c)iby (rule group0.group0_4_L9)
then show d = b-a-c by simp
from I have d = fhfhGroupInv(G, f)(a),bi, GroupInv(G, f)(c)iby (rule group0.group0_4_L9)
thus d = (-a)+b-c
by simpfrom I have b = fhfha, di,ciby (rule group0.group0_4_L9)
thus b = a+d+c by simpqed

A rearrangement with four integers. Property of groups.
lemma (in int0) Int_ZF_1_2_L16:
assumes a∈ZZ b∈ZZ c∈ZZ d∈ZZshows a+(b-c)+d = a+b+d-c
using assms Int_ZF_1_T2 group0.group0_4_L8 by simp

Some rearrangements with three integers. Properties of groups.
lemma (in int0) Int_ZF_1_2_L17:
assumes A1: a∈ZZ b∈ZZ c∈ZZ
shows
a+b-c+(c-b) = aa+(b+c)-c = a+b
proof let G = int
let f = IntegerAddition
from A1 have I:
group0(G, f)a ∈ G b ∈ G c ∈ Gusing Int_ZF_1_T2 by auto
then havefhfhfha,bi,GroupInv(G, f)(c)i,fhc,GroupInv(G, f)(b)ii = aby (rule group0.group0_2_L14A)
thus a+b-c+(c-b) = a by simp
from I have478

fhfha,fhb,cii,GroupInv(G, f)(c)i = fha,biby (rule group0.group0_2_L14A)
thus a+(b+c)-c = a+b by simp
qed

Another rearrangement with three integers. Property of abelian groups.
lemma (in int0) Int_ZF_1_2_L18:
assumes A1: a∈ZZ b∈ZZ c∈ZZshows a+b-c+(c-a) = b
proof let G = int
let f = IntegerAddition
from A1 havegroup0(G, f)
f {is commutative on} Ga ∈ G b ∈ G c ∈ Gusing Int_ZF_1_T2 by auto
then havefhfhfha,bi,GroupInv(G, f)(c)i,fhc,GroupInv(G, f)(a)ii = b
by (rule group0.group0_4_L6D)
thus a+b-c+(c-a) = b by simp
qed

42.3

Integers as an ordered ring

We already know from Int_ZF that integers with addition form a linearlyordered group. To show that integers form an ordered ring we need the factthat the set of nonnegative integers is closed under multiplication.
We start with the property that a product of nonnegative integers is nonnegative. The proof is by induction and the next lemma is the induction
step.
lemma (in int0) Int_ZF_1_3_L1: assumes A1: 0≤a 0≤b
and A3: 0 ≤ a·b
shows 0 ≤ a·(b+1)
proof from A1 A3 have 0+0 ≤ a·b+ausing int_ineq_add_sides by simp
with A1 show 0 ≤ a·(b+1)
using int_zero_one_are_int Int_ZF_1_1_L4 Int_ZF_2_L1A Int_ZF_1_2_L7
by simpqed

Product of nonnegative integers is nonnegative.
lemma (in int0) Int_ZF_1_3_L2: assumes A1: 0≤ashows 0≤a·b
proof from A1 have 0≤b by simp

479

0≤b

moreover from A1 have 0 ≤ a·0 using
Int_ZF_2_L1A Int_ZF_1_1_L4 int_zero_one_are_int int_ord_is_refl refl_def
by simpmoreover from A1 have
∀ m. 0≤m ∧ 0≤a·m −→ 0 ≤ a·(m+1)
using Int_ZF_1_3_L1 by simp
ultimately show 0≤a·b by (rule Induction_on_int)qed

The set of nonnegative integers is closed under multiplication.
lemma (in int0) Int_ZF_1_3_L2A: shows
ZZ+ {is closed under} IntegerMultiplication
proof { fix a b assume a∈ZZ+ b∈ZZ+
then have a·b ∈ZZ+
using Int_ZF_1_3_L2 Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L2
by simp} then have ∀ a∈ZZ+ .∀ b∈ZZ+ .a·b ∈ZZ+ by simp
then show thesis using IsOpClosed_def by simp
qedIntegers form an ordered ring. All theorems proven in the ring1 context are
valid in int0 context.
theorem (in int0) Int_ZF_1_3_T1: shows
IsAnOrdRing(ZZ,IntegerAddition,IntegerMultiplication,IntegerOrder)
ring1(ZZ,IntegerAddition,IntegerMultiplication,IntegerOrder)using Int_ZF_1_1_L2 Int_ZF_2_L1B Int_ZF_1_3_L2A Int_ZF_2_T1
OrdRing_ZF_1_L6 OrdRing_ZF_1_L2 by auto

Product of integers that are greater that one is greater than one. The proof
is by induction and the next step is the induction step.
lemma (in int0) Int_ZF_1_3_L3_indstep:
assumes A1: 1≤a 1≤b
and A2: 1 ≤ a·b
shows 1 ≤ a·(b+1)
proof from A1 A2 have 1≤2 and 2 ≤ a·(b+1)
using Int_ZF_2_L1A int_ineq_add_sides Int_ZF_2_L16B Int_ZF_1_2_L7
by autothen show 1 ≤ a·(b+1) by (rule Int_order_transitive)
qed

Product of integers that are greater that one is greater than one.
lemma (in int0) Int_ZF_1_3_L3:
assumes A1: 1≤a 1≤bshows 1 ≤ a·b
proof -

480

from A1 have 1≤b 1≤a·1
using Int_ZF_2_L1A Int_ZF_1_1_L4 by auto
moreover from A1 have
∀ m. 1≤m ∧ 1 ≤ a·m −→ 1 ≤ a·(m+1)
using Int_ZF_1_3_L3_indstep by simp
ultimately show 1 ≤ a·b by (rule Induction_on_int)
qed|a · (−b)| = |(−a) · b| = |(−a) · (−b)| = |a · b| This is a property of orderedrings..
lemma (in int0) Int_ZF_1_3_L4: assumes a∈ZZ b∈ZZ
showsabs((-a)·b) = abs(a·b)
abs(a·(-b)) = abs(a·b)
abs((-a)·(-b)) = abs(a·b)
using assms Int_ZF_1_1_L5 Int_ZF_2_L17 by auto

Absolute value of a product is the product of absolute values. Property ofordered rings.
lemma (in int0) Int_ZF_1_3_L5:
assumes A1: a∈ZZ b∈ZZ
shows abs(a·b) = abs(a)·abs(b)using assms Int_ZF_1_3_T1 ring1.OrdRing_ZF_2_L5 by simp

Double nonnegative is nonnegative. Property of ordered rings.
lemma (in int0) Int_ZF_1_3_L5A: assumes 0≤ashows 0≤2·ausing assms Int_ZF_1_3_T1 ring1.OrdRing_ZF_1_L5A by simp

The next lemma shows what happens when one integer is not greater or
equal than another.
lemma (in int0) Int_ZF_1_3_L6:
assumes A1: a∈ZZ b∈ZZ
shows ¬(b≤a) ←→ a+1 ≤ b
proofassume A3: ¬(b≤a)
with A1 have a≤b by (rule Int_ZF_2_L19)
then have a = b∨ a+1 ≤ busing Int_ZF_4_L1B by simp
moreover from A1 A3 have a6=b by (rule Int_ZF_2_L19)
ultimately show a+1 ≤ b by simp
next assume A4: a+1 ≤ b{ assume b≤awith A4 have a+1 ≤ a by (rule Int_order_transitive)
moreover from A1 have a ≤ a+1
using Int_ZF_2_L12B by simp
ultimately have a+1 = aby (rule Int_ZF_2_L3)

481

with A1 have False using Int_ZF_1_L14 by simp
} then show ¬(b≤a) by autoqed

Another form of stating that there are no integers between integers m andm + 1.
corollary (in int0) no_int_between: assumes A1: a∈ZZ
shows b≤a ∨ a+1 ≤ busing A1 Int_ZF_1_3_L6 by autob∈ZZ

Another way of saying what it means that one integer is not greater or equal
than another.
corollary (in int0) Int_ZF_1_3_L6A:
assumes A1: a∈ZZ b∈ZZ and A2: ¬(b≤a)
shows a ≤ b-1
proof from A1 A2 have a+1 - 1 ≤ b - 1
using Int_ZF_1_3_L6 int_zero_one_are_int Int_ZF_1_1_L4
int_ord_transl_inv by simp
with A1 show a ≤ b-1
using int_zero_one_are_int Int_ZF_1_2_L3
by simpqed

Yet another form of stating that there are nointegers between m and m + 1.
lemma (in int0) no_int_between1:
assumes A1: a≤b and A2: a6=bshows
a+1 ≤ ba ≤ b-1
proof from A1 have T: a∈ZZ b∈ZZ using Int_ZF_2_L1A
by auto{ assume b≤awith A1 have a=b by (rule Int_ZF_2_L3)
with A2 have False by simp }then have ¬(b≤a) by autowith T showa+1 ≤ ba ≤ b-1
using no_int_between Int_ZF_1_3_L6A by autoqed

We can decompose proofs into three cases: a = b, a ≤ b − 1b or a ≥ b + 1b.
lemma (in int0) Int_ZF_1_3_L6B: assumes A1: a∈ZZ b∈ZZ
shows a=b ∨ (a ≤ b-1) ∨ (b+1 ≤a)proof from A1 have a=b ∨ (a≤b ∧ a6=b) ∨ (b≤a ∧ b6=a)482

using Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L31
by simpthen show thesis using no_int_between1by autoqed

A special case of Int_ZF_1_3_L6B when b = 0. This allows to split the proofs
in cases a ≤ −1, a = 0 and a ≥ 1.
corollary (in int0) Int_ZF_1_3_L6C: assumes A1: a∈ZZ
shows a=0 ∨ (a ≤ -1) ∨ (1≤a)
proof from A1 have a=0 ∨ (a ≤ 0 -1) ∨ (0 +1 ≤a)using int_zero_one_are_int Int_ZF_1_3_L6B by simp
then show thesis using Int_ZF_1_1_L4 int_zero_one_are_int
by simpqed

An integer is not less or equal zero iff it is greater or equal one.
lemma (in int0) Int_ZF_1_3_L7: assumes a∈ZZ
shows ¬(a≤0) ←→ 1 ≤ ausing assms int_zero_one_are_int Int_ZF_1_3_L6 Int_ZF_1_1_L4
by simp

Product of positive integers is positive.
lemma (in int0) Int_ZF_1_3_L8:
assumes a∈ZZ b∈ZZ
and ¬(a≤0) ¬(b≤0)
shows ¬((a·b) ≤ 0)
using assms Int_ZF_1_3_L7 Int_ZF_1_3_L3 Int_ZF_1_1_L5 Int_ZF_1_3_L7
by simp

If a · b is nonnegative and b is positive, then a is nonnegative. Proof bycontradiction.
lemma (in int0) Int_ZF_1_3_L9:
assumes A1: a∈ZZ b∈ZZ
and A2: ¬(b≤0) and A3: a·b ≤ 0shows a≤0
proof { assume ¬(a≤0)
with A1 A2 have ¬((a·b) ≤ 0) using Int_ZF_1_3_L8
by simp} with A3 show a≤0 by autoqed

One integer is less or equal another iff the difference is nonpositive.
lemma (in int0) Int_ZF_1_3_L10:
assumes a∈ZZ b∈ZZ
shows a≤b ←→ a-b ≤ 0

483

using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L9
by simp

Some conclusions from the fact that one integer is less or equal than another.
lemma (in int0) Int_ZF_1_3_L10A: assumes a≤bshows 0 ≤ b-a
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L12A
by simp

We can simplify out a positive element on both sides of an inequality.
lemma (in int0) Int_ineq_simpl_positive:
assumes A1: a∈ZZ b∈ZZ c∈ZZ
and A2: a·c ≤ b·c and A4: ¬(c≤0)
shows a ≤ b
proof from A1 A4 have a-b ∈ ZZ c∈ZZ ¬(c≤0)
using Int_ZF_1_1_L5 by auto
moreover from A1 A2 have (a-b)·c ≤ 0
using Int_ZF_1_1_L5 Int_ZF_1_3_L10 Int_ZF_1_1_L6
by simpultimately have a-b ≤ 0 by (rule Int_ZF_1_3_L9)
with A1 show a ≤ b using Int_ZF_1_3_L10 by simpqed

A technical lemma about conclusion from an inequality between absolutevalues. This is a property of ordered rings.
lemma (in int0) Int_ZF_1_3_L11:
assumes A1: a∈ZZ b∈ZZ
and A2: ¬(abs(a) ≤ abs(b))
shows ¬(abs(a) ≤ 0)
proof { assume abs(a) ≤ 0
moreover from A1 have 0 ≤ abs(a) using int_abs_nonneg
by simpultimately have abs(a) = 0 by (rule Int_ZF_2_L3)
with A1 A2 have False using int_abs_nonneg by simp
} then show ¬(abs(a) ≤ 0) by auto
qed

Negative times positive is negative. This a property of ordered rings.
lemma (in int0) Int_ZF_1_3_L12:
assumes a≤0 and 0≤bshows a·b ≤ 0
using assms Int_ZF_1_3_T1 ring1.OrdRing_ZF_1_L8
by simp

We can multiply an inequality by a nonnegative number. This is a propertyof ordered rings.
484

lemma (in int0) Int_ZF_1_3_L13:
assumes A1: a≤b and A2: 0≤c
showsa·c ≤ b·c
c·a ≤ c·busing assms Int_ZF_1_3_T1 ring1.OrdRing_ZF_1_L9 by auto

A technical lemma about decreasing a factor in an inequality.
lemma (in int0) Int_ZF_1_3_L13A:
assumes 1≤a and b≤c and (a+1)·c ≤ dshows (a+1)·b ≤ dproof from assms have(a+1)·b ≤ (a+1)·c(a+1)·c ≤ dusing Int_ZF_2_L16C Int_ZF_1_3_L13 by auto
then show (a+1)·b ≤ d by (rule Int_order_transitive)qed

We can multiply an inequality by a positive number. This is a property ofordered rings.
lemma (in int0) Int_ZF_1_3_L13B:
assumes A1: a≤b and A2: c∈ZZ+showsa·c ≤ b·c
c·a ≤ c·b
proof let R = ZZ
let A = IntegerAddition
let M = IntegerMultiplication
let r = IntegerOrderfrom A1 A2 havering1(R, A, M, r)ha,bi ∈ rc ∈ PositiveSet(R, A, r)using Int_ZF_1_3_T1 by auto
then show
a·c ≤ b·c
c·a ≤ c·busing ring1.OrdRing_ZF_1_L9A by autoqed

A rearrangement with four integers and absolute value.
lemma (in int0) Int_ZF_1_3_L14:
assumes A1: a∈ZZ b∈ZZ c∈ZZ d∈ZZshows abs(a·b)+(abs(a)+c)·d = (d+abs(b))·abs(a)+c·d
proof from A1 have T1:
abs(a) ∈ ZZ abs(b) ∈ ZZ

485

abs(a)·abs(b) ∈ ZZ
abs(a)·d ∈ ZZ
c·d ∈ ZZ
abs(b)+d ∈ ZZ
using Int_ZF_2_L14 Int_ZF_1_1_L5 by autowith A1 have abs(a·b)+(abs(a)+c)·d = abs(a)·(abs(b)+d)+c·d
using Int_ZF_1_3_L5 Int_ZF_1_1_L1 Int_ZF_1_1_L7 by simp
with A1 T1 show thesis using Int_ZF_1_1_L5 by simpqed

A technical lemma about what happens when one absolute value is not
greater or equal than another.
lemma (in int0) Int_ZF_1_3_L15: assumes A1: m∈ZZ n∈ZZ
and A2: ¬(abs(m) ≤ abs(n))
shows n ≤ abs(m) m6=0
proof from A1 have T1: n ≤ abs(n)using Int_ZF_2_L19C by simp
from A1 have abs(n) ∈ ZZ abs(m) ∈ ZZ
using Int_ZF_2_L14 by auto
moreover note A2
ultimately have abs(n) ≤ abs(m)by (rule Int_ZF_2_L19)
with T1 show n ≤ abs(m) by (rule Int_order_transitive)
from A1 A2 show m6=0 using Int_ZF_2_L18 int_abs_nonneg by auto
qed

Negative of a nonnegative is nonpositive.
lemma (in int0) Int_ZF_1_3_L16: assumes A1: 0 ≤ mshows (-m) ≤ 0
proof from A1 have (-m) ≤ (-0)
using Int_ZF_2_L10 by simp
then show (-m) ≤ 0 using Int_ZF_1_L11
by simpqed

Some statements about intervals centered at 0.
lemma (in int0) Int_ZF_1_3_L17: assumes A1: m∈ZZ
shows(-abs(m)) ≤ abs(m)(-abs(m))..abs(m) 6= 0
proof from A1 have (-abs(m)) ≤ 0 0 ≤ abs(m)using int_abs_nonneg Int_ZF_1_3_L16 by auto
then show (-abs(m)) ≤ abs(m) by (rule Int_order_transitive)then have abs(m) ∈ (-abs(m))..abs(m)using int_ord_is_refl Int_ZF_2_L1A Order_ZF_2_L2 by simp
thus (-abs(m))..abs(m) 6= 0 by auto

486

qed

The greater of two integers is indeed greater than both, and the smaller one
is smaller that both.
lemma (in int0) Int_ZF_1_3_L18: assumes A1: m∈ZZ
showsm ≤ GreaterOf(IntegerOrder,m,n)n ≤ GreaterOf(IntegerOrder,m,n)SmallerOf(IntegerOrder,m,n) ≤ m
SmallerOf(IntegerOrder,m,n) ≤ nusing assms Int_ZF_2_T1 Order_ZF_3_L2 by auton∈ZZ

If |m| ≤ n, then m ∈ −n..n.
lemma (in int0) Int_ZF_1_3_L19:
assumes A1: m∈ZZ and A2: abs(m) ≤ n
shows(-n) ≤ m m ≤ n
m ∈ (-n)..n0 ≤ nusing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L8
group3.OrderedGroup_ZF_3_L8A Order_ZF_2_L1
by auto

A slight generalization of the above lemma.
lemma (in int0) Int_ZF_1_3_L19A:
assumes A1: m∈ZZ and A2: abs(m) ≤ n and A3: 0≤kshows (-(n+k)) ≤ musing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L8B
by simp

Sets of integers that have absolute value bounded are bounded.
lemma (in int0) Int_ZF_1_3_L20:
assumes A1: ∀ x∈X. b(x) ∈ ZZ ∧ abs(b(x)) ≤ Lshows IsBounded({b(x). x∈X},IntegerOrder)
proof let G = ZZ
let P = IntegerAddition
let r = IntegerOrderfrom A1 havegroup3(G, P, r)r {is total on} G∀ x∈X. b(x) ∈ G ∧ hAbsoluteValue(G, P, r) b(x), Li ∈ rusing Int_ZF_2_T1 by auto
then show IsBounded({b(x). x∈X},IntegerOrder)by (rule group3.OrderedGroup_ZF_3_L9A)
qed

If a set is bounded, then the absolute values of the elements of that set arebounded.
487

lemma (in int0) Int_ZF_1_3_L20A: assumes IsBounded(A,IntegerOrder)shows ∃ L. ∀ a∈A. abs(a) ≤ Lusing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L10A
by simp

Absolute vaues of integers from a finite image of integers are bounded by an
integer.
lemma (in int0) Int_ZF_1_3_L20AA:
assumes A1: {b(x). x∈ZZ} ∈ Fin(ZZ)shows ∃ L∈ZZ. ∀ x∈ZZ. abs(b(x)) ≤ Lusing assms int_not_empty Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L11A
by simp

If absolute values of values of some integer function are bounded, then theimage a set from the domain is a bounded set.
lemma (in int0) Int_ZF_1_3_L20B:
assumes f:X→ZZ and A⊆X and ∀ x∈A. abs(f(x)) ≤ Lshows IsBounded(f(A),IntegerOrder)
proof let G = ZZ
let P = IntegerAddition
let r = IntegerOrderfrom assms havegroup3(G, P, r)r {is total on} G
f:X→G
A⊆X
∀ x∈A. hAbsoluteValue(G, P, r)(f(x)), Li ∈ rusing Int_ZF_2_T1 by auto
then show IsBounded(f(A), r)
by (rule group3.OrderedGroup_ZF_3_L9B)
qed

A special case of the previous lemma for a function from integers to integers.
corollary (in int0) Int_ZF_1_3_L20C:
assumes f:ZZ→ZZ and ∀ m∈ZZ. abs(f(m)) ≤ Lshows f(ZZ) ∈ Fin(ZZ)
proof from assms have f:ZZ→ZZ ZZ ⊆ ZZ ∀ m∈ZZ. abs(f(m)) ≤ L
by autothen have IsBounded(f(ZZ),IntegerOrder)by (rule Int_ZF_1_3_L20B)
then show f(ZZ) ∈ Fin(ZZ) using Int_bounded_iff_fin
by simpqed

A triangle inequality with three integers. Property of linearly ordered abeliangroups.
488

lemma (in int0) int_triangle_ineq3:
assumes A1: a∈ZZ b∈ZZ c∈ZZshows abs(a-b-c) ≤ abs(a) + abs(b) + abs(c)proof from A1 have T: a-b ∈ ZZ abs(c) ∈ ZZ
using Int_ZF_1_1_L5 Int_ZF_2_L14 by autowith A1 have abs(a-b-c) ≤ abs(a-b) + abs(c)using Int_triangle_ineq1 by simp
moreover from A1 T haveabs(a-b) + abs(c) ≤ abs(a) + abs(b) + abs(c)using Int_triangle_ineq1 int_ord_transl_inv by simp
ultimately show thesis by (rule Int_order_transitive)qed

If a ≤ c and b ≤ c, then a + b ≤ 2 · c. Property of ordered rings.
lemma (in int0) Int_ZF_1_3_L21:
assumes A1: a≤c b≤c shows a+b ≤ 2·cusing assms Int_ZF_1_3_T1 ring1.OrdRing_ZF_2_L6 by simp

If an integer a is between b and b + c, then |b − a| ≤ c. Property of orderedgroups.
lemma (in int0) Int_ZF_1_3_L22:
assumes a≤b and c∈ZZ and b≤ c+ashows abs(b-a) ≤ cusing assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L8C
by simp

An application of the triangle inequality with four integers. Property oflinearly ordered abelian groups.
lemma (in int0) Int_ZF_1_3_L22A:
assumes a∈ZZ b∈ZZ c∈ZZ d∈ZZshows abs(a-c) ≤ abs(a+b) + abs(c+d) + abs(b-d)
using assms Int_ZF_1_T2 Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L7F
by simp

If an integer a is between b and b + c, then |b − a| ≤ c. Property of orderedgroups. A version of Int_ZF_1_3_L22 with sligtly different assumptions.
lemma (in int0) Int_ZF_1_3_L23:
assumes A1: a≤b and A2: c∈ZZ and A3: b≤ a+c
shows abs(b-a) ≤ c
proof from A1 have a ∈ ZZ
using Int_ZF_2_L1A by simp
with A2 A3 have b≤ c+a
using Int_ZF_1_1_L5 by simp
with A1 A2 show abs(b-a) ≤ cusing Int_ZF_1_3_L22 by simp
qed

489

42.4

Maximum and minimum of a set of integers

In this section we provide some sufficient conditions for integer subsets tohave extrema (maxima and minima).
Finite nonempty subsets of integers attain maxima and minima.
theorem (in int0) Int_fin_have_max_min:assumes A1: A ∈ Fin(ZZ) and A2: A6=0
shows
HasAmaximum(IntegerOrder,A)
HasAminimum(IntegerOrder,A)
Maximum(IntegerOrder,A) ∈ A
Minimum(IntegerOrder,A) ∈ A∀ x∈A. x ≤ Maximum(IntegerOrder,A)∀ x∈A. Minimum(IntegerOrder,A) ≤ x
Maximum(IntegerOrder,A) ∈ ZZ
Minimum(IntegerOrder,A) ∈ ZZ
proof from A1 have
A=0 ∨ HasAmaximum(IntegerOrder,A) and
A=0 ∨ HasAminimum(IntegerOrder,A)using Int_ZF_2_T1 Int_ZF_2_L6 Finite_ZF_1_1_T1A Finite_ZF_1_1_T1B
by autowith A2 show
HasAmaximum(IntegerOrder,A)
HasAminimum(IntegerOrder,A)by autofrom A1 A2 show
Maximum(IntegerOrder,A) ∈ A
Minimum(IntegerOrder,A) ∈ A∀ x∈A. x ≤ Maximum(IntegerOrder,A)∀ x∈A. Minimum(IntegerOrder,A) ≤ x
using Int_ZF_2_T1 Finite_ZF_1_T2 by auto
moreover from A1 have A⊆ZZ using FinD by simp
ultimately show
Maximum(IntegerOrder,A) ∈ ZZ
Minimum(IntegerOrder,A) ∈ ZZ
by autoqed

Bounded nonempty integer subsets attain maximum and minimum.
theorem (in int0) Int_bounded_have_max_min:assumes IsBounded(A,IntegerOrder) and A6=0
shows
HasAmaximum(IntegerOrder,A)
HasAminimum(IntegerOrder,A)
Maximum(IntegerOrder,A) ∈ A
Minimum(IntegerOrder,A) ∈ A∀ x∈A. x ≤ Maximum(IntegerOrder,A)490

∀ x∈A. Minimum(IntegerOrder,A) ≤ x
Maximum(IntegerOrder,A) ∈ ZZ
Minimum(IntegerOrder,A) ∈ ZZ
using assms Int_fin_have_max_min Int_bounded_iff_fin
by autoNonempty set of integers that is bounded below attains its minimum.
theorem (in int0) int_bounded_below_has_min:assumes A1: IsBoundedBelow(A,IntegerOrder) and A2: A6=0
shows
HasAminimum(IntegerOrder,A)
Minimum(IntegerOrder,A) ∈ A∀ x∈A. Minimum(IntegerOrder,A) ≤ x
proof from A1 A2 have
IntegerOrder {is total on} ZZ
trans(IntegerOrder)
IntegerOrder ⊆ ZZ×ZZ∀ A. IsBounded(A,IntegerOrder) ∧ A6=0 −→ HasAminimum(IntegerOrder,A)A6=0 IsBoundedBelow(A,IntegerOrder)using Int_ZF_2_T1 Int_ZF_2_L6 Int_ZF_2_L1B Int_bounded_have_max_min
by autothen show HasAminimum(IntegerOrder,A)by (rule Order_ZF_4_L11)
then show
Minimum(IntegerOrder,A) ∈ A∀ x∈A. Minimum(IntegerOrder,A) ≤ x
using Int_ZF_2_L4 Order_ZF_4_L4 by autoqed

Nonempty set of integers that is bounded above attains its maximum.
theorem (in int0) int_bounded_above_has_max:
assumes A1: IsBoundedAbove(A,IntegerOrder) and A2: A6=0
shows
HasAmaximum(IntegerOrder,A)
Maximum(IntegerOrder,A) ∈ A
Maximum(IntegerOrder,A) ∈ ZZ
∀ x∈A. x ≤ Maximum(IntegerOrder,A)proof from A1 A2 have
IntegerOrder {is total on} ZZ
trans(IntegerOrder) and
I: IntegerOrder ⊆ ZZ×ZZ and∀ A. IsBounded(A,IntegerOrder) ∧ A6=0 −→ HasAmaximum(IntegerOrder,A)A6=0 IsBoundedAbove(A,IntegerOrder)using Int_ZF_2_T1 Int_ZF_2_L6 Int_ZF_2_L1B Int_bounded_have_max_min
by autothen show HasAmaximum(IntegerOrder,A)491

by (rule Order_ZF_4_L11A)
then show
II: Maximum(IntegerOrder,A) ∈ A and∀ x∈A. x ≤ Maximum(IntegerOrder,A)using Int_ZF_2_L4 Order_ZF_4_L3 by autofrom I A1 have A ⊆ ZZ by (rule Order_ZF_3_L1A)
with II show Maximum(IntegerOrder,A) ∈ ZZ by autoqed

A set defined by separation over a bounded set attains its maximum andminimum.
lemma (in int0) Int_ZF_1_4_L1:
assumes A1: IsBounded(A,IntegerOrder) and A2: A6=0
and A3: ∀ q∈ZZ. F(q) ∈ ZZ
and A4: K = {F(q). q ∈ A}
shows
HasAmaximum(IntegerOrder,K)
HasAminimum(IntegerOrder,K)
Maximum(IntegerOrder,K) ∈ K
Minimum(IntegerOrder,K) ∈ K
Maximum(IntegerOrder,K) ∈ ZZ
Minimum(IntegerOrder,K) ∈ ZZ
∀ q∈A. F(q) ≤ Maximum(IntegerOrder,K)∀ q∈A. Minimum(IntegerOrder,K) ≤ F(q)IsBounded(K,IntegerOrder)
proof from A1 have A ∈ Fin(ZZ) using Int_bounded_iff_fin
by simpwith A3 have {F(q). q ∈ A} ∈ Fin(ZZ)
by (rule fin_image_fin)with A2 A4 have T1: K ∈ Fin(ZZ) K6=0 by auto
then show T2:
HasAmaximum(IntegerOrder,K)
HasAminimum(IntegerOrder,K)and Maximum(IntegerOrder,K) ∈ K
Minimum(IntegerOrder,K) ∈ K
Maximum(IntegerOrder,K) ∈ ZZ
Minimum(IntegerOrder,K) ∈ ZZ
using Int_fin_have_max_min by auto
{ fix q assume q∈Awith A4 have F(q) ∈ K by autowith T1 haveF(q) ≤ Maximum(IntegerOrder,K)
Minimum(IntegerOrder,K) ≤ F(q)using Int_fin_have_max_min by auto
} then show
∀ q∈A. F(q) ≤ Maximum(IntegerOrder,K)∀ q∈A. Minimum(IntegerOrder,K) ≤ F(q)by auto492

from T2 show IsBounded(K,IntegerOrder)using Order_ZF_4_L7 Order_ZF_4_L8A IsBounded_def
by simpqed

A three element set has a maximume and minimum.
lemma (in int0) Int_ZF_1_4_L1A: assumes A1: a∈ZZ
shows
Maximum(IntegerOrder,{a,b,c}) ∈ ZZ
a ≤ Maximum(IntegerOrder,{a,b,c})b ≤ Maximum(IntegerOrder,{a,b,c})c ≤ Maximum(IntegerOrder,{a,b,c})using assms Int_ZF_2_T1 Finite_ZF_1_L2A by auto

b∈ZZ

c∈ZZ

Integer functions attain maxima and minima over intervals.
lemma (in int0) Int_ZF_1_4_L2:
assumes A1: f:ZZ→ZZ and A2: a≤bshowsmaxf(f,a..b) ∈ ZZ
∀ c ∈ a..b. f(c) ≤ maxf(f,a..b)∃ c ∈ a..b. f(c) = maxf(f,a..b)minf(f,a..b) ∈ ZZ
∀ c ∈ a..b. minf(f,a..b) ≤ f(c)∃ c ∈ a..b. f(c) = minf(f,a..b)
proof from A2 have T: a∈ZZ b∈ZZ a..b ⊆ ZZ
using Int_ZF_2_L1A Int_ZF_2_L1B Order_ZF_2_L6
by autowith A1 A2 have
Maximum(IntegerOrder,f(a..b)) ∈ f(a..b)∀ x∈f(a..b). x ≤ Maximum(IntegerOrder,f(a..b))Maximum(IntegerOrder,f(a..b)) ∈ ZZ
Minimum(IntegerOrder,f(a..b)) ∈ f(a..b)∀ x∈f(a..b). Minimum(IntegerOrder,f(a..b)) ≤ x
Minimum(IntegerOrder,f(a..b)) ∈ ZZ
using Int_ZF_4_L8 Int_ZF_2_T1 group3.OrderedGroup_ZF_2_L6
Int_fin_have_max_min by autowith A1 T show
maxf(f,a..b) ∈ ZZ
∀ c ∈ a..b. f(c) ≤ maxf(f,a..b)∃ c ∈ a..b. f(c) = maxf(f,a..b)minf(f,a..b) ∈ ZZ
∀ c ∈ a..b. minf(f,a..b) ≤ f(c)∃ c ∈ a..b. f(c) = minf(f,a..b)using func_imagedef by auto
qed

493

42.5

The set of nonnegative integers

The set of nonnegative integers looks like the set of natural numbers. We
explore that in this section. We also rephrase some lemmas about the set of
positive integers known from the theory of oredered grups.
The set of positive integers is closed under addition.
lemma (in int0) pos_int_closed_add:
shows ZZ+ {is closed under} IntegerAddition
using Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L13 by simp

Text expended version of the fact that the set of positive integers is closed
under addition
lemma (in int0) pos_int_closed_add_unfolded:
assumes a∈ZZ+ b∈ZZ+ shows a+b ∈ ZZ+
using assms pos_int_closed_add IsOpClosed_def
by simpZZ+ is bounded below.
lemma (in int0) Int_ZF_1_5_L1: shows
IsBoundedBelow(ZZ+ ,IntegerOrder)
IsBoundedBelow(ZZ+ ,IntegerOrder)using Nonnegative_def PositiveSet_def IsBoundedBelow_def by auto

Subsets of ZZ+ are bounded below.
lemma (in int0) Int_ZF_1_5_L1A: assumes A ⊆ ZZ+
shows IsBoundedBelow(A,IntegerOrder)using assms Int_ZF_1_5_L1 Order_ZF_3_L12 by blast

Subsets of ZZ+ are bounded below.
lemma (in int0) Int_ZF_1_5_L1B: assumes A1: A ⊆ ZZ+
shows IsBoundedBelow(A,IntegerOrder)using A1 Int_ZF_1_5_L1 Order_ZF_3_L12 by blast

Every nonempty subset of positive integers has a mimimum.
lemma (in int0) Int_ZF_1_5_L1C: assumes A ⊆ ZZ+ and A 6= 0
shows
HasAminimum(IntegerOrder,A)
Minimum(IntegerOrder,A) ∈ A∀ x∈A. Minimum(IntegerOrder,A) ≤ x
using assms Int_ZF_1_5_L1B int_bounded_below_has_min by auto

Infinite subsets of Z + do not have a maximum - If A ⊆ Z + then for every
integer we can find one in the set that is not smaller.
lemma (in int0) Int_ZF_1_5_L2:
assumes A1: A ⊆ ZZ+ and A2: A ∈/ Fin(ZZ) and A3: D∈ZZ
shows ∃ n∈A. D≤n494

proof { assume ∀ n∈A. ¬(D≤n)
moreover from A1 A3 have D∈ZZ ∀ n∈A. n∈ZZusing Nonnegative_def by auto
ultimately have ∀ n∈A. n≤Dusing Int_ZF_2_L19 by blast
hence ∀ n∈A. hn,Di ∈ IntegerOrder by simp
then have IsBoundedAbove(A,IntegerOrder)by (rule Order_ZF_3_L10)
with A1 have IsBounded(A,IntegerOrder)using Int_ZF_1_5_L1A IsBounded_def by simp
with A2 have False using Int_bounded_iff_fin by auto
} thus thesis by auto
qed

Infinite subsets of Z+ do not have a maximum - If A ⊆ Z+ then for every
integer we can find one in the set that is not smaller. This is very similar to
Int_ZF_1_5_L2, except we have ZZ+ instead of ZZ+ here.
lemma (in int0) Int_ZF_1_5_L2A:
assumes A1: A ⊆ ZZ+ and A2: A ∈/ Fin(ZZ) and A3: D∈ZZ
shows ∃ n∈A. D≤nproof { assume ∀ n∈A. ¬(D≤n)
moreover from A1 A3 have D∈ZZ ∀ n∈A. n∈ZZusing PositiveSet_def by auto
ultimately have ∀ n∈A. n≤Dusing Int_ZF_2_L19 by blast
hence ∀ n∈A. hn,Di ∈ IntegerOrder by simp
then have IsBoundedAbove(A,IntegerOrder)by (rule Order_ZF_3_L10)
with A1 have IsBounded(A,IntegerOrder)using Int_ZF_1_5_L1B IsBounded_def by simp
with A2 have False using Int_bounded_iff_fin by auto
} thus thesis by autoqed

An integer is either positive, zero, or its opposite is postitive.
lemma (in int0) Int_decomp: assumes m∈ZZ
shows Exactly_1_of_3_holds (m=0,m∈ZZ+ ,(-m)∈ZZ+ )using assms Int_ZF_2_T1 group3.OrdGroup_decomp
by simp

An integer is zero, positive, or it’s inverse is positive.
lemma (in int0) int_decomp_cases: assumes m∈ZZ
shows m=0 ∨ m∈ZZ+ ∨ (-m) ∈ ZZ+
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L14
by simp

An integer is in the positive set iff it is greater or equal one.
495

lemma (in int0) Int_ZF_1_5_L3: shows m∈ZZ+ ←→ 1≤m
proof
assume m∈ZZ+ then have 0≤m m6=0
using PositiveSet_def by auto
then have 0+1 ≤ musing Int_ZF_4_L1B by auto
then show 1≤musing int_zero_one_are_int Int_ZF_1_T2 group0.group0_2_L2
by simpnext assume 1≤mthen have m∈ZZ 0≤m m6=0
using Int_ZF_2_L1A Int_ZF_2_L16C by auto
then show m∈ZZ+ using PositiveSet_def by autoqed

The set of positive integers is closed under multiplication. The unfolded
form.
lemma (in int0) pos_int_closed_mul_unfold:assumes a∈ZZ+ b∈ZZ+
shows a·b ∈ ZZ+
using assms Int_ZF_1_5_L3 Int_ZF_1_3_L3 by simp

The set of positive integers is closed under multiplication.
lemma (in int0) pos_int_closed_mul: shows
ZZ+ {is closed under} IntegerMultiplication
using pos_int_closed_mul_unfold IsOpClosed_def
by simp

It is an overkill to prove that the ring of integers has no zero divisors thisway, but why not?
lemma (in int0) int_has_no_zero_divs:
shows HasNoZeroDivs(ZZ,IntegerAddition,IntegerMultiplication)using pos_int_closed_mul Int_ZF_1_3_T1 ring1.OrdRing_ZF_3_L3
by simp

Nonnegative integers are positive ones plus zero.
lemma (in int0) Int_ZF_1_5_L3A: shows ZZ+ = ZZ+ ∪ {0}using Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L24 by simp

We can make a function smaller than any constant on a given interval of
positive integers by adding another constant.
lemma (in int0) Int_ZF_1_5_L4:
assumes A1: f:ZZ→ZZ and A2: K∈ZZ N∈ZZ
shows ∃ C∈ZZ. ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nproof from A2 have N≤1 ∨ 2≤Nusing int_zero_one_are_int no_int_between
by simp496

moreover{ assume A3: N≤1
let C = 0
have C ∈ ZZ using int_zero_one_are_int
by simpmoreover{ fix n assume n∈ZZ+
then have 1 ≤ n using Int_ZF_1_5_L3
by simpwith A3 have N≤n by (rule Int_order_transitive)} then have ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nby autoultimately have ∃ C∈ZZ. ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nby auto }moreover{ let C = K - 1 - maxf(f,1..(N-1))
assume 2≤Nthen have 2-1 ≤ N-1
using int_zero_one_are_int Int_ZF_1_1_L4 int_ord_transl_inv
by simpthen have I: 1 ≤ N-1
using int_zero_one_are_int Int_ZF_1_2_L3 by simp
with A1 A2 have T:
maxf(f,1..(N-1)) ∈ ZZ K-1 ∈ ZZ C ∈ ZZ
using Int_ZF_1_4_L2 Int_ZF_1_1_L5 int_zero_one_are_int
by automoreover{ fix n assume A4: n∈ZZ+{ assume A5: K ≤ f(n) + C and ¬(N≤n)
with A2 A4 have n ≤ N-1
using PositiveSet_def Int_ZF_1_3_L6A by simp
with A4 have n ∈ 1..(N-1)
using Int_ZF_1_5_L3 Interval_def by autowith A1 I T have f(n)+C ≤ maxf(f,1..(N-1)) + C
using Int_ZF_1_4_L2 int_ord_transl_inv by simp
with T have f(n)+C ≤ K-1
using Int_ZF_1_2_L3 by simp
with A5 have K ≤ K-1
by (rule Int_order_transitive)
with A2 have False using Int_ZF_1_2_L3AA by simp
} then have K ≤ f(n) + C −→ N≤nby auto} then have ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nby simpultimately have ∃ C∈ZZ. ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nby auto }ultimately show thesis by autoqed

Absolute value is identity on positive integers.
497

lemma (in int0) Int_ZF_1_5_L4A:
assumes a∈ZZ+ shows abs(a) = a
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_3_L2B
by simpOne and two are in ZZ+ .
lemma (in int0) int_one_two_are_pos: shows 1 ∈ ZZ+ 2 ∈ ZZ+
using int_zero_one_are_int int_ord_is_refl refl_def Int_ZF_1_5_L3
Int_ZF_2_L16B by auto

The image of ZZ+ by a function defined on integers is not empty.
lemma (in int0) Int_ZF_1_5_L5: assumes A1: f : ZZ→X
shows f(ZZ+ ) 6= 0
proof have ZZ+ ⊆ ZZ using PositiveSet_def by autowith A1 show f(ZZ+ ) 6= 0
using int_one_two_are_pos func_imagedef by autoqed

If n is positive, then n − 1 is nonnegative.
lemma (in int0) Int_ZF_1_5_L6: assumes A1: n ∈ ZZ+
shows
0 ≤ n-1
0 ∈ 0..(n-1)
0..(n-1) ⊆ ZZ
proof from A1 have 1 ≤ n (-1) ∈ ZZ
using Int_ZF_1_5_L3 int_zero_one_are_int Int_ZF_1_1_L4
by autothen have 1-1 ≤ n-1
using int_ord_transl_inv by simp
then show 0 ≤ n-1
using int_zero_one_are_int Int_ZF_1_1_L4 by simp
then show 0 ∈ 0..(n-1)
using int_zero_one_are_int int_ord_is_refl refl_def Order_ZF_2_L1B
by simpshow 0..(n-1) ⊆ ZZ
using Int_ZF_2_L1B Order_ZF_2_L6 by simp
qedIntgers greater than one in ZZ+ belong to ZZ+ . This is a property of orderedgroups and follows from OrderedGroup_ZF_1_L19, but Isabelle’s simplifier has
problems using that result directly, so we reprove it specifically for integers.
lemma (in int0) Int_ZF_1_5_L7: assumes a ∈ ZZ+ and a≤bshows b ∈ ZZ+
proof from assms have 1≤a a≤busing Int_ZF_1_5_L3 by auto498then have 1≤b by (rule Int_order_transitive)then show b ∈ ZZ+ using Int_ZF_1_5_L3 by simp
qed

Adding a positive integer increases integers.
lemma (in int0) Int_ZF_1_5_L7A: assumes a∈ZZ b ∈ ZZ+
shows a ≤ a+b a 6= a+b a+b ∈ ZZ
using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L22
by autoFor any integer m the greater of m and 1 is a positive integer that is greateror equal than m. If we add 1 to it we get a positive integer that is strictly
greater than m.
lemma (in int0) Int_ZF_1_5_L7B: assumes a∈ZZ
showsa ≤ GreaterOf(IntegerOrder,1,a)GreaterOf(IntegerOrder,1,a) ∈ ZZ+
GreaterOf(IntegerOrder,1,a) + 1 ∈ ZZ+
a ≤ GreaterOf(IntegerOrder,1,a) + 1
a 6= GreaterOf(IntegerOrder,1,a) + 1
using assms int_zero_not_one Int_ZF_1_3_T1 ring1.OrdRing_ZF_3_L12
by autoThe opposite of an element of ZZ+ cannot belong to ZZ+ .
lemma (in int0) Int_ZF_1_5_L8: assumes a ∈ ZZ+
shows (-a) ∈/ ZZ+using assms Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L20
by simp

For every integer there is one in ZZ+ that is greater or equal.
lemma (in int0) Int_ZF_1_5_L9: assumes a∈ZZ
shows ∃ b∈ZZ+ . a≤busing assms int_not_trivial Int_ZF_2_T1 group3.OrderedGroup_ZF_1_L23
by simpA theorem about odd extensions. Recall from OrdereGroup_ZF.thy that theodd extension of an integer function f defined on ZZ+ is the odd function on
ZZ equal to f on ZZ+ . First we show that the odd extension is defined on ZZ.
lemma (in int0) Int_ZF_1_5_L10: assumes f : ZZ+ →ZZ
shows OddExtension(ZZ,IntegerAddition,IntegerOrder,f) : ZZ→ZZ
using assms Int_ZF_2_T1 group3.odd_ext_props by simp

On ZZ+ , the odd extension of f is the same as f .
lemma (in int0) Int_ZF_1_5_L11: assumes f : ZZ+ →ZZ and a ∈ ZZ+ andg = OddExtension(ZZ,IntegerAddition,IntegerOrder,f)shows g(a) = f(a)using assms Int_ZF_2_T1 group3.odd_ext_props by simp499

On -ZZ+ , the value of the odd extension of f is the negative of f (−a).
lemma (in int0) Int_ZF_1_5_L12:
assumes f : ZZ+ →ZZ and a ∈ (-ZZ+ ) andg = OddExtension(ZZ,IntegerAddition,IntegerOrder,f)shows g(a) = -(f(-a))
using assms Int_ZF_2_T1 group3.odd_ext_props by simp

Odd extensions are odd on ZZ.
lemma (in int0) int_oddext_is_odd:
assumes f : ZZ+ →ZZ and a∈ZZ andg = OddExtension(ZZ,IntegerAddition,IntegerOrder,f)shows g(-a) = -(g(a))
using assms Int_ZF_2_T1 group3.oddext_is_odd by simp

Alternative definition of an odd function.
lemma (in int0) Int_ZF_1_5_L13: assumes A1: f: ZZ→ZZ shows(∀ a∈ZZ. f(-a) = (-f(a))) ←→ (∀ a∈ZZ. (-(f(-a))) = f(a))
using assms Int_ZF_1_T2 group0.group0_6_L2 by simp

Another way of expressing the fact that odd extensions are odd.
lemma (in int0) int_oddext_is_odd_alt:
assumes f : ZZ+ →ZZ and a∈ZZ andg = OddExtension(ZZ,IntegerAddition,IntegerOrder,f)shows (-g(-a)) = g(a)using assms Int_ZF_2_T1 group3.oddext_is_odd_alt by simp

42.6

Functions with infinite limits

In this section we consider functions (integer sequences) that have infinite
limits. An integer function has infinite positive limit if it is arbitrarily large
for large enough arguments. Similarly, a function has infinite negative limit
if it is arbitrarily small for small enough arguments. The material in thiscome mostly from the section in OrderedGroup_ZF.thy with he same title.
Here we rewrite the theorems from that section in the notation we use for
integers and add some results specific for the ordered group of integers.
If an image of a set by a function with infinite positive limit is bounded
above, then the set itself is bounded above.
lemma (in int0) Int_ZF_1_6_L1: assumes f: ZZ→ZZ and∀ a∈ZZ.∃ b∈ZZ+ .∀ x. b≤x −→ a ≤ f(x) and A ⊆ ZZ and
IsBoundedAbove(f(A),IntegerOrder)shows IsBoundedAbove(A,IntegerOrder)using assms int_not_trivial Int_ZF_2_T1 group3.OrderedGroup_ZF_7_L1
by simp

If an image of a set defined by separation by a function with infinite positive
limit is bounded above, then the set itself is bounded above.
500

lemma (in int0) Int_ZF_1_6_L2: assumes A1: X6=0 and A2: f: ZZ→ZZ andA3: ∀ a∈ZZ.∃ b∈ZZ+ .∀ x. b≤x −→ a ≤ f(x) andA4: ∀ x∈X. b(x) ∈ ZZ ∧ f(b(x)) ≤ Ushows ∃ u.∀ x∈X. b(x) ≤ u
proof let G = ZZ
let P = IntegerAddition
let r = IntegerOrderfrom A1 A2 A3 A4 havegroup3(G, P, r)r {is total on} G
G 6= {TheNeutralElement(G, P)}
X6=0 f: G→G∀ a∈G. ∃ b∈PositiveSet(G, P, r). ∀ y. hb, yi ∈ r −→ ha, f(y)i ∈ r∀ x∈X. b(x) ∈ G ∧ hf(b(x)), Ui ∈ rusing int_not_trivial Int_ZF_2_T1 by auto
then have ∃ u. ∀ x∈X. hb(x), ui ∈ r by (rule group3.OrderedGroup_ZF_7_L2)
thus thesis by simpqed

If an image of a set defined by separation by a integer function with infinite
negative limit is bounded below, then the set itself is bounded above. Thisis dual to Int_ZF_1_6_L2.
lemma (in int0) Int_ZF_1_6_L3: assumes A1: X6=0 and A2: f: ZZ→ZZ andA3: ∀ a∈ZZ.∃ b∈ZZ+ .∀ y. b≤y −→ f(-y) ≤ a andA4: ∀ x∈X. b(x) ∈ ZZ ∧ L ≤ f(b(x))
shows ∃ l.∀ x∈X. l ≤ b(x)proof let G = ZZ
let P = IntegerAddition
let r = IntegerOrderfrom A1 A2 A3 A4 havegroup3(G, P, r)r {is total on} G
G 6= {TheNeutralElement(G, P)}
X6=0 f: G→G∀ a∈G. ∃ b∈PositiveSet(G, P, r). ∀ y.
hb, yi ∈ r −→ hf(GroupInv(G, P)(y)),ai ∈ r∀ x∈X. b(x) ∈ G ∧ hL,f(b(x))i ∈ rusing int_not_trivial Int_ZF_2_T1 by auto
then have ∃ l. ∀ x∈X. hl, b(x)i ∈ r by (rule group3.OrderedGroup_ZF_7_L3)
thus thesis by simp
qed

The next lemma combines Int_ZF_1_6_L2 and Int_ZF_1_6_L3 to show that
if the image of a set defined by separation by a function with infinite limits
is bounded, then the set itself is bounded. The proof again uses directly a501

fact from OrderedGroup_ZF.
lemma (in int0) Int_ZF_1_6_L4:
assumes A1: X6=0 and A2: f: ZZ→ZZ andA3: ∀ a∈ZZ.∃ b∈ZZ+ .∀ x. b≤x −→ a ≤ f(x) andA4: ∀ a∈ZZ.∃ b∈ZZ+ .∀ y. b≤y −→ f(-y) ≤ a andA5: ∀ x∈X. b(x) ∈ ZZ ∧ f(b(x)) ≤ U ∧ L ≤ f(b(x))
shows ∃ M.∀ x∈X. abs(b(x)) ≤ M
proof let G = ZZ
let P = IntegerAddition
let r = IntegerOrderfrom A1 A2 A3 A4 A5 havegroup3(G, P, r)r {is total on} G
G 6= {TheNeutralElement(G, P)}
X6=0 f: G→G∀ a∈G. ∃ b∈PositiveSet(G, P, r). ∀ y. hb, yi ∈ r −→ ha, f(y)i ∈ r∀ a∈G. ∃ b∈PositiveSet(G, P, r). ∀ y.
hb, yi ∈ r −→ hf(GroupInv(G, P)(y)),ai ∈ r∀ x∈X. b(x) ∈ G ∧ hL,f(b(x))i ∈ r ∧ hf(b(x)), Ui ∈ rusing int_not_trivial Int_ZF_2_T1 by auto
then have ∃ M. ∀ x∈X. hAbsoluteValue(G, P, r) b(x), Mi ∈ r
by (rule group3.OrderedGroup_ZF_7_L4)
thus thesis by simp
qed

If a function is larger than some constant for arguments large enough, thenthe image of a set that is bounded below is bounded below. This is not true
for ordered groups in general, but only for those for which bounded sets are
finite. This does not require the function to have infinite limit, but suchfunctions do have this property.
lemma (in int0) Int_ZF_1_6_L5:
assumes A1: f: ZZ→ZZ and A2: N∈ZZ andA3: ∀ m. N≤m −→ L ≤ f(m) and
A4: IsBoundedBelow(A,IntegerOrder)shows IsBoundedBelow(f(A),IntegerOrder)
proof from A2 A4 have A = {x∈A. x≤N} ∪ {x∈A. N≤x}
using Int_ZF_2_T1 Int_ZF_2_L1C Order_ZF_1_L5
by simpmoreover havef({x∈A. x≤N} ∪ {x∈A. N≤x}) =f{x∈A. x≤N} ∪ f{x∈A. N≤x}by (rule image_Un)
ultimately have f(A) = f{x∈A. x≤N} ∪ f{x∈A. N≤x}by simpmoreover have IsBoundedBelow(f{x∈A. x≤N},IntegerOrder)
proof -

502

let B = {x∈A. x≤N}
from A4 have B ∈ Fin(ZZ)
using Order_ZF_3_L16 Int_bounded_iff_fin by autowith A1 have IsBounded(f(B),IntegerOrder)using Finite1_L6A Int_bounded_iff_fin by simp
then show IsBoundedBelow(f(B),IntegerOrder)using IsBounded_def by simp
qed
moreover have IsBoundedBelow(f{x∈A. N≤x},IntegerOrder)
proof let C = {x∈A. N≤x}
from A4 have C ⊆ ZZ using Int_ZF_2_L1C by autowith A1 A3 have ∀ y ∈ f(C). hL,yi ∈ IntegerOrderusing func_imagedef by simp
then show IsBoundedBelow(f(C),IntegerOrder)by (rule Order_ZF_3_L9)
qed
ultimately show IsBoundedBelow(f(A),IntegerOrder)using Int_ZF_2_T1 Int_ZF_2_L6 Int_ZF_2_L1B Order_ZF_3_L6
by simpqed

A function that has an infinite limit can be made arbitrarily large on positive
integers by adding a constant. This does not actually require the function
to have infinite limit, just to be larger than a constant for arguments large
enough.
lemma (in int0) Int_ZF_1_6_L6: assumes A1: N∈ZZ andA2: ∀ m. N≤m −→ L ≤ f(m) andA3: f: ZZ→ZZ and A4: K∈ZZ
shows ∃ c∈ZZ. ∀ n∈ZZ+ . K ≤ f(n)+c
proof have IsBoundedBelow(ZZ+ ,IntegerOrder)using Int_ZF_1_5_L1 by simp
with A3 A1 A2 have IsBoundedBelow(f(ZZ+ ),IntegerOrder)by (rule Int_ZF_1_6_L5)
with A1 obtain l where I: ∀ y∈f(ZZ+ ). l ≤ yusing Int_ZF_1_5_L5 IsBoundedBelow_def by auto
let c = K-lfrom A3 have f(ZZ+ ) 6= 0 using Int_ZF_1_5_L5
by simpthen have ∃ y. y ∈ f(ZZ+ ) by (rule nonempty_has_element)
then obtain y where y ∈ f(ZZ+ ) by autowith A4 I have T: l ∈ ZZ c ∈ ZZ
using Int_ZF_2_L1A Int_ZF_1_1_L5 by auto
{ fix n assume A5: n∈ZZ+have ZZ+ ⊆ ZZ using PositiveSet_def by autowith A3 I T A5 have l + c ≤ f(n) + c
using func_imagedef int_ord_transl_inv by autowith I T have l + c ≤ f(n) + c

503

using int_ord_transl_inv by simp
with A4 T have K ≤ f(n) + c
using Int_ZF_1_2_L3 by simp
} then have ∀ n∈ZZ+ . K ≤ f(n) + c by simp
with T show thesis by autoqed

If a function has infinite limit, then we can add such constant such thatminimum of those arguments for which the function (plus the constant) islarger than another given constant is greater than a third constant. It is not
as complicated as it sounds.
lemma (in int0) Int_ZF_1_6_L7:
assumes A1: f: ZZ→ZZ and A2: K∈ZZ N∈ZZ andA3: ∀ a∈ZZ.∃ b∈ZZ+ .∀ x. b≤x −→ a ≤ f(x)shows ∃ C∈ZZ. N ≤ Minimum(IntegerOrder,{n∈ZZ+ . K ≤ f(n)+C})
proof from A1 A2 have ∃ C∈ZZ. ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nusing Int_ZF_1_5_L4 by simp
then obtain C where I: C∈ZZ andII: ∀ n∈ZZ+ . K ≤ f(n) + C −→ N≤nby autohave antisym(IntegerOrder) using Int_ZF_2_L4 by simp
moreover have HasAminimum(IntegerOrder,{n∈ZZ+ . K ≤ f(n)+C})
proof from A2 A3 I have ∃ n∈ZZ+ .∀ x. n≤x −→ K-C ≤ f(x)using Int_ZF_1_1_L5 by simp
then obtain n wheren∈ZZ+ and ∀ x. n≤x −→ K-C ≤ f(x)by autowith A2 I have{n∈ZZ+ . K ≤ f(n)+C} 6= 0{n∈ZZ+ . K ≤ f(n)+C} ⊆ ZZ+
using int_ord_is_refl refl_def PositiveSet_def Int_ZF_2_L9C
by autothen show HasAminimum(IntegerOrder,{n∈ZZ+ . K ≤ f(n)+C})
using Int_ZF_1_5_L1C by simp
qed
moreover from II have∀ n ∈ {n∈ZZ+ . K ≤ f(n)+C}. hN,ni ∈ IntegerOrderby autoultimately have
hN,Minimum(IntegerOrder,{n∈ZZ+ . K ≤ f(n)+C})i ∈ IntegerOrderby (rule Order_ZF_4_L12)
with I show thesis by autoqed

For any integer m the function k 7→ m · k has an infinite limit (or negativeof that). This is why we put some properties of these functions here, eventhough they properly belong to a (yet nonexistent) section on homomor504

phisms. The next lemma shows that the set {a · x : x ∈ Z} can finite only
if a = 0.
lemma (in int0) Int_ZF_1_6_L8:
assumes A1: a∈ZZ and A2: {a·x. x∈ZZ} ∈ Fin(ZZ)shows a = 0
proof from A1 have a=0 ∨ (a ≤ -1) ∨ (1≤a)
using Int_ZF_1_3_L6C by simp
moreover{ assume a ≤ -1
then have {a·x. x∈ZZ} ∈/ Fin(ZZ)
using int_zero_not_one Int_ZF_1_3_T1 ring1.OrdRing_ZF_3_L6
by simpwith A2 have False by simp }moreover{ assume 1≤athen have {a·x. x∈ZZ} ∈/ Fin(ZZ)
using int_zero_not_one Int_ZF_1_3_T1 ring1.OrdRing_ZF_3_L5
by simpwith A2 have False by simp }ultimately show a = 0 by auto
qed

42.7

Miscelaneous

In this section we put some technical lemmas needed in various other places
that are hard to classify.
Suppose we have an integer expression (a meta-function)F such that F (p)|p|is bounded by a linear function of |p|, that is for some integers A, B we have
F (p)|p| ≤ A|p| + B. We show that F is then bounded. The proof is easy, we
just divide both sides by |p| and take the limit (just kidding).
lemma (in int0) Int_ZF_1_7_L1:
assumes A1: ∀ q∈ZZ. F(q) ∈ ZZ andA2: ∀ q∈ZZ. F(q)·abs(q) ≤ A·abs(q) + B and
A3: A∈ZZ B∈ZZ
shows ∃ L. ∀ p∈ZZ. F(p) ≤ L
proof let I = (-abs(B))..abs(B)
let K = {F(q). q ∈ I}
let M = Maximum(IntegerOrder,K)
let L = GreaterOf(IntegerOrder,M,A+1)
from A3 A1 have C1:
IsBounded(I,IntegerOrder)
I 6= 0∀ q∈ZZ. F(q) ∈ ZZ
K = {F(q). q ∈ I}
using Order_ZF_3_L11 Int_ZF_1_3_L17 by auto505

then have M ∈ ZZ by (rule Int_ZF_1_4_L1)
with A3 have T1: M ≤ L A+1 ≤ L
using int_zero_one_are_int Int_ZF_1_1_L5 Int_ZF_1_3_L18
by autofrom C1 have T2: ∀ q∈I. F(q) ≤ M
by (rule Int_ZF_1_4_L1){ fix p assume A4: p∈ZZ have F(p) ≤ L
proof { assume abs(p) ≤ abs(B)with A4 T1 T2 have F(p) ≤ M M ≤ Lusing Int_ZF_1_3_L19 by auto
then have F(p) ≤ L by (rule Int_order_transitive) }moreover{ assume A5: ¬(abs(p) ≤ abs(B))
from A3 A2 A4 haveA·abs(p) ∈ ZZ F(p)·abs(p) ≤ A·abs(p) + B
using Int_ZF_2_L14 Int_ZF_1_1_L5 by auto
moreover from A3 A4 A5 have B ≤ abs(p)using Int_ZF_1_3_L15 by simp
ultimately haveF(p)·abs(p) ≤ A·abs(p) + abs(p)using Int_ZF_2_L15A by blast
with A3 A4 have F(p)·abs(p) ≤ (A+1)·abs(p)using Int_ZF_2_L14 Int_ZF_1_2_L7 by simp
moreover from A3 A1 A4 A5 haveF(p) ∈ ZZ A+1 ∈ ZZ abs(p) ∈ ZZ¬(abs(p) ≤ 0)
using int_zero_one_are_int Int_ZF_1_1_L5 Int_ZF_2_L14 Int_ZF_1_3_L11
by autoultimately have F(p) ≤ A+1
using Int_ineq_simpl_positive by simp
moreover from T1 have A+1 ≤ L by simp
ultimately have F(p) ≤ L by (rule Int_order_transitive) }ultimately show thesis by blastqed} then have ∀ p∈ZZ. F(p) ≤ L by simp
thus thesis by autoqed

A lemma about splitting (not really, there is some overlap) the ZZ×ZZ into
six subsets (cases). The subsets are as follows: first and third qaudrant, andsecond and fourth quadrant farther split by the b = −a line.
lemma (in int0) int_plane_split_in6: assumes a∈ZZ b∈ZZ
shows0≤a ∧ 0≤b ∨ a≤0 ∧ b≤0 ∨a≤0 ∧ 0≤b ∧ 0 ≤ a+b ∨ a≤0 ∧ 0≤b ∧ a+b ≤ 0 ∨0≤a ∧ b≤0 ∧ 0 ≤ a+b ∨ 0≤a ∧ b≤0 ∧ a+b ≤ 0
using assms Int_ZF_2_T1 group3.OrdGroup_6cases by simp

506

end

43

Division on integers

theory IntDiv_ZF_IML imports Int_ZF_1 ZF.IntDiv
begin

This theory translates some results form the Isabelle’s IntDiv.thy theory to
the notation used by IsarMathLib.

43.1

Quotient and reminder

For any integers m, n , n > 0 there are unique integers q, p such that 0 ≤p < n and m = n · q + p. Number p in this decompsition is usually called m
mod n. Standard Isabelle denotes numbers q, p as m zdiv n and m zmod n,resp., and we will use the same notation.
The next lemma is sometimes called the ”quotient-reminder theorem”.
lemma (in int0) IntDiv_ZF_1_L1: assumes m∈ZZ n∈ZZshows m = n·(m zdiv n) + (m zmod n)using assms Int_ZF_1_L2 raw_zmod_zdiv_equality
by simp

If n is greater than 0 then m zmod n is between 0 and n − 1.
lemma (in int0) IntDiv_ZF_1_L2:
assumes A1: m∈ZZ and A2: 0≤n n6=0
shows
0 ≤ m zmod nm zmod n ≤ nm zmod n 6= nm zmod n ≤ n-1
proof from A2 have T: n ∈ ZZ
using Int_ZF_2_L1A by simp
from A2 have #0 $< n using Int_ZF_2_L9 Int_ZF_1_L8
by autowith T show
0 ≤ m zmod nm zmod n ≤ nm zmod n 6= nusing pos_mod Int_ZF_1_L8 Int_ZF_1_L8A zmod_type
Int_ZF_2_L1 Int_ZF_2_L9AA
by autothen show m zmod n ≤ n-1
using Int_ZF_4_L1B by autoqed(m · k) div k = m.
507

lemma (in int0) IntDiv_ZF_1_L3:
assumes m∈ZZ k∈ZZ and k6=0
shows(m·k) zdiv k = m(k·m) zdiv k = musing assms zdiv_zmult_self1 zdiv_zmult_self2
Int_ZF_1_L8 Int_ZF_1_L2 by auto

The next lemma essentially translates zdiv_mono1 from standard Isabelle toour notation.
lemma (in int0) IntDiv_ZF_1_L4:
assumes A1: m ≤ k and A2: 0≤n n6=0
shows m zdiv n ≤ k zdiv n
proof from A2 have #0 ≤ n #0 6= nusing Int_ZF_1_L8 by autowith A1 havem zdiv n $≤ k zdiv n
m zdiv n ∈ ZZ
m zdiv k ∈ ZZ
using Int_ZF_2_L1A Int_ZF_2_L9 zdiv_mono1
by autothen show (m zdiv n) ≤ (k zdiv n)using Int_ZF_2_L1 by simp
qed

A quotient-reminder theorem about integers greater than a given product.
lemma (in int0) IntDiv_ZF_1_L5:
assumes A1: n ∈ ZZ+ and A2: n ≤ k and A3: k·n ≤ mshowsm = n·(m zdiv n) + (m zmod n)m = (m zdiv n)·n + (m zmod n)(m zmod n) ∈ 0..(n-1)
k ≤ (m zdiv n)m zdiv n ∈ ZZ+
proof from A2 A3 have T:
m∈ZZ n∈ZZ k∈ZZ m zdiv n ∈ ZZ
using Int_ZF_2_L1A by auto
then show m = n·(m zdiv n) + (m zmod n)using IntDiv_ZF_1_L1 by simp
with T show m = (m zdiv n)·n + (m zmod n)using Int_ZF_1_L4 by simp
from A1 have I: 0≤n n6=0
using PositiveSet_def by autowith T show (m zmod n) ∈ 0..(n-1)
using IntDiv_ZF_1_L2 Order_ZF_2_L1
by simpfrom A3 I have (k·n zdiv n) ≤ (m zdiv n)using IntDiv_ZF_1_L4 by simp

508

with I T show k ≤ (m zdiv n)using IntDiv_ZF_1_L3 by simp
with A1 A2 show m zdiv n ∈ ZZ+
using Int_ZF_1_5_L7 by blast
qed

end

44

Integers 2

theory Int_ZF_2 imports func_ZF_1 Int_ZF_1 IntDiv_ZF_IML Group_ZF_3
begin

In this theory file we consider the properties of integers that are needed forthe real numbers construction in Real_ZF series.

44.1

SlopesIn this section we study basic properties of slopes - the integer almost homomorphisms. The general definition of an almost homomorphism f on a group
G written in additive notation requires the set {f (m + n) − f (m) − f (n) :m, n ∈ G} to be finite. In this section we establish a definition that is equivalent for integers: that for all integer m, n we have |f (m+n)−f (m)−f (n)| ≤ L
for some L.
First we extend the standard notation for integers with notation related toslopes. We define slopes as almost homomorphisms on the additive groupof integers. The set of slopes is denoted S . We also define ”positive” slopes
as those that take infinite number of positive values on positive integers.
We write δ(s,m,n) to denote the homomorphism difference of s at m, n (i.ethe expression s(m + n) − s(m) − s(n)). We denote maxδ(s) the maximum
absolute value of homomorphism difference of s as m, n range over integers.
If s is a slope, then the set of homomorphism differences is finite and thismaximum exists. In Group_ZF_3 we define the equivalence relation on almost
homomorphisms using the notion of a quotient group relation and use ”≈” todenote it. As here this symbol seems to be hogged by the standard Isabelle,
we will use ”∼” instead ”≈”. We show in this section that s ∼ r iff for some
L we have |s(m) − r(m)| ≤ L for all integer m. The ”+” denotes the first
operation on almost homomorphisms. For slopes this is addition of functions
defined in the natural way. The ”◦” symbol denotes the second operationon almost homomorphisms (see Group_ZF_3 for definition), defined for thegroup of integers. In short ”◦” is the composition of slopes. The ”−1 ” symbol
acts as an infix operator that assigns the value min{n ∈ Z+ : p ≤ f (n)} to509

a pair (of sets) f and p. In application f represents a function defined on
Z+ and p is a positive integer. We choose this notation because we use
it to construct the right inverse in the ring of classes of slopes and showthat this ring is in fact a field. To study the homomorphism differenceof the function defined by p 7→ f −1 (p) we introduce the symbol ε definedas ε(f, hm, ni) = f −1 (m + n) − f −1 (m) − f −1 (n). Of course the intention
is to use the fact that ε(f, hm, ni) is the homomorphism difference of thefunction g defined as g(m) = f −1 (m). We also define γ(s, m, n) as theexpression δ(f, m, −n) + s(0) − δ(f, n, −n). This is useful because of theidentity f (m − n) = γ(m, n) + f (m) − f (n) that allows to obtain bounds onthe value of a slope at the difference of of two integers. For every integer m
we introduce notation mS defined by mE (n) = m · n. The mapping q 7→ q S
embeds integers into S preserving the order, (that is, maps positive integers
into S + ).
locale int1 = int0 +fixes slopes (S )defines slopes_def[simp]: S ≡ AlmostHoms(ZZ,IntegerAddition)
fixes posslopes (S + )defines posslopes_def[simp]: S + ≡ {s∈S. s(ZZ+ ) ∩ ZZ+ ∈/ Fin(ZZ)}
fixes δdefines δ_def[simp]: δ(s,m,n) ≡ s(m+n)-s(m)-s(n)fixes maxhomdiff (maxδ )defines maxhomdiff_def[simp]:
maxδ(s) ≡ Maximum(IntegerOrder,{abs(δ(s,m,n)). h m,ni ∈ ZZ×ZZ})
fixes AlEqReldefines AlEqRel_def[simp]:
AlEqRel ≡ QuotientGroupRel(S,AlHomOp1(ZZ,IntegerAddition),FinRangeFunctions(ZZ,ZZ))
fixes AlEq (infix ∼ 68)
defines AlEq_def[simp]: s ∼ r ≡ h s,ri ∈ AlEqRel
fixes slope_add (infix + 70)
defines slope_add_def[simp]: s + r ≡fixes slope_comp (infix ◦ 70)
defines slope_comp_def[simp]: s ◦ r ≡s,riAlHomOp1(ZZ,IntegerAddition)h s,ri

AlHomOp2(ZZ,IntegerAddition)hfixes neg (-_ [90] 91)
defines neg_def[simp]: -s ≡ GroupInv(ZZ,IntegerAddition) O s
fixes slope_inv (infix −1 71)

510

defines slope_inv_def[simp]:
f−1 (p) ≡ Minimum(IntegerOrder,{n∈ZZ+ . p ≤ f(n)})
fixes εdefines ε_def[simp]:
ε(f,p) ≡ f−1 (fst(p)+snd(p)) - f−1 (fst(p)) - f−1 (snd(p))
fixes γdefines γ_def[simp]:
γ(s,m,n) ≡ δ(s,m,-n) - δ(s,n,-n) + s(0)fixes intembed (_S )defines intembed_def[simp]: mS ≡ {hn,m·ni. n∈ZZ}

We can use theorems proven in the group1 context.
lemma (in int1) Int_ZF_2_1_L1: shows group1(ZZ,IntegerAddition)using Int_ZF_1_T2 group1_axioms.intro group1_def by simp

Type information related to the homomorphism difference expression.
lemma (in int1) Int_ZF_2_1_L2: assumes f∈S and n∈ZZ m∈ZZ
shows
m+n ∈ ZZf(m+n) ∈ ZZ
f(m) ∈ ZZ
f(n) ∈ ZZ
f(m) + f(n) ∈ ZZ
HomDiff(ZZ,IntegerAddition,f,h m,ni) ∈ ZZ
using assms Int_ZF_2_1_L1 group1.Group_ZF_3_2_L4A
by autoType information related to the homomorphism difference expression.
lemma (in int1) Int_ZF_2_1_L2A:
assumes f:ZZ→ZZ and n∈ZZ m∈ZZ
shows
m+n ∈ ZZf(m+n) ∈ ZZ
f(m) ∈ ZZ
f(n) ∈ ZZ
f(m) + f(n) ∈ ZZ
HomDiff(ZZ,IntegerAddition,f,h m,ni) ∈ ZZ
using assms Int_ZF_2_1_L1 group1.Group_ZF_3_2_L4
by autoSlopes map integers into integers.
lemma (in int1) Int_ZF_2_1_L2B:
assumes A1: f∈S and A2: m∈ZZ
shows f(m) ∈ ZZ
proof from A1 have f:ZZ→ZZ using AlmostHoms_def by simp
with A2 show f(m) ∈ ZZ using apply_funtype by simp
qed

511

The homomorphism difference in multiplicative notation is defined as theexpression s(m · n) · (s(m) · s(n))−1 . The next lemma shows that in the
additive notation used for integers the homomorphism difference is f (m +n) − f (m) − f (n) which we denote as δ(f,m,n).
lemma (in int1) Int_ZF_2_1_L3:
assumes f:ZZ→ZZ and m∈ZZ n∈ZZshows HomDiff(ZZ,IntegerAddition,f,h m,ni) = δ(f,m,n)using assms Int_ZF_2_1_L2A Int_ZF_1_T2 group0.group0_4_L4A
HomDiff_def by auto

The next formula restates the definition of the homomorphism difference toexpress the value an almost homomorphism on a sum.
lemma (in int1) Int_ZF_2_1_L3A:
assumes A1: f∈S and A2: m∈ZZ n∈ZZ
showsf(m+n) = f(m)+(f(n)+δ(f,m,n))
proof from A1 A2 have
T: f(m)∈ ZZ f(n) ∈ ZZ δ(f,m,n) ∈ ZZ and
HomDiff(ZZ,IntegerAddition,f,h m,ni) = δ(f,m,n)using Int_ZF_2_1_L2 AlmostHoms_def Int_ZF_2_1_L3 by autowith A1 A2 show f(m+n) = f(m)+(f(n)+δ(f,m,n))using Int_ZF_2_1_L3 Int_ZF_1_L3
Int_ZF_2_1_L1 group1.Group_ZF_3_4_L1
by simpqed

The homomorphism difference of any integer function is integer.
lemma (in int1) Int_ZF_2_1_L3B:
assumes f:ZZ→ZZ and m∈ZZ n∈ZZshows δ(f,m,n) ∈ ZZ
using assms Int_ZF_2_1_L2A Int_ZF_2_1_L3 by simp

The value of an integer function at a sum expressed in terms of δ .
lemma (in int1) Int_ZF_2_1_L3C: assumes A1: f:ZZ→ZZ and A2: m∈ZZ
shows f(m+n) = δ(f,m,n) + f(n) + f(m)proof from A1 A2 have T:δ(f,m,n) ∈ ZZ f(m+n) ∈ ZZ f(m) ∈ ZZ f(n) ∈ ZZ
using Int_ZF_1_1_L5 apply_funtype by auto
then show f(m+n) = δ(f,m,n) + f(n) + f(m)using Int_ZF_1_2_L15 by simp
qed

n∈ZZ

The next lemma presents two ways the set of homomorphism differences canbe written.
lemma (in int1) Int_ZF_2_1_L4: assumes A1: f:ZZ→ZZ

512

shows {abs(HomDiff(ZZ,IntegerAddition,f,x)). x ∈ ZZ×ZZ} ={abs(δ(f,m,n)). h m,ni ∈ ZZ×ZZ}
proof from A1 have ∀ m∈ZZ. ∀ n∈ZZ.
abs(HomDiff(ZZ,IntegerAddition,f,h m,ni)) = abs(δ(f,m,n))using Int_ZF_2_1_L3 by simp
then show thesis by (rule ZF1_1_L4A)
qed

If f maps integers into integers and for all m, n ∈ Z we have |f (m + n) −f (m) − f (n)| ≤ L for some L, then f is a slope.
lemma (in int1) Int_ZF_2_1_L5: assumes A1: f:ZZ→ZZ
and A2: ∀ m∈ZZ.∀ n∈ZZ. abs(δ(f,m,n)) ≤ Lshows f∈S
proof let Abs = AbsoluteValue(ZZ,IntegerAddition,IntegerOrder)
have group3(ZZ,IntegerAddition,IntegerOrder)
IntegerOrder {is total on} ZZ
using Int_ZF_2_T1 by auto
moreover from A1 A2 have
∀ x∈ZZ×ZZ. HomDiff(ZZ,IntegerAddition,f,x) ∈ ZZ ∧hAbs(HomDiff(ZZ,IntegerAddition,f,x)),L i ∈ IntegerOrderusing Int_ZF_2_1_L2A Int_ZF_2_1_L3 by auto
ultimately have
IsBounded({HomDiff(ZZ,IntegerAddition,f,x). x∈ZZ×ZZ},IntegerOrder)by (rule group3.OrderedGroup_ZF_3_L9A)
with A1 show f ∈ S using Int_bounded_iff_fin AlmostHoms_def
by simpqed

The absolute value of homomorphism difference of a slope s does not exceedmaxδ(s).
lemma (in int1) Int_ZF_2_1_L7:
assumes A1: s∈S and A2: n∈ZZ m∈ZZ
showsabs(δ(s,m,n)) ≤ maxδ(s)δ(s,m,n) ∈ ZZ
maxδ(s) ∈ ZZ(-maxδ(s)) ≤ δ(s,m,n)
proof from A1 A2 show T: δ(s,m,n) ∈ ZZ
using Int_ZF_2_1_L2 Int_ZF_1_1_L5 by simp
let A = {abs(HomDiff(ZZ,IntegerAddition,s,x)). x∈ZZ×ZZ}
let B = {abs(δ(s,m,n)). h m,ni ∈ ZZ×ZZ}
let d = abs(δ(s,m,n))have IsLinOrder(ZZ,IntegerOrder) using Int_ZF_2_T1
by simpmoreover have A ∈ Fin(ZZ)
proof have ∀ k∈ZZ. abs(k) ∈ ZZ using Int_ZF_2_L14 by simp

513

moreover from A1 have
{HomDiff(ZZ,IntegerAddition,s,x). x ∈ ZZ×ZZ} ∈ Fin(ZZ)
using AlmostHoms_def by simp
ultimately show A ∈ Fin(ZZ) by (rule Finite1_L6C)
qed
moreover have A6=0 by auto
ultimately have ∀ k∈A. hk,Maximum(IntegerOrder,A)i ∈ IntegerOrderby (rule Finite_ZF_1_T2)
moreover from A1 A2 have d∈A using AlmostHoms_def Int_ZF_2_1_L4
by autoultimately have d ≤ Maximum(IntegerOrder,A) by autowith A1 show d ≤ maxδ(s) maxδ(s) ∈ ZZ
using AlmostHoms_def Int_ZF_2_1_L4 Int_ZF_2_L1A
by autowith T show (-maxδ(s)) ≤ δ(s,m,n)using Int_ZF_1_3_L19 by simp
qed

A useful estimate for the value of a slope at 0, plus some type information
for slopes.
lemma (in int1) Int_ZF_2_1_L8: assumes A1: s∈Sshowsabs(s(0)) ≤ maxδ(s)0 ≤ maxδ(s)abs(s(0)) ∈ ZZ
maxδ(s) ∈ ZZ
abs(s(0)) + maxδ(s) ∈ ZZ
proof from A1 have s(0) ∈ ZZ
using int_zero_one_are_int Int_ZF_2_1_L2B by simp
then have I: 0 ≤ abs(s(0))
and abs(δ(s,0,0)) = abs(s(0))
using int_abs_nonneg int_zero_one_are_int Int_ZF_1_1_L4
Int_ZF_2_L17 by auto
moreover from A1 have abs(δ(s,0,0)) ≤ maxδ(s)using int_zero_one_are_int Int_ZF_2_1_L7 by simp
ultimately show II: abs(s(0)) ≤ maxδ(s)by simpwith I show 0≤maxδ(s) by (rule Int_order_transitive)
with II showmaxδ(s) ∈ ZZ
abs(s(0)) ∈ ZZ
abs(s(0)) + maxδ(s) ∈ ZZ
using Int_ZF_2_L1A Int_ZF_1_1_L5 by autoqed

Int Group_ZF_3.thy we show that finite range functions valued in an abeliangroup form a normal subgroup of almost homomorphisms. This allows to
define the equivalence relation between almost homomorphisms as the relation resulting from dividing by that normal subgroup. Then we show inGroup_ZF_3_4_L12 that if the difference of f and g has finite range (actually514

f (n) · g(n)−1 as we use multiplicative notation in Group_ZF_3.thy), then f
and g are equivalent. The next lemma translates that fact into the notation
used in int1 context.
lemma (in int1) Int_ZF_2_1_L9: assumes A1: s∈S r∈S
and A2: ∀ m∈ZZ. abs(s(m)-r(m)) ≤ Lshows s ∼ r
proof from A1 A2 have
∀ m∈ZZ. s(m)-r(m) ∈ ZZ ∧ abs(s(m)-r(m)) ≤ Lusing Int_ZF_2_1_L2B Int_ZF_1_1_L5 by simp
then have
IsBounded({s(n)-r(n). n∈ZZ}, IntegerOrder)by (rule Int_ZF_1_3_L20)
with A1 show s ∼ r using Int_bounded_iff_fin
Int_ZF_2_1_L1 group1.Group_ZF_3_4_L12 by simp
qed

A neccessary condition for two slopes to be almost equal. For slopes thedefinition postulates the set {f (m) − g(m) : m ∈ Z} to be finite. Thislemma shows that this implies that |f (m) − g(m)| is bounded (by some
integer) as m varies over integers. We also mention here that in this contexts ∼ r implies that both s and r are slopes.
lemma (in int1) Int_ZF_2_1_L9A: assumes s ∼ rshows∃ L∈ZZ. ∀ m∈ZZ. abs(s(m)-r(m)) ≤ L
s∈S r∈S
using assms Int_ZF_2_1_L1 group1.Group_ZF_3_4_L11
Int_ZF_1_3_L20AA QuotientGroupRel_def by auto

Let’s recall that the relation of almost equality is an equivalence relation on
the set of slopes.
lemma (in int1) Int_ZF_2_1_L9B: shows
AlEqRel ⊆ S×S
equiv(S,AlEqRel)using Int_ZF_2_1_L1 group1.Group_ZF_3_3_L3 by auto

Another version of sufficient condition for two slopes to be almost equal: if
the difference of two slopes is a finite range function, then they are almost
equal.
lemma (in int1) Int_ZF_2_1_L9C: assumes s∈S r∈S ands + (-r) ∈ FinRangeFunctions(ZZ,ZZ)
shows
s ∼ r
r ∼ s
using assms Int_ZF_2_1_L1
group1.Group_ZF_3_2_L13 group1.Group_ZF_3_4_L12A
by auto515

If two slopes are almost equal, then the difference has finite range. This is
the inverse of Int_ZF_2_1_L9C.
lemma (in int1) Int_ZF_2_1_L9D: assumes A1: s ∼ rshows s + (-r) ∈ FinRangeFunctions(ZZ,ZZ)
proof let G = ZZ
let f = IntegerAddition
from A1 have AlHomOp1(G, f)hs,GroupInv(AlmostHoms(G, f),AlHomOp1(G,f))(r)i∈ FinRangeFunctions(G, G)
using Int_ZF_2_1_L1 group1.Group_ZF_3_4_L12B by autowith A1 show s + (-r) ∈ FinRangeFunctions(ZZ,ZZ)
using Int_ZF_2_1_L9A Int_ZF_2_1_L1 group1.Group_ZF_3_2_L13
by simpqed

What is the value of a composition of slopes?
lemma (in int1) Int_ZF_2_1_L10:
assumes s∈S r∈S and m∈ZZ
shows (s◦r)(m) = s(r(m)) s(r(m)) ∈ ZZ
using assms Int_ZF_2_1_L1 group1.Group_ZF_3_4_L2 by auto

Composition of slopes is a slope.
lemma (in int1) Int_ZF_2_1_L11:
assumes s∈S r∈Sshows s◦r ∈ Susing assms Int_ZF_2_1_L1 group1.Group_ZF_3_4_T1 by simp

Negative of a slope is a slope.
lemma (in int1) Int_ZF_2_1_L12: assumes s∈S shows -s ∈ Susing assms Int_ZF_1_T2 Int_ZF_2_1_L1 group1.Group_ZF_3_2_L13
by simp

What is the value of a negative of a slope?
lemma (in int1) Int_ZF_2_1_L12A:
assumes s∈S and m∈ZZ shows (-s)(m) = -(s(m))
using assms Int_ZF_2_1_L1 group1.Group_ZF_3_2_L5
by simp

What are the values of a sum of slopes?
lemma (in int1) Int_ZF_2_1_L12B: assumes s∈S r∈S and m∈ZZ
shows (s+r)(m) = s(m) + r(m)using assms Int_ZF_2_1_L1 group1.Group_ZF_3_2_L12
by simpSum of slopes is a slope.
lemma (in int1) Int_ZF_2_1_L12C: assumes s∈S

516

r∈S

shows s+r ∈ Susing assms Int_ZF_2_1_L1 group1.Group_ZF_3_2_L16
by simp

A simple but useful identity.
lemma (in int1) Int_ZF_2_1_L13:
assumes s∈S and n∈ZZ m∈ZZ
shows s(n·m) + (s(m) + δ(s,n·m,m)) = s((n+1)·m)
using assms Int_ZF_1_1_L5 Int_ZF_2_1_L2B Int_ZF_1_2_L9 Int_ZF_1_2_L7
by simp

Some estimates for the absolute value of a slope at the opposite integer.
lemma (in int1) Int_ZF_2_1_L14: assumes A1: s∈S and A2: m∈ZZ
showss(-m) = s(0) - δ(s,m,-m) - s(m)abs(s(m)+s(-m)) ≤ 2·maxδ(s)abs(s(-m)) ≤ 2·maxδ(s) + abs(s(m))s(-m) ≤ abs(s(0)) + maxδ(s) - s(m)proof from A1 A2 have T:(-m) ∈ ZZ abs(s(m)) ∈ ZZ s(0) ∈ ZZ abs(s(0)) ∈ ZZ
δ(s,m,-m) ∈ ZZ
s(m) ∈ ZZ
s(-m) ∈ ZZ(-(s(m))) ∈ ZZ s(0) - δ(s,m,-m) ∈ ZZ
using Int_ZF_1_1_L4 Int_ZF_2_1_L2B Int_ZF_2_L14 Int_ZF_2_1_L2
Int_ZF_1_1_L5 int_zero_one_are_int by autowith A2 show I: s(-m) = s(0) - δ(s,m,-m) - s(m)using Int_ZF_1_1_L4 Int_ZF_1_2_L15 by simp
from T have abs(s(0) - δ(s,m,-m)) ≤ abs(s(0)) + abs(δ(s,m,-m))using Int_triangle_ineq1 by simp
moreover from A1 A2 T have abs(s(0)) + abs(δ(s,m,-m)) ≤ 2·maxδ(s)using Int_ZF_2_1_L7 Int_ZF_2_1_L8 Int_ZF_1_3_L21 by simp
ultimately have abs(s(0) - δ(s,m,-m)) ≤ 2·maxδ(s)by (rule Int_order_transitive)
moreoverfrom I have s(m) + s(-m) = s(m) + (s(0) - δ(s,m,-m) - s(m))
by simpwith T have abs(s(m) + s(-m)) = abs(s(0) - δ(s,m,-m))using Int_ZF_1_2_L3 by simp
ultimately show abs(s(m)+s(-m)) ≤ 2·maxδ(s)by simpfrom I have abs(s(-m)) = abs(s(0) - δ(s,m,-m) - s(m))
by simpwith T haveabs(s(-m)) ≤ abs(s(0)) + abs(δ(s,m,-m)) + abs(s(m))
using int_triangle_ineq3 by simp
moreover from A1 A2 T haveabs(s(0)) + abs(δ(s,m,-m)) + abs(s(m)) ≤ 2·maxδ(s) + abs(s(m))
using Int_ZF_2_1_L7 Int_ZF_2_1_L8 Int_ZF_1_3_L21 int_ord_transl_inv
by simp517

ultimately show abs(s(-m)) ≤ 2·maxδ(s) + abs(s(m))
by (rule Int_order_transitive)
from T have s(0) - δ(s,m,-m) ≤ abs(s(0)) + abs(δ(s,m,-m))using Int_ZF_2_L15E by simp
moreover from A1 A2 T haveabs(s(0)) + abs(δ(s,m,-m)) ≤ abs(s(0)) + maxδ(s)using Int_ZF_2_1_L7 int_ord_transl_inv by simp
ultimately have s(0) - δ(s,m,-m) ≤ abs(s(0)) + maxδ(s)by (rule Int_order_transitive)
with T haves(0) - δ(s,m,-m) - s(m) ≤ abs(s(0)) + maxδ(s) - s(m)using int_ord_transl_inv by simp
with I show s(-m) ≤ abs(s(0)) + maxδ(s) - s(m)by simpqed

An identity that expresses the value of an integer function at the opposite
integer in terms of the value of that function at the integer, zero, and thehomomorphism difference. We have a similar identity in Int_ZF_2_1_L14,
but over there we assume that f is a slope.
lemma (in int1) Int_ZF_2_1_L14A: assumes A1: f:ZZ→ZZ and A2: m∈ZZ
shows f(-m) = (-δ(f,m,-m)) + f(0) - f(m)proof from A1 A2 have T:
f(-m) ∈ ZZ δ(f,m,-m) ∈ ZZ f(0) ∈ ZZ f(m) ∈ ZZ
using Int_ZF_1_1_L4 Int_ZF_1_1_L5 int_zero_one_are_int apply_funtype
by autowith A2 show f(-m) = (-δ(f,m,-m)) + f(0) - f(m)using Int_ZF_1_1_L4 Int_ZF_1_2_L15 by simp
qed

The next lemma allows to use the expression maxf(f,0..M-1). Recall thatmaxf(f,A) is the maximum of (function) f on (the set) A.
lemma (in int1) Int_ZF_2_1_L15:
assumes s∈S and M ∈ ZZ+
shows
maxf(s,0..(M-1)) ∈ ZZ
∀ n ∈ 0..(M-1). s(n) ≤ maxf(s,0..(M-1))
minf(s,0..(M-1)) ∈ ZZ
∀ n ∈ 0..(M-1). minf(s,0..(M-1)) ≤ s(n)using assms AlmostHoms_def Int_ZF_1_5_L6 Int_ZF_1_4_L2
by autoA lower estimate for the value of a slope at nM + k.
lemma (in int1) Int_ZF_2_1_L16:
assumes A1: s∈S and A2: m∈ZZ and A3: M ∈ ZZ+ and A4: k ∈ 0..(M-1)
shows s(m·M) + (minf(s,0..(M-1))- maxδ(s)) ≤ s(m·M+k)518

proof from A3 have 0..(M-1) ⊆ ZZ
using Int_ZF_1_5_L6 by simp
with A1 A2 A3 A4 have T: m·M ∈ ZZ
k ∈ ZZ s(m·M) ∈ ZZ
using PositiveSet_def Int_ZF_1_1_L5 Int_ZF_2_1_L2B
by autowith A1 A3 A4 haves(m·M) + (minf(s,0..(M-1)) - maxδ(s)) ≤ s(m·M) + (s(k) + δ(s,m·M,k))using Int_ZF_2_1_L15 Int_ZF_2_1_L7 int_ineq_add_sides int_ord_transl_inv
by simpwith A1 T show thesis using Int_ZF_2_1_L3A by simp
qed

Identity is a slope.
lemma (in int1) Int_ZF_2_1_L17: shows id(ZZ) ∈ S
using Int_ZF_2_1_L1 group1.Group_ZF_3_4_L15 by simp

Simple identities about (absolute value of) homomorphism differences.
lemma (in int1) Int_ZF_2_1_L18:
assumes A1: f:ZZ→ZZ and A2: m∈ZZ n∈ZZ
showsabs(f(n) + f(m) - f(m+n)) = abs(δ(f,m,n))abs(f(m) + f(n) - f(m+n)) = abs(δ(f,m,n))(-(f(m))) - f(n) + f(m+n) = δ(f,m,n)(-(f(n))) - f(m) + f(m+n) = δ(f,m,n)abs((-f(m+n)) + f(m) + f(n)) = abs(δ(f,m,n))
proof from A1 A2 have T:
f(m+n) ∈ ZZ f(m) ∈ ZZ f(n) ∈ ZZ
f(m+n) - f(m) - f(n) ∈ ZZ(-(f(m))) ∈ ZZ(-f(m+n)) + f(m) + f(n) ∈ ZZ
using apply_funtype Int_ZF_1_1_L4 Int_ZF_1_1_L5 by auto
then haveabs(-(f(m+n) - f(m) - f(n))) = abs(f(m+n) - f(m) - f(n))
using Int_ZF_2_L17 by simp
moreover from T have(-(f(m+n) - f(m) - f(n))) = f(n) + f(m) - f(m+n)
using Int_ZF_1_2_L9A by simp
ultimately show abs(f(n) + f(m) - f(m+n)) = abs(δ(f,m,n))by simpmoreover from T have f(n) + f(m) = f(m) + f(n)using Int_ZF_1_1_L5 by simp
ultimately show abs(f(m) + f(n) - f(m+n)) = abs(δ(f,m,n))by simpfrom T show(-(f(m))) - f(n) + f(m+n) = δ(f,m,n)(-(f(n))) - f(m) + f(m+n) = δ(f,m,n)using Int_ZF_1_2_L9 by auto

519

from T haveabs((-f(m+n)) + f(m) + f(n)) =abs(-((-f(m+n)) + f(m) + f(n)))
using Int_ZF_2_L17 by simp
also from T haveabs(-((-f(m+n)) + f(m) + f(n))) = abs(δ(f,m,n))using Int_ZF_1_2_L9 by simp
finally show abs((-f(m+n)) + f(m) + f(n)) = abs(δ(f,m,n))by simpqed

Some identities about the homomorphism difference of odd functions.
lemma (in int1) Int_ZF_2_1_L19:
assumes A1: f:ZZ→ZZ and A2: ∀ x∈ZZ. (-f(-x)) = f(x)and A3: m∈ZZ n∈ZZ
showsabs(δ(f,-m,m+n)) = abs(δ(f,m,n))abs(δ(f,-n,m+n)) = abs(δ(f,m,n))δ(f,n,-(m+n)) = δ(f,m,n)δ(f,m,-(m+n)) = δ(f,m,n)abs(δ(f,-m,-n)) = abs(δ(f,m,n))
proof from A1 A2 A3 showabs(δ(f,-m,m+n)) = abs(δ(f,m,n))abs(δ(f,-n,m+n)) = abs(δ(f,m,n))using Int_ZF_1_2_L3 Int_ZF_2_1_L18 by autofrom A3 have T: m+n ∈ ZZ using Int_ZF_1_1_L5 by simp
from A1 A2 have I: ∀ x∈ZZ. f(-x) = (-f(x))
using Int_ZF_1_5_L13 by simp
with A1 A2 A3 T showδ(f,n,-(m+n)) = δ(f,m,n)δ(f,m,-(m+n)) = δ(f,m,n)using Int_ZF_1_2_L3 Int_ZF_2_1_L18 by autofrom A3 haveabs(δ(f,-m,-n)) = abs(f(-(m+n)) - f(-m) - f(-n))
using Int_ZF_1_1_L5 by simp
also from A1 A2 A3 T I have . . . = abs(δ(f,m,n))using Int_ZF_2_1_L18 by simp
finally show abs(δ(f,-m,-n)) = abs(δ(f,m,n)) by simp
qed

Recall that f is a slope iff f (m + n) − f (m) − f (n) is bounded as m, n ranges
over integers. The next lemma is the first step in showing that we only needto check this condition as m, n ranges over positive intergers. Namely weshow that if the condition holds for positive integers, then it holds if one
integer is positive and the second one is nonnegative.
lemma (in int1) Int_ZF_2_1_L20: assumes A1: f:ZZ→ZZ andA2: ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ L andA3: m∈ZZ+ n∈ZZ+

520

shows0 ≤ L
abs(δ(f,m,n)) ≤ L + abs(f(0))
proof from A1 A2 haveδ(f,1,1) ∈ ZZ and abs(δ(f,1,1)) ≤ Lusing int_one_two_are_pos PositiveSet_def Int_ZF_2_1_L3B
by autothen show I: 0 ≤ L using Int_ZF_1_3_L19 by simp
from A1 A3 have T:n ∈ ZZ f(n) ∈ ZZ f(0) ∈ ZZ
δ(f,m,n) ∈ ZZ abs(δ(f,m,n)) ∈ ZZ
using PositiveSet_def int_zero_one_are_int apply_funtype
Nonnegative_def Int_ZF_2_1_L3B Int_ZF_2_L14 by autofrom A3 have m=0 ∨ m∈ZZ+ using Int_ZF_1_5_L3A by auto
moreover{ assume m = 0
with T I have abs(δ(f,m,n)) ≤ L + abs(f(0))
using Int_ZF_1_1_L4 Int_ZF_1_2_L3 Int_ZF_2_L17
int_ord_is_refl refl_def Int_ZF_2_L15F by simp }moreover{ assume m∈ZZ+
with A2 A3 T have abs(δ(f,m,n)) ≤ L + abs(f(0))
using int_abs_nonneg Int_ZF_2_L15F by simp }ultimately show abs(δ(f,m,n)) ≤ L + abs(f(0))
by autoqed

If the slope condition holds for all pairs of integers such that one integer ispositive and the second one is nonnegative, then it holds when both integers
are nonnegative.
lemma (in int1) Int_ZF_2_1_L21: assumes A1: f:ZZ→ZZ andA2: ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ L andA3: n∈ZZ+ m∈ZZ+
shows abs(δ(f,m,n)) ≤ L + abs(f(0))
proof from A1 A2 haveδ(f,1,1) ∈ ZZ and abs(δ(f,1,1)) ≤ Lusing int_one_two_are_pos PositiveSet_def Nonnegative_def Int_ZF_2_1_L3B
by autothen have I: 0 ≤ L using Int_ZF_1_3_L19 by simp
from A1 A3 have T:m ∈ ZZ f(m) ∈ ZZ f(0) ∈ ZZ (-f(0)) ∈ ZZ
δ(f,m,n) ∈ ZZ abs(δ(f,m,n)) ∈ ZZ
using int_zero_one_are_int apply_funtype Nonnegative_def
Int_ZF_2_1_L3B Int_ZF_2_L14 Int_ZF_1_1_L4 by autofrom A3 have n=0 ∨ n∈ZZ+ using Int_ZF_1_5_L3A by auto
moreover{ assume n=0521

with T have δ(f,m,n) = -f(0)using Int_ZF_1_1_L4 by simp
with T have abs(δ(f,m,n)) = abs(f(0))
using Int_ZF_2_L17 by simp
with T have abs(δ(f,m,n)) ≤ abs(f(0))
using int_ord_is_refl refl_def by simp
with T I have abs(δ(f,m,n)) ≤ L + abs(f(0))
using Int_ZF_2_L15F by simp }moreover{ assume n∈ZZ+with A2 A3 T have abs(δ(f,m,n)) ≤ L + abs(f(0))
using int_abs_nonneg Int_ZF_2_L15F by simp }ultimately show abs(δ(f,m,n)) ≤ L + abs(f(0))
by autoqed

If the homomorphism difference is bounded on ZZ+ ×ZZ+ , then it is boundedon ZZ+ ×ZZ+ .
lemma (in int1) Int_ZF_2_1_L22: assumes A1: f:ZZ→ZZ andA2: ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ Lshows ∃ M. ∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(f,m,n)) ≤ M
proof from A1 A2 have
∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(f,m,n)) ≤ L + abs(f(0)) + abs(f(0))
using Int_ZF_2_1_L20 Int_ZF_2_1_L21 by simp
then show thesis by autoqed

For odd functions we can do better than in Int_ZF_2_1_L22: if the homomorphism difference of f is bounded on ZZ+ ×ZZ+ , then it is bounded on ZZ×ZZ,
hence f is a slope. Loong prof by splitting the ZZ×ZZ into six subsets.
lemma (in int1) Int_ZF_2_1_L23: assumes A1: f:ZZ→ZZ andA2: ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ L
and A3: ∀ x∈ZZ. (-f(-x)) = f(x)shows f∈S
proof from A1 A2 have
∃ M.∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ M
by (rule Int_ZF_2_1_L22)
then obtain M where I: ∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(f,m,n)) ≤ M
by auto{ fix a b assume A4: a∈ZZ b∈ZZ
then have0≤a ∧ 0≤b ∨ a≤0 ∧ b≤0 ∨a≤0 ∧ 0≤b ∧ 0 ≤ a+b ∨ a≤0 ∧ 0≤b ∧ a+b ≤ 0 ∨0≤a ∧ b≤0 ∧ 0 ≤ a+b ∨ 0≤a ∧ b≤0 ∧ a+b ≤ 0
using int_plane_split_in6 by simp
moreover{ assume 0≤a ∧ 0≤b

522

then have a∈ZZ+ b∈ZZ+
using Int_ZF_2_L16 by autowith I have abs(δ(f,a,b)) ≤ M by simp }moreover{ assume a≤0 ∧ b≤0
with I have abs(δ(f,-a,-b)) ≤ M
using Int_ZF_2_L10A Int_ZF_2_L16 by simp
with A1 A3 A4 have abs(δ(f,a,b)) ≤ M
using Int_ZF_2_1_L19 by simp }moreover{ assume a≤0 ∧ 0≤b ∧ 0 ≤ a+b
with I have abs(δ(f,-a,a+b)) ≤ M
using Int_ZF_2_L10A Int_ZF_2_L16 by simp
with A1 A3 A4 have abs(δ(f,a,b)) ≤ M
using Int_ZF_2_1_L19 by simp }moreover{ assume a≤0 ∧ 0≤b ∧ a+b ≤ 0with I have abs(δ(f,b,-(a+b))) ≤ M
using Int_ZF_2_L10A Int_ZF_2_L16 by simp
with A1 A3 A4 have abs(δ(f,a,b)) ≤ M
using Int_ZF_2_1_L19 by simp }moreover{ assume 0≤a ∧ b≤0 ∧ 0 ≤ a+b
with I have abs(δ(f,-b,a+b)) ≤ M
using Int_ZF_2_L10A Int_ZF_2_L16 by simp
with A1 A3 A4 have abs(δ(f,a,b)) ≤ M
using Int_ZF_2_1_L19 by simp }moreover{ assume 0≤a ∧ b≤0 ∧ a+b ≤ 0with I have abs(δ(f,a,-(a+b))) ≤ M
using Int_ZF_2_L10A Int_ZF_2_L16 by simp
with A1 A3 A4 have abs(δ(f,a,b)) ≤ M
using Int_ZF_2_1_L19 by simp }ultimately have abs(δ(f,a,b)) ≤ M by auto }then have ∀ m∈ZZ. ∀ n∈ZZ. abs(δ(f,m,n)) ≤ M by simp
with A1 show f∈S by (rule Int_ZF_2_1_L5)
qed

If the homomorphism difference of a function defined on positive integers isbounded, then the odd extension of this function is a slope.
lemma (in int1) Int_ZF_2_1_L24:
assumes A1: f:ZZ+ →ZZ and A2: ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ Lshows OddExtension(ZZ,IntegerAddition,IntegerOrder,f) ∈ S
proof let g = OddExtension(ZZ,IntegerAddition,IntegerOrder,f)from A1 have g : ZZ→ZZ
using Int_ZF_1_5_L10 by simp
moreover have ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(g,a,b)) ≤ L
proof -523

{ fix a b assume A3: a∈ZZ+ b∈ZZ+
with A1 have abs(δ(f,a,b)) = abs(δ(g,a,b))
using pos_int_closed_add_unfolded Int_ZF_1_5_L11
by simpmoreover from A2 A3 have abs(δ(f,a,b)) ≤ L by simp
ultimately have abs(δ(g,a,b)) ≤ L by simp
} then show thesis by simp
qed
moreover from A1 have ∀ x∈ZZ. (-g(-x)) = g(x)using int_oddext_is_odd_alt by simp
ultimately show g ∈ S by (rule Int_ZF_2_1_L23)
qed

Type information related to γ.
lemma (in int1) Int_ZF_2_1_L25:
assumes A1: f:ZZ→ZZ and A2: m∈ZZ n∈ZZ
shows
δ(f,m,-n) ∈ ZZ
δ(f,n,-n) ∈ ZZ(-δ(f,n,-n)) ∈ ZZ
f(0) ∈ ZZ
γ(f,m,n) ∈ ZZ
proof from A1 A2 show T1:
δ(f,m,-n) ∈ ZZ f(0) ∈ ZZ
using Int_ZF_1_1_L4 Int_ZF_2_1_L3B int_zero_one_are_int apply_funtype
by autofrom A2 have (-n) ∈ ZZ
using Int_ZF_1_1_L4 by simp
with A1 A2 show δ(f,n,-n) ∈ ZZ
using Int_ZF_2_1_L3B by simp
then show (-δ(f,n,-n)) ∈ ZZ
using Int_ZF_1_1_L4 by simp
with T1 show γ(f,m,n) ∈ ZZ
using Int_ZF_1_1_L5 by simpqed

A couple of formulae involving f (m − n) and γ(f, m, n).
lemma (in int1) Int_ZF_2_1_L26:
assumes A1: f:ZZ→ZZ and A2: m∈ZZ n∈ZZ
showsf(m-n) = γ(f,m,n) + f(m) - f(n)f(m-n) = γ(f,m,n) + (f(m) - f(n))
f(m-n) + (f(n) - γ(f,m,n)) = f(m)proof from A1 A2 have T:(-n) ∈ ZZ δ(f,m,-n) ∈ ZZ
f(0) ∈ ZZ f(m) ∈ ZZ f(n) ∈ ZZ (-f(n)) ∈ ZZ(-δ(f,n,-n)) ∈ ZZ

524

(-δ(f,n,-n)) + f(0) ∈ ZZ
γ(f,m,n) ∈ ZZ
using Int_ZF_1_1_L4 Int_ZF_2_1_L25 apply_funtype Int_ZF_1_1_L5
by autowith A1 A2 have f(m-n) =δ(f,m,-n) + ((-δ(f,n,-n)) + f(0) - f(n)) + f(m)using Int_ZF_2_1_L3C Int_ZF_2_1_L14A by simp
with T have f(m-n) =δ(f,m,-n) + ((-δ(f,n,-n)) + f(0)) + f(m) - f(n)using Int_ZF_1_2_L16 by simp
moreover from T haveδ(f,m,-n) + ((-δ(f,n,-n)) + f(0)) = γ(f,m,n)using Int_ZF_1_1_L7 by simp
ultimately show I: f(m-n) = γ(f,m,n) + f(m) - f(n)by simpthen have f(m-n) + (f(n) - γ(f,m,n)) =(γ(f,m,n) + f(m) - f(n)) + (f(n) - γ(f,m,n))by simpmoreover from T have . . . = f(m) using Int_ZF_1_2_L18
by simpultimately show f(m-n) + (f(n) - γ(f,m,n)) = f(m)by simpfrom T have γ(f,m,n) ∈ ZZ f(m) ∈ ZZ (-f(n)) ∈ ZZ
by autothen haveγ(f,m,n) + f(m) + (-f(n)) = γ(f,m,n) + (f(m) + (-f(n)))
by (rule Int_ZF_1_1_L7)
with I show f(m-n) = γ(f,m,n) + (f(m) - f(n)) by simp
qed

A formula expressing the difference between f (m − n − k) and f (m) − f (n) −f (k) in terms of γ.
lemma (in int1) Int_ZF_2_1_L26A:
assumes A1: f:ZZ→ZZ and A2: m∈ZZ n∈ZZ k∈ZZ
showsf(m-n-k) - (f(m)- f(n) - f(k)) = γ(f,m-n,k) + γ(f,m,n)
proof from A1 A2 have
T: m-n ∈ ZZ γ(f,m-n,k) ∈ ZZ f(m) - f(n) - f(k) ∈ ZZ and
T1: γ(f,m,n) ∈ ZZ f(m) - f(n) ∈ ZZ (-f(k)) ∈ ZZ
using Int_ZF_1_1_L4 Int_ZF_1_1_L5 Int_ZF_2_1_L25 apply_funtype
by autofrom A1 A2 havef(m-n) - f(k) = γ(f,m,n) + (f(m) - f(n)) + (-f(k))
using Int_ZF_2_1_L26 by simp
also from T1 have . . . = γ(f,m,n) + (f(m) - f(n) + (-f(k)))
by (rule Int_ZF_1_1_L7)
finally havef(m-n) - f(k) = γ(f,m,n) + (f(m) - f(n) - f(k))

525

by simp
moreover from A1 A2 T havef(m-n-k) = γ(f,m-n,k) + (f(m-n)-f(k))
using Int_ZF_2_1_L26 by simp
ultimately havef(m-n-k) - (f(m)- f(n) - f(k)) =γ(f,m-n,k) + ( γ(f,m,n) + (f(m) - f(n) - f(k)))- (f(m)- f(n) - f(k))
by simpwith T T1 show thesis
using Int_ZF_1_2_L17 by simp
qed

If s is a slope, then γ(s, m, n) is uniformly bounded.
lemma (in int1) Int_ZF_2_1_L27: assumes A1: s∈Sshows ∃ L∈ZZ. ∀ m∈ZZ.∀ n∈ZZ. abs(γ(s,m,n)) ≤ L
proof let L = maxδ(s) + maxδ(s) + abs(s(0))
from A1 have T:
maxδ(s) ∈ ZZ abs(s(0)) ∈ ZZ L ∈ ZZ
using Int_ZF_2_1_L8 int_zero_one_are_int Int_ZF_2_1_L2B
Int_ZF_2_L14 Int_ZF_1_1_L5 by auto
moreover{ fix mfix nassume A2: m∈ZZ n∈ZZwith A1 have T:(-n) ∈ ZZ
δ(s,m,-n) ∈ ZZ
δ(s,n,-n) ∈ ZZ(-δ(s,n,-n)) ∈ ZZ
s(0) ∈ ZZ abs(s(0)) ∈ ZZ
using Int_ZF_1_1_L4 AlmostHoms_def Int_ZF_2_1_L25 Int_ZF_2_L14
by autowith T haveabs(δ(s,m,-n) - δ(s,n,-n) + s(0)) ≤abs(δ(s,m,-n)) + abs(-δ(s,n,-n)) + abs(s(0))
using Int_triangle_ineq3 by simp
moreover from A1 A2 T haveabs(δ(s,m,-n)) + abs(-δ(s,n,-n)) + abs(s(0)) ≤ Lusing Int_ZF_2_1_L7 int_ineq_add_sides int_ord_transl_inv Int_ZF_2_L17
by simpultimately have abs(δ(s,m,-n) - δ(s,n,-n) + s(0)) ≤ L
by (rule Int_order_transitive)then have abs(γ(s,m,n)) ≤ L by simp }ultimately show ∃ L∈ZZ. ∀ m∈ZZ.∀ n∈ZZ. abs(γ(s,m,n)) ≤ L
by autoqed

If s is a slope, then s(m) ≤ s(m − 1) + M , where L does not depend on m.
526

lemma (in int1) Int_ZF_2_1_L28: assumes A1: s∈Sshows ∃ M∈ZZ. ∀ m∈ZZ. s(m) ≤ s(m-1) + M
proof from A1 have
∃ L∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.abs(γ(s,m,n)) ≤ Lusing Int_ZF_2_1_L27 by simp
then obtain L where T: L∈ZZ and ∀ m∈ZZ.∀ n∈ZZ.abs(γ(s,m,n)) ≤ Lusing Int_ZF_2_1_L27 by auto
then have I: ∀ m∈ZZ.abs(γ(s,m,1)) ≤ Lusing int_zero_one_are_int by simp
let M = s(1) + Lfrom A1 T have M ∈ ZZ
using int_zero_one_are_int Int_ZF_2_1_L2B Int_ZF_1_1_L5
by simpmoreover{ fix m assume A2: m∈ZZ
with A1 haveT1: s:ZZ→ZZ m∈ZZ 1∈ZZ and
T2: γ(s,m,1) ∈ ZZ s(1) ∈ ZZ
using int_zero_one_are_int AlmostHoms_def
Int_ZF_2_1_L25 by autofrom A2 T1 have T3: s(m-1) ∈ ZZ
using Int_ZF_1_1_L5 apply_funtype by simp
from I A2 T2 have(-γ(s,m,1)) ≤ abs(γ(s,m,1))abs(γ(s,m,1)) ≤ Lusing Int_ZF_2_L19C by auto
then have (-γ(s,m,1)) ≤ L
by (rule Int_order_transitive)
with T2 T3 haves(m-1) + (s(1) - γ(s,m,1)) ≤ s(m-1) + M
using int_ord_transl_inv by simp
moreover from T1 haves(m-1) + (s(1) - γ(s,m,1)) = s(m)by (rule Int_ZF_2_1_L26)
ultimately have s(m) ≤ s(m-1) + M by simp }ultimately show ∃ M∈ZZ. ∀ m∈ZZ. s(m) ≤ s(m-1) + M
by autoqed

If s is a slope, then the difference between s(m−n−k) and s(m)−s(n)−s(k)is uniformly bounded.
lemma (in int1) Int_ZF_2_1_L29: assumes A1: s∈Sshows∃ M∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. abs(s(m-n-k) - (s(m)-s(n)-s(k))) ≤M
proof from A1 have ∃ L∈ZZ. ∀ m∈ZZ.∀ n∈ZZ. abs(γ(s,m,n)) ≤ Lusing Int_ZF_2_1_L27 by simp
then obtain L where I: L∈ZZ and527

II: ∀ m∈ZZ.∀ n∈ZZ. abs(γ(s,m,n)) ≤ L
by autofrom I have L+L ∈ ZZ
using Int_ZF_1_1_L5 by simp
moreover{ fix m n k assume A2: m∈ZZ n∈ZZ k∈ZZ
with A1 have T:
m-n ∈ ZZ γ(s,m-n,k) ∈ ZZ γ(s,m,n) ∈ ZZ
using Int_ZF_1_1_L5 AlmostHoms_def Int_ZF_2_1_L25
by autothen have
I: abs(γ(s,m-n,k) + γ(s,m,n)) ≤ abs(γ(s,m-n,k)) + abs(γ(s,m,n))using Int_triangle_ineq by simp
from II A2 T haveabs(γ(s,m-n,k)) ≤ L
abs(γ(s,m,n)) ≤ L
by autothen have abs(γ(s,m-n,k)) + abs(γ(s,m,n)) ≤ L+L
using int_ineq_add_sides by simp
with I have abs(γ(s,m-n,k) + γ(s,m,n)) ≤ L+L
by (rule Int_order_transitive)
moreover from A1 A2 haves(m-n-k) - (s(m)- s(n) - s(k)) = γ(s,m-n,k) + γ(s,m,n)using AlmostHoms_def Int_ZF_2_1_L26A by simp
ultimately haveabs(s(m-n-k) - (s(m)- s(n) - s(k))) ≤ L+L
by simp }
ultimately show thesis by autoqed

If s is a slope, then we can find integers M, K such that s(m − n − k) ≤s(m) − s(n) − s(k) + M and s(m) − s(n) − s(k) + K ≤ s(m − n − k), for all
integer m, n, k.
lemma (in int1) Int_ZF_2_1_L30: assumes A1: s∈Sshows∃ M∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. s(m-n-k) ≤ s(m)-s(n)-s(k)+M∃ K∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. s(m)-s(n)-s(k)+K ≤ s(m-n-k)
proof from A1 have
∃ M∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. abs(s(m-n-k) - (s(m)-s(n)-s(k))) ≤M
using Int_ZF_2_1_L29 by simp
then obtain M where I: M∈ZZ and II:∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. abs(s(m-n-k) - (s(m)-s(n)-s(k))) ≤M
by autofrom I have III: (-M) ∈ ZZ using Int_ZF_1_1_L4 by simp
{ fix m n k assume A2: m∈ZZ n∈ZZ k∈ZZ
with A1 have s(m-n-k) ∈ ZZ and s(m)-s(n)-s(k) ∈ ZZ
using Int_ZF_1_1_L5 Int_ZF_2_1_L2B by auto
moreover from II A2 have528

abs(s(m-n-k) - (s(m)-s(n)-s(k))) ≤M
by simpultimately haves(m-n-k) ≤ s(m)-s(n)-s(k)+M ∧s(m)-s(n)-s(k) - M ≤ s(m-n-k)
using Int_triangle_ineq2 by simp
} then have
∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. s(m-n-k) ≤ s(m)-s(n)-s(k)+M∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. s(m)-s(n)-s(k) - M ≤ s(m-n-k)
by autowith I III show
∃ M∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. s(m-n-k) ≤ s(m)-s(n)-s(k)+M∃ K∈ZZ. ∀ m∈ZZ.∀ n∈ZZ.∀ k∈ZZ. s(m)-s(n)-s(k)+K ≤ s(m-n-k)
by autoqed

By definition functions f, g are almost equal if f − g* is bounded. In thenext lemma we show it is sufficient to check the boundedness on positive
integers.
lemma (in int1) Int_ZF_2_1_L31: assumes A1: s∈S r∈S
and A2: ∀ m∈ZZ+ . abs(s(m)-r(m)) ≤ Lshows s ∼ r
proof let a = abs(s(0) - r(0))
let c = 2·maxδ(s) + 2·maxδ(r) + L
let M = Maximum(IntegerOrder,{a,L,c})from A2 have abs(s(1)-r(1)) ≤ Lusing int_one_two_are_pos by simp
then have T: L∈ZZ using Int_ZF_2_L1A by simp
moreover from A1 have a ∈ ZZ
using int_zero_one_are_int Int_ZF_2_1_L2B
Int_ZF_1_1_L5 Int_ZF_2_L14 by simp
moreover from A1 T have c ∈ ZZ
using Int_ZF_2_1_L8 int_two_three_are_int Int_ZF_1_1_L5
by simpultimately have
I: a ≤ M and
II: L ≤ M and
III: c ≤ Musing Int_ZF_1_4_L1A by auto
{ fix m assume A5: m∈ZZ
with A1 have T:s(m) ∈ ZZ r(m) ∈ ZZ s(m) - r(m) ∈ ZZ
s(-m) ∈ ZZ r(-m) ∈ ZZ
using Int_ZF_2_1_L2B Int_ZF_1_1_L4 Int_ZF_1_1_L5
by autofrom A5 have m=0 ∨ m∈ZZ+ ∨ (-m) ∈ ZZ+
using int_decomp_cases by simp529

moreover{ assume m=0
with I have abs(s(m) - r(m)) ≤ M
by simp }moreover{ assume m∈ZZ+
with A2 II haveabs(s(m)-r(m)) ≤ L and L≤M
by autothen have abs(s(m)-r(m)) ≤ M
by (rule Int_order_transitive) }moreover{ assume A6: (-m) ∈ ZZ+
from T have abs(s(m)-r(m)) ≤abs(s(m)+s(-m)) + abs(r(m)+r(-m)) + abs(s(-m)-r(-m))
using Int_ZF_1_3_L22A by simp
moreoverfrom A1 A2 III A5 A6 haveabs(s(m)+s(-m)) + abs(r(m)+r(-m)) + abs(s(-m)-r(-m)) ≤ cc ≤ Musing Int_ZF_2_1_L14 int_ineq_add_sides by auto
then haveabs(s(m)+s(-m)) + abs(r(m)+r(-m)) + abs(s(-m)-r(-m)) ≤ M
by (rule Int_order_transitive)
ultimately have abs(s(m)-r(m)) ≤ M
by (rule Int_order_transitive) }ultimately have abs(s(m) - r(m)) ≤ M
by auto} then have ∀ m∈ZZ. abs(s(m)-r(m)) ≤ M
by simpwith A1 show s ∼ r by (rule Int_ZF_2_1_L9)
qed

A sufficient condition for an odd slope to be almost equal to identity: If for
all positive integers the value of the slope at m is between m and m plus
some constant independent of m, then the slope is almost identity.
lemma (in int1) Int_ZF_2_1_L32: assumes A1: s∈S M∈ZZ
and A2: ∀ m∈ZZ+ . m ≤ s(m) ∧ s(m) ≤ m+M
shows s ∼ id(ZZ)
proof let r = id(ZZ)
from A1 have s∈S r ∈ Susing Int_ZF_2_1_L17 by auto
moreover from A1 A2 have ∀ m∈ZZ+ . abs(s(m)-r(m)) ≤ M
using Int_ZF_1_3_L23 PositiveSet_def id_conv by simp
ultimately show s ∼ id(ZZ) by (rule Int_ZF_2_1_L31)
qed

A lemma about adding a constant to slopes. This is actually proven in
530

Group_ZF_3_5_L1, in Group_ZF_3.thy here we just refer to that lemma toshow it in notation used for integers. Unfortunately we have to use raw set
notation in the proof.
lemma (in int1) Int_ZF_2_1_L33:
assumes A1: s∈S and A2: c∈ZZ andA3: r = {hm,s(m)+ci. m∈ZZ}
shows∀ m∈ZZ. r(m) = s(m)+c
r∈S
s ∼ r
proof let G = ZZ
let f = IntegerAddition
let AH = AlmostHoms(G, f)from assms have I:
group1(G, f)s ∈ AlmostHoms(G, f)c ∈ Gr = {hx, fhs(x), cii. x ∈ G}
using Int_ZF_2_1_L1 by auto
then have ∀ x∈G. r(x) = fhs(x),ciby (rule group1.Group_ZF_3_5_L1)
moreover from I have r ∈ AlmostHoms(G, f)by (rule group1.Group_ZF_3_5_L1)
moreover from I havehs, ri ∈ QuotientGroupRel(AlmostHoms(G, f), AlHomOp1(G, f), FinRangeFunctions(G,G))
by (rule group1.Group_ZF_3_5_L1)
ultimately show
∀ m∈ZZ. r(m) = s(m)+c
r∈S
s ∼ r
by autoqed

44.2

Composing slopes

Composition of slopes is not commutative. However, as we show in thissection if f and g are slopes then the range of f ◦ g − g ◦ f is bounded. This
allows to show that the multiplication of real numbers is commutative.
Two useful estimates.
lemma (in int1) Int_ZF_2_2_L1:
assumes A1: f:ZZ→ZZ and A2: p∈ZZ q∈ZZ
showsabs(f((p+1)·q)-(p+1)·f(q)) ≤ abs(δ(f,p·q,q))+abs(f(p·q)-p·f(q))
abs(f((p-1)·q)-(p-1)·f(q)) ≤ abs(δ(f,(p-1)·q,q))+abs(f(p·q)-p·f(q))
proof -

531

let R = ZZ
let A = IntegerAddition
let M = IntegerMultiplication
let I = GroupInv(R, A)
let a = f((p+1)·q)
let b = p
let c = f(q)let d = f(p·q)
from A1 A2 have T1:
ring0(R, A, M) a ∈ R b ∈ R c ∈ R d ∈ Rusing Int_ZF_1_1_L2 int_zero_one_are_int Int_ZF_1_1_L5 apply_funtype
by autothen have
Aha,I(MhAhb, TheNeutralElement(R, M)i,ci)i =AhAhAha,I(d)i,I(c)i,Ahd, I(Mhb, ci)ii
by (rule ring0.Ring_ZF_2_L2)with A2 havef((p+1)·q)-(p+1)·f(q) = δ(f,p·q,q)+(f(p·q)-p·f(q))
using int_zero_one_are_int Int_ZF_1_1_L1 Int_ZF_1_1_L4 by simp
moreover from A1 A2 T1 have δ(f,p·q,q) ∈ ZZ f(p·q)-p·f(q) ∈ ZZ
using Int_ZF_1_1_L5 apply_funtype by auto
ultimately showabs(f((p+1)·q)-(p+1)·f(q)) ≤ abs(δ(f,p·q,q))+abs(f(p·q)-p·f(q))
using Int_triangle_ineq by simp
from A1 A2 have T1:f((p-1)·q) ∈ ZZ
p∈ZZ f(q) ∈ ZZ
f(p·q) ∈ ZZ
using int_zero_one_are_int Int_ZF_1_1_L5 apply_funtype by auto
then havef((p-1)·q)-(p-1)·f(q) = (f(p·q)-p·f(q))-(f(p·q)-f((p-1)·q)-f(q))
by (rule Int_ZF_1_2_L6)
with A2 have f((p-1)·q)-(p-1)·f(q) = (f(p·q)-p·f(q))-δ(f,(p-1)·q,q)using Int_ZF_1_2_L7 by simp
moreover from A1 A2 havef(p·q)-p·f(q) ∈ ZZ
δ(f,(p-1)·q,q) ∈ ZZ
using Int_ZF_1_1_L5 int_zero_one_are_int apply_funtype by auto
ultimately showabs(f((p-1)·q)-(p-1)·f(q)) ≤ abs(δ(f,(p-1)·q,q))+abs(f(p·q)-p·f(q))
using Int_triangle_ineq1 by simp
qed

If f is a slope, then |f (p · q) − p · f (q)| ≤ (|p| + 1)·maxδ(f). The proof is by
induction on p and the next lemma is the induction step for the case when0 ≤ p.
lemma (in int1) Int_ZF_2_2_L2:
assumes A1: f∈S and A2: 0≤p q∈ZZ
and A3: abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f)shows
abs(f((p+1)·q)-(p+1)·f(q)) ≤ (abs(p+1)+ 1)·maxδ(f)532proof from A2 have q∈ZZ p·q ∈ ZZ
using Int_ZF_2_L1A Int_ZF_1_1_L5 by autowith A1 have I: abs(δ(f,p·q,q)) ≤ maxδ(f) by (rule Int_ZF_2_1_L7)
moreover note A3
moreover from A1 A2 haveabs(f((p+1)·q)-(p+1)·f(q)) ≤ abs(δ(f,p·q,q))+abs(f(p·q)-p·f(q))
using AlmostHoms_def Int_ZF_2_L1A Int_ZF_2_2_L1 by simp
ultimately haveabs(f((p+1)·q)-(p+1)·f(q)) ≤ maxδ(f)+(abs(p)+1)·maxδ(f)by (rule Int_ZF_2_L15)
moreover from I A2 havemaxδ(f)+(abs(p)+1)·maxδ(f) = (abs(p+1)+ 1)·maxδ(f)using Int_ZF_2_L1A Int_ZF_1_2_L2 by simp
ultimately showabs(f((p+1)·q)-(p+1)·f(q)) ≤ (abs(p+1)+ 1)·maxδ(f)by simpqed

If f is a slope, then |f (p · q) − p · f (q)| ≤ (|p| + 1)·maxδ . The proof is by
induction on p and the next lemma is the induction step for the case whenp ≤ 0.
lemma (in int1) Int_ZF_2_2_L3:
assumes A1: f∈S and A2: p≤0 q∈ZZ
and A3: abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f)shows abs(f((p-1)·q)-(p-1)·f(q)) ≤ (abs(p-1)+ 1)·maxδ(f)proof from A2 have q∈ZZ (p-1)·q ∈ ZZ
using Int_ZF_2_L1A int_zero_one_are_int Int_ZF_1_1_L5 by autowith A1 have I: abs(δ(f,(p-1)·q,q)) ≤ maxδ(f) by (rule Int_ZF_2_1_L7)
moreover note A3
moreover from A1 A2 haveabs(f((p-1)·q)-(p-1)·f(q)) ≤ abs(δ(f,(p-1)·q,q))+abs(f(p·q)-p·f(q))
using AlmostHoms_def Int_ZF_2_L1A Int_ZF_2_2_L1 by simp
ultimately haveabs(f((p-1)·q)-(p-1)·f(q)) ≤ maxδ(f)+(abs(p)+1)·maxδ(f)by (rule Int_ZF_2_L15)
with I A2 show thesis using Int_ZF_2_L1A Int_ZF_1_2_L5 by simp
qed

If f is a slope, then |f (p · q) − p · f (q)| ≤ (|p| + 1)·maxδ (f ). Proof by caseson 0 ≤ p.
lemma (in int1) Int_ZF_2_2_L4:
assumes A1: f∈S and A2: p∈ZZ q∈ZZ
shows abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f)proof { assume 0≤pmoreover from A1 A2 have abs(f(0·q)-0·f(q)) ≤ (abs(0)+1)·maxδ(f)using int_zero_one_are_int Int_ZF_2_1_L2B Int_ZF_1_1_L4

533

Int_ZF_2_1_L8 Int_ZF_2_L18 by simp
moreover from A1 A2 have
∀ p. 0≤p ∧ abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f) −→abs(f((p+1)·q)-(p+1)·f(q)) ≤ (abs(p+1)+ 1)·maxδ(f)using Int_ZF_2_2_L2 by simp
ultimately have abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f)by (rule Induction_on_int) }moreover{ assume ¬(0≤p)
with A2 have p≤0 using Int_ZF_2_L19A by simp
moreover from A1 A2 have abs(f(0·q)-0·f(q)) ≤ (abs(0)+1)·maxδ(f)using int_zero_one_are_int Int_ZF_2_1_L2B Int_ZF_1_1_L4
Int_ZF_2_1_L8 Int_ZF_2_L18 by simp
moreover from A1 A2 have
∀ p. p≤0 ∧ abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f) −→abs(f((p-1)·q)-(p-1)·f(q)) ≤ (abs(p-1)+ 1)·maxδ(f)using Int_ZF_2_2_L3 by simp
ultimately have abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f)by (rule Back_induct_on_int) }ultimately show thesis by blastqed

The next elegant result is Lemma 7 in the Arthan’s paper [2].
lemma (in int1) Arthan_Lem_7:
assumes A1: f∈S and A2: p∈ZZ q∈ZZ
shows abs(q·f(p)-p·f(q)) ≤ (abs(p)+abs(q)+2)·maxδ(f)proof from A1 A2 have T:
q·f(p)-f(p·q) ∈ ZZ
f(p·q)-p·f(q) ∈ ZZ
f(q·p) ∈ ZZ f(p·q) ∈ ZZ
q·f(p) ∈ ZZ p·f(q) ∈ ZZ
maxδ(f) ∈ ZZ
abs(q) ∈ ZZ abs(p) ∈ ZZ
using Int_ZF_1_1_L5 Int_ZF_2_1_L2B Int_ZF_2_1_L7 Int_ZF_2_L14 by auto
moreover have abs(q·f(p)-f(p·q)) ≤ (abs(q)+1)·maxδ(f)proof from A1 A2 have abs(f(q·p)-q·f(p)) ≤ (abs(q)+1)·maxδ(f)using Int_ZF_2_2_L4 by simp
with T A2 show thesis
using Int_ZF_2_L20 Int_ZF_1_1_L5 by simp
qed
moreover from A1 A2 have abs(f(p·q)-p·f(q)) ≤ (abs(p)+1)·maxδ(f)using Int_ZF_2_2_L4 by simp
ultimately haveabs(q·f(p)-f(p·q)+(f(p·q)-p·f(q))) ≤ (abs(q)+1)·maxδ(f)+(abs(p)+1)·maxδ(f)using Int_ZF_2_L21 by simp
with T show thesis using Int_ZF_1_2_L9 int_zero_one_are_int Int_ZF_1_2_L10
by simp534

qedThis is Lemma 8 in the Arthan’s paper.
lemma (in int1) Arthan_Lem_8: assumes A1: f∈Sshows ∃ A B. A∈ZZ ∧ B∈ZZ ∧ (∀ p∈ZZ. abs(f(p)) ≤ A·abs(p)+B)
proof let A = maxδ(f) + abs(f(1))
let B = 3·maxδ(f)from A1 have A∈ZZ B∈ZZ
using int_zero_one_are_int Int_ZF_1_1_L5 Int_ZF_2_1_L2B
Int_ZF_2_1_L7 Int_ZF_2_L14 by auto
moreover have ∀ p∈ZZ. abs(f(p)) ≤ A·abs(p)+B
proof
fix p assume A2: p∈ZZwith A1 have T:
f(p) ∈ ZZ abs(p) ∈ ZZ f(1) ∈ ZZ
p·f(1) ∈ ZZ 3∈ZZ maxδ(f) ∈ ZZ
using Int_ZF_2_1_L2B Int_ZF_2_L14 int_zero_one_are_int
Int_ZF_1_1_L5 Int_ZF_2_1_L7 by autofrom A1 A2 haveabs(1·f(p)-p·f(1)) ≤ (abs(p)+abs(1)+2)·maxδ(f)using int_zero_one_are_int Arthan_Lem_7 by simp
with T have abs(f(p)) ≤ abs(p·f(1))+(abs(p)+3)·maxδ(f)using Int_ZF_2_L16A Int_ZF_1_1_L4 Int_ZF_1_2_L11
Int_triangle_ineq2 by simp
with A2 T show abs(f(p)) ≤ A·abs(p)+B
using Int_ZF_1_3_L14 by simp
qed
ultimately show thesis by autoqed

If f and g are slopes, then f ◦ g is equivalent (almost equal) to g ◦ f . This
is Theorem 9 in Arthan’s paper [2].
theorem (in int1) Arthan_Th_9: assumes A1: f∈S g∈Sshows f◦g ∼ g◦f
proof from A1 have
∃ A B. A∈ZZ ∧ B∈ZZ ∧ (∀ p∈ZZ. abs(f(p)) ≤ A·abs(p)+B)∃ C D. C∈ZZ ∧ D∈ZZ ∧ (∀ p∈ZZ. abs(g(p)) ≤ C·abs(p)+D)
using Arthan_Lem_8 by auto
then obtain A B C D where D1: A∈ZZ B∈ZZ C∈ZZ D∈ZZ and D2:∀ p∈ZZ. abs(f(p)) ≤ A·abs(p)+B∀ p∈ZZ. abs(g(p)) ≤ C·abs(p)+D
by autolet E = maxδ(g)·(A+1) + maxδ(f)·(C+1)
let F = (B·maxδ(g) + 2·maxδ(g)) + (D·maxδ(f) + 2·maxδ(f)){ fix p assume A2: p∈ZZwith A1 have T1:
g(p) ∈ ZZ f(p) ∈ ZZ abs(p) ∈ ZZ 2 ∈ ZZ

535

f(g(p)) ∈ ZZ g(f(p)) ∈ ZZ f(g(p)) - g(f(p)) ∈ ZZ
p·f(g(p)) ∈ ZZ p·g(f(p)) ∈ ZZ
abs(f(g(p))-g(f(p))) ∈ ZZ
using Int_ZF_2_1_L2B Int_ZF_2_1_L10 Int_ZF_1_1_L5 Int_ZF_2_L14 int_two_three_are_int
by autowith A1 A2 haveabs((f(g(p))-g(f(p)))·p) ≤(abs(p)+abs(f(p))+2)·maxδ(g) + (abs(p)+abs(g(p))+2)·maxδ(f)using Arthan_Lem_7 Int_ZF_1_2_L10A Int_ZF_1_2_L12 by simp
moreover have(abs(p)+abs(f(p))+2)·maxδ(g) + (abs(p)+abs(g(p))+2)·maxδ(f) ≤((maxδ(g)·(A+1) + maxδ(f)·(C+1)))·abs(p) +((B·maxδ(g) + 2·maxδ(g)) + (D·maxδ(f) + 2·maxδ(f)))
proof from D2 A2 T1 haveabs(p)+abs(f(p))+2 ≤ abs(p)+(A·abs(p)+B)+2
abs(p)+abs(g(p))+2 ≤ abs(p)+(C·abs(p)+D)+2
using Int_ZF_2_L15C by autowith A1 have(abs(p)+abs(f(p))+2)·maxδ(g) ≤ (abs(p)+(A·abs(p)+B)+2)·maxδ(g)(abs(p)+abs(g(p))+2)·maxδ(f) ≤ (abs(p)+(C·abs(p)+D)+2)·maxδ(f)using Int_ZF_2_1_L8 Int_ZF_1_3_L13 by auto
moreover from A1 D1 T1 have(abs(p)+(A·abs(p)+B)+2)·maxδ(g) =maxδ(g)·(A+1)·abs(p) + (B·maxδ(g) + 2·maxδ(g))(abs(p)+(C·abs(p)+D)+2)·maxδ(f) =maxδ(f)·(C+1)·abs(p) + (D·maxδ(f) + 2·maxδ(f))
using Int_ZF_2_1_L8 Int_ZF_1_2_L13 by auto
ultimately have(abs(p)+abs(f(p))+2)·maxδ(g) + (abs(p)+abs(g(p))+2)·maxδ(f) ≤(maxδ(g)·(A+1)·abs(p) + (B·maxδ(g) + 2·maxδ(g))) +(maxδ(f)·(C+1)·abs(p) + (D·maxδ(f) + 2·maxδ(f)))
using int_ineq_add_sides by simp
moreover from A1 A2 D1 have abs(p) ∈ ZZ
maxδ(g)·(A+1) ∈ ZZ B·maxδ(g) + 2·maxδ(g) ∈ ZZ
maxδ(f)·(C+1) ∈ ZZ D·maxδ(f) + 2·maxδ(f) ∈ ZZ
using Int_ZF_2_L14 Int_ZF_2_1_L8 int_zero_one_are_int
Int_ZF_1_1_L5 int_two_three_are_int by auto
ultimately show thesis using Int_ZF_1_2_L14 by simp
qed
ultimately haveabs((f(g(p))-g(f(p)))·p) ≤ E·abs(p) + F
by (rule Int_order_transitive)
with A2 T1 haveabs(f(g(p))-g(f(p)))·abs(p) ≤ E·abs(p) + F
abs(f(g(p))-g(f(p))) ∈ ZZ
using Int_ZF_1_3_L5 by auto
} then have
∀ p∈ZZ. abs(f(g(p))-g(f(p))) ∈ ZZ536

∀ p∈ZZ. abs(f(g(p))-g(f(p)))·abs(p) ≤ E·abs(p) + F
by automoreover from A1 D1 have E ∈ ZZ F ∈ ZZ
using int_zero_one_are_int int_two_three_are_int Int_ZF_2_1_L8 Int_ZF_1_1_L5
by autoultimately have
∃ L. ∀ p∈ZZ. abs(f(g(p))-g(f(p))) ≤ L
by (rule Int_ZF_1_7_L1)
with A1 obtain L where ∀ p∈ZZ. abs((f◦g)(p)-(g◦f)(p)) ≤ Lusing Int_ZF_2_1_L10 by auto
moreover from A1 have f◦g ∈ S g◦f ∈ S
using Int_ZF_2_1_L11 by auto
ultimately show f◦g ∼ g◦f using Int_ZF_2_1_L9 by auto
qed
end

45

Integers 3

theory Int_ZF_3 imports Int_ZF_2
begin

This theory is a continuation of Int_ZF_2. We consider here the propertiesof slopes (almost homomorphisms on integers) that allow to define the orderrelation and multiplicative inverse on real numbers. We also prove theorems
that allow to show completeness of the order relation of real numbers wedefine in Real_ZF.

45.1

Positive slopes

This section provides background material for defining the order relation onreal numbers.
Positive slopes are functions (of course.)lemma (in int1) Int_ZF_2_3_L1: assumes A1: f∈S + shows f:ZZ→ZZ
using assms AlmostHoms_def PositiveSet_def by simp

A small technical lemma to simplify the proof of the next theorem.
lemma (in int1) Int_ZF_2_3_L1A:
assumes A1: f∈S + and A2: ∃ n ∈ f(ZZ+ ) ∩ ZZ+ . a≤nshows ∃ M∈ZZ+ . a ≤ f(M)proof from A1 have f:ZZ→ZZ ZZ+ ⊆ ZZ
using AlmostHoms_def PositiveSet_def by autowith A2 show thesis using func_imagedef by auto
qed

537

The next lemma is Lemma 3 in the Arthan’s paper.
lemma (in int1) Arthan_Lem_3:
assumes A1: f∈S + and A2: D ∈ ZZ+
shows ∃ M∈ZZ+ . ∀ m∈ZZ+ . (m+1)·D ≤ f(m·M)
proof let E = maxδ(f) + D
let A = f(ZZ+ ) ∩ ZZ+
from A1 A2 have I: D≤Eusing Int_ZF_1_5_L3 Int_ZF_2_1_L8 Int_ZF_2_L1A Int_ZF_2_L15D
by simpfrom A1 A2 have A ⊆ ZZ+ A ∈/ Fin(ZZ) 2·E ∈ ZZ
using int_two_three_are_int Int_ZF_2_1_L8 PositiveSet_def Int_ZF_1_1_L5
by autowith A1 have ∃ M∈ZZ+ . 2·E ≤ f(M)using Int_ZF_1_5_L2A Int_ZF_2_3_L1A by simp
then obtain M where II: M∈ZZ+ and III: 2·E ≤ f(M)by auto{ fix m assume m∈ZZ+ then have A4: 1≤musing Int_ZF_1_5_L3 by simp
moreover from II III have (1+1) ·E ≤ f(1·M)
using PositiveSet_def Int_ZF_1_1_L4 by simp
moreover have ∀ k.
1≤k ∧ (k+1)·E ≤ f(k·M) −→ (k+1+1)·E ≤ f((k+1)·M)
proof { fix k assume A5: 1≤k and A6: (k+1)·E ≤ f(k·M)
with A1 A2 II have T:
k∈ZZ M∈ZZ k+1 ∈ ZZ E∈ZZ (k+1)·E ∈ ZZ 2·E ∈ ZZ
using Int_ZF_2_L1A PositiveSet_def int_zero_one_are_int
Int_ZF_1_1_L5 Int_ZF_2_1_L8 by autofrom A1 A2 A5 II haveδ(f,k·M,M) ∈ ZZ
abs(δ(f,k·M,M)) ≤ maxδ(f)0≤Dusing Int_ZF_2_L1A PositiveSet_def Int_ZF_1_1_L5
Int_ZF_2_1_L7 Int_ZF_2_L16C by autowith III A6 have(k+1)·E + (2·E - E) ≤ f(k·M) + (f(M) + δ(f,k·M,M))
using Int_ZF_1_3_L19A int_ineq_add_sides by simp
with A1 T have (k+1+1)·E ≤ f((k+1)·M)
using Int_ZF_1_1_L1 int_zero_one_are_int Int_ZF_1_1_L4
Int_ZF_1_2_L11 Int_ZF_2_1_L13 by simp
} then show thesis by simp
qed
ultimately have (m+1)·E ≤ f(m·M) by (rule Induction_on_int)
with A4 I have (m+1)·D ≤ f(m·M) using Int_ZF_1_3_L13A
by simp} then have ∀ m∈ZZ+ .(m+1)·D ≤ f(m·M) by simp
with II show thesis by autoqed

A special case of Arthan_Lem_3 when D = 1.
538

corollary (in int1) Arthan_L_3_spec: assumes A1: f ∈ S +shows ∃ M∈ZZ+ .∀ n∈ZZ+ . n+1 ≤ f(n·M)
proof have ∀ n∈ZZ+ . n+1 ∈ ZZ
using PositiveSet_def int_zero_one_are_int Int_ZF_1_1_L5
by simpthen have ∀ n∈ZZ+ . (n+1)·1 = n+1
using Int_ZF_1_1_L4 by simp
moreover from A1 have ∃ M∈ZZ+ . ∀ n∈ZZ+ . (n+1)·1 ≤ f(n·M)
using int_one_two_are_pos Arthan_Lem_3 by simp
ultimately show thesis by simpqed

We know from Group_ZF_3.thy that finite range functions are almost homomorphisms. Besides reminding that fact for slopes the next lemma showsthat finite range functions do not belong to S + . This is important, because
the projection of the set of finite range functions defines zero in the real
number construction in Real_ZF_x.thy series, while the projection of S + becomes the set of (strictly) positive reals. We don’t want zero to be positive,
do we? The next lemma is a part of Lemma 5 in the Arthan’s paper [2].
lemma (in int1) Int_ZF_2_3_L1B:
assumes A1: f ∈ FinRangeFunctions(ZZ,ZZ)
shows f∈S
f ∈/ S+
proof from A1 show f∈S using Int_ZF_2_1_L1 group1.Group_ZF_3_3_L1
by autohave ZZ+ ⊆ ZZ using PositiveSet_def by autowith A1 have f(ZZ+ ) ∈ Fin(ZZ)
using Finite1_L21 by simp
then have f(ZZ+ ) ∩ ZZ+ ∈ Fin(ZZ)
using Fin_subset_lemma by blast
thus f ∈/ S + by autoqed

We want to show that if f is a slope and neither f nor −f are in S + , thenf is bounded. The next lemma is the first step towards that goal and showsthat if slope is not in S + then f (ZZ+ ) is bounded above.
lemma (in int1) Int_ZF_2_3_L2: assumes A1: f∈S and A2: f ∈/ S+shows IsBoundedAbove(f(ZZ+ ), IntegerOrder)
proof from A1 have f:ZZ→ZZ using AlmostHoms_def by simp
then have f(ZZ+ ) ⊆ ZZ using func1_1_L6 by simp
moreover from A1 A2 have f(ZZ+ ) ∩ ZZ+ ∈ Fin(ZZ) by auto
ultimately show thesis using Int_ZF_2_T1 group3.OrderedGroup_ZF_2_L4
by simpqed

If f is a slope and −f ∈/ S + , then f (ZZ+ ) is bounded below.
539

lemma (in int1) Int_ZF_2_3_L3: assumes A1: f∈S and A2: -f ∈/ S+shows IsBoundedBelow(f(ZZ+ ), IntegerOrder)
proof from A1 have T: f:ZZ→ZZ using AlmostHoms_def by simp
then have (-(f(ZZ+ ))) = (-f)(ZZ+ )using Int_ZF_1_T2 group0_2_T2 PositiveSet_def func1_1_L15C
by autowith A1 A2 T show IsBoundedBelow(f(ZZ+ ), IntegerOrder)using Int_ZF_2_1_L12 Int_ZF_2_3_L2 PositiveSet_def func1_1_L6
Int_ZF_2_T1 group3.OrderedGroup_ZF_2_L5 by simpqed

A slope that is bounded on ZZ+ is bounded everywhere.
lemma (in int1) Int_ZF_2_3_L4:
assumes A1: f∈S and A2: m∈ZZ
and A3: ∀ n∈ZZ+ . abs(f(n)) ≤ Lshows abs(f(m)) ≤ 2·maxδ(f) + L
proof from A1 A3 have0 ≤ abs(f(1)) abs(f(1)) ≤ Lusing int_zero_one_are_int Int_ZF_2_1_L2B int_abs_nonneg int_one_two_are_pos
by autothen have II: 0≤L by (rule Int_order_transitive)
note A2
moreover have abs(f(0)) ≤ 2·maxδ(f) + L
proof from A1 haveabs(f(0)) ≤ maxδ(f) 0 ≤ maxδ(f)and T: maxδ(f) ∈ ZZ
using Int_ZF_2_1_L8 by autowith II have abs(f(0)) ≤ maxδ(f) + maxδ(f) + L
using Int_ZF_2_L15F by simp
with T show thesis using Int_ZF_1_1_L4 by simp
qed
moreover from A1 A3 II have
∀ n∈ZZ+ . abs(f(n)) ≤ 2·maxδ(f) + L
using Int_ZF_2_1_L8 Int_ZF_1_3_L5A Int_ZF_2_L15F
by simpmoreover have ∀ n∈ZZ+ . abs(f(-n)) ≤ 2·maxδ(f) + L
proof
fix n assume n∈ZZ+with A1 A3 have
2·maxδ(f) ∈ ZZ
abs(f(-n)) ≤ 2·maxδ(f) + abs(f(n))
abs(f(n)) ≤ Lusing int_two_three_are_int Int_ZF_2_1_L8 Int_ZF_1_1_L5
PositiveSet_def Int_ZF_2_1_L14 by auto
then show abs(f(-n)) ≤ 2·maxδ(f) + L
using Int_ZF_2_L15A by blast

540

qed
ultimately show thesis by (rule Int_ZF_2_L19B)
qed

A slope whose image of the set of positive integers is bounded is a finite
range function.
lemma (in int1) Int_ZF_2_3_L4A:
assumes A1: f∈S and A2: IsBounded(f(ZZ+ ), IntegerOrder)shows f ∈ FinRangeFunctions(ZZ,ZZ)
proof have T1: ZZ+ ⊆ ZZ using PositiveSet_def by autofrom A1 have T2: f:ZZ→ZZ using AlmostHoms_def by simp
from A2 obtain L where ∀ a∈f(ZZ+ ). abs(a) ≤ Lusing Int_ZF_1_3_L20A by autowith T2 T1 have ∀ n∈ZZ+ . abs(f(n)) ≤ L
by (rule func1_1_L15B)
with A1 have ∀ m∈ZZ. abs(f(m)) ≤ 2·maxδ(f) + L
using Int_ZF_2_3_L4 by simp
with T2 have f(ZZ) ∈ Fin(ZZ)
by (rule Int_ZF_1_3_L20C)
with T2 show f ∈ FinRangeFunctions(ZZ,ZZ)
using FinRangeFunctions_def by simpqed

A slope whose image of the set of positive integers is bounded below is a
finite range function or a positive slope.
lemma (in int1) Int_ZF_2_3_L4B:
assumes f∈S and IsBoundedBelow(f(ZZ+ ), IntegerOrder)shows f ∈ FinRangeFunctions(ZZ,ZZ) ∨ f∈S +using assms Int_ZF_2_3_L2 IsBounded_def Int_ZF_2_3_L4A
by autoIf one slope is not greater then another on positive integers, then they arealmost equal or the difference is a positive slope.
lemma (in int1) Int_ZF_2_3_L4C: assumes A1: f∈S g∈S andA2: ∀ n∈ZZ+ . f(n) ≤ g(n)shows f∼g ∨ g + (-f) ∈ S +proof let h = g + (-f)
from A1 have (-f) ∈ S using Int_ZF_2_1_L12
by simpwith A1 have I: h ∈ S using Int_ZF_2_1_L12C
by simpmoreover have IsBoundedBelow(h(ZZ+ ), IntegerOrder)
proof from I haveh:ZZ→ZZ and ZZ+ ⊆ZZ using AlmostHoms_def PositiveSet_def
by auto541

moreover from A1 A2 have ∀ n∈ZZ+ . h0, h(n)i ∈ IntegerOrderusing Int_ZF_2_1_L2B PositiveSet_def Int_ZF_1_3_L10A
Int_ZF_2_1_L12 Int_ZF_2_1_L12B Int_ZF_2_1_L12A
by simpultimately show IsBoundedBelow(h(ZZ+ ), IntegerOrder)by (rule func_ZF_8_L1)
qed
ultimately have h ∈ FinRangeFunctions(ZZ,ZZ) ∨ h∈S +using Int_ZF_2_3_L4B by simp
with A1 show f∼g ∨ g + (-f) ∈ S +using Int_ZF_2_1_L9C by autoqed

Positive slopes are arbitrarily large for large enough arguments.
lemma (in int1) Int_ZF_2_3_L5:
assumes A1: f∈S + and A2: K∈ZZ
shows ∃ N∈ZZ+ . ∀ m. N≤m −→ K ≤ f(m)proof from A1 obtain M where I: M∈ZZ+ and II: ∀ n∈ZZ+ . n+1 ≤ f(n·M)
using Arthan_L_3_spec by auto
let j = GreaterOf(IntegerOrder,M,K - (minf(f,0..(M-1)) - maxδ(f)) 1)
from A1 I have T1:
minf(f,0..(M-1)) - maxδ(f) ∈ ZZ M∈ZZ
using Int_ZF_2_1_L15 Int_ZF_2_1_L8 Int_ZF_1_1_L5 PositiveSet_def
by autowith A2 I have T2:
K - (minf(f,0..(M-1)) - maxδ(f)) ∈ ZZ
K - (minf(f,0..(M-1)) - maxδ(f)) - 1 ∈ ZZ
using Int_ZF_1_1_L5 int_zero_one_are_int by autowith T1 have III: M ≤ j andK - (minf(f,0..(M-1)) - maxδ(f)) - 1 ≤ jusing Int_ZF_1_3_L18 by autowith A2 T1 T2 have
IV: K ≤ j+1 + (minf(f,0..(M-1)) - maxδ(f))
using int_zero_one_are_int Int_ZF_2_L9C by simp
let N = GreaterOf(IntegerOrder,1,j·M)
from T1 III have T3: j ∈ ZZ j·M ∈ ZZ
using Int_ZF_2_L1A Int_ZF_1_1_L5 by auto
then have V: N ∈ ZZ+ and VI: j·M ≤ Nusing int_zero_one_are_int Int_ZF_1_5_L3 Int_ZF_1_3_L18
by auto{ fix mlet n = m zdiv M
let k = m zmod M
assume N≤mwith VI have j·M ≤ m by (rule Int_order_transitive)
with I III have
VII: m = n·M+k542

j ≤ n and
VIII: n ∈ ZZ+ k ∈ 0..(M-1)
using IntDiv_ZF_1_L5 by autowith II havej + 1 ≤ n + 1 n+1 ≤ f(n·M)
using int_zero_one_are_int int_ord_transl_inv by auto
then have j + 1 ≤ f(n·M)
by (rule Int_order_transitive)
with T1 havej+1 + (minf(f,0..(M-1)) - maxδ(f)) ≤f(n·M) + (minf(f,0..(M-1)) - maxδ(f))
using int_ord_transl_inv by simp
with IV have K ≤ f(n·M) + (minf(f,0..(M-1)) - maxδ(f))
by (rule Int_order_transitive)
moreover from A1 I VIII havef(n·M) + (minf(f,0..(M-1))- maxδ(f)) ≤ f(n·M+k)using PositiveSet_def Int_ZF_2_1_L16 by simp
ultimately have K ≤ f(n·M+k)by (rule Int_order_transitive)
with VII have K ≤ f(m) by simp
} then have ∀ m. N≤m −→ K ≤ f(m)by simpwith V show thesis by autoqed

Positive slopes are arbitrarily small for small enough arguments. Kind of
dual to Int_ZF_2_3_L5.
lemma (in int1) Int_ZF_2_3_L5A: assumes A1: f∈S + and A2: K∈ZZ
shows ∃ N∈ZZ+ . ∀ m. N≤m −→ f(-m) ≤ K
proof from A1 have T1: abs(f(0)) + maxδ(f) ∈ ZZ
using Int_ZF_2_1_L8 by autowith A2 have abs(f(0)) + maxδ(f) - K ∈ ZZ
using Int_ZF_1_1_L5 by simp
with A1 have
∃ N∈ZZ+ . ∀ m. N≤m −→ abs(f(0)) + maxδ(f) - K ≤ f(m)using Int_ZF_2_3_L5 by simp
then obtain N where I: N∈ZZ+ and II:∀ m. N≤m −→ abs(f(0)) + maxδ(f) - K ≤ f(m)by auto{ fix m assume A3: N≤mwith A1 havef(-m) ≤ abs(f(0)) + maxδ(f) - f(m)using Int_ZF_2_L1A Int_ZF_2_1_L14 by simp
moreoverfrom II T1 A3 have abs(f(0)) + maxδ(f) - f(m) ≤(abs(f(0)) + maxδ(f)) -(abs(f(0)) + maxδ(f) - K)using Int_ZF_2_L10 int_ord_transl_inv by simp
with A2 T1 have abs(f(0)) + maxδ(f) - f(m) ≤ K

543

using Int_ZF_1_2_L3 by simp
ultimately have f(-m) ≤ K
by (rule Int_order_transitive)} then have ∀ m. N≤m −→ f(-m) ≤ K
by simpwith I show thesis by autoqed

A special case of Int_ZF_2_3_L5 where K = 1.
corollary (in int1) Int_ZF_2_3_L6: assumes f∈S +shows ∃ N∈ZZ+ . ∀ m. N≤m −→ f(m) ∈ ZZ+
using assms int_zero_one_are_int Int_ZF_2_3_L5 Int_ZF_1_5_L3
by simpA special case of Int_ZF_2_3_L5 where m = N .
corollary (in int1) Int_ZF_2_3_L6A: assumes f∈S + and K∈ZZ
shows ∃ N∈ZZ+ . K ≤ f(N)proof from assms have ∃ N∈ZZ+ . ∀ m. N≤m −→ K ≤ f(m)using Int_ZF_2_3_L5 by simp
then obtain N where I: N ∈ ZZ+ and II: ∀ m. N≤m −→ K ≤ f(m)by autothen show thesis using PositiveSet_def int_ord_is_refl refl_def
by autoqed

If values of a slope are not bounded above, then the slope is positive.
lemma (in int1) Int_ZF_2_3_L7: assumes A1: f∈S
and A2: ∀ K∈ZZ. ∃ n∈ZZ+ . K ≤ f(n)shows f ∈ S +proof { fix K assume K∈ZZ
with A2 obtain n where n∈ZZ+ K ≤ f(n)by automoreover from A1 have ZZ+ ⊆ ZZ f:ZZ→ZZ
using PositiveSet_def AlmostHoms_def by auto
ultimately have ∃ m ∈ f(ZZ+ ). K ≤ musing func1_1_L15D by auto
} then have ∀ K∈ZZ. ∃ m ∈ f(ZZ+ ). K ≤ m by simp
with A1 show f ∈ S + using Int_ZF_4_L9 Int_ZF_2_3_L2
by autoqed

For unbounded slope f either f ∈S + of −f ∈S + .
theorem (in int1) Int_ZF_2_3_L8:
assumes A1: f∈S and A2: f ∈/ FinRangeFunctions(ZZ,ZZ)
shows (f ∈ S + ) Xor ((-f) ∈ S + )proof -

544

have T1: ZZ+ ⊆ ZZ using PositiveSet_def by autofrom A1 have T2: f:ZZ→ZZ using AlmostHoms_def by simp
then have I: f(ZZ+ ) ⊆ ZZ using func1_1_L6 by autofrom A1 A2 have f ∈ S + ∨ (-f) ∈ S +using Int_ZF_2_3_L2 Int_ZF_2_3_L3 IsBounded_def Int_ZF_2_3_L4A
by blast
moreover have ¬(f ∈ S + ∧ (-f) ∈ S + )proof { assume A3: f ∈ S + and A4: (-f) ∈ S +from A3 obtain N1 where
I: N1∈ZZ+ and II: ∀ m. N1≤m −→ f(m) ∈ ZZ+
using Int_ZF_2_3_L6 by autofrom A4 obtain N2 where
III: N2∈ZZ+ and IV: ∀ m. N2≤m −→ (-f)(m) ∈ ZZ+
using Int_ZF_2_3_L6 by auto
let N = GreaterOf(IntegerOrder,N1,N2)
from I III have N1 ≤ N N2 ≤ Nusing PositiveSet_def Int_ZF_1_3_L18 by autowith A1 II IV havef(N) ∈ ZZ+ (-f)(N) ∈ ZZ+ (-f)(N) = -(f(N))
using Int_ZF_2_L1A PositiveSet_def Int_ZF_2_1_L12A
by autothen have False using Int_ZF_1_5_L8 by simp
} thus thesis by autoqed
ultimately show (f ∈ S + ) Xor ((-f) ∈ S + )using Xor_def by simp
qed

The sum of positive slopes is a positive slope.
theorem (in int1) sum_of_pos_sls_is_pos_sl:
assumes A1: f ∈ S + g ∈ S +shows f+g ∈ S +proof { fix K assume K∈ZZ
with A1 have ∃ N∈ZZ+ . ∀ m. N≤m −→ K ≤ f(m)using Int_ZF_2_3_L5 by simp
then obtain N where I: N∈ZZ+ and II: ∀ m. N≤m −→ K ≤ f(m)by autofrom A1 have ∃ M∈ZZ+ . ∀ m. M≤m −→ 0 ≤ g(m)using int_zero_one_are_int Int_ZF_2_3_L5 by simp
then obtain M where III: M∈ZZ+ and IV: ∀ m. M≤m −→ 0 ≤ g(m)by autolet L = GreaterOf(IntegerOrder,N,M)
from I III have V: L ∈ ZZ+ ZZ+ ⊆ ZZ
using GreaterOf_def PositiveSet_def by auto
moreover from A1 V have (f+g)(L) = f(L) + g(L)using Int_ZF_2_1_L12B by auto
moreover from I II III IV have K ≤ f(L) + g(L)545

using PositiveSet_def Int_ZF_1_3_L18 Int_ZF_2_L15F
by simpultimately have L ∈ ZZ+ K ≤ (f+g)(L)by autothen have ∃ n ∈ZZ+ . K ≤ (f+g)(n)by auto} with A1 show f+g ∈ S +using Int_ZF_2_1_L12C Int_ZF_2_3_L7 by simp
qed

The composition of positive slopes is a positive slope.
theorem (in int1) comp_of_pos_sls_is_pos_sl:
assumes A1: f ∈ S + g ∈ S +shows f◦g ∈ S +proof { fix K assume K∈ZZ
with A1 have ∃ N∈ZZ+ . ∀ m. N≤m −→ K ≤ f(m)using Int_ZF_2_3_L5 by simp
then obtain N where N∈ZZ+ and I: ∀ m. N≤m −→ K ≤ f(m)by autowith A1 have ∃ M∈ZZ+ . N ≤ g(M)using PositiveSet_def Int_ZF_2_3_L6A by simp
then obtain M where M∈ZZ+ N ≤ g(M)by autowith A1 I have ∃ M∈ZZ+ . K ≤ (f◦g)(M)using PositiveSet_def Int_ZF_2_1_L10
by auto} with A1 show f◦g ∈ S +using Int_ZF_2_1_L11 Int_ZF_2_3_L7
by simpqed

A slope equivalent to a positive one is positive.
lemma (in int1) Int_ZF_2_3_L9:
assumes A1: f ∈ S + and A2: hf,gi ∈ AlEqRel shows g ∈ S +proof from A2 have T: g∈S and ∃ L∈ZZ. ∀ m∈ZZ. abs(f(m)-g(m)) ≤ Lusing Int_ZF_2_1_L9A by auto
then obtain L where
I: L∈ZZ and II: ∀ m∈ZZ. abs(f(m)-g(m)) ≤ L
by auto{ fix K assume A3: K∈ZZ
with I have K+L ∈ ZZ
using Int_ZF_1_1_L5 by simp
with A1 obtain M where III: M∈ZZ+ and IV: K+L ≤ f(M)using Int_ZF_2_3_L6A by autowith A1 A3 I have K ≤ f(M)-L
using PositiveSet_def Int_ZF_2_1_L2B Int_ZF_2_L9B
by simp546

moreover from A1 T II III havef(M)-L ≤ g(M)using PositiveSet_def Int_ZF_2_1_L2B Int_triangle_ineq2
by simpultimately have K ≤ g(M)by (rule Int_order_transitive)
with III have ∃ n∈ZZ+ . K ≤ g(n)by auto} with T show g ∈ S +using Int_ZF_2_3_L7 by simp
qed

The set of positive slopes is saturated with respect to the relation of equivalence of slopes.
lemma (in int1) pos_slopes_saturated: shows IsSaturated(AlEqRel,S + )proof haveequiv(S,AlEqRel)
AlEqRel ⊆ S × S
using Int_ZF_2_1_L9B by auto
moreover have S + ⊆ S by auto
moreover have ∀ f∈S + . ∀ g∈S. hf,gi ∈ AlEqRel −→ g ∈ S +using Int_ZF_2_3_L9 by blast
ultimately show IsSaturated(AlEqRel,S + )by (rule EquivClass_3_L3)
qed

A technical lemma involving a projection of the set of positive slopes and alogical epression with exclusive or.
lemma (in int1) Int_ZF_2_3_L10:
assumes A1: f∈S g∈S
and A2: R = {AlEqRel{s}. s∈S + }and A3: (f∈S + ) Xor (g∈S + )shows (AlEqRel{f} ∈ R) Xor (AlEqRel{g} ∈ R)
proof from A1 A2 A3 haveequiv(S,AlEqRel)
IsSaturated(AlEqRel,S + )S+ ⊆ Sf∈S g∈S
R = {AlEqRel{s}. s∈S + }(f∈S + ) Xor (g∈S + )using pos_slopes_saturated Int_ZF_2_1_L9B by auto
then show thesis by (rule EquivClass_3_L7)
qed

Identity function is a positive slope.
lemma (in int1) Int_ZF_2_3_L11: shows id(ZZ) ∈ S +547

proof let f = id(ZZ){ fix K assume K∈ZZ
then obtain n where T: n∈ZZ+ and K≤nusing Int_ZF_1_5_L9 by auto
moreover from T have f(n) = n
using PositiveSet_def by simp
ultimately have n∈ZZ+ and K≤f(n)by autothen have ∃ n∈ZZ+ . K≤f(n) by auto
} then show f ∈ S +using Int_ZF_2_1_L17 Int_ZF_2_3_L7 by simp
qed

The identity function is not almost equal to any bounded function.
lemma (in int1) Int_ZF_2_3_L12: assumes A1: f ∈ FinRangeFunctions(ZZ,ZZ)
shows ¬(id(ZZ) ∼ f)proof { from A1 have id(ZZ) ∈ S +using Int_ZF_2_3_L11 by simp
moreover assume hid(ZZ),fi ∈ AlEqRel
ultimately have f ∈ S +by (rule Int_ZF_2_3_L9)
with A1 have False using Int_ZF_2_3_L1B
by simp} then show ¬(id(ZZ) ∼ f) by auto
qed

45.2

Inverting slopes

Not every slope is a 1:1 function. However, we can still invert slopes in thesense that if f is a slope, then we can find a slope g such that f ◦ g is almost
equal to the identity function. The goal of this this section is to establish
this fact for positive slopes.
If f is a positive slope, then for every positive integer p the set {n ∈ Z+ :p ≤ f (n)} is a nonempty subset of positive integers. Recall that f −1 (p) is
the notation for the smallest element of this set.
lemma (in int1) Int_ZF_2_4_L1:
assumes A1: f ∈ S + and A2: p∈ZZ+ and A3: A = {n∈ZZ+ . p ≤ f(n)}showsA ⊆ ZZ+
A 6= 0f−1 (p) ∈ A∀ m∈A. f−1 (p) ≤ m
proof from A3 show I: A ⊆ ZZ+ by autofrom A1 A2 have ∃ n∈ZZ+ . p ≤ f(n)548

using PositiveSet_def Int_ZF_2_3_L6A by simp
with A3 show II: A 6= 0 by autofrom A3 I II show
f−1 (p) ∈ A∀ m∈A. f−1 (p) ≤ musing Int_ZF_1_5_L1C by autoqed

If f is a positive slope and p is a positive integer p, then f −1 (p) (defined as
the minimum of the set {n ∈ Z+ : p ≤ f (n)} ) is a (well defined) positive
integer.
lemma (in int1) Int_ZF_2_4_L2:
assumes f ∈ S + and p∈ZZ+
shows
f−1 (p) ∈ ZZ+
p ≤ f(f−1 (p))
using assms Int_ZF_2_4_L1 by auto

If f is a positive slope and p is a positive integer such that n ≤ f (p), thenf −1 (n) ≤ p.
lemma (in int1) Int_ZF_2_4_L3:
assumes f ∈ S + and m∈ZZ+ p∈ZZ+ and m ≤ f(p)shows f−1 (m) ≤ pusing assms Int_ZF_2_4_L1 by simp

An upper bound f (f −1 (m) − 1) for positive slopes.
lemma (in int1) Int_ZF_2_4_L4:assumes A1: f ∈ S + and A2: m∈ZZ+ and A3: f−1 (m)-1 ∈ ZZ+
shows f(f−1 (m)-1) ≤ m
f(f−1 (m)-1) 6= m
proof from A1 A2 have T: f−1 (m) ∈ ZZ using Int_ZF_2_4_L2 PositiveSet_def
by simpfrom A1 A3 have f:ZZ→ZZ and f−1 (m)-1 ∈ ZZ
using Int_ZF_2_3_L1 PositiveSet_def by autowith A1 A2 have T1: f(f−1 (m)-1) ∈ ZZ m∈ZZ
using apply_funtype PositiveSet_def by auto
{ assume m ≤ f(f−1 (m)-1)
with A1 A2 A3 have f−1 (m) ≤ f−1 (m)-1
by (rule Int_ZF_2_4_L3)
with T have False using Int_ZF_1_2_L3AA
by simp} then have I: ¬(m ≤ f(f−1 (m)-1)) by autowith T1 show f(f−1 (m)-1) ≤ mby (rule Int_ZF_2_L19)
from T1 I show f(f−1 (m)-1) 6= mby (rule Int_ZF_2_L19)
qed

The (candidate for) the inverse of a positive slope is nondecreasing.
549

lemma (in int1) Int_ZF_2_4_L5:
assumes A1: f ∈ S + and A2: m∈ZZ+ and A3: m≤nshows f−1 (m) ≤ f−1 (n)proof from A2 A3 have T: n ∈ ZZ+ using Int_ZF_1_5_L7 by blast
with A1 have n ≤ f(f−1 (n)) using Int_ZF_2_4_L2
by simpwith A3 have m ≤ f(f−1 (n)) by (rule Int_order_transitive)
with A1 A2 T show f−1 (m) ≤ f−1 (n)using Int_ZF_2_4_L2 Int_ZF_2_4_L3 by simp
qed

If f −1 (m) is positive and n is a positive integer, then, then f −1 (m + n) − 1
is positive.
lemma (in int1) Int_ZF_2_4_L6:
assumes A1: f ∈ S + and A2: m∈ZZ+ n∈ZZ+ andA3: f−1 (m)-1 ∈ ZZ+
shows f−1 (m+n)-1 ∈ ZZ+
proof from A1 A2 have f−1 (m)-1 ≤ f−1 (m+n) - 1
using PositiveSet_def Int_ZF_1_5_L7A Int_ZF_2_4_L2
Int_ZF_2_4_L5 int_zero_one_are_int Int_ZF_1_1_L4
int_ord_transl_inv by simp
with A3 show f−1 (m+n)-1 ∈ ZZ+ using Int_ZF_1_5_L7
by blast
qed

If f is a slope, then f (f −1 (m + n) − f −1 (m) − f −1 (n)) is uniformly bounded
above and below. Will it be the messiest IsarMathLib proof ever? Only time
will tell.
lemma (in int1) Int_ZF_2_4_L7: assumes A1: f ∈ S + andA2: ∀ m∈ZZ+ . f−1 (m)-1 ∈ ZZ+
shows∃ U∈ZZ. ∀ m∈ZZ+ . ∀ n∈ZZ+ . f(f−1 (m+n)-f−1 (m)-f−1 (n)) ≤ U∃ N∈ZZ. ∀ m∈ZZ+ . ∀ n∈ZZ+ . N ≤ f(f−1 (m+n)-f−1 (m)-f−1 (n))
proof from A1 have ∃ L∈ZZ. ∀ r∈ZZ. f(r) ≤ f(r-1) + L
using Int_ZF_2_1_L28 by simp
then obtain L where
I: L∈ZZ and II: ∀ r∈ZZ. f(r) ≤ f(r-1) + L
by autofrom A1 have
∃ M∈ZZ. ∀ r∈ZZ.∀ p∈ZZ.∀ q∈ZZ. f(r-p-q) ≤ f(r)-f(p)-f(q)+M∃ K∈ZZ. ∀ r∈ZZ.∀ p∈ZZ.∀ q∈ZZ. f(r)-f(p)-f(q)+K ≤ f(r-p-q)
using Int_ZF_2_1_L30 by auto
then obtain M K where III: M∈ZZ andIV: ∀ r∈ZZ.∀ p∈ZZ.∀ q∈ZZ. f(r-p-q) ≤ f(r)-f(p)-f(q)+M
and
V: K∈ZZ and VI: ∀ r∈ZZ.∀ p∈ZZ.∀ q∈ZZ. f(r)-f(p)-f(q)+K ≤ f(r-p-q)

550

by auto
from I III V have
L+M ∈ ZZ (-L) - L + K ∈ ZZ
using Int_ZF_1_1_L4 Int_ZF_1_1_L5 by auto
moreover{ fix m nassume A3: m∈ZZ+ n∈ZZ+have f(f−1 (m+n)-f−1 (m)-f−1 (n)) ≤ L+M ∧(-L)-L+K ≤ f(f−1 (m+n)-f−1 (m)-f−1 (n))
proof let r = f−1 (m+n)
let p = f−1 (m)let q = f−1 (n)from A1 A3 have T1:
p ∈ ZZ+ q ∈ ZZ+ r ∈ ZZ+
using Int_ZF_2_4_L2 pos_int_closed_add_unfolded by autowith A3 have T2:m ∈ ZZ n ∈ ZZ p ∈ ZZ q ∈ ZZ r ∈ ZZ
using PositiveSet_def by autofrom A2 A3 have T3:
r-1 ∈ ZZ+ p-1 ∈ ZZ+ q-1 ∈ ZZ+
using pos_int_closed_add_unfolded by autofrom A1 A3 have VII:m+n ≤ f(r)m ≤ f(p)n ≤ f(q)using Int_ZF_2_4_L2 pos_int_closed_add_unfolded by autofrom A1 A3 T3 have VIII:f(r-1) ≤ m+nf(p-1) ≤ m
f(q-1) ≤ nusing pos_int_closed_add_unfolded Int_ZF_2_4_L4 by auto
have f(r-p-q) ≤ L+M
proof from IV T2 have f(r-p-q) ≤ f(r)-f(p)-f(q)+M
by simpmoreoverfrom I II T2 VIII havef(r) ≤ f(r-1) + L
f(r-1) + L ≤ m+n+Lusing int_ord_transl_inv by auto
then have f(r) ≤ m+n+Lby (rule Int_order_transitive)
with VII have f(r) - f(p) ≤ m+n+L-musing int_ineq_add_sides by simp
with I T2 VII have f(r) - f(p) - f(q) ≤ n+L-nusing Int_ZF_1_2_L9 int_ineq_add_sides by simp
with I III T2 have f(r) - f(p) - f(q) + M ≤ L+M
using Int_ZF_1_2_L3 int_ord_transl_inv by simp

551

ultimately show f(r-p-q) ≤ L+M
by (rule Int_order_transitive)qed
moreover have (-L)-L +K ≤ f(r-p-q)
proof from I II T2 VIII havef(p) ≤ f(p-1) + L
f(p-1) + L ≤ m +L
using int_ord_transl_inv by auto
then have f(p) ≤ m +Lby (rule Int_order_transitive)
with VII have m+n -(m+L) ≤ f(r) - f(p)using int_ineq_add_sides by simp
with I T2 have n - L ≤ f(r) - f(p)using Int_ZF_1_2_L9 by simp
moreoverfrom I II T2 VIII havef(q) ≤ f(q-1) + L
f(q-1) + L ≤ n +L
using int_ord_transl_inv by auto
then have f(q) ≤ n +Lby (rule Int_order_transitive)
ultimately haven - L - (n+L) ≤ f(r) - f(p) - f(q)using int_ineq_add_sides by simp
with I V T2 have(-L)-L +K ≤ f(r) - f(p) - f(q) + K
using Int_ZF_1_2_L3 int_ord_transl_inv by simp
moreover from VI T2 havef(r) - f(p) - f(q) + K ≤ f(r-p-q)
by simpultimately show (-L)-L +K ≤ f(r-p-q)
by (rule Int_order_transitive)qed
ultimately showf(r-p-q) ≤ L+M ∧(-L)-L+K ≤ f(f−1 (m+n)-f−1 (m)-f−1 (n))
by simpqed}
ultimately show
∃ U∈ZZ. ∀ m∈ZZ+ . ∀ n∈ZZ+ . f(f−1 (m+n)-f−1 (m)-f−1 (n)) ≤ U∃ N∈ZZ. ∀ m∈ZZ+ . ∀ n∈ZZ+ . N ≤ f(f−1 (m+n)-f−1 (m)-f−1 (n))
by autoqed

The expression f −1 (m + n) − f −1 (m) − f −1 (n) is uniformly bounded for all
pairs hm, ni ∈ ZZ+ ×ZZ+ . Recall that in the int1 context ε(f,x) is defined sothat ε(f, hm, ni) = f −1 (m + n) − f −1 (m) − f −1 (n).

552

lemma (in int1) Int_ZF_2_4_L8: assumes A1: f ∈ S + andA2: ∀ m∈ZZ+ . f−1 (m)-1 ∈ ZZ+
shows ∃ M. ∀ x∈ZZ+ ×ZZ+ . abs(ε(f,x)) ≤ M
proof from A1 A2 have
∃ U∈ZZ. ∀ m∈ZZ+ . ∀ n∈ZZ+ . f(f−1 (m+n)-f−1 (m)-f−1 (n)) ≤ U∃ N∈ZZ. ∀ m∈ZZ+ . ∀ n∈ZZ+ . N ≤ f(f−1 (m+n)-f−1 (m)-f−1 (n))
using Int_ZF_2_4_L7 by auto
then obtain U N where I:∀ m∈ZZ+ . ∀ n∈ZZ+ . f(f−1 (m+n)-f−1 (m)-f−1 (n)) ≤ U∀ m∈ZZ+ . ∀ n∈ZZ+ . N ≤ f(f−1 (m+n)-f−1 (m)-f−1 (n))
by autohave ZZ+ ×ZZ+ 6= 0 using int_one_two_are_pos by auto
moreover from A1 have f: ZZ→ZZ
using AlmostHoms_def by simp
moreover from A1 have
∀ a∈ZZ.∃ b∈ZZ+ .∀ x. b≤x −→ a ≤ f(x)using Int_ZF_2_3_L5 by simp
moreover from A1 have
∀ a∈ZZ.∃ b∈ZZ+ .∀ y. b≤y −→ f(-y) ≤ ausing Int_ZF_2_3_L5A by simp
moreover have
∀ x∈ZZ+ ×ZZ+ . ε(f,x) ∈ ZZ ∧ f(ε(f,x)) ≤ U ∧ N ≤ f(ε(f,x))
proof { fix x assume A3: x ∈ ZZ+ ×ZZ+
let m = fst(x)let n = snd(x)from A3 have T: m ∈ ZZ+ n ∈ ZZ+ m+n ∈ ZZ+
using pos_int_closed_add_unfolded by autowith A1 havef−1 (m+n) ∈ ZZ f−1 (m) ∈ ZZ f−1 (n) ∈ ZZ
using Int_ZF_2_4_L2 PositiveSet_def by autowith I T haveε(f,x) ∈ ZZ ∧ f(ε(f,x)) ≤ U ∧ N ≤ f(ε(f,x))
using Int_ZF_1_1_L5 by auto
} thus thesis by simp
qed
ultimately show ∃ M.∀ x∈ZZ+ ×ZZ+ . abs(ε(f,x)) ≤ M
by (rule Int_ZF_1_6_L4)
qed

The (candidate for) inverse of a positive slope is a (well defined) function
on ZZ+ .
lemma (in int1) Int_ZF_2_4_L9:
assumes A1: f ∈ S + and A2: g = {hp,f−1 (p)i. p∈ZZ+ }shows
g : ZZ+ →ZZ+
g : ZZ+ →ZZ
proof -

553

from A1 have
∀ p∈ZZ+ . f−1 (p) ∈ ZZ+∀ p∈ZZ+ . f−1 (p) ∈ ZZ
using Int_ZF_2_4_L2 PositiveSet_def by autowith A2 showg : ZZ+ →ZZ+ and g : ZZ+ →ZZ
using ZF_fun_from_total by autoqedWhat are the values of the (candidate for) the inverse of a positive slope?
lemma (in int1) Int_ZF_2_4_L10:
assumes A1: f ∈ S + and A2: g = {hp,f−1 (p)i. p∈ZZ+ } and A3: p∈ZZ+
shows g(p) = f−1 (p)proof from A1 A2 have g : ZZ+ →ZZ+ using Int_ZF_2_4_L9 by simp
with A2 A3 show g(p) = f−1 (p) using ZF_fun_from_tot_val by simpqed

The (candidate for) the inverse of a positive slope is a slope.
lemma (in int1) Int_ZF_2_4_L11: assumes A1: f ∈ S + andA2: ∀ m∈ZZ+ . f−1 (m)-1 ∈ ZZ+ andA3: g = {hp,f−1 (p)i. p∈ZZ+ }shows OddExtension(ZZ,IntegerAddition,IntegerOrder,g) ∈ S
proof from A1 A2 have ∃ L. ∀ x∈ZZ+ ×ZZ+ . abs(ε(f,x)) ≤ Lusing Int_ZF_2_4_L8 by simp
then obtain L where I: ∀ x∈ZZ+ ×ZZ+ . abs(ε(f,x)) ≤ L
by autofrom A1 A3 have g : ZZ+ →ZZ using Int_ZF_2_4_L9
by simpmoreover have ∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(g,m,n)) ≤ L
proof { fix m n
assume A4: m∈ZZ+ n∈ZZ+
then have hm,ni ∈ ZZ+ ×ZZ+ by simp
with I have abs(ε(f,hm,ni)) ≤ L by simp
moreover have ε(f,hm,ni) = f−1 (m+n) - f−1 (m) - f−1 (n)by simpmoreover from A1 A3 A4 havef−1 (m+n) = g(m+n) f−1 (m) = g(m) f−1 (n) = g(n)using pos_int_closed_add_unfolded Int_ZF_2_4_L10 by auto
ultimately have abs(δ(g,m,n)) ≤ L by simp
} thus ∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(g,m,n)) ≤ L by simp
qed
ultimately show thesis by (rule Int_ZF_2_1_L24)
qed

Every positive slope that is at least 2 on positive integers almost has aninverse.
554

lemma (in int1) Int_ZF_2_4_L12: assumes A1: f ∈ S + andA2: ∀ m∈ZZ+ . f−1 (m)-1 ∈ ZZ+
shows ∃ h∈S. f◦h ∼ id(ZZ)
proof let g = {hp,f−1 (p)i. p∈ZZ+ }let h = OddExtension(ZZ,IntegerAddition,IntegerOrder,g)from A1 have
∃ M∈ZZ. ∀ n∈ZZ. f(n) ≤ f(n-1) + M
using Int_ZF_2_1_L28 by simp
then obtain M where
I: M∈ZZ and II: ∀ n∈ZZ. f(n) ≤ f(n-1) + M
by autofrom A1 A2 have T: h ∈ Susing Int_ZF_2_4_L11 by simp
moreover have f◦h ∼ id(ZZ)
proof from A1 T have f◦h ∈ S using Int_ZF_2_1_L11
by simpmoreover note I
moreover{ fix m assume A3: m∈ZZ+
with A1 have f−1 (m) ∈ ZZ
using Int_ZF_2_4_L2 PositiveSet_def by simp
with II have f(f−1 (m)) ≤ f(f−1 (m)-1) + M
by simpmoreover from A1 A2 I A3 have f(f−1 (m)-1) + M ≤ m+M
using Int_ZF_2_4_L4 int_ord_transl_inv by simp
ultimately have f(f−1 (m)) ≤ m+M
by (rule Int_order_transitive)
moreover from A1 A3 have m ≤ f(f−1 (m))
using Int_ZF_2_4_L2 by simp
moreover from A1 A2 T A3 have f(f−1 (m)) = (f◦h)(m)using Int_ZF_2_4_L9 Int_ZF_1_5_L11
Int_ZF_2_4_L10 PositiveSet_def Int_ZF_2_1_L10
by simpultimately have m ≤ (f◦h)(m) ∧ (f◦h)(m) ≤ m+M
by simp }
ultimately show f◦h ∼ id(ZZ) using Int_ZF_2_1_L32
by simpqed
ultimately show ∃ h∈S. f◦h ∼ id(ZZ)
by autoqed
Int_ZF_2_4_L12 is almost what we need, except that it has an assumptionthat the values of the slope that we get the inverse for are not smaller than 2on positive integers. The Arthan’s proof of Theorem 11 has a mistake where
he says ”note that for all but finitely many m, n ∈ N p = g(m) and q = g(n)are both positive”. Of course there may be infinitely many pairs hm, ni such555

that p, q are not both positive. This is however easy to workaround: we justmodify the slope by adding a constant so that the slope is large enough on
positive integers and then look for the inverse.
theorem (in int1) pos_slope_has_inv: assumes A1: f ∈ S +shows ∃ g∈S. f∼g ∧ (∃ h∈S. g◦h ∼ id(ZZ))
proof from A1 have f: ZZ→ZZ 1∈ZZ 2 ∈ ZZ
using AlmostHoms_def int_zero_one_are_int int_two_three_are_int
by automoreover from A1 have
∀ a∈ZZ.∃ b∈ZZ+ .∀ x. b≤x −→ a ≤ f(x)using Int_ZF_2_3_L5 by simp
ultimately have
∃ c∈ZZ. 2 ≤ Minimum(IntegerOrder,{n∈ZZ+ . 1 ≤ f(n)+c})by (rule Int_ZF_1_6_L7)
then obtain c where I: c∈ZZ and
II: 2 ≤ Minimum(IntegerOrder,{n∈ZZ+ . 1 ≤ f(n)+c})
by autolet g = {hm,f(m)+ci. m∈ZZ}
from A1 I have III: g∈S and IV: f∼g using Int_ZF_2_1_L33
by autofrom IV have hf,gi ∈ AlEqRel by simp
with A1 have T: g ∈ S + by (rule Int_ZF_2_3_L9)
moreover have ∀ m∈ZZ+ . g−1 (m)-1 ∈ ZZ+
proof
fix m assume A2: m∈ZZ+
from A1 I II have V: 2 ≤ g−1 (1)using Int_ZF_2_1_L33 PositiveSet_def by simp
moreover from A2 T have g−1 (1) ≤ g−1 (m)using Int_ZF_1_5_L3 int_one_two_are_pos Int_ZF_2_4_L5
by simpultimately have 2 ≤ g−1 (m)by (rule Int_order_transitive)then have 2-1 ≤ g−1 (m)-1
using int_zero_one_are_int Int_ZF_1_1_L4 int_ord_transl_inv
by simpthen show g−1 (m)-1 ∈ ZZ+
using int_zero_one_are_int Int_ZF_1_2_L3 Int_ZF_1_5_L3
by simpqed
ultimately have ∃ h∈S. g◦h ∼ id(ZZ)
by (rule Int_ZF_2_4_L12)
with III IV show thesis by auto
qed

556

45.3

CompletenessIn this section we consider properties of slopes that are needed for the proof
of completeness of real numbers constructred in Real_ZF_1.thy. In particular
we consider properties of embedding of integers into the set of slopes by themapping m 7→ mS , where mS is defined by mS (n) = m · n.
If m is an integer, then mS is a slope whose value is m · n for every integer.
lemma (in int1) Int_ZF_2_5_L1: assumes A1: m ∈ ZZ
shows
∀ n ∈ ZZ. (mS )(n) = m·nmS ∈ S
proof from A1 have I: mS :ZZ→ZZ
using Int_ZF_1_1_L5 ZF_fun_from_total by simp
then show II: ∀ n ∈ ZZ. (mS )(n) = m·n using ZF_fun_from_tot_val
by simp{ fix n k
assume A2: n∈ZZ k∈ZZ
with A1 have T: m·n ∈ ZZ m·k ∈ ZZ
using Int_ZF_1_1_L5 by autofrom A1 A2 II T have δ(mS ,n,k) = m·k - m·kusing Int_ZF_1_1_L5 Int_ZF_1_1_L1 Int_ZF_1_2_L3
by simp
also from T have . . . = 0 using Int_ZF_1_1_L4
by simp
finally have δ(mS ,n,k) = 0 by simp
then have abs(δ(mS ,n,k)) ≤ 0
using Int_ZF_2_L18 int_zero_one_are_int int_ord_is_refl refl_def
by simp} then have ∀ n∈ZZ.∀ k∈ZZ. abs(δ(mS ,n,k)) ≤ 0
by simpwith I show mS ∈ S by (rule Int_ZF_2_1_L5)
qed

For any slope f there is an integer m such that there is some slope g thatis almost equal to mS and dominates f in the sense that f ≤ g on positive
integers (which implies that either g is almost equal to f or g −f is a positive
slope. This will be used in Real_ZF_1.thy to show that for any real number
there is an integer that (whose real embedding) is greater or equal.
lemma (in int1) Int_ZF_2_5_L2: assumes A1: f ∈ Sshows ∃ m∈ZZ. ∃ g∈S. (mS ∼g ∧ (f∼g ∨ g+(-f) ∈ S + ))proof from A1 have∃ m k. m∈ZZ ∧ k∈ZZ ∧ (∀ p∈ZZ. abs(f(p)) ≤ m·abs(p)+k)
using Arthan_Lem_8 by simp
then obtain m k where I: m∈ZZ and II: k∈ZZ and
III: ∀ p∈ZZ. abs(f(p)) ≤ m·abs(p)+k557

by auto
let g = {hn,mS (n) +ki. n∈ZZ}from I have IV: mS ∈ S using Int_ZF_2_5_L1 by simp
with II have V: g∈S and VI: mS ∼g using Int_ZF_2_1_L33
by auto{ fix n assume A2: n∈ZZ+with A1 have f(n) ∈ ZZ
using Int_ZF_2_1_L2B PositiveSet_def by simp
then have f(n) ≤ abs(f(n)) using Int_ZF_2_L19C
by simpmoreoverfrom III A2 have abs(f(n)) ≤ m·abs(n) + k
using PositiveSet_def by simp
with A2 have abs(f(n)) ≤ m·n+kusing Int_ZF_1_5_L4A by simp
ultimately have f(n) ≤ m·n+kby (rule Int_order_transitive)
moreoverfrom II IV A2 have g(n) = (mS )(n)+kusing Int_ZF_2_1_L33 PositiveSet_def by simp
with I A2 have g(n) = m·n+kusing Int_ZF_2_5_L1 PositiveSet_def by simp
ultimately have f(n) ≤ g(n)by simp} then have ∀ n∈ZZ+ . f(n) ≤ g(n)by simpwith A1 V have f∼g ∨ g + (-f) ∈ S +using Int_ZF_2_3_L4C by simp
with I V VI show thesis by autoqed

The negative of an integer embeds in slopes as a negative of the orgiginal
embedding.
lemma (in int1) Int_ZF_2_5_L3: assumes A1: m ∈ ZZ
shows (-m)S = -(mS )proof from A1 have (-m)S : ZZ→ZZ and (-(mS )): ZZ→ZZ
using Int_ZF_1_1_L4 Int_ZF_2_5_L1 AlmostHoms_def Int_ZF_2_1_L12
by automoreover have ∀ n∈ZZ. ((-m)S )(n) = (-(mS ))(n)proof
fix n assume A2: n∈ZZwith A1 have((-m)S )(n) = (-m)·n(-(mS ))(n) = -(m·n)
using Int_ZF_1_1_L4 Int_ZF_2_5_L1 Int_ZF_2_1_L12A
by autowith A1 A2 show ((-m)S )(n) = (-(mS ))(n)using Int_ZF_1_1_L5 by simp

558

qed
ultimately show (-m)S = -(mS ) using fun_extension_iff
by simpqed

The sum of embeddings is the embeding of the sum.
lemma (in int1) Int_ZF_2_5_L3A: assumes A1: m∈ZZ k∈ZZshows (mS ) + (kS ) = ((m+k)S )proof from A1 have T1: m+k ∈ ZZ using Int_ZF_1_1_L5
by simpwith A1 have T2:(mS ) ∈ S (kS ) ∈ S(m+k)S ∈ S(mS ) + (kS ) ∈ S
using Int_ZF_2_5_L1 Int_ZF_2_1_L12C by auto
then have(mS ) + (kS ) : ZZ→ZZ(m+k)S : ZZ→ZZ
using AlmostHoms_def by auto
moreover have ∀ n∈ZZ. ((mS ) + (kS ))(n) = ((m+k)S )(n)proof
fix n assume A2: n∈ZZwith A1 T1 T2 have ((mS ) + (kS ))(n) = (m+k)·nusing Int_ZF_2_1_L12B Int_ZF_2_5_L1 Int_ZF_1_1_L1
by simp
also from T1 A2 have . . . = ((m+k)S )(n)using Int_ZF_2_5_L1 by simp
finally show ((mS ) + (kS ))(n) = ((m+k)S )(n)by simpqed
ultimately show (mS ) + (kS ) = ((m+k)S )using fun_extension_iff by simp
qed

The composition of embeddings is the embeding of the product.
lemma (in int1) Int_ZF_2_5_L3B: assumes A1: m∈ZZ
shows (mS ) ◦ (kS ) = ((m·k)S )proof from A1 have T1: m·k ∈ ZZ using Int_ZF_1_1_L5
by simpwith A1 have T2:(mS ) ∈ S (kS ) ∈ S(m·k)S ∈ S(mS ) ◦ (kS ) ∈ S
using Int_ZF_2_5_L1 Int_ZF_2_1_L11 by auto
then have(mS ) ◦ (kS ) : ZZ→ZZ(m·k)S : ZZ→ZZ

559

k∈ZZ

using AlmostHoms_def by auto
moreover have ∀ n∈ZZ. ((mS ) ◦ (kS ))(n) = ((m·k)S )(n)proof
fix n assume A2: n∈ZZwith A1 T2 have((mS ) ◦ (kS ))(n) = (mS )(k·n)
using Int_ZF_2_1_L10 Int_ZF_2_5_L1 by simp
moreoverfrom A1 A2 have k·n ∈ ZZ using Int_ZF_1_1_L5
by simpwith A1 A2 have (mS )(k·n) = m·k·n
using Int_ZF_2_5_L1 Int_ZF_1_1_L7 by simp
ultimately have ((mS ) ◦ (kS ))(n) = m·k·n
by simp
also from T1 A2 have m·k·n = ((m·k)S )(n)using Int_ZF_2_5_L1 by simp
finally show ((mS ) ◦ (kS ))(n) = ((m·k)S )(n)by simpqed
ultimately show (mS ) ◦ (kS ) = ((m·k)S )using fun_extension_iff by simp
qed

Embedding integers in slopes preserves order.
lemma (in int1) Int_ZF_2_5_L4: assumes A1: m≤nshows (mS ) ∼ (nS ) ∨ (nS )+(-(mS )) ∈ S +proof from A1 have mS ∈ S and nS ∈ S
using Int_ZF_2_L1A Int_ZF_2_5_L1 by auto
moreover from A1 have ∀ k∈ZZ+ . (mS )(k) ≤ (nS )(k)using Int_ZF_1_3_L13B Int_ZF_2_L1A PositiveSet_def Int_ZF_2_5_L1
by simpultimately show thesis using Int_ZF_2_3_L4C
by simpqed

We aim at showing that m 7→ mS is an injection modulo the relation ofalmost equality. To do that we first show that if mS has finite range, thenm = 0.
lemma (in int1) Int_ZF_2_5_L5:
assumes m∈ZZ and mS ∈ FinRangeFunctions(ZZ,ZZ)
shows m=0
using assms FinRangeFunctions_def Int_ZF_2_5_L1 AlmostHoms_def
func_imagedef Int_ZF_1_6_L8 by simp

Embeddings of two integers are almost equal only if the integers are equal.
lemma (in int1) Int_ZF_2_5_L6:
assumes A1: m∈ZZ k∈ZZ and A2: (mS ) ∼ (kS )560

shows m=k
proof from A1 have T: m-k ∈ ZZ using Int_ZF_1_1_L5 by simp
from A1 have (-(kS )) = ((-k)S )using Int_ZF_2_5_L3 by simp
then have mS + (-(kS )) = (mS ) + ((-k)S )by simpwith A1 have mS + (-(kS )) = ((m-k)S )using Int_ZF_1_1_L4 Int_ZF_2_5_L3A by simp
moreover from A1 A2 have mS + (-(kS )) ∈ FinRangeFunctions(ZZ,ZZ)
using Int_ZF_2_5_L1 Int_ZF_2_1_L9D by simp
ultimately have (m-k)S ∈ FinRangeFunctions(ZZ,ZZ)
by simpwith T have m-k = 0 using Int_ZF_2_5_L5
by simpwith A1 show m=k by (rule Int_ZF_1_L15)
qed

Embedding of 1 is the identity slope and embedding of zero is a finite rangefunction.
lemma (in int1) Int_ZF_2_5_L7: shows
1S = id(ZZ)
0S ∈ FinRangeFunctions(ZZ,ZZ)
proof have id(ZZ) = {hx,xi. x∈ZZ}
using id_def by blast
then show 1S = id(ZZ) using Int_ZF_1_1_L4 by simp
have {0S (n). n∈ZZ} = {0·n. n∈ZZ}using int_zero_one_are_int Int_ZF_2_5_L1 by simp
also have . . . = {0} using Int_ZF_1_1_L4 int_not_empty
by simp
finally have {0S (n). n∈ZZ} = {0} by simp
then have {0S (n). n∈ZZ} ∈ Fin(ZZ)
using int_zero_one_are_int Finite1_L16 by simp
moreover have 0S : ZZ→ZZ
using int_zero_one_are_int Int_ZF_2_5_L1 AlmostHoms_def
by simpultimately show 0S ∈ FinRangeFunctions(ZZ,ZZ)
using Finite1_L19 by simpqed

A somewhat technical condition for a embedding of an integer to be ”less orequal” (in the sense apriopriate for slopes) than the composition of a slope
and another integer (embedding).
lemma (in int1) Int_ZF_2_5_L8:
assumes A1: f ∈ S and A2: N ∈ ZZ M ∈ ZZ andA3: ∀ n∈ZZ+ . M·n ≤ f(N·n)
shows MS ∼ f◦(NS ) ∨ (f◦(NS )) + (-(MS )) ∈ S +proof -

561

from A1 A2 have MS ∈ S f◦(NS ) ∈ S
using Int_ZF_2_5_L1 Int_ZF_2_1_L11 by auto
moreover from A1 A2 A3 have ∀ n∈ZZ+ . (MS )(n) ≤ (f◦(NS ))(n)using Int_ZF_2_5_L1 PositiveSet_def Int_ZF_2_1_L10
by simpultimately show thesis using Int_ZF_2_3_L4C
by simpqed

Another technical condition for the composition of a slope and an integer(embedding) to be ”less or equal” (in the sense apriopriate for slopes) thanembedding of another integer.
lemma (in int1) Int_ZF_2_5_L9:
assumes A1: f ∈ S and A2: N ∈ ZZ M ∈ ZZ andA3: ∀ n∈ZZ+ . f(N·n) ≤ M·nshows f◦(NS ) ∼ (MS ) ∨ (MS ) + (-(f◦(NS ))) ∈ S +proof from A1 A2 have f◦(NS ) ∈ S MS ∈ S
using Int_ZF_2_5_L1 Int_ZF_2_1_L11 by auto
moreover from A1 A2 A3 have ∀ n∈ZZ+ . (f◦(NS ))(n) ≤ (MS )(n)using Int_ZF_2_5_L1 PositiveSet_def Int_ZF_2_1_L10
by simpultimately show thesis using Int_ZF_2_3_L4C
by simp
qed
end

46

Construction real numbers - the generic part

theory Real_ZF imports Int_ZF_IML Ring_ZF_1
begin

The goal of the Real_ZF series of theory files is to provide a contruction of
the set of real numbers. There are several ways to construct real numbers.
Most common start from the rational numbers and use Dedekind cuts or
Cauchy sequences. Real_ZF_x.thy series formalizes an alternative approachthat constructs real numbers directly from the group of integers. Our formalization is mostly based on [2]. Different variants of this contruction are
also described in [1] and [3]. I recommend to read these papers, but for theimpatient here is a short description: we take a set of maps s : Z → Z suchthat the set {s(m + n) − s(m) − s(n)}n,m∈Z is finite (Z means the integers
here). We call these maps slopes. Slopes form a group with the natural
addition (s + r)(n) = s(n) + r(n). The maps such that the set s(Z) is finite(finite range functions) form a subgroup of slopes. The additive group ofreal numbers is defined as the quotient group of slopes by the (sub)group of562

finite range functions. The multiplication is defined as the projection of thecomposition of slopes into the resulting quotient (coset) space.

46.1

The definition of real numbers

This section contains the construction of the ring of real numbers as classesof slopes - integer almost homomorphisms. The real definitions are inGroup_ZF_2 theory, here we just specialize the definitions of almost homomorphisms, their equivalence and operations to the additive group of integers
from the general case of abelian groups considered in Group_ZF_2.
The set of slopes is defined as the set of almost homomorphisms on the
additive group of integers.
definition
Slopes ≡ AlmostHoms(int,IntegerAddition)

The first operation on slopes (pointwise addition) is a special case of thefirst operation on almost homomorphisms.
definition
SlopeOp1 ≡ AlHomOp1(int,IntegerAddition)

The second operation on slopes (composition) is a special case of the second
operation on almost homomorphisms.
definition
SlopeOp2 ≡ AlHomOp2(int,IntegerAddition)

Bounded integer maps are functions from integers to integers that have finite
range. They play a role of zero in the set of real numbers we are constructing.
definition
BoundedIntMaps ≡ FinRangeFunctions(int,int)

Bounded integer maps form a normal subgroup of slopes. The equivalence
relation on slopes is the (group) quotient relation defined by this subgroup.
definition
SlopeEquivalenceRel ≡ QuotientGroupRel(Slopes,SlopeOp1,BoundedIntMaps)

The set of real numbers is the set of equivalence classes of slopes.
definition
RealNumbers ≡ Slopes//SlopeEquivalenceRel

The addition on real numbers is defined as the projection of pointwise addition of slopes on the quotient. This means that the additive group of real
numbers is the quotient group: the group of slopes (with pointwise addition)
defined by the normal subgroup of bounded integer maps.
definition

563

RealAddition ≡ ProjFun2(Slopes,SlopeEquivalenceRel,SlopeOp1)

Multiplication is defined as the projection of composition of slopes on thequotient. The fact that it works is probably the most surprising part of theconstruction.
definition
RealMultiplication ≡ ProjFun2(Slopes,SlopeEquivalenceRel,SlopeOp2)

We first show that we can use theorems proven in some proof contexts (locales). The locale group1 requires assumption that we deal with an abeliangroup. The next lemma allows to use all theorems proven in the context
called group1.
lemma Real_ZF_1_L1: shows group1(int,IntegerAddition)using group1_axioms.intro group1_def Int_ZF_1_T2 by simp

Real numbers form a ring. This is a special case of the theorem proven in
Ring_ZF_1.thy, where we show the same in general for almost homomorphisms rather than slopes.
theorem Real_ZF_1_T1: shows IsAring(RealNumbers,RealAddition,RealMultiplication)
proof let AH = AlmostHoms(int,IntegerAddition)
let Op1 = AlHomOp1(int,IntegerAddition)
let FR = FinRangeFunctions(int,int)
let Op2 = AlHomOp2(int,IntegerAddition)
let R = QuotientGroupRel(AH,Op1,FR)
let A = ProjFun2(AH,R,Op1)
let M = ProjFun2(AH,R,Op2)
have IsAring(AH//R,A,M) using Real_ZF_1_L1 group1.Ring_ZF_1_1_T1
by simpthen show thesis using Slopes_def SlopeOp2_def SlopeOp1_def
BoundedIntMaps_def SlopeEquivalenceRel_def RealNumbers_def
RealAddition_def RealMultiplication_def by simpqed

We can use theorems proven in group0 and group1 contexts applied to thegroup of real numbers.
lemma Real_ZF_1_L2: showsgroup0(RealNumbers,RealAddition)
RealAddition {is commutative on} RealNumbers
group1(RealNumbers,RealAddition)
proof have
IsAgroup(RealNumbers,RealAddition)
RealAddition {is commutative on} RealNumbers
using Real_ZF_1_T1 IsAring_def by auto
then showgroup0(RealNumbers,RealAddition)

564

RealAddition {is commutative on} RealNumbers
group1(RealNumbers,RealAddition)using group1_axioms.intro group0_def group1_def
by autoqed

Let’s define some notation.
locale real0 =fixes real (IR)defines real_def [simp]: IR ≡ RealNumbers
fixes ra (infixl + 69)
defines ra_def [simp]: a+ b ≡ RealAdditionha,bifixes rminus (- _ 72)
defines rminus_def [simp]:-a ≡ GroupInv(IR,RealAddition)(a)fixes rsub (infixl - 69)
defines rsub_def [simp]: a-b ≡ a+(-b)
fixes rm (infixl · 70)
defines rm_def [simp]: a·b ≡ RealMultiplicationha,bifixes rzero (0)defines rzero_def [simp]:
0 ≡ TheNeutralElement(RealNumbers,RealAddition)
fixes rone (1)defines rone_def [simp]:
1 ≡ TheNeutralElement(RealNumbers,RealMultiplication)
fixes rtwo (2)defines rtwo_def [simp]: 2≡ 1+1

fixes non_zero (IR0 )defines non_zero_def[simp]: IR0 ≡ IR-{0}fixes inv (_−1 [90] 91)
defines inv_def[simp]:
a−1 ≡ GroupInv(IR0 ,restrict(RealMultiplication,IR0 ×IR0 ))(a)In real0 context all theorems proven in the ring0, context are valid.
lemma (in real0) Real_ZF_1_L3: shows
ring0(IR,RealAddition,RealMultiplication)using Real_ZF_1_T1 ring0_def ring0.Ring_ZF_1_L1
by autoLets try out our notation to see that zero and one are real numbers.
565

lemma (in real0) Real_ZF_1_L4: shows 0∈IR 1∈IRusing Real_ZF_1_L3 ring0.Ring_ZF_1_L2 by auto

The lemma below lists some properties that require one real number to state.
lemma (in real0) Real_ZF_1_L5: assumes A1: a∈IR
shows(-a) ∈ IR(-(-a)) = a
a+0 = a0+a = aa·1 = a1·a = aa-a = 0a-0 = ausing assms Real_ZF_1_L3 ring0.Ring_ZF_1_L3 by auto

The lemma below lists some properties that require two real numbers tostate.
lemma (in real0) Real_ZF_1_L6: assumes a∈IR b∈IR
showsa+b ∈ IRa-b ∈ IRa·b ∈ IRa+b = b+a(-a)·b = -(a·b)
a·(-b) = -(a·b)
using assms Real_ZF_1_L3 ring0.Ring_ZF_1_L4 ring0.Ring_ZF_1_L7
by autoMultiplication of reals is associative.
lemma (in real0) Real_ZF_1_L6A: assumes a∈IR b∈IR
shows a·(b·c) = (a·b)·c
using assms Real_ZF_1_L3 ring0.Ring_ZF_1_L11
by simpc∈IR

Addition is distributive with respect to multiplication.
lemma (in real0) Real_ZF_1_L7: assumes a∈IR b∈IR c∈IRshowsa·(b+c) = a·b + a·c(b+c)·a = b·a + c·aa·(b-c) = a·b - a·c(b-c)·a = b·a - c·ausing assms Real_ZF_1_L3 ring0.ring_oper_distr ring0.Ring_ZF_1_L8
by autoA simple rearrangement with four real numbers.
lemma (in real0) Real_ZF_1_L7A:
assumes a∈IR b∈IR c∈IR d∈IR

566

shows a-b + (c-d) = a+c-b-dusing assms Real_ZF_1_L2 group0.group0_4_L8A by simp
RealAddition is defined as the projection of the first operation on slopes(that is, slope addition) on the quotient (slopes divided by the ”almost
equal” relation. The next lemma plays with definitions to show that thisis the same as the operation induced on the appriopriate quotient group.
The names AH, Op1 and FR are used in group1 context to denote almost
homomorphisms, the first operation on AH and finite range functions resp.
lemma Real_ZF_1_L8: assumes
AH = AlmostHoms(int,IntegerAddition) andOp1 = AlHomOp1(int,IntegerAddition) and
FR = FinRangeFunctions(int,int)
shows RealAddition = QuotientGroupOp(AH,Op1,FR)
using assms RealAddition_def SlopeEquivalenceRel_def
QuotientGroupOp_def Slopes_def SlopeOp1_def BoundedIntMaps_def
by simp

The symbol 0 in the real0 context is defined as the neutral element of real
addition. The next lemma shows that this is the same as the neutral elementof the appriopriate quotient group.
lemma (in real0) Real_ZF_1_L9: assumes
AH = AlmostHoms(int,IntegerAddition) andOp1 = AlHomOp1(int,IntegerAddition) and
FR = FinRangeFunctions(int,int) andr = QuotientGroupRel(AH,Op1,FR)
shows
TheNeutralElement(AH//r,QuotientGroupOp(AH,Op1,FR)) = 0
SlopeEquivalenceRel = r
using assms Slopes_def Real_ZF_1_L8 RealNumbers_def
SlopeEquivalenceRel_def SlopeOp1_def BoundedIntMaps_def
by autoZero is the class of any finite range function.
lemma (in real0) Real_ZF_1_L10:
assumes A1: s ∈ Slopes
shows SlopeEquivalenceRel{s} = 0 ←→ s ∈ BoundedIntMaps
proof let AH = AlmostHoms(int,IntegerAddition)
let Op1 = AlHomOp1(int,IntegerAddition)
let FR = FinRangeFunctions(int,int)
let r = QuotientGroupRel(AH,Op1,FR)
let e = TheNeutralElement(AH//r,QuotientGroupOp(AH,Op1,FR))from A1 havegroup1(int,IntegerAddition)s∈AHusing Real_ZF_1_L1 Slopes_def
by auto567

then have r{s} = e ←→ s ∈ FR
using group1.Group_ZF_3_3_L5 by simp
moreover haver = SlopeEquivalenceRel
e = 0
FR = BoundedIntMaps
using SlopeEquivalenceRel_def Slopes_def SlopeOp1_def
BoundedIntMaps_def Real_ZF_1_L9 by auto
ultimately show thesis by simp
qed

We will need a couple of results from Group_ZF_3.thy The first two thatstate that the definition of addition and multiplication of real numbers
are consistent, that is the result does not depend on the choice of theslopes representing the numbers. The second one implies that what we call
SlopeEquivalenceRel is actually an equivalence relation on the set of slopes.
We also show that the neutral element of the multiplicative operation on
reals (in short number 1) is the class of the identity function on integers.
lemma Real_ZF_1_L11: shows
Congruent2(SlopeEquivalenceRel,SlopeOp1)
Congruent2(SlopeEquivalenceRel,SlopeOp2)
SlopeEquivalenceRel ⊆ Slopes × Slopes
equiv(Slopes, SlopeEquivalenceRel)
SlopeEquivalenceRel{id(int)} =TheNeutralElement(RealNumbers,RealMultiplication)
BoundedIntMaps ⊆ Slopes
proof let G = int
let f = IntegerAddition
let AH = AlmostHoms(int,IntegerAddition)
let Op1 = AlHomOp1(int,IntegerAddition)
let Op2 = AlHomOp2(int,IntegerAddition)
let FR = FinRangeFunctions(int,int)
let R = QuotientGroupRel(AH,Op1,FR)
have
Congruent2(R,Op1)
Congruent2(R,Op2)
using Real_ZF_1_L1 group1.Group_ZF_3_4_L13A group1.Group_ZF_3_3_L4
by autothen show
Congruent2(SlopeEquivalenceRel,SlopeOp1)
Congruent2(SlopeEquivalenceRel,SlopeOp2)
using SlopeEquivalenceRel_def SlopeOp1_def Slopes_def
BoundedIntMaps_def SlopeOp2_def by auto
have equiv(AH,R)
using Real_ZF_1_L1 group1.Group_ZF_3_3_L3 by simp
then show equiv(Slopes,SlopeEquivalenceRel)using BoundedIntMaps_def SlopeEquivalenceRel_def SlopeOp1_def Slopes_def

568

by simp
then show SlopeEquivalenceRel ⊆ Slopes × Slopes
using equiv_type by simp
have R{id(int)} = TheNeutralElement(AH//R,ProjFun2(AH,R,Op2))
using Real_ZF_1_L1 group1.Group_ZF_3_4_T2 by simp
then show SlopeEquivalenceRel{id(int)} =TheNeutralElement(RealNumbers,RealMultiplication)using Slopes_def RealNumbers_def
SlopeEquivalenceRel_def SlopeOp1_def BoundedIntMaps_def
RealMultiplication_def SlopeOp2_def
by simphave FR ⊆ AH using Real_ZF_1_L1 group1.Group_ZF_3_3_L1
by simpthen show BoundedIntMaps ⊆ Slopes
using BoundedIntMaps_def Slopes_def by simpqed

A one-side implication of the equivalence from Real_ZF_1_L10: the class of abounded integer map is the real zero.
lemma (in real0) Real_ZF_1_L11A: assumes s ∈ BoundedIntMaps
shows SlopeEquivalenceRel{s} = 0
using assms Real_ZF_1_L11 Real_ZF_1_L10 by auto

The next lemma is rephrases the result from Group_ZF_3.thy that says thatthe negative (the group inverse with respect to real addition) of the class ofa slope is the class of that slope composed with the integer additive groupinverse. The result and proof is not very readable as we use mostly generic
set theory notation with long names here. Real_ZF_1.thy contains the samestatement written in a more readable notation: [−s] = −[s].
lemma (in real0) Real_ZF_1_L12: assumes A1: s ∈ Slopes and
Dr: r = QuotientGroupRel(Slopes,SlopeOp1,BoundedIntMaps)
shows r{GroupInv(int,IntegerAddition) O s} = -(r{s})proof let G = int
let f = IntegerAddition
let AH = AlmostHoms(int,IntegerAddition)
let Op1 = AlHomOp1(int,IntegerAddition)
let FR = FinRangeFunctions(int,int)
let F = ProjFun2(Slopes,r,SlopeOp1)
from A1 Dr havegroup1(G, f)s ∈ AlmostHoms(G, f)
r = QuotientGroupRel(
AlmostHoms(G, f), AlHomOp1(G, f), FinRangeFunctions(G, G))
and F = ProjFun2(AlmostHoms(G, f), r, AlHomOp1(G, f))using Real_ZF_1_L1 Slopes_def SlopeOp1_def BoundedIntMaps_def
by autothen have569

r{GroupInv(G, f) O s} =GroupInv(AlmostHoms(G, f) // r, F)(r {s})using group1.Group_ZF_3_3_L6 by simp
with Dr show thesis
using RealNumbers_def Slopes_def SlopeEquivalenceRel_def RealAddition_def
by simpqed

Two classes are equal iff the slopes that represent them are almost equal.
lemma Real_ZF_1_L13: assumes s ∈ Slopes p ∈ Slopes
and r = SlopeEquivalenceRelshows r{s} = r{p} ←→ hs,pi ∈ rusing assms Real_ZF_1_L11 eq_equiv_class equiv_class_eq
by blast

Identity function on integers is a slope. Thislemma concludes the easy partof the construction that follows from the fact that slope equivalence classes
form a ring. It is easy to see that multiplication of classes of almost homomorphisms is not commutative in general. The remaining properties of real
numbers, like commutativity of multiplication and the existence of multiplicative inverses have to be proven using properties of the group of integers,
rather that in general setting of abelian groups.
lemma Real_ZF_1_L14: shows id(int) ∈ Slopes
proof have id(int) ∈ AlmostHoms(int,IntegerAddition)using Real_ZF_1_L1 group1.Group_ZF_3_4_L15
by simpthen show thesis using Slopes_def by simp
qed
end

47

Construction of real numbers

theory Real_ZF_1 imports Real_ZF Int_ZF_3 OrderedField_ZF
begin

In this theory file we continue the construction of real numbers started in
Real_ZF to a succesful conclusion. We put here those parts of the construction that can not be done in the general settings of abelian groups andrequire integers.

47.1

Definitions and notation

In this section we define notions and notation needed for the rest of theconstruction.
570

We define positive slopes as those that take an infinite number of posititive
values on the positive integers (see Int_ZF_2 for properties of positive slopes).
definition
PositiveSlopes ≡ {s ∈ Slopes.
s(PositiveIntegers) ∩ PositiveIntegers ∈/ Fin(int)}

The order on the set of real numbers is constructed by specifying the setof positive reals. This set is defined as the projection of the set of positive
slopes.
definition
PositiveReals ≡ {SlopeEquivalenceRel{s}. s ∈ PositiveSlopes}

The order relation on real numbers is constructed from the set of positive elements in a standard way (see section ”Alternative definitions” inOrderedGroup_ZF.)
definition
OrderOnReals ≡ OrderFromPosSet(RealNumbers,RealAddition,PositiveReals)

The next locale extends the locale real0 to define notation specific to theconstruction of real numbers. The notation follows the one defined in
Int_ZF_2.thy. If m is an integer, then the real number which is the classof the slope n 7→ m · n is denoted mR . For a real number a notation bacmeans the largest integer m such that the real version of it (that is, mR ) is
not greater than a. For an integer m and a subset of reals S the expression
Γ(S, m) is defined as max{bpR · xc : x ∈ S}. This is plays a role in the proof
of completeness of real numbers. We also reuse some notation defined in the
int0 context, like ZZ+ (the set of positive integers) and abs(m) ( the absolutevalue of an integer, and some defined in the int1 context, like the addition( +) and composition (◦ of slopes.
locale real1 = real0 +fixes AlEq (infix ∼ 68)
defines AlEq_def[simp]: s ∼ r ≡ hs,ri ∈ SlopeEquivalenceRelfixes slope_add (infix + 70)
defines slope_add_def[simp]:s + r ≡ SlopeOp1hs,ri
fixes slope_comp (infix ◦ 71)
defines slope_comp_def[simp]: s ◦ r ≡SlopeOp2hs,ri

fixes slopes (S)defines slopes_def[simp]: S ≡ AlmostHoms(int,IntegerAddition)
fixes posslopes (S + )defines posslopes_def[simp]: S + ≡ PositiveSlopes

571

fixes slope_class ([ _ ])defines slope_class_def[simp]: [f] ≡ SlopeEquivalenceRel{f}fixes slope_neg (-_ [90] 91)
defines slope_neg_def[simp]: -s ≡ GroupInv(int,IntegerAddition) O s
fixes lesseqr (infix ≤ 60)
defines lesseqr_def[simp]: a ≤ b ≡ ha,bi ∈ OrderOnReals
fixes sless (infix < 60)
defines sless_def[simp]: a < b ≡ a≤b ∧ a6=b
fixes positivereals (IR+ )defines positivereals_def[simp]: IR+ ≡ PositiveSet(IR,RealAddition,OrderOnReals)
fixes intembed (_R [90] 91)
defines intembed_def[simp]:mR ≡ [{hn,IntegerMultiplicationhm,ni i. n ∈ int}]
fixes floor (b _ c)defines floor_def[simp]:
bac ≡ Maximum(IntegerOrder,{m ∈ int. mR ≤ a})fixes Γdefines Γ_def[simp]: Γ(S,p) ≡ Maximum(IntegerOrder,{bpR ·xc. x∈S})
fixes ia (infixl + 69)
defines ia_def[simp]: a+b ≡ IntegerAdditionh a,bi
fixes iminus (- _ 72)
defines iminus_def[simp]: -a ≡ GroupInv(int,IntegerAddition)(a)fixes isub (infixl - 69)
defines isub_def[simp]: a-b ≡ a+ (- b)fixes intpositives (ZZ+ )defines intpositives_def[simp]:
ZZ+ ≡ PositiveSet(int,IntegerAddition,IntegerOrder)
fixes zlesseq (infix ≤ 60)
defines lesseq_def[simp]: m ≤ n ≡ hm,ni ∈ IntegerOrderfixes imult (infixl · 70)
defines imult_def[simp]: a·b ≡ IntegerMultiplicationh a,bi
fixes izero (0Z )defines izero_def[simp]: 0Z ≡ TheNeutralElement(int,IntegerAddition)572

fixes ione (1Z )defines ione_def[simp]: 1Z ≡ TheNeutralElement(int,IntegerMultiplication)
fixes itwo (2Z )defines itwo_def[simp]: 2Z ≡ 1Z +1Z
fixes abs
defines abs_def[simp]:
abs(m) ≡ AbsoluteValue(int,IntegerAddition,IntegerOrder)(m)fixes δdefines δ_def[simp]: δ(s,m,n) ≡ s(m+n)-s(m)-s(n)47.2Multiplication of real numbers

Multiplication of real numbers is defined as a projection of composition ofslopes onto the space of equivalence classes of slopes. Thus, the product of
the real numbers given as classes of slopes s and r is defined as the class ofs ◦ r. The goal of this section is to show that multiplication defined this way
is commutative.
Let’s recall a theorem from Int_ZF_2.thy that states that if f, g are slopes,
then f ◦ g is equivalent to g ◦ f . Here we conclude from that that the classesof f ◦ g and g ◦ f are the same.
lemma (in real1) Real_ZF_1_1_L2: assumes A1: f ∈ S g ∈ Sshows [f◦g] = [g◦f]proof from A1 have f◦g ∼ g◦fusing Slopes_def int1.Arthan_Th_9 SlopeOp1_def BoundedIntMaps_def
SlopeEquivalenceRel_def SlopeOp2_def by simp
then show thesis using Real_ZF_1_L11 equiv_class_eq
by simpqed

Classes of slopes are real numbers.
lemma (in real1) Real_ZF_1_1_L3: assumes A1: f ∈ Sshows [f] ∈ IR
proof from A1 have [f] ∈ Slopes//SlopeEquivalenceRelusing Slopes_def quotientI by simp
then show [f] ∈ IR using RealNumbers_def by simp
qed

Each real number is a class of a slope.
lemma (in real1) Real_ZF_1_1_L3A: assumes A1: a∈IRshows ∃ f∈S . a = [f]proof -

573

from A1 have a ∈ S//SlopeEquivalenceRelusing RealNumbers_def Slopes_def by simp
then show thesis using quotient_def
by simpqed

It is useful to have the definition of addition and multiplication in the real1
context notation.
lemma (in real1) Real_ZF_1_1_L4:
assumes A1: f ∈ S g ∈ S
shows[f] + [g] = [f+g][f] · [g] = [f◦g]
proof let r = SlopeEquivalenceRelhave [f]·[g] = ProjFun2(S,r,SlopeOp2)h[f],[g]iusing RealMultiplication_def Slopes_def by simp
also from A1 have . . . = [f◦g]using Real_ZF_1_L11 EquivClass_1_L10 Slopes_def
by simp
finally show [f] · [g] = [f◦g] by simp
have [f] + [g] = ProjFun2(S,r,SlopeOp1)h[f],[g]iusing RealAddition_def Slopes_def by simp
also from A1 have . . . = [f+g]using Real_ZF_1_L11 EquivClass_1_L10 Slopes_def
by simp
finally show [f] + [g] = [f+g] by simp
qed

The next lemma is essentially the same as Real_ZF_1_L12, but written in thenotation defined in the real1 context. It states that if f is a slope, then−[f ] = [−f ].
lemma (in real1) Real_ZF_1_1_L4A: assumes f ∈ Sshows [-f] = -[f]using assms Slopes_def SlopeEquivalenceRel_def Real_ZF_1_L12
by simp

Subtracting real numbers correspods to adding the opposite slope.
lemma (in real1) Real_ZF_1_1_L4B: assumes A1: f ∈ S g ∈ Sshows [f] - [g] = [f+(-g)]
proof from A1 have [f+(-g)] = [f] + [-g]using Slopes_def BoundedIntMaps_def int1.Int_ZF_2_1_L12
Real_ZF_1_1_L4 by simp
with A1 show [f] - [g] = [f+(-g)]
using Real_ZF_1_1_L4A by simp
qed

Multiplication of real numbers is commutative.
574

theorem (in real1) real_mult_commute: assumes A1: a∈IRshows a·b = b·a
proof from A1 have
∃ f∈S . a = [f]∃ g∈S . b = [g]using Real_ZF_1_1_L3A by auto
then obtain f g wheref ∈ S g ∈ S and a = [f] b = [g]by autothen show a·b = b·ausing Real_ZF_1_1_L4 Real_ZF_1_1_L2 by simp
qed

b∈IR

Multiplication is commutative on reals.
lemma real_mult_commutative: shows
RealMultiplication {is commutative on} RealNumbers
using real1.real_mult_commute IsCommutative_def
by simp

The neutral element of multiplication of reals (denoted as 1 in the real1
context) is the class of identity function on integers. This is really shown
in Real_ZF_1_L11, here we only rewrite it in the notation used in the real1
context.
lemma (in real1) real_one_cl_identity: shows [id(int)] = 1
using Real_ZF_1_L11 by simp

If f is bounded, then its class is the neutral element of additive operation
on reals (denoted as 0 in the real1 context).
lemma (in real1) real_zero_cl_bounded_map:
assumes f ∈ BoundedIntMaps shows [f] = 0
using assms Real_ZF_1_L11A by simp

Two real numbers are equal iff the slopes that represent them are almost
equal. This is proven in Real_ZF_1_L13, here we just rewrite it in the notation
used in the real1 context.
lemma (in real1) Real_ZF_1_1_L5:
assumes f ∈ S g ∈ Sshows [f] = [g] ←→ f ∼ gusing assms Slopes_def Real_ZF_1_L13 by simp

If the pair of function belongs to the slope equivalence relation, then theirclasses are equal. This is convenient, because we don’t need to assume thatf, g are slopes (follows from the fact that f ∼ g).
lemma (in real1) Real_ZF_1_1_L5A: assumes f ∼ gshows [f] = [g]using assms Real_ZF_1_L11 Slopes_def Real_ZF_1_1_L5

575

by auto

Identity function on integers is a slope. This is proven in Real_ZF_1_L13,
here we just rewrite it in the notation used in the real1 context.
lemma (in real1) id_on_int_is_slope: shows id(int) ∈ S
using Real_ZF_1_L14 Slopes_def by simp

A result from Int_ZF_2.thy: the identity function on integers is not almost
equal to any bounded function.
lemma (in real1) Real_ZF_1_1_L7:
assumes A1: f ∈ BoundedIntMaps
shows ¬(id(int) ∼ f)using assms Slopes_def SlopeOp1_def BoundedIntMaps_def
SlopeEquivalenceRel_def BoundedIntMaps_def int1.Int_ZF_2_3_L12
by simp

Zero is not one.
lemma (in real1) real_zero_not_one: shows 16=0
proof { assume A1: 1=0
have ∃ f ∈ S. 0 = [f]using Real_ZF_1_L4 Real_ZF_1_1_L3A by simp
with A1 have∃ f ∈ S. [id(int)] = [f] ∧ [f] = 0
using real_one_cl_identity by auto
then have False using Real_ZF_1_1_L5 Slopes_def
Real_ZF_1_L10 Real_ZF_1_1_L7 id_on_int_is_slopeby auto} then show 16=0 by auto
qed

Negative of a real number is a real number. Property of groups.
lemma (in real1) Real_ZF_1_1_L8: assumes a∈IR shows (-a) ∈ IR
using assms Real_ZF_1_L2 group0.inverse_in_groupby simp

An identity with three real numbers.
lemma (in real1) Real_ZF_1_1_L9: assumes a∈IR b∈IR c∈IRshows a·(b·c) = a·c·b
using assms real_mult_commutative Real_ZF_1_L3 ring0.Ring_ZF_2_L4
by simp47.3

The order on reals

In this section we show that the order relation defined by prescribing theset of positive reals as the projection of the set of positive slopes makes thering of real numbers into an ordered ring. We also collect the facts aboutordered groups and rings that we use in the construction.
576

Positive slopes are slopes and positive reals are real.
lemma Real_ZF_1_2_L1: shows
PositiveSlopes ⊆ Slopes
PositiveReals ⊆ RealNumbers
proof have PositiveSlopes ={s ∈ Slopes. s(PositiveIntegers) ∩ PositiveIntegers ∈/ Fin(int)}
using PositiveSlopes_def by simp
then show PositiveSlopes ⊆ Slopes by (rule subset_with_property)
then have{SlopeEquivalenceRel{s}. s ∈ PositiveSlopes } ⊆Slopes//SlopeEquivalenceRelusing EquivClass_1_L1A by simp
then show PositiveReals ⊆ RealNumbers
using PositiveReals_def RealNumbers_def by simp
qed

Positive reals are the same as classes of a positive slopes.
lemma (in real1) Real_ZF_1_2_L2:
shows a ∈ PositiveReals ←→ (∃ f∈S + . a = [f])proofassume a ∈ PositiveReals
then have a ∈ {([s]). s ∈ S + } using PositiveReals_def
by simpthen show ∃ f∈S + . a = [f] by auto
next assume ∃ f∈S + . a = [f]then have a ∈ {([s]). s ∈ S + } by auto
then show a ∈ PositiveReals using PositiveReals_def
by simpqed

Let’s recall from Int_ZF_2.thy that the sum and composition of positive
slopes is a positive slope.
lemma (in real1) Real_ZF_1_2_L3:
assumes f∈S + g∈S +shows
f+g ∈ S +f◦g ∈ S +using assms Slopes_def PositiveSlopes_def PositiveIntegers_def
SlopeOp1_def int1.sum_of_pos_sls_is_pos_sl
SlopeOp2_def int1.comp_of_pos_sls_is_pos_sl
by autoBounded integer maps are not positive slopes.
lemma (in real1) Real_ZF_1_2_L5:
assumes f ∈ BoundedIntMaps
shows f ∈/ S+
using assms BoundedIntMaps_def Slopes_def PositiveSlopes_def

577

PositiveIntegers_def int1.Int_ZF_2_3_L1B by simp

The set of positive reals is closed under addition and multiplication. Zero(the neutral element of addition) is not a positive number.
lemma (in real1) Real_ZF_1_2_L6: shows
PositiveReals {is closed under} RealAddition
PositiveReals {is closed under} RealMultiplication
0 ∈/ PositiveReals
proof { fix a fix b
assume a ∈ PositiveReals and b ∈ PositiveReals
then obtain f g where
I: f ∈ S + g ∈ S + and
II: a = [f] b = [g]using Real_ZF_1_2_L2 by auto
then have f ∈ S g ∈ S using Real_ZF_1_2_L1 Slopes_def
by autowith I II havea+b ∈ PositiveReals ∧ a·b ∈ PositiveReals
using Real_ZF_1_1_L4 Real_ZF_1_2_L3 Real_ZF_1_2_L2
by auto} then show
PositiveReals {is closed under} RealAddition
PositiveReals {is closed under} RealMultiplication
using IsOpClosed_def
by auto{ assume 0 ∈ PositiveReals
then obtain f where f ∈ S + and 0 = [f]using Real_ZF_1_2_L2 by auto
then have False
using Real_ZF_1_2_L1 Slopes_def Real_ZF_1_L10 Real_ZF_1_2_L5
by auto} then show 0 ∈/ PositiveReals by autoqed

If a class of a slope f is not zero, then either f is a positive slope or −f isa positive slope. The real proof is in Int_ZF_2.thy.
lemma (in real1) Real_ZF_1_2_L7:
assumes A1: f ∈ S and A2: [f] 6= 0
shows (f ∈ S + ) Xor ((-f) ∈ S + )using assms Slopes_def SlopeEquivalenceRel_def BoundedIntMaps_def
PositiveSlopes_def PositiveIntegers_def
Real_ZF_1_L10 int1.Int_ZF_2_3_L8 by simp

The next lemma rephrases Int_ZF_2_3_L10 in the notation used in real1
context.
lemma (in real1) Real_ZF_1_2_L8:
assumes A1: f ∈ S g ∈ S

578

and A2: (f ∈ S + ) Xor (g ∈ S + )shows ([f] ∈ PositiveReals) Xor ([g] ∈ PositiveReals)
using assms PositiveReals_def SlopeEquivalenceRel_def Slopes_def
SlopeOp1_def BoundedIntMaps_def PositiveSlopes_def PositiveIntegers_def
int1.Int_ZF_2_3_L10 by simp

The trichotomy law for the (potential) order on reals: if a 6= 0, then either
a is positive or −a is potitive.
lemma (in real1) Real_ZF_1_2_L9:
assumes A1: a∈IR and A2: a6=0
shows (a ∈ PositiveReals) Xor ((-a) ∈ PositiveReals)
proof from A1 obtain f where I: f ∈ S a = [f]using Real_ZF_1_1_L3A by autowith A2 have ([f] ∈ PositiveReals) Xor ([-f] ∈ PositiveReals)
using Slopes_def BoundedIntMaps_def int1.Int_ZF_2_1_L12
Real_ZF_1_2_L7 Real_ZF_1_2_L8 by simp
with I show (a ∈ PositiveReals) Xor ((-a) ∈ PositiveReals)
using Real_ZF_1_1_L4A by simp
qed

Finally we are ready to prove that real numbers form an ordered ring withno zero divisors.
theorem reals_are_ord_ring: shows
IsAnOrdRing(RealNumbers,RealAddition,RealMultiplication,OrderOnReals)
OrderOnReals {is total on} RealNumbers
PositiveSet(RealNumbers,RealAddition,OrderOnReals) = PositiveReals
HasNoZeroDivs(RealNumbers,RealAddition,RealMultiplication)
proof let R = RealNumbers
let A = RealAddition
let M = RealMultiplication
let P = PositiveReals
let r = OrderOnReals
let z = TheNeutralElement(R, A)
have I:
ring0(R, A, M)
M {is commutative on} R
P ⊆ R
P {is closed under} A
TheNeutralElement(R, A) ∈/ P
∀ a∈R. a 6= z −→ (a ∈ P) Xor (GroupInv(R, A)(a) ∈ P)
P {is closed under} M
r = OrderFromPosSet(R, A, P)
using real0.Real_ZF_1_L3 real_mult_commutative Real_ZF_1_2_L1
real1.Real_ZF_1_2_L6 real1.Real_ZF_1_2_L9 OrderOnReals_def
by autothen show IsAnOrdRing(R, A, M, r)by (rule ring0.ring_ord_by_positive_set)579

from I show r {is total on} Rby (rule ring0.ring_ord_by_positive_set)
from I show PositiveSet(R,A,r) = P
by (rule ring0.ring_ord_by_positive_set)
from I show HasNoZeroDivs(R,A,M)
by (rule ring0.ring_ord_by_positive_set)qed

All theorems proven in the ring1 (about ordered rings), group3 (about ordered groups) and group1 (about groups) contexts are valid as applied toordered real numbers with addition and (real) order.
lemma Real_ZF_1_2_L10: shows
ring1(RealNumbers,RealAddition,RealMultiplication,OrderOnReals)
IsAnOrdGroup(RealNumbers,RealAddition,OrderOnReals)
group3(RealNumbers,RealAddition,OrderOnReals)
OrderOnReals {is total on} RealNumbers
proof show ring1(RealNumbers,RealAddition,RealMultiplication,OrderOnReals)
using reals_are_ord_ring OrdRing_ZF_1_L2 by simp
then show
IsAnOrdGroup(RealNumbers,RealAddition,OrderOnReals)
group3(RealNumbers,RealAddition,OrderOnReals)
OrderOnReals {is total on} RealNumbers
using ring1.OrdRing_ZF_1_L4 by autoqed

If a = b or b − a is positive, then a is less or equal b.
lemma (in real1) Real_ZF_1_2_L11: assumes A1: a∈IR
A3: a=b ∨ b-a ∈ PositiveReals
shows a≤busing assms reals_are_ord_ring Real_ZF_1_2_L10
group3.OrderedGroup_ZF_1_L30 by simpb∈IR andA sufficient condition for two classes to be in the real order.
lemma (in real1) Real_ZF_1_2_L12: assumes A1: f ∈ S g ∈ S and
A2: f∼g ∨ (g + (-f)) ∈ S +shows [f] ≤ [g]proof from A1 A2 have [f] = [g] ∨ [g]-[f] ∈ PositiveReals
using Real_ZF_1_1_L5A Real_ZF_1_2_L2 Real_ZF_1_1_L4B
by autowith A1 show [f] ≤ [g] using Real_ZF_1_1_L3 Real_ZF_1_2_L11
by simpqed

Taking negative on both sides reverses the inequality, a case with an inverseon one side. Property of ordered groups.
lemma (in real1) Real_ZF_1_2_L13:580

assumes A1: a∈IR and A2: (-a) ≤ bshows (-b) ≤ ausing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L5AG
by simpReal order is antisymmetric.
lemma (in real1) real_ord_antisym:
assumes A1: a≤b b≤a shows a=b
proof from A1 havegroup3(RealNumbers,RealAddition,OrderOnReals)
ha,bi ∈ OrderOnReals hb,ai ∈ OrderOnReals
using Real_ZF_1_2_L10 by auto
then show a=b by (rule group3.group_order_antisym)
qedReal order is transitive.
lemma (in real1) real_ord_transitive: assumes A1: a≤bshows a≤c
proof from A1 havegroup3(RealNumbers,RealAddition,OrderOnReals)
ha,bi ∈ OrderOnReals hb,ci ∈ OrderOnReals
using Real_ZF_1_2_L10 by auto
then have ha,ci ∈ OrderOnRealsby (rule group3.Group_order_transitive)then show a≤c by simp
qed

b≤c

We can multiply both sides of an inequality by a nonnegative real number.
lemma (in real1) Real_ZF_1_2_L14:
assumes a≤b and 0≤cshows
a·c ≤ b·c
c·a ≤ c·busing assms Real_ZF_1_2_L10 ring1.OrdRing_ZF_1_L9
by autoA special case of Real_ZF_1_2_L14: we can multiply an inequality by a real
number.
lemma (in real1) Real_ZF_1_2_L14A:
assumes A1: a≤b and A2: c∈IR+shows c·a ≤ c·b
using assms Real_ZF_1_2_L10 ring1.OrdRing_ZF_1_L9A
by simpIn the real1 context notation a ≤ b implies that a and b are real numbers.
lemma (in real1) Real_ZF_1_2_L15: assumes a≤b shows a∈IR

581

b∈IR

using assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L4
by autoa ≤ b implies that 0 ≤ b − a.
lemma (in real1) Real_ZF_1_2_L16: assumes a≤bshows 0 ≤ b-a
using assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L12A
by simp

A sum of nonnegative elements is nonnegative.
lemma (in real1) Real_ZF_1_2_L17: assumes 0≤a 0≤bshows 0 ≤ a+b
using assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L12
by simp

We can add sides of two inequalities
lemma (in real1) Real_ZF_1_2_L18: assumes a≤b c≤dshows a+c ≤ b+dusing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L5B
by simp

The order on real is reflexive.
lemma (in real1) real_ord_refl: assumes a∈IR shows a≤ausing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L3
by simp

We can add a real number to both sides of an inequality.
lemma (in real1) add_num_to_ineq: assumes a≤b and c∈IRshows a+c ≤ b+c
using assms Real_ZF_1_2_L10 IsAnOrdGroup_def by simp

We can put a number on the other side of an inequality, changing its sign.
lemma (in real1) Real_ZF_1_2_L19:
assumes a∈IR b∈IR and c ≤ a+b
shows c-b ≤ ausing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L9C
by simp

What happens when one real number is not greater or equal than another?
lemma (in real1) Real_ZF_1_2_L20: assumes a∈IRshows b < aproof from assms have I:
group3(IR,RealAddition,OrderOnReals)
OrderOnReals {is total on} IRa∈IR b∈IR ¬(ha,bi ∈ OrderOnReals)
using Real_ZF_1_2_L10 by auto
then have hb,ai ∈ OrderOnReals

582

b∈IR and ¬(a≤b)

by (rule group3.OrderedGroup_ZF_1_L8)
then have b ≤ a by simp
moreover from I have a6=b by (rule group3.OrderedGroup_ZF_1_L8)
ultimately show b < a by autoqed

We can put a number on the other side of an inequality, changing its sign,version with a minus.
lemma (in real1) Real_ZF_1_2_L21:
assumes a∈IR b∈IR and c ≤ a-b
shows c+b ≤ ausing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L5J
by simp

The order on reals is a relation on reals.
lemma (in real1) Real_ZF_1_2_L22: shows OrderOnReals ⊆ IR×IR
using Real_ZF_1_2_L10 IsAnOrdGroup_def
by simpA set that is bounded above in the sense defined by order on reals is a subsetof real numbers.
lemma (in real1) Real_ZF_1_2_L23:
assumes A1: IsBoundedAbove(A,OrderOnReals)
shows A ⊆ IR
using A1 Real_ZF_1_2_L22 Order_ZF_3_L1A
by blast

Properties of the maximum of three real numbers.
lemma (in real1) Real_ZF_1_2_L24:
assumes A1: a∈IR b∈IR c∈IRshows
Maximum(OrderOnReals,{a,b,c}) ∈ {a,b,c}Maximum(OrderOnReals,{a,b,c}) ∈ IRa ≤ Maximum(OrderOnReals,{a,b,c})b ≤ Maximum(OrderOnReals,{a,b,c})c ≤ Maximum(OrderOnReals,{a,b,c})
proof have IsLinOrder(IR,OrderOnReals)
using Real_ZF_1_2_L10 group3.group_ord_total_is_lin
by simpwith A1 show
Maximum(OrderOnReals,{a,b,c}) ∈ {a,b,c}Maximum(OrderOnReals,{a,b,c}) ∈ IRa ≤ Maximum(OrderOnReals,{a,b,c})b ≤ Maximum(OrderOnReals,{a,b,c})c ≤ Maximum(OrderOnReals,{a,b,c})using Finite_ZF_1_L2A by auto
qed

583

A form of transitivity for the order on reals.
lemma (in real1) real_strict_ord_transit:
assumes A1: a≤b and A2: b<cshows a<cproof from A1 A2 have I:
group3(IR,RealAddition,OrderOnReals)
ha,bi ∈ OrderOnReals hb,ci ∈ OrderOnReals ∧ b6=cusing Real_ZF_1_2_L10 by auto
then have ha,ci ∈ OrderOnReals ∧ a6=c by (rule group3.group_strict_ord_transit)
then show a<c by simpqed

We can multiply a right hand side of an inequality between positive real
numbers by a number that is greater than one.
lemma (in real1) Real_ZF_1_2_L25:
assumes b ∈ IR+ and a≤b and 1<cshows a<b·cusing assms reals_are_ord_ring Real_ZF_1_2_L10 ring1.OrdRing_ZF_3_L17
by simp

We can move a real number to the other side of a strict inequality, changing
its sign.
lemma (in real1) Real_ZF_1_2_L26:
assumes a∈IR b∈IR and a-b < cshows a < c+busing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_1_L12B
by simpReal order is translation invariant.
lemma (in real1) real_ord_transl_inv:
assumes a≤b and c∈IRshows c+a ≤ c+b
using assms Real_ZF_1_2_L10 IsAnOrdGroup_def
by simp

It is convenient to have the transitivity of the order on integers in the notation specific to real1 context. This may be confusing for the presentation
readers: even though ≤ and ≤ are printed in the same way, they are different
symbols in the source. In the real1 context the former denotes inequality
between integers, and the latter denotes inequality between real numbers(classes of slopes). The next lemma is about transitivity of the order relation on integers.
lemma (in real1) int_order_transitive:
assumes A1: a≤b b≤cshows a≤c
proof -

584

from A1 have
ha,bi ∈ IntegerOrder and hb,ci ∈ IntegerOrderby autothen have ha,ci ∈ IntegerOrderby (rule Int_ZF_2_L5)
then show a≤c by simp
qed

A property of nonempty subsets of real numbers that don’t have a maximum:
for any element we can find one that is (strictly) greater.
lemma (in real1) Real_ZF_1_2_L27:
assumes A⊆IR and ¬HasAmaximum(OrderOnReals,A) and x∈Ashows ∃ y∈A. x<yusing assms Real_ZF_1_2_L10 group3.OrderedGroup_ZF_2_L2B
by simp

The next lemma shows what happens when one real number is not greateror equal than another.
lemma (in real1) Real_ZF_1_2_L28:
assumes a∈IR b∈IR and ¬(a≤b)
shows b<a
proof from assms havegroup3(IR,RealAddition,OrderOnReals)
OrderOnReals {is total on} IRa∈IR b∈IR ha,bi ∈/ OrderOnReals
using Real_ZF_1_2_L10 by auto
then have hb,ai ∈ OrderOnReals ∧ b6=aby (rule group3.OrderedGroup_ZF_1_L8)
then show b<a by simp
qed

If a real number is less than another, then the second one can not be less orequal that the first.
lemma (in real1) Real_ZF_1_2_L29:
assumes a<b shows ¬(b≤a)
proof from assms havegroup3(IR,RealAddition,OrderOnReals)
ha,bi ∈ OrderOnReals a6=busing Real_ZF_1_2_L10 by auto
then have hb,ai ∈/ OrderOnRealsby (rule group3.OrderedGroup_ZF_1_L8AA)
then show ¬(b≤a) by simp
qed

585

47.4

Inverting reals

In this section we tackle the issue of existence of (multiplicative) inversesof real numbers and show that real numbers form an ordered field. We
also restate here some facts specific to ordered fields that we need for theconstruction. The actual proofs of most of these facts can be found in
Field_ZF.thy and OrderedField_ZF.thy
We rewrite the theorem from Int_ZF_2.thy that shows that for every positive
slope we can find one that is almost equal and has an inverse.
lemma (in real1) pos_slopes_have_inv: assumes f ∈ S +shows ∃ g∈S. f∼g ∧ (∃ h∈S. g◦h ∼ id(int))
using assms PositiveSlopes_def Slopes_def PositiveIntegers_def
int1.pos_slope_has_inv SlopeOp1_def SlopeOp2_def
BoundedIntMaps_def SlopeEquivalenceRel_def
by simp

The set of real numbers we are constructing is an ordered field.
theorem (in real1) reals_are_ord_field: shows
IsAnOrdField(RealNumbers,RealAddition,RealMultiplication,OrderOnReals)
proof let R = RealNumbers
let A = RealAddition
let M = RealMultiplication
let r = OrderOnReals
have ring1(R,A,M,r) and 0 6= 1
using reals_are_ord_ring OrdRing_ZF_1_L2 real_zero_not_one
by automoreover have M {is commutative on} R
using real_mult_commutative by simp
moreover have
∀ a∈PositiveSet(R,A,r). ∃ b∈R. a·b = 1
proof
fix a assume a ∈ PositiveSet(R,A,r)then obtain f where I: f∈S + and II: a = [f]using reals_are_ord_ring Real_ZF_1_2_L2
by autothen have ∃ g∈S. f∼g ∧ (∃ h∈S. g◦h ∼ id(int))
using pos_slopes_have_inv by simp
then obtain g where
III: g∈S and IV: f∼g and V: ∃ h∈S. g◦h ∼ id(int)by autofrom V obtain h where VII: h∈S and VIII: g◦h ∼ id(int)by autofrom I III IV have [f] = [g]using Real_ZF_1_2_L1 Slopes_def Real_ZF_1_1_L5
by autowith II III VII VIII have a·[h] = 1
using Real_ZF_1_1_L4 Real_ZF_1_1_L5A real_one_cl_identity586

by simp
with VII show ∃ b∈R. a·b = 1 using Real_ZF_1_1_L3
by autoqed
ultimately show thesis using ring1.OrdField_ZF_1_L4
by simpqed

Reals form a field.
lemma reals_are_field:
shows IsAfield(RealNumbers,RealAddition,RealMultiplication)using real1.reals_are_ord_field OrdField_ZF_1_L1A
by simp

Theorem proven in field0 and field1 contexts are valid as applied to real
numbers.
lemma field_cntxts_ok: shows
field0(RealNumbers,RealAddition,RealMultiplication)
field1(RealNumbers,RealAddition,RealMultiplication,OrderOnReals)
using reals_are_field real1.reals_are_ord_field
field_field0 OrdField_ZF_1_L2 by auto

If a is positive, then a−1 is also positive.
lemma (in real1) Real_ZF_1_3_L1: assumes a ∈ IR+
shows a−1 ∈ IR+
a−1 ∈ IR
using assms field_cntxts_ok field1.OrdField_ZF_1_L8 PositiveSet_def
by autoA technical fact about multiplying strict inequality by the inverse of one of
the sides.
lemma (in real1) Real_ZF_1_3_L2:
assumes a ∈ IR+ and a−1 < bshows 1 < b·ausing assms field_cntxts_ok field1.OrdField_ZF_2_L2
by simp

If a is smaller than b, then (b − a)−1 is positive.
lemma (in real1) Real_ZF_1_3_L3: assumes a<bshows (b-a)−1 ∈ IR+
using assms field_cntxts_ok field1.OrdField_ZF_1_L9
by simp

We can put a positive factor on the other side of a strict inequality, changing
it to its inverse.
lemma (in real1) Real_ZF_1_3_L4:
assumes A1: a∈IR b∈IR+ and A2: a·b < cshows a < c·b−1

587

using assms field_cntxts_ok field1.OrdField_ZF_2_L6
by simp

We can put a positive factor on the other side of a strict inequality, changing
it to its inverse, version with the product initially on the right hand side.
lemma (in real1) Real_ZF_1_3_L4A:
assumes A1: b∈IR c∈IR+ and A2: a < b·cshows a·c−1 < busing assms field_cntxts_ok field1.OrdField_ZF_2_L6A
by simp

We can put a positive factor on the other side of an inequality, changing it
to its inverse, version with the product initially on the right hand side.
lemma (in real1) Real_ZF_1_3_L4B:
assumes A1: b∈IR c∈IR+ and A2: a ≤ b·cshows a·c−1 ≤ busing assms field_cntxts_ok field1.OrdField_ZF_2_L5A
by simp

We can put a positive factor on the other side of an inequality, changing it
to its inverse, version with the product initially on the left hand side.
lemma (in real1) Real_ZF_1_3_L4C:
assumes A1: a∈IR b∈IR+ and A2: a·b ≤ cshows a ≤ c·b−1
using assms field_cntxts_ok field1.OrdField_ZF_2_L5
by simpA technical lemma about solving a strict inequality with three real numbers
and inverse of a difference.
lemma (in real1) Real_ZF_1_3_L5:
assumes a<b and (b-a)−1 < cshows 1 + a·c < b·cusing assms field_cntxts_ok field1.OrdField_ZF_2_L9
by simp

We can multiply an inequality by the inverse of a positive number.
lemma (in real1) Real_ZF_1_3_L6:
assumes a≤b and c∈IR+ shows a·c−1 ≤ b·c−1
using assms field_cntxts_ok field1.OrdField_ZF_2_L3
by simp

We can multiply a strict inequality by a positive number or its inverse.
lemma (in real1) Real_ZF_1_3_L7:
assumes a<b and c∈IR+ showsa·c < b·c
c·a < c·ba·c−1 < b·c−1

588

using assms field_cntxts_ok field1.OrdField_ZF_2_L4
by autoAn identity with three real numbers, inverse and cancelling.
lemma (in real1) Real_ZF_1_3_L8: assumesa∈IR b∈IR b6=0
shows a·b·(c·b−1 ) = a·cusing assms field_cntxts_ok field0.Field_ZF_2_L6
by simp

47.5

c∈IR

CompletenessThis goal of this section is to show that the order on real numbers is complete, that is every subset of reals that is bounded above has a smallest
upper bound.
If m is an integer, then mR is a real number. Recall that in real1 context mR
denotes the class of the slope n 7→ m · n.
lemma (in real1) real_int_is_real: assumes m ∈ int
shows mR ∈ IR
using assms int1.Int_ZF_2_5_L1 Real_ZF_1_1_L3 by simp

The negative of the real embedding of an integer is the embedding of thenegative of the integer.
lemma (in real1) Real_ZF_1_4_L1: assumes m ∈ int
shows (-m)R = -(mR )using assms int1.Int_ZF_2_5_L3 int1.Int_ZF_2_5_L1 Real_ZF_1_1_L4A
by simp

The embedding of sum of integers is the sum of embeddings.
lemma (in real1) Real_ZF_1_4_L1A: assumes m ∈ int k ∈ int
shows mR + kR = ((m+k)R )using assms int1.Int_ZF_2_5_L1 SlopeOp1_def int1.Int_ZF_2_5_L3A
Real_ZF_1_1_L4 by simp

The embedding of a difference of integers is the difference of embeddings.
lemma (in real1) Real_ZF_1_4_L1B: assumes A1: m ∈ int
shows mR - kR = (m-k)R
proof from A1 have (-k) ∈ int using int0.Int_ZF_1_1_L4
by simpwith A1 have (m-k)R = mR + (-k)Rusing Real_ZF_1_4_L1A by simp
with A1 show mR - kR = (m-k)Rusing Real_ZF_1_4_L1 by simpqedk ∈ int

The embedding of the product of integers is the product of embeddings.
589

lemma (in real1) Real_ZF_1_4_L1C: assumes m ∈ int k ∈ int
shows mR · kR = (m·k)R
using assms int1.Int_ZF_2_5_L1 SlopeOp2_def int1.Int_ZF_2_5_L3B
Real_ZF_1_1_L4 by simp

For any real numbers there is an integer whose real version is greater or
equal.
lemma (in real1) Real_ZF_1_4_L2: assumes A1: a∈IRshows ∃ m∈int. a ≤ mR
proof from A1 obtain f where I: f∈S and II: a = [f]using Real_ZF_1_1_L3A by auto
then have ∃ m∈int. ∃ g∈S.
{hn,m·ni . n ∈ int} ∼ g ∧ (f∼g ∨ (g + (-f)) ∈ S + )using int1.Int_ZF_2_5_L2 Slopes_def SlopeOp1_def
BoundedIntMaps_def SlopeEquivalenceRel_def
PositiveIntegers_def PositiveSlopes_def
by simpthen obtain m g where III: m∈int and IV: g∈S and{hn,m·ni . n ∈ int} ∼ g ∧ (f∼g ∨ (g + (-f)) ∈ S + )by autothen have mR = [g] and f ∼ g ∨ (g + (-f)) ∈ S +using Real_ZF_1_1_L5A by autowith I II IV have a ≤ mR using Real_ZF_1_2_L12
by simpwith III show ∃ m∈int. a ≤ mR by autoqed

For any real numbers there is an integer whose real version (embedding) is
less or equal.
lemma (in real1) Real_ZF_1_4_L3: assumes A1: a∈IRshows {m ∈ int. mR ≤ a} 6= 0
proof from A1 have (-a) ∈ IR using Real_ZF_1_1_L8
by simpthen obtain m where I: m∈int and II: (-a) ≤ mR
using Real_ZF_1_4_L2 by auto
let k = GroupInv(int,IntegerAddition)(m)from A1 I II have k ∈ int and kR ≤ ausing Real_ZF_1_2_L13 Real_ZF_1_4_L1 int0.Int_ZF_1_1_L4
by autothen show thesis by autoqed

Embeddings of two integers are equal only if the integers are equal.
lemma (in real1) Real_ZF_1_4_L4:assumes A1: m ∈ int k ∈ int and A2: mR = kRshows m=k590

proof let r = {hn, IntegerMultiplication hm, nii . n ∈ int}
let s = {hn, IntegerMultiplication hk, nii . n ∈ int}
from A1 A2 have r ∼ susing int1.Int_ZF_2_5_L1 AlmostHoms_def Real_ZF_1_1_L5
by simpwith A1 havem ∈ int k ∈ int
hr,si ∈ QuotientGroupRel(AlmostHoms(int, IntegerAddition),
AlHomOp1(int, IntegerAddition),FinRangeFunctions(int, int))
using SlopeEquivalenceRel_def Slopes_def SlopeOp1_def
BoundedIntMaps_def by auto
then show m=k by (rule int1.Int_ZF_2_5_L6)
qed

The embedding of integers preserves the order.
lemma (in real1) Real_ZF_1_4_L5: assumes A1: m≤kshows mR ≤ kR
proof let r = {hn, m·ni . n ∈ int}
let s = {hn, k·ni . n ∈ int}
from A1 have r ∈ S s ∈ Susing int0.Int_ZF_2_L1A int1.Int_ZF_2_5_L1 by auto
moreover from A1 have r ∼ s ∨ s + (-r) ∈ S +using Slopes_def SlopeOp1_def BoundedIntMaps_def SlopeEquivalenceRel_def
PositiveIntegers_def PositiveSlopes_def
int1.Int_ZF_2_5_L4 by simp
ultimately show mR ≤ kR using Real_ZF_1_2_L12
by simpqed

The embedding of integers preserves the strict order.
lemma (in real1) Real_ZF_1_4_L5A: assumes A1: m≤kshows mR < kR
proof from A1 have mR ≤ kR using Real_ZF_1_4_L5
by simpmoreoverfrom A1 have T: m ∈ int k ∈ int
using int0.Int_ZF_2_L1A by autowith A1 have mR 6= kR using Real_ZF_1_4_L4
by autoultimately show mR < kR by simp
qed

m6=k

For any real number there is a positive integer whose real version is (strictly)
greater. This is Lemma 14 i) in [2].
lemma (in real1) Arthan_Lemma14i: assumes A1: a∈IRshows ∃ n∈ZZ+ . a < nR591

proof from A1 obtain m where I: m∈int and II: a ≤ mR
using Real_ZF_1_4_L2 by auto
let n = GreaterOf(IntegerOrder,1Z ,m) + 1Z
from I have T: n ∈ZZ+ and m ≤ n m6=nusing int0.Int_ZF_1_5_L7B by auto
then have III: mR < nR
using Real_ZF_1_4_L5A by simp
with II have a < nR by (rule real_strict_ord_transit)
with T show thesis by autoqed

If one embedding is less or equal than another, then the integers are alsoless or equal.
lemma (in real1) Real_ZF_1_4_L6:
assumes A1: k ∈ int m ∈ int and A2: mR ≤ kRshows m≤k
proof { assume A3: hm,ki ∈/ IntegerOrderwith A1 have hk,mi ∈ IntegerOrderby (rule int0.Int_ZF_2_L19)
then have kR ≤ mR using Real_ZF_1_4_L5
by simpwith A2 have mR = kR by (rule real_ord_antisym)with A1 have k = m using Real_ZF_1_4_L4
by automoreover from A1 A3 have k6=m by (rule int0.Int_ZF_2_L19)
ultimately have False by simp
} then show m≤k by autoqed

The floor function is well defined and has expected properties.
lemma (in real1) Real_ZF_1_4_L7: assumes A1: a∈IR
shows
IsBoundedAbove({m ∈ int. mR ≤ a},IntegerOrder){m ∈ int. mR ≤ a} 6= 0
bac ∈ int
bacR ≤ aproof let A = {m ∈ int. mR ≤ a}from A1 obtain K where I: K∈int and II: a ≤ (KR )using Real_ZF_1_4_L2 by auto
{ fix n assume n ∈ A
then have III: n ∈ int and IV: nR ≤ a
by autofrom IV II have (nR ) ≤ (KR )by (rule real_ord_transitive)
with I III have n≤K using Real_ZF_1_4_L6
by simp592

} then have ∀ n∈A. hn,Ki ∈ IntegerOrderby simpthen show IsBoundedAbove(A,IntegerOrder)by (rule Order_ZF_3_L10)
moreover from A1 show A 6= 0 using Real_ZF_1_4_L3
by simpultimately have Maximum(IntegerOrder,A) ∈ A
by (rule int0.int_bounded_above_has_max)
then show bac ∈ int
bacR ≤ a by autoqed

Every integer whose embedding is less or equal a real number a is less orequal than the floor of a.
lemma (in real1) Real_ZF_1_4_L8:
assumes A1: m ∈ int and A2: mR ≤ ashows m ≤ bac
proof let A = {m ∈ int. mR ≤ a}from A2 have IsBoundedAbove(A,IntegerOrder) and A6=0
using Real_ZF_1_2_L15 Real_ZF_1_4_L7 by auto
then have ∀ x∈A. hx,Maximum(IntegerOrder,A)i ∈ IntegerOrderby (rule int0.int_bounded_above_has_max)
with A1 A2 show m ≤ bac by simp
qedInteger zero and one embed as real zero and one.
lemma (in real1) int_0_1_are_real_zero_one:
shows 0Z R = 0 1Z R = 1
using int1.Int_ZF_2_5_L7 BoundedIntMaps_def
real_one_cl_identity real_zero_cl_bounded_map
by autoInteger two embeds as the real two.
lemma (in real1) int_two_is_real_two: shows 2Z R = 2
proof have 2Z R = 1Z R + 1Z R
using int0.int_zero_one_are_int Real_ZF_1_4_L1A
by simp
also have . . . = 2 using int_0_1_are_real_zero_one
by simp
finally show 2Z R = 2 by simpqed

A positive integer embeds as a positive (hence nonnegative) real.
lemma (in real1) int_pos_is_real_pos: assumes A1: p∈ZZ+
shows
pR ∈ IR0 ≤ pR593

pR ∈ IR+
proof from A1 have I: p ∈ int 0Z ≤ p 0Z 6= pusing PositiveSet_def by auto
then have pR ∈ IR 0Z R ≤ pR
using real_int_is_real Real_ZF_1_4_L5 by auto
then show pR ∈ IR 0 ≤ pR
using int_0_1_are_real_zero_one by auto
moreover have 0 6= pR
proof { assume 0 = pR
with I have False using int_0_1_are_real_zero_one
int0.int_zero_one_are_int Real_ZF_1_4_L4 by auto
} then show 0 6= pR by autoqed
ultimately show pR ∈ IR+ using PositiveSet_def
by simpqed

The ordered field of reals we are constructing is archimedean, i.e., if x, y are
its elements with y positive, then there is a positive integer M such that x
is smaller than M R y. This is Lemma 14 ii) in [2].
lemma (in real1) Arthan_Lemma14ii: assumes A1: x∈IR y ∈ IR+
shows ∃ M∈ZZ+ . x < MR ·yproof from A1 have
∃ C∈ZZ+ . x < CR and ∃ D∈ZZ+ . y−1 < DRusing Real_ZF_1_3_L1 Arthan_Lemma14i by auto
then obtain C D where
I: C∈ZZ+ and II: x < CR and
III: D∈ZZ+ and IV: y−1 < DR
by autolet M = C·D
from I III have
T: M ∈ ZZ+ CR ∈ IR DR ∈ IR
using int0.pos_int_closed_mul_unfold PositiveSet_def real_int_is_realby autowith A1 I III have CR ·(DR ·y) = MR ·yusing PositiveSet_def Real_ZF_1_L6A Real_ZF_1_4_L1C
by simpmoreover from A1 I II IV havex < CR ·(DR ·y)using int_pos_is_real_pos Real_ZF_1_3_L2 Real_ZF_1_2_L25
by autoultimately have x < MR ·y
by autowith T show thesis by auto
qed

594

Taking the floor function preserves the order.
lemma (in real1) Real_ZF_1_4_L9: assumes A1: a≤bshows bac ≤ bbc
proof from A1 have T: a∈IR using Real_ZF_1_2_L15
by simpwith A1 have bacR ≤ a and a≤busing Real_ZF_1_4_L7 by auto
then have bacR ≤ b by (rule real_ord_transitive)
moreover from T have bac ∈ int using Real_ZF_1_4_L7
by simpultimately show bac ≤ bbc using Real_ZF_1_4_L8
by simpqed

If S is bounded above and p is a positive intereger, then Γ(S, p) is welldefined.
lemma (in real1) Real_ZF_1_4_L10:
assumes A1: IsBoundedAbove(S,OrderOnReals) S6=0 and A2: p∈ZZ+
shows
IsBoundedAbove({bpR ·xc. x∈S},IntegerOrder)
Γ(S,p) ∈ {bpR ·xc. x∈S}
Γ(S,p) ∈ int
proof let A = {bpR ·xc. x∈S}
from A1 obtain X where I: ∀ x∈S. x≤Xusing IsBoundedAbove_def by auto
{ fix m assume m ∈ Athen obtain x where x∈S and II: m = bpR ·xc
by autowith I have x≤X by simp
moreover from A2 have 0 ≤ pR using int_pos_is_real_pos
by simpultimately have pR ·x ≤ pR ·X using Real_ZF_1_2_L14
by simpwith II have m ≤ bpR ·Xc using Real_ZF_1_4_L9
by simp} then have ∀ m∈A. hm,bpR ·Xci ∈ IntegerOrderby autothen show II: IsBoundedAbove(A,IntegerOrder)by (rule Order_ZF_3_L10)
moreover from A1 have III: A 6= 0 by simp
ultimately have Maximum(IntegerOrder,A) ∈ A
by (rule int0.int_bounded_above_has_max)
moreover from II III have Maximum(IntegerOrder,A) ∈ int
by (rule int0.int_bounded_above_has_max)
ultimately show Γ(S,p) ∈ {bpR ·xc. x∈S} and Γ(S,p) ∈ int
by autoqed595

If p is a positive integer, then for all s ∈ S the floor of p · x is not greaterthat Γ(S, p).
lemma (in real1) Real_ZF_1_4_L11:
assumes A1: IsBoundedAbove(S,OrderOnReals) and A2: x∈S and A3: p∈ZZ+
shows bpR ·xc ≤ Γ(S,p)
proof let A = {bpR ·xc. x∈S}
from A2 have S6=0 by autowith A1 A3 have IsBoundedAbove(A,IntegerOrder) A 6= 0
using Real_ZF_1_4_L10 by auto
then have ∀ x∈A. hx,Maximum(IntegerOrder,A)i ∈ IntegerOrderby (rule int0.int_bounded_above_has_max)
with A2 show bpR ·xc ≤ Γ(S,p) by simp
qed

The candidate for supremum is an integer mapping with values given by Γ.
lemma (in real1) Real_ZF_1_4_L12:
assumes A1: IsBoundedAbove(S,OrderOnReals) S6=0 and
A2: g = {hp,Γ(S,p)i. p∈ZZ+ }shows
g : ZZ+ →int
∀ n∈ZZ+ . g(n) = Γ(S,n)
proof from A1 have ∀ n∈ZZ+ . Γ(S,n) ∈ int using Real_ZF_1_4_L10
by simpwith A2 show I: g : ZZ+ →int using ZF_fun_from_total by simp
{ fix n assume n∈ZZ+with A2 I have g(n) = Γ(S,n) using ZF_fun_from_tot_val
by simp} then show ∀ n∈ZZ+ . g(n) = Γ(S,n) by simp
qed

Every integer is equal to the floor of its embedding.
lemma (in real1) Real_ZF_1_4_L14: assumes A1: m ∈ int
shows bmR c = m
proof let A = {n ∈ int. nR ≤ mR }have antisym(IntegerOrder) using int0.Int_ZF_2_L4
by simpmoreover from A1 have m ∈ Ausing real_int_is_real real_ord_refl by auto
moreover from A1 have ∀ n ∈ A. hn,mi ∈ IntegerOrderusing Real_ZF_1_4_L6 by auto
ultimately show bmR c = m using Order_ZF_4_L14
by autoqed

Floor of (real) zero is (integer) zero.

596

lemma (in real1) floor_01_is_zero_one: showsb0c = 0Zb1c = 1Z
proof have b(0Z )R c = 0Z and b(1Z )R c = 1Z
using int0.int_zero_one_are_int Real_ZF_1_4_L14
by autothen show b0c = 0Z and b1c = 1Z
using int_0_1_are_real_zero_one
by autoqed

Floor of (real) two is (integer) two.
lemma (in real1) floor_2_is_two: shows b2c = 2Z
proof have b(2Z )R c = 2Z
using int0.int_two_three_are_int Real_ZF_1_4_L14
by simpthen show b2c = 2Z using int_two_is_real_two
by simpqed

Floor of a product of embeddings of integers is equal to the product ofintegers.
lemma (in real1) Real_ZF_1_4_L14A: assumes A1: m ∈ int
shows bmR ·kR c = m·k
proof from A1 have T: m·k ∈ int
using int0.Int_ZF_1_1_L5 by simp
from A1 have bmR ·kR c = b(m·k)R c using Real_ZF_1_4_L1C
by simpwith T show bmR ·kR c = m·k using Real_ZF_1_4_L14
by simpqedk ∈ int

Floor of the sum of a number and the embedding of an integer is the floorof the number plus the integer.
lemma (in real1) Real_ZF_1_4_L15: assumes A1: x∈IR and A2: p ∈ int
shows bx + pR c = bxc + p
proof let A = {n ∈ int. nR ≤ x + pR }have antisym(IntegerOrder) using int0.Int_ZF_2_L4
by simpmoreover have bxc + p ∈ A
proof from A1 A2 have bxcR ≤ x and pR ∈ IR
using Real_ZF_1_4_L7 real_int_is_real by auto
then have bxcR + pR ≤ x + pR
using add_num_to_ineq by simp597

moreover from A1 A2 have (bxc + p)R = bxcR + pR
using Real_ZF_1_4_L7 Real_ZF_1_4_L1A by simp
ultimately have (bxc + p)R ≤ x + pR
by simpmoreover from A1 A2 have bxc + p ∈ int
using Real_ZF_1_4_L7 int0.Int_ZF_1_1_L5 by simp
ultimately show bxc + p ∈ A by autoqed
moreover have ∀ n∈A. n ≤ bxc + p
proof
fix n assume n∈Athen have I: n ∈ int and nR ≤ x + pR
by autowith A1 A2 have nR - pR ≤ xusing real_int_is_real Real_ZF_1_2_L19
by simpwith A2 I have b(n-p)R c ≤ bxc
using Real_ZF_1_4_L1B Real_ZF_1_4_L9
by simpmoreoverfrom A2 I have n-p ∈ int
using int0.Int_ZF_1_1_L5 by simp
then have b(n-p)R c = n-pusing Real_ZF_1_4_L14 by simp
ultimately have n-p ≤ bxc
by simpwith A2 I show n ≤ bxc + p
using int0.Int_ZF_2_L9C by simp
qed
ultimately show bx + pR c = bxc + p
using Order_ZF_4_L14 by autoqed

Floor of the difference of a number and the embedding of an integer is thefloor of the number minus the integer.
lemma (in real1) Real_ZF_1_4_L16: assumes A1: x∈IR and A2: p ∈ int
shows bx - pR c = bxc - p
proof from A2 have bx - pR c = bx + (-p)R c
using Real_ZF_1_4_L1 by simp
with A1 A2 show bx - pR c = bxc - p
using int0.Int_ZF_1_1_L4 Real_ZF_1_4_L15 by simp
qed

The floor of sum of embeddings is the sum of the integers.
lemma (in real1) Real_ZF_1_4_L17: assumes m ∈ int n ∈ int
shows b(mR ) + nR c = m + nusing assms real_int_is_real Real_ZF_1_4_L15 Real_ZF_1_4_L14
by simp598

A lemma about adding one to floor.
lemma (in real1) Real_ZF_1_4_L17A: assumes A1: a∈IRshows 1 + bacR = (1Z + bac)R
proof have 1 + bacR = 1Z R + bacRusing int_0_1_are_real_zero_one by simp
with A1 show 1 + bacR = (1Z + bac)R
using int0.int_zero_one_are_int Real_ZF_1_4_L7 Real_ZF_1_4_L1A
by simpqed

The difference between the a number and the embedding of its floor is(strictly) less than one.
lemma (in real1) Real_ZF_1_4_L17B: assumes A1: a∈IRshows
a - bacR < 1
a < (1Z + bac)R
proof from A1 have T1: bac ∈ int bacR ∈ IR and
T2: 1 ∈ IR a - bacR ∈ IR
using Real_ZF_1_4_L7 real_int_is_real Real_ZF_1_L6 Real_ZF_1_L4
by auto{ assume 1 ≤ a - bacRwith A1 T1 have b1Z R + bacR c ≤ bacusing Real_ZF_1_2_L21 Real_ZF_1_4_L9 int_0_1_are_real_zero_one
by simpwith T1 have False
using int0.int_zero_one_are_int Real_ZF_1_4_L17
int0.Int_ZF_1_2_L3AA by simp
} then have I: ¬(1 ≤ a - bacR ) by autowith T2 show II: a - bacR < 1
by (rule Real_ZF_1_2_L20)
with A1 T1 I II havea < 1 + bacRusing Real_ZF_1_2_L26 by simp
with A1 show a < (1Z + bac)R
using Real_ZF_1_4_L17A by simp
qed

The next lemma corresponds to Lemma 14 iii) in [2]. It says that we canfind a rational number between any two different real numbers.
lemma (in real1) Arthan_Lemma14iii: assumes A1: x<yshows ∃ M∈int. ∃ N∈ZZ+ . x·NR < MR ∧ MR < y·NR
proof from A1 have (y-x)−1 ∈ IR+ using Real_ZF_1_3_L3
by simpthen have∃ N∈ZZ+ . (y-x)−1 < NR599

using Arthan_Lemma14i PositiveSet_def by simp
then obtain N where I: N∈ZZ+ and II: (y-x)−1 < NR
by autolet M = 1Z + bx·NR cfrom A1 I have
T1: x∈IR NR ∈ IR NR ∈ IR+ x·NR ∈ IR
using Real_ZF_1_2_L15 PositiveSet_def real_int_is_real
Real_ZF_1_L6 int_pos_is_real_pos by auto
then have T2: M ∈ int using
int0.int_zero_one_are_int Real_ZF_1_4_L7 int0.Int_ZF_1_1_L5
by simpfrom T1 have III: x·NR < MR
using Real_ZF_1_4_L17B by simp
from T1 have (1 + bx·NR cR ) ≤ (1 + x·NR )using Real_ZF_1_4_L7 Real_ZF_1_L4 real_ord_transl_inv
by simpwith T1 have MR ≤ (1 + x·NR )using Real_ZF_1_4_L17A by simp
moreover from A1 II have (1 + x·NR ) < y·NR
using Real_ZF_1_3_L5 by simp
ultimately have MR < y·NRby (rule real_strict_ord_transit)
with I T2 III show thesis by autoqedSome estimates for the homomorphism difference of the floor function.
lemma (in real1) Real_ZF_1_4_L18: assumes A1: x∈IR y∈IRshowsabs(bx+yc - bxc - byc) ≤ 2Z
proof from A1 have T:
bxcR ∈ IR bycR ∈ IR
x+y - (bxcR ) ∈ IR
using Real_ZF_1_4_L7 real_int_is_real Real_ZF_1_L6
by autofrom A1 have0 ≤ x - (bxcR ) + (y - (bycR ))x - (bxcR ) + (y - (bycR )) ≤ 2
using Real_ZF_1_4_L7 Real_ZF_1_2_L16 Real_ZF_1_2_L17
Real_ZF_1_4_L17B Real_ZF_1_2_L18 by auto
moreover from A1 T havex - (bxcR ) + (y - (bycR )) = x+y - (bxcR ) - (bycR )using Real_ZF_1_L7A by simp
ultimately have0 ≤ x+y - (bxcR ) - (bycR )x+y - (bxcR ) - (bycR ) ≤ 2
by autothen haveb0c ≤ bx+y - (bxcR ) - (bycR )c600

bx+y - (bxcR ) - (bycR )c ≤ b2c
using Real_ZF_1_4_L9 by auto
then have
0Z ≤ bx+y - (bxcR ) - (bycR )cbx+y - (bxcR ) - (bycR )c ≤ 2Z
using floor_01_is_zero_one floor_2_is_two by auto
moreover from A1 havebx+y - (bxcR ) - (bycR )c = bx+yc - bxc - byc
using Real_ZF_1_L6 Real_ZF_1_4_L7 real_int_is_real Real_ZF_1_4_L16
by simpultimately have
0Z ≤ bx+yc - bxc - byc
bx+yc - bxc - byc ≤ 2Z
by autothen show abs(bx+yc - bxc - byc) ≤ 2Z
using int0.Int_ZF_2_L16 by simp
qed

Suppose S 6= ∅ is bounded above and Γ(S, m) = bmR · xc for some positive
integer m and x ∈ S. Then if y ∈ S, x ≤ y we also have Γ(S, m) = bmR · yc.
lemma (in real1) Real_ZF_1_4_L20:
assumes A1: IsBoundedAbove(S,OrderOnReals) S6=0 and
A2: n∈ZZ+ x∈S andA3: Γ(S,n) = bnR ·xc and
A4: y∈S x≤yshows Γ(S,n) = bnR ·yc
proof from A2 A4 have bnR ·xc ≤ b(nR )·yc
using int_pos_is_real_pos Real_ZF_1_2_L14 Real_ZF_1_4_L9
by simpwith A3 have hΓ(S,n),b(nR )·yci ∈ IntegerOrderby simpmoreover from A1 A2 A4 have hbnR ·yc,Γ(S,n)i ∈ IntegerOrderusing Real_ZF_1_4_L11 by simp
ultimately show Γ(S,n) = bnR ·yc
by (rule int0.Int_ZF_2_L3)
qed

The homomorphism difference of n 7→ Γ(S, n) is bounded by 2 on positive
integers.
lemma (in real1) Real_ZF_1_4_L21:
assumes A1: IsBoundedAbove(S,OrderOnReals) S6=0 and
A2: m∈ZZ+ n∈ZZ+shows abs(Γ(S,m+n) - Γ(S,m) - Γ(S,n)) ≤ 2Z
proof from A2 have T: m+n ∈ ZZ+ using int0.pos_int_closed_add_unfoldedby simpwith A1 A2 haveΓ(S,m) ∈ {bmR ·xc. x∈S} and601

Γ(S,n) ∈ {bnR ·xc. x∈S} andΓ(S,m+n) ∈ {b(m+n)R ·xc. x∈S}
using Real_ZF_1_4_L10 by auto
then obtain a b c where I: a∈S b∈S c∈S
and II:
Γ(S,m) = bmR ·ac
Γ(S,n) = bnR ·bc
Γ(S,m+n) = b(m+n)R ·cc
by autolet d = Maximum(OrderOnReals,{a,b,c})from A1 I have a∈IR b∈IR c∈IRusing Real_ZF_1_2_L23 by auto
then have IV:d ∈ {a,b,c}d ∈ IR
a ≤ d
b ≤ d
c ≤ d
using Real_ZF_1_2_L24 by autowith I have V: d ∈ S by autofrom A1 T I II IV V have Γ(S,m+n) = b(m+n)R ·dc
using Real_ZF_1_4_L20 by blast
also from A2 have . . . = b((mR )+(nR ))·dc
using Real_ZF_1_4_L1A PositiveSet_def by simp
also from A2 IV have . . . = b(mR )·d + (nR )·dc
using PositiveSet_def real_int_is_real Real_ZF_1_L7
by simp
finally have Γ(S,m+n) = b(mR )·d + (nR )·dc
by simpmoreover from A1 A2 I II IV V have Γ(S,m) = bmR ·dc
using Real_ZF_1_4_L20 by blast
moreover from A1 A2 I II IV V have Γ(S,n) = bnR ·dc
using Real_ZF_1_4_L20 by blast
moreover from A1 T I II IV V have Γ(S,m+n) = b(m+n)R ·dc
using Real_ZF_1_4_L20 by blast
ultimately have abs(Γ(S,m+n) - Γ(S,m) - Γ(S,n)) =abs(b(mR )·d + (nR )·dc - bmR ·dc - bnR ·dc)
by simpwith A2 IV showabs(Γ(S,m+n) - Γ(S,m) - Γ(S,n)) ≤ 2Z
using PositiveSet_def real_int_is_real Real_ZF_1_L6
Real_ZF_1_4_L18 by simp
qed

The next lemma provides sufficient condition for an odd function to be analmost homomorphism. It says for odd functions we only need to check thatthe homomorphism difference (denoted δ in the real1 context) is boundedon positive integers. This is really proven in Int_ZF_2.thy, but we restate
it here for convenience. Recall from Group_ZF_3.thy that OddExtension of a602

function defined on the set of positive elements (of an ordered group) is the
only odd function that is equal to the given one when restricted to positiveelements.
lemma (in real1) Real_ZF_1_4_L21A:
assumes A1: f:ZZ+ →int ∀ a∈ZZ+ . ∀ b∈ZZ+ . abs(δ(f,a,b)) ≤ Lshows OddExtension(int,IntegerAddition,IntegerOrder,f) ∈ S
using A1 int1.Int_ZF_2_1_L24 by auto

The candidate for (a representant of) the supremum of a nonempty bounded
above set is a slope.
lemma (in real1) Real_ZF_1_4_L22:
assumes A1: IsBoundedAbove(S,OrderOnReals) S6=0 and
A2: g = {hp,Γ(S,p)i. p∈ZZ+ }shows OddExtension(int,IntegerAddition,IntegerOrder,g) ∈ S
proof from A1 A2 have g: ZZ+ →int by (rule Real_ZF_1_4_L12)
moreover have ∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(g,m,n)) ≤ 2Z
proof { fix m n assume A3: m∈ZZ+ n∈ZZ+
then have m+n ∈ ZZ+ m∈ZZ+ n∈ZZ+using int0.pos_int_closed_add_unfoldedby automoreover from A1 A2 have ∀ n∈ZZ+ . g(n) = Γ(S,n)
by (rule Real_ZF_1_4_L12)
ultimately have δ(g,m,n) = Γ(S,m+n) - Γ(S,m) - Γ(S,n)
by simpmoreover from A1 A3 haveabs(Γ(S,m+n) - Γ(S,m) - Γ(S,n)) ≤ 2Z
by (rule Real_ZF_1_4_L21)
ultimately have abs(δ(g,m,n)) ≤ 2Z
by simp} then show ∀ m∈ZZ+ . ∀ n∈ZZ+ . abs(δ(g,m,n)) ≤ 2Z
by simpqed
ultimately show thesis by (rule Real_ZF_1_4_L21A)
qed

A technical lemma used in the proof that all elements of S are less or equal
than the candidate for supremum of S.
lemma (in real1) Real_ZF_1_4_L23:
assumes A1: f ∈ S and A2: N ∈ int M ∈ int andA3: ∀ n∈ZZ+ . M·n ≤ f(N·n)
shows MR ≤ [f]·(NR )proof let MS = {hn, M·ni . n ∈ int}
let NS = {hn, N·ni . n ∈ int}
from A1 A2 have T: MS ∈ S NS ∈ S f◦NS ∈ S
using int1.Int_ZF_2_5_L1 int1.Int_ZF_2_1_L11 SlopeOp2_def603

by auto
moreover from A1 A2 A3 have MS ∼ f◦NS ∨ f◦NS + (-MS ) ∈ S +using int1.Int_ZF_2_5_L8 SlopeOp2_def SlopeOp1_def Slopes_def
BoundedIntMaps_def SlopeEquivalenceRel_def PositiveIntegers_def
PositiveSlopes_def by simp
ultimately have [MS ] ≤ [f◦NS ] using Real_ZF_1_2_L12
by simpwith A1 T show MR ≤ [f]·(NR ) using Real_ZF_1_1_L4
by simpqed

A technical lemma aimed used in the proof the candidate for supremum of
S is less or equal than any upper bound for S.
lemma (in real1) Real_ZF_1_4_L23A:
assumes A1: f ∈ S and A2: N ∈ int M ∈ int andA3: ∀ n∈ZZ+ . f(N·n) ≤ M·nshows [f]·(NR ) ≤ MR
proof let MS = {hn, M·ni . n ∈ int}
let NS = {hn, N·ni . n ∈ int}
from A1 A2 have T: MS ∈ S NS ∈ S f◦NS ∈ S
using int1.Int_ZF_2_5_L1 int1.Int_ZF_2_1_L11 SlopeOp2_def
by automoreover from A1 A2 A3 havef◦NS ∼ MS ∨ MS + (-(f◦NS )) ∈ S +using int1.Int_ZF_2_5_L9 SlopeOp2_def SlopeOp1_def Slopes_def
BoundedIntMaps_def SlopeEquivalenceRel_def PositiveIntegers_def
PositiveSlopes_def by simp
ultimately have [f◦NS ] ≤ [MS ] using Real_ZF_1_2_L12
by simpwith A1 T show [f]·(NR )≤ MR using Real_ZF_1_1_L4
by simpqed

The essential condition to claim that the candidate for supremum of S isgreater or equal than all elements of S.
lemma (in real1) Real_ZF_1_4_L24:
assumes A1: IsBoundedAbove(S,OrderOnReals) andA2: x<y y∈S and
A4: N ∈ ZZ+ M ∈ int andA5: MR < y·NR and A6: p ∈ ZZ+
shows p·M ≤ Γ(S,p·N)
proof from A2 A4 A6 have T1:
NR ∈ IR+y∈IR
pR ∈ IR+R
p·N ∈ ZZ+
(p·N) ∈ IR+
using int_pos_is_real_pos Real_ZF_1_2_L15
int0.pos_int_closed_mul_unfold by autowith A4 A6 have T2:604p ∈ intpR ∈ IRNR ∈ IR NR 6= 0
MR ∈ IR
using real_int_is_real PositiveSet_def by autofrom T1 A5 have b(p·N)R ·(MR ·(NR )−1 )c ≤ b(p·N)R ·yc
using Real_ZF_1_3_L4A Real_ZF_1_3_L7 Real_ZF_1_4_L9
by simpmoreover from A1 A2 T1 have b(p·N)R ·yc ≤ Γ(S,p·N)
using Real_ZF_1_4_L11 by simp
ultimately have I: b(p·N)R ·(MR ·(NR )−1 )c ≤ Γ(S,p·N)
by (rule int_order_transitive)
from A4 A6 have (p·N)R ·(MR ·(NR )−1 ) = pR ·NR ·(MR ·(NR )−1 )using PositiveSet_def Real_ZF_1_4_L1C by simp
with A4 T2 have b(p·N)R ·(MR ·(NR )−1 )c = p·M
using Real_ZF_1_3_L8 Real_ZF_1_4_L14A by simp
with I show p·M ≤ Γ(S,p·N) by simpqed

An obvious fact about odd extension of a function p 7→ Γ(s, p) that is useda couple of times in proofs.
lemma (in real1) Real_ZF_1_4_L24A:
assumes A1: IsBoundedAbove(S,OrderOnReals) S6=0 and A2: p ∈ ZZ+
and A3:h = OddExtension(int,IntegerAddition,IntegerOrder,{hp,Γ(S,p)i. p∈ZZ+ })shows h(p) = Γ(S,p)
proof let g = {hp,Γ(S,p)i. p∈ZZ+ }from A1 have I: g : ZZ+ →int using Real_ZF_1_4_L12
by blastwith A2 A3 show h(p) = Γ(S,p)
using int0.Int_ZF_1_5_L11 ZF_fun_from_tot_val
by simpqed

The candidate for the supremum of S is not smaller than any element of S.
lemma (in real1) Real_ZF_1_4_L25:
assumes A1: IsBoundedAbove(S,OrderOnReals) andA2: ¬HasAmaximum(OrderOnReals,S) andA3: x∈S and A4:
h = OddExtension(int,IntegerAddition,IntegerOrder,{hp,Γ(S,p)i. p∈ZZ+ })shows x ≤ [h]proof from A1 A2 A3 have
S ⊆ IR ¬HasAmaximum(OrderOnReals,S) x∈Susing Real_ZF_1_2_L23 by auto
then have ∃ y∈S. x<y by (rule Real_ZF_1_2_L27)
then obtain y where I: y∈S and II: x<yby autofrom II have
∃ M∈int. ∃ N∈ZZ+ . x·NR < MR ∧ MR < y·NR
using Arthan_Lemma14iii by simp605

then obtain M N where III: M ∈ int N∈ZZ+ and
IV: x·NR < MR MR < y·NR
by autofrom II III IV have V: x ≤ MR ·(NR )−1
using int_pos_is_real_pos Real_ZF_1_2_L15 Real_ZF_1_3_L4
by autofrom A3 have VI: S6=0 by autowith A1 A4 have T1: h ∈ S using Real_ZF_1_4_L22
by simpmoreover from III have N ∈ int M ∈ int
using PositiveSet_def by auto
moreover have ∀ n∈ZZ+ . M·n ≤ h(N·n)
proof
let g = {hp,Γ(S,p)i. p∈ZZ+ }fix n assume A5: n∈ZZ+with III have T2: N·n ∈ ZZ+
using int0.pos_int_closed_mul_unfold by simp
from III A5 have
N·n = n·N and n·M = M·nusing PositiveSet_def int0.Int_ZF_1_1_L5 by auto
moreoverfrom A1 I II III IV A5 have
IsBoundedAbove(S,OrderOnReals)
x<y y∈SN ∈ ZZ+ M ∈ int
MR < y·NR n ∈ ZZ+
by autothen have n·M ≤ Γ(S,n·N) by (rule Real_ZF_1_4_L24)
moreover from A1 A4 VI T2 have h(N·n) = Γ(S,N·n)using Real_ZF_1_4_L24A by simp
ultimately show M·n ≤ h(N·n) by autoqed
ultimately have MR ≤ [h]·NR using Real_ZF_1_4_L23
by simpwith III T1 have MR ·(NR )−1 ≤ [h]using int_pos_is_real_pos Real_ZF_1_1_L3 Real_ZF_1_3_L4B
by simpwith V show x ≤ [h] by (rule real_ord_transitive)qed

The essential condition to claim that the candidate for supremum of S isless or equal than any upper bound of S.
lemma (in real1) Real_ZF_1_4_L26:
assumes A1: IsBoundedAbove(S,OrderOnReals) andA2: x≤y x∈S and
A4: N ∈ ZZ+ M ∈ int andA5: y·NR < MR and A6: p ∈ ZZ+
shows b(N·p)R ·xc ≤ M·p
proof -

606

from A2 A4 A6 have T:
p·N ∈ ZZ+ p ∈ int N ∈ int
pR ∈ IR+ pR ∈ IR NR ∈ IR x ∈ IR y ∈ IR
using int0.pos_int_closed_mul_unfold PositiveSet_def
real_int_is_real Real_ZF_1_2_L15 int_pos_is_real_pos
by autowith A2 have (p·N)R ·x ≤ (p·N)R ·y
using int_pos_is_real_pos Real_ZF_1_2_L14A
by simpmoreover from A4 T have I:(p·N)R = pR ·NR(p·M)R = pR ·MR
using Real_ZF_1_4_L1C by auto
ultimately have (p·N)R ·x ≤ pR ·NR ·y
by simpmoreoverfrom A5 T I have pR ·(y·NR ) < (p·M)Rusing Real_ZF_1_3_L7 by simp
with T have pR ·NR ·y < (p·M)R using Real_ZF_1_1_L9
by simpultimately have (p·N)R ·x < (p·M)R
by (rule real_strict_ord_transit)
then have b(p·N)R ·xc ≤ b(p·M)R c
using Real_ZF_1_4_L9 by simp
moreoverfrom A4 T have p·M ∈ int using int0.Int_ZF_1_1_L5
by simpthen have b(p·M)R c = p·M using Real_ZF_1_4_L14
by simpmoreover from A4 A6 have p·N = N·p and p·M = M·pusing PositiveSet_def int0.Int_ZF_1_1_L5 by auto
ultimately show b(N·p)R ·xc ≤ M·p by simpqed

A piece of the proof of the fact that the candidate for the supremum of S
is not greater than any upper bound of S, done separately for clarity (ofmind).
lemma (in real1) Real_ZF_1_4_L27:
assumes IsBoundedAbove(S,OrderOnReals) S6=0 and
h = OddExtension(int,IntegerAddition,IntegerOrder,{hp,Γ(S,p)i. p∈ZZ+ })and p ∈ ZZ+
shows ∃ x∈S. h(p) = bpR ·xc
using assms Real_ZF_1_4_L10 Real_ZF_1_4_L24A by auto

The candidate for the supremum of S is not greater than any upper boundof S.
lemma (in real1) Real_ZF_1_4_L28:
assumes A1: IsBoundedAbove(S,OrderOnReals)and A2: ∀ x∈S. x≤y and A3:

607

S6=0

h = OddExtension(int,IntegerAddition,IntegerOrder,{hp,Γ(S,p)i. p∈ZZ+ })shows [h] ≤ yproof from A1 obtain a where a∈S by autowith A1 A2 A3 have T: y∈IR h ∈ S [h] ∈ IR
using Real_ZF_1_2_L15 Real_ZF_1_4_L22 Real_ZF_1_1_L3
by auto{ assume ¬([h] ≤ y)with T have y < [h] using Real_ZF_1_2_L28
by blast
then have ∃ M∈int. ∃ N∈ZZ+ . y·NR < MR ∧ MR < [h]·NR
using Arthan_Lemma14iii by simp
then obtain M N where I: M∈int N∈ZZ+ and
II: y·NR < MR MR < [h]·NR
by autofrom I have III: NR ∈ IR+ using int_pos_is_real_pos
by simphave ∀ p∈ZZ+ . h(N·p) ≤ M·p
proof
fix p assume A4: p∈ZZ+with A1 A3 I have ∃ x∈S. h(N·p) = b(N·p)R ·xc
using int0.pos_int_closed_mul_unfold Real_ZF_1_4_L27
by simpwith A1 A2 I II A4 show h(N·p) ≤ M·pusing Real_ZF_1_4_L26 by autoqedwith T I have [h]·NR ≤ MR
using PositiveSet_def Real_ZF_1_4_L23A
by simpwith T III have [h] ≤ MR ·(NR )−1
using Real_ZF_1_3_L4C by simp
moreover from T II III have MR ·(NR )−1 < [h]using Real_ZF_1_3_L4A by simp
ultimately have False using Real_ZF_1_2_L29 by blast} then show [h] ≤ y by autoqed

Now we can prove that every nonempty subset of reals that is bounded
above has a supremum. Proof by considering two cases: when the set has amaximum and when it does not.
lemma (in real1) real_order_complete:assumes A1: IsBoundedAbove(S,OrderOnReals)
S6=0T
shows HasAminimum(OrderOnReals, a∈S. OrderOnReals{a})proof { assume HasAmaximum(OrderOnReals,S)T
with A1 have HasAminimum(OrderOnReals, a∈S. OrderOnReals{a})using Real_ZF_1_2_L10 IsAnOrdGroup_def IsPartOrder_def
Order_ZF_5_L6 by simp }moreover608

{ assume A2: ¬HasAmaximum(OrderOnReals,S)
let h = OddExtension(int,IntegerAddition,IntegerOrder,{hp,Γ(S,p)i.
p∈ZZ+ })
let r = OrderOnReals
from A1 have antisym(OrderOnReals) S6=0
using Real_ZF_1_2_L10 IsAnOrdGroup_def IsPartOrder_def by auto
moreover from A1 A2 have ∀ x∈S. hx,[h]i ∈ rusing Real_ZF_1_4_L25 by simp
moreover from A1 have ∀ y. (∀ x∈S. hx,yi ∈ r) −→ h[h],yi ∈ rusing Real_ZF_1_4_L28 by simp
Tultimately have HasAminimum(OrderOnReals, a∈S. OrderOnReals{a})by (rule Order_ZF_5_L5) }ultimately show thesis by blast
qed

Finally, we are ready to formulate the main result: that the constructionof real numbers from the additive group of integers results in a complete
ordered field. This theorem completes the construction. It was fun.
theorem eudoxus_reals_are_reals: shows
IsAmodelOfReals(RealNumbers,RealAddition,RealMultiplication,OrderOnReals)
using real1.reals_are_ord_field real1.real_order_complete
IsComplete_def IsAmodelOfReals_def by simpend48Complex numbers

theory Complex_ZF imports func_ZF_1 OrderedField_ZF
begin

The goal of this theory is to define complex numbers and prove that theMetamath complex numbers axioms hold.

48.1

From complete ordered fields to complex numbers

This section consists mostly of definitions and a proof context for talking
about complex numbers. Suppose we have a set R with binary operations
A and M and a relation r such that the quadruple (R, A, M, r) forms acomplete ordered field. The next definitions take (R, A, M, r) and construct
the sets that represent the structure of complex numbers: the carrier (C =R×R), binary operations of addition and multiplication of complex numbers
and the order relation on R = R × 0. The ImCxAdd, ReCxAdd, ImCxMul,
ReCxMul are helper meta-functions representing the imaginary part of a sumof complex numbers, the real part of a sum of real numbers, the imaginary
part of a product of complex numbers and the real part of a product of real609

numbers, respectively. The actual operations (subsets of (R × R) × R are
named CplxAdd and CplxMul.
When R is an ordered field, it comes with an order relation. This induces
a natural strict order relation on {hx, 0i : x ∈ R} ⊆ R × R. We callthe set {hx, 0i : x ∈ R} ComplexReals(R,A) and the strict order relation
CplxROrder(R,A,r). The order on the real axis of complex numbers is defined as the relation induced on it by the canonical projection on the firstcoordinate and the order we have on the real numbers. OK, lets repeat thisslower. We start with the order relation r on a (model of) real numbers R.
We want to define an order relation on a subset of complex numbers, namely
on R×{0}. To do that we use the notion of a relation induced by a mapping.
The mapping here is f : R × {0} → R, f hx, 0i = x which is defined under aname of SliceProjection in func_ZF.thy. This defines a relation r1 (called
InducedRelation(f,r), see func_ZF) on R × {0} such that hhx, 0i, hy, 0i ∈ r1
iff hx, yi ∈ r. This way we get what we call CplxROrder(R,A,r). However,this is not the end of the story, because Metamath uses strict inequalities in
its axioms, rather than weak ones like IsarMathLib (mostly). So we need totake the strict version of this order relation. This is done in the syntax definition of <R in the definition of complex0 context. Since Metamath proves
a lot of theorems about the real numbers extended with +∞ and −∞, wedefine the notation for inequalites on the extended real line as well.
A helper expression representing the real part of the sum of two complex
numbers.
definition
ReCxAdd(R,A,a,b) ≡ Ahfst(a),fst(b)i

An expression representing the imaginary part of the sum of two complex
numbers.
definition
ImCxAdd(R,A,a,b) ≡ Ahsnd(a),snd(b)i

The set (function) that is the binary operation that adds complex numbers.
definition
CplxAdd(R,A) ≡{hp, h ReCxAdd(R,A,fst(p),snd(p)),ImCxAdd(R,A,fst(p),snd(p)) i i.
p∈(R×R)×(R×R)}

The expression representing the imaginary part of the product of complex
numbers.
definition
ImCxMul(R,A,M,a,b) ≡ AhMhfst(a),snd(b)i, Mhsnd(a),fst(b)i i

The expression representing the real part of the product of complex numbers.
definition

610

ReCxMul(R,A,M,a,b) ≡AhMhfst(a),fst(b)i,GroupInv(R,A)(Mhsnd(a),snd(b)i)i

The function (set) that represents the binary operation of multiplication ofcomplex numbers.
definition
CplxMul(R,A,M) ≡{ hp, hReCxMul(R,A,M,fst(p),snd(p)),ImCxMul(R,A,M,fst(p),snd(p))i i.
p ∈ (R×R)×(R×R)}

The definition real numbers embedded in the complex plane.
definition
ComplexReals(R,A) ≡ R×{TheNeutralElement(R,A)}

Definition of order relation on the real line.
definition
CplxROrder(R,A,r) ≡InducedRelation(SliceProjection(ComplexReals(R,A)),r)The next locale defines proof context and notation that will be used forcomplex numbers.
locale complex0 =fixes R and A and M and r
assumes R_are_reals: IsAmodelOfReals(R,A,M,r)fixes complex (C)defines complex_def[simp]: C ≡ R×R
fixes rone (1R )defines rone_def[simp]: 1R ≡ TheNeutralElement(R,M)
fixes rzero (0R )defines rzero_def[simp]: 0R ≡ TheNeutralElement(R,A)
fixes one (1)defines one_def[simp]: 1 ≡ h1R , 0R i
fixes zero (0)defines zero_def[simp]: 0 ≡ h0R , 0R i
fixes iunit (i)defines iunit_def[simp]: i ≡ h0R ,1R i
fixes creal (IR)defines creal_def[simp]: IR ≡ {hr,0R i. r∈R}
fixes rmul (infixl · 71)

611

defines rmul_def[simp]: a · b ≡ Mha,bifixes radd (infixl + 69)
defines radd_def[simp]: a + b ≡ Aha,bifixes rneg (- _ 70)
defines rneg_def[simp]: - a ≡GroupInv(R,A)(a)fixes ca (infixl + 69)
defines ca_def[simp]: a + b ≡ CplxAdd(R,A)ha,bifixes cm (infixl · 71)
defines cm_def[simp]: a · b ≡ CplxMul(R,A,M)ha,bifixes cdiv (infixl / 70)Sdefines cdiv_def[simp]: a / b ≡{ x ∈ C. b · x = a }fixes sub (infixl - 69)
Sdefines sub_def[simp]: a - b ≡{ x ∈ C. b + x = a }fixes cneg (-_ 95)
defines cneg_def[simp]: - a ≡ 0 - a
fixes lessr (infix <R 68)
defines lessr_def[simp]:
a <R b ≡ ha,bi ∈ StrictVersion(CplxROrder(R,A,r))fixes cpnf (+∞)
defines cpnf_def[simp]: +∞ ≡ C
fixes cmnf (−∞)
defines cmnf_def[simp]: −∞ ≡ {C}fixes cxr (IR∗ )defines cxr_def[simp]: IR∗ ≡ IR ∪ {+∞,−∞}
fixes cxn (IN)defines
T cxn_def[simp]:
IN ≡{N ∈ Pow(IR). 1 ∈ N ∧ (∀ n. n∈N −→ n+1 ∈ N)}
fixes cltrrset (<)
defines cltrrset_def[simp]:< ≡ StrictVersion(CplxROrder(R,A,r)) ∩ IR×IR ∪{h−∞,+∞i} ∪ (IR×{+∞}) ∪ ({−∞}×IR )fixes cltrr (infix < 68)
defines cltrr_def[simp]: a < b ≡ ha,bi ∈ <fixes lsq (infix ≤ 68)612

defines lsq_def[simp]: a ≤ b ≡ ¬ (b < a)fixes two (2)defines two_def[simp]: 2 ≡ 1 + 1
fixes three (3)defines three_def[simp]: 3 ≡ 2+1
fixes four (4)defines four_def[simp]: 4 ≡ 3+1
fixes five (5)defines five_def[simp]: 5 ≡ 4+1
fixes six (6)defines six_def[simp]: 6 ≡ 5+1
fixes seven (7)defines seven_def[simp]: 7 ≡ 6+1
fixes eight (8)defines eight_def[simp]: 8 ≡ 7+1
fixes nine (9)defines nine_def[simp]: 9 ≡ 8+1

48.2

Axioms of complex numbers

In this section we will prove that all Metamath’s axioms of complex numbers
hold in the complex0 context.
The next lemma lists some contexts that are valid in the complex0 context.
lemma (in complex0) valid_cntxts: shows
field1(R,A,M,r)field0(R,A,M)
ring1(R,A,M,r)group3(R,A,r)
ring0(R,A,M)
M {is commutative on} R
group0(R,A)
proof from R_are_reals have I: IsAnOrdField(R,A,M,r)using IsAmodelOfReals_def by simp
then show field1(R,A,M,r) using OrdField_ZF_1_L2 by simp
then show ring1(R,A,M,r) and I: field0(R,A,M)
using field1.axioms ring1_def field1.OrdField_ZF_1_L1B
by autothen show group3(R,A,r) using ring1.OrdRing_ZF_1_L4
by simp613

from I have IsAfield(R,A,M) using field0.Field_ZF_1_L1
by simpthen have IsAring(R,A,M) and M {is commutative on} R
using IsAfield_def by auto
then show ring0(R,A,M) and M {is commutative on} R
using ring0_def by auto
then show group0(R,A) using ring0.Ring_ZF_1_L1
by simpqed

The next lemma shows the definition of real and imaginary part of complex
sum and product in a more readable form using notation defined in complex0
locale.
lemma (in complex0) cplx_mul_add_defs: shows
ReCxAdd(R,A,ha,bi,hc,di) = a + c
ImCxAdd(R,A,ha,bi,hc,di) = b + d
ImCxMul(R,A,M,ha,bi,hc,di) = a·d + b·c
ReCxMul(R,A,M,ha,bi,hc,di) = a·c + (-b·d)
proof let z1 = ha,bi
let z2 = hc,dihave ReCxAdd(R,A,z1 ,z2 ) ≡ Ahfst(z1 ),fst(z2 )iby (rule ReCxAdd_def)
moreover have ImCxAdd(R,A,z1 ,z2 ) ≡ Ahsnd(z1 ),snd(z2 )iby (rule ImCxAdd_def)
moreover have
ImCxMul(R,A,M,z1 ,z2 ) ≡ AhM<fst(z1 ),snd(z2 )>,M<snd(z1 ),fst(z2 )>iby (rule ImCxMul_def)
moreover have
ReCxMul(R,A,M,z1 ,z2 ) ≡AhM<fst(z1 ),fst(z2 )>,GroupInv(R,A)(Mhsnd(z1 ),snd(z2 )i)i
by (rule ReCxMul_def)
ultimately show
ReCxAdd(R,A,z1 ,z2 ) = a + c
ImCxAdd(R,A,ha,bi,hc,di) = b + d
ImCxMul(R,A,M,ha,bi,hc,di) = a·d + b·c
ReCxMul(R,A,M,ha,bi,hc,di) = a·c + (-b·d)
by autoqed

Real and imaginary parts of sums and products of complex numbers arereal.
lemma (in complex0) cplx_mul_add_types:
z2 ∈ C
assumes A1: z1 ∈ C
shows
ReCxAdd(R,A,z1 ,z2 ) ∈ R
ImCxAdd(R,A,z1 ,z2 ) ∈ R
ImCxMul(R,A,M,z1 ,z2 ) ∈ R
ReCxMul(R,A,M,z1 ,z2 ) ∈ R

614

proof let a = fst(z1 )let b = snd(z1 )let c = fst(z2 )let d = snd(z2 )from A1 have a ∈ R b ∈ R c ∈ R d ∈ R
by autothen havea + c ∈ R
b + d ∈ R
a·d + b·c ∈ R
a·c + (- b·d) ∈ R
using valid_cntxts ring0.Ring_ZF_1_L4 by autowith A1 show
ReCxAdd(R,A,z1 ,z2 ) ∈ R
ImCxAdd(R,A,z1 ,z2 ) ∈ R
ImCxMul(R,A,M,z1 ,z2 ) ∈ R
ReCxMul(R,A,M,z1 ,z2 ) ∈ R
using cplx_mul_add_defs by autoqedComplex reals are complex. Recall the definition of IR in the complex0 locale.
lemma (in complex0) axresscn: shows IR ⊆ C
using valid_cntxts group0.group0_2_L2 by auto

Complex 1 is not complex 0.
lemma (in complex0) ax1ne0: shows 1 6= 0
proof have IsAfield(R,A,M) using valid_cntxts field0.Field_ZF_1_L1
by simpthen show 1 6= 0 using IsAfield_def by autoqedComplex addition is a complex valued binary operation on complex numbers.
lemma (in complex0) axaddopr: shows CplxAdd(R,A): C × C → C
proof have ∀ p ∈ C×C.
hReCxAdd(R,A,fst(p),snd(p)),ImCxAdd(R,A,fst(p),snd(p))i ∈ Cusing cplx_mul_add_types by simp
then have{hp,hReCxAdd(R,A,fst(p),snd(p)),ImCxAdd(R,A,fst(p),snd(p))i i.
p ∈ C×C}: C×C → C
by (rule ZF_fun_from_total)then show CplxAdd(R,A): C × C → C using CplxAdd_def by simp
qedComplex multiplication is a complex valued binary operation on complex
numbers.
lemma (in complex0) axmulopr: shows CplxMul(R,A,M): C × C → C

615

proof have ∀ p ∈ C×C.
hReCxMul(R,A,M,fst(p),snd(p)),ImCxMul(R,A,M,fst(p),snd(p))i ∈ Cusing cplx_mul_add_types by simp
then have{hp,hReCxMul(R,A,M,fst(p),snd(p)),ImCxMul(R,A,M,fst(p),snd(p))ii.
p ∈ C×C}: C×C → C by (rule ZF_fun_from_total)then show CplxMul(R,A,M): C × C → C using CplxMul_def by simp
qed

What are the values of omplex addition and multiplication in terms of theirreal and imaginary parts?
lemma (in complex0) cplx_mul_add_vals:
assumes A1: a∈R b∈R c∈R d∈R
showsha,bi + hc,di = ha + c, b + diha,bi · hc,di = ha·c + (-b·d), a·d + b·ci
proof let S = CplxAdd(R,A)
let P = CplxMul(R,A,M)
let p = h ha,bi, hc,di ifrom A1 have S : C × C → C and p ∈ C × C
using axaddopr by auto
moreover have
S = {hp, <ReCxAdd(R,A,fst(p),snd(p)),ImCxAdd(R,A,fst(p),snd(p))>i.
p ∈ C × C}
using CplxAdd_def by simp
ultimately have S(p) = hReCxAdd(R,A,fst(p),snd(p)),ImCxAdd(R,A,fst(p),snd(p))iby (rule ZF_fun_from_tot_val)
then show ha,bi + hc,di = ha + c, b + diusing cplx_mul_add_defs by simp
from A1 have P : C × C → C and p ∈ C × C
using axmulopr by auto
moreover have
P = {hp, hReCxMul(R,A,M,fst(p),snd(p)),ImCxMul(R,A,M,fst(p),snd(p))ii.
p ∈ C × C}
using CplxMul_def by simp
ultimately haveP(p) = hReCxMul(R,A,M,fst(p),snd(p)),ImCxMul(R,A,M,fst(p),snd(p))iby (rule ZF_fun_from_tot_val)
then show ha,bi · hc,di = ha·c + (-b·d), a·d + b·ci
using cplx_mul_add_defs by simp
qedComplex multiplication is commutative.
lemma (in complex0) axmulcom: assumes A1: a ∈ Cshows a·b = b·a

616

b ∈ C

using assms cplx_mul_add_vals valid_cntxts ring0.Ring_ZF_1_L4
field0.field_mult_comm by auto

A sum of complex numbers is complex.
lemma (in complex0) axaddcl: assumes a ∈ Cshows a+b ∈ Cusing assms axaddopr apply_funtype by simpb ∈ C

A product of complex numbers is complex.
lemma (in complex0) axmulcl: assumes a ∈ Cshows a·b ∈ Cusing assms axmulopr apply_funtype by simpb ∈ CMultiplication is distributive with respect to addition.
lemma (in complex0) axdistr:
assumes A1: a ∈ C b ∈ C c ∈ Cshows a·(b + c) = a·b + a·c
proof let ar = fst(a)let ai = snd(a)let br = fst(b)let bi = snd(b)let cr = fst(c)let ci = snd(c)from A1 have T:ar ∈ R ai ∈ R br ∈ R bi ∈ R cr ∈ R ci ∈ R
br +cr ∈ R bi +ci ∈ R
ar ·br + (-ai ·bi ) ∈ R
ar ·cr + (-ai ·ci ) ∈ R
ar ·bi + ai ·br ∈ R
ar ·ci + ai ·cr ∈ Rusing valid_cntxts ring0.Ring_ZF_1_L4 by autowith A1 have a·(b + c) =har ·(br +cr ) + (-ai ·(bi +ci )),ar ·(bi +ci ) + ai ·(br +cr )iusing cplx_mul_add_vals by auto
moreover from T havear ·(br +cr ) + (-ai ·(bi +ci )) =ar ·br + (-ai ·bi ) + (ar ·cr + (-ai ·ci ))andar ·(bi +ci ) + ai ·(br +cr ) =ar ·bi + ai ·br + (ar ·ci + ai ·cr )using valid_cntxts ring0.Ring_ZF_2_L6 by auto
moreover from A1 T have
har ·br + (-ai ·bi ) + (ar ·cr + (-ai ·ci )),ar ·bi + ai ·br + (ar ·ci + ai ·cr )i =a·b + a·cusing cplx_mul_add_vals by auto
ultimately show a·(b + c) = a·b + a·c
by simp617

qed

Complex addition is commutative.
lemma (in complex0) axaddcom: assumes a ∈ C b ∈ Cshows a+b = b+ausing assms cplx_mul_add_vals valid_cntxts ring0.Ring_ZF_1_L4
by autoComplex addition is associative.
lemma (in complex0) axaddass: assumes A1: a ∈ C b ∈ C c ∈ Cshows a + b + c = a + (b + c)
proof let ar = fst(a)let ai = snd(a)let br = fst(b)let bi = snd(b)let cr = fst(c)let ci = snd(c)from A1 have T:ar ∈ R ai ∈ R br ∈ R bi ∈ R cr ∈ R ci ∈ R
ar +br ∈ R ai +bi ∈ R
br +cr ∈ R bi +ci ∈ R
using valid_cntxts ring0.Ring_ZF_1_L4 by autowith A1 have a + b + c = har +br +cr ,ai +bi +ci iusing cplx_mul_add_vals by auto
also from A1 T have . . . = a + (b + c)using valid_cntxts ring0.Ring_ZF_1_L11 cplx_mul_add_vals
by autofinally show a + b + c = a + (b + c)
by simpqed

Complex multiplication is associative.
lemma (in complex0) axmulass: assumes A1: a ∈ C b ∈ Cshows a · b · c = a · (b · c)
proof let ar = fst(a)let ai = snd(a)let br = fst(b)let bi = snd(b)let cr = fst(c)let ci = snd(c)from A1 have T:ar ∈ R ai ∈ R br ∈ R bi ∈ R cr ∈ R ci ∈ R
ar ·br + (-ai ·bi ) ∈ R
ar ·bi + ai ·br ∈ R
br ·cr + (-bi ·ci ) ∈ R
br ·ci + bi ·cr ∈ Rusing valid_cntxts ring0.Ring_ZF_1_L4 by auto

618

c ∈ C

with A1 have a · b · c =h(ar ·br + (-ai ·bi ))·cr + (-(ar ·bi + ai ·br )·ci ),(ar ·br + (-ai ·bi ))·ci + (ar ·bi + ai ·br )·cr iusing cplx_mul_add_vals by auto
moreover from A1 T have
har ·(br ·cr + (-bi ·ci )) + (-ai ·(br ·ci + bi ·cr )),ar ·(br ·ci + bi ·cr ) + ai ·(br ·cr + (-bi ·ci ))i =a · (b · c)using cplx_mul_add_vals by auto
moreover from T havear ·(br ·cr + (-bi ·ci )) + (-ai ·(br ·ci + bi ·cr )) =(ar ·br + (-ai ·bi ))·cr + (-(ar ·bi + ai ·br )·ci )andar ·(br ·ci + bi ·cr ) + ai ·(br ·cr + (-bi ·ci )) =(ar ·br + (-ai ·bi ))·ci + (ar ·bi + ai ·br )·cr
using valid_cntxts ring0.Ring_ZF_2_L6 by auto
ultimately show a · b · c = a · (b · c)by autoqed

Complex 1 is real. This really means that the pair h1, 0i is on the real axis.
lemma (in complex0) ax1re: shows 1 ∈ IR
using valid_cntxts ring0.Ring_ZF_1_L2 by simp

The imaginary unit is a ”square root” of −1 (that is, i2 + 1 = 0).
lemma (in complex0) axi2m1: shows i·i + 1 = 0
using valid_cntxts ring0.Ring_ZF_1_L2 ring0.Ring_ZF_1_L3
cplx_mul_add_vals ring0.Ring_ZF_1_L6 group0.group0_2_L6
by simp

0 is the neutral element of complex addition.
lemma (in complex0) ax0id: assumes a ∈ Cshows a + 0 = ausing assms cplx_mul_add_vals valid_cntxts
ring0.Ring_ZF_1_L2 ring0.Ring_ZF_1_L3
by autoThe imaginary unit is a complex number.
lemma (in complex0) axicn: shows i ∈ Cusing valid_cntxts ring0.Ring_ZF_1_L2 by auto

All complex numbers have additive inverses.
lemma (in complex0) axnegex: assumes A1: a ∈ Cshows ∃ x∈C. a + x = 0
proof let ar = fst(a)let ai = snd(a)let x = h-ar , -ai i619

from A1 have T:ar ∈ Rai ∈ R(-ar ) ∈ R(-ar ) ∈ R
using valid_cntxts ring0.Ring_ZF_1_L3 by auto
then have x ∈ C using valid_cntxts ring0.Ring_ZF_1_L3
by automoreover from A1 T have a + x = 0
using cplx_mul_add_vals valid_cntxts ring0.Ring_ZF_1_L3
by autoultimately show ∃ x∈C. a + x = 0
by autoqed

A non-zero complex number has a multiplicative inverse.
lemma (in complex0) axrecex: assumes A1: a ∈ C and A2: a6=0
shows ∃ x∈C. a·x = 1
proof let ar = fst(a)let ai = snd(a)let m = ar ·ar + ai ·ai
from A1 have T1: ar ∈ R
ai ∈ R by auto
moreover from A1 A2 have ar 6= 0R ∨ ai 6= 0R
by autoultimately have ∃ c∈R. m·c = 1R
using valid_cntxts field1.OrdField_ZF_1_L10
by autothen obtain c where I: c∈R and II: m·c = 1R
by autolet x = har ·c, -ai ·ci
from T1 I have T2: ar ·c ∈ R (-ai ·c) ∈ R
using valid_cntxts ring0.Ring_ZF_1_L4 ring0.Ring_ZF_1_L3
by autothen have x ∈ C by auto
moreover from A1 T1 T2 I II have a·x = 1
using cplx_mul_add_vals valid_cntxts ring0.ring_rearr_3_elemAby autoultimately show ∃ x∈C. a·x = 1 by autoqedComplex 1 is a right neutral element for multiplication.
lemma (in complex0) ax1id: assumes A1: a ∈ Cshows a·1 = ausing assms valid_cntxts ring0.Ring_ZF_1_L2 cplx_mul_add_vals
ring0.Ring_ZF_1_L3 ring0.Ring_ZF_1_L6 by auto

A formula for sum of (complex) real numbers.
lemma (in complex0) sum_of_reals: assumes a∈IR b∈IRshows
a + b = hfst(a) + fst(b),0R iusing assms valid_cntxts ring0.Ring_ZF_1_L2 cplx_mul_add_vals

620

ring0.Ring_ZF_1_L3 by auto

The sum of real numbers is real.
lemma (in complex0) axaddrcl: assumes A1: a∈IR b∈IR
shows a + b ∈ IR
using assms sum_of_reals valid_cntxts ring0.Ring_ZF_1_L4
by autoThe formula for the product of (complex) real numbers.
lemma (in complex0) prod_of_reals: assumes A1: a∈IR b∈IR
shows a · b = hfst(a)·fst(b),0R i
proof let ar = fst(a)let br = fst(b)from A1 have T:ar ∈ R br ∈ R 0R ∈ R ar ·br ∈ Rusing valid_cntxts ring0.Ring_ZF_1_L2 ring0.Ring_ZF_1_L4
by autowith A1 show a · b = har ·br ,0R iusing cplx_mul_add_vals valid_cntxts ring0.Ring_ZF_1_L2
ring0.Ring_ZF_1_L6 ring0.Ring_ZF_1_L3 by autoqed

The product of (complex) real numbers is real.
lemma (in complex0) axmulrcl: assumes a∈IR b∈IR
shows a · b ∈ IR
using assms prod_of_reals valid_cntxts ring0.Ring_ZF_1_L4
by autoThe existence of a real negative of a real number.
lemma (in complex0) axrnegex: assumes A1: a∈IRshows ∃ x ∈ IR. a + x = 0
proof let ar = fst(a)let x = h-ar ,0R ifrom A1 have T:ar ∈ R (-ar ) ∈ R 0R ∈ R
using valid_cntxts ring0.Ring_ZF_1_L3 ring0.Ring_ZF_1_L2
by autothen have x∈ IR by auto
moreover from A1 T have a + x = 0
using cplx_mul_add_vals valid_cntxts ring0.Ring_ZF_1_L3
by autoultimately show ∃ x∈IR. a + x = 0 by autoqed

Each nonzero real number has a real inverse
lemma (in complex0) axrrecex:621

assumes A1: a ∈ IR
a 6= 0shows ∃ x∈IR. a · x = 1
proof let R0 = R-{0R }let ar = fst(a)let y = GroupInv(R0 ,restrict(M,R0 ×R0 ))(ar )from A1 have T: hy,0R i ∈ IR using valid_cntxts field0.Field_ZF_1_L5
by automoreover from A1 T have a · hy,0R i = 1
using prod_of_reals valid_cntxts
field0.Field_ZF_1_L5 field0.Field_ZF_1_L6 by auto
ultimately show ∃ x ∈ IR. a · x = 1 by autoqed

Our IR symbol is the real axis on the complex plane.
lemma (in complex0) real_means_real_axis: shows IR = ComplexReals(R,A)
using ComplexReals_def by auto

The CplxROrder thing is a relation on the complex reals.
lemma (in complex0) cplx_ord_on_cplx_reals:
shows CplxROrder(R,A,r) ⊆ IR×IR
using ComplexReals_def slice_proj_bij real_means_real_axis
CplxROrder_def InducedRelation_def by auto

The strict version of the complex relation is a relation on complex reals.
lemma (in complex0) cplx_strict_ord_on_cplx_reals:
shows StrictVersion(CplxROrder(R,A,r)) ⊆ IR×IR
using cplx_ord_on_cplx_reals strict_ver_rel by simp

The CplxROrder thing is a relation on the complex reals. Here this is formulated as a statement that in complex0 context a < b implies that a, b arecomplex reals
lemma (in complex0) strict_cplx_ord_type: assumes a <R bshows a∈IR b∈IR
using assms CplxROrder_def def_of_strict_ver InducedRelation_def
slice_proj_bij ComplexReals_def real_means_real_axis
by autoA more readable version of the definition of the strict order relation on thereal axis. Recall that in the complex0 context r denotes the (non-strict)order relation on the underlying model of real numbers.
lemma (in complex0) def_of_real_axis_order: shows
hx,0R i <R hy,0R i ←→ hx,yi ∈ r ∧ x6=y
proof
let f = SliceProjection(ComplexReals(R,A))
assume A1: hx,0R i <R hy,0R ithen have h fhx,0R i, fhy,0R i i ∈ r ∧ x 6= yusing CplxROrder_def def_of_strict_ver def_of_ind_relA622

by simp
moreover from A1 have hx,0R i ∈ IR hy,0R i ∈ IR
using strict_cplx_ord_type by auto
ultimately show hx,yi ∈ r ∧ x6=yusing slice_proj_bij ComplexReals_def by simp
next assume A1: hx,yi ∈ r ∧ x6=y
let f = SliceProjection(ComplexReals(R,A))
have f : IR → R
using ComplexReals_def slice_proj_bij real_means_real_axis
by simpmoreover from A1 have T: hx,0R i ∈ IR
hy,0R i ∈ IR
using valid_cntxts ring1.OrdRing_ZF_1_L3 by auto
moreover from A1 T have h fhx,0R i, fhy,0R i i ∈ rusing slice_proj_bij ComplexReals_def by simp
ultimately have h hx,0R i, hy,0R i i ∈ InducedRelation(f,r)
using def_of_ind_relB by simp
with A1 show hx,0R i <R hy,0R iusing CplxROrder_def def_of_strict_verby simpqed

The (non strict) order on complex reals is antisymmetric, transitive andtotal.
lemma (in complex0) cplx_ord_antsym_trans_tot: shows
antisym(CplxROrder(R,A,r))trans(CplxROrder(R,A,r))CplxROrder(R,A,r) {is total on} IR
proof let f = SliceProjection(ComplexReals(R,A))
have f ∈ ord_iso(IR,CplxROrder(R,A,r),R,r)using ComplexReals_def slice_proj_bij real_means_real_axis
bij_is_ord_iso CplxROrder_def by simp
moreover have CplxROrder(R,A,r) ⊆ IR×IR
using cplx_ord_on_cplx_reals by simp
moreover have I:
antisym(r)r {is total on} R
trans(r)using valid_cntxts ring1.OrdRing_ZF_1_L1 IsAnOrdRing_def
IsLinOrder_def by auto
ultimately show
antisym(CplxROrder(R,A,r))trans(CplxROrder(R,A,r))CplxROrder(R,A,r) {is total on} IR
using ord_iso_pres_antsym ord_iso_pres_tot ord_iso_pres_transby autoqed

The trichotomy law for the strict order on the complex reals.
lemma (in complex0) cplx_strict_ord_trich:assumes a ∈ IR b ∈ IR

623

shows Exactly_1_of_3_holds(a<R b, a=b, b<R a)using assms cplx_ord_antsym_trans_tot strict_ans_tot_trich
by simp

The strict order on the complex reals is kind of antisymetric.
lemma (in complex0) pre_axlttri: assumes A1: a ∈ IR
shows a <R b ←→ ¬(a=b ∨ b <R a)proof from A1 have Exactly_1_of_3_holds(a<R b, a=b, b<R a)by (rule cplx_strict_ord_trich)then show a <R b ←→ ¬(a=b ∨ b <R a)by (rule Fol1_L8A)
qedb ∈ IR

The strict order on complex reals is transitive.
lemma (in complex0) cplx_strict_ord_trans:
shows trans(StrictVersion(CplxROrder(R,A,r)))using cplx_ord_antsym_trans_tot strict_of_transB by simp

The strict order on complex reals is transitive - the explicit version of
cplx_strict_ord_trans.
lemma (in complex0) pre_axlttrn:
assumes A1: a <R bb <R cshows a <R cproof let s = StrictVersion(CplxROrder(R,A,r))from A1 havetrans(s)ha,bi ∈ s ∧ hb,ci ∈ susing cplx_strict_ord_trans by auto
then have ha,ci ∈ s by (rule Fol1_L3)
then show a <R c by simp
qed

The strict order on complex reals is preserved by translations.
lemma (in complex0) pre_axltadd:
assumes A1: a <R b and A2: c ∈ IR
shows c+a <R c+b
proof from A1 have T: a∈IR b∈IR using strict_cplx_ord_typeby autowith A1 A2 show c+a <R c+b
using def_of_real_axis_order valid_cntxts
group3.group_strict_ord_transl_inv sum_of_reals
by autoqed

The set of positive complex reals is closed with respect to multiplication.
lemma (in complex0) pre_axmulgt0: assumes A1: 0 <R a624

0 <R bshows 0 <R a·b
proof from A1 have T: a∈IR b∈IR using strict_cplx_ord_typeby autowith A1 show 0 <R a·b
using def_of_real_axis_order valid_cntxts field1.pos_mul_closed
def_of_real_axis_order prod_of_reals
by autoqed

The order on complex reals is linear and complete.
lemma (in complex0) cmplx_reals_ord_lin_compl: shows
CplxROrder(R,A,r) {is complete}
IsLinOrder(IR,CplxROrder(R,A,r))proof have SliceProjection(IR) ∈ bij(IR,R)
using slice_proj_bij ComplexReals_def real_means_real_axis
by simpmoreover have r ⊆ R×R using valid_cntxts ring1.OrdRing_ZF_1_L1
IsAnOrdRing_def by simp
moreover from R_are_reals haver {is complete} and IsLinOrder(R,r)
using IsAmodelOfReals_def valid_cntxts ring1.OrdRing_ZF_1_L1
IsAnOrdRing_def by auto
ultimately show
CplxROrder(R,A,r) {is complete}
IsLinOrder(IR,CplxROrder(R,A,r))using CplxROrder_def real_means_real_axis ind_rel_pres_compl
ind_rel_pres_lin by autoqed

The property of the strict order on complex reals that corresponds to completeness.
lemma (in complex0) pre_axsup: assumes A1: X ⊆ IR
X 6= 0 andA2: ∃ x∈IR. ∀ y∈X. y <R xshows
∃ x∈IR. (∀ y∈X. ¬(x <R y)) ∧ (∀ y∈IR. (y <R x −→ (∃ z∈X. y <R z)))proof let s = StrictVersion(CplxROrder(R,A,r))have
CplxROrder(R,A,r) ⊆ IR×IR
IsLinOrder(IR,CplxROrder(R,A,r))CplxROrder(R,A,r) {is complete}using cplx_ord_on_cplx_reals cmplx_reals_ord_lin_complby automoreover note A1
moreover have s = StrictVersion(CplxROrder(R,A,r))by simpmoreover from A2 have ∃ u∈IR. ∀ y∈X. hy,ui ∈ s

625

by simp
ultimately have
∃ x∈IR. ( ∀ y∈X. hx,yi ∈/ s ) ∧(∀ y∈IR. hy,xi ∈ s −→ (∃ z∈X. hy,zi ∈ s))by (rule strict_of_compl)
then show (∃ x∈IR. (∀ y∈X. ¬(x <R y)) ∧(∀ y∈IR. (y <R x −→ (∃ z∈X. y <R z))))by simp
qed
end

49

Topology - introduction

theory Topology_ZF imports ZF1 Finite_ZF Fol1
begin

This theory file provides basic definitions and properties of topology, open
and closed sets, closure and boundary.

49.1

Basic definitions and properties

A typical textbook defines a topology on a set X as a collection T of subsets
of X such that X ∈ T , ∅ ∈ T and T is closed with respect to arbitrary
unionsSand intersection of two sets. One can notice here that since we always
have T = X, the set on which the topology is defined (the ”carrier” of
the topology) can always be constructed from the topology itself and issuperfluous in the definition. Moreover, as Marnix Klooster pointed out
to me, the fact that the empty set is open can also be proven from otheraxioms. Hence, we define a topology as a collection of sets that is closed
under arbitrary unions and intersections of two sets, without any mention of
the set on which the topology is defined. Recall that Pow(T) is the powersetof T , so that if M ∈ Pow(T) then M is a subset of T . The sets that belong
to a topology T will be sometimes called ”open in” T or just ”open” if the
topology is clear from the context.
Topology is a collection of sets that is closed under arbitrary unions andintersections of two sets.
definition
IsATopology (_ {is a topology} [90] 91)
S whereT {is a topology} ≡ ( ∀ M ∈ Pow(T).
M ∈ T ) ∧( ∀ U∈T. ∀ V∈T. U∩V ∈ T)

We define interior of a set A as the union of all open sets contained in A.
We use Interior(A,T) to denote the interior of A.
626

definition
S
Interior(A,T) ≡{U∈T. U ⊆ A}

A set is closed if it is contained in the carrier of topology and its complement
is open.
definition
IsClosed (infixl {is closed in}S 90)S whereD {is closed in} T ≡ (D ⊆T ∧T - D ∈ T)

To prove various properties of closure we will often use the collection ofclosed sets that contain a given set A. Such collection does not have aseparate name in informal math. We will call it ClosedCovers(A,T).
definition
S
ClosedCovers(A,T) ≡ {D ∈ Pow( T). D {is closed in} T ∧ A⊆D}

The closure of a set A is defined as the intersection of the collection of closed
sets that contain A.
definition
T
Closure(A,T) ≡ClosedCovers(A,T)

We also define boundary of a set as the intersection of its closure with theclosure of the complement (with respect to the carrier).
definition
S
Boundary(A,T) ≡ Closure(A,T) ∩ Closure( T - A,T)

A set K is compact if for every collection of open sets that covers K we canchoose a finite one that still covers the set. Recall that FinPow(M) is the collection of finite subsets of M (finite powerset of M ), defined in IsarMathLib’s
Finite_ZF theory.
definition
IsCompact (infixl {is compact Sin} 90) whereK {is compact in} TS ≡ (K ⊆T ∧S(∀ M∈Pow(T). K ⊆M −→ (∃ N ∈ FinPow(M). K ⊆N)))A basic example of a topology: the powerset of any set is a topology.
lemma Pow_is_top: shows Pow(X) {is a topology}
proof S
have ∀ A∈Pow(Pow(X)).
A ∈ Pow(X) by fast
moreover have ∀ U∈Pow(X). ∀ V∈Pow(X). U∩V ∈ Pow(X) by fast
ultimately show Pow(X) {is a topology} using IsATopology_def
by autoqed

Empty set is open.
lemma empty_open:
assumes T {is a topology} shows 0 ∈ T

627

proof have 0 ∈ Pow(T) S
by simpwith assms have0 ∈ T using IsATopology_def by blast
thus 0 ∈ T by simp
qed

The carrier is open.
lemma carr_open: assumes T {is a topology} shows (using assms IsATopology_def by autoST) ∈ T

Union of a collection of open sets is open.
lemma union_open:
assumes T {is a topology} and ∀ A∈A. A ∈ T
Sshows ( A) ∈ T using assms IsATopology_def by auto

Union of a indexed family of open sets is open.
lemma union_indexed_open: assumes A1: T {is a topology} and A2: ∀ i∈I.
P(i) ∈ T S
shows ( i∈I. P(i)) ∈ T using assms union_open by simp

The intersection of any nonempty collection of topologies on a set X is a
topology.
lemma Inter_tops_is_top:
assumesTA1: M =6 0 and A2: ∀ T∈M. T {is a topology}
shows ( M) {is a topology}
proof T{ fix A assume A∈Pow( M)with A1 have ∀ T∈M.
A∈Pow(T)by autoS
Twith A1 A2 haveA ∈M using IsATopology_def
by autoT
S
T} then have ∀ T
A. A∈Pow(
A ∈M by simp
S M)
T −→hence ∀ A∈Pow( M).
A ∈M by auto
moreoverTT{ fix U V assume U ∈M and V ∈Mthen have ∀ T∈M. U ∈ T ∧ V ∈ T by autowith A1 A2 have ∀ T∈M. U∩V ∈ T using IsATopology_def
by simpT
T
T} then have ∀ U ∈M. ∀ V ∈M. U∩V ∈M
by autoT
ultimately show ( M) {is a topology}
using IsATopology_def by simp
qed

We will now introduce some notation. In Isar, this is done by definininga ”locale”. Locale is kind of a context that holds some assumptions andnotation used in all theorems proven in it. In the locale (context) below
called topology0 we assume that T is a topology. The interior of the set A(with respectSto the topology in the context) is denoted int(A). The closureof a set A ⊆ T is denoted cl(A) and the boundary is ∂A.
628

locale topology0 =fixes T
assumes topSpaceAssum: T {is a topology}
fixes int
defines int_def [simp]: int(A) ≡ Interior(A,T)
fixes cldefines cl_def [simp]: cl(A) ≡ Closure(A,T)
fixes boundary (∂_ [91] 92)
defines boundary_def [simp]: ∂A ≡ Boundary(A,T)

Intersection of a finite nonempty collection of open sets is open.
lemma (inT topology0) fin_inter_open_open: assumes N6=0 N ∈ FinPow(T)
shows
N ∈ T
using topSpaceAssum assms IsATopology_def inter_two_inter_fin
by simp

Having a topology T and a set X we can define the induced topology as theone consisting of the intersections of X with sets from T . The notion of acollection restricted to a set is defined in ZF1.thy.
lemma (in topology0) Top_1_L4:
shows (T {restricted to} X) {is a topology}
proof let S = T {restrictedto} X
Shave ∀ A∈Pow(S).
A ∈ S
proof
fix A assumeSA1: A∈Pow(S)have ∀ V∈A.
{U ∈ T. V = U∩X} ∈ T
proof { fix V
let M = {U ∈ T. V = U∩X}
have M ∈ Pow(T) by auto S
with topSpaceAssum haveM ∈ T using IsATopology_def by simp
} thus thesis by simp
qedS
hence { {U∈T. V = U∩X}.V∈
S A} ⊆ ST by autowith topSpaceAssum have ( V∈A.
{U∈T. V = U∩X}) ∈ T
using IsATopology_def
by
auto
S
S
then have ( V∈A.
{U∈T. V = U∩X})∩ X ∈ S
using RestrictedTo_def by auto
moreoverfrom A1 have ∀ V∈A. ∃ U∈T. V = U∩Xusing S
RestrictedTo_def
by autoS
S
hence ( V∈A.
{U∈T.
V
=
U∩X})∩X =A by blast
S
ultimately show
A ∈ S by simp
qed
moreover have ∀ U∈S. ∀ V∈S. U∩V ∈ S

629

proof { fix U V assume U∈S V∈Sthen obtain U1 V1 whereU1 ∈ T ∧ U = U1 ∩X and V1 ∈ T ∧ V = V1 ∩X
using RestrictedTo_def by autowith topSpaceAssum have U1 ∩V1 ∈ T and U∩V = (U1 ∩V1 )∩X
using IsATopology_def by auto
then have U∩V ∈ S using RestrictedTo_def by auto
} thus ∀ U∈S. ∀ V∈S. U∩V ∈ S
by simpqed
ultimately show S {is a topology} using IsATopology_def
by simpqed

49.2

Interior of a set

In this section we show basic properties of the interior of a set.
Interior of a set A is contained in A.
lemma (in topology0) Top_2_L1: shows int(A) ⊆ A
using Interior_def by auto

Interior is open.
lemma (in topology0) Top_2_L2: shows int(A) ∈ T
proof have {U∈T. U⊆A} ∈ Pow(T) by autowith topSpaceAssum show int(A) ∈ T
using IsATopology_def Interior_def by autoqed

A set is open iff it is equal to its interior.
lemma (in topology0) Top_2_L3: shows U∈T ←→ int(U) = U
proof
assume U∈T then show int(U) = U
using Interior_def by auto
next assume A1: int(U) = U
have int(U) ∈ T using Top_2_L2 by simp
with A1 show U∈T by simp
qedInterior of the interior is the interior.
lemma (in topology0) Top_2_L4: shows int(int(A)) = int(A)proof let U = int(A)from topSpaceAssum have U∈T using Top_2_L2 by simp
then show int(int(A)) = int(A) using Top_2_L3 by simp
qed

630

Interior of a bigger set is bigger.
lemma (in topology0) interior_mono:assumes A1: A⊆B shows int(A) ⊆ int(B)proof from A1 have ∀ U∈T. (U⊆A −→ U⊆B) by auto
then show int(A) ⊆ int(B) using Interior_def by autoqed

An open subset of any set is a subset of the interior of that set.
lemma (in topology0) Top_2_L5: assumes U⊆A and U∈Tshows U ⊆ int(A)using assms Interior_def by auto

If a point of a set has an open neighboorhood contained in the set, then the
point belongs to the interior of the set.
lemma (in topology0) Top_2_L6: assumes ∃ U∈T. (x∈U ∧ U⊆A)
shows x ∈ int(A)using assms Interior_def by auto

A set is open iff its every point has a an open neighbourhood contained in
the set. We will formulate this statement as two lemmas (implication one
way and the other way). The lemma below shows that if a set is open thenevery point has a an open neighbourhood contained in the set.
lemma (in topology0) open_open_neigh:assumes A1: V∈Tshows ∀ x∈V. ∃ U∈T. (x∈U ∧ U⊆V)
proof from A1 have ∀ x∈V. V∈T ∧ x ∈ V ∧ V ⊆ V by simp
thus thesis by autoqed

If every point of a set has a an open neighbourhood contained in the set
then the set is open.
lemma (in topology0) open_neigh_open:
assumes A1: ∀ x∈V. ∃ U∈T. (x∈U ∧ U⊆V)
shows V∈T
proof from A1 have V = int(V) using Top_2_L1 Top_2_L6
by blast
then show V∈T using Top_2_L3 by simp
qed

49.3

Closed sets, closure, boundary.

This section is devoted to closed sets and properties of the closure andboundary operators.

631

The carrier of the space is closed.
S
lemma (in topology0) Top_3_L1: shows ( T) {is closed in} T
proof - SS
have
T T = 0 by auto
S
S
with topSpaceAssum have
T T ∈ T using IsATopology_def by auto
then show thesis using IsClosed_def by simp
qed

Empty set is closed.
lemma (in topology0) Top_3_L2: shows 0 {is closed in} T
using topSpaceAssum IsATopology_def IsClosed_def by simp

The collection of closed covers of a subset of the carrier of topology is neverempty. This is good to know, as we want to intersect this collection to get
the closure.
lemma (in topology0)
S Top_3_L3:
assumes A1: A ⊆T shows ClosedCovers(A,T) 6= 0
proof S
from A1 have
T ∈ ClosedCovers(A,T) using ClosedCovers_def Top_3_L1
by autothus thesis by auto
qedIntersection of a nonempty family of closed sets is closed.
lemma (in topology0) Top_3_L4: assumes A1: K6=0 andA2: ∀ D∈K.
T D {is closed in} T
shows ( K) {is closed in} T
proof S
S
from A2 have I: ∀ D∈K. (D ⊆T ∧ ( T - D)∈ T)
using IsClosed_def
by simpS
then have { T - D. D∈ K}S⊆ TS by autowith topSpaceAssum have ({ T - D. D∈ K}) ∈ T
using IsATopology_def S
by autoS
S
T
moreover from A1 have
T K by fast
T{ T -SD. D∈ K} =moreover from A1 TI haveK ⊆T by blast
ultimately show ( K) {is closed in} T using IsClosed_def
by simpqed

The union and intersection of two closed sets are closed.
lemma (in topology0) Top_3_L5:
assumes A1: D1 {is closed in} T
D2 {is closed in} Tshows(D1 ∩D2 ) {is closed in} T(D1 ∪D2 ) {is closed in} T
proof have {D1 ,D2 } 6= T0 by simp
with A1 have ({D1 ,D2 }) {is closed in} T using Top_3_L4

632

by fast
thus (D1 ∩D2 ) {is closed in} TSby simp
S
from topSpaceAssum A1 have ( T - D1 ) ∩ ( T - D2 ) ∈ T
using IsClosed_def
IsATopology_def
by simpS
S
S
moreover have ( T - D1 ) ∩ ( T - D2 ) =T - (D1 ∪ D2 )by autoS
moreover from A1 have D1 ∪ D2 ⊆T using IsClosed_def
by autoultimately show (D1 ∪D2 ) {is closed in} T using IsClosed_def
by simpqed

Finite union of closed sets is closed. To understand the proof recall thatS
D ∈Pow( T) means that D is a subset of the carrier of the topology.
lemma (in topology0) fin_union_cl_is_cl:assumesS
A1: N ∈ SFinPow({D∈Pow( T). D {is closed in} T})
shows ( N) {is closed in} T
proof S
let C = {D∈Pow( T). D {is closed in} T}
have 0∈C using Top_3_L2 by simp
moreover have ∀ A∈C. ∀ B∈C. A∪B ∈ C
using Top_3_L5 by auto
moreover note A1S
ultimately
have
N ∈ C by (rule union_two_union_fin)Sthus ( N) {is closed in} T by simp
qed

Closure of a set is closed.
S
lemma (in topology0) cl_is_closed: assumes A ⊆Tshows cl(A) {is closed in} T
using assms Closure_def Top_3_L3 ClosedCovers_def Top_3_L4
by simp

Closure of a bigger sets is bigger.
lemma (in topology0)
S top_closure_mono:S
assumes A1: A ⊆T B ⊆T and A2:A⊆B
shows cl(A) ⊆ cl(B)proof from A2 have ClosedCovers(B,T)⊆ ClosedCovers(A,T)
using ClosedCovers_def by autowith A1 show thesis using Top_3_L3 Closure_def by autoqed

Boundary of a set is closed.
lemma (in topology0)
S boundary_closed:
assumes A1: A ⊆T shows ∂A {is closed in} T
proof -633

S
S
from A1 haveT - A ⊆
T by fastwith A1 show ∂A {is closed in} T
using cl_is_closed Top_3_L5 Boundary_def by autoqed

A set is closed iff it is equal to its closure.
S
lemma (in topology0) Top_3_L8: assumes A1: A ⊆Tshows A {is closed in} T ←→ cl(A) = A
proof
assume A {is closed in} Twith A1 show cl(A) = A
using Closure_def ClosedCovers_def by auto
next assume S
cl(A) = A S
then haveT - A =
T - cl(A) by simp
with A1 show A {is closed in} T using cl_is_closed IsClosed_def
by simpqed

Complement of an open set is closed.
lemma (in topology0) Top_3_L9:
assumesSA1: A∈Tshows ( T - A) {is closed in} T
proof SSS
Sfrom topSpaceAssum A1 haveT - ( T - A) = A and
T - A ⊆
T
using IsATopology_def
by
auto
S
with A1 show ( T - A) {is closed in} T using IsClosed_def by simp
qed

A set is contained in its closure.
S
lemma (in topology0) cl_contains_set: assumes A ⊆T shows A ⊆ cl(A)using assms Top_3_L1 ClosedCovers_def Top_3_L3 Closure_def by auto

Closure of a subset of the carrier is a subset of the carrier and closure of thecomplement is the complement of the interior.
Slemma (in topology0) Top_3_L11: assumes A1: A ⊆
T
shows
S
cl(A)
T S
S ⊆
cl( T - A) =T - int(A)proof S
from A1 show cl(A) ⊆T using Top_3_L1 Closure_def ClosedCovers_def
by autoS
S
from A1 haveT - A ⊆
T - int(A) using Top_2_L1
by autoS
S
S
S
moreover have I: ST - int(A) ⊆ S T
T - A ⊆
T by auto
ultimately have cl( T - A) ⊆ cl( T - int(A))
using top_closure_mono by simp
moreoverS
from I have ( T - int(A)) {is closed in} T634using Top_2_L2 S
Top_3_L9 by simp S
with I have cl(( T) - int(A)) =T - int(A)using Top_3_L8 bySsimp
S
ultimately have cl( T - A) ⊆T - int(A) by simp
moreoverS
S
from IShave
TS- A ⊆ cl( T - A)S using cl_contains_set
by simpS
hence
T -S cl( T -S A) ⊆ A and
T - A ⊆
T by auto
then haveT - cl( T - A) ⊆ int(A)usingScl_is_closed IsClosed_def
Top_2_L5 by simpShence
T - int(A) ⊆
cl(
T
A)
S
S by auto
ultimately show cl( T - A) =T - int(A) by autoqed

Boundary of a set is the closure of the set minus the interior of the set.
lemma (in topology0) Top_3_L12: assumes A1: A ⊆shows ∂A = cl(A) - int(A)proof S
from A1 have ∂A = cl(A) ∩ ( T - int(A))
using Boundary_def Top_3_L11 by simp
moreover from
S A1 havecl(A) ∩ ( T - int(A)) = cl(A) - int(A)using Top_3_L11 by blast
ultimately show ∂A = cl(A) - int(A) by simp
qed

S

T

If a set A is contained in a closed set B, then the closure of A is containedin B.
lemma (in topology0) Top_3_L13:
assumes A1: B {is closed in} TA⊆B
shows cl(A) ⊆ B
proof S
from A1 have B ⊆T using IsClosed_def by simp
with A1 show cl(A) ⊆ B using ClosedCovers_def Closure_def by autoqed

If a set is disjoint with an open set, then we can close it and it will still bedisjoint.
lemma (in topology0)
S disj_open_cl_disj:
assumes A1: A ⊆T V∈T and A2: A∩V = 0
shows cl(A) ∩ V = 0
proof S
from assms have A ⊆TS- V by auto
moreover from A1 have ( T - V) {is closed in} T using Top_3_L9 bysimp
Sultimately have cl(A) - ( T - V) = 0
using Top_3_L13 by blast
S
moreover from A1 have cl(A) ⊆T using cl_is_closed IsClosed_def
by simp635

Sthen have cl(A) -( T - V) = cl(A) ∩ V by auto
ultimately show thesis by simp
qed

A reformulation of disj_open_cl_disj: If a point belongs to the closure of aset, then we can find a point from the set in any open neighboorhood of thepoint.
lemma (in topology0)
cl_inter_neigh:S
assumes A ⊆T and U∈T and x ∈ cl(A) ∩ Ushows A∩U 6= 0 using assms disj_open_cl_disj by auto

A reverse of cl_inter_neigh: if every open neiboorhood of a point has anonempty intersection with a set, then that point belongs to the closure of
the set.
lemma (in topology0)
S inter_neigh_cl:Sassumes A1: A ⊆T and A2: x∈ T and A3: ∀ U∈T. x∈U −→ U∩A 6= 0
shows x ∈ cl(A)proof { assume x ∈/ cl(A)
with A1 obtain D where D {is closed in} T and A⊆D and x∈D/using Top_3_L3
Closure_def
ClosedCovers_def
by
auto
S
let U = ( T) - Dfrom A2 hD {is closed in} Ti hx∈D
/ i hA⊆Di have U∈T x∈U and U∩A = 0
unfolding IsClosed_def by autowith A3 have False by auto
} thus thesis by auto
qed
end

50

Topology 1

theory Topology_ZF_1 imports Topology_ZF
begin

In this theory file we study separation axioms and the notion of base andsubbase. Using the products of open sets as a subbase we define a natural
topology on a product of two topological spaces.

50.1

Separation axioms.

Topological spaces cas be classified according to certain properties called”separation axioms”. In this section we define what it means that a topological space is T0 , T1 or T2 .
A topology on X is T0 if for every pair of distinct points of X there is an
open set that contains only one of them.
636

definition
isT0 (_ {is T0 } [90] 91) whereS
S
T {is T0 } ≡ ∀ x y. ((x ∈T ∧ y ∈T ∧(∃ U∈T. (x∈U ∧ y∈U)/∨ (y∈U ∧ x∈U)))/x6=y) −→

A topology is T1 if for every such pair there exist an open set that contains
the first point but not the second.
definitionisT1 (_ {is T1 } [90] 91) whereS
S
T {is T1 } ≡ ∀ x y. ((x ∈T ∧ y ∈T ∧(∃ U∈T. (x∈U ∧ y∈U)))/x6=y) −→

A topology is T2 (Hausdorff) if for every pair of points there exist a pair ofdisjoint open sets each containing one of the points. This is an importantclass of topological spaces. In particular, metric spaces are Hausdorff.
definitionisT2 (_ {is T2 } [90] 91) whereS
S
T {is T2 } ≡ ∀ x y. ((x ∈T ∧ y ∈T ∧(∃ U∈T. ∃ V∈T. x∈U ∧ y∈V ∧ U∩V=0))x6=y) −→

If a topology is T1 then it is T0 . We don’t really assume here that T is a
topology on X. Instead, we prove the relation between isT0 condition andisT1.
lemma T1_is_T0: assumes A1: T {is T1 } shows T {is T0 }proof S
S
from A1 have ∀ x y. x ∈T ∧ y ∈T ∧ x6=y −→(∃ U∈T. x∈U ∧ y∈U)/using isT1_def by simp
S
S
then have ∀ x y. x ∈T ∧ y ∈T ∧ x6=y −→(∃ U∈T. x∈U ∧ y∈U/ ∨ y∈U ∧ x∈U)/by autothen show T {is T0 } using isT0_def by simp
qed

If a topology is T2 then it is T1 .
lemma T2_is_T1: assumes A1: T {is T2 } shows T {is T1 }proof SS
{ fix x y assume x ∈T y ∈T x6=ywith A1 have ∃ U∈T. ∃ V∈T. x∈U ∧ y∈V ∧ U∩V=0
using isT2_def by auto
then have ∃ U∈T. x∈U ∧Sy∈U/ by autoS} then have ∀ x y. x ∈T ∧ y ∈T ∧ x6=y −→(∃ U∈T. x∈U ∧ y∈U)/by simpthen show T {is T1 } using isT1_def by simp
qed

In a T0 space two points that can not be separated by an open set are equal.
Proof by contradiction.
637

lemma Top_1_1_L1: assumes A1: T {is T0 } and A2: x ∈and A3: ∀ U∈T. (x∈U ←→ y∈U)shows x=yproof { assume x6=ywith A1 A2 have ∃ U∈T. x∈U ∧ y∈U/ ∨ y∈U ∧ x∈U/using isT0_def by simp
with A3 have False by auto
} then show x=y by auto
qed

50.2

S

T

y ∈

S

T

Bases and subbases.

Sometimes it is convenient to talk about topologies in terms of their bases
and subbases. These are certain collections of open sets that define thewhole topology.
A base of topology is a collection of open sets such that every open set is aunion of the sets from the base.
definition
IsAbaseFor (infixl {is a base for} 65)
S whereB {is a base for} T ≡ B⊆T ∧ T = { A. A∈Pow(B)}A subbase is a collection of open sets such that finite intersection of thosesets form a base.
definition
IsAsubBaseFor (infixl {is a subbase for} 65) whereB {is a subbasefor} T ≡T
B ⊆ T ∧ { A. A ∈ FinPow(B)} {is a base for} T

Below we formulate a condition that we will prove to be necessary andsufficient for a collection B of open sets to form a base. It says that for any
two sets U, V from the collection B we can find a point x ∈ U ∩ V with aneighboorhod from B contained in U ∩ V .
definition
SatisfiesBaseCondition (_ {satisfies the base condition} [50] 50)
whereB {satisfies the base condition} ≡∀ U V. ((U∈B ∧ V∈B) −→ (∀ x ∈ U∩V. ∃ W∈B. x∈W ∧ W ⊆ U∩V))

A collection that is closed with respect to intersection satisfies the basecondition.
lemma inter_closed_base: assumes ∀ U∈B.(∀ V∈B. U∩V ∈ B)
shows B {satisfies the base condition}
proof { fix U V x assume U∈B and V∈B and x ∈ U∩V
with assms have ∃ W∈B. x∈W ∧ W ⊆ U∩V by blast638

} then show thesis using SatisfiesBaseCondition_def by simp
qed

Each open set is a union of some sets from the base.
lemma Top_1_2_L1: assumes
S B {is a base for} Tshows ∃ A∈Pow(B). U =Ausing assms IsAbaseFor_def by simp

and U∈T

Elements of base are open.
lemma base_sets_open:
assumes B {is a base for} T and U ∈ Bshows U ∈ Tusing assms IsAbaseFor_def by auto

A base defines topology uniquely.
lemma same_base_same_top:
assumes B {is a base for} T and B {is a base for} S
shows T = S
using assms IsAbaseFor_def by simp

Every point from an open set has a neighboorhood from the base that iscontained in the set.
lemma point_open_base_neigh:assumes A1: B {is a base for} T and A2: U∈T and A3: x∈Ushows ∃ V∈B. V⊆U ∧ x∈V
proof S
from A1 A2 obtain A where A ∈ Pow(B) and U =Ausing Top_1_2_L1 by blast
with A3 obtain V whereS V∈A and x∈V by autowith hA ∈ Pow(B)i hU =Ai show thesis by autoqed

A criterion for a collection to be a base for a topology that is a slightreformulation of the definition. The only thing different that in the definitionis that we assume only that every open set is a union of some sets from thebase. The definition requires also the opposite inclusion that every union of
the sets from the base is open, but that we can prove if we assume that T
is a topology.
lemma is_a_base_criterion: assumes A1: T {is a topology}
S
and A2: B ⊆ T and A3: ∀ V ∈ T. ∃ A ∈ Pow(B). V =Ashows B {is a base for} T
proof S
from A3 have T ⊆S { A. A∈Pow(B)} by auto
moreover have { A. A∈Pow(B)} ⊆ T
proofS
fix U assume U ∈ { A. A∈Pow(B)}Sthen obtain A where A ∈ Pow(B) and U =A639

by auto
with hB ⊆ Ti S
have A ∈ Pow(T) by autowith A1 hU =Ai show U ∈ T
unfolding IsATopology_def by simp
qedS
ultimately have T = { A. A∈Pow(B)} by autowith A2 show B {is a base for} T
unfolding IsAbaseFor_def by simp
qed

A necessary condition for a collection of sets to be a base for some topology: every point in the intersection of two sets in the base has a neighboorhoodfrom the base contained in the intersection.
lemma Top_1_2_L2:
assumes A1:∃ T. T {is a topology} ∧ B {is a base for} T
and A2: V∈B W∈Bshows ∀ x ∈ V∩W. ∃ U∈B. x∈U ∧ U ⊆ V ∩ W
proof from A1 obtain T where
D1: T {is a topology}
B {is a base for} T
by autothen have B ⊆ T using IsAbaseFor_def by autowith A2 have V∈T and W∈T usingSIsAbaseFor_def by autowith D1 have ∃ A∈Pow(B). V∩W =A using IsATopology_def Top_1_2_L1
by autoS
then obtain A where A ⊆ B and V ∩ W =A by auto
then show ∀ x ∈ V∩W. ∃ U∈B. (x∈U ∧ U ⊆ V ∩ W) by autoqed

We will construct a topology as the collection of unions of (would-be) base.
First we prove that if the collection of sets satisfies the condition we want
to show to be sufficient, the the intersection belongs to what we will define
as topology (am I clear here?). Having this fact ready simplifies the proofof the next lemma. There is not much topology here, just some set theory.
lemma Top_1_2_L3:
assumes A1: ∀ x∈
S V∩W . ∃ U∈B. x∈U ∧ U ⊆ V∩W
shows V∩W ∈ { A. A∈Pow(B)}proofS
let A =
x∈V∩W. {U∈B. x∈U ∧ U ⊆ V∩W}
show A∈Pow(B) by auto
S
from A1 show V∩W =A by blastqed

The next lemma is needed when proving that the would-be topology is closedwith respect to taking intersections. We show here that intersection of two
sets from this (would-be) topology can be written as union of sets from the
topology.
lemma Top_1_2_L4:

640

S
S
assumes A1: U1 ∈ { A. A∈Pow(B)}U2 ∈ { A. A∈Pow(B)}and A2: B {satisfies
the base condition} S
Sshows ∃ C. C ⊆ { A. A∈Pow(B)} ∧ U1 ∩U2 =C
proof from A1 A2 obtain A1 A2SwhereS
D1: A1 ∈ Pow(B) U1 =A1 A2 ∈ Pow(B) U2 =A2
by autoS
let C =U∈A1 .{U∩V. V∈A2 }from D1 have (∀ U∈AS
1 . U∈B) ∧ (∀ V∈A2 . V∈B) by autowith A2 have C ⊆ { A . A ∈ Pow(B)}using Top_1_2_L3 SatisfiesBaseCondition_def
by autoS
moreover from D1 have U1 ∩ U2 =C by auto
ultimately show thesis by autoqed

If B satisfies the base condition, then the collection of unions of sets from
B is a topology and B is a base for this topology.
theorem Top_1_2_T1:
assumes A1: BS{satisfies the base condition}
and A2: T = { A. A∈Pow(B)}shows T {is a topology} and B {is a base for} T
proof show T {is a topology}
proof S
have I: ∀ C∈Pow(T).
C ∈ T
proof { fix C assume
S S A3: C ∈ Pow(T) S
let Q =
{ {A∈Pow(B). U =A}. U∈C} S
from A2 A3 Shave S∀ U∈C. ∃ A∈Pow(B). U =A by auto
then haveQ =C using
ZF1_1_L10
bysimp
S
moreover from A2
Q ∈ T by auto
S haveultimately have SC ∈ T by simp
} thus ∀ C∈Pow(T).
C ∈ T by autoqed
moreover have ∀ U∈T. ∀ V∈T. U∩V ∈ T
proof { fix U V assume U ∈ T V ∈ T
Swith A1 A2 have ∃ C.(C ⊆ T ∧ U∩V =C)using Top_1_2_L4 by simpSthen obtain C where C ⊆ T and U∩V =C
by autowith I have U∩V ∈ T by simp
} then show ∀ U∈T. ∀ V∈T. U∩V ∈ T by simp
qed
ultimately show T {is a topology} using IsATopology_def
by simpqedfrom A2 have B⊆T by autowith A2 show B {is a base for} T using IsAbaseFor_def

641

by simp
qed

The carrier of the base and topology are the same.
lemma Top_1_2_L5:
assumes B {is a base for} T
S
S
shows
T =
B
using assms IsAbaseFor_def by auto

If B is a base for T , then T is the smallest topology containing B.
lemma base_smallest_top:
assumes A1: B {is a base for} T and A2: S {is a topology} and A3:
B⊆S
shows T⊆S
proof
fix U assume U∈TS
with A1 obtain BU where BU ⊆ B and U =BU using IsAbaseFor_def
by autowith A3 have SBU ⊆ S by autowith A2 hU =BU i show U∈S using IsATopology_def by simp
qed

If B is a base for T and B is a topology, then B = T .
lemma base_topology: assumes B {is a topology} and B {is a base for}Tshows B=T using assms base_sets_open base_smallest_top by blast

50.3

Product topology

In this section we consider a topology defined on a product of two sets.
Given two topological spaces we can define a topology on the product of thecarriers such that the cartesian products of the sets of the topologies are abase for the product topology. Recall that for two collections S, T of sets
the product collection is defined (in ZF1.thy) as the collections of cartesian
products A × B, where A ∈ S, B ∈ T .
definition
S
ProductTopology(T,S) ≡ { W. W ∈ Pow(ProductCollection(T,S))}

The product collection satisfies the base condition.
lemma Top_1_4_L1:
assumes A1: T {is a topology}
S {is a topology}
and A2: A ∈ ProductCollection(T,S) B ∈ ProductCollection(T,S)
shows ∀ x∈(A∩B). ∃ W∈ProductCollection(T,S). (x∈W ∧ W ⊆ A ∩ B)
proof
fix x assume A3: x ∈ A∩B
from A2 obtain U1 V1 U2 V2 where
D1: U1 ∈T V1 ∈S
A=U1 ×V1 U2 ∈T V2 ∈S
B=U2 ×V2

642

using ProductCollection_def by auto
let W = (U1 ∩U2 ) × (V1 ∩V2 )from A1 D1 have U1 ∩U2 ∈ T and V1 ∩V2 ∈ S
using IsATopology_def by auto
then have W ∈ ProductCollection(T,S) using ProductCollection_def
by automoreover from A3 D1 have x∈W and W ⊆ A∩B by auto
ultimately have ∃ W. (W ∈ ProductCollection(T,S) ∧ x∈W ∧ W ⊆ A∩B)
by autothus ∃ W∈ProductCollection(T,S). (x∈W ∧ W ⊆ A ∩ B) by autoqed

The product topology is indeed a topology on the product.
theorem Top_1_4_T1: assumes A1: T {is a topology} S {is a topology}
shows
ProductTopology(T,S) {is a topology}
ProductCollection(T,S){isSa baseS for} ProductTopology(T,S)
S
ProductTopology(T,S) =T ×
Sproof from A1 show
ProductTopology(T,S) {is a topology}
ProductCollection(T,S) {is a base for} ProductTopology(T,S)
using Top_1_4_L1 ProductCollection_def
SatisfiesBaseCondition_def ProductTopology_def Top_1_2_T1
by auto S
SS
then show
ProductTopology(T,S) =T ×
Susing Top_1_2_L5 ZF1_1_L6 by simp
qed

Each point of a set open in the product topology has a neighborhood which
is a cartesian product of open sets.
lemma prod_top_point_neighb:
assumes A1: T {is a topology} S {is a topology} andA2: U ∈ ProductTopology(T,S) and A3: x ∈ Ushows ∃ V W. V∈T ∧ W∈S ∧ V×W ⊆ U ∧ x ∈ V×Wproof from A1 have
ProductCollection(T,S) {is a base for} ProductTopology(T,S)
using Top_1_4_T1 by simp
with A2 A3 obtain Z whereZ ∈ ProductCollection(T,S) and Z ⊆ U ∧ x∈Zusing point_open_base_neigh by blast
then obtain V W where V ∈ T and W∈S and V×W ⊆ U ∧ x ∈ V×Wusing ProductCollection_def by auto
thus thesis by autoqed

Products of open sets are open in the product topology.
lemma prod_open_open_prod:643

assumes A1: T {is a topology} S {is a topology} andA2: U∈T V∈Sshows U×V ∈ ProductTopology(T,S)
proof from A1 have
ProductCollection(T,S) {is a base for} ProductTopology(T,S)
using Top_1_4_T1 by simp
moreover from A2 have U×V ∈ ProductCollection(T,S)
unfolding ProductCollection_def by auto
ultimately show U×V ∈ ProductTopology(T,S)
using base_sets_open by simp
qed

Sets that are open in th product topology are contained in the product of
the carrier.
lemma prod_open_type: assumes A1: T {is a topology}
and
A2: V ∈ ProductTopology(T,S)
S
S
shows V ⊆T ×
Sproof S
from A2 have V ⊆ProductTopology(T,S) by autowith A1 show thesis using Top_1_4_T1 by simpqed

S {is a topology}

Suppose we have subsets A ⊆ X, B ⊆ Y , where X, Y are topological spaces
with topologies T, S. We can the consider relative topologies on TA , SB onsets A, B and the collection of cartesian products of sets open in TA , SB ,(namely {U × V : U ∈ TA , V ∈ SB }. The next lemma states that thiscollection is a base of the product topology on X × Y restricted to the
product A × B.
lemma prod_restr_base_restr:
assumes A1: T {is a topology} S {is a topology}
shows
ProductCollection(T {restricted to} A, S {restricted to} B){is a base for} (ProductTopology(T,S) {restricted to} A×B)
proof let B = ProductCollection(T {restricted to} A, S {restricted to} B)
let τ = ProductTopology(T,S)
from A1 have (τ {restricted to} A×B) {is a topology}
using Top_1_4_T1 topology0_def topology0.Top_1_L4
by simpmoreover have B ⊆ (τ {restricted to} A×B)
proof
fix U assume U ∈ Bthen obtain UA UB where U = UA × UB andUA ∈ (T {restricted to} A) and UB ∈ (S {restricted to} B)
using ProductCollection_def by auto
then obtain WA WB where644WA ∈ T UA = WA ∩ A and WB ∈ S UB = WB ∩ B
using RestrictedTo_def by autowith hU = UA × UB i have U = WA ×WB ∩ (A×B) by auto
moreover from A1 hWA ∈ Ti and hWB ∈ Si have WA ×WB ∈ τusing prod_open_open_prod by simp
ultimately show U ∈ τ {restricted to} A×B
using RestrictedTo_def by autoqed
moreover have ∀ U ∈ Sτ {restricted to} A×B.
∃ C ∈ Pow(B). U =C
proof
fix U assume U ∈ τ {restricted to} A×B
then obtain W where W ∈ τ and U = W ∩ (A×B)
using RestrictedTo_def by autofrom A1 hW ∈ τ i obtain AW whereS
AW ∈ Pow(ProductCollection(T,S)) and W =AWusing Top_1_4_T1 IsAbaseFor_def by auto
let C = {V ∩ A×B. V ∈ AW }S
have C ∈ Pow(B) and U =C
proof { fix R assume R ∈ Cthen obtain V where V ∈ AW and R = V ∩ A×B
by autowith hAW ∈ Pow(ProductCollection(T,S))i obtain VT VS whereVT ∈ T and VS ∈ S and V = VT × VS
using ProductCollection_def by autowith hR = V ∩ A×Bi have R ∈ B
using ProductCollection_def RestrictedTo_def
by auto} then show C ∈ Pow(B) by auto
S
from hU = S
W ∩ (A×B)i and hW =AW ishow U =C by autoqedSthus ∃ C ∈ Pow(B). U =C by blast
qed
ultimately show thesis by (rule is_a_base_criterion)qed

We can commute taking restriction (relative topology) and product topology.
The reason the two topologies are the same is that they have the same base.
lemma prod_top_restr_comm:assumes A1: T {is a topology} S {is a topology}
shows
ProductTopology(T {restricted to} A,S {restricted to} B) =ProductTopology(T,S) {restricted to} (A×B)
proof let B = ProductCollection(T {restricted to} A, S {restricted to} B)
from A1 haveB {is a base for} ProductTopology(T {restricted to} A,S {restricted645

to} B)using topology0_def topology0.Top_1_L4 Top_1_4_T1 by simp
moreover from A1 haveB {is a base for} ProductTopology(T,S) {restricted to} (A×B)
using prod_restr_base_restr by simp
ultimately show thesis by (rule same_base_same_top)qed

Projection of a section of an open set is open.
lemma prod_sec_open1: assumes A1: T {is a topology} S {is a topology}
andS
A2: V ∈ ProductTopology(T,S)
and A3: x ∈TSshows {y ∈S. hx,yi ∈ V} ∈ S
proof S
let A = {y ∈S. hx,yi ∈ V}
from A1 have topology0(S) using topology0_def by simp
moreover have ∀ y∈A.∃ W∈S. (y∈W ∧ W⊆A)
proof
fix y assume y ∈ Athen have hx,yi ∈ V by simp
S
Swith A1 A2 S
have hx,yi ∈S T ×
S using prod_open_type by blast
hence x ∈T and y ∈S by autofrom A1 A2 hhx,yi ∈ Vi have ∃ U W. U∈T ∧ W∈S ∧ U×W ⊆ V ∧ hx,yi∈ U×W
by (rule prod_top_point_neighb)
then obtain U W where U∈T W∈S U×W ⊆ V hx,yi ∈ U×W
by autowith A1 A2 show ∃ W∈S. (y∈W ∧ W⊆A) using prod_open_type section_proj
by autoqed
ultimately show thesis by (rule topology0.open_neigh_open)
qed

Projection of a section of an open set is open. This is dual of prod_sec_open1
with a very similar proof.
lemma prod_sec_open2: assumes A1: T {is a topology} S {is a topology}
andS
A2: V ∈ ProductTopology(T,S)
and A3: y ∈SSshows {x ∈T. hx,yi ∈ V} ∈ T
proof S
let A = {x ∈T. hx,yi ∈ V}
from A1 have topology0(T) using topology0_def by simp
moreover have ∀ x∈A.∃ W∈T. (x∈W ∧ W⊆A)
proof
fix x assume x ∈ Athen have hx,yi ∈ V by simp
S
Swith A1 A2 S
have hx,yi ∈S T ×
S using prod_open_type by blast
hence x ∈T and y ∈S by auto

646

from A1 A2 hhx,yi ∈ Vi have ∃ U W. U∈T ∧ W∈S ∧ U×W ⊆ V ∧ hx,yi∈ U×W
by (rule prod_top_point_neighb)
then obtain U W where U∈T W∈S U×W ⊆ V hx,yi ∈ U×W
by autowith A1 A2 show ∃ W∈T. (x∈W ∧ W⊆A) using prod_open_type section_proj
by autoqed
ultimately show thesis by (rule topology0.open_neigh_open)
qed

end

51

Topology 1b

theory Topology_ZF_1b imports Topology_ZF_1
begin

One of the facts demonstrated in every class on General Topology is that ina T2 (Hausdorff) topological space compact sets are closed. Formalizing theproof of this fact gave me an interesting insight into the role of the Axiomof Choice (AC) in many informal proofs.
A typical informal proof of this fact goes like this: we want to show that thecomplement of K is open. To do this, choose an arbitrary point y ∈ K c .
Since X is T2 , for every point x ∈ K we can find an open set Ux such thaty∈
/ Ux . Obviously {Ux }x∈K covers K, so select a finite subcollection thatcovers K, and so on. I had never realized that such reasoning requires the
Axiom of Choice. Namely, suppose we have a lemma that states ”In T2
spaces, if x 6= y, then there is an open set U such that x ∈ U and y ∈/ U”(like our lemma T2_cl_open_sep below). This only states that the set of suchopen sets U is not empty. To get the collection {Ux }x∈K in this proof wehave to select one such set among many for every x ∈ K and this is where
we use the Axiom of Choice. Probably in 99/100 cases when an informal
calculus proof states something like ∀ε∃δε · · · the proof uses AC. Most of thetime the use of AC in such proofs can be avoided. This is also the case forthe fact that in a T2 space compact sets are closed.

51.1

Compact sets are closed - no need for AC

In this section we show that in a T2 topological space compact sets areclosed.
First we prove a lemma that in a T2 space two points can be separated by
the closure of an open set.
647

lemma (in topology0) T2_cl_open_sep:SSassumes T {is T2 } and x ∈
T y ∈
T
x6=y
shows ∃ U∈T. (x∈U ∧ y ∈/ cl(U))
proof from assms have ∃ U∈T. ∃ V∈T. x∈U ∧ y∈V ∧ U∩V=0
using isT2_def by simp
then obtain U V where U∈T V∈T x∈U y∈V U∩V=0
by autothen have U∈T ∧ x∈U ∧ y∈ V ∧ cl(U) ∩ V = 0
using disj_open_cl_disj by auto
thus ∃ U∈T. (x∈U ∧ y ∈/ cl(U)) by autoqed

AC-free proof that in a Hausdorff space compact sets are closed. To understand the notation recall that in Isabelle/ZF Pow(A) is the powerset (theset of subsets) of A and FinPow(A) denotes the set of finite subsets of A in
IsarMathLib.
theorem (in topology0) in_t2_compact_is_cl:assumes A1: T {is T2 } and A2: K {is compact in} T
shows K {is closed in} T
proof - S
let X =T
have ∀ y ∈ X - K. ∃ U∈T. y∈U ∧ U ⊆ X - K
proof { fix y assume y ∈ X y∈K/
have ∃ U∈T. y∈U ∧ U ⊆ X - K
proof
S let B =x∈K. {V∈T. x∈V ∧ y ∈/ cl(V)}
have I: B ∈ Pow(T) FinPow(B) ⊆ Pow(B)using FinPow_def by autofrom hK {is compact in} Ti hy ∈ Xi hy∈K/ i have∀ x∈K. x ∈ X ∧ y ∈ X ∧ x6=yusing IsCompact_def by autowith hT {is T2 }i have ∀ x∈K. {V∈T. x∈V ∧ y ∈/ cl(V)} 6= 0
using T2_cl_open_sep
by
auto
S
hence K ⊆B by blast
with hK {is compact in} STi I have
∃ N ∈ FinPow(B). K ⊆Nusing IsCompact_def by autoS
then obtain N where N ∈ FinPow(B) K ⊆N
by autowith I have N ⊆ B by auto
hence ∀ V∈N. V∈B by auto
let M = {cl(V). V∈N}
let C = {D ∈ Pow(X). D {is closed in} T}from hN ∈ FinPow(B)i have ∀ V∈B. cl(V) ∈ C N ∈ FinPow(B)using cl_is_closed IsClosed_def by auto
then have M ∈ S
FinPow(C) by (rule fin_image_fin)then have X M ∈ T using fin_union_cl_is_cl IsClosed_def648

by simphy ∈ Xihy∈K
moreover from/ i h∀ V∈N. V∈Bi haveSy ∈ X M by simp
S
moreover have X M ⊆ X - K
proof S
Si
from h∀ V∈N.
N ⊆M using cl_contains_set by auto
S V∈B have S
with hK ⊆Ni show X M ⊆ X - K by autoqed
ultimately have ∃ U. U∈T ∧ y ∈ U ∧ U ⊆ X - K
by autothus ∃ U∈T. y∈U ∧ U ⊆ X - K by autoqed
} thus ∀ y ∈ X - K. ∃ U∈T. y∈U ∧ U ⊆ X - K
by autoqedwith A2 show K {is closed in} T
using open_neigh_open IsCompact_def IsClosed_def by auto
qed

end

52

Topology 2

theory Topology_ZF_2 imports Topology_ZF_1 func1 Fol1
begin

This theory continues the series on general topology and covers the definition
and basic properties of continuous functions. We also introduce the notionof homeomorphism an prove the pasting lemma.

52.1

Continuous functions.

In this section we define continuous functions and prove that certain conditions are equivalent to a function being continuous.
In standard math we say that a function is contiuous with respect to two
topologies τ1 , τ2 if the inverse image of sets from topology τ2 are in τ1 . Here
we define a predicate that is supposed to reflect that definition, with a difference that we don’t require in the definition that τ1 , τ2 are topologies. Thismeans for example that when we define measurable functions, the definition
will be the same.
The notation f-(A) means the inverse image of (a set) A with respect to (afunction) f .
definition
IsContinuous(τ 1 ,τ 2 ,f) ≡ (∀ U∈τ 2 . f-(U) ∈ τ 1 )649

A trivial example of a continuous function - identity is continuous.
Slemma id_cont: shows IsContinuous(τ ,τ ,id( τ ))proof { fix U assume U∈τSthen have id( τ )-(U)S = U using vimage_id_same by autowith hU∈τ i have id( τ )-(U) ∈ τ Sby simp
} then show IsContinuous(τ ,τ ,id( τ )) using IsContinuous_def
by simpqed

We will work with a pair of topological spaces. The following locale sets up
our context that consists of two topologies
S τ1 , τ2 and a continuous function
f : X1 → X2 , where Xi is defined as τi for i = 1, 2. We also define
notation cl1 (A) and cl2 (A) for closure of a set A in topologies τ1 and τ2 ,respectively.
locale two_top_spaces0 =fixes τ 1
assumes tau1_is_top: τ 1 {is a topology}
fixes τ 2
assumes tau2_is_top: τ 2 {is a topology}
fixes X1
S
defines X1_def [simp]: X1 ≡
τ1fixes X2
S
defines X2_def [simp]: X2 ≡
τ2fixes fassumes fmapAssum: f: X1 → X2
fixes isContinuous (_ {is continuous} [50] 50)
defines isContinuous_def [simp]: g {is continuous} ≡ IsContinuous(τ 1 ,τ 2 ,g)fixes cl1
defines cl1_def [simp]: cl1 (A) ≡ Closure(A,τ 1 )fixes cl2
defines cl2_def [simp]: cl2 (A) ≡ Closure(A,τ 2 )First we show that theorems proven in locale topology0 are valid whenapplied to topologies τ1 and τ2 .
lemma (in two_top_spaces0) topol_cntxs_valid:
shows topology0(τ 1 ) and topology0(τ 2 )using tau1_is_top tau2_is_top topology0_def by auto

For continuous functions the inverse image of a closed set is closed.
650

lemma (in two_top_spaces0) TopZF_2_1_L1:
assumes A1: f {is continuous} and A2: D {is closed in} τ 2shows f-(D) {is closed in} τ 1
proof from fmapAssum have f-(D) ⊆ X1 using func1_1_L3 by simp
moreover from fmapAssum have f-(X2 - D) = X1 - f-(D)using Pi_iff function_vimage_Diff func1_1_L4 by auto
ultimately have X1 - f-(X2 - D) = f-(D) by auto
moreover from A1 A2 have (X1 - f-(X2 - D)) {is closed in} τ 1
using IsClosed_def IsContinuous_def topol_cntxs_valid topology0.Top_3_L9
by simpultimately show f-(D) {is closed in} τ 1 by simp
qed

If the inverse image of every closed set is closed, then the image of a closure
is contained in the closure of the image.
lemma (in two_top_spaces0) Top_ZF_2_1_L2:
assumes A1: ∀ D. ((D {is closed in} τ 2 ) −→ f-(D) {is closed in} τ 1 )and A2: A ⊆ X1
shows f(cl1 (A)) ⊆ cl2 (f(A))
proof from fmapAssum have f(A) ⊆ cl2 (f(A))
using func1_1_L6 topol_cntxs_valid topology0.cl_contains_set
by simpwith fmapAssum have f-(f(A)) ⊆ f-(cl2 (f(A)))
by automoreover from fmapAssum A2 have A ⊆ f-(f(A))
using func1_1_L9 by simp
ultimately have A ⊆ f-(cl2 (f(A))) by autowith fmapAssum A1 have f(cl1 (A)) ⊆ f(f-(cl2 (f(A))))
using func1_1_L6 func1_1_L8 IsClosed_def
topol_cntxs_valid topology0.cl_is_closed topology0.Top_3_L13
by simpmoreover from fmapAssum have f(f-(cl2 (f(A)))) ⊆ cl2 (f(A))
using fun_is_function function_image_vimage by simp
ultimately show f(cl1 (A)) ⊆ cl2 (f(A))
by autoqedIf f A ⊆ f (A) (the image of the closure is contained in the closure of theimage), then f −1 (B) ⊆ f −1 B (the inverse image of the closure contains
the closure of the inverse image).
lemma (in two_top_spaces0) Top_ZF_2_1_L3:
assumes A1: ∀ A. ( A ⊆ X1 −→ f(cl1 (A)) ⊆ cl2 (f(A)))
shows ∀ B. ( B ⊆ X2 −→ cl1 (f-(B)) ⊆ f-(cl2 (B)) )proof { fix B assume B ⊆ X2from fmapAssum A1 have f(cl1 (f-(B))) ⊆ cl2 (f(f-(B)))
using func1_1_L3 by simp651

moreover from fmapAssum hB ⊆ X2 i have cl2 (f(f-(B))) ⊆ cl2 (B)using fun_is_function function_image_vimage func1_1_L6
topol_cntxs_valid topology0.top_closure_mono
by simpultimately have f-(f(cl1 (f-(B)))) ⊆ f-(cl2 (B))
using fmapAssum fun_is_function by auto
moreover from fmapAssum hB ⊆ X2 i havecl1 (f-(B)) ⊆ f-(f(cl1 (f-(B))))using func1_1_L3 func1_1_L9 IsClosed_def
topol_cntxs_valid topology0.cl_is_closed by simp
ultimately have cl1 (f-(B)) ⊆ f-(cl2 (B)) by auto
} then show thesis by simpqedIf f −1 (B) ⊆ f −1 B (the inverse image of a closure contains the closure of the inverse image), then the function is continuous. This lemma
closes a series of implications in lemmas Top_ZF_2_1_L1, Top_ZF_2_1_L2 and
Top_ZF_2_1_L3 showing equivalence of four definitions of continuity.
lemma (in two_top_spaces0) Top_ZF_2_1_L4:
assumes A1: ∀ B. ( B ⊆ X2 −→ cl1 (f-(B)) ⊆ f-(cl2 (B)) )shows f {is continuous}
proof { fix U assume U ∈ τ 2then have (X2 - U) {is closed in} τ 2using topol_cntxs_validStopology0.Top_3_L9 by simp
moreover have X2 - U ⊆τ 2 by auto
ultimately have cl2 (X2 - U) = X2 - U
using topol_cntxs_valid topology0.Top_3_L8 by simp
moreover from A1 have cl1 (f-(X2 - U)) ⊆ f-(cl2 (X2 - U))by autoultimately have cl1 (f-(X2 - U)) ⊆ f-(X2 - U) by simp
moreover from fmapAssum have f-(X2 - U) ⊆ cl1 (f-(X2 - U))using func1_1_L3 topol_cntxs_valid topology0.cl_contains_set
by simpultimately have f-(X2 - U) {is closed in} τ 1
using fmapAssum func1_1_L3 topol_cntxs_valid topology0.Top_3_L8
by autowith fmapAssum have f-(U) ∈ τ 1using fun_is_function function_vimage_Diff func1_1_L4
func1_1_L3 IsClosed_def double_complement by simp
} then have ∀ U∈τ 2 . f-(U) ∈ τ 1 by simp
then show thesis using IsContinuous_def by simp
qed

Another condition for continuity: it is sufficient to check if the inverse imageof every set in a base is open.
lemma (in two_top_spaces0) Top_ZF_2_1_L5:
assumes A1: B {is a base for} τ 2 and A2: ∀ U∈B. f-(U) ∈ τ 1shows f {is continuous}652

proof { fix V assume A3: V ∈ τ 2
Swith A1 obtain A where A ⊆ B V =Ausing IsAbaseFor_def by autowith A2 have {f-(U). U∈A}S ⊆ τ 1 by autowith tau1_is_top have{f-(U). U∈A} ∈ τ 1using IsATopology_def by simp
SS
moreover from hA ⊆ Bi hV =Ai have f-(V) ={f-(U). U∈A}
by autoultimately have f-(V) ∈ τ 1 by simp
} then show f {is continuous} using IsContinuous_def
by simpqed

We can strenghten the previous lemma: it is sufficient to check if the inverse
image of every set in a subbase is open. The proof is rather awkward, as
usual when we deal with general intersections. We have to keep track of thecase when the collection is empty.
lemma (in two_top_spaces0) Top_ZF_2_1_L6:
assumes A1: B {is a subbase for} τ 2 and A2: ∀ U∈B. f-(U) ∈ τ 1shows f {is continuous}
proof T
let C = { A. A ∈ FinPow(B)}from A1 have C {is a base for} τ 2using IsAsubBaseFor_def by simp
moreover have ∀ U∈C. f-(U) ∈ τ 1
proof
fix U assume U∈C{ assume f-(U) = 0
with tau1_is_top have f-(U) ∈ τ 1using empty_open by simp }moreover{ assume f-(U) 6= 0
then have U6=0 by (rule func1_1_L13)imoreover from hU∈C
T obtain A whereA ∈ FinPow(B) and U =Aby autoT
ultimately have
A6=0 by simp
then have A6=0 by (rule inter_nempty_nempty)
then have {f-(W). W∈A} 6= 0 by simp
moreover from A2 hA ∈ FinPow(B)i have {f-(W). W∈A} ∈ FinPow(τ 1 )by (rule fin_image_fin)Tultimately have{f-(W). W∈A} ∈ τ 1using topol_cntxs_valid topology0.fin_inter_open_open by simp
moreoverfrom hA ∈ FinPow(B)i have A ⊆ B using FinPow_def by simp
with tau2_is_top A1 have A ⊆ Pow(X2 )using IsAsubBaseFor_def IsATopology_def
by auto TTwith fmapAssum hA6=0i hU =Ai have f-(U) ={f-(W). W∈A}

653

using func1_1_L12 by simp
ultimately have f-(U) ∈ τ 1 by simp }ultimately show f-(U) ∈ τ 1 by blast
qed
ultimately show f {is continuous}
using Top_ZF_2_1_L5 by simpqed

A dual of Top_ZF_2_1_L5: a function that maps base sets to open sets is open.
lemma (in two_top_spaces0) base_image_open:
assumes A1: B {is a base for} τ 1 and A2: ∀ B∈B. f(B) ∈ τ 2 and A3:
U∈τ 1
shows f(U) ∈ τ 2
proof S
from A1 A3 obtain E where E ∈ Pow(B) and U =E using Top_1_2_L1
by blast
S{f(E). E ∈ E} using Top_1_2_L5 fmapAssum image_of_Union
with A1 have f(U) =by automoreoverfrom A2 hE S
∈ Pow(B)i have {f(E). E ∈ E} ∈ Pow(τ 2 ) by auto
then have{f(E). E ∈ E} ∈ τ 2 using tau2_is_top IsATopology_def bysimp
ultimately show thesis using tau2_is_top IsATopology_def by autoqed

A composition of two continuous functions is continuous.
lemma comp_cont: assumes IsContinuous(T,S,f) and IsContinuous(S,R,g)shows IsContinuous(T,R,g O f)using assms IsContinuous_def vimage_comp by simp

A composition of three continuous functions is continuous.
lemma comp_cont3:
assumes IsContinuous(T,S,f) and IsContinuous(S,R,g) and IsContinuous(R,P,h)shows IsContinuous(T,P,h O g O f)using assms IsContinuous_def vimage_comp by simp

52.2

Homeomorphisms

This section studies ”homeomorphisms” - continous bijections whose inverses are also continuous. Notions that are preserved by (commute with)homeomorphisms are called ”topological invariants”.
Homeomorphism is a bijection that preserves open sets.
definition IsAhomeomorphism(T,S,f)≡S S
f ∈ bij( T, S) ∧ IsContinuous(T,S,f) ∧ IsContinuous(S,T,converse(f))

Inverse (converse) of a homeomorphism is a homeomorphism.
lemma homeo_inv: assumes IsAhomeomorphism(T,S,f)654

shows IsAhomeomorphism(S,T,converse(f))
using assms IsAhomeomorphism_def bij_converse_bij bij_converse_converseby autoHomeomorphisms are open maps.
lemma homeo_open: assumes IsAhomeomorphism(T,S,f) and U∈Tshows f(U) ∈ S
using assms image_converse IsAhomeomorphism_def IsContinuous_def bysimp

A continuous bijection that is an open map is a homeomorphism.
lemma bij_cont_open_homeo:
S S
assumes f ∈ bij( T, S) and IsContinuous(T,S,f) and ∀ U∈T. f(U) ∈Sshows IsAhomeomorphism(T,S,f)using assms image_converse IsAhomeomorphism_def IsContinuous_def by
auto

A continuous bijection that maps base to open sets is a homeomorphism.
lemma (in two_top_spaces0) bij_base_open_homeo:
assumes A1: f ∈ bij(X1 ,X2 ) and A2: B {is a base for} τ 1 and A3: C{is a base for} τ 2 andA4: ∀ U∈C. f-(U) ∈ τ 1 and A5: ∀ V∈B. f(V) ∈ τ 2shows IsAhomeomorphism(τ 1 ,τ 2 ,f)using assms tau2_is_top tau1_is_top bij_converse_bij bij_is_fun two_top_spaces0_def
image_converse two_top_spaces0.Top_ZF_2_1_L5 IsAhomeomorphism_def bysimp

A bijection that maps base to base is a homeomorphism.
lemma (in two_top_spaces0) bij_base_homeo:
assumes A1: f ∈ bij(X1 ,X2 ) and A2: B {is a base for} τ 1 andA3: {f(B). B∈B} {is a base for} τ 2shows IsAhomeomorphism(τ 1 ,τ 2 ,f)proof note A1
moreover have f {is continuous}
proof { fix C assume C ∈ {f(B). B∈B}
then obtain B where B∈B and I: C = f(B) by autowith A2 have B ⊆ X1 using Top_1_2_L5 by autowith A1 A2 hB∈B i I have f-(C) ∈ τ 1using bij_def inj_vimage_image base_sets_open by auto
} hence ∀ C ∈ {f(B). B∈B}. f-(C) ∈ τ 1 by autowith A3 show thesis by (rule Top_ZF_2_1_L5)
qed
moreoverfrom A3 have ∀ B∈B. f(B) ∈ τ 2 using base_sets_open by auto655

with A2 have ∀ U∈τ 1 . f(U) ∈ τ 2 using base_image_open by simp
ultimately show thesis using bij_cont_open_homeo by simp
qedInterior is a topological invariant.
S
theorem int_top_invariant: assumes A1: A⊆ T and A2: IsAhomeomorphism(T,S,f)shows f(Interior(A,T)) = Interior(f(A),S)
proof let A = {U∈T. U⊆A}
have I: {f(U). U∈A} = {V∈S. V ⊆ f(A)}prooffrom A2 show {f(U). U∈A} ⊆ {V∈S. V ⊆ f(A)}using homeo_open by auto
{ fix V assume V ∈ {V∈S. V ⊆ f(A)}hence V∈S and II: V ⊆ f(A) by auto
let U = f-(V)from II have U ⊆ f-(f(A)) by auto
moreover from assms have f-(f(A)) = A
using IsAhomeomorphism_def bij_def inj_vimage_image by auto
moreover from A2 hV∈Si have U∈Tusing IsAhomeomorphism_def IsContinuous_def by simp
moreoverS
from hV∈Si have V ⊆S by autowith A2 have V = f(U)using IsAhomeomorphism_def bij_def surj_image_vimage by auto
ultimately have V ∈ {f(U). U∈A} by auto
} thus {V∈S. V ⊆ f(A)} ⊆ {f(U). U∈A} by autoqedS
have f(Interior(A,T)) = S f( A) unfolding Interior_def by simp
also from A2 have . . . ={f(U). U∈A}
using IsAhomeomorphism_def bij_def inj_def image_of_Union by auto
also from I have . . . = Interior(f(A),S) unfolding Interior_def by simp
finally show thesis by simp
qed

52.3

Topologies induced by mappings

In this section we consider various ways a topology may be defined on a set
that is the range (or the domain) of a function whose domain (or range) is
a topological space.
A bijection from a topological space induces a topology on the range.
S
theorem bij_induced_top: assumes A1: T {is a topology} and A2: f ∈ bij( T,Y)
shows
{f(U). U∈T} {is a topology} and{S{f(x).x∈U}. U∈T} {is a topology} and( {f(U). U∈T}) = Y and
IsAhomeomorphism(T, {f(U). U∈T},f)proof -

656

S
from A2 haveSf ∈ inj( T,Y) using bij_def by simp
then have f: T→Y using inj_def by simp
let S = {f(U). U∈T}
{ fix M assume M ∈ Pow(S)let MT = {f-(V). V∈M}
have MT ⊆ T
proof
fix W assume W∈MT
then obtain V where V∈M and I: W = f-(V) by autowith hM ∈ Pow(S)i have V∈S by auto
then obtain U where U∈T and V = f(U) by autowith I have W S= f-(f(U)) by simp
with hf ∈ inj( T,Y)i hU∈Ti have W = U using inj_vimage_image by
blastwith hU∈Ti show W∈T by simp
qedSwith A1 have
( MT ) ∈ T using IsATopology_def by simp
S
hence f( MT ) ∈ S
S by autoS
moreover have f( MT ) =M
proof - SSSfrom hf: T→Yi hMT ⊆ Ti have f( MT ) ={f(U). U∈MT }using image_of_Union by auto
moreover have {f(U). U∈MT } = M
proof - Sfrom hf: T→Yi have ∀ U∈T. f(U) ⊆ Y using func1_1_L6 by simp
with hM ∈ Pow(S)i have M ⊆ Pow(Y) by autowith A2 show {f(U). U∈MT } = M using bij_def surj_subsets by
auto
qed
S
S
ultimately show f( MT ) =M by simp
qedS
ultimately have
M ∈ S
S by auto} then have ∀ M∈Pow(S).
M ∈ S by auto
moreover{ fix U V assume U∈S V∈Sthen obtain UT VT where UT ∈ T
VT ∈ T and
I: U = f(UT ) V = f(VT )by autowith A1 have UT ∩VT ∈ T using IsATopology_def by simp
hence f(UT ∩VT ) ∈ S by auto
moreover have f(UT ∩VT ) = U∩V
proof S
S
from hUT ∈ Ti hVT ∈ Ti have UT ⊆T VT ⊆
T
using bij_defS by autowith hf ∈ inj( T,Y)i I show f(UT ∩VT ) = U∩V using inj_image_interby simpqed
ultimately have U∩V ∈ S by simp

657

} then have ∀ U∈S. ∀ V∈S. U∩V ∈ S by auto
ultimately show S S{is a topology} using IsATopology_def by simp
moreover from hf: T→Yi have ∀ U∈T. f(U) = {f(x).x∈U}using func_imagedef by blast
ultimately
show { {f(x).x∈U}. U∈T} {is a topology} by simp
S
show
S = Y
proof
S
hf:
from S
T→Yi have ∀ U∈T. f(U) ⊆ Y using func1_1_L6 by simpthus
S ⊆ Y bySauto S
from A1 have f( T)S using IsATopology_def by autoS⊆with A2 show Y ⊆S using bij_def surj_range_image_domain
by autoqed
show IsAhomeomorphism(T,S,f)proof S
S S
from A2 h S = Yi have f ∈ bij( T, S) by simp
moreover have IsContinuous(T,S,f)proof { fix V assume V∈S
then obtainSU where U∈T and V = f(U) by auto
hence U ⊆T Sand f-(V) = f-(f(U)) by autowith hf ∈ inj( T,Y)i hU∈Ti have f-(V) ∈ T using inj_vimage_image
by simp} then show IsContinuous(T,S,f) unfolding IsContinuous_def by autoqed
ultimately showIsAhomeomorphism(T,S,f) using bij_cont_open_homeo
by auto
qed
qed

52.4

Partial functions and continuity

S
Suppose we have two topologies τ1 , τ2 on sets Xi = τi , i = 1, 2. Consider
some function f : A → X2 , where A ⊆ X1 (we will call such function”partial”). In such situation we have two natural possibilities for the pairsof topologies with respect to which this function may be continuous. One
is obvously the original τ1 , τ2 and in the second one the first element of thepair is the topology relative to the domain of the function: {A ∩ U |U ∈ τ1 }.
These two possibilities are not exactly the same and the goal of this section
is to explore the differences.
If a function is continuous, then its restriction is continous in relative topology.
lemma (in two_top_spaces0) restr_cont:assumes A1: A ⊆ X1 and A2: f {is continuous}shows IsContinuous(τ 1 {restricted to} A, τ 2 ,restrict(f,A))

658

proof let g = restrict(f,A){ fix U assume U ∈ τ 2with A2 have f-(U) ∈ τ 1 using IsContinuous_def by simp
moreover from A1 have g-(U) = f-(U) ∩ A
using fmapAssum func1_2_L1 by simp
ultimately have g-(U) ∈ (τ 1 {restricted to} A)
using RestrictedTo_def by auto
} then show thesis using IsContinuous_def by simp
qed

If a function is continuous, then it is continuous when we restrict the topology on the range to the image of the domain.
lemma (in two_top_spaces0) restr_image_cont:assumes A1: f {is continuous}shows IsContinuous(τ 1 , τ 2 {restricted to} f(X1 ),f)
proof have ∀ U ∈ τ 2 {restricted to} f(X1 ). f-(U) ∈ τ 1
proof
fix U assume U ∈ τ 2 {restricted to} f(X1 )then obtain V where V ∈ τ 2 and U = V ∩ f(X1 )using RestrictedTo_def by autowith A1 show f-(U) ∈ τ 1using fmapAssum inv_im_inter_im IsContinuous_def
by simpqed
then show thesis using IsContinuous_def by simp
qed

A combination of restr_cont and restr_image_cont.
lemma (in two_top_spaces0) restr_restr_image_cont:assumes A1: A ⊆ X1 and A2: f {is continuous} andA3: g = restrict(f,A) andA4: τ 3 = τ 1 {restricted to} Ashows IsContinuous(τ 3 , τ 2 {restricted to} g(A),g)
proof S
from A1 A4 have
τ3 = A
using union_restrict by auto
have two_top_spaces0(τ 3 , τ 2 , g)proof from A4 have
τ 3 {is a topology} and τ 2 {is a topology}
using tau1_is_top tau2_is_top
topology0_def topology0.Top_1_L4
by auto S
SS
moreover from A1 A3 h τ 3 = Ai have g:τ3 →τ2using fmapAssum restrict_type2 by simp
ultimately show thesis using two_top_spaces0_def
by simpqed

659

moreover from assms have IsContinuous(τ 3 , τ 2 , g)using restr_cont by simp
Sultimately have IsContinuous(τ 3 , τ 2 {restricted to} g( τ 3 ),g)by (rule two_top_spaces0.restr_image_cont)S
moreover note h τ 3 = Ai
ultimately show thesis by simp
qed

We need a context similar to two_top_spaces0 but without the global function f : X1 → X2 .
locale two_top_spaces1 =fixes τ 1
assumes tau1_is_top: τ 1 {is a topology}
fixes τ 2
assumes tau2_is_top: τ 2 {is a topology}
fixes X1
S
defines X1_def [simp]: X1 ≡
τ1fixes X2
S
defines X2_def [simp]: X2 ≡
τ2

If a partial function g : X1 ⊇ A → X2 is continuous with respect to (τ1 , τ2 ),then A is open (in τ1 ) and the function is continuous in the relative topology.
lemma (in two_top_spaces1) partial_fun_cont:assumes A1: g:A→X2 and A2: IsContinuous(τ 1 ,τ 2 ,g)shows A ∈ τ 1 and IsContinuous(τ 1 {restricted to} A, τ 2 , g)proof from A2 have g-(X2 ) ∈ τ 1using tau2_is_top IsATopology_def IsContinuous_def by simp
with A1 show A ∈ τ 1 using func1_1_L4 by simp
{ fix V assume V ∈ τ 2with A2 have g-(V) ∈ τ 1 using IsContinuous_def by simp
moreoverfrom A1 have g-(V) ⊆ A using func1_1_L3 by simp
hence g-(V) = A ∩ g-(V) by auto
ultimately have g-(V) ∈ (τ 1 {restricted to} A)
using RestrictedTo_def by auto
} then show IsContinuous(τ 1 {restricted to} A, τ 2 , g)using IsContinuous_def by simp
qed

For partial function defined on open sets continuity in the whole and relative
topologies are the same.
lemma (in two_top_spaces1) part_fun_on_open_cont:assumes A1: g:A→X2 and A2: A ∈ τ 1660

shows IsContinuous(τ 1 ,τ 2 ,g) ←→IsContinuous(τ 1 {restricted to} A, τ 2 , g)
proof
assume IsContinuous(τ 1 ,τ 2 ,g)with A1 show IsContinuous(τ 1 {restricted to} A, τ 2 , g)using partial_fun_cont by simp
next
assume I: IsContinuous(τ 1 {restricted to} A, τ 2 , g)
{ fix V assume V ∈ τ 2with I have g-(V) ∈ (τ 1 {restricted to} A)
using IsContinuous_def by simp
then obtain W where W ∈ τ 1 and g-(V) = A∩Wusing RestrictedTo_def by autowith A2 have g-(V) ∈ τ 1 using tau1_is_top IsATopology_def
by simp} then show IsContinuous(τ 1 ,τ 2 ,g) using IsContinuous_def
by simpqed

52.5

Product topology and continuity

We start with three topological spaces (τ1 , X1 ), (τ2 , X2 ) and (τ3 , X3 ) and afunction f : X1 × X2 → X3 . We will study the properties of f with respect
to the product topology τ1 × τ2 and τ3 . This situation is similar as in locale
two_top_spaces0 but the first topological space is assumed to be a productof two topological spaces.
First we define a locale with three topological spaces.
locale prod_top_spaces0 =fixes τ 1
assumes tau1_is_top: τ 1 {is a topology}
fixes τ 2
assumes tau2_is_top: τ 2 {is a topology}
fixes τ 3
assumes tau3_is_top: τ 3 {is a topology}
fixes X1
S
defines X1_def [simp]: X1 ≡
τ1fixes X2
S
defines X2_def [simp]: X2 ≡
τ2fixes X3S
defines X3_def [simp]: X3 ≡
τ3fixes η661

defines eta_def [simp]: η ≡ ProductTopology(τ 1 ,τ 2 )Fixing the first variable in a two-variable continuous function results in acontinuous function.
lemma (in prod_top_spaces0) fix_1st_var_cont:assumes f: X1 ×X2 →X3 and IsContinuous(η,τ 3 ,f)and x∈X1
shows IsContinuous(τ 2 ,τ 3 ,Fix1stVar(f,x))
using assms fix_1st_var_vimage IsContinuous_def tau1_is_top tau2_is_top
prod_sec_open1 by simp

Fixing the second variable in a two-variable continuous function results in
a continuous function.
lemma (in prod_top_spaces0) fix_2nd_var_cont:assumes f: X1 ×X2 →X3 and IsContinuous(η,τ 3 ,f)and y∈X2
shows IsContinuous(τ 1 ,τ 3 ,Fix2ndVar(f,y))using assms fix_2nd_var_vimage IsContinuous_def tau1_is_top tau2_is_top
prod_sec_open2 by simp

Having two constinuous mappings we can construct a third one on the cartesian product of the domains.
lemma cart_prod_cont:assumes A1: τ 1 {is a topology} τ 2 {is a topology} andA2: η 1 {isη 2 {is a S
topology}
S a topology}S
S andA3a: f1 : τ 1 → η 1 and A3b: f2 : τ 2 → η 2 andA4: IsContinuous(τ 1 ,η 1 ,f1 ) IsContinuous(τ 2S,η 2 ,fS2 ) and
A5: g = {hp,hf1 (fst(p)),f2 (snd(p))ii. p ∈τ 1× τ 2}shows IsContinuous(ProductTopology(τ 1 ,τ 2 ),ProductTopology(η 1 ,η 2 ),g)
proof let τ = ProductTopology(τ 1 ,τ 2 )let η = ProductTopology(η1 ,η 2 )S
let X1 = S τ 1
let X2 = S τ 2
let Y1 = S η 1
let Y2 =η2let B = ProductCollection(η 1 ,η 2 )from A1 A2 have τ {is a topology} and η {is a topology}
using Top_1_4_T1 by auto
moreover have g: X1 ×X2 → Y1 ×Y2
proof { fix p assume p ∈ X1 ×X2
hence fst(p) ∈ X1 and snd(p) ∈ X2 by autofrom A3a hfst(p) ∈ X1 i have f1 (fst(p)) ∈ Y1
by (rule apply_funtype)moreover from A3b hsnd(p) ∈ X2 i have f2 (snd(p)) ∈ Y2
by (rule apply_funtype)S
S
ultimately have hf1 (fst(p)),f2 (snd(p))i ∈η 1 × η 2 by auto662

} hence ∀ p ∈ X1 ×X2 . hf1 (fst(p)),f2 (snd(p))i ∈ Y1 ×Y2
by simpwith A5 show g: X1 ×X2 → Y1 ×Y2 using ZF_fun_from_total
by simpqed
SS
moreover from A1 A2 have
τ = X1 ×X2 andη = Y1 ×Y2
using Top_1_4_T1 by auto
ultimately have two_top_spaces0(τ ,η,g) using two_top_spaces0_def
by simpmoreover from A2 have B {is a base for} η using Top_1_4_T1
by simpmoreover have ∀ U∈B. g-(U) ∈ τ
proof
fix U assume U∈Bthen obtain V W where V ∈ η 1 W ∈ η 2 and U = V×Wusing ProductCollection_def by autowith A3a A3b A5 have g-(U) = f1 -(V) × f2 -(W)using cart_prod_fun_vimage by simp
moreover from A1 A4 hV ∈ η 1 i hW ∈ η 2 i have f1 -(V) × f2 -(W) ∈ τusing IsContinuous_def prod_open_open_prod by simp
ultimately show g-(U) ∈ τ by simp
qed
ultimately show thesis using two_top_spaces0.Top_ZF_2_1_L5
by simpqed

A reformulation of the cart_prod_cont lemma above in slightly different
notation.
theorem (in two_top_spaces0)
S
S product_cont_functions:assumes f:X1 →X2 g: τ 3 → τ 4
IsContinuous(τ 1 ,τ 2 ,f) IsContinuous(τ 3 ,τ 4 ,g)
τ 4 {is a topology} τ 3 {is a topology}
shows IsContinuous(ProductTopology(τ1 ,τ 3 ),ProductTopology(τ 2 ,τ 4 ),{hhx,yi,hfx,gyii.
Shx,yi∈X1 × τ 3 })proof S
haveS {hhx,yi,hfx,gyii. hx,yi∈X1 × τ 3 } = {hp,hf(fst(p)),g(snd(p))ii. p∈ X1 × τ 3 }by forcewith tau1_is_top tau2_is_top assms show thesis using cart_prod_contby simpqed

A special case of cart_prod_cont when the function acting on the second
axis is the identity.
lemma cart_prod_cont1:
assumes A1: τ 1 {is a topology} and A1a: τ 2 {is a topology} andA2: η 1 S
{is a S
topology} andA3: f1 : τ 1 → η 1 and A4: IsContinuous(τ,f1 ) andS 1 ,η 1S
A5: g = {hp, hf1 (fst(p)),snd(p)ii. p ∈τ 1× τ 2}663

shows IsContinuous(ProductTopology(τ 1 ,τ 2 ),ProductTopology(η 1 ,τ 2 ),g)
proof Slet f2 = id(S τ 2)
have ∀ x∈ τ 2 . fS2 (x) S= x using id_conv by blast
hence I: ∀ p ∈τ 1 × τ 2 . snd(p) = f2 (snd(p)) by simp
note A1 A1a A2 A1aSA3 S
moreover have f2 : τ 2 → τ 2 using id_type by simp
moreover note A4
moreover have IsContinuous(τ 2 ,τ 2 ,f2 ) using id_cont bySsimp S
moreover have g = {hp, hf1 (fst(p)),f2 (snd(p))i i. p ∈τ 1× τ 2}
proof
S
Sfrom A5 I show g ⊆ {hp, hf1 (fst(p)),f2 (snd(p))ii. p ∈τ 1× τ 2}
by autoS
S
from A5 I show {hp, hf1 (fst(p)),f2 (snd(p))ii. p ∈τ 1× τ 2} ⊆ gby autoqed
ultimately show thesis by (rule cart_prod_cont)
qed

52.6

Pasting lemma

The classical pasting lemma states that if U1 , U2 are both open (or closed)
and a function is continuous when restricted to both U1 and U2 then it iscontinuous when restricted to U1 ∪ U2 . In this section we prove a generalization statement stating that the set {U ∈ τ1 |f |U is continuous } is a
topology.
A typical statement of the pasting lemma uses the notion of a function restricted to a set being continuous without specifying the topologies withrespect to which this continuity holds. In two_top_spaces0 context the notation g {is continuous} means continuity wth respect to topologies τ1 , τ2 .
The next lemma is a special
case of partial_fun_cont and states that if forS
some set A ⊆ X1 = τ1 the function f |A is continuous (with respect to(τ1 , τ2 )), then A has to be open. This clears up terminology and indicates
why we need to pay attention to the issue of which topologies we talk about
when we say that the restricted (to some closed set for example) function iscontinuos.
lemma (in two_top_spaces0) restriction_continuous1:
assumes A1: A ⊆ X1 and A2: restrict(f,A) {is continuous}shows A ∈ τ 1
proof from assms have two_top_spaces1(τ 1 ,τ 2 ) and
restrict(f,A):A→X2 and restrict(f,A) {is continuous}
using tau1_is_top tau2_is_top two_top_spaces1_def fmapAssum restrict_fun
by autothen show thesis using two_top_spaces1.partial_fun_cont by simp
qed

664

If a fuction is continuous on each set of a collection of open sets, then it iscontinuous on the union of them. We could use continuity with respect tothe relative topology here, but we know that on open sets this is the sameas the original topology.
lemma (in two_top_spaces0) pasting_lemma1:
assumes A1: M ⊆ τS1 and A2: ∀ U∈M. restrict(f,U) {is continuous}shows restrict(f, M) {is continuous}
proof { fix V assume V∈τ
S 2from A1 haveM ⊆ X1Sby autoS
then have restrict(f, M)-(V) = f-(V) ∩ ( M)using func1_2_L1
S fmapAssum by simp
also have . . . ={f-(V)S ∩ U. U∈M}Sby auto
finally have restrict(f, M)-(V) ={f-(V) ∩ U. U∈M} by simp
moreoverhave {f-(V) ∩ U. U∈M} ∈ Pow(τ 1 )proof { fix W assume W ∈ {f-(V) ∩ U. U∈M}
then obtain U where U∈M and I: W = f-(V) ∩ U by autowith A2 have restrict(f,U) {is continuous} by simp
with hV∈τ 2 i have restrict(f,U)-(V) ∈ τ 1using IsContinuous_def
by simpS
moreover from h M ⊆ X1 i and hU∈Mi
have restrict(f,U)-(V) = f-(V) ∩ U
using fmapAssum func1_2_L1 by blast
ultimately have f-(V) ∩ U ∈ τ 1 by simp
with I have W ∈ τ 1 by simp
} then show thesis by autoqedSthen have{f-(V) ∩ U. U∈M} ∈ τ 1using tau1_is_top IsATopology_def
by autoS
ultimately have restrict(f, M)-(V) ∈ τ 1
by simp} then show thesis using IsContinuous_def by simp
qed

If a function is continuous on two sets, then it is continuous on intersection.
lemma (in two_top_spaces0) cont_inter_cont:assumes A1: A ⊆ X1 B ⊆ X1 andA2: restrict(f,A) {is continuous} restrict(f,B) {is continuous}shows restrict(f,A∩B) {is continuous}
proof { fix V assume V∈τ 2
with assms haverestrict(f,A)-(V) = f-(V) ∩ A restrict(f,B)-(V) = f-(V) ∩ B andrestrict(f,A)-(V) ∈ τ 1 and restrict(f,B)-(V) ∈ τ 1using func1_2_L1 fmapAssum IsContinuous_def by auto
then have (restrict(f,A)-(V)) ∩ (restrict(f,B)-(V)) = f-(V) ∩ (A∩B)
by auto665

moreoverfrom A2 hV∈τ 2 i haverestrict(f,A)-(V) ∈ τ 1 and restrict(f,B)-(V) ∈ τ 1using IsContinuous_def by auto
then have (restrict(f,A)-(V)) ∩ (restrict(f,B)-(V)) ∈ τ 1using tau1_is_top IsATopology_def by simp
moreoverfrom A1 have (A∩B) ⊆ X1 by auto
then have restrict(f,A∩B)-(V) = f-(V) ∩ (A∩B)
using func1_2_L1 fmapAssum by simp
ultimately have restrict(f,A∩B)-(V) ∈ τ 1 by simp
} then show thesis using IsContinuous_def by autoqed

The collection of open sets U such that f restricted to U is continuous, is a
topology.
theorem (in two_top_spaces0) pasting_theorem:
shows {U ∈ τ 1 . restrict(f,U) {is continuous}} {is a topology}
proof let T = {U ∈ τ 1 . restrict(f,U){is continuous}}S
have ∀ M∈Pow(T).
M ∈ T
proof
fix M assume M ∈ Pow(T)Sthen have restrict(f, M) {is continuous}
using pasting_lemma1 by
S autowith hM ∈ Pow(T)i show
M ∈ Tusing tau1_is_top IsATopology_def by autoqed
moreover have ∀ U∈T.∀ V∈T. U∩V ∈ Tusing cont_inter_cont tau1_is_top IsATopology_def by auto
ultimately show thesis using IsATopology_def by simp
qed

0 is continuous.
corollary (in two_top_spaces0) zero_continuous: shows 0 {is continuous}
proof let T = {U ∈ τ 1 . restrict(f,U) {is continuous}}
have T {is a topology} by (rule pasting_theorem)
then have 0∈T by (rule empty_open)
hence restrict(f,0) {is continuous} by simp
moreover have restrict(f,0) = 0 by simp
ultimately show thesis by simp
qed
end

53

Topology 3

theory Topology_ZF_3 imports Topology_ZF_2 FiniteSeq_ZF666

beginTopology_ZF_1 theory describes how we can define a topology on a productof two topological spaces. One way to generalize that is to construct topology for a cartesian product of n topological spaces. The cartesian productapproach is somewhat inconvenient though. Another way to approach product topology on X n is to model cartesian product as sets of sequences (oflength n) of elements of X. This means that having a topology on X wewant to define a toplogy on the space n → X, where n is a natural number(recall that n = {0, 1, ..., n − 1} in ZF). However, this in turn can be done
more generally by defining a topology on any function space I → X, where
I is any set of indices. This is what we do in this theory.

53.1

The base of the product topology

In this section we define the base of the product topology.
S
Suppose X = I → T is a space of functions from some index set I to thecarrier of a topology T . Then take a finite collection of open sets W : N → T
indexed by N ⊆ I. We can define a subset of X that models the cartesian
product of W .
definition
FinProd(X ,W) ≡ {x∈X . ∀ i∈domain(W). x(i) ∈ W(i)}Now we define the base of the product topology as the collection of all finite
products (in the sense defined above) of open sets.
definition
ProductTopBase(I,T) ≡SSN∈FinPow(I).{FinProd(I→ T,W). W∈N→T}

Finally, we define the product topology on sequences. We use the ”Seq”
prefix although the definition is good for any index sets, not only natural
numbers.
definitionS
SeqProductTopology(I,T) ≡ { B. B ∈ Pow(ProductTopBase(I,T))}

Product topology base is closed with respect to intersections.
lemma prod_top_base_inter:assumes A1: T {is a topology} andA2: U ∈ ProductTopBase(I,T) V ∈ ProductTopBase(I,T)
shows U∩V ∈ ProductTopBase(I,T)
proof S
let X = I→ T
from A2 obtain N1 W1 N2 W2 where
I: N1 ∈ FinPow(I) W1 ∈N1 →T U = FinProd(X ,W1 ) and
II: N2 ∈ FinPow(I) W2 ∈N2 →T V = FinProd(X ,W2 )667

using ProductTopBase_def by auto
let N3 = N1 ∪ N2
let W3 = {hi,if i ∈ N1 -N2 then W1 (i)else if i ∈ N2 -N1 then W2 (i)else (W1 (i)) ∩ (W2 (i))i. i ∈ N3 }from A1 I II have ∀ i ∈ N1 ∩ N2 . (W1 (i) ∩ W2 (i)) ∈ T
using apply_funtype IsATopology_def by auto
moreover from I II have ∀ i∈N1 -N2 . W1 (i) ∈ T and ∀ i∈N2 -N1 . W2 (i) ∈Tusing apply_funtype by auto
ultimately have W3 :N3 →T by (rule fun_union_overlap)
with I II have FinProd(X ,W3 ) ∈ ProductTopBase(I,T) using union_finpow
ProductTopBase_def
by automoreover have U∩V = FinProd(X ,W3 )proof{ fix x assume x∈U and x∈Vwith hU = FinProd(X ,W1 )i hW1 ∈N1 →Ti and hV = FinProd(X ,W2 )i hW2 ∈N2 →Tihave x∈X and ∀ i∈N1 . x(i) ∈ W1 (i) and ∀ i∈N2 . x(i) ∈ W2 (i)using func1_1_L1 FinProd_def by autowith hW3 :N3 →Ti hx∈X i have x ∈ FinProd(X ,W3 )using ZF_fun_from_tot_val func1_1_L1 FinProd_def by auto
} thus U∩V ⊆ FinProd(X ,W3 ) by auto
{ fix x assume x ∈ FinProd(XS ,W3 )
with hW3 :N3 →Ti have x:I→ T and III: ∀ i∈N3 . x(i) ∈ W3 (i)using FinProd_def func1_1_L1 by auto
{ fix i assume i∈N1with hW3 :N3 →Ti have W3 (i) ⊆ W1 (i) using ZF_fun_from_tot_val by
autowith III hi∈N1 i have x(i)∈ W1 (i) by autoS
} with hW1 ∈N1 →Ti hx:I→ Ti hU = FinProd(X ,W1 )ihave x ∈ U using func1_1_L1 FinProd_def by auto
moreover{ fix i assume i∈N2with hW3 :N3 →Ti have W3 (i) ⊆ W2 (i) using ZF_fun_from_tot_val by
autowith III hi∈N2 i have x(i)∈ W2 (i) by autoS
} with hW2 ∈N2 →Ti hx:I→ Ti hV = FinProd(X ,W2 )i have x∈Vusing func1_1_L1 FinProd_def by auto
ultimately have x ∈ U∩V by simp
} thus FinProd(X ,W3 ) ⊆ U∩V by autoqed
ultimately show thesis by simp
qed

In the next theorem we show the collection of sets defined above as ProductTopBase(X ,T)satisfies the base condition. This is a condition, defined in Topology_ZF_1
that allows to claim that this collection is a base for some topology.
theorem prod_top_base_is_base: assumes T {is a topology}

668

shows ProductTopBase(I,T) {satisfies the base condition}using assms prod_top_base_inter inter_closed_base by simp

The (sequence) product topology is indeed a topology on the space of sequences. In the proof we are using the fact that (∅ → X) = {∅}.
theorem seq_prod_top_is_top: assumes T {is a topology}shows
SeqProductTopology(I,T) {is a topology} andProductTopBase(I,T){is a base for}S
S SeqProductTopology(I,T) and
SeqProductTopology(I,T) = (I→ T)
proof from assms show SeqProductTopology(I,T) {is a topology} and
I: ProductTopBase(I,T) {is a base for} SeqProductTopology(I,T)
using prod_top_base_is_base SeqProductTopology_def Top_1_2_T1
by autoS
S
from I have
SeqProductTopology(I,T) =ProductTopBase(I,T)
using Top_1_2_L5
by
simp
S
S
also have
ProductTopBase(I,T) = (I→ T)
proof SS
show
ProductTopBase(I,T) ⊆ (I→ T) using ProductTopBase_def FinProd_def
by autohave 0 ∈ FinPow(I)Susing empty_in_finpow
S by simp
S
hence {FinProd(I→ T,W). W∈0→T} ⊆ ( N∈FinPow(I).{FinProd(I→ T,W).
W∈N→T})by blast
S
Sthen show (I→ T) ⊆ProductTopBase(I,T) using ProductTopBase_def
FinProd_def
by autoqed
S
S
finally show
SeqProductTopology(I,T) = (I→ T) by simp
qed

53.2

Finite product of topologies

As a special case of the space of functions I → X we can consider space oflists of elements of X, i.e. space n → X, where n is a natural number (recall
that in ZF set theory n = {0, 1, ..., n−1}). Such spaces model finite cartesian
products X n but are easier to deal with in formalized way (than the said
products). This section discusses natural topology defined on n → X where
X is a topological space.
When the index set is finite, the definition of ProductTopBase(I,T) can be
simplifed.
lemma fin_prod_def_nat: assumes A1: n∈nat and A2: T {is a topology}
Sshows ProductTopBase(n,T) = {FinProd(n→ T,W). W∈n→T}
proof

669

from A1 have n ∈ FinPow(n) using nat_finpow_nat fin_finpow_self by
autoSthen show {FinProd(n→ T,W). W∈n→T} ⊆ ProductTopBase(n,T) using ProductTopBase_def
by auto{ fix B assume B ∈ ProductTopBase(n,T)
Sthen obtain N W where N ∈ FinPow(n) and W ∈ N→T and B = FinProd(n→ T,W)
using ProductTopBase_def by auto S
let Wn = {hi,if i∈N then W(i) else
Ti. i∈n}hN ∈ FinPow(n)ihW∈N→Ti have ∀ i∈n. (if i∈N then W(i) else
from
A2
S
T) ∈ T
using apply_funtype FinPow_def IsATopology_def by auto
then have Wn :n→T by (rule ZF_fun_from_total)
S
moreover have B = FinProd(n→ T,Wn )proof{ fix x assume x∈B
SS
with hB = FinProd(n→ T,W)i have x ∈ n→ T using FinProd_def
by simpmoreover have ∀ i∈domain(Wn ). x(i) ∈ Wn (i)proof
fix i assume i ∈ domain(Wn )iwith hWn :n→T
S have i∈n using
S func1_1_L1 by simphwith x:n→ Ti have x(i) ∈S T using apply_funtype by blast
with hx∈Bi hB = FinProd(n→ T,W)i hW ∈ N→Ti hWn :n→Ti hi∈nishow x(i) ∈ Wn (i) using func1_1_L1 FinProd_def ZF_fun_from_tot_val
by simpqed
Sultimately have x ∈ FinProd(n→T,Wn ) using FinProd_def by simpS
} thus B ⊆ FinProd(n→ T,Wn ) by autonext
S{ fix x assume x ∈ FinProd(n→T,Wn )
S
then have x ∈ n→ T and ∀ i∈domain(Wn ). x(i) ∈ Wn (i)using FinProd_def by autowith hWn :n→Ti and hN ∈ FinPow(n)i have ∀ i∈N. x(i) ∈ Wn (i)using func1_1_L1 FinPow_def by auto
moreover from hWn :n→Ti and hN ∈ FinPow(n)ihave ∀ i∈N. Wn (i) = W(i)using ZF_fun_from_tot_val FinPow_def by auto
ultimately have ∀ i∈N. x(i)∈ W(i) by simp S
Swith hW ∈ N→Ti hx ∈ n→ Ti hB = FinProd(n→ T,W)i have x∈Busing func1_1_L1
S FinProd_def by simp
} thus FinProd(n→ T,Wn ) ⊆ B by autoqed
Sultimately have B ∈ {FinProd(n→ T,W). SW∈n→T} by auto
} thus ProductTopBase(n,T) ⊆ {FinProd(n→ T,W). W∈n→T} by autoqed

A technical lemma providing a formula for finite product on one topologicalspace.

670

lemma single_top_prod:
assumes A1: W:1→τ
S
shows FinProd(1→ τ ,W) = { {h0,yi}. y ∈ W(0)}proof have 1 = {0} by autofrom A1 have domain(W)by autoS = {0} using func1_1_L1
Sthen have FinProd(1→ τ ,W) = {x ∈ 1→ τ . x(0) ∈ W(0)}using FinProd_defS by simp
also have {x ∈ 1→ τ . x(0) ∈ W(0)} = { {h0,yi}. y ∈ W(0)}proof
S
from h1 = {0}i show {x ∈ 1→ τ . x(0) ∈ W(0)} ⊆ { {h0,yi}. y ∈ W(0)}using func_singleton_pair by auto
{ fix x assume x ∈ { {h0,yi}. y ∈ W(0)}then obtain y whereS x = {h0,yi} and II: y ∈ W(0) by autowith A1 have y ∈τ using apply_funtype
S by autowith hx = {h0,yi}i h1 = {0}i have x:1→ τ using pair_func_singleton
by autoSwith hx = {h0,yi}i II have x ∈ {x ∈ 1→ τ . x(0) ∈ W(0)}using pair_val by simpS
} thus { {h0,yi}. y ∈ W(0)} ⊆ {x ∈ 1→ τ . x(0) ∈ W(0)} by autoqed
finally show thesis by simp
qed

Intuitively, the topological space of singleton lists valued in X is the sameas X. However, each element of this space is a list of length one, i.e a set
consisting of a pair h0, xi where x is an element of X. The next lemma
provides a formula for the product topology in the corner case when we
have only one factor and shows that the product topology of one space isessentially the same as the space.
lemma singleton_prod_top: assumes A1: τ {is a topology}shows
SeqProductTopology(1,τ ) = { { {h0,yi}. y∈U }. U∈τ } andS
IsAhomeomorphism(τ ,SeqProductTopology(1,τ ),{hy,{h0,yi}i.y ∈τ })proof have {0} = 1 by autoS
let b = {hy,{h0,yi}i.yτ}SS∈have b ∈ bij( τ ,1→ τ ) using list_singleton_bij by blast
with A1 have {b(U). U∈τ } {is a topology} and IsAhomeomorphism(τ , {b(U).
U∈τ },b)using bij_induced_top by auto
moreover have ∀ U∈τ . b(U) = { {h0,yi}. y∈U }proof
fix U assume U∈τSSSSfrom hb ∈ bij( τ ,1→ τ )i have b: τ →(1→ τ ) using bij_def inj_def
by simpS{ fix y assume
y ∈S τ
S
with hb: τ →(1→ τ )i have b(y) = {h0,yi} using ZF_fun_from_tot_val
by simp S} hence ∀ y ∈τ . b(y) = {h0,yi} by auto

671

S
S
with hU∈τ i hb: τ →(1→ τ )i show b(U) = { {h0,yi}. y∈U }using func_imagedef by autoqed
moreover have ProductTopBase(1,τ ) = { { {h0,yi}. y∈U }. U∈τ }proof{ fix V assume V ∈ ProductTopBase(1,τ )S
with A1 obtain W where W:1→τ and V = FinProd(1→ τ ,W)using fin_prod_def_nat by auto
then have V ∈ { { {h0,yi}. y∈U }. U∈τ } using apply_funtype single_top_prodby auto} thus ProductTopBase(1,τ ) ⊆ { { {h0,yi}. y∈U }. U∈τ } by auto
{ fix V assume V ∈ { { {h0,yi}. y∈U }. U∈τ }then obtain U where U∈τ and V = { {h0,yi}. y∈U } by auto
let W = {h0,Ui}
from hU∈τ i have W:{0}→τ using pair_func_singleton by simp
with h{0} = 1i have W:1→τ and W(0) = U using pair_val
by autoSwith hV = { {h0,yi}. y∈U }i have V = FinProd(1→ τ ,W)using single_top_prod by simp
with A1 hW:1→τ i have V ∈ ProductTopBase(1,τ ) using fin_prod_def_nat
by auto} thus { { {h0,yi}. y∈U }. U∈τ } ⊆ ProductTopBase(1,τ ) by autoqed
ultimately have I: ProductTopBase(1,τ ) {is a topology} and
II: IsAhomeomorphism(τ , ProductTopBase(1,τ ),b) by autofrom A1 have ProductTopBase(1,τ ) {is a base for} SeqProductTopology(1,τ )using seq_prod_top_is_top by simp
with I have ProductTopBase(1,τ ) = SeqProductTopology(1,τ ) by (rulebase_topology)
with hProductTopBase(1,τ ) = { { {h0,yi}. y∈U }. U∈τ }i II show
SeqProductTopology(1,τ ) = { { {h0,yi}. y∈U }. U∈τ } andS
IsAhomeomorphism(τ ,SeqProductTopology(1,τ ),{hy,{h0,yi}i.y ∈τ }) byauto
qed

A special corner case of finite_top_prod_homeo: a space X is homeomorphic
to the space of one element lists of X.
theorem singleton_prod_top1: assumes A1: τ {is a topology}
Sshows IsAhomeomorphism(SeqProductTopology(1,τ ),τ ,{hx,x(0)i. x∈1→ τ })proof SS
have {hx,x(0)i. x∈1→ τ } = converse({hy,{h0,yi}i.y∈ τ })using list_singleton_bij by blast
with A1 show thesis using singleton_prod_top homeo_inv by simpqed

A technical lemma describing the carrier of a (cartesian) product topologyof the (sequence) product topology of n copies of topology τ and anothercopy of τ .
lemma finite_prod_top: assumes τ {is a topology} and672

T = SeqProductTopology(n,τ )SSS
shows ( ProductTopology(T,τ )) = (n→ τ )× τ
using assms Top_1_4_T1 seq_prod_top_is_top by simp

If U is a set from the base of X n and V is open in X, then U × V is in thebase of X n+1 . The next lemma is an analogue of this fact for the function
space approach.
lemma finite_prod_succ_base: assumes A1: τ {is a topology} and A2:n ∈ nat andA3: U ∈ ProductTopBase(n,τ) and A4: V∈τSshows {x ∈ succ(n)→ τ . Init(x) ∈ U ∧ x(n) ∈ V} ∈ ProductTopBase(succ(n),τ )proof Slet B = {x ∈ succ(n)→ τ . Init(x) ∈ U ∧ x(n) ∈ V} S
from A1 A2 have ProductTopBase(n,τ ) = {FinProd(n→ τ ,W). W∈n→τ }using fin_prod_def_nat by simp
Swith A3 obtain WU where WU :n→τ and U =FinProd(n→ τ ,WU ) by auto
let W = Append(WU ,V)from A4 and hWU :n→τ i have W:succ(n)→τ
using append_props by simp
S
moreover have B = FinProd(succ(n)→ τ ,W)proof{ fix x assume x∈BSwith hW:succ(n)→τ i have x ∈ succ(n)→ τ and domain(W) = succ(n)using func1_1_L1
by autoS
moreoverfrom A2 A4 hx∈Bi hU =FinProd(n→ τ ,WU )i hWU :n→τ i hx
S
∈ succ(n)→ τ ihave ∀ i∈succ(n). x(i) ∈ W(i) using func1_1_L1 FinProd_def init_props
append_props
by simpS
ultimately have x ∈ FinProd(succ(n)→ τ ,W) using FinProd_def
by simpS} thus B ⊆ FinProd(succ(n)→ τ ,W) by autonext
S{ fix x assume x ∈ FinProd(succ(n)→τ ,W)Sthen have x:succ(n)→ τ and I: ∀ i ∈ domain(W). x(i) ∈ W(i)using FinProd_def by auto
moreover have Init(x) ∈ U
proof S
S
from A2 and hx:succ(n)→ τ i have Init(x):n→ τ using init_props
by simpmoreover have ∀ i∈domain(WU ). Init(x)(i) ∈ WU (i)proof S
from A2 hx ∈ FinProd(succ(n)→ τ ,W)i hW:succ(n)→τ i have ∀ i∈n.
x(i) ∈ W(i)using FinProd_def func1_1_L1 S
by simpmoreover from A2 hx: succ(n)→ τ i have ∀ i∈n. Init(x)(i)= x(i)
using init_props by simp
moreover from A4 and hWU :n→τ i have ∀ i∈n. W(i) = WU (i)using append_props by simp

673

ultimately have ∀ i∈n. Init(x)(i) ∈ WU (i) by simp
with hWU :n→τ i show thesis using func1_1_L1 by simp
qedS
ultimately have Init(x) ∈ FinProd(n→ τ ,WU ) using FinProd_def
by simpS
with hU =FinProd(n→ τ ,WU )i show thesis by simp
qed
moreover have x(n) ∈ V
proof from hW:succ(n)→τ i I have x(n) ∈ W(n) using func1_1_L1 bysimp
moreover from A4 hWU :n→τ i have W(n) = V using append_props
by simpultimately show thesis by simp
qed
ultimately have x∈B byS simp
} thus FinProd(succ(n)→ τ ,W) ⊆ B by autoqed
moreover from A1 A2 haveS
ProductTopBase(succ(n),τ ) = {FinProd(succ(n)→ τ ,W). W∈succ(n)→τ }using fin_prod_def_nat by simp
ultimately show thesis by autoqed

If U is open in X n and V is open in X, then U × V is open in X n+1 . The
next lemma is an analogue of this fact for the function space approach.
lemma finite_prod_succ: assumes A1: τ {is a topology} and A2: n ∈ nat
and
A3: U ∈ SeqProductTopology(n,τ) and A4: V∈τSshows {x ∈ succ(n)→ τ . Init(x) ∈ U ∧ x(n) ∈ V} ∈ SeqProductTopology(succ(n),τ )proof from A1 have ProductTopBase(n,τ ) {is a base for} SeqProductTopology(n,τ )and
I: ProductTopBase(succ(n),τ ) {is a base for} SeqProductTopology(succ(n),τ )and
II: SeqProductTopology(succ(n),τ ) {is a topology}
using seq_prod_top_is_top by autoSwith A3 have ∃ B ∈ Pow(ProductTopBase(n,τ )). U =B using Top_1_2_L1
by simpS
then obtain B where B ⊆ ProductTopBase(n,τ ) and U =B by auto
then have SSS{x:succ(n)→ τ . Init(x) ∈ U ∧ x(n) ∈ V} = ( B∈B.{x:succ(n)→ τ .
Init(x) ∈ B ∧ x(n) ∈ V})
by autohimoreover from A1 A2 A4
S B ⊆ ProductTopBase(n,τ ) have
∀ B∈B. ({x:succ(n)→ τ . Init(x) ∈ B ∧ x(n) ∈ V} ∈ ProductTopBase(succ(n),τ ))using finite_prod_succ_base by auto
with
S I II have
S
( B∈B.{x:succ(n)→ τ . Init(x) ∈ B ∧ x(n) ∈ V}) ∈ SeqProductTopology(succ(n),τ )674

using base_sets_open union_indexed_open by auto
ultimately show thesis by simp
qed

In the Topology_ZF_2 theory we define product topology of two topologicalspaces. The next lemma explains in what sense the topology on finite listsof length n of elements of topological space X can be thought as a modelof the product topology on the cartesian product of n copies of that space.
Namely, we show that the space of lists of length n + 1 of elements of X
is homeomorphic to the product topology (as defined in Topology_ZF_2) of
two spaces: the space of lists of length n and X. Recall
S that if B is a base(i.e. satisfies the base condition), then the collection { B|B ∈ P ow(B)} isa topology (generated by B).
theorem finite_top_prod_homeo: assumes A1: τ {is a topology} and A2:n ∈ nat andS
A3: f = {hx,hInit(x),x(n)ii. x ∈ succ(n)→ τ } and
A4: T = SeqProductTopology(n,τ ) andA5: S = SeqProductTopology(succ(n),τ )shows IsAhomeomorphism(S,ProductTopology(T,τ ),f)
proof let C = ProductCollection(T,τ )let B = ProductTopBase(succ(n),τ )from A1 A4 have T {is a topology} using seq_prod_top_is_top by simp
with A1 A5 have S {is a topology} and ProductTopology(T,τ ) {is atopology}using seq_prod_top_is_top Top_1_4_T1 by auto
moreoverS S
from assms have f ∈ bij( S, ProductTopology(T,τ ))using lists_cart_prod
seq_prod_top_is_top Top_1_4_T1 by simp
S
S
then have f:
S→ ProductTopology(T,τ ) using bij_is_fun by simp
ultimately have two_top_spaces0(S,ProductTopology(T,τ ),f) using two_top_spaces0_def
by simp
S S
moreover note hf ∈ bij( S, ProductTopology(T,τ ))i
moreover from A1 A5 have B {is a base for} S
using seq_prod_top_is_top by simp
moreover from A1 hT {is a topology}i have C {is a base for} ProductTopology(T,τ )using Top_1_4_T1 by auto
moreover have ∀ W∈C. f-(W) ∈ S
proof
fix W assume W∈Cthen obtain U V where U∈T V∈τ and W = U×V using ProductCollection_def
by autoS
SS
S
from A1 A5 hf:
S→ ProductTopology(T,τ )i have f: (succ(n)→ τ )→ ProductTopology(
using seq_prod_top_is_top by simp
with assms hW = U×Vi hU∈Ti hV∈τ i show f-(W) ∈ S
using ZF_fun_from_tot_val func1_1_L15 finite_prod_succ by simp

675

qed
moreover have ∀ V∈B. f(V) ∈ ProductTopology(T,τ )proof
fix V assume V∈B
S
with A1 A2 obtain WV where WV ∈ succ(n)→τ and V = FinProd(succ(n)→ τ ,WV )using fin_prod_def_nat
by autoS
let U = FinProd(n→ τ ,Init(WV ))let W = WV (n)have U ∈ T
proof from A1 A2 hWV ∈ succ(n)→τ i have U ∈ ProductTopBase(n,τ )using fin_prod_def_nat init_props by autowith A1 A4 show thesis using seq_prod_top_is_top base_sets_open
by blast
qedfrom A1 hWV ∈ succ(n)→τ i hT {is a topology}i hU ∈ Ti have U×W ∈ ProductTopology(T,τ )using apply_funtype prod_open_open_prod by simp
moreover have f(V) = U×Wproof from A2 hWV : succ(n)→τ i have Init(WV ): n→τ and III: ∀ k∈n. Init(WV )(k)= WV (k)using init_props by auto
then have domain(Init(WV )) = n using func1_1_L1 by simp
have f(V) = {hInit(x),x(n)i. x∈V}
proof have f(V) = {f(x). x∈V}
proof from A1 A5 have B {is a base for} S using seq_prod_top_is_top
by simpS
i have V ⊆with hV∈BS
S using IsAbaseFor_def by autoSwith hf:
S→ ProductTopology(T,τ )i show thesis using func_imagedef
by simpqed
moreover have ∀ x∈V. f(x) = hInit(x),x(n)i
proof S
S
from A1 A3 A5 hV = FinProd(succ(n)→ τ ,WV )i have V ⊆S andfdef: f = {hx,hInit(x),x(n)ii. x ∈SS} using seq_prod_top_is_top

FinProd_def
by autoS
S
S
from hf:
S→ ProductTopology(T,τ )i fdef have ∀ x ∈S. f(x)= hInit(x),x(n)iby (ruleSZF_fun_from_tot_val0)
with hV ⊆Si show thesis by autoqed
ultimately show thesis by simp
qedalso have {hInit(x),x(n)i. x∈V} = U×W

676

proof{ fix y assume y ∈ {hInit(x),x(n)i. x∈V}then obtain x where I: y = hInit(x),x(n)i and x∈V by autoSwith hV = FinProd(succ(n)→τ ,WV )i haveS
x:succ(n)→ τ and II: ∀ k∈domain(WV ). x(k) ∈ WV (k)unfolding FinProd_def by autowith A2 hWV : succ(n)→τ i have IV: ∀ k∈n. Init(x)(k) = x(k)using init_props by simp
have Init(x) ∈ U
proof S
S
from A2 hx:succ(n)→ τ i have Init(x): n→ τ using init_props
by simpmoreover have ∀ k∈domain(Init(WV )). Init(x)(k) ∈ Init(WV )(k)proof from A2 hWV : succ(n)→τ i have Init(WV ): n→τ using init_props
by simpthen have domain(Init(WV )) = n using func1_1_L1 by simp
note III IV hdomain(Init(WV )) = nimoreover from II hWV ∈ succ(n)→τ i have ∀ k∈n. x(k) ∈ WV (k)using func1_1_L1 by simp
ultimately show thesis by simp
qed
ultimately show Init(x) ∈ U using FinProd_def by simp
qed
moreover from hWV : succ(n)→τ i II have x(n) ∈ W using func1_1_L1
by simpultimately have hInit(x),x(n)i ∈ U×W by simp
with I have y ∈ U×W by simp
} thus {hInit(x),x(n)i. x∈V} ⊆ U×W by auto
{ fix y assume y ∈ U×Wthen have fst(y) ∈ U and snd(y) ∈ W by autoSwith hdomain(Init(WV )) = ni have fst(y): n→ τ andV: ∀ k∈n. fst(y)(k) ∈ Init(WV )(k)using FinProd_def by autofrom hWV : succ(n)→τ i have W ∈ τSusing apply_funtype by simp
with hsnd(y) ∈ Wi have snd(y) ∈τ by auto
let x = Append(fst(y),snd(y))
have x∈V
proof S
S
S
from hfst(y): n→ τ i hsnd(y) ∈τ i have x:succ(n)→ τ using append_props by simp
moreover have ∀ i∈domain(WV ). x(i) ∈ WV (i)proof S
S
from hfst(y): n→ τ i hsnd(y) ∈τihave ∀ k∈n. x(k) = fst(y)(k) and x(n) = snd(y)using append_props by auto
moreover from III V have ∀ k∈n. fst(y)(k) ∈ WV (k) by simp

677

moreover note hsnd(y) ∈ Wi
ultimately have ∀ i∈succ(n). x(i) ∈ WV (i) by simp
with hWV ∈ succ(n)→τ i show thesis using func1_1_L1 by
simp
qed
S
ultimately have x ∈ FinProd(succ(n)→ τ ,WV ) using FinProd_def
by simpS
with hV = FinProd(succ(n)→ τ ,WV )i show x∈V by simp
qed
SS
moreover from A2 hy ∈ U×Wi hfst(y): n→ τ i hsnd(y) ∈τ i havey = hInit(x),x(n)iusing init_append append_props by auto
ultimately have y ∈ {hInit(x),x(n)i. x∈V} by auto
} thus U×W ⊆ {hInit(x),x(n)i. x∈V} by autoqed
finally show f(V) = U×W by simp
qed
ultimately show f(V) ∈ ProductTopology(T,τ ) by simp
qed
ultimately show thesis using two_top_spaces0.bij_base_open_homeo by
simp
qed

end

54

Topology 4

theory Topology_ZF_4 imports Topology_ZF_1 Order_ZF func1 NatOrder_ZF
begin

This theory deals with convergence in topological spaces. Contributed by
Daniel de la Concepcion.

54.1

Nets

Nets are a generalization of sequences. It is known that sequences do not
determine the behavior of the topological spaces that are not first countable; i.e., have a countable neighborhood base for each point. To solve thisproblem, nets were defined so that the behavior of any topological space canbe thought in terms of convergence of nets.
First we need to define what a directed set is:definition
IsDirectedSet (_ directs _ 90)
where r directs D ≡ refl(D,r) ∧ trans(r) ∧ (∀ x∈D. ∀ y∈D. ∃ z∈D. hx,zi∈r∧ hy,zi∈r)678

Any linear order is a directed set; in particular (N, ≤).
lemma linorder_imp_directed:
assumes IsLinOrder(X,r)
shows r directs X
proof from assms have trans(r) using IsLinOrder_def by auto
moreoverfrom assms have r:refl(X,r) using IsLinOrder_def total_is_refl by auto
moreover{fix x yassume R: x∈X y∈Xwith assms have hx,yi∈r ∨ hy,xi∈r using IsLinOrder_def IsTotal_def
by autowith r have (hx,yi∈r ∧ hy,yi∈r)∨(hy,xi∈r ∧ hx,xi∈r) using R refl_def
by autothen have ∃ z∈X. hx,zi∈r ∧ hy,zi∈r using R by auto}
ultimately show thesis using IsDirectedSet_def function_def by autoqed

Natural numbers are a directed set.
corollary Le_directs_nat:
shows IsLinOrder(nat,Le) Le directs nat
proof show IsLinOrder(nat,Le) by (rule NatOrder_ZF_1_L2)
then show Le directs nat using linorder_imp_directed by autoqed

We are able to define the concept of net, now that we now what a directed
set is.
definition
IsNet (_ {is a net on} _ 90)
where N {is a net on} X ≡ fst(N):domain(fst(N))→X ∧ (snd(N) directs
domain(fst(N))) ∧ domain(fst(N))6=0

Provided a topology and a net directed on its underlying set, we can talkabout convergence of the net in the topology.
definition (in topology0)
NetConverges (_ →N _ 90)
S
whereT =⇒ N →N x ≡S N {is a net on}
S(x∈ T) ∧ (∀ U∈Pow( T). (x∈int(U) −→ (∃ t∈domain(fst(N)). ∀ m∈domain(fst(N)).
(ht,mi∈snd(N) −→ fst(N)m∈U))))One of the most important directed sets, is the neighborhoods of a point.
theorem (in topology0)
directedset_neighborhoods:
S
assumes x∈ T

679

S
defines Neigh≡{U∈Pow( T). x∈int(U)}defines r≡{hU,Vi∈(Neigh × Neigh). V⊆U}
shows r directs Neighproof {
fix U
assume U ∈ Neighthen have hU,Ui ∈ r using r_def by auto}
then have refl(Neigh,r) using refl_def by auto
moreover{fix U V W
assume hU,Vi ∈ r hV,Wi ∈ rthen have U ∈ Neigh W ∈ Neigh W⊆U using r_def by auto
then have hU,Wi∈r using r_def by auto}
then have trans(r) using trans_def by blast
moreover{fix A Bassume p: A∈Neigh B∈Neighhave A∩B ∈ Neighproof S
from p have A∩B ∈ Pow( T) using Neigh_def by auto
moreover{ from p have x∈int(A)x∈int(B) using Neigh_def by auto
then have x∈int(A)∩int(B) by auto
moreover{ have int(A)∩int(B)⊆A∩B using Top_2_L1 by auto
moreover have int(A)∩int(B)∈T
using Top_2_L2 Top_2_L2 topSpaceAssum IsATopology_def by blast
ultimately have int(A)∩int(B)⊆int(A∩B)
using Top_2_L5 by auto}
ultimately have x ∈ int(A∩B) by auto}
ultimately show thesis using Neigh_def by autoqed
moreover from hA∩B ∈ Neighi have hA,A∩Bi∈r ∧ hB,A∩Bi∈rusing r_def p by auto
ultimately
have ∃ z∈Neigh. hA,zi∈r ∧ hB,zi∈r by auto}
ultimately show thesis using IsDirectedSet_def by autoqed

There can be nets directed by the neighborhoods that converge to the point;
if there is a choice function.

680

theorem (in topology0)
net_direct_neigh_converg:
Sassumes x∈ T
Sdefines Neigh≡{U∈Pow( T). x∈int(U)}defines r≡{hU,Vi∈(Neigh× Neigh). V⊆U}
S
assumes f:Neigh→ T ∀ U∈Neigh. f(U) ∈ Ushows hf,ri →N x
proof from assms(4) have dom_def: Neigh = domain(f) using Pi_def by auto
moreoverS
have
T∈T using
IsATopology_def by auto
S topSpaceAssumS
then have int( T)= S T using Top_2_L3 by autowith assms(1)T∈Neigh using Neigh_def by auto
S havethen haveT∈domain(fst(hf,ri)) using dom_def by autoS
moreover from assms(4) dom_def have fst(hf,ri):domain(fst(hf,ri))→ T
by automoreover from assms(1,2,3) dom_def have snd(hf,ri) directs domain(fst(hf,ri))using directedset_neighborhoods by simp
Sultimately have Net: hf,ri {is a net on}
T unfolding IsNet_def by
auto
{
fix U
S
assume U ∈ Pow( T) x ∈ int(U)then have U ∈ Neigh using Neigh_def by auto
then have t: U ∈ domain(f) using dom_def by auto{
fix W
assume A: W∈domain(f) hU,Wi∈rthen have W∈Neigh using dom_def by autowith assms(5) have fW∈W by autowith A(2) r_def have fW∈U by auto}
then have ∀ W∈domain(f). (hU,Wi∈r −→ fW∈U) by autowith t have ∃ V∈domain(f). ∀ W∈domain(f). (hV,Wi∈r −→ fW∈U) by auto}S
then have ∀ U∈Pow( T). (x∈int(U) −→ (∃ V∈domain(f). ∀ W∈domain(f).
(hV,Wi∈r −→ f(W) ∈ U)))by autowith assms(1) Net show thesis using NetConverges_def by auto
qed

54.2

Filters

Nets are a generalization of sequences that can make us see that not all
topological spaces can be described by sequences. Nevertheless, nets are notalways the tool used to deal with convergence. The reason is that they makeuse of directed sets which are completely unrelated with the topology.

681

The topological tools to deal with convergence are what is called filters.
definition
IsFilter (_ {is a filter on} _ 90)
where F {is a filter on} X ≡ (0∈F)/∧ (X∈F) ∧ (F⊆Pow(X)) ∧(∀ A∈F. ∀ B∈F. A∩B∈F) ∧ (∀ B∈F. ∀ C∈Pow(X). B⊆C −→ C∈F)

Not all the sets of a filter are needed to be consider at all times; as it happens
with a topology we can consider bases.
definition
IsBaseFilter (_ {is a base filter} _ 90)
S
where C {is a base filter} F ≡ C⊆F ∧ F={A∈Pow( F). (∃ D∈C. D⊆A)}

Not every set is a base for a filter, as it happens with topologies, there is acondition to be satisfied.
definition
SatisfiesFilterBase (_ {satisfies the filter base condition} 90)
where C {satisfies the filter base condition} ≡ (∀ A∈C. ∀ B∈C. ∃ D∈C.
D⊆A∩B) ∧ C6=0 ∧ 0∈C/

Every set of a filter contains a set from the filter’s base.
lemma basic_element_filter:
assumes A∈F and C {is a base filter} Fshows ∃ D∈C. D⊆A
proof S
from assms(2) have t:F={A∈Pow( F). (∃ D∈C. D⊆A)} using IsBaseFilter_def
by autoSwith assms(1) have
S A∈{A∈Pow( F). (∃ D∈C. D⊆A)} by auto
then have A∈Pow( F) ∃ D∈C. D⊆A by auto
then show thesis by autoqed

The following two results state that the filter base condition is necessary
and sufficient for the filter generated by a base, to be an actual filter. The
third result, rewrites the previous two.
theorem basic_filter_1:
assumes C {is a base filter}
S F and C {satisfies the filter base condition}shows F {is a filter on}
F
proof {
fix A Bassume AF: A∈F and BF: B∈Fwith assms(1) have ∃ DA∈C. DA⊆A using basic_element_filter by simp
then obtain DA where perA: DA∈C and subA: DA⊆A by autofrom BF assms have ∃ DB∈C. DB⊆B using basic_element_filter by simp
then obtain DB where perB: DB∈C and subB: DB⊆B by autofrom assms(2) perA perB have ∃ D∈C. D⊆DA∩DB
unfolding SatisfiesFilterBase_def by auto682

then obtain D where D∈C D⊆DA∩DB by autoSwith subA subB AF BF have A∩B∈{A ∈ Pow( F) . ∃ D∈C. D ⊆ A} by autowith assms(1) have A∩B∈F unfolding IsBaseFilter_def by auto}
moreover{fix A BS
assume AF: A∈F and BS: B∈Pow( F) and sub: A⊆B
from assms(1) AF have ∃ D∈C. D⊆A using basic_element_filter by auto
then obtain D where D⊆A D∈CS by autowith sub BS have B∈{A∈Pow( F). ∃ D∈C. D⊆A} by autowith assms(1) have B∈F unfolding IsBaseFilter_def by auto}
moreoverfrom assms(2) have C6=0 using SatisfiesFilterBase_def by auto
then obtain D where D∈C
S by autowith assms(1) haveD⊆
F using
IsBaseFilter_def by auto
S
S
with hD∈Ci haveF∈{A∈Pow(F).
∃ D∈C. D⊆A} by autoSwith assms(1) haveF∈F unfolding IsBaseFilter_def by auto
moreover{assume 0∈Fwith assms(1) have ∃ D∈C. D⊆0 using basic_element_filter by simp
then obtain D where D∈CD⊆0 by auto
then have D∈C D=0 by autowith assms(2) have False using SatisfiesFilterBase_def by auto}
then have 0∈F/ by auto
ultimately show thesis using IsFilter_def by autoqed

A base filter satisfies the filter base condition.
theorem basic_filter_2:
Sassumes C {is a base filter} F and F {is a filter on}Fshows C {satisfies the filter base condition}
proof {
fix A Bassume AF: A∈C and BF: B∈Cthen have A∈F and B∈F using assms(1) IsBaseFilter_def by auto
then have A∩B∈F using assms(2) IsFilter_def by auto
then have ∃ D∈C. D⊆A∩B using assms(1) basic_element_filter by blast}
then have ∀ A∈C. ∀ B∈C. ∃ D∈C. D⊆A∩B by auto
moreover{assume 0∈Cthen have 0∈F using assms(1) IsBaseFilter_def by auto683

then have False using assms(2) IsFilter_def by auto}
then have 0∈C/ by auto
moreover{assume C=0
then have F=0 using assms(1) IsBaseFilter_def by auto
then have False using assms(2) IsFilter_def by auto}
then have C6=0 by auto
ultimately show thesis using SatisfiesFilterBase_def by autoqed

A base filter for a collection satisfies the filter base condition iff that collection is in fact a filter.
theorem basic_filter:
assumes C {is a base filter} F
shows(C {satisfies the filter base condition}) ←→ (F {is a filter
Son}F)using assms basic_filter_1 basic_filter_2 by auto

A base for a filter determines a filter up to the underlying set.
theorem base_unique_filter:
assumes C {is a base
F1and C {is a base filter} F2
S filter}S
shows F1=F2 ←→F1= F2using assms unfolding IsBaseFilter_def by auto

Suppose that we take any nonempty collection C of subsets of some set X.
Then this collection is a base filter for the collection of all supersets (in X)
of sets from C.
theorem base_unique_filter_set1:
assumes C ⊆ Pow(X) and C6=0
S
shows C {is a base filter} {A∈Pow(X). ∃ D∈C. D⊆A} and{A∈Pow(X).
∃ D∈C. D⊆A}=X
proof from assms(1) have C⊆{A∈Pow(X). ∃ D∈C. D⊆A} by auto
moreoverfrom assms(2) obtain D where D∈C by auto
then have D⊆X using assms(1) by autowith hD∈Ci have
X∈{A∈Pow(X). ∃ D∈C. D⊆A} by autoS
then show{A∈Pow(X). ∃ D∈C. D⊆A}=X by auto
ultimately
show C {is a base filter} {A∈Pow(X). ∃ D∈C. D⊆A} using IsBaseFilter_def
by autoqed

A collection C that satisfies the filter base condition is a base filter for someother collection F iff F is the collection of supersets of C.
684

theorem base_unique_filter_set2:
assumes C⊆Pow(X) and C {satisfies Sthe filter base condition}shows ((C {is a base filter} F) ∧F=X) ←→ F={A∈Pow(X). ∃ D∈C. D⊆A}
using assms IsBaseFilter_def SatisfiesFilterBase_def base_unique_filter_set1
by autoA simple corollary from the previous lemma.
corollary base_unique_filter_set3:
assumes C⊆Pow(X) and C {satisfies the filter base condition}
Sshows C {is a base filter} {A∈Pow(X). ∃ D∈C. D⊆A} and{A∈Pow(X).
∃ D∈C. D⊆A} = X
proof let F = {A∈Pow(X). ∃ D∈C. D⊆A}
S
from assms have (C {is a base filter} F) ∧F=X
using base_unique_filter_set2 bysimp
Sthus C {is a base filter} F and
F = X
by autoqed

The convergence for filters is much easier concept to write. Given a topology and a filter on the same underlying set, we can define convergence as
containing all the neighborhoods of the point.
definition (in topology0)
FilterConverges (_S →F _ 50) whereF{isS a filter on}S T =⇒ F→F x ≡x∈ T ∧ ({U∈Pow( T). x∈int(U)} ⊆ F)

The neighborhoods of a point form a filter that converges to that point.
lemma (in topology0)
neigh_filter:S
assumes x∈ T
Sdefines Neigh≡{U∈Pow( T). x∈int(U)}Sshows Neigh {is a filter on} T and Neigh →F x
proof {
fix A Bassume p:A∈Neigh B∈Neighhave A∩B∈Neighproof S
from p have A∩B∈Pow( T) using Neigh_def by auto
moreover{from p have x∈int(A) x∈int(B) using Neigh_def by auto
then have x∈int(A)∩int(B) by auto
moreover{ have int(A)∩int(B)⊆A∩B using Top_2_L1 by auto
moreover have int(A)∩int(B)∈T
using Top_2_L2 topSpaceAssum IsATopology_def by blast
ultimately have int(A)∩int(B)⊆int(A∩B) using Top_2_L5 by auto}
ultimately have x∈int(A∩B) by auto

685

}
ultimately show thesis using Neigh_def by autoqed}
moreover{fix A BS
assume A: A∈Neigh and B: B∈Pow( T) and sub: A⊆B
from sub have int(A)∈T int(A)⊆B using Top_2_L2 Top_2_L1
by autothen have int(A)⊆int(B) using Top_2_L5 by autowith A have x∈int(B) using Neigh_def by autowith B have B∈Neigh using Neigh_def by auto}
moreover{assume 0∈Neighthen have x∈Interior(0,T) using Neigh_def by auto
then have x∈0 using Top_2_L1 by auto
then have False by auto}
then have 0∈Neigh/by automoreoverS
have
T∈T using topSpaceAssum
IsATopology_def by auto
S
S
then have Interior( T,T)=
T
using
Top_2_L3 by autoSwith assms(1) have ab:
T∈Neigh
unfolding
Neigh_def by autoS
moreover have Neigh⊆Pow( T) using Neigh_def
by autoS
ultimately show Neigh {is a filter on}
T using IsFilter_def
by autoS
S
moreover from ab have
Neigh= T unfolding Neigh_def by auto
ultimately show Neigh →F x using FilterConverges_def assms(1) Neigh_def
by autoqed

Note that with the net we built in a previous result, it wasn’t clear that we
could construct an actual net that converged to the given point without theaxiom of choice. With filters, there is no problem.
Another positive point of filters is due to the existence of filter basis. If
we have a basis for a filter, then the filter converges to a point iff every
neighborhood of that point contains a basic filter element.
theorem (in topology0) convergence_filter_base1:
S
assumes F {is a filter on}
T and C {is a base filter} F and F →Fx
S
S
shows ∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U) and x∈ T
proof { fix U
Sassume U⊆( T) and x∈int(U)with assms(1,3) have U∈F using FilterConverges_def by auto

686

with assms(2)Shave ∃ D∈C. D⊆U using basic_element_filter by blast} thus ∀ U∈Pow( T). x∈int(U)−→ (∃ D∈C. D⊆U) by auto
S
from assms(1,3) show x∈ T using FilterConverges_def by autoqed

A sufficient condition for a filter to converge to a point.
theorem (in topology0) convergence_filter_base2:
S
assumes F {is Sa filter on}
T and C {is a base filter}S F
and ∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U) and x∈ Tshows F →F x
proof {
fix U
S
assume AS: U∈Pow( T) x∈int(U)then obtain D where pD:D∈C and s:D⊆U using assms(3)by blast
Swith assms(2) AS have D∈F and D⊆U and U∈Pow( T)using IsBaseFilter_def by autowith assms(1) have U∈F using IsFilter_def by auto}with assms(1,4) show thesis using FilterConverges_def by autoqed

A necessary and sufficient condition for a filter to converge to a point.
theorem (in topology0) convergence_filter_base_eq:
Sassumes F {is a filter on}
T Sand C {is a base filter} F
Sshows (F →F x) ←→ ((∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U)) ∧ x∈ T)
proofassume F →F x
SSwith assms show ((∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U)) ∧ x∈ T)
using convergence_filter_base1 by simp
next
SS
assume (∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U)) ∧ x∈ Twith assms show F →F x using convergence_filter_base2
by autoqed

54.3

Relation between nets and filters

In this section we show that filters do not generalize nets, but still nets andfilter are in w way equivalent as far as convergence is considered.
Let’s build now a net from a filter, such that both converge to the same
points.
definition
NetOfFilter (Net(_) S40) whereF {is a filter on}
F =⇒S Net(F) ≡S
S
h{hA,fst(A)i. A∈{hx,Fi∈( F)×F. x∈F}},{hA,Bi∈{hx,Fi∈( F)×F. x∈F}×{hx,Fi∈( F)×F.
x∈F}. snd(B)⊆snd(A)}i

687

Net of a filter is indeed a net.
theorem net_of_filter_is_net:
assumes F {is a filter on} X
shows (Net(F)) {is a net on} X
proof from assms have
S X∈F F⊆Pow(X) using IsFilter_def by auto
then have uu: F=X by blast S
let f = {hA,fst(A)i. A∈{hx,Fi∈(
F)×F. x∈F}} S
S
let r = {hA,Bi∈{hx,Fi∈( F)×F. x∈F}×{hx,Fi∈( F)×F. x∈F}. snd(B)⊆snd(A)}have function(f) using function_def by auto
moreover have relation(f) using relation_def by auto
ultimately have f:domain(f)→range(f) using function_imp_Pi
by autoS
have dom:domain(f)={hx,Fi∈(
F)×F. x∈F} by autoS
have range(f)⊆ F by autoSwith hf:domain(f)→range(f)i have f:domain(f)→ F using fun_weaken_typeby automoreover{{fix t
assume pp:t∈domain(f)then have snd(t)⊆snd(t) by autowith dom pp have ht,ti∈r by auto}
then have refl(domain(f),r) using refl_def by auto
moreover{fix t1 t2 t3
assume ht1,t2i∈r ht2,t3i∈rthen have snd(t3)⊆snd(t1) t1∈domain(f) t3∈domain(f) using dom
by autothen have ht1,t3i∈r by auto}
then have trans(r) using trans_def by auto
moreover{fix x yassume as:x∈domain(f)y∈domain(f)then have snd(x)∈F snd(y)∈F by auto
then have p:snd(x)∩snd(y)∈F using assms IsFilter_def by auto{
assume snd(x)∩snd(y)=0with p have 0∈F by auto
then have False using assms IsFilter_def by auto}
then have snd(x)∩snd(y)6=0 by auto
then obtain xy where xy∈snd(x)∩snd(y) by auto S
then have xy∈snd(x)∩snd(y) hxy,snd(x)∩snd(y)i∈( F)×F using p

688

by autoS
then have hxy,snd(x)∩snd(y)i∈{hx,Fi∈( F)×F. x∈F} by autowith dom have d:hxy,snd(x)∩snd(y)i∈domain(f) by autowith as have hx,hxy,snd(x)∩snd(y)ii∈r ∧ hy,hxy,snd(x)∩snd(y)ii∈rby autowith d have ∃ z∈domain(f). hx,zi∈r ∧ hy,zi∈r by blast}
then have ∀ x∈domain(f). ∀ y∈domain(f). ∃ z∈domain(f). hx,zi∈r ∧ hy,zi∈rby blast
ultimately have r directs domain(f) using IsDirectedSet_def by blast}
moreover{have p:X∈F and 0∈F/ using assms IsFilter_def by auto
then have X6=0 by auto
then obtain q where q∈X by autowith p dom have hq,Xi∈domain(f) by auto
then have domain(f)6=0 by blast}
S
ultimately have hf,ri {is a net on} F using IsNet_def by auto
then show (Net(F)) {is a net on} X using NetOfFilter_def assms uu by
auto
qed

If a filter converges to some point then its net converges to the same point.
theorem (in topology0) filter_conver_net_of_filter_conver:S
assumes F {is a filter on}
T and F →F x
shows (Net(F)) →N x
proof S
S
from assms haveT∈F F⊆Pow( T) using IsFilter_def by auto
S S
then have uu:
F= T by blast
Sfrom assms(1) have func: fst(Net(F))={hA,fst(A)i. A∈{hx,Fi∈( F)×F.
x∈F}}
S
S
and dir: snd(Net(F))={hA,Bi∈{hx,Fi∈( F)×F. x∈F}×{hx,Fi∈( F)×F.
x∈F}. snd(B)⊆snd(A)}using NetOfFilter_def uu by autoS
then have dom_def: domain(fst(Net(F)))={hx,Fi∈(
F)×F. x∈F}S by auto
S
from func have fun: fst(Net(F)): {hx,Fi∈( F)×F. x∈F} → ( F)using ZF_fun_from_total by simp
S
from assms(1) have NN: (Net(F)) {is a net on} T using net_of_filter_is_net
by autoS
moreover from assms have x∈ T using FilterConverges_def
by automoreover{fix U
Sassume AS: U∈Pow( T) x∈int(U)with assms have U∈F x∈U using Top_2_L1 FilterConverges_def by auto689

then have pp: hx,Ui∈domain(fst(Net(F))) using dom_def by auto{
fix massume ASS: m∈domain(fst(Net(F))) hhx,Ui,mi∈snd(Net(F))
from ASS(1) fun func have fst(Net(F))(m) = fst(m)using func1_1_L1 ZF_fun_from_tot_val by simp
with dir ASS have fst(Net(F))(m) ∈ U using dom_def by auto}
then have ∀ m∈domain(fst(Net(F))). (hhx,Ui,mi∈snd(Net(F)) −→ fst(Net(F))m∈U)
by autowith pp have ∃ t∈domain(fst(Net(F))). ∀ m∈domain(fst(Net(F))). (ht,mi∈snd(Net(F))−→ fst(Net(F))m∈U)
by auto}S
then have ∀ U∈Pow( T).
(x∈int(U) −→ (∃ t∈domain(fst(Net(F))). ∀ m∈domain(fst(Net(F))).
(ht,mi∈snd(Net(F)) −→ fst(Net(F))m∈U)))by autoultimately show thesis using NetConverges_def by autoqed

If a net converges to a point, then a filter also converges to a point.
theorem (in topology0) net_of_filter_conver_filter_conver:S
assumes F {is a filter on} T and (Net(F)) →N x
shows F →F x
proof S
S
from assms haveT∈F F⊆Pow( T) using IsFilter_def by auto
S S
then have
F= T by blast
S uu:
have x∈ T using assms NetConverges_def net_of_filter_is_net by auto
moreover{fix U
Sassume U∈Pow( T) x∈int(U)then obtain t where t: t∈domain(fst(Net(F))) andreg: ∀ m∈domain(fst(Net(F))). ht,mi∈snd(Net(F)) −→ fst(Net(F))m∈U
using assms net_of_filter_is_net NetConverges_def by blast
with assms(1) uu obtain t1 t2 where t_def: t=ht1,t2i and t1∈t2 andtFF: t2∈Fusing NetOfFilter_def by auto{
fix s
assume s∈t2
Sthen have hs,t2i∈{hq1,q2i∈ F×F. q1∈q2} using tFF by auto
moreoverS
from assms(1) uu have domain(fst(Net(F)))={hq1,q2i∈ F×F. q1∈q2}
using NetOfFilter_def
by autoultimately
have tt: hs,t2i∈domain(fst(Net(F))) by auto690

moreoverfrom assms(1) uu t t_def tt have hht1,t2i,hs,t2ii∈snd(Net(F)) using NetOfFilter_def
by autoultimately
have fst(Net(F))hs,t2i∈U using reg t_def by auto
moreoverfrom assms(1) uu have function(fst(Net(F))) using NetOfFilter_def
function_def
by automoreoverfrom tt assms(1) uu have hhs,t2i,si∈fst(Net(F)) using NetOfFilter_def
by autoultimately
have s∈U using NetOfFilter_def function_apply_equality by auto}
then have t2⊆U by auto S
with tFF assms(1) hU∈Pow( T)i have U∈F using IsFilter_def by auto}S
then have {U∈Pow( T). x∈int(U)} ⊆ F by auto
ultimately
show thesis using FilterConverges_def assms(1) by autoqed

A filter converges to a point if and only if its net converges to the point.
theorem (in topology0) filter_conver_iff_net_of_filter_conver:S
assumes F {is a filter on} Tshows (F →F x) ←→ ((Net(F)) →N x)
using filter_conver_net_of_filter_conver net_of_filter_conver_filter_converassms
by autoThe previous result states that, when considering convergence, the filters do
not generalize nets. When considering a filter, there is always a net thatconverges to the same points of the original filter.
Now we see that with nets, results come naturally applying the axiom of
choice; but with filters, the results come, may be less natural, but withno choice. The reason is that Net(F) is a net that doesn’t come into ourattention as a first choice; maybe because we restrict ourselves to the antisymmetry property of orders without realizing that a directed set is not anorder.
The following results will state that filters are not just a subclass of nets,
but that nets and filters are equivalent on convergence: for every filter there
is a net converging to the same points, and also, for every net there is a filter
converging to the same points.
definition
FilterOfNet (Filter (_ .. _) 40) where691

(N {is a net on} X) =⇒ Filter N..X ≡ {A∈Pow(X). ∃ D∈{{fst(N)snd(s).
s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N) ∧ fst(s)=t0}}. t0∈domain(fst(N))}.
D⊆A}

Filter of a net is indeed a filter
theorem filter_of_net_is_filter:
assumes N {is a net on} X
shows (Filter N..X) {is a filter on} X and{{fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N) ∧ fst(s)=t0}}.
t0∈domain(fst(N))} {is a base filter} (Filter N..X)
proof let C = {{fst(N)(snd(s)). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t0}}. t0∈domain(fst(N))}
have C⊆Pow(X)proof {
fix t
assume t∈Cthen obtain t1 where t1∈domain(fst(N)) and
t_Def: t={fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t1}}
by auto{fix x
assume x∈twith t_Def obtain ss where ss∈{s∈domain(fst(N))×domain(fst(N)).
s∈snd(N) ∧ fst(s)=t1} andx_def: x = fst(N)(snd(ss)) by blast
then have snd(ss) ∈ domain(fst(N)) by autofrom assms have fst(N):domain(fst(N))→X unfolding IsNet_def
by simpwith hsnd(ss) ∈ domain(fst(N))i have x∈X using apply_funtype
x_def
by auto}hence t⊆X by auto}
thus thesis by blast
qed
have sat: C {satisfies the filter base condition}
proof from assms obtain t1 where t1∈domain(fst(N)) using IsNet_def by
blast
hence {fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t1}}∈C
by autohence C6=0 by auto
moreover{692

fix Uassume U∈Cthen obtain q where q_dom: q∈domain(fst(N)) and
U_def: U={fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=q}}
by blastwith assms have hq,qi∈snd(N) ∧ fst(hq,qi)=q unfolding IsNet_def
IsDirectedSet_def refl_def
by autowith q_dom have hq,qi∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=q}
by autowith U_def have fst(N)(snd(hq,qi)) ∈ U by blast
hence U6=0 by auto}
then have 0∈C/ by auto
moreoverhave ∀ A∈C. ∀ B∈C. (∃ D∈C. D⊆A∩B)
proof
fix A
assume pA: A∈Cshow ∀ B∈C. ∃ D∈C. D⊆A∩B
proof
{
fix B
assume B∈Cwith pA obtain qA qB where per: qA∈domain(fst(N)) qB∈domain(fst(N))
andA_def: A={fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)).
s∈snd(N) ∧ fst(s)=qA}} and
B_def: B={fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)).
s∈snd(N) ∧ fst(s)=qB}}
by blast
have dir: snd(N) directs domain(fst(N)) using assms IsNet_def
by autowith per obtain qD where ine: hqA,qDi∈snd(N) hqB,qDi∈snd(N)andperD: qD∈domain(fst(N)) unfolding IsDirectedSet_def
by blastlet D = {fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=qD}}
from perD have D∈C by auto
moreover{fix dassume d∈Dthen obtain sd where sd∈{s∈domain(fst(N))×domain(fst(N)).
s∈snd(N) ∧ fst(s)=qD} andd_def: d=fst(N)snd(sd) by blast693

then have sdN: sd∈snd(N) and qdd: fst(sd)=qD and sd∈domain(fst(N))×domain(fstby autothen obtain qI aa where sd = haa,qIi qI ∈ domain(fst(N))
aa ∈ domain(fst(N))
by autowith qdd have sd_def: sd=hqD,qIi and qIdom: qI∈domain(fst(N))
by autowith sdN have hqD,qIi∈snd(N) by autofrom dir have trans(snd(N)) unfolding IsDirectedSet_def by
auto
then have hqA,qDi∈snd(N) ∧ hqD,qIi∈snd(N) −→ hqA,qIi∈snd(N)andhqB,qDi∈snd(N) ∧ hqD,qIi∈snd(N)−→hqB,qIi∈snd(N)using trans_def by autowith ine hhqD,qIi∈snd(N)i have hqA,qIi∈snd(N) hqB,qIi∈snd(N)by autowith qIdom per have hqA,qIi∈{s∈domain(fst(N))×domain(fst(N)).
s∈snd(N) ∧ fst(s)=qA}
hqB,qIi∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N) ∧ fst(s)=qB}
by autothen have fst(N)(qI) ∈ A∩B using A_def B_def by auto
then have fst(N)(snd(sd)) ∈ A∩B using sd_def by auto
then have d ∈ A∩B using d_def by auto}
then have D ⊆ A∩B by blast
ultimately show ∃ D∈C. D⊆A∩B by blast
}
qed
qed
ultimately
show thesis unfolding SatisfiesFilterBase_def by blast
qed
have
S
Base: C {is a base filter} {A∈Pow(X). ∃ D∈C. D⊆A}
{A∈Pow(X). ∃ D∈C.
D⊆A}=X
proof from hC⊆Pow(X)i sat show C {is a base filter} {A∈Pow(X). ∃ D∈C. D⊆A}
by (rule base_unique_filter_set3)
S
from hC⊆Pow(X)i sat show
{A∈Pow(X). ∃ D∈C. D⊆A}=X
by (rule base_unique_filter_set3)
qedwith sat show (Filter N..X) {is a filter on} X
using sat basic_filter FilterOfNet_def assms by autofrom Base(1) show C {is a base filter} (Filter N..X)
using FilterOfNet_def assms by auto
qed

694

Convergence of a net implies the convergence of the corresponding filter.
theorem (in topology0) net_conver_filter_of_net_conver:S
assumes N {is a net
T and N →N x
S on}shows (Filter N..( T)) →F x
proof let C = {{fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t}}.
t∈domain(fst(N))}
from assms(1) S
have
S(FilterSN..( T)) {is a filter on} ( T) and C {is a base filter}
Filter N..( T)using filter_of_net_is_filterby autoS
moreover have ∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U)
proof {
fix U
S
assume U∈Pow( T) x∈int(U)with assms have ∃ t∈domain(fst(N)). (∀ m∈domain(fst(N)). (ht,mi∈snd(N)−→ fst(N)m∈U))
using NetConverges_def by auto
then obtain t where t∈domain(fst(N)) andreg: ∀ m∈domain(fst(N)). (ht,mi∈snd(N) −→ fst(N)m∈U) by auto{
fix fassume f∈{fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)).
s∈snd(N) ∧ fst(s)=t}}
then obtain s where s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t} and
f_def: f=fst(N)snd(s) by blast
hence s∈domain(fst(N))×domain(fst(N)) and s∈snd(N) and fst(s)=t
by autohence s=ht,snd(s)i and snd(s)∈domain(fst(N)) by autowith hs∈snd(N)i reg have fst(N)snd(s)∈U by autowith f_def have f∈U by auto}
hence {fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t}} ⊆ Uby blastwith ht∈domain(fst(N))i have ∃ D∈C. D⊆U
by autoS} thus ∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U) by autoqedS
moreover from assms have x∈S T using NetConverges_def by auto
ultimately show (Filter N..( T)) →F x by (rule convergence_filter_base2)
qed

Convergence of a filter corresponding to a net implies convergence of the
net.
695

theorem (in topology0) filter_of_net_conver_net_conver:S
S
assumes N {is a net on}
T and (Filter N..( T)) →F x
shows N →N x
proof let C = {{fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=t}}.
t∈domain(fst(N))}
S
S
from assms have I: (Filter N..( T))S {is a filter on}S ( T)C {is a base filter} (Filter N..( T)) (Filter N..( T)) →F x
using filter_of_net_is_filterby autoS
then have reg: ∀ U∈Pow( T). x∈int(U) −→ (∃ D∈C. D⊆U)
by (rule convergence_filter_base1)
S
from I have x∈ T by (rule convergence_filter_base1)
moreover{fix U
Sassume U∈Pow( T) x∈int(U)with reg have ∃ D∈C. D⊆U by auto
then obtain D where D∈C D⊆U
by autothen obtain td where td∈domain(fst(N)) and
D_def: D={fst(N)snd(s). s∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N)∧ fst(s)=td}}
by auto{fix massume m∈domain(fst(N)) htd,mi∈snd(N)with htd∈domain(fst(N))i havehtd,mi∈{s∈domain(fst(N))×domain(fst(N)). s∈snd(N) ∧ fst(s)=td}
by autowith D_def have fst(N)m∈D by autowith hD⊆Ui have fst(N)m∈U by auto}
then have ∀ m∈domain(fst(N)). htd,mi∈snd(N) −→ fst(N)m∈U by autowith htd∈domain(fst(N))i have∃ t∈domain(fst(N)). ∀ m∈domain(fst(N)). ht,mi∈snd(N) −→ fst(N)m∈U
by auto}then haveS∀ U∈Pow( T). x∈int(U) −→(∃ t∈domain(fst(N)). ∀ m∈domain(fst(N)). ht,mi∈snd(N) −→ fst(N)m∈U)
by autoultimately show thesis using NetConverges_def assms(1) by autoqed

Filter of net converges to a point x if and only the net converges to x.
theorem (in topology0) filter_of_net_conv_iff_net_conv:
S
assumes N {is a netSon}
Tshows ((Filter N..( T)) →F x) ←→ (N →N x)

696

using assms filter_of_net_conver_net_conver net_conver_filter_of_net_conver
by autoWe know now that filters and nets are the same thing, when working convergence of topological spaces. Sometimes, the nature of filters makes it easierto generalized them as follows.
Instead of considering all subsets of some set X, we can consider only open
sets (we get an open filter) or closed sets (we get a closed filter). There aremany more useful examples that characterize topological properties.
This type of generalization cannot be done with nets.
Also a filter can give us a topology in the following way:
theorem top_of_filter:S
assumes F {is a filter on}Fshows (F ∪ {0}) {is a topology}
proof {
fix A Bassume A∈(F ∪ {0})B∈(F ∪ {0})then have (A∈F ∧ B∈F) ∨ (A∩B=0) by autowith assms have A∩B∈(F ∪ {0}) unfolding IsFilter_def
by blast}
then have ∀ A∈(F ∪ {0}). ∀ B∈(F ∪ {0}). A∩B∈(F ∪ {0}) by auto
moreover{fix M
assume A:M∈Pow(F ∪ {0})then have M=0∨M={0}∨(∃T∈M. T∈F) by blastSthen have
M=0∨(∃ T∈M.
S T∈F) by auto
then obtainS T where
M=0∨(T∈F∧ T∈M) by autoS
then have
M=0∨(T∈F ∧ T⊆ SM) by
S automoreover from this
A
have
M⊆
F by autoS
ultimately have
M∈(F∪{0}) using IsFilter_def assms by auto}S
then have ∀ M∈Pow(F∪{0}).
M∈(F∪{0}) by auto
ultimately show thesis using IsATopology_def by autoqed

We can use topology0 locale with filters.
lemma topology0_filter:S
assumes F {is a filter on}Fshows topology0(F ∪ {0})using top_of_filter topology0_def assms by auto

The next abbreviation introduces notation where we want to specify the
space where the filter convergence takes place.
697

abbreviation FilConvTop(_ →F _ {in} _)where F →F x {in} T ≡ topology0.FilterConverges(T,F,x)

The next abbreviation introduces notation where we want to specify the
space where the net convergence takes place.
abbreviation NetConvTop(_ →N _ {in} _)where N →N x {in} T ≡ topology0.NetConverges(T,N,x)

Each point of a the union of a filter is a limit of that filter.
lemma lim_filter_top_of_filter:
S
S
assumes F {is a filter on}
F and x∈ F
shows F →F x {in} (F∪{0})
proof - S S
have
F= (F∪{0}) by autoSwith assms(1) have assms1: F {is a filter on}(F∪{0}) by auto
{
fix U
S
assume U∈Pow( (F∪{0})) x∈Interior(U,(F∪{0}))with assms(1) have Interior(U,(F∪{0}))∈F using topology0_def top_of_filter
topology0.Top_2_L2 by blast
moreoverfrom assms(1) have Interior(U,(F∪{0}))⊆U using topology0_def top_of_filter
topology0.Top_2_L1 by auto
moreoverS
S
from hU∈Pow( (F∪{0}))i have U∈Pow( F) by auto
ultimately have U∈F using assms(1) IsFilter_def by auto}with assms assms1 show thesis using topology0.FilterConverges_def top_of_filter
topology0_def by auto
qed
end

55

Topology and neighborhoods

theory Topology_ZF_4a imports Topology_ZF_4
begin

This theory considers the relations between topology and systems of neighborhood filters.

55.1

Neighborhood systems

The standard way of defining a topological space is by specifying a collectionof sets that we consider ”open” (see the Topology_ZF theory). An alternativeof this approach is to define a collection of neighborhoods for each point of
the space.
698

We define a neighborhood system as a function that takes each point x ∈ X
and assigns it a collection of subsets of X which is called the neighborhoodsof x. The neighborhoods of a point x form a filter that satisfies an additional
axiom that for every neighborhood N of x we can find another one U suchthat N is a neighborhood of every point of U .
definition
IsNeighSystem (_ {is a neighborhood system on} _ 90)
where M {is a neighborhood system on} X ≡ (M : X→Pow(Pow(X))) ∧(∀ x∈X. (M(x) {is a filter on} X) ∧ (∀ N∈M(x). x∈N ∧ (∃ U∈M(x).∀ y∈U.(N∈M(y))) ))A neighborhood system on X consists of collections of subsets of X.
lemma neighborhood_subset:
assumes M {is a neighborhood system on} X and x∈X and N∈M(x)shows N⊆X and x∈Nproof from hM {is a neighborhood system on} Xi have M : X→Pow(Pow(X))
unfolding IsNeighSystem_def by simp
with hx∈Xi have M(x) ∈ Pow(Pow(X)) using apply_funtype by blast
with hN∈M(x)i show N⊆X by blastfrom assms show x∈N using IsNeighSystem_def by simp
qedSome sources (like Wikipedia) use a bit different definition of neighborhood
systems where the U is required to be contained in N . The next lemmashows that this stronger version can be recovered from our definition.
lemma neigh_def_stronger:
assumes M {is a neighborhood system on} X and x∈X and N∈M(x)shows ∃ U∈M(x).U⊆N ∧ (∀ y∈U.(N∈M(y)))
proof from assms obtain W where W∈M(x) and areNeigh:∀ y∈W.(N∈M(y))
using IsNeighSystem_def by blast
let U = N∩W
from assms hW∈M(x)i have U ∈ M(x)unfolding IsNeighSystem_def IsFilter_def by blast
moreover have U⊆N by blast
moreover from areNeigh have ∀ y∈U.(N∈M(y)) by auto
ultimately show thesis by auto
qed

55.2

Topology from neighborhood systems

Given a neighborhood system {Mx }x∈X we can define a topology on X.
Namely, we consider a subset of X open if U ∈ Mx for every element x ofU.
The collection of sets defined as above is indeed a topology.
699

theorem topology_from_neighs:
assumes M {is a neighborhood system on} X
defines Tdef: T ≡ {U∈Pow(X). S∀ x∈U. U ∈ M(x)}shows T {is a topology} andT = X
proof { fix U S
assume U ∈ Pow(T)
have
U ∈ T
proof S
from hU ∈ Pow(T)i Tdef haveU ∈ Pow(X) by blast
moreoverS{ fix x assume x ∈Uthen obtain U where U∈U and x∈U by blast
with assms hU ∈ Pow(T)i S
have U ∈ M(x) and U ⊆U and M(x) {is a filter on} X
unfolding
IsNeighSystem_def
by autoS
S
with h U ∈ Pow(X)i haveU ∈ M(x) unfolding IsFilter_def
by simp}S
ultimately show
U ∈ T using Tdef by blast
qed}
moreover{ fix U V assume U∈T and V∈Thave U∩V ∈ T
proof from Tdef hU∈Ti hU∈Ti have U∩V ∈ Pow(X) by auto
moreover{ fix x assume x ∈ U∩V
with assms hU∈Ti hV∈Ti Tdef have U ∈ M(x) V ∈ M(x) and M(x){is a filter on} X
unfolding IsNeighSystem_def by auto
then have U∩V ∈ M(x) unfolding IsFilter_def by simp}
ultimately show U∩V ∈T using Tdef by simp
qed}
ultimately show T {is a topology} unfolding IsATopology_def by blastfrom assms show
blast
qed

S

T = X unfolding IsNeighSystem_def IsFilter_def bySome sources (like Wikipedia) define the open sets generated by a neighborhood system ”as those sets containing a neighborhood of each of theirpoints”. The next lemma shows that this definition is equivalent to the one
we are using.
lemma topology_from_neighs1:
assumes M {is a neighborhood system on} X
shows {U∈Pow(X). ∀ x∈U. U ∈ M(x)} = {U∈Pow(X). ∀ x∈U. ∃ V ∈ M(x).

700

V⊆U}
proof
let T = {U∈Pow(X). ∀ x∈U. U ∈ M(x)}let S = {U∈Pow(X). ∀ x∈U. ∃ V ∈ M(x). V⊆U}
show S⊆T
proof { fix U assume U∈Sthen have U∈Pow(X) by simp
moreoverfrom assms hU∈Si hU∈Pow(X)i have ∀ x∈U. U ∈ M(x)unfolding IsNeighSystem_def IsFilter_def by blast
ultimately have U∈T by auto
} thus thesis by autoqedshow T⊆S by auto
qed

55.3

Neighborhood system from topology

Once weShave a topology T we can define a natural neighborhood system
on X = T . In this section we define such neighborhood system and prove
its basic properties.
For a topology T weSdefine a neighborhood system of T as a function thattakes an x ∈ X = T and assigns it a collection supersets of open setscontaining x. We call that the ”neighborhood system of T ”
definition
NeighSystem ({neighborhood system of} _ 91)
S
where
S {neighborhood system of} T ≡ { hx,{V∈Pow( T).∃ U∈T.(x∈U ∧ U⊆V)}i.
x ∈T }The next lemma shows that open sets are members ofS(what we will provelater to be) the natural neighborhood system on X = T .
lemma open_are_neighs:
assumes U∈T
S x∈U
Sshows x ∈T and U ∈ {V∈Pow( T).∃ U∈T.(x∈U ∧ U⊆V)}
using assms by auto

Another fact we will need is that for every x ∈ X =of x form a filter
lemma neighs_is_filter:S
assumes T {is a topology} and x ∈Tdefines Mdef: M ≡ {neighborhood
systemof} TSshows M(x) {is a filter on} ( T)proof - S
let X =
T
let F = {V∈Pow(X).∃ U∈T.(x∈U ∧ U⊆V)}
have 0∈F/ by blast701

S

T the neighborhoods

moreover have X∈F
proof from assms hx∈Xi have X ∈ Pow(X) X∈T and x∈X ∧ X⊆X using carr_open
by autohence ∃ U∈T.(x∈U ∧ U⊆X) by auto
thus thesis by autoqed
moreover have ∀ A∈F. ∀ B∈F. A∩B ∈ F
proof { fix A B assume A∈F B∈Fthen obtain UA UB where UA ∈T x∈UA UA ⊆A UB ∈T x∈UB UB ⊆B
by autowith hT {is a topology}i hA∈Fi hB∈Fi have A∩B ∈ Pow(X) andUA ∩UB ∈ T x ∈ UA ∩UB UA ∩UB ⊆ A∩B using IsATopology_def
by autohence A∩B ∈ F by blast} thus thesis by blast
qed
moreover have ∀ B∈F. ∀ C∈Pow(X). B⊆C −→ C∈F
proof { fix B C assume B∈F C ∈ Pow(X) B⊆C
then obtain U where U∈T and x∈U U⊆B by blast
with hC ∈ Pow(X)i hB⊆Ci have C∈F by blast} thus thesis by autoqed
ultimately have F {is a filter on} X unfolding IsFilter_def by blast
with Mdef hx∈Xi show M(x) {is a filter on} X using ZF_fun_from_tot_val1
NeighSystem_def
by simpqed

The next theorem states that the the natural neighborhood system on X =ST indeed is a neighborhood system.
theorem neigh_from_topology:
assumes T {is a topology}
Sshows ({neighborhood system of} T) {is a neighborhood system on} ( T)proof - S
let X =
T
let M = {neighborhood system of} T
have M : X→Pow(Pow(X))
proof { fix x assume x∈XShence {V∈Pow( T).∃ U∈T.(x∈U∧ U⊆V)} ∈ Pow(Pow(X)) by autoS
} hence ∀ x∈X. {V∈Pow( T).∃ U∈T.(x∈U ∧ U⊆V)} ∈ Pow(Pow(X)) by auto
then show thesis using ZF_fun_from_total NeighSystem_def by simp
qed
moreover from assms have ∀ x∈X. (M(x) {is a filter on} X)
using neighs_is_filter NeighSystem_def by auto702

moreover have ∀ x∈X. ∀ N∈M(x). x∈N ∧ (∃ U∈M(x).∀ y∈U.(N∈M(y)))
proof { fix x N assume x∈X N ∈ M(x)let F = {V∈Pow(X).∃ U∈T.(x∈U ∧ U⊆V)}
from hx∈Xi have M(x) = F using ZF_fun_from_tot_val1 NeighSystem_def
by simpwith hN ∈ M(x)i have N∈F by simp
hence x∈N by blastfrom hN∈Fi obtain U where U∈T x∈U and U⊆N by blast
with hN∈Fi hM(x) = Fi have U ∈ M(x) by auto
moreover from assms hU∈Ti hU⊆Ni hN∈Fi have ∀ y∈U.(N ∈ M(y))
using ZF_fun_from_tot_val1 open_are_neighs neighs_is_filter
NeighSystem_def IsFilter_def by auto
ultimately have ∃ U∈M(x).∀ y∈U.(N∈M(y)) by blast
with hx∈Ni have x∈N ∧ (∃ U∈M(x).∀ y∈U.(N∈M(y))) by simp
} thus thesis by autoqed
ultimately show thesis unfolding IsNeighSystem_def by blast
qed
end

56

Topology - examples

theory Topology_ZF_examples imports Topology_ZF Cardinal_ZF
begin

This theory deals with some concrete examples of topologies.

56.1

CoCardinal Topology

In this section we define and prove the basic properties of the co-cardinal
topology on a set X.
The collection of subsets of a set whose complement is strictly bounded bya cardinal is a topology given some assumptions on the cardinal.
definition
CoCardinal(X,T) ≡ {F∈Pow(X). X-F ≺ T}∪ {0}For any set and any infinite cardinal we prove that CoCardinal(X,Q) forms a
topology. The proof is done with an infinite cardinal, but it is obvious thatthe set Q can be any set equipollent with an infinite cardinal. It is a topology
also if the set where the topology is defined is too small or the cardinal toolarge; in this case, as it is later proved the topology is a discrete topology.
And the last case corresponds with Q=1 which translates in the indiscrete
topology.
703

lemma CoCar_is_topology:
assumes InfCard (Q)shows CoCardinal(X,Q) {is a topology}
proof let T = CoCardinal(X,Q){
fix M
assume A:M∈Pow(T)hence M⊆T by auto
then have M⊆Pow(X)using CoCardinal_def by autoS
then have
M∈Pow(X) by auto
moreover{assume B:M=0
S
then haveM∈T using CoCardinal_def by auto}
moreover{assume B:M={0}Sthen haveM∈T using CoCardinal_def by auto}
moreover{assume B:M 6=0 M6={0}from B obtain T where C:T∈M and T6=0 by autowith A have D:X-T
S ≺ (Q) using CoCardinal_def by autofrom C have X-S M⊆X-T by blast
with D have X- M≺ (Q) using subset_imp_lepoll lesspoll_trans1
by blast}S
ultimately haveM∈T using CoCardinal_def by auto}
moreover{fix U and V
assume U∈T and V∈Tthen have A:U=0 ∨ (U∈Pow(X) ∧ X-U≺ (Q)) and
B:V=0 ∨ (V∈Pow(X) ∧ X-V≺ (Q)) using CoCardinal_def by auto
hence D:U∈Pow(X)V∈Pow(X) by auto
have C:X-(U ∩ V)=(X-U)∪(X-V) by fastwith A B C have U∩V=0∨(U∩V∈Pow(X) ∧ X-(U ∩ V)≺ (Q)) using less_less_imp_un_lessassms
by autothen have U∩V∈T using CoCardinal_def by auto}
ultimately show thesis using IsATopology_def by autoqed

We can use theorems proven in topology0 context for the co-cardinal topol-

704

ogy.
theorem topology0_CoCardinal:assumes InfCard(T)shows topology0(CoCardinal(X,T))
using topology0_def CoCar_is_topology assms by auto

It can also be proven that if CoCardinal(X,T) is a topology, X6=0, Card(T)and T6=0; then T is an infinite cardinal, X≺T or T=1. It follows from thefact that the union of two closed sets is closed. Choosing the appropriate
cardinals, the cofinite and the cocountable topologies are obtained.
The cofinite topology is a very special topology because it is closely related
to the separation axiom T1 . It also appears naturally in algebraic geometry.
definition
Cofinite (CoFinite _ 90) where
CoFinite X ≡ CoCardinal(X,nat)

Cocountable topology in fact consists of the empty set and all cocountable
subsets of X.
definition
Cocountable (CoCountable _ 90) where
CoCountable X ≡ CoCardinal(X,csucc(nat))

56.2

Total set, Closed sets, Interior, Closure and Boundary

There are several assertions that can be done to the CoCardinal(X,T) topology. In each case, we will not assume sufficient conditions for CoCardinal(X,T)
to be a topology, but they will be enough to do the calculations in every
posible case.
The topology is defined in the set X
lemma union_cocardinal:assumes
S T6=0shows
CoCardinal(X,T) = X
proof have X:X-X=0 by auto
have 0 . 0 by autowith assms have 0≺11 .T using not_0_is_lepoll_1 lepoll_imp_lesspoll_succ
by autothen have 0≺T using lesspoll_trans2 by autowith X have (X-X)≺T by auto
then haveS X∈CoCardinal(X,T) using CoCardinal_def by auto
hence X⊆
CoCardinal(X,T)
by blast
Sthen show
CoCardinal(X,T)=X using CoCardinal_def by autoqed

The closed sets are the small subsets of X and X itself.
lemma closed_sets_cocardinal:705

assumes T6=0
shows D {is closed in} CoCardinal(X,T) ←→ (D∈Pow(X) ∧ D≺T) ∨ D=X
proof {
assume A:D ⊆ X X - D ∈ CoCardinal(X,T) D 6= X
from A(1,3) have X-(X-D)=D X-D6=0 by autowith A(2) have D≺T using CoCardinal_def by simp}
with assms have D {is closed in} CoCardinal(X,T) −→ (D∈Pow(X) ∧ D≺T)∨
D=X using IsClosed_def
union_cocardinal by auto
moreover{assume A:D ≺ TD ⊆ Xfrom A(2) have X-(X-D)=D by blast
with A(1) have X-(X-D)≺ T by auto
then have X-D∈ CoCardinal(X,T) using CoCardinal_def by auto}with assms have (D∈Pow(X) ∧ D≺T)−→ D {is closed in} CoCardinal(X,T)
using union_cocardinal
IsClosed_def by auto
moreoverhave X-X=0 by auto
then have X-X∈ CoCardinal(X,T)using CoCardinal_def by autowith assms have X{is closed in} CoCardinal(X,T) using union_cocardinal
IsClosed_def by auto
ultimately show thesis by autoqed

The interior of a set is itself if it is open or 0 if it isn’t open.
lemma interior_set_cocardinal:assumes noC: T6=0 and A⊆X
shows Interior(A,CoCardinal(X,T))= (if ((X-A) ≺ T) then A else 0)
proof from assms(2) have dif_dif:X-(X-A)=A by blast{
assume (X-A) ≺ T
then have (X-A)∈Pow(X) ∧ (X-A) ≺ T by autowith noC have (X-A) {is closed in} CoCardinal(X,T) using closed_sets_cocardinalby autowith noC have X-(X-A)∈CoCardinal(X,T) using IsClosed_def union_cocardinalby autowith dif_dif have A∈CoCardinal(X,T) by auto
hence A∈{U∈CoCardinal(X,T).
U ⊆ A} by autoS
hence a1:A⊆{U∈CoCardinal(X,T).
U ⊆ A} by autoS
have a2: {U∈CoCardinal(X,T). U ⊆ A}⊆A by blastfrom a1 a2 have Interior(A,CoCardinal(X,T))=A using Interior_def
by auto}moreover706

{assume as:~((X-A) ≺ T){
fix U
assume U ⊆A
hence X-A ⊆ X-U by blast
then have Q:X-A . X-U using subset_imp_lepoll by auto{
assume X-U≺ T
with Q have X-A≺ T using lesspoll_trans1 by autowith as have False by auto}
hence ~((X-U) ≺ T) by auto
then have U∈CoCardinal(X,T)∨U=0/
using CoCardinal_def by auto}
hence {U∈CoCardinal(X,T). U ⊆ A}⊆{0} by blast
then have Interior(A,CoCardinal(X,T))=0 using Interior_def by auto}
ultimately show thesis by autoqed

X is a closed set that contains A. This lemma is necessary because wecannot use the lemmas proven in the topology0 context since T6=0} is too
weak for CoCardinal(X,T) to be a topology.
lemma X_closedcov_cocardinal:assumes T6=0 A⊆X
shows X∈ClosedCovers(A,CoCardinal(X,T)) using ClosedCovers_def
using union_cocardinal closed_sets_cocardinal assms by auto

The closure of a set is itself if it is closed or X if it isn’t closed.
lemma closure_set_cocardinal:assumes T6=0A⊆X
shows Closure(A,CoCardinal(X,T))=(if (A ≺ T) then A else X)
proof {
assume A ≺ Twith assms have A {is closed in} CoCardinal(X,T) using closed_sets_cocardinalby autowith assms(2) have A∈ {D ∈ Pow(X). D {is closed in} CoCardinal(X,T)∧ A⊆D} by autowith assms(1) have S:A∈ClosedCovers(A,CoCardinal(X,T)) using ClosedCovers_def
using union_cocardinalby autoT
hence l1: ClosedCovers(A,CoCardinal(X,T))⊆A
by blastTfrom S have l2:A ⊆ClosedCovers(A,CoCardinal(X,T))
unfolding ClosedCovers_def by autofrom l1 l2 have Closure(A,CoCardinal(X,T))=A using Closure_def
by auto}moreover707

{assume as:¬ A ≺ T{
fix U
assume A⊆U
then have Q:A . U using subset_imp_lepoll by auto{
assume U≺ T
with Q have A≺ T using lesspoll_trans1 by autowith as have False by auto}
hence ¬ U ≺ T by autowith assms(1) have ¬(U {is closed in} CoCardinal(X,T)) ∨ U=X using closed_sets_cocardinalby auto}with assms(1) have ∀ U∈Pow(X). U{is closed in}CoCardinal(X,T) ∧ A⊆U−→U=X
by autowith assms(1) have ClosedCovers(A,CoCardinal(X,T))⊆{X}
using union_cocardinal using ClosedCovers_def by autowith assms have ClosedCovers(A,CoCardinal(X,T))={X} using X_closedcov_cocardinalby autothen have Closure(A,CoCardinal(X,T)) = X using Closure_def by auto}
ultimately show thesis by autoqed

The boundary of a set is empty if A and X − A are closed, X if not A
neither X − A are closed and; if only one is closed, then the closed one is its
boundary.
lemma boundary_cocardinal:assumes T6=0A⊆X
shows Boundary(A,CoCardinal(X,T)) = (if A≺ T then (if (X-A)≺ T then0 else A) else (if (X-A)≺ T then X-A else X))
proof from assms(2) have X-A ⊆ X by auto{
assume AS: A≺T X-A ≺ Twith assms hX-A ⊆ Xi have
Closure(X-A,CoCardinal(X,T)) = X-A and Closure(A,CoCardinal(X,T))= A
using closure_set_cocardinal by autowith assms(1) have Boundary(A,CoCardinal(X,T)) = 0
using Boundary_def union_cocardinal by auto}
moreover{assume AS: ~(A≺T) X-A ≺ Twith assms hX-A ⊆ Xi have708

Closure(X-A,CoCardinal(X,T)) = X-A and Closure(A,CoCardinal(X,T))= X
using closure_set_cocardinal by autowith assms(1) have Boundary(A,CoCardinal(X,T))=X-A using Boundary_def
union_cocardinal by auto}
moreover{assume AS:~(A≺T) ~(X-A ≺ T)with assms hX-A ⊆ Xi have
Closure(X-A,CoCardinal(X,T))=X and Closure(A,CoCardinal(X,T))=X
using closure_set_cocardinal by autowith assms(1) have Boundary(A,CoCardinal(X,T))=X using Boundary_def
union_cocardinalby auto}moreover{assume AS:A≺ T ~(X-A≺T)
with assms hX-A ⊆ Xi have
Closure(X-A,CoCardinal(X,T))=X and Closure(A,CoCardinal(X,T)) =A
using closure_set_cocardinal by autowith assms have Boundary(A,CoCardinal(X,T))=A using Boundary_def
union_cocardinalby auto}ultimately show thesis by autoqed

If the set is too small or the cardinal too large, then the topology is just thediscrete topology.
lemma discrete_cocardinal:assumes X≺Tshows CoCardinal(X,T) = Pow(X)
proof
{
fix U
assume U∈CoCardinal(X,T)
then have U ∈ Pow(X) using CoCardinal_def by auto}
then show CoCardinal(X,T) ⊆ Pow(X) by auto{
fix U
assume A:U ∈ Pow(X)then have X-U ⊆ X by auto
then have X-U .X using subset_imp_lepoll by auto
then have X-U≺ T using lesspoll_trans1 assms by autowith A have U∈CoCardinal(X,T) using CoCardinal_def709

by auto}
then show Pow(X) ⊆ CoCardinal(X,T) by autoqed

If the cardinal is taken as T=1 then the topology is indiscrete.
lemma indiscrete_cocardinal:shows CoCardinal(X,1) = {0,X}
proof
{
fix Q
assume Q ∈ CoCardinal(X,1)
then have Q ∈ Pow(X) and Q=0 ∨ X-Q≺1 using CoCardinal_def by auto
then have Q ∈ Pow(X) and Q=0 ∨ X-Q=0 using lesspoll_succ_iff lepoll_0_iff
by autothen have Q=0 ∨ Q=X by blast}
then show CoCardinal(X,1) ⊆ {0, X} by auto
have 0 ∈ CoCardinal(X,1) using CoCardinal_def by auto
moreoverhave 0≺1 and X-X=0 using lesspoll_succ_iff by auto
then have X∈CoCardinal(X,1) using CoCardinal_def by auto
ultimately show {0, X} ⊆ CoCardinal(X,1) by autoqed

The topological subspaces of the CoCardinal(X,T) topology are also CoCardinal topologies.
lemma subspace_cocardinal:shows CoCardinal(X,T) {restricted to} Y = CoCardinal(Y∩X,T)
proof
{
fix M
assume M ∈ (CoCardinal(X,T) {restricted to} Y)then obtain A where A1:A ∈ CoCardinal(X,T) M=Y ∩ A using RestrictedTo_def
by autothen have M ∈ Pow(X ∩ Y) using CoCardinal_def by auto
moreoverfrom A1 have (Y ∩ X)-M = (Y ∩ X)-A using CoCardinal_def by autowith h(Y ∩ X)-M = (Y ∩ X)-Ai have (Y ∩ X)-M⊆ X-A by auto
then have (Y ∩ X)-M . X-A using subset_imp_lepoll by autowith A1 have (Y ∩ X)-M ≺ T ∨ M=0 using lesspoll_trans1 CoCardinal_def
by autoultimately have M ∈ CoCardinal(Y∩X, T) using CoCardinal_def
by auto}then show CoCardinal(X,T) {restricted to} Y ⊆ CoCardinal(Y∩X,T) by
auto
{
fix M

710

let A = M ∪ (X-Y)
assume A:M ∈ CoCardinal(Y ∩ X,T){
assume M=0
hence M=0 ∩ Y by auto
then have M∈CoCardinal(X,T) {restricted to} Y using RestrictedTo_def
CoCardinal_def by auto}
moreover{assume AS:M6=0
from A AS have A1:(M∈Pow(Y ∩ X) ∧ (Y ∩ X)-M≺T) using CoCardinal_def
by autohence A∈Pow(X) by blast
moreoverhave X-A=(Y ∩ X)-M by blast
with A1 have X-A≺ T by auto
ultimately have A∈CoCardinal(X,T) using CoCardinal_def by auto
then have AT:Y ∩ A∈CoCardinal(X,T) {restricted to} Y using RestrictedTo_def
by autohave Y ∩ A=Y ∩ M by blast
also from A1 have . . .=M by auto
finally have Y ∩ A=M by simp
with AT have M∈CoCardinal(X,T) {restricted to} Y
by auto}ultimately have M∈CoCardinal(X,T) {restricted to} Y by auto}
then show CoCardinal(Y ∩ X, T) ⊆ CoCardinal(X,T) {restricted to} Y
by autoqed

56.3

Excluded Set Topology

In this section, we consider all the subsets of a set which have empty intersection with a fixed set.
The excluded set topology consists of subsets of X that are disjoint with afixed set U .
definition ExcludedSet(X,U) ≡ {F∈Pow(X). U ∩ F=0}∪ {X}

For any set; we prove that ExcludedSet(X,Q) forms a topology.
theorem excludedset_is_topology:
shows ExcludedSet(X,Q) {is a topology}
proof {
fix M
assume M ∈ Pow(ExcludedSet(X,Q))

711

then have A:M⊆{F∈Pow(X). Q ∩ F=0}∪ {X} using ExcludedSet_def by
auto
S
hence
M∈Pow(X) by auto
moreover{S S
have B:Q ∩ M= {Q ∩T. T∈M} by auto{
assume X∈M/
with A have M⊆{F∈Pow(X).
Q ∩ F=0} by autoSwith B have Q ∩M=0 by auto}
moreover{assume X∈M S
with A have
M=X by auto}S
S
ultimately have Q ∩M=0 ∨M=X by auto}S
ultimately have
M∈ExcludedSet(X,Q) using ExcludedSet_def by auto}
moreover{fix U V
assume U∈ExcludedSet(X,Q) V∈ExcludedSet(X,Q)
then have U∈Pow(X)V∈Pow(X)U=X∨ U ∩ Q=0V=X∨ V ∩ Q=0 using ExcludedSet_def
by autohence U∈Pow(X)V∈Pow(X)(U ∩ V)=X ∨ Q∩(U ∩ V)=0 by auto
then have (U ∩ V)∈ExcludedSet(X,Q) using ExcludedSet_def by auto}
ultimately show thesis using IsATopology_def by autoqed

We can use topology0 when discussing excluded set topology.
theorem topology0_excludedset:
shows topology0(ExcludedSet(X,T))
using topology0_def excludedset_is_topology by auto

Choosing a singleton set, it is considered a point in excluded topology.
definition
ExcludedPoint(X,p) ≡ ExcludedSet(X,{p})56.4Total set, closed sets, interior, closure and boundary

Here we discuss what are closed sets, interior, closure and boundary in excluded set topology.
The topology is defined in the set X
lemma union_excludedset:

712

S
shows
ExcludedSet(X,T) = X
proof have X ∈ExcludedSet(X,T) using ExcludedSet_def by auto
then show thesis using ExcludedSet_def by autoqed

The closed sets are those which contain the set (X ∩ T) and 0.
lemma closed_sets_excludedset:
shows D {is closed in}ExcludedSet(X,T) ←→ (D∈Pow(X) ∧ (X ∩ T) ⊆ D)
∨ D=0
proof {
fix x
assume A:D ⊆ X X-D ∈ExcludedSet(X,T) D6=0 x∈T x∈Xfrom A(1) have B:X-(X-D)=D by autofrom A(2) have T∩(X-D)=0∨ X-D=X using ExcludedSet_def by auto
hence T∩(X-D)=0∨ X-(X-D)=X-X by autowith B have T∩(X-D)=0∨ D=X-X by auto
hence T∩(X-D)=0∨ D=0 by autowith A(3) have T∩(X-D)=0 by autowith A(4) have x∈X-D/
by autowith A(5) have x∈D by auto}
moreover{assume A:X∩T⊆D D⊆Xfrom A(1) have X-D⊆X-(X∩T) by auto
also have . . . = X-T by auto
finally have T∩(X-D) = 0 by auto
moreoverhave X-D ∈ Pow(X) by auto
ultimately have X-D ∈ExcludedSet(X,T) using ExcludedSet_def by auto}
ultimately show thesis using IsClosed_def union_excludedset ExcludedSet_def
by autoqed

The interior of a set is itself if it is X or the difference with the set T
lemma interior_set_excludedset:
assumes A⊆X
shows Interior(A,ExcludedSet(X,T)) = (if A=X then X else A-T)
proof {
assume A:A6=X
from assms have A-T ∈ExcludedSet(X,T) using ExcludedSet_def by auto
then have A-T⊆Interior(A,ExcludedSet(X,T))
using Interior_def by auto
moreover

713

{
fix U
assume U ∈ExcludedSet(X,T) U⊆A
then have T∩U=0 ∨ U=XU⊆A using ExcludedSet_def by autowith A assms have T∩U=0U⊆A by auto
then have U-T=UU-T⊆A-T by auto
then have U⊆A-T by auto}
then have Interior(A,ExcludedSet(X,T))⊆A-T using Interior_def by
auto
ultimately have Interior(A,ExcludedSet(X,T))=A-T by auto}
moreoverhave X∈ExcludedSet(X,T) using ExcludedSet_def
union_excludedset by auto
then have Interior(X,ExcludedSet(X,T)) = X using topology0.Top_2_L3
topology0_excludedset by auto
ultimately show thesis by autoqed

The closure of a set is itself if it is 0 or the union with T.
lemma closure_set_excludedset:
assumes A⊆X
shows Closure(A,ExcludedSet(X,T))=(if A=0 then 0 else A ∪(X∩ T))
proof have 0∈ClosedCovers(0,ExcludedSet(X,T)) using ClosedCovers_def
closed_sets_excludedset by auto
then have Closure(0,ExcludedSet(X,T))⊆0 using Closure_def by auto
hence Closure(0,ExcludedSet(X,T))=0 by blast
moreover{assume A:A6=0
with assms have (A∪(X∩T)) {is closed in}ExcludedSet(X,T) using closed_sets_excludedsetby blast
then have (A ∪(X∩ T))∈ {D ∈ Pow(X). D {is closed in}ExcludedSet(X,T)∧ A⊆D}
using assms by auto
then have (A ∪(X∩ T))∈ClosedCovers(A,ExcludedSet(X,T)) unfolding
ClosedCovers_def
using union_excludedset
by autoTthen have l1: ClosedCovers(A,ExcludedSet(X,T)) ⊆ (A ∪(X∩ T)) by
blast
{
fix U
assume U∈ClosedCovers(A,ExcludedSet(X,T))
then have U{is closed in}ExcludedSet(X,T) and A⊆U using ClosedCovers_def
union_excludedset by auto
then have U=0∨(X∩T)⊆U and A⊆U using closed_sets_excludedset714

by auto
with A have (X∩T)⊆UA⊆U by auto
hence (X∩T)∪A⊆U by auto}Twith assms have (A ∪(X∩ T)) ⊆ClosedCovers(A,ExcludedSet(X,T))
using topology0.Top_3_L3 topology0_excludedset union_excludedset
by autoTwith l1 have
ClosedCovers(A,ExcludedSet(X,T)) = (A∪(X∩T)) by auto
then have Closure(A, ExcludedSet(X,T)) = A∪(X∩T) using Closure_def
by auto}ultimately show thesis by autoqed

The boundary of a set is 0 if A is X or 0, and X∩T in other case.
lemma boundary_excludedset:
assumes A⊆X
shows Boundary(A,ExcludedSet(X,T)) = (if A=0∨A=X then 0 else X∩T)
proof {
have Closure(0,ExcludedSet(X,T))=0Closure(X - 0,ExcludedSet(X,T))=X
using closure_set_excludedset by auto
then have Boundary(0,ExcludedSet(X,T)) = 0using Boundary_def using
union_excludedset assms by auto}
moreover{have X-X=0 by blast
then have Closure(X,ExcludedSet(X,T)) = X and Closure(X-X,ExcludedSet(X,T))= 0
using closure_set_excludedset by auto
then have Boundary(X,ExcludedSet(X,T)) = 0unfolding Boundary_def
using
union_excludedset by auto}
moreover{assume A6=0 and A6=X
then have X-A6=0 using assms by autowith assms hA6=0i hA⊆Xi have Closure(A,ExcludedSet(X,T)) = A ∪ (X∩T)
using closure_set_excludedset by simp
moreoverfrom hA⊆Xi have X-A ⊆ X by blast
with hX-A6=0i have Closure(X-A,ExcludedSet(X,T)) = (X-A) ∪ (X∩T)
using closure_set_excludedset by simp
ultimately have Boundary(A,ExcludedSet(X,T)) = X∩T715

using Boundary_def union_excludedset by auto}
ultimately show thesis by auto
qed

56.5

Special cases and subspaces

This section provides some miscellaneous facts about excluded set topologies.
The excluded set topology is equal in the sets T and X∩T.
lemma smaller_excludedset:
shows ExcludedSet(X,T) = ExcludedSet(X,(X∩T))
proofshow ExcludedSet(X,T) ⊆ ExcludedSet(X, X∩T) and ExcludedSet(X, X∩T)
⊆ExcludedSet(X,T)
unfolding ExcludedSet_def by autoqed

If the set which is excluded is disjoint with X, then the topology is discrete.
lemma empty_excludedset:
assumes T∩X=0
shows ExcludedSet(X,T) = Pow(X)prooffrom assms show ExcludedSet(X,T) ⊆ Pow(X) using smaller_excludedset
ExcludedSet_def
by autofrom assms show Pow(X) ⊆ExcludedSet(X,T) unfolding ExcludedSet_def
by blast
qed

The topological subspaces of the ExcludedSet X T topology are also ExcludedSet topologies.
lemma subspace_excludedset:
shows ExcludedSet(X,T) {restricted to} Y = ExcludedSet(Y ∩ X, T)
proof
{
fix M
assume M∈(ExcludedSet(X,T) {restricted to} Y)then obtain A where A1:A:ExcludedSet(X,T) M=Y ∩ A unfolding RestrictedTo_def
by autothen have M∈Pow(X ∩ Y) unfolding ExcludedSet_def by auto
moreoverfrom A1 have T∩M=0∨M=Y∩X unfolding ExcludedSet_def by blast
ultimately have M ∈ ExcludedSet(Y ∩ X,T) unfolding ExcludedSet_def
by auto}then show ExcludedSet(X,T) {restricted to} Y ⊆ ExcludedSet(Y∩X,T)
by auto

716

{
fix M
let A = M ∪ ((X∩Y-T)-Y)
assume A:M ∈ ExcludedSet(Y∩X,T){
assume M = Y ∩ Xthen have M ∈ ExcludedSet(X,T) {restricted to} Y unfolding RestrictedTo_def
ExcludedSet_def by auto}
moreover{assume AS:M6=Y ∩ Xfrom A AS have A1:(M∈Pow(Y ∩ X) ∧ T∩M=0) unfolding ExcludedSet_def
by autothen have A∈Pow(X) by blast
moreoverhave T∩A=T∩M by blast
with A1 have T∩A=0 by auto
ultimately have A ∈ExcludedSet(X,T) unfolding ExcludedSet_def by
auto
then have AT:Y ∩ A ∈ExcludedSet(X,T) {restricted to} Y unfolding RestrictedTo_def
by autohave Y ∩ A=Y ∩ M by blast
also have . . .=M using A1 by auto
finally have Y∩A = M by simp
with AT have M ∈ExcludedSet(X,T) {restricted to} Y by auto}
ultimately have M ∈ExcludedSet(X,T) {restricted to} Y by auto}
then show ExcludedSet(Y ∩ X,T) ⊆ ExcludedSet(X,T) {restricted to}
Y by auto
qed

56.6

Included Set Topology

In this section we consider the subsets of a set which contain a fixed set.
The family defined in this section and the one in the previous section are
dual; meaning that the closed set of one are the open sets of the other.
We define the included set topology as the collection of supersets of somefixed subset of the space X.
definition
IncludedSet(X,U) ≡ {F∈Pow(X). U ⊆ F} ∪ {0}In the next theorem we prove that IncludedSet X Q forms a topology.
theorem includedset_is_topology:
shows IncludedSet(X,Q) {is a topology}717

proof {fix Massume M ∈ Pow(IncludedSet(X,Q))
then have A:M⊆{F∈Pow(X).
Q ⊆ F}∪ {0} using IncludedSet_def by autoS
then have
M∈Pow(X) by auto
moreoverS
S
haveQ ⊆ M∨
M=0
S using A by blast
ultimately have
M∈IncludedSet(X,Q) using IncludedSet_def by auto}
moreover{fix U V
assume U∈IncludedSet(X,Q) V∈IncludedSet(X,Q)
then have U∈Pow(X)V∈Pow(X)U=0∨ Q⊆UV=0∨ Q⊆V using IncludedSet_def
by autothen have U∈Pow(X)V∈Pow(X)(U ∩ V)=0 ∨ Q⊆(U ∩ V) by auto
then have (U ∩ V)∈IncludedSet(X,Q) using IncludedSet_def by auto}
ultimately show thesis using IsATopology_def by autoqed

We can reference the theorems proven in the topology0 context when discussing the included set topology.
theorem topology0_includedset:
shows topology0(IncludedSet(X,T))
using topology0_def includedset_is_topology by auto

Choosing a singleton set, it is considered a point excluded topology. In thefollowing lemmas and theorems, when neccessary it will be considered that
T6=0 and T⊆X. These cases will appear in the special cases section.
definition
IncludedPoint (IncludedPoint _ _ 90) where
IncludedPoint X p ≡ IncludedSet(X,{p})56.7Basic topological notions in included set topology

This section discusses total set, closed sets, interior, closure and boundary
for included set topology.
The topology is defined in the set X.
lemma union_includedset:
assumes
S T⊆Xshows
IncludedSet(X,T) = X
proof from assms S
have X ∈ IncludedSet(X,T) using IncludedSet_def by auto
then show
IncludedSet(X,T) = X using IncludedSet_def by auto
qed

718

The closed sets are those which are disjoint with T and X.
lemma closed_sets_includedset:
assumes T⊆Xshows D {is closed in} IncludedSet(X,T) ←→ (D∈Pow(X) ∧ (D ∩ T)=0)∨
D=X
proof have X-X=0 by blast
then have X-X∈IncludedSet(X,T) using IncludedSet_def by auto
moreover{assume A:D ⊆ X X - D ∈ IncludedSet(X,T) D 6= X
from A(2) have T⊆(X-D)∨ X-D=0 using IncludedSet_def by autowith A(1) have T⊆(X-D)∨ D=X by blast
with A(3) have T⊆(X-D) by auto
hence D∩T=0 by blast}
moreover{assume A:D∩T=0D⊆X
from A(1) assms have T⊆(X-D) by blast
then have X-D∈IncludedSet(X,T) using IncludedSet_def by auto}
ultimately show thesis using IsClosed_def union_includedset assms by
auto
qed

The interior of a set is itself if it is open or the empty set if it isn’t.
lemma interior_set_includedset:
assumes A⊆X
shows Interior(A,IncludedSet(X,T))= (if T⊆A then A else 0)
proof {
fix x
assume A:Interior(A,IncludedSet(X,T)) 6= 0 x∈Thave Interior(A,IncludedSet(X,T)) ∈ IncludedSet(X,T) using
topology0.Top_2_L2 topology0_includedset by autowith A(1) have T ⊆ Interior(A,IncludedSet(X,T)) using IncludedSet_def
by autowith A(2) have x ∈ Interior(A,IncludedSet(X,T)) by auto
then have x∈A using topology0.Top_2_L1 topology0_includedset by auto}
moreover{assume T⊆A
with assms have A∈IncludedSet(X,T) using IncludedSet_def by auto
then have Interior(A,IncludedSet(X,T)) = A using topology0.Top_2_L3
topology0_includedset by auto}
ultimately show thesis by auto
qed

719

The closure of a set is itself if it is closed or the whole space if it is not.
lemma closure_set_includedset:
assumes A⊆X T⊆Xshows Closure(A,IncludedSet(X,T)) = (if T∩A=0 then A else X)
proof {
assume AS:T∩A=0
then have A {is closed in} IncludedSet(X,T) using closed_sets_includedset
assms by autowith assms(1) have Closure(A,IncludedSet(X,T))=A using topology0.Top_3_L8
topology0_includedset union_includedset assms(2) by auto}
moreover{assume AS:T∩A 6= 0
have X∈ClosedCovers(A,IncludedSet(X,T)) using ClosedCovers_def
closed_sets_includedset
union_includedset assms by autoT
then have l1: ClosedCovers(A,IncludedSet(X,T))⊆X using Closure_def
by automoreover{fix Uassume U∈ClosedCovers(A,IncludedSet(X,T))
then have U{is closed in}IncludedSet(X,T)A⊆U using ClosedCovers_def
by autothen have U=X∨(T∩U)=0A⊆U using closed_sets_includedset assms(2)by autothen have U=X∨(T∩A)=0 by auto
then have U=X using AS by auto}T
then have X ⊆ClosedCovers(A,IncludedSet(X,T)) using topology0.Top_3_L3
topology0_includedset
union_includedset assms by autoT
ultimately have
ClosedCovers(A,IncludedSet(X,T))=X by auto
then have Closure(A,IncludedSet(X,T)) = X
using Closure_def by auto}
ultimately show thesis by autoqed

The boundary of a set is X-A if A contains T completely, is A if X −A contains
T completely and X if T is divided between the two sets. The case where T=0
is considered as a special case.
lemma boundary_includedset:
assumes A⊆X T⊆X T6=0
shows Boundary(A,IncludedSet(X,T))=(if T⊆A then X-A else (if T∩A=0
then A else X))
proof from hA⊆Xi have X-A ⊆ X by auto{

720

assume T⊆A
with assms(2,3) have T∩A6=0 and T∩(X-A)=0 by autowith assms(1,2) hX-A ⊆ Xi have
Closure(A,IncludedSet(X,T)) = X and Closure(X-A,IncludedSet(X,T))= (X-A)
using closure_set_includedset by autowith assms(2) have Boundary(A,IncludedSet(X,T)) = X-A
using Boundary_def union_includedset by auto}
moreover{assume ~(T⊆A) and T∩A=0
with assms(2) have T∩(X-A)6=0 by autowith assms(1,2) hT∩A=0i hX-A ⊆ Xi have
Closure(A,IncludedSet(X,T)) = A and Closure(X-A,IncludedSet(X,T))= X
using closure_set_includedset by autowith assms(1,2) have Boundary(A,IncludedSet(X,T))=A using Boundary_def
union_includedset
by auto}moreover{assume ~(T⊆A) and T∩A 6= 0
with assms(1,2) have T∩(X-A) 6= 0 by autowith assms(1,2) hT∩A6=0i hX-A ⊆ Xi have
Closure(A,IncludedSet(X,T)) = X and Closure(X-A,IncludedSet(X,T))= X
using closure_set_includedset by autowith assms(2) have Boundary(A,IncludedSet(X,T)) = X
using Boundary_def union_includedset by auto}
ultimately show thesis by auto
qed

56.8

Special cases and subspaces

In this section we discuss some corner cases when some parameters in our
definitions are empty and provide some facts about subspaces in included
set topologies.
The topology is discrete if T=0
lemma smaller_includedset:
shows IncludedSet(X,0) = Pow(X)proofshow IncludedSet(X,0) ⊆ Pow(X) and Pow(X) ⊆ IncludedSet(X,0)
unfolding IncludedSet_def by auto
qed

721

If the set which is included is not a subset of X, then the topology is trivial.
lemma empty_includedset:
assumes ~(T⊆X)
shows IncludedSet(X,T) = {0}prooffrom assms show IncludedSet(X,T) ⊆ {0} and {0} ⊆ IncludedSet(X,T)
unfolding IncludedSet_def by autoqed

The topological subspaces of the IncludedSet(X,T) topology are also IncludedSet topologies. The trivial case does not fit the idea in the demonstration
because if Y⊆X then IncludedSet(Y∩X, Y∩T) is never trivial. There is noneed for a separate proof because the only subspace of the trivial topology
is itself.
lemma subspace_includedset:
assumes T⊆Xshows IncludedSet(X,T) {restricted to} Y = IncludedSet(Y∩X,Y∩T)
proof
{
fix M
assume M ∈ (IncludedSet(X,T) {restricted to} Y)then obtain A where A1:A:IncludedSet(X,T) M = Y∩A unfolding RestrictedTo_def
by autothen have M ∈ Pow(X∩Y) unfolding IncludedSet_def by auto
moreoverfrom A1 have Y∩T⊆M ∨ M=0 unfolding IncludedSet_def by blast
ultimately have M ∈ IncludedSet(Y∩X, Y∩T) unfolding IncludedSet_def
by auto}then show IncludedSet(X,T) {restricted to} Y ⊆ IncludedSet(Y∩X, Y∩T)
by auto{fix M
let A = M ∪ Tassume A:M ∈ IncludedSet(Y∩X, Y∩T){
assume M=0
then have M∈IncludedSet(X,T) {restricted to} Y unfolding RestrictedTo_def
IncludedSet_def by auto}
moreover{assume AS:M6=0
from A AS have A1:M∈Pow(Y∩X) ∧ Y∩T⊆M unfolding IncludedSet_def
by autothen have A∈Pow(X) using assms by blast722

moreoverhave T⊆A by blast
ultimately have A ∈ IncludedSet(X,T) unfolding IncludedSet_def by
auto
then have AT:Y ∩ A ∈ IncludedSet(X,T) {restricted to} Yunfolding
RestrictedTo_def
by autofrom A1 have Y ∩ A=Y ∩ M by blast
also from A1 have . . .=M by auto
finally have Y∩A = M by simp
with AT have M ∈ IncludedSet(X,T) {restricted to} Y
by auto}ultimately have M ∈ IncludedSet(X,T) {restricted to} Y by auto}
thus IncludedSet(Y∩X, Y∩T) ⊆ IncludedSet(X,T) {restricted to} Y by
auto
qed
end

57

More examples in topology

theory Topology_ZF_examples_1
imports Topology_ZF_1 Order_ZF
begin

In this theory file we reformulate the concepts related to a topology inrelation with a base of the topology and we give examples of topologies
defined by bases or subbases.

57.1

New ideas using a base for a topology

57.2

The topology of a base

Given a family of subsets satisfiying the base condition, it is posible toconstruct a topology where that family is a base. Even more, it is the only
topology with such characteristics.
definition
TopologyWithBase (TopologyBase _ 50) whereU {satisfies the base condition} =⇒ TopologyBase U ≡ THE T. U {is abase for} T
theorem Base_topology_is_a_topology:
assumes U {satisfies the base condition}shows (TopologyBase U) {is a topology} and U {is a base for} (TopologyBase
U)
proof -

723

from assms obtain T where U {is a base for} T using
Top_1_2_T1(2) by blast
then have ∃ !T. U {is a base for} T using same_base_same_top ex1I[whereP=
λT. U {is a base for} T] by blast
with assms show U {is a base for} (TopologyBase U)

using theI[whereP=
λT. U {is a base for} T] TopologyWithBase_def by autowith assms show (TopologyBase U) {is a topology} using Top_1_2_T1(1)IsAbaseFor_def by autoqed

A base doesn’t need the empty set.
lemma base_no_0:
shows B{is a base for}T ←→ (B-{0}){is a base for}T
proof {
fix M
Sassume M∈{ A . A ∈ Pow(B)}Sthen obtain
S Q where M= QQ∈Pow(B) by auto
hence M= S
(Q-{0})Q-{0}∈Pow(B-{0}) by auto
hence M∈{ A . A ∈ Pow(B - {0})} by auto}
S
S
hence { A . A ∈ Pow(B)} ⊆ { A . A ∈ Pow(B - {0})} by blast
moreover{fix M
Sassume M∈{ A . A ∈ Pow(B-{0})}Sthen obtain
S Q where M= QQ∈Pow(B-{0}) by auto
hence M= S(Q)Q∈Pow(B) by auto
hence M∈{ A . A ∈ Pow(B)} by auto}
S
S
hence { A . A ∈ Pow(B - {0})} ⊆ { A . A ∈ Pow(B)}by autoS
S
ultimately have { A . A ∈ Pow(B - {0})} = { A . A ∈ Pow(B)} by auto
then show B{is a base for}T ←→ (B-{0}){is a base for}T using IsAbaseFor_def
by autoqed

The interior of a set is the union of all the sets of the base which are fully
contained by it.
lemma interior_set_base_topology:
assumes U {is a baseSfor} TT{is a topology}
shows Interior(A,T)= {T∈U. T⊆A}
proof
have {T∈U. T⊆A}⊆U by
S autowith assms(1) have{T∈U. T⊆A}∈T
using IsAbaseFor_def by auto
moreover

724

S
have
{T∈U. T⊆A}⊆A by blast S
with calculation assms(2) show
{T∈U. T⊆A}⊆Interior(A,T)
using topology0.Top_2_L5 topology0_def by auto{
fix x
assume x∈Interior(A,T)
with assms obtain V where V∈UV⊆Interior(A,T)x∈V
using point_open_base_neightopology0.Top_2_L2 topology0_def by blast
with assms have V∈Ux∈VV⊆A using topology0.Top_2_L1 topology0_defby(safe,blast)S
hence x∈ {T∈U. T⊆A} by auto}S
thus Interior(A, T) ⊆{T ∈ U . T ⊆ A} by autoqed

In the following, we offer another lemma about the closure of a set given a basis for a topology. This lemma is based on cl_inter_neigh and inter_neigh_cl.
It states that it is only necessary to check the sets of the base, not all theopen sets.
lemma closure_set_base_topology:S
assumes U {is a base for}S QQ{is a topology}A⊆ Q
shows Closure(A,Q)={x∈ Q. ∀ T∈U. x∈T−→A∩T6=0}
proof
{
fix x
assume A:x∈Closure(A,Q) S
with assms(2,3) have B:x∈ Q using topology0_def topology0.Top_3_L11(1)by blast
moreover{fix Tassume T∈Ux∈T
with assms(1) have T∈Qx∈T using base_sets_open
by autowith assms(2,3) A have A∩T6=0 using topology0_def
topology0.cl_inter_neigh[where U=T and T=Q and A=A]
by auto}hence ∀ T∈U. x∈T−→A∩T6
S=0 by auto
ultimately have x∈{x∈ Q. ∀ T∈U. x∈T−→A∩T6=0} by auto}S
thus Closure(A, Q) ⊆{x∈ Q. ∀ T∈U. x∈T−→A∩T6=0}
by auto{fix x
Sassume AS:x∈{x∈
Q . ∀ T∈U. x ∈ T −→ A ∩ T 6= 0}
Shence x∈ Q by blast
moreover

725

{
fix R
assume R∈Q
S
with assms(1) obtain W where RR:W⊆UR= W using
IsAbaseFor_def by auto{
assume x∈Rwith RR(2) obtain WW where TT:WW∈Wx∈WW by auto{
assume R∩A=0
with RR(2) TT(1) have WW∩A=0 by autowith TT(1) RR(1)S have WW∈UWW∩A=0 by autowith AS have x∈ Q-WW by autowith TT(2) have False by auto}
hence R∩A6=0 by auto}}
hence ∀ U∈Q. x∈U −→ U∩A6=0 by autowith calculation assms(2,3) have x∈Closure(A,Q) using topology0_def
topology0.inter_neigh_cl by auto}S
then show {x ∈Q . ∀ T∈U. x ∈ T −→ A ∩ T 6= 0}⊆Closure(A,Q)
by autoqed

The restriction of a base is a base for the restriction.
lemma subspace_base_topology:
assumes B{is a base for}Tshows (B{restricted to}Y){is a base for}(T{restricted to}Y)
proof {
fix t
Sassume t∈RepFun({ A . A ∈ Pow(B)},(∩)(Y))
S
then obtain x where A:t=Y∩xx∈{A.
A ∈ Pow(B)} by autoS
then obtain A where B:x=AA∈Pow(B)byautoSfrom A(1) B(1) have t= (A {restricted to} Y) using RestrictedTo_def
by autoSwith B(2) have t∈{ A . A ∈ Pow(RepFun(B, (∩)(Y)))} unfolding RestrictedTo_def
by blast}
S
S
hence RepFun({ A . A ∈ Pow(B)}, (∩)(Y)) ⊆ { A . A ∈ Pow(RepFun(B,(∩)(Y)))} by(auto+)
moreover{fix t
Sassume t∈{ A . A ∈ Pow(RepFun(B, (∩)(Y)))} S
then obtain A where A:A⊆ B{restricted to}Yt= A using RestrictedTo_def
by auto726

let AA={C∈B. Y∩C∈A}
from A(1) have AA⊆BA=AA {restricted to}Y using RestrictedTo_def
by autoSwith A(2) have AA⊆Bt=
S (AA {restricted to}Y) by auto
then have AA⊆Bt=Y∩(AA) using RestrictedTo_def by autoS
hence t∈RepFun({ A . A ∈ Pow(B)}, (∩)(Y)) by auto}
S
S
hence { A . A ∈ Pow(RepFun(B, (∩)(Y)))} ⊆ RepFun({ A . A ∈ Pow(B)},(∩)(Y)) by (auto+)SS
ultimately have { A . A ∈ Pow(RepFun(B, (∩)(Y)))} = RepFun({ A . A∈ Pow(B)}, (∩)(Y)) by autowith assms show thesis using RestrictedTo_def IsAbaseFor_def by autoqed

If the base of a topology is contained in the base of another topology, then
the topologies maintain the same relation.
theorem base_subset:
assumes B{is a base for}TB2{is a base for}T2B⊆B2shows T⊆T2
proof
{
fix x
assume x∈TS
with assms(1) obtain M where
S M⊆Bx= M using IsAbaseFor_def by autowith assms(3) have M⊆B2x= M by autowith assms(2) show x∈T2 using IsAbaseFor_def by auto
}
qed

57.3

Dual Base for Closed Sets

A dual base for closed sets is the collection of complements of sets of a basefor the topology.
definition
DualBase (DualBase _ _ 80) whereS
S
B{is a base for}T =⇒ DualBase B T≡{ T-U. U∈B}∪{ T}

lemma closed_inter_dual_base:assumes D{is closed in}TB{is a base
T for}T
obtains M where M⊆DualBase B TD= M
proof VT
assume K: M. M ⊆ DualBase B T =⇒ D =M =⇒ thesis{
S
assume AS:D6= T
S S
from assms(1)T) T-D∈T using IsClosed_def by auto
S
Shave D:D∈Pow(
S
hence A: T-( T-D)=D T-D∈T by auto
S
S
with assms(2) obtain Q where QQ:Q∈Pow(B) T-D= Q using IsAbaseFor_def
by auto727

{assume Q=0S
then have
Q=0 byS autowith QQ(2) have ST-D=0 by autowith D(1) have D= T by autowith AS have False by auto}
hence QNN:Q6=0 by auto S S
from QQ(2) A(1) have
T S D= T- Q by autowith QNN have D= { T-R. R∈Q} by auto
moreoverS
with assms(2) QQ(1) have { T-R. R∈Q}⊆DualBase B T using DualBase_def
by autowith calculation K have thesis by auto}
moreover{S
assume AS:D= T
Swith assms(2) have { T}⊆DualBase B T using DualBase_def by auto
moreover
S
T S
have
T =
{ T} by autowith calculation K AS have thesis by auto}
ultimately show thesis by autoqed

We have already seen for a base that whenever there is a union of open sets,
we can consider only basic open sets due to the fact that any open set is aunion of basic open sets. What we should expect now is that when there isan intersection of closed sets, we can consider only dual basic closed sets.
lemma closure_dual_base:S
assumes U {is a base
T for} QQ{is a topology}A⊆ Q
shows Closure(A,Q)= {T∈DualBase U Q. A⊆T}
proof
S
from assms(1) have T: Q∈DualBase U Q using DualBase_def by auto
moreover{fix Tassume A:T∈DualBase U Q A⊆TSSwith assms(1) obtain R where (T= Q-R∧R∈U)∨T= Q using DualBase_def
by autoSwith A(2) assms(1,2) have (T{is closed in}Q)A⊆TT∈Pow( Q) using
topology0.Top_3_L1 topology0_def
topology0.Top_3_L9 base_sets_open by auto}S
then have SUB:{T∈DualBase U Q. A⊆T}⊆{T∈Pow( Q). (T{is closed in}Q)∧A⊆T}
by blast
TS
Twith calculation assms(3) have
{T∈Pow( Q). (T{is closed in}Q)∧A⊆T}⊆ {T∈DualBase
U Q. A⊆T}728

by autoTthen show Closure(A,Q)⊆ {T∈DualBase U Q. A⊆T} using Closure_def ClosedCovers_def
by auto{fix x
Tassume A:x∈ {T∈DualBase U Q. A⊆T}{
fix T
assume B:x∈TT∈U{
assume C:A∩T=0
S
from B(2) assms(1) have
Q-T∈DualBase U Q using DualBase_def
by automoreoverS
from C assms(3) have A⊆ Q-T by auto
moreoverS
from B(1) have x∈/ TQ-T by auto
ultimately have x∈/ {T∈DualBase U Q. A⊆T} by autowith A have False by auto}
hence A∩T6=0 by auto}
hence ∀ T∈U. x∈T−→A∩T6=0 by auto
moreoverS
from T A assms(3) have x∈ Q by autowith calculation assms have x∈Closure(A,Q) using closure_set_base_topology
by auto}T
thus{T ∈ DualBase U Q . A ⊆ T} ⊆ Closure(A, Q) by auto
qed

57.4

Partition topology

In the theory file Partitions ZF.thy; there is a definition to work with partitions. In this setting is much easier to work with a family of subsets.
definition
IsAPartition (_{is a partitionSof}_ 90) where(U {is a partition of} X) ≡ ( U=X ∧ (∀ A∈U. ∀ B∈U. A=B∨ A∩B=0)∧ 0∈U)/

A subcollection of a partition is a partition of its union.
lemma subpartition:
assumes U {is a partition Sof} X V⊆U
shows V{is a partition of} V
using assms unfolding IsAPartition_def by auto

A restriction of a partition is a partition. If the empty set appears it has tobe removed.
lemma restriction_partition:729

assumes U {is a partition of}X
shows ((U {restricted to} Y)-{0}) {is a partition of} (X∩Y)
using assms unfolding IsAPartition_def RestrictedTo_def
by fastGiven a partition, the complement of a union of a subfamily is a union of a
subfamily.
lemma diff_union_is_union_diff:assumes R⊆P
S P S{is a partition of} X
shows X R= (P-R)
proof
{
fix x
S
assume x∈X - S R
hence P:x∈Xx∈/ R by auto{
fix T
assume T∈R
with P(2) have x∈T/ by auto}with P(1) assms(2) obtain Q where Q∈(P-R)x∈Q using IsAPartition_def
by autoS
hence x∈ (P-R) by auto}
S S
thus X R⊆ (P-R) by auto
{
fix x
S
assume x∈ (P-R)
then obtain Q where Q∈P-Rx∈Q by auto
hence C: Q∈PQS∈Rx∈Q/
by autothen have x∈ P by autowith assms(2) have x∈X using IsAPartition_def by auto
moreover{S
assume x∈ Rthen obtain t where G:t∈R x∈t by autowith C(3) assms(1) have t∩Q6=0t∈P by autowith assms(2) C(1,3) have t=Q using IsAPartition_def
by blastwith C(2) G(1) have False by auto}S
hence x∈/ R by auto S
ultimately have x∈X- R by auto
}
S
S
thus
(P-R)⊆X R by auto
qed

730

57.5

Partition topology is a topology.

A partition satisfies the base condition.
lemma partition_base_condition:
assumes P {is a partition of} X
shows P {satisfies the base condition}
proof {
fix U V
assume AS:U∈P∧V∈P
with assms have A:U=V∨ U∩V=0 using IsAPartition_def by auto{
fix x
assume ASS:x∈U∩V
with A have U=V by autowith AS ASS have U∈Px∈U∧ U⊆U∩V by auto
hence ∃ W∈P. x∈W∧ W⊆U∩V by auto}
hence (∀ x ∈ U∩V. ∃ W∈P. x∈W ∧ W ⊆ U∩V) by auto}
then show thesis using SatisfiesBaseCondition_def by auto
qed

Since a partition is a base of a topology, and this topology is uniquely determined; we can built it. In the definition we have to make sure that wehave a partition.
definition
PartitionTopology (PTopology _ _ 50) where(U {is a partition of} X) =⇒ PTopology X U ≡ TopologyBase U
theorem Ptopology_is_a_topology:
assumes U {is a partition of} X
shows (PTopology X U) {is a topology} and U {is a base for} (PTopology
X U)
using assms Base_topology_is_a_topology partition_base_condition
PartitionTopology_def by auto
lemma topology0_ptopology:
assumes U {is a partition of} X
shows topology0(PTopology X U)
using Ptopology_is_a_topology topology0_def assms by auto

57.6

Total set, Closed sets, Interior, Closure and Boundary

The topology is defined in the set X
lemma union_ptopology:
assumes
S U {is a partition of} X
shows(PTopology X U)=X

731

using assms Ptopology_is_a_topology(2) Top_1_2_L5
IsAPartition_def by auto

The closed sets are the open sets.
lemma closed_sets_ptopology:
assumes T {is a partition of} X
showsD {is closed in} (PTopology X T) ←→ D∈(PTopology X T)
prooffrom assms
have B:T{is a base for}(PTopology X T) using Ptopology_is_a_topology(2)by auto{fix D
assume D {is closed in} (PTopology X T)
with assms have A:D∈Pow(X)X-D∈(PTopology X T)
using IsClosed_def union_ptopology bySauto
from A(2) B obtain R where Q:R⊆T X-D= R using Top_1_2_L1[where
B=T and U=X-D]
by autofrom A(1) have X-(X-D)=D
by blast
Swith Q(2) have D=X- R by
S autowith Q(1) assms have D= (T-R) using diff_union_is_union_diffby autowith B show D∈(PTopology X T) using IsAbaseFor_def by auto
}
{
fix D
assume D∈(PTopology X T)
Swith B obtainS R where Q:R⊆TD= R using IsAbaseFor_def by auto
hence X-D=X- R by auto S
with Q(1) assms have X-D= (T-R) using diff_union_is_union_diffby autowith B have X-D∈(PTopology X T) using IsAbaseFor_def by auto
moreoverS
from Q have D⊆ T by autowith assms have D⊆X using IsAPartition_def by autowith calculation assms show D{is closed in} (PTopology X T)
using IsClosed_def union_ptopology by auto}qed

There is a formula for the interior given by an intersection of sets of the dualbase. Is the intersection of all the closed sets of the dual basis such thatthey do not complement A to X. Since the interior of X must be inside X,
we have to enter X as one of the sets to be intersected.
lemma interior_set_ptopology:
assumes U {is a partition of} XA⊆XT
shows Interior(A,(PTopology X U))= {T∈DualBase U (PTopology X U).
T=X∨T∪A6=X}

732

proof{fix xassume x∈Interior(A,(PTopology X U))
with assms obtain R where A:x∈RR∈(PTopology X U)R⊆A
using topology0.open_open_neigh topology0_ptopology
topology0.Top_2_L2 topology0.Top_2_L1
by autoSwith assms obtain B where B:B⊆UR= B using Ptopology_is_a_topology(2)IsAbaseFor_def by autofrom A(1,3) assms have XX:x∈XX∈{T∈DualBase U (PTopology X U). T=X∨T∪A6=X}
using union_ptopology[of UX] DualBase_def[ofU] Ptopology_is_a_topology(2)[ofUX] by (safe,blast,auto)
moreoverfrom B(2) A(1) obtain S where C:S∈Bx∈S by auto{
fix T
assume AS:T∈DualBase U (PTopology X U)T ∪A6=X
from AS(1) assms obtain w where (T=X-w∧w∈U)∨(T=X)
using DualBase_def union_ptopology Ptopology_is_a_topology(2)by autowith assms(2) AS(2)S have D:T=X-ww∈U by autofrom D(2) have w⊆ U S
by autowith assms(1) have w⊆ (PTopology X U) using Ptopology_is_a_topology(2)Top_1_2_L5[of UPTopology X U]
by autowith assms(1) have w⊆X using union_ptopology by autowith D(1) have X-T=w by autowith D(2) have X-T∈U by auto{
assume x∈X-T
with C B(1) have S∈US∩(X-T)6=0 by autowith hX-T∈Ui assms(1) have X-T=S using IsAPartition_def by autowith hX-T=wihT=X-wi have X-S=T by autowith AS(2) have X-S∪A6=X by autofrom A(3) B(2) C(1) have S⊆A by auto
hence X-A⊆X-S by autowith assms(2) have X-S∪A=X by autowith hX-S∪A6=Xi have False by auto}
then have x∈T using XX by auto}T
ultimately have x∈ {T∈DualBase U (PTopology X U). T=X∨T∪A6=X}
by auto}T
thus Interior(A,(PTopology X U))⊆ {T∈DualBase U (PTopology X U). T=X∨T∪A6=X}
by auto
{
fix x

733

T
assume p:x∈
T {T∈DualBase U (PTopology X U). T=X∨T∪A6=X}
hence noE: {T∈DualBase U (PTopology X U). T=X∨T∪A6=X}6=0 by auto{
fix T
assume T∈DualBase U (PTopology X U)
with assms(1) obtain w where T=X∨(w∈U∧T=X-w) using DualBase_def
Ptopology_is_a_topology(2) union_ptopology by autowith assms(1) have T=X∨(w∈(PTopology X U)∧T=X-w) using base_sets_open
Ptopology_is_a_topology(2) by blast
with assms(1) have T{is closed in}(PTopology X U) using topology0.Top_3_L1[where
T=PTopology X U]
topology0_ptopology topology0.Top_3_L9[where T=PTopology X U]
union_ptopology
by auto}moreoverfrom assms(1) p have X∈{T∈DualBase U (PTopology X U). T=X∨T∪A6=X}and
X:x∈X using Ptopology_is_a_topology(2)DualBase_def union_ptopology byT autowith calculation assms(1) have ( {T∈DualBase U (PTopology X U).
T=X∨T∪A6=X}) {is closed in}(PTopology X U)
using topology0.Top_3_L4[where K={T∈DualBase U (PTopology X U).
T=X∨T∪A6=X}] topology0_ptopology[where U=U and X=X]
by autoTwith assms(1) have ab:( {T∈DualBase U (PTopology X U). T=X∨T∪A6=X})∈(PTopology
X U)
using closed_sets_ptopology by auto T
with assms(1) obtain
B where B∈Pow(U)( {T∈DualBase U (PTopology
S
X U). T=X∨T∪A6=X})= B
using Ptopology_is_a_topology(2)T IsAbaseFor_def by autowith p obtain R where x∈RR∈UR⊆( {T∈DualBase U (PTopology X U).
T=X∨T∪A6=X})
by autoTwith assms(1) have R:x∈RR∈(PTopology X U)R⊆( {T∈DualBase U (PTopology
X U). T=X∨T∪A6=X})X-R∈DualBase U (PTopology X U)
using base_sets_open Ptopology_is_a_topology(2) DualBase_def union_ptopologyby (safe,blast,simp,blast){assume (X-R) ∪A6=X
with R(4) have X-R∈{T∈DualBase U (PTopology X U). T=X∨T∪A6=X} by
auto
T
hence
{T∈DualBase U (PTopology X U). T=X∨T∪A6=X}⊆X-R by autowith R(3) have R⊆X-R using subset_trans[where A=R and C=X-R] by
auto
hence R=0 by blast
with R(1) have False by auto}
hence I:(X-R) ∪A=X by auto{734

fix yassume ASR:y∈R S
with R(2) have y∈ (PTopology X U) by autowith assms(1) have XX:y∈X using union_ptopology by autowith I have y∈(X-R) ∪A by autowith XX have y∈R∨y∈A/
by autowith ASR have y∈A by auto}
hence R⊆A by autowith R(1,2) have ∃ R∈(PTopology X U). (x∈R∧R⊆A) by autowith assms(1) have x∈Interior(A,(PTopology X U)) using topology0.Top_2_L6
topology0_ptopology by auto}T
thus
{T ∈ DualBase U PTopology X U . T = X ∨ T ∪ A 6= X} ⊆ Interior(A,PTopology X U)
by autoqed

The closure of a set is the union of all the sets of the partition which intersectwith A.

lemma closure_set_ptopology:
assumes U {is a partition of} XA⊆X
S
shows Closure(A,(PTopology X U))= {T∈U. T∩A6=0}
proof
{
fix x
assume A:x∈Closure(A,(PTopology
X U))
Swith assms have x∈ (PTopology X U) using topology0.Top_3_L11(1)[where
T=PTopology X U
and A=A] topology0_ptopology
union_ptopology by autoSwith assms(1) have x∈ U using Top_1_2_L5[where B=U and T=PTopology
X U] Ptopology_is_a_topology(2) by auto
then obtain W where B:x∈WW∈U by autowith A have x∈Closure(A,(PTopology X U))∩W by auto
moreoverfrom assms B(2) have W∈(PTopology X U)A⊆X using base_sets_open Ptopology_is_a_topologyby (safe,blast)with calculation assms(1) have A∩W6=0 using topology0_ptopology[where
U=U and X=X]
topology0.cl_inter_neighunion_ptopology by autoSwith B have x∈ {T∈U. T∩A6=0} by blast}
S
thus Closure(A, PTopology X U) ⊆{T ∈ U . T ∩ A 6= 0} by auto
{
fix x
S
assume x∈ {T ∈ U . T ∩ A 6= 0}
then obtain T whereS A:x∈TT∈UT∩A6=0 by autofrom assms have A⊆ (PTopology X U) using union_ptopology by auto
moreover735

Sfrom A(1,2) assms(1) have x∈ (PTopology X U) using Top_1_2_L5[where
B=U and T=PTopology X U]
Ptopology_is_a_topology(2) by auto
moreover{fix Q
assume B:Q∈(PTopology X U)x∈Q
S
with assms(1) obtain M where C:Q= MM⊆U using
Ptopology_is_a_topology(2)IsAbaseFor_def by autofrom B(2) C(1) obtain R where D:R∈Mx∈R by autowith C(2) A(1,2) have R∩T6=0R∈UT∈U by autowith assms(1) have R=T using IsAPartition_def by autowith C(1) D(1) have T⊆Q by autowith A(3) have Q∩A6=0 by auto}
then have ∀ Q∈(PTopology X U). x∈Q −→ Q∩A6=0 by autowith calculation assms(1) have x∈Closure(A,(PTopology X U)) using
topology0.inter_neigh_cl
topology0_ptopology by auto}S
then show{T ∈ U . T ∩ A 6= 0} ⊆ Closure(A, PTopology X U) by autoqed

The boundary of a set is given by the union of the sets of the partition whichhave non empty intersection with the set but that are not fully contained init. Another equivalent statement would be: the union of the sets of the partition which have non empty intersection with the set and its complement.
lemma boundary_set_ptopology:
assumes U {is a partition of} XA⊆XS
shows Boundary(A,(PTopology X U))= {T∈U. T∩A6=0 ∧ ~(T⊆A)}
proof S
from assms have Closure(A,(PTopology X U))= {T ∈ U . T ∩ A 6= 0} using
closure_set_ptopology by auto
moreoverS
from assms(1) have Interior(A,(PTopology X U))= {T ∈ U . T ⊆ A} using
interior_set_base_topology Ptopology_is_a_topology[where U=U and
X=X] by autoSwith calculation
S assms have A:Boundary(A,(PTopology X U))= {T ∈ U. T ∩ A 6= 0} {T ∈ U . T ⊆ A}
using topology0.Top_3_L12 topology0_ptopology union_ptopology
by autoS
from assms(1) have ({T ∈ U . T ∩ A 6= 0}) {is a partition of}({T∈ U . T ∩ A 6= 0})
using subpartition by blast
moreover{736

fix T
assume T∈UT⊆A
with assms(1) have T∩A=TT6=0 using IsAPartition_def by autowith hT∈Ui have T∩A6=0T∈U by auto}
then have {T ∈ US . T ⊆ A}⊆{T ∈ U . T ∩ S
A 6= 0} by auto S
ultimately have
{T ∈ U . T ∩ A 6= 0} {T ∈ U . T ⊆ A}= (({T ∈U . T ∩ A 6= 0})-({T ∈ U . T ⊆ A}))
using diff_union_is_union_diffby autoS
also have . . .= ({T ∈ U . T ∩ A 6= 0 ∧ ~(T⊆A)}) by blast
with calculation A show thesis by auto
qed

57.7

Special cases and subspaces

The discrete and the indiscrete topologies appear as special cases of thispartition topologies.
lemma discrete_partition:shows {{x}.x∈X} {is a partition of}X
using IsAPartition_def by auto
lemma indiscrete_partition:
assumes X6=0
shows {X} {is a partition of} X
using assms IsAPartition_def by auto
theorem discrete_ptopology:
shows (PTopology X {{x}.x∈X})=Pow(X)
proof
{
fix t
assume t∈(PTopology
X {{x}.x∈X})
S
hence t⊆ (PTopology X {{x}.x∈X}) by auto
then have t∈Pow(X) using union_ptopology
discrete_partition by auto}
thus (PTopology X {{x}.x∈X})⊆Pow(X) by auto{
fix t
assumeS A:t∈Pow(X)have({{x}. x∈t})=t by auto
moreoverfrom AShave {{x}. x∈t}∈Pow({{x}.x∈X})
by autoS
hence({{x}. x∈t})∈{ A . A ∈ Pow({{x} . x ∈ X})} by auto
ultimately
have t∈(PTopology X {{x} . x ∈ X}) using Ptopology_is_a_topology(2)discrete_partition IsAbaseFor_def by auto}
thus Pow(X) ⊆ (PTopology X {{x} . x ∈ X}) by auto

737

qed
theorem indiscrete_ptopology:
assumes X6=0
shows (PTopology X {X})={0,X}
proof
{
fix T
assume T∈(PTopology X {X})S
with assms obtain M where M⊆{X} M=T using Ptopology_is_a_topology(2)indiscrete_partition IsAbaseFor_def by auto
then have T=0∨T=X by auto}
then show (PTopology X {X})⊆{0,X} by autofrom assms have 0∈(PTopology X {X}) using Ptopology_is_a_topology(1)empty_open
indiscrete_partition by auto
moreoverS
from assms have
(PTopology X {X})∈(PTopology X {X}) using union_open
Ptopology_is_a_topology(1)indiscrete_partition by autowith assms have X∈(PTopology X {X}) using union_ptopology indiscrete_partition
by autoultimately show {0,X}⊆(PTopology X {X}) by autoqed

The topological subspaces of the (PTopology X U) are partition topologies.
lemma subspace_ptopology:
assumes U{is a partition of}X
shows (PTopology X U) {restricted to} Y=(PTopology (X∩Y) ((U {restrictedto} Y)-{0}))proof from assms have U{is a base for}(PTopology X U) using Ptopology_is_a_topology(2)by autothen have (U{restricted to} Y){is a base for}(PTopology X U){restrictedto} Yusing subspace_base_topology by auto
then have ((U{restricted to} Y)-{0}){is a base for}(PTopology X U){restrictedto} Y using base_no_0
by automoreoverfrom assms have ((U{restricted to} Y)-{0}) {is a partition of} (X∩Y)
using restriction_partition by auto
then have ((U{restricted to} Y)-{0}){is a base for}(PTopology (X∩Y)((U {restricted to} Y)-{0}))using Ptopology_is_a_topology(2) by auto
ultimately show thesis using same_base_same_top by auto
qed

738

57.8

Order topologies

57.9

Order topology is a topology

Given a totally ordered set, several topologies can be defined using the orderrelation. First we define an open interval, notice that the set defined as
Interval is a closed interval; and open rays.
definition
IntervalX where
IntervalX(X,r,b,c)≡(Interval(r,b,c)∩X)-{b,c}definition
LeftRayX where
LeftRayX(X,r,b)≡{c∈X. hc,bi∈r}-{b}definition
RightRayX where
RightRayX(X,r,b)≡{c∈X. hb,ci∈r}-{b}Intersections of intervals and rays.

lemma inter_two_intervals:
assumes bu∈Xbv∈Xcu∈Xcv∈XIsLinOrder(X,r)
shows IntervalX(X,r,bu,cu)∩IntervalX(X,r,bv,cv)=IntervalX(X,r,GreaterOf(r,bu,bv),SmallerO
proof
have T:GreaterOf(r,bu,bv)∈XSmallerOf(r,cu,cv)∈X using assms
GreaterOf_def SmallerOf_def by (cases hbu,bvi∈r,simp,simp,cases hcu,cvi∈r,simp,simp){
fix x
assume ASS:x∈IntervalX(X,r,bu,cu)∩IntervalX(X,r,bv,cv)
then have x∈IntervalX(X,r,bu,cu)x∈IntervalX(X,r,bv,cv) by auto
then have BB:x∈Xx∈Interval(r,bu,cu)x6=bux6=cux∈Interval(r,bv,cv)x6=bvx6=cv
using IntervalX_def assms by auto
then have x∈X by auto
moreoverhave x6=GreaterOf(r,bu,bv)x6=SmallerOf(r,cu,cv)
proof show x6=GreaterOf(r,bu,bv) using GreaterOf_def BB(6,3) by (cases
hbu,bvi∈r,simp+)
show x6=SmallerOf(r,cu,cv) using SmallerOf_def BB(7,4) by (cases
hcu,cvi∈r,simp+)
qed
moreoverhave hbu,xi∈rhx,cui∈rhbv,xi∈rhx,cvi∈r using BB(2,5) Order_ZF_2_L1A
by autothen have hGreaterOf(r,bu,bv),xi∈rhx,SmallerOf(r,cu,cv)i∈r using GreaterOf_def
SmallerOf_defby (cases hbu,bvi∈r,simp,simp,cases hcu,cvi∈r,simp,simp)
then have x∈Interval(r,GreaterOf(r,bu,bv),SmallerOf(r,cu,cv)) using Order_ZF_2_L1 by auto
ultimately
have x∈IntervalX(X,r,GreaterOf(r,bu,bv),SmallerOf(r,cu,cv)) using739

IntervalX_def T by auto}
then show IntervalX(X, r, bu, cu) ∩ IntervalX(X, r, bv, cv) ⊆ IntervalX(X,r, GreaterOf(r, bu, bv), SmallerOf(r, cu, cv))
by auto{fix x
assume x∈IntervalX(X,r,GreaterOf(r,bu,bv),SmallerOf(r,cu,cv))
then have BB:x∈Xx∈Interval(r,GreaterOf(r,bu,bv),SmallerOf(r,cu,cv))x6=GreaterOf(r,bu,bvusing IntervalX_def T by auto
then have x∈X by auto
moreoverfrom BB(2) have CC:hGreaterOf(r,bu,bv),xi∈rhx,SmallerOf(r,cu,cv)i∈rusing Order_ZF_2_L1A by auto{{
assume AS:hbu,bvi∈rthen have GreaterOf(r,bu,bv)=bv using GreaterOf_def by auto
then have hbv,xi∈r using CC(1) by autowith AS have hbu,xi∈r hbv,xi∈r using assms IsLinOrder_def trans_defby (safe, blast)}moreover{assume AS:hbu,bvi∈r/then have GreaterOf(r,bu,bv)=bu using GreaterOf_def by auto
then have hbu,xi∈r using CC(1) by autofrom AS have hbv,bui∈r using assms IsLinOrder_def IsTotal_def
assms by autowith hhbu,xi∈ri have hbu,xi∈r hbv,xi∈r using assms IsLinOrder_def
trans_def by (safe, blast)}
ultimately have R:hbu,xi∈r hbv,xi∈r by auto
moreover{assume AS:x=bu
then have hbv,bui∈r using R(2) by auto
then have GreaterOf(r,bu,bv)=bu using GreaterOf_def assms IsLinOrder_def
antisym_def by auto
then have False using AS BB(3) by auto}
moreover{assume AS:x=bv
then have hbu,bvi∈r using R(1) by auto
then have GreaterOf(r,bu,bv)=bv using GreaterOf_def by auto
then have False using AS BB(3) by auto}
ultimately have hbu,xi∈r hbv,xi∈rx6=bux6=bv by auto740

}
moreover{{assume AS:hcu,cvi∈rthen have SmallerOf(r,cu,cv)=cu using SmallerOf_def by auto
then have hx,cui∈r using CC(2) by autowith AS have hx,cui∈r hx,cvi∈r using assms IsLinOrder_def trans_defby(safe ,blast)}moreover{assume AS:hcu,cvi∈r/then have SmallerOf(r,cu,cv)=cv using SmallerOf_def by auto
then have hx,cvi∈r using CC(2) by autofrom AS have hcv,cui∈r using assms IsLinOrder_def IsTotal_def
by autowith hhx,cvi∈ri have hx,cvi∈r hx,cui∈r using assms IsLinOrder_def
trans_def by(safe ,blast)}
ultimately have R:hx,cvi∈r hx,cui∈r by auto
moreover{assume AS:x=cv
then have hcv,cui∈r using R(2) by auto
then have SmallerOf(r,cu,cv)=cv using SmallerOf_def assms IsLinOrder_def
antisym_def by auto
then have False using AS BB(4) by auto}
moreover{assume AS:x=cu
then have hcu,cvi∈r using R(1) by auto
then have SmallerOf(r,cu,cv)=cu using SmallerOf_def by auto
then have False using AS BB(4) by auto}
ultimately have hx,cui∈r hx,cvi∈rx6=cux6=cv by auto}
ultimately
have x∈IntervalX(X,r,bu,cu) x∈IntervalX(X,r,bv,cv) using Order_ZF_2_L1
IntervalX_def
assms by auto
then have x∈IntervalX(X, r, bu, cu) ∩ IntervalX(X, r, bv, cv) by
auto}
then show IntervalX(X,r,GreaterOf(r,bu,bv),SmallerOf(r,cu,cv)) ⊆ IntervalX(X,r, bu, cu) ∩ IntervalX(X, r, bv, cv)
by autoqed

741

lemma inter_rray_interval:
assumes bv∈Xbu∈Xcv∈XIsLinOrder(X,r)
shows RightRayX(X,r,bu)∩IntervalX(X,r,bv,cv)=IntervalX(X,r,GreaterOf(r,bu,bv),cv)
proof
{
fix x
assume x∈RightRayX(X,r,bu)∩IntervalX(X,r,bv,cv)
then have x∈RightRayX(X,r,bu)x∈IntervalX(X,r,bv,cv) by auto
then have BB:x∈Xx6=bux6=bvx6=cvhbu,xi∈rx∈Interval(r,bv,cv) using RightRayX_def
IntervalX_def
by autothen have hbv,xi∈rhx,cvi∈r using Order_ZF_2_L1A by autowith hhbu,xi∈ri have hGreaterOf(r,bu,bv),xi∈r using GreaterOf_def by(cases hbu,bvi∈r,simp+)
with hhx,cvi∈ri have x∈Interval(r,GreaterOf(r,bu,bv),cv) using Order_ZF_2_L1
by autothen have x∈IntervalX(X,r,GreaterOf(r,bu,bv),cv) using BB(1-4) IntervalX_def
GreaterOf_defby (simp)}
then show RightRayX(X, r, bu) ∩ IntervalX(X, r, bv, cv) ⊆ IntervalX(X,r, GreaterOf(r, bu, bv), cv) by auto{
fix x
assume x∈IntervalX(X, r, GreaterOf(r, bu, bv), cv)
then have x∈Xx∈Interval(r,GreaterOf(r, bu, bv), cv)x6=cvx6=GreaterOf(r,bu, bv) using IntervalX_def by auto
then have R:hGreaterOf(r, bu, bv),xi∈rhx,cvi∈r using Order_ZF_2_L1A
by autowith hx6=cvi have hx,cvi∈rx6=cv by auto
moreover{{assume AS:hbu,bvi∈rthen have GreaterOf(r,bu,bv)=bv using GreaterOf_def by auto
then have hbv,xi∈r using R(1) by autowith AS have hbu,xi∈r hbv,xi∈r using assms unfolding IsLinOrder_def
trans_def by (safe,blast)}moreover{assume AS:hbu,bvi∈r/then have GreaterOf(r,bu,bv)=bu using GreaterOf_def by auto
then have hbu,xi∈r using R(1) by autofrom AS have hbv,bui∈r using assms unfolding IsLinOrder_def IsTotal_def
using assms by autowith hhbu,xi∈ri have hbu,xi∈r hbv,xi∈r using assms unfolding IsLinOrder_def
trans_def by (safe,blast)742

}
ultimately have T:hbu,xi∈r hbv,xi∈r by auto
moreover{assume AS:x=bu
then have hbv,bui∈r using T(2) by auto
then have GreaterOf(r,bu,bv)=bu unfolding GreaterOf_def using
assms unfolding IsLinOrder_def
antisym_def by autowith hx6=GreaterOf(r,bu,bv)i have False using AS by auto}
moreover{assume AS:x=bv
then have hbu,bvi∈r using T(1) by auto
then have GreaterOf(r,bu,bv)=bv unfolding GreaterOf_def by autowith hx6=GreaterOf(r,bu,bv)i have False using AS by auto}
ultimately have hbu,xi∈r hbv,xi∈rx6=bux6=bv by auto}with calculation hx∈Xi have x∈RightRayX(X, r, bu)x∈IntervalX(X, r,bv, cv) unfolding RightRayX_def IntervalX_def
using Order_ZF_2_L1 by auto
then have x∈RightRayX(X, r, bu) ∩ IntervalX(X, r, bv, cv) by auto}
then show IntervalX(X, r, GreaterOf(r, bu, bv), cv) ⊆ RightRayX(X,r, bu) ∩ IntervalX(X, r, bv, cv) by autoqed

lemma inter_lray_interval:
assumes bv∈Xcu∈Xcv∈XIsLinOrder(X,r)
shows LeftRayX(X,r,cu)∩IntervalX(X,r,bv,cv)=IntervalX(X,r,bv,SmallerOf(r,cu,cv))
proof{
fix x assume x∈LeftRayX(X,r,cu)∩IntervalX(X,r,bv,cv)
then have B:x6=cux∈Xhx,cui∈rhbv,xi∈rhx,cvi∈rx6=bvx6=cv unfolding LeftRayX_def
IntervalX_def Interval_def
by autofrom hhx,cui∈ri hhx,cvi∈ri have C:hx,SmallerOf(r, cu, cv)i∈r using SmallerOf_defby (cases hcu,cvi∈r,simp+)
from B(7,1) have x6=SmallerOf(r,cu,cv) using SmallerOf_def by (cases
hcu,cvi∈r,simp+)
then have x∈IntervalX(X,r,bv,SmallerOf(r,cu,cv)) using B C IntervalX_def
Order_ZF_2_L1 by auto}
then show LeftRayX(X, r, cu) ∩ IntervalX(X, r, bv, cv) ⊆ IntervalX(X,r, bv, SmallerOf(r, cu, cv)) by auto{743

fix x assume x∈IntervalX(X,r,bv,SmallerOf(r,cu,cv))
then have R:x∈Xhbv,xi∈rhx,SmallerOf(r,cu,cv)i∈rx6=bvx6=SmallerOf(r,cu,cv)
using IntervalX_def Interval_def
by autothen have hbv,xi∈rx6=bv by auto
moreover{{assume AS:hcu,cvi∈rthen have SmallerOf(r,cu,cv)=cu using SmallerOf_def by auto
then have hx,cui∈r using R(3) by autowith AS have hx,cui∈r hx,cvi∈r using assms unfolding IsLinOrder_def
trans_def by (safe, blast)}moreover{assume AS:hcu,cvi∈r/then have SmallerOf(r,cu,cv)=cv using SmallerOf_def by auto
then have hx,cvi∈r using R(3) by autofrom AS have hcv,cui∈r using assms IsLinOrder_def IsTotal_def
assms by autowith hhx,cvi∈ri have hx,cvi∈r hx,cui∈r using assms IsLinOrder_def
trans_def by (safe, blast)}
ultimately have T:hx,cvi∈r hx,cui∈r by auto
moreover{assume AS:x=cu
then have hcu,cvi∈r using T(1) by auto
then have SmallerOf(r,cu,cv)=cu using SmallerOf_def assms IsLinOrder_def
antisym_def by autowith hx6=SmallerOf(r,cu,cv)i have False using AS by auto}
moreover{assume AS:x=cv
then have hcv,cui∈r using T(2) by auto
then have SmallerOf(r,cu,cv)=cv using SmallerOf_def assms IsLinOrder_def
antisym_def by autowith hx6=SmallerOf(r,cu,cv)i have False using AS by auto}
ultimately have hx,cui∈r hx,cvi∈rx6=cux6=cv by auto}with calculation hx∈Xi have x∈LeftRayX(X,r,cu)x∈IntervalX(X, r, bv,cv) using LeftRayX_def IntervalX_def Interval_def
by autothen have x∈LeftRayX(X, r, cu) ∩ IntervalX(X, r, bv, cv) by auto}
then show IntervalX(X, r, bv, SmallerOf(r, cu, cv)) ⊆ LeftRayX(X, r,744cu) ∩ IntervalX(X, r, bv, cv)
qedby autolemma inter_lray_rray:assumes bu∈Xcv∈XIsLinOrder(X,r)
shows LeftRayX(X,r,bu)∩RightRayX(X,r,cv)=IntervalX(X,r,cv,bu)
unfolding LeftRayX_def RightRayX_def IntervalX_def Interval_def by auto
lemma inter_lray_lray:assumes bu∈Xcv∈XIsLinOrder(X,r)
shows LeftRayX(X,r,bu)∩LeftRayX(X,r,cv)=LeftRayX(X,r,SmallerOf(r,bu,cv))
proof
{
fix x
assume x∈LeftRayX(X,r,bu)∩LeftRayX(X,r,cv)then have B:x∈Xhx,bui∈rhx,cvi∈rx6=bux6=cv using LeftRayX_def by auto
then have C:hx,SmallerOf(r,bu,cv)i∈r using SmallerOf_def by (cases
hbu,cvi∈r, auto)from B have D:x6=SmallerOf(r,bu,cv) using SmallerOf_def by (cases
hbu,cvi∈r, auto)from B C D have x∈LeftRayX(X,r,SmallerOf(r,bu,cv)) using LeftRayX_def
by auto}then show LeftRayX(X, r, bu) ∩ LeftRayX(X, r, cv) ⊆ LeftRayX(X, r,
SmallerOf(r, bu, cv)) by auto{
fix x
assume x∈LeftRayX(X, r, SmallerOf(r, bu, cv))
then have R:x∈Xhx,SmallerOf(r,bu,cv)i∈rx6=SmallerOf(r,bu,cv) using
LeftRayX_def by auto{{
assume AS:hbu,cvi∈rthen have SmallerOf(r,bu,cv)=bu using SmallerOf_def by auto
then have hx,bui∈r using R(2) by autowith AS have hx,bui∈r hx,cvi∈r using assms IsLinOrder_def trans_defby(safe, blast)}moreover{assume AS:hbu,cvi∈r/then have SmallerOf(r,bu,cv)=cv using SmallerOf_def by auto
then have hx,cvi∈r using R(2) by autofrom AS have hcv,bui∈r using assms IsLinOrder_def IsTotal_def
assms by autowith hhx,cvi∈ri have hx,cvi∈r hx,bui∈r using assms IsLinOrder_def
trans_def by(safe, blast)}
ultimately have T:hx,cvi∈r hx,bui∈r by auto745

moreover{assume AS:x=bu
then have hbu,cvi∈r using T(1) by auto
then have SmallerOf(r,bu,cv)=bu using SmallerOf_def assms IsLinOrder_def
antisym_def by autowith hx6=SmallerOf(r,bu,cv)i have False using AS by auto}
moreover{assume AS:x=cv
then have hcv,bui∈r using T(2) by auto
then have SmallerOf(r,bu,cv)=cv using SmallerOf_def assms IsLinOrder_def
antisym_def by autowith hx6=SmallerOf(r,bu,cv)i have False using AS by auto}
ultimately have hx,bui∈r hx,cvi∈rx6=bux6=cv by auto}with hx∈Xi have x∈ LeftRayX(X, r, bu) ∩ LeftRayX(X, r, cv) using LeftRayX_def
by auto}then show LeftRayX(X, r, SmallerOf(r, bu, cv)) ⊆ LeftRayX(X, r, bu)∩ LeftRayX(X, r, cv) by autoqed
lemma inter_rray_rray:assumes bu∈Xcv∈XIsLinOrder(X,r)
shows RightRayX(X,r,bu)∩RightRayX(X,r,cv)=RightRayX(X,r,GreaterOf(r,bu,cv))
proof
{
fix x
assume x∈RightRayX(X,r,bu)∩RightRayX(X,r,cv)then have B:x∈Xhbu,xi∈rhcv,xi∈rx6=bux6=cv using RightRayX_def by auto
then have C:hGreaterOf(r,bu,cv),xi∈r using GreaterOf_def by (cases
hbu,cvi∈r,auto)from B have D:x6=GreaterOf(r,bu,cv) using GreaterOf_def by (cases
hbu,cvi∈r,auto)from B C D have x∈RightRayX(X,r,GreaterOf(r,bu,cv)) using RightRayX_def
by auto}then show RightRayX(X, r, bu) ∩ RightRayX(X, r, cv) ⊆ RightRayX(X,r, GreaterOf(r, bu, cv)) by auto{
fix x
assume x∈RightRayX(X, r, GreaterOf(r, bu, cv))
then have R:x∈XhGreaterOf(r,bu,cv),xi∈rx6=GreaterOf(r,bu,cv) using
RightRayX_def by auto
{
{

746

assume AS:hbu,cvi∈rthen have GreaterOf(r,bu,cv)=cv using GreaterOf_def by auto
then have hcv,xi∈r using R(2) by autowith AS have hbu,xi∈r hcv,xi∈r using assms IsLinOrder_def trans_defby(safe, blast)}moreover{assume AS:hbu,cvi∈r/then have GreaterOf(r,bu,cv)=bu using GreaterOf_def by auto
then have hbu,xi∈r using R(2) by autofrom AS have hcv,bui∈r using assms IsLinOrder_def IsTotal_def
assms by autowith hhbu,xi∈ri have hcv,xi∈r hbu,xi∈r using assms IsLinOrder_def
trans_def by(safe, blast)}
ultimately have T:hcv,xi∈r hbu,xi∈r by auto
moreover{assume AS:x=bu
then have hcv,bui∈r using T(1) by auto
then have GreaterOf(r,bu,cv)=bu using GreaterOf_def assms IsLinOrder_def
antisym_def by autowith hx6=GreaterOf(r,bu,cv)i have False using AS by auto}
moreover{assume AS:x=cv
then have hbu,cvi∈r using T(2) by auto
then have GreaterOf(r,bu,cv)=cv using GreaterOf_def assms IsLinOrder_def
antisym_def by autowith hx6=GreaterOf(r,bu,cv)i have False using AS by auto}
ultimately have hbu,xi∈r hcv,xi∈rx6=bux6=cv by auto}with hx∈Xi have x∈ RightRayX(X, r, bu) ∩ RightRayX(X, r, cv) using RightRayX_def by auto}
then show RightRayX(X, r, GreaterOf(r, bu, cv)) ⊆ RightRayX(X, r, bu)∩ RightRayX(X, r, cv) by autoqed

The open intervals and rays satisfy the base condition.
lemma intervals_rays_base_condition:
assumes IsLinOrder(X,r)
shows {IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X} {satisfies the base condition}
proof let I={IntervalX(X,r,b,c). hb,ci∈X×X}

747

let R={RightRayX(X,r,b). b∈X}
let L={LeftRayX(X,r,b). b∈X}
let B={IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X}{
fix U V
assume A:U∈BV∈B
then have dU:U∈I∨U∈L∨U∈Rand dV:V∈I∨V∈L∨V∈R by auto{
assume S:V∈I{
assume U∈Iwith S obtain bu cu bv cv where A:U=IntervalX(X,r,bu,cu)V=IntervalX(X,r,bv,cv)bu∈X
by autothen have SmallerOf(r,cu,cv)∈XGreaterOf(r,bu,bv)∈X by (cases
hcu,cvi∈r,simp add:SmallerOf_def A,simp add:SmallerOf_def A,
cases hbu,bvi∈r,simp add:GreaterOf_def A,simp add:GreaterOf_defA)with A have U∩V∈B using inter_two_intervals assms by auto}
moreover{assume U∈Lwith S obtain bu bv cv where A:U=LeftRayX(X, r,bu)V=IntervalX(X,r,bv,cv)bu∈Xbv∈Xcv
by autothen have SmallerOf(r,bu,cv)∈X using SmallerOf_def by (cases
hbu,cvi∈r,auto)with A have U∩V∈B using inter_lray_interval assms by auto}
moreover{assume U∈Rwith S obtain cu bv cv where A:U=RightRayX(X,r,cu)V=IntervalX(X,r,bv,cv)cu∈Xbv∈Xcv
by autothen have GreaterOf(r,cu,bv)∈X using GreaterOf_def by (cases
hcu,bvi∈r,auto)with A have U∩V∈B using inter_rray_interval assms by auto}
ultimately have U∩V∈B using dU by auto}
moreover{assume S:V∈L{
assume U∈Iwith S obtain bu bv cv where A:V=LeftRayX(X, r,bu)U=IntervalX(X,r,bv,cv)bu∈Xbv∈Xcv
by autothen have SmallerOf(r,bu,cv)∈X using SmallerOf_def by (cases
hbu,cvi∈r, auto)748

have U∩V=V∩U by autowith A hSmallerOf(r,bu,cv)∈Xi have U∩V∈B using inter_lray_interval
assms by auto}
moreover{assume U∈Rwith S obtain bu cv where A:V=LeftRayX(X,r,bu)U=RightRayX(X,r,cv)bu∈Xcv∈X
by autohave U∩V=V∩U by autowith A have U∩V∈B using inter_lray_rray assms by auto}
moreover{assume U∈Lwith S obtain bu bv where A:U=LeftRayX(X,r,bu)V=LeftRayX(X,r,bv)bu∈Xbv∈X
by autothen have SmallerOf(r,bu,bv)∈X using SmallerOf_def by (cases
hbu,bvi∈r, auto)with A have U∩V∈B using inter_lray_lray assms by auto}
ultimately have U∩V∈B using dU by auto}
moreover{assume S:V∈R{
assume U∈Iwith S obtain cu bv cv where A:V=RightRayX(X,r,cu)U=IntervalX(X,r,bv,cv)cu∈Xbv∈Xcv
by autothen have GreaterOf(r,cu,bv)∈X using GreaterOf_def by (cases
hcu,bvi∈r,auto)
have U∩V=V∩U by autowith A hGreaterOf(r,cu,bv)∈Xi have U∩V∈B using inter_rray_interval
assms by auto}
moreover{assume U∈Lwith S obtain bu cv where A:U=LeftRayX(X,r,bu)V=RightRayX(X,r,cv)bu∈Xcv∈X
by autothen have U∩V∈B using inter_lray_rray assms by auto}
moreover{assume U∈Rwith S obtain cu cv where A:U=RightRayX(X,r,cu)V=RightRayX(X,r,cv)cu∈Xcv∈X
by autothen have GreaterOf(r,cu,cv)∈X using GreaterOf_def by (cases

749hcu,cvi∈r,auto)with A have U∩V∈B using inter_rray_rray assms by auto}
ultimately have U∩V∈B using dU by auto}
ultimately have S:U∩V∈B using dV by auto{
fix x
assume x∈U∩Vthen have x∈U∩V∧U∩V⊆U∩V by auto
then have ∃ W. W∈(B)∧ x∈W ∧ W ⊆ U∩V using S by blast
then have ∃ W∈(B). x∈W ∧ W ⊆ U∩V by blast}
hence (∀ x ∈ U∩V. ∃ W∈(B). x∈W ∧ W ⊆ U∩V) by auto}
then show thesis using SatisfiesBaseCondition_def by auto
qed

Since the intervals and rays form a base of a topology, and this topology is
uniquely determined; we can built it. In the definition we have to make surethat we have a totally ordered set.
definition
OrderTopology (OrdTopology _ _ 50) where
IsLinOrder(X,r) =⇒ OrdTopology X r ≡ TopologyBase {IntervalX(X,r,b,c).
hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b). b∈X}

theorem Ordtopology_is_a_topology:
assumes IsLinOrder(X,r)
shows (OrdTopology X r) {is a topology} and {IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,b∈X}∪{RightRayX(X,r,b). b∈X} {is a base for} (OrdTopology X r)
using assms Base_topology_is_a_topology intervals_rays_base_condition
OrderTopology_def by auto
lemma topology0_ordtopology:
assumes IsLinOrder(X,r)
shows topology0(OrdTopology X r)
using Ordtopology_is_a_topology topology0_def assms by auto

57.10

Total set

The topology is defined in the set X, when X has more than one pointlemma union_ordtopology:
assumes
S IsLinOrder(X,r)∃ x y. x6=y ∧ x∈X∧ y∈X
shows(OrdTopology X r)=X
proof
let B={IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X}

750

have base:B {is a base for} (OrdTopology X r) using Ordtopology_is_a_topology(2)assms(1)by autofrom assms(2) obtain x y where T:x6=y ∧ x∈X∧ y∈X by auto
then have B:x∈LeftRayX(X,r,y)∨x∈RightRayX(X,r,y) using LeftRayX_def
RightRayX_def
assms(1) IsLinOrder_def
IsTotal_def by autoS
then have x∈ BS using T by auto
then have x:x∈ (OrdTopology X r) using Top_1_2_L5 base by auto{
fix z
assume z:z∈X{assume x=z S
then have z∈ (OrdTopology X r) using x by auto}
moreover{assume x6=zwith z T have z∈LeftRayX(X,r,x)∨z∈RightRayX(X,r,x)x∈X using LeftRayX_def
RightRayX_def
assms(1) IsLinOrder_def
IsTotal_def by autoS
then have z∈S B by auto
then have z∈ (OrdTopology X r) using Top_1_2_L5 base by auto}S
ultimately have z∈ (OrdTopology X r) by auto}S
then showX⊆ (OrdTopology X r) by auto
S
have
B⊆X Susing IntervalX_def LeftRayX_def RightRayX_def by auto
then show(OrdTopology X r)⊆X using Top_1_2_L5 base by autoqed

The interior, closure and boundary can be calculated using the formulas
proved in the section that deals with the base.
The subspace of an order topology doesn’t have to be an order topology.

57.11

Right order and Left order topologies.

Notice that the left and right rays are closed under intersection, hence they
form a base of a topology. They are called right order topology and leftorder topology respectively.
If the order in X has a minimal or a maximal element, is necessary toconsider X as an element of the base or that limit point wouldn’t be in any
basic open set.

751

57.11.1

Right and Left Order topologies are topologies

lemma leftrays_base_condition:
assumes IsLinOrder(X,r)
shows {LeftRayX(X,r,b). b∈X}∪{X} {satisfies the base condition}
proof {
fix U V
assume U∈{LeftRayX(X,r,b). b∈X}∪{X}V∈{LeftRayX(X,r,b). b∈X}∪{X}
then obtain b c where A:(b∈X∧U=LeftRayX(X,r,b))∨U=X(c∈X∧V=LeftRayX(X,r,c))∨V=XU⊆XV⊆X
unfolding LeftRayX_def by auto
then have (U∩V=LeftRayX(X,r,SmallerOf(r,b,c))∧b∈X∧c∈X)∨U∩V=X∨(U∩V=LeftRayX(X,r,c)∧c∈using inter_lray_lray assms by auto
moreoverhave b∈X∧c∈X −→ SmallerOf(r,b,c)∈X unfolding SmallerOf_def by (cases
hb,ci∈r,auto)
ultimately have U∩V∈{LeftRayX(X,r,b). b∈X}∪{X} by auto
hence ∀ x∈U∩V. ∃ W∈{LeftRayX(X,r,b). b∈X}∪{X}. x∈W∧W⊆U∩V by blast}
moreoverthen show thesis using SatisfiesBaseCondition_def by autoqed

lemma rightrays_base_condition:
assumes IsLinOrder(X,r)
shows {RightRayX(X,r,b). b∈X}∪{X} {satisfies the base condition}
proof {
fix U V
assume U∈{RightRayX(X,r,b). b∈X}∪{X}V∈{RightRayX(X,r,b). b∈X}∪{X}
then obtain b c where A:(b∈X∧U=RightRayX(X,r,b))∨U=X(c∈X∧V=RightRayX(X,r,c))∨V=XU⊆XV⊆
unfolding RightRayX_def by auto
then have (U∩V=RightRayX(X,r,GreaterOf(r,b,c))∧b∈X∧c∈X)∨U∩V=X∨(U∩V=RightRayX(X,r,c)∧using inter_rray_rray assms by auto
moreoverhave b∈X∧c∈X −→ GreaterOf(r,b,c)∈X using GreaterOf_def by (cases
hb,ci∈r,auto)
ultimately have U∩V∈{RightRayX(X,r,b). b∈X}∪{X} by auto
hence ∀ x∈U∩V. ∃ W∈{RightRayX(X,r,b). b∈X}∪{X}. x∈W∧W⊆U∩V by blast}
then show thesis using SatisfiesBaseCondition_def by autoqed
definition
LeftOrderTopology (LOrdTopology _ _ 50) where
IsLinOrder(X,r) =⇒ LOrdTopology X r ≡ TopologyBase {LeftRayX(X,r,b).
b∈X}∪{X}definition752

RightOrderTopology (ROrdTopology _ _ 50) where
IsLinOrder(X,r) =⇒ ROrdTopology X r ≡ TopologyBase {RightRayX(X,r,b).
b∈X}∪{X}theorem LOrdtopology_ROrdtopology_are_topologies:
assumes IsLinOrder(X,r)
shows (LOrdTopology X r) {is a topology} and {LeftRayX(X,r,b). b∈X}∪{X}{is a base for} (LOrdTopology X r)and (ROrdTopology X r) {is a topology} and {RightRayX(X,r,b). b∈X}∪{X}{is a base for} (ROrdTopology X r)
using Base_topology_is_a_topology leftrays_base_condition assms rightrays_base_condition
LeftOrderTopology_def RightOrderTopology_def by auto
lemma topology0_lordtopology_rordtopology:
assumes IsLinOrder(X,r)
shows topology0(LOrdTopology X r) and topology0(ROrdTopology X r)
using LOrdtopology_ROrdtopology_are_topologies topology0_def assms by
auto

57.11.2

Total set

The topology is defined on the set X
lemma union_lordtopology_rordtopology:
assumes
S IsLinOrder(X,r)
S
shows(LOrdTopology X r)=X and(ROrdTopology X r)=X
using Top_1_2_L5[OF LOrdtopology_ROrdtopology_are_topologies(2)[OF assms]]
Top_1_2_L5[OF LOrdtopology_ROrdtopology_are_topologies(4)[OF assms]]
unfolding LeftRayX_def RightRayX_def by auto

57.12

Union of Topologies

The union of two topologies is not a topology. A way to overcome this fact
is to define the following topology:
definition
joinT (joinT _ 90) where
S S
S(∀ T∈M. T{is a topology} ∧ (∀ Q∈M.
Q= T)) =⇒ (joinT M ≡ THE T. ( M){isa subbase for} T)

First let’s proof that given a family of sets, then it is a subbase for a topology.
The first result states that from any family of sets we get a base using finite
intersections of them. The second one states that any family of sets is a
subbase of some topology.
theorem subset_as_subbase:Tshows { A. A ∈ FinPow(B)} {satisfies the base condition}
proof {
fix U V753

T
T
assume A:U∈{ A. A ∈ FinPow(B)} ∧ V∈{ A. A ∈ FinPow(B)}then
M R where MR:Finite(M)Finite(R)M⊆BR⊆B
T obtainT
U= MV= Rusing FinPow_def by auto{
fix x
assume AS:x∈U∩Vthen have N:M6=0R6=0 using MR(5,6) by auto
have Finite(M ∪R) using MR(1,2) by auto
moreoverhave M ∪ R∈Pow(B) using MR(3,4) by auto
ultimately T
have M∪R∈FinPow(B)using FinPow_def by autoT
then have(M∪R)∈{ A. A ∈ FinPow(B)} by auto
moreoverT
T T
Tfrom N have
T (M∪R)⊆ M (M∪R)⊆ R by auto
then have(M∪R)⊆U∩V using MR(5,6) by auto
moreover{fix Sassume S∈M ∪ Rthen have S∈M∨S∈R by auto
then have x∈S using AS MR(5,6) by auto}T
then have x∈ (M ∪ R)
T using N by auto
ultimately have ∃ W∈{ A. A ∈ FinPow(B)}. x∈W∧W⊆U∩V by blast}Tthen have (∀ x ∈ U∩V. ∃ W∈{ A. A ∈ FinPow(B)}. x∈W ∧ W ⊆ U∩V) by
auto
}
T
T
then have ∀ U V. ((U∈{ A. A ∈ FinPow(B)} ∧ V∈{ A. A ∈ FinPow(B)})−→
T(∀ x ∈ U∩V.T ∃ W∈{ A. A ∈ FinPow(B)}. x∈W ∧ W ⊆ U∩V)) by auto
then show { A. A ∈ FinPow(B)} {satisfies the base condition}using SatisfiesBaseCondition_def by autoqed
theorem Top_subbase:
ST
assumes T = { A. A∈Pow({ A. A ∈ FinPow(B)})}shows T {is a topology} and B {is a subbase for} T
proof {
fix S
assume S∈B
Tthen have {S}∈FinPow(B){S}=S using FinPow_def by autoT
then have {S}∈Pow({A.
A∈ FinPow(B)})
by (blast+)
S
S
Tthen have{S}∈{
A.
A∈Pow({A.
A∈
FinPow(B)})}by blast
S
Tthen have S∈{ A. A∈Pow({ A. A ∈ FinPow(B)})} by auto
then have S∈T using assms by auto}754

then have B⊆T by auto
moreoverT
have { A. A ∈ FinPow(B)} {satisfies the base condition}using subset_as_subbase by auto T
then have T {is a topology} and { A. A ∈ FinPow(B)} {is a base for}T
using Top_1_2_T1 assms by auto
ultimately show T {is a topology} and B{is a subbase for}T
using IsAsubBaseFor_def by autoqed

A subbase defines a unique topology.
theorem same_subbase_same_top:
assumes B {is a subbase for} T and B {is a subbase for} S
shows T = S
using IsAsubBaseFor_def assms same_base_same_top
by autoend

58

Properties in Topology

theory Topology_ZF_properties imports Topology_ZF_examples Topology_ZF_examples_1
begin

This theory deals with topological properties which make use of cardinals.

58.1

Properties of compactness

It is already defined what is a compact topological space, but the is a generalization which may be useful sometimes.
definition
IsCompactOfCard (_{is compact of cardinal}_ {in}_ 90)
S
where K{is compactSof cardinal} Q{in}T ≡ (Card(Q)
∧ K ⊆
T ∧
S
(∀ M∈Pow(T). K ⊆M −→ (∃ N ∈ Pow(M). K ⊆N ∧ N≺Q)))

The usual compact property is the one defined over the cardinal of thenatural numbers.
lemma Compact_is_card_nat:
shows K{is compact in}T ←→ (K{is compact of cardinal} nat {in}T)
proof{
assume K{is compactS in}TS
then have sub:K⊆
T and reg:(∀ M∈Pow(T). K ⊆M −→ (∃ N ∈S
FinPow(M). K ⊆N))using IsCompact_def by auto

755

{
fix M
S
assume M∈Pow(T)K⊆ M
S
with reg obtain N where N∈FinPow(M) K⊆ N by blast
then have Finite(N) using FinPow_def by auto
then obtain n where A:n∈natN ≈n using Finite_def by autofrom A(1) have n≺nat using n_lesspoll_nat by autowith A(2) have N.nat using lesspoll_def eq_lepoll_trans by auto
moreover{assume N ≈natthen have nat ≈ N using eqpoll_sym by autowith A(2) have nat ≈n using eqpoll_trans by blast
then have n ≈nat using eqpoll_sym by autowith hn≺nati have False using lesspoll_def by auto}
then have ~(N ≈nat) Sby autoSwith calculation hK⊆ NihN∈FinPow(M)i have N≺natK⊆ NN∈Pow(M) using lesspoll_def
FinPow_def by autoS
hence (∃ N ∈ Pow(M). K ⊆N ∧ N≺nat) by auto}with sub show K{is compact of cardinal} nat {in}T using IsCompactOfCard_def
Card_nat by auto}{
assume (K{is compact
of cardinal} nat {in}T) S
S
then
have
sub:K⊆
Tandreg:(∀ M∈Pow(T). K ⊆M −→ (∃ N ∈ Pow(M).
SK ⊆N ∧ N≺nat))using IsCompactOfCard_def by auto
{
fix M
S
assume M∈Pow(T)K⊆ M
S
with reg have (∃ N ∈ Pow(M). K S⊆
N ∧ N≺nat) by auto
then obtain N where N∈Pow(M)K⊆NN≺natby blast
Sthen have N∈FinPow(M)K⊆ N using lesspoll_nat_is_Finite FinPow_def
by autoS
hence ∃ N∈FinPow(M). K⊆ N by auto}with sub show K{is compact in}T using IsCompact_def by auto}qed

Another property of this kind widely used is the Lindeloef property; it is
the one on the successor of the natural numbers.
definition
IsLindeloef (_{is lindeloef in}_ 90) whereK {is lindeloef in} T≡K{is compact of cardinal}csucc(nat){in}T756

It would be natural to think that every countable set with any topology is
Lindeloef; but this statement is not provable in ZF. The reason is that tobuild a subcover, most of the time we need to choose sets from an infinite
collection which cannot be done in ZF. Additional axioms are needed, but
strictly weaker than the axiom of choice.
However, if the topology has not many open sets, then the topological spaceis indeed compact.
theorem card_top_comp: S
assumes Card(Q) T≺Q K⊆ T
shows (K){is compact of cardinal}Q{in}T
proof {
S
fix M assume M:M⊆T K⊆ M
from M(1) assms(2) have M≺Q using subset_imp_lepoll lesspoll_trans1
by blast
Swith M(2) have ∃ N∈Pow(M). K⊆ N ∧ N≺Q by auto}with assms(1,3) show thesis unfolding IsCompactOfCard_def by autoqed

The union of two compact sets, is compact; of any cardinality.
theorem union_compact:assumes K{is compact of cardinal}Q{in}T K1{is compact of cardinal}Q{in}T
InfCard(Q)shows (K ∪ K1){is compact of cardinal}Q{in}T unfolding IsCompactOfCard_def
proof (safe)
from assms(1) show Card(Q) unfolding
IsCompactOfCard_def by autoS
fix x assume x∈K then show x∈ T using assms(1) unfolding IsCompactOfCard_def
by blast
next
S
fix x assume x∈K1 then show x∈ T using assms(2) unfolding IsCompactOfCard_def
by blast
next
S
fix M assume S
M⊆T K∪K1⊆
M
S
then have K⊆ MK1⊆ M by auto S
S
with hM⊆Ti have ∃ N∈Pow(M). K ⊆N ∧ N ≺ Q∃ N∈Pow(M). K1 ⊆N ∧ N
≺ Q using assms unfolding IsCompactOfCard_def
by autoS
S
then obtain NK NK1 where NK∈Pow(M)NK1∈Pow(M)K ⊆NKK1 ⊆NK1NK ≺QNK1 ≺ Q by autoS
then have NK∪NK1 ≺ QK∪K1⊆ (NK∪NK1)NK∪NK1∈Pow(M) using assms(3) less_less_imp_un_lessby autoS
then show ∃ N∈Pow(M). K∪K1⊆ N ∧ N≺Q by autoqed

If a set is compact of cardinality Q for some topology, it is compact of cardinality Q for every coarser topology.
757

theorem compact_coarser:
S
S
assumes T1⊆T and
T1= T and (K){is compact of cardinal}Q{in}Tshows (K){is compact of cardinal}Q{in}T1
proof {
fix M
Sassume AS:M∈Pow(T1)K⊆S M
then have M∈Pow(T)K⊆ MSusing assms(1) by auto
then have ∃ N∈Pow(M).K⊆ N∧N≺Q using assms(3) unfolding IsCompactOfCard_def
by auto}then show (K){is compact of cardinal}Q{in}T1 using assms(3,2) unfolding IsCompactOfCard_def by autoqed

If some set is compact for some cardinal, it is compact for any greater
cardinal.
theorem compact_greater_card:
assumes Q.Q1 and (K){is compact of cardinal}Q{in}T and Card(Q1)shows (K){is compact of cardinal}Q1{in}T
proof {
fix M
Sassume AS: M∈Pow(T)K⊆ SM
then have ∃ N∈Pow(M).K⊆ N∧N≺Q using assms(2) unfolding IsCompactOfCard_def
by autoS
then have ∃ N∈Pow(M).K⊆ N∧N≺Q1 using assms(1) lesspoll_trans2
unfolding IsCompactOfCard_def by auto}
then show thesis using assms(2,3) unfolding IsCompactOfCard_def by
auto
qed

A closed subspace of a compact space of any cardinality, is also compact of
the same cardinality.
theorem compact_closed:
assumes K {is compact of cardinal} Q {in} T
and R {is closed in} T
shows (K∩R) {is compact of cardinal} Q {in} T
proof {
fix M
Sassume
S AS:M∈Pow(T)K∩R⊆ M
have
T-R∈T
S using assms(2) IsClosed_def by auto
have K-R⊆(
T-R) usingSassms(1)by autoS
S IsCompactOfCard_def
Swith h T-R∈Ti have K⊆ (M ∪{ T-R}) and M ∪{ T-R}∈Pow(T)proof (safe)
{
fix x

758

assume x∈Mwith AS(1) show x∈T by auto
}
{
fix x
assume x∈Khave x∈R∨x∈R/ by autowith hx∈Ki have x∈K∩R∨x∈K-R
by S
auto
S
S
i have x∈
with AS(2) hK-R⊆(
T-R)
M∨x∈( T-R) by auto
S
S
then show x∈ (M ∪{ T-R}) by auto
}
qed
S
S
with assms(1) have ∃ N∈Pow(M∪{ T-R}). K ⊆N ∧ N ≺ Q unfolding
IsCompactOfCard_def by auto
S
S
then obtain
S N where cub:N∈Pow(M∪{S
S T-R}) K⊆
S N N≺Q by auto
have N-{ T-R}∈Pow(M)K∩R⊆ (N-{ T-R}) N-{ T-R}≺Q
proof (safe){
fix x
assume x∈Nx∈M/S
then show x= T-R using cub(1) by auto
}
{
fix x
assume x∈Kx∈R
S
then have x∈/ ST-Rx∈K
S by auto
then show x∈ (N-{ T-R}) using cub(2) by blast}
S
have N-{ T-R}⊆N by S
autowith cub(3) show N-{ T-R}≺Q using subset_imp_lepoll lesspoll_trans1
by blast
qed
Sthen have ∃ N∈Pow(M). K∩R⊆ N ∧ N≺Q by auto}
S
S
then have ∀ M∈Pow(T). (K ∩ R ⊆
M −→ (∃ N∈Pow(M). K ∩ R ⊆N ∧ N≺ Q)) by auto
then show thesis using IsCompactOfCard_def assms(1) by auto
qed

58.2

Properties of numerability

The properties of numerability deal with cardinals of some sets built fromthe topology. The properties which are normally used are the ones related
to the cardinal of the natural numbers or its successor.
definition
IsFirstOfCard (_ {is of first type of cardinal}_
90) whereS(T {is of first type of cardinal} Q) ≡ ∀ x∈ T. (∃ B. (B {is a base for}T) ∧ ({b∈B. x∈b} ≺ Q))

759

definition
IsSecondOfCard (_ {is of second type of cardinal}_ 90) where(T {is of second type of cardinal}Q) ≡ (∃ B. (B {is a base for} T) ∧(B ≺ Q))definition
IsSeparableOfCard (_{is separable of cardinal}_
90) whereS
S
T{is separable of cardinal}Q≡ ∃ U∈Pow( T). Closure(U,T)= T ∧ U≺Q
definition
IsFirstCountable (_ {is first countable} 90) where(T {is first countable}) ≡ T {is of first type of cardinal} csucc(nat)definition
IsSecondCountable (_ {is second countable} 90) where(T {is second countable}) ≡ (T {is of second type of cardinal}csucc(nat))definition
IsSeparable (_{is separable} 90) whereT{is separable}≡ T{is separable of cardinal}csucc(nat)If a set is of second type of cardinal Q, then it is of first type of that same
cardinal.
theorem second_imp_first:
assumes T{is of second type of cardinal}Q
shows T{is of first type of cardinal}Q
proof from assms have ∃ B. (B {is a base for} T) ∧ (B ≺ Q) using IsSecondOfCard_def
by autothen obtain B where base:(B {is a base for} T) ∧ (B ≺ Q) by auto
{
fix x
S
assume x∈ Thave {b∈B. x∈b}⊆B by auto
then have {b∈B. x∈b}.B using subset_imp_lepoll by autowith base have {b∈B. x∈b}≺Q using lesspoll_trans1 by autowith base have (B {is a base for} T) ∧ {b∈B. x∈b}≺Q by auto}S
then have ∀ x∈ T. ∃ B. (B {is a base for} T) ∧ {b∈B. x∈b}≺Q by auto
then show thesis using IsFirstOfCard_def by autoqed

A set is dense iff it intersects all non-empty, open sets of the topology.
lemma dense_int_open:S
assumes T{is a topology}
and A⊆ T
S
shows Closure(A,T)= T ←→ (∀ U∈T. U6=0 −→ A∩U6=0)
proof
S
assume AS:Closure(A,T)= T{

760

fix Uassume Uopen:U∈T
and U6=0
Sthen have U∩ T6=0 by autowith AS have U∩Closure(A,T) 6=0 by autowith assms Uopen have U∩A6=0 using topology0.cl_inter_neigh topology0_def
by blast}
then show ∀ U∈T. U6=0 −→ A∩U6=0 by auto
next
assume AS:∀ U∈T. U6=0 −→ A∩U6=0
{
fix x
S
assume A:x∈ Tthen have ∀ U∈T. x∈U −→ U∩A6=0 using AS by autowith assms A have x∈Closure(A,T) using topology0.inter_neigh_cl topology0_def
by auto}S
then haveT⊆Closure(A,T) bySauto
with assms show Closure(A,T)= T using topology0.Top_3_L11(1) topology0_def
by blast
qed

58.3

Relations between numerability properties and choiceprinciples

It is known that some statements in topology aren’t just derived from choiceaxioms, but also equivalent to them. Here is an example
The following are equivalent:• Every topological space of second cardinality csucc(Q) is separable ofcardinality csucc(Q).
• The axiom of Q choice.
In the article [4] there is a proof of this statement for Q= N, with moreequivalences.
If a topology is of second type of cardinal csucc(Q), then it is separable ofthe same cardinal. This result makes use of the axiom of choice for theS
cardinal Q on subsets of T.
theorem Q_choice_imp_second_imp_separable:
assumes T{is of second type of cardinal}csucc(Q) S
and {the axiom of} Q {choice holds for subsets}
T
and T{is a topology}
shows T{is separable of cardinal}csucc(Q)proof from assms(1) have ∃ B. (B {is a base for} T) ∧ (B ≺ csucc(Q)) using IsSecondOfCard_def by auto761

then obtain B where base:(B {is a base for} T) ∧ (B ≺ csucc(Q)) by
auto
let N=λb∈B. b
let B=B-{0}have B-{0}⊆B by autowith base have prec:B-{0}≺csucc(Q) using subset_imp_lepoll lesspoll_trans1
by blastfrom base have baseOpen:∀ b∈B. Nb∈T using base_sets_open by auto
fromS assms(2) have car:Card(Q) and reg:(∀ M N. (M .Q ∧ (∀ t∈M. Nt6=0∧ Nt⊆ T)) −→ (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)))using AxiomCardinalChoice_def by auto S
then have (B .Q ∧ (∀ t∈B. Nt6=0 ∧ Nt⊆ T)) −→ (∃ f. f:Pi(B,λt. Nt)∧ (∀ t∈B. ft∈Nt)) by blast S
with prec have (∀ t∈B. Nt⊆ T) −→ (∃ f. f:Pi(B,λt. Nt) ∧ (∀ t∈B. ft∈Nt))
using Card_less_csucc_eq_le car by autowith baseOpen have ∃ f. f:Pi(B,λt. Nt) ∧ (∀ t∈B. ft∈Nt) by blast
then obtain f where f:f:Pi(B,λt. Nt) and f2:∀ t∈B. ft∈Nt by auto{
fix U
assume U∈T and U6=0
then obtain b where A1:b∈B-{0} and b⊆U using Top_1_2_L1 base by
blastwith f2 have fb∈U by autowith A1 have {fb. b∈B}∩U6=0 by auto}
then have r:∀ U∈T.
S U6=0 −→ {fb. b∈B}∩U6=0 by auto
have {fb. b∈B}⊆ T using f2 baseOpen by auto
moreoverS
with r have Closure({fb. b∈B},T)= T using dense_int_open assms(3)by automoreoverhave ffun:f:B→range(f) using f range_of_fun by auto
then have f∈surj(B,range(f)) using fun_is_surj by auto
then have des1:range(f).B using surj_fun_inv_2[of fBrange(f)Q] prec
Card_less_csucc_eq_le car
Card_is_Ord by auto
then have {fb. b∈B}⊆range(f) using apply_rangeI[OF ffun] by auto
then have {fb. b∈B}.range(f) using subset_imp_lepoll by autowith des1 have {fb. b∈B}.B using lepoll_trans by blast
with prec have {fb. b∈B}≺csucc(Q) using lesspoll_trans1 by auto
ultimately show thesis using IsSeparableOfCard_def by autoqed
SThe next theorem resolves that the axiom of Q choice for subsets of T

is necessary for second type spaces to be separable of the same cardinal
csucc(Q).
theorem second_imp_separable_imp_Q_choice:assumes ∀ T. (T{is a topology} ∧ (T{is of second type of cardinal}csucc(Q)))−→ (T{is separable of cardinal}csucc(Q))

762and Card(Q)shows {the axiom of} Q {choice holds}
proof {
fix N M
assume AS:M .Q ∧ (∀ t∈M. Nt6=0)
then obtain h where inj:h∈inj(M,Q) using lepoll_def by auto
then have bij:converse(h):bij(range(h),M) using inj_bij_range bij_converse_bij
by autolet T={(N(converse(h)i))×{i}. i∈range(h)}{fix jassume AS2:j∈range(h)from bij have converse(h):range(h)→M using bij_def inj_def by
autowith AS2 have converse(h)j∈M by simp
with AS have N(converse(h)j)6=0 by auto
then have (N(converse(h)j))×{j}6=0 by auto}
then have noEmpty:0∈T/ by auto
moreover{fix A Bassume AS2:A∈TB∈TA∩B6=0
then obtain j t where A_def:A=N(converse(h)j)×{j} and B_def:B=N(converse(h)t)×{t}and Range:j∈range(h) t∈range(h) by autofrom AS2(3) obtain x where x∈A∩B by autowith A_def B_def have j=t by autowith A_def B_def have A=B by auto}
then have (∀ A∈T. ∀ B∈T. A=B∨ A∩B=0) by auto
ultimately
S
have Part:T {is a partition of}
T unfolding IsAPartition_def byautoS
let τ =PTopology
T Tfrom Part have top:τ {is a topology} and base:T {is a base for}τ
using Ptopology_is_a_topology by auto
let f={hi,(N(converse(h)i))×{i}i. i∈range(h)}have f:range(h)→T using functionI[of f] Pi_def by auto
then have f∈surj(range(h),T) unfolding surj_def using apply_equality
by automoreoverhave range(h)⊆Q using inj unfolding inj_def range_def domain_def
Pi_def by auto
ultimately have T. Q using surj_fun_inv[of frange(h)TQ] assms(2)Card_is_Ord lepoll_transsubset_imp_lepoll by auto
then have T≺csucc(Q) using Card_less_csucc_eq_le assms(2) by auto763

with base have (τ {is of second type of cardinal}csucc(Q)) using IsSecondOfCard_def
by autowith top have τ {is separable of cardinal}csucc(Q) using assms(1)by autoS
S
then obtain D where sub:D∈Pow( τ ) and clos:Closure(D,τ )= τ andcardd:D≺csucc(Q)using IsSeparableOfCard_def by auto
then have D.Q using Card_less_csucc_eq_le assms(2) by auto
then obtain r where r:r∈inj(D,Q) using lepoll_def by auto
then have bij2:converse(r):bij(range(r),D) using inj_bij_range bij_converse_bij
by autothen have surj2:converse(r):surj(range(r),D) using bij_def by auto
let R=λi∈range(h). {j∈range(r). converse(r)j∈((N(converse(h)i))×{i})}{fix iassume AS:i∈range(h)then have T:(N(converse(h)i))×{i}∈T by auto
then have P: (N(converse(h)i))×{i}∈τ using base unfolding IsAbaseFor_def
by blastwith top sub clos have ∀ U∈τ . U6=0 −→ D∩U6=0 using dense_int_open
by autowith P have (N(converse(h)i))×{i}6=0 −→ D∩(N(converse(h)i))×{i}6=0
by autowith T noEmpty have D∩(N(converse(h)i))×{i}6=0 by auto
then obtain x where x∈D and px:x∈(N(converse(h)i))×{i} by autowith surj2 obtain j where j∈range(r) and converse(r)j=x unfolding surj_def by blast
with px have j∈{j∈range(r). converse(r)j∈((N(converse(h)i))×{i})}by autothen have Ri6=0 using beta_if[of range(h) _ i] AS by auto}
then have nonE:∀ i∈range(h). Ri6=0 by auto{
fix i jassume i:i∈range(h) and j:j∈Rifrom j i have converse(r)j∈((N(converse(h)i))×{i}) using beta_if
by auto}then have pp:∀ i∈range(h). ∀ j∈Ri. converse(r)j∈((N(converse(h)i))×{i})by autolet E={hm,fst(converse(r)(µ j. j∈R(hm)))i. m∈M}
have ff:function(E) unfolding function_def by auto
moreover{fix massume M:m∈M
with inj have hm:hm∈range(h) using apply_rangeI inj_def by auto

764

{
fix j
assume j∈R(hm)with hm have j∈range(r) using beta_if by autofrom r have r:surj(D,range(r)) using fun_is_surj inj_def by autowith hj∈range(r)i obtain d where d∈D and rd=j using surj_def
by autothen have j∈Q using r inj_def by auto}
then have subcar:R(hm)⊆Q by blastfrom nonE hm obtain ee where P:ee∈R(hm) by blast
with subcar have ee∈Q by auto
then have Ord(ee) using assms(2) Card_is_Ord Ord_in_Ord by autowith P have (µ j. j∈R(hm))∈R(hm) using LeastI[where i=ee and P=λj.
j∈R(hm)]by autowith pp hm have converse(r)(µ j. j∈R(hm))∈((N(converse(h)(hm)))×{(hm)})by autothen have converse(r)(µ j. j∈R(hm))∈((N(m))×{(hm)}) using left_inverse[OFinj M]
by simpthen have fst(converse(r)(µ j. j∈R(hm)))∈(N(m)) by auto}
ultimately have thesis1:∀ m∈M. Em∈(N(m)) using function_apply_equality
by auto{fix e
assume e∈Ethen obtain m where m∈M and e=hm,Emi using function_apply_equality
ff by autowith thesis1 have e∈Sigma(M,λt. Nt) by auto}
then have E∈Pow(Sigma(M,λt. Nt)) by autowith ff have E∈Pi(M,λm. Nm) using Pi_iff by auto
then have (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)) using thesis1 by
auto}then show thesis using AxiomCardinalChoiceGen_def assms(2) by autoqed

Here is the equivalence from the two previous results.
theorem Q_choice_eq_secon_imp_sepa:
assumes Card(Q)shows (∀ T. (T{is a topology} ∧ (T{is of second type of cardinal}csucc(Q)))−→ (T{is separable of cardinal}csucc(Q)))←→({the axiom of} Q {choice holds})
using Q_choice_imp_second_imp_separable choice_subset_imp_choiceusing second_imp_separable_imp_Q_choice assms by auto

Given a base injective with a set, then we can find a base whose elements
765

are indexed by that set.
lemma base_to_indexed_base:assumes B .Q B {is a base for}Tshows ∃ N. {Ni. i∈Q}{is a base for}T
proof from assms obtain f where f_def:f∈inj(B,Q) unfolding lepoll_def by
auto
let ff={hb,fbi. b∈B}
have domain(ff)=B by auto
moreoverhave relation(ff) unfolding relation_def by auto
moreoverhave function(ff) unfolding function_def by auto
ultimately
have fun:ff:B→range(ff) using function_imp_Pi[of ff] by auto
then have injj:ff∈inj(B,range(ff)) unfolding inj_def
proof{
fix w xassume AS:w∈Bx∈B{hb, f bi . b ∈ B} w = {hb, f bi . b ∈ B} x
then have fw=fx using apply_equality[OF _ fun] by auto
then have w=x using f_def inj_def AS(1,2) by auto}
then show ∀ w∈B. ∀ x∈B. {hb, f bi . b ∈ B} w = {hb, f bi . b ∈B} x −→ w = x by autoqed
then have bij:ff∈bij(B,range(ff)) using inj_bij_range by autofrom fun have range(ff)={fb. b∈B} by autowith f_def have ran:range(ff)⊆Q using inj_def by auto
let N={hi,(if i∈range(ff) then converse(ff)i else 0)i. i∈Q}
have FN:function(N) unfolding function_def by auto
have B ⊆{Ni. i∈Q}
proof
fix t
assume a:t∈B
from bij have rr:ff:B→range(ff) unfolding bij_def inj_def by auto
have ig:fft=ft using a apply_equality[OF _ rr] by auto
have r:fft∈range(ff) using apply_type[OF rr a].
from ig have t:fft∈Q using apply_type[OF _ a] f_def unfolding inj_def
by autowith r have N(fft)=converse(ff)(fft) using function_apply_equality[OF_ FN] by auto
then have N(fft)=t using left_inverse[OF injj a] by auto
then have t=N(fft) by auto
then have ∃ i∈Q. t=Ni using t(1) by auto
then show t∈{Ni. i∈Q} by simp
qed
moreoverhave ∀ r∈{Ni. i∈Q}-B. r=0766

prooffix rassume r∈{Ni. i∈Q}-B
then obtain j where R:j∈Qr=Njr∈B/ by auto{
assume AS:j∈range(ff)with R(1) have Nj=converse(ff)j using function_apply_equality[OF_ FN] by auto
then have Nj∈B using apply_funtype[OF inj_is_fun[OF bij_is_inj[OFbij_converse_bij[OF bij]]] AS]
by autothen have False using R(3,2) by auto}
then have j∈range(ff)/by autothen show r=0 using function_apply_equality[OF _ FN] R(1,2) by autoqed
ultimately have {Ni. i∈Q}=B∨{Ni. i∈Q}=B ∪{0} by blast
moreoverhave (B ∪{0})-{0}=B-{0} by blast
then have (B ∪{0})-{0} {is a base for}T using base_no_0[of BT] assms(2)by autothen have B ∪{0} {is a base for}T using base_no_0[of B ∪{0}T] by auto
ultimately
have {Ni. i∈Q}{is a base for}T using assms(2) by auto
then show thesis by auto
qed

58.4

Relation between numerability and compactness

If the axiom of Q choice holds, then any topology of second type of cardinal
csucc(Q) is compact of cardinal csucc(Q)theorem compact_of_cardinal_Q:
assumes {the axiom of} Q {choice holds for subsets} (Pow(Q))
T{is of second type of cardinal}csucc(Q)T{is a S
topology}shows (( T){is compact of cardinal}csucc(Q){in}T)
proof V
from assms(1) have CC:Card(Q) and reg: M N. (M .Q ∧ (∀ t∈M. Nt6=0∧Nt⊆Pow(Q)))−→ (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)) using
AxiomCardinalChoice_def by autofrom assms(2) obtain R where R.QR{is a base for}T unfolding IsSecondOfCard_def
using Card_less_csucc_eq_le CC by autowith base_to_indexed_base obtain N where base:{Ni. i∈Q}{is a base for}T
by blast
{
fix M
S S
assume A: T⊆ MM∈Pow(T)let α=λU∈M. {i∈Q. N(i)⊆U}
have inj:α∈inj(M,Pow(Q)) unfolding inj_def

767proof{show (λU∈M. {i ∈ Q . N i ⊆ U}) ∈ M → Pow(Q) using lam_type[ofMλU. {i ∈ Q . N(i) ⊆ U}%t. Pow(Q)] by auto{
fix w xassume AS:w∈Mx∈M{i ∈ Q . N(i) ⊆ w} = {i ∈ Q . N(i) ⊆ x}from AS(1,2) A(2) have w∈Tx∈T by auto
then have w=Interior(w,T)x=Interior(x,T) using assms(3) topology0.Top_2_L3[ofT]topology0_def[ofS T] by autoS
then have UN:w=( {B∈{N(i). i∈Q}. B⊆w})x=( {B∈{N(i). i∈Q}.
B⊆x})using interior_set_base_topology assms(3) base by auto{
fix bassume b∈w Sthen have b∈ {B∈{N(i). i∈Q}. B⊆w} using UN(1) by auto
then obtain S where S:S∈{N(i). i∈Q} b∈S S⊆w by blast
then obtain j where j:j∈QS=N(j) by auto
then have j∈{i ∈ Q . N(i) ⊆ w} using S(3) by auto
then have N(j)⊆xb∈N(j)j∈Qusing S(2) AS(3) j by autoS
then have b∈( {B∈{N(i). i∈Q}. B⊆x}) by auto
then have b∈x using UN(2) by auto}
moreover{fix b
assume b∈x Sthen have b∈ {B∈{N(i). i∈Q}. B⊆x} using UN(2) by auto
then obtain S where S:S∈{N(i). i∈Q} b∈S S⊆x by blast
then obtain j where j:j∈QS=N(j) by auto
then have j∈{i ∈ Q . N(i) ⊆ x} using S(3) by auto
then have j∈{i ∈ Q . N(i) ⊆ w} using AS(3) by auto
then have N(j)⊆wb∈N(j)j∈Qusing S(2) j(2) by autoS
then have b∈( {B∈{N(i). i∈Q}. B⊆w}) by auto
then have b∈w using UN(2) by auto}
ultimately have w=x by auto}
then show ∀ w∈M. ∀ x∈M. (λU∈M. {i ∈ Q . N i ⊆ U}) w = (λU∈M.
{i ∈ Q . N i ⊆ U}) x −→ w = x by auto}qed
let X=λi∈Q. {αU. U∈{V∈M. N(i)⊆V}}
let M={i∈Q. Xi6=0}
have subMQ:M⊆Q by auto
then have ddd:M .Q using subset_imp_lepoll by auto
then have M .Q∀ i∈M. Xi6=0∀ i∈M. Xi⊆Pow(Q) by auto768then have M .Q∀ i∈M. Xi6=0∀ i∈M. Xi . Pow(Q) using subset_imp_lepoll
by autothen have (∃ f. f:Pi(M,λt. Xt) ∧ (∀ t∈M. ft∈Xt)) using reg[of MX]
by autothen obtain f where f:f:Pi(M,λt. Xt)(!!t. t∈M =⇒ ft∈Xt) by auto{
fix massume S:m∈M
from f(2) S obtain YY where YY:(YY∈M) (fm=αYY) by auto
then have Y:(YY∈M)∧(fm=αYY) by auto
moreover{fix Uassume U∈M∧(fm=αU)
then have U=YY using inj inj_def YY by auto}Vthen have r: x. x∈M∧(fm=αx) =⇒ x=YY by blast
have ∃ !YY. YY∈M ∧ fm=αYY using ex1I[of %Y. Y∈M∧ fm=αY,OF Y r]
by auto}then have ex1YY:∀ m∈M. ∃ !YY. YY∈M ∧ fm=αYY by auto
let YYm={hm,(THEYY. YY∈M ∧ fm=αYY)i. m∈M}
Vhave aux: m. m∈M =⇒ YYmm=(THE YY. YY∈M ∧ fm=αYY) unfolding apply_def
by autohave ree:∀ m∈M. (YYmm)∈M ∧ fm=α(YYmm)
proof
fix m
assume C:m∈M
then have ∃ !YY. YY∈M ∧ fm=αYY using ex1YY by auto
then have (THE YY. YY∈M ∧ fm=αYY)∈M∧fm=α(THE YY. YY∈M ∧ fm=αYY)
using theI[of %Y. Y∈M∧ fm=αY] by blast
then show (YYmm)∈M ∧ fm=α(YYmm) apply (simp only: aux[OF C]) doneqedVhave tt: m. m∈M =⇒ N(m)⊆YYmm
proof fix massume D:m∈M
then have QQ:m∈Q by autofrom D have t:(YYmm)∈M ∧ fm=α(YYmm) using ree by blast
then have fm=α(YYmm) by blast
then have (α(YYmm))∈(λi∈Q. {αU. U∈{V∈M. N(i)⊆V}})m using f(2)[OFD]
by autothen have (α(YYmm))∈{αU. U∈{V∈M. N(m)⊆V}} using QQ by auto
then obtain U where U∈{V∈M. N(m)⊆V}α(YYmm)=αU by auto
then have r:U∈MN(m)⊆Uα(YYmm)=αU(YYmm)∈M using t by auto
then have YYmm=U using inj_apply_equality[OF inj] by blast
then show N(m)⊆YYmm using r by auto
qed

769

S
S
then have ( m∈M. N(m))⊆( m∈M. YYmm)
proof {
fix s
Sassume s∈( m∈M. N(m))
then obtain t where r:t∈Ms∈N(t) by auto
then have s∈YYmt
S using tt[OF r(1)] by blast
then have s∈( m∈M. YYmm) using r(1) by blast}
then show thesis by blast
qed
moreover{fix x
Sassume AT:x∈ Twith A obtain U where BB:U∈MU∈Tx∈U by auto
then obtain j where BC:j∈Q N(j)⊆Ux∈N(j) using point_open_base_neigh[OFbase,of Ux] by auto
then have Xj6=0 using BB(1) by auto
then have j∈MSusing BC(1) by auto
then have x∈( m∈M. N(m)) using BC(3) by auto}
S
S
then haveT⊆( m∈M. S
N(m)) Sby blast
S S
ultimately
have
covers:T⊆( m∈M. YYmm) using subset_trans[ofT( m∈M.
S
N(m))( m∈M. YYmm)]by autohave relation(YYm) unfolding relation_def by auto
moreoverhave f:function(YYm) unfolding function_def by auto
moreoverhave d:domain(YYm)=M by auto
moreoverhave r:range(YYm)=YYmM by auto
ultimately
have fun:YYm:M→YYmM using function_imp_Pi[of YYm] by auto
have YYm∈surj(M,YYmM) using fun_is_surj[OF fun] r by autowith surj_fun_inv[OF this subMQ Card_is_Ord[OF CC]]
have YYmM . M by autowith ddd have Rw:YYmM .Q using lepoll_trans by blast{
fix m assume m∈Mthen have hm,YYmmi∈YYm using function_apply_Pair[OF f] d by blast
then have YYmm∈YYmM by auto}
then have l1:{YYmm. m∈M}⊆YYmM by blast{
fix t assume t∈YYmM
then have ∃ x∈M. hx,ti∈YYm unfolding image_def by auto
then obtain r where S:r∈Mhr,ti∈YYm by auto
have YYmr=t using apply_equality[OF S(2) fun] by auto

770with S(1) have t∈{YYmm. m∈M} by auto}with l1 have {YYmm. m∈M}=YYmM by blast
with Rw have {YYmm. m∈M} .Q by auto S S
with covers have {YYmm. m∈M}∈Pow(M)∧ T⊆ {YYmm. m∈M}∧{YYmm. m∈M}
≺csucc(Q) using ree
Card_less_csucc_eq_le[OFCC] by blast
S S
then have ∃ N∈Pow(M).
T⊆ N∧N≺csucc(Q) by auto
}
S
S
S
S
then have ∀ M∈Pow(T).
T ⊆M −→ (∃ N∈Pow(M).
T ⊆N ∧ N ≺ csucc(Q))
by autothen show thesis using IsCompactOfCard_def Card_csucc CC Card_is_Ordby autoqed

In the following proof, we have chosen an infinite cardinal to be able to apply
the equation Q × Q ≈ Q. For finite cardinals; both, the assumption and theaxiom of choice, are always true.
theorem second_imp_compact_imp_Q_choice_PowQ:
assumes∀ T. (T{is a topology} ∧ (T{is of second type of cardinal}csucc(Q)))
S−→ (( T){is compact of cardinal}csucc(Q){in}T)
and InfCard(Q)shows {the axiom of} Q {choice holds for subsets} (Pow(Q))
proof {
fix N M
assume AS:M .Q ∧ (∀ t∈M. Nt6=0 ∧ Nt⊆Pow(Q))
then obtain h where h∈inj(M,Q) using lepoll_def by auto
have discTop:Pow(Q×M) {is a topology} using Pow_is_top by auto{
fix A
assume S
AS:A∈Pow(Q×M)
have A= {{i}. i∈A} by autoSwith AS have ∃ST∈Pow({{i}. i∈Q×M}). A= T by auto
then have A∈{ U. U∈Pow({{i}. i∈Q×M})} by auto}
moreover{fix A
Sassume AS:A∈{ U. U∈Pow({{i}. i∈Q×M})}
then have A∈Pow(Q×M) by auto}
ultimately
have base:{{x}. x∈Q×M} {is a base for} Pow(Q×M) unfolding IsAbaseFor_def
by blast
let f={hi,{i}i. i∈Q×M}
have fff:f∈Q×M→{{i}. i∈Q×M} using Pi_def function_def by auto
then have f∈inj(Q×M,{{i}. i∈Q×M}) unfolding inj_def using apply_equality771

by auto
then have f∈bij(Q×M,{{i}. i∈Q×M}) unfolding bij_def surj_def using fff
apply_equality fff by auto
then have Q×M≈{{i}. i∈Q×M} using eqpoll_def by auto
then have {{i}. i∈Q×M}≈Q×M using eqpoll_sym by auto
then have {{i}. i∈Q×M}.Q×M using eqpoll_imp_lepoll by auto
then have {{i}. i∈Q×M}.Q×Q using AS prod_lepoll_mono[of QQMQ] lepoll_refl[ofQ]
lepoll_trans by blast
then have {{i}. i∈Q×M}.Q using InfCard_square_eqpoll assms(2) lepoll_eq_transby autothen have {{i}. i∈Q×M}≺csucc(Q) using Card_less_csucc_eq_le assms(2)InfCard_is_Card by auto
then have Pow(Q×M) {is of second type of cardinal} csucc(Q) using
IsSecondOfCard_def base by auto
then have comp:(Q×M) {is compact of cardinal}csucc(Q){in}Pow(Q×M)
using discTop assms(1) by auto{
fix W
assume W∈Pow(Q×M)
then have T:W{is closed in} Pow(Q×M) and (Q×M)∩W=W using IsClosed_def
by autowith compact_closed[OF comp T] have (W {is compact of cardinal}csucc(Q){in}Pow(Q×M))
by auto}then have subCompact:∀ W∈Pow(Q×M). (W {is compact of cardinal}csucc(Q){in}Pow(Q×M))
by autoS
let cub= {{(U)×{t}.
U∈Nt}. t∈M}
Sfrom AS have ( cub)∈Pow((Q)×M)
S by autowith subCompact have Ncomp:(( cub) {is compact of cardinal}csucc(Q){in}Pow(Q×M))
by autoS
S
have cond:(cub)∈Pow(Pow(Q×M))∧
cub⊆ cub using AS by auto
S
S
have ∃ S∈Pow(cub). ( cub) ⊆S ∧ S ≺ csucc(Q)proof {
S
have (( cub) {is compact of cardinal}csucc(Q){in}Pow(Q×M)) using Ncomp by auto
S
S
S
then have ∀ M∈Pow(Pow(Q×M)).
cub ⊆M −→ (∃ Na∈Pow(M).
cubS⊆Na ∧ Na ≺ csucc(Q))
unfolding IsCompactOfCard_def
S by autoSwith cond have ∃ S∈Pow(cub).
cub ⊆S ∧ S ≺ csucc(Q) by auto}
then show thesis by autoqed
SS
then have ttt:∃ S∈Pow(cub). ( cub) ⊆S ∧ S . Q using Card_less_csucc_eq_leassms(2) InfCard_is_Card by auto
S
S
then obtain S where S_def:S∈Pow(cub)( cub) ⊆S S . Q by auto{772

fix tassume AA:t∈MNt6={0}from AA(1) AS have Nt6=0 by autowith AA(2) obtain U where G:U∈Nt and notEm:U6=0 by blast
then have U×{t}∈cub
S using AA by auto
then have U×{t}⊆ cub by auto S
with G notEm AA have ∃ s. hs,ti∈ cub by auto}S
then have ∀ t∈M. (Nt6={0})−→ (∃ s. hs,ti∈ cub)by autoS
then have A:∀ t∈M. (Nt6={0})−→ (∃ s. hs,ti∈ S) using S_def(2) by
blastfrom S_def(1) have B:∀ f∈S. ∃ t∈M. ∃ U∈Nt. f=U×{t} by blastfrom A B have ∀ t∈M. (Nt6={0})−→ (∃ U∈Nt. U×{t}∈S) by blast
then have noEmp:∀ t∈M. (Nt6={0})−→ (S∩({U×{t}. U∈Nt})6=0) by autofrom S_def(3) obtain r where r:r:inj(S,Q) using lepoll_def by auto
then have bij2:converse(r):bij(range(r),S) using inj_bij_range bij_converse_bij
by autothen have surj2:converse(r):surj(range(r),S) using bij_def by auto
let R=λt∈M. {j∈range(r). converse(r)j∈({U×{t}. U∈Nt})}{
fix tassume AA:t∈MNt6={0}then have (S∩({U×{t}. U∈Nt})6=0) using noEmp by auto
then obtain s where ss:s∈Ss∈{U×{t}. U∈Nt} by blast
then obtain j where converse(r)j=s j∈range(r) using surj2 unfolding surj_def by blast
then have j∈{j∈range(r). converse(r)j∈({U×{t}. U∈Nt})} using ss
by autothen have Rt6=0 using beta_if AA by auto}
then have nonE:∀ t∈M. Nt6={0}−→Rt6=0 by auto{
fix t jassume t∈Mj∈Rtthen have converse(r)j∈{U×{t}. U∈Nt} using beta_if by auto}
then have pp:∀ t∈M. ∀ j∈Rt. converse(r)j∈{U×{t}. U∈Nt} by auto
have reg:∀ t U V. U×{t}=V×{t}−→U=V
proof {
fix t U V
assume AA:U×{t}=V×{t}{fix v
assume v∈Vthen have hv,ti∈V ×{t} by auto
then have hv,ti∈U ×{t} using AA by auto
then have v∈U by auto}773

then have V⊆U by auto
moreover{fix uassume u∈Uthen have hu,ti∈U ×{t} by auto
then have hu,ti∈V ×{t} using AA by auto
then have u∈V by auto}
then have U⊆V by auto
ultimately have U=V by auto}
then show thesis by autoqed
let E={ht,if Nt={0} then 0 else (THE U. converse(r)(µ j. j∈Rt)=U×{t})i.
t∈M}
have ff:function(E) unfolding function_def by auto
moreover{fix t
assume pm:t∈M{ assume nonEE:Nt6={0}{fix jassume j∈Rtwith pm(1) have j∈range(r) using beta_if by autofrom r have r:surj(S,range(r)) using fun_is_surj inj_def by autowith hj∈range(r)i obtain d where d∈S and rd=j using surj_def
by autothen have j∈Q using r inj_def by auto}
then have sub:Rt⊆Q by blastfrom nonE pm nonEE obtain ee where P:ee∈Rt by blast
with sub have ee∈Q by auto
then have Ord(ee) using assms(2) Card_is_Ord Ord_in_Ord InfCard_is_Cardby blastwith P have (µ j. j∈Rt)∈Rt using LeastI[where i=ee and P=λj.
j∈Rt] by autowith pp pm have converse(r)(µ j. j∈Rt)∈{U×{t}. U∈Nt} by auto
then obtain W where converse(r)(µ j. j∈Rt)=W×{t} and s:W∈Nt by
autothen have (THE U. converse(r)(µ j. j∈Rt)=U×{t})=W using reg by
autowith s have (THE U. converse(r)(µ j. j∈Rt)=U×{t})∈Nt by auto}
then have (if Nt={0} then 0 else (THE U. converse(r)(µ j. j∈Rt)=U×{t}))∈Nt
by auto}774

ultimately have thesis1:∀ t∈M. Et∈Nt using function_apply_equality
by auto{fix e
assume e∈Ethen obtain m where m∈M and e=hm,Emi using function_apply_equality
ff by autowith thesis1 have e∈Sigma(M,λt. Nt) by auto}
then have E∈Pow(Sigma(M,λt. Nt)) by autowith ff have E∈Pi(M,λm. Nm) using Pi_iff by auto
then have (∃ f. f:Pi(M,λt. Nt) ∧ (∀ t∈M. ft∈Nt)) using thesis1 by
auto}then show thesis using AxiomCardinalChoice_def assms(2) InfCard_is_Cardby autoqed

The two previous results, state the following equivalence:
theorem Q_choice_Pow_eq_secon_imp_comp:assumes InfCard(Q)shows
S (∀ T. (T{is a topology} ∧ (T{is of second type of cardinal}csucc(Q)))−→ (( T){is compact of cardinal}csucc(Q){in}T))←→({the axiom of} Q {choice holds for subsets} (Pow(Q)))
using second_imp_compact_imp_Q_choice_PowQ compact_of_cardinal_Q assms
by autoIn the next result we will prove that if the space (κ, P ow(κ)), for κ an infinite
cardinal, is compact of its successor cardinal; then all topologycal spaces
which are of second type of the successor cardinal of κ are also compact ofthat cardinal.
theorem Q_csuccQ_comp_eq_Q_choice_Pow:
assumes InfCard(Q) (Q){is compact of cardinal}csucc(Q){in}Pow(Q)showsS ∀ T. (T{is a topology} ∧ (T{is of second type of cardinal}csucc(Q)))−→ (( T){is compact of cardinal}csucc(Q){in}T)
proof
fix T
{
assume top:T {is a topology} and sec:T{is of second type of cardinal}csucc(Q)from assms have Card(csucc(Q)) Card(Q) using InfCard_is_Card Card_is_Ord
Card_csucc by auto
moreoverS S
have
T⊆ T by auto
moreover
{
fix M
S S
assume MT:M∈Pow(T) and cover: T⊆ M
from sec obtain B where B {is a base for} T B≺csucc(Q) using IsSecondOfCard_def
by auto775

with hCard(Q)i obtain N where base:{Ni. i∈Q}{is a base for}T using Card_less_csucc_eq_lebase_to_indexed_base by blast
let S={hu,{i∈Q. Ni⊆u}i. u∈M}
have function(S) unfolding function_def by auto
then have S:M→Pow(Q) using Pi_iff by auto
then have S∈inj(M,Pow(Q)) unfolding inj_def
proof{
fix w xassume AS:w∈Mx∈M{hu, {i ∈ Q . N i ⊆ u}i . u ∈ M} w = {hu,{i ∈ Q . N i ⊆ u}i . u ∈ M} xwith hS:M→Pow(Q)i have ASS:{i ∈ Q . N i ⊆ w}={i ∈ Q . N i⊆ x} using apply_equality by autofrom AS(1,2) MT have w∈Tx∈T by auto
then have w=Interior(w,T)x=Interior(x,T) using top topology0.Top_2_L3[ofT]topology0_def[ofS T] by autoS
then have UN:w=( {B∈{N(i). i∈Q}. B⊆w})x=( {B∈{N(i). i∈Q}.
B⊆x})using interior_set_base_topology top base by auto{
fix bassume b∈w Sthen have b∈ {B∈{N(i). i∈Q}. B⊆w} using UN(1) by auto
then obtain S where S:S∈{N(i). i∈Q} b∈S S⊆w by blast
then obtain j where j:j∈QS=N(j) by auto
then have j∈{i ∈ Q . N(i) ⊆ w} using S(3) by auto
then have N(j)⊆xb∈N(j)j∈Qusing S(2) ASS j by autoS
then have b∈( {B∈{N(i). i∈Q}. B⊆x}) by auto
then have b∈x using UN(2) by auto}
moreover{fix b
assume b∈x Sthen have b∈ {B∈{N(i). i∈Q}. B⊆x} using UN(2) by auto
then obtain S where S:S∈{N(i). i∈Q} b∈S S⊆x by blast
then obtain j where j:j∈QS=N(j) by auto
then have j∈{i ∈ Q . N(i) ⊆ x} using S(3) by auto
then have j∈{i ∈ Q . N(i) ⊆ w} using ASS by auto
then have N(j)⊆wb∈N(j)j∈Qusing S(2) j(2) by autoS
then have b∈( {B∈{N(i). i∈Q}. B⊆w}) by auto
then have b∈w using UN(2) by auto}
ultimately have w=x by auto}
then show ∀ w∈M. ∀ x∈M. {hu, {i ∈ Q . N i ⊆ u}i . u ∈ M} w
= {hu, {i ∈ Q . N i ⊆ u}i . u ∈ M} x −→ w = x by auto

776

qed
then have S∈bij(M,range(S)) using fun_is_surj unfolding bij_def
inj_def surj_def by force
have range(S)⊆Pow(Q) by auto
then have range(S)∈Pow(Pow(Q)) by auto
moreoverS
S
S
have ( (range(S))) {is closed in} Pow(Q) Q∩( range(S))=( range(S))
using IsClosed_def by auto
S
from this(2) compact_closed[OF assms(2) this(1)] have ( range(S)){iscompact of cardinal}csucc(Q) {in}Pow(Q)by automoreoverSS
have(range(S))⊆ (range(S)) by autoS
S
ultimately have ∃ S∈Pow(range(S)). ( (range(S)))⊆ S ∧ S≺ csucc(Q)using IsCompactOfCard_def by auto
S
S
then obtain SS where SS_def:SS⊆range(S) ( (range(S)))⊆ SS SS≺
csucc(Q) by autowith hS∈bij(M,range(S))i have con:converse(S)∈bij(range(S),M) using bij_converse_bij by auto
then have r1:restrict(converse(S),SS)∈bij(SS,converse(S)SS) using restrict_bij bij_def SS_def(1) by auto
then have rr:converse(restrict(converse(S),SS))∈bij(converse(S)SS,SS)
using bij_converse_bij by auto
{
fix x
S
assume x∈ T
S
with cover have x∈ M by auto
then obtain R where R∈M x∈R by autowith MT have R∈T x∈R by auto
then have ∃ V∈{Ni. i∈Q}. V⊆R ∧ x∈V using point_open_base_neighbase by force
then obtain j where j∈Q Nj⊆R and x_p:x∈Nj by autowith hR∈Mi hS:M→Pow(Q)i hS∈bij(M,range(S))i have SR∈range(S) ∧j∈SR using apply_equality
bij_def inj_def by autofrom exI[where P=λt. t∈range(S) ∧ j∈t, OF this] have ∃ A∈range(S).
j∈A unfolding Bex_def
by autoS
then have j∈(
S (range(S))) by auto
then have j∈ SS using SS_def(2) by blast
then obtain SR where SR∈SS j∈SR by auto
moreoverhave converse(restrict(converse(S),SS))∈surj(converse(S)SS,SS)
using rr bij_def by auto
ultimately obtain RR where converse(restrict(converse(S),SS))RR=SR
and p:RR∈converse(S)SS unfolding surj_def by blast
then have converse(converse(restrict(converse(S),SS)))(converse(restrict(converse(Sby automoreover777

have converse(restrict(converse(S),SS))∈inj(converse(S)SS,SS)
using rr unfolding bij_def by auto
moreoverultimately have RR=converse(converse(restrict(converse(S),SS)))SR
using left_inverse[OF _ p]by force
moreoverwith r1 have restrict(converse(S),SS)∈SS→converse(S)SS unfolding bij_def inj_def by auto
then have relation(restrict(converse(S),SS)) using Pi_def relation_def
by autothen have converse(converse(restrict(converse(S),SS)))=restrict(converse(S),SS)
using relation_converse_converse by auto
ultimately have RR=restrict(converse(S),SS)SR by autowith hSR∈SSi have eq:RR=converse(S)SR unfolding restrict by auto
then have converse(converse(S))RR=converse(converse(S))(converse(S)SR)
by automoreoverwith hSR∈SSi have SR∈range(S) using SS_def(1) by autofrom con left_inverse[OF _ this] have converse(converse(S))(converse(S)SR)=SR
unfolding bij_def
by autoultimately have converse(converse(S))RR=SR by auto
then have SRR=SR using relation_converse_converse[of S] unfolding relation_def by auto
moreoverhave converse(S):range(S)→M using con bij_def inj_def by autowith hSR∈range(S)i have converse(S)SR∈M using apply_funtype
by autowith eq have RR∈M by auto
ultimately have SR={i∈Q. Ni⊆RR} using hS:M→Pow(Q)i apply_equality
by autothen have Nj⊆RR using hj∈SRi by autowith x_p have x∈RR
by autoSwith p have x∈ (converse(S)SS) by auto}
S S
then haveT⊆ (converse(S)SS) by blast
moreover{from con have converse(S)SS={converse(S)R. R∈SS} using image_function[ofconverse(S) SS]
SS_def(1) unfolding range_def bij_def inj_def Pi_def by auto
have {converse(S)R. R∈SS}⊆{converse(S)R. R∈range(S)} using SS_def(1)by automoreoverhave converse(S):range(S)→M using con unfolding bij_def inj_def
by autothen have {converse(S)R. R∈range(S)}⊆M using apply_funtype by
force

778

ultimately
have (converse(S)SS)⊆M by auto}
then have converse(S)SS∈Pow(M) by auto
moreoverwith rr have converse(S)SS≈SS using eqpoll_def by auto
then have converse(S)SS≺csucc(Q) using SS_def(3) eq_lesspoll_transby autoultimately
S S
have ∃ N∈Pow(M).
T⊆ N ∧ N≺csucc(Q) by auto
}
S S
S S
then have ∀ M∈Pow(T).
T⊆ M −→ (∃ N∈Pow(M).
T⊆ N ∧ N≺csucc(Q))
by autoS
ultimately have ( T){is compact of cardinal}csucc(Q){in}T unfolding IsCompactOfCard_def
by auto}thenSshow (T {is a topology}) ∧ (T {is of second type of cardinal}csucc(Q))−→ (( T){is compact of cardinal}csucc(Q) {in}T)
by autoqed
theorem Q_disc_is_second_card_csuccQ:
assumes InfCard(Q)shows Pow(Q){is of second type of cardinal}csucc(Q)proof {
fix A
assume S
AS:A∈Pow(Q)have A= {{i}. i∈A} by autoSwith AS have ∃ST∈Pow({{i}. i∈Q}). A= T by auto
then have A∈{ U. U∈Pow({{i}. i∈Q})} by auto}
moreover{fix A
Sassume AS:A∈{ U. U∈Pow({{i}. i∈Q})}
then have A∈Pow(Q) by auto}
ultimately
have base:{{x}. x∈Q} {is a base for} Pow(Q) unfolding IsAbaseFor_def
by blast
let f={hi,{i}i. i∈Q}
have f∈Q→{{x}. x∈Q} unfolding Pi_def function_def by auto
then have f∈inj(Q,{{x}. x∈Q}) unfolding inj_def using apply_equality
by automoreoverfrom hf∈Q→{{x}. x∈Q}i have f∈surj(Q,{{x}. x∈Q}) unfolding surj_def
using apply_equality779

by auto
ultimately have f∈bij(Q,{{x}. x∈Q}) unfolding bij_def by auto
then have Q≈{{x}. x∈Q} using eqpoll_def by auto
then have {{x}. x∈Q}≈Q using eqpoll_sym by auto
then have {{x}. x∈Q}.Q using eqpoll_imp_lepoll by auto
then have {{x}. x∈Q}≺csucc(Q) using Card_less_csucc_eq_le assms InfCard_is_Cardby autowith base show thesis using IsSecondOfCard_def by autoqedThis previous results give us another equivalence of the axiom of Q choicethat is apparently weaker (easier to check) to the previous one.
theorem Q_disc_comp_csuccQ_eq_Q_choice_csuccQ:
assumes InfCard(Q)shows (Q{is compact of cardinal}csucc(Q){in}(Pow(Q))) ←→ ({the axiomof}Q{choice holds for subsets}(Pow(Q)))
proof
assume Q{is compact of cardinal}csucc(Q) {in}Pow(Q)with assms show {the axiom of}Q{choice holds for subsets}(Pow(Q)) using Q_choice_Pow_eq_secon_imp_comp Q_csuccQ_comp_eq_Q_choice_Pow
by autonext
assume {the axiom of}Q{choice holds for subsets}(Pow(Q))
with assms show Q{is compact of cardinal}csucc(Q){in}(Pow(Q)) using
Q_disc_is_second_card_csuccQ Q_choice_Pow_eq_secon_imp_comp Pow_is_top[ofQ]
by force
qed

end

59

Topology 5

theory Topology_ZF_5 imports Topology_ZF_examples Topology_ZF_properties
func1 Topology_ZF_examples_1 Topology_ZF_4
begin

59.1

Some results for separation axioms

First we will give a global characterization of T1 -spaces; which is interesting
because it involves the cardinal N.
lemma (in topology0) T1_cocardinal_coarser:
S
shows (T {is T1 }) ←→ (CoFinite ( T))⊆T
proof{
assume AS:T {is T1 }
{

780

S
fix x assume p:x∈ T{S
fix y assume y∈( T)-{x}with AS p obtain U where/ using isT1_def by blast
S U∈T y∈U x∈Uthen have U∈T y∈U U⊆( T)-{x}
by
auto
S
then have ∃ U∈T. y∈U ∧ U⊆( T)-{x} by auto}
S
S
then have ∀Sy∈( T)-{x}. ∃ U∈T. y∈U ∧ U⊆( T)-{x} by auto
then haveT-{x}∈T using open_neigh_open by autowith p have {x} {is closed in}T using IsClosed_def by auto}S
then have pointCl:∀ x∈ T. {x} {is closed in} T by auto
{
fix A
S
assume AS2:A∈FinPow( T)
let p={hx,{x}i. x∈A}
have p∈A→{{x}. x∈A} using Pi_def unfolding function_def by auto
then have p:bij(A,{{x}. x∈A}) unfolding bij_def inj_def surj_def
using apply_equality
by autothen have A≈{{x}. x∈A} unfolding eqpoll_def by autowith AS2 have Finite({{x}. x∈A}) unfolding FinPow_def using eqpoll_imp_Finite_iff
by autoS
then have {{x}. x∈A}∈FinPow({D ∈ Pow( T) . D {is closed in} T})
using AS2 pointCl unfolding FinPow_defby (safe, blast+)
Sthen have ( {{x}. x∈A}) {is closed in} T using fin_union_cl_is_clby automoreoverS
have{{x}. x∈A}=A by auto
ultimately have A {is closed in} T by simp}Sthen have reg:∀ A∈FinPow( T). A {is closed in} T by auto
{
fix U
S
assume AS2:U ∈ CoCardinal(
T,nat)S
S
then have U∈Pow( T) U=0 ∨ (( T)-U)≺nat using CoCardinal_def by
auto
SS
then have U∈Pow( T) U=0 ∨ Finite( T-U) using lesspoll_nat_is_Finite
by autoS
S
then have U∈Pow( T) U∈T∨( T-U) {is closed in} T using empty_open
topSpaceAssumreg unfolding FinPow_def
byS
S autoSthen have U∈Pow( T) U∈T∨( T-( T-U))∈T using IsClosed_def by
auto
moreover S
Sthen have ( T-( T-U))=U by blast
ultimately have U∈T by auto
}

781

S
then show (CoFinite ( T))⊆T using Cofinite_def by auto}{S
assume (CoFinite ( T))⊆TS
then have AS:CoCardinal( T,nat) ⊆ T using Cofinite_def by auto{
fix x yS
S
assume AS2:x∈ T y∈ Tx6=yhave Finite({y}) by auto
then obtain n where {y}≈n n∈nat using Finite_def by auto
then have {y}≺nat using n_lesspoll_nat eq_lesspoll_transby autoS
then have {y} {is closed in} CoCardinal( T,nat) using closed_sets_cocardinal
AS2(2) by SautoS
then have ( T)-{y}∈CoCardinal( T,nat) using union_cocardinal
IsClosed_def by auto S
with AS have ( T)-{y}∈T by auto
moreoverS
S
with AS2(1,3) have x∈(( T)-{y}) ∧ y∈((/T)-{y}) by auto
ultimately have ∃ V∈T. x∈V∧y∈V/ by(safe,auto)}
then show T {is T1 } using isT1_def by auto}qed

In the previous proof, it is obvious that we don’t need to check if ever cofinite
set is open. It is enough to check if every singleton is closed.
corollary(in topology0) T1_iff_singleton_closed:S
shows (T {is T1 }) ←→ (∀ x∈ T. {x}{is closed in}T)
proof
assume AS:T {is T1 }{S
fix x assume p:x∈ T{S
fix y assume y∈( T)-{x}with AS p obtain U where/ using isT1_def by blast
S U∈T y∈U x∈Uthen have U∈T y∈U U⊆( T)-{x}
by
auto
S
then have ∃ U∈T. y∈U ∧ U⊆( T)-{x} by auto}
S
S
then have ∀Sy∈( T)-{x}. ∃ U∈T. y∈U ∧ U⊆( T)-{x} by auto
then haveT-{x}∈T using open_neigh_open by autowith p have {x} {is closed in}T using IsClosed_def by auto}S
then show pointCl:∀ x∈ T. {x} {is closed in} T by autonext
Sassume pointCl:∀ x∈ T. {x} {is closed in} T
{
fix A
S
assume AS2:A∈FinPow( T)
let p={hx,{x}i. x∈A}

782

have p∈A→{{x}. x∈A} using Pi_def unfolding function_def by auto
then have p:bij(A,{{x}. x∈A}) unfolding bij_def inj_def surj_def
using apply_equality
by autothen have A≈{{x}. x∈A} unfolding eqpoll_def by autowith AS2 have Finite({{x}. x∈A}) unfolding FinPow_def using eqpoll_imp_Finite_iff
by autoS
then have {{x}. x∈A}∈FinPow({D ∈ Pow( T) . D {is closed in} T})
using AS2 pointCl unfolding FinPow_defby (safe, blast+)
Sthen have ( {{x}. x∈A}) {is closed in} T using fin_union_cl_is_clby automoreoverS
have{{x}. x∈A}=A by auto
ultimately have A {is closed in} T by simp}Sthen have reg:∀ A∈FinPow( T). A {is closed in} T by auto
{
fix U
S
assume AS2:U∈CoCardinal(
T,nat)S
S
then have U∈Pow( T) U=0 ∨ (( T)-U)≺nat using CoCardinal_def by
auto
SS
then have U∈Pow( T) U=0 ∨ Finite( T-U) using lesspoll_nat_is_Finite
by autoS
S
then have U∈Pow( T) U∈T∨( T-U) {is closed in} T using empty_open
topSpaceAssumreg unfolding FinPow_def
byS
S autoSthen have U∈Pow( T) U∈T∨( T-( T-U))∈T using IsClosed_def by auto
moreover S
Sthen have ( T-( T-U))=U by blast
ultimately have U∈T by auto}S
then have (CoFinite ( T))⊆T using Cofinite_def by auto
then show T {is T1 } using T1_cocardinal_coarser by autoqed

Secondly, let’s show that the CoCardinal X Q topologies for different sets
Q are all ordered as the partial order of sets. (The order is linear when
considering only cardinals)
lemma order_cocardinal_top:
fixes X
assumes Q1.Q2
shows CoCardinal(X,Q1) ⊆ CoCardinal(X,Q2)
proof
fix x
assume x ∈ CoCardinal(X,Q1)
then have x∈Pow(X) x=0∨(X-x)≺Q1 using CoCardinal_def by autowith assms have x∈Pow(X) x=0∨(X-x)≺Q2 using lesspoll_trans2 by auto
then show x∈CoCardinal(X,Q2) using CoCardinal_def by auto

783

qed
corollary cocardinal_is_T1:
fixes X K
assumes InfCard(K)shows CoCardinal(X,K) {is T1 }proof have nat≤K using InfCard_def assms by auto
then have nat⊆K using le_imp_subset by auto
then have nat.K K6=0using subset_imp_lepoll by Sauto
then have CoCardinal(X,nat) ⊆ CoCardinal(X,K)
CoCardinal(X,K)=X using order_cocardinal_top
union_cocardinal by auto
then show thesis using topology0.T1_cocardinal_coarser topology0_CoCardinal
assms Cofinite_def
by autoqed

In T2 -spaces, filters and nets have at most one limit point.
lemma (in topology0) T2_imp_unique_limit_filter:S
assumes T {is T2 } F {is a filter on} T F →F x F →F yshows x=yproof {
assume x6=yS
S
from assms(3,4) have x∈ T y∈ T using FilterConverges_def assms(2)by autowith hx6=yi have ∃ U∈T. ∃ V∈T. x∈U ∧ y∈V ∧ U∩V=0 using assms(1) isT2_def
by autothen obtain U V where
S x∈U y∈V U∩V=0 U∈T V∈T by autoS
then have U∈{A∈Pow( T). x∈Interior(A,T)} V∈{A∈Pow( T). y∈Interior(A,T)}
using Top_2_L3 by auto
then have U∈F V∈F using FilterConverges_def assms(2) assms(3,4)
by autothen have U∩V∈F using IsFilter_def assms(2) by autowith hU∩V=0i have 0∈F by auto
then have False using IsFilter_def assms(2) by auto}
then show thesis by autoqed
lemma (in topology0) T2_imp_unique_limit_net:
Sassumes T {is T2 } N {is a net on} T N →N x N →N yshows x=yproof SS
S
have (FilterSN..( T)) {is a filter on} ( T) (Filter N..( T)) →F
x (Filter N..( T)) →F yusing filter_of_net_is_filter(1) net_conver_filter_of_net_conver assms(2)assms(3,4) by auto784

with assms(1) show thesis using T2_imp_unique_limit_filter by autoqed

In fact, T2 -spaces are characterized by this property. For this proof we build
a filter containing the union of two filters.
lemma (in topology0)
unique_limit_filter_imp_T2:
S
S
S
assumes ∀ x∈ T. ∀ y∈ T. ∀ F. ((F {is a filter on} T) ∧ (F →F x)∧ (F →F y)) −→ x=yshows T {is T2 }proof {
fix x yS
S
assume x∈ T y∈ T x6=y{
assume ∀ U∈T. S∀ V∈T. (x∈U ∧ y∈V) −→ U∩V6=0
let Ux={A∈Pow(S T). x∈int(A)}let Uy={A∈Pow( T). y∈int(A)}let FF=Ux ∪ Uy ∪ {A∩B. hA,Bi∈Ux × Uy}
have sat:FF {satisfies the filter base condition}
proof {
fix A Bassume A∈FF B∈FF{
assume A∈Ux{
assume B∈Ux
S
with hx∈ Ti hA∈Uxi have A∩B∈Ux using neigh_filter(1) IsFilter_def
by autothen have A∩B∈FF by auto}
moreover{assume B∈Uy
with hA∈Uxi have A∩B∈FF by auto}
moreover{assume B∈{A∩B. hA,Bi∈Ux × Uy}
then obtain
S AA BB where B=AA∩BB AA∈Ux BB∈Uy by autowith hx∈ Ti hA∈Uxi have A∩B=(A∩AA)∩BB A∩AA∈Ux using neigh_filter(1)IsFilter_def by autowith hBB∈Uyi have A∩B∈{A∩B. hA,Bi∈Ux × Uy} by auto
then have A∩B∈FF by auto}
ultimately have A∩B∈FF using hB∈FFi by auto}
moreover{785

assume A∈Uy{
assume B∈Uy
S
with hy∈ Ti hA∈Uyi have A∩B∈Uy using neigh_filter(1) IsFilter_def
by autothen have A∩B∈FF by auto}
moreover{assume B∈Ux
with hA∈Uyi have B∩A∈FF by auto
moreover have A∩B=B∩A by auto
ultimately have A∩B∈FF by auto}
moreover{assume B∈{A∩B. hA,Bi∈Ux × Uy}
then obtain
S AA BB where B=AA∩BB AA∈Ux BB∈Uy by autowith hy∈ Ti hA∈Uyi have A∩B=AA∩(A∩BB) A∩BB∈Uy using neigh_filter(1)IsFilter_def by autowith hAA∈Uxi have A∩B∈{A∩B. hA,Bi∈Ux × Uy} by auto
then have A∩B∈FF by auto}
ultimately have A∩B∈FF using hB∈FFi by auto}
moreover{assume A∈{A∩B. hA,Bi∈Ux × Uy}
then obtain AA BB where A=AA∩BB AA∈Ux BB∈Uy by auto{
assume B∈Uy
S
with hBB∈Uyi hy∈ Ti have B∩BB∈Uy using neigh_filter(1)IsFilter_def by auto
moreover from hA=AA∩BBi have A∩B=AA∩(B∩BB) by auto
ultimately have A∩B∈FF using hAA∈Uxi hB∩BB∈Uyi by auto}
moreover{assume B∈Ux
S
with hAA∈Uxi hx∈ Ti have B∩AA∈Ux using neigh_filter(1)IsFilter_def by auto
moreover from hA=AA∩BBi have A∩B=(B∩AA)∩BB by auto
ultimately have A∩B∈FF using hB∩AA∈Uxi hBB∈Uyi by auto}
moreover{assume B∈{A∩B. hA,Bi∈Ux × Uy}
then obtain AA2 BB2 where B=AA2∩BB2 AA2∈Ux BB2∈Uy by autofrom hB=AA2∩BB2i hA=AA∩BBi have A∩B=(AA∩AA2)∩(BB∩BB2) by

786

auto
moreoverS
from hAA∈UxihAA2∈Uxihx∈ Ti have AA∩AA2∈Ux using neigh_filter(1)IsFilter_def by auto
moreoverS
from hBB∈UyihBB2∈Uyihy∈ Ti have BB∩BB2∈Uy using neigh_filter(1)IsFilter_def by auto
ultimately have A∩B∈FF by auto}
ultimately have A∩B∈FF using hB∈FFi by auto}
ultimately have A∩B∈FF using hA∈FFi by auto
then have ∃ D∈FF. D⊆A∩B unfolding Bex_def by auto}
then have ∀ A∈FF. ∀ B∈FF. ∃ D∈FF. D⊆A∩B by force
moreoverS
S
have
T∈Ux using hx∈ Ti neigh_filter(1) IsFilter_def by auto
then have FF6=0 by auto
moreover{assume 0∈FF
moreoverS
have 0∈Ux/
using hx∈ Ti neigh_filter(1) IsFilter_def by auto
moreoverS
have 0∈Uy/using hy∈ Ti neigh_filter(1) IsFilter_def by auto
ultimately have 0∈{A∩B. hA,Bi∈Ux × Uy} by auto
then obtain A B where 0=A∩B A∈UxB∈Uy by auto
then have x∈int(A)y∈int(B) by auto
moreoverwith h0=A∩Bi have int(A)∩int(B)=0 using Top_2_L1 by auto
moreoverhave int(A)∈Tint(B)∈T using Top_2_L2 by auto
ultimately have False using h∀ U∈T. ∀ V∈T. x∈U∧y∈V −→ U∩V6=0i
by auto}then have 0∈FF/
by autoultimately show thesis using SatisfiesFilterBase_def by autoqed
moreoverS
have FF⊆Pow( T) by autoS
ultimately
have bas:FF S{is a base filter} {A∈Pow( T). ∃ D∈FF. D⊆A}SS{A∈Pow( T). ∃ D∈FF. D⊆A}= T
using base_unique_filter_set2[ofFF] by auto
S
S
then have fil:{A∈Pow( T). ∃ D∈FF. D⊆A} {is a filter on}
T using basic_filter sat
by
auto
S
have ∀ U∈Pow( T).Sx∈int(U) −→ (∃ D∈FF. D⊆U) by auto
then have S{A∈Pow( T). ∃ D∈FF. D⊆A} →F x using convergence_filter_base2[OFfil bas(1) _ hx∈ Ti] by auto
moreover787

Sthen have ∀ U∈Pow(S T). y∈int(U) −→ (∃ D∈FF. D⊆U) by auto
then have S{A∈Pow( T). ∃ D∈FF. D⊆A} →F y using convergence_filter_base2[OFfil bas(1) _ hy∈ Ti] by autoS
S
ultimately have x=y using assms fil hx∈ Tihy∈ Ti by blast
with hx6=yi have False by auto}
then have ∃ U∈T. ∃ V∈T. x∈U ∧ y∈V ∧ U∩V=0 by blast}
then show thesis using isT2_def by autoqed
lemma (in topology0)
unique_limit_net_imp_T2:
S
S
S
assumes ∀ x∈ T. ∀ y∈ T. ∀ N. ((N {is a net on} T) ∧ (N →N x) ∧ (N→N y)) −→ x=yshows T {is T2 }proof {
fix x y F SSSassume x∈ T y∈ TF {is a filter Son} TF →F xF →F ythen have (Net(F)) {is a net on}
T(Net F) →N x(Net F) →N yusing filter_conver_net_of_filter_conver net_of_filter_is_net by
auto
SS
with hx∈ Ti hy∈ Ti have x=y using assms by blast}
S
S
S
then have ∀ x∈ T. ∀ y∈ T. ∀ F. ((F {is a filter on} T) ∧ (F →F x)∧ (F →F y)) −→ x=y by auto
then show thesis using unique_limit_filter_imp_T2 by autoqedThis results make easy to check if a space is T2 .
S

The topology which comes from a filter as in F {is a filter on} F =⇒(F ∪ {0}) {is a topology} is not T2 generally. We will see in this file lateron, that the exceptions are a consequence of the spectrum.
corollary filter_T2_imp_card1:
S
S
assumesF x∈ FS (F∪{0}) {is T2 } F {is a filter on}
shows
F={x}
proof {
S
fix y assume y∈ Fthen have F →F y {in} (F∪{0}) using lim_filter_top_of_filter assms(2)by automoreoverhave F →F x {in} (F∪{0}) using lim_filter_top_of_filter assms(2,3)
by automoreoverS S
have
F= (F∪{0}) by auto
ultimately
have y=x using topology0.T2_imp_unique_limit_filter[OF topology0_filter[OF788assms(2)] assms(1)] assms(2)by auto}S
then haveF⊆{x} by autowith assms(3) show thesis by autoqed

There are more separation axioms that just T0 , T1 or T2
definition
IsRegular (_{is regular} 90)
S
where T{is regular} ≡ ∀ A. A{is closed in}T −→ (∀ x∈ T-A. ∃ U∈T. ∃ V∈T.
A⊆U∧x∈V∧U∩V=0)
definitionisT3 (_{is T3 } 90)
where T{is T3 } ≡ (T{is T1 }) ∧ (T{is regular})definition
IsNormal (_{is normal} 90)
where T{is normal} ≡ ∀ A. A{is closed in}T −→ (∀ B. B{is closed in}T
∧ A∩B=0 −→(∃ U∈T. ∃ V∈T. A⊆U∧B⊆V∧U∩V=0))
definition
isT4 (_{is T4 } 90)
where T{is T4 } ≡ (T{is T1 }) ∧ (T{is normal})lemma (in topology0) T4_is_T3:
assumes T{is T4 } shows T{is T3 }proof from assms have nor:T{is normal} using isT4_def by autofrom assms have T{isST1 } using isT4_def by auto
then have Cofinite ( T)⊆T using T1_cocardinal_coarser by auto{
fix A
assume AS:A{is closed in}T
{
fix x
S
assume x∈ T-A
have Finite({x}) by auto
then obtain n where {x}≈n n∈nat unfolding Finite_def by auto
then have {x}.n n∈nat using eqpoll_imp_lepoll by auto
then haveby autoS {x}≺nat using n_lesspoll_nat lesspoll_trans1
S
with hx∈ T-Ai have {x} {is closed in} (Cofinite ( T)) using Cofinite_def
closed_sets_cocardinal
by S
auto
S
then haveT-{x}∈Cofinite( T) unfolding IsClosed_def using union_cocardinal
Cofinite_def
by auto789

S
S
with hCofinite( T)⊆Ti haveT-{x}∈T by autoSwith hx∈ T-Ai have {x}{is closed in}T A∩{x}=0 using IsClosed_def
by autowith nor AS have ∃ U∈T. ∃ V∈T. A⊆U∧{x}⊆V∧U∩V=0 unfolding IsNormal_def
by blast
then have ∃ U∈T. ∃ V∈T. A⊆U∧ x∈V∧U∩V=0 by auto}S
then have ∀ x∈ T-A. ∃ U∈T. ∃ V∈T. A⊆U∧ x∈V∧U∩V=0 by auto}
then have T{is regular} using IsRegular_def by blast
with hT{is T1 }i show thesis using isT3_def by autoqed
lemma (in topology0) T3_is_T2:
assumes T{is T3 } shows T{is T2 }proof from assms have T{is regular} using isT3_def by autofrom assms have T{isST1 } using isT3_def by auto
then have Cofinite ( T)⊆T using T1_cocardinal_coarser by auto{
fix x yS
S
assume x∈ Ty∈ Tx6=yhave Finite({x}) by auto
then obtain n where {x}≈n n∈nat unfolding Finite_def by auto
then have {x}.n n∈nat using eqpoll_imp_lepoll by auto
then haveby autoS {x}≺nat using n_lesspoll_nat lesspoll_trans1
S
with hx∈ Ti have {x} {is closed in} (Cofinite ( T)) using Cofinite_def
closed_sets_cocardinal
by S
auto
S
then haveT-{x}∈Cofinite( T) unfolding IsClosed_def using union_cocardinal
Cofinite_def
by autoS
S
with hCofinite( T)⊆Ti haveT-{x}∈T by auto
S
S
S
with hx∈ Tihy∈ Tihx6=yi have {x}{is closed in}T y∈ T-{x} using IsClosed_def
by autowith hT{is regular}i have ∃ U∈T. ∃ V∈T. {x}⊆U∧y∈V∧U∩V=0 unfolding
IsRegular_def by force
then have ∃ U∈T. ∃ V∈T. x∈U∧y∈V∧U∩V=0 by auto}
then show thesis using isT2_def by autoqed

Regularity can be rewritten in terms of existence of certain neighboorhoods.
lemma (in topology0) regular_imp_exist_clos_neig:
assumes T{is regular} and U∈T and x∈Ushows ∃ V∈T. x∈V ∧ cl(V)⊆U
proof S
from assms(2) have ( T-U){is closed in}T using Top_3_L9 by auto moreover790

S
from assms(2,3) have x∈ T by auto moreover
noteS assms(1,3) ultimately obtain A B where A∈T and B∈T and A∩B=0and ( T-U)⊆A and x∈Bunfolding IsRegular_def by
S blastfrom hA∩B=0i hB∈Ti haveSB⊆ T-A by autowith hA∈Ti have cl(B)⊆T-A using Top_3_L9
SS Top_3_L13 by auto
moreover from h( T-U)⊆Ai assms(3) have
T-A⊆U by auto
moreover note hx∈Bi hB∈Ti
ultimately have B∈T ∧ x∈B ∧ cl(B)⊆U by auto
then show thesis by autoqed
lemma (in topology0)
exist_clos_neig_imp_regular:S
assumes ∀ x∈ T. ∀ U∈T. x∈U −→ (∃ V∈T. x∈V∧ cl(V)⊆U)
shows T{is regular}
proof {
fix F
assume F{is closed in}T{S
fix x assume x∈ T-F
S S
Swith hF{is closed in}Ti have x∈ T
T-F∈T F⊆ T unfolding IsClosed_def
by autoS
S
with assms hx∈ T-Fi have ∃ V∈T. x∈V S∧ cl(V)⊆ T-F by auto
then obtain VS where V∈T
S x∈V cl(V)⊆S T-F by autofrom hcl(V)⊆ T-Fi hF⊆ Ti S
have SF⊆ T-cl(V) by autoi
moreover from hV∈T
S haveS T-( T-V)=V by autoS
then have cl(V)= T-int( T-V) using Top_3_L11(2)[ofT-V] byauto
S
ultimatelyShave F⊆int(T-V) by auto moreoverS
have int( T-V)⊆ ST-V using Top_2_L1 by auto
then have V∩(int( T-V))=0 by auto moreovernote hx∈VihV∈TiSultimately
S
S
have V∈T int( T-V)∈T F⊆int( T-V) ∧ x∈V ∧ (int( T-V))∩V=0 using Top_2_L2
by autothen have ∃ U∈T. ∃ V∈T. F⊆U ∧ x∈V ∧ U∩V=0 by auto}S
then have ∀ x∈ T-F. ∃ U∈T. ∃ V∈T. F⊆U ∧ x∈V ∧ U∩V=0 by auto}
then show thesis using IsRegular_def by blastqed
lemma (in topology0) regular_eq:
Sshows T{is regular} ←→ (∀ x∈ T. ∀ U∈T. x∈U −→ (∃ V∈T. x∈V∧ cl(V)⊆U))
using regular_imp_exist_clos_neig exist_clos_neig_imp_regular by force

A Hausdorff space separates compact spaces from points.
theorem (in topology0) T2_compact_point:791

S
assumes T{is T2 } A{is compact in}T x∈ T x∈A/shows ∃ U∈T. ∃ V∈T. A⊆U ∧ x∈V ∧ U∩V=0
proof {
assume A=0SS
then have A⊆0∧x∈ T∧(0∩( T)=0) using assms(3) by auto
then have thesis using empty_open topSpaceAssum unfolding IsATopology_def
by auto}moreover{assume noEmpty:A6=0
let U={hU,Vi∈T×T. x∈U∧U∩V=0}{
fix y assume y∈Awith hx∈A/ i assms(4) have x6=ySby autoS
moreover from hy∈Ai have x∈ Ty∈ T using assms(2,3) unfolding
IsCompact_def by auto
ultimately obtain U V where U∈TV∈TU∩V=0x∈Uy∈V using assms(1) unfolding isT2_def by blast
then have ∃ hU,Vi∈U. y∈V by auto}
then have ∀ y∈A.
S ∃ hU,Vi∈U. y∈V by auto
then have A⊆ {snd(B). B∈U} by auto
moreover have {snd(B). B∈U}∈Pow(T) by auto S
ultimately have ∃ N∈FinPow({snd(B). B∈U}). A⊆ N using assms(2) unfolding IsCompact_def by autoS
then obtain N where ss:N∈FinPow({snd(B).
B∈U}) A⊆ N by autoSwith h{snd(B). B∈U}∈Pow(T)i have A⊆ N N∈Pow(T) unfolding FinPow_def
by auto
S S
then have NN:A⊆ N
N∈T using topSpaceAssum unfolding IsATopology_def
by autofrom ss have Finite(N)N⊆{snd(B). B∈U} unfolding FinPow_def by auto
then obtain n where n∈nat N≈n unfolding Finite_def by auto
then have N.n using
eqpoll_imp_lepoll by auto
S
from noEmpty hA⊆ Ni have NnoEmpty:N6=0 by auto
let QQ={hn,{fst(B). B∈{A∈U. snd(A)=n}}i. n∈N}
have QQPi:QQ:N→{{fst(B). B∈{A∈U. snd(A)=n}}. n∈N} unfolding Pi_def
function_def domain_def by auto{
fix n assume n∈Nwith hN⊆{snd(B). B∈U}i obtain B where n=snd(B) B∈U by auto
then have fst(B)∈{fst(B). B∈{A∈U. snd(A)=n}} by auto
then have {fst(B). B∈{A∈U. snd(A)=n}}6=0 by auto moreoverfrom hn∈Ni have hn,{fst(B). B∈{A∈U. snd(A)=n}}i∈QQ by autowith QQPi have QQn={fst(B). B∈{A∈U. snd(A)=n}} using apply_equality
by autoultimately have QQn6=0 by auto}792

then have ∀ n∈N. QQn6=0 by autowith hn∈nati hN.ni have ∃ f. f∈Pi(N,λt. QQt) ∧ (∀ t∈N. ft∈QQt) using finite_choice unfolding AxiomCardinalChoiceGen_def
by autothen obtain f where fPI:f∈Pi(N,λt. QQt) (∀ t∈N. ft∈QQt) by autofrom fPI(1) NnoEmpty have range(f)6=0 unfolding Pi_def range_def domain_def
converse_def by (safe,blast){
fix t assume t∈Nthen have ft∈QQt using
fPI(2) byS
S autowith ht∈Ni have ft∈ (QQN) QQt⊆ (QQN) using func_imagedef QQPi
by auto}S
S
then have reg:∀ t∈N. ft∈ (QQN) ∀ t∈N. QQt⊆ (QQN) by auto{
fix tt assume tt∈fwith fPI(1) have()(QQ)) unfolding Pi_def by auto
S tt∈Sigma(N,Sthen have tt∈( xa∈N.
y∈QQxa. {hxa,yi}) unfolding Sigma_def by
auto
then obtain xa y whereS xa∈N y∈QQxa tt=hxa,yi by autowith reg(2) have y∈ (QQN) by blast
S
S S
with htt=hxa,yii hxa∈Ni have tt∈( xa∈N.
y∈ (QQN). {hxa,yi}) byautoSthen have tt∈N×( (QQN)) unfolding Sigma_def by auto}S
then have ffun:f:N→ (QQN) using fPI(1) unfolding Pi_def by auto
then have f∈surj(N,range(f)) using fun_is_surj by autowith hN.ni hn∈nati have range(f).N using surj_fun_inv_2 nat_into_Ordby autowith hN.ni have range(f).n using lepoll_trans by blast
with hn∈nati have Finite(range(f)) using n_lesspoll_nat lesspoll_nat_is_Finite
lesspoll_trans1 by autoS
moreover from ffun have rr:range(f)⊆ (QQN) unfolding Pi_def by
auto
then have range(f)⊆T by auto
ultimately T
have range(f)∈FinPow(T) unfolding FinPow_def by auto
then haverange(f)∈T using fin_inter_open_open hrange(f)6=0i by
auto moreover{
fix S assume S∈range(f)Swith rr have S∈ (QQN) by blast
then have ∃ B∈(QQN). S ∈ B using Union_iff by auto
then obtain B where B∈(QQN) S∈B by auto
then have ∃ rr∈N. hrr,Bi∈QQ unfolding image_def by auto
then have ∃ rr∈N. B={fst(B). B∈{A∈U. snd(A)=rr}} by autowith hS∈Bi obtain rr where hS,rri∈U by auto
then have x∈S by auto}T
then have x∈ range(f) using hrange(f)6=0i by auto moreover

793

{
S
T
fix y assume y∈( N)∩( range(f))
then have reg:(∀ S∈range(f). y∈S)∧(∃ t∈N. y∈t) by auto
then obtain t where t∈N y∈t by auto
then have ht, {fst(B). B∈{A∈U. snd(A)=t}}i∈QQ by auto
then have ft∈range(f) using apply_rangeI ffun by autowith reg have yft:y∈ft by autowith ht∈Ni fPI(2) have ft∈QQt by autowith ht∈Ni have ft∈{fst(B). B∈{A∈U. snd(A)=t}} using apply_equality
QQPi by auto
then have hft,ti∈U by auto
then have ft∩t=0 by autowith hy∈ti yft have False by auto}S
T
then have ( N)∩( range(f))=0 by blast moreovernote NNultimately have thesis by auto}
ultimately show thesis by autoqed

A Hausdorff space separates compact spaces from other compact spaces.
theorem (in topology0) T2_compact_compact:assumes T{is T2 } A{is compact in}T B{is compact in}T A∩B=0
shows ∃ U∈T. ∃ V∈T. A⊆U ∧ B⊆V ∧ U∩V=0
proof {
assume B=0 S
S
then have A⊆ T∧B⊆0∧(( T)∩0=0) using assms(2) unfolding IsCompact_def
by auto moreover
have S0∈T using empty_open topSpaceAssum by auto moreoverhave
T∈T using topSpaceAssum unfolding IsATopology_def by auto
ultimately
have thesis by auto}
moreover{assume noEmpty:B6=0
let U={hU,Vi∈T×T. A⊆U ∧ U∩V=0}{
fix y assume Sy∈Bthen have y∈ T using assms(3) unfolding IsCompact_def by autowith hy∈Bi have ∃ U∈T. ∃ V∈T. A⊆U ∧ y∈V ∧ U∩V=0 using T2_compact_point
assms(1,2,4) by auto
then have ∃ hU,Vi∈U. y∈V by auto}
then have ∀ y∈B.
S ∃ hU,Vi∈U. y∈V by auto
then have B⊆ {snd(B). B∈U} by auto
moreover have {snd(B). B∈U}∈Pow(T) by auto794

S
ultimately have ∃ N∈FinPow({snd(B). B∈U}). B⊆ N using assms(3) unfolding IsCompact_def by autoS
then obtain N where ss:N∈FinPow({snd(B).
B∈U}) B⊆ N by autoSwith h{snd(B). B∈U}∈Pow(T)i have B⊆ N N∈Pow(T) unfolding FinPow_def
by auto
S S
then have NN:B⊆ N
N∈T using topSpaceAssum unfolding IsATopology_def
by autofrom ss have Finite(N)N⊆{snd(B). B∈U} unfolding FinPow_def by auto
then obtain n where n∈nat N≈n unfolding Finite_def by auto
then have N.n using
eqpoll_imp_lepoll by auto
S
from noEmpty hB⊆ Ni have NnoEmpty:N6=0 by auto
let QQ={hn,{fst(B). B∈{A∈U. snd(A)=n}}i. n∈N}
have QQPi:QQ:N→{{fst(B). B∈{A∈U. snd(A)=n}}. n∈N} unfolding Pi_def
function_def domain_def by auto{
fix n assume n∈Nwith hN⊆{snd(B). B∈U}i obtain B where n=snd(B) B∈U by auto
then have fst(B)∈{fst(B). B∈{A∈U. snd(A)=n}} by auto
then have {fst(B). B∈{A∈U. snd(A)=n}}6=0 by auto moreoverfrom hn∈Ni have hn,{fst(B). B∈{A∈U. snd(A)=n}}i∈QQ by autowith QQPi have QQn={fst(B). B∈{A∈U. snd(A)=n}} using apply_equality
by autoultimately have QQn6=0 by auto}
then have ∀ n∈N. QQn6=0 by autowith hn∈nati hN.ni have ∃ f. f∈Pi(N,λt. QQt) ∧ (∀ t∈N. ft∈QQt) using finite_choice unfolding AxiomCardinalChoiceGen_def
by autothen obtain f where fPI:f∈Pi(N,λt. QQt) (∀ t∈N. ft∈QQt) by autofrom fPI(1) NnoEmpty have range(f)6=0 unfolding Pi_def range_def domain_def
converse_def by (safe,blast){
fix t assume t∈Nthen have ft∈QQt using
fPI(2) byS
S autowith ht∈Ni have ft∈ (QQN) QQt⊆ (QQN) using func_imagedef QQPi
by auto}S
S
then have reg:∀ t∈N. ft∈ (QQN) ∀ t∈N. QQt⊆ (QQN) by auto{
fix tt assume tt∈fwith fPI(1) have()(QQ)) unfolding Pi_def by auto
S tt∈Sigma(N,Sthen have tt∈( xa∈N.
y∈QQxa. {hxa,yi}) unfolding Sigma_def by
auto
then obtain xa y whereS xa∈N y∈QQxa tt=hxa,yi by autowith reg(2) have y∈ (QQN) by blast
S
S S
with htt=hxa,yii hxa∈Ni have tt∈( xa∈N.
y∈ (QQN). {hxa,yi}) byautoSthen have tt∈N×( (QQN)) unfolding Sigma_def by auto
}

795

S
then have ffun:f:N→ (QQN) using fPI(1) unfolding Pi_def by auto
then have f∈surj(N,range(f)) using fun_is_surj by autowith hN.ni hn∈nati have range(f).N using surj_fun_inv_2 nat_into_Ordby autowith hN.ni have range(f).n using lepoll_trans by blast
with hn∈nati have Finite(range(f)) using n_lesspoll_nat lesspoll_nat_is_Finite
lesspoll_trans1 by autoS
moreover from ffun have rr:range(f)⊆ (QQN) unfolding Pi_def by
auto
then have range(f)⊆T by auto
ultimately T
have range(f)∈FinPow(T) unfolding FinPow_def by auto
then haverange(f)∈T using fin_inter_open_open hrange(f)6=0i by
auto moreover{
fix S assume S∈range(f)Swith rr have S∈ (QQN) by blast
then have ∃ B∈(QQN). S ∈ B using Union_iff by auto
then obtain B where B∈(QQN) S∈B by auto
then have ∃ rr∈N. hrr,Bi∈QQ unfolding image_def by auto
then have ∃ rr∈N. B={fst(B). B∈{A∈U. snd(A)=rr}} by autowith hS∈Bi obtain rr where hS,rri∈U by auto
then have A⊆S by auto}T
then have A⊆ range(f) using hrange(f)6=0i by auto moreover{ST
fix y assume y∈( N)∩( range(f))
then have reg:(∀ S∈range(f). y∈S)∧(∃ t∈N. y∈t) by auto
then obtain t where t∈N y∈t by auto
then have ht, {fst(B). B∈{A∈U. snd(A)=t}}i∈QQ by auto
then have ft∈range(f) using apply_rangeI ffun by autowith reg have yft:y∈ft by autowith ht∈Ni fPI(2) have ft∈QQt by autowith ht∈Ni have ft∈{fst(B). B∈{A∈U. snd(A)=t}} using apply_equality
QQPi by auto
then have hft,ti∈U by auto
then have ft∩t=0 by autowith hy∈ti yft have False by auto}
T
S
then have ( range(f))∩( N)=0 by blast moreovernote NNultimately have thesis by auto}
ultimately show thesis by autoqed

A compact Hausdorff space is normal.
corollary (in topology0)
S T2_compact_is_normal:
assumes T{is T2 } ( T){is compact in}Tshows T{is normal} unfolding IsNormal_def

796proof S
from assms(2) have car_nat:( T){is compact of cardinal}nat{in}T using Compact_is_card_nat by auto{
fix A B assume A{isS closed in}T B{is closed in}TA∩B=0
S
then have com:(( T)∩A){is compact of cardinal}nat{in}T (( T)∩B){iscompact of cardinal}nat{in}T using compact_closed[OF car_nat]
by autoS
S
from hA{is closed in}TihB{is closed in}Ti have ( T)∩A=A( T)∩B=B unfolding IsClosed_def by autowith com have A{is compact of cardinal}nat{in}T B{is compact of cardinal}nat{in}Tby autothen have A{is compact in}TB{is compact in}T using Compact_is_card_nat
by autowith hA∩B=0i have ∃ U∈T. ∃ V∈T. A⊆U ∧ B⊆V ∧ U∩V=0 using T2_compact_compact
assms(1) by auto}
then show ∀ A. A {is closed in} T −→ (∀ B. B {is closed in} T ∧ A∩ B = 0 −→ (∃ U∈T. ∃ V∈T. A ⊆ U ∧ B ⊆ V ∧ U ∩ V = 0))
by autoqed

59.2

Hereditability

A topological property is hereditary if whenever a space has it, every subspace also has it.
definition IsHer (_{is hereditary} 90)
S
where P {is hereditary} ≡ ∀ T. T{is a topology} ∧ P(T) −→ (∀ A∈Pow( T).
P(T{restricted to}A))
lemma subspace_of_subspace:S
assumes A⊆BB⊆ T
shows T{restricted to}A=(T{restricted to}B){restricted to}A
proof
from assms have S:∀ S∈T. A∩(B∩S)=A∩S by auto
then show T {restricted to} A ⊆ T {restricted to} B {restricted to}
A unfolding RestrictedTo_def
by autofrom S show T {restricted to} B {restricted to} A ⊆ T {restrictedto} A unfolding RestrictedTo_def
by autoqed

The separation properties T0 , T1 , T2 y T3 are hereditary.
theorem regular_here:S
assumes T{is regular} A∈Pow( T) shows (T{restricted to}A){is regular}
proof {

797

fix C
assume A:C{is closedin}(T{restricted to}A)S{fix y assume Sy∈ (T{restricted to}A)y∈C/
S
withSA have ( (T{restricted to}A))-C∈(T{restricted to}A)C⊆ (T{restrictedto}A) y∈ (T{restricted to}A)y∈C/ unfolding IsClosed_def
by automoreoverS
with assms(2) have(T{restricted to}A)=A unfolding RestrictedTo_def
by autoultimately have A-C∈T{restricted to}A y∈Ay∈CC∈Pow(A)/by autothen obtain S where S∈T A∩S=A-C y∈Ay∈C/ unfolding RestrictedTo_def
by autothen have y∈A-CA∩S=A-C by autowith hC∈Pow(A)i have y∈A∩SC=A-A∩S by auto
then have y∈S C=A-S by autoSwith assms(2) have y∈S C⊆ T-S by auto
moreoverS
S
from hS∈Ti haveT-( T-S)=S by auto
moreoverS
with hS∈Ti have ( ST-S) S{is closed
S in}T using IsClosed_def by auto
ultimately have y∈ T-(S T-S)(
T-S) {is closed in}TS
S by autowith assms(1) have ∀ y∈ T-( T-S). ∃ U∈T. ∃ V∈T. ( T-S)⊆U∧y∈V∧U∩V=0
unfolding IsRegular_def
by autoSSSwith hy∈ T-( T-S)i have ∃ U∈T.S ∃ V∈T. ( T-S)⊆U∧y∈V∧U∩V=0 by auto
then obtain U V where U∈TV∈T
T-S⊆Uy∈VU∩V=0 by auto
then have A∩U∈(T{restricted to}A)A∩V∈(T{restrictedto}A) C⊆Uy∈V(A∩U)∩(A∩V)=0
S
unfolding RestrictedTo_def using hC⊆ T-Si by auto
moreoverwith hC∈Pow(A)ihy∈Ai have C⊆A∩Uy∈A∩V by auto
ultimately have ∃ U∈(T{restricted to}A). ∃ V∈(T{restricted to}A). C⊆U∧y∈V∧U∩V=0
by auto}S
then have ∀ x∈ (T{restricted to}A)-C. ∃ U∈(T{restricted to}A). ∃ V∈(T{restrictedto}A). C⊆U∧x∈V∧U∩V=0 by auto}S
then have ∀ C. C{is closed in}(T{restricted to}A) −→ (∀ x∈ (T{restrictedto}A)-C. ∃ U∈(T{restricted to}A). ∃ V∈(T{restricted to}A). C⊆U∧x∈V∧U∩V=0)
by blast
then show thesis using IsRegular_def by autoqed
corollary here_regular:
shows IsRegular {is hereditary} using regular_here IsHer_def by auto
theorem T1_here:S
assumes T{is T1 } A∈Pow( T) shows (T{restricted to}A){is T1 }proof S
from assms(2) have un: (T{restricted to}A)=A unfolding RestrictedTo_def
by auto798

{
fix x yassume x∈Ay∈Ax6
S =ySSwith hA∈Pow( T)i have x∈ Ty∈ Tx6=y by auto
then have ∃ U∈T. x∈U∧y∈U/ using assms(1) isT1_def by auto
then obtain U where U∈Tx∈Uy∈U/ by autowith hx∈Ai have A∩U∈(T{restricted to}A) x∈A∩U y∈A∩U/
unfolding RestrictedTo_def
by autothen have ∃ U∈(T{restricted to}A). x∈U∧y∈U/ by blast}
S
S
with un have ∀ x y. x∈ (T{restricted to}A) ∧ y∈ (T{restricted to}A)∧ x6=y −→ (∃ U∈(T{restricted to}A). x∈U∧y∈U)/
by autothen show thesis using isT1_def by autoqed
corollary here_T1:
shows isT1 {is hereditary} using T1_here IsHer_def by auto
lemma here_and:assumes P {is hereditary} Q {is hereditary}shows (λT. P(T) ∧ Q(T)) {is hereditary} using assms unfolding IsHer_def
by autocorollary here_T3:
shows isT3 {is hereditary} using here_and[OF here_T1 here_regular]
unfolding IsHer_def isT3_def.
lemma T2_here:S
assumes T{is T2 } A∈Pow( T) shows (T{restricted to}A){is T2 }proof S
from assms(2) have un: (T{restricted to}A)=A unfolding RestrictedTo_def
by auto{fix x yassume x∈Ay∈Ax6
S =ySSwith hA∈Pow( T)i have x∈ Ty∈ Tx6=y by auto
then have ∃ U∈T. ∃ V∈T. x∈U∧y∈V∧U∩V=0 using assms(1) isT2_def by
auto
then obtain U V where U∈T V∈Tx∈Uy∈VU∩V=0 by autowith hx∈Aihy∈Ai have A∩U∈(T{restricted to}A)A∩V∈(T{restricted to}A)x∈A∩U y∈A∩V (A∩U)∩(A∩V)=0unfolding RestrictedTo_def by auto
then have ∃ U∈(T{restricted to}A). ∃ V∈(T{restricted to}A). x∈U∧y∈V∧U∩V=0
unfolding Bex_def by auto}
S
S
with un have ∀ x y. x∈ (T{restricted to}A) ∧ y∈ (T{restricted to}A)∧ x6=y −→ (∃ U∈(T{restricted to}A). ∃ V∈(T{restricted to}A). x∈U∧y∈V∧U∩V=0)
by autothen show thesis using isT2_def by auto

799

qed
corollary here_T2:
shows isT2 {is hereditary} using T2_here IsHer_def by auto
lemma T0_here:S
assumes T{is T0 } A∈Pow( T) shows (T{restricted to}A){is T0 }proof S
from assms(2) have un: (T{restricted to}A)=A unfolding RestrictedTo_def
by auto{fix x yassume x∈Ay∈Ax6
S =ySSwith hA∈Pow( T)i have x∈ Ty∈ Tx6=y by auto
then have ∃ U∈T. (x∈U∧y∈U)∨(y∈U∧x/∈U)/using assms(1) isT0_def by
auto
then obtain U where U∈T (x∈U∧y∈U)∨(y∈U∧x/∈U)/
by autowith hx∈Aihy∈Ai have A∩U∈(T{restricted to}A) (x∈A∩U∧y∈A∩U)∨(y∈A∩U∧x
/
∈A∩U)
/
unfolding RestrictedTo_def by auto
then have ∃ U∈(T{restricted to}A). (x∈U∧y∈U)∨(y∈U∧x/∈U)/
unfolding
Bex_def by auto}
S
S
with un have ∀ x y. x∈ (T{restricted to}A) ∧ y∈ (T{restricted to}A)∧ x6=y −→ (∃ U∈(T{restricted to}A). (x∈U∧y∈U)∨(y∈U∧x/∈U))/
by autothen show thesis using isT0_def by autoqed
corollary here_T0:
shows isT0 {is hereditary} using T0_here IsHer_def by auto

59.3

Spectrum and anti-properties

The spectrum of a topological property is a class of sets such that all topologies defined over that set have that property.
The spectrum of a property gives us the list of sets for which the property
doesn’t give any topological information. Being in the spectrum of a topological property is an invariant in the category of sets and function; meningthat equipollent sets are in the same spectra.
definition Spec (_ {is in the spectrum of} _ 99)S
where Spec(K,P) ≡ ∀ T. ((T{is a topology} ∧T≈K) −→ P(T))
lemma equipollent_spect:assumes A≈B B {is in the spectrum of} P
shows A {is in the spectrum of} P
proof S
from assms(2) have ∀ T. ((T{is a topology} ∧T≈B) −→ P(T)) using
Spec_def by auto

800

S
then have ∀ T. ((T{is a topology} ∧T≈A) −→ P(T)) using eqpoll_trans[OF_ assms(1)] by auto
then show thesis using Spec_def by autoqed
theorem eqpoll_iff_spec:
assumes A≈B
shows (B {is in the spectrum of} P) ←→ (A {is in the spectrum of}P)
proof
assume B {is in the spectrum of} P
with assms equipollent_spect show A {is in the spectrum of} P by auto
next
assume A {is in the spectrum of} P
moreoverfrom assms have B≈A using eqpoll_sym by auto
ultimately show B {is in the spectrum of} P using equipollent_spect
by autoqed

From the previous statement, we see that the spectrum could be formed
only by representative of clases of sets. If AC holds, this means that the
spectrum can be taken as a set or class of cardinal numbers.
Here is an example of the spectrum. The proof lies in the indiscrite filter {A}that can be build for any set. In this proof, we see that without choice, there
is no way to define the sepctrum of a property with cardinals because if a
set is not comparable with any ordinal, its cardinal is defined as 0 without
the set being empty.
theorem T4_spectrum:shows (A {is in the spectrum of} isT4) ←→ A . 1
proof
assume A {is in the spectrum of} isT4 S
then have reg:∀ T. ((T{is a topology} ∧T≈A) −→ (T {is T4 })) using Spec_def by auto{
assume A6=0
then obtain xSwhere x∈A by auto
then have x∈ {A} by auto
moreoverSthen have {A} {is a filter on} {A} using IsFilter_def by auto
moreoverSthen have ({A}∪{0}) {is a topology} ∧({A}∪{0})=A using top_of_filterby autoS
then have top:({A}∪{0}) {is a topology}({A}∪{0})≈A using eqpoll_refl
by autothen have ({A}∪{0}) {is T4 } using reg by auto
then have ({A}∪{0}) {is T2 } using topology0.T3_is_T2 topology0.T4_is_T3
topology0_def top by auto

801

S
ultimately have{A}={x} using filter_T2_imp_card1[of {A}x] by auto
then have A={x} by auto
then have A≈1 using singleton_eqpoll_1 by auto}
moreoverhave A=0 −→ A≈0 by auto
ultimately have A≈1∨A≈0 by blast
then show A.1 using empty_lepollI eqpoll_imp_lepoll eq_lepoll_transby autonext
assume A.1
have A=0∨A6=0 by auto
then obtain E where A=0∨E∈A by auto
then have A≈0∨E∈A by autowith hA.1i have A≈0∨A={E} using lepoll_1_is_sing by auto
then have A≈0∨A≈1 using singleton_eqpoll_1 by auto
{
fix T
S
assume AS:T{is a topology} T≈A{assume A≈0S
with AS have T{is a topology} and empty: T=0 using eqpoll_transeqpoll_0_is_0 by auto
then have T{is T2 } using isT2_def by auto
then have T{is T1 } using T2_is_T1 by auto
moreoverfrom empty have T⊆{0} by autowith AS(1) have T={0} using empty_open by autofrom empty have rr:∀ A. A{is closed in}T −→ A=0 using IsClosed_def
by autohave ∃ U∈T. ∃ V∈T. 0⊆U∧0⊆V∧U∩V=0 using empty_open AS(1) by autowith rr have ∀ A. A{is closed in}T −→ (∀ B. B{is closed in}T ∧A∩B=0 −→ (∃ U∈T. ∃ V∈T. A⊆U∧B⊆V∧U∩V=0))
by blast
then have T{is normal} using IsNormal_def by autowith hT{is T1 }i have T{is T4 } using isT4_def by auto}
moreover{assume A≈1
S
with AS have T{is a topology} and NONempty: T≈1 using eqpoll_trans[ofSTA1] by auto S
then haveT.1 using eqpoll_imp_lepoll by auto
moreover{S
assumeT=0 S
then have 0≈ T by autowith NONempty have 0≈1 using eqpoll_trans by blast
then have 0=1 using eqpoll_0_is_0 eqpoll_sym by auto

802

then have False by auto}S
then have
T6=0 by autoS
then obtain R whereR∈ T by blast
S
ultimately have
T={R} using lepoll_1_is_sing by auto{
fix x yassume x{is closed
SSin}Ty{is closed in}T x∩y=0
then have x⊆ Ty⊆ T using IsClosed_def
by autoS
then have x=0∨y=0 using hx∩y=0i h T={R}i by force{
assume x=0
SS
then have x⊆0y⊆ T using hy⊆ Ti by auto
moreoverS
have 0∈T T∈T using AS(1) IsATopology_def empty_open by auto
ultimately have ∃ U∈T. ∃ V∈T. x⊆U∧y⊆V∧U∩V=0 by auto}
moreover{assume x6=0
i have y=0 by autowith hx=0∨y=0S
S
then have x⊆ Ty⊆0 using hx⊆ Ti by auto
moreoverS
have 0∈T T∈T using AS(1) IsATopology_def empty_open by auto
ultimately have ∃ U∈T. ∃ V∈T. x⊆U∧y⊆V∧U∩V=0 by auto}
ultimately
have (∃ U∈T. ∃ V∈T. x ⊆ U ∧ y ⊆ V ∧ U ∩ V = 0) by blast}
then have T{is normal} using IsNormal_def by auto
moreover{fix x yS
S
assumeS x∈ Ty∈ Tx6=ywith h T={R}i have False by auto
then have ∃ U∈T. x∈U∧y∈U/ by auto}
then have T{is T1 } using isT1_def by auto
ultimately have T{is T4 } using isT4_def by auto}
ultimately have T{is T4 } using hA≈0∨A≈1i by auto}S
then have ∀ T. (T{is a topology} ∧T ≈ A) −→ (T{is T4 }) by auto
then show A {is in the spectrum of} isT4 using Spec_def by autoqed

If the topological properties are related, then so are the spectra.
lemma P_imp_Q_spec_inv:
assumes ∀ T. T{is a topology} −→ (Q(T) −→ P(T))

803

A {is in the spectrum

of} Q
shows A {is in the spectrum of} P
proof S
from assms(2) have ∀ T. T{is a topology} ∧T ≈ A −→ Q(T) using Spec_def
by autoSwith assms(1) have ∀ T. T{is a topology} ∧T ≈ A −→ P(T) by auto
then show thesis using Spec_def by auto
qed

Since we already now the spectrum of T4 ; if we now the spectrum of T0 , itshould be easier to compute the spectrum of T1 , T2 and T3 .
theorem T0_spectrum:shows (A {is in the spectrum of} isT0) ←→ A . 1
proof
assume A {is in the spectrum of} isT0 S
then have reg:∀ T. ((T{is a topology} ∧T≈A) −→ (T {is T0 })) using Spec_def by auto{
assume A6=0
then obtain xSwhere x∈A by auto
then have x∈ {A} by auto
moreoverSthen have {A} {is a filter on} {A} using IsFilter_def by auto
moreoverSthen have ({A}∪{0}) {is a topology} ∧({A}∪{0})=A using top_of_filterby autoS
then have ({A}∪{0}) {is a topology} ∧({A}∪{0})≈A using eqpoll_refl
by autothen have ({A}∪{0}) {is T0 } using reg by auto{
fix yassume y∈Ax6=ywith h({A}∪{0}) {is T0 }i obtain U where U∈({A}∪{0}) and dis:(x∈ U ∧ y ∈/ U) ∨ (y ∈ U ∧ x ∈/ U) using isT0_def by auto
then have U=A by S
autowith dis hy∈Ai hx∈ {A}i have False by auto}
then haveS ∀ y∈A. y=x by autowith hx∈ {A}i have A={x} by blast
then have A≈1 using singleton_eqpoll_1 by auto}
moreoverhave A=0 −→ A≈0 by auto
ultimately have A≈1∨A≈0 by blast
then show A.1 using empty_lepollI eqpoll_imp_lepoll eq_lepoll_transby autonext
assume A.1{

804fix T
assume T{is a topology}
then have (T{is T4 })−→(T{is T0 }) using topology0.T4_is_T3 topology0.T3_is_T2
T2_is_T1 T1_is_T0
topology0_def by auto}
then have ∀ T. T{is a topology} −→ ((T{is T4 })−→(T{is T0 })) by auto
then have (A {is in the spectrum of} isT4) −→ (A {is in the spectrumof} isT0)
using P_imp_Q_spec_inv[of λT. (T{is T4 })λT. T{is T0 }] by auto
then show (A {is in the spectrum of} isT0) using T4_spectrum hA.1i
by autoqed
theorem T1_spectrum:shows (A {is in the spectrum of} isT1) ←→ A . 1
proof note T2_is_T1 topology0.T3_is_T2 topology0.T4_is_T3
then have (A {is in the spectrum of} isT4) −→ (A {is in the spectrumof} isT1)
using P_imp_Q_spec_inv[of isT4isT1] topology0_def by auto
moreovernote T1_is_T0
then have (A {is in the spectrum of} isT1) −→ (A {is in the spectrumof}isT0)
using P_imp_Q_spec_inv[of isT1isT0] by auto
moreovernote T0_spectrum T4_spectrum
ultimately show thesis by blastqed
theorem T2_spectrum:shows (A {is in the spectrum of} isT2) ←→ A . 1
proof note topology0.T3_is_T2 topology0.T4_is_T3
then have (A {is in the spectrum of} isT4) −→ (A {is in the spectrumof} isT2)
using P_imp_Q_spec_inv[of isT4isT2] topology0_def by auto
moreovernote T2_is_T1
then have (A {is in the spectrum of} isT2) −→ (A {is in the spectrumof}isT1)
using P_imp_Q_spec_inv[of isT2isT1] by auto
moreovernote T1_spectrum T4_spectrum
ultimately show thesis by blastqed
theorem T3_spectrum:805

shows (A {is in the spectrum of} isT3) ←→ A . 1
proof note topology0.T4_is_T3
then have (A {is in the spectrum of} isT4) −→ (A {is in the spectrumof} isT3)
using P_imp_Q_spec_inv[of isT4isT3] topology0_def by auto
moreovernote topology0.T3_is_T2
then have (A {is in the spectrum of} isT3) −→ (A {is in the spectrumof}isT2)
using P_imp_Q_spec_inv[of isT3isT2] topology0_def by auto
moreovernote T2_spectrum T4_spectrum
ultimately show thesis by blastqed
theorem compact_spectrum:S
shows (A {is in the spectrum of} (λT. ( T) {is compact in}T)) ←→Finite(A)proofSassume A {is in the spectrum of} (λT. S( T) {is compactin}T)Sthen have reg:∀ T. T{is a topology} ∧T≈A −→ (( T) {is compactin}T) using Spec_def by autoS
have Pow(A){is a topology} ∧Pow(A)=A
using Pow_is_top by autoS
then have Pow(A){is a topology} ∧Pow(A)≈A using eqpoll_refl byautowith reg have A{is compact in}Pow(A) by auto
moreoverhave {{x}. x∈A}∈Pow(Pow(A)) by auto
moreoverS
have{{x}. x∈A}=A by autoS
ultimately have ∃ N∈FinPow({{x}. x∈A}). A⊆ N using IsCompact_def by
autoS
then obtain N where N∈FinPow({{x}. x∈A})
A⊆ N by autoS
then have N⊆{{x}. x∈A} Finite(N) A⊆ N using FinPow_def by auto{
fix t
assume t∈{{x}. x∈A}then obtainS x where Sx∈At={x} by autowith hA⊆ Ni have x∈ N by auto
then obtain B where B∈Nx∈B by autowith hN⊆{{x}. x∈A}i have B={x} by autowith ht={x}ihB∈Ni have t∈N by auto}with hN⊆{{x}. x∈A}i have N={{x}. x∈A} by autowith hFinite(N)i have Finite({{x}. x∈A}) by auto
let B={hx,{x}i. x∈A}
have B:A→{{x}. x∈A} unfolding Pi_def function_def by auto
then have B:bij(A,{{x}. x∈A}) unfolding bij_def inj_def surj_def us-

806

ing apply_equality by auto
then have A≈{{x}. x∈A} using eqpoll_def by autowith hFinite({{x}. x∈A})i show Finite(A) using eqpoll_imp_Finite_iff
by autonext
assume Finite(A){S
fix T assume T{is a topology}S T≈Awith hFinite(A)i have S
Finite( T) using eqpoll_imp_Finite_iff by auto
then have Finite(Pow( T)) using Finite_Pow by auto
moreoverS
have T⊆Pow( T) by auto
ultimately have Finite(T) using subset_Finite by auto
{
fix M
S S
assume M∈Pow(T) T⊆ M
i have Finite(M) using subset_Finite by autowith hS
Finite(T)
S
S S
h
i
with
T⊆ M have ∃ N∈FinPow(M).
T⊆ N using FinPow_def by auto}S
then have ( T){is compact in}T unfolding IsCompact_def by auto}S
then show A {is in the spectrum of} (λT. ( T) {is compact in}T) using Spec_def by autoqed

It is, at least for some people, surprising that the spectrum of some properties
cannot be completely determined in ZF.
theorem compactK_spectrum:
assumes {the axiom of}K{choice holds forSsubsets}(Pow(K)) Card(K)shows (A {is in the spectrum of} (λT. (( T){is compact of cardinal}
csucc(K){in}T))) ←→ (A.K)
proof
S
assume A {is in the spectrum of} (λT. (( T){is compact of cardinal}
csucc(K){in}T))S
Sthen have reg:∀ T. T{is a topology}∧ T≈A −→ (( T){is compact ofcardinal} csucc(K){in}T) using Spec_def by auto
then have A{is compact of cardinal} csucc(K) {in} Pow(A) using Pow_is_top[ofA] by auto
S
S
then have ∀ M∈Pow(Pow(A)). A⊆ M −→ (∃ N∈Pow(M). A⊆ N ∧ N≺csucc(K))
unfolding IsCompactOfCard_def by auto
moreoverhave {{x}. x∈A}∈Pow(Pow(A)) by auto
moreoverS
have A= {{x}. x∈A} by autoS
ultimately have ∃ N∈Pow({{x}. x∈A}). A⊆ NS∧ N≺csucc(K) by auto
then obtain N where N∈Pow({{x}. x∈A})SA⊆ N N≺csucc(K) by auto
then have N⊆{{x}. x∈A} N≺csucc(K) A⊆ N using FinPow_def by auto
{
fix t

807

assume t∈{{x}. x∈A}then obtainS x where Sx∈At={x} by autowith hA⊆ Ni have x∈ N by auto
then obtain B where B∈Nx∈B by autowith hN⊆{{x}. x∈A}i have B={x} by autowith ht={x}ihB∈Ni have t∈N by auto}with hN⊆{{x}. x∈A}i have N={{x}. x∈A} by auto
let B={hx,{x}i. x∈A}
from hN={{x}. x∈A}i have B:A→ N unfolding Pi_def function_def by autowith hN={{x}. x∈A}i have B:inj(A,N) unfolding inj_def using apply_equality
by autothen have A.N using lepoll_def by autowith hN≺csucc(K)i have A≺csucc(K) using lesspoll_trans1 by auto
then show A.K using Card_less_csucc_eq_le assms(2) by auto
next
assume A.K
{
fix T
S
assume T{isS a topology} T≈Ahave Pow( T){is a topology} using Pow_is_top by auto
{
fix B
S
assume AS:B∈Pow( T)Sthen have {{i}. i∈B}⊆{{i} .i∈ T} by auto
moreoverS
have B= {{i}. i∈B} by autoS
S
ultimately have
S ∃ S∈Pow({{i}. i∈ ST}). B= S by auto
then have B∈{ U. U∈Pow({{i}. i∈ T})} by auto}
moreover
{
fix B
S
S
assume AS:B∈{ U.
S U∈Pow({{i}. i∈ T})}
then have B∈Pow( T) by auto}
ultimately
S
S
have base:{{x}. x∈ T} {is a base for}Pow( T) unfolding IsAbaseFor_def
by autoS
let f={hi,{i}i.
i∈ T} SS
have f:f: T→ {{x}. x∈ T} using Pi_def function_def by auto
moreover{fix w xS
S
assume as:w∈ Tx∈ Tfw=fx
with f have fw={w} fx={x} using apply_equality by autowith as(3) have w=x by auto}
S
S
with f have f:inj( T,{{x}. x∈ T}) unfolding inj_def by auto808

moreover{
fix xaS
assume xa∈{{x}. x∈ T}Sthen obtain x where x∈ Txa={x} by autowith f havefx=xa using
S
S apply_equality by autowith hx∈ Ti have ∃ x∈ T. fx=xa by auto}
S
S
then have ∀ xa∈{{x}. x∈
S T}. ∃ x∈ ST. fx=xa by blast
ultimately have f:bij( T,{{x}. x∈ T}) unfolding bij_def surj_def
by autoS
S
then haveT≈{{x}.
S x∈ ST} using eqpoll_def by auto
then have{{x}. x∈ T}≈ TS using eqpoll_sym by autoSwith h T≈Ai have {{x}.
x∈ T}≈A using eqpoll_trans by blastSthen have {{x}. x∈ T}.AS using eqpoll_imp_lepoll by autowith hA.Ki have {{x}.
S x∈ T}.K using lepoll_trans by blast
then have {{x}. x∈ T}≺csucc(K) using assms(2) Card_less_csucc_eq_leby autoSwith base have Pow( T) {is of second type of cardinal}csucc(K) unfolding IsSecondOfCard_def by auto
moreoverS
S
S
have
Pow( T)= T by auto
S
S
with calculation assms(1) hPow( ST){is a topology}i have ( T) {iscompact of cardinal}csucc(K){in}Pow( T) S
using compact_of_cardinal_Q[of KPow( T)] by auto
moreoverS
have T⊆Pow( T) by
S autoultimately have ( T) {is compact of cardinal}csucc(K){in}T using
compact_coarser by auto}S
then show A {is in the spectrum of} (λT. (( T){is compact of cardinal}csucc(K){in}T)) using Spec_def by autoqed
theorem compactK_spectrum_reverse:S
assumes ∀ A. (A {is in the spectrum of} (λT. (( T){is compact of cardinal}
csucc(K){in}T))) ←→ (A.K) InfCard(K)shows {the axiom of}K{choice holds for subsets}(Pow(K))
proof have K.K using lepoll_refl by autoS
then have K {is in the spectrum of} (λT. (( T){is compact of cardinal}
csucc(K){in}T)) using assms(1) by auto
moreoverhave Pow(K){is a topology} using Pow_is_top by auto
moreoverS
have
Pow(K)=K
by autoS
then have
Pow(K)≈K using eqpoll_refl by auto
ultimately
have K {is compact of cardinal} csucc(K){in}Pow(K) using Spec_def by

809

auto
then show thesis using Q_disc_comp_csuccQ_eq_Q_choice_csuccQ assms(2)by autoqed

This last theorem states that if one of the forms of the axiom of choice related to this compactness property fails, then the spectrum will be different.
Notice that even for Lindelöf spaces that will happend.
The spectrum gives us the posibility to define what an anti-property means.
A space is anti-P if the only subspaces which have the property are the onesin the spectrum of P. This concept tries to put together spaces that arecompletely opposite to spaces where P(T).
definition
antiProperty (_{is anti-}_ 50)S
where T{is anti-}P ≡ ∀ A∈Pow( T). P(T{restricted to}A) −→ (A {isin the spectrum of} P)
abbreviation
ANTI(P) ≡ λT. (T{is anti-}P)

A first, very simple, but very useful result is the following: when the properties are related and the spectra are equal, then the anti-properties are
related in the oposite direction.
theorem (in topology0) eq_spect_rev_imp_anti:
assumes ∀ T. T{is a topology} −→ P(T) −→ Q(T) ∀ A. (A{is in the spectrumof}Q) −→ (A{is in the spectrum of}P)
and T{is anti-}Qshows T{is anti-}Pproof {
fix A
S
assume A∈Pow( T)P(T{restricted to}A)with assms(1) have Q(T{restrictedto}A) using Top_1_L4 by autoSwith assms(3) hA∈Pow( T)i have A{is in the spectrum of}Q using antiProperty_def
by autowith assms(2) have A{is in the spectrum of}P by auto}
then show thesis using antiProperty_def by autoqed

If a space can be P(T)∧Q(T) only in case the underlying set is in the spectrumof P; then Q(T)−→ANTI(P,T) when Q is hereditary.
theorem Q_P_imp_Spec:S
assumes ∀ T. ((T{is a topology}∧P(T)∧Q(T))−→ (( T){is in the spectrumof}P))and Q{is hereditary}shows ∀ T. T{is a topology} −→ (Q(T)−→(T{is anti-}P))810

prooffix T{assume T{is a topology}{
assume Q(T){assume ¬(T{is anti-}P)S
then obtain A where A∈Pow( T) P(T{restricted to}A)¬(A{is in
the spectrum of}P)
unfolding antiProperty_def by auto
S
from hQ(T)ihT{is a topology}ihA∈Pow( T)i assms(2) have Q(T{restrictedto}A)
unfolding IsHer_def by auto
moreovernote hP(T{restricted to}A)i assms(1)moreoverfrom hT{is a topology}i have (T{restricted to}A){is a topology}
using topology0.Top_1_L4
topology0_def by auto
moreoverS
S
from hA∈Pow( T)i have(T{restricted to}A)=A unfolding RestrictedTo_def
by autoultimately have A{is in the spectrum of}P by autowith h¬(A{is in the spectrum of}P)i have False by auto}
then have T{is anti-}P by auto}
then have Q(T)−→(T{is anti-}P) by auto}
then show (T {is a topology}) −→ (Q(T) −→ (T{is anti-}P)) by autoqed

If a topologycal space has an hereditary property, then it has its double-anti
property.
theorem (in topology0)her_P_imp_anti2P:
assumes P{is hereditary} P(T)shows T{is anti-}ANTI(P)proof {
assume ¬(T{is anti-}ANTI(P))
S
then have ∃ A∈Pow( T). ((T{restricted to}A){is anti-}P)∧¬(A{is in
the spectrum of}ANTI(P))
unfolding antiProperty_def[of _ SANTI(P)] by auto
then obtain A where A_def:A∈Pow( T)¬(A{is in the spectrum of}ANTI(P))(T{restrictedto}A){is anti-}P
by autoS
S
from hA∈Pow( T)i have tot: (T{restricted to}A)=A unfolding RestrictedTo_def
by auto811

Sfrom A_def have reg:∀ B∈Pow( (T{restricted to}A)). P((T{restrictedto}A){restricted to}B) −→ (B{is in the spectrum of}P)
unfolding antiProperty_def by auto
have ∀ B∈Pow(A). (T{restricted to}A){restrictedto}B=T{restricted
Sto}B using subspace_of_subspace hA∈Pow( T)i by auto
then have ∀ B∈Pow(A). P(T{restricted to}B) −→ (B{is in the spectrumof}P) using reg tot
by force
moreoverS
have ∀ B∈Pow(A). P(T{restricted to}B) using assms hA∈Pow( T)i unfolding IsHer_def using topSpaceAssum by blast
ultimately have reg2:∀ B∈Pow(A). (B{is in the spectrum of}P) by autohi
S from ¬(A{is in the spectrum of}ANTI(P)) have ∃ T. T{is a topology}∧T≈A ∧ ¬(T{is anti-}P)
unfolding Spec_def by autoS
then obtain S where S{is a topology}
S S≈A ¬(S{is anti-}P) by autofrom h¬(S{is anti-}P)i have ∃ B∈Pow( S). P(S{restricted to}B) ∧ ¬(B{isin the spectrum of}P) unfolding antiProperty_def by autoS
then obtain B where B_def:¬(B{is in the spectrum of}P) B∈Pow( S)by autoS
then have
B. S using subset_imp_lepoll by autoSwith h S≈Ai have B.A using lepoll_eq_trans by auto
then obtain f where f∈inj(B,A) unfolding lepoll_def by auto
then have f∈bij(B,range(f)) using inj_bij_range by auto
then have B≈range(f) unfolding eqpoll_def by autowith B_def(1) have ¬(range(f){is in the spectrum of}P) using eqpoll_iff_specby automoreoverwith hf∈inj(B,A)i have range(f)⊆A unfolding inj_def Pi_def by autowith reg2 have range(f){is in the spectrum of}P by auto
ultimately have False by auto}
then show thesis by autoqed

The anti-properties are always hereditary
theorem anti_here:
shows ANTI(P){is hereditary}
proof {
fix T
assume T {is a topology}ANTI(P,T)
{
fix A
S
assume A∈Pow(
T)
S
then have(T{restricted to}A)=A unfolding RestrictedTo_def by
auto
moreover{812

fix Bassume B∈Pow(A)P((T{restricted
SS to}A){restricted to}B)with hA∈Pow( T)i have B∈Pow( T)P(T{restricted to}B) using subspace_of_subspaceby autowith hANTI(P,T)i have B{is in the spectrum of}P unfolding antiProperty_def
by auto}S
ultimately have ∀ B∈Pow( (T{restricted to}A)). (P((T{restrictedto}A){restricted to}B)) −→ (B{is in the spectrum of}P)
by autothen have ANTI(P,(T{restricted to}A)) unfolding antiProperty_def
by auto}S
then have ∀ A∈Pow( T). ANTI(P,(T{restricted to}A)) by auto}
then show thesis using IsHer_def by autoqed
corollary (in topology0) anti_imp_anti3:
assumes T{is anti-}Pshows T{is anti-}ANTI(ANTI(P))
using anti_here her_P_imp_anti2P assms by auto

In the article [5], we can find some results on anti-properties.
theorem (in topology0) anti_T0:
S
shows (T{is anti-}isT0) ←→ T={0, T}
proof
S
assume T={0, T}
{
fix A
S
assume A∈Pow( T)(T{restricted to}A) {is T0 }{fix B
assume B∈T{restricted to}A
then obtain S where S∈T and B=A∩S unfolding RestrictedTo_def by
auto
SSwith hT={0, T}i haveS∈{0, T} by autoS
then have S=0∨S= S
T by autowith hB=A∩SihA∈Pow( T)i have B=0∨B=A by auto}
moreover{S
S
S
have 0∈{0, S T}
T∈{0, T}S by autowith hT={0, T}i have 0∈T( T)∈T by autoS
then have A∩0∈(T{restricted to}A) A∩( T)∈(T{restricted to}A)
using RestrictedTo_def by auto
moreoverS
S
from hA∈Pow( T)i have A∩( T)=A by auto
ultimately have 0∈(T{restricted to}A) A∈(T{restricted to}A) by

813

auto
}
ultimately have (T{restricted to}A)={0,A} by autowith h(T{restricted to}A) {is T0 }i have {0,A} {is T0 } by auto{
assume A6=0
then obtain x where x∈A by blast{
fix yassume y∈Ax6=ywith h{0,A} {is T0 }i obtain U where U∈{0,A} and dis:(x ∈ U ∧y ∈/ U) ∨ (y ∈ U ∧ x ∈/ U) using isT0_def by auto
then have U=A by autowith dis hy∈Ai hx∈Ai have False by auto}
then have ∀ y∈A. y=x by autowith hx∈Ai have A={x} by blast
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}isT0 using T0_spectrum by auto}
moreover{assume A=0
then have A≈0 by auto
then have A.1 using empty_lepollI eq_lepoll_trans by auto
then have A{is in the spectrum of}isT0 using T0_spectrum by auto}
ultimately have A{is in the spectrum of}isT0 by auto}
then show T{is anti-}isT0 using antiProperty_def by auto
next
assume T{is anti-}isT0
S
then have ∀ A∈Pow( T). (T{restricted to}A){is T0 } −→ (A{is in the
spectrum of}isT0) using antiProperty_def
by autoS
then have reg:∀ A∈Pow( T). (T{restricted to}A){is T0 } −→ (A.1) using T0_spectrum by auto{S
assume ∃ A∈T. A6=0∧ A6= T
S
then obtain A where A∈TA6=0A6=S T by auto
then obtain x y where x∈A y∈
S T-A by blast
with hA∈Ti have s:{x,y}∈Pow( T) x6=y by auto
note smoreover{fix b1 b2 S
S
assume b1∈ (T{restricted to}{x,y})b2∈ (T{restricted to}{x,y})b16=b2
moreover814

Sfrom s have(T{restricted to}{x,y})={x,y} unfolding RestrictedTo_def
by autoultimately have (b1=x∧b2=y)∨(b1=y∧b2=x) by autowith hx6=yi have (b1∈{x}∧b2∈{x})/∨ (b2∈{x}∧b1∈{x})/
by automoreoverS
from hy∈ T-Aihx∈Ai have {x}={x,y}∩A by autowith hA∈Ti have {x}∈(T{restricted to}{x,y}) unfolding RestrictedTo_def
by autoultimately have ∃ U∈(T{restricted to}{x,y}). (b1∈U∧b2∈U)/∨ (b2∈U∧b1∈U)/by auto}then have (T{restricted to}{x,y}){is T0 } using isT0_def by auto
ultimately have {x,y}.1 using reg by auto
moreoverhave x∈{x,y} by auto
ultimately have {x,y}={x} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto
ultimately have y∈{x} by auto
then have y=x by autowith hx6=yi have False by auto}S
then have T⊆{0, T} by auto
moreoverS
from topSpaceAssum have 0∈T T∈T using IsATopology_def empty_open byauto
S
ultimately show T={0, T} by autoqed
lemma indiscrete_spectrum:S
shows (A {is in the spectrum of}(λT. T={0, T})) ←→ A.1
proofS
assume (A {is in the spectrum of}(λT. T={0,T}))
SS
then have reg:∀ T. ((T{is a topology} ∧T≈A) −→ T ={0, T}) using
Spec_def by auto
moreoverS
have
Pow(A)=A
by autoS
then have
Pow(A)≈A by auto
moreoverhave Pow(A) {is a topology} using Pow_is_top by auto
ultimately have P:Pow(A)={0,A} by auto{
assume A6=0
then obtain x where x∈A by blast
then have {x}∈Pow(A) by autowith P have {x}=A by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}815

moreover{assume A=0
then have A≈0 by auto
then have A.1 using empty_lepollI eq_lepoll_trans by auto}
ultimately show A.1 by auto
next
assume A.1
{
fix T
S
assume T{is a topology} T≈A{assume
S A=0
S
i havewith h T≈AST≈0 by auto
then have
T=0 using eqpoll_0_is_0 by auto
then have T⊆{0} by auto
i have T={0} using empty_open by autowith hT{is a topology}Sthen have T={0, T} by auto}
moreover{assume A6=0
then obtain E where E∈A by blast
with hA.1i have A={E} using lepoll_1_is_sing by auto
then haveA≈1 using singleton_eqpoll_1
by autoS
S
i have NONempty:
with h T≈AST≈1 using eqpoll_trans by blast
then haveT.1 using eqpoll_imp_lepoll by auto
moreover{S
assumeT=0 S
then have 0≈ T by autowith NONempty have 0≈1 using eqpoll_trans by blast
then have 0=1 using eqpoll_0_is_0 eqpoll_sym by auto
then have False by auto}S
then have
T6=0 by autoS
then obtain R whereR∈ T by blast
S
ultimately have
T={R} using lepoll_1_is_sing by auto
moreoverS
have T⊆Pow( T) by auto
ultimately have T⊆Pow({R}) by auto
then have T⊆{0,{R}} by blast
moreoverS
with hT{is a topology}i have 0∈T T∈T using IsATopology_def by auto
moreoverS
note h T={R}iSultimately have T={0, T} by auto
}

816

S
ultimately have T={0, T} by auto}S
then show A {is in the spectrum of}(λT. T={0, T}) using Spec_def by
auto
qed
theorem (in topology0) anti_indiscrete:
S
shows (T{is anti-}(λT. T={0, T})) ←→ T{is T0 }proofassume T{is T0 }
{
fix A
S
S
assume A∈Pow(S T)T{restricted to}A={0, (T{restricted to}A)}then have un: (T{restricted to}A)=A T{restricted to}A={0,A} using
RestrictedTo_def by auto S
from hT{is T0 }ihA∈Pow( T)i have (T{restricted to}A){is T0 } using T0_hereby auto{assume A=0
then have A≈0 by auto
then have A.1 using empty_lepollI eq_lepoll_trans by auto}
moreover{assume A6=0
then obtain E where E∈A by blast{
fix yassume y∈Ay6=E
S
S
with hE∈Ai un have y∈ (T{restricted to}A)E∈ (T{restricted to}A)
by autowith h(T{restricted to}A){is T0 }ihy6=Ei have ∃ U∈(T{restricted to}A).
(E∈U∧y∈U)∨(E/∈U∧y∈U)/
unfolding isT0_def by blast
then obtain U where U∈(T{restricted to}A) (E∈U∧y∈U)∨(E/∈U∧y∈U)/by autowith hT{restricted to}A={0,A}i have U=0∨U=A by auto
ihy∈AihE∈Ai have False by autowith h(E∈U∧y∈U)∨(E/∈U∧y∈U)/}then have ∀ y∈A. y=E by autowith hE∈Ai have A={E} by blast
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
ultimately have A.1 by autoS
then have A{is in the spectrum of}(λT. T={0, T}) using indiscrete_spectrum
by auto}S
then show T{is anti-}(λT. T={0, T}) unfolding antiProperty_def by

817

auto
next
S
assume T{is anti-}(λT.
T={0, T})S
S
then have ∀ A∈Pow( T). (T{restricted to}A)={0,(T{restricted to}A)}S−→ (A {is in the spectrum of} (λT. T={0, T})) using antiProperty_def
by autoS
S
then have ∀ A∈Pow( T). (T{restricted to}A)={0, (T{restricted to}A)}−→ A.1 using indiscrete_spectrum by auto
moreoverS
S
have ∀ A∈Pow( T).
(T{restricted to}A)=A unfolding RestrictedTo_def
by autoS
ultimately have reg:∀ A∈Pow( T). (T{restricted to}A)={0,A} −→ A.1
by auto{fix x yS
S
assume x∈ Ty∈ Tx6=y{assume ∀ U∈T. (x∈U∧y∈U)∨(x∈U∧y/∈U)/then have T{restricted to}{x,y}⊆{0,{x,y}} unfolding RestrictedTo_def
by automoreoverS
S
Sfrom hx∈ Tihy∈ Ti have emp:0∈T{x,y}∩0=0 and tot: {x,y}={x,y}∩ T
ST∈T using topSpaceAssum empty_open IsATopology_def by autofrom emp have 0∈T{restricted to}{x,y} unfolding RestrictedTo_def
by automoreoverfrom tot have {x,y}∈T{restricted to}{x,y} unfolding RestrictedTo_def
by autoultimately haveto}{x,y}={0,{x,y}} by auto
S T{restricted
Swith reg hx∈ Tihy∈ Ti have {x,y}.1 by auto
moreoverhave x∈{x,y} by auto
ultimately have {x,y}={x} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto
ultimately have y∈{x} by auto
then have y=x by auto
then have False using hx6=yi by auto}
then have ∃ U∈T. (x∈U∨y/∈U)∧(x∈U∨y∈U)/
by autothen have ∃ U∈T. (x∈U∧y∈U)∨(x/∈U∧y∈U)/by auto}S
S
then have ∀ x y. x∈ T∧y∈ T∧ x6=y −→ (∃ U∈T. (x∈U∧y∈U)∨(y∈U∧x/∈U))/
by autothen show T {is T0 } using isT0_def by autoqed

The conclusion is that being T0 is just the opposite to being indiscrete.
Next, let’s compute the anti-Ti for i = 1, 2, 3 or 4. Surprisingly, they are818

all the same. Meaning, that the total negation of T1 is enough to negate allof these axioms.
theorem anti_T1:
S
S
shows (T{is anti-}isT1) ←→ (IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))
proof
assume T{is anti-}isT1
S
S
let r={hU,Vi∈Pow( T)×Pow( T). U⊆V}
have antisym(r) unfolding antisym_def by auto
moreoverhave trans(r) unfolding trans_def by auto
moreover{fix A Bassume A∈TB∈T{
assume ¬(A⊆B∨B⊆A)
then have A-B6=0B-A6=0 by auto
then obtain x y where x∈Ax∈By∈By/∈A/ x6=y by blast
then have {x,y}∩A={x}{x,y}∩B={y} by auto
moreoverfrom hA∈TihB∈Ti have {x,y}∩A∈T{restricted to}{x,y}{x,y}∩B∈T{restrictedto}{x,y} unfolding
RestrictedTo_def by auto
ultimately have open_set:{x}∈T{restricted to}{x,y}{y}∈T{restrictedto}{x,y} by auto
S
S
ih
ih
ih
i
have x∈ Ty∈ T using hA∈T
S B∈T x∈A y∈B by auto
then have sub:{x,y}∈Pow(T) by autoS
then have tot: (T{restricted to}{x,y})={x,y} unfolding RestrictedTo_def
by auto{fix s tS
S
assume s∈ (T{restricted to}{x,y})t∈ (T{restricted to}{x,y})s6=t
with tot have s∈{x,y}t∈{x,y}s6=t by auto
then have (s=x∧t=y)∨(s=y∧t=x) by autowith open_set have ∃ U∈(T{restricted to}{x,y}). s∈U∧t∈U/ usinghx6=yi by auto}
then have (T{restricted to}{x,y}){is T1 } unfolding isT1_def by
autowith sub hT{is anti-}isT1i tot have {x,y} {is in the spectrum of}isT1
using antiProperty_def
by autothen have {x,y}.1 using T1_spectrum by auto
moreoverhave x∈{x,y} by auto
ultimately have {x}={x,y} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto819

ultimately
have y∈{x} by auto
then have x=y by auto
then have False using hx∈Aihy∈A/ i by auto}
then have A⊆B∨B⊆A by auto}
then have r {is total on}T using IsTotal_def by auto
ultimately
show IsLinOrder(T,r) using IsLinOrder_def by autonext
SS
assume IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V})
then have ordTot:∀ S∈T. ∀ B∈T. S⊆B∨B⊆S unfolding IsLinOrder_def IsTotal_def
by auto{fix A
Sassume A∈Pow( ST) and T1:(T{restricted to}A) {is T1 }then have tot: (T{restricted to}A)=A unfolding RestrictedTo_def by
auto{
fix U V
assume U∈T{restricted to}AV∈T{restricted to}A
then obtain AU AV where AU∈TAV∈TU=A∩AUV=A∩AV unfolding RestrictedTo_def
by autowith ordTot have U⊆V∨V⊆U by auto}
then have ordTotSub:∀ S∈T{restricted to}A. ∀ B∈T{restricted to}A.
S⊆B∨B⊆S by auto{
assume A=0
then have A≈0 by auto
moreoverhave 0.1 using empty_lepollI by auto
ultimately have A.1 using eq_lepoll_trans by auto
then have A{is in the spectrum of}isT1 using T1_spectrum by auto}
moreover{assume A6=0
then obtain t where t∈A by blast{
fix yassume y∈Ay6=t
with ht∈Ai tot T1 obtain U where U∈(T{restricted to}A)y∈Ut∈U/
unfolding isT1_def
by autofrom hy6=ti have t6=y by autowith hy∈Aiht∈Ai tot T1 obtain V where V∈(T{restricted to}A)t∈Vy∈V/
unfolding isT1_def

820

by auto
with hy∈Uiht∈U/ i have ¬(U⊆V∨V⊆U) by autowith ordTotSub hU∈(T{restricted to}A)ihV∈(T{restricted to}A)i haveFalse by auto}
then have ∀ y∈A. y=t by autowith ht∈Ai have A={t} by blast
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}isT1 using T1_spectrum by auto}
ultimately
have A{is in the spectrum of}isT1 by auto}
then show T{is anti-}isT1 using antiProperty_def by autoqed
corollary linordtop_here:
S
S
shows (λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V})){is hereditary}using anti_T1 anti_here[of isT1] by auto
theorem (in topology0) anti_T4:
S
S
shows (T{is anti-}isT4) ←→ (IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))
proof
assume T{is anti-}isT4
S
S
let r={hU,Vi∈Pow( T)×Pow( T). U⊆V}
have antisym(r) unfolding antisym_def by auto
moreoverhave trans(r) unfolding trans_def by auto
moreover{fix A Bassume A∈TB∈T{
assume ¬(A⊆B∨B⊆A)
then have A-B6=0B-A6=0 by auto
then obtain x y where x∈Ax∈By∈By/∈A/ x6=y by blast
then have {x,y}∩A={x}{x,y}∩B={y} by auto
moreoverfrom hA∈TihB∈Ti have {x,y}∩A∈T{restricted to}{x,y}{x,y}∩B∈T{restrictedto}{x,y} unfolding
RestrictedTo_def by auto
ultimately have open_set:{x}∈T{restricted to}{x,y}{y}∈T{restrictedto}{x,y} by auto
S
S
ih
ih
ih
i
have x∈ Ty∈ T using hA∈T
S B∈T x∈A y∈B by auto
then have sub:{x,y}∈Pow(
T)
by
auto
S
then have tot: (T{restricted to}{x,y})={x,y} unfolding RestrictedTo_def
by auto821

{

fix s tS
S
assume s∈ (T{restricted to}{x,y})t∈ (T{restricted to}{x,y})s6=t
with tot have s∈{x,y}t∈{x,y}s6=t by auto
then have (s=x∧t=y)∨(s=y∧t=x) by autowith open_set have ∃ U∈(T{restricted to}{x,y}). s∈U∧t∈U/ usinghx6=yi by auto}
then have (T{restricted to}{x,y}){is T1 } unfolding isT1_def by
auto
moreover{fix s
assume AS:s{is closed in}(T{restricted to}{x,y}){fix tassume AS2:t{is closed in}(T{restricted to}{x,y})s∩t=0
have (T{restricted to}{x,y}){is a topology} using Top_1_L4 by
autowith tot have 0∈(T{restricted to}{x,y}){x,y}∈(T{restrictedto}{x,y}) using empty_open
union_open[where A=T{restricted to}{x,y}] by auto
moreovernote open_set
moreoverS
have T{restricted to}{x,y}⊆Pow( (T{restricted to}{x,y})) by
blast
with tot have T{restricted to}{x,y}⊆Pow({x,y}) by auto
ultimately have T{restricted to}{x,y}={0,{x},{y},{x,y}} by blast
moreover have {0,{x},{y},{x,y}}=Pow({x,y}) by blast
ultimately have P:T{restricted to}{x,y}=Pow({x,y}) by simp
with tot have {A∈Pow({x,y}). A{is closed in}(T{restricted to}{x,y})}={A∈ Pow({x, y}) . A ⊆ {x, y} ∧ {x, y} - A ∈ Pow({x, y})} using IsClosed_def
by simpwith P have S:{A∈Pow({x,y}). A{is closed in}(T{restricted to}{x,y})}=T{restrictedto}{x,y} by autofrom AS AS2(1) have s∈Pow({x,y}) t∈Pow({x,y}) using IsClosed_def
tot by auto
moreovernote AS2(1) AS
ultimately have s∈{A∈Pow({x,y}). A{is closed in}(T{restrictedto}{x,y})}t∈{A∈Pow({x,y}). A{is closed in}(T{restricted to}{x,y})}by autowith S AS2(2) have s∈T{restricted to}{x,y} t∈T{restricted to}{x,y}s∩t=0
by autothen have ∃ U∈(T{restricted to}{x,y}). ∃ V∈(T{restricted to}{x,y}).
s⊆U∧t⊆V∧U∩V=0 by auto}
then have ∀ t. t{is closed in}(T{restricted to}{x,y})∧s∩t=0 −→822

(∃ U∈(T{restricted to}{x,y}). ∃ V∈(T{restricted to}{x,y}). s⊆U∧t⊆V∧U∩V=0)
by auto}then have ∀ s. s{is closed in}(T{restricted to}{x,y}) −→ (∀ t. t{isclosed in}(T{restricted to}{x,y})∧s∩t=0 −→ (∃ U∈(T{restricted to}{x,y}).
∃ V∈(T{restricted to}{x,y}). s⊆U∧t⊆V∧U∩V=0))
by autothen have (T{restricted to}{x,y}){is normal} using IsNormal_def
by autoultimately have (T{restricted to}{x,y}){is T4 } using isT4_def by
autowith sub hT{is anti-}isT4i tot have {x,y} {is in the spectrum of}isT4
using antiProperty_def
by autothen have {x,y}.1 using T4_spectrum by auto
moreoverhave x∈{x,y} by auto
ultimately have {x}={x,y} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto
ultimately
have y∈{x} by auto
then have x=y by auto
then have False using hx∈Aihy∈A/ i by auto}
then have A⊆B∨B⊆A by auto}
then have r {is total on}T using IsTotal_def by auto
ultimately
show IsLinOrder(T,r) using IsLinOrder_def by autonext
SS
assume IsLinOrder(T, {hU,Vi ∈ Pow( T) × Pow( T) . U ⊆ V})
then have T{is anti-}isT1 using anti_T1 by auto
moreoverhave ∀ T. T{is a topology} −→ (T{is T4 }) −→ (T{is T1 }) using topology0.T4_is_T3
topology0.T3_is_T2 T2_is_T1 topology0_def by auto
moreoverhave ∀ A. (A {is in the spectrum of} isT1) −→ (A {is in the spectrumof} isT4) using T1_spectrum T4_spectrum
by autoultimately show T{is anti-}isT4 using eq_spect_rev_imp_anti[of isT4isT1]
by autoqed
theorem (in topology0) anti_T3:
S
S
shows (T{is anti-}isT3) ←→ (IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))
proof823

assume T{is anti-}isT3
moreoverhave ∀ T. T{is a topology} −→ (T{is T4 }) −→ (T{is T3 }) using topology0.T4_is_T3
topology0_def by auto
moreoverhave ∀ A. (A {is in the spectrum of} isT3) −→ (A {is in the spectrumof} isT4) using T3_spectrum T4_spectrum
by autoultimately have T{is anti-}isT4 using eq_spect_rev_imp_anti[of isT4isT3]
by autoS
S
then show IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V}) using anti_T4
by autonext
SS
assume IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V})
then have T{is anti-}isT1 using anti_T1 by auto
moreoverhave ∀ T. T{is a topology} −→ (T{is T3 }) −→ (T{is T1 }) using
topology0.T3_is_T2 T2_is_T1 topology0_def by auto
moreoverhave ∀ A. (A {is in the spectrum of} isT1) −→ (A {is in the spectrumof} isT3) using T1_spectrum T3_spectrum
by autoultimately show T{is anti-}isT3 using eq_spect_rev_imp_anti[of isT3isT1]
by autoqed
theorem (in topology0) anti_T2:
S
S
shows (T{is anti-}isT2) ←→ (IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))
proof
assume T{is anti-}isT2
moreoverhave ∀ T. T{is a topology} −→ (T{is T4 }) −→ (T{is T2 }) using topology0.T4_is_T3
topology0.T3_is_T2 topology0_def by auto
moreoverhave ∀ A. (A {is in the spectrum of} isT2) −→ (A {is in the spectrumof} isT4) using T2_spectrum T4_spectrum
by autoultimately have T{is anti-}isT4 using eq_spect_rev_imp_anti[of isT4isT2]
by autoS
S
then show IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V}) using anti_T4
by autonext
SS
assume IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V})
then have T{is anti-}isT1 using anti_T1 by auto
moreoverhave ∀ T. T{is a topology} −→ (T{is T2 }) −→ (T{is T1 }) using T2_is_T1824

by auto
moreoverhave ∀ A. (A {is in the spectrum of} isT1) −→ (A {is in the spectrumof} isT2) using T1_spectrum T2_spectrum
by autoultimately show T{is anti-}isT2 using eq_spect_rev_imp_anti[of isT2isT1]
by autoqed
lemma linord_spectrum:S
S
shows (A{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))) ←→ A.1
proof
S
S
assume A{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))S
S
S
then have reg:∀ T. T{is a topology}∧T≈A −→ IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V})using Spec_def by auto{
assume A=0
moreoverhave 0.1 using empty_lepollI by auto
ultimately have A.1 using eq_lepoll_trans by auto}
moreover{assume A6=0
then obtain x where x∈A by blast
moreover{fix yassume y∈Ahave Pow(A) {is a topology} using Pow_is_top by auto
moreoverS
have
Pow(A)=A
by autoS
then have
Pow(A)≈A by auto
note regS
S
ultimately have IsLinOrder(Pow(A),{hU,Vi∈Pow( Pow(A))×Pow( Pow(A)).
U⊆V}) by auto
then have IsLinOrder(Pow(A),{hU,Vi∈Pow(A)×Pow(A). U⊆V}) by autowith hx∈Aihy∈Ai have {x}⊆{y}∨{y}⊆{x} unfolding IsLinOrder_def IsTotal_def
by autothen have x=y by auto}
ultimately have A={x} by blast
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
ultimately show A.1 by auto

825

next
assume A.1
S
then have ind:A{is in the spectrum of}(λT. T={0, T}) using indiscrete_spectrum
by auto{fix T
Sassume AS:T{is a topology}
T={0,
S
S T}
have trans({hU,Vi∈Pow( T)×Pow( T). U⊆V}) unfolding trans_def by
auto
moreoverS
S
have antisym({hU,Vi∈Pow( T)×Pow( T). U⊆V}) unfolding antisym_def
by automoreoverS
S
have {hU,Vi∈Pow( T)×Pow( T). U⊆V}{is total on}T
proof {
fix aa b
assume aa∈Tb∈T
S
S
with AS(2) have aa∈{0,T}b∈{0,T} by auto
S
S
then have aa=0∨aa= Tb=0∨b= T by auto
then have aa⊆b∨b⊆aa by auto
S
S
then have haa, biT) × Pow( T), split((⊆)))
S ∈ Collect(Pow(S∨ hb, aai ∈ Collect(Pow( T) × Pow( T), split((⊆)))
using haa∈Tihb∈Ti by auto}
then show thesis using IsTotal_def by autoqed
SS
ultimately have IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V}) unfolding IsLinOrder_def by auto}S
then have S∀ T. T {is aS topology} −→ T = {0,T} −→ IsLinOrder(T,{hU,Vi ∈ Pow( T) × Pow( T) . U ⊆ V}) by auto
S
S
then show A{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V}))S
S
S
using P_imp_Q_spec_inv[of λT. T={0, T}λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V})]ind by autoqed
theorem (in topology0) anti_linord:
S
S
shows (T{is anti-}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V})))←→ T{is T1 }
proof
S
S
assume AS:T{is anti-}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T). U⊆V})){
assume ¬(T{is T1 })SSthen obtain x y where x∈ Ty∈ Tx6=y∀ U∈T. x∈U∨y∈U/unfolding isT1_def
by auto{826

assume {x}∈T{restricted to}{x,y}then obtain U where U∈T {x}={x,y}∩U unfolding RestrictedTo_def
by automoreoverhave x∈{x} by auto
ultimately have U∈Tx∈U by auto
moreover{assume y∈Uthen have y∈{x,y}∩U by autowith h{x}={x,y}∩Ui have y∈{x} by autowith hx6=yi have False by auto}
then have y∈U/ by auto
moreoverinote h∀ U∈T. x∈U∨y∈U/ultimately have False by auto}
then have {x}∈T{restricted/to}{x,y} by auto
moreover S
SS
have tot: (T{restricted to}{x,y})={x,y} using hx∈ Tihy∈ Ti unfolding RestrictedTo_def by auto
moreoverS
have T{restricted to}{x,y}⊆Pow( (T{restricted to}{x,y})) by auto
ultimately have T{restricted to}{x,y}⊆Pow({x,y})-{{x}} by auto
moreoverhave Pow({x,y})={0,{x,y},{x},{y}} by blast
ultimately have T{restricted to}{x,y}⊆{0,{x,y},{y}} by auto
moreoverhave IsLinOrder({0,{x,y},{y}},{hU,Vi∈Pow({x,y})×Pow({x,y}). U⊆V})
proof have antisym(Collect(Pow({x, y}) × Pow({x, y}), split((⊆)))) using antisym_def by auto
moreoverhave trans(Collect(Pow({x, y}) × Pow({x, y}), split((⊆)))) using trans_def by auto
moreoverhave Collect(Pow({x, y}) × Pow({x, y}), split((⊆))) {is total on}{0, {x, y}, {y}} using IsTotal_def by auto
ultimately show IsLinOrder({0,{x,y},{y}},{hU,Vi∈Pow({x,y})×Pow({x,y}).
U⊆V}) using IsLinOrder_def by autoqed
ultimately have IsLinOrder(T{restricted to}{x,y},{hU,Vi∈Pow({x,y})×Pow({x,y}).
U⊆V}) using ord_linear_subset
by autoSwith tot have
S IsLinOrder(T{restricted to}{x,y},{hU,Vi∈Pow( (T{restrictedto}{x,y}))×Pow( (T{restricted to}{x,y})). U⊆V})
by autoS
then have IsLinOrder(T{restricted to}{x,y},Collect(Pow( (T {restricted827

Sto} {x,y})) × Pow( (T {restricted to} {x,y})), split((⊆)))) by auto
moreoverS
S
Sfrom hx∈ Tihy∈ Ti have {x,y}∈Pow( T) by auto
moreovernote AS
S
S
ultimately have {x,y}{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V})) unfolding antiProperty_def
by simpthen have {x,y}.1 using linord_spectrum by auto
moreoverhave x∈{x,y} by auto
ultimately have {x}={x,y} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto
ultimately
have y∈{x} by auto
then have x=y by auto
then have False using hx6=yi by auto}
then show T {is T1 } by auto
next
assume T1:T {is T1 }
{
fix A
S
S
assume S
A_def:A∈Pow( T)IsLinOrder((T{restricted to}A) ,{hU,Vi∈Pow( (T{restrictedto}A))×Pow( (T{restricted to}A)). U⊆V}){
fix xassume AS1:x∈A{
fix yassume AS:y∈Ax6=y
S
S
with AS1 have {x,y}∈Pow( T) using hA∈Pow( T)i by autofrom hx∈Aihy∈Ai have
S {x,y}∈Pow(A) by autofrom h{x,y}∈Pow( T)i have T11:(T{restricted to}{x,y}){is T1 }using T1_here T1 by auto
moreover S
have tot:S (T{restricted to}{x,y})={x,y} unfolding RestrictedTo_def
using h{x,y}∈Pow( T)i by auto
moreovernote AS(2)ultimately obtain U where x∈Uy∈UU∈(T{restricted/to}{x,y}) unfolding isT1_def by auto
moreoverfrom AS(2) tot T11 obtain V where y∈Vx∈VV∈(T{restricted/to}{x,y})unfolding isT1_def by auto
ultimately have x∈U-Vy∈V-UU∈(T{restricted to}{x,y})V∈(T{restrictedto}{x,y}) by auto
then have ¬(U⊆V∨V⊆U)U∈(T{restricted to}{x,y})V∈(T{restricted828

to}{x,y}) by auto
S
S
then have ¬({hU,Vi∈Pow( (T{restricted to}{x,y}))×Pow( (T{restrictedto}{x,y})). U⊆V} {is total on} (T{restricted to}{x,y}))unfolding IsTotal_def by autoS
then have
S ¬(IsLinOrder((T{restricted to}{x,y}),{hU,Vi∈Pow( (T{restrictedto}{x,y}))×Pow( (T{restricted to}{x,y})). U⊆V}))
unfolding IsLinOrder_def by auto
moreover{have (T{restricted to}A) {is a topology} using Top_1_L4 by
auto
moreovernote A_def(2) linordtop_hereSultimately have ∀ B∈Pow(S (T{restricted to}A)). IsLinOrder((T{restricted
Sto}A){restricted to}B ,{hU,Vi∈Pow( ((T{restricted to}A){restricted to}B))×Pow( ((T{restricto}A){restricted to}B)). U⊆V})
unfolding IsHer_def by auto
moreover S
have
S tot: (T{restricted to}A)=A unfolding RestrictedTo_def
using hA∈Pow( T)i by auto
ultimately
S have ∀ B∈Pow(A). IsLinOrder((T{restrictedS to}A){restrictedto}B ,{hU,Vi∈Pow( ((T{restricted to}A){restricted to}B))×Pow( ((T{restrictedto}A){restricted to}B)). U⊆V}) by auto
moreoverhave ∀ B∈Pow(A). (T{restricted
S to}A){restricted to}B=T{restrictedto}B using subspace_of_subspace hA∈Pow( T)i by auto
ultimately
S
have ∀ B∈Pow(A). IsLinOrder((T{restrictedto}B) ,{hU,Vi∈Pow( ((T{restricted
Sto}A){restricted to}B))×Pow( ((T{restricted to}A){restricted to}B)).
U⊆V}) by auto
moreoverS
have∀ B∈Pow(A).
((T{restricted to}A){restricted to}B)=B usS
ing hA∈Pow( T)i unfolding RestrictedTo_def by auto
ultimately have ∀ B∈Pow(A). IsLinOrder((T{restricted to}B) ,{hU,Vi∈Pow(B)×Pow(B).
U⊆V}) by autowith h{x,y}∈Pow(A)i have IsLinOrder((T{restricted to}{x,y}),{hU,Vi∈Pow({x,y})×Pow({x,y}). U⊆V}) by auto}
ultimately have False using tot by auto}
then have A={x} using AS1 by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
S
S
then have A{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V})) using linord_spectrum
by auto}moreover{829

assume A=0
then have A≈0 by auto
moreoverhave 0.1 using empty_lepollI by auto
ultimately have A.1 using eq_lepoll_trans by auto
S
S
then have A{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V})) using linord_spectrum
by auto}S
S
ultimately have A{is in the spectrum of}(λT. IsLinOrder(T,{hU,Vi∈Pow( T)×Pow( T).
U⊆V})) by blast}
S
S
then show T{is anti-}(λT. IsLinOrder(T, {hU,Vi ∈ Pow( T) × Pow( T). U ⊆ V})) unfolding antiProperty_def
by autoqed

In conclusion, T1 is also an anti-property.
Let’s define some anti-properties that we’ll use in the future.
definition
IsAntiComp (_{is anti-compact})
S
where T{is anti-compact} ≡ T{is anti-}(λT. ( T){is compact in}T)
definition
IsAntiLin (_{is anti-lindeloef})S
where T{is anti-lindeloef} ≡ T{is anti-}(λT. (( T){is lindeloef in}T))

Anti-compact spaces are also called pseudo-finite spaces in literature before
the concept of anti-property was defined.
end

60

Topology 6

theory Topology_ZF_6 imports Topology_ZF_4 Topology_ZF_2 Topology_ZF_1
begin

This theory deals with the relations between continuous functions and convergence of filters. At the end of the file there some results about the buildingof functions in cartesian products.

60.1

Image filter

First of all, we will define the appropriate tools to work with functions andfilters together.

830

We define the image filter as the collections of supersets of of images of setsfrom a filter.
definition
ImageFilter (_[_].._ 98)
where F {is a filter on} X =⇒ f:X→Y =⇒ f[F]..Y ≡ {A∈Pow(Y). ∃ D∈{f(B).B∈F}. D⊆A}

Note that in the previous definition, it is necessary to state Y as the final
set because f is also a function to every superset of its range. X can bechanged by domain(f) without any change in the definition.
lemma base_image_filter:
assumes F {is a filter on} X f:X→Yshows {fB .B∈F} {is a base filter} (f[F]..Y) and (f[F]..Y) {is a filteron} Y
proof {
assume 0 ∈ {fB .B∈F}
then obtain B where B∈F and f_B:fB=0 by auto
then have B∈Pow(X) using assms(1) IsFilter_def by auto
then have fB={fb. b∈B} using image_fun assms(2) by autowith f_B have {fb. b∈B}=0 by auto
then have B=0 by autowith hB∈Fi have False using IsFilter_def assms(1) by auto}
then have 0∈{fB/.B∈F} by auto
moreoverfrom assms(1) obtain S where S∈F using IsFilter_def by auto
then have fS∈{fB .B∈F} by auto
then have nA:{fB .B∈F}6=0 by auto
moreover{fix A Bassume A∈{fB .B∈F} and B∈{fB .B∈F}
then obtain AB BB where A=fAB B=fBB AB∈F BB∈F by auto
then have A∩B=(fAB)∩(fBB) by auto
then have I: f(AB∩BB)⊆A∩B by auto
moreoverfrom assms(1) I hAB∈FihBB∈Fi have AB∩BB∈F using IsFilter_def by auto
ultimately have ∃ D∈{fB .B∈F}. D⊆A∩B by auto}
then have ∀ A∈{fB .B∈F}. ∀ B∈{fB .B∈F}. ∃ D∈{fB .B∈F}. D⊆A∩B by auto
ultimately have sbc:{fB .B∈F} {satisfies the filter base condition}using SatisfiesFilterBase_def by auto
moreover{fix t
assume t∈{fB . B∈F}
then obtain B where B∈F and im_def:fB=t by auto831

with assms(1) have B∈Pow(X) unfolding IsFilter_def by autowith im_def assms(2) have t={fx. x∈B} using image_fun by autowith assms(2) hB∈Pow(X)i have t⊆Y using apply_funtype by auto}
then have nB:{fB . B∈F}⊆Pow(Y) by auto
ultimately
have (({fBS .B∈F} {is a base filter} {A ∈ Pow(Y) . ∃ D∈{fB .B∈F}. D⊆ A}) ∧ ( {A ∈ Pow(Y) . ∃ D∈{fB .B∈F}. D ⊆ A}=Y)) using base_unique_filter_set2
by forcethen have {fB .B∈F} {is a base filter} {A ∈ Pow(Y) . ∃ D∈{fB .B∈F}.
D ⊆ A} by autowith assms show {fB .B∈F} {is a base filter} (f[F]..Y) using ImageFilter_def
by automoreovernote sbc
moreover{from nA obtain D where I: D∈{fB .B∈F} by blast
moreover from I nB have D⊆Y by auto
ultimately have Y∈{A∈Pow(Y). ∃ D∈{fB .B∈F}. D⊆A} by auto}S
then have{A∈Pow(Y). ∃ D∈{fB .B∈F}. D⊆A}=Y by auto
ultimately show (f[F]..Y) {is a filter on} Y using basic_filter
ImageFilter_def assms by auto
qed

60.2

Continuous at a point vs. globally continuous

In this section we show that continuity of a function implies local continuity(at a point) and that local continuity at all points implies (global) continuity.
If a function is continuous, then it is continuous at every point.
lemma cont_global_imp_continuous_x:
S
S
S
S
assumes x∈ τ 1 IsContinuous(τ 1 ,τ 2 ,f) f:( τ 1 )→( τ 2 ) x∈ τ 1shows ∀ U∈τ 2 . f(x)∈U −→ (∃ V∈τ 1 . x∈V ∧ f(V)⊆U)
proof {
fix U
assume AS:U∈τ 2 f(x)∈U
then have f-(U)∈τ 1 using assms(2) IsContinuous_def by auto
moreoverfrom assms(3) have f(f-(U))⊆U using function_image_vimage fun_is_fun
by automoreoverfrom assms(3) assms(4) AS(2) have x∈f-(U) using func1_1_L15 by auto
ultimately have ∃ V∈τ 1 . x∈V ∧ fV⊆U by auto}832

then show ∀ U∈τ 2 . f(x)∈U −→ (∃ V∈τ 1 . x∈V ∧ f(V)⊆U) by autoqed

A function that is continuous at every point of its domain is continuous.
lemma ccontinuous_all_x_imp_cont_global:
S
S
S
assumes ∀ x∈ τ 1 . ∀ U∈τ 2 . fx∈U −→ (∃ V∈τ 1 . x∈V ∧ fV⊆U) f∈( τ 1 )→( τ 2 )and
τ 1 {is a topology}
shows IsContinuous(τ 1 ,τ 2 ,f)proof {
fix U
assume U∈τ 2{
fix x
assume AS: x∈f-U
note hU∈τ 2 i
moreoverS
from assms(2) have
τ 1 using func1_1_L6A by auto
S f - U ⊆with AS have x∈ τ 1 by autowith assms(1) have ∀ U∈τ 2 . fx∈U −→ (∃ V∈τ 1 . x∈V ∧ fV⊆U) by auto
moreoverfrom AS assms(2) have fx∈U using func1_1_L15 by auto
ultimately have ∃ V∈τ 1 . x∈V ∧ fV⊆U by auto
then obtain V where I: V∈τ 1 x∈V f(V)⊆U by auto
moreoverS
from I have V⊆ τ 1 by auto
moreoverS
from assms(2) hV⊆ τ 1 i have V⊆f-(fV) using func1_1_L9 by auto
ultimately have V ⊆ f-(U) by blast
with hV∈τ 1 i hx∈Vi have ∃ V∈τ 1 . x∈V ∧ V ⊆ f-(U) by auto
} hence ∀ x∈f-(U). ∃ V∈τ 1 . x∈V ∧ V⊆f-(U) by autowith assms(3) have f-(U) ∈ τ 1 using topology0.open_neigh_open topology0_def
by auto}hence ∀ U∈τ 2 . f-U∈τ 1 by auto
then show thesis using IsContinuous_def by auto
qed

60.3

Continuous functions and filters

In this section we consider the relations between filters and continuity.
If the function is continuous then if the filter converges to a point the image
filter converges to the image point.
lemma (in two_top_spaces0) cont_imp_filter_conver_preserved:
assumes F {is a filter on} X1 f {is continuous} F →F x {in} τ 1shows (f[F]..X2 ) →F (f(x)) {in} τ 2833

proof from assms(1) assms(3) have x∈X1
using topology0.FilterConverges_def topol_cntxs_valid(1) X1_def by
auto
have topology0(τ 2 ) using topol_cntxs_valid(2) by simp
S
moreover from assms(1) have (f[F]..X2 ) {is a filter on} ( τ 2 ) and{fB .B∈F} {is a base filter} (f[F]..X2 )using base_image_filter
S fmapAssum X1_def X2_def by auto
moreover have ∀ U∈Pow( τ 2 ). (fx)∈Interior(U,τ 2 ) −→ (∃ D∈{fB .B∈F}.
D⊆U)
proof { fix U
assume U∈Pow(X2 ) (fx)∈Interior(U,τ 2 )with hx∈X1 i have xim: x∈f-(Interior(U,τ 2 )) and sub: f-(Interior(U,τ 2 ))∈Pow(X1 )using func1_1_L6A fmapAssum func1_1_L15 fmapAssum by auto
note submoreoverhave Interior(U,τ 2 )∈τ 2 using topology0.Top_2_L2 topol_cntxs_valid(2)by autowith assms(2) have f-(Interior(U,τ 2 ))∈τ 1 unfolding isContinuous_def
IsContinuous_def
by autowith xim have x∈Interior(f-(Interior(U,τ 2 )),τ 1 )using topology0.Top_2_L3 topol_cntxs_valid(1) by auto
moreover from assms(1) assms(3) have {U∈Pow(X1 ). x∈Interior(U,τ 1 )}⊆F
using topology0.FilterConverges_def topol_cntxs_valid(1) X1_def
by autoultimately have f-(Interior(U,τ 2 ))∈F by auto
moreover have f(f-(Interior(U,τ 2 )))⊆Interior(U,τ 2 )using function_image_vimage fun_is_fun fmapAssum by auto
then have f(f-(Interior(U,τ 2 )))⊆U
using topology0.Top_2_L1 topol_cntxs_valid(2) by auto
ultimately have ∃ D∈{f(B) .B∈F}. D⊆U by auto
} thus thesis by autoqed
moreover from fmapAssum hx∈X1 i have f(x) ∈ X2
by (rule apply_funtype)Shence f(x) ∈τ 2 by simp
ultimately show thesis by (rule topology0.convergence_filter_base2)
qed

Continuity in filter at every point of the domain implies global continuity.
lemma (in two_top_spaces0)
filter_conver_preserved_imp_cont:Sassumes ∀ x∈ τ 1 . ∀ F. ((F {is a filter on} X1 ) ∧ (F →F x {in} τ 1 ))−→ ((f[F]..X2 ) →F (fx) {in} τ 2 )shows f{is continuous}

834

proof {fix x
Sassume as2: x∈ τ 1with assms have reg:
∀ F. ((F {is a filter on} X1 ) ∧ (F →F x {in} τ 1 )) −→ ((f[F]..X2 )→F (fx) {in} τ 2 )by autoS
let Neig = {U ∈ Pow( τ 1 ) . x ∈ Interior(U, τ 1 )}from as2 have NFil: Neig{is a filter on}X1 and NCon: Neig →F x {in}τ1using topol_cntxs_valid(1) topology0.neigh_filter by auto{
fix U
assume U∈τ 2 fx∈USthen have U∈Pow( τ 2 ) fx∈Interior(U,τ 2 ) using topol_cntxs_valid(2)topology0.Top_2_L3 by auto
moreoverfrom NCon NFil reg have (f[Neig]..X2 ) →F (fx) {in} τ 2 by auto
moreover have (f[Neig]..X2 ) {is a filter on} X2using base_image_filter(2) NFil fmapAssum by auto
ultimately have U∈(f[Neig]..X2 )using topology0.FilterConverges_def topol_cntxs_valid(2) unfolding X1_def X2_def
by automoreoverfrom fmapAssum NFil have {fB .B∈Neig} {is a base filter} (f[Neig]..X2 )using base_image_filter(1) X1_def X2_def by auto
ultimately have ∃ V∈{fB .B∈Neig}. V⊆U using basic_element_filterby blast
then obtain B where B∈Neig fB⊆U by auto
moreoverhave Interior(B,τ 1 )⊆B using topology0.Top_2_L1 topol_cntxs_valid(1)by autohence fInterior(B,τ 1 ) ⊆ f(B) by auto
moreover have Interior(B,τ 1 )∈τ 1
using topology0.Top_2_L2 topol_cntxs_valid(1) by auto
ultimately have ∃ V∈τ 1 . x∈V ∧ fV⊆U by force}
hence ∀ U∈τ 2 . fx∈U −→ (∃ V∈τ 1 . x∈V ∧ fV⊆U) by auto}S
hence ∀ x∈ τ 1 . ∀ U∈τ 2 . fx∈U −→ (∃ V∈τ 1 . x∈V ∧ fV⊆U) by auto
then show thesis
using ccontinuous_all_x_imp_cont_global fmapAssum X1_def X2_def isContinuous_def
tau1_is_top
by auto
qed

835

end

61

Topology 7

theory Topology_ZF_7 imports Topology_ZF_5
begin

61.1

Connection Properties

Another type of topological properties are the connection properties. These
properties establish if the space is formed of several pieces or just one.
A space is connected iff there is no clopen set other that the empty set andthe total set.
definition IsConnected (_{is connected} 70)
S
where T {is connected} ≡ ∀ U. (U∈T ∧ (U {is closed in}T)) −→ U=0∨U= T
lemma indiscrete_connected:
shows {0,X} {is connected}
unfolding IsConnected_def IsClosed_def by auto

The anti-property of connectedness is called total-diconnectedness.
definition IsTotDis (_ {is totally-disconnected} 70)
where IsTotDis ≡ ANTI(IsConnected)
lemma conn_spectrum:shows (A{is in the spectrum of}IsConnected) ←→ A.1
proof
assume A{is in the spectrum of}IsConnected
Sthen have ∀ T. (T{is a topology}∧ T≈A) −→ (T{is connected}) using
Spec_def by auto
moreoverhave Pow(A){is a topology} using Pow_is_top by auto
moreoverS
have(Pow(A))=A
by autoS
then have(Pow(A))≈A by auto
ultimately have Pow(A) {is connected} by auto{
assume A6=0
then obtain E where E∈A by blast
then have {E}∈Pow(A) by auto
moreoverhave A-{E}∈Pow(A) by auto
ultimately have {E}∈Pow(A)∧{E}{is closed in}Pow(A) unfolding IsClosed_def
by autowith hPow(A) {is connected}i have {E}=A unfolding IsConnected_def
by auto836

then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
moreover{assume A=0
then have A.1 using empty_lepollI[of 1] by auto}
ultimately show A.1 by auto
next
assume A.1
{
fix T
S
assume T{is a topology} T≈A{S
assumeT=0with hT{is a topology}i have T={0} using empty_open by auto
then have T{is connected} unfolding IsConnected_def by auto}
moreover{S
assumeT6=0
moreover S
Sfrom hA.1ih T≈Ai haveT.1 using eq_lepoll_trans by auto
ultimately
Sobtain E where
T={E} using lepoll_1_is_sing by blast
moreoverS
have T⊆Pow( T) by auto
ultimately have T⊆Pow({E}) by auto
then have T⊆{0,{E}} by blast
with hT{is a topology}i have {0}⊆T T⊆{0,{E}} using empty_open by
auto
then have T{is connected} unfolding IsConnected_def by auto}
ultimately have T{is connected} by auto}
then show A{is in the spectrum of}IsConnected unfolding Spec_def by
auto
qed

The discrete space is a first example of totally-disconnected space.
lemma discrete_tot_dis:
shows Pow(X) {is totally-disconnected}
proof {
fix A assume A∈Pow(X) and con:(Pow(X){restricted to}A){is connected}
have res:(Pow(X){restricted to}A)=Pow(A) unfolding RestrictedTo_def
using hA∈Pow(X)iby blast

837

{
assume A=0
then have A.1 using empty_lepollI[of 1] by auto
then have A{is in the spectrum of}IsConnected using conn_spectrum
by auto}moreover{assume A6=0
then obtain E where E∈A by blast
then have {E}∈Pow(A) by auto
moreoverhave A-{E}∈Pow(A) by auto
ultimately have {E}∈Pow(A)∧{E}{is closed in}Pow(A) unfolding IsClosed_def
by autowith con res have {E}=A unfolding IsConnected_def by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}IsConnected using conn_spectrum
by auto}ultimately have A{is in the spectrum of}IsConnected by auto}
then show thesis unfolding IsTotDis_def antiProperty_def by autoqed

An space is hyperconnected iff every two non-empty open sets meet.
definition IsHConnected (_{is hyperconnected}90)
where T{is hyperconnected} ≡∀ U V. U∈T ∧ V∈T ∧ U∩V=0 −→ U=0∨V=0Every hyperconnected space is connected.
lemma HConn_imp_Conn:assumes T{is hyperconnected}
shows T{is connected}
proof {
fix U
assume U∈TU
S {is closed in}T
then have
T-U∈TU∈T using IsClosed_def by auto
moreoverS
have ( T-U)∩U=0 by auto
moreovernote assms
ultimately S
have U=0∨( T-U)=0 using
S IsHConnected_def by autowith hU∈Ti have U=0∨U= T by auto}
then show thesis using IsConnected_def by auto
qed

838

lemma Indiscrete_HConn:shows {0,X}{is hyperconnected}
unfolding IsHConnected_def by auto

A first example of an hyperconnected space but not indiscrete, is the cofinite
topology on the natural numbers.
lemma Cofinite_nat_HConn:assumes ¬(X≺nat)shows (CoFinite X){is hyperconnected}
proof {
fix U V
assume U∈(CoFinite X)V∈(CoFinite X)U∩V=0
then have eq:(X-U)≺nat∨U=0(X-V)≺nat∨V=0 unfolding Cofinite_def
CoCardinal_def by autofrom hU∩V=0i have un:(X-U)∪(X-V)=X by auto{
assume AS:(X-U)≺nat(X-V)≺natfrom un have X≺nat using less_less_imp_un_less[OF AS InfCard_nat]
by autothen have False using assms by auto}with eq(1,2) have U=0∨V=0 by auto}
then show (CoFinite X){is hyperconnected} using IsHConnected_def by
auto
qedlemma HConn_spectrum:shows (A{is in the spectrum of}IsHConnected) ←→ A.1
proof
assume A{is in the spectrum of}IsHConnected
Sthen have ∀ T. (T{is a topology}∧ T≈A) −→ (T{is hyperconnected})using Spec_def by auto
moreoverhave Pow(A){is a topology} using Pow_is_top by auto
moreoverS
have(Pow(A))=A
by autoS
then have(Pow(A))≈A by auto
ultimately
have HC_Pow:Pow(A){is hyperconnected} by auto{
assume A=0
then have A.1 using empty_lepollI by auto}
moreover{assume A6=0

839

then obtain e where e∈A by blast
then have {e}∈Pow(A) by auto
moreoverhave A-{e}∈Pow(A) by auto
moreoverhave {e}∩(A-{e})=0 by auto
moreovernote HC_Pow
ultimately have A-{e}=0 unfolding IsHConnected_def by blast
with he∈Ai have A={e} by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
ultimately show A.1 by auto
next
assume A.1
{
fix T
S
assume T{is a topology} T≈A{S
assumeT=0with hT{is a topology}i have T={0} using empty_open by auto
then have T{is hyperconnected} unfolding IsHConnected_def by auto}
moreover{S
assumeT6=0
moreover S
Sfrom hA.1ih T≈Ai haveT.1 using eq_lepoll_trans by auto
ultimately
Sobtain E where
T={E} using lepoll_1_is_sing by blast
moreoverS
have T⊆Pow( T) by auto
ultimately have T⊆Pow({E}) by auto
then have T⊆{0,{E}} by blast
with hT{is a topology}i have {0}⊆T T⊆{0,{E}} using empty_open by
auto
then have T{is hyperconnected} unfolding IsHConnected_def by auto}
ultimately have T{is hyperconnected} by auto}
then show A{is in the spectrum of}IsHConnected unfolding Spec_def by
auto
qed

In the following results we will show that anti-hyperconnectedness is a separation property between T1 and T2 . We will show also that both implications
are proper.
First, the closure of a point in every topological space is always hypercon840

nected. This is the reason why every anti-hyperconnected space must be T1 :every singleton must be closed.

lemma (in topology0)cl_point_imp_HConn:
S
assumes x∈ Tshows (T{restricted to}Closure({x},T)){is hyperconnected}
proof S
from assms have
S sub:Closure({x},T)⊆ T using Top_3_L11 by auto
then have tot: (T{restricted to}Closure({x},T))=Closure({x},T) unfolding RestrictedTo_def by auto{
fix A Bassume AS:A∈(T{restrictedto}Closure({x},T))B∈(T{restrictedto}Closure({x},T))A∩B=0
S
S
then have B⊆ ((T{restricted to}Closure({x},T)))A⊆ ((T{restrictedto}Closure({x},T)))by autowith tot have B⊆Closure({x},T)A⊆Closure({x},T) by autofrom AS(1,2) obtain UA UB where UAUB:UA∈TUB∈TA=UA∩Closure({x},T)B=UB∩Closure({x},T)unfolding RestrictedTo_def by auto
then have Closure({x},T)-A=Closure({x},T)-(UA∩Closure({x},T)) Closure({x},T)-B=Closure(by autothen have Closure({x},T)-A=Closure({x},T)-(UA) Closure({x},T)-B=Closure({x},T)-(UB)by autoSwith sub have Closure({x},T)-A=Closure({x},T)∩( T-UA) Closure({x},T)-B=Closure({x},T)∩by automoreoverS
S
from UAUB have ( T-UA){is closed in}T( T-UB){is closed in}T using Top_3_L9 by auto
moreoverhave Closure({x},T){is closed in}T using cl_is_closed assms by auto
ultimately have (Closure({x},T)-A){is closed in}T(Closure({x},T)-B){isclosed in}T
using Top_3_L5(1) by auto
moreover{have x∈Closure({x},T) using cl_contains_set assms by auto
moreoverfrom AS(3) have x∈A∨x/∈B/ by auto
ultimately have x∈(Closure({x},T)-A)∨x∈(Closure({x},T)-B) by auto}
ultimately have Closure({x},T)⊆(Closure({x},T)-A) ∨ Closure({x},T)⊆(Closure({x},T)-B)
using Top_3_L13 by auto
then have A∩Closure({x},T)=0 ∨ B∩Closure({x},T)=0 by autowith hB⊆Closure({x},T)ihA⊆Closure({x},T)i have A=0∨B=0 using cl_contains_set
assms by blast}
then show thesis unfolding IsHConnected_def by autoqed

A consequence is that every totally-disconnected space is T1 .
841

lemma (in topology0) tot_dis_imp_T1:
assumes T{is totally-disconnected}
shows T{is T1 }proof {
fix x yS
S
assume y∈ Tx∈ Ty6=x
then have (T{restricted to}Closure({x},T)){is hyperconnected} using cl_point_imp_HConn by auto
then have (T{restricted to}Closure({x},T)){is connected} using HConn_imp_Connby automoreoverS
S
from hx∈ Ti have Closure({x},T)⊆ T using Top_3_L11(1) by auto
moreovernote assms
ultimately have Closure({x},T){is in the spectrum of}IsConnected unfolding IsTotDis_def antiProperty_def
by autothen have Closure({x},T).1 using conn_spectrum by auto
moreoverS
from hx∈ Ti have x∈Closure({x},T) using cl_contains_set by auto
ultimately have Closure({x},T)={x} using lepoll_1_is_sing[of Closure({x},T)x] by autoS
then have {x}{isclosed in}T using Top_3_L8 hx∈ Ti by autoS
then haveT-{x}∈T unfolding IsClosed_def by auto
moreoverS
S
Sfrom hy∈ Tihy6=xi have y∈ T-{x}∧x∈/ T-{x} by auto
ultimately have ∃ U∈T. y∈U∧x∈U/ by force}
then show thesis unfolding isT1_def by autoqed

In the literature, there exists a class of spaces called sober spaces; where theonly non-empty closed hyperconnected subspaces are the closures of points
and closures of diferent singletons are different.
definition IsSober (_{is sober}90)
S
where T{is sober} ≡ ∀ A∈Pow( T)-{0}.
(A{is closed in}T ∧ ((T{restricted
SSto}A){is hyperconnected})) −→ (∃ x∈ T. A=Closure({x},T) ∧ (∀ y∈ T. A=Closure({y},T)−→ y=x) )Being sober is weaker than being anti-hyperconnected.
theorem (in topology0) anti_HConn_imp_sober:assumes T{is anti-}IsHConnectedshows T{is sober}proof {S
fix A assume A∈Pow( T)-{0}A{is closed in}T(T{restricted to}A){ishyperconnected}

842

with assms have A{is in the spectrum of}IsHConnected unfolding antiProperty_def
by autothen have A.1 using HConn_spectrum by auto
moreoverS
with hA∈Pow( T)-{0}i have A6=0 by auto
then obtain x where x∈A by auto
ultimately have A={x} using lepoll_1_is_sing by autowith hA{is closed in}Ti haveS{x}{is closed in}T by S
auto
moreover from hx∈Ai hA∈Pow( T)-{0}i have {x}∈Pow( T) by auto
ultimately
have Closure({x},T)={x} unfolding Closure_def ClosedCovers_def by
autowith hA={x}i have A=Closure({x},T) by auto
moreover{S
fix y assume y∈ TA=Closure({y},T)then have {y}⊆Closure({y},T) using cl_contains_set by autowith hA=Closure({y},T)i have y∈A by autowith hA={x}i have y=x by auto}S
then have ∀ y∈ T. A=Closure({y},T)−→ y=x by autoSimoreover note h{x}∈Pow(
T)
S
S
ultimately have ∃ x∈ T. A=Closure({x},T)∧(∀ y∈ T. A=Closure({y},T)−→ y=x) by auto}
then show thesis using IsSober_def by autoqed

Every sober space is T0 .
lemma (in topology0) sober_imp_T0:
assumes T{is sober}shows T{is T0 }proof {
fix x yS
S
assume AS:x∈Ty∈ Tx6=y∀ U∈T. x∈U ←→ y∈U
Sfrom hx∈ Ti have clx:Closure({x},T) {is closed in}T using cl_is_closedby autoS
S
with hx∈ Ti have ( T-Closure({x},T))∈T using Top_3_L11(1) unfolding IsClosed_def by auto
moreoverS
from hx∈ Ti have x∈Closure({x},T) using cl_contains_set by auto
moreovernote AS(1,4)
S
ultimately have y∈(/
T-Closure({x},T)) by autowith AS(2) have y∈Closure({x},T) by autowith clx have ineq1:Closure({y},T)⊆Closure({x},T) using Top_3_L13
by autoS
from hy∈ Ti have cly:Closure({y},T) {is closed in}T using cl_is_closed843

by auto
S
S
with hy∈ Ti have ( T-Closure({y},T))∈T using Top_3_L11(1) unfolding IsClosed_def by auto
moreoverS
from hy∈ Ti have y∈Closure({y},T) using cl_contains_set by auto
moreovernote AS(2,4)
S
ultimately have x∈(/
T-Closure({y},T)) by autowith AS(1) have x∈Closure({y},T) by autowith cly have Closure({x},T)⊆Closure({y},T) using Top_3_L13 by autowith ineq1 have eq:Closure({x},T)=Closure({y},T)by autoS
S
have Closure({x},T)∈Pow( T)-{0} using Top_3_L11(1) hx∈ Ti hx∈Closure({x},T)iby automoreover note assmsSclx
S
ultimately have ∃ t∈ T.( Closure({x},T) = Closure({t}, T) ∧ (∀ y∈ T.
Closure({x},T) = Closure({y}, T) −→ y = t))Sunfolding IsSober_def using Scl_point_imp_HConn[OF hx∈ Ti] by auto S
then obtain t where t_def:t∈ TClosure({x},T) = Closure({t}, T)∀ y∈ T.
Closure({x},T) = Closure({y}, T) −→ y = t
by blast
Siwith eq have y=t using hy∈
S T by autohimoreover from t_def x∈ T have x=t by blast
ultimately have y=x by autowith hx6=yi have False by auto}
S
S
then have ∀ x y. x∈ T∧y∈ T∧x6=y −→ (∃ U∈T. (x∈U∧y∈U)∨(y∈U∧x/∈U))/
by autothen show thesis using isT0_def by autoqed

Every T2 space is anti-hyperconnected.
theorem (in topology0) T2_imp_anti_HConn:assumes T{is T2 }shows T{is anti-}IsHConnected
proof {
fix TT
assume TT{is a topology} TT{is hyperconnected}TT{is T2 }{S
assumeTT=0Sthen have STT.1 using empty_lepollI by auto
then have ( TT){is in the spectrum of}IsHConnected using HConn_spectrum
by auto}moreover{S
assumeTT6=0Sthen obtain x where x∈ TT by blast{844

fix yS
assume y∈ TTx6=y S
with hTT{is T2 }ihx∈ TTi obtain U V where U∈TTV∈TTx∈Uy∈VU∩V=0
unfolding isT2_def by blast
with hTT{is hyperconnected}i have False using IsHConnected_def
by auto}S
Siwith hx∈ TT
TT={x} by auto
S havethen have S TT≈1 using singleton_eqpoll_1 by auto
then have STT.1 using eqpoll_imp_lepoll by auto
then have ( TT){is in the spectrum of}IsHConnected using HConn_spectrum
by auto}S
ultimately have ( TT){is in the spectrum of}IsHConnected by blast}
then have ∀ T. ((T{is a topology}∧(T{is hyperconnected})∧(T{is T2 }))−→S(( T){is in the spectrum of}IsHConnected))by automoreovernote here_T2
ultimately
have ∀ T. T{is a topology} −→ ((T{is T2 })−→(T{is anti-}IsHConnected))using Q_P_imp_Spec[where P=IsHConnected and Q=isT2]
by autothen show thesis using assms topSpaceAssum by autoqed

Every anti-hyperconnected space is T1 .
theorem anti_HConn_imp_T1:
assumes T{is anti-}IsHConnectedshows T{is T1 }proof {
fix x yS
S
assume x∈ Ty∈ Tx6=y{assume AS:∀/
S U∈T.
S x∈U∨y∈U
S
from hx∈ Tihy∈ Ti have {x,y}∈Pow( T) by auto
then have sub:(T{restricted to}{x,y})⊆Pow({x,y}) using RestrictedTo_def
by auto{fix U V
assume H:U∈T{restricted to}{x,y} V∈(T{restricted to}{x,y})U∩V=0
with AS have x∈U−→y∈Ux∈V−→y∈V unfolding RestrictedTo_def by
autowith H(1,2) sub have x∈U−→U={x,y}x∈V−→V={x,y} by autowith H sub have x∈U−→(U={x,y}∧V=0)x∈V−→(V={x,y}∧U=0) by auto
then have (x∈U∨x∈V)−→(U=0∨V=0) by auto
moreover845

from sub H have (x∈U∧x
/
∈V)−→
/
(U=0∨V=0) by blast
ultimately have U=0∨V=0 by auto}
then have (T{restricted to}{x,y}){is hyperconnected} unfolding IsHConnected_def
by autoSwith assmsh{x,y}∈Pow( T)i have {x,y}{is in the spectrum of}IsHConnected
unfolding antiProperty_def
by autothen have {x,y}.1 using HConn_spectrum by auto
moreoverhave x∈{x,y} by auto
ultimately have {x,y}={x} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto
ultimately have y∈{x} by auto
then have y=x by autowith hx6=yi have False by auto}
then have ∃ U∈T. x∈U∧y∈U/ by auto}
then show thesis using isT1_def by autoqed

There is at least one topological space that is T1 , but not anti-hyperconnected.
This space is the cofinite topology on the natural numbers.
lemma Cofinite_not_anti_HConn:shows ¬((CoFinite nat){is anti-}IsHConnected) and (CoFinite nat){isT1 }proof {
assume (CoFinite nat){is anti-}IsHConnected
moreoverS
have(CoFinite nat)=nat unfolding Cofinite_def using union_cocardinalby automoreoverhave (CoFinite nat){restricted to}nat=(CoFinite nat) using subspace_cocardinal
unfolding Cofinite_def
by automoreoverhave ¬(nat≺nat) by auto
then have (CoFinite nat){is hyperconnected} using Cofinite_nat_HConn[ofnat] by auto
ultimately have nat{is in the spectrum of}IsHConnected unfolding antiProperty_def
by autothen have nat.1 using HConn_spectrum by auto
moreoverhave 1∈nat by auto
then have 1≺nat using n_lesspoll_nat by auto
ultimately have nat≺nat using lesspoll_trans1 by auto

846

then have False by auto}
then show ¬((CoFinite nat){is anti-}IsHConnected) by auto
next
show (CoFinite nat){is T1 } using cocardinal_is_T1 InfCard_nat unfolding Cofinite_def by autoqed

The join-topology build from the cofinite topology on the natural numbers,
and the excluded set topology on the natural numbers excluding {0,1}; isjust the union of both.

lemma join_top_cofinite_excluded_set:
shows (joinT {CoFinite nat,ExcludedSet(nat,{0,1})})=(CoFinite nat)∪
ExcludedSet(nat,{0,1})
proof have coftop:(CoFinite nat){is a topology} unfolding Cofinite_def using CoCar_is_topology InfCard_nat by auto
moreoverhave ExcludedSet(nat,{0,1}){is a topology} using excludedset_is_topology
by automoreover S
have exuni: ExcludedSet(nat,{0,1})=nat using union_excludedset by auto
moreoverS
have cofuni: (CoFinite nat)=nat using union_cocardinal unfolding Cofinite_def
by autoultimately have (joinT {CoFinite nat,ExcludedSet(nat,{0,1})}) = (THE
T. (CoFinite nat)∪ExcludedSet(nat,{0,1}) {is a subbase for} T)
using joinT_def by auto
moreoverS
have(CoFinite nat)∈CoFinite nat using CoCar_is_topology[OF InfCard_nat]
unfolding Cofinite_def IsATopology_def
by autowith cofuni have n:nat∈CoFinite nat by autoS
have T
Pa:(CoFinite nat)∪ExcludedSet(nat,{0,1}) {is a subbase for}{ A.
A∈Pow({ B. B∈FinPow((CoFinite nat)∪ExcludedSet(nat,{0,1}))})}
usingS Top_subbase(2)by autoT
have { A. A∈Pow({ B. B∈FinPow((CoFinite nat)∪ExcludedSet(nat,{0,1}))})}=(THET. (CoFinite nat)∪ExcludedSet(nat,{0,1}) {is a subbase for} T)
using same_subbase_same_top[where
B=(CoFinitenat)∪ExcludedSet(nat,{0,1}),
ST
OF _ Pa] the_equality[where a={ A. A∈Pow({ B. B∈FinPow((CoFinite nat)∪ExcludedSet(nat,{0and P=λT. ((CoFinite nat)∪ExcludedSet(nat,{0,1})){is a subbase for}T,
OF Pa] by auto
ultimately
have
S
T equal:(joinT {CoFinite nat,ExcludedSet(nat,{0,1})})={ A. A∈Pow({ B. B∈FinPow((CoFinite nat)∪ExcludedSet(nat,{0,1}))})}by auto{S
T
fix U assume U∈{ A. A∈Pow({
B. B∈FinPow((CoFinitenat)∪ExcludedSet(nat,{0,1}))})}
S
T
then obtain AU where U= AU and base:AU∈Pow({ B. B∈FinPow((CoFinitenat)∪ExcludedSet(nat,{0,1}))})

847

by autoS
have (CoFinite nat)⊆Pow( (CoFinite nat)) by auto
moreoverS
have ExcludedSet(nat,{0,1})⊆Pow( ExcludedSet(nat,{0,1})) by auto
moreovernote cofuni exuni
ultimately have sub:(CoFinite nat)∪ExcludedSet(nat,{0,1})⊆Pow(nat)by autoT
from base have ∀ S∈AU. S∈{ B. B∈FinPow((CoFinite nat)∪ExcludedSet(nat,{0,1}))}by blast
T then have ∀ S∈AU. ∃ B∈FinPow((CoFinite nat)∪ExcludedSet(nat,{0,1})).
S= B by blast
T then have eq:∀ S∈AU. ∃ B∈Pow((CoFinite nat)∪ExcludedSet(nat,{0,1})).
S= B unfolding FinPow_def by blast{
fix S assume S∈AU
T
with eq obtain B where B∈Pow((CoFinite nat)∪ExcludedSet(nat,{0,1}))S= B
by autowith sub have B∈Pow(Pow(nat)) by auto{T
fix x assume x∈ Bthen have ∀ N∈B. x∈NB6=0 by autowith hB∈Pow(Pow(nat))i have x∈nat by blast}
Twith hS= Bi have S∈Pow(nat) by auto}
then have
S ∀ S∈AU. S∈Pow(nat) by blast
with hU= AUi have U∈Pow(nat) by auto{
assume S
0∈U∨1∈U
with hU= AUi obtain S where T
S∈AU0∈S∨1∈S by autowith base obtain BS where S= BS and bsbase:BS∈FinPow((CoFinitenat)∪ExcludedSet(nat,{0,1})) by autowith h0∈S∨1∈Si have ∀ M∈BS. 0∈M∨1∈M by auto
then have ∀ M∈BS. M∈ExcludedSet(nat,{0,1})-{nat}/unfolding ExcludedPoint_def
ExcludedSet_def by auto
moreovernote bsbase nultimately have BS∈FinPow(CoFinite nat) unfolding FinPow_def by
auto
moreoveri have S6=0 by autofrom h0∈S∨1∈S
Twith hS= BSi have BS6=0 by auto
moreovernote coftop
T
ultimately have
BS∈CoFinite nat using topology0.fin_inter_open_open[OFtopology0_CoCardinal[OF InfCard_nat]]
unfolding
T Cofinite_def by autowith hS= BSi have S∈CoFinite nat by auto

848

with h0∈S∨1∈Si have nat-S≺nat unfolding Cofinite_def CoCardinal_def
by automoreoverS
from hU= AUihS∈AUi have S⊆U by auto
then have nat-U⊆nat-S by auto
then have nat-U.nat-S using subset_imp_lepoll by auto
ultimately
have nat-U≺nat using lesspoll_trans1 by autowith hU∈Pow(nat)i have U∈CoFinite nat unfolding Cofinite_def CoCardinal_def
by autowith hU∈Pow(nat)i have U∈ (CoFinite nat)∪ ExcludedSet(nat,{0,1})by auto}with hU∈Pow(nat)i have U∈(CoFinite nat)∪ ExcludedSet(nat,{0,1}) unfolding ExcludedSet_def by blast}
S
Tthen have ({ A . A ∈ Pow({ B . B ∈ FinPow((CoFinite nat) ∪ ExcludedSet(nat,{0,1}))})})⊆ (CoFinite nat)∪ ExcludedSet(nat,{0,1})
by blast
moreover{fix Uassume U∈(CoFinite nat)∪ ExcludedSet(nat,{0,1})
then have {U}∈FinPow((CoFinite nat) ∪ ExcludedSet(nat,{0,1})) unfolding FinPow_def by autoT
then have {U}∈Pow({ B . B ∈ FinPow((CoFinite nat) ∪ ExcludedSet(nat,{0,1}))})by blast
moreoverS
have U= {U} by autoST
ultimately have U∈{ A . A ∈ Pow({ B . B ∈ FinPow((CoFinite nat)
∪ ExcludedSet(nat,{0,1}))})} by blast}
S
Tthen have (CoFinite nat)∪ ExcludedSet(nat,{0,1})⊆{ A . A ∈ Pow({ B. B ∈ FinPow((CoFinite nat) ∪ ExcludedSet(nat,{0,1}))})}by autoS
T
ultimately have (CoFinite nat)∪ ExcludedSet(nat,{0,1})={ A . A ∈ Pow({ B. B ∈ FinPow((CoFinite nat) ∪ ExcludedSet(nat,{0,1}))})}by autowith equal show thesis by autoqed

The previous topology in not T2 , but is anti-hyperconnected.
theorem join_Cofinite_ExclPoint_not_T2:
shows¬((joinT {CoFinite nat, ExcludedSet(nat,{0,1})}){is T2 }) and(joinT {CoFinite nat,ExcludedSet(nat,{0,1})}){is anti-} IsHConnected
proof have (CoFinitenat) ⊆ (CoFinite nat) ∪ ExcludedSet(nat,{0,1})by autoS
S
have((CoFinite nat)∪ ExcludedSet(nat,{0,1}))=( (CoFinite nat))∪849

S( ExcludedSet(nat,{0,1}))by automoreoverhave . . .=nat unfolding Cofinite_def using union_cocardinal union_excludedset
by autoS
ultimately have tot: ((CoFinite nat)∪ ExcludedSet(nat,{0,1}))=nat by
auto{
assume (joinT {CoFinite nat,ExcludedSet(nat,{0,1})}) {is T2 }then have t2:((CoFinite nat)∪ ExcludedSet(nat,{0,1})){is T2 } using
join_top_cofinite_excluded_set
by autowith tot have ∃ U∈((CoFinite nat)∪ ExcludedSet(nat,{0,1})). ∃ V∈((CoFinitenat)∪ ExcludedSet(nat,{0,1})). 0∈U∧1∈V∧U∩V=0 using isT2_def by auto
then obtain U V where U ∈ (CoFinite nat) ∨ (0 ∈/ U∧1∈U)V/∈ (CoFinitenat) ∨ (0 ∈/ V∧1∈V)0∈U1∈VU∩V=0/
unfolding ExcludedSet_def by auto
then have U∈(CoFinite nat)V∈(CoFinite nat) by autowith h0∈Uih1∈Vi have U∩V6=0 using Cofinite_nat_HConn IsHConnected_def
by autowith hU∩V=0i have False by auto}
then show ¬((joinT {CoFinite nat,ExcludedSet(nat,{0,1})}){is T2 }) byauto{S
fix A assume AS:A∈Pow( ((CoFinite nat)∪ ExcludedSet(nat,{0,1})))(((CoFinitenat)∪ ExcludedSet(nat,{0,1})){restricted to}A){is hyperconnected}
with tot have A∈Pow(nat) by auto
then have sub:A∩nat=A by auto
have ((CoFinite nat)∪ ExcludedSet(nat,{0,1})){restricted to}A=((CoFinitenat){restricted to}A)∪ (ExcludedSet(nat,{0,1}){restricted to}A)
unfolding RestrictedTo_def by auto
also from sub have . . .=(CoFinite A)∪ExcludedSet(A,{0,1}) using subspace_excludedset[ofnasubspace_cocardinal[of natnatA] unfolding Cofinite_def
by autofinally have ((CoFinite nat)∪ ExcludedSet(nat,{0,1})){restricted to}A=(CoFinite
A)∪ExcludedSet(A,{0,1}) by autowith AS(2) have eq:((CoFinite A)∪ExcludedSet(A,{0,1})){is hyperconnected}
by auto{assume {0,1}∩A=0
then have (CoFinite A)∪ExcludedSet(A,{0,1})=Pow(A) using empty_excludedset[of{0,1}A] unfolding Cofinite_def CoCardinal_def
by autowith eq have Pow(A){is hyperconnected} by auto
then have Pow(A){is connected} using HConn_imp_Conn by auto
moreoverhave Pow(A){is anti-}IsConnected using discrete_tot_dis unfolding IsTotDis_def by auto

850

moreoverS
S
have(Pow(A))∈Pow( (Pow(A))) by auto
moreoverS
have Pow(A){restricted to} (Pow(A))=Pow(A) unfolding RestrictedTo_def
by blastS
ultimately have ( (Pow(A))){is in the spectrum of}IsConnected unfolding antiProperty_def
by autothen have A{is in the spectrum of}IsConnected by auto
then have A.1 using conn_spectrum by auto
then have A{is in the spectrum of}IsHConnected using HConn_spectrum
by auto}moreover{assume AS:{0,1}∩A6=0{
assume A={0}∨A={1}then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}IsHConnected using HConn_spectrum
by auto}moreover{assume AS2:¬(A={0}∨A={1}){assume AS3:A⊆{0,1}with AS AS2 have A_def:A={0,1} by blast
then have ExcludedSet(A,{0,1})=ExcludedSet(A,A) by auto
moreover have ExcludedSet(A,A)={0,A} unfolding ExcludedSet_def
by blast
ultimately have ExcludedSet(A,{0,1})={0,A} by auto
moreoverhave 0∈(CoFinite A) using empty_open[of CoFinite A]
CoCar_is_topology[OF InfCard_nat,of A] unfolding Cofinite_def
by automoreoverS
have(CoFinite A)=A using union_cocardinal unfolding Cofinite_def
by autothen have A∈(CoFinite A) using CoCar_is_topology[OF InfCard_nat,of
A] unfolding Cofinite_def
IsATopology_def by auto
ultimately have (CoFinite A)∪ExcludedSet(A,{0,1})=(CoFiniteA) by autowith eq have(CoFinite A){is hyperconnected} by autowith A_def have hyp:(CoFinite {0,1}){is hyperconnected} by
auto
have {0}≈1{1}≈1 using singleton_eqpoll_1 by auto851

moreoverhave 1≺nat using n_lesspoll_nat by auto
ultimately have {0}≺nat{1}≺nat using eq_lesspoll_trans by auto
moreoverhave {0,1}-{1}={0}{0,1}-{0}={1} by auto
ultimately have {1}∈(CoFinite {0,1}){0}∈(CoFinite {0,1}) {1}∩{0}=0
unfolding Cofinite_def CoCardinal_def
by autowith hyp have False unfolding IsHConnected_def by auto}
then obtain t where t∈A t6=0 t6=1 by auto
then have {t}∈ExcludedSet(A,{0,1}) unfolding ExcludedSet_def
by automoreover{have {t}≈1 using singleton_eqpoll_1 by auto
moreoverhave 1≺nat using n_lesspoll_nat by auto
ultimately have {t}≺nat using eq_lesspoll_trans by auto
moreoverwith ht∈Ai have A-(A-{t})={t} by auto
ultimately have A-{t}∈(CoFinite A) unfolding Cofinite_def CoCardinal_def
by auto}ultimately have {t}∈((CoFinite A)∪ExcludedSet(A,{0,1}))A-{t}∈((CoFinite
A)∪ExcludedSet(A,{0,1})){t}∩(A-{t})=0 by autowith eq have A-{t}=0 unfolding IsHConnected_def by autowith ht∈Ai have A={t} by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}IsHConnected using HConn_spectrum
by auto}ultimately have A{is in the spectrum of}IsHConnected by auto}
ultimately have A{is in the spectrum of}IsHConnected by auto}
then have ((CoFinite nat)∪ExcludedSet(nat,{0,1})){is anti-}IsHConnected
unfolding antiProperty_def
by autothen show (joinT {CoFinite nat, ExcludedSet(nat,{0,1})}){is anti-}IsHConnectedusing join_top_cofinite_excluded_set
by autoqed

Let’s show that anti-hyperconnected is in fact T1 and sober. The trick of
the proof lies in the fact that if a subset is hyperconnected, its closure is sotoo (the closure of a point is then always hyperconnected because singletons852

are in the spectrum); since the closure is closed, we can apply the sober
property on it.

theorem (in topology0) T1_sober_imp_anti_HConn:assumes T{is T1 } and T{is sober}shows T{is anti-}IsHConnected
proof {S
fix A assume AS:A∈Pow( T)(T{restricted to}A){is hyperconnected}{
assume A=0
then have A.1 using empty_lepollI by auto
then have A{is in the spectrum of}IsHConnected using HConn_spectrum
by auto}moreover{assume A6=0
then obtain x where x∈A by blast{
assume ¬((T{restricted to}Closure(A,T)){is hyperconnected})then obtain U V where UV_def:U∈(T{restricted to}Closure(A,T))V∈(T{restrictedto}Closure(A,T))
U∩V=0U6=0V6=0 using IsHConnected_def by auto
then obtain UCA VCA where UCA∈TVCA∈TU=UCA∩Closure(A,T)V=VCA∩Closure(A,T)
unfolding RestrictedTo_def
by autoS
from hA∈Pow( T)i have A⊆Closure(A,T) using cl_contains_set byauto
then have UCA∩A⊆UCA∩Closure(A,T)VCA∩A⊆VCA∩Closure(A,T) by autowith hU=UCA∩Closure(A,T)ihV=VCA∩Closure(A,T)ihU∩V=0i have (UCA∩A)∩(VCA∩A)=0
by automoreoverfrom hUCA∈TihVCA∈Ti have UCA∩A∈(T{restricted to}A)VCA∩A∈(T{restrictedto}A)
unfolding RestrictedTo_def by auto
moreovernote AS(2)ultimately have UCA∩A=0∨VCA∩A=0 using IsHConnected_def by autowith hA⊆Closure(A,T)i have A⊆Closure(A,T)-UCA∨A⊆Closure(A,T)-VCA
by automoreover{S
S
have Closure(A,T)-UCA=Closure(A,T)∩( T-UCA)Closure(A,T)-VCA=Closure(A,T)∩( T-VC
using Top_3_L11(1) AS(1) by auto
moreoverS
S
with hUCA∈TihVCA∈Ti have ( T-UCA){is closed in}T( T-VCA){isclosed in}TClosure(A,T){is closed in}T
using Top_3_L9 cl_is_closed AS(1) by auto
ultimately have (Closure(A,T)-UCA){is closed in}T(Closure(A,T)-VCA){isclosed in}T853

using Top_3_L5(1) by auto}
ultimately
have Closure(A,T)⊆Closure(A,T)-UCA∨Closure(A,T)⊆Closure(A,T)-VCA
using Top_3_L13
by autothen have UCA∩Closure(A,T)=0∨VCA∩Closure(A,T)=0 by autowith hU=UCA∩Closure(A,T)ihV=VCA∩Closure(A,T)i have U=0∨V=0 by
autowith hU6=0ihV6=0i have False by auto}
then have (T{restricted to}Closure(A,T)){is hyperconnected} byautomoreoverhave Closure(A,T){is closed in}T using cl_is_closed AS(1) by auto
moreoverfrom hx∈Ai have Closure(A,T)6=0 using cl_contains_set AS(1) by auto
moreoverS
from AS(1) have Closure(A,T)⊆ T Susing Top_3_L11(1) by auto
ultimately have Closure(A,T)∈Pow( T)-{0}(T {restricted to} Closure(A,T)){is hyperconnected} Closure(A, T) {is closed in} T
by automoreover note assms(2)SSultimately have ∃ x∈ T. (Closure(A,T)=Closure({x},T)∧ (∀ y∈ T.
Closure(A,T) = Closure({y}, T) −→ y = x)) unfolding IsSober_def
by autoS
then obtain y where y∈ TClosure(A,T)=Closure({y},T) by auto
moreover{S
fix z assume z∈( ST)-{y}with assms(1) hy∈ Ti obtain U where U∈T z∈U y∈U/ using isT1_def
by blast
Sthen have U∈T z∈U U⊆( T)-{y}S by auto
then have ∃ U∈T. z∈U ∧ U⊆( T)-{y} by auto}
S
S
then have ∀Sz∈( T)-{y}. ∃ U∈T. z∈U ∧ U⊆( T)-{y} by auto
then have
S T-{y}∈T using open_neigh_open by autowith hy∈S Ti have {y} {is closed in}T using IsClosed_def by autowith hy∈ Ti have Closure({y},T)={y} using Top_3_L8 by autowith hClosure(A,T)=Closure({y},T)i have Closure(A,T)={y} by autowith AS(1) have A⊆{y} using cl_contains_set[of A] by autowith hA6=0i have A={y} by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}IsHConnected using HConn_spectrum
by auto}ultimately have A{is in the spectrum of}IsHConnected by blast}854

then show thesis using antiProperty_def by autoqed
theorem (in topology0) anti_HConn_iff_T1_sober:shows (T{is anti-}IsHConnected) ←→ (T{is sober}∧T{is T1 })using T1_sober_imp_anti_HConn anti_HConn_imp_T1 anti_HConn_imp_sober
by autoA space is ultraconnected iff every two non-empty closed sets meet.
definition IsUConnected (_{is ultraconnected}80)
where T{is ultraconnected}≡ ∀ A B. A{is closed in}T∧B{is closed in}T∧A∩B=0−→ A=0∨B=0Every ultraconnected space is trivially normal.
lemma (in topology0)UConn_imp_normal:
assumes T{is ultraconnected}
shows T{is normal}
proof {
fix A Bassume AS:A{is closed in}T B{is closed in}TA∩B=0
with assms have A=0∨B=0 using
by autoS IsUConnected_def
Swith AS(1,2) have (A⊆0∧B⊆ T)∨(A⊆ T∧B⊆0) unfolding IsClosed_def
by automoreoverhave 0∈T using empty_open topSpaceAssum by auto
moreoverS
have
T∈T using topSpaceAssum unfolding IsATopology_def by auto
ultimately have ∃ U∈T. ∃ V∈T. A⊆U∧B⊆V∧U∩V=0 by auto}
then show thesis unfolding IsNormal_def by autoqed

Every ultraconnected space is connected.
lemma UConn_imp_Conn:assumes T{is ultraconnected}
shows T{is connected}
proof {
fix U V
assume U∈TU{isclosed in}TS
S
then have
T-( ST-U)=U by autowith hU∈Ti have ( T-U){is closed in}T unfolding
IsClosed_def by autoSwith hU{is closed in}Ti assms have U=0∨ T-U=0 unfolding IsUConnected_def
by autoSwith hU∈Ti have U=0∨U= T by auto}
then show thesis unfolding IsConnected_def by auto
qed

855

lemma UConn_spectrum:shows (A{is in the spectrum of}IsUConnected) ←→ A.1
proof
assume A_spec:(A{is in the spectrum of}IsUConnected){
assume A=0
then have A.1 using empty_lepollI by auto}
moreover{assume A6=0
S
from A_spec have ∀ T. (T{is a topology}∧ T≈A) −→ (T{is ultraconnected})
unfolding Spec_def by auto
moreoverhave Pow(A){is a topology} using Pow_is_top by auto
moreoverS
have
Pow(A)=A
by autoS
then have
Pow(A)≈A by auto
ultimately have ult:Pow(A){is ultraconnected} by auto
moreoverfrom hA6=0i obtain b where b∈A by auto
then have {b}{is closed in}Pow(A) unfolding IsClosed_def by auto{
fix cassume c∈Ac6=bthen have {c}{is closed in}Pow(A){c}∩{b}=0 unfolding IsClosed_def
by autowith ult h{b}{is closed in}Pow(A)i have False using IsUConnected_def
by auto}with hb∈Ai have A={b} by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
ultimately show A.1 by auto
next
assume A.1
{
fix T
S
assume T{is a topology} T≈A{S
assumeT=0with hT{is a topology}i have T={0} using empty_open by auto
then have T{is ultraconnected} unfolding IsUConnected_def IsClosed_def
by auto}moreover{856

S
assumeT6=0
moreover S
Sfrom hA.1ih T≈Ai haveT.1 using eq_lepoll_trans by auto
ultimately
Sobtain E where eq: T={E} using lepoll_1_is_sing by blast
moreoverS
have T⊆Pow( T) by auto
ultimately have T⊆Pow({E}) by auto
then have T⊆{0,{E}} by blast
with hT{is a topology}i have {0}⊆T T⊆{0,{E}} using empty_open by
auto
then have T{is ultraconnected} unfolding IsUConnected_def IsClosed_defby (simp only: eq, safe, force)}
ultimately have T{is ultraconnected} by auto}
then show A{is in the spectrum of}IsUConnected unfolding Spec_def by
auto
qed

This time, anti-ultraconnected is an old property.
theorem (in topology0) anti_UConn:shows (T{is anti-}IsUConnected) ←→ T{is T1 }proofassume T{is T1 }{fix TT{
assume TT{is a topology}TT{is T1 }TT{is ultraconnected}{
SassumeTT=0Sthen have
TT.1
using empty_lepollI by autoS
then have (( TT){is in the spectrum of}IsUConnected) using UConn_spectrum
by auto}moreover{S
assumeTT6=0Sthen obtain t where t∈ TT by blast
{
fix x
S
assume p:x∈ TT{S
fix y assume y∈( TT)-{x}with hTT{is T1 }i p obtain U where U∈TT y∈U x∈U/ using isT1_def
by blast
Sthen have U∈TT y∈U U⊆( TT)-{x}by autoS
then have ∃ U∈TT. y∈U ∧ U⊆( TT)-{x} by auto
}

857

S
S
then have ∀ y∈( TT)-{x}. ∃ U∈TT.
S y∈U ∧ U⊆( TT)-{x} by autowith hTT{is a topology}i haveTT-{x}∈TT using topology0.open_neigh_open
unfolding topology0_def by autowith p have {x} {is closed in}TT using IsClosed_def by auto}S
then haveS reg:∀ x∈ TT. {x}{is closed in}TT by autowith ht∈ TTi have t_cl:{t}{is closed in}TT by auto
{
fix y
S
assume y∈ TTwith reg have {y}{is closed in}TT by autowith hTT{is ultraconnected}i t_cl have y=t unfolding IsUConnected_def
by auto}S
Siwith ht∈ TT
TT={t} by blast
S havethen have S TT≈1 using singleton_eqpoll_1 by auto
then have STT.1 using eqpoll_imp_lepoll by auto
then have ( TT){is in the spectrum of}IsUConnected using UConn_spectrum
by auto}S
ultimately have ( TT){is in the spectrum of}IsUConnected by blast}
S then have (TT{is a topology}∧TT{is T1 }∧(TT{is ultraconnected}))−→(( TT){is in the spectrum of}IsUConnected)
by auto}thenhave ∀ TT. (TT{is a topology}∧TT{is T1 }∧(TT{is ultraconnected}))−→S(( TT){is in the spectrum of}IsUConnected)
by automoreovernote here_T1
ultimately have ∀ T. T{is a topology} −→ ((T{is T1 })−→(T{is anti-}IsUConnected))using Q_P_imp_Spec[where Q=isT1 and P=IsUConnected]
by autowith topSpaceAssum have (T{is T1 })−→(T{is anti-}IsUConnected) by autowith hT{is T1 }i show T{is anti-}IsUConnected by auto
next
assume ASS:T{is anti-}IsUConnected{
fix x yS
S
assume x∈ Ty∈S Tx6=ythen have tot: (T{restricted to}{x,y})={x,y} unfolding RestrictedTo_def
by auto{assume AS:∀ U∈T. x∈U−→y∈U{assume {y}{is closed in}(T{restricted to}{x,y})
moreoverfrom hx6=yi have {x,y}-{y}={x} by auto858

ultimately have {x}∈(T{restricted to}{x,y}) unfolding IsClosed_defby (simp only:tot)
then obtain U where U∈T{x}={x,y}∩U unfolding RestrictedTo_def
by automoreoverwith hx6=yi have y∈{x}/y∈{x,y} by (blast+)with h{x}={x,y}∩Ui have y∈U/ by auto
moreover have x∈{x} by autowith h{x}={x,y}∩Ui have x∈U by auto
ultimately have x∈Uy∈UU∈T/
by autowith AS have False by auto}
then have y_no_cl:¬({y}{is closed in}(T{restricted to}{x,y})) by
auto{
fix A Bassume cl:A{is closed in}(T{restricted to}{x,y})B{is closed in}(T{restrictedto}{x,y})A∩B=0
with tot have A⊆{x,y}B⊆{x,y}A∩B=0 unfolding IsClosed_def by
auto
then have x∈A−→x∈By∈A−→y/∈BA⊆{x,y}B⊆{x,y}/by auto{assume x∈Awith hx∈A−→x∈B/ ihB⊆{x,y}i have B⊆{y} by auto
then have B=0∨B={y} by autowith y_no_cl cl(2) have B=0 by auto}
moreover{assume x∈A/with hA⊆{x,y}i have A⊆{y} by auto
then have A=0∨A={y} by autowith y_no_cl cl(1) have A=0 by auto}
ultimately have A=0∨B=0 by auto}
then have (T{restricted to}{x,y}){is ultraconnected} unfolding IsUConnected_def
by autoS
S
with ASS hx∈ Tihy∈ Ti have {x,y}{is in the spectrum of}IsUConnected
unfolding antiProperty_def
by autothen have {x,y}.1 using UConn_spectrum by auto
moreover have x∈{x,y} by auto
ultimately have {x}={x,y} using lepoll_1_is_sing[of {x,y}x] by auto
moreoverhave y∈{x,y} by auto
ultimately have y∈{x} by auto
then have y=x by auto
then have False using hx6=yi by auto859

}then have ∃ U∈T. x∈U∧y∈U/ by auto}
then show T{is T1 } unfolding isT1_def by autoqed

Is is natural that separation axioms and connection axioms are anti-propertiesof each other; as the concepts of connectedness and separation are opposite.
To end this section, let’s try to charaterize anti-sober spaces.
lemma sober_spectrum:shows (A{is in the spectrum of}IsSober) ←→ A.1
proof
assume AS:A{is in the spectrum of}IsSober{assume A=0
then have A.1 using empty_lepollI by auto}
moreover{assume A6=0
note AS
moreoverhave top:{0,A}{is a topology} unfolding IsATopology_def by auto
moreoverS
have{0,A}=Aby autoS
then have{0,A}≈A by auto
ultimately have {0,A}{is sober} using Spec_def by auto
moreoverhave {0,A}{is hyperconnected} using Indiscrete_HConn by auto
moreoverhave {0,A}{restricted to}A={0,A} unfolding RestrictedTo_def by auto
moreoverhave A{is closed in}{0,A} unfolding IsClosed_def by auto
moreovernote hA6=0i
S
ultimately have ∃ x∈A. A=Closure({x},{0,A})∧ (∀ y∈ {0, A}. A = Closure({y},{0, A}) −→ y = x) unfolding IsSober_def by auto
then obtain x where x∈A A=Closure({x},{0,A}) and reg:∀ y∈A. A = Closure({y},{0, A}) −→ y = x by auto{
fix y assume y∈Awith top have Closure({y},{0,A}){is closed in}{0,A} using topology0.cl_is_closed
topology0_def by auto
moreoverfrom hy∈Ai top have y∈Closure({y},{0,A}) using topology0.cl_contains_set
topology0_def by auto
ultimately have A-Closure({y},{0,A})∈{0,A}Closure({y},{0,A})∩A6=0
unfolding IsClosed_def

860

by auto
then have A-Closure({y},{0,A})=A∨A-Closure({y},{0,A})=0
by automoreoverfrom hy∈Aihy∈Closure({y},{0,A})i have y∈Ay∈A-Closure({y},{0,A})/
by autoultimately have A-Closure({y},{0,A})=0 by (cases A-Closure({y},{0,A})=A,
simp, auto)
moreoverfrom hy∈Ai top have Closure({y},{0,A})⊆A using topology0_def topology0.Top_3_L11(1)by blast
then have A-(A-Closure({y},{0,A}))=Closure({y},{0,A}) by auto
ultimately have A=Closure({y},{0,A}) by auto}with reg have ∀ y∈A. x=y by autowith hx∈Ai have A={x} by blast
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
ultimately show A.1 by auto
next
assume A.1{
S
fix T assume T{is a topology} T≈A{S
assumeT=0then have T{is sober} unfolding IsSober_def by auto}
moreover{S
assumeT6=0Sthen obtain x where x∈ T by blast
moreoverS
S
from h T≈Ai hA.1Si haveT.1 using eq_lepoll_trans by auto
ultimately have
T={x} using lepoll_1_is_sing by auto
moreoverS
have T⊆Pow( T) by auto
ultimately have T⊆Pow({x}) by auto
then have T⊆{0,{x}} by blast
moreoverfrom hT{is a topology}i have 0∈T using empty_open by auto
moreoverS
from hT{is a topology}i haveT∈T unfolding IsATopology_def by
autoSwith h T={x}i have {x}∈T by auto
ultimately have T_def:T={0,{x}}by autoS
then have dd:Pow( T)-{0}={{x}} by auto{S
fix B assume B∈Pow( T)-{0}861with dd have B_def:B={x} by auto
S
from hT{is a topology}i have ( T){is closed in}T using topology0_def
topology0.Top_3_L1
by autoSwith h T={x}i hT{is a topology}i have Closure({x},T)={x} using
topology0.Top_3_L8
unfolding topology0_def by autowith B_def have B=Closure({x},T) by auto
moreover{S
fix y assumey∈ TSwith h T={x}i have y=x by auto}S
then have (∀ y∈ T.
S B = Closure({y}, T) −→ y = x) by auto
moreover note hx∈ TiSSultimately have (∃ x∈ T. B = Closure({x}, T) ∧ (∀ y∈ T. B = Closure({y},T) −→ y = x))
by auto}then have T{is sober} unfolding IsSober_def by auto}
ultimately have T{is sober} by blast}
then show A {is in the spectrum of} IsSober unfolding Spec_def by autoqed
theorem (in topology0)anti_sober:Sshows (T{is anti-}IsSober) ←→ T={0, T}
proof
S
assume T={0, T}{
S
fix A assume A∈Pow( T)(T{restricted to}A){is sober}{assume A=0
then have A.1 using empty_lepollI by auto
then have A{is in the spectrum of}IsSober using sober_spectrum
by auto}moreover{assumeS A6=0 S
S
have
T∈{0,
S T}0∈{0, ST} by autowith hT={0, ST}i have ( T)∈T 0∈T by autowith hA∈Pow( T)i have {0,A}⊆(T{restricted to}A) unfolding RestrictedTo_def
by automoreoverS
S
have ∀ B∈{0,
S T}. B=0∨B= T by autoS
with hT={0, ST}i have ∀ B∈T. B=0∨B= T by autowith hA∈Pow( T)i have T{restricted to}A⊆{0,A} unfolding RestrictedTo_def

862

by auto
ultimately have top_def:T{restricted to}A={0,A} by auto
moreoverhave A{is closed in}{0,A} unfolding IsClosed_def by auto
moreoverhave {0,A}{is hyperconnected} using Indiscrete_HConn by auto
moreoverS
from hA∈Pow( T)i have (T{restricted to}A){restricted to}A=T{restrictedto}A using subspace_of_subspace[of AAT]
by automoreoverS
note hA6=0i hA∈Pow( T)i S
ultimately have A∈Pow( (T{restricted to}A))-{0}A{is closed in}(T{restrictedto}A)((T{restricted to}A){restricted to}A){is hyperconnected}
by autoS
i have ∃ x∈with h(T{restricted to}A){is sober}(T{restricted to}A).
S
A=Closure({x},T{restricted to}A)∧(∀ y∈ (T{restricted to}A). A=Closure({y},T{restrictedto}A) −→ y=x)
unfolding IsSober_def by autowith top_def have ∃ x∈A. A=Closure({x},{0,A})∧(∀ y∈A. A=Closure({y},{0,A})−→ y=x) by auto
then obtain x where x∈AA=Closure({x},{0,A})and reg:∀ y∈A. A=Closure({y},{0,A})−→ y=x by auto{
fix y assume y∈Afrom hA6=0i have top:{0,A}{is a topology} using indiscrete_ptopology[ofA] indiscrete_partition[of A] Ptopology_is_a_topology(1)[of {A}A]
by autowith hy∈Ai have Closure({y},{0,A}){is closed in}{0,A} using topology0.cl_is_closed
topology0_def by auto
moreoverfrom hy∈Ai top have y∈Closure({y},{0,A}) using topology0.cl_contains_set
topology0_def by auto
ultimately have A-Closure({y},{0,A})∈{0,A}Closure({y},{0,A})∩A6=0
unfolding IsClosed_def
by autothen have A-Closure({y},{0,A})=A∨A-Closure({y},{0,A})=0
by automoreoverfrom hy∈Aihy∈Closure({y},{0,A})i have y∈Ay∈A-Closure({y},{0,A})/
by autoultimately have A-Closure({y},{0,A})=0 by (cases A-Closure({y},{0,A})=A,
simp, auto)
moreoverfrom hy∈Ai top have Closure({y},{0,A})⊆A using topology0_def
topology0.Top_3_L11(1) by blast
then have A-(A-Closure({y},{0,A}))=Closure({y},{0,A}) by auto
ultimately have A=Closure({y},{0,A}) by auto}863

with reg hx∈Ai have A={x} by blast
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto
then have A{is in the spectrum of}IsSober using sober_spectrum
by auto}ultimately have A{is in the spectrum of}IsSober by auto}
then show T{is anti-}IsSober using antiProperty_def by auto
next
assume T{is anti-}IsSober
{
fix A
S
assume A∈TA6=0A6= T
S
then obtain x y where x∈Ay∈ T-A x6=yby blast
then have {x}={x,y}∩A by autowith hA∈Ti have {x}∈T{restricted to}{x,y} unfolding RestrictedTo_def
by auto{assume {y}∈T{restrictedto}{x,y}S
S
from hy∈ T-Ai hx∈AihA∈Ti have(T{restricted to}{x,y})={x,y} unfolding RestrictedTo_def
by autowith hx6=yih{y}∈T{restricted to}{x,y}ih{x}∈T{restricted to}{x,y}ihave (T{restricted to}{x,y}){is T2 }unfolding isT2_def by auto
then have (T{restricted to}{x,y}){is sober} using topology0.T2_imp_anti_HConn[ofT{restricted to}{x,y}]Top_1_L4 topology0_def topology0.anti_HConn_iff_T1_sober[of T{restrictedto}{x,y}] by auto}
moreover{assume {y}∈T{restricted/to}{x,y}moreoverS
from hy∈ T-Ai hx∈AihA∈Ti have T{restricted to}{x,y}⊆Pow({x,y}) unfolding RestrictedTo_def by auto
then have T{restricted to}{x,y}⊆{0,{x},{y},{x,y}} by blast
moreovernote h{x}∈T{restricted to}{x,y}i empty_open[OF Top_1_L4[of {x,y}]]moreoverS
S
from hy∈ T-Ai hx∈AihA∈Ti have tot: (T{restricted to}{x,y})={x,y}unfolding RestrictedTo_def
by autoS
from Top_1_L4[of {x,y}] have(T{restricted to}{x,y})∈T{restrictedto}{x,y} unfolding IsATopology_def
by autowith tot have {x,y}∈T{restricted to}{x,y} by auto
ultimately have top_d_def:T{restricted to}{x,y}={0,{x},{x,y}} by

864

auto
{
fix B assume B∈Pow({x,y})-{0}B{isclosed in}(T{restricted to}{x,y})S
with top_d_def have ( (T{restricted to}{x,y}))-B∈{0,{x},{x,y}}
unfolding IsClosed_def by simp
moreover have B∈{{x},{y},{x,y}} using hB∈Pow({x,y})-{0}i by blast
moreover note tot
ultimately have {x,y}-B∈{0,{x},{x,y}} by auto
have xin:x∈Closure({x},T{restricted to}{x,y}) using topology0.cl_contains_set[ofT{restricted to}{x,y}{x}]Top_1_L4[of {x,y}] unfolding topology0_def[of (T {restrictedto} {x, y})] using tot by auto{
assume {x}{is closed in}(T{restricted to}{x,y})then have {x,y}-{x}∈(T{restricted to}{x,y}) unfolding IsClosed_def
using tot
by automoreoverfrom hx6=yi have {x,y}-{x}={y} by auto
ultimately have {y}∈(T{restricted to}{x,y}) by auto
then have False using h{y}∈(T{restricted/to}{x,y})i by auto}
then have ¬({x}{is closed in}(T{restricted to}{x,y})) by auto
moreoverfrom tot have (Closure({x},T{restricted to}{x,y})){is closedin}(T{restricted to}{x,y})using topology0.cl_is_closed unfolding topology0_def using Top_1_L4[of{x,y}]
tot by auto
ultimately have ¬(Closure({x},T{restricted to}{x,y})={x}) by
automoreover note xin topology0.Top_3_L11(1)[of T{restricted to}{x,y}{x}]totultimately have cl_x:Closure({x},T{restricted to}{x,y})={x,y}unfolding topology0_def
using Top_1_L4[of {x,y}] by auto
have {y}{is closed in}(T{restricted to}{x,y}) unfolding IsClosed_def
using tot
top_d_def hx6=yi by auto
then have cl_y:Closure({y},T{restricted to}{x,y})={y} using topology0.Top_3_L8[ofT{restricted to}{x,y}]
unfolding topology0_def using Top_1_L4[of {x,y}] tot by auto{
assume {x,y}-B=0
with hB∈Pow({x,y})-{0}i have B:{x,y}=B by auto{
fix massume dis:m∈{x,y} and B_def:B=Closure({m},T{restrictedto}{x,y})865

{
assume m=ywith B_def have B=Closure({y},T{restricted to}{x,y}) by
autowith cl_y have B={y} by autowith B have {x,y}={y} by auto
moreover have x∈{x,y} by auto
ultimately
have x∈{y} by autowith hx6=yi have False by auto}with dis have m=x by auto}
then have (∀ m∈{x,y}. B=Closure({m},T{restricted to}{x,y})−→m=x) by auto
moreoverhave B=Closure({x},T{restricted to}{x,y}) using cl_x B by auto
ultimately have ∃ t∈{x,y}. B=Closure({t},T{restricted to}{x,y})∧ (∀ m∈{x,y}. B=Closure({m},T{restricted to}{x,y})−→m=t )by auto}moreover{assume {x,y}-B6=0
with h{x,y}-B∈{0,{x},{x,y}}i have or:{x,y}-B={x}∨{x,y}-B={x,y}by auto{assume {x,y}-B={x}then have x∈{x,y}-B by autowith hB∈{{x},{y},{x,y}}i hx6=yi have B:B={y} by blast{fix massume dis:m∈{x,y} and B_def:B=Closure({m},T{restrictedto}{x,y}){assume m=x
with B_def have B=Closure({x},T{restricted to}{x,y})
by autowith cl_x have B={x,y} by autowith B have {x,y}={y} by auto
moreover have x∈{x,y} by auto
ultimately
have x∈{y} by autowith hx6=yi have False by auto}with dis have m=y by auto}
moreoverhave B=Closure({y},T{restricted to}{x,y}) using cl_y B by

866

auto
ultimately have ∃ t∈{x,y}. B=Closure({t},T{restricted to}{x,y})∧ (∀ m∈{x,y}. B=Closure({m},T{restricted to}{x,y})−→m=t )by auto}moreover{assume {x,y}-B6={x}with or have {x,y}-B={x,y} by auto
then have x∈{x,y}-By∈{x,y}-B by autowith hB∈{{x},{y},{x,y}}i hx6=yi have False by auto}
ultimately have ∃ t∈{x,y}. B=Closure({t},T{restricted to}{x,y})∧ (∀ m∈{x,y}. B=Closure({m},T{restricted to}{x,y})−→m=t )by auto}ultimately have ∃ t∈{x,y}. B=Closure({t},T{restricted to}{x,y})∧ (∀ m∈{x,y}. B=Closure({m},T{restricted to}{x,y})−→m=t )by auto}then have (T{restricted to}{x,y}){is sober} unfolding IsSober_def
using tot by auto}
ultimately have (T{restricted to}{x,y}){is sober} by autowith hT{is anti-}IsSoberi have {x,y}{is in the spectrum of}IsSober
unfolding antiProperty_def
Susing hx∈AihA∈Tihy∈ T-Ai by auto
then have {x,y}.1 using sober_spectrum by auto
moreoverhave x∈{x,y} by auto
ultimately have {x,y}={x} using lepoll_1_is_sing[of {x,y}x] by auto
moreover have y∈{x,y} by auto
ultimately have y∈{x} by auto
then have False using hx6=yi by auto}S
then have T⊆{0, T} by autoSwith empty_open[OF topSpaceAssum] topSpaceAssum show T={0, T} unfolding IsATopology_def
by auto
qed

end

62

Topology 8

theory Topology_ZF_8 imports Topology_ZF_6 EquivClass1
begin

867

This theory deals with quotient topologies.

62.1

Definition of quotient topology

Given a surjective function f : X → Y and a topology τ in X, it is posible
to consider a special topology in Y . f is called quotient function.
definition(in topology0)
QuotientTop ({quotient
topology in}_{by}_ 80)
Swhere f∈surj( T,Y) =⇒{quotient topology in}Y{by}f≡{U∈Pow(Y). f-U∈T}
abbreviation QuotientTopTop ({quotient topology in}_{by}_{from}_)
where QuotientTopTop(Y,f,T) ≡ topology0.QuotientTop(T,Y,f)

The quotient topology is indeed a topology.
theorem(in topology0)
quotientTop_is_top:Sassumes f∈surj( T,Y)
shows ({quotient topology in} Y {by} f) {is a topology}
proof have ({quotient topology in} Y {by} f)={U ∈ Pow(Y) . f - U ∈ T} using QuotientTop_def assms
by auto moreover{
fix M x B assume
M:M ⊆ {U ∈ Pow(Y) . f - U ∈ T}S
then have
M⊆Y
byS
SblastS moreover
have A1:f - ( M)=( y∈( M). f-{y}) using vimage_eq_UN by blast{
fix A assume A∈M
with M have S
A∈Pow(Y) f - A∈T by auto
have f - A=( y∈A. f-{y}) using vimage_eq_UN by blast}
S
S
S
then have (S A∈M. f- A)=(S A∈M.
S ( y∈A. f-{y})) by auto
then have ( A∈M. f- S
A)=( Sy∈ M. f-{y}) by autowith A1 have A2:f - ( M)= {f- A. A∈M} by auto{
fix A assume A∈M
with M have f - A∈T by auto}
then have ∀ A∈M. f - A∈T by auto
then have {fS A. A∈M}⊆T by auto
then have ( {f- A. A∈M})∈T using topSpaceAssum unfolding IsATopology_def
by autoSwith A2 have (f S
- ( M))∈T by auto
ultimately have
M∈{U∈Pow(Y). f-U∈T} by auto}
moreover{fix U V assume U∈{U∈Pow(Y). f-U∈T}V∈{U∈Pow(Y). f-U∈T}868

then have U∈Pow(Y)V∈Pow(Y)f-U∈Tf-V∈T by auto
then have (f-U)∩(f-V)∈T using topSpaceAssum unfolding IsATopology_def
by autothen have f- (U∩V)∈T using invim_inter_inter_invim assms unfolding surj_def
by autowith hU∈Pow(Y)ihV∈Pow(Y)i have U∩V∈{U∈Pow(Y). f-U∈T} by auto}
ultimately show thesis using IsATopology_def by autoqed

The quotient function is continuous.
lemma (in topology0)
S quotient_func_cont:assumes f∈surj( T,Y)
shows IsContinuous(T,({quotient topology in} Y {by} f),f)
unfolding IsContinuous_def using QuotientTop_def assms by auto

One of the important properties of this topology, is that a function from thequotient space is continuous iff the composition with the quotient function
is continuous.
theorem(in two_top_spaces0)
cont_quotient_top:SSassumes h∈surj( τ 1 ,Y) g:Y→ τ 2 IsContinuous(τ 1 ,τ 2 ,g O h)shows IsContinuous(({quotient topology in} Y {by} h {from} τ 1 ),τ 2 ,g)
proof {
fix U assume U∈τ 2
with assms(3) have (g O h)-(U)∈τ 1 unfolding IsContinuous_def by auto
then have h-(g-(U))∈τ 1 using vimage_comp by auto
then have g-(U)∈({quotient topology in} Y {by} h {from} τ 1 ) using
topology0.QuotientTop_def
tau1_is_top assms(1) using func1_1_L3 assms(2) unfolding topology0_def
by auto}then show thesis unfolding IsContinuous_def by autoqed

The underlying set of the quotient topology is Y .
lemma(in topology0)
S total_quo_func:
assumesSf∈surj( T,Y)
shows ( ({quotient topology in}Y{by}f))=Y
proof S
from assms have f-Y= T using func1_1_L4 unfolding surj_def by auto
moreoverS
have
T∈T using topSpaceAssum unfolding IsATopology_def by auto ultimately
have Y∈({quotient topology in}Y{by}f{from}T) using QuotientTop_def
assms by auto
then show thesis using QuotientTop_def assms by auto
qed

869

62.2

Quotient topologies from equivalence relations

In this section we will show that the quotient topologies come from anequivalence relation.
First, some lemmas for relations.
lemma quotient_proj_fun:shows {hb,r{b}i. b∈A}:A→A//r unfolding Pi_def function_def domain_def
unfolding quotient_def by auto
lemma quotient_proj_surj:shows {hb,r{b}i. b∈A}∈surj(A,A//r)
proof {
fix y assume y∈A//rthen obtain yy where A:yy∈A y=r{yy} unfolding quotient_def by auto
then have hyy,yi∈{hb,r{b}i. b∈A} by auto
then have {hb,r{b}i. b∈A}yy=y using apply_equality[OF _ quotient_proj_fun]by autowith A(1) have ∃ yy∈A. {hb,r{b}i. b∈A}yy=y by auto}with quotient_proj_fun show thesis unfolding surj_def by autoqed
lemma preim_equi_proj:
assumes U⊆A//r equiv(A,r)
S
shows {hb,r{b}i. b∈A}-U= U
proof
{
S
fix y assume y∈ Uthen obtain V where V:y∈VV∈U by autowith hU⊆(A//r)i have y∈A using EquivClass_1_L1 assms(2) by auto moreoverfrom hU⊆(A//r)i V have r{y}=V using EquivClass_1_L2 assms(2) by auto
moreover note V(2) ultimately have y∈{x∈A. r{x}∈U} by auto
then have y∈{hb,r{b}i. b∈A}-U by auto}S
then showU⊆{hb,r{b}i. b∈A}-U by blast moreover{
fix y assume y∈{hb,r{b}i. b∈A}-U
then have yy:y∈{x∈A. r{x}∈U} by auto
then have r{y}∈U by auto moreoverfrom yy Shave y∈r{y} using assms equiv_class_self by auto ultimately
have y∈ U by auto}S
then show {hb,r{b}i. b∈A}-U⊆ U by blastqed

Now we define what a quotient topology from an equivalence relation is:870

definition(in topology0)
EquivQuo ({quotientby}_ 70)
SS
whereequiv(
T,r)=⇒({quotientby}r)≡{quotient topology in}( T)//r{by}{hb,r{b}i.
Sb∈ T}abbreviation
EquivQuoTop (_{quotient by}_ 60)
where EquivQuoTop(T,r)≡topology0.EquivQuo(T,r)

First, another description of the topology (more intuitive):
theorem (in topology0)
quotient_equiv_rel:Sassumes equiv( T,r)S
S
shows ({quotient by}r)={U∈Pow(( T)//r).
U∈T}
proof SS
S
have ({quotient
topology in}( T)//r{by}{hb,r{b}i. b∈ T})={U∈Pow(( T)//r).
S{hb,r{b}i. b∈ T}-U∈T}using QuotientTop_def
quotient_proj_surj
by auto moreover
S
S
S
S
have {U∈Pow(( T)//r). {hb,r{b}i. b∈ T}-U∈T}={U∈Pow(( T)//r).
U∈T}
proof
{
S
S
fix U assume U∈{U∈Pow((
T)//r).
S
S {hb,r{b}i. b∈ T}-U∈T}
then have U∈{U∈Pow(( T)//r).
U∈T} using preim_equi_proj assms
by auto}S
S
S
then show {U∈Pow(( T)//r). {hb,r{b}i. b∈ T}-U∈T}⊆{U∈Pow(( T)//r).
S
U∈T} by auto{
S
S
fix U assume U∈{U∈Pow((
T)//r).
U∈T}
S
S
then have U∈{U∈Pow(( T)//r). {hb,r{b}i. b∈ T}-U∈T} using preim_equi_proj
assms by auto}
S
S
SU∈T}⊆{U∈Pow(( T)//r). {hb,r{b}i.
S then show {U∈Pow(( T)//r).
b∈ T}-U∈T} by autoqed
ultimately show thesis using EquivQuo_def assms by autoqed

We apply previous results to this topology.
theorem(in topology0)
total_quo_equi:Sassumes
equiv(
T,r)
S
S
shows
({quotient by}r)=( T)//r
using total_quo_func quotient_proj_surj EquivQuo_def assms by auto
theorem(in topology0)
equiv_quo_is_top:Sassumes equiv( T,r)shows ({quotient by}r){is a topology}
using quotientTop_is_top quotient_proj_surj EquivQuo_def assms by auto

MAIN RESULT: All quotient topologies arise from an equivalence relation
871

given by the quotient function f : X → Y . This means that any quotient
topology is homeomorphic to a topology given by an equivalence relation
quotient.
theorem(in topology0)
equiv_quotient_top:Sassumes f∈surj( ST,Y)S
defines r≡{hx,yi∈ T× T. f(x)=f(y)}defines g≡{hy,f-{y}i.
y∈Y}Sshows equiv( T,r) and IsAhomeomorphism(({quotient topology in}Y{by}f),({quotientby}r),g)
proof S
have ff:f: T→Y
S using assms(1) unfolding surj_def by autoshow B:equiv( T,r) unfolding equiv_def refl_def sym_def trans_def
unfolding r_def by
S autohave gg:g:Y→(( T)//r)
proof {
fix B assume B∈gthen obtain y where
S Y:y∈Y B=hy,f-{y}i unfolding g_def by auto
then have f-{y}⊆ T using
S func1_1_L3 ff by blast
then have eq:f-{y}={x∈ T. hx,yi∈f}using vimage_iff by auto
S
from Y obtain A where A1:A∈ TfA=y using assms(1) unfolding surj_def
by blastwith eq have A:A∈f-{y} using apply_Pair[OF ff] by auto{
fix t assume t∈f-{y}SS
with A have t∈ TA∈ Tht,yi∈fhA,yi∈f using eq by auto
then have ft=fA using apply_equality assms(1) unfolding surj_def
by autoS
S
with ht∈ TihA∈ Ti have hA,ti∈r using r_def by auto
then have t∈r{A} using image_iff by auto}
then have f-{y}⊆r{A} by auto moreover{
fix t assume t∈r{A}then have hA,ti∈r
S using
S image_iff by auto
then have un:t∈ TA∈ T and eq2:ft=fA unfolding r_def by auto
moreoverfrom un have ht,fti∈f using apply_Pair[OF ff] by autowith eq2 A1 have ht,yi∈f by autowith un have t∈f-{y} using eq by auto}
then have r{A}⊆f-{y} by auto ultimately
have f-{y}=r{A} by Sauto
then have f-{y}∈ ( T)//r using A1(1) unfolding quotient_def
by autoSwith Y have B∈Y×( T)//r by auto}S
then have ∀ A∈g. A∈
S Y×( T)//r by auto
then have g⊆(Y×( T)//r) by auto moreover872then show thesis unfolding Pi_def function_def domain_def g_def
by autoqed
Sthen have gg2:g:Y→( ({quotient by}r)) using total_quo_equi B by auto{
fix s assume S:s∈({quotient topology in}Y{by}f)then have s∈Pow(Y)and P:f-s∈T using QuotientTop_def topSpaceAssumassms(1)by auto S
have f-s=( y∈s. f-{y}) using vimage_eq_UN by blast moreoverfrom hs∈Pow(Y)i have ∀ y∈s. hy,f-{y}i∈g unfolding g_def by auto
then have S∀ y∈s. gy=f-{y} using apply_equality gg by auto ultimately
have f-s=( y∈s.
S gy) by autowith P have ( y∈s. gy)∈T by auto
S moreoverfrom hs∈Pow(Y)i have ∀ y∈s. gy∈( T)//r using apply_type gg by auto
ultimately have {gy. y∈s}∈({quotient by}r) using quotient_equiv_rel
B by autowith hs∈Pow(Y)i have gs∈({quotient by}r) using func_imagedef gg by
auto}then have gopen:∀ s∈({quotient topology in}Y{by}f). gs∈(T{quotient by}r)
by autoS
S
S
have pr_fun:{hb,r{b}i. b∈ T}: T→( T)//r using quotient_proj_fun
by auto{S
fix b assume b:b∈ Thave bY:fb∈Y using apply_funtype ff b by autowith b have com:(g O f)b=g(fb) using comp_fun_apply ff by autofrom bY have pg:hfb,f-({fb})i∈g unfolding g_def by auto
then have g(fb)=f-({fb}) using apply_equality gg by autowith com have comeq:(g O f)b=f-({fb})by autoS
from b have A:f{b}={fb} {b}⊆ T using func_imagedef ff by autofrom A(2) have b∈f - (f {b}) using func1_1_L9 ff by blast
then have b∈f-({fb}) using
S A(1) by auto moreoverfrom pg have f-({fb})∈( T)//r using gg unfolding Pi_def by auto
ultimately have r{b}=f-({fb}) using EquivClass_1_L2 B by auto
then have (g O f)b=r{b} using comeq
S by auto moreoverfrom b have hb,r{b}i∈{hb,r{b}i.S b∈ T} by autowith pr_fun have {hb,r{b}i. b∈ T}b=r{b} using apply_equality by
auto ultimately
S
have (g O f)b={hb,r{b}i. b∈ T}b by auto}
S
S
then have reg:∀ b∈S T. (gS O f)b={hb,r{b}i. b∈ T}b by auto moreover
have compp:g O f∈ T→( T)//rSusing comp_fun ff gg by auto
have feq:(g O f)={hb,r{b}i. b∈ T} using fun_extension[OF compp pr_fun]
reg by auto
then have IsContinuous(T,{quotient by}r,(g O f)) using quotient_func_contquotient_proj_surj
EquivQuo_def topSpaceAssum B by auto moreover

873

S
S
have (g O f): T→ ({quotient by}r) using comp_fun ff gg2 by auto
ultimately have gcont:IsContinuous({quotient topology in}Y{by}f,{quotientby}r,g)using two_top_spaces0.cont_quotient_top assms(1) gg2 unfolding two_top_spaces0_def
using topSpaceAssum equiv_quo_is_top B by auto{
fix x y assume T:x∈Yy∈Ygx=gy
then have f-{x}=f-{y} using apply_equality gg unfolding g_def by
auto
then have f(f-{x})=f(f-{y}) by autowith T(1,2) have {x}={y} using surj_image_vimage assms(1) by auto
then have x=y by auto}Swith gg2 have g∈inj(Y, ({quotient by}r)) unfolding inj_def by auto
moreoverS
S
have g O f∈surj( T, S
( T)//r) using feq quotient_proj_surj by auto
then have g∈surj(Y,(S T)//r) using comp_mem_surjD1 ff gg by auto
then have g∈surj(Y, (T{quotientby}r)) using total_quo_equi
B by autoS
S
ultimately have g∈bij( ({quotient topology in}Y{by}f), ({quotientby}r)) unfolding bij_def using total_quo_func assms(1) by autowith gcont gopen show IsAhomeomorphism(({quotient topology in}Y{by}f),({quotientby}r),g)using bij_cont_open_homeo by autoqed
lemma product_equiv_rel_fun:
S S
S S
S
S
shows {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}:( T× T)→(( T)//r×( T)//r)
proof SS
S
have {hb,r{b}i. b∈ T}∈ T→( T)//r using quotient_proj_fun by auto
moreover S
S
have ∀ A∈ T. hA,r{A}i∈{hb,r{b}i.
b∈ T}S
S by auto
ultimately have ∀ A∈ T. {hb,r{b}i. b∈ T}A=r{A} using apply_equality
by autoS
S
then have IN: {hhb,T ×T}= {hhx,
S ci, r {b}, r {c}i . hb,ci
S ∈
S yi,
{hb,
r
{b}i
.
b
∈
T}
x,
{hb,
r
{b}i
.
b
∈
T}
yi
.
hx,yi
∈
T ×
S
T}
by forcethen show thesis using prod_fun quotient_proj_fun by autoqed

lemma(in topology0) prod_equiv_rel_surj:
S S
S
S
S
shows {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}:surj( (ProductTopology(T,T)),(( T)//r×( T)//r
proof S S
S SSShave fun:{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}:( T× T)→(( T)//r×( T)//r)
using
product_equiv_rel_fun by auto moreover{SS
fix M assume M∈(( T)//r×( T)//r)S
Sthen obtain M1 M2 where M:M=hM1,M2i M1∈( T)//rM2∈( T)//r by auto

874

S
S
then obtain m1 m2 where m:m1∈ Tm2∈ TM1=r{m1}M2=r{m2} unfolding
quotient_def
by auto
S S
then have mm:hm1,m2i∈( T× T) by auto
S S
then have hhm1,m2i,hr{m1},r{m2}ii∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
by auto
S S
then have {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}hm1,m2i=hr{m1},r{m2}iusing apply_equality fun by auto S S
then have {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}hm1,m2i=M using M(1)m(3,4) by auto
S S
S S
then have ∃ R∈( T× T). {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}R=M using mm by auto}
ultimately show thesis unfolding surj_def using Top_1_4_T1(3) topSpaceAssumby autoqed
lemma(in topology0)
product_quo_fun:Sassumes equiv( T,r)shows IsContinuous(ProductTopology(T,T),ProductTopology({quotientby}r,({quotient
S Sby}r)),{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T})
proof SS
S
have {hb,r{b}i. b∈ T}: T→( T)//r using quotient_proj_fun by auto
moreover S
S
have ∀ A∈S T. hA,r{A}i∈{hb,r{b}i.
b∈ T} by auto ultimately
S
have ∀ A∈ T. {hb,r{b}i. b∈ T}A=r{A} using apply_equality
S
S by auto
then have IN: {hhb,
ci,
r
{b},
r
{c}i
.
hb,ci
∈
T
×
T}= {hhx,
S
S
S yi,
{hb,
r
{b}i
.
b
∈
T}
x,
{hb,
r
{b}i
.
b
∈
T}
yi
.
hx,yi
∈
T ×
S
T}
by forceS
have cont:IsContinuous(T,{quotient by}r,{hb,r{b}i. b∈ T}) using quotient_func_contquotient_proj_surj
EquivQuo_def
assms by auto
S
S
have tot: (T{quotient by}r) = ( T) // r and top:({quotient by}r){is a topology} using total_quo_equi
assms by autoS
S equiv_quo_is_top
Sthen have fun:{hb,r{b}i. b∈ T}: T→ ({quotient by}r) using quotient_proj_fun
by autoS
then have two:two_top_spaces0(T,{quotient by}r,{hb,r{b}i. b∈ T}) unfolding two_top_spaces0_def using topSpaceAssum top by autoshow thesis using two_top_spaces0.product_cont_functions two fun funcont cont top topSpaceAssum IN by autoqed

The product of quotient topologies is a quotient topology given that thequotient map is open. This isn’t true in general.

theorem(in topology0)
prod_quotient:S
Sassumes equiv( T,r) ∀ A∈T. {hb,r{b}i. b∈ T}A∈({quotient by}r)shows (ProductTopology({quotientby}r,{quotient by}r)) = ({quotientS
S
S S
topology in}((( T)//r)×(( T)//r)){by}({hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}){from}(ProductTo875

proof{fix A assume A:A∈ProductTopology({quotient by}r,{quotient by}r)from assms have IsContinuous(ProductTopology(T,T),ProductTopology({quotient
S Sby}r,({quotient by}r)),{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}) using product_quo_fun
by autoS S
with A have {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}-A∈ProductTopology(T,T)
unfolding IsContinuous_def
by auto moreoverS
from A have A⊆ ProductTopology(T{quotient by}r,T{quotient by}r)
by autoS
S
then have A⊆ (T{quotient by}r)× (T{quotient by}r) using Top_1_4_T1(3)equiv_quo_is_top equiv_quo_is_top
using assms by auto
S
S
then have A∈Pow((( T)//r)×(( T)//r)) using total_quo_equi assms
by autoS
S
ultimately
have A∈({quotient topology in}((( T)//r)×(( T)//r)){by}{hhb,ci,hr{b},r{c}ii.
S S
hb,ci∈ T× T}{from}(ProductTopology(T,T)))
using topology0.QuotientTop_def Top_1_4_T1(1) topSpaceAssum prod_equiv_rel_surj
assms(1) unfolding topology0_def by auto}
then show ProductTopology(T{quotientby}r,T{quotient by}r)⊆({quotientS
S
S S
topology in}((( T)//r)×(( T)//r)){by}{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}{from}(ProductTopo
by auto{S
S
fixSA assume
A∈({quotient topology in}((( T)//r)×(( T)//r)){by}{hhb,ci,hr{b},r{c}ii.
Shb,ci∈ T× T}{from}(ProductTopology(T,T)))SSS S
then have A:A⊆(( T)//r)×(( T)//r) {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}-A∈ProductTopolo
using topology0.QuotientTop_def Top_1_4_T1(1) topSpaceAssum prod_equiv_rel_surj
assms(1) unfolding topology0_def by auto{
fix CC assume CC∈AS
Swith A(1) obtain C1 C2 where CC:CC=hC1,C2i C1∈(( T)//r)C2∈(( T)//r)
by autoS
S
then obtain c1 c2 where CC1:c1∈ Tc2∈ T and CC2:C1=r{c1}C2=r{c2}unfolding quotient_def
by auto
S S
then have hc1,c2i∈ T× T by auto
S S
then have hhc1,c2i,hr{c1},r{c2}ii∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
by autoS S
with CC2 CC have hhc1,c2i,CCi∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
by autoS S
with hCC∈Ai have hc1,c2i∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}-A
using vimage_iff by auto
with
S SA(2) have ∃ V W. V ∈ T ∧ W ∈ T ∧ V × W ⊆ {hhb,ci,hr{b},r{c}ii.
hb,ci∈ T× T}-A ∧ hc1,c2i ∈ V × W
using prod_top_point_neighb topSpaceAssum by blast
S S
then obtain V W where VW:V∈TW∈TV × W ⊆ {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}-Ac1∈Vc2∈
by autoSwith assms(2) have {hb,r{b}i. b∈ T}V∈(T{quotient by}r){hb,r{b}i.

876

Sb∈ T}W∈(T{quotient by}r) by auto
S
S
then have P:{hb,r{b}i. b∈ T}V×{hb,r{b}i. b∈ T}W∈ProductTopology(T{quotientby}r,T{quotient by}r) using prod_open_open_prod equiv_quo_is_top
assms(1) by auto{
S
S
fix S assume S∈{hb,r{b}i. b∈ T}V×{hb,r{b}i. b∈ T}WSthen obtain s1 s2 where S:S=hs1,s2is1∈{hb,r{b}i. b∈ T}Vs2∈{hb,r{b}i.
Sb∈ T}W by blastSthen obtain t1 t2 where T:ht1,s1i∈{hb,r{b}i. b∈ T}ht2,s2i∈{hb,r{b}i.
Sb∈ T}t1∈Vt2∈W using image_iff by auto
then have ht1,t2i∈V×W by auto
S S
with VW(3) have ht1,t2i∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}-A
by auto
S S
then have ∃ SS∈A. hht1,t2i,SSi∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
using vimage_iff by auto
S S
then obtain SS where SS∈Ahht1,t2i,SSi∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
by auto moreover
S S
from T VW(1,2) have ht1,t2i∈ T× Ths1,s2i=hr{t1},r{t2}i
S by
S autowith S(1) have hht1,t2i,Si∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
by autoultimately have S∈A using product_equiv_rel_fun unfolding Pi_def
function_def
by auto}S
S
then have sub:{hb,r{b}i. b∈by blast
S T}V×{hb,r{b}i. b∈ T}W⊆A
S
have hc1,C1i∈{hb,r{b}i. b∈ T}hc2,C2i∈{hb,r{b}i. b∈ T} using CC2
CC1
by autoS
S
with hc1∈Vihc2∈Wi have C1∈{hb,r{b}i. b∈ T}VC2∈{hb,r{b}i. b∈ T}W
using image_iff by auto S
Sthen have CC∈{hb,r{b}i. b∈ T}V×{hb,r{b}i. b∈ T}W using CC by
autowith sub P have ∃ OO∈ProductTopology(T{quotient by}r,T{quotientby}r). CC∈OO∧ OO⊆AS
S
using exI[where x={hb,r{b}i. b∈ T}V×{hb,r{b}i. b∈ T}W and P=λOO.
OO∈ProductTopology(T{quotient by}r,T{quotient by}r)∧ CC∈OO∧ OO⊆A]
by auto}then have ∀ C∈A. ∃ OO∈ProductTopology(T{quotient by}r,T{quotient by}r).
C∈OO∧ OO⊆A by auto
then have A∈ProductTopology(T{quotient by}r,T{quotient by}r) using topology0.open_neigh_open
unfolding topology0_def using Top_1_4_T1 equiv_quo_is_top assms
by auto}S
S
thenSshow
S ({quotient topology in}((( T)//r)×(( T)//r)){by}{hhb,ci,hr{b},r{c}ii.
hb,ci∈ T× T}{from}(ProductTopology(T,T)))⊆ProductTopology(T{quotientby}r,T{quotient by}r)
by auto

877

qed
end

63

Topology 9

theory Topology_ZF_9
imports Topology_ZF_2 Group_ZF_2 Topology_ZF_7 Topology_ZF_8
begin

63.1

Group of homeomorphisms

This theory file deals with the fact the set homeomorphisms of a topologicalspace into itself forms a group.
First, we define the set of homeomorphisms.
definition
S
S
HomeoG(T) ≡ {f: T→ T. IsAhomeomorphism(T,T,f)}

The homeomorphisms are closed by composition.

lemma (in topology0) homeo_composition:
assumes f∈HomeoG(T)g∈HomeoG(T)Sshows Composition( T)hf, gi∈HomeoG(T)proof SSS
Sfrom assms have fun:f∈ T→ Tg∈ T→ T and homeo:IsAhomeomorphism(T,T,f)IsAhomeomorphis
unfolding HomeoG_def
by autoS
S
from fun have f O g∈ T→ ST using
comp_funS
S by
S auto moreoverfrom homeo have bij:f∈bij( T, T)g∈bij( T, T) and cont:IsContinuous(T,T,f)IsContinuou
and contconv:
IsContinuous(T,T,converse(f))IsContinuous(T,T,converse(g)) unfolding IsAhomeomorphism_def bySauto
S
from bij have f O g∈bij( T, T) using comp_bij by auto moreoverfrom cont have IsContinuous(T,T,f O g) using comp_cont by auto moreover
have converse(f O g)=converse(g) O converse(f) using converse_comp by
autowith contconv have IsContinuous(T,T,converse(f O g)) using comp_contby auto ultimately
have f O g∈HomeoG(T) unfolding HomeoG_def IsAhomeomorphism_def by auto
then show thesis using func_ZF_5_L2 fun by autoqed

The identity function is a homeomorphism.
lemma (in topology0)
homeo_id:S
shows id( T)∈HomeoG(T)proof -

878

S
S
S
have converse(id( T)) O id( T)=id( T) using left_comp_inverse id_bij
by autoS
S
then have converse(id( T))=id( T) using right_comp_id by auto
then show thesis unfolding HomeoG_def IsAhomeomorphism_def using id_cont
id_type id_bij
by autoqed

The homeomorphisms form a monoid and its neutral element is the identity.
theorem (in topology0) homeo_submonoid:
S
shows IsAmonoid(HomeoG(T),restrict(Composition( T),HomeoG(T)×HomeoG(T)))

S
S
TheNeutralElement(HomeoG(T),restrict(Composition( T),HomeoG(T)×HomeoG(T)))=id( T)proof S
have cl:HomeoG(T) {is closed under} Composition( T) unfolding IsOpClosed_def
using homeo_composition by auto S
S
moreover have sub:HomeoG(T)⊆ T→ T unfolding HomeoG_def by auto
moreoverS
S
S
have ne:TheNeutralElement( T→ T, Composition( T))∈HomeoG(T) using homeo_id Group_ZF_2_5_L2(2) by autoS
ultimately show IsAmonoid(HomeoG(T),restrict(Composition( T),HomeoG(T)×HomeoG(T)))
using Group_ZF_2_5_L2(1)monoid0.group0_1_T1 unfolding monoid0_def by force
S
from cl sub
S ne have TheNeutralElement(HomeoG(T),restrict(Composition( T),HomeoG(T)×Homeo
Composition( T))using Group_ZF_2_5_L2(1)group0_1_L6
SS
S by blast moreoverS
have id( T)=TheNeutralElement( T→ T, Composition( T)) using Group_ZF_2_5_L2(2)by autoS
ultimately show TheNeutralElement(HomeoG(T),restrict(Composition( T),HomeoG(T)×HomeoG(T)by autoqed

The homeomorphisms form a group, with the composition.
theorem(in topology0) homeo_group:
S
shows IsAgroup(HomeoG(T),restrict(Composition( T),HomeoG(T)×HomeoG(T)))
proof {
fix x assume AS:x∈HomeoG(T)S S
S S
then have surj:x∈surj( T, T) and bij:x∈bij( T, T) unfolding HomeoG_def
IsAhomeomorphism_def bij_def by auto
S S
from bij have converse(x)∈bij( T, T) using bij_converse_bij by
auto
S
S
S
S
with bij have conx_fun:converse(x)∈ T→ Tx∈ T→ T unfolding bij_def
inj_def by auto
S
from surj have id:x O converse(x)=id( T) using right_comp_inverseby autoS
from conx_fun have Composition( T)hx,converse(x)i=x O converse(x)using func_ZF_5_L2 by auto
S
S
with id have Composition( T)hx,converse(x)i=id( T) by auto879

moreover have converse(x)∈HomeoG(T) unfolding HomeoG_def using conx_fun(1)homeo_inv AS unfolding HomeoG_def
by autoS
S
ultimately have ∃ M∈HomeoG(T). Composition( T)hx,Mi=id( T) by auto}
S
S
then have ∀ x∈HomeoG(T). ∃ M∈HomeoG(T). Composition( T)hx,Mi=id( T)by autothen show thesis using homeo_submonoid definition_of_group by auto
qed

63.2

Examples computed

As a first example, we show that the group of homeomorphisms of the cocardinal topology is the group of bijective functions.
theorem homeo_cocardinal:assumes InfCard(Q)shows HomeoG(CoCardinal(X,Q))=bij(X,X)
prooffrom assms have n:Q6=0 unfolding InfCard_def by auto
then show HomeoG(CoCardinal(X,Q)) ⊆ bij(X, X) unfolding HomeoG_def
IsAhomeomorphism_def
using union_cocardinal by auto{
fix f assume a:f∈bij(X,X)
then have converse(f)∈bij(X,X) using bij_converse_bij by auto
then have cinj:converse(f)∈inj(X,X) unfolding bij_def by autofrom a have fun:f∈X→X unfolding bij_def inj_def by auto
then have two:two_top_spaces0((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)
unfolding two_top_spaces0_def
using union_cocardinal assms n CoCar_is_topology by auto{
fix N assume N{is closed in}(CoCardinal(X,Q))
then have N_def:N=X ∨ (N∈Pow(X) ∧ N≺Q) using closed_sets_cocardinaln by auto
then have restrict(converse(f),N)∈bij(N,converse(f)N) using cinj
restrict_bij by auto
then have N≈f-N unfolding vimage_def eqpoll_def by auto
then have f-N≈N using eqpoll_sym by autowith N_def have N=X ∨ (f-N≺Q ∧ N∈Pow(X)) using eq_lesspoll_transby autowith fun have f-N=X ∨ (f-N≺Q ∧ (f-N)∈Pow(X)) using func1_1_L3
func1_1_L4 by auto
then have f-N {is closed in}(CoCardinal(X,Q)) using closed_sets_cocardinaln by auto}
then have ∀ N. N{is closed in}(CoCardinal(X,Q)) −→ f-N {is closedin}(CoCardinal(X,Q)) by auto
then have IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),f) using two_top_spaces0.Top_ZF_2_1_L4880

two_top_spaces0.Top_ZF_2_1_L3 two_top_spaces0.Top_ZF_2_1_L2 two
by auto}then have ∀ f∈bij(X,X). IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)
by autothen have ∀ f∈bij(X,X). IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)∧ IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),converse(f))
using bij_converse_bij by auto
then have ∀ f∈bij(X,X). IsAhomeomorphism((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)
unfolding IsAhomeomorphism_def
using n union_cocardinal by auto
then show bij(X,X)⊆HomeoG((CoCardinal(X,Q))) unfolding HomeoG_def bij_def
inj_def using n union_cocardinalby autoqed

The group of homeomorphism of the excluded set is a direct product of thebijections on X \ T and the bijections on X ∩ T .

theorem homeo_excluded:
shows HomeoG(ExcludedSet(X,T))={f∈bij(X,X). f(X-T)=(X-T)}
proof
have sub1:X-T⊆X by auto{
fix g assume g∈HomeoG(ExcludedSet(X,T))
then have fun:g:X→X and bij:g∈bij(X,X) and hom:IsAhomeomorphism((ExcludedSet(X,T)),(Eunfolding HomeoG_def
using union_excludedset unfolding IsAhomeomorphism_def by auto{
assume A:g(X-T)=X and B:X∩T6=0
have rfun:restrict(g,X-T):X-T→X using fun restrict_fun sub1 byauto moreoverfrom A fun have {gaa. aa∈X-T}=X using func_imagedef sub1 by auto
then have ∀ x∈X. x∈{gaa. aa∈X-T} by auto
then have ∀ x∈X. ∃ aa∈X-T. x=gaa by auto
then have ∀ x∈X. ∃ aa∈X-T. x=restrict(g,X-T)aa by autowith A have surj:restrict(g,X-T)∈surj(X-T,X) using rfun unfolding surj_def by autofrom B obtain d where d∈Xd∈T by autowith bij have gd∈X using apply_funtype unfolding bij_def inj_def
by autothen obtain s where restrict(g,X-T)s=gds∈X-T using surj unfolding surj_def by blast
then have gs=gd by autowith hd∈Xihs∈X-Ti have s=d using bij unfolding bij_def inj_def by
auto
then have False using hs∈X-Ti hd∈Ti by auto}
then have g(X-T)=X −→ X∩T=0 by auto
then have reg:g(X-T)=X −→ X-T=X by auto881

then have g(X-T)=X −→ g(X-T)=X-T by auto
then have g(X-T)=X −→ g∈{f∈bij(X,X). f(X-T)=(X-T)} using bij byauto moreover{
fix ggassume A:gg(X-T)6=X and hom2:IsAhomeomorphism((ExcludedSet(X,T)),(ExcludedSet(X,T)),g
from hom2 have fun:gg∈X→X and bij:gg∈bij(X,X) unfolding IsAhomeomorphism_def
bij_def inj_def using
S union_excludedset by auto
have sub:X-T⊆ (ExcludedSet(X,T)) using union_excludedset by autowith hom2 have gg(Interior(X-T,(ExcludedSet(X,T))))=Interior(gg(X-T),(ExcludedSet(X,Tusing int_top_invariant by auto moreoverfrom sub1 have Interior(X-T,(ExcludedSet(X,T)))=X-T using interior_set_excludedset
by autoultimately have gg(X-T)=Interior(gg(X-T),(ExcludedSet(X,T))) byauto moreover
have ss:gg(X-T)⊆X using fun func1_1_L6(2) by auto
then have Interior(gg(X-T),(ExcludedSet(X,T))) = (gg(X-T))-T using interior_set_excludedset A
by autoultimately have eq:gg(X-T)=(gg(X-T))-T by auto{
assume (gg(X-T))∩T6=0
then obtain t where t∈T and im:t∈gg(X-T) by blast
then have t∈(gg(X-T))-T/
by autothen have False using eq im by auto}
then have (gg(X-T))∩T=0 by auto
then have gg(X-T)⊆X-T using ss by blast}
then have ∀ gg. gg(X-T)6=X ∧ IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),gg)−→
gg(X-T)⊆X-T by auto moreoverfrom bij have conbij:converse(g)∈bij(X,X) using bij_converse_bij
by autothen have confun:converse(g)∈X→X unfolding bij_def inj_def by auto{
assume A:converse(g)(X-T)=X and B:X∩T6=0
have rfun:restrict(converse(g),X-T):X-T→X using confun restrict_fun
sub1 by auto moreoverfrom A confun have {converse(g)aa. aa∈X-T}=X using func_imagedef
sub1 by auto
then have ∀ x∈X. x∈{converse(g)aa. aa∈X-T} by auto
then have ∀ x∈X. ∃ aa∈X-T. x=converse(g)aa by auto
then have ∀ x∈X. ∃ aa∈X-T. x=restrict(converse(g),X-T)aa by autowith A have surj:restrict(converse(g),X-T)∈surj(X-T,X) using rfun
unfolding surj_def by autofrom B obtain d where d∈Xd∈T by autowith conbij have converse(g)d∈X using apply_funtype unfolding bij_def
inj_def by auto
then obtain s where restrict(converse(g),X-T)s=converse(g)ds∈X-T882

using surj unfolding surj_def by blast
then have converse(g)s=converse(g)d by autowith hd∈Xihs∈X-Ti have s=d using conbij unfolding bij_def inj_def
by autothen have False using hs∈X-Ti hd∈Ti by auto}
then have converse(g)(X-T)=X −→ X∩T=0 by auto
then have converse(g)(X-T)=X −→ X-T=X by auto
then have converse(g)(X-T)=X −→ g-(X-T)=(X-T) unfolding vimage_def
by autothen have G:converse(g)(X-T)=X −→ g(g-(X-T))=g(X-T) by auto
have GG:g(g-(X-T))=(X-T) using sub1 surj_image_vimage bij unfolding bij_def by autowith G have converse(g)(X-T)=X −→ g(X-T)=X-T by auto
then have converse(g)(X-T)=X −→ g∈{f∈bij(X,X). f(X-T)=(X-T)} using bij by auto moreoverfrom hom have IsAhomeomorphism(ExcludedSet(X,T), ExcludedSet(X,T),
converse(g)) using homeo_inv by auto
moreover note hom ultimately have g∈{f∈bij(X,X). f(X-T)=(X-T)} ∨(g(X-T)⊆X-T ∧ converse(g)(X-T)⊆X-T)
by forcethen have g∈{f∈bij(X,X). f(X-T)=(X-T)} ∨ (g(X-T)⊆X-T ∧ g-(X-T)⊆X-T)
unfolding vimage_def by auto moreover
have g-(X-T)⊆X-T −→ g(g-(X-T))⊆g(X-T) using func1_1_L8 by autowith GG have g-(X-T)⊆X-T −→ (X-T)⊆g(X-T) by force
ultimately have g∈{f∈bij(X,X). f(X-T)=(X-T)} ∨ (g(X-T)⊆X-T ∧ (X-T)⊆g(X-T))
by autothen have g∈{f∈bij(X,X). f(X-T)=(X-T)} using bij by auto}
then show HomeoG(ExcludedSet(X,T))⊆{f∈bij(X,X). f(X-T)=(X-T)} by auto{
fix g assume as:g∈bij(X,X)g(X-T)=X-T
then have inj:g∈inj(X,X) and im:g-(g(X-T))=g-(X-T) unfolding bij_def
by autofrom inj have g-(g(X-T))=X-T using inj_vimage_image sub1 by force
with im have as_3:g-(X-T)=X-T by auto{
fix A
assume A∈(ExcludedSet(X,T))
then have A=X∨A∩T=0 A⊆X unfolding ExcludedSet_def by auto
then have A⊆X-T∨A=X by auto moreover{
assume A=X
with as(1) have gA=X using surj_range_image_domain unfolding bij_def
by auto}moreover{assume A⊆X-T

883

then have gA⊆g(X-T) using func1_1_L8 by auto
then have gA⊆(X-T) using as(2) by auto}
ultimately have gA⊆(X-T) ∨ gA=X by auto
then have gA∈(ExcludedSet(X,T)) unfolding ExcludedSet_def by auto}
then have ∀ A∈(ExcludedSet(X,T)). gA∈(ExcludedSet(X,T)) by auto moreover{
fix A assume A∈(ExcludedSet(X,T))
then have A=X∨A∩T=0 A⊆X unfolding ExcludedSet_def by auto
then have A⊆X-T∨A=X by auto moreover{
assume A=X
with as(1) have g-A=X using func1_1_L4 unfolding bij_def inj_def
by auto}moreover{assume A⊆X-T
then have g-A⊆g-(X-T) using func1_1_L8 by auto
then have g-A⊆(X-T) using as_3 by auto}
ultimately have g-A⊆(X-T) ∨ g-A=X by auto
then have g-A∈(ExcludedSet(X,T)) unfolding ExcludedSet_def by auto}
then have IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),g) unfolding IsContinuous_def by auto moreovernote as(1) ultimately have IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),g)
using union_excludedset bij_cont_open_homeo by autowith as(1) have g∈HomeoG(ExcludedSet(X,T)) unfolding bij_def inj_def
HomeoG_def using union_excludedset by auto}
then show {f ∈ bij(X, X) . f (X - T) = X - T} ⊆ HomeoG(ExcludedSet(X,T))
by autoqed

We now give some lemmas that will help us compute HomeoG(IncludedSet(X,T)).
lemma cont_in_cont_ex:
assumes IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f) f:X→X T⊆Xshows IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)
proof from assms(2,3) have two:two_top_spaces0(IncludedSet(X,T),IncludedSet(X,T),f)
using union_includedset includedset_is_topology
unfolding two_top_spaces0_def by auto{
fix A assume A∈(ExcludedSet(X,T))
then have A∩T=0 ∨ A=XA⊆X unfolding ExcludedSet_def by auto884

then have A{is closed in}(IncludedSet(X,T)) using closed_sets_includedset
assms by auto
then have f-A{is closed in}(IncludedSet(X,T)) using two_top_spaces0.TopZF_2_1_L1
assms(1)two assms includedset_is_topology by auto
then have (f-A)∩T=0 ∨ f-A=Xf-A⊆X using closed_sets_includedset assms(1,3)
by autothen have f-A∈(ExcludedSet(X,T)) unfolding ExcludedSet_def by auto}
then show IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f) unfolding IsContinuous_def by autoqed
lemma cont_ex_cont_in:
assumes IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f) f:X→X T⊆Xshows IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)
proof from assms(2) have two:two_top_spaces0(ExcludedSet(X,T),ExcludedSet(X,T),f)
using union_excludedset excludedset_is_topology
unfolding two_top_spaces0_def by auto{
fix A assume A∈(IncludedSet(X,T))
then have T⊆A ∨ A=0A⊆X unfolding IncludedSet_def by auto
then have A{is closed in}(ExcludedSet(X,T)) using closed_sets_excludedset
assms by auto
then have f-A{is closed in}(ExcludedSet(X,T)) using two_top_spaces0.TopZF_2_1_L1
assms(1)two assms excludedset_is_topology by auto
then have T⊆(f-A) ∨ f-A=0f-A⊆X using closed_sets_excludedset assms(1,3)
by autothen have f-A∈(IncludedSet(X,T)) unfolding IncludedSet_def by auto}
then show IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f) unfolding IsContinuous_def by autoqed

The previous lemmas imply that the group of homeomorphisms of the included set topology is the same as the one of the excluded set topology.
lemma homeo_included:
assumes T⊆Xshows HomeoG(IncludedSet(X,T))={f ∈ bij(X, X) . f (X - T) = X - T}
proof {
fix f assume f∈HomeoG(IncludedSet(X,T))
then have hom:IsAhomeomorphism(IncludedSet(X,T),IncludedSet(X,T),f)
and fun:f∈X→X andbij:f∈bij(X,X) unfolding HomeoG_def IsAhomeomorphism_def using union_includedset
assms by auto
then have cont:IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)885

unfolding IsAhomeomorphism_def by auto
then have IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f) using
cont_in_cont_ex fun assms by auto moreover{from hom have cont1:IsContinuous(IncludedSet(X,T),IncludedSet(X,T),converse(f))
unfolding IsAhomeomorphism_def by auto moreover
have converse(f):X→X using bij_converse_bij bij unfolding bij_def
inj_def by auto moreovernote assms ultimately
have IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),converse(f))
using cont_in_cont_ex assms by auto}
then have IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),converse(f))
by automoreover note bij ultimately
have IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),f) unfolding IsAhomeomorphism_def
using union_excludedset by autowith fun have f∈HomeoG(ExcludedSet(X,T)) unfolding HomeoG_def using union_excludedset by auto}
then have HomeoG(IncludedSet(X,T))⊆HomeoG(ExcludedSet(X,T)) by auto
moreover{fix f assume f∈HomeoG(ExcludedSet(X,T))
then have hom:IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),f)
and fun:f∈X→X andbij:f∈bij(X,X) unfolding HomeoG_def IsAhomeomorphism_def using union_excludedset
assms by auto
then have cont:IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)
unfolding IsAhomeomorphism_def by auto
then have IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f) using
cont_ex_cont_in fun assms by auto moreover{from hom have cont1:IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),converse(f))
unfolding IsAhomeomorphism_def by auto moreover
have converse(f):X→X using bij_converse_bij bij unfolding bij_def
inj_def by auto moreovernote assms ultimately
have IsContinuous(IncludedSet(X,T),IncludedSet(X,T),converse(f))
using cont_ex_cont_in assms by auto}
then have IsContinuous(IncludedSet(X,T),IncludedSet(X,T),converse(f))
by automoreover note bij ultimately
have IsAhomeomorphism(IncludedSet(X,T),IncludedSet(X,T),f) unfolding IsAhomeomorphism_def
using union_includedset assms by autowith fun have f∈HomeoG(IncludedSet(X,T)) unfolding HomeoG_def us-

886

ing union_includedset assms by auto}
then have HomeoG(ExcludedSet(X,T))⊆HomeoG(IncludedSet(X,T)) by auto
ultimately
show thesis using homeo_excluded by auto
qed

Finally, let’s compute part of the group of homeomorphisms of an order
topology.
lemma homeo_order:
assumes IsLinOrder(X,r)∃ x y. x6=y∧x∈X∧y∈X
shows ord_iso(X,r,X,r)⊆HomeoG(OrdTopology X r)
proof
fix f assume f∈ord_iso(X,r,X,r)then have bij:f∈bij(X,X) and ord:∀ x∈X. ∀ y∈X. hx, yi ∈ r ←→ hf x,
f yi ∈ r
unfolding ord_iso_def by auto
have twoSpac:two_top_spaces0(OrdTopology X r,OrdTopology X r,f) unfolding two_top_spaces0_def
using bij unfolding bij_def inj_def using union_ordtopology[OF assms]
Ordtopology_is_a_topology(1)[OF assms(1)]by auto{fix c d assume A:c∈Xd∈X{
fix x assume AA:x∈Xx6=cx6=dhc,xi∈rhx,di∈rthen have hfc,fxi∈rhfx,fdi∈r using A(2,1) ord by auto moreover{
assume fx=fc ∨ fx=fd
then have x=c∨x=d using bij unfolding bij_def inj_def using A(2,1)
AA(1) by auto
then have False using AA(2,3) by auto}
then have fx6=fcfx6=fd by auto moreover
have fx∈X using bij unfolding bij_def inj_def using apply_type
AA(1) by auto
ultimately have fx∈IntervalX(X,r,fc,fd) unfolding IntervalX_def
Interval_def by auto}
then have {fx. x∈IntervalX(X,r,c,d)}⊆IntervalX(X,r,fc,fd) unfolding IntervalX_def Interval_def by auto
moreover{fix y assume y∈IntervalX(X,r,fc,fd)
then have y:y∈Xy6=fcy6=fdhfc,yi∈rhy,fdi∈r unfolding IntervalX_def
Interval_def by auto
then obtain s where s:s∈Xy=fs using bij unfolding bij_def surj_def
by auto{887

assume s=c∨s=dthen have fs=fc∨fs=fd by auto
then have False using s(2) y(2,3) by auto}
then have s6=cs6=d by auto moreover
have hc,si∈rhs,di∈r using y(4,5) s ord A(2,1) by auto moreovernote s(1) ultimately have s∈IntervalX(X,r,c,d) unfolding IntervalX_def
Interval_def by auto
then have y∈{fx. x∈IntervalX(X,r,c,d)} using s(2) by auto}
ultimately have {fx. x∈IntervalX(X,r,c,d)}=IntervalX(X,r,fc,fd) byauto moreover
have IntervalX(X,r,c,d)⊆X unfolding IntervalX_def by auto moreover
have f:X→X using bij unfolding bij_def surj_def by auto ultimately
have fIntervalX(X,r,c,d)=IntervalX(X,r,fc,fd) using func_imagedef
by auto}then have inter:∀ c∈X. ∀ d∈X. fIntervalX(X,r,c,d)=IntervalX(X,r,fc,fd)∧ fc∈X ∧ fd∈X using bij
unfolding bij_def inj_def by auto{
fix c assume A:c∈X{
fix x assume AA:x∈Xx6=chc,xi∈rthen have hfc,fxi∈r using A ord by auto moreover{
assume fx=fc
then have x=c using bij unfolding bij_def inj_def using A AA(1)by autothen have False using AA(2) by auto}
then have fx6=fc by auto moreover
have fx∈X using bij unfolding bij_def inj_def using apply_type
AA(1) by auto
ultimately have fx∈RightRayX(X,r,fc) unfolding RightRayX_def by
auto}
then have {fx. x∈RightRayX(X,r,c)}⊆RightRayX(X,r,fc) unfolding RightRayX_def
by automoreover{fix y assume y∈RightRayX(X,r,fc)
then have y:y∈Xy6=fchfc,yi∈r unfolding RightRayX_def by auto
then obtain s where s:s∈Xy=fs using bij unfolding bij_def surj_def
by auto{assume s=c
then have fs=fc by auto888

then have False using s(2) y(2) by auto}
then have s6=c by auto moreover
have hc,si∈r using y(3) s ord A by auto moreovernote s(1) ultimately have s∈RightRayX(X,r,c) unfolding RightRayX_def
by autothen have y∈{fx. x∈RightRayX(X,r,c)} using s(2) by auto}
ultimately have {fx. x∈RightRayX(X,r,c)}=RightRayX(X,r,fc) by auto
moreoverhave RightRayX(X,r,c)⊆X unfolding RightRayX_def by auto moreover
have f:X→X using bij unfolding bij_def surj_def by auto ultimately
have fRightRayX(X,r,c)=RightRayX(X,r,fc) using func_imagedef by auto}
then have rray:∀ c∈X. fRightRayX(X,r,c)=RightRayX(X,r,fc) ∧ fc∈X using bij
unfolding bij_def inj_def by auto{
fix c assume A:c∈X{
fix x assume AA:x∈Xx6=chx,ci∈rthen have hfx,fci∈r using A ord by auto moreover{
assume fx=fc
then have x=c using bij unfolding bij_def inj_def using A AA(1)by autothen have False using AA(2) by auto}
then have fx6=fc by auto moreover
have fx∈X using bij unfolding bij_def inj_def using apply_type
AA(1) by auto
ultimately have fx∈LeftRayX(X,r,fc) unfolding LeftRayX_def by auto}
then have {fx. x∈LeftRayX(X,r,c)}⊆LeftRayX(X,r,fc) unfolding LeftRayX_def
by automoreover{fix y assume y∈LeftRayX(X,r,fc)
then have y:y∈Xy6=fchy,fci∈r unfolding LeftRayX_def by auto
then obtain s where s:s∈Xy=fs using bij unfolding bij_def surj_def
by auto{assume s=c
then have fs=fc by auto
then have False using s(2) y(2) by auto}
then have s6=c by auto moreover
have hs,ci∈r using y(3) s ord A by auto moreovernote s(1) ultimately have s∈LeftRayX(X,r,c) unfolding LeftRayX_def889

by auto
then have y∈{fx. x∈LeftRayX(X,r,c)} using s(2) by auto}
ultimately have {fx. x∈LeftRayX(X,r,c)}=LeftRayX(X,r,fc) by auto
moreoverhave LeftRayX(X,r,c)⊆X unfolding LeftRayX_def by auto moreover
have f:X→X using bij unfolding bij_def surj_def by auto ultimately
have fLeftRayX(X,r,c)=LeftRayX(X,r,fc) using func_imagedef by auto}
then have lray:∀ c∈X. fLeftRayX(X,r,c)=LeftRayX(X,r,fc)∧fc∈X usingbij
unfolding bij_def inj_def by auto
have r1:∀ U∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X, r,b) . b ∈ X} ∪{RightRayX(X, r, b) . b ∈ X}. fU∈({IntervalX(X, r, b, c) . hb,ci ∈X × X} ∪ {LeftRayX(X, r, b) . b ∈ X} ∪{RightRayX(X, r, b) . b ∈ X}) apply safe prefer 3 using rray apply
blast prefer 2 using lray apply blast
using inter apply auto
proof fix xa y assume xa∈Xy∈X
then have fxa∈Xfy∈X using bij unfolding bij_def inj_def by auto
then show ∃ x∈X. ∃ ya∈X. IntervalX(X, r, f xa, f y) = IntervalX(X,r, x, ya) by autoqed
have r2:{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X, r, b). b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X}⊆(OrdTopology X r)
using base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]]by blast{
fix U assume U∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X}
with r1 have fU∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X}
by autowith r2 have fU∈(OrdTopology X r) by blast}
then have ∀ U∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪{RightRayX(X, r, b) . b ∈ X}. fU∈(OrdTopology X r) by blast
then have f_open:∀ U∈(OrdTopology X r). fU∈(OrdTopology X r) using two_top_spaces0.base_i
twoSpac Ordtopology_is_a_topology(2)[OF assms(1)]]by auto{fix c d assume A:c∈Xd∈X
then obtain cc dd where pre:fcc=cfdd=dcc∈Xdd∈X using bij unfolding bij_def surj_def by blast
with inter have f IntervalX(X, r, cc, dd) = IntervalX(X, r, c,d) by auto890

then have f-(fIntervalX(X, r, cc, dd)) = f-(IntervalX(X, r, c, d))by automoreoverhave IntervalX(X, r, cc, dd)⊆X unfolding IntervalX_def by auto moreover
have f∈inj(X,X) using bij unfolding bij_def by auto ultimately
have IntervalX(X, r, cc, dd)=f-IntervalX(X, r, c, d) using inj_vimage_image
by automoreoverfrom pre(3,4) have IntervalX(X, r, cc, dd)∈{IntervalX(X,r,e1,e2).
he1,e2i∈X×X} by auto
ultimately have f-IntervalX(X, r, c, d)∈(OrdTopology X r) using
base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by
auto}
then have inter:∀ c∈X. ∀ d∈X. f-IntervalX(X, r, c, d)∈(OrdTopology
X r) by auto{
fix c assume A:c∈X
then obtain cc where pre:fcc=ccc∈X using bij unfolding bij_def surj_def
by blastwith rray have f RightRayX(X, r, cc) = RightRayX(X, r, c) by auto
then have f-(fRightRayX(X, r, cc)) = f-(RightRayX(X, r, c)) by auto
moreoverhave RightRayX(X, r, cc)⊆X unfolding RightRayX_def by auto moreover
have f∈inj(X,X) using bij unfolding bij_def by auto ultimately
have RightRayX(X, r, cc)=f-RightRayX(X, r, c) using inj_vimage_image
by automoreoverfrom pre(2) have RightRayX(X, r, cc)∈{RightRayX(X,r,e2). e2∈X} by
auto
ultimately have f-RightRayX(X, r, c)∈(OrdTopology X r) using
base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by
auto}
then have rray:∀ c∈X. f-RightRayX(X, r, c)∈(OrdTopology X r) by auto{
fix c assume A:c∈X
then obtain cc where pre:fcc=ccc∈X using bij unfolding bij_def surj_def
by blastwith lray have f LeftRayX(X, r, cc) = LeftRayX(X, r, c) by auto
then have f-(fLeftRayX(X, r, cc)) = f-(LeftRayX(X, r, c)) by auto
moreoverhave LeftRayX(X, r, cc)⊆X unfolding LeftRayX_def by auto moreover
have f∈inj(X,X) using bij unfolding bij_def by auto ultimately
have LeftRayX(X, r, cc)=f-LeftRayX(X, r, c) using inj_vimage_image891

by auto
moreoverfrom pre(2) have LeftRayX(X, r, cc)∈{LeftRayX(X,r,e2). e2∈X} by
auto
ultimately have f-LeftRayX(X, r, c)∈(OrdTopology X r) using
base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by
auto}
then have lray:∀ c∈X. f-LeftRayX(X, r, c)∈(OrdTopology X r) by auto{
fix U assume U∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X}
with lray inter rray have f-U∈(OrdTopology X r) by auto}
then have ∀ U∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X}.
f-U∈(OrdTopology X r) by blast
then have fcont:IsContinuous(OrdTopology X r,OrdTopology X r,f) using two_top_spaces0.Top_ZF_2_1_L5[OF twoSpac
Ordtopology_is_a_topology(2)[OF assms(1)]] by autofrom fcont f_open bij have IsAhomeomorphism(OrdTopology X r,OrdTopology
X r,f) using bij_cont_open_homeo
union_ordtopology[OF assms] by auto
then show f∈HomeoG(OrdTopology X r) unfolding HomeoG_def using bij
union_ordtopology[OF assms]
unfolding bij_def inj_def by autoqedThis last example shows that order isomorphic sets give homeomorphic topological spaces.

63.3

Properties preserved by functions

The continuous image of a connected space is connected.
theorem (in two_top_spaces0) cont_image_conn:
assumes IsContinuous(τ 1 ,τ 2 ,f) f∈surj(X1 ,X2 ) τ 1 {is connected}
shows τ 2 {is connected}
proof {
fix U
assume Uop:U∈τ 2 and Ucl:U{is closed in}τ 2from Uop assms(1) have f-U∈τ 1 unfolding IsContinuous_def by auto
moreoverfrom Ucl assms(1) have f-U{is closed in}τ 1 using TopZF_2_1_L1 by
auto ultimately
S
have disj:f-U=0 ∨ f-U= τ 1 using assms(3) unfolding IsConnected_def
by auto moreover{892

assume as:f-U6=0
then have U6=0 using func1_1_L13
by autoS
from as disj have f-U=
τ
by
auto
1
S
then have
S f(f-U)=f( τ 1 ) by auto moreover
have U⊆ S
τ 2 using Uop by blast ultimately
have U=f( Sτ 1 ) using surj_image_vimage assms(2) Uop by force
then haveτ 2 =U using surj_range_image_domain assms(2) by auto}
moreover{assume as:U6=0
S
from Uop have s:U⊆ τ 2 by autowith as obtain S
u where uU:u∈U by autowith s have u∈ τ 2 by autoSwith assms(2) obtain w where fw=uw∈ τ 1 unfolding surj_def X1_def
X2_def by blast
with uU have w∈f-U using func1_1_L15 assms(2) unfolding surj_def
by autothen have f-U6=0 by auto}S
ultimately have U=0∨U= τ 2 by auto}
then show thesis unfolding IsConnected_def by autoqed

Every continuous function from a space which has some property P and aspace which has the property anti(P), given that this property is preservedby continuous functions, if follows that the range of the function is in the
spectrum. Applied to connectedness, it follows that continuous functions
from a connected space to a totally-disconnected one are constant.

corollary(in two_top_spaces0) cont_conn_tot_disc:assumes IsContinuous(τ 1 ,τ 2 ,f) τ 1 {is connected} τ 2 {is totally-disconnected}
f:X1 →X2 X1 6=0
shows ∃ q∈X2 . ∀ w∈X1 . f(w)=q
proof from assms(4) have surj:f∈surj(X1 ,range(f)) using fun_is_surj by auto
have sub:range(f)⊆X2 using func1_1_L5B assms(4) by autofrom assms(1) have cont:IsContinuous(τ 1 ,τ 2 {restricted to}range(f),f)
using restr_image_cont range_image_domain
assms(4) by
S autohave union: (τ 2 {restricted to}range(f))=range(f) unfolding RestrictedTo_def
using sub by auto
then have two_top_spaces0(τ 1 ,τ 2 {restricted to}range(f),f) unfolding
two_top_spaces0_def
using surj unfolding surj_def using tau1_is_top topology0.Top_1_L4
unfolding topology0_def using tau2_is_top
by autothen have conn:(τ 2 {restricted to}range(f)){is connected} using two_top_spaces0.cont_image
surj assms(2) cont893

union by auto
then have range(f){is in the spectrum of}IsConnected using assms(3)sub unfolding IsTotDis_def antiProperty_def
using union by auto
then have range(f).1 using conn_spectrum by auto moreoverfrom assms(5) have fX1 6=0 using func1_1_L15A assms(4) by auto
then have range(f)6=0 using range_image_domain assms(4) by auto
ultimately obtain q where uniq:range(f)={q} using lepoll_1_is_singby blast{
fix w assume w∈X1
then have fw∈range(f) using func1_1_L5A(2) assms(4) by autowith uniq have fw=q by auto}
then have ∀ w∈X1 . fw=q by auto
then show thesis using uniq sub by autoqed

The continuous image of a compact space is compact.
theorem (in two_top_spaces0) cont_image_com:
assumes IsContinuous(τ 1 ,τ 2 ,f) f∈surj(X1 ,X2 ) X1 {is compact of cardinal}K{in}τ 1
shows X2 {is compact of cardinal}K{in}τ 2
proof S
have X2 ⊆ τ 2 by auto moreover{S
fix U assume as:X2 ⊆ U U⊆τ 2then have P:{f-V. V∈U}⊆τ 1 using assms(1) unfolding IsContinuous_def
by autoS
from as(1) have f-X2 ⊆ f-( U)
S by blast
then have f-X2 ⊆ converse(f)( U) unfolding vimage_def by auto moreoverS
S
have converse(f)( U)=( V∈U. converse(f)V) using image_UN by force
ultimately
S
have f-X2 ⊆ ( V∈U.S converse(f)V) by auto
then have f-X2 ⊆S( V∈U. f-V) unfolding vimage_def by auto
then have X1 ⊆ ( V∈U. f-V) using func1_1_L4 assms(2) unfolding surj_def
by forceS
then have X1 ⊆{f-V. V∈U} by autoSwith P assms(3) have ∃ N∈Pow({f-V. V∈U}). X1 ⊆N ∧ N≺K unfolding IsCompactOfCard_def by autoS
then obtain N where N∈Pow({f-V. V∈U}) X1 ⊆N N≺K bySauto
then have fin:N≺K and sub:N⊆{f-V. V∈U} and cov:X1 ⊆N unfolding FinPow_def by autofrom sub have S{fR. R∈N}⊆{f(f-V). V∈U} by auto moreover
have ∀ V∈U. V⊆ τ 2 using as(2) by auto ultimately
have {fR. R∈N}⊆U using surj_image_vimage assms(2) by auto moreover
let FN={hR,fRi. R∈N}
have FN:FN:N→{fR. R∈N} unfolding Pi_def function_def domain_def by

894

auto
{
fix S assume S∈{fR. R∈N}
then obtain R where R_def:R∈NfR=S by auto
then have hR,fRi∈FN by auto
then have FNR=fR using FN apply_equality by auto
then have ∃ R∈N. FNR=S using R_def by auto}
then have surj:FN∈surj(N,{fR. R∈N}) unfolding surj_def using FN by
force
from fin have N:N.K Ord(K) using assms(3) lesspoll_imp_lepoll unfolding IsCompactOfCard_def
using Card_is_Ord by auto
then have {fR. R∈N}.N using surj_fun_inv_2 surj by auto
then have {fR. R∈N}≺K using fin lesspoll_trans1 by blast
moreoverSS
have{fR. R∈N}=f(N) using image_UN by autoS
then have fX1 ⊆S {fR. R∈N} using cov by blast
then have X2 ⊆{fR. R∈N} using assms(2) surj_range_image_domain
by autoS
ultimately have ∃ NN∈Pow(U). X2 ⊆NN ∧ NN≺K by auto}
S
S
then have ∀ U∈Pow(τ 2 ). X2 ⊆U −→ (∃ NN∈Pow(U). X2 ⊆NN ∧ NN≺K)
by autoultimately show thesis using assms(3) unfolding IsCompactOfCard_def
by autoqed

As it happends to connected spaces, a continuous function from a compact
space to an anti-compact space has finite range.
corollary (in two_top_spaces0) cont_comp_anti_comp:assumes IsContinuous(τ 1 ,τ 2 ,f) X1 {is compact in}τ 1 τ 2 {is anti-compact}
f:X1 →X2 X1 6=0
shows Finite(range(f)) and range(f)6=0
proof from assms(4) have surj:f∈surj(X1 ,range(f)) using fun_is_surj by auto
have sub:range(f)⊆X2 using func1_1_L5B assms(4) by autofrom assms(1) have cont:IsContinuous(τ 1 ,τ 2 {restricted to}range(f),f)
using restr_image_cont range_image_domain
assms(4) by
S autohave union: (τ 2 {restricted to}range(f))=range(f) unfolding RestrictedTo_def
using sub by auto
then have two_top_spaces0(τ 1 ,τ 2 {restricted to}range(f),f) unfolding
two_top_spaces0_def
using surj unfolding surj_def using tau1_is_top topology0.Top_1_L4
unfolding topology0_def using tau2_is_top
by autothen have range(f){is compact in}(τ 2 {restricted to}range(f)) using surj
two_top_spaces0.cont_image_com cont union895

assms(2) Compact_is_card_nat by force
S
then have range(f){is in the spectrum of}(λT. ( T) {is compact in}T)
using assms(3) sub unfolding IsAntiComp_def antiProperty_def
using union by auto
then show Finite(range(f)) using compact_spectrum by auto moreoverfrom assms(5) have fX1 6=0 using func1_1_L15A assms(4) by auto
then show range(f)6=0 using range_image_domain assms(4) by autoqed

As a consequence, it follows that quotient topological spaces of compact(connected) spaces are compact (connected).
corollary(in S
topology0) compQuot:
S
assumesS( T){is compact in}T equiv( T,r)shows ( T)//r{is compact in}({quotient by}r)
proof SS
S
have surj:{hb,r{b}i. b∈ T}∈surj( T,( T)//r) using quotient_proj_surj
by autoS
S
moreover have tot: ({quotient by}r)=( T)//r using total_quo_equi
assms(2) by autoS
ultimately have cont:IsContinuous(T,{quotient by}r,{hb,r{b}i. b∈ T})
using quotient_func_cont
EquivQuo_def assms(2) by auto
S
from surj tot have two_top_spaces0(T,{quotient by}r,{hb,r{b}i. b∈ T})
unfolding two_top_spaces0_def
using topSpaceAssum equiv_quo_is_top assms(2) unfolding surj_def by
autowith surj cont tot assms(1) show thesis using two_top_spaces0.cont_image_com
Compact_is_card_nat by forceqed
corollary(in topology0) ConnQuot: S
assumes T{is connected} equiv( T,r)shows ({quotient by}r){is connected}
proof SS
S
have surj:{hb,r{b}i. b∈ T}∈surj( T,( T)//r) using quotient_proj_surj
by autoS
S
moreover have tot: ({quotient by}r)=( T)//r using total_quo_equi
assms(2) by autoS
ultimately have cont:IsContinuous(T,{quotient by}r,{hb,r{b}i. b∈ T})
using quotient_func_cont
EquivQuo_def assms(2) by auto
S
from surj tot have two_top_spaces0(T,{quotient by}r,{hb,r{b}i. b∈ T})
unfolding two_top_spaces0_def
using topSpaceAssum equiv_quo_is_top assms(2) unfolding surj_def by
autowith surj cont tot assms(1) show thesis using two_top_spaces0.cont_image_conn
by force
qed

896

end

64

Topology 10

theory Topology_ZF_10
imports Topology_ZF_7
begin

This file deals with properties of product spaces. We only consider productof two spaces, and most of this proofs, can be used to prove the results in
product of a finite number of spaces.

64.1

Closure and closed sets in product space

The closure of a product, is the product of the closures.
lemma cl_product:
SS
assumes T{is a topology} S{is a topology} A⊆ T B⊆ S
shows Closure(A×B,ProductTopology(T,S))=Closure(A,T)×Closure(B,S)
proof
S S
have A×B⊆ T× S using
assms(3,4) by autoS
then have sub:A×B⊆ ProductTopology(T,S) using Top_1_4_T1(3) assms(1,2)
by autohave top:ProductTopology(T,S){is a topology} using Top_1_4_T1(1) assms(1,2)
by auto{fix x assume asx:x∈Closure(A×B,ProductTopology(T,S))
then have reg:∀ U∈ProductTopology(T,S). x∈U −→ U∩(A×B)6=0 using
topology0.cl_inter_neighsub top unfolding
S topology0_def by blastfrom asx have x∈ ProductTopology(T,S) using topology0.Top_3_L11(1)
top unfolding topology0_def
using sub by blastS S
then have xSigma:x∈ T× SS using
S Top_1_4_T1(3) assms(1,2) by auto
then have hfst(x),snd(x)i∈T×
S usingSPair_fst_snd_eq by autoS
then have xT:fst(x)∈ T and xS:snd(x)∈ S by auto{
fix U S
V assume as:U∈T fst(x)∈U
haveS∈S using S
assms(2) unfolding IsATopology_def by autowith as have U×( S)∈ProductCollection(T,S) unfolding ProductCollection_def
by autoS
then have P:U×( S)∈ProductTopology(T,S) using Top_1_4_T1(2) assms(1,2)
base_sets_open by blast
S
with xS as(2) have
S hfst(x),snd(x)i∈U×( S) by auto
then have x∈U×( S)Susing Pair_fst_snd_eq xSigma by autowith P reg have U×( S)∩A×B6=0 by auto
then have noEm:U∩A6=0 by auto}
then have ∀ U∈T. fst(x)∈U −→ U∩A6=0 by auto moreover897

{
fix U S
V assume as:U∈S snd(x)∈U
haveT∈T usingS assms(1) unfolding IsATopology_def by autowith as have ( T)×U∈ProductCollection(T,S) unfolding ProductCollection_def
by autoS
then have P:( T)×U∈ProductTopology(T,S) using Top_1_4_T1(2) assms(1,2)
base_sets_open by blast
S
with xT as(2) S
have hfst(x),snd(x)i∈( T)×U by auto
then have x∈( T)×U
S using Pair_fst_snd_eq xSigma by autowith P reg have ( T)×U∩A×B6=0 by auto
then have noEm:U∩B6=0 by auto}
then have ∀ U∈S. snd(x)∈U −→ U∩B6=0 by auto
ultimately have fst(x)∈Closure(A,T) snd(x)∈Closure(B,S) using
topology0.inter_neigh_cl assms(3,4) unfolding topology0_def
using assms(1,2) xT xS by auto
then have hfst(x),snd(x)i∈Closure(A,T)×Closure(B,S) by autowith xSigma have x∈Closure(A,T)×Closure(B,S) by auto}
then show Closure(A×B,ProductTopology(T,S))⊆Closure(A,T)×Closure(B,S)
by auto{fix x assume x:x∈Closure(A,T)×Closure(B,S)
then have xcl:fst(x)∈Closure(A,T) snd(x)∈Closure(B,S) by autofrom xcl(1) have regT:∀ U∈T. fst(x)∈U −→ U∩A6=0 using topology0.cl_inter_neighunfolding topology0_def using assms(1,3) by blastfrom xcl(2) have regS:∀ U∈S. snd(x)∈U −→ U∩B6=0 using topology0.cl_inter_neighunfolding topology0_def using
S Sassms(2,4) by blastfrom x assms(3,4) have x∈ T× S using topology0.Top_3_L11(1) unfolding topology0_def
using assms(1,2)Sby blast
then have xtot:x∈ ProductTopology(T,S) using Top_1_4_T1(3) assms(1,2)
by auto{fix PO assume as:PO∈ProductTopology(T,S) x∈POthen obtain POB where base:POB∈ProductCollection(T,S) x∈POBPOB⊆PO
using point_open_base_neighTop_1_4_T1(2) assms(1,2) base_sets_open by blast
then obtain VT VS where V:VT∈T VS∈S x∈VT×VS POB=VT×VS unfolding ProductCollection_def
by autofrom V(3) have x:fst(x)∈VT snd(x)∈VS by autofrom V(1) regT x(1) have VT∩A6=0 by auto moreoverfrom V(2) regS x(2) have VS∩B6=0 by auto ultimately
have VT×VS∩A×B6=0 by autowith V(4) base(3) have PO∩A×B6=0 by blast}
then have ∀ P∈ProductTopology(T,S). x∈P −→ P∩A×B6=0 by auto
then have x∈Closure(A×B,ProductTopology(T,S)) using topology0.inter_neigh_cl898unfolding topology0_def using top sub xtot by auto}
then show Closure(A,T)×Closure(B,S)⊆Closure(A×B,ProductTopology(T,S))
by autoqed

The product of closed sets, is closed in the product topology.
corollary closed_product:
assumes T{is a topology} S{is a topology} A{is closed in}TB{is closedin}Sshows (A×B) {is closed in}ProductTopology(T,S)
proof S
S
from assms(3,4) ShaveS sub:A⊆ TB⊆ S unfolding IsClosed_def by auto
then have A×B⊆ T× SS by auto
then have sub1:A×B⊆ ProductTopology(T,S) using Top_1_4_T1(3) assms(1,2)
by autofrom sub assms have Closure(A,T)=AClosure(B,S)=B using topology0.Top_3_L8
unfolding topology0_def by auto
then have Closure(A×B,ProductTopology(T,S))=A×B using cl_productassms(1,2) sub by auto
then show thesis using topology0.Top_3_L8 unfolding topology0_def
using sub1 Top_1_4_T1(1) assms(1,2) by auto
qed

64.2

Separation properties in product space

The product of T0 spaces is T0 .

theorem T0_product:
assumes T{is a topology}S{is a topology}T{is T0 }S{is T0 }shows ProductTopology(T,S){is T0 }proof {SS
fix x y assume x∈S ProductTopology(T,S)y∈
ProductTopology(T,S)x6=y
S
S S
then have tot:x∈ T× Sy∈ T× Sx6=y using Top_1_4_T1(3) assms(1,2)
by autoS S
S S
then have hfst(x),snd(x)i∈ T× Shfst(y),snd(y)i∈ T× S and disj:fst(x)6=fst(y)∨snd(x)using Pair_fst_snd_eq
S by auto
S
S
S
then have T:fst(x)∈ Tfst(y)∈ T and S:snd(y)∈ Ssnd(x)∈ S andp:fst(x)6=fst(y)∨snd(x)6=snd(y)by auto{assume fst(x)6=fst(y)with T assms(3) have (∃ U∈T. (fst(x)∈U∧fst(y)∈U)∨(fst(y)∈U∧fst(x)/∈U))/
unfolding
isT0_def by auto
then obtain U where U∈T (fst(x)∈U∧fst(y)∈U)∨(fst(y)∈U∧fst(x)/∈U)/
by auto899

S
S
with S have (hfst(x),snd(x)i∈U×(S) ∧ hfst(y),snd(y)i∈U×(/S))∨(hfst(y),snd(y)i∈U×(S∧ hfst(x),snd(x)i∈U×(/S))
by autoS
S
S
S
then have (x∈U×( S) ∧ y∈U×(/S))∨(y∈U×( S) ∧ x∈U×(/S)) using Pair_fst_snd_eq tot(1,2)
by
auto
S
moreover have ( S)∈S using assms(2) unfolding IsATopology_def
by autoSwith hU∈Ti have U×( S)∈ProductTopology(T,S) using prod_open_open_prod
assms(1,2) by auto
ultimately
have ∃ V∈ProductTopology(T,S). (x∈V ∧ y∈V)∨(y∈V/∧ x∈V)/
proof qed
} moreover{
assume snd(x)6=snd(y)with S assms(4) have (∃ U∈S. (snd(x)∈U∧snd(y)∈U)∨(snd(y)∈U∧snd(x)/∈U))/
unfolding
isT0_def by auto
then obtain U where U∈S (snd(x)∈U∧snd(y)∈U)∨(snd(y)∈U∧snd(x)/∈U)/
by autoSSSwith T have (hfst(x),snd(x)i∈(T)×U ∧ hfst(y),snd(y)i∈(/T)×U)∨(hfst(y),snd(y)i∈( T
S∧ hfst(x),snd(x)i∈(/T)×U)
by autoS
S
S
S
then have (x∈( T)×U ∧ y∈(/T)×U)∨(y∈( T)×U ∧ x∈(/T)×U) using Pair_fst_snd_eq tot(1,2)
by
auto
S
moreover have ( T)∈T using assms(1) unfolding IsATopology_def
by autoSwith hU∈Si have ( T)×U∈ProductTopology(T,S) using prod_open_open_prod
assms(1,2) by auto
ultimately
have ∃ V∈ProductTopology(T,S). (x∈V ∧ y∈V)∨(y∈V/∧ x∈V)/
proof qed
}moreovernote disj
ultimately have ∃ V∈ProductTopology(T,S). (x∈V ∧ y∈V)∨(y∈V/∧ x∈V)/by auto}then show thesis unfolding isT0_def by autoqed

The product of T1 spaces is T1 .

theorem T1_product:
assumes T{is a topology}S{is a topology}T{is T1 }S{is T1 }shows ProductTopology(T,S){is T1 }proof {SS
fix x y assume x∈S ProductTopology(T,S)y∈
ProductTopology(T,S)x6=y
S
S S
then have tot:x∈ T× Sy∈ T× Sx6=y using Top_1_4_T1(3) assms(1,2)
by autoS S
S S
then have hfst(x),snd(x)i∈ T× Shfst(y),snd(y)i∈ T× S and disj:fst(x)6=fst(y)∨snd(x)900using Pair_fst_snd_eq
S by auto
S
S
S
then have T:fst(x)∈ Tfst(y)∈ T and S:snd(y)∈ Ssnd(x)∈ S andp:fst(x)6=fst(y)∨snd(x)6=snd(y)by auto{assume fst(x)6=fst(y)with T assms(3) have (∃ U∈T. (fst(x)∈U∧fst(y)∈U))/
unfolding
isT1_def by auto
then obtain U where U∈T (fst(x)∈U∧fst(y)∈U)/
by autoS
S
with S have (hfst(x),snd(x)i∈U×( S) ∧ hfst(y),snd(y)i∈U×(/S))
by autoS
S
then have (x∈U×( S) ∧ y∈U×(/S)) using Pair_fst_snd_eq tot(1,2)
by autoS
moreover have ( S)∈S using assms(2) unfolding IsATopology_def
by autoSwith hU∈Ti have U×( S)∈ProductTopology(T,S) using prod_open_open_prod
assms(1,2) by auto
ultimately
have ∃ V∈ProductTopology(T,S). (x∈V ∧ y∈V)/
proof qed
} moreover{
assume snd(x)6=snd(y)with S assms(4) have (∃ U∈S. (snd(x)∈U∧snd(y)∈U))/
unfolding
isT1_def by auto
then obtain U where U∈S (snd(x)∈U∧snd(y)∈U)/
by autoS
S
with T have (hfst(x),snd(x)i∈( T)×U ∧ hfst(y),snd(y)i∈(/T)×U)
by autoS
S
then have (x∈( T)×U ∧ y∈(/T)×U) using Pair_fst_snd_eq tot(1,2)
by autoS
moreover have ( T)∈T using assms(1) unfolding IsATopology_def
by autoSwith hU∈Si have ( T)×U∈ProductTopology(T,S) using prod_open_open_prod
assms(1,2) by auto
ultimately
have ∃ V∈ProductTopology(T,S). (x∈V ∧ y∈V)/
proof qed
}moreovernote disj
ultimately have ∃ V∈ProductTopology(T,S). (x∈V ∧ y∈V)/
by auto}then show thesis unfolding isT1_def by autoqed

The product of T2 spaces is T2 .
theorem T2_product:
assumes T{is a topology}S{is a topology}T{is T2 }S{is T2 }shows ProductTopology(T,S){is T2 }proof {SS
fix x y assume x∈ ProductTopology(T,S)y∈ ProductTopology(T,S)x6=y

901

S S
S S
then have tot:x∈ T× Sy∈ T× Sx6=y using Top_1_4_T1(3) assms(1,2)
by autoS S
S S
then have hfst(x),snd(x)i∈ T× Shfst(y),snd(y)i∈ T× S and disj:fst(x)6=fst(y)∨snd(x)using Pair_fst_snd_eq
S by auto
S
S
S
then have T:fst(x)∈ Tfst(y)∈ T and S:snd(y)∈ Ssnd(x)∈ S andp:fst(x)6=fst(y)∨snd(x)6=snd(y)by auto{assume fst(x)6=fst(y)with T assms(3) have (∃ U∈T. ∃ V∈T. (fst(x)∈U∧fst(y)∈V) ∧ U∩V=0)
unfolding
isT2_def by auto
then obtain U V where U∈T V∈T fst(x)∈U
fst(y)∈V U∩V=0 S
by autoSwith S Shave hfst(x),snd(x)i∈U×(S)
hfst(y),snd(y)i∈V×(S) andS
disjoint:(U× S)∩(V× SS)=0 by autoS
then have x∈U×( S)y∈V×( S) using Pair_fst_snd_eq tot(1,2) byautoS
moreover have ( S)∈S using assms(2) unfolding IsATopology_def
by autoS
S
with hU∈TihV∈Ti have P:U×( S)∈ProductTopology(T,S) V×( S)∈ProductTopology(T,S)
using prod_open_open_prod assms(1,2) by auto
note disjoint
S ultimatelyS
S
S
have x∈U×( S) ∧ y∈V×( S) ∧ (U×( S))∩(V×( S))=0
by auto
S
with
P(2)
have
∃
UU∈ProductTopology(T,S).
(x∈U×(S)∧
y∈UU ∧S(U×( S))∩UU=0)
SS) and P=λt. t∈ProductTopology(T,S) ∧Susing exI[where x=V×(
S(x∈U×( S) ∧ y∈t ∧ (U×( S))∩t=0)] by autowith P(1) have ∃ VV∈ProductTopology(T,S). ∃ UU∈ProductTopology(T,S).
(x∈VV ∧ y∈UU ∧ VV∩UU=0)
S
using exI[where x=U×( S) and P=λt. t∈ProductTopology(T,S) ∧(∃ UU∈ProductTopology(T,S). (x∈t ∧ y∈UU ∧ (t)∩UU=0))] by auto
} moreover{
assume snd(x)6=snd(y)with S assms(4) have (∃ U∈S. ∃ V∈S. (snd(x)∈U∧snd(y)∈V) ∧ U∩V=0)
unfolding
isT2_def by auto
then obtain U V where U∈S V∈S
S snd(x)∈U snd(y)∈V U∩V=0
S by autowith ST have hfst(x),snd(x)i∈(T)×U
hfst(y),snd(y)i∈(
T)×V andS
disjoint:(( T)×U)∩((T)×V)=0
byautoSSthen have x∈( T)×Uy∈( T)×V using Pair_fst_snd_eq tot(1,2) byautoS
moreover have ( T)∈T using assms(1) unfolding IsATopology_def
by autoS
S
with hU∈SihV∈Si have P:( T)×U∈ProductTopology(T,S) ( T)×V∈ProductTopology(T,S)
using prod_open_open_prod assms(1,2) by auto902

note disjoint
ultimately
S
S
S
S
have x∈( T)×U ∧ y∈( T)×V ∧ (( T)×U)∩(( T)×V)=0
by auto
S
with
P(2)
have
∃
UU∈ProductTopology(T,S).
(x∈(
T)×U
∧
y∈UU ∧S(( T)×U)∩UU=0)S
S using exI[whereS x=( T)×V and P=λt. t∈ProductTopology(T,S) ∧(x∈( T)×U ∧ y∈t ∧ (( T)×U)∩t=0)] by autowith P(1) have ∃ VV∈ProductTopology(T,S). ∃ UU∈ProductTopology(T,S).
(x∈VV ∧ y∈UU ∧ VV∩UU=0)
S
using exI[where x=( T)×U and P=λt. t∈ProductTopology(T,S) ∧(∃ UU∈ProductTopology(T,S). (x∈t ∧ y∈UU ∧ (t)∩UU=0))] by auto
} moreovernote disj
ultimately have ∃ VV∈ProductTopology(T, S). ∃ UU∈ProductTopology(T,S). x ∈ VV ∧ y ∈ UU ∧ VV ∩ UU = 0 by auto}
then show thesis unfolding isT2_def by autoqed

The product of regular spaces is regular.
theorem regular_product:
assumes T{is a topology} S{is a topology} T{is regular} S{is regular}
shows ProductTopology(T,S){is regular}
proof {
S
fix x U assume x∈ ProductTopology(T,S) U∈ProductTopology(T,S) x∈Uthen obtain V W where VW:V∈TW∈S V×W⊆U and x:x∈V×W using prod_top_point_neighbassms(1,2) by blast
then have p:fst(x)∈Vsnd(x)∈W by autofrom p(1) hV∈Ti obtain VV where VV:fst(x)∈VV Closure(VV,T)⊆V VV∈T
using
assms(1,3) topology0.regular_imp_exist_clos_neig unfolding topology0_def
by force moreoverfrom p(2) hW∈Si obtain WW where WW:snd(x)∈WW Closure(WW,S)⊆W WW∈S
using
assms(2,4) topology0.regular_imp_exist_clos_neig unfolding topology0_def
by force ultimately
have x∈VV×WW using x by auto
moreover from hClosure(VV,T)⊆Vi hClosure(WW,S)⊆Wi have Closure(VV,T)×Closure(WW,S)⊆ V×W
by autoS
S
moreover from VV(3) WW(3) have VV⊆ TWW⊆ S by auto
ultimately have x∈VV×WW Closure(VV×WW,ProductTopology(T,S)) ⊆ V×Wusing cl_product assms(1,2)
by automoreover have VV×WW∈ProductTopology(T,S) using prod_open_open_prod
assms(1,2)
VV(3) WW(3) by auto
ultimately have ∃ Z∈ProductTopology(T,S). x∈Z ∧ Closure(Z,ProductTopology(T,S))⊆V×W903

by auto
with VW(3) have ∃ Z∈ProductTopology(T,S). x∈Z ∧ Closure(Z,ProductTopology(T,S))⊆U
by auto}S
then have ∀ x∈ ProductTopology(T,S). ∀ U∈ProductTopology(T,S).x∈U −→(∃ Z∈ProductTopology(T,S). x∈Z ∧ Closure(Z,ProductTopology(T,S))⊆U)by autothen show thesis using topology0.exist_clos_neig_imp_regular unfolding topology0_def
using assms(1,2) Top_1_4_T1(1) by auto
qed

64.3

Connection properties in product spaceFirst, we prove that the projection functions are open.
lemma projection_open:
assumes T{isa topology}B∈ProductTopology(T,S)
S a topology}S{isS
shows {y∈ T. ∃ x∈ S. hy,xi∈B}∈T
proof {SS
fix z assume z∈{y∈ T. ∃ x∈
S S. hy,xi∈B}
S
then obtain x where
x:x∈ S and Sz:z∈ T and p:hz,xi∈B
by S
auto
S
S
then have z∈{y∈ T. hy,xi∈B} {y∈ T. hy,xi∈B}⊆{y∈ T. ∃ x∈ S. hy,xi∈B}by auto moreoverS
from x have {y∈ T. hy,xi∈B}∈T using
assms by auto
S prod_sec_open2
S
ultimately have ∃ V∈T. z∈V ∧ V⊆{y∈ T. ∃ x∈ S. hy,xi∈B} unfolding
Bex_def by auto}
S
S
then show {y∈ T. ∃ x∈ S. hy,xi∈B}∈T using topology0.open_neigh_open
unfolding topology0_def
using assms(1) by blastqed
lemma projection_open2:
assumes T{isa topology}B∈ProductTopology(T,S)
S a topology}S{isS
shows {y∈ S. ∃ x∈ T. hx,yi∈B}∈S
proof {SS
fix z assume z∈{y∈ S. ∃ x∈
S T. hx,yi∈B}
Sthen obtain x where
x:x∈ T and Sz:z∈ S and p:hx,zi∈B
by S
auto
S
S
then have z∈{y∈ S. hx,yi∈B} {y∈ S. hx,yi∈B}⊆{y∈ S. ∃ x∈ T. hx,yi∈B}by auto moreoverS
from x have {y∈ S. hx,yi∈B}∈S using
assms by auto
S prod_sec_open1
S
ultimately have ∃ V∈S. z∈V ∧ V⊆{y∈ S. ∃ x∈ T. hx,yi∈B} unfolding
Bex_def by auto}
S
S
then show {y∈ S. ∃ x∈ T. hx,yi∈B}∈S using topology0.open_neigh_open
unfolding topology0_def
using assms(2) by blast

904

qed

The product of connected spaces is connected.
theorem compact_product:
assumes T{is a topology}S{is a topology}T{is connected}S{is connected}
shows ProductTopology(T,S){is connected}
proof {
fix U assume U:U∈ProductTopology(T,S)
S U{is closed in}ProductTopology(T,S)
then have P:U∈ProductTopology(T,S)
ProductTopology(T,S)-U∈ProductTopology(T,S)
unfolding IsClosed_def by auto{S
fix s assume s:s∈ S S
with P(1) have p:{x∈ T. hx,si∈U}∈T using prod_sec_open2 assms(1,2)
by autoS
S
from s P(2) have oop:{y∈ T. hy,si∈( ProductTopology(T,S)-U)}∈T
using prod_sec_open2
assms(1,2)
S by Sblast S
S
S
then
have
T-( T-{y∈ T. hy,si∈( ProductTopology(T,S)-U)})={y∈ T.
Shy,si∈( ProductTopology(T,S)-U)}S
S by auto S
with oop have cl:( T-{y∈ T. hy,si∈( ProductTopology(T,S)-U)}){is closed in}T unfolding IsClosed_def by auto{
S
SS
fix t assume t∈ ST-{y∈ T.
S hy,si∈( ProductTopology(T,S)-U)}S
then have tt:t∈ T t∈{y∈/
T. hy,si∈( ProductTopology(T,S)-U)}by autoS
then have ht,si∈(/
ProductTopology(T,S)-U)
by autoS
then have ht,si∈U ∨ ht,si∈/ S ProductTopology(T,S)
by autoS
then have ht,si∈U ∨ ht,si∈/ T× S using Top_1_4_T1(3) assms(1,2)
by autowith tt(1) s have ht,si∈U
S by autowith tt(1) have t∈{x∈ T. hx,si∈U} by auto
} moreover{S
fix t assume t∈{x∈
T. hx,si∈U}
Sthen have tt:t∈ ST ht,si∈U by auto
then have ht,si∈/S ProductTopology(T,S)-U
by autoS
then have t∈{y∈/T.
hy,si∈(
ProductTopology(T,S)-U)}by autoSSSwith tt(1) have t∈ T-{y∈ T. hy,si∈( ProductTopology(T,S)-U)}by auto}S
S
S
S
ultimately have {x∈ T. hx,si∈U}= T-{y∈ T. hy,si∈( ProductTopology(T,S)-U)}by blast
Swith cl have {x∈ T. hx,si∈U}{isclosed in}T by
S
S autoSwith p assms(3) have {x∈ T. hx,si∈U}=0 ∨ {x∈ T. hx,si∈U}= T
unfolding IsConnected_def
by auto moreover{Sassume {x∈ T. hx,si∈U}=0905

Sthen have ∀ x∈ T. hx,si∈U/ by auto}
moreover{S
S
assume AA:{x∈ T. hx,si∈U}= T{S
fix x assume x∈ T S
with AA have x∈{x∈ T. hx,si∈U} by auto
then have hx,si∈U by auto}S
then have ∀ x∈ T. hx,si∈U by auto}S
S
ultimately have (∀ x∈ T. hx,si∈U)/∨ (∀ x∈ T. hx,si∈U) by blast}
S
S
S
then have reg:∀ s∈ S. (∀ x∈ T. hx,si∈U)/∨ (∀ x∈ T. hx,si∈U) by auto{S
fix q assume qU:q∈ T×{snd(qq).
qq∈U}Sthen obtain t u where
t:t∈
T
u∈U
q=ht,snd(u)i by autoSwith U(1) haveu∈
ProductTopology(T,S)
by auto
S S
then have u∈ T× S using Top_1_4_T1(3) assms(1,2) by auto moreover
then have uu:u=hfst(u),snd(u)i using Pair_fst_snd_eq by auto ultimately
S
S
have fu:fst(u)∈ Tsnd(u)∈S by (safe,auto) S
S
with reg have (∀ tt∈ T. htt,snd(u)i∈U)∨(∀/tt∈ T. htt,snd(u)i∈U)
by autoSwith hu∈Ui uu fu(1) have ∀ tt∈ T. htt,snd(u)i∈U by force
with t(1,3) have q∈U by auto}S
then have U1: T×{snd(qq). qq∈U}⊆U by auto{S
fix t assume t:t∈ T S
with P(1) have p:{x∈ S. ht,xi∈U}∈S using prod_sec_open1 assms(1,2)
by autoS
S
from t P(2) have oop:{x∈ S. ht,xi∈( ProductTopology(T,S)-U)}∈S
using prod_sec_open1
assms(1,2)
S by Sblast S
S
S
then
have
S-( S-{x∈ S. ht,xi∈( ProductTopology(T,S)-U)})={y∈ S.
Sht,yi∈( ProductTopology(T,S)-U)}S
S by auto S
with oop have cl:( S-{y∈ S. ht,yi∈( ProductTopology(T,S)-U)}){is closed in}S unfolding IsClosed_def by auto{
S
SS
fix s assume s∈ SS-{y∈ S.
S ht,yi∈( ProductTopology(T,S)-U)}S
then have tt:s∈ S s∈{y∈/S. ht,yi∈( ProductTopology(T,S)-U)}by autoS
then have ht,si∈(/
ProductTopology(T,S)-U)
by autoS
then have ht,si∈U ∨ ht,si∈/ S ProductTopology(T,S)
by autoS
then have ht,si∈U ∨ ht,si∈/ T× S using Top_1_4_T1(3) assms(1,2)
by auto906

with tt(1) t have ht,si∈U
S by autowith tt(1) have s∈{x∈ S. ht,xi∈U} by auto
} moreover{S
fix s assume s∈{x∈
S. ht,xi∈U}
Sthen have tt:s∈ SS ht,si∈U by auto
then have ht,si∈/S ProductTopology(T,S)-U
by autoS
then have s∈{y∈/S.
ht,yi∈(
ProductTopology(T,S)-U)}by autoSSSwith tt(1) have s∈ S-{y∈ S. ht,yi∈( ProductTopology(T,S)-U)}by auto}S
S
S
S
ultimately have {x∈ S. ht,xi∈U}= S-{y∈ S. ht,yi∈( ProductTopology(T,S)-U)}by blast
Swith cl have {x∈ S. ht,xi∈U}{isclosed in}S byS
S autoSwith p assms(4) have {x∈ S. ht,xi∈U}=0 ∨ {x∈ S. ht,xi∈U}= S
unfolding IsConnected_def
by auto moreover{Sassume {x∈ S.S ht,xi∈U}=0
then have ∀ x∈ S. ht,xi∈U/ by auto}
moreover{S
S
assume AA:{x∈ S. ht,xi∈U}= S{
S
fix x assume x∈ S S
with AA have x∈{x∈ S. ht,xi∈U} by auto
then have ht,xi∈U by auto}S
then have ∀ x∈ S. ht,xi∈U by auto}S
S
ultimately have (∀ x∈ S. ht,xi∈U)/∨ (∀ x∈ S. ht,xi∈U) by blast}
S
S
S
then have reg:∀ s∈ T. (∀ x∈ S. hs,xi∈U)/∨ (∀ x∈ S. hs,xi∈U) by auto{S
fix q assume qU:q∈{fst(qq). qq∈U}× S
Sthen obtain qq s wheret:q=hfst(qq),si qq∈U s∈ S by autoSwith U(1) haveS qq∈S ProductTopology(T,S) by auto
then have qq∈ T× S using Top_1_4_T1(3) assms(1,2) by auto moreover
then have qq:qq=hfst(qq),snd(qq)i using Pair_fst_snd_eq by auto
ultimately
S
S
have fq:fst(qq)∈ Tsnd(qq)∈
S S by (safe,auto)
S
from fq(1) reg have (∀ tt∈ S. hfst(qq),tti∈U)∨(∀/tt∈ S. hfst(qq),tti∈U)by auto moreoverSwith hqq∈Ui qq fq(2) have ∀ tt∈ S. hfst(qq),tti∈U by force
with t(1,3) have q∈U by auto}S
then have U2:{fst(qq). qq∈U}× S⊆U by blast907

{
assume U6=0
then obtain u where u:u∈U by auto{
S S
fix aa assume aa∈ T× S S
Sthen obtain t s where t∈
S Ts∈ Saa=ht,si by autowith u have ht,snd(u)i∈ T×{snd(qq). qq∈U} by autowith U1 have ht,snd(u)i∈U by autoS
moreover have t=fst(ht,snd(u)i) by auto moreover note hs∈ Si
ultimately
S
have ht,si∈{fst(qq). qq∈U}× S by blast
with U2 have ht,si∈U by autowith haa=ht,sii have aa∈U by auto}
S S
then have
T× S⊆U
S by auto moreoverwith U(1)haveU⊆
ProductTopology(T,S) by auto ultimately
S S
have
T× S=U using Top_1_4_T1(3) assms(1,2) by auto}
S S
then have (U=0)∨(U= T× S) by auto}
then show thesis unfolding IsConnected_def using Top_1_4_T1(3) assms(1,2)
by auto
qed
end

65

Topology 11

theory Topology_ZF_11 imports Topology_ZF_7 Finite_ZF_1
begin

This file deals with order topologies. The order topology is already definedin Topology_ZF_examples_1.thy.

65.1

Order topologies

We will assume most of the time that the ordered set has more than one
point. It is natural to think that the topological properties can be translated
to properties of the order; since every order rises one and only one topology
in a set.

65.2

Separation properties

Order topologies have a lot of separation properties.
Every order topology is Hausdorff.
908

theorem order_top_T2:
assumes IsLinOrder(X,r) ∃ x y. x6=y∧x∈X∧y∈X
shows (OrdTopology X r){is T2 }proof {SS
fix x y assume A1:x∈ (OrdTopology X r)y∈ (OrdTopology X r)x6=ythen have AS:x∈Xy∈Xx6=y using union_ordtopology[OF assms(1) assms(2)]by auto{assume A2:∃ z∈X-{x,y}. (hx,yi∈r−→hx,zi∈r∧hz,yi∈r)∧(hy,xi∈r−→hy,zi∈r∧hz,xi∈r)from AS(1,2) assms(1) have hx,yi∈r∨hy,xi∈r unfolding IsLinOrder_def
IsTotal_def by auto moreover{
assume hx,yi∈rwith AS A2 obtain z where z:hx,zi∈rhz,yi∈rz∈Xz6=xz6=y by autowith AS(1,2) have x∈LeftRayX(X,r,z)y∈RightRayX(X,r,z) unfolding LeftRayX_def RightRayX_def
by auto moreover
have LeftRayX(X,r,z)∩RightRayX(X,r,z)=0 using inter_lray_rray[OFz(3) z(3) assms(1)]unfolding IntervalX_def using Order_ZF_2_L4[OF total_is_refl_ z(3)] assms(1) unfolding IsLinOrder_def
by auto moreover
have LeftRayX(X,r,z)∈(OrdTopology X r)RightRayX(X,r,z)∈(OrdTopology
X r)using z(3) base_sets_open[OF Ordtopology_is_a_topology(2)[OF
assms(1)]] by auto
ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}
moreover{assume hy,xi∈rwith AS A2 obtain z where z:hy,zi∈rhz,xi∈rz∈Xz6=xz6=y by autowith AS(1,2) have y∈LeftRayX(X,r,z)x∈RightRayX(X,r,z) unfolding LeftRayX_def RightRayX_def
by auto moreover
have LeftRayX(X,r,z)∩RightRayX(X,r,z)=0 using inter_lray_rray[OFz(3) z(3) assms(1)]unfolding IntervalX_def using Order_ZF_2_L4[OF total_is_refl_ z(3)] assms(1) unfolding IsLinOrder_def
by auto moreover
have LeftRayX(X,r,z)∈(OrdTopology X r)RightRayX(X,r,z)∈(OrdTopology
X r)using z(3) base_sets_open[OF Ordtopology_is_a_topology(2)[OF
assms(1)]] by auto
ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}909

ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}
moreover{assume A2:∀ z∈X - {x, y}. (hx, yi ∈ r ∧ (hx, zi ∈/ r ∨ hz, yi ∈/ r))
∨ (hy, xi ∈ r ∧ (hy, zi ∈/ r ∨ hz, xi ∈/ r))from AS(1,2) assms(1) have disj:hx,yi∈r∨hy,xi∈r unfolding IsLinOrder_def
IsTotal_def by auto moreover{
assume TT:hx,yi∈rwith AS assms(1) have T:hy,xi∈r/ unfolding IsLinOrder_def antisym_def
by autofrom TT AS(1-3) have x∈LeftRayX(X,r,y)y∈RightRayX(X,r,x) unfolding LeftRayX_def RightRayX_def
by auto moreover{
fix z assume z∈LeftRayX(X,r,y)∩RightRayX(X,r,x)
then have hz,yi∈rhx,zi∈rz∈X-{x,y} unfolding RightRayX_def LeftRayX_def
by autowith A2 T have False by auto}
then have LeftRayX(X,r,y)∩RightRayX(X,r,x)=0 by auto moreover
have LeftRayX(X,r,y)∈(OrdTopology X r)RightRayX(X,r,x)∈(OrdTopology
X r)using base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]]AS by auto
ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}
moreover{assume TT:hy,xi∈rwith AS assms(1) have T:hx,yi∈r/ unfolding IsLinOrder_def antisym_def
by autofrom TT AS(1-3) have y∈LeftRayX(X,r,x)x∈RightRayX(X,r,y) unfolding LeftRayX_def RightRayX_def
by auto moreover{
fix z assume z∈LeftRayX(X,r,x)∩RightRayX(X,r,y)then have hz,xi∈rhy,zi∈rz∈X-{x,y} unfolding RightRayX_def LeftRayX_def
by autowith A2 T have False by auto}
then have LeftRayX(X,r,x)∩RightRayX(X,r,y)=0 by auto moreover
have LeftRayX(X,r,x)∈(OrdTopology X r)RightRayX(X,r,y)∈(OrdTopology
X r)using base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]]AS by auto

910

ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}
ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}
ultimately have ∃ U∈(OrdTopology X r). ∃ V∈(OrdTopology X r). x∈U∧ y∈V ∧ U∩V=0 by auto}
then show thesis unfolding isT2_def by autoqed

Every order topology is T4 , but the proof needs lots of machinery. At theend of the file, we will prove that every order topology is normal; sooner orlater.

65.3

Connectedness properties

Connectedness is related to two properties of orders: completeness and density
Some order-dense properties:
definition
IsDenseSub (_ {is dense in}_{with respect to}_) whereA {is dense in}X{with respect to}r ≡∀ x∈X. ∀ y∈X. hx,yi∈r ∧ x6=y −→ (∃ z∈A-{x,y}. hx,zi∈r∧hz,yi∈r)definition
IsDenseUnp (_ {is not-properly dense in}_{with respect to}_) whereA {is not-properly dense in}X{with respect to}r ≡∀ x∈X. ∀ y∈X. hx,yi∈r ∧ x6=y −→ (∃ z∈A. hx,zi∈r∧hz,yi∈r)definition
IsWeaklyDenseSub (_ {is weakly dense in}_{with respect to}_) whereA {is weakly dense in}X{with respect to}r ≡∀ x∈X. ∀ y∈X. hx,yi∈r ∧ x6=y −→ ((∃ z∈A-{x,y}. hx,zi∈r∧hz,yi∈r)∨ IntervalX(X,r,x,y)=0)
definition
IsDense (_ {is dense with respect to}_) where
X {is dense with respect to}r ≡∀ x∈X. ∀ y∈X. hx,yi∈r ∧ x6=y −→ (∃ z∈X-{x,y}. hx,zi∈r∧hz,yi∈r)lemma dense_sub:
shows (X {is dense with respect to}r) ←→ (X {is dense in}X{with respectto}r)unfolding IsDenseSub_def IsDense_def by auto
lemma not_prop_dense_sub:911shows (A {is dense in}X{with respect to}r) −→ (A {is not-properly
dense in}X{with respect to}r)
unfolding IsDenseSub_def IsDenseUnp_def by auto

In densely ordered sets, intervals are infinite.
theorem dense_order_inf_intervals:
assumes IsLinOrder(X,r) IntervalX(X, r, b, c)6=0b∈Xc∈X X{is dense withrespect to}rshows ¬Finite(IntervalX(X, r, b, c))proofassume fin:Finite(IntervalX(X, r, b, c))have sub:IntervalX(X, r, b, c)⊆X unfolding IntervalX_def by auto
have p:Minimum(r,IntervalX(X, r, b, c))∈IntervalX(X, r, b, c) using
Finite_ZF_1_T2(2)[OF assms(1) Finite_Fin[OF fin sub] assms(2)]by autothen have hb,Minimum(r,IntervalX(X, r, b, c))i∈rb6=Minimum(r,IntervalX(X,r, b, c))unfolding IntervalX_def using Order_ZF_2_L1 by autowith assms(3,5) sub p obtain z1 where z1:z1∈Xz16=bz16=Minimum(r,IntervalX(X,r, b, c))hb,z1i∈rhz1,Minimum(r,IntervalX(X, r, b, c))i∈r
unfolding IsDense_def by blastfrom p have B:hMinimum(r,IntervalX(X, r, b, c)),ci∈r unfolding IntervalX_def
using Order_ZF_2_L1 by auto moreover
have trans(r) using assms(1) unfolding IsLinOrder_def by auto moreovernote z1(5) ultimately have z1a:hz1,ci∈r unfolding trans_def by fast{assume z1=cwith B have hMinimum(r,IntervalX(X, r, b, c)),z1i∈r by autowith z1(5) have z1=Minimum(r,IntervalX(X, r, b, c)) using assms(1)unfolding IsLinOrder_def antisym_def by auto
then have False using z1(3) by auto}
then have z16=c by autowith z1(1,2,4) z1a have z1∈IntervalX(X, r, b, c) unfolding IntervalX_def
using Order_ZF_2_L1 by auto
then have hMinimum(r,IntervalX(X, r, b, c)),z1i∈r using Finite_ZF_1_T2(4)[OF
assms(1) Finite_Fin[OF fin sub] assms(2)] by autowith z1(5) have z1=Minimum(r,IntervalX(X, r, b, c)) using assms(1)unfolding IsLinOrder_def antisym_def by autowith z1(3) show False by autoqed

Left rays are infinite.
theorem dense_order_inf_lrays:
assumes IsLinOrder(X,r) LeftRayX(X,r,c)6=0c∈Xto}rshows ¬Finite(LeftRayX(X,r,c))
proof -

912

X{is dense with respectfrom assms(2) obtain b where b∈Xhb,ci∈rb6=c unfolding LeftRayX_def
by autowith assms(3) obtain z where z∈X-{b,c}hb,zi∈rhz,ci∈r using assms(4)unfolding IsDense_def by auto
then have IntervalX(X, r, b, c)6=0 unfolding IntervalX_def using Order_ZF_2_L1
by autothen have nFIN:¬Finite(IntervalX(X, r, b, c)) using dense_order_inf_intervals[OFassms(1) _ _ assms(3,4)]
hb∈Xi by auto{
fix d assume d∈IntervalX(X, r, b, c)then have hb,di∈rhd,ci∈rd∈Xd6=bd6=c unfolding IntervalX_def using Order_ZF_2_L1
by autothen have d∈LeftRayX(X,r,c) unfolding LeftRayX_def by auto}
then have IntervalX(X, r, b, c)⊆LeftRayX(X,r,c) by autowith nFIN show thesis using subset_Finite by autoqed

Right rays are infinite.
theorem dense_order_inf_rrays:
assumes IsLinOrder(X,r) RightRayX(X,r,b)6=0b∈X X{is dense with respectto}rshows ¬Finite(RightRayX(X,r,b))
proof from assms(2) obtain c where c∈Xhb,ci∈rb6=c unfolding RightRayX_def
by autowith assms(3) obtain z where z∈X-{b,c}hb,zi∈rhz,ci∈r using assms(4)unfolding IsDense_def by auto
then have IntervalX(X, r, b, c)6=0 unfolding IntervalX_def using Order_ZF_2_L1
by autothen have nFIN:¬Finite(IntervalX(X, r, b, c)) using dense_order_inf_intervals[OFassms(1) _ assms(3) _ assms(4)]hc∈Xi by auto{
fix d assume d∈IntervalX(X, r, b, c)then have hb,di∈rhd,ci∈rd∈Xd6=bd6=c unfolding IntervalX_def using Order_ZF_2_L1
by autothen have d∈RightRayX(X,r,b) unfolding RightRayX_def by auto}
then have IntervalX(X, r, b, c)⊆RightRayX(X,r,b) by autowith nFIN show thesis using subset_Finite by autoqed

The whole space in a densely ordered set is infinite.
corollary dense_order_infinite:assumes IsLinOrder(X,r) X{is dense with respect to}r
∃ x y. x6=y∧x∈X∧y∈X
shows ¬(X≺nat)913

proof from assms(3) obtain b c where B:b∈Xc∈Xb6=c by auto{
assume hb,ci∈r/with assms(1) have hc,bi∈r unfolding IsLinOrder_def IsTotal_def using hb∈Xihc∈Xi by autowith assms(2) B obtain z where z∈X-{b,c}hc,zi∈rhz,bi∈r unfolding
IsDense_def by auto
then have IntervalX(X,r,c,b)6=0 unfolding IntervalX_def using Order_ZF_2_L1
by autothen have ¬(Finite(IntervalX(X,r,c,b))) using dense_order_inf_intervals[OFassms(1) _ hc∈Xihb∈Xi assms(2)]by auto moreover
have IntervalX(X,r,c,b)⊆X unfolding IntervalX_def by auto
ultimately have ¬(Finite(X)) using subset_Finite by auto
then have ¬(X≺nat) using lesspoll_nat_is_Finite by auto}
moreover{assume hb,ci∈rwith assms(2) B obtain z where z∈X-{b,c}hb,zi∈rhz,ci∈r unfolding
IsDense_def by auto
then have IntervalX(X,r,b,c)6=0 unfolding IntervalX_def using Order_ZF_2_L1
by autothen have ¬(Finite(IntervalX(X,r,b,c))) using dense_order_inf_intervals[OFassms(1) _ hb∈Xihc∈Xi assms(2)]by auto moreover
have IntervalX(X,r,b,c)⊆X unfolding IntervalX_def by auto
ultimately have ¬(Finite(X)) using subset_Finite by auto
then have ¬(X≺nat) using lesspoll_nat_is_Finite by auto}
ultimately show thesis by autoqed

If an order topology is connected, then the order is complete. It is equivalent
to assume that r ⊆ X × X or prove that r ∩ X × X is complete.
theorem conn_imp_complete:assumes IsLinOrder(X,r) ∃ x y. x6=y∧x∈X∧y∈X r⊆X×X(OrdTopology X r){is connected}
shows r{is complete}
proof {
assume ¬(r{is complete})Tthen obtain A where A:A6=0IsBoundedAbove(A,r)¬(HasAminimum(r,b∈A.
r {b})) unfolding
IsComplete_def by auto
TT
from A(3) have r1:∀ m∈ b∈A. r {b}. ∃ x∈ b∈A. r {b}. hm,xi∈r/ unfolding HasAminimum_def
by force914

from A(1,2) obtain b where r2:∀ x∈A. hx, bi ∈ r unfolding IsBoundedAbove_def
by autowith assms(3) A(1) have A⊆Xb∈X by autowith assms(3) have r3:∀ c∈A. r {c}⊆X using image_iff by autofrom r2 have ∀ x∈A.
T b∈r{x} using image_iff by auto
then have noE:b∈( b∈A. r {b}) using A(1) by auto{T
fix x assume x∈( b∈A. r {b})then have ∀ c∈A. x∈r{c} by autowith A(1) obtain c where c∈A x∈r{c} by autowith r3 have x∈X by auto}T
then have sub:( b∈A. r {b})⊆X by auto{T
fix x assume x:x∈(
T b∈A. r {b})with r1 have ∃ z∈ b∈A. r T{b}. hx,zi∈r/ by auto
then obtain z where z:z∈( b∈A. r {b})hx,zi∈r/ by autofrom x z(1) sub have x∈Xz∈X by autowith z(2) have hz,xi∈r using assms(1) unfolding IsLinOrder_def IsTotal_def
by autothen have xx:x∈RightRayX(X,r,z) unfolding RightRayX_def using hx∈Xihhx,zi∈r/ iassms(1) unfolding IsLinOrder_def using total_is_refl unfolding refl_def by auto{
fix m assume m∈RightRayX(X,r,z)then have m:m∈X-{z}hz,mi∈r unfolding RightRayX_def by auto{
fix c assume c∈Awith z(1) have hc,zi∈r using image_iff by autowith m(2) have hc,mi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fastthen have m∈r{c} using image_iff by auto}Twith A(1) have m∈( b∈A. r {b}) by auto}T
then have sub1:RightRayX(X,r,z)⊆( b∈A. r {b}) by auto
have RightRayX(X,r,z)∈(OrdTopology X r) using
base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] hz∈Xiby autoTwith sub1 xx have ∃ U∈(OrdTopology X r). x∈U ∧ U⊆( b∈A. r {b})by auto}Tthen have ( b∈A. r {b})∈(OrdTopology X r) using topology0.open_neigh_open[OFtopology0_ordtopology[OF assms(1)]]by auto moreover{T
fix x assume x∈X-(
T b∈A. r {b})then have x∈Xx∈(/b∈A. r {b}) by autowith A(1) obtain b where x∈r{b}b∈A/
by auto915

then have hb,xi∈r/ using image_iff by autowith hA⊆Xi hb∈Aihx∈Xi have hx,bi∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def by auto
then have xx:x∈LeftRayX(X,r,b) unfolding LeftRayX_def using hx∈Xi
hhb,xi∈r/ iassms(1) unfolding IsLinOrder_def using total_is_refl unfolding refl_def by auto{T
fix y assume y∈LeftRayX(X,r,b)∩( b∈A. r {b})then have y∈X-{b}hy,bi∈r∀ c∈A. y∈r{c} unfolding LeftRayX_def by
auto
then have y∈Xhy,bi∈r∀ c∈A. hc,yi∈r using image_iff by autowith hb∈Ai have y=b using assms(1) unfolding IsLinOrder_def antisym_def
by autothen have False using hy∈X-{b}i by auto}T
then have sub1:LeftRayX(X,r,b)⊆X-( b∈A. r {b}) unfolding LeftRayX_def
by autohave LeftRayX(X,r,b)∈(OrdTopology X r) using
base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] hb∈AihA⊆Xi
by blastTwith sub1 xx have ∃ U∈(OrdTopology X r). x∈U∧U⊆X-( b∈A. r {b})by auto}Tthen have X - ( b∈A. r {b})∈(OrdTopology X r) using topology0.open_neigh_open[OFtopology0_ordtopology[OF assms(1)]]by auto S
Tthen have(OrdTopology X r)-( b∈A. r {b})∈(OrdTopology X r) using union_ordtopology[OFassms(1,2)] by autoT
then have ( b∈A. r {b}){is closed in}(OrdTopology X r) unfolding
IsClosed_def using union_ordtopology[OF assms(1,2)]
sub by auto
moreoverT note assms(4) ultimately
T
have ( b∈A. r {b})=0∨( b∈A. r {b})=X using union_ordtopology[OFassms(1,2)] unfolding IsConnected_def
by autoTthen have e1:( b∈A. r {b})=X using noE by auto
then have ∀ x∈X. ∀ b∈A. x∈r{b} by auto
then have r4:∀ x∈X. ∀ b∈A. hb,xi∈r using image_iff by auto{
fix a1 a2 assume aA:a1∈Aa2∈Aa16=a2
with hA⊆Xi have aX:a1∈Xa2∈X by autowith r4 aA(1,2) have ha1,a2i∈rha2,a1i∈r by auto
then have a1=a2 using assms(1) unfolding IsLinOrder_def antisym_def
by autowith aA(3) have False by auto}
moreoverfrom A(1) obtain t where t∈A by auto

916

ultimately have A={t} by autowith r4 have ∀ x∈X. ht,xi∈rt∈X using hA⊆Xi by auto
then have HasAminimum(r,X) T
unfolding HasAminimum_def by autowith e1 have HasAminimum(r, b∈A. r {b}) by autowith A(3) have False by auto}
then show thesis by autoqed

If an order topology is connected, then the order is dense.
theorem conn_imp_dense:
assumes IsLinOrder(X,r) ∃ x y. x6=y∧x∈X∧y∈X(OrdTopology X r){is connected}
shows X {is dense with respect to}r
proof {
assume ¬(X {is dense with respect to}r)then have ∃ x1∈X. ∃ x2∈X. hx1,x2i∈r∧x16=x2∧(∀ z∈X-{x1,x2}. hx1,zi∈r∨hz,x2i/∈r)/
unfolding IsDense_def by auto
then obtain x1 x2 where x:x1∈Xx2∈Xhx1,x2i∈rx16=x2(∀ z∈X-{x1,x2}. hx1,zi∈r∨hz,x2i/∈r)/
by autofrom x(1,2) have P:LeftRayX(X,r,x2)∈(OrdTopology X r)RightRayX(X,r,x1)∈(OrdTopology
X r)using base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]]by auto{fix x assume x∈X-LeftRayX(X,r,x2)
then have x∈X x∈LeftRayX(X,r,x2)/
by autothen have hx,x2i∈r∨x=x2/
unfolding LeftRayX_def by auto
then have hx2,xi∈r∨x=x2 using assms(1) hx∈Xi hx2∈Xi unfolding IsLinOrder_def
IsTotal_def by auto
then have s:hx2,xi∈r using assms(1) unfolding IsLinOrder_def using total_is_refl hx2∈Xi
unfolding refl_def by autowith x(3) have hx1,xi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fastthen have x=x1∨x∈RightRayX(X,r,x1) unfolding RightRayX_def using hx∈Xi by autowith s have hx2,x1i∈r∨x∈RightRayX(X,r,x1) by autowith x(3) have x1=x2 ∨ x∈RightRayX(X,r,x1) using assms(1) unfolding IsLinOrder_def
antisym_def by autowith x(4) have x∈RightRayX(X,r,x1) by auto}
then have X-LeftRayX(X,r,x2)⊆RightRayX(X,r,x1) by auto moreover{
fix x assume x∈RightRayX(X,r,x1)
then have xr:x∈X-{x1}hx1,xi∈r unfolding RightRayX_def by auto{

917

assume x∈LeftRayX(X,r,x2)
then have xl:x∈X-{x2}hx,x2i∈r unfolding LeftRayX_def by autofrom xl xr x(5) have False by auto}with xr(1) have x∈X-LeftRayX(X,r,x2) by auto}
ultimately have RightRayX(X,r,x1)=X-LeftRayX(X,r,x2) by auto
then have LeftRayX(X,r,x2){is closed in}(OrdTopology X r) using P(2)union_ordtopology[
OF assms(1,2)] unfolding IsClosed_def LeftRayX_def by autowith P(1) have LeftRayX(X,r,x2)=0∨LeftRayX(X,r,x2)=X using union_ordtopology[
OF assms(1,2)] assms(3) unfolding IsConnected_def by autowith x(1,3,4) have LeftRayX(X,r,x2)=X unfolding LeftRayX_def by auto
then have x2∈LeftRayX(X,r,x2) using x(2) by auto
then have False unfolding LeftRayX_def by auto}
then show thesis by auto
qed

Actually a connected order topology is one that comes from a dense andcomplete order.
First a lemma. In a complete ordered set, every non-empty set boundedfrom below has a maximum lower bound.
lemma complete_order_bounded_below:
assumes r{is complete}
T IsBoundedBelow(A,r) A6=0 r⊆X×Xshows HasAmaximum(r, c∈A. r-{c})proof - T
let M= c∈A. r-{c}from assms(3) obtain t where A:t∈A by auto{
fix m assume m∈Mwith A have m∈r-{t} by auto
then have hm,ti∈r by auto}T
then have (∀ x∈ c∈A. r - {c}. hx, ti ∈ r) by auto
then have IsBoundedAbove(M,r) unfolding IsBoundedAbove_def by auto
moreoverfrom assms(2,3) obtain l where ∀ x∈A. hl, xi ∈ r unfolding IsBoundedBelow_def
by autothen have ∀ x∈A. l ∈ r-{x} using vimage_iff by autowith assms(3) have l∈M by auto
then have M6=0 by auto moreover
T note assms(1)ultimately have HasAminimum(r, c∈M. r {c}) unfolding IsComplete_def
by autoT
T
then obtain rr where rr:rr∈( c∈M. r {c}) ∀ s∈( c∈M. r {c}). hrr,si∈r
unfolding HasAminimum_def
by auto{918

fix aa assume A:aa∈A{
fix c assume M:c∈M
with A have hc,aai∈r by auto
then have aa∈r{c} by auto}T
then have aa∈( c∈M. r {c}) using rr(1) by auto}T
then have A⊆( c∈M. r {c}) by autowith rr(2) have ∀ s∈A. hrr,si∈r by auto
then have rr∈M using assms(3) by auto
moreover{fix m assume m∈Mthen have rr∈r{m} using rr(1) by auto
then have hm,rri∈r by auto}
then have ∀ m∈M. hm,rri∈r by auto
ultimately show thesis unfolding HasAmaximum_def by autoqed
theorem comp_dense_imp_conn:
assumes IsLinOrder(X,r) ∃ x y. x6=y∧x∈X∧y∈X r⊆X×X
X {is dense with respect to}r r{is complete}
shows (OrdTopology X r){is connected}
proof {
assume ¬((OrdTopology X r){is connected})then obtain U where U:U6=0U6=XU∈(OrdTopology X r)U{is closed in}(OrdTopology
X r)
unfolding IsConnected_def using union_ordtopology[OF assms(1,2)]by autofrom U(4) have A:X-U∈(OrdTopology X r)U⊆X unfolding IsClosed_def
using union_ordtopology[OF assms(1,2)] by autofrom U(1) obtain u where u∈U by autofrom A(2) U(1,2) have X-U6=0 by auto
then obtain v where v∈X-U by autowith hu∈Ui hU⊆Xi have hu,vi∈r∨hv,ui∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def
by auto{assume hu,vi∈r
have LeftRayX(X,r,v)∈(OrdTopology X r) using base_sets_open[OFOrdtopology_is_a_topology(2)[OF assms(1)]]hv∈X-Ui by auto
then have U∩LeftRayX(X,r,v)∈(OrdTopology X r) using U(3) using
Ordtopology_is_a_topology(1)[OF assms(1)] unfolding IsATopology_def by auto{919

fix b assume b∈(U)∩LeftRayX(X,r,v)
then have hb,vi∈r unfolding LeftRayX_def by auto}
then have bound:IsBoundedAbove(U∩LeftRayX(X,r,v),r) unfolding IsBoundedAbove_def
by auto moreoverwith hhu,vi∈rihu∈UihU⊆Xihv∈X-Ui have nE:U∩LeftRayX(X,r,v)6=0 unfolding LeftRayX_def by autoT
ultimately have Hmin:HasAminimum(r, c∈U∩LeftRayX(X,r,v). r{c})using assms(5) unfolding IsComplete_def
by autolet min=Supremum(r,U∩LeftRayX(X,r,v)){
fix c assume c∈U∩LeftRayX(X,r,v)
then have hc,vi∈r unfolding LeftRayX_def by auto}
then have a1:hmin,vi∈r using Order_ZF_5_L3[OF _ nE Hmin] assms(1)unfolding IsLinOrder_def
by auto{assume ass:min∈Uthen obtain V where V:min∈VV⊆U
V∈{IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X} using point_open_base_neigh[OF Ordtopology_is_a_topology(2)[OF assms(1)] hU∈(OrdTopologyiX r) ass] by blast{
assume V∈{RightRayX(X,r,b). b∈X}then obtain b where b:b∈X V=RightRayX(X,r,b) by auto
note a1 moreoverfrom V(1) b(2) have a2:hb,mini∈rmin6=b unfolding RightRayX_def
by autoultimately have hb,vi∈r using assms(1) unfolding IsLinOrder_def
trans_def by blast moreover{
assume b=v
with a1 a2(1) have b=min using assms(1) unfolding IsLinOrder_def
antisym_def by autowith a2(2) have False by auto}
ultimately have False using V(2) b(2) unfolding RightRayX_def
using hv∈X-Ui by auto}
moreover{assume V∈{LeftRayX(X,r,b). b∈X}then obtain b where b:V=LeftRayX(X,r,b) b∈X by auto{
assume hv,bi∈rthen have b=v∨v∈LeftRayX(X,r,b) unfolding LeftRayX_def us-920

ing hv∈X-Ui by auto
then have b=v using b(1) V(2) hv∈X-Ui by auto}
then have bv:hb,vi∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def using b(2)hv∈X-Ui by autofrom b(1) V(1) have hmin,bi∈rmin6=b unfolding LeftRayX_def by
autowith assms(4) obtain z where z:hmin,zi∈rhz,bi∈rz∈X-{b,min}unfolding IsDense_def
using b(2) V(1,2) hU⊆Xi by blast
then have rayb:z∈LeftRayX(X,r,b) unfolding LeftRayX_def by
auto
from z(2) bv have hz,vi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fast
moreover{assume z=v
with bv have hb,zi∈r by autowith z(2) have b=z using assms(1) unfolding IsLinOrder_def
antisym_def by auto
then have False using z(3) by auto}
ultimately have z∈LeftRayX(X,r,v) unfolding LeftRayX_def using z(3) by autowith rayb have z∈U∩LeftRayX(X,r,v) using V(2) b(1) by auto
then have min∈r{z} using Order_ZF_4_L4(1)[OF _ Hmin] assms(1)unfolding Supremum_def IsLinOrder_def
by autothen have hz,mini∈r by autowith z(1,3) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
moreover{assume V∈{IntervalX(X,r,b,c). hb,ci∈X×X}
then obtain b c where b:V=IntervalX(X,r,b,c) b∈Xc∈X by autofrom b V(1) have m:hmin,ci∈rhb,mini∈rmin6=b min6=c unfolding
IntervalX_def Interval_def by auto{
assume A:hc,vi∈rfrom m obtain z where z:hz,ci∈r hmin,zi∈rz∈X-{c,min} using assms(4) unfolding IsDense_def
using b(3) V(1,2) hU⊆Xi by blastfrom z(2) have hb,zi∈r using m(2) assms(1) unfolding IsLinOrder_def
trans_defby fastwith z(1) have z∈IntervalX(X,r,b,c)∨z=b using z(3) unfolding IntervalX_def

921

Interval_def by auto
then have z∈IntervalX(X,r,b,c) using m(2) z(2,3) using assms(1)unfolding IsLinOrder_def
antisym_def by autowith b(1) V(2) have z∈U by auto moreoverfrom A z(1) have hz,vi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fast
moreover have z6=v using A z(1,3) assms(1) unfolding IsLinOrder_def
antisym_def by auto
ultimately have z∈U∩LeftRayX(X,r,v) unfolding LeftRayX_def
using z(3) by auto
then have min∈r{z} using Order_ZF_4_L4(1)[OF _ Hmin] assms(1)unfolding Supremum_def IsLinOrder_def
by autothen have hz,mini∈r by autowith z(2,3) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
then have vc:hv,ci∈rv6=c using assms(1) unfolding IsLinOrder_def
IsTotal_def using hv∈X-Uib(3) by auto{
assume min=v
with V(2,1) hv∈X-Ui have False by auto}
then have min6=v by autowith a1 obtain z where z:hmin,zi∈rhz,vi∈rz∈X-{min,v} using
assms(4) unfolding IsDense_def
using V(1,2) hU⊆Xihv∈X-Ui by blastfrom z(2) vc(1) have zc:hz,ci∈r using assms(1) unfolding IsLinOrder_def
trans_defby fast moreoverfrom m(2) z(1) have hb,zi∈r using assms(1) unfolding IsLinOrder_def
trans_defby fast ultimately
have z∈Interval(r,b,c) using Order_ZF_2_L1B by auto moreover{
assume z=cthen have False using z(2) vc using assms(1) unfolding IsLinOrder_def
antisym_def
by fast}then have z6=c by auto moreover{
assume z=b
then have z=min using m(2) z(1) using assms(1) unfolding
IsLinOrder_def
antisym_def by autowith z(3) have False by auto922

}then have z6=b by auto moreover
have z∈X using z(3) by auto ultimately
have z∈IntervalX(X,r,b,c) unfolding IntervalX_def by auto
then have z∈V using b(1) by auto
then have z∈U using V(2) by auto moreoverfrom z(2,3) have z∈LeftRayX(X,r,v) unfolding LeftRayX_def by
auto ultimately
have z∈U∩LeftRayX(X,r,v) by auto
then have min∈r{z} using Order_ZF_4_L4(1)[OF _ Hmin] assms(1)unfolding Supremum_def IsLinOrder_def
by autothen have hz,mini∈r by autowith z(1,3) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
ultimately have False using V(3) by auto}
then have ass:min∈X-U using a1 assms(3) by auto
then obtain V where V:min∈VV⊆X-U
V∈{IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X} using point_open_base_neigh[OF Ordtopology_is_a_topology(2)[OF assms(1)] hX-U∈(OrdTopologyiX r) ass] by blast{
assume V∈{IntervalX(X,r,b,c). hb,ci∈X×X}
then obtain b c where b:V=IntervalX(X,r,b,c)b∈Xc∈X by autofrom b V(1) have m:hmin,ci∈rhb,mini∈rmin6=b min6=c unfolding IntervalX_def
Interval_def by auto{
fix x assume A:x∈U∩LeftRayX(X,r,v)
then have hx,vi∈rx∈U unfolding LeftRayX_def by auto
then have x∈V/ using V(2) by auto
then have x∈Interval(r,/b, c) ∩ X∨x=b∨x=c using b(1) unfolding IntervalX_def by auto
then have (hb,xi∈r∨hx,ci/∈r)∨x=b∨x=cx∈X/using Order_ZF_2_L1B
hx∈UihU⊆Xi by auto
then have (hx,bi∈r∨hc,xi∈r)∨x=b∨x=c using assms(1) unfolding IsLinOrder_def IsTotal_def
using b(2,3) by auto
then have (hx,bi∈r∨hc,xi∈r) using assms(1) unfolding IsLinOrder_def
using total_is_refl
unfolding refl_def using b(2,3) by auto moreoverfrom A have hx,mini∈r using Order_ZF_4_L4(1)[OF _ Hmin] assms(1)unfolding Supremum_def IsLinOrder_def
by autoultimately have (hx,bi∈r∨hc,mini∈r) using assms(1) unfolding
IsLinOrder_def trans_def
by fast923

with m(1) have (hx,bi∈r∨c=min) using assms(1) unfolding IsLinOrder_def
antisym_def by autowith m(4) have hx,bi∈r by auto}
then have hmin,bi∈r using Order_ZF_5_L3[OF _ nE Hmin] assms(1)unfolding IsLinOrder_def by autowith m(2,3) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
moreover{assume V∈{RightRayX(X,r,b). b∈X}then obtain b where b:V=RightRayX(X,r,b) b∈X by autofrom b V(1) have m:hb,mini∈rmin6=b unfolding RightRayX_def by
auto{
fix x assume A:x∈U∩LeftRayX(X,r,v)
then have hx,vi∈rx∈U unfolding LeftRayX_def by auto
then have x∈V/ using V(2) by auto
then have x∈RightRayX(X,r,/b) using b(1) by auto
then have (hb,xi∈r∨x=b)x∈X/
unfolding RightRayX_def using hx∈UihU⊆Xi
by autothen have hx,bi∈r using assms(1) unfolding IsLinOrder_def using total_is_refl unfolding
refl_def unfolding IsTotal_def using b(2) by auto}
then have hmin,bi∈r using Order_ZF_5_L3[OF _ nE Hmin] assms(1)unfolding IsLinOrder_def by autowith m(2,1) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto
} moreover{
assume V∈{LeftRayX(X,r,b). b∈X}then obtain b where b:V=LeftRayX(X,r,b) b∈X by autofrom b V(1) have m:hmin,bi∈rmin6=b unfolding LeftRayX_def by auto{
fix x assume A:x∈U∩LeftRayX(X,r,v)
then have hx,vi∈rx∈U unfolding LeftRayX_def by auto
then have x∈V/ using V(2) by auto
then have x∈LeftRayX(X,r,/b) using b(1) by auto
then have (hx,bi∈r∨x=b)x∈X/
unfolding LeftRayX_def using hx∈UihU⊆Xi
by autothen have hb,xi∈r using assms(1) unfolding IsLinOrder_def using total_is_refl unfolding
refl_def unfolding IsTotal_def using b(2) by autowith m(1) have hmin,xi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fast
moreoverfrom bound A have ∃ g. ∀ y∈U∩LeftRayX(X,r,v). hy,gi∈r using

924

nE
unfolding IsBoundedAbove_def by auto
then obtain g where g:∀ y∈U∩LeftRayX(X,r,v). hy,gi∈r by autowith nE obtain t where t∈U∩LeftRayX(X,r,v) by autowith g have ht,gi∈r by autowith assms(3) have g∈X by autowith g have boundX:∃ g∈X. ∀ y∈U∩LeftRayX(X,r,v). hy,gi∈r by
auto

have hx,mini∈r using Order_ZF_5_L7(2)[OF assms(3) _ assms(5)_ nE boundX]
assms(1) hU⊆Xi A unfolding LeftRayX_def IsLinOrder_def by
auto
ultimately have x=min using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
then have U∩LeftRayX(X,r,v)⊆{min} by auto moreover{
assume min∈U∩LeftRayX(X,r,v)
then have min∈U by auto
then have False using V(1,2) by auto}
ultimately have False using nE by auto}
moreover note V(3)ultimately have False by auto}with assms(1) have hv,ui∈r unfolding IsLinOrder_def IsTotal_def using hu∈UihU⊆Xi
hv∈X-Ui by auto
have RightRayX(X,r,v)∈(OrdTopology X r) using base_sets_open[OF Ordtopology_is_a_topolo
assms(1)]]hv∈X-Ui by auto
then have U∩RightRayX(X,r,v)∈(OrdTopology X r) using U(3) using Ordtopology_is_a_topolo[OF assms(1)] unfolding IsATopology_def by auto{
fix b assume b∈(U)∩RightRayX(X,r,v)
then have hv,bi∈r unfolding RightRayX_def by auto}
then have bound:IsBoundedBelow(U∩RightRayX(X,r,v),r) unfolding IsBoundedBelow_def
by autowith hhv,ui∈rihu∈UihU⊆Xihv∈X-Ui have nE:U∩RightRayX(X,r,v)6=0 unfolding RightRayX_def by autoT
have Hmax:HasAmaximum(r, c∈U∩RightRayX(X,r,v). r-{c}) using complete_order_bounded_bel
assms(5) bound nE assms(3)].
let max=Infimum(r,U∩RightRayX(X,r,v)){
fix c assume c∈U∩RightRayX(X,r,v)
then have hv,ci∈r unfolding RightRayX_def by auto}925

then have a1:hv,maxi∈r using Order_ZF_5_L4[OF _ nE Hmax] assms(1)unfolding IsLinOrder_def
by auto{assume ass:max∈Uthen obtain V where V:max∈VV⊆U
V∈{IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X} using point_open_base_neigh[OF Ordtopology_is_a_topology(2)[OF assms(1)] hU∈(OrdTopology
X r)i ass] by blast{
assume V∈{RightRayX(X,r,b). b∈X}then obtain b where b:b∈X V=RightRayX(X,r,b) by autofrom V(1) b(2) have a2:hb,maxi∈rmax6=b unfolding RightRayX_def
by auto{assume hb,vi∈rthen have b=v∨v∈RightRayX(X,r,b) unfolding RightRayX_def using hv∈X-Ui by auto
then have b=v using b(2) V(2) hv∈X-Ui by auto}
then have bv:hv,bi∈r using assms(1) unfolding IsLinOrder_def IsTotal_def
using b(1)hv∈X-Ui by autofrom a2 assms(4) obtain z where z:hb,zi∈rhz,maxi∈rz∈X-{b,max}
unfolding IsDense_def
using b(1) V(1,2) hU⊆Xi by blast
then have rayb:z∈RightRayX(X,r,b) unfolding RightRayX_def by
auto
from z(1) bv have hv,zi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fast moreover{
assume z=v
with bv have hz,bi∈r by autowith z(1) have b=z using assms(1) unfolding IsLinOrder_def
antisym_def by auto
then have False using z(3) by auto}
ultimately have z∈RightRayX(X,r,v) unfolding RightRayX_def using z(3) by autowith rayb have z∈U∩RightRayX(X,r,v) using V(2) b(2) by auto
then have max∈r-{z} using Order_ZF_4_L3(1)[OF _ Hmax] assms(1)unfolding Infimum_def IsLinOrder_def
by autothen have hmax,zi∈r by autowith z(2,3) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
moreover926

{assume V∈{LeftRayX(X,r,b). b∈X}then obtain b where b:V=LeftRayX(X,r,b) b∈X by auto
note a1 moreoverfrom V(1) b(1) have a2:hmax,bi∈rmax6=b unfolding LeftRayX_def
by autoultimately have hv,bi∈r using assms(1) unfolding IsLinOrder_def
trans_def by blast moreover{
assume b=v
with a1 a2(1) have b=max using assms(1) unfolding IsLinOrder_def
antisym_def by autowith a2(2) have False by auto}
ultimately have False using V(2) b(1) unfolding LeftRayX_def using hv∈X-Ui by auto}
moreover{assume V∈{IntervalX(X,r,b,c). hb,ci∈X×X}
then obtain b c where b:V=IntervalX(X,r,b,c) b∈Xc∈X by autofrom b V(1) have m:hmax,ci∈rhb,maxi∈rmax6=b max6=c unfolding IntervalX_def
Interval_def by auto{
assume A:hv,bi∈rfrom m obtain z where z:hz,maxi∈r hb,zi∈rz∈X-{b,max} using
assms(4) unfolding IsDense_def
using b(2) V(1,2) hU⊆Xi by blastfrom z(1) have hz,ci∈r using m(1) assms(1) unfolding IsLinOrder_def
trans_defby fastwith z(2) have z∈IntervalX(X,r,b,c)∨z=c using z(3) unfolding IntervalX_def
Interval_def by auto
then have z∈IntervalX(X,r,b,c) using m(1) z(1,3) using assms(1)unfolding IsLinOrder_def
antisym_def by autowith b(1) V(2) have z∈U by auto moreoverfrom A z(2) have hv,zi∈r using assms(1) unfolding IsLinOrder_def
trans_def by fast
moreover have z6=v using A z(2,3) assms(1) unfolding IsLinOrder_def
antisym_def by auto
ultimately have z∈U∩RightRayX(X,r,v) unfolding RightRayX_def
using z(3) by auto
then have max∈r-{z} using Order_ZF_4_L3(1)[OF _ Hmax] assms(1)unfolding Infimum_def IsLinOrder_def
by autothen have hmax,zi∈r by autowith z(1,3) have False using assms(1) unfolding IsLinOrder_def

927

antisym_def by auto}
then have vc:hb,vi∈rv6=b using assms(1) unfolding IsLinOrder_def
IsTotal_def using hv∈X-Uib(2) by auto{
assume max=v
with V(2,1) hv∈X-Ui have False by auto}
then have v6=max by auto moreovernote a1 moreover
have max∈X using V(1,2) hU⊆Xi by auto
moreover have v∈X using hv∈X-Ui by auto
ultimately obtain z where z:hv,zi∈rhz,maxi∈rz∈X-{v,max} using
assms(4) unfolding IsDense_def
by autofrom z(1) vc(1) have zc:hb,zi∈r using assms(1) unfolding IsLinOrder_def
trans_defby fast moreoverfrom m(1) z(2) have hz,ci∈r using assms(1) unfolding IsLinOrder_def
trans_defby fast ultimately
have z∈Interval(r,b,c) using Order_ZF_2_L1B by auto moreover{
assume z=b
then have False using z(1) vc using assms(1) unfolding IsLinOrder_def
antisym_def
by fast}then have z6=b by auto moreover{
assume z=cthen have z=max using m(1) z(2) using assms(1) unfolding IsLinOrder_def
antisym_def by autowith z(3) have False by auto}
then have z6=c by auto moreover
have z∈X using z(3) by auto ultimately
have z∈IntervalX(X,r,b,c) unfolding IntervalX_def by auto
then have z∈V using b(1) by auto
then have z∈U using V(2) by auto moreoverfrom z(1,3) have z∈RightRayX(X,r,v) unfolding RightRayX_def by
auto ultimately
have z∈U∩RightRayX(X,r,v) by auto
then have max∈r-{z} using Order_ZF_4_L3(1)[OF _ Hmax] assms(1)unfolding Infimum_def IsLinOrder_def
by autothen have hmax,zi∈r by autowith z(2,3) have False using assms(1) unfolding IsLinOrder_def

928

antisym_def by auto}
ultimately have False using V(3) by auto}
then have ass:max∈X-U using a1 assms(3) by auto
then obtain V where V:max∈VV⊆X-U
V∈{IntervalX(X,r,b,c). hb,ci∈X×X}∪{LeftRayX(X,r,b). b∈X}∪{RightRayX(X,r,b).
b∈X} using point_open_base_neigh[OF Ordtopology_is_a_topology(2)[OF assms(1)] hX-U∈(OrdTopology
X r)i ass] by blast{
assume V∈{IntervalX(X,r,b,c). hb,ci∈X×X}
then obtain b c where b:V=IntervalX(X,r,b,c)b∈Xc∈X by autofrom b V(1) have m:hmax,ci∈rhb,maxi∈rmax6=b max6=c unfolding IntervalX_def
Interval_def by auto{
fix x assume A:x∈U∩RightRayX(X,r,v)
then have hv,xi∈rx∈U unfolding RightRayX_def by auto
then have x∈V/ using V(2) by auto
then have x∈Interval(r,/b, c) ∩ X∨x=b∨x=c using b(1) unfolding IntervalX_def by auto
then have (hb,xi∈r∨hx,ci/∈r)∨x=b∨x=cx∈X/using Order_ZF_2_L1B hx∈UihU⊆Xi
by autothen have (hx,bi∈r∨hc,xi∈r)∨x=b∨x=c using assms(1) unfolding
IsLinOrder_def IsTotal_def
using b(2,3) by auto
then have (hx,bi∈r∨hc,xi∈r) using assms(1) unfolding IsLinOrder_def
using total_is_refl
unfolding refl_def using b(2,3) by auto moreoverfrom A have hmax,xi∈r using Order_ZF_4_L3(1)[OF _ Hmax] assms(1)unfolding Infimum_def IsLinOrder_def
by autoultimately have (hmax,bi∈r∨hc,xi∈r) using assms(1) unfolding IsLinOrder_def
trans_defby fastwith m(2) have (max=b∨hc,xi∈r) using assms(1) unfolding IsLinOrder_def
antisym_def by autowith m(3) have hc,xi∈r by auto}
then have hc,maxi∈r using Order_ZF_5_L4[OF _ nE Hmax] assms(1) unfolding IsLinOrder_def by autowith m(1,4) have False using assms(1) unfolding IsLinOrder_def
antisym_def by auto}
moreover{assume V∈{RightRayX(X,r,b). b∈X}then obtain b where b:V=RightRayX(X,r,b) b∈X by autofrom b V(1) have m:hb,maxi∈rmax6=b unfolding RightRayX_def by auto929

{
fix x assume A:x∈U∩RightRayX(X,r,v)
then have hv,xi∈rx∈U unfolding RightRayX_def by auto
then have x∈V/ using V(2) by auto
then have x∈RightRayX(X,r,/b) using b(1) by auto
then have (hb,xi∈r∨x=b)x∈X/
unfolding RightRayX_def using hx∈UihU⊆Xi
by autothen have hx,bi∈r using assms(1) unfolding IsLinOrder_def using total_is_refl unfolding
refl_def unfolding IsTotal_def using b(2) by auto moreoverfrom A have hmax,xi∈r using Order_ZF_4_L3(1)[OF _ Hmax] assms(1)unfolding Infimum_def IsLinOrder_def
by auto ultimately
have hmax,bi∈r using assms(1) unfolding IsLinOrder_def trans_def
by fastwith m have False using assms(1) unfolding IsLinOrder_def antisym_def
by auto}then have False using nE by auto
} moreover{
assume V∈{LeftRayX(X,r,b). b∈X}then obtain b where b:V=LeftRayX(X,r,b) b∈X by autofrom b V(1) have m:hmax,bi∈rmax6=b unfolding LeftRayX_def by auto{
fix x assume A:x∈U∩RightRayX(X,r,v)
then have hv,xi∈rx∈U unfolding RightRayX_def by auto
then have x∈V/ using V(2) by auto
then have x∈LeftRayX(X,r,/b) using b(1) by auto
then have (hx,bi∈r∨x=b)x∈X/
unfolding LeftRayX_def using hx∈UihU⊆Xi
by autothen have hb,xi∈r using assms(1) unfolding IsLinOrder_def using total_is_refl unfolding
refl_def unfolding IsTotal_def using b(2) by auto
then have b∈r-{x} by auto}Twith nE have b∈( c∈U∩RightRayX(X,r,v). r-{c}) by auto
then have hb,maxi∈r unfolding Infimum_def using Order_ZF_4_L3(2)[OF_ Hmax] assms(1)unfolding IsLinOrder_def by autowith m have False using assms(1) unfolding IsLinOrder_def antisym_def
by auto}moreover note V(3)ultimately have False by auto}
then show thesis by auto
qed

930

65.4

Numerability axioms

A κ-separable order topology is in relation with order density.
If an order topology has a subset A which is topologically dense, then that
subset is weakly order-dense in X.
lemma dense_top_imp_Wdense_ord:
assumes IsLinOrder(X,r) Closure(A,OrdTopology X r)=X A⊆X ∃ x y. x 6=y ∧ x ∈ X ∧ y ∈ Xshows A{is weakly dense in}X{with respect to}r
proof {
fix r1 r2 assume r1∈Xr2∈Xr16=r2 hr1,r2i∈rthen have IntervalX(X,r,r1,r2)∈{IntervalX(X, r, b, c) . hb,ci ∈ X× X} ∪ {LeftRayX(X, r, b) . b ∈ X} ∪{RightRayX(X, r, b) . b ∈ X} by auto
then have P:IntervalX(X,r,r1,r2)∈(OrdTopology X r) using base_sets_open[OFOrdtopology_is_a_topology(2)[OF assms(1)]]by autohave IntervalX(X,r,r1,r2)⊆X unfolding IntervalX_def by auto
then have int:Closure(A,OrdTopology X r)∩IntervalX(X,r,r1,r2)=IntervalX(X,r,r1,r2)
using assms(2) by auto{
assume IntervalX(X,r,r1,r2)6=0
then have A∩(IntervalX(X,r,r1,r2))6=0 using topology0.cl_inter_neigh[OFtopology0_ordtopology[OF assms(1)] _ P , of A]
using assms(3) union_ordtopology[OF assms(1,4)] int by auto}
then have (∃ z∈A-{r1,r2}. hr1,zi∈r∧hz,r2i∈r)∨IntervalX(X,r,r1,r2)=0
unfolding IntervalX_def
Interval_def by auto}
then show thesis unfolding IsWeaklyDenseSub_def by autoqed

Conversely, a weakly order-dense set is topologically dense if it is also considered that: if there is a maximum or a minimum elements whose singletons
are open, this points have to be in A. In conclusion, weakly order-density is
a property closed to topological density.
Another way to see this: Consider a weakly order-dense set A:• If X has a maximum and a minimum and {min, max} is open: A is
topologically dense in X \ {min, max}, where min is the minimum in
X and max is the maximum in X.
• If X has a maximum, {max} is open and X has no minimum or {min}isn’t open: A is topologically dense in X \ {max}, where max is the
maximum in X.
931

• If X has a minimum, {min} is open and X has no maximum or {max}isn’t open A is topologically dense in X \ {min}, where min is theminimum in X.
• If X has no minimum or maximum, or {min, max} has no proper open
sets: A is topologically dense in X.
lemma Wdense_ord_imp_dense_top:
assumes IsLinOrder(X,r) A{is weakly dense in}X{with respect to}r A⊆X∃ x y. x 6= y ∧ x ∈ X ∧ y ∈ X
HasAminimum(r,X)−→{Minimum(r,X)}∈(OrdTopology X r)−→Minimum(r,X)∈A
HasAmaximum(r,X)−→{Maximum(r,X)}∈(OrdTopology X r)−→Maximum(r,X)∈A
shows Closure(A,OrdTopology X r)=X
proof {
fix x assume x∈X{
fix U assume ass:x∈UU∈(OrdTopology X r)then have ∃ V∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X} . V⊆U∧x∈Vusing point_open_base_neigh[OF Ordtopology_is_a_topology(2)[OF assms(1)]]by autothen obtain V where V:V∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪{LeftRayX(X, r, b) . b ∈ X} ∪ {RightRayX(X, r, b) . b ∈ X} V⊆U x∈Vby blast
note V(1) moreover{
assume V∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X}
then obtain b c where b:b∈Xc∈XV=IntervalX(X, r, b, c) by autowith V(3) have x:hb,xi∈r hx,ci∈r x6=b x6=c unfolding IntervalX_def
Interval_def by auto
then have hb,ci∈r using assms(1) unfolding IsLinOrder_def trans_def
by fastmoreover from x(1-3) have b6=c using assms(1) unfolding IsLinOrder_def
antisym_def by fast
moreover note assms(2) b V(3)ultimately have ∃ z∈A-{b,c}. hb,zi∈r∧hz,ci∈r unfolding IsWeaklyDenseSub_def
by autothen obtain z where z∈Az6=bz6=chb,zi∈rhz,ci∈r by autowith assms(3) have z∈Az∈IntervalX(X, r, b, c) unfolding IntervalX_def
Interval_def by auto
then have A∩U6=0 using V(2) b(3) by auto}
moreover{assume V∈{RightRayX(X, r, b) . b ∈ X}
then obtain b where b:b∈XV=RightRayX(X, r, b) by autowith V(3) have x:hb,xi∈r b6=x unfolding RightRayX_def by auto moreover932note b(1)S moreover
have U⊆ (OrdTopology X r) using ass(2) by auto
then have U⊆X using union_ordtopology[OF assms(1,4)] by auto
then have x∈X using ass(1) by auto moreovernote assms(2) ultimately
have disj:(∃ z∈A-{b,x}. hb,zi∈r∧hz,xi∈r)∨ IntervalX(X, r, b, x)= 0 unfolding IsWeaklyDenseSub_def by auto{
assume B:IntervalX(X, r, b, x) = 0{
assume ∃ y∈X. hx,yi∈r ∧ x6=ythen obtain y where y:y∈Xhx,yi∈r x6=y by autowith x have x∈IntervalX(X,r,b,y) unfolding IntervalX_def Interval_def
using hx∈Xi by auto moreover
have hb,yi∈r using y(2) x(1) assms(1) unfolding IsLinOrder_def
trans_def by fast
moreover have b6=y using y(2,3) x(1) assms(1) unfolding IsLinOrder_def
antisym_def by fast
ultimately
have (∃ z∈A-{b,y}. hb,zi∈r∧hz,yi∈r) using assms(2) unfolding
IsWeaklyDenseSub_def
using y(1) b(1) by auto
then obtain z where z∈Ahb,zi∈rb6=z by auto
then have z∈A∩V using b(2) unfolding RightRayX_def using assms(3)by autothen have z∈A∩U using V(2) by auto
then have A∩U6=0 by auto}
moreover{assume R:∀ y∈X. hx,yi∈r−→x=y{
fix y assume y∈RightRayX(X,r,b)then have y:hb,yi∈r y∈X-{b} unfolding RightRayX_def by auto{
assume A:y6=xthen have hx,yi∈r/ using R y(2) by auto
then have hy,xi∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def
using hx∈Xi y(2) by autowith A y have y∈IntervalX(X,r,b,x) unfolding IntervalX_def
Interval_def
by autothen have False using B by auto}
then have y=x by auto}
then have RightRayX(X,r,b)={x} using V(3) b(2) by blast
moreover933

{fix t assume T:t∈X{
assume t=x
then have ht,xi∈r using assms(1) unfolding IsLinOrder_def
using Order_ZF_1_L1 T by auto}
moreover{assume t6=x
then have hx,ti∈r/ using R T by auto
then have ht,xi∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def
using T hx∈Xi by auto}
ultimately have ht,xi∈r by auto}with hx∈Xi have HM:HasAmaximum(r,X) unfolding HasAmaximum_def
by autothen have Maximum(r,X)∈X∀ t∈X. ht,Maximum(r,X)i∈r using Order_ZF_4_L3
assms(1) unfolding IsLinOrder_def
by autowith R hx∈Xi have xm:x=Maximum(r,X) by auto
moreover note b(2)ultimately have V={Maximum(r,X)} by auto
then have {Maximum(r,X)}∈(OrdTopology X r) using base_sets_open[OFOrdtopology_is_a_topology(2)[OF assms(1)]]V(1) by autowith HM have Maximum(r,X)∈A using assms(6) by autowith xm have x∈A by autowith V(2,3) have A∩U6=0 by auto}
ultimately have A∩U6=0 by auto}
moreover{assume IntervalX(X, r, b, x) 6= 0
with disj have ∃ z∈A-{b,x}. hb,zi∈r∧hz,xi∈r by auto
then obtain z where z∈Az6=bhb,zi∈r by auto
then have z∈Az∈RightRayX(X,r,b) unfolding RightRayX_def using
assms(3) by auto
then have z∈A∩U using V(2) b(2) by auto
then have A∩U6=0 by auto}
ultimately have A∩U6=0 by auto}
moreover{assume V∈{LeftRayX(X, r, b) . b ∈ X}934

then obtain b where b:b∈XV=LeftRayX(X, r, b) by autowith V(3) have x:hx,bi∈r b6=x unfolding LeftRayX_def by auto moreovernote b(1)S moreover
have U⊆ (OrdTopology X r) using ass(2) by auto
then have U⊆X using union_ordtopology[OF assms(1,4)] by auto
then have x∈X using ass(1) by auto moreovernote assms(2) ultimately
have disj:(∃ z∈A-{b,x}. hx,zi∈r∧hz,bi∈r)∨ IntervalX(X, r, x, b)= 0 unfolding IsWeaklyDenseSub_def by auto{
assume B:IntervalX(X, r, x, b) = 0{
assume ∃ y∈X. hy,xi∈r ∧ x6=ythen obtain y where y:y∈Xhy,xi∈r x6=y by autowith x have x∈IntervalX(X,r,y,b) unfolding IntervalX_def Interval_def
using hx∈Xi by auto moreover
have hy,bi∈r using y(2) x(1) assms(1) unfolding IsLinOrder_def
trans_def by fast
moreover have b6=y using y(2,3) x(1) assms(1) unfolding IsLinOrder_def
antisym_def by fast
ultimately
have (∃ z∈A-{b,y}. hy,zi∈r∧hz,bi∈r) using assms(2) unfolding
IsWeaklyDenseSub_def
using y(1) b(1) by auto
then obtain z where z∈Ahz,bi∈rb6=z by auto
then have z∈A∩V using b(2) unfolding LeftRayX_def using assms(3)by autothen have z∈A∩U using V(2) by auto
then have A∩U6=0 by auto}
moreover{assume R:∀ y∈X. hy,xi∈r−→x=y{
fix y assume y∈LeftRayX(X,r,b)then have y:hy,bi∈r y∈X-{b} unfolding LeftRayX_def by auto{
assume A:y6=xthen have hy,xi∈r/ using R y(2) by auto
then have hx,yi∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def
using hx∈Xi y(2) by autowith A y have y∈IntervalX(X,r,x,b) unfolding IntervalX_def
Interval_def
by autothen have False using B by auto}
then have y=x by auto935

}then have LeftRayX(X,r,b)={x} using V(3) b(2) by blast
moreover{fix t assume T:t∈X{
assume t=x
then have hx,ti∈r using assms(1) unfolding IsLinOrder_def
using Order_ZF_1_L1 T by auto}
moreover{assume t6=x
then have ht,xi∈r/ using R T by auto
then have hx,ti∈r using assms(1) unfolding IsLinOrder_def
IsTotal_def
using T hx∈Xi by auto}
ultimately have hx,ti∈r by auto}with hx∈Xi have HM:HasAminimum(r,X) unfolding HasAminimum_def
by autothen have Minimum(r,X)∈X∀ t∈X. hMinimum(r,X),ti∈r using Order_ZF_4_L4
assms(1) unfolding IsLinOrder_def
by autowith R hx∈Xi have xm:x=Minimum(r,X) by auto
moreover note b(2)ultimately have V={Minimum(r,X)} by auto
then have {Minimum(r,X)}∈(OrdTopology X r) using base_sets_open[OFOrdtopology_is_a_topology(2)[OF assms(1)]]V(1) by autowith HM have Minimum(r,X)∈A using assms(5) by autowith xm have x∈A by autowith V(2,3) have A∩U6=0 by auto}
ultimately have A∩U6=0 by auto}
moreover{assume IntervalX(X, r, x, b) 6= 0
with disj have ∃ z∈A-{b,x}. hx,zi∈r∧hz,bi∈r by auto
then obtain z where z∈Az6=bhz,bi∈r by auto
then have z∈Az∈LeftRayX(X,r,b) unfolding LeftRayX_def using assms(3)by autothen have z∈A∩U using V(2) b(2) by auto
then have A∩U6=0 by auto}
ultimately have A∩U6=0 by auto}

936

ultimately have A∩U6=0 by auto}
then have ∀ U∈(OrdTopology X r). x∈U −→ U∩A6=0 by auto
moreover note hx∈Xi moreovernote assms(3) topology0.inter_neigh_cl[OF topology0_ordtopology[OF assms(1)]]union_ordtopology[OF assms(1,4)] ultimately have x∈Closure(A,OrdTopology
X r)
by auto}then have X⊆Closure(A,OrdTopology X r) by autowith topology0.Top_3_L11(1)[OF topology0_ordtopology[OF assms(1)]]assms(3) union_ordtopology[OF assms(1,4)] show thesis by autoqed

The conclusion is that an order topology is κ-separable iff there is a set A
with cardinality strictly less than κ which is weakly-dense in X.
theorem separable_imp_wdense:
assumes (OrdTopology X r){is separable of cardinal}Q ∃ x y. x 6= y ∧x ∈ X ∧ y ∈ X
IsLinOrder(X,r)
shows ∃ A∈Pow(X). A≺Q ∧ (A{is weakly dense in}X{with respect to}r)
proof SfromS assms obtain U where U∈Pow( (OrdTopology X r)) Closure(U,OrdTopology
X r)= (OrdTopology X r) U≺Q
unfolding IsSeparableOfCard_def by auto
then have U∈Pow(X) Closure(U,OrdTopology X r)=X U≺Q using union_ordtopology[OFassms(3,2)]by autowith dense_top_imp_Wdense_ord[OF assms(3) _ _ assms(2)] show thesis
by autoqed
theorem wdense_imp_separable:
assumes ∃ x y. x 6= y ∧ x ∈ X ∧ y ∈ X (A{is weakly dense in}X{withrespect to}r)
IsLinOrder(X,r) A≺Q InfCard(Q) A⊆X
shows (OrdTopology X r){is separable of cardinal}Q
proof {
assume Hmin:HasAmaximum(r,X)
then have MaxX:Maximum(r,X)∈X using Order_ZF_4_L3(1) assms(3) unfolding IsLinOrder_def
by auto{assume HMax:HasAminimum(r,X)
then have MinX:Minimum(r,X)∈X using Order_ZF_4_L4(1) assms(3) unfolding IsLinOrder_def
by autolet A=A ∪{Maximum(r,X),Minimum(r,X)}937

have Finite({Maximum(r,X),Minimum(r,X)}) by auto
then have {Maximum(r,X),Minimum(r,X)}≺nat using n_lesspoll_nat
unfolding Finite_def using eq_lesspoll_trans by auto
moreoverfrom assms(5) have nat≺Q∨nat=Q unfolding InfCard_def
using lt_Card_imp_lesspoll[of Qnat] unfolding lt_def succ_def
using Card_is_Ord[of Q] by auto
ultimately have {Maximum(r,X),Minimum(r,X)}≺Q using lesspoll_transby autowith assms(4,5) have C:A≺Q using less_less_imp_un_lessby autohave WeakDense:A{is weakly dense in}X{with respect to}r using assms(2)unfolding
IsWeaklyDenseSub_def by autofrom MaxX MinX assms(6) have S:A⊆X by auto
then have Closure(A,OrdTopology X r)=X using Wdense_ord_imp_dense_top[OF assms(3) WeakDense _ assms(1)] by auto
then have thesis unfolding IsSeparableOfCard_def using union_ordtopology[OFassms(3,1)]
S C by auto}
moreover{assume nmin:¬HasAminimum(r,X)
let A=A ∪{Maximum(r,X)}
have Finite({Maximum(r,X)}) by auto
then have {Maximum(r,X)}≺nat using n_lesspoll_nat
unfolding Finite_def using eq_lesspoll_trans by auto
moreoverfrom assms(5) have nat≺Q∨nat=Q unfolding InfCard_def
using lt_Card_imp_lesspoll[of Qnat] unfolding lt_def succ_def
using Card_is_Ord[of Q] by auto
ultimately have {Maximum(r,X)}≺Q using lesspoll_trans by autowith assms(4,5) have C:A≺Q using less_less_imp_un_lessby autohave WeakDense:A{is weakly dense in}X{with respect to}r using assms(2)unfolding
IsWeaklyDenseSub_def by autofrom MaxX assms(6) have S:A⊆X by auto
then have Closure(A,OrdTopology X r)=X using Wdense_ord_imp_dense_top[OF assms(3) WeakDense _ assms(1)] nmin by auto
then have thesis unfolding IsSeparableOfCard_def using union_ordtopology[OFassms(3,1)]
S C by auto}
ultimately have thesis by auto}
moreover{938

assume nmax:¬HasAmaximum(r,X){
assume HMin:HasAminimum(r,X)
then have MinX:Minimum(r,X)∈X using Order_ZF_4_L4(1) assms(3) unfolding IsLinOrder_def
by autolet A=A ∪{Minimum(r,X)}
have Finite({Minimum(r,X)}) by auto
then have {Minimum(r,X)}≺nat using n_lesspoll_nat
unfolding Finite_def using eq_lesspoll_trans by auto
moreoverfrom assms(5) have nat≺Q∨nat=Q unfolding InfCard_def
using lt_Card_imp_lesspoll[of Qnat] unfolding lt_def succ_def
using Card_is_Ord[of Q] by auto
ultimately have {Minimum(r,X)}≺Q using lesspoll_trans by autowith assms(4,5) have C:A≺Q using less_less_imp_un_lessby autohave WeakDense:A{is weakly dense in}X{with respect to}r using assms(2)unfolding
IsWeaklyDenseSub_def by autofrom MinX assms(6) have S:A⊆X by auto
then have Closure(A,OrdTopology X r)=X using Wdense_ord_imp_dense_top[OF assms(3) WeakDense _ assms(1)] nmax by auto
then have thesis unfolding IsSeparableOfCard_def using union_ordtopology[OFassms(3,1)]
S C by auto}
moreover{assume nmin:¬HasAminimum(r,X)
let A=Afrom assms(4,5) have C:A≺Q by auto
have WeakDense:A{is weakly dense in}X{with respect to}r using assms(2)unfolding
IsWeaklyDenseSub_def by autofrom assms(6) have S:A⊆X by auto
then have Closure(A,OrdTopology X r)=X using Wdense_ord_imp_dense_top[OF assms(3) WeakDense _ assms(1)] nmin nmax by auto
then have thesis unfolding IsSeparableOfCard_def using union_ordtopology[OFassms(3,1)]
S C by auto}
ultimately have thesis by auto}
ultimately show thesis by auto
qed

end

939

66

Uniform spaces

theory UniformSpace_ZF imports Topology_ZF_4a
begin

This theory defines uniform spaces and proves their basic properties.

66.1

Definition and motivation

Just like a topological space constitutes the minimal setting in which one
can speak of continuous functions, the notion of uniform spaces (commonly
attributed to André Weil) captures the minimal setting in which one canspeak of uniformly continuous functions. In some sense this is a generalization of the notion of metric (or metrizable) spaces and topological groups.
There are several definitions of uniform spaces. The fact that these definitions are equivalent is far from obvious (some people call such phenomenon
cryptomorphism). We will use the definition of the uniform structure (or”uniformity”) based on entourages. This was the original definition by Weiland it seems to be the most commonly used. A uniformity consists of entourages that are binary relations between points of space X that satisfy acertain collection of conditions, specified below.
definition
IsUniformity (_ {is a uniformity on} _ 90) whereΦ {is a uniformity on} X ≡(Φ {is a filter on} (X×X))∧ (∀ U∈Φ. id(X) ⊆ U ∧ (∃ V∈Φ. V O V ⊆ U) ∧ converse(U) ∈ Φ)

If Φ is a uniformity on X, then the every element V of Φ is a certain relation
on X (a subset of X × X and is called an ”entourage”. For an x ∈ X wecall V {x} a neighborhood of x. The first useful fact we will show is thatneighborhoods are non-empty.
lemma neigh_not_empty:
assumes Φ {is a uniformity on} X V∈Φ and x∈Xshows V{x} 6= 0 and x ∈ V{x}proof from assms(1,2) have id(X) ⊆ V using IsUniformity_def IsFilter_def
by autowith hx∈Xi show x∈V{x} and V{x} 6= 0 by auto
qed

Uniformity Φ defines a natural topology on its space X via the neighborhood
system that assigns the collection {V ({x}) : V ∈ Φ} to every point x ∈ X.
In the next lemma we show that if we define a function this way the valuesof that function are what they should be. This is only a technical factwhich is useful to shorten the remaining proofs, usually treated as obvious
in standard mathematics.
940

lemma neigh_filt_fun:assumes Φ {is a uniformity on} X
defines M ≡ {hx,{V{x}.V∈Φ}i.x∈X}shows M:X→Pow(Pow(X)) and ∀ x∈X. M(x) = {V{x}.V∈Φ}
proof from assms have ∀ x∈X. {V{x}.V∈Φ} ∈ Pow(Pow(X))
using IsUniformity_def IsFilter_def image_subset by autowith assms show M:X→Pow(Pow(X)) using ZF_fun_from_total by simp
with assms show ∀ x∈X. M(x) = {V{x}.V∈Φ} using ZF_fun_from_tot_val
by simpqed

In the next lemma we show that the collection defined in lemma neigh_filt_fun
is a filter on X. The proof is kind of long, but it just checks that all filter
conditions hold.
lemma filter_from_uniformity:
assumes Φ {is a uniformity on} X and x∈Xdefines M ≡ {hx,{V{x}.V∈Φ}i.x∈X}shows M(x) {is a filter on} X
proof from assms have PhiFilter: Φ {is a filter on} (X×X) and
M:X→Pow(Pow(X)) and M(x) = {V{x}.V∈Φ}using IsUniformity_def neigh_filt_fun by auto
have 0 ∈/ M(x)
proof from assms hx∈Xi have 0 ∈/ {V{x}.V∈Φ} using neigh_not_empty by blast
with hM(x) = {V{x}.V∈Φ}i show 0 ∈/ M(x) by simp
qed
moreover have X ∈ M(x)proof note hM(x) = {V{x}.V∈Φ}imoreover from assms have X×X ∈ Φ unfolding IsUniformity_def IsFilter_def
by blast
hence (X×X){x} ∈ {V{x}.V∈Φ} by auto
moreover from hx∈Xi have (X×X){x} = X by auto
ultimately show X ∈ M(x) by simp
qed
moreover from hM:X→Pow(Pow(X))i hx∈Xi have M(x) ⊆ Pow(X) using apply_funtype
by blast
moreover have LargerIn: ∀ B ∈ M(x). ∀ C ∈ Pow(X). B⊆C −→ C ∈ M(x)proof { fix B assume B ∈ M(x)fix C assume C ∈ Pow(X) and B⊆Cfrom hM(x) = {V{x}.V∈Φ}i hB ∈ M(x)i obtain U whereU∈Φ and B = U{x} by auto
let V = U ∪ C×Cfrom assms hU∈Φi hC ∈ Pow(X)i have V ∈ Pow(X×X) and U⊆V941

using IsUniformity_def IsFilter_def by autowith hU∈Φi PhiFilter have V∈Φ using IsFilter_def by simp
moreover from assms hU∈Φi hx∈Xi hB = U{x}i hB⊆Ci have C = V{x}using neigh_not_empty image_greater_rel by simp
ultimately have C ∈ {V{x}.V∈Φ} by autowith hM(x) = {V{x}.V∈Φ}i have C ∈ M(x) by simp
} thus thesis by blast
qed
moreover have ∀ A ∈ M(x).∀ B ∈ M(x). A∩B ∈ M(x)proof { fix A B assume A ∈ M(x) and B ∈ M(x)with hM(x) = {V{x}.V∈Φ}i obtain VA VB where
A = VA {x} B = VB {x} and VA ∈ Φ VB ∈ Φ
by autolet C = VA {x} ∩ VB {x}from assms hVA ∈ Φi hVB ∈ Φi have VA ∩VB ∈ Φ using IsUniformity_def
IsFilter_def
by simpwith hM(x) = {V{x}.V∈Φ}i have (VA ∩VB ){x} ∈ M(x) by auto
moreover from PhiFilter hVA ∈ Φi hVB ∈ Φi have C ∈ Pow(X) unfolding IsFilter_def
by automoreover have (VA ∩VB ){x} ⊆ C using image_Int_subset_left by simp
moreover note LargerIn
ultimately have C ∈ M(x) by simp
with hA = VA {x}i hB = VB {x}i have A∩B ∈ M(x) by blast} thus thesis by simp
qed
ultimately show thesis unfolding IsFilter_def by simp
qed

The function defined in the premises of lemma neigh_filt_fun (or filter_from_uniformity)
is a neighborhood system. The proof uses the existence of the ”half-thesize” neighborhood condition (∃ V∈Φ. V O V ⊆ U) of the uniformity definition, but not the converse(U) ∈ Φ part.
theorem neigh_from_uniformity:
assumes Φ {is a uniformity on} X
shows {hx,{V{x}.V∈Φ}i.x∈X} {is a neighborhood system on} X
proof let M = {hx,{V{x}.V∈Φ}i.x∈X}from assms have M:X→Pow(Pow(X)) and Mval: ∀ x∈X. M(x) = {V{x}.V∈Φ}using IsUniformity_def neigh_filt_fun by auto
moreover from assms have ∀ x∈X. (M(x) {is a filter on} X) using filter_from_uniformity
by simpmoreover{ fix x assume x∈Xhave ∀ N∈M(x). x∈N ∧ (∃ U∈M(x).∀ y∈U.(N∈M(y)))
proof { fix N assume N∈M(x)942have x∈N and ∃ U∈M(x).∀ y∈U.(N ∈ M(y))
proof from hM:X→Pow(Pow(X))i Mval hx∈Xi hN∈M(x)i
obtain U where U∈Φ and N = U{x} by autowith assms hx∈Xi show x∈N using neigh_not_empty by simp
from assms hU∈Φi obtain V where V∈Φ and V O V ⊆ U
unfolding IsUniformity_def by auto
let W = V{x}from hV∈Φi Mval hx∈Xi have W ∈ M(x) by auto
moreover have ∀ y∈W. N ∈ M(y)proof { fix y assume y∈Wwith hM:X→Pow(Pow(X))i hx∈Xi hW ∈ M(x)i have y∈Xusing apply_funtype by blast
with assms have M(y) {is a filter on} X using filter_from_uniformity
by simpmoreover from assms hy∈Xi hV∈Φi have V{y} ∈ M(y)using neigh_filt_fun by auto
moreover from hM:X→Pow(Pow(X))i hx∈Xi hN ∈ M(x)i haveN ∈ Pow(X)using apply_funtype by blast
moreover from hV O V ⊆ Ui hy∈Wi have
V{y} ⊆ (V O V){x} and (V O V){x} ⊆ U{x}by autowith hN = U{x}i have V{y} ⊆ N by blast
ultimately have N ∈ M(y) unfolding IsFilter_def by simp
} thus thesis by simp
qed
ultimately show ∃ U∈M(x).∀ y∈U.(N ∈ M(y)) by autoqed
} thus thesis by simp
qed}
ultimately show thesis unfolding IsNeighSystem_def by simp
qed

When we have a uniformity Φ on X we can define a topology on X in a(relatively) natural way. We will call that topology the UniformTopology(Φ).
The definition may be a bit cryptic but it just combines the constructionof a neighborhood system from uniformity as in the assumptions of lemmafilter_from_uniformity and the construction of topology from a neighborhood system from theorem topology_from_neighs. We could probably reformulate the definition to skip the X parameter because if Φ is a uniformity
on X then X can be recovered from (is determined by) Φ.
definition
UniformTopology(Φ,X) ≡ {U ∈ Pow(X). ∀ x∈U. U ∈ {ht,{V{t}.V∈Φ}i.t∈X}(x)}The collection of sets constructed in the UniformTopology definition is indeed
a topology on X.
943

theorem uniform_top_is_top:
assumes Φ {is a uniformity on} X
shows
S
UniformTopology(Φ,X) {is a topology} andUniformTopology(Φ,X) =X
using assms neigh_from_uniformity UniformTopology_def topology_from_neighsby autoend

67

Topological groups - introduction

theory TopologicalGroup_ZF imports Topology_ZF_3 Group_ZF_1 Semigroup_ZF
begin

This theory is about the first subject of algebraic topology: topologicalgroups.

67.1

Topological group: definition and notation

Topological group is a group that is a topological space at the same time.
This means that a topological group is a triple of sets, say (G, f, T ) suchthat T is a topology on G, f is a group operation on G and both f and theoperation of taking inverse in G are continuous. Since IsarMathLib defines
topology
without using the carrier, (see Topology_ZF
SS), in our setup we justuse T instead of G and say that the pair of sets ( T, f ) is a group. Thisway our definition of being a topological group is a statement
about twoS
sets: the topology T and the group operation f on G = T . Since thedomain of the group operation is G × G, the pair of topologies in which f is
supposed to be continuous is T and the product topology on G × G (which
we will call τ below).
This way we arrive at the following definition of a predicate that states thatpair of sets is a topological group.
definition
S
IsAtopologicalGroup(T,f) ≡ (T {is a topology}) ∧ IsAgroup( T,f) ∧IsContinuous(ProductTopology(T,T),T,f)∧
S
IsContinuous(T,T,GroupInv( T,f))

We will inherit notation from the topology0 locale. ThatSlocale assumes
that T is a topology. For convenience we will denote G = T and τ to be
the product topology on G × G. To that we add some notation specific togroups. We will use additive notation for the group operation, even though
we don’t assume that the group is abelian. The notation g +A will mean theleft translation of the set A by element g, i.e. g + A = {g + a|a ∈ A}. The
944

group operation G induces a natural operation on the subsets of G defined
as hA, Bi 7→ {x + y|x ∈ A, y ∈ B}. Such operation has been considered in
func_ZF and called f ”lifted to subsets of” G. We will denote the value ofsuch operation on sets A, B as A + B. The set of neigboorhoods of zero(denoted N 0 ) is the collection of (not necessarily open) sets whose interior
contains the neutral element of the group.
locale topgroup = topology0 +fixes GS
defines G_def [simp]: G ≡Tfixes prodtop (τ )defines prodtop_def [simp]: τ ≡ ProductTopology(T,T)
fixes fassumes Ggroup: IsAgroup(G,f)
assumes fcon: IsContinuous(τ ,T,f)assumes inv_cont: IsContinuous(T,T,GroupInv(G,f))fixes grop (infixl + 90)
defines grop_def [simp]: x+y ≡ fhx,yifixes grinv (- _ 89)
defines grinv_def [simp]: (-x) ≡ GroupInv(G,f)(x)fixes grsub (infixl - 90)
defines grsub_def [simp]: x-y ≡ x+(-y)
fixes setinv (- _ 72)
defines setninv_def [simp]: -A ≡ GroupInv(G,f)(A)fixes ltrans (infix + 73)
defines ltrans_def [simp]: x + A ≡ LeftTranslation(G,f,x)(A)fixes rtrans (infix + 73)
defines rtrans_def [simp]: A + x ≡ RightTranslation(G,f,x)(A)fixes setadd (infixl + 71)
defines setadd_def [simp]: A+B ≡ (f {lifted to subsets of} G)hA,Bifixes gzero (0)defines gzero_def [simp]: 0 ≡ TheNeutralElement(G,f)
fixes zerohoods (N 0 )defines zerohoods_def [simp]: N 0 ≡ {A ∈ Pow(G). 0 ∈ int(A)}945

P
fixes listsum (_ 70)
Pdefines listsum_def[simp]:k ≡ Fold1(f,k)

The first lemma states that we indeeed talk about topological group in thecontext of topgroup locale.
lemma (in topgroup) topGroup: shows IsAtopologicalGroup(T,f)
using topSpaceAssum Ggroup fcon inv_cont IsAtopologicalGroup_def
by simp

If a pair of sets (T, f ) forms a topological group, then all theorems provenin the topgroup context are valid as applied to (T, f ).
lemma topGroupLocale: assumes IsAtopologicalGroup(T,f)
shows topgroup(T,f)
using assms IsAtopologicalGroup_def topgroup_def
topgroup_axioms.intro topology0_def by simp

We can use the group0 locale in the context of topgroup.
lemma (in topgroup) group0_valid_in_tgroup: shows group0(G,f)
using Ggroup group0_def by simp

We can use semigr0 locale in the context of topgroup.
lemma (in topgroup) semigr0_valid_in_tgroup: shows semigr0(G,f)
using Ggroup IsAgroup_def IsAmonoid_def semigr0_def by simp

We can use the prod_top_spaces0 locale in the context of topgroup.
lemma (in topgroup) prod_top_spaces0_valid: shows prod_top_spaces0(T,T,T)
using topSpaceAssum prod_top_spaces0_def by simp

Negative of a group element is in group.
lemma (in topgroup) neg_in_tgroup: assumes g∈G shows (-g) ∈ G
proof from assms have GroupInv(G,f)(g) ∈ G
using group0_valid_in_tgroup group0.inverse_in_group by blast
thus thesis by simp
qed

Zero is in the group.
lemma (in topgroup) zero_in_tgroup: shows 0∈G
proof have TheNeutralElement(G,f) ∈ G
using group0_valid_in_tgroup group0.group0_2_L2 by blast
then show 0∈G by simpqed

Of course the product topology is a topology (on G × G).
lemma (in topgroup) prod_top_on_G:946

Sshows τ {is a topology} andτ = G×G
using topSpaceAssum Top_1_4_T1 by auto

Let’s recall that f is a binary operation on G in this context.
lemma (in topgroup) topgroup_f_binop: shows f : G×G → G
using Ggroup group0_def group0.group_oper_assocA by simp

A subgroup of a topological group is a topological group with relative topology and restricted operation. Relative topology is the same as T {restrictedto} H which is defined to be {V ∩ H : V ∈ T } in ZF1 theory.
lemma (in topgroup) top_subgroup: assumes A1: IsAsubgroup(H,f)
shows IsAtopologicalGroup(T {restricted to} H,restrict(f,H×H))
proof let τ 0 = T {restricted to} H
let fHS= restrict(f,H×H)
haveτ 0 = G ∩ H using union_restrict by simp
also from A1 have . . . = H
using group0_valid_in_tgroup
group0.group0_3_L2 by blast
S
finally have
τ 0 = H by simp
have τ 0 {is a topology}
using Top_1_L4 by simp
SS
moreover from A1 h τ 0 = Hi have IsAgroup( τ 0 ,fH )using IsAsubgroup_def by simp
moreover have IsContinuous(ProductTopology(τ 0 ,τ 0 ),τ 0 ,fH )proof have two_top_spaces0(τ , T,f)using topSpaceAssum prod_top_on_G topgroup_f_binop prod_top_on_G
two_top_spaces0_def by simp
moreoverfrom A1 have H ⊆ G using group0_valid_in_tgroup group0.group0_3_L2
by simpS
then have H×H ⊆τ using prod_top_on_G by auto
moreover have IsContinuous(τ ,T,f) using fcon by simp
ultimately have
IsContinuous(τ {restricted to} H×H, T {restricted to} fH (H×H),fH )using two_top_spaces0.restr_restr_image_contby simpmoreover have
ProductTopology(τ 0 ,τ 0 ) = τ {restricted to} H×H using topSpaceAssum
prod_top_restr_commby simpmoreover from A1 have fH (H×H) = H using image_subgr_op
by simpultimately show thesis by simp
qedS
moreover have IsContinuous(τ 0 ,τ 0 ,GroupInv( τ 0 ,fH ))proof let g = restrict(GroupInv(G,f),H)
have GroupInv(G,f) : G → G
using Ggroup group0_2_T2 by simp

947

then have two_top_spaces0(T,T,GroupInv(G,f))using topSpaceAssum two_top_spaces0_def
by simpS
moreover from A1 have H ⊆Tusing group0_valid_in_tgroup group0.group0_3_L2
by simpultimately have
IsContinuous(τ 0 ,T {restricted to} g(H),g)
using inv_cont two_top_spaces0.restr_restr_image_contby simpmoreover from A1 have g(H) = H
using group0_valid_in_tgroup group0.restr_inv_onto
by simpmoreoverfrom A1 have GroupInv(H,fH ) = g
using group0_valid_in_tgroup group0.group0_3_T1
by simpS
S
with h τ 0 = Hi have g = GroupInv( τ 0 ,fH ) by simp
ultimately show thesis by simp
qed
ultimately show thesis unfolding IsAtopologicalGroup_def by simp
qed

67.2

Interval arithmetic, translations and inverse of set

In this section we list some properties of operations of translating a set andreflecting it around the neutral element of the group. Many of the results areproven in other theories, here we just collect them and rewrite in notation
specific to the topgroup context.
Different ways of looking at adding sets.
lemma (in topgroup) interval_add: assumes
A⊆G B⊆G showsS
A+B ⊆ G and A+B = f(A×B) A+B = ( x∈A. x+B)
proof from assms show A+B ⊆ G and A+B = f(A×B)
using topgroup_f_binop Slift_subsets_explained by autofrom assms show A+B = ( x∈A. x+B)
using group0_valid_in_tgroup group0.image_ltrans_union by simp
qed

Right and left translations are continuous.
lemma (in topgroup) trans_cont: assumes g∈G shows
IsContinuous(T,T,RightTranslation(G,f,g)) and
IsContinuous(T,T,LeftTranslation(G,f,g))
using assms group0_valid_in_tgroup group0.trans_eq_section
topgroup_f_binop fcon prod_top_spaces0_valid
prod_top_spaces0.fix_1st_var_cont prod_top_spaces0.fix_2nd_var_contby autoLeft and right translations of an open set are open.
948

lemma (in topgroup) open_tr_open: assumes g∈G and V∈Tshows g+V ∈ T and V+g ∈ Tusing assms neg_in_tgroup trans_cont IsContinuous_defgroup0_valid_in_tgroup group0.trans_image_vimage by auto

Right and left translations are homeomorphisms.
lemma (in topgroup) tr_homeo: assumes g∈G shows
IsAhomeomorphism(T,T,RightTranslation(G,f,g)) andIsAhomeomorphism(T,T,LeftTranslation(G,f,g))
using assms group0_valid_in_tgroup group0.trans_bij trans_cont open_tr_open
bij_cont_open_homeo by auto

Translations preserve interior.
lemma (in topgroup) trans_interior: assumes A1: g∈G and A2: A⊆Gshows g + int(A) = int(g+A)
proof S
T and IsAhomeomorphism(T,T,LeftTranslation(G,f,g))from assms have A ⊆using tr_homeo
by autothen show thesis using int_top_invariant by simp
qed

Inverse of an open set is open.
lemma (in topgroup) open_inv_open: assumes V∈T shows (-V) ∈ T
using assms group0_valid_in_tgroup group0.inv_image_vimage
inv_cont IsContinuous_def by simp

Inverse is a homeomorphism.
lemma (in topgroup) inv_homeo: shows IsAhomeomorphism(T,T,GroupInv(G,f))using group0_valid_in_tgroup group0.group_inv_bij inv_cont open_inv_open
bij_cont_open_homeo by simp

Taking negative preserves interior.
lemma (in topgroup) int_inv_inv_int: assumes A ⊆ Gshows int(-A) = -(int(A))
using assms inv_homeo int_top_invariant by simp

67.3

Neighborhoods of zero

Zero neighborhoods are (not necessarily open) sets whose interior contains
the neutral element of the group. In the topgroup locale the collection ofneighboorhoods of zero is denoted N 0 .
The whole space is a neighborhood of zero.
lemma (in topgroup) zneigh_not_empty: shows G ∈ N 0
using topSpaceAssum IsATopology_def Top_2_L3 zero_in_tgroupby simp949

Any element belongs to the interior of any neighboorhood of zero translatedby that element.
lemma (in topgroup) elem_in_int_trans:
assumes A1: g∈G and A2: H ∈ N 0
shows g ∈ int(g+H)
proof from A2 have 0 ∈ int(H) and int(H) ⊆ G using Top_2_L2 by autowith A1 have g ∈ g + int(H)using group0_valid_in_tgroup group0.neut_trans_elem by simp
with assms show thesis using trans_interior by simp
qed

Negative of a neighborhood of zero is a neighborhood of zero.
lemma (in topgroup) neg_neigh_neigh: assumes H ∈ N 0
shows (-H) ∈ N 0
proof from assms have int(H) ⊆ G and 0 ∈ int(H) using Top_2_L1 by autowith assms have 0 ∈ int(-H) using group0_valid_in_tgroup group0.neut_inv_neut
int_inv_inv_int by simp
moreoverhave GroupInv(G,f):G→G using Ggroup group0_2_T2 by simp
then have (-H) ⊆ G using func1_1_L6 by simp
ultimately show thesis by simp
qedTranslating an open set by a negative of a point that belongs to it makes it
a neighboorhood of zero.
lemma (in topgroup) open_trans_neigh: assumes A1: U∈T and g∈Ushows (-g)+U ∈ N 0
proof let H = (-g)+Ufrom assms have g∈G by auto
then have (-g) ∈ G using neg_in_tgroup by simp
with A1 have H∈T using open_tr_open by simp
hence H ⊆ G by auto
moreover have 0 ∈ int(H)proof from assms have U⊆G and g∈U by autowith hH∈Ti show 0 ∈ int(H)using group0_valid_in_tgroup group0.elem_trans_neut Top_2_L3
by autoqed
ultimately show thesis by simp
qed

67.4

Closure in topological groups

This section is devoted to a characterization of closure in topological groups.
950

Closure of a set is contained in the sum of the set and any neighboorhoodof zero.
lemma (in topgroup) cl_contains_zneigh:assumes A1: A⊆G and A2: H ∈ N 0
shows cl(A) ⊆ A+H
proof
fix x assume x ∈ cl(A)from A1 have cl(A) ⊆ G using Top_3_L11 by simp
with hx ∈ cl(A)i have x∈G by auto
have int(H) ⊆ G using Top_2_L2 by auto
let V = int(x + (-H))
have V = x + (-int(H))
proof from A2 hx∈Gi have V = x + int(-H)
using neg_neigh_neigh trans_interior by simp
with A2 show thesis using int_inv_inv_int by simp
qed
have A∩V 6= 0
proof from A2 hx∈Gi hx ∈ cl(A)i have V∈T and x ∈ cl(A) ∩ V
using neg_neigh_neigh elem_in_int_trans Top_2_L2 by autowith A1 show A∩V 6= 0 using cl_inter_neigh by simp
qedthen obtain y where y∈A and y∈V by autowith hV = x + (-int(H))i hint(H) ⊆ Gi hx∈Gi have x ∈ y+int(H)using group0_valid_in_tgroup
group0.ltrans_inv_in by simp
Swith hy∈Ai have x ∈ ( y∈A. y+H) using Top_2_L1 func1_1_L8 by autowith assms show x ∈ A+H using interval_add by simp
qed

The next theorem provides a characterization of closure in topological groups
in terms of neighborhoods of zero.
theorem (in topgroup) cl_topgroup:Tassumes A⊆G shows cl(A) = ( H∈N 0 . A+H)
proof
T
from assms show cl(A) ⊆ ( H∈N 0 . A+H)
using zneigh_not_empty cl_contains_zneigh by autonext
T{ fix x assume x ∈ ( H∈N 0 . A+H)
then have x ∈ A+G using zneigh_not_empty by autowith assms have x∈G using interval_add by blast
have ∀ U∈T. x∈U −→ U∩A 6= 0
proof { fix U assume U∈T and x∈U
let H = -((-x)+U)from hU∈Ti and hx∈Ui have (-x)+U ⊆ G and H ∈ N 0
using open_trans_neighneg_neigh_neigh by autoTwith hx ∈ ( H∈N 0 . A+H)i have x ∈ A+H by autowith assms hH ∈ N 0 i obtain y where y∈A and x ∈ y+H

951

using interval_add by auto
have y∈U
proof from assms hy∈Ai have y∈G by autowith h(-x)+U ⊆ Gi and hx ∈ y+Hi have y ∈ x+((-x)+U)
using group0_valid_in_tgroup group0.ltrans_inv_in by simp
with hU∈Ti hx∈Gi show y∈Uusing neg_in_tgroup group0_valid_in_tgroup group0.trans_comp_imagegroup0.group0_2_L6 group0.trans_neutral image_id_sameby autoqedwith hy∈Ai have U∩A 6= 0 by auto
} thus thesis by simp
qedhx∈Gi have x ∈ cl(A) using inter_neigh_cl by simp
with assms
T} thus ( H∈N 0 . A+H) ⊆ cl(A) by auto
qed

67.5

Sums of sequences of elements and subsets

In
this section we consider properties of the function Gn → G, x = (x0 , x1 , ..., xn−1 ) 7→Pn−1
ni=0 xi . We will model the cartesian product G by the space of sequencesn → G, where n = {0, 1, ..., n − 1} is a natural number. This space isequipped with a natural product topology defined in Topology_ZF_3.
Let’s recall first that the sum of elements of a group is an element of thegroup.
lemma (in topgroup) sum_list_in_group:
assumesPn ∈ nat and x: succ(n)→Gshows ( x) ∈ G
proof from assms have semigr0(G,f) and n ∈ nat x: succ(n)→Gusing semigr0_valid_in_tgroup by auto
then have
P Fold1(f,x) ∈ G by (rule semigr0.prod_type)thus ( x) ∈ G by simp
qed

In this context x+y is the same as the value of the group operation on theelements x and y. Normally we shouldn’t need to state this a s separate
lemma.
lemma (in topgroup) grop_def1: shows fhx,yi = x+y by simp

Another theorem from Semigroup_ZF theory that is useful to have in the
additive notation.
lemma (in topgroup) shorter_set_add:
assumesPn ∈ natPand x: succ(succ(n))→G
shows ( x) = ( Init(x)) + (x(succ(n)))
proof -

952

from assms have semigr0(G,f) and n ∈ nat x: succ(succ(n))→G
using semigr0_valid_in_tgroup by auto
then have Fold1(f,x) = fhFold1(f,Init(x)),x(succ(n))iby (rule semigr0.shorter_seq)
thus thesis by simp
qed

Sum is a continuous function in the product topology.
theorem (in topgroup) sum_continuous: assumes n ∈ nat P
shows IsContinuous(SeqProductTopology(succ(n),T),T,{hx, xi.x∈succ(n)→G})
proof note hn ∈ natiP
moreover have IsContinuous(SeqProductTopology(succ(0),T),T,{hx, xi.x∈succ(0)→G})
proof P
have {hx, xi.x∈succ(0)→G} = {hx,x(0)i. x∈1→G}
using semigr0_valid_in_tgroup semigr0.prod_of_1elem by simp
moreover haveS
IsAhomeomorphism(SeqProductTopology(1,T),T,{hx,x(0)i. x∈1→ T})
using topSpaceAssum singleton_prod_top1
by simpultimately show thesis using IsAhomeomorphism_def by simp
qed
moreover have ∀ k∈nat.
P
IsContinuous(SeqProductTopology(succ(k),T),T,{hx, xi.x∈succ(k)→G})−→P
IsContinuous(SeqProductTopology(succ(succ(k)),T),T,{hx, xi.x∈succ(succ(k))→G})
proof { fix k assume
P k ∈ natlet s = {hx, xi.x∈succ(k)→G}
let g = {hp,hs(fst(p)),snd(p)ii. p ∈ (succ(k)→G)×G}
let h = {hx,hInit(x),x(succ(k))ii. x ∈ succ(succ(k))→G}
let ϕ = SeqProductTopology(succ(k),T)
let ψ = SeqProductTopology(succ(succ(k)),T)
assume IsContinuous(ϕ,T,s)from hk ∈ nati have s: (succ(k)→G) → G
using sum_list_in_group ZF_fun_from_total by simp
have h: (succ(succ(k))→G)→(succ(k)→G)×G
proof { fix x assume x ∈ succ(succ(k))→G
with hk ∈ nati have Init(x) ∈ (succ(k)→G)
using init_props by simp
with hk ∈ nati hx : succ(succ(k))→Gi
have hInit(x),x(succ(k))i ∈ (succ(k)→G)×G using apply_funtype
by blast} then show thesis using ZF_fun_from_total by simp
qed
moreover have g:((succ(k)→G)×G)→(G×G)
proof { fix p assume p ∈ (succ(k)→G)×G

953

hence fst(p): succ(k)→G and snd(p) ∈ G by autowith hs: (succ(k)→G) → Gi have hs(fst(p)),snd(p)i ∈ G×G
using apply_funtype by blast} then show g:((succ(k)→G)×G)→(G×G) using ZF_fun_from_total
by simpqed
moreover have f : G×G → G using topgroup_f_binop by simp
ultimately have f O g O h :(succ(succ(k))→G)→G using comp_fun
by blastfrom hk ∈ nati have IsContinuous(ψ,ProductTopology(ϕ,T),h)using topSpaceAssum finite_top_prod_homeo IsAhomeomorphism_def
by simpmoreover have IsContinuous(ProductTopology(ϕ,T),τ ,g)proof from topSpaceAssum haveS
T {is a topology} ϕ {is a topology}
ϕ = succ(k)→Gusing seq_prod_top_is_top
by
auto
S
moreover S
fromSh ϕ = succ(k)→Gi hs: (succ(k)→G) → Gi
have s: ϕ→ T by simpi
moreover note hIsContinuous(ϕ,T,s)S
hi
moreover fromϕ = succ(k)→GS
Shave g = {hp,hs(fst(p)),snd(p)ii. p ∈ϕ× T}
by simpultimately have IsContinuous(ProductTopology(ϕ,T),ProductTopology(T,T),g)
using cart_prod_cont1 by blast
thus thesis by simp
qed
moreover have IsContinuous(τ,T,f) using fcon by simpP
moreover have {hx, xi.x∈succ(succ(k))→G} = f O g O h
proof P
let d = {hx, xi.x∈succ(succ(k))→G}
P
from hk∈nati have ∀ x∈succ(succ(k))→G. ( x) ∈ G
using sum_list_in_group by blast
then have d:(succ(succ(k))→G)→G
using sum_list_in_group ZF_fun_from_total by simp
moreover note hf O g O h :(succ(succ(k))→G)→Gi
moreover have ∀ x∈succ(succ(k))→G. d(x) = (f O g O h)(x)proof
fix x assume x∈succ(succ(k))→G
then have I: h(x) = hInit(x),x(succ(k))iusing ZF_fun_from_tot_val1 by simp
moreover from hk∈nati hx∈succ(succ(k))→Gi
have Init(x): succ(k)→Gusing init_props by simp
moreover from hk∈nati hx:succ(succ(k))→Gi
have II: x(succ(k)) ∈ G
using apply_funtype by blast
ultimately have h(x) ∈ (succ(k)→G)×G by simp
then have g(h(x)) = hs(fst(h(x))),snd(h(x))i954

using ZF_fun_from_tot_val1 by simp
with I have g(h(x)) = hs(Init(x)),x(succ(k))iby simpP
with hInit(x): succ(k)→Gi have g(h(x)) = h Init(x),x(succ(k))iusing ZF_fun_from_tot_val1 by simpiwith hk ∈ nati hx: succ(succ(k))→GP
have f(g(h(x))) = ( x)using shorter_set_add by simp
with hx ∈ succ(succ(k))→Gi have f(g(h(x))) = d(x)using ZF_fun_from_tot_val1 by simp
moreover fromhh: (succ(succ(k))→G)→(succ(k)→G)×Gi
hg:((succ(k)→G)×G)→(G×G)i
hf:(G×G)→Gi hx∈succ(succ(k))→Gi
have (f O g O h)(x) = f(g(h(x))) by (rule func1_1_L18)
ultimately show d(x) = (f O g O h)(x) by simp
qedP
ultimately show {hx, xi.x∈succ(succ(k))→G} = f O g O husing func_eq by simp
qed
moreover note hIsContinuous(τ ,T,f)i P
ultimately have IsContinuous(ψ,T,{hx, xi.x∈succ(succ(k))→G})
using comp_cont3 by simp
} thus thesis by simp
qed
ultimately show thesis by (rule ind_on_nat)
qed
end

68

Properties in topology 2

theory Topology_ZF_properties_2 imports Topology_ZF_7 Topology_ZF_1b
Finite_ZF_1 Topology_ZF_11
begin

68.1

Local properties.

This theory file deals with local topological properties; and applies local
compactness to the one point compactification.
We will say that a topological space is locally @term”P” iff every point
has a neighbourhood basis of subsets that have the property @term”P” assubspaces.
definition
IsLocally (_{is locally}_ 90)
S
where T{is a topology} =⇒ T{is locally}P ≡ (∀ x∈ T. ∀ b∈T. x∈b −→(∃ c∈Pow(b). x∈Interior(c,T) ∧ P(c,T)))

955

68.2

First examples

Our first examples deal with the locally finite property. Finiteness is aproperty of sets, and hence it is preserved by homeomorphisms; which arein particular bijective.
The discrete topology is locally finite.
lemma discrete_locally_finite:
shows Pow(A){is locally}(λA.(λB. Finite(A)))
proof S
have ∀ b∈Pow(A).
(Pow(A){restricted to}b)=b unfolding RestrictedTo_def
by blast
then have ∀ b∈{{x}. x∈A}. Finite(b) by auto moreover
have reg:∀ S∈Pow(A). Interior(S,Pow(A))=S unfolding Interior_def byauto{S
fix x b assume x∈ Pow(A) b∈Pow(A) x∈bthen have {x}⊆b x∈Interior({x},Pow(A)) Finite({x}) using reg by
auto
then have ∃ c∈Pow(b). x∈Interior(c,Pow(A))∧Finite(c) by blast}Sthen have ∀ x∈ Pow(A). ∀ b∈Pow(A). x∈b −→ (∃ c∈Pow(b). x∈Interior(c,Pow(A))∧ Finite(c)) by auto
then show thesis using IsLocally_def[OF Pow_is_top] by autoqed

The included set topology is locally finite when the set is finite.
lemma included_finite_locally_finite:assumes Finite(A) and A⊆X
shows (IncludedSet(X,A)){is locally}(λA.(λB. Finite(A)))
proof have ∀ b∈Pow(X). b∩A⊆b by auto moreovernote assms(1)ultimately have rr:∀ b∈{A∪{x}. x∈X}. Finite(b) by force{S
fix x b assume x∈ (IncludedSet(X,A)) b∈(IncludedSet(X,A)) x∈bthen have A∪{x}⊆b A∪{x}∈{A∪{x}. x∈X} and sub: b⊆X unfolding IncludedSet_def
by automoreover have A ∪ {x} ⊆ X using assms(2) sub hx∈bi by auto
then have x∈Interior(A∪{x},IncludedSet(X,A)) using interior_set_includedset[ofA∪{x}XA] by auto
ultimately have ∃ c∈Pow(b). x∈Interior(c,IncludedSet(X,A))∧ Finite(c)using rr by blast}Sthen have ∀ x∈ (IncludedSet(X,A)). ∀ b∈(IncludedSet(X,A)). x∈b −→(∃ c∈Pow(b). x∈Interior(c,IncludedSet(X,A))∧ Finite(c)) by auto
then show thesis using IsLocally_def includedset_is_topology by auto
qed

956

68.3

Local compactness

definition
IsLocallyComp (_{is locally-compact} 70)
where T{is locally-compact}≡T{is locally}(λB. λT. B{is compact in}T)

We center ourselves in local compactness, because it is a very important tool
in topological groups and compactifications.
If a subset is compact of some cardinal for a topological space, it is compactof the same cardinal in the subspace topology.
lemma compact_imp_compact_subspace:assumes A{is compact of cardinal}K{in}T A⊆B
shows A{is compact of cardinal}K{in}(T{restricted to}B) unfolding IsCompactOfCard_def
prooffrom assms show C:Card(K)unfolding IsCompactOfCard_def by auto
S
from assms have SA⊆ T unfolding IsCompactOfCard_def by auto
then have AA:A⊆ (T{restricted to}B) using assms(2) unfolding RestrictedTo_def
by auto moreover{S
fix M assume M∈Pow(T{restricted to}B) A⊆ M
let M={S∈T. B∩S∈M}
S S
from hM∈Pow(T{restricted to}B)i haveM⊆ M unfolding RestrictedTo_def
by autoS
S
with hA⊆ Mi have A⊆ MM∈Pow(T)S by autowith assms have ∃ N∈Pow(M). A⊆ N∧N≺K unfolding IsCompactOfCard_def
by autoS
then obtain N where N∈Pow(M) A⊆ N N≺K by auto
then have N{restricted to}B⊆M unfolding RestrictedTo_def FinPow_def
by automoreoverlet f={hB,B∩Bi. B∈N}
have f:N→(N{restricted to}B) unfolding Pi_def function_def domain_def
RestrictedTo_def by auto
then have f∈surj(N,N{restricted to}B) unfolding surj_def RestrictedTo_def
using apply_equality
by autofrom hN≺Ki have N.K unfolding lesspoll_def by autowith hf∈surj(N,N{restricted to}B)i have N{restricted to}B.N using
surj_fun_inv_2 Card_is_Ord C by autowith hN≺Ki have N{restrictedto}B≺K
using lesspoll_trans1 by auto
S
S
moreover from hA⊆ Ni have A⊆ (N{restricted to}B) using assms(2)unfolding RestrictedTo_def by autoS
ultimately have ∃ N∈Pow(M). A⊆ N ∧ N≺K by auto}Swith AAS show A ⊆(T {restricted
S to} B) ∧ (∀ M∈Pow(T {restricted to}B). A ⊆
M −→ (∃ N∈Pow(M). A ⊆N ∧ N≺K)) by autoqed

The converse of the previous result is not always true. For compactness, it957

holds because the axiom of finite choice always holds.
lemma compact_subspace_imp_compact:assumes A{is compact in}(T{restricted to}B) A⊆B
shows A{is compact in}T unfolding IsCompact_def
proofSfrom assms show A⊆ T unfolding IsCompact_def RestrictedTo_def by
auto
next
{
S
fix M assume M∈Pow(T) A⊆ M
let M=M{restricted to}Bfrom hM∈Pow(T)i have M∈Pow(T{restricted to}B) unfolding RestrictedTo_def
by autoS
S
from hA⊆ Mi have A⊆ M unfolding RestrictedTo_def using assms(2)by autohiSwith assms M∈Pow(T{restricted to}B) obtain N where N∈FinPow(M)A⊆ N unfolding IsCompact_def by blastfrom hN∈FinPow(M)i have N≺nat unfolding FinPow_def Finite_def using n_lesspoll_nat eq_lesspoll_transby autothen have Finite(N) using lesspoll_nat_is_Finite by auto
then obtain n where n∈nat N≈n unfolding Finite_def by auto
then have N.n using eqpoll_imp_lepoll by auto
moreover{fix BB assume BB∈N
with hN∈FinPow(M)i have BB∈M unfolding FinPow_def by auto
then obtain S where S∈M and BB=B∩S unfolding RestrictedTo_def
by autothen have S∈{S∈M. B∩S=BB} by auto
then obtain {S∈M. B∩S=BB}6=0 by auto}
then have ∀ BB∈N. ((λW∈N. {S∈M. B∩S=W})BB)6=0 by auto moreoverfrom hn∈nati have (N . n ∧ (∀ t∈N. (λW∈N. {S∈M. B∩S=W}) t 6= 0)−→ (∃ f. f ∈ Pi(N,λt. (λW∈N. {S∈M. B∩S=W}) t) ∧ (∀ t∈N. f t ∈ (λW∈N.
{S∈M. B∩S=W}) t))) using finite_choice unfolding AxiomCardinalChoiceGen_def
by blast
ultimately
obtain f where AA:f∈Pi(N,λt. (λW∈N. {S∈M. B∩S=W}) t) ∀ t∈N. ft∈(λW∈N.
{S∈M. B∩S=W}) t by blastfrom AA(2) have ss:∀ t∈N. ft∈{S∈M. B∩S=t} using beta_if by auto
then have {ft. t∈N}⊆M by auto{
fix t assume t∈Nwith ss have ft∈{S∈M. B∩S∈N} by auto}with AA(1) have FF:f:N→{S∈M. B∩S∈N} unfolding Pi_def Sigma_def using beta_if by auto moreover{958

fix aa bb assume AAA:aa∈N bb∈N faa=fbb
from AAA(1) ss have B∩ (faa) =aa by autowith AAA(3) have B∩(fbb)=aa by autowith ss AAA(2) have aa=bb by auto}
ultimately have f∈inj(N,{S∈M. B∩S∈N}) unfolding inj_def by auto
then have f∈bij(N,range(f)) using inj_bij_range by auto
then have f∈bij(N,fN) using range_image_domain FF by auto
then have f∈bij(N,{ft. t∈N}) using func_imagedef FF by auto
then have N≈{ft. t∈N} unfolding eqpoll_def by autowith hN≈ni have {ft. t∈N}≈n using eqpoll_sym eqpoll_trans by blast
with hn∈nati have Finite({ft. t∈N}) unfolding Finite_def by autowith ss have {ft. t∈N}∈FinPow(M) unfolding FinPow_def by auto moreover{
fix aa assume
aa∈ASwith hA⊆ Ni obtain b where b∈N and aa∈b by autowith ss have B∩(fb)=b by autowith haa∈bi have aa∈B∩(fb) by auto
then have aa∈ fb byS autowith hb∈Ni have aa∈ {ft. t∈N} by auto}S
then have A⊆ {ft. t∈N}
S by auto ultimately
have ∃ R∈FinPow(M). A⊆ R by auto}
S
S
then show ∀ M∈Pow(T). A ⊆M −→ (∃ N∈FinPow(M). A ⊆N) by autoqed

If the axiom of choice holds for some cardinal, then we can drop the compact
sets of that cardial are compact of the same cardinal as subspaces of every
superspace.
lemma Kcompact_subspace_imp_Kcompact:assumes A{is compact of cardinal}Q{in}(T{restricted to}B) A⊆B ({theaxiom of} Q {choice holds})
shows A{is compact of cardinal}Q{in}T
proof from assms(1) have a1:Card(Q) unfolding IsCompactOfCard_def RestrictedTo_def
by autoS
from assms(1) have a2:A⊆ T unfolding IsCompactOfCard_def RestrictedTo_def
by auto{S
fix M assume M∈Pow(T) A⊆ M
let M=M{restricted to}Bfrom hM∈Pow(T)i have M∈Pow(T{restricted to}B) unfolding RestrictedTo_def
by autoS
S
from hA⊆ Mi have A⊆ M unfolding RestrictedTo_def using assms(2)by autoSwith assms hM∈Pow(T{restricted to}B)i obtain N where N:N∈Pow(M) A⊆ N
N ≺ Q unfolding IsCompactOfCard_def by blast959

from N(3) have N.Q using lesspoll_imp_lepoll by auto moreover{
fix BB assume BB∈N
with hN∈Pow(M)i have BB∈M unfolding FinPow_def by auto
then obtain S where S∈M and BB=B∩S unfolding RestrictedTo_def
by autothen have S∈{S∈M. B∩S=BB} by auto
then obtain {S∈M. B∩S=BB}6=0 by auto}
then have ∀ BB∈N. ((λW∈N. {S∈M. B∩S=W})BB)6=0 by auto moreover
have (N . Q ∧ (∀ t∈N. (λW∈N. {S∈M. B∩S=W}) t 6= 0) −→ (∃ f. f ∈Pi(N,λt. (λW∈N. {S∈M. B∩S=W}) t) ∧ (∀ t∈N. f t ∈ (λW∈N. {S∈M. B∩S=W})t)))using assms(3) unfolding AxiomCardinalChoiceGen_def by blast
ultimately
obtain f where AA:f∈Pi(N,λt. (λW∈N. {S∈M. B∩S=W}) t) ∀ t∈N. ft∈(λW∈N.
{S∈M. B∩S=W}) t by blastfrom AA(2) have ss:∀ t∈N. ft∈{S∈M. B∩S=t} using beta_if by auto
then have {ft. t∈N}⊆M by auto{
fix t assume t∈Nwith ss have ft∈{S∈M. B∩S∈N} by auto}with AA(1) have FF:f:N→{S∈M. B∩S∈N} unfolding Pi_def Sigma_def using beta_if by auto moreover{
fix aa bb assume AAA:aa∈N bb∈N faa=fbb
from AAA(1) ss have B∩ (faa) =aa by autowith AAA(3) have B∩(fbb)=aa by autowith ss AAA(2) have aa=bb by auto}
ultimately have f∈inj(N,{S∈M. B∩S∈N}) unfolding inj_def by auto
then have f∈bij(N,range(f)) using inj_bij_range by auto
then have f∈bij(N,fN) using range_image_domain FF by auto
then have f∈bij(N,{ft. t∈N}) using func_imagedef FF by auto
then have N≈{ft. t∈N} unfolding eqpoll_def by autowith hN≺Qi have {ft. t∈N}≺Q using eqpoll_sym eq_lesspoll_trans by
blast moreoverwith ss have {ft. t∈N}∈Pow(M) unfolding FinPow_def by auto moreover{
fix aa assume
aa∈ASwith hA⊆ Ni obtain b where b∈N and aa∈b by autowith ss have B∩(fb)=b by autowith haa∈bi have aa∈B∩(fb) by auto
then have aa∈ fb byS autowith hb∈Ni have aa∈ {ft. t∈N} by auto}S
then have A⊆ {ft. t∈N} by auto ultimately

960

S
have ∃ R∈Pow(M). A⊆ R ∧ R≺Q by auto}
then show thesis using a1 a2 unfolding IsCompactOfCard_def by autoqed

Every set, with the cofinite topology is compact.
lemma cofinite_compact:shows X {is compact in}(CoFinite X) unfolding IsCompact_def
proofS
show X⊆ (CoFinite X) using union_cocardinal unfolding Cofinite_def
by autonext{
S
fix M assume M∈Pow(CoFinite X) X⊆ M{
assume M=0∨M={0}then haveby autoS M∈FinPow(M) unfolding FinPow_def
Swith hX⊆ Mi have ∃ N∈FinPow(M). X⊆ N by auto}
moreover{assume M6=0M6={0}then obtain U where U∈MU6=0 by autowith hM∈Pow(CoFinite X)i have U∈CoFinite X by autowith hU6=0i have U⊆X (X-U)≺nat unfolding Cofinite_def CoCardinal_def
by autothen have Finite(X-U) using lesspoll_nat_is_Finite
by autoS
then have (X-U){is in the spectrum of}(λT. ( T){is compact in}T)
using compact_spectrum
by autoS
S
then have (( (CoFinite (X-U)))≈X-U) −→ (( (CoFinite (X-U))){iscompact in}(CoFinite (X-U))) unfolding Spec_def
using InfCard_nat CoCar_is_topology unfolding Cofinite_def by
auto
then have com:(X-U){is compact in}(CoFinite (X-U)) using union_cocardinal
unfolding Cofinite_def by auto
have (X-U)∩X=X-U by auto
then have (CoFinite X){restricted to}(X-U)=(CoFinite (X-U)) using subspace_cocardinal unfolding Cofinite_def by autowith com have (X-U){is compact in}(CoFinite X) using compact_subspace_imp_compact[ofX-UCoFinite XX-U] by auto S
S
moreover have X-U⊆ M using hX⊆ Mi by auto
moreover note hM∈Pow(CoFinite X)i S
ultimately have ∃ N∈FinPow(M). X-U⊆ N unfolding IsCompact_def by
autoS
then obtain N where N⊆M Finite(N) X-U⊆ N unfolding FinPow_def
by autoSwith hU∈Mi have N ∪{U}⊆M Finite(N∪{U}) X⊆ (N ∪{U}) by autoS
then have ∃ N∈FinPow(M). X⊆ N unfolding FinPow_def by blast961

}ultimately
S
have ∃ N∈FinPow(M). X⊆ N by auto}
S
S
then show ∀ M∈Pow(CoFinite X). X ⊆M −→ (∃ N∈FinPow(M). X ⊆N)by autoqed

A corollary is then that the cofinite topology is locally compact; since every
subspace of a cofinite space is cofinite.
corollary cofinite_locally_compact:shows (CoFinite X){is locally-compact}
proof have cof:topology0(CoFinite X) and cof1:(CoFinite X){is a topology}
using CoCar_is_topology InfCard_nat Cofinite_def unfolding topology0_def
by auto{S
fix x B assume x∈ (CoFinite X) B∈(CoFinite X) x∈Bthen have x∈Interior(B,CoFinite X) using topology0.Top_2_L3[OF cof]by auto moreoverfrom hB∈(CoFinite X)i have B⊆X unfolding Cofinite_def CoCardinal_def
by autothen have B∩X=B by auto
then have (CoFinite X){restricted to}B=CoFinite B using subspace_cocardinal
unfolding Cofinite_def by auto
then have B{is compact in}((CoFinite X){restricted to}B) using cofinite_compact
union_cocardinal unfolding Cofinite_def by auto
then have B{is compact in}(CoFinite X) using compact_subspace_imp_compact
by autoultimately have ∃ c∈Pow(B). x∈Interior(c,CoFinite X)∧ c{is compactin}(CoFinite X) by auto}S
then have (∀ x∈ (CoFinite X). ∀ b∈(CoFinite X). x∈b −→ (∃ c∈Pow(b).
x∈Interior(c,CoFinite X) ∧ c{is compact in}(CoFinite X)))
by autothen show thesis unfolding IsLocallyComp_def IsLocally_def[OF cof1]
by autoqed

In every locally compact space, by definition, every point has a compact
neighbourhood.
theorem (in topology0) locally_compact_exist_compact_neig:
assumes T{isS locally-compact}
Sshows ∀ x∈ T. ∃ A∈Pow( T). A{is compact in}T ∧ x∈int(A)proof {
S
fix x assume
S x∈ T moreover
then have
T6=0 by auto

962

S
have
T∈T using union_open
topSpaceAssum by autoS
ultimately have ∃ c∈Pow( T). x∈int(c)∧ c{is compact in}T using assms
IsLocally_def topSpaceAssum
unfolding IsLocallyComp_def by autoS
then have ∃ c∈Pow( T). c{is compact in}T ∧ x∈int(c) by auto}
then show thesis by autoqed

In Hausdorff spaces, the previous result is an equivalence.

theorem (in topology0)
exist_compact_neig_T2_imp_locally_compact:
S
S
assumes ∀ x∈ T. ∃ A∈Pow( T). x∈int(A) ∧ A{is compact in}T T{is T2 }shows T{is locally-compact}
proof {
S
fix x assume x∈ T
S
with assms(1) obtain A where A∈Pow( T) x∈int(A) and Acom:A{is compactin}T by blast
then have Acl:A{is closed in}T using in_t2_compact_is_cl assms(2)by autoS
then have sub:A⊆ T unfolding IsClosed_def by auto{
fix U assume U∈T x∈U
let V=int(A∩U)
from hx∈Ui hx∈int(A)i have x∈U∩(int (A)) by auto
moreover from hU∈Ti have U∩(int(A))∈T using Top_2_L2 topSpaceAssum
unfolding IsATopology_def
by auto moreover
have U∩(int(A))⊆A∩U using Top_2_L1 by auto
ultimately have x∈V using Top_2_L5 by blast
have V⊆A using Top_2_L1 by auto
then have cl(V)⊆A using Acl Top_3_L13 by auto
then have A∩cl(V)=cl(V) by auto moreoverS
have clcl:cl(V){is closed in}T using cl_is_closed hV⊆Ai hA⊆ Ti byauto
ultimately have comp:cl(V){is compact in}T using Acom compact_closed[ofAnatTcl(V)] Compact_is_card_nat
by auto{then have cl(V){is compact in}(T{restricted to}cl(V)) using compact_imp_compact_subcl(V)natT] Compact_is_card_nat
by S
auto moreoverhave(T{restricted to}cl(V))=cl(V) unfolding RestrictedTo_def
using clcl unfolding IsClosed_def
by auto moreoverSultimately have ( (T{restricted to}cl(V))){is compact in}(T{restrictedto}cl(V)) by auto}S
then have ( (T{restricted to}cl(V))){is compact in}(T{restrictedto}cl(V)) by auto moreover963

have (T{restricted to}cl(V)){is T2 } using assms(2) T2_here clcl
unfolding IsClosed_def by auto
ultimately have (T{restricted to}cl(V)){is T4 } using topology0.T2_compact_is_normal
unfolding topology0_def
using Top_1_L4 unfolding isT4_def using T2_is_T1 by auto
then have clvreg:(T{restricted to}cl(V)){is regular} using topology0.T4_is_T3
unfolding topology0_def isT3_def using Top_1_L4
by autoS
have V⊆cl(V) using cl_contains_set hV⊆Ai hA⊆ Ti by auto
then have V∈(T{restricted to}cl(V)) unfolding RestrictedTo_def
using Top_2_L2 by autowith hx∈Vi obtain W where Wop:W∈(T{restricted to}cl(V)) and clcont:Closure(W,(T{restrto}cl(V)))⊆V and cinW:x∈Wusing topology0.regular_imp_exist_clos_neig unfolding topology0_def
using Top_1_L4 clvreg
by blastfrom clcont Wop have W⊆V using topology0.cl_contains_set unfolding topology0_def using Top_1_L4 by autowith Wop have W∈(T{restricted to}cl(V)){restricted to}V unfolding RestrictedTo_def by auto S
S
moreover from hV⊆Ai hA⊆ STi have V⊆ T by auto
then have V⊆cl(V)cl(V)⊆ T using hV⊆cl(V)i Top_3_L11(1) by auto
then have (T{restricted to}cl(V)){restricted to}V=(T{restrictedto}V) using subspace_of_subspace by auto
ultimately have W∈(T{restricted to}V) by auto
then obtain UU where UU∈T W=UU∩V unfolding RestrictedTo_def by
auto
then have W∈T using Top_2_L2 topSpaceAssum unfolding IsATopology_def
by auto moreover
have W⊆Closure(W,(T{restricted to}cl(V))) using topology0.cl_contains_set
unfolding topology0_def
using Top_1_L4 Wop by auto
ultimately have A1:x∈int(Closure(W,(T{restricted to}cl(V)))) using Top_2_L6 cinW by autofrom clcont have A2:Closure(W,(T{restricted to}cl(V)))⊆U using
Top_2_L1 by auto
have clwcl:Closure(W,(T{restricted to}cl(V))) {is closed in}(T{restrictedto}cl(V))
using topology0.cl_is_closed Top_1_L4 Wop unfolding topology0_def
by autofrom comp have cl(V){is compact in}(T{restricted to}cl(V)) using compact_imp_compact_subspace[of cl(V)natT] Compact_is_card_nat
by autowith clwcl have ((cl(V)∩(Closure(W,(T{restricted to}cl(V)))))){iscompact in}(T{restricted to}cl(V))
using compact_closed Compact_is_card_nat by auto moreoverfrom clcont have cont:(Closure(W,(T{restrictedto}cl(V))))⊆cl(V)S
using cl_contains_set hV⊆AihA⊆ Ti
by blast964

then have ((cl(V)∩(Closure(W,(T{restricted to}cl(V))))))=Closure(W,(T{restrictedto}cl(V))) by auto
ultimately have Closure(W,(T{restricted to}cl(V))){is compact in}(T{restrictedto}cl(V)) by auto
then have Closure(W,(T{restricted to}cl(V))){is compact in}T using compact_subspace_imp_compact[of Closure(W,T{restricted to}cl(V))]
cont by autowith A1 A2 have ∃ c∈Pow(U). x∈int(c)∧c{is compact in}T by auto}
then have ∀ U∈T. x∈U −→ (∃ c∈Pow(U). x∈int(c)∧c{is compact in}T)
by auto}then show thesis unfolding IsLocally_def[OF topSpaceAssum] IsLocallyComp_def
by autoqed

68.4

Compactification by one point

Given a topological space, we can always add one point to the space and geta new compact topology; as we will check in this section.
definition
OPCompactification ({one-point compactification
S of}_S90)
S
where {one-point compactification of}T≡T∪{{ T}∪(( T)-K). K∈{B∈Pow( T).
B{is compact in}T ∧ B{is closed in}T}}Firstly, we check that what we defined is indeed a topology.
theorem (in topology0) op_comp_is_top:
shows ({one-point compactification of}T){is a topology} unfolding IsATopology_def
proof (safe)
fix M assume M⊆{one-pointof}T S
S compactificationSthen have disj:M⊆T∪{{ T}∪(( T)-K). K∈{B∈Pow( T). B{is compact in}T
∧ B{is closed in}T}} unfolding OPCompactification_def by auto
let MT={A∈M. A∈T}
have MT⊆T by S
auto
then have c1: MT∈T using topSpaceAssum unfolding IsATopology_def by
auto
let MK={A∈M.
/ S
S S A∈T}have
M= MK ∪
MT by auto S
SS
from disj have MK⊆{A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T). B{is compactin}T ∧ B{is closed S
in}T}}}
S by auto
moreover have N: T∈(/
T) using mem_not_refl by auto{
S
S
S
fix B assume B∈M B∈{{ T}∪(( T)-K). K∈{B∈Pow( T). B{is compactin}T ∧ B{is closed in}T}}S
SS
then obtain KS where K∈Pow( T) B={ T}∪(( T)-K) by autowith N haveT∈B by autowith N have B∈T/ by autowith hB∈Mi have B∈MK by auto

965

}
S
S
S
then have {A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T). B{is compact in}T
∧ B{is closed in}T}}}⊆MK by auto
S
S
S
ultimately have MK_def:MK={A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T).
B{is compact in}TS ∧ B{isS closedS in}T}}} by auto
let KK={K∈Pow( T). { T}∪(( T)-K)∈MK}{
assume MK=0
S S
then have S M= MT by auto
then have S M∈T using c1 by auto
then haveM∈{one-point compactification of}T unfolding OPCompactification_def
by auto}moreover{assume MK6=0
then obtain A where A∈MKSby auto
S
S
then obtain K1 where A={ T}∪(( T)-K1) K1∈Pow( T) K1{is closedin}T K1{is compact in}T
T using MK_def by autowith hA∈MKi haveS KK⊆K1
S by auto
S
from hA∈MKi hA={ T}∪(( T)-K1)i hK1∈Pow( T)i have KK6=0 by blast{
fix K assumeSK∈KK S
Sthen have { T}∪(( T)-K)∈MKK⊆S T by auto
S
S
S
S
then obtain KK where A:{ T}∪(( T)-K)={ T}∪(( T)-KK) KK⊆ T
KK{is compact in}T KK{is closed in}T using MK_def by auto
note A(1)S moreover
S
S
S
S
S
have ( T)-K⊆{ T}∪((
T)-K)
T}∪((
T)-KK)autoS
S ( T)-KK⊆{SS
S by Sultimately have ( T)-K⊆{ T}∪(( T)-KK) ( T)-KK⊆{ T}∪(( T)-K)
by auto moreover SSSSfrom NShave
TS∈(/T)-K ST∈(/T)-KK
S by auto ultimately
have ( T)-K⊆((
T)-KK)(T)-KK⊆((T)-K) by auto
S
S
then have(T)-K=(
T)-KK
by
auto
moreoverS
S
Sfrom hK⊆S Ti have
S K=( T)-(( T)-K) by auto ultimately
have K=( ST)-(( T)-KK) by autowith hKK⊆ Ti have K=KK by autowith A(4) have K{is closed in}T by auto}
then have ∀ K∈KK. T
K{is closed in}T by autowith hKK6=0i have ( KK){is closed in}T
T using Top_3_L4 by autowith hK1{is compact in}Ti have
(K1∩(KK)){is compact in}T using Compact_is_card_nat
Tcompact_closed[ofK1natTKK]
byauto
moreoverT
T
Tfrom h T KK⊆K1i have K1∩( KK)=( KK) by auto ultimately
have ( TKK){is compact in}T by
T autoSS
S
Twith h( KK){is closed in}Ti h KK⊆K1i hK1∈Pow( T)i have ({ T}∪(( T)-( KK)))∈({one-pocompactification of}T)
unfolding
OPCompactification_def
SSS
S by blast
S
have t: MK= {A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T). B{is compactin}T ∧ B{is closed in}T}}}966

using MK_def by auto{S
fix x assume x∈S MKSSSwith t have x∈ {A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T). B{iscompact in}T ∧ B{is closed in}T}}}
S by auto
S
S
then have ∃ AA∈{A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T). B{is compactin}T ∧ B{is closed in}T}}}. x∈AA
using Union_iff by auto
S
S
S
then obtain AA where AAp:AA∈{A∈M. A∈{{ T}∪(( T)-K). K∈{B∈Pow( T).
B{is compact in}T ∧ B{is closed S
in}T}}}Sx∈AA by auto S
then obtain K2 where AA={ T}∪(( T)-K2) K2∈Pow( T)K2{is compactin}T K2{is closed in}T bySauto
S
with hx∈AAi have/by autoS x= T ∨S (x∈( ST) ∧ x∈K2)
from hK2∈Pow( T)i hAA={ T}∪(( T)-K2)i AAp(1) MK_def have K2∈KK
by autoTthen have
KK⊆K2 Sby auto
S
S
S
T
i have x=
with hx= T ∨ (x∈( T) ∧ x∈K2)/
T∨(x∈ T ∧ x∈
/ KK) by
auto
S
S
T
then have x∈{ T}∪(( T)-( KK)) by auto
}
S
S
S
T
then haveMK⊆{ T}∪(( T)-( KK)) by auto
moreover{SS
T
fix x assume Sx∈{ T}∪((
T)-(T KK))S
then have x= T∨(x∈( T)∧ x∈/ KK) byS auto S
with hKK6=0i S
obtain S
K2 where K2∈KK x= T∨(x∈ T∧ x∈K2)/
by autothen have{T}∪((T)-K2)∈MK
by
auto
S
S
S
i have x∈
with hx= T∨(x∈ T∧ x∈K2)/
MK by auto
}
S
S
T
S
then have { T}∪((
T)-(
KK))⊆
MKT by (safe,auto)
S
S
S
ultimately
have
MK={
T}∪((
T)-(
S
S
S S
S KK)) by blastfrom hS MT∈Ti have ST-(S T- MT)= MT by autowith h MT∈Ti have ( T- MT){is closed in}T unfolding IsClosed_def
by auto
S
T
S
S S
S
T
S S
have (( T)-( KK))∪( T-( T- MT))=( T)-(( KK)∩( T- MT)) by
auto
S
S
T
S
S S
S
S
T
S S
then have ({ T}∪(( T)-( KK)))∪( T-( T- MT))={ T}∪(( T)-(( KK)∩( T- MT)))by auto S
S
S
T
S
S S
S
S
S
S
S
T
with h MK={ T}∪(( T)-( KK))ih T-( T- MT)= MTi haveMK∪ MT={ T}∪(( T)-(( KK)
by auto
S S
S
S
S
S
T
S S
with h M= MK ∪ MTi have unM: M={ T}∪(( T)-(( KK)∩( T- MT)))by autoT
S S
TSS
have (( KK)∩( T- MT)) {is closed in}T using h( KK){is closed in}Tih( T-( MT)){isclosed in}Ti
Top_3_L5 by auto
moreoverS
S
Tnote h( T-( TMT)){isS closedin}Ti h( KK){is compact in}Ti
Sthen have (( KK)∩(
T T- MT)){isS S compact of cardinal}nat{in}T using compact_closed[ofKKnatT( T- MT)] Compact_is_card_nat

967

by auto
T
S S
then have (( KK)∩( T- MT)){is compact in}T using Compact_is_card_nat
by autoSS
T
S S
ultimately have { T}∪( T-(( KK)∩( T- MT)))∈{one-point compactificationof}T
unfolding OPCompactification_def
IsClosed_def by autoSwith unM haveM∈{one-point compactification of}T by auto}S
ultimately show
M∈{one-point compactification of}T by autonext
fix U V assume U∈{one-point compactification of}T and V∈{one-pointcompactification of}TS
SS
then have A:U∈T∨(∃ KU∈Pow( T). U={ T}∪( T-KU)∧KU{is closed in}T∧KU{iscompact in}T)SSSV∈T∨(∃ KV∈Pow( T). V={ T}∪( T-KV)∧KV{is closed in}T∧KV{is compactin}T) unfolding OPCompactification_def
by autoS
S
have N: T∈(/
T) using mem_not_refl by auto{
assume U∈TV∈T
then have U∩V∈T using topSpaceAssum unfolding IsATopology_def by
auto
then have U∩V∈{one-point compactification of}T unfolding OPCompactification_def
by auto}moreover{assume U∈TV∈T/S
S
then obtain KV where V:KV{is closed in}TKV{is compact in}TV={ T}∪( T-KV)
using A(2) by autoS
i havewith N hU∈TS
T∈U/ by auto
then have
T∈U∩V
/
by
S autothen have U∩V=U∩(
T-KV) using V(3) by autoS
moreover have
T-KV∈T
using V(1) unfolding IsClosed_def by autoSwith hU∈Ti have U∩( T-KV)∈T using topSpaceAssum unfolding IsATopology_def
by autoSwith hU∩V=U∩( T-KV)i have U∩V∈T by auto
then have U∩V∈{one-point compactification of}T unfolding OPCompactification_def
by auto}moreover{assume U∈TV∈T/S
S
then obtain KV where V:KV{is closed in}TKV{is compact in}TU={ T}∪( T-KV)
using A(1) by autoS
i havewith N hV∈TS
T∈V/ by auto
then haveT∈U∩V/ S by auto
then have U∩V=(S T-KV)∩V using V(3) by auto
moreover have
T-KV∈T using V(1) unfolding IsClosed_def by auto968

Swith hV∈Ti have ( T-KV)∩V∈T using topSpaceAssum unfolding IsATopology_def
by autoSwith hU∩V=( T-KV)∩Vi have U∩V∈T by auto
then have U∩V∈{one-point compactification of}T unfolding OPCompactification_def
by auto}moreover{assume U∈TV
/ ∈T
/
S
S
then obtain KV KU where V:KV{is closed in}TKV{iscompactin}TV={ T}∪( T-KV)S
Sand U:KU{is closed in}TKU{is compact in}TU={ T}∪( T-KU)
using A by autoSwith V(3) U(3) have
T∈U∩V
by S
auto
S
S
then have U∩V={S T}∪(( ST-KV)∩( T-KU)) using V(3) U(3) by auto
moreover have
T-KV∈T T-KU∈T using V(1) U(1) unfolding IsClosed_def
by autoS
S
then have ( T-KV)∩( T-KU)∈T using topSpaceAssum unfolding IsATopology_def
by autoS
S
SSSS
then have ( T-KV)∩( T-KU)= T-( T-(( T-KV)∩( T-KU))) by auto
moreover SSSSSwith h( T-KV)∩( T-KU)∈Ti have ( T-( T-KV)∩( T-KU)){is closedin}T unfolding IsClosed_def
by auto moreover S
SSfrom V(1) U(1) have ( T-( T-KV)∩( T-KU))=KV∪KU unfolding IsClosed_def
by autoSSSwith V(2) U(2) have ( T-( T-KV)∩( T-KU)){is compact in}T using
union_compact[of KVnatTKU] Compact_is_card_nat
InfCard_nat by auto ultimately
have U∩V∈{one-point compactification of}T unfolding OPCompactification_def
by auto}ultimately show U∩V∈{one-point compactification of}T by autoqed

The original topology is an open subspace of the new topology.
theorem S(in topology0) open_subspace:shows
T∈{one-point
S compactification of}T and ({one-point compactificationof}T){restricted to} T=T
proof - S
show
T∈{one-point compactification of}T
unfolding OPCompactification_def using topSpaceAssum unfolding IsATopology_def
by autoS
have T⊆({one-point compactification of}T){restricted to} T unfolding OPCompactification_def RestrictedTo_def by auto
moreover{S
fix A assume A∈({one-point compactification of}T){restrictedSto} T
then obtain R where R∈({one-point compactification of}T) A= T∩R
unfolding RestrictedTo_def by auto

969

S
S
then obtain K where K:R∈T ∨ (R={ T}∪( T-K) ∧ K{is closed in}T)
unfolding OPCompactification_def
by autoS
S
with hA= T∩Ri have (A=R∧R∈T)∨(A= T-K ∧ K{is closed in}T) using
mem_not_refl unfolding IsClosed_def by autowith K have A∈T unfolding IsClosed_def by auto}
ultimately
S
show ({one-point compactification of}T){restricted to} T=T by autoqed

We added only one new point to the space.
lemma (inS topology0) op_compact_total:
S
S
shows
({one-point compactification of}T)={ T}∪( T)
proof have 0{is compact in}T unfolding IsCompact_def FinPow_def
by autoS
moreover note Top_3_L2 ultimately have TT:0∈{A∈Pow( T). A{is compactin}T ∧A{isS closed in}T} by auto
S
S S
S
S
have
({one-point compactification of}T)=( T)∪( {{ T}∪( T-K). K∈{B∈Pow( T).
B{is compact in}T∧B{is closed in}T}}) unfolding OPCompactification_def
by blast
SS
S SS
also have . . .=( T)∪{ T}∪( {( T-K). K∈{B∈Pow( T). B{is compact in}T∧B{isclosed in}T}}) using
S TT by autoS
S
ultimately show({one-point compactification of}T)={ T}∪( T) by
auto
qed

The one point compactification, gives indeed a compact topological space.
theorem (incompact_op:
S topology0)
Sshows ({ T}∪( T)){is compact in}({one-point compactification of}T)
unfolding IsCompact_def
proof (safe)
have 0{is compact in}T unfolding IsCompact_def FinPow_def
by autoS
moreover note Top_3_L2 ultimately have 0∈{A∈Pow( T). A{is compactin}T ∧A{is closedin}T}
by autoS
S
then have { T}∪( T)∈{one-point compactification of}T unfolding OPCompactification_def
by autoS
S
then show
T ∈{one-point compactification of}T by autonext
fix x B assumeS x∈BB∈T
then show x∈ ({one-point compactification of}T) using open_subspaceby autonext
SSS
fix M assume A:M⊆({one-pointcompactification of}T) { T} ∪T ⊆MSthen obtain
R
where
R∈M
T∈R
by
auto
S S
have
T∈
/ S
T using mem_not_refl by auto
S
S
with hR∈Mi h T∈Ri A(1) obtain K where K:R={ T}∪( T-K) K{is compactin}TK{is closed in}T
unfolding OPCompactification_def
by autoS
S
from K(1,2) have B:{ T} ∪ ( T) = R ∪ K unfolding IsCompact_def by

970

auto
S
with A(2) have K⊆ M by auto
from
K(2) have K{is compact in}(({one-point compactification of}T){restrictedSto} T) using open_subspace(2)by autothen have K{is compact in}({one-point compactification of}T) using
compact_subspace_imp_compacthK{is closed in}Ti unfolding IsClosed_def by auto
S
S
with hK⊆ Mi A(1) have (∃ N∈FinPow(M). K ⊆N) unfolding IsCompact_def
by autoS
then obtain N where N∈FinPow(M) K⊆ N S
by autowith hR∈Mi have (N ∪{R})∈FinPow(M)R∪K⊆ (N∪{R}) unfolding FinPow_def
by autoSSSwith B show ∃ N∈FinPow(M). { T} ∪ ( T)⊆ N by autoqed

The one point compactification is Hausdorff iff the original space is also
Hausdorff and locally compact.
lemma (in topology0) op_compact_T2_1:
assumes ({one-point compactification of}T){is T2 }shows T{is T2 }S
using T2_here[OF assms, ofT] open_subspace by auto
lemma (in topology0) op_compact_T2_2:
assumes ({one-point compactification of}T){is T2 }shows T{is locally-compact}
proof {
S
fix x assume x∈
S T Sthen have x∈{ S
T}∪( ST) byS auto
moreoverShave
T∈{ S T}∪( T) by auto moreoverfrom hx∈ Ti have x6= T using mem_not_refl by auto
ultimately have ∃ U∈{one-point
S compactification of}T. ∃ V∈{one-pointcompactification of}T. x ∈ U ∧ ( T) ∈ V ∧ U ∩ V = 0
using assms op_compact_total unfolding isT2_def by auto
then obtain U V where UV:U∈{one-point compactification of}TV∈{one-pointcompactificationof}TSx∈U T∈VU∩V=0 by auto
S
from hV∈{one-pointcompactificationof}Ti h T∈Vi mem_not_refl obS
Stain K where K:V={ T}∪( T-K)K{is closed in}TK{is compact in}T
unfolding OPCompactification_def by auto
S
S
from hU∈{one-point compactification of}Ti have U⊆{ T}∪( T) unfolding OPCompactification_def
using op_compact_total by
S autowith hU∩V=0iSK have U⊆KK⊆ T unfolding IsClosed_def by auto
then have ( T)∩U=U
S by auto moreover
from
UV(1)
have
((
T)∩U)∈({one-point compactification of}T){restrictedSto} T
unfolding RestrictedTo_def by auto971

ultimately have U∈T using open_subspace(2) by autowith hx∈USihU⊆Ki have x∈int(K) using Top_2_L6 S
by autowith hK⊆ Ti hK{is compact in}Ti have ∃ A∈Pow( T). x∈int(A)∧ A{iscompact in}T by auto}
S
S
then have ∀ x∈ T. ∃ A∈Pow( T). x∈int(A)∧ A{is compact in}T by auto
then show thesis using op_compact_T2_1[OF assms] exist_compact_neig_T2_imp_locally_compac
by autoqed
lemma (in topology0) op_compact_T2_3:
assumes T{is locally-compact} T{is T2 }shows ({one-point compactification of}T){is T2 }proof {SS
fix x y assume x6=yx∈ ({one-point compactification of}T)y∈ ({one-pointcompactification of}T)S
SSS
then have S:x∈{ T}∪( T)y∈{ T}∪( T) using op_compact_total by
auto
{
S
S
assume x∈ Ty∈ Twith hx6=yi have ∃ U∈T. ∃ V∈T. x∈U∧y∈V∧U∩V=0 using assms(2) unfolding isT2_def by auto
then have ∃ U∈({one-point compactification of}T). ∃ V∈({one-pointcompactification of}T). x∈U∧y∈V∧U∩V=0
unfolding OPCompactification_def by auto}
moreover{S
S
assume x∈/ T∨yS∈/ T S
with S have x= T∨y=
S T byS auto S
S
with hx6=yi have S(x= T∧y6=T)∨(y=
T∧x6
SS
S = T) by autowith S have (x= T∧y∈ T)∨(y=
S T∧x∈ T) by autoS
then obtain Ky Kx where (x= T∧ Ky{is compact in}T∧y∈int(Ky))∨(y= T∧
Kx{is compact in}T∧x∈int(Kx))
using assms(1)S locally_compact_exist_compact_neig by blastSthen have (x= T∧ Ky{is compact in}T∧ Ky{is closed in}T∧y∈int(Ky))∨(y= T∧
Kx{is compact in}T∧ Kx{is closed in}T∧x∈int(Kx))
using in_t2_compact_is_classms(2) by auto
S
S
then have (x∈{T}∪(
T-Ky)∧y∈int(Ky)∧
Ky{is compact in}T∧ Ky{isS
S
closed in}T)∨(y∈{ T}∪( T-Kx)∧x∈int(Kx)∧ Kx{is compact in}T∧ Kx{isclosed in}T)
by auto moreover{
fix K
assume A:K{isS closed in}TK{is compact in}T
then have K⊆ TS unfolding
IsClosed_def by autoS
moreover have
T∈
/
T
using
mem_not_refl by autoS
S
ultimately have ({ T}∪( T-K))∩K=0 by auto

972

S
S
then have ({ T}∪( T-K))∩int(K)=0 using Top_2_L1 by auto moreover
S
S
from A have { T}∪( T-K)∈({one-point compactification of}T)
unfolding OPCompactification_def
IsClosed_def by auto moreover
have int(K)∈({one-point compactification of}T) using Top_2_L2
unfolding OPCompactification_def
by auto ultimately
S
S
have int(K)∈({one-point
S
Scompactification of}T)∧{ T}∪( T-K)∈({one-pointcompactification of}T)∧({ T}∪( T-K))∩int(K)=0
by auto}S
S
ultimately have ({ T} ∪ ( T - Ky)∈({one-point compactification
SSof}T)∧int(Ky)∈({one-point
S
Scompactification of}T)∧x ∈ { T} ∪ ( T - Ky)∧ y ∈ int(Ky)∧ ({S T}∪( T-Ky))∩int(Ky)=0) ∨S({ T} ∪ ( T - Kx)∈({one-pointS
S compactification of}T)∧int(Kx)∈({one-point
S
S
compactification of}T)∧y ∈ { T} ∪ ( T - Kx) ∧ x ∈ int(Kx) ∧ ({ T}∪( T-Kx))∩int(Kx)=0)
by automoreover{S
S
assume ({ T} ∪ ( TS- Ky)∈({one-pointcompactification of}T)∧int(Ky)∈({one-point
S
S
S
compactification of}T)∧x ∈ { T} ∪ ( T - Ky) ∧ y ∈ int(Ky) ∧ ({ T}∪( T-Ky))∩int(Ky)=0)
then have ∃ U∈({one-point compactification of}T). ∃ V∈({one-pointcompactification of}T). x∈U∧y∈V∧U∩V=0 using exI[OF exI[of _ int(Ky)],of
λU V. U∈({one-point compactificationof}T)∧V∈({one-point compactification
SSof}T) ∧ x∈U∧y∈V∧U∩V=0 { T}∪( T-Ky)]by auto} moreover{SS
assume ({ T} ∪ ( TS- Kx)∈({one-pointcompactification of}T)∧int(Kx)∈({one-point
S
S
S
compactification of}T)∧y ∈ { T} ∪ ( T - Kx) ∧ x ∈ int(Kx) ∧ ({ T}∪( T-Kx))∩int(Kx)=0)
then have ∃ U∈({one-point compactification of}T). ∃ V∈({one-point
S
S
compactification of}T). x∈U∧y∈V∧U∩V=0 using exI[OF exI[of _ { T}∪( T-Kx)],of
λU V. U∈({one-point compactification of}T)∧V∈({one-point compactificationof}T) ∧ x∈U∧y∈V∧U∩V=0int(Kx) ]by blast}
ultimately have ∃ U∈({one-point compactification of}T). ∃ V∈({one-pointcompactification of}T). x∈U∧y∈V∧U∩V=0 by auto}
ultimately have ∃ U∈({one-point compactification of}T). ∃ V∈({one-pointcompactification of}T). x∈U∧y∈V∧U∩V=0 by auto}
then show thesis unfolding isT2_def by autoqed

In conclusion, every locally compact Hausdorff topological space is regular;
since this property is hereditary.
corollary (in topology0) locally_compact_T2_imp_regular:

973

assumes T{is locally-compact} T{is T2 }shows T{is regular}
proof from assms have ( {one-point compactification of}T) {is T2 } using op_compact_T2_3
by autothen have ({one-point compactification of}T) {is T4 } unfolding isT4_def
using T2_is_T1 topology0.T2_compact_is_normal
op_comp_is_top unfolding topology0_def using op_compact_total compact_op
by autothen have ({one-point compactification of}T) {is T3 } using topology0.T4_is_T3
op_comp_is_top unfolding topology0_def
by autothen have ({one-point compactification of}T) {is regular} using isT3_def
by autoSmoreoverShaveT⊆ ({one-point compactification of}T) using op_compact_total
by autoS
ultimately have (({one-point compactification of}T){restricted to} T){is regular} using regular_here by auto
then show T{is regular} using open_subspace(2) by autoqedThis last corollary has an explanation: In Hausdorff spaces, compact setsare closed and regular spaces are exactly the ”locally closed spaces”(thosewhich have a neighbourhood basis of closed sets). So the neighbourhoodbasis of compact sets also works as the neighbourhood basis of closed sets
we needed to find.
definition
IsLocallyClosed (_{is locally-closed})
where T{is locally-closed} ≡ T{is locally}(λB TT. B{is closed in}TT)lemma (in topology0) regular_locally_closed:shows T{is regular} ←→ (T{is locally-closed})proof
assume T{is regular}Sthen have a:∀ x∈ T. ∀ U∈T. (x∈U) −→ (∃ V∈T. x ∈ V ∧ cl(V) ⊆ U) using regular_imp_exist_clos_neig by auto{S
fix x b assume x∈ Tb∈Tx∈bwith a obtain V where V∈Tx∈Vcl(V)⊆b by blastnote hcl(V)⊆bi moreoverS
from hV∈Ti have V⊆ T by auto
then have V⊆cl(V) using cl_contains_set by auto
ihV∈Ti have x∈int(cl(V)) using Top_2_L6 by auto moreoverwith hx∈VShfrom V⊆ Ti have cl(V){is closed in}T using cl_is_closed by auto
ultimately have x∈int(cl(V))cl(V)⊆bcl(V){is closed in}T by auto
then have ∃ K∈Pow(b). x∈int(K)∧K{is closed in}T by auto}
then show T{is locally-closed} unfolding IsLocally_def[OF topSpaceAssum]
IsLocallyClosed_def974

by auto
next
assume T{is locally-closed}S
then have a:∀ x∈ T. ∀ b∈T. x∈b −→ (∃ K∈Pow(b). x∈int(K)∧K{is closedin}T) unfolding IsLocally_def[OF topSpaceAssum]
IsLocallyClosed_def by auto{S
fix x b assume x∈ Tb∈Tx∈bwith a obtain K where K:K⊆bx∈int(K)K{is closed in}T by blast
have int(K)⊆K using Top_2_L1 by autowith K(3) have cl(int(K))⊆K using Top_3_L13 by autowith K(1) have cl(int(K))⊆b by auto moreover
have int(K)∈T using Top_2_L2 by auto moreovernote hx∈int(K)i ultimately have ∃ V∈T. x∈V∧ cl(V)⊆b by auto}S
then have ∀ x∈ T. ∀ b∈T. x∈b −→ (∃ V∈T. x∈V∧ cl(V)⊆b) by auto
then show T{is regular} using exist_clos_neig_imp_regular by auto
qed

68.5

Hereditary properties and local properties

In this section, we prove a relation between a property and its local property
for hereditary properties. Then we apply it to locally-Hausdorff or locallyT2 . We also prove the relation between locally-T2 and another property thatappeared when considering anti-properties, the anti-hyperconnectness.
If a property is hereditary in open sets, then local properties are equivalent
to find just one open neighbourhood with that property instead of a whole
local basis.
lemma (in topology0) her_P_is_loc_P:
Sassumes ∀ TT. ∀ B∈Pow( TT). ∀ A∈TT.
S TT{is a topology}∧P(B,TT) −→ P(B∩A,TT)
shows (T{is locally}P) ←→ (∀ x∈ T. ∃ A∈T. x∈A∧P(A,T))
proof
assume A:T{is locally}P{S
fix x assume x:x∈ Twith A have ∀ b∈T. x∈b −→ (∃ c∈Pow(b). x∈int(c)∧P(c,T)) unfolding
IsLocally_def[OF topSpaceAssum]
by auto moreovernote xS moreoverhave
T∈T using topSpaceAssum
unfolding IsATopology_def by autoS
ultimately have ∃ c∈Pow( ST). x∈int(c)∧ P(c,T) by auto
then obtain c where c:c⊆ Tx∈int(c)P(c,T) by auto
have P:int(c)∈T using Top_2_L2 by auto moreoverfrom c(1,3) topSpaceAssum assms have ∀ A∈T. P(c∩A,T) by auto
ultimately have P(c∩int(c),T) by auto moreoverfrom Top_2_L1[of c] have int(c)⊆c by auto
then have c∩int(c)=int(c) by auto

975

ultimately have P(int(c),T) by autowith P c(2) have ∃ V∈T. x∈V∧P(V,T) by auto}S
then show ∀ x∈ T. ∃ V∈T. x∈V∧P(V,T) by autonext
Sassume A:∀ x∈ T. ∃ A∈T. x ∈ A ∧ P(A, T){S
fix x assume x:x∈ T{
fix b assume b:x∈bb∈Tfrom x A obtain A where A_def:A∈Tx∈AP(A,T) by autofrom A_def(1,3) assms topSpaceAssum have ∀ G∈T. P(A∩G,T) by autowith b(2) have P(A∩b,T) by auto
moreover from b(1) A_def(2) have x∈A∩b by auto moreover
have A∩b∈T using b(2) A_def(1) topSpaceAssum IsATopology_def by
auto
then have int(A∩b)=A∩b using Top_2_L3 by auto
ultimately have x∈int(A∩b)∧P(A∩b,T) by auto
then have ∃ c∈Pow(b). x∈int(c)∧P(c,T) by auto}
then have ∀ b∈T. x∈b−→(∃ c∈Pow(b). x∈int(c)∧P(c,T)) by auto}
then show T{is locally}P unfolding IsLocally_def[OF topSpaceAssum]
by autoqed

definition
IsLocallyT2 (_{is locally-T2 } 70)
where T{is locally-T2 }≡T{is locally}(λB. λT. (T{restricted to}B){isT2 })Since T2 is an hereditary property, we can apply the previous lemma.
corollary (in topology0) loc_T2:
Sshows (T{is locally-T2 }) ←→ (∀ x∈ T. ∃ A∈T. x∈A∧(T{restricted to}A){isT2 })proof {
fix TT BS A assume TT:TT{is a topology} (TT{restricted to}B){is T2 }A∈TTB∈Pow( TT)S
then have s:B∩A⊆BB⊆ TT by auto
then have (TT{restricted to}(B∩A))=(TT{restricted to}B){restrictedto}(B∩A) using subspace_of_subspaceby S
auto moreoverhave(TT{restricted to}B)=B unfolding RestrictedTo_def using s(2)by autoS
then have B∩A⊆ (TT{restricted to}B) using s(1) by auto moreovernote TT(2) ultimately have (TT{restricted to}(B∩A)){is T2 } using T2_hereby auto976

}Sthen have ∀ TT. ∀ B∈Pow( TT). ∀ A∈TT. TT{is a topology}∧(TT{restrictedto}B){is T2 } −→ (TT{restricted to}(B∩A)){is T2 }by autowith her_P_is_loc_P[where P=λA. λTT. (TT{restricted to}A){is T2 }] show
thesis unfolding IsLocallyT2_def by auto
qedFirst, we prove that a locally-T2 space is anti-hyperconnected.
Before starting, let’s prove that an open subspace of an hyperconnected
space is hyperconnected.
lemma(in topology0) open_subspace_hyperconn:
assumes T{is hyperconnected} U∈Tshows (T{restricted to}U){is hyperconnected}
proof {
fix A B assume A∈(T{restricted to}U)B∈(T{restricted to}U)A∩B=0
then obtain AU BU where A=U∩AUB=U∩BU AU∈TBU∈T unfolding RestrictedTo_def
by autothen have A∈TB∈T using topSpaceAssum assms(2) unfolding IsATopology_def
by autowith hA∩B=0i have A=0∨B=0 using assms(1) unfolding IsHConnected_def
by auto}then show thesis unfolding IsHConnected_def by autoqed
lemma(in topology0) locally_T2_is_antiHConn:assumes T{is locally-T2 }shows T{is anti-}IsHConnected
proof {S
fix A assume A:A∈Pow( T)(T{restricted to}A){is hyperconnected}{
fix x assume x∈A S
with A(1)have x∈ T by auto moreoverS
have
T∈T using topSpaceAssum unfolding IsATopology_def by auto
ultimately
S
have ∃ c∈Pow( T). x ∈ int(c) ∧ (T {restricted to} c) {is T2 } using assms
unfolding IsLocallyT2_def IsLocally_def[OFtopSpaceAssum] by autoS
then obtain c where c:c∈Pow( T)x∈int(c)(T {restricted to} c) {isT2 } by auto SS
have(T {restricted to} c)=( T)∩c unfolding RestrictedTo_def
by autoSSSwith hc∈Pow( T)ih T∈Ti have tot: (T {restricted to} c)=c by auto
have int(c)∈T using Top_2_L2 by auto
then have A∩(int(c))∈(T{restricted to}A) unfolding RestrictedTo_def

977

by auto
with A(2) have ((T{restricted to}A){restricted to}(A∩(int(c)))){ishyperconnected}using topology0.open_subspace_hyperconn unfolding topology0_def
using Top_1_L4
by autothen have (T{restricted to}(A∩(int(c)))){is hyperconnected} using subspace_of_subspace[of A∩(int(c))
AT] A(1) by force moreover
have int(c)⊆c using Top_2_L1 by auto
then have sub:A∩(int(c))⊆cby autoS
then have A∩(int(c))⊆ (T {restricted to} c) using tot by auto
then have ((T {restricted to} c){restricted to}(A∩(int(c)))) {isT2 } using
T2_here[OF c(3)] by autowith sub have (T {restricted to}(A∩(int(c)))){is T2 } using subspace_of_subspace[ofA∩(int(c))
ScT] hc∈Pow( T)i by auto
ultimately have (T{restricted to}(A∩(int(c)))){is hyperconnected}(T{restricted to}(A∩(int(c)))){is T2 }by autothen have (T{restricted to}(A∩(int(c)))){is hyperconnected}(T {restrictedto}(A∩(int(c)))){is anti-}IsHConnectedusing topology0.T2_imp_anti_HConn unfolding topology0_def using Top_1_L4 by auto
moreoverSS
have(T{restricted to}(A∩(int(c))))=( T)∩A∩(int(c)) unfolding RestrictedTo_def by auto S
with A(1) Top_2_L2 have(T{restricted to}(A∩(int(c))))=A∩(int(c))
by autoS
then have A∩(int(c))⊆ (T{restricted to}(A∩(int(c)))) by auto
moreoverS
have A∩(int(c))⊆ T using A(1) Top_2_L2 by auto
then have (T{restricted to}(A∩(int(c)))){restricted to}(A∩(int(c)))=(T{restrictedto}(A∩(int(c))))using subspace_of_subspace[of A∩(int(c))A∩(int(c))T] by auto
ultimately have (A∩(int(c))){is in the spectrum of}IsHConnected
unfolding antiProperty_def
by autothen have A∩(int(c)).1 using HConn_spectrum by auto
then have (A∩(int(c))={x}) using lepoll_1_is_sing hx∈Aihx∈int(c)iby autothen have {x}∈(T{restricted to}A) using h(A∩(int(c))∈(T{restrictedto}A))i by auto}
then have pointOpen:∀ x∈A. {x}∈(T{restricted to}A) by auto{
fix x y assume x6=yx∈Ay∈A
with pointOpen have {x}∈(T{restricted to}A){y}∈(T{restricted to}A){x}∩{y}=0978

by auto
with A(2) have {x}=0∨{y}=0 unfolding IsHConnected_def by auto
then have False by auto}
then have uni:∀ x∈A. ∀ y∈A. x=y by auto{
assume A6=0
then obtain x where x∈A by autowith uni have A={x} by auto
then have A≈1 using singleton_eqpoll_1 by auto
then have A.1 using eqpoll_imp_lepoll by auto}
moreover{assume A=0
then have A≈0 by auto
then have A.1 using empty_lepollI eq_lepoll_trans by auto}
ultimately have A.1 by auto
then have A{is in the spectrum of}IsHConnected using HConn_spectrum
by auto}then show thesis unfolding antiProperty_def by autoqed

Now we find a counter-example for: Every anti-hyperconnected space islocally-Hausdorff.
The example we are going to consider is the following. Put in X an antihyperconnected topology, where an infinite number of points don’t havefinite sets as neighbourhoods. Then add a new point to the set, p ∈/ X.
Consider the open sets on X ∪ p as the anti-hyperconnected topology andthe open sets that contain p are p ∪ A where X \ A is finite.
This construction equals the one-point compactification iff X is anti-compact;i.e., the only compact sets are the finite ones. In general this topology is
contained in the one-point compactification topology, making it compacttoo.
It is easy to check that any open set containing p meets infinite other nonempty open set. The question is if such a topology exists.
theorem (in topology0)
S COF_comp_is_top:
assumes T{is T1 }¬( T≺nat)
S
S
shows ((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T){is a topology}
proof SS
have N: T∈(/
T) using mem_not_refl by auto{
S
S
fix M assume M:M⊆((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T)979

let MT={A∈M. A∈T}
let MK={A∈M.
/ S
S A∈T}
S
have MM:(
MT)∪(MK)= M by autoS
have MN: MT∈T using topSpaceAssum unfolding IsATopology_def S
by auto S
then have sub:MK⊆({one-point compactification of}(CoFinite ( T)))-{{ T}}using M by autoS
then have MK⊆({one-point compactification of}(CoFinite ( T))) by
auto
SS
then have CO: MK∈({one-point compactification of}(CoFinite ( T)))using
topology0.op_comp_is_top[OF topology0_CoCardinal[OF InfCard_nat]]
unfolding Cofinite_def
IsATopology_def by auto{
S
S
assume AS: MK={ T}Smoreover have ∀ R∈MK. R⊆ MK
S by auto
ultimately have ∀ R∈MK.
R⊆{T} by autoS
then have ∀ R∈MK. R={ T}∨R=0 by force moreoverwith sub have
S ∀ R∈MK. R=0 by auto
then have
MK=0 by autowith AS have False by auto}
S
S
S
with CO have CO2: MK∈({one-point compactification of}(CoFinite ( T)))-{{ T}}by auto{S
S
assumeMK∈(CoFinite( T))
S
then have
MK∈T
S using
S assms(1) T1_cocardinal_coarser by autowith MN have{MT,SS MK}⊆(T) by auto
then
have
(
MT)∪(
MK)∈T using union_open[OF topSpaceAssum, of
SS{ MT, MK}] by autoS
then haveM∈T using MM by auto}
moreover{S
S
assumeMK∈(CoFinite
/
( T))
S
with CO S
obtain B where B{is compact in}(CoFinite ( T))B{is closedin}(CoFinite(S T))SSSS
MK={ CoFiniteT}∪( (CoFiniteT)-B) unfolding OPCompactification_def
by autoS
S
S
S
then have MK: MK={ T}∪( T-B)B{is closed in}(CoFinite ( T))using union_cocardinal
unfolding
Cofinite_def by auto
S
S
then have B:B⊆ T B≺nat∨B= T using closed_sets_cocardinal unfolding Cofinite_def by auto{S
assume B= T S
Swith MK have
MK={ T} by auto
then have False using CO2 by auto}Swith B have B⊆ T and natB:B≺nat by auto

980

S
S
have ( T-( SMT))∩B⊆B
by autoS
then have (S T-(S MT))∩B.B using subset_imp_lepoll by auto
then have ( ST-( SMT))∩B≺nat using natB lesspoll_trans1
by autoS
then have (( T-( MT))∩B){is closed in}(CoFinite ( T)) using
closed_sets_cocardinalB(1) unfolding
Cofinite_def
by autoS
S
S
S
then haveT-(( T-( MT))∩B)∈(CoFinite ( T)) unfolding IsClosed_def
using union_cocardinal
Cofinite_def
SSunfolding
SS
S bySautoS
also haveT-((
T-(MT))∩B)=(T-(
T-( MT)))∪( T-B) by auto
S
S
also have . . .=( MT)∪(S T-B)S by autoS
ultimately haveP:(SS MT)∪(S T-B)∈(CoFinite
S
S ( T))S by auto
then have eq: T-(
S T-((S MT)∪(S T-B)))=( MT)∪( T-B) by autoS
from P eq have ( T-(( MT)∪( T-B))){is closed in}(CoFinite ( T))
unfolding IsClosed_def
Susing union_cocardinal[of nat T] unfolding Cofinite_def by auto
moreover
S
S
S
S
S
S
S
have ( T-(( MT)∪( ST-B)))∩ T=( T-(( SMT)∪(S T-B)))S by autothenT){restricted to}( T-(( MT)∪( T-B)))=CoFinite
S
S haveS (CoFinite( T-(( MT)∪( T-B))) using subspace_cocardinal unfolding Cofinite_def
by autoSSSST){restricted
S thenShave (S T-(( MT)∪( T-B))){is compact in}((CoFiniteto}( T-(( MT)∪( T-B)))) using cofinite_compact
union_cocardinal
S
Sunfolding
S Cofinite_def by autoS
then have ( T-(( MT)∪( T-B))){is compact in}(CoFiniteT) using compact_subspace_imp_compactbyauto
ultimately
S
S
S
S
S
have { ST}∪( T-( T-(( MT)∪( T-B))))∈({one-point compactificationof}(CoFinite ( T)))
unfolding OPCompactification_def using union_cocardinal unfolding Cofinite_def by auto
S
S
S
with eq S
have { T}∪(( MT)∪( T-B))∈({one-point compactificationof}(CoFinite ( T))) by auto
S
S
S
S
S
moreover have AA:{ T}∪(( MT)∪( T-B))=(( MT)∪( MK)) using MK(1)by autoS
S
ultimately
S have AA2:(( MT)∪( MK))∈({one-point compactificationof}(CoFinite ( T))) by auto{
S
S
S
assume AS:( MT)∪(S SMK)={ T}from MN have T: T∈/ MT using N by auto{S
fix x assume G:x∈MTS
Sthen have x∈( MT)∪(MK) by autoSwith AS haveSx∈{ T} by auto
then have x= T by autowith T have False using G by auto}S
then have
MT=0
S by autoSwith AS have ( MK)={ T} by auto
then have False using CO2 by auto
}

981

S
S
withSAA2 have (( MT)∪( MK))∈({one-point compactification of}(CoFinite
S( T)))-{{ T}} by auto
S
S
S
with MM haveM∈({one-point compactification of}(CoFinite ( T)))-{{ T}}by auto}ultimately
S
S
S
have
M∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto}SS( T)))-{{ T}})∪T).
S then have ∀ M∈Pow((({one-point compactification
S of}(CoFinite
S
M∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto moreover{SS
fix U V assume U∈(({one-pointof}(CoFinite ( T)))-{{ T}})∪TV∈(({oneS compactification
S
compactification of}(CoFinite ( T)))-{{ T}})∪T moreover{
assume U∈TV∈T
then have U∩V∈T using topSpaceAssum unfolding IsATopology_def by
auto
SS
then have U∩V∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto}moreover{S
S
assume UV:U∈(({one-pointScompactificationof}(CoFinite ( T)))-{{ T}})V∈(({one-point
S
compactification of}(CoFinite ( T)))-{{ T}})S
then have O:U∩V∈({one-point compactification of}(CoFinite ( T)))
using topology0.op_comp_is_top[OF topology0_CoCardinal[OF InfCard_nat]]
unfolding Cofinite_def
IsATopology_def
by auto
S
S
then
have
T∩(U∩V)∈({one-pointcompactification of}(CoFinite ( T))){restrictedSto} T
unfoldingSRestrictedTo_def by
S autothen have
T∩(U∩V)∈CoFinite
T using topology0.open_subspace(2)[OF
topology0_CoCardinal[OF InfCard_nat]]
union_cocardinalS unfolding
Cofinite_def by auto
S S
from UV S
have U6={ T}V6={ T} ST∩U∈({one-pointcompactification
Sof}(CoFinite (S T))){restricted to}S T T∩V∈({one-point compactificationof}(CoFinite ( T))){restricted to} T
unfolding RestrictedTo_def
S
S Sby auto
S S
Sthen have R:U6={ T}V6={ T} T∩U∈CoFinite
T T∩V∈CoFiniteTusing topology0.open_subspace(2)[OF topology0_CoCardinal[OF InfCard_nat]]
union_cocardinal
S unfolding Cofinite_def by auto
S
S
from UV have U⊆ ({one-pointcompactification of}(CoFinite ( T)))V⊆ ({one-point
S
compactification of}(CoFinite( ST)))Sby auto
S
S
then have U⊆{ T}∪ TV⊆{ T}∪ T using topology0.op_compact_total[OFtopology0_CoCardinal[OF InfCard_nat]]
union_cocardinalby Sauto
S unfolding
S Cofinite_def
SSS
then have E:U=( T∩U)∪({ T}∩U)V=( T∩V)∪({ T}∩V)U∩V=( T∩U∩V)∪({ T}∩U∩V)982

by auto{S
assume Q:U∩V={
S T}then have RR: T∩(U∩V)=0 using N by auto{S
assumeT∩U=0S
with E(1) have SU={ T}∩U by auto
also have . . .⊆{ T} by
S autoultimately have U⊆{
S T} by auto
then have U=0∨U={ T} by autowith R(1) have U=0 by auto
then have U∩V=0 by auto
then have False using Q by auto}
moreover{S
assumeT∩V=0S
with E(2) have SV={ T}∩V by auto
also have . . .⊆{ T} by
S autoultimately have V⊆{
S T} by auto
then have V=0∨V={ T} by autowith R(2) have V=0 by auto
then have U∩V=0 by auto
then have False using Q by auto}
moreover{S
S
assumeT∩U6=0 T∩V6
S =0
S
with R(3,4) have ( T∩U)∩( T∩V)6=0 using Cofinite_nat_HConn[OFassms(2)]unfoldingSIsHConnected_def by auto
then have
T∩(U∩V)6=0 by auto
then have False using RR by auto}
ultimately have False by auto}
S
S
with O have U∩V∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto}moreover{S
S
assume UV:U∈TV∈({one-point compactificationof}(CoFinite
SS
S ( T)))-{{ T}}from UV(2) obtain
T)∨(V={ T}∪( T-B)∧B{isS B where V∈(CoFinite
closed in}(CoFinite ( T))) unfolding OPCompactification_def
using union_cocardinal unfolding
S
SCofinite_def by autowith
assms(1)haveV∈T∨(V={T}∪(
T-B)∧B{is closed in}(CoFinite
S( T))) using T1_cocardinal_coarser
by
auto
S
S
then have V∈T∨(U∩V=U∩( T-B)∧B{is closed in}(CoFinite ( T)))
using UV(1) N by auto

983

S
S
S
then have V∈T∨(U∩V=U∩( T-B)∧( T-B)∈(CoFinite ( T))) unfolding IsClosed_def using union_cocardinalS
S unfolding Cofinite_def by auto
then have V∈T∨(U∩V=U∩( T-B)∧( T-B)∈T) using assms(1) T1_cocardinal_coarser
by autowith UV(1) have U∩V∈T using topSpaceAssum unfolding IsATopology_def
by autoS
S
then have U∩V∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto}moreover{S
S
assume UV:U∈({one-point compactification( T)))-{{ T}}V∈T
S of}(CoFinite
S
S
from UV(1) obtain
T)∨(U={ T}∪( T-B)∧B{isS B where U∈(CoFinite
closed in}(CoFinite ( T))) unfolding OPCompactification_def
using union_cocardinal unfolding
S
SCofinite_def by autowith
assms(1)haveU∈T∨(U={T}∪(
T-B)∧B{is closed in}(CoFinite
S( T))) using T1_cocardinal_coarser
by
auto
S
S
then have U∈T∨(U∩V=( T-B)∩V∧B{is closed in}(CoFinite ( T)))
using UV(2) N by auto
S
S
S
then have U∈T∨(U∩V=( T-B)∩V∧( T-B)∈(CoFinite ( T))) unfolding IsClosed_def using union_cocardinalS
S unfolding Cofinite_def by auto
then have U∈T∨(U∩V=( T-B)∩V∧( T-B)∈T) using assms(1) T1_cocardinal_coarser
by autowith UV(2) have U∩V∈T using topSpaceAssum unfolding IsATopology_def
by autoS
S
then have U∩V∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto}ultimately
S
S
have U∩V∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪Tby auto}ultimately show thesis unfolding IsATopology_def by autoqed

The previous construction preserves anti-hyperconnectedness.
theorem (in topology0) COF_comp_antiHConn:
S
assumes T{is anti-}IsHConnected ¬( T≺nat)
S
S
shows ((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T){is anti-}IsHConnected
proof SS
have N: T∈(/
T) using mem_not_refl by autofrom assms(1)by auto S
S have T1:T{is T1 } using anti_HConn_imp_T1 S
Shave tot1: ({one-point compactification of}(CoFinite ( T)))={ T}∪ T
using
S topology0.op_compact_total[OF topology0_CoCardinal[OF InfCard_nat],ofT]S
union_cocardinal[ofnat T] unfolding Cofinite_def S
by auto S
SSSthen have ( ({one-point compactification of}(CoFinite ( T))))∪ T={ T}∪ T
by auto moreover

984

S
S
S
have
(({one-point compactificationof}(CoFinite ( T)))∪T)=( ({one-point
S
S
compactification of}(CoFinite ( T))))∪ T
by autoS
S
S
S
ultimately have tot2: (({one-point compactification of}(CoFinite ( T)))∪T)={ T}∪ T
by auto S
SS
have { T}∪ T∈({one-point compactification of}(CoFinite ( T))) using union_open[OF topology0.op_comp_is_top[OF topology0_CoCardinal[OFS
InfCard_nat]],of {one-point compactification of}(CoFinite ( T))]
tot1 unfolding Cofinite_def by auto moreover{SassumeT=0with assms(2) have ¬(0≺nat) by auto
then have False unfolding lesspoll_def using empty_lepollI eqpoll_0_is_0
eqpoll_sym by auto}S
then have
T6=0 bySautoS
with N have Not:¬( T⊆{ T}) by auto{
S
S
S
assumeT}∪ S
T={ T} moreoverS { Shave S T⊆{S T}∪ T by auto ultimately
have
T⊆{ T} by autowith Not have False by auto}
S
S
S
then have
S {S T}∪ T6={ T} by auto ultimately
S
S
have { T}∪ T∈({one-point compactification of}(CoFinite ( T)))-{{ T}}by autoS
S
S
S
then have { T}∪ T∈({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T
by autoS
S S
SSthen have { T}∪ T⊆ (({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)by auto moreoverS
S
have ({one-point compactificationof}(CoFinite ( T)))-{{ T}}∪T⊆({one-point
S
compactification
S of}(CoFinite ( T)))∪T by auto
S
S
S
then have(({one-point compactificationof}(CoFinite ( T)))-{{ T}}∪T)⊆ (({one-point
S
compactification of}(CoFinite( T)))∪T) by auto
S
S
S
S
S
with tot2 have(({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)⊆{ T}∪ T
by autoS
S
S
S
ultimately have TOT: ((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T)={ Tby auto{S
AS:A⊆ T (((({one-point compactification of}(CoFinite
S fix A assume
S( T)))-{{ T}})∪T){restricted to}A) {is hyperconnected}
have e0:((({one-point compactification of}(CoFinite
S from AS(1,2)
S(S T)))-{{S T}})∪T){restricted to}A=(((({one-pointcompactification of}(CoFinite
S( T)))-{{ T}})∪T){restricted to} T){restrictedto}AS
using subspace_of_subspace[ofA T((({one-point compactification
SS
of}(CoFinite ( T)))-{{ T}})∪T)] TOT by auto
S
S
have e1:(((({one-point compactification of}(CoFiniteT}})∪T){restrictedS
S ( T)))-{{S
to}(T))=((({one-pointcompactificationof}(CoFinite(T)))-{{T}}){restrictedSSto} T)∪(T{restricted to} T)985

unfolding RestrictedTo_def by auto{S
fix A assume A∈T{restricted to}
TSthen obtain B where B∈TA=B∩ T unfolding RestrictedTo_def by auto
then have A=B by autowith hB∈Ti have A∈T by auto}S
then have T{restricted to} T⊆T by auto moreover{
fix A assume
S A∈Tthen haveT∩A=A by autoSwith hA∈Ti have A∈T{restricted to} T unfolding RestrictedTo_def
by auto}S
ultimately have T{restricted to} T=T by auto moreover{
SS
S fix A assume A∈(({one-point compactification of}(CoFinite ( T)))-{{ T}}){restrictedto} T
thenSobtainS
S B where B∈({one-point compactification of}(CoFinite( T)))-{{ T}} T∩B=A unfolding RestrictedTo_def by auto
S
S
then have B∈({one-point compactification of}(CoFinite ( T))) T∩B=A
by autoS
S then have A∈({one-point compactification of}(CoFinite ( T))){restrictedto} T unfolding RestrictedTo_def
S by auto
then have A∈(CoFinite ( T)) using topology0.open_subspace(2)[OF
topology0_CoCardinal[OF InfCard_nat]]
union_cocardinal unfolding Cofinite_def by autowith T1 have A∈T using T1_cocardinal_coarser by auto}
S
S
Sthen have (({one-point compactification of}(CoFinite ( T)))-{{ T}}){restrictedto} T⊆T by auto
moreover note e1 ultimately
S
S
have ((({one-pointT)) - {{ T}} ∪S compactification of}(CoFiniteT) {restricted to} ( T)) =T by auto
S
S
with e0 have ((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T){restrictedto}A=T{restricted to}A by autowith assms(1) AS have A{is in the spectrum of}IsHConnected unfolding antiProperty_def by auto}
S
Sthen haveS reg:∀ A∈Pow( T). ((((({one-point compactification of}(CoFinite( T)))-{{ T}})∪T){restricted to}A) {is hyperconnected}) −→(A{is in
the spectrumof}IsHConnected) by autoS
have
T∈T using
topSpaceAssum unfolding IsATopology_def by auto
S
S
S
then have P: T∈((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T)by auto{SS
fix B assume
T ∪{ T}) and hyp:((((({one-point compactification
S sub:B∈Pow(
Sof}(CoFinite ( T)))-{{ ST}})∪T){restricted to}B) {is hyperconnected})from P have subop: T∩B∈(((({one-point compactification of}(CoFinite

986

S
S
( T)))-{{ T}})∪T){restricted to}B) unfolding RestrictedTo_def by autoof}(CoFinite
S with hyp
S have hypSub:((((({one-point compactification
S( T)))-{{ T}})∪T){restricted to}B){restricted to}( T∩B)){is hyperconnected}using topology0.open_subspace_hyperconn
topology0.Top_1_L4 COF_comp_is_top[OF T1 assms(2)] unfolding topology0_def
by autoS(({one-point compactification of}(CoFinite
S from sub
S TOT have B ⊆T)) - {{ T}} ∪ T) by autoSS
thenhave (((({one-point compactification of}(CoFiniteS( T)))-{{S
S T}})∪T){restrictedto}( T∩B))=(((({one-pointcompactification of}(CoFinite ( T)))-{{ T}})∪T){restrictedSto}B){restricted to}( T∩B)
S
using subspace_of_subspace[ofT∩BB((({one-point compactification
SS
of}(CoFinite ( T)))-{{ T}})∪T)] by autoSwith hypSub have ((({one-point
T))SS compactification of}(CoFinite- {{ T}} ∪ T) {restricted
to}
(
T
∩
B)){ishyperconnected}
by
auto
S
with reg haveS( T∩B){is in the spectrum of}IsHConnected by auto
then have le: T∩B.1 using HConn_spectrum by auto{S
fix x assume x:x∈ ST∩B
with le have sing: T∩B={x} using lepoll_1_is_sing by auto{
fix y assume S
y:y∈B S
then have y∈ TS ∪{ T} Susing sub by autowith y have y∈ T∩B∨y=
S T by autowith sing have y=x∨y= T by auto}S
then have B⊆{x, T} by auto S
with x have disj:B={x}∨B={x, T} by auto{S
assumeT∈B
S
with disj have B:B={x, T} by autofrom sing
subopShave singOp:{x}∈(((({one-point compactification
Sof}(CoFinite ( T)))-{{ T}})∪T){restricted to}B)
by autoS
have {x}{is closed in}(CoFiniteT) using topology0.T1_iff_singleton_closed[OFtopology0_CoCardinal[OF InfCard_nat]] cocardinal_is_T1[OF InfCard_nat]
x union_cocardinal unfolding Cofinite_def by auto
moreoverhave Finite({x}) by autoS
then have spec:{x}{is in the spectrum of} (λT. ( T) {is compactin}T) using compact_spectrum
by autoS
S
have((CoFiniteT){restrictedto}{x}){is a topology} ((CoFiniteST){restricted to}{x})={x}using topology0.Top_1_L4[OF topology0_CoCardinal[OF InfCard_nat]]
unfolding RestrictedTo_def Cofinite_def
using x union_cocardinal by autoSwith spec have {x}{is compact in}((CoFiniteT){restricted to}{x})unfolding Spec_def
by auto987

Sthen have {x}{is compact in}(CoFiniteT) using compact_subspace_imp_compact
by auto moreover
note
x
S
S
ultimately have { T}∪( T-{x})∈{one-point compactification of}(CoFinite
S( T)) unfolding OPCompactification_def
using union_cocardinal unfolding Cofinite_def by auto moreover{
S
S
S
assume A:{ T}∪( T-{x})={ T}{S
fix y assume P:y∈
T-{x}
S
S
then have y∈{T}∪(
T-{x}) by autoS
then have y= T using A by autowith N P have False by auto}S
then haveT-{x}=0by autoSwith x have
T={x}
by
auto
S
then haveT≈1 using singleton_eqpoll_1 by auto moreover
have 1≺nat usingS n_lesspoll_nat by auto
ultimately haveT≺nat using eq_lesspoll_trans by auto
then have False using assms(2) by auto}S
S
ultimately
have { T}∪( T-{x})∈({one-point compactification of}(CoFinite
SS( T)))-{{ T}} by auto
S
S
then
S
S have { T}∪( T-{x})∈(((({one-point compactification of}(CoFinite( T)))-{{ T}})∪T)) bySauto S
then have
B∩({S T}∪( T-{x}))∈(((({one-point compactification
Sof}(CoFinite ( T)))-{{ T}})∪T){restricted to}B) unfolding RestrictedTo_def
by autoS
S
S
moreover have B∩({
S T}∪( T-{x}))={ T} using B by auto
ultimately
have { T}∈(((({one-point compactification of}(CoFinite
SS( T)))-{{ T}})∪T){restricted to}B) by autowith singOp hyp N x have False unfolding IsHConnected_def by
auto}with disj have B={x} by auto
then have B≈1 using singleton_eqpoll_1 by auto
then have B.1 using eqpoll_imp_lepoll by auto}S
then haveT∩B6=0−→B.1 by blast
moreover{S
assumeT∩B=0S
with sub have S
B⊆{ T} by auto
then have B.{ T} using subset_imp_lepoll by auto
then have B.1 using singleton_eqpoll_1 lepoll_eq_trans by auto}
ultimately have B.1 by auto
then have B{is in the spectrum of}IsHConnected using HConn_spectrum
by auto988

}then show thesis unfolding antiProperty_def using TOT by autoqed

The previous construction, applied to a densely ordered topology, gives theSdesired counterexample. What happends is that every neighbourhood of T
is dense; because there are no finite open sets, and hence meets every nonS
empty open set. In conclusion, T cannot be separated from other points
by disjoint open sets.
S

Every open set that contains T is dense, when considering the order topology in a densely ordered set with more than two points.
theorem neigh_infPoint_dense:
fixes T X r
defines T_def:T ≡ (OrdTopology X r)
assumes IsLinOrder(X,r) X{is dense with respect to}r
SSS ∃ x y. x6=y∧x∈X∧y∈X U∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T
T∈U
S
S
V∈(({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T V6=0
shows U∩V6=0
proof
S
S
have N: T∈(/
T) using mem_not_refl by auto
S
S
S
S
have tot1: ({one-point compactification of}(CoFinite ( T)))={ T}∪ T
using
S topology0.op_compact_total[OF topology0_CoCardinal[OF InfCard_nat],ofT]S
union_cocardinal[ofnat T] unfolding Cofinite_def S
by auto S
SSSthen have ( ({one-point compactification of}(CoFinite ( T))))∪ T={ T}∪ T
by autoSmoreoverSS
have(({one-point compactificationof}(CoFinite ( T)))∪T)=( ({one-point
S
S
compactification of}(CoFinite ( T))))∪ T
by autoS
S
S
S
ultimately have tot2: (({one-point compactification of}(CoFinite ( T)))∪T)={ T}∪ T
by auto S
SS
have { T}∪ T∈({one-point compactification of}(CoFinite ( T))) using union_open[OF topology0.op_comp_is_top[OF topology0_CoCardinal[OFS
InfCard_nat]],of {one-point compactification of}(CoFinite ( T))]
tot1 unfolding Cofinite_def by auto moreover{SassumeT=0then have X=0 unfolding T_def using union_ordtopology[OF assms(2)]assms(4) by auto
then have False using assms(4) by auto}S
then have
T6=0 bySautoS
with N have Not:¬( T⊆{ T}) by auto{
S
S
S
assumeT}∪ S
T={ T} moreoverS { Shave S T⊆{S T}∪ T by auto ultimately
have
T⊆{ T} by auto989

with Not have False by auto}
S
S
S
then have
S {S T}∪ T6={ T} by auto ultimately
S
S
have { T}∪ T∈({one-point compactification of}(CoFinite ( T)))-{{ T}}by autoS
S
S
S
then have { T}∪ T∈({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T
by autoS
S S
SSthen have { T}∪ T⊆ (({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)by auto moreoverS
S
have ({one-point compactificationof}(CoFinite ( T)))-{{ T}}∪T⊆({one-point
S
compactification
S of}(CoFinite ( T)))∪T by auto
S
S
S
then have(({one-point compactificationof}(CoFinite ( T)))-{{ T}}∪T)⊆ (({one-point
S
compactification of}(CoFinite( T)))∪T) by auto
S
S
S
S
S
with tot2 have(({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)⊆{ T}∪ T
by autoS
S
S
S
ultimately have TOT: ((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T)={ Tby autoassume A:U∩V=0
S
with assms(6) have NN: T∈V/ by S
autowith assms(7) have V∈(CoFinite
T)∪T unfolding OPCompactification_def
using union_cocardinal
unfolding Cofinite_def by auto
moreover have T{is T2 } unfolding T_def using order_top_T2[OF assms(2)]assms(4) by auto
then have T1:T{is T1 } using T2_is_T1 by auto
ultimately have VopT:V∈T using topology0.T1_cocardinal_coarser[OF topology0_ordtopology(1assms(2)]]unfolding T_def by autoS
from
A assms(7)have V⊆ ((({one-point compactification of}(CoFinite
SS( T)))-{{ T}})∪T)-U
byS
S autothen have V⊆({
T}∪T)-U using TOT by autoS
then have V⊆( T)-U using NN by autofrom N have U∈T/ using S
assms(6) by auto
then have U∈(CoFinite/
T)∪T using T1 topology0.T1_cocardinal_coarser[OFtopology0_ordtopology(1)[OF assms(2)]]unfolding T_def using union_cocardinal union_ordtopology[OF assms(2)]assms(4) by auto
SS
obtain B where U:U={ T}∪( T-B) B{is closed in}(CoFinite
S with assms(5,6)
S
T) B6= T
unfolding OPCompactification_def using union_cocardinal unfolding
Cofinite_def by Sauto SSSthen have U={ T}∪( T-B) B= T ∨ B≺nat B6= T using closed_sets_cocardinal
unfolding Cofinite_def
by autoS
S
then have U={
S T}∪(S T-B)
S B≺nat by autowith N have
T-U=
T-(T-B) by autoS
then have
T-U=B using U(2) unfolding IsClosed_def using union_cocardinal
unfolding Cofinite_def
by auto990

Siwith hB≺nat
S have Finite( T-U) using lesspoll_nat_is_Finite by autowith hV⊆( T)-Ui have Finite(V) using subset_Finite by autofrom assms(8) obtain v where v∈V by autowith VopT have ∃ R∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X} ∪ {LeftRayX(X,r, b) . b ∈ X} ∪{RightRayX(X, r, b) . b ∈ X}. R ⊆ V ∧ v ∈ R using
point_open_base_neigh[OF Ordtopology_is_a_topology(2)[OF assms(2)]]unfolding T_def by auto
then obtain R where R_def:R∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X}
∪ {LeftRayX(X, r, b) . b ∈ X} ∪{RightRayX(X, r, b) . b ∈ X} R⊆V v∈R
by blast
moreover{assume R∈{IntervalX(X, r, b, c) . hb,ci ∈ X × X}
then obtain b c where lim:b∈Xc∈XR=IntervalX(X, r, b, c) by autowith hv∈Ri have ¬ Finite(R) using dense_order_inf_intervals[OF assms(2)_ _ _ assms(3)]by autowith hR⊆Vi hFinite(V)i have False using subset_Finite by auto
} moreover{
assume R∈{LeftRayX(X, r, b) . b ∈ X}
then obtain b where lim:b∈XR=LeftRayX(X, r, b) by autowith hv∈Ri have ¬ Finite(R) using dense_order_inf_lrays[OF assms(2)_ _ assms(3)] by autowith hR⊆Vi hFinite(V)i have False using subset_Finite by auto
} moreover{
assume R∈{RightRayX(X, r, b) . b ∈ X}
then obtain b where lim:b∈XR=RightRayX(X, r, b) by autowith hv∈Ri have ¬ Finite(R) using dense_order_inf_rrays[OF assms(2)__ assms(3)] by autowith hR⊆Vi hFinite(V)i have False using subset_Finite by auto
} ultimately
show False by autoqed

A densely ordered set with more than one point gives an order topology.
Applying the previous construction to this topology we get a non locallyHausdorff space.
theorem OPComp_cofinite_dense_order_not_loc_T2:
fixes T X r
defines T_def:T ≡ (OrdTopology X r)
assumes IsLinOrder(X,r) X{is dense with respect to}r
∃ x y. x6=y∧x∈X∧y∈X
S
S
shows ¬((({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T){islocally-T2 })
proof
S
S
have N: T∈(/
T) using mem_not_refl by auto
S
S
S
S
have tot1: ({one-point compactification of}(CoFinite ( T)))={ T}∪ T

991

usingS topology0.op_compact_total[OF topology0_CoCardinal[OF InfCard_nat],ofT]S
union_cocardinal[ofnat T] unfolding Cofinite_def S
by auto S
SSSthen have ( ({one-point compactification of}(CoFinite ( T))))∪ T={ T}∪ T
by autoSmoreoverSS
have(({one-point compactificationof}(CoFinite ( T)))∪T)=( ({one-point
S
S
compactification of}(CoFinite ( T))))∪ T
by autoS
S
S
S
ultimately have tot2: (({one-point compactification of}(CoFinite ( T)))∪T)={ T}∪ T
by auto S
SS
have { T}∪ T∈({one-point compactification of}(CoFinite ( T))) using union_open[OF topology0.op_comp_is_top[OF topology0_CoCardinal[OFS
InfCard_nat]],of {one-point compactification of}(CoFinite ( T))]
tot1 unfolding Cofinite_def by auto moreover{SassumeT=0then have X=0 unfolding T_def using union_ordtopology[OF assms(2)]assms(4) by auto
then have False using assms(4) by auto}S
then have
T6=0 bySautoS
with N have Not:¬( T⊆{ T}) by auto{
S
S
S
assumeT}∪ S
T={ T} moreoverS { Shave S T⊆{S T}∪ T by auto ultimately
have
T⊆{ T} by autowith Not have False by auto}
S
S
S
then have
S {S T}∪ T6={ T} by auto ultimately
S
S
have { T}∪ T∈({one-point compactification of}(CoFinite ( T)))-{{ T}}by autoS
S
S
S
then have { T}∪ T∈({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T
by autoS
S S
SSthen have { T}∪ T⊆ (({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)by auto moreoverS
S
have ({one-point compactificationof}(CoFinite ( T)))-{{ T}}∪T⊆({one-point
S
compactification
S of}(CoFinite ( T)))∪T by auto
S
S
S
then have(({one-point compactificationof}(CoFinite ( T)))-{{ T}}∪T)⊆ (({one-point
S
compactification of}(CoFinite( T)))∪T) by auto
S
S
S
S
S
with tot2 have(({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)⊆{ T}∪ T
by autoS
S
S
S
ultimately have TOT: ((({one-point compactification of}(CoFinite ( T)))-{{ T}})∪T)={ Tby autohave T1:T{is T1 } using order_top_T2[OF assms(2,4)] T2_is_T1 unfolding T_def by auto moreoverfrom assms(4) obtain b c where B:b∈Xc∈Xb6=c by auto{
assume hb,ci∈r/with assms(2) have hc,bi∈r unfolding IsLinOrder_def IsTotal_def us-992

ing hb∈Xihc∈Xi by autowith assms(3) B obtain z where z∈X-{b,c}hc,zi∈rhz,bi∈r unfolding
IsDense_def by auto
then have IntervalX(X,r,c,b)6=0 unfolding IntervalX_def using Order_ZF_2_L1
by autothen have ¬(Finite(IntervalX(X,r,c,b))) using dense_order_inf_intervals[OFassms(2) _ hc∈Xihb∈Xi assms(3)]by auto moreover
have IntervalX(X,r,c,b)⊆X unfolding IntervalX_def by auto
ultimately have ¬(Finite(X)) using subset_Finite by auto
then have ¬(X≺nat) using lesspoll_nat_is_Finite by auto}
moreover{assume hb,ci∈rwith assms(3) B obtain z where z∈X-{b,c}hb,zi∈rhz,ci∈r unfolding
IsDense_def by auto
then have IntervalX(X,r,b,c)6=0 unfolding IntervalX_def using Order_ZF_2_L1
by autothen have ¬(Finite(IntervalX(X,r,b,c))) using dense_order_inf_intervals[OFassms(2) _ hb∈Xihc∈Xi assms(3)]by auto moreover
have IntervalX(X,r,b,c)⊆X unfolding IntervalX_def by auto
ultimately have ¬(Finite(X)) using subset_Finite by auto
then have ¬(X≺nat) using lesspoll_nat_is_Finite by auto}
ultimately have ¬(X≺nat) by auto
S
S
with T1 have top:(({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T){isa topology} using topology0.COF_comp_is_top[OF topology0_ordtopology[OFassms(2)]] unfolding T_def
using union_ordtopology[OF assms(2,4)] by auto
S
S
assume (({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T){islocally-T
moreover
S2} S
S
S
have
T∈ (({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T)
using TOT by autoS
S
S
moreover have(({one-pointScompactificationof}(CoFinite ( T)))-{{ T}}∪T)∈(({one-poi
Scompactification of}(CoFinite ( T)))-{{ T}}∪T)
using top unfolding IsATopology_def
by autoS
ultimately
have∃c∈Pow((({one-pointcompactification of}(CoFinite
SSS(T)))-{{
T}}∪T)).
T∈
Interior(c,(({one-pointcompactification of}(CoFinite
SST)) - {{ T}}) ∪ T) ∧S
S((({one-point compactification of}CoFiniteT) - {{ T}}∪ T) {restricted to} c) {is T2 } unfolding IsLocallyT2_def IsLocally_def[OFtop] by auto
S
Sthen obtain
S C where
S C:C⊆ (({one-point compactification of}(CoFinite( T)))-{{S T}}∪T)
T ∈ Interior(C, (({one-point compactification of}(CoFinite
S
T))
{{
T}})
∪
T)
and T2:((({one-point compactification of}CoFinite
SST) - {{ T}} ∪ T) {restricted to} C) {is T2 }by auto

993

S
have
T))
S sub:Interior(C, (({one-point compactification of}(CoFinite- {{ T}}) ∪ T)⊆C using topology0.Top_2_L1
top unfolding topology0_def by auto
S
S
have (((({one-point compactification of}(CoFiniteT)) - {{ T}}) ∪T){restrictedSto}C){restrictedto}(Interior(C, (({one-point compactification
Sof}(CoFinite
T))
{{
T}})
∪
T))=((({one-point compactification of}(CoFinite
SST)) - {{ T}})∪T){restrictedto}(Interior(C, (({one-point compactification
SS
of}(CoFiniteT)) - {{ T}}) ∪ T))
usingS subspace_of_subspace[OF sub C(1)] by auto moreoverS
S
have ( ((({one-point compactification of}CoFiniteT) - {{ T}} ∪T) {restricted to} SC))⊆C unfolding RestrictedTo_def by auto
S
with
C(1)
have
(
((({one-point compactification of}CoFiniteT) S{{ T}} ∪ T) {restricted to} C))=C unfolding RestrictedTo_def by auto(({one-point compactification of}(CoFinite
S with subShave pp:Interior(C,
S
T))
{{
T}})
∪
T)∈Pow(((({one-pointcompactification of}CoFinite
SST) - {{ T}} ∪ T) {restricted to} C)) by autoS
ultimately
have T2_2:(((({one-point compactification of}(CoFiniteT))S- {{ T}}) ∪ ST){restrictedto}(Interior(C,(({one-pointcompactification
Sof}(CoFiniteT)) - {{ T}}) ∪ T))){is T2 }using T2_here[OF T2 pp] by auto
S
S
have top2:(((({one-point compactification of}(CoFiniteT)) - {{ T}})∪to}(Interior(C, (({one-point compactification of}(CoFiniteS T){restrictedST)) - {{ T}}) ∪ T))){is a topology}
using topology0.Top_1_L4
S Stop unfolding topology0_def by auto
from
C(2)
pp
have
p1:
T∈ (((({one-point compactification of}(CoFinite
SST)) - {{ T}})∪T){restrictedto}(Interior(C, (({one-point compactification
SS
of}(CoFiniteT)) - {{ T}}) ∪ T)))
unfolding RestrictedTo_def by autofrom top topology0.Top_2_L2(({one-point
S have intOP:(Interior(C,S
compactificationof}(CoFinite
T))
{{
T}})
∪
T))∈(({one-pointcompactification
SS
of}(CoFiniteT)) - {{ T}}) ∪ T unfolding topology0_def by auto{SS
x6= T x∈ (((({one-point compactification of}(CoFinite
S fix x assume
ST)) - {{ T}})to}(Interior(C, (({one-point compactification
S ∪ T){restricted
Sof}(CoFiniteT)) - {{ T}}) ∪ T)))S
with p1 have ∃ U∈(((({one-point compactification of}(CoFiniteT))S- {{ T}}) ∪ ST){restrictedto}(Interior(C,(({one-pointcompactification
Sof}(CoFinite S T)) - {{S T}}) ∪ T))). ∃ V∈(((({one-point compactificationof}(CoFiniteT)) - {{ T}}) ∪to}(Interior(C, (({one-point
S T){restrictedS
compactificationof}(CoFinite
T))
{{
T}})
∪ T))).
S
x∈U∧ T∈V∧U∩V=0 using T2_2 unfolding isT2_def by auto
U V where UV:U∈(((({one-point compactification of}(CoFinite
S then obtain
ST)) - {{ T}})to}(Interior(C, (({one-point compactification
S ∪ T){restricted
Sof}(CoFiniteT)) - {{ T}}) ∪ T)))SS
V∈(((({one-point compactification of}(CoFiniteT)) - {{ T}})∪ T){restrictedto}(Interior(C, (({one-point compactification of}(CoFinite
SST)) - {{S T}}) ∪ T)))
U6=0 T∈VU∩V=0 by autofrom UV(1) obtain UC where U=(Interior(C, (({one-point compactification

994

S
S
of}(CoFinite S T)) - {{S T}}) ∪ T))∩UCUC∈(((({one-point compactificationof}(CoFiniteT)) - {{ T}}) ∪ T))
unfolding RestrictedTo_def by auto
S with top
S intOP have Uop:U∈(({one-point compactification of}(CoFiniteT)) - {{ T}}) ∪ T unfolding IsATopology_def by autofrom UV(2)S obtain VC
S where V=(Interior(C, (({one-point compactificationof}(CoFinite S T)) - {{S T}}) ∪ T))∩VCVC∈(((({one-point compactificationof}(CoFiniteT)) - {{ T}}) ∪ T))
unfolding RestrictedTo_def by auto
S with top
S intOP have V∈(({one-point compactification of}(CoFiniteT)) - {{ T}}) ∪ T unfolding IsATopology_def by autowith UV(3-5) Uop neigh_infPoint_dense[OF assms(2-4),of VU] union_ordtopology[OFassms(2,4)]
have False unfolding T_def by auto}
S
S
S
then have(((({one-point compactification of}(CoFiniteT)) - {{ T}})∪to}(Interior(C,(({one-point compactification of}(CoFiniteS T){restrictedSST)) - {{ T}}) ∪ T)))⊆{ T}
by autoSS
withp1 have(((({one-point compactification of}(CoFiniteT)) S{{ T}}) ∪ T){restrictedto}(Interior(C,(({one-pointcompactification
SS
Sof}(CoFiniteT)) - {{ T}}) ∪ T)))={ T}by auto
S
S
with
T))
S top2 have { T}∈(((({one-point compactification of}(CoFinite- {{ T}}) ∪ ST){restrictedto}(Interior(C,(({one-pointcompactification
Sof}(CoFiniteT)) - {{ T}}) ∪ T)))
unfolding IsATopology_def
S by auto
then obtainSW where S
UT:{ T}=(Interior(C, (({one-point compactificationof}(CoFinite S T)) - {{S T}}) ∪ T))∩WW∈(({one-point compactificationof}(CoFiniteT)) - {{ T}}) ∪ T
unfolding RestrictedTo_def by auto
have (Interior(C, (({one-point compactification of}(CoFinite
S from this(2)S
ST))S - {{ T}}) ∪ T))∩W∈(({one-point compactification of}(CoFiniteT))- {{ T}}) ∪ T using intOP
top unfolding IsATopology_def
by auto
S
S
with
UT(1)
have
{
T}∈(({one-pointcompactification of}(CoFiniteT))S- {{ T}}) ∪ TSby auto
then have { T}∈T by autowith N show False by autoqedThis topology, from the previous result, gives a counter-example for antihyperconnected implies locally-T2 .
theorem antiHConn_not_imp_loc_T2:
fixes T X r
defines T_def:T ≡ (OrdTopology X r)
assumes IsLinOrder(X,r) X{is dense with respect to}r
∃ x y. x6=y∧x∈X∧y∈X
S
S
shows ¬((({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T){is995locally-T2 })S
S
and (({one-point compactification of}(CoFinite ( T)))-{{ T}}∪T){isanti-}IsHConnectedusing OPComp_cofinite_dense_order_not_loc_T2[OF assms(2-4)] dense_order_infinite[OFassms(2-4)] union_ordtopology[OF assms(2,4)]
topology0.COF_comp_antiHConn[OF topology0_ordtopology[OF assms(2)] topology0.T2_imp_anti_H
topology0_ordtopology[OF assms(2)] order_top_T2[OF assms(2,4)]]]
unfolding T_def by auto

Let’s prove that T2 spaces are locally-T2 , but that there are locally-T2 spaces
which aren’t T2 . In conclusion T2 ⇒ locally -T2 ⇒ anti-hyperconnected; all
implications proper.
theorem(in topology0) T2_imp_loc_T2:
assumes T{is T2 }shows T{is locally-T2 }proof {
S
fix x assume x∈ T{
fix b assume b:b∈Tx∈bthen have (T{restricted to}b){is T2 } using T2_here assms by auto
moreoverfrom b have x∈int(b) using Top_2_L3 by auto
ultimately have ∃ c∈Pow(b). x∈int(c)∧(T{restricted to}c){is T2 }by auto}then have ∀ b∈T. x∈b −→(∃ c∈Pow(b). x∈int(c)∧(T{restricted to}c){isT2 }) by auto}
then show thesis unfolding IsLocallyT2_def IsLocally_def[OF topSpaceAssum]
by autoqed

If there is a closed singleton, then we can consider a topology that makes
this point doble.
theorem(in topology0) doble_point_top:
assumes {m}{is closedSin}Tshows (T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) {is a topology}
proof {
S
fix M assume M:M⊆T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}
let MT={V∈M. V∈T}
let Mm={V∈M.
/S
S V∈T}
S
have unm:
M=(MT)∪( Mm) by autoS
have tt: MT∈T using topSpaceAssum unfolding IsATopology_def by auto{
assume Mm=0
S
then have
Mm=0
S bySautowith unm have
M=( MT) by auto996

Swith tt haveM∈T by auto S
Sthen haveM∈T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto}
moreover{assume AS:Mm6=0
then obtain V where V:V∈MV∈T/S by autowith M have V∈{(U - {m}) ∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T} by blastSthen obtain U W where U:V=(U-{m})∪{T}∪W
U∈Tm∈UW∈T by autoS
let U={hV,Wi∈T×T. m∈V∧ (V-{m})∪{ T}∪W∈Mm}
let fU={fst(B). B∈U}
let sU={snd(B). B∈U}
have fU⊆TsU⊆T
S by autoS
then have P: fU∈T sU∈T using topSpaceAssum unfolding IsATopology_def
by auto moreover
have hU,Wi∈U S
using U V by auto
then have m∈ fU by
S autoSultimately have s:h fU, sUi∈{V∈T. m∈V}×T by auto
S
S
moreover have r:∀ S. ∀ R. S∈{V∈T. m∈V}−→ R∈T−→(S-{m})∪{ T}∪R∈{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}
by autoS
S
S
S
ultimately have ( fU-{m})∪{ T}∪ sU∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T} by auto{S
fix v assume v∈ Mmthen obtain V where v:v∈VV∈Mm by auto
then have V:V∈MV∈T/ by autoSwith M have V∈{U - {m} ∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T} by blastSthen obtain U W where U:V=(U-{m})∪{T}∪W
U∈Tm∈UW∈T by autoSwith v(1) have v∈(U-{m})∪{
T}∪W
by
auto
S
then have v∈U-{m}∨v= T∨v∈W
by autoS
then have (v∈U∧v6=m)∨v= T∨v∈W by auto
moreover from U V have
S hU,Wi∈U by
S autoSultimately have v∈(( fU)-{m})∪{ T}∪( sU) by auto
}
S
S
S
S
then have
Mm⊆(( fU)-{m})∪{ T}∪( sU) by blast moreover{
SSS
fix v assume v:v∈(( fU)-{m})∪{ T}∪( sU){S
assume v= T
Sthen have v∈(U-{m})∪{S T}∪W by autowith hhU,Wi∈Ui have v∈ Mm by auto}
moreover{S
S
assume v6= Tv∈/ S
sU
with v have v∈((fU)-{m}) by autoS
then have (v∈ fU∧v6=m) by auto
then obtain W where (v∈W∧W∈fU∧v6=m) by auto997

Sthen have v∈(W-{m})∪{ T} W∈fU by autoS
then obtain BSwhere fst(B)=W B∈U v∈(W-{m})∪{ T} by blast
then have v∈ Mm by auto}S
ultimately have v∈ Mm by auto
}
S
S
S
S
then have (( fU)-{m})∪{S
S T}∪( sU)⊆
S Mm Sby auto
ultimately S
have SMm=(( fU)-{m})∪{sU) by auto
S
ST}∪( S
then have
M=(( fU)-{m})∪{
T}∪((
sU)∪(
MT)) using unm by auto
S
S
moreover from P tt have ( sU)∪( SMT)∈T
using
topSpaceAssumS
union_open[OF
topSpaceAssum,
of
{
sU,
MT}]
by
auto
S
S
S
with s have hS fU,( sU)∪(MT)i∈{V∈T.
m∈V}×Tbyauto SSS
Sthen have (( fU)-{m})∪{ T}∪(( sU)∪( MT))∈{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T} using r
by autoS
S
ultimately S
have
M∈{(U-{m})∪{S T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto
then haveM∈T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto}
ultimately
S
S
have
M∈T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto}
S
S
S
then have ∀ M∈Pow(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}).
M∈T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T} by auto
moreover{S
fix A B assume
ass:A∈T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}B∈T
S∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}{
assume A:A∈T{
assume B∈Twith A have A∩B∈T using topSpaceAssum unfolding IsATopology_def
by auto}moreover{assume B∈T/S
with ass(2) have B∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} byautoSthen obtain U W where U:U∈Tm∈UW∈TB=(U-{m})∪{ T}∪W by auto
moreoverS
from A mem_not_refl haveT∈A
/ by auto
ultimately have A∩B=A∩((U-{m})∪W) by auto
then have
eq:A∩B=(A∩(U-{m}))∪(A∩W) by autoS
have
T-{m}∈T using Sassms unfolding IsClosed_def by autowith U(1) have O:U∩( T-{m})∈T using topSpaceAssum unfolding
IsATopology_def
by autoS
have U∩( T-{m})=U-{m} using U(1) by auto998

with O have U-{m}∈T by autowith A have (A∩(U-{m}))∈T using topSpaceAssum unfolding IsATopology_def
by automoreoverfrom A U(3) have A∩W∈T using topSpaceAssum unfolding IsATopology_def
by autoultimately have (A∩(U-{m}))∪(A∩W)∈T using
union_open[OF topSpaceAssum, of {A∩(U-{m}),A∩W}] by autowith eq have A∩B∈T by auto}
ultimately have A∩B∈T by auto}
moreover{assume A∈T/S
with ass(1) have A:A∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by
auto{
assume B:B∈T
S
from A obtain U W where U:U∈Tm∈UW∈TA=(U-{m})∪{ T}∪W by auto
moreoverS
from B mem_not_refl haveT∈B
/ by auto
ultimately have A∩B=((U-{m})∪W)∩B by auto
then have
eq:A∩B=((U-{m})∩B)∪(W∩B) by autoS
have
T-{m}∈T using Sassms unfolding IsClosed_def by autowith U(1) have O:U∩( T-{m})∈T using topSpaceAssum unfolding
IsATopology_def
by autoS
have U∩( T-{m})=U-{m} using U(1) by autowith O have U-{m}∈T by autowith B have ((U-{m})∩B)∈T using topSpaceAssum unfolding IsATopology_def
by automoreoverfrom B U(3) have W∩B∈T using topSpaceAssum unfolding IsATopology_def
by autoultimately have ((U-{m})∩B)∪(W∩B)∈T using
union_open[OF topSpaceAssum, of {((U-{m})∩B),(W∩B)}] by autowith eq have A∩B∈T by auto}
moreover{assume B∈T/S
with ass(2) have B∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} byautoSthen obtain U W where U:U∈Tm∈UW∈TB=(U-{m})∪{ T}∪W by auto
moreoverS
from A obtain UA WA where UA:UA∈Tm∈UAWA∈TA=(UA-{m})∪{ T}∪WA
by autoS
ultimately have A∩B=(((UA-{m})∪WA)∩((U-{m})∪W))∪{ T} by auto

999

S
then have eq:A∩B=((UA-{m})∩(U-{m}))∪(WA∩(U-{m}))∪((UA-{m})∩W)∪(WA∩W)∪{ T}
by autoS
have
T-{m}∈T using assms Sunfolding IsClosed_def
by autoSwith U(1) UA(1) have O:U∩( T-{m})∈TUA∩( T-{m})∈T using topSpaceAssum
unfolding IsATopology_def
by autoS
S
have U∩( T-{m})=U-{m}UA∩( T-{m})=UA-{m} using U(1) UA(1) by
autowith O have OO:U-{m}∈TUA-{m}∈T by auto
then have ((UA-{m})∩(U-{m}))=UA∩U-{m} by auto
moreoverhave UA∩U∈Tm∈UA∩U using U(1,2) UA(1,2) topSpaceAssum unfolding IsATopology_def
by automoreoverfrom OO U(3) UA(3) have TT:WA∩(U-{m})∈T(UA-{m})∩W∈TWA∩W∈T using topSpaceAssum unfolding IsATopology_def
by autofrom TT(2,3) have ((UA-{m})∩W)∪(WA∩W)∈T using union_open[OF
topSpaceAssum,of {(UA-{m})∩W,WA∩W}] by autowith TT(1) have (WA∩(U-{m}))∪(((UA-{m})∩W)∪(WA∩W))∈T using union_open[OF
topSpaceAssum,of {WA∩(U-{m}),((UA-{m})∩W)∪(WA∩W)}] by auto
ultimately
S
have A∩B=(UA∩U-{m})∪{ T}∪((WA∩(U-{m}))∪(((UA-{m})∩W)∪(WA∩W)))(WA∩(U-{m}))∪(((UA-{m})∩W)∪(WA∩W))∈T UA∩U∈{V∈T. m∈V} using
eq by autoS
then have ∃ W∈T. A∩B=(UA∩U-{m})∪{ T}∪W UA∩U∈{V∈T. m∈V} byautoSthen have A∩B∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto}
ultimately
S
have A∩B∈T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto}S
ultimately have A∩B∈T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by auto}
S
S
then have ∀ A∈T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}. ∀ B∈T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}. S
A∩B∈T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by blast
ultimately show thesis unfolding IsATopology_def by autoqed

The previous topology is defined over a set with one more point.
lemma(in topology0) union_doublepoint_top:
assumes
S {m}{is closed Sin}T
S
S
shows
(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})= T ∪{ T}
proof
{

1000

S
S
fix x assume x∈ (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T})S
then obtain R where x:x∈RR∈T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}
by blast{
assume R∈TS
with x(1) have x∈ T by auto}
moreover{assume R∈T/S
with x(2) have R∈{(U-{m})∪{ T}∪W.
S hU,Wi∈{V∈T. m∈V}×T} by auto
then obtain U W where
R=(U-{m})∪{T}∪WW∈TU∈Tm∈U by auto
S
S
with x(1) have x= T∨x∈ T by auto}S
S
ultimately have x∈ T ∪{ T} by auto
}
S
S
S
S
then show(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})⊆ T ∪{ T}
by auto{SS
fix x assume x∈ S
T ∪{ ST}
then have dis:x∈ T∨x= T by auto{S
assume x∈ TS
Sthen have x∈ (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) by auto}
moreover{S
assume x∈/ TSwith dis have x= T by auto
S
S
moreover from assms haveT-{m}∈Tm∈ T unfolding IsClosed_def
by automoreover have 0∈T S
using empty_open
topSpaceAssumS
S
S by autoS
ultimately have x∈( T-{m})∪{ T}∪0 ( T-{m})∪{ T}∪0∈{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}
using union_open[OF
topSpaceAssum]
by autoS
S
S
SS
then have x∈( T-{m})∪{ T}∪0 ( T-{m})∪{ T}∪0∈T ∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}
by autoS
S
then have x∈ (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) by blast}
SS
ultimately have x∈ (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) by
auto
}
S
S
S
S
then show
T ∪{ T}⊆ (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})
by autoqed

In this topology, the previous topological space is an open subspace.
theorem(in topology0) open_subspace_double_point:1001

assumes {m}{is closed
S in}TS
shows(T∪{(U-{m})∪{S
S T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to} T=T
andT∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})
proof S S
have N: T∈/ T using mem_not_refl by auto{
S
Sfix x assume x∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted
to} T
S
S
then obtain U where U:U∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})x= T∩U
unfolding RestrictedTo_def by blast{
assume U∈T/S
with U(1) have U∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T} by autoS
then obtain V W where VW:U=(V-{m})∪{ T}∪WV∈Tm∈VW∈T by autowith NS U(2) have x:x=(V-{m})∪W by autohave
T-{m}∈TSusing assms unfolding IsClosed_def by auto
then have V∩( T-{m})∈T using VW(2) topSpaceAssum unfolding IsATopology_def
by auto moreoverS
have V-{m}=V∩( T-{m}) using VW(2,3) by auto ultimately
have V-{m}∈T by autowith VW(4) have (V-{m})∪W∈T using union_open[OF topSpaceAssum,of {V-{m},W}]
by autowith x have x∈T by auto}
moreover{assume A:U∈T
with U(2) have x=U by autowith A have x∈T by auto}
ultimately have x∈T by auto}
S
S
then have (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to} T⊆T
by automoreover{fix x assume x:x∈T
Sthen have x∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) by auto moreoverS
from x haveT∩x=x byS auto ultimately
S
have ∃ M∈(T∪{(U-{m})∪{ T}∪W.
T∩M=x by blast
S hU,Wi∈{V∈T. m∈V}×T}).
then
have
x∈(T∪{(U-{m})∪{T}∪W.
hU,Wi∈{V∈T.
m∈V}×T}){restrictedSto} T unfolding RestrictedTo_def
by auto}S
ultimately
show (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedSto} T=T by
S autohave P: T∈T using topSpaceAssum unfolding IsATopology_def by auto1002

then show
qed

S

S
T∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) by auto

The previous topology construction applied to a T2 non-discrite space topology, gives a counter-example to: Every locally-T2 space is T2 .
If there is a singleton which is not open, but closed; then the construction
on that point is not T2 .

theorem(in topology0) loc_T2_imp_T2_counter_1:
assumes {m}∈T/ {m}{is closedin}TSshows ¬((T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) {is T2 })proof
Sassume ass:(T∪{(U-{m})∪{
T}∪W.
}
S
S hU,Wi∈{V∈T. m∈V}×T}) {is T2SSthen have tot1: (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})= T ∪{ T}
using union_doublepoint_top
assms(2)S by auto
have m6= T using mem_not_refl assms(2) unfolding IsClosed_def by auto
moreoverS
S
SSS
from ass tot1 have ∀ x y. x∈ T ∪{ T} ∧ y∈ T ∪{ T}∧x6=y −→ (∃ U∈(T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}).S∃ V∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}). x∈U∧y∈V∧U∩V=0)
unfolding isT2_def by auto
moreoverS
S
from assms(2) have m∈ T ∪{ T} unfolding IsClosed_def by auto moreover
S S
S
have
T∈ T ∪{ T} bySauto ultimately
S
have ∃ U∈(T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}). ∃ V∈(T∪{(U-{m})∪{ T}∪W.
S
hU,Wi∈{V∈T. m∈V}×T}). m∈U∧ T∈V∧U∩V=0
by autoS
then obtain U V where
UV:U∈(T∪{(U-{m})∪{ T}∪W. S
hU,Wi∈{V∈T. m∈V}×T})S
V∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})m∈U T∈VU∩V=0 using
tot1 by blastSthen haveT∈U/ by autowith UV(1) have P:U∈T by auto{
assume V∈T S
then have V⊆ TSby S
autowith UV(4) haveT∈ T using tot1 by auto
then have False using mem_not_refl by auto}Swith UV(2) have V∈{(U-{m})∪{ T}∪W.ShU,Wi∈{V∈T. m∈V}×T} by auto
then obtain U W where V:V=(U-{m})∪{ T}∪W U∈Tm∈UW∈T by autofrom V(2,3) P have int:U∩U∈Tm∈U∩U using UV(3) topSpaceAssum
unfolding IsATopology_def by auto
have (U∩U-{m})⊆U (U∩U-{m})⊆V using V(1) by auto
then have (U∩U-{m})=0 using UV(5) by autowith int(2) have U∩U={m} by autowith int(1) assms(1) show False by auto
qed

1003

This topology is locally-T2 .

theorem(in topology0)
S loc_T2_imp_T2_counter_2:
assumes {m}∈T/ m∈ TST{is T2 }shows (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}) {is locally-T2 }proof from assms(3) have T{is T1 } using T2_is_T1 by autowith assms(2) have mc:{m}{is closed in}T using T1_iff_singleton_closedby auto S S
have N: T∈/ T using mem_not_refl
by autoS
S
have res:(T∪{(U-{m})∪{T}∪W.
hU,Wi∈{V∈T.
SS
S m∈V}×T}){restricted to} T=T
and P: T∈T and Q: T∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})
using open_subspace_double_point mc
topSpaceAssum unfolding IsATopology_def by auto{S
S
fix A assume ass:A∈ T ∪{ T}{S
assume A6= T
S
with ass have A∈ T by auto
S
S
T∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.Sm∈V}×T})∧
S with Q res assms(3)S haveA∈ T ∧ (((T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to} T){isT2 }) by auto
S
S
then have ∃ Z∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}). A∈Z∧(((T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted to}Z){is T2 })by blast}
moreover{S
assumeS A:A= ST
have
T∈Tm∈ T0∈T using assms(2) empty_open[OF topSpaceAssum]
unfolding IsClosed_def
usingSP by auto
S
S
then have ( T-{m})∪{ T}∪0∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}
by autoS
S
S
then have opp:( T-{m})∪{ T}∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T}) by auto
{
S
S
S
S
fix A1 A2 assume points:A1∈( T-{m})∪{ T}A2∈( T-{m})∪{ T}A16=A2
from points(1,2) have notm:A16=mA26=m using assms(2) unfolding
IsClosed_def
using mem_not_refl by auto{
S
S
assume or:A1∈ TA2∈ T
with points(3) assms(3) obtain U V where UV:U∈TV∈TA1∈UA2∈V
U∩V=0 unfolding isT2_def
S by blast
S
S
from UV(1,2) have U∩(( T-{m})∪{T})∈(T∪{(U-{m})∪{
T}∪W.
S
S
hU,Wi∈{V∈T. m∈V}×T}){restrictedto}((T-{m})∪{
T})
S
S
S
V∩((
S
S T-{m})∪{ T})∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T})unfolding RestrictedTo_def
moreover SS
S by auto SSSthen have U∩( T-{m})=U∩(( T-{m})∪{ T}) V∩( T-{m})=V∩(( T-{m})∪{ T})

1004

S
using UV(1,2) mem_not_refl[ofT]by autoS
S
ultimately have S
opUV:U∩( S
T-{m})∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T}){restrictedto}(( T-{m})∪{ T})S
SV∩(
T-{m})∈(T∪{(U-{m})∪{T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedSSto}(( T-{m})∪{ T}) by autoSS
moreover have U∩( T-{m})∩(V∩( T-{m}))=0 using UV(5) by auto
moreoverS
from UV(3) or(1) notm(1) have A1∈U∩( T-{m}) by auto moreoverS
from UV(4) or(2) notm(2) have A2∈V∩( T-{m}) by auto ultimately
S
have S∃ V. V∈(T∪{(U-{m})∪{T}∪W. hU,Wi∈{V∈T.
m∈V}×T}){restricted
S
S
Sto}(( ST-{m})∪{ T})∧ A1∈U∩( T-{m})∧A2∈V∧(U∩(
T-{m}))∩V=0
using exI[whereS
x=V∩(S T-{m}) andP=λW.
W∈(T∪{(U-{m})∪{T}∪W.
hU,Wi∈{V∈T.
m∈V}×T}){restricted
S
S
Sto}(( T-{m})∪{ T})∧A1∈(U∩( T-{m}))∧A2∈W∧(U∩( T-{m}))∩W=0]
using opUV(2) by autoS
thenhave ∃ U. U∈(T∪{(U-{m})∪{ S
T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedSSto}((S T-{m})∪{S T})∧(∃ V. V∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T})∧S
A1∈U∧A2∈V∧U∩V=0)
using exI[where x=U∩( T-{m}) andS
S P=λW. S
W∈(T∪{(U-{m})∪{S T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}((S T-{m})∪{S T})∧(∃ V.
V∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}(( T-{m})∪{ T})∧
A1∈W∧A2∈V∧W∩V=0)]
using opUV(1) by autoS
thenhave ∃ U∈(T∪{(U-{m})∪{ T}∪W.
SSS hU,Wi∈{V∈T. m∈V}×T}){restrictedto}((S T-{m})∪{S T}). (∃ V. V∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T})∧A1∈U∧A2∈V∧U∩V=0)S by blast
then S
have ∃ U∈(T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restrictedSSto}((S T-{m})∪{S T}). (∃ V∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T}). A1∈U∧A2∈V∧U∩V=0) by blast}
moreover{S
assume A1∈/ T S
then have ig:A1= T using points(1) by auto{S
assume A2∈/ TS
then have A2= T using points(2) by autowith points(3) ig have False by auto}S
then have
S igA2:A2∈ T by auto moreover
have m∈ T using assms(2) unfolding IsClosed_def by auto
moreover note notm(2) assms(3) ultimately obtain U V where
UV:U∈TV∈Tm∈UA2∈VU∩V=0 unfolding isT2_def by blastfrom UV(1,3) have U∈{W∈T. m∈W} by auto moreover
have 0∈T usingSempty_open topSpaceAssumby auto ultimately
S
have (U-{m})∪{ T}∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by

1005

auto
S
S
then have Uop:(U-{m})∪{ T}∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T}) by auto
S
from UV(2) have Vop:V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})
by autoS
SSSS
from UV(1-3,5) have sub:V⊆( T-{m})∪{ T} ((U-{m})∪{ T})⊆( T-{m})∪{ T}
by autoS
S
from sub(1) have V=(( T-{m})∪{S T})∩V by auto
then S
have VV:V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted
Sto}(( T-{m})∪{ T}) unfolding RestrictedTo_def
using Vop by blast moreover
S
S
S
S
from sub(2) have ((U-{m})∪{ T})=(( T-{m})∪{ T})∩((U-{m})∪{ T})by autoS
S
then have UU:((U-{m})∪{T})∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
S
Sm∈V}×T}){restricted to}(( T-{m})∪{ T}) unfolding RestrictedTo_def
using Uop by blast moreoverS
from UV(2) have ((U-{m})∪{ T})∩V=(U-{m})∩V using mem_not_refl
by autoS
then have ((U-{m})∪{ T})∩V=0 using UV(5) byS autowith UV(4) VV igSigA2 haveS ∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T}){restricted to}((S T-{m})∪{ T}).
S
A1∈(U-{m})∪{ T}∧A2∈V∧((U-{m})∪{ T})∩V=0
by auto
S
with
UU
ig
have
∃
U.
U∈(T
∪{(U-{m})∪{T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted
S
S
Sto}((S T-{m})∪{S T})∧ (∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T}).
S
A1∈U∧A2∈V∧U∩V=0)
using exI[where x=((U-{m})∪{ T}) and S
S
S
P=λU. U∈(T ∪{(U-{m})∪{T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}((T-{m})∪{T})∧SSS(∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}(( T-{m})∪{ T}).
A1∈U∧A2∈V∧U∩V=0)] by auto S
thenhave ∃ U∈(T ∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted
S
S
Sto}((S T-{m})∪{S T}). (∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T}).
A1∈U∧A2∈V∧U∩V=0) by blast}
moreover{S
assume A2∈/ T S
then have ig:A2= T using points(2) by auto{S
assume A1∈/ TS
then have A1= T using points(1) by autowith points(3) ig have False by auto}S
then have
S igA2:A1∈ T by auto moreover
have m∈ T using assms(2) unfolding IsClosed_def by auto
moreover note notm(1) assms(3) ultimately obtain U V where
UV:U∈TV∈Tm∈UA1∈VU∩V=0 unfolding isT2_def by blastfrom UV(1,3) have U∈{W∈T. m∈W} by auto moreover1006

have 0∈T usingSempty_open topSpaceAssumby auto ultimately
S
have (U-{m})∪{ T}∈{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T} by
auto
SSthen have Uop:(U-{m})∪{ T}∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T}) by auto
S
from UV(2) have Vop:V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T})
by autoS
SSSS
from UV(1-3,5) have sub:V⊆( T-{m})∪{ T} ((U-{m})∪{ T})⊆( T-{m})∪{ T}
by autoS
S
from sub(1) have V=(( T-{m})∪{S T})∩V by auto
then S
have VV:V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted
Sto}(( T-{m})∪{ T}) unfolding RestrictedTo_def
using Vop by blast moreover
S
S
S
S
from sub(2) have ((U-{m})∪{ T})=(( T-{m})∪{ T})∩((U-{m})∪{ T})by autoS
S
then have UU:((U-{m})∪{T})∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
S
Sm∈V}×T}){restricted to}(( T-{m})∪{ T}) unfolding RestrictedTo_def
using Uop by blast moreoverS
from UV(2) have V∩((U-{m})∪{ T})=V∩(U-{m}) using mem_not_refl
by autoS
then have V∩((U-{m})∪{ T})=0 using UV(5) by Sauto
with UU UV(4) igSigA2 haveS ∃ U∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
m∈V}×T}){restricted to}(( T-{m})∪{ T}).
A1∈V∧A2∈U∧V∩U=0 by autoSwith VV igA2 haveS ∃ U. U∈(TS ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
Sm∈V}×T}){restricted to}(( T-{m})∪{ S
T})∧ (∃ V∈(TS ∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted to}(( T-{m})∪{ T}).
S
A1∈U∧A2∈V∧U∩V=0) using exI[where
x=V
T}∪W.
S
S and P=λU. U∈(T ∪{(U-{m})∪{S
hU,Wi∈{V∈T. m∈V}×T}){restricted to}((S T-{m})∪{S T})∧ (∃ V∈(T ∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted to}(( T-{m})∪{ T}).
A1∈U∧A2∈V∧U∩V=0)] by auto S
thenhave ∃ U∈(T ∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted
S
S
Sto}((S T-{m})∪{S T}). (∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T}).
A1∈U∧A2∈V∧U∩V=0) by blast}
S
S ultimately
S have ∃ U∈(T ∪{(U-{m})∪{S T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}((S T-{m})∪{S T}). (∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T}).
A1∈U∧A2∈V∧U∩V=0) by blast
}
S
S
S
S
then have ∀ A1∈(
T-{m})∪{ T}. ∀ A2∈( T-{m})∪{ T}. A16=A2S−→SS(∃ U∈(T ∪{(U-{m})∪{S T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}((S T-{m})∪{S T}).
(∃ V∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}(( T-{m})∪{ T}).
SA1∈U∧A2∈V∧U∩V=0))
S by auto moreover
have((T∪{(U-{m})∪{T}∪W. hU,Wi∈{V∈T.
m∈V}×T}){restricted
S
S
S
S
S
S
to}(( T-{m})∪{ T}))=( (T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}))∩(( T-{m})∪{ T})unfoldingSRestrictedTo_def Sby auto
then have((T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted

1007

S
S
S
S
S
S
to}(( T-{m})∪{ T}))=( T ∪{ T})∩(( T-{m})∪{ T}) using
union_doublepoint_top
mc byS
S auto
then
have
((T
∪{(U-{m})∪{SSSS T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T}))=( T-{m})∪{T} by autoS
S
ultimately
have
∀
A1∈
((T
∪{(U-{m})∪{S
S
S
ST}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedto}((S T-{m})∪{S T})). ∀ A2∈ ((T ∪{(U-{m})∪{ T}∪W. S
hU,Wi∈{V∈T. m∈V}×T}){restrictedto}(( T-{m})∪{ T})). A16=SA2 −→ (∃ S
U∈(T ∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T.
Sm∈V}×T}){restricted to}(( T-{m})∪{ ST}). (∃ V∈(TS ∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted to}(( T-{m})∪{ T}).
A1∈U∧A2∈V∧U∩V=0)) by
S auto
then
have
((T
∪{(U-{m})∪{T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restrictedSSto}(( T-{m})∪{ T})){is T2 } unfolding isT2_def
by forceS
with opp A haveS ∃ Z∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}).
A∈Z∧(((T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}){restricted to}Z){isT2 })by blast}
ultimately
S
S
have ∃ Z∈(T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}). A∈Z∧(((T∪{(U-{m})∪{ T}∪W.
hU,Wi∈{V∈T. m∈V}×T}){restricted to}Z){is T2 })by blast}
S
Sthen have S∀ A∈ (T∪{(U-{m})∪{ T}∪W. hU,Wi∈{V∈T. m∈V}×T}). ∃ Z∈T ∪{U - {m} ∪ { T} ∪ W . hU,Wi ∈ {VS ∈ T . m ∈ V} × T}.
A ∈ Z ∧ ((T ∪ {U - {m} ∪ { T} ∪ W . hU,Wi ∈ {V ∈ T . m ∈ V} ×T}) {restricted to} Z) {is T2 }using union_doublepoint_top mc by autoSwith topology0.loc_T2 show (T ∪ {U - {m} ∪ { T} ∪ W . hU,Wi ∈ {V ∈T . m ∈ V} × T}){is locally-T2 }unfolding topology0_def using doble_point_top mc by autoqed

There can be considered many more local properties, which; as happens withlocally-T2 ; can distinguish between spaces other properties cannot.
end

69

Topological groups 1

theory TopologicalGroup_ZF_1 imports TopologicalGroup_ZF Topology_ZF_properties_2
beginThis theory deals with some topological properties of topological groups.

69.1

Separation properties of topological groups

The topological groups have very specific properties. For instance, G is T0
iff it is T3 .
1008

theorem(in topgroup) cl_point:
assumes x∈GTshows cl({x}) = ( H∈N 0 . x+H)
proof {T
have c:cl({x}) = ( H∈N 0 . {x}+H) using cl_topgroup assms by auto{
fix H
assume H∈N 0
then have {x}+H=x+ H using interval_add(3) assms
by autowith hH∈N 0 i have {x}+H∈{x+H. H∈N 0 } by auto}
then have {{x}+H. H∈N 0 }⊆{x+H. H∈N 0 } by auto
moreover{fix H
assume H∈N 0
then have {x}+H=x+ H using interval_add(3) assms
by autowith hH∈N 0 i have x+ H∈{{x}+H. H∈N 0 } by auto}
then have {x+H. H∈N 0 }⊆{{x}+H. H∈N 0 } by auto
ultimately have{{x}+H. H∈N 0 }={x+H.
H∈N 0 } by autoTT
then have ( H∈N 0 . {x}+H)=(
H∈N. x+H) by auto
0Twith c show cl({x})=( H∈N 0 . x+H) by auto}qed

We prove the equivalence between T0 and T1 first.
theorem (in topgroup) neu_closed_imp_T1:
assumes {0}{is closed in}Tshows T{is T1 }proof {
fix x z assume xG:x∈G and
T zG:z∈G and dis:x6=z
then have clx:cl({x})=( H∈N 0 . x+H) using cl_point by auto{
fix yassume y∈cl({x}) T
with clx have y∈( H∈N 0 . x+H) by auto
then have t:∀ H∈N 0 . y∈x+H by autofrom hy∈cl({x})i xG have yG:y∈G using Top_3_L11(1) G_def by auto{
fix H
assume HNeig:H∈N 0
with t have y∈x+H by auto
then obtain n where y=x+n and n∈H unfolding ltrans_def grop_def
LeftTranslation_def by auto1009

with HNeig have nG:n∈G unfolding zerohoods_def by autofrom hy=x+ni and hn∈Hi have (-x)+y∈H using group0.group0_2_L18(2)group0_valid_in_tgroup xG nG yG unfolding grinv_def grop_def
by auto}Tthen have el:(-x)+y∈(
N 0 ) using zneigh_not_empty by autoT
have cl({0})=( H∈N 0 . 0+H) using cl_point zero_in_tgroup by auto
moreover{fix H assume H∈N 0
then have H⊆G unfolding zerohoods_def by auto
then have 0+H=H using image_id_same group0.trans_neutral(2)group0_valid_in_tgroup unfolding gzero_def ltrans_def
by autowith hH∈N 0 i have 0+H∈N 0 H∈{0+H. H∈N 0 } by auto}
then have {0+H. H∈N 0 }=NT
0 by blast
ultimately have cl({0})=( N 0 ) by autowith el have (-x)+y∈cl({0}) by auto
then have (-x)+y∈{0} using assms Top_3_L8 G_def zero_in_tgroupby autothen have (-x)+y=0 by auto
then have y=-(-x) using group0.group0_2_L9(2) group0_valid_in_tgroupneg_in_tgroup xG yG unfolding grop_def grinv_def by auto
then have y=x using group0.group_inv_of_inv group0_valid_in_tgroupxG unfolding grinv_def by auto}
then have cl({x})⊆{x} by auto
then have cl({x})={x} using xG cl_contains_set G_def by blast
then have {x}{isclosed in}T using Top_3_L8 xG G_def by autoS
then have ( T)-{x}∈T using SIsClosed_def by S
auto moreoverfrom dis zG G_def have z∈(( T)-{x}) ∧ x∈((/T)-{x}) by auto
ultimately have ∃ V∈T. z∈V∧x∈V/ by(safe,auto)}
then show T{is T1 } using isT1_def by autoqed
theorem (in topgroup) T0_imp_neu_closed:
assumes T{is T0 }shows {0}{is closed in}T
proof {
fix x assume x∈cl({0})
and x6=0Thave cl({0})=( H∈N 0 . 0+H) using cl_point zero_in_tgroup by auto
moreover{fix H assume H∈N 0
then have H⊆G unfolding zerohoods_def by auto
then have 0+H=H using image_id_same group0.trans_neutral(2) group0_valid_in_tgroup1010

unfolding gzero_def ltrans_def
by autowith hH∈N 0 i have 0+H∈N 0 H∈{0+H. H∈N 0 } by auto}
then have {0+H. H∈N 0 }=NT
0 by blast
ultimately have cl({0})=( N 0 ) by autofrom hx6=0i and hx∈cl({0})i obtain U where U∈T and (x∈U∧0∈U)∨(0/∈U∧x∈U)/
using assms Top_3_L11(1)zero_in_tgroup unfolding isT0_def G_def by blast moreover{
assume 0∈Uwith hU∈Ti have U∈N 0 using zerohoods_def
G_def Top_2_L3 by autoTwith hx∈cl({0})i and hcl({0})=( N 0 )i have x∈U by auto}
ultimately have 0∈U/ and x∈U by autowith hU∈Ti hx∈cl({0})i have False using cl_inter_neigh zero_in_tgroup
unfolding G_def by blast}
then have cl({0})⊆{0} by auto
then have cl({0})={0} using zero_in_tgroup cl_contains_set G_def by
blastthen show thesis using Top_3_L8 zero_in_tgroup unfolding G_def by auto
qed

69.2

Existence of nice neighbourhoods.

theorem(in topgroup) exists_sym_zerohood:assumes U∈N 0
shows ∃ V∈N 0 . (V⊆U∧ (-V)=V)
proof
let V=U∩(-U)
have U⊆G using assms unfolding zerohoods_def by auto
then have V⊆G by auto
have invg: GroupInv(G, f) ∈ G → G using group0_2_T2 Ggroup by auto
have invb:GroupInv(G, f) ∈bij(G,G) using group0.group_inv_bij(2) group0_valid_in_tgroupby autohave (-V)=GroupInv(G,f)-V unfolding setninv_def using group0.inv_image_vimagegroup0_valid_in_tgroup by auto
also have . . .=(GroupInv(G,f)-U)∩(GroupInv(G,f)-(-U)) using invim_inter_inter_invim
invg by auto
also have . . .=(-U)∩(GroupInv(G,f)-(GroupInv(G,f)U)) unfolding setninv_def
using group0.inv_image_vimage group0_valid_in_tgroup by auto
also with hU⊆Gi have . . .=(-U)∩U using inj_vimage_image invb unfolding
bij_defby autofinally have (-V)=V by auto
then show V ⊆ U ∧ (- V) = V by autofrom assms have (-U)∈N 0 using neg_neigh_neigh by autowith assms have 0∈int(U)∩int(-U) unfolding zerohoods_def by auto1011

moreoverhave int(U)∩int(-U)∈T using Top_2_L3 IsATopology_def topSpaceAssum
Top_2_L4 by auto
then have int:int(int(U)∩int(-U))=int(U)∩int(-U) using Top_2_L3 by
auto
have int(U)∩int(-U)⊆V using Top_2_L1 by autofrom interior_mono[OF this] int have int(U)∩int(-U)⊆int(V) by auto
ultimately have 0∈int(V) by autowith hV⊆Gi show V∈N 0 using zerohoods_def by autoqed
theorem(in topgroup) exists_procls_zerohood:assumes U∈N 0
shows ∃ V∈N 0 . (V⊆U∧ (V+V)⊆U ∧ (-V)=V)
proof have int(U)∈T using Top_2_L2 by auto
then have f-(int(U))∈τ using fcon IsContinuous_def by auto
moreoverhave fne:f h0, 0i = 0 using group0.group0_2_L2 group0_valid_in_tgroupby autohave 0∈int(U) using assms unfolding zerohoods_def by auto
then have f - {0}⊆f-(int(U)) using func1_1_L8 vimage_def by auto
then have GroupInv(G,f)⊆f-(int(U)) using group0.group0_2_T3 group0_valid_in_tgroupby autothen have h0,0i∈f-(int(U)) using fne zero_in_tgroup unfolding GroupInv_def
by autoultimately obtain W V where wop:W∈T and vop:V∈T and cartsub:W×V⊆f-(int(U))
and zerhood:h0,0i∈W×V using prod_top_point_neighb topSpaceAssum
unfolding prodtop_def by force
then have 0∈W and 0∈V by auto
then have 0∈W∩V by auto
have sub:W∩V⊆G using wop vop G_def by auto
have assoc:f∈G×G→G using group0.group_oper_assocA group0_valid_in_tgroupby auto{fix t s assume t∈W∩V and s∈W∩Vthen have t∈W and s∈V by auto
then have ht,si∈W×V by auto
then have ht,si∈f-(int(U)) using cartsub by auto
then have fht,si∈int(U) using func1_1_L15 assoc by auto}
then have {fht,si. ht,si∈(W∩V)×(W∩V)}⊆int(U) by auto
then have (W∩V)+(W∩V)⊆int(U) unfolding setadd_def using lift_subsets_explained(4)assoc subby autothen have (W∩V)+(W∩V)⊆U using Top_2_L1 by autofrom topSpaceAssum have W∩V∈T using vop wop unfolding IsATopology_def
by autothen have int(W∩V)=W∩V using Top_2_L3 by auto1012

with sub h0∈W∩Vi have W∩V∈N 0 unfolding zerohoods_def by auto
then obtain Q where Q∈N 0 and Q⊆W∩V and (-Q)=Q using exists_sym_zerohoodby blast
then have Q×Q⊆(W∩V)×(W∩V) by auto
moreover from hQ⊆W∩Vi have W∩V⊆G and Q⊆G using vop wop unfolding
G_def by auto
ultimately have Q+Q⊆(W∩V)+(W∩V) using interval_add(2) func1_1_L8 by
autowith h(W∩V)+(W∩V)⊆Ui have Q+Q⊆U by autofrom hQ∈N 0 i have 0∈Q unfolding zerohoods_def using Top_2_L1 by autowith hQ+Q⊆Ui hQ⊆Gi have 0+Q⊆U using interval_add(3) by autowith hQ⊆Gi have Q⊆U unfolding ltrans_def using group0.trans_neutral(2)group0_valid_in_tgroup
unfolding gzero_def using image_id_same by autowith hQ∈N 0 i hQ+Q⊆Ui h(-Q)=Qi show thesis by autoqed

lemma (in topgroup) exist_basehoods_closed:
assumes U∈N 0
shows ∃ V∈N 0 . cl(V)⊆U
proof from assms obtain V where V∈N 0 V⊆U (V+V)⊆U (-V)=V using exists_procls_zerohoodby blast
have inv_fun:GroupInv(G,f)∈G→G using group0_2_T2 Ggroup by auto
have f_fun:f∈G×G→G using group0.group_oper_assocA group0_valid_in_tgroupby auto{fix x assume x∈cl(V)SS
with hV∈N 0 i have x∈ T V⊆ T using Top_3_L11(1) unfolding zerohoods_def
G_def by blast+iwith hV∈N
S0 have x∈int(x+V) using elem_in_int_trans G_def by autohwith V⊆ Tihx∈cl(V)i have int(x+V)∩V6=0 using cl_inter_neigh Top_2_L2
by blast
then have (x+V)∩V6=0 using Top_2_L1 by blast
then obtainq∈(x+V) and q∈V by blast
S q whereSwith hV⊆ Tihx∈ Ti obtain v where q=x+v v∈V unfolding ltrans_def
grop_def using group0.ltrans_imagegroup0_valid_in_tgroup
unfolding
G_def
SS
S by auto
ihq∈Vi have v∈
from hV⊆ Ti hv∈V
Tq∈
T by autoSwith hq=x+vihx∈ Ti have q-v=x using group0.group0_2_L18(1) group0_valid_in_tgroup
unfolding G_def
unfolding grsub_def grinv_def grop_def by auto moreoverifrom hv∈V
S have (-v)∈(-V) unfolding setninv_def grinv_def using func_imagedef
inv_fun hV⊆ Ti G_def by auto
then have (-v)∈V using h(-V)=Vi by autowith hq∈Vi have hq,-vi∈V×V by autoS
then have fhq,-vi∈V+V using lift_subset_suff f_fun hV⊆ Ti unfolding setadd_def by auto1013

with hV+V⊆Ui have q-v∈U unfolding grsub_def grop_def by autowith hq-v=xi have x∈U by auto}
then have cl(V)⊆U by autowith hV∈N 0 i show thesis by auto
qed

69.3

Rest of separation axioms

theorem(in topgroup) T1_imp_T2:
assumes T{is T1 }shows T{is T2 }proof {SS
fix x y assume ass:x∈ T y∈ T x6=y{
assume (-y)+x=0
with ass(1,2) have y=x using group0.group0_2_L11[where a=y andb=x] group0_valid_in_tgroup by autowith ass(3) have False by auto}
then have (-y)+x6=0 by auto
then haveauto
S 06=(-y)+x by S
from hy∈S Ti have (-y)∈ S
T using neg_in_tgroup G_def by autowith hx∈ Ti have (-y)+x∈ T using group0.group_op_closed[where a=-yand b=x] group0_valid_in_tgroup unfolding
G_def by autowith assms h06=(-y)+xi obtain U where U∈T and (-y)+x∈U/ and 0∈U unfolding isT1_def using zero_in_tgroupby autothen have U∈N 0 unfolding zerohoods_def G_def using Top_2_L3 by auto
then obtain Q where Q∈N 0 Q⊆U (Q+Q)⊆U (-Q)=Q using exists_procls_zerohoodby blastwith h(-y)+x∈U/ i have (-y)+x∈Q/ by autofrom hQ∈N 0 i have Q⊆G unfolding zerohoods_def by auto{
assume x∈y+Q S
with hQ⊆Gi hy∈ Ti obtain u where u∈Q and x=y+u unfolding ltrans_def
grop_def using group0.ltrans_image group0_valid_in_tgroup
unfolding G_def by
S autowith hQ⊆Gi haveSu∈ T unfolding
G_def by autoSwith hx=y+ui hy∈ Ti hx∈ Ti hQ⊆Gi have (-y)+x=u using group0.group0_2_L18(2)group0_valid_in_tgroup unfolding G_def
unfolding grsub_def grinv_def grop_def by autowith hu∈Qi have (-y)+x∈Q by auto
then have False using h(-y)+x∈Q/ i by auto}
then have x∈y+Q/
by auto moreover{1014

assume y∈x+Q S
with hQ⊆Gi hx∈ Ti obtain u where u∈Q and y=x+u unfolding ltrans_def
grop_def using group0.ltrans_image group0_valid_in_tgroup
unfolding G_def by
S autowith hQ⊆Gi haveSu∈ T unfolding
G_def by autoSwith hy=x+ui hy∈ Ti hx∈ Ti hQ⊆Gi have (-x)+y=u using group0.group0_2_L18(2)group0_valid_in_tgroup unfolding G_def
unfolding grsub_def grinv_def grop_def by autowith hu∈Qi have (-y)+x=-u using group0.group_inv_of_two[OF group0_valid_in_tgroup
group0.inverse_in_group[OFS
S group0_valid_in_tgroup,of x],of y]using hx∈ Ti hy∈ Ti using group0.group_inv_of_inv[OF group0_valid_in_tgroup]
unfolding G_def grinv_def grop_def by auto
moreover from hu∈Qi have (-u)∈(-Q) unfolding setninv_def grinv_def
using func_imagedef[OF group0_2_T2[OF Ggroup] hQ⊆Gi] by auto
ultimately have (-y)+x∈Q using h(-y)+x∈Q/ i h(-Q)=Qi unfolding setninv_def
grinv_def by auto
then have False using h(-y)+x∈Q/ i by auto}
then have y∈x+Q/by auto moreover{
fix t
assume t∈(x+Q)∩(y+Q)
then have t∈(x+Q)
t∈(y+Q)by autoS
S
with hQ⊆Gi hx∈ Ti hy∈ Ti obtain u v where u∈Q v∈Q and t=x+u t=y+v
unfolding ltrans_def grop_def using group0.ltrans_image[OF group0_valid_in_tgroup]
unfolding G_def by auto
then have x+u=y+v by auto
S
S
moreover from hu∈Qi hv∈Qi hQ⊆Gi have u∈ T v∈ T unfolding G_def
by autoS
S
moreover note hx∈ Ti hy∈ Tiultimately have (-y)+(x+u)=v using group0.group0_2_L18(2)[OF group0_valid_in_tgroup,of y v x+u] group0.group_op_closed[OF group0_valid_in_tgroup, of x u]
unfolding G_def
unfolding grsub_def grinv_def grop_def by auto
then have ((-y)+x)+u=v using group0.group_oper_assoc[OFgroup0_valid_in_tgroup]
S
S
S
unfolding grop_def using hx∈ Ti hy∈ Ti hu∈ Ti using group0.inverse_in_group[OFgroup0_valid_in_tgroup] unfolding G_def
by autothen have ((-y)+x)=v-u using group0.group0_2_L18(1)[OF group0_valid_in_tgroup,of(-y)+x u v]
SSSusing h(-y)+x∈ Ti hu∈ Ti hv∈ Ti unfolding G_def grsub_def grinv_def
grop_def by force
moreoverfrom hu∈Qi have (-u)∈(-Q) unfolding setninv_def grinv_def using
func_imagedef[OF group0_2_T2[OF Ggroup] hQ⊆Gi] by auto
then have (-u)∈Q using h(-Q)=Qi by autowith hv∈Qi have hv,-ui∈Q×Q by auto
then have fhv,-ui∈Q+Q using lift_subset_suff[OF group0.group_oper_assocA[OFgroup0_valid_in_tgroup] hQ⊆Gi hQ⊆Gi]

1015

unfolding setadd_def by autowith hQ+Q⊆Ui have v-u∈U unfolding grsub_def grop_def by auto
ultimately have (-y)+x∈U by autowith h(-y)+x∈U/ i have False by auto}
then have (x+Q)∩(y+Q)=0 by autohimoreoverhave
S
S x∈int(x+Q)y∈int(y+Q) using elem_in_int_trans Q∈N 0hx∈
Ti hy∈ Ti unfolding G_def by auto moreover
have int(x+Q)⊆(x+Q)int(y+Q)⊆(y+Q) using Top_2_L1 by auto
moreover have int(x+Q)∈T int(y+Q)∈T using Top_2_L2 by auto
ultimately have int(x+Q)∈T ∧ int(y+Q)∈T ∧ x ∈ int(x+Q) ∧ y ∈ int(y+Q)∧ int(x+Q) ∩ int(y+Q) = 0
by blast
then have ∃ U∈T. ∃ V∈T. x∈U∧y∈V∧U∩V=0 by auto}
then show thesis using isT2_def by autoqed

Here follow some auxiliary lemmas.
lemma (in topgroup) trans_closure:assumes x∈G A⊆Gshows cl(x+A)=x+cl(A)proof - SS
have
T-( T-(x+A))=(x+A) unfolding ltrans_def using group0.group0_5_L1(2)[OFgroup0_valid_in_tgroup assms(1)]unfolding image_def
domain_def converse_def Pi_def
S range_def
S
S by auto
then have cl(x+A)= T-int( T-(x+A)) using Top_3_L11(2)[ofT-(x+A)]by auto moreover
have x+G=G using surj_image_eq group0.trans_bij(2)[OF group0_valid_in_tgroup
assms(1)] bij_def
by auto S
S
then haveT-(x+A)=x+( T-A) using inj_image_dif[of LeftTranslation(G,f, x)GG, OF _ assms(2)]unfolding ltrans_def G_def using group0.trans_bij(2)[OF group0_valid_in_tgroup
assms(1)] bij_defSby autoS
then have int(S T-(x+A))=int(x+(S T-A)) by auto
S then have int( T-(x+A))=x+int( T-A) using trans_interior[OF assms(1),of
T-A] unfoldingS
S G_def bySforce
SS
have
T-int( T-A)=cl( T-( T-A)) using Top_3_L11(2)[ofT-A] by
force SS
have ST-( T-A)=A
usingSassms(2)G_def bySauto S
SS
i havewith hS T-int(
T-A)=cl(T-(
T-A))
T-int( T-A)=cl(A) by auto
S
S
S
have ST-( T-int(
T-A))=int(
T-A)
using
Top_2_L2
by autoS
S
S
i have int(
with h T-int(
T-A)=cl(A)
T-A)=
T-cl(A)by autoSSSSwith hint( T-(x+A))=x+int( T-A)i have int( T-(x+A))=x+( T-cl(A))
by autoS
S
with hx+G=Gi have int( T-(x+A))= T-(x+cl(A)) using inj_image_dif[ofLeftTranslation(G, f, x)GGcl(A)]unfolding ltrans_def using group0.trans_bij(2)[OF group0_valid_in_tgroup
assms(1)] Top_3_L11(1) assms(2) unfolding bij_def G_def

1016

by auto S
SSSthen have S T-int(S T-(x+A))= T-( T-(x+cl(A))) by auto
then haveT-int( T-(x+A))=x+cl(A) unfolding ltrans_def using group0.group0_5_L1(2)[OFgroup0_valid_in_tgroup assms(1)]unfolding image_def
range_def domain_def converse_def Pi_def by auto
S
S
with hcl(x+A)= T-int( T-(x+A))i show thesis by autoqed
lemma (in topgroup) trans_interior2: assumes A1: g∈G and A2: A⊆Gshows int(A)+g = int(A+g)
proof S
from assms have A ⊆T and IsAhomeomorphism(T,T,RightTranslation(G,f,g))
using tr_homeo by auto
then show thesis using int_top_invariant by simp
qedlemma (in topgroup) trans_closure2:
assumes x∈G A⊆Gshows cl(A+x)=cl(A)+x
proof - SS
have
T-( T-(A+x))=(A+x) unfolding ltrans_def using group0.group0_5_L1(1)[OFgroup0_valid_in_tgroup assms(1)]unfolding image_def
domain_def converse_def Pi_def
S range_def
S
S by auto
then have cl(A+x)= T-int( T-(A+x)) using Top_3_L11(2)[ofT-(A+x)]by auto moreover
have G+x=G using surj_image_eq group0.trans_bij(1)[OF group0_valid_in_tgroup
assms(1)] bij_def
by autoS
S
then haveT-(A+x)=( T-A)+x using inj_image_dif[of RightTranslation(G,f, x)GG, OF _ assms(2)]unfolding rtrans_def G_def using group0.trans_bij(1)[OF group0_valid_in_tgroup
assms(1)] bij_defSby autoS
then have int(S T-(A+x))=int((
S T-A)+x) by auto
S then have int( T-(A+x))=int( T-A)+x using trans_interior2[OF assms(1),of
T-A] unfoldingS
S G_def bySforce
SS
have
T-int( T-A)=cl( T-( T-A)) using Top_3_L11(2)[ofT-A] by
force SS
have ST-( T-A)=A
usingSassms(2)G_def bySauto S
SS
i havewith hS T-int(
T-A)=cl(T-(
T-A))
T-int( T-A)=cl(A) by auto
S
S
S
have ST-( T-int(
T-A))=int(
T-A)
using
Top_2_L2
by autoS
S
S
i have int(
with h T-int(
T-A)=cl(A)
T-A)=
T-cl(A)
bySautoSSSwith hint( T-(A+x))=int( T-A)+xi have int( T-(A+x))=( T-cl(A))+x
by autoS
S
with hG+x=Gi have int( T-(A+x))= T-(cl(A)+x) using inj_image_dif[ofRightTranslation(G, f, x)GGcl(A)]unfolding rtrans_def using group0.trans_bij(1)[OF group0_valid_in_tgroup
assms(1)] Top_3_L11(1) assms(2) unfolding bij_def G_def
by auto S
SSSthen have S T-int(S T-(A+x))= T-( T-(cl(A)+x)) by auto
then haveT-int( T-(A+x))=cl(A)+x unfolding ltrans_def using group0.group0_5_L1(1)[OF1017

group0_valid_in_tgroup assms(1)]unfolding image_def
range_def domain_def converse_def Pi_def by auto
S
S
with hcl(A+x)= T-int( T-(A+x))i show thesis by autoqed
lemma (in topgroup) trans_subset:
assumes A⊆((-x)+B)x∈GA⊆GB⊆G
shows x+A⊆B
proof {
fix t assume t∈x+Awith hx∈Gi hA⊆Gi obtain u where u∈A t=x+u unfolding ltrans_def grop_def
using group0.ltrans_image[OF group0_valid_in_tgroup]
unfolding G_def by autowith hx∈Gi hA⊆Gi hu∈Ai have (-x)+t=u using group0.group0_2_L18(2)[OFgroup0_valid_in_tgroup, of xut]
group0.group_op_closed[OF group0_valid_in_tgroup,of x u] unfolding grop_def grinv_def by autowith hu∈Ai have (-x)+t∈A by autowith hA⊆(-x)+Bi have (-x)+t∈(-x)+B by autowith hB⊆Gi obtain v where (-x)+t=(-x)+v v∈B unfolding ltrans_def
grop_def using neg_in_tgroup[OF hx∈Gi] group0.ltrans_image[OF group0_valid_in_tgroup]
unfolding G_def by auto
have LeftTranslation(G,f,-x)∈inj(G,G) using group0.trans_bij(2)[OFgroup0_valid_in_tgroup neg_in_tgroup[OF hx∈Gi]] bij_def by auto
then have eq:∀ A∈G. ∀ B∈G. LeftTranslation(G,f,-x)A=LeftTranslation(G,f,-x)B−→ A=B unfolding inj_def by auto{
fix A B assume A∈GB∈G
assume fh-x,Ai=fh-x,Bithen have LeftTranslation(G,f,-x)A=LeftTranslation(G,f,-x)B using group0.group0_5_L2(2)[OF group0_valid_in_tgroup neg_in_tgroup[OF hx∈Gi]]
hA∈GihB∈Gi by autowith eq hA∈GihB∈Gi have A=B by auto}
then have eq1:∀ A∈G. ∀ B∈G. fh-x,Ai=fh-x,Bi −→ A=B by autofrom hA⊆Gi hu∈Ai have u∈G by autowith hv∈Bi hB⊆Gi ht=x+ui have t∈G v∈G using group0.group_op_closed[OFgroup0_valid_in_tgroup hx∈Gi,of u] unfolding grop_def
by autowith eq1 h(-x)+t=(-x)+vi have t=v unfolding grop_def by autowith hv∈Bi have t∈B by auto}
then show thesis by autoqed

Every topological group is regular, and hence T3 . The proof is in the next
section, since it uses local properties.

1018

69.4

Local properties

In a topological group, all local properties depend only on the neighbourhoods of the neutral element; when considering topological properties. The
next result of regularity, will use this idea, since translations preserve closed
sets.
lemma (in topgroup) local_iff_neutral:assumes ∀ U∈T∩N 0 . ∃ N∈N 0 . N⊆U∧ P(N,T) ∀ N∈Pow(G). ∀ x∈G. P(N,T) −→P(x+N,T)shows T{is locally}P
proof {
S
fix x U assume x∈ TU∈Tx∈Uthen have (-x)+U∈T∩N 0 using open_tr_open(1) open_trans_neigh neg_in_tgroup
unfolding G_def
by autowith assms(1)obtain N where N⊆((-x)+U)P(N,T)N∈N 0 by autoS
i moreovernote hx∈ TihN⊆((-x)+U)S
hi
from U∈T have U⊆ T by auto moreoverfrom hN∈N 0 i have N⊆G unfolding zerohoods_def by auto
ultimately have (x+N)⊆U using trans_subset unfolding G_def by auto
moreoverS
from hN⊆Gihx∈ Ti assms(2) hP(N,T)i have P((x+N),T) unfolding G_def
by auto moreover S
from hN∈N 0 ihx∈ Ti have x∈int(x+N) using elem_in_int_trans unfolding G_def by auto
ultimately have ∃ N∈Pow(U). x∈int(N)∧P(N,T) by auto}
then show thesis unfolding IsLocally_def[OF topSpaceAssum] by autoqed
lemma (in topgroup) trans_closed:
assumes A{is closed in}Tx∈G
shows (x+A){is closed in}T
proof from assms(1) have cl(A)=A using Top_3_L8 unfolding IsClosed_def by
auto
then have x+cl(A)=x+A by auto
then have cl(x+A)=x+A using trans_closure assms unfolding IsClosed_def
by automoreover have x+A⊆G unfolding ltrans_def using group0.group0_5_L1(2)[OFgroup0_valid_in_tgroup hx∈Gi]
unfolding image_def range_def domain_def converse_def Pi_def by
auto
ultimately show thesis using Top_3_L8 unfolding G_def by autoqed

As it is written in the previous section, every topological group is regular.
theorem (in topgroup) topgroup_reg:1019

shows T{is regular}
proof {
fix U assume U∈T∩N 0
then obtain V where cl(V)⊆UV∈N 0 using exist_basehoods_closed byblastthen have V⊆cl(V) using cl_contains_set unfolding zerohoods_def G_def
by autothen have int(V)⊆int(cl(V)) using interior_mono by autowith hV∈N 0 i have cl(V)∈N 0 unfolding zerohoods_def G_def using Top_3_L11(1)by autofrom hV∈N 0 i have cl(V){is closed in}T using cl_is_closed unfolding zerohoods_def G_def by autowith hcl(V)∈N 0 ihcl(V)⊆Ui have ∃ N∈N 0 . N⊆U∧N{is closed in}T by auto}
then have ∀ U∈T∩N 0 . ∃ N∈N 0 . N⊆U∧N{is closed in}T by auto moreover
have ∀ N∈Pow(G).( ∀ x∈G. (N{is closed in}T−→(x+N){is closed in}T))
using trans_closed by auto
ultimately have T{is locally-closed} using local_iff_neutral unfolding IsLocallyClosed_def by auto
then show T{is regular} using regular_locally_closed by autoqed

The promised corollary follows:corollary (in topgroup) T2_imp_T3:
assumes T{is T2 }shows T{is T3 } using T2_is_T1 topgroup_reg isT3_def assms by auto
end

70

Topological groups 2

theory TopologicalGroup_ZF_2 imports Topology_ZF_8 TopologicalGroup_ZF
Group_ZF_2
begin

This theory deals with quotient topological groups.

70.1

Quotients of topological groups

The quotient topology given by the quotient group equivalent relation, hasan open quotient map.
theorem(in topgroup) quotient_map_topgroup_open:
assumes IsAsubgroup(H,f) A∈T
defines r ≡ QuotientGroupRel(G,f,H)
S
shows {hb,r{b}i. b∈ T}A∈(T{quotient by}r)
proof -

1020

S
have eqT:equiv( T,r) and eqG:equiv(G,r) using group0.Group_ZF_2_4_L3
assms(1) unfolding r_def IsAnormalSubgroup_def
using group0_valid_in_tgroup by auto
have subA:A⊆G using assms(2) by auto
have subH:H⊆G using group0.group0_3_L2[OFS
S group0_valid_in_tgroup assms(1)].
have A1:{hb,r{b}i. b∈ T}-({hb,r{b}i. b∈ T}A)=H+A
proof
{
S
S
fix t assume t∈{hb,r{b}i. b∈S T}-({hb,r{b}i. b∈ T}A) S
then have ∃ m∈({hb,r{b}i. b∈ T}A). ht,mi∈{hb,r{b}i. b∈ T} using
vimage_iff by auto
S
S
then obtain m where m∈({hb,r{b}i. b∈ T}A)ht,mi∈{hb,r{b}i. b∈ T}
by autoS
then obtain b where b∈Ahb,mi∈{hb,r{b}i. b∈ T}t∈G and rel:r{t}=musing image_iff by auto
then have r{b}=m by auto
then have r{t}=r{b} using rel by autowith hb∈AisubA have ht,bi∈r using eq_equiv_class[OF _ eqT] by auto
then have fht,GroupInv(G,f)bi∈H unfolding r_def QuotientGroupRel_def
by autothen obtain h where h∈H and prd:fht,GroupInv(G,f)bi=h by auto
then have h∈G using subH by auto
have b∈G using hb∈AihA∈Ti by auto
then have (-b)∈G using neg_in_tgroup by autofrom prd have t=fhh, GroupInv(G, f) (- b)i using group0.group0_2_L18(1)[OFgroup0_valid_in_tgroup ht∈Gih(-b)∈Gihh∈Gi]
unfolding grinv_def by auto
then have t=fhh,bi using group0.group_inv_of_inv[OF group0_valid_in_tgrouphb∈Gi]
unfolding grinv_def by auto
then have hhh,bi,ti∈f using apply_Pair[OF topgroup_f_binop] hh∈Gihb∈Gi
by auto moreoverfrom hh∈Hihb∈Ai have hh,bi∈H×A by auto
ultimately have t∈f(H×A) using image_iff by autowith subA subH have t∈H+A using interval_add(2) by auto}
S
S
then show ({hb,r{b}i. b∈ T}-({hb,r{b}i. b∈ T}A))⊆H+A by force{
fix t assume t∈H+A
with subA subH have t∈f(H×A) using interval_add(2) by auto
then obtain ha where ha∈H×Ahha,ti∈f using image_iff by auto
then obtain h aa where ha=hh,aaih∈Haa∈A by auto
then have h∈Gaa∈G using subH subA by autofrom hhha,ti∈fi have t∈G using topgroup_f_binop unfolding Pi_def
by autofrom hha=hh,aaii hhha,ti∈fi have t=fhh,aai using apply_equality[OF_ topgroup_f_binop] by auto
then have fht,-aai=h using group0.group0_2_L18(1)[OF group0_valid_in_tgrouphh∈Gihaa∈Giht∈Gi]1021

by auto
with hh∈Hiht∈Gihaa∈Gi have ht,aai∈r unfolding r_def QuotientGroupRel_def
by autothen have r{t}=r{aa} using eqT equiv_class_eq
by autoSwith haa∈Gi have haa,r{t}i∈{hb,r{b}i. b∈S T} by autowith haa∈Ai have A1:r{t}∈({hb,r{b}i. b∈ T}A) using image_iff byautoS
from ht∈Gi have ht,r{t}i∈{hb,r{b}i.
b∈ T} by auto
S
S
with A1 have t∈{hb,r{b}i. b∈ T}-({hb,r{b}i. b∈ T}A) using vimage_iff
by auto}S
S
then show H+A⊆{hb,r{b}i. b∈ T}-({hb,r{b}i. b∈ T}A) by autoqedS
have H+A=( x∈H. x + A) using interval_add(3) subH subA by auto moreover
have ∀ x∈H. x + A∈T using open_tr_open(1) assms(2) subH by blast
then have {xS + A. x∈H}⊆T by auto
then have ( x∈H. x + A)∈T using topSpaceAssum unfolding IsATopology_def
by autoultimately have H+A∈T by auto
S
S
with A1 have {hb,r{b}i. b∈
S T}-({hb,r{b}i. b∈ T}A)∈T byS auto
thenhave ({hb,r{b}i. b∈ T}A)∈{quotient topology in}(( T)//r){by}{hb,r{b}i.
Sb∈ T}{from}Tusing QuotientTop_def topSpaceAssum quotient_proj_surj using
func1_1_L6(2)[OF quotient_proj_fun]by autoS
then show ({hb,r{b}i. b∈ T}A)∈(T{quotient by}r) using EquivQuo_def[OFeqT] by autoqed

A quotient of a topological group is just a quotient group with an appropiate
topology that makes product and inverse continuous.
theorem (in topgroup) quotient_top_group_F_cont:assumes IsAnormalSubgroup(G,f,H)
defines r ≡ QuotientGroupRel(G,f,H)
defines F ≡ QuotientGroupOp(G,f,H)
shows IsContinuous(ProductTopology(T{quotient by}r,T{quotient by}r),T{quotientby}r,F)
proof S
have eqT:equiv( T,r) and eqG:equiv(G,r) using group0.Group_ZF_2_4_L3
assms(1) unfolding r_def IsAnormalSubgroup_def
using group0_valid_in_tgroup by auto
S S
have fun:{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}:G×G→(G//r)×(G//r) using product_equiv_rel_fun unfolding G_def by auto
have C:Congruent2(r,f) using Group_ZF_2_4_L5A[OF Ggroup assms(1)] unfolding r_def.
with eqT have IsContinuous(ProductTopology(T,T),ProductTopology(T{quotient
S Sby}r,T{quotient by}r),{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T})
using product_quo_fun by auto
have tprod:topology0(ProductTopology(T,T)) unfolding topology0_def us-

1022

ing Top_1_4_T1(1)[OF topSpaceAssum topSpaceAssum].
S S
SS
have Hfun:{hhb,ci,hr{b},r{c}ii.
hb,ci∈ T× T}∈surj( ProductTopology(T,T),(({quotientS
S
S S
topology in}((( T)//r)×(( T)//r)){by}{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}{from}(ProductTopo
using prod_equiv_rel_surj
total_quo_equi[OF eqT] topology0.total_quo_func[OF tprod prod_equiv_rel_surj]
unfolding F_def QuotientGroupOp_def r_def
by autoSS
S
haveSFfun:F:(({quotient topology in}((( T)//r)×((T)//r)){by}{hhb,ci,hr{b},r{c}ii.
SS
hb,ci∈ T× T}{from}(ProductTopology(T,T))))→ (T{quotient by}r)using EquivClass_1_T1[OF eqG C] using total_quo_equi[OF eqT] topology0.total_quo_func[OFtprod prod_equiv_rel_surj] unfolding F_def QuotientGroupOp_def r_def
by autoS S
have cc:(F O {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}):G×G→G//r using comp_fun[OFfun EquivClass_1_T1[OF eqG C]]
unfolding F_def QuotientGroupOp_def r_def
S bySauto S
Sthen have (F O {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}): (ProductTopology(T,T))→ (T{quotienby}r) using Top_1_4_T1(3)[OF topSpaceAssum topSpaceAssum]
total_quo_equi[OF eqT] by auto
then have two:two_top_spaces0(ProductTopology(T,T),T{quotientby}r,(FS S
O {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T})) unfolding two_top_spaces0_def
using Top_1_4_T1(1)[OF topSpaceAssum topSpaceAssum] equiv_quo_is_top[OFeqT] by auto
have IsContinuous(ProductTopology(T,T),T,f) using fcon prodtop_def by
auto moreoverS
have IsContinuous(T,T{quotient by}r,{hb,r{b}i. b∈ T}) using quotient_func_cont[OFquotient_proj_surj]
unfolding EquivQuo_def[OF eqT] by auto
ultimately
have cont:IsContinuous(ProductTopology(T,T),T{quotient by}r,{hb,r{b}i.
Sb∈ T} O f)using comp_cont by auto{
fix A assume A:A∈G×G
then obtain g1 g2 where A_def:A=hg1,g2i
g1∈Gg2∈G by autoS
then have fA=g1+g2 and p:g1+g2∈ T unfolding grop_def using
apply_type[OF topgroup_f_binop]
by autoS
S
then have {hb,r{b}i. b∈ T}(fA)={hb,r{b}i.
b∈ T}(g1+g2) by autoSwith p have {hb,r{b}i. b∈ T}(fA)=r{g1+g2} using apply_equality[OF_ quotient_proj_fun]by autoS
then have Pr1:({hb,r{b}i. b∈ T} O f)A=r{g1+g2} using comp_fun_apply[OFtopgroup_f_binop A] by auto
S S
from A_def(2,3) have hg1,g2i∈ T× T by auto
S S
then have hhg1,g2i,hr{g1},r{g2}ii∈{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}
by auto
S S
then have {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}A=hr{g1},r{g2}i using
A_def(1) apply_equality[OF _ product_equiv_rel_fun]by auto
S S
then have F({hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}A)=Fhr{g1},r{g2}i by
auto

1023

S S
then have F({hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}A)=r({g1+g2}) usinggroup0.Group_ZF_2_2_L2[OF group0_valid_in_tgroup eqG C_ A_def(2,3)] unfolding F_def QuotientGroupOp_def r_def by auto
moreover
S S
note fun ultimately have (F O {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T})A=r({g1+g2})
using comp_fun_apply[OF _ A] by auto
S S
Sthen have (F O {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T})A=({hb,r{b}i. b∈ T}
O f)A using Pr1 by auto}
S S
Sthen have (F O {hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T})=({hb,r{b}i. b∈ T}O f) using fun_extension[OF cc comp_fun[OF topgroup_f_binop quotient_proj_fun]]unfolding F_def QuotientGroupOp_def r_def by auto
thenShave
S A:IsContinuous(ProductTopology(T,T),T{quotient by}r,F O {hhb,ci,hr{b},r{c}ii.
hb,ci∈ T× T}) using cont by auto
have IsAsubgroup(H,f) using assms(1) unfolding IsAnormalSubgroup_def
by autoS
then have ∀ A∈T. {hb, r {b}i . b ∈T} A ∈ ({quotient by}r) using
quotient_map_topgroup_open unfolding r_def by autowith eqT haveSProductTopology({quotientby}r,{quotient by}r)=({quotientS
S S
topology in}((( T)//r)×(( T)//r)){by}{hhb,ci,hr{b},r{c}ii. hb,ci∈ T× T}{from}(ProductTopo
using prod_quotientby autowith A show IsContinuous(ProductTopology(T{quotient by}r,T{quotientby}r),T{quotient by}r,F)using two_top_spaces0.cont_quotient_top[OF two Hfun Ffun] topology0.total_quo_func[OFtprod prod_equiv_rel_surj] unfolding F_def QuotientGroupOp_def r_def
by autoqed
lemma (in group0) Group_ZF_2_4_L8:
assumes IsAnormalSubgroup(G,P,H)
defines r ≡ QuotientGroupRel(G,P,H)
and F ≡ QuotientGroupOp(G,P,H)
shows GroupInv(G//r,F):G//r→G//r
using group0_2_T2[OF Group_ZF_2_4_T1[OF _ assms(1)]] groupAssum using assms(2,3)
by autotheorem (in topgroup) quotient_top_group_INV_cont:assumes IsAnormalSubgroup(G,f,H)
defines r ≡ QuotientGroupRel(G,f,H)
defines F ≡ QuotientGroupOp(G,f,H)
shows IsContinuous(T{quotient by}r,T{quotient by}r,GroupInv(G//r,F))
proof S
have eqT:equiv( T,r) and eqG:equiv(G,r) using group0.Group_ZF_2_4_L3
assms(1) unfolding r_def IsAnormalSubgroup_def
using group0_valid_in_tgroup by auto
have two:two_top_spaces0(T,T{quotient by}r,{hb,r{b}i. b∈G}) unfolding two_top_spaces0_def

1024using topSpaceAssum equiv_quo_is_top[OF eqT] quotient_proj_fun total_quo_equi[OFeqT] by auto
have IsContinuous(T,T,GroupInv(G,f)) using inv_cont. moreover{
fix g assume G:g∈Gthen have GroupInv(G,f)g=-g using grinv_def by auto
then have r({GroupInv(G,f)g})=GroupInv(G//r,F)(r{g}) using group0.Group_ZF_2_4_L7[OF group0_valid_in_tgroup assms(1) G] unfolding r_def F_def by
auto
then have {hb,r{b}i. b∈G}(GroupInv(G,f)g)=GroupInv(G//r,F)({hb,r{b}i.
b∈G}g)
using apply_equality[OF _ quotient_proj_fun] G neg_in_tgroup unfolding grinv_def
by autothen have ({hb,r{b}i. b∈G}O GroupInv(G,f))g=(GroupInv(G//r,F)O {hb,r{b}i.
b∈G})gusing comp_fun_apply[OF quotient_proj_fun G] comp_fun_apply[OF group0_2_T2[OFGgroup] G] by auto}
then have A1:{hb,r{b}i. b∈G}O GroupInv(G,f)=GroupInv(G//r,F)O {hb,r{b}i.
b∈G} using fun_extension[
OF comp_fun[OF quotient_proj_fun group0.Group_ZF_2_4_L8[OF group0_valid_in_tgroup
assms(1)]]comp_fun[OF group0_2_T2[OF Ggroup] quotient_proj_fun[of Gr]]] unfolding r_def F_def by autoS
have IsContinuous(T,T{quotient by}r,{hb,r{b}i. b∈ T}) using quotient_func_cont[OFquotient_proj_surj]
unfolding EquivQuo_def[OF eqT] by autoS
ultimately have IsContinuous(T,T{quotient by}r,{hb,r{b}i. b∈ T}O GroupInv(G,f))using comp_cont by autowith A1 have IsContinuous(T,T{quotient by}r,GroupInv(G//r,F)O {hb,r{b}i.
b∈G}) by auto
S
thenShave IsContinuous({quotient topology in}( T) // r{by}{hb, r {b}i. b ∈T}{from}T,T{quotient by}r,GroupInv(G//r,F))
using two_top_spaces0.cont_quotient_top[OF two quotient_proj_surj,of GroupInv(G//r,F)r] group0.Group_ZF_2_4_L8[OF group0_valid_in_tgroup
assms(1)]using total_quo_equi[OF eqT] unfolding r_def F_def by auto
then show thesis unfolding EquivQuo_def[OF eqT].
qed

Finally we can prove that quotient groups of topological groups are topological groups.
theorem(in topgroup) quotient_top_group:
assumes IsAnormalSubgroup(G,f,H)
defines r ≡ QuotientGroupRel(G,f,H)
defines F ≡ QuotientGroupOp(G,f,H)
shows IsAtopologicalGroup({quotient by}r,F)
unfolding IsAtopologicalGroup_def using total_quo_equi equiv_quo_is_top1025Group_ZF_2_4_T1 Ggroup assms(1) quotient_top_group_INV_cont quotient_top_group_F_contgroup0.Group_ZF_2_4_L3 group0_valid_in_tgroup assms(1) unfolding r_def
F_def IsAnormalSubgroup_def
by autoend

71

Topological groups 3

theory TopologicalGroup_ZF_3 imports Topology_ZF_10 TopologicalGroup_ZF_2
TopologicalGroup_ZF_1
Group_ZF_4
begin

This theory deals with topological properties of subgroups, quotient groups
and relations between group theorical properties and topological properties.

71.1

Subgroups topologies

The closure of a subgroup is a subgroup.

theorem (in topgroup) closure_subgroup:
assumes IsAsubgroup(H,f)
shows IsAsubgroup(cl(H),f)
proof have two:two_top_spaces0(ProductTopology(T,T),T,f) unfolding two_top_spaces0_def
using
topSpaceAssum Top_1_4_T1(1,3) topgroup_f_binop by autofrom fcon have cont:IsContinuous(ProductTopology(T,T),T,f) by auto
then have closed:∀ D. D{is closed in}T −→ f-D{is closed in}τ using
two_top_spaces0.TopZF_2_1_L1
two by autoS
then have closure:∀ A∈Pow( τ ). f(Closure(A,τ ))⊆cl(fA) using two_top_spaces0.Top_ZF_2_1_L
two by force
have sub1:H⊆G using group0.group0_3_L2 group0_valid_in_tgroup assms
by forceS
then have sub:(H)×(H)⊆ τ using prod_top_on_G(2) by autofrom sub1 have clHG:cl(H)⊆G using Top_3_L11(1) by auto
then have clHsub1:cl(H)×cl(H)⊆G×G by auto
have Closure(H×H,ProductTopology(T,T))=cl(H)×cl(H) using cl_product
topSpaceAssum group0.group0_3_L2 group0_valid_in_tgroup assms by auto
then have f(Closure(H×H,ProductTopology(T,T)))=f(cl(H)×cl(H)) by autowith closure sub have clcl:f(cl(H)×cl(H))⊆cl(f(H×H)) by force
from assms have fun:restrict(f,H×H):H×H→H unfolding IsAsubgroup_def
usinggroup0.group_oper_assocA unfolding group0_def by auto
then have restrict(f,H×H)(H×H)=f(H×H) using restrict_image by auto1026

moreover from fun have restrict(f,H×H)(H×H)⊆H using func1_1_L6(2)by blast
ultimately have f(H×H)⊆H by autowith sub1 have f(H×H)⊆Hf(H×H)⊆GH⊆G by auto
then have cl(f(H×H))⊆cl(H) using top_closure_mono by autowith clcl have img:f(cl(H)×cl(H))⊆cl(H) by auto{
fix x y assume x∈cl(H)y∈cl(H)then have hx,yi∈cl(H)×cl(H) by auto moreover
have f(cl(H)×cl(H))={ft. t∈cl(H)×cl(H)} using func_imagedef topgroup_f_binop
clHsub1 by auto ultimately
have fhx,yi∈f(cl(H)×cl(H)) by autowith img have fhx,yi∈cl(H) by auto}
then have A1:cl(H){is closed under} f unfolding IsOpClosed_def by auto
have two:two_top_spaces0(T,T,GroupInv(G,f)) unfolding two_top_spaces0_def
using
topSpaceAssum Ggroup group0_2_T2 by autofrom inv_cont have cont:IsContinuous(T,T,GroupInv(G,f)) by auto
then have closed:∀ D. D{is closed in}T −→ GroupInv(G,f)-D{is closedin}T using two_top_spaces0.TopZF_2_1_L1
two by autoS
then have closure:∀ A∈Pow( T). GroupInv(G,f)(cl(A))⊆cl(GroupInv(G,f)A)
using two_top_spaces0.Top_ZF_2_1_L2
two by force
with sub1 have Inv:GroupInv(G,f)(cl(H))⊆cl(GroupInv(G,f)H) by auto
moreoverhave GroupInv(H,restrict(f,H×H)):H→H using assms unfolding IsAsubgroup_def
using group0_2_T2 by auto thenhave GroupInv(H,restrict(f,H×H))H⊆H using func1_1_L6(2) by auto
then have restrict(GroupInv(G,f),H)H⊆H using group0.group0_3_T1 assms
group0_valid_in_tgroup by auto
then have sss:GroupInv(G,f)H⊆H using restrict_image by auto
then have H⊆G GroupInv(G,f)H⊆G using sub1 by autowith sub1 sss have cl(GroupInv(G,f)H)⊆cl(H) using top_closure_mono
by auto ultimately
have img:GroupInv(G,f)(cl(H))⊆cl(H) by auto{
fix x assume x∈cl(H) moreover
have GroupInv(G,f)(cl(H))={GroupInv(G,f)t. t∈cl(H)} using func_imagedef
Ggroup group0_2_T2
clHG by force ultimately
have GroupInv(G,f)x∈GroupInv(G,f)(cl(H)) by autowith img have GroupInv(G,f)x∈cl(H) by auto}
then have A2:∀ x∈cl(H). GroupInv(G,f)x∈cl(H) by autofrom assms have H6=0 using group0.group0_3_L5 group0_valid_in_tgroupby auto moreover1027

have H⊆cl(H) using cl_contains_set sub1 by auto ultimately
have cl(H)6=0 by autowith clHG A2 A1 show thesis using group0.group0_3_T3 group0_valid_in_tgroupby autoqed

The closure of a normal subgroup is normal.
theorem (in topgroup) normal_subg:
assumes IsAnormalSubgroup(G,f,H)
shows IsAnormalSubgroup(G,f,cl(H))
proof have A:IsAsubgroup(cl(H),f) using closure_subgroup assms unfolding IsAnormalSubgroup_def
by autohave sub1:H⊆G using group0.group0_3_L2 group0_valid_in_tgroup assms
unfolding IsAnormalSubgroup_def by auto
then have sub2:cl(H)⊆G using Top_3_L11(1) by auto{
fix g assume g:g∈Gthen have cl1:cl(g+H)=g+cl(H) using trans_closure sub1 by auto
have ss:g+cl(H)⊆G unfolding ltrans_def LeftTranslation_def by auto
have g+H⊆G unfolding ltrans_def LeftTranslation_def by auto
moreover from g have (-g)∈G using neg_in_tgroup by auto
ultimately have cl2:cl((g+H)+(-g))=cl(g+H)+(-g) using trans_closure2
by autowith cl1 have clcon:cl((g+H)+(-g))=(g+(cl(H)))+(-g) by auto{
fix r assume r∈(g+H)+(-g)
then obtain q where q:q∈g+H r=q+(-g) unfolding rtrans_def RightTranslation_def
by forcefrom q(1) obtain h where h∈H q=g+h unfolding ltrans_def LeftTranslation_def
by autowith q(2) have r=(g+h)+(-g) by autowith hh∈Hi hg∈Gi h(-g)∈Gi have r∈H using assms unfolding IsAnormalSubgroup_def
grinv_def grop_def by auto}
then have (g+H)+(-g)⊆H by auto
moreover then have (g+H)+(-g)⊆GH⊆G using sub1 by auto ultimately
have cl((g+H)+(-g))⊆cl(H) using top_closure_mono by autowith clcon have (g+(cl(H)))+(-g)⊆cl(H) by auto moreover{
fix b assume b∈{g+(d-g). d∈cl(H)}then obtain d where d:d∈cl(H) b=g+(d-g) by auto moreover
then have d∈G using sub2 by auto
then have g+d∈G using group0.group_op_closed[OF group0_valid_in_tgrouphg∈Gi] by autofrom d(2) have b:b=(g+d)-g using group0.group_oper_assoc[OF group0_valid_in_tgrouphg∈Gi hd∈Gih(-g)∈Gi]
unfolding grsub_def grop_def grinv_def by blast
have (g+d)=LeftTranslation(G,f,g)d using group0.group0_5_L2(2)[OF1028

group0_valid_in_tgroup]hg∈Gihd∈Gi by autowith hd∈cl(H)i have g+d∈g+cl(H) unfolding ltrans_def using func_imagedef[OFgroup0.group0_5_L1(2)[OF group0_valid_in_tgroup hg∈Gi] sub2] by auto
moreover from b have b=RightTranslation(G,f,-g)(g+d) using group0.group0_5_L2(1)[OFgroup0_valid_in_tgroup]h(-g)∈Gihg+d∈Gi by auto
ultimately have b∈(g+cl(H))+(-g) unfolding rtrans_def using func_imagedef[OFgroup0.group0_5_L1(1)[OF group0_valid_in_tgroup h(-g)∈Gi] ss] by force}
ultimately have {g+(d-g). d∈cl(H)}⊆cl(H) by force}
then show thesis using A group0.cont_conj_is_normal[OF group0_valid_in_tgroup,of cl(H)]unfolding grsub_def grinv_def grop_def by autoqed

Every open subgroup is also closed.
theorem (in topgroup) open_subgroup_closed:
assumes IsAsubgroup(H,f) H∈Tshows H{is closed in}T
proof from assms(1) have sub:H⊆G using group0.group0_3_L2 group0_valid_in_tgroupby force{
fix t assume t∈G-Hthen have tnH:t∈H/ and tG:t∈G by autofrom assms(1) have sub:H⊆G using group0.group0_3_L2 group0_valid_in_tgroupby forcefrom assms(1) have nSubG:0∈H using group0.group0_3_L5 group0_valid_in_tgroupby autofrom assms(2) tG have P:t+H∈T using open_tr_open(1) by autofrom nSubG sub tG have tp:t∈t+H using group0_valid_in_tgroup group0.neut_trans_elem
by auto{fix x assume x∈(t+H)∩H
then obtain u where x=t+u u∈H x∈H unfolding ltrans_def LeftTranslation_def
by autothen have u∈Gx∈Gt∈G using sub tG by autowith hx=t+ui have x+(-u)=t using group0.group0_2_L18(1) group0_valid_in_tgroup
unfolding grop_def grinv_def by autofrom hu∈Hi have (-u)∈H unfolding grinv_def using assms(1) group0.group0_3_T3A
group0_valid_in_tgroupby autowith hx∈Hi have x+(-u)∈H unfolding grop_def using assms(1) group0.group0_3_L6
group0_valid_in_tgroupby auto1029

with hx+(-u)=ti have False using tnH by auto}
then have (t+H)∩H=0 by auto moreover
have t+H⊆G unfolding ltrans_def LeftTranslation_def by auto ultimately
have (t+H)⊆G-H by autowith tp P have ∃ V∈T. t∈V ∧ V⊆G-H unfolding Bex_def by auto}
then have ∀ t∈G-H. ∃ V∈T. t∈V ∧ V⊆G-H by auto
then have G-H∈T using open_neigh_open by auto
then show thesis unfolding IsClosed_def using sub by autoqed

Any subgroup with non-empty interior is open.

theorem (in topgroup) clopen_or_emptyInt:
assumes IsAsubgroup(H,f) int(H)6=0
shows H∈T
proof from assms(1) have sub:H⊆G using group0.group0_3_L2 group0_valid_in_tgroupby force{
fix h assume h∈Hhave intsub:int(H)⊆H using Top_2_L1 by autofrom assms(2) obtain u where u∈int(H) by autowith intsub have u∈H by auto
then have (-u)∈H unfolding grinv_def using assms(1) group0.group0_3_T3A
group0_valid_in_tgroupby autowith hh∈Hi have h-u∈H unfolding grop_def using assms(1) group0.group0_3_L6
group0_valid_in_tgroupby auto{fix t assume t∈(h-u)+(int(H))
then obtain r where r∈int(H)t=(h-u)+r unfolding grsub_def grinv_def
grop_def
ltrans_def LeftTranslation_def by auto
then have r∈H using intsub by autowith hh-u∈Hi have (h-u)+r∈H unfolding grop_def using assms(1) group0.group0_3_L6
group0_valid_in_tgroupby autowith ht=(h-u)+ri have t∈H by auto}
then have ss:(h-u)+(int(H))⊆H by auto
have P:(h-u)+(int(H))∈T using open_tr_open(1) hh-u∈Hi Top_2_L2 subby blastfrom hh-u∈Hihu∈Hihh∈Hi sub have (h-u)∈G u∈Gh∈G by auto
have int(H)⊆G using sub intsub by auto moreover
have LeftTranslation(G,f,(h-u))∈G→G using group0.group0_5_L1(2) group0_valid_in_tgrouph(h-u)∈Gi

1030

by auto ultimately
have LeftTranslation(G,f,(h-u))(int(H))={LeftTranslation(G,f,(h-u))r.
r∈int(H)}using func_imagedef by auto moreoverfrom h(h-u)∈Gi hu∈Gi have LeftTranslation(G,f,(h-u))u=(h-u)+u usinggroup0.group0_5_L2(2) group0_valid_in_tgroupby autowith hu∈int(H)i have (h-u)+u∈{LeftTranslation(G,f,(h-u))r. r∈int(H)}by force ultimately
have (h-u)+u∈(h-u)+(int(H)) unfolding ltrans_def by auto moreover
have (h-u)+u=h using group0.inv_cancel_two(1) group0_valid_in_tgrouphu∈Gihh∈Gi by auto ultimately
have h∈(h-u)+(int(H)) by autowith P ss have ∃ V∈T. h∈V∧ V⊆H unfolding Bex_def by auto}
then show thesis using open_neigh_open by autoqed

In conclusion, a subgroup is either open or has empty interior.
corollary(in topgroup) emptyInterior_xor_op:
assumes IsAsubgroup(H,f)
shows (int(H)=0) Xor (H∈T)
unfolding Xor_def using clopen_or_emptyInt assms Top_2_L3
group0.group0_3_L5 group0_valid_in_tgroup by force

Then no connected topological groups has proper subgroups with non-empty
interior.
corollary(in topgroup) connected_emptyInterior:assumes IsAsubgroup(H,f) T{is connected}
shows (int(H)=0) Xor (H=G)
proof have (int(H)=0) Xor (H∈T) using emptyInterior_xor_op assms(1) by auto
moreover{assume H∈T moreover
then have H{is closed in}T using open_subgroup_closed assms(1) byauto ultimately
have H=0∨H=G using assms(2) unfolding IsConnected_def by auto
then have H=G using group0.group0_3_L5 group0_valid_in_tgroup assms(1)by auto} moreover
have G∈T using topSpaceAssum unfolding IsATopology_def G_def by auto
ultimately show thesis unfolding Xor_def by autoqed

Every locally-compact subgroup of a T0 group is closed.
theorem (in topgroup) loc_compact_T0_closed:
assumes IsAsubgroup(H,f) (T{restricted to}H){is locally-compact} T{is
T0 }

1031

shows H{is closed in}T
proof from assms(1) have clsub:IsAsubgroup(cl(H),f) using closure_subgroupby autothen have subcl:cl(H)⊆G using group0.group0_3_L2 group0_valid_in_tgroupby forcefrom assms(1) have sub:H⊆G using group0.group0_3_L2 group0_valid_in_tgroupby forcefrom assms(3) have T{is T2 } using T1_imp_T2 neu_closed_imp_T1 T0_imp_neu_closedby autothen haveS(T{restricted to}H){is T2 } using T2_here sub by auto
have tot: (T{restricted to}H)=H using sub unfolding RestrictedTo_def
by autowith assms(2) have ∀ x∈H. ∃ A∈Pow(H). A {is compact in} (T{restrictedto}H) ∧ x ∈ Interior(A, (T{restricted to}H)) using
topology0.locally_compact_exist_compact_neig[of T{restricted to}H]
Top_1_L4 unfolding topology0_def
by autothen obtain K where K:K⊆H K{is compact in} (T{restricted to}H)0∈Interior(K,(T{restrictedto}H))
using group0.group0_3_L5 group0_valid_in_tgroup assms(1) unfolding
gzero_def by force
from K(1,2) have K{is compact in} T using compact_subspace_imp_compact
by autowith hT{is T2 }i have Kcl:K{is closed in}T using in_t2_compact_is_clby autohave Interior(K,(T{restricted to}H))∈(T{restricted to}H) using topology0.Top_2_L2
unfolding topology0_def
using Top_1_L4 by auto
then obtain U where U:U∈TInterior(K,(T{restricted to}H))=H∩U unfolding RestrictedTo_def by auto
then have H∩U⊆K using topology0.Top_2_L1[of T{restricted to}H] unfolding topology0_def using Top_1_L4 by force
moreover have U2:U⊆U∪K by auto
have ksub:K⊆H using tot K(2) unfolding IsCompact_def by auto
ultimately have int:H∩(U∪K)=K by autofrom U(2) K(3) have 0∈U by autowith U(1) U2 have 0∈int(U ∪ K) using Top_2_L6 by auto
then have U∪K∈N 0 unfolding zerohoods_def using U(1) ksub sub by auto
then obtain V where V:V⊆U∪K V∈N 0 V+V⊆U∪K(- V) = V using exists_procls_zerohood[ofU∪K]
by auto{fix h assume AS:h∈cl(H)with clsub have (-h)∈cl(H) using group0.group0_3_T3A group0_valid_in_tgroupby auto moreover
then have (-h)∈G using subcl by autowith V(2) have (-h)∈int((-h)+V) using elem_in_int_trans by auto ultimately

1032

have (-h)∈(cl(H))∩(int((-h)+V)) by auto moreover
have int((-h)+V)∈T using Top_2_L2 by auto moreovernote sub ultimately
have H∩(int((-h)+V))6=0 using cl_inter_neigh by auto moreoverfrom h(-h)∈Gi V(2) have int((-h)+V)=(-h)+int(V) unfolding zerohoods_def
using trans_interior by force
ultimately have H∩((-h)+int(V))6=0 by auto
then obtain y where y:y∈H y∈(-h)+int(V) by blast
then obtain v where v:v∈int(V) y=(-h)+v unfolding ltrans_def LeftTranslation_def
by autowith h(-h)∈Gi V(2) y(1) sub have v∈G(-h)∈Gy∈G using Top_2_L1[of V]
unfolding zerohoods_def by autowith v(2) have (-(-h))+y=v using group0.group0_2_L18(2) group0_valid_in_tgroup
unfolding grop_def grinv_def by auto moreover
have h∈G using AS subcl by auto
then have (-(-h))=h using group0.group_inv_of_inv group0_valid_in_tgroupby auto ultimately
have h+y=v by autowith v(1) have hyV:h+y∈int(V) by auto
have y∈cl(H) using y(1) cl_contains_set sub by autowith AS have hycl:h+ y∈cl(H) using clsub group0.group0_3_L6 group0_valid_in_tgroupby auto{fix W assume W:W∈Th+y∈Wwith hyV have h+y∈int(V)∩W by auto moreoverfrom W(1) have int(V)∩W∈T using Top_2_L2 topSpaceAssum unfolding IsATopology_def by auto moreovernote hycl sub
ultimately have (int(V)∩W)∩H6=0 using cl_inter_neigh[of Hint(V)∩Wh+y]by autothen have V∩W∩H6=0 using Top_2_L1 by autowith V(1) have (U∪K)∩W∩H6=0 by auto
then have (H∩(U∪K))∩W6=0 by autowith int have K∩W6=0 by auto}
then have ∀ W∈T. h+y∈W −→ K∩W6=0 by auto moreover
have K⊆G h+y∈G using ksub sub hycl subcl by auto ultimately
have h+y∈cl(K) using inter_neigh_cl[of Kh+y] unfolding G_def by force
then have h+y∈K using Kcl Top_3_L8 hK⊆Gi by autowith ksub have h+y∈H by auto
moreover from y(1) have (-y)∈H using group0.group0_3_T3A assms(1)group0_valid_in_tgroupby autoultimately have (h+y)-y∈H unfolding grsub_def using group0.group0_3_L6
group0_valid_in_tgroup
assms(1) by auto
moreoverhave (-y)∈G using h(-y)∈Hi sub by auto
then have h+(y-y)=(h+y)-y using hy∈Gihh∈Gi group0.group_oper_assoc

1033

group0_valid_in_tgroup unfolding grsub_def by auto
then have h+0=(h+y)-y using group0.group0_2_L6 group0_valid_in_tgrouphy∈Gi
unfolding grsub_def grinv_def grop_def gzero_def by auto
then have h=(h+y)-y using group0.group0_2_L2 group0_valid_in_tgrouphh∈Gi unfolding gzero_def by auto
ultimately have h∈H by auto}
then have cl(H)⊆H by auto
then have H=cl(H) using cl_contains_set sub by auto
then show thesis using Top_3_L8 sub by autoqed

We can always consider a factor group which is T2 .
theorem(in topgroup) factor_haus:shows (T{quotient by}QuotientGroupRel(G,f,cl({0}))){is T2 }proof let r=QuotientGroupRel(G,f,cl({0}))let f=QuotientGroupOp(G,f,cl({0}))let i=GroupInv(G//r,f)
have IsAnormalSubgroup(G,f,{0}) using group0.trivial_normal_subgroup
Ggroup unfolding group0_def
by autothen have normal:IsAnormalSubgroup(G,f,cl({0})) using normal_subg by
autoSthen have eq:equiv( T,r) using group0.Group_ZF_2_4_L3[OF group0_valid_in_tgroup]
unfolding IsAnormalSubgroup_def
by autoS
then have tot: (T{quotient by}r)=G//r using total_quo_equi by auto
have neu:r{0}=TheNeutralElement(G//r,f) using Group_ZF_2_4_L5B[OF Ggroupnormal] by auto
then have r{0}∈G//r using group0.group0_2_L2 Group_ZF_2_4_T1[OF Ggroupnormal] unfolding group0_def by auto
then have sub1:{r{0}}⊆G//r
by autoS
then have sub:{r{0}}⊆(T{quotientby}r) using tot by autoS
have zG:0∈ T using group0.group0_2_L2[OF group0_valid_in_tgroup] by
auto
from zG have cla:r{0}∈G//r unfolding quotient_def by auto
let x=G//r-{r{0}}{S
fix s assume A:s∈ (G//r-{r{0}})then obtain U where s∈U U∈G//r-{r{0}} by auto
then have U∈G//r U6=r{0} s∈U by auto
then have U∈G//rs∈U s∈r{0}/using cla quotient_disj[OF eq] by autoS
then have s∈ (G//r)-r{0} by auto}
moreover{S
fix s assume A:s∈ (G//r)-r{0}then obtain U where s∈U U∈G//r s∈r{0}/by auto1034

then have s∈U
S U∈G//r-{r{0}} by auto
then have s∈ (G//r-{r{0}}) by auto}S
S
ultimately have
(G//r-{r{0}})= (G//r)-r{0} by autoS
then have A: (G//r-{r{0}})=G-r{0} using Union_quotient eq by auto{
fix s assume A:s∈r{0}then have h0,si∈r by auto
then have hs,0i∈r using eq unfolding equiv_def sym_def by auto
then have s∈cl({0}) using group0.Group_ZF_2_4_L5C[OF group0_valid_in_tgroup]
unfolding QuotientGroupRel_def by auto}
moreover{fix s assume A:s∈cl({0})
then have s∈G using Top_3_L11(1) zG by auto
then have hs,0i∈r using group0.Group_ZF_2_4_L5C[OF group0_valid_in_tgroup]
A by auto
then have h0,si∈r using eq unfolding equiv_def sym_def by auto
then have s∈r{0} by auto}
ultimately have
S r{0}=cl({0}) by blast
with A have
(G//r-{r{0}})=G-cl({0}) by auto
moreover have cl({0}){isclosed in}T using cl_is_closed zG by autoS
ultimately have
(G//r-{r{0}})∈T unfolding IsClosed_def by auto
then have (G//r-{r{0}})∈{quotient by}r using quotient_equiv_rel eq
by autoS
then have ( (T{quotient by}r)-{r{0}})∈{quotient by}r using total_quo_equi[OFeq] by autoS
moreover from sub1 have {r{0}}⊆( (T{quotient by}r)) using total_quo_equi[OFeq] by auto
ultimately have {r{0}}{is closed in}(T{quotient by}r) unfolding IsClosed_def
by autothen have {TheNeutralElement(G//r,f)}{is closed in}(T{quotient by}r)using neu by auto
then have (T{quotient by}r){is T1 } using topgroup.neu_closed_imp_T1[OFtopGroupLocale[OF quotient_top_group[OF normal]]]total_quo_equi[OF eq] by auto
then show thesis using topgroup.T1_imp_T2[OF topGroupLocale[OF quotient_top_group[OFnormal]]] by auto
qed

end

72

Metamath introduction

theory MMI_prelude imports Order_ZF_1

1035

beginMetamath’s set.mm features a large (over 8000) collection of theorems provenin the ZFC set theory. This theory is part of an attempt to translate thosetheorems to Isar so that they are available for Isabelle/ZF users. A total of about 1200 assertions have been translated, 600 of that with proofs(the rest was proven automatically by Isabelle). The translation was donewith the support of the mmisar tool, whose source is included in the IsarMathLib distributions prior to version 1.6.4. The translation tool wasdoing about 99 percent of work involved, with the rest mostly related to thedifference between Isabelle/ZF and Metamath metalogics. Metamath uses
Tarski-Megill metalogic that does not have a notion of bound variables (seehttp://planetx.cc.vt.edu/AsteroidMeta/Distinctors_vs_binders for details
and discussion). The translation project is closed now as I decided that it
was too boring and tedious even with the support of mmisar software. Also,
the translated proofs are not as readable as native Isar proofs which goesagainst IsarMathLib philosophy.

72.1

Importing from Metamath - how is it done

We are interested in importing the theorems about complex numbers thatstart from the ”recnt” theorem on. This is done mostly automatically by
the mmisar tool that is included in the IsarMathLib distributions prior toversion 1.6.4. The tool works as follows:First it reads the list of (Metamath) names of theorems that are alreadyimported to IsarMathlib (”known theorems”) and the list of theorems thatare intended to be imported in this session (”new theorems”). The newtheorems are consecutive theorems about complex numbers as they appear
in the Metamath database. Then mmisar creates a ”Metamath script” that
contains Metamath commands that open a log file and put the statements
and proofs of the new theorems in that file in a readable format. The tool
writes this script to a disk file and executes metamath with standard input
redirected from that file. Then the log file is read and its contents converted
to the Isar format. In Metamath, the proofs of theorems about complex
numbers depend only on 28 axioms of complex numbers and some basic
logic and set theory theorems. The tool finds which of these dependencies
are not known yet and repeats the process of getting their statements from
Metamath as with the new theorems. As a result of this process mmisar
creates files new theorems.thy, new deps.thy and new known theorems.txt.
The file new theorems.thy contains the theorems (with proofs) imported
from Metamath in this session. These theorems are added (by hand) to thecurrent MMI_Complex_ZF_x.thy file. The file new deps.thy contains the statements of new dependencies with generic proofs ”by auto”. These are added
to the MMI_logic_and_sets.thy. Most of the dependencies can be proven au1036

tomatically by Isabelle. However, some manual work has to be done for the
dependencies that Isabelle can not prove by itself and to correct problems
related to the fact that Metamath uses a metalogic based on distinct variable constraints (Tarski-Megill metalogic), rather than an explicit notion offree and bound variables.
The old list of known theorems is replaced by the new list and mmisar isready to convert the next batch of new theorems. Of course this rarely works
in practice without tweaking the mmisar source files every time a new batchis processed.

72.2

The context for Metamath theorems

We list the Metamth’s axioms of complex numbers and define notation here.
The next definition is what Metamath X ∈ V is translated to. I am notsure why it works, probably because Isabelle does a type inference and the”=” sign indicates that both sides are sets.
definition
IsASet :: i⇒o (_ isASet [90] 90) where
IsASet_def[simp]: X isASet ≡X = X

The next locale sets up the context to which Metamath theorems aboutcomplex numbers are imported. It assumes the axioms of complex numbers
and defines the notation used for complex numbers.
One of the problems with importing theorems from Metamath is that Metamath allows direct infix notation for binary operations so that the notation
af b is allowed where f is a function (that is, a set of pairs). To my knowledge, Isar allows only notation fha,bi with a possibility of defining a syntax
say a + b to mean the same as fha,bi (please correct me if I am wrong here).
This is why we have two objects for addition: one called caddset that represents the binary function, and the second one called ca which defines thea + b notation for caddsetha,bi. The same applies to multiplication of real
numbers.
Another difficulty is that Metamath allows to define sets with syntax {x|p}where p is some formula that (usually) depends on x. Isabelle allows the set
comprehension like this only as a subset of another set i.e. {x ∈ A.p(x)}.
This forces us to have a sligtly different definition of (complex) natural numbers, requiring explicitly that natural numbers is a subset of reals. Becauseof that, the proofs of Metamath theorems that reference the definition directly can not be imported.
locale MMIsar0 =fixes real (IR)fixes complex (C)1037

fixes one (1)fixes zero (0)fixes iunit (i)fixes caddset (+)
fixes cmulset (·)
fixes lessrrel (<R )fixes ca (infixl + 69)
defines ca_def: a + b ≡ +ha,bifixes cm (infixl · 71)
defines cm_def: a · b ≡ ·ha,bifixes sub (infixl - 69)
Sdefines sub_def: a - b ≡{ x ∈ C. b + x = a }fixes cneg (-_ 95)
defines cneg_def: - a ≡ 0 - a
fixes cdiv (infixl / 70)Sdefines cdiv_def: a / b ≡{ x ∈ C. b · x = a }fixes cpnf (+∞)
defines cpnf_def: +∞ ≡ C
fixes cmnf (−∞)
defines cmnf_def: −∞ ≡ {C}fixes cxr (IR∗ )defines cxr_def: IR∗ ≡ IR ∪ {+∞,−∞}
fixes cxn (IN)T
defines cxn_def: IN ≡{N ∈ Pow(IR). 1 ∈ N ∧ (∀ n. n∈N −→ n+1 ∈ N)}
fixes lessr (infix <R 68)
defines lessr_def: a <R b ≡ ha,bi ∈ <Rfixes cltrrset (<)
defines cltrrset_def:< ≡ (<R ∩ IR×IR) ∪ {h−∞,+∞i} ∪(IR×{+∞}) ∪ ({−∞}×IR )fixes cltrr (infix < 68)
defines cltrr_def: a < b ≡ ha,bi ∈ <fixes convcltrr (infix > 68)
defines convcltrr_def: a > b ≡ ha,bi ∈ converse(<)
fixes lsq (infix ≤ 68)
defines lsq_def: a ≤ b ≡ ¬ (b < a)fixes two (2)defines two_def: 2 ≡ 1+1
fixes three (3)defines three_def: 3 ≡ 2+1
fixes four (4)defines four_def: 4 ≡ 3+1
fixes five (5)defines five_def: 5 ≡ 4+1
fixes six (6)defines six_def: 6 ≡ 5+1
fixes seven (7)defines seven_def: 7 ≡ 6+1

1038

fixes eight (8)defines eight_def: 8 ≡ 7+1
fixes nine (9)defines nine_def: 9 ≡ 8+1
assumes MMI_pre_axlttri:
A ∈ IR ∧ B ∈ IR −→ (A <R B ←→ ¬(A=B ∨ B <R A))
assumes MMI_pre_axlttrn:
A ∈ IR ∧ B ∈ IR ∧ C ∈ IR −→ ((A <R B ∧ B <R C) −→ A <R C)
assumes MMI_pre_axltadd:
A ∈ IR ∧ B ∈ IR ∧ C ∈ IR −→ (A <R B −→ C+A <R C+B)
assumes MMI_pre_axmulgt0:
A ∈ IR ∧ B ∈ IR −→ ( 0 <R A ∧ 0 <R B −→ 0 <R A·B)
assumes MMI_pre_axsup:
A ⊆ IR ∧ A 6= 0 ∧ (∃ x∈IR. ∀ y∈A. y <R x) −→(∃ x∈IR. (∀ y∈A. ¬(x <R y)) ∧ (∀ y∈IR. (y <R x −→ (∃ z∈A. y <R z))))assumes MMI_axresscn: IR ⊆ C
assumes MMI_ax1ne0: 1 6= 0
assumes MMI_axcnex: C isASet
assumes MMI_axaddopr: + : ( C × C ) → C
assumes MMI_axmulopr: · : ( C × C ) → C
assumes MMI_axmulcom: A ∈ C ∧ B ∈ C −→ A · B = B · A
assumes MMI_axaddcl: A ∈ C ∧ B ∈ C −→ A + B ∈ C
assumes MMI_axmulcl: A ∈ C ∧ B ∈ C −→ A · B ∈ C
assumes MMI_axdistr:
A ∈ C ∧ B ∈ C ∧ C ∈ C −→ A·(B + C) = A·B + A·C
assumes MMI_axaddcom: A ∈ C ∧ B ∈ C −→ A + B = B + A
assumes MMI_axaddass:A ∈ C ∧ B ∈ C ∧ C ∈ C −→ A + B + C = A + (B + C)
assumes MMI_axmulass:A ∈ C ∧ B ∈ C ∧ C ∈ C −→ A · B · C = A · (B · C)assumes MMI_ax1re: 1 ∈ IR
assumes MMI_axi2m1: i · i + 1 = 0
assumes MMI_ax0id: A ∈ C −→ A + 0 = A
assumes MMI_axicn: i ∈ Cassumes MMI_axnegex: A ∈ C −→ ( ∃ x ∈ C. ( A + x ) = 0 )assumes MMI_axrecex: A ∈ C ∧ A 6= 0 −→ ( ∃ x ∈ C. A · x = 1)
assumes MMI_ax1id: A ∈ C −→ A · 1 = A
assumes MMI_axaddrcl: A ∈ IR ∧ B ∈ IR −→ A + B ∈ IR
assumes MMI_axmulrcl: A ∈ IR ∧ B ∈ IR −→ A · B ∈ IR
assumes MMI_axrnegex: A ∈ IR −→ ( ∃ x ∈ IR. A + x = 0 )assumes MMI_axrrecex: A ∈ IR ∧ A 6= 0 −→ ( ∃ x ∈ IR. A · x = 1 )

end

73

Logic and sets in Metamatahtheory MMI_logic_and_sets imports MMI_prelude1039

begin73.1

Basic Metamath theorems

This section contains Metamath theorems that the more advanced theorems
from MMIsar.thy depend on. Most of these theorems are proven automatically by Isabelle, some have to be proven by hand and some have to bemodified to convert from Tarski-Megill metalogic used by Metamath to one
based on explicit notion of free and bound variables.
lemma MMI_ax_mp: assumes ϕ and ϕ −→ ψ shows ψusing assms by auto
lemma MMI_sseli: assumes A1: A ⊆ Bshows C ∈ A −→ C ∈ B
using assms by auto
lemma MMI_sselii: assumes A1: A ⊆ B and
A2: C ∈ A
shows C ∈ B
using assms by auto
lemma MMI_syl: assumes A1: ϕ −→ ps andA2: ps −→ chshows ϕ −→ chusing assms by auto
lemma MMI_elimhyp: assumes A1: A = if ( ϕ , A , B ) −→ ( ϕ ←→ ψ )and
A2: B = if ( ϕ , A , B ) −→ ( ch ←→ ψ ) andA3: chshows ψproof { assume ϕwith A1 have ψ by simp }moreover{ assume ¬ϕwith A2 A3 have ψ by simp }ultimately show ψ by autoqed
lemma MMI_neeq1:
shows A = B −→ ( A 6= C ←→ B 6= C )by autolemma MMI_mp2: assumes A1: ϕ andA2: ψ andA3: ϕ −→ ( ψ −→ chi )1040

shows chi
using assms by auto
lemma MMI_xpex: assumes A1: A isASet andA2: B isASetshows ( A × B ) isASet
using assms by auto
lemma MMI_fex:
shows
A ∈ C −→ ( F : A → B −→ F isASet )A isASet −→ ( F : A → B −→ F isASet )by autolemma MMI_3eqtr4d: assumes A1: ϕ −→ A = B andA2: ϕ −→ C = A andA3: ϕ −→ D = B
shows ϕ −→ C = D
using assms by auto
lemma MMI_3coml: assumes A1: ( ϕ ∧ ψ ∧ chi ) −→ thshows ( ψ ∧ chi ∧ ϕ ) −→ thusing assms by auto
lemma MMI_sylan: assumes A1: ( ϕ ∧ ψ ) −→ chi andA2: th −→ ϕshows ( th ∧ ψ ) −→ chi
using assms by auto
lemma MMI_3impa: assumes A1: ( ( ϕ ∧ ψ ) ∧ chi ) −→ thshows ( ϕ ∧ ψ ∧ chi ) −→ thusing assms by auto
lemma MMI_3adant2: assumes A1: ( ϕ ∧ ψ ) −→ chishows ( ϕ ∧ th ∧ ψ ) −→ chi
using assms by auto
lemma MMI_3adant1: assumes A1: ( ϕ ∧ ψ ) −→ chishows ( th ∧ ϕ ∧ ψ ) −→ chi
using assms by auto
lemma (in MMIsar0) MMI_opreq12d: assumes A1: ϕ −→ A = B andA2: ϕ −→ C = D
shows
ϕ −→ ( A + C ) = ( B + D )ϕ −→ ( A · C ) = ( B · D )ϕ −→ ( A - C ) = ( B - D )ϕ −→ ( A / C ) = ( B / D )using assms by auto1041

lemma MMI_mp2an: assumes A1: ϕ andA2: ψ andA3: ( ϕ ∧ ψ ) −→ chishows chiusing assms by auto
lemma MMI_mp3an: assumes A1: ϕ andA2: ψ andA3: ch andA4: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ϑusing assms by auto
lemma MMI_eqeltrr: assumes A1: A = B and
A2: A ∈ C
shows B ∈ C
using assms by auto
lemma MMI_eqtr: assumes A1: A = B and
A2: B = Cshows A = C
using assms by auto

lemma MMI_impbi: assumes A1: ϕ −→ ψ andA2: ψ −→ ϕshows ϕ ←→ ψ
proof
assume ϕ with A1 show ψ by simp
next
assume ψ with A2 show ϕ by simp
qedlemma MMI_mp3an3: assumes A1: ch andA2: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ϕ ∧ ψ ) −→ ϑusing assms by auto
lemma MMI_eqeq12d: assumes A1: ϕ −→ A = B andA2: ϕ −→ C = D
shows ϕ −→ ( A = C ←→ B = D )using assms by auto
lemma MMI_mpan2: assumes A1: ψ andA2: ( ϕ ∧ ψ ) −→ chshows ϕ −→ chusing assms by auto1042

lemma (in MMIsar0) MMI_opreq2:shows
A = B −→ ( C + A ) = ( C + B )A = B −→ ( C · A ) = ( C · B )A = B −→ ( C - A ) = ( C - B )A = B −→ ( C / A ) = ( C / B )by autolemma MMI_syl5bir: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ −→ chshows ϕ −→ ( ϑ −→ ψ )using assms by auto
lemma MMI_adantr: assumes A1: ϕ −→ ψshows ( ϕ ∧ ch ) −→ ψusing assms by auto
lemma MMI_mpan: assumes A1: ϕ andA2: ( ϕ ∧ ψ ) −→ chshows ψ −→ chusing assms by auto
lemma MMI_eqeq1d: assumes A1: ϕ −→ A = B
shows ϕ −→ ( A = C ←→ B = C )using assms by auto
lemma (in MMIsar0) MMI_opreq1:
shows
A = B −→ ( A · C ) = ( B · C )A = B −→ ( A + C ) = ( B + C )A = B −→ ( A - C ) = ( B - C )A = B −→ ( A / C ) = ( B / C )by autolemma MMI_syl6eq: assumes A1: ϕ −→ A = B and
A2: B = Cshows ϕ −→ A = C
using assms by auto
lemma MMI_syl6bi: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ch −→ ϑshows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_imp: assumes A1: ϕ −→ ( ψ −→ ch )shows ( ϕ ∧ ψ ) −→ chusing assms by auto1043

lemma MMI_sylibd: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϕ −→ ( ch ←→ ϑ )shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_ex: assumes A1: ( ϕ ∧ ψ ) −→ chshows ϕ −→ ( ψ −→ ch )using assms by auto
lemma MMI_r19_23aiv: assumes A1: ∀ x.
shows ( ∃ x ∈ A . ϕ(x) ) −→ ψusing assms by auto(x ∈ A−→ (ϕ(x) −→ ψ ))lemma MMI_bitr: assumes A1: ϕ ←→ ψ andA2: ψ ←→ chshows ϕ ←→ chusing assms by auto
lemma MMI_eqeq12i: assumes A1: A = B and
A2: C = Dshows A = C ←→ B = D
using assms by auto
lemma MMI_dedth3h:
assumes A1: A = if ( ϕ , A , D ) −→ ( ϑ ←→ ta ) andA2: B = if ( ψ , B , R ) −→ ( ta ←→ et ) andA3: C = if ( ch , C , S ) −→ ( et ←→ ze ) andA4: zeshows ( ϕ ∧ ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_bibi1d: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ( ψ ←→ ϑ ) ←→ ( ch ←→ ϑ ) )using assms by auto
lemma MMI_eqeq1:
shows A = B −→ ( A = C ←→ B = C )by autolemma MMI_bibi12d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ϑ ←→ ta )shows ϕ −→ ( ( ψ ←→ ϑ ) ←→ ( ch ←→ ta ) )using assms by auto
lemma MMI_eqeq2d: assumes A1: ϕ −→ A = B
shows ϕ −→ ( C = A ←→ C = B )using assms by auto
lemma MMI_eqeq2:1044

shows A = B −→ ( C = A ←→ C = B )by autolemma MMI_elimel: assumes A1: B ∈ Cshows if ( A ∈ C , A , B ) ∈ Cusing assms by auto
lemma MMI_3adant3: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ϕ ∧ ψ ∧ ϑ ) −→ chusing assms by auto
lemma MMI_bitr3d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ψ ←→ ϑ )shows ϕ −→ ( ch ←→ ϑ )using assms by auto

lemma MMI_3eqtr3d: assumes A1: ϕ −→ A = B andA2: ϕ −→ A = C andA3: ϕ −→ B = D
shows ϕ −→ C = D
using assms by auto
lemma (in MMIsar0) MMI_opreq1d: assumes A1: ϕ −→ A = B
shows
ϕ −→ ( A + C ) = ( B + C )ϕ −→ ( A - C ) = ( B - C )ϕ −→ ( A · C ) = ( B · C )ϕ −→ ( A / C ) = ( B / C )using assms by auto
lemma MMI_3com12: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ψ ∧ ϕ ∧ ch ) −→ ϑusing assms by auto
lemma (in MMIsar0) MMI_opreq2d: assumes A1: ϕ −→ A = B
shows
ϕ −→ ( C + A ) = ( C + B )ϕ −→ ( C - A ) = ( C - B )ϕ −→ ( C · A ) = ( C · B )ϕ −→ ( C / A ) = ( C / B )using assms by auto
lemma MMI_3com23: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ϕ ∧ ch ∧ ψ ) −→ ϑusing assms by auto
lemma MMI_3expa: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ1045

shows ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑusing assms by auto
lemma MMI_adantrr: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ϕ ∧ ( ψ ∧ ϑ ) ) −→ chusing assms by auto
lemma MMI_3expb: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ϕ ∧ ( ψ ∧ ch ) ) −→ ϑusing assms by auto
lemma MMI_an4s: assumes A1: ( ( ϕ ∧ ψ ) ∧ ( ch ∧ ϑ ) ) −→ τshows ( ( ϕ ∧ ch ) ∧ ( ψ ∧ ϑ ) ) −→ τusing assms by auto
lemma MMI_eqtrd: assumes A1: ϕ −→ A = B andA2: ϕ −→ B = C
shows ϕ −→ A = C
using assms by auto
lemma MMI_ad2ant2l: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ( ϑ ∧ ϕ ) ∧ ( τ ∧ ψ ) ) −→ chusing assms by auto
lemma MMI_pm3_2i: assumes A1: ϕ andA2: ψshows ϕ ∧ ψusing assms by auto
lemma (in MMIsar0) MMI_opreq2i: assumes A1: A = B
shows( C + A ) = ( C + B )( C - A ) = ( C - B )( C · A ) = ( C · B )using assms by auto

lemma MMI_mpbir2an: assumes A1: ϕ ←→ ( ψ ∧ ch ) andA2: ψ andA3: chshows ϕusing assms by auto
lemma MMI_reu4: assumes A1: ∀ x y. x = y −→ ( ϕ(x) ←→ ψ(y) )shows ( ∃ ! x . x ∈ A ∧ ϕ(x) ) ←→( ( ∃ x ∈ A . ϕ(x) ) ∧ ( ∀ x ∈ A . ∀ y ∈ A .
( ( ϕ(x) ∧ ψ(y) ) −→ x = y ) ) )using assms by auto1046

lemma MMI_risset:
shows A ∈ B ←→ ( ∃ x ∈ B . x = A )by autolemma MMI_sylib: assumes A1: ϕ −→ ψ andA2: ψ ←→ chshows ϕ −→ chusing assms by auto
lemma MMI_mp3an13: assumes A1: ϕ andA2: ch andA3: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ψ −→ ϑusing assms by auto
lemma MMI_eqcomd: assumes A1: ϕ −→ A = B
shows ϕ −→ B = A
using assms by auto
lemma MMI_sylan9eqr: assumes A1: ϕ −→ A = B andA2: ψ −→ B = C
shows ( ψ ∧ ϕ ) −→ A = C
using assms by auto
lemma MMI_exp32: assumes A1: ( ϕ ∧ ( ψ ∧ ch ) ) −→ ϑshows ϕ −→ ( ψ −→ ( ch −→ ϑ ) )using assms by auto
lemma MMI_impcom: assumes A1: ϕ −→ ( ψ −→ ch )shows ( ψ ∧ ϕ ) −→ chusing assms by auto
lemma MMI_a1d: assumes A1: ϕ −→ ψshows ϕ −→ ( ch −→ ψ )using assms by auto
lemma MMI_r19_21aiv: assumes A1: ∀ x. ϕ −→ ( x ∈ A −→ ψ(x) )shows ϕ −→ ( ∀ x ∈ A . ψ(x) )using assms by auto
lemma MMI_r19_22:
shows ( ∀ x ∈ A . ( ϕ(x) −→ ψ(x) ) ) −→( ( ∃ x ∈ A . ϕ(x) ) −→ ( ∃ x ∈ A . ψ(x) ) )by autolemma MMI_syl6: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ch −→ ϑshows ϕ −→ ( ψ −→ ϑ )1047

using assms by auto
lemma MMI_mpid: assumes A1: ϕ −→ ch andA2: ϕ −→ ( ψ −→ ( ch −→ ϑ ) )shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_eqtr3t:
shows ( A = C ∧ B = C ) −→ A = B
by autolemma MMI_syl5bi: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ −→ ψshows ϕ −→ ( ϑ −→ ch )using assms by auto
lemma MMI_mp3an1: assumes A1: ϕ andA2: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_rgen2: assumes A1: ∀ x y. ( x ∈ A ∧ y ∈ A ) −→ ϕ(x,y)
shows ∀ x ∈ A . ∀ y ∈ A . ϕ(x,y)
using assms by auto

lemma MMI_ax_17: shows ϕ −→ (∀ x. ϕ) by simp

lemma MMI_3eqtr4g: assumes A1: ϕ −→ A = B and
A2: C = A andA3: D = Bshows ϕ −→ C = D
using assms by auto

lemma MMI_3imtr4: assumes A1: ϕ −→ ψ andA2: ch ←→ ϕ andA3: ϑ ←→ ψ
shows ch −→ ϑusing assms by auto

lemma MMI_eleq2i: assumes A1: A = B
shows C ∈ A ←→ C ∈ B
using assms by auto1048

lemma MMI_albii: assumes A1: ϕ ←→ ψ
shows ( ∀ x . ϕ ) ←→ ( ∀ x . ψ )using assms by auto

lemma MMI_reucl:
Sshows ( ∃ ! x . x ∈ A ∧ ϕ(x) ) −→{ x ∈ A . ϕ(x) } ∈ A
proof
assume A1: ∃ ! x . x ∈ A ∧ ϕ(x)then obtain a where I: a∈A and ϕ(a) by autowith A1 have {Sx ∈ A . ϕ(x) } = {a} by blast
with I show
{ x ∈ A . ϕ(x) } ∈ A by simp
qedlemma MMI_dedth2h: assumes A1: A = if ( ϕ , A , C ) −→ ( ch ←→ ϑ
) and
A2: B = if ( ψ , B , D ) −→ ( ϑ ←→ τ ) andA3: τshows ( ϕ ∧ ψ ) −→ chusing assms by auto
lemma MMI_eleq1d: assumes A1: ϕ −→ A = B
shows ϕ −→ ( A ∈ C ←→ B ∈ C )using assms by auto
lemma MMI_syl5eqel: assumes A1: ϕ −→ A ∈ B and
A2: C = Ashows ϕ −→ C ∈ B
using assms by auto

lemma IML_eeuni: S
assumes A1: x ∈ A and A2: ∃ ! t . t ∈ A ∧ ϕ(t)shows ϕ(x) ←→{ x ∈ A . ϕ(x) } = x
proofassume ϕ(x)S
with A1 A2 showS{ x ∈ A . ϕ(x) } = x by auto
next assume A3:{ x ∈ A . ϕ(x) } = x
from A2 obtain y where y∈A and I: ϕ(y) by autowith A2 A3 have x = y by autowith I show ϕ(x) by simp
qedlemma MMI_reuuni1:
shows ( x ∈S A ∧ ( ∃ ! x . x ∈ A ∧ ϕ(x) ) ) −→( ϕ(x) ←→{ x ∈ A . ϕ(x) } = x )using IML_eeuni by simp1049

lemma MMI_eqeq1i: assumes A1: A = B
shows A = C ←→ B = C
using assms by auto
lemma MMI_syl6rbbr: assumes A1: ∀ x. ϕ(x) −→ ( ψ(x) ←→ ch(x) ) andA2: ∀ x. ϑ(x) ←→ ch(x)shows ∀ x. ϕ(x) −→ ( ϑ(x) ←→ ψ(x) )using assms by auto

lemma MMI_syl6rbbrA: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ ←→ chshows ϕ −→ ( ϑ ←→ ψ )using assms by auto
lemma MMI_vtoclga: assumes A1: ∀ x. x = A −→ ( ϕ(x) ←→ ψ) andA2: ∀ x. x ∈ B −→ ϕ(x)shows A ∈ B −→ ψusing assms by auto

lemma MMI_3bitr4: assumes A1: ϕ ←→ ψ andA2: ch ←→ ϕ andA3: ϑ ←→ ψ
shows ch ←→ ϑ
using assms by auto
lemma MMI_mpbii: assumes Amin: ψ andAmaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ chusing assms by auto
lemma MMI_eqid:
shows A = A
by autolemma MMI_pm3_27:
shows ( ϕ ∧ ψ ) −→ ψby autolemma MMI_pm3_26:
shows ( ϕ ∧ ψ ) −→ ϕby autolemma MMI_ancoms: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ψ ∧ ϕ ) −→ chusing assms by auto1050

lemma MMI_syl3anc: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ andA2: τ −→ ϕ andA3: τ −→ ψ andA4: τ −→ chshows τ −→ ϑusing assms by auto
lemma MMI_syl5eq: assumes A1: ϕ −→ A = B and
A2: C = Ashows ϕ −→ C = B
using assms by auto
lemma MMI_eqcomi: assumes A1: A = B
shows B = A
using assms by auto
lemma MMI_3eqtr: assumes A1: A = B and
A2: B = C andA3: C = Dshows A = D
using assms by auto
lemma MMI_mpbir: assumes Amin: ψ andAmaj: ϕ ←→ ψ
shows ϕusing assms by auto
lemma MMI_syl3an3: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ andA2: τ −→ chshows ( ϕ ∧ ψ ∧ τ ) −→ ϑusing assms by auto
lemma MMI_3eqtrd: assumes A1: ϕ −→ A = B andA2: ϕ −→ B = C andA3: ϕ −→ C = D
shows ϕ −→ A = D
using assms by auto
lemma MMI_syl5: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϑ −→ ψshows ϕ −→ ( ϑ −→ ch )using assms by auto
lemma MMI_exp3a: assumes A1: ϕ −→ ( ( ψ ∧ ch ) −→ ϑ )shows ϕ −→ ( ψ −→ ( ch −→ ϑ ) )using assms by auto
lemma MMI_com12: assumes A1: ϕ −→ ( ψ −→ ch )1051

shows ψ −→ ( ϕ −→ ch )using assms by auto
lemma MMI_3imp: assumes A1: ϕ −→ ( ψ −→ ( ch −→ ϑ ) )shows ( ϕ ∧ ψ ∧ ch ) −→ ϑusing assms by auto

lemma MMI_3eqtr3: assumes A1: A = B and
A2: A = C and
A3: B = Dshows C = D
using assms by auto
lemma (in MMIsar0) MMI_opreq1i: assumes A1: A = B
shows( A + C ) = ( B + C )( A - C ) = ( B - C )( A / C ) = ( B / C )( A · C ) = ( B · C )using assms by auto
lemma MMI_eqtr3: assumes A1: A = B and
A2: A = Cshows B = C
using assms by auto
lemma MMI_dedth: assumes A1: A = if ( ϕ , A , B ) −→ ( ψ ←→ ch )andA2: chshows ϕ −→ ψusing assms by auto
lemma MMI_id:
shows ϕ −→ ϕby autolemma MMI_eqtr3d: assumes A1: ϕ −→ A = B andA2: ϕ −→ A = C
shows ϕ −→ B = C
using assms by auto
lemma MMI_sylan2: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ϑ −→ ψshows ( ϕ ∧ ϑ ) −→ chusing assms by auto
lemma MMI_adantl: assumes A1: ϕ −→ ψ1052

shows ( ch ∧ ϕ ) −→ ψusing assms by auto
lemma (in MMIsar0) MMI_opreq12:shows( A = B ∧ C = D ) −→ ( A + C ) = ( B + D )( A = B ∧ C = D ) −→ ( A - C ) = ( B - D )( A = B ∧ C = D ) −→ ( A · C ) = ( B · D )( A = B ∧ C = D ) −→ ( A / C ) = ( B / D )by autolemma MMI_anidms: assumes A1: ( ϕ ∧ ϕ ) −→ ψshows ϕ −→ ψusing assms by auto

lemma MMI_anabsan2: assumes A1: ( ϕ ∧ ( ψ ∧ ψ ) ) −→ chshows ( ϕ ∧ ψ ) −→ chusing assms by auto
lemma MMI_3simp2:
shows ( ϕ ∧ ψ ∧ ch ) −→ ψby autolemma MMI_3simp3:
shows ( ϕ ∧ ψ ∧ ch ) −→ chby autolemma MMI_sylbir: assumes A1: ψ ←→ ϕ andA2: ψ −→ chshows ϕ −→ chusing assms by auto
lemma MMI_3eqtr3g: assumes A1: ϕ −→ A = B and
A2: A = C and
A3: B = Dshows ϕ −→ C = D
using assms by auto
lemma MMI_3bitr: assumes A1: ϕ ←→ ψ andA2: ψ ←→ ch andA3: ch ←→ ϑ
shows ϕ ←→ ϑ
using assms by auto

lemma MMI_3bitr3: assumes A1: ϕ ←→ ψ and1053

A2: ϕ ←→ ch andA3: ψ ←→ ϑ
shows ch ←→ ϑ
using assms by auto
lemma MMI_eqcom:
shows A = B ←→ B = A
by autolemma MMI_syl6bb: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ch ←→ ϑ
shows ϕ −→ ( ψ ←→ ϑ )using assms by auto
lemma MMI_3bitr3d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ψ ←→ ϑ ) andA3: ϕ −→ ( ch ←→ τ )shows ϕ −→ ( ϑ ←→ τ )using assms by auto
lemma MMI_syl3an2: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ andA2: τ −→ ψshows ( ϕ ∧ τ ∧ ch ) −→ ϑusing assms by auto

lemma MMI_df_rex:
shows ( ∃ x ∈ A . ϕ(x) ) ←→ ( ∃ x . ( x ∈ A ∧ ϕ(x) ) )by autolemma MMI_mpbi: assumes Amin: ϕ andAmaj: ϕ ←→ ψ
shows ψusing assms by auto
lemma MMI_mp3an12: assumes A1: ϕ andA2: ψ andA3: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ch −→ ϑusing assms by auto
lemma MMI_syl5bb: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ ←→ ψ
shows ϕ −→ ( ϑ ←→ ch )using assms by auto
lemma MMI_eleq1a:shows A ∈ B −→ ( C = A −→ C ∈ B )1054

by auto
lemma MMI_sylbird: assumes A1: ϕ −→ ( ch ←→ ψ ) andA2: ϕ −→ ( ch −→ ϑ )shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_19_23aiv: assumes A1: ∀ x. ϕ(x) −→ ψshows ( ∃ x . ϕ(x) ) −→ ψusing assms by auto
lemma MMI_eqeltrrd: assumes A1: ϕ −→ A = B andA2: ϕ −→ A ∈ Cshows ϕ −→ B ∈ C
using assms by auto
lemma MMI_syl2an: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ϑ −→ ϕ andA3: τ −→ ψshows ( ϑ ∧ τ ) −→ chusing assms by auto

lemma MMI_adantrl: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ϕ ∧ ( ϑ ∧ ψ ) ) −→ chusing assms by auto
lemma MMI_ad2ant2r: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ( ϕ ∧ ϑ ) ∧ ( ψ ∧ τ ) ) −→ chusing assms by auto
lemma MMI_adantll: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ( ϑ ∧ ϕ ) ∧ ψ ) −→ chusing assms by auto
lemma MMI_anandirs: assumes A1: ( ( ϕ ∧ ch ) ∧ ( ψ ∧ ch ) ) −→ τshows ( ( ϕ ∧ ψ ) ∧ ch ) −→ τusing assms by auto
lemma MMI_adantlr: assumes A1: ( ϕ ∧ ψ ) −→ chshows ( ( ϕ ∧ ϑ ) ∧ ψ ) −→ chusing assms by auto
lemma MMI_an42s: assumes A1: ( ( ϕ ∧ ψ ) ∧ ( ch ∧ ϑ ) ) −→ τshows ( ( ϕ ∧ ch ) ∧ ( ϑ ∧ ψ ) ) −→ τusing assms by auto1055

lemma MMI_mp3an2: assumes A1: ψ andA2: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ϕ ∧ ch ) −→ ϑusing assms by auto

lemma MMI_3simp1:
shows ( ϕ ∧ ψ ∧ ch ) −→ ϕby autolemma MMI_3impb: assumes A1: ( ϕ ∧ ( ψ ∧ ch ) ) −→ ϑshows ( ϕ ∧ ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_mpbird: assumes Amin: ϕ −→ ch andAmaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ψusing assms by auto
lemma (in MMIsar0) MMI_opreq12i: assumes A1: A = B and
A2: C = Dshows
( A + C ) = ( B + D )( A · C ) = ( B · D )( A - C ) = ( B - D )using assms by auto
lemma MMI_3eqtr4: assumes A1: A = B and
A2: C = A andA3: D = Bshows C = D
using assms by auto

lemma MMI_eqtr4d: assumes A1: ϕ −→ A = B andA2: ϕ −→ C = B
shows ϕ −→ A = C
using assms by auto

lemma MMI_3eqtr3rd: assumes A1: ϕ −→ A = B andA2: ϕ −→ A = C andA3: ϕ −→ B = D
shows ϕ −→ D = C
using assms by auto1056

lemma MMI_sylanc: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ϑ −→ ϕ andA3: ϑ −→ ψshows ϑ −→ chusing assms by auto

lemma MMI_anim12i: assumes A1: ϕ −→ ψ andA2: ch −→ ϑshows ( ϕ ∧ ch ) −→ ( ψ ∧ ϑ )using assms by auto
lemma (in MMIsar0) MMI_opreqan12d: assumes A1: ϕ −→ A = B andA2: ψ −→ C = Dshows( ϕ ∧ ψ ) −→ ( A + C ) = ( B + D )( ϕ ∧ ψ ) −→ ( A - C ) = ( B - D )( ϕ ∧ ψ ) −→ ( A · C ) = ( B · D )using assms by auto
lemma MMI_sylanr2: assumes A1: ( ϕ ∧ ( ψ ∧ ch ) ) −→ ϑ andA2: τ −→ chshows ( ϕ ∧ ( ψ ∧ τ ) ) −→ ϑusing assms by auto
lemma MMI_sylanl2: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑ andA2: τ −→ ψshows ( ( ϕ ∧ τ ) ∧ ch ) −→ ϑusing assms by auto
lemma MMI_ancom2s: assumes A1: ( ϕ ∧ ( ψ ∧ ch ) ) −→ ϑshows ( ϕ ∧ ( ch ∧ ψ ) ) −→ ϑusing assms by auto
lemma MMI_anandis: assumes A1: ( ( ϕ ∧ ψ ) ∧ ( ϕ ∧ ch ) ) −→ τshows ( ϕ ∧ ( ψ ∧ ch ) ) −→ τusing assms by auto
lemma MMI_sylan9eq: assumes A1: ϕ −→ A = B andA2: ψ −→ B = C
shows ( ϕ ∧ ψ ) −→ A = C
using assms by auto

lemma MMI_keephyp: assumes A1: A = if ( ϕ , A , B ) −→ ( ψ ←→ ϑ )
and

1057

A2: B = if ( ϕ , A , B ) −→ ( ch ←→ ϑ ) andA3: ψ andA4: chshows ϑproof { assume ϕwith A1 A3 have ϑ by simp }moreover{ assume ¬ϕwith A2 A4 have ϑ by simp }ultimately show ϑ by autoqed
lemma MMI_eleq1:
shows A = B −→ ( A ∈ C ←→ B ∈ C )by autolemma MMI_pm4_2i:
shows ϕ −→ ( ψ ←→ ψ )by autolemma MMI_3anbi123d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ϑ ←→ τ ) andA3: ϕ −→ ( η ←→ ζ )shows ϕ −→ ( ( ψ ∧ ϑ ∧ η ) ←→ ( ch ∧ τ ∧ ζ ) )using assms by auto
lemma MMI_imbi12d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ϑ ←→ τ )shows ϕ −→ ( ( ψ −→ ϑ ) ←→ ( ch −→ τ ) )using assms by auto
lemma MMI_bitrd: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ch ←→ ϑ )shows ϕ −→ ( ψ ←→ ϑ )using assms by auto
lemma MMI_df_ne:
shows ( A 6= B ←→ ¬ ( A = B ) )by autolemma MMI_3pm3_2i: assumes A1: ϕ andA2: ψ andA3: chshows ϕ ∧ ψ ∧ chusing assms by auto
lemma MMI_eqeq2i: assumes A1: A = B
shows C = A ←→ C = B

1058

using assms by auto
lemma MMI_syl5bbr: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ψ ←→ ϑ
shows ϕ −→ ( ϑ ←→ ch )using assms by auto
lemma MMI_biimpd: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ψ −→ ch )using assms by auto
lemma MMI_orrd: assumes A1: ϕ −→ ( ¬ ( ψ ) −→ ch )shows ϕ −→ ( ψ ∨ ch )using assms by auto
lemma MMI_jaoi: assumes A1: ϕ −→ ψ andA2: ch −→ ψshows ( ϕ ∨ ch ) −→ ψusing assms by auto
lemma MMI_oridm:
shows ( ϕ ∨ ϕ ) ←→ ϕ
by autolemma MMI_orbi1d: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ( ψ ∨ ϑ ) ←→ ( ch ∨ ϑ ) )using assms by auto
lemma MMI_orbi2d: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ( ϑ ∨ ψ ) ←→ ( ϑ ∨ ch ) )using assms by auto

lemma MMI_3bitr4g: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ ←→ ψ andA3: τ ←→ chshows ϕ −→ ( ϑ ←→ τ )using assms by auto
lemma MMI_negbid: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ¬ ( ψ ) ←→ ¬ ( ch ) )using assms by auto
lemma MMI_ioran:shows ¬ ( ( ϕ ∨ ψ ) ) ←→( ¬ ( ϕ ) ∧ ¬ ( ψ ) )by auto1059

lemma MMI_syl6rbb: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ch ←→ ϑ
shows ϕ −→ ( ϑ ←→ ψ )using assms by auto
lemma MMI_anbi12i: assumes A1: ϕ ←→ ψ andA2: ch ←→ ϑ
shows ( ϕ ∧ ch ) ←→ ( ψ ∧ ϑ )using assms by auto

lemma MMI_keepel: assumes A1: A ∈ C andA2: B ∈ C
shows if ( ϕ , A , B ) ∈ Cusing assms by auto
lemma MMI_imbi2d: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ( ϑ −→ ψ ) ←→ ( ϑ −→ ch ) )using assms by auto

lemma MMI_eqeltr: assumes A = B and B ∈ Cshows A ∈ C using assms by auto

lemma MMI_3impia: assumes A1: ( ϕ ∧ ψ ) −→ ( ch −→ ϑ )shows ( ϕ ∧ ψ ∧ ch ) −→ ϑusing assms by auto

lemma MMI_eqneqd: assumes A1: ϕ −→ ( A = B ←→ C = D )shows ϕ −→ ( A 6= B ←→ C 6= D )using assms by auto
lemma MMI_3ad2ant2: assumes A1: ϕ −→ chshows ( ψ ∧ ϕ ∧ ϑ ) −→ chusing assms by auto
lemma MMI_mp3anl3: assumes A1: ch andA2: ( ( ϕ ∧ ψ ∧ ch ) ∧ ϑ ) −→ τshows ( ( ϕ ∧ ψ ) ∧ ϑ ) −→ τusing assms by auto
lemma MMI_bitr4d: assumes A1: ϕ −→ ( ψ ←→ ch ) and1060

A2: ϕ −→ ( ϑ ←→ ch )shows ϕ −→ ( ψ ←→ ϑ )using assms by auto
lemma MMI_neeq1d: assumes A1: ϕ −→ A = B
shows ϕ −→ ( A 6= C ←→ B 6= C )using assms by auto

lemma MMI_3anim123i: assumes A1: ϕ −→ ψ andA2: ch −→ ϑ andA3: τ −→ ηshows ( ϕ ∧ ch ∧ τ ) −→ ( ψ ∧ ϑ ∧ η )using assms by auto
lemma MMI_3exp: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ϕ −→ ( ψ −→ ( ch −→ ϑ ) )using assms by auto
lemma MMI_exp4a: assumes A1: ϕ −→ ( ψ −→ ( ( ch ∧ ϑ ) −→ τ ) )shows ϕ −→ ( ψ −→ ( ch −→ ( ϑ −→ τ ) ) )using assms by auto
lemma MMI_3imp1: assumes A1: ϕ −→ ( ψ −→ ( ch −→ ( ϑ −→ τ ) ) )shows ( ( ϕ ∧ ψ ∧ ch ) ∧ ϑ ) −→ τusing assms by auto
lemma MMI_anim1i: assumes A1: ϕ −→ ψshows ( ϕ ∧ ch ) −→ ( ψ ∧ ch )using assms by auto
lemma MMI_3adantl1: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑshows ( ( τ ∧ ϕ ∧ ψ ) ∧ ch ) −→ ϑusing assms by auto
lemma MMI_3adantl2: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑshows ( ( ϕ ∧ τ ∧ ψ ) ∧ ch ) −→ ϑusing assms by auto
lemma MMI_3comr: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑshows ( ch ∧ ϕ ∧ ψ ) −→ ϑusing assms by auto

lemma MMI_bitr3: assumes A1: ψ ←→ ϕ andA2: ψ ←→ ch1061

shows ϕ ←→ chusing assms by auto
lemma MMI_anbi12d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ϑ ←→ τ )shows ϕ −→ ( ( ψ ∧ ϑ ) ←→ ( ch ∧ τ ) )using assms by auto
lemma MMI_pm3_26i: assumes A1: ϕ ∧ ψshows ϕusing assms by auto
lemma MMI_pm3_27i: assumes A1: ϕ ∧ ψshows ψusing assms by auto

lemma MMI_anabsan: assumes A1: ( ( ϕ ∧ ϕ ) ∧ ψ ) −→ chshows ( ϕ ∧ ψ ) −→ chusing assms by auto
lemma MMI_3eqtr4rd: assumes A1: ϕ −→ A = B andA2: ϕ −→ C = A andA3: ϕ −→ D = B
shows ϕ −→ D = C
using assms by auto
lemma MMI_syl3an1: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ andA2: τ −→ ϕshows ( τ ∧ ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_syl3anl2: assumes A1: ( ( ϕ ∧ ψ ∧ ch ) ∧ ϑ ) −→ τ andA2: η −→ ψshows ( ( ϕ ∧ η ∧ ch ) ∧ ϑ ) −→ τusing assms by auto

lemma MMI_jca: assumes A1: ϕ −→ ψ andA2: ϕ −→ chshows ϕ −→ ( ψ ∧ ch )using assms by auto
lemma MMI_3ad2ant3: assumes A1: ϕ −→ chshows ( ψ ∧ ϑ ∧ ϕ ) −→ chusing assms by auto1062

lemma MMI_anim2i: assumes A1: ϕ −→ ψshows ( ch ∧ ϕ ) −→ ( ch ∧ ψ )using assms by auto
lemma MMI_ancom:
shows ( ϕ ∧ ψ ) ←→ ( ψ ∧ ϕ )by autolemma MMI_anbi1i: assumes Aaa: ϕ ←→ ψ
shows ( ϕ ∧ ch ) ←→ ( ψ ∧ ch )using assms by auto
lemma MMI_an42:
shows ( ( ϕ ∧ ψ ) ∧ ( ch ∧ ϑ ) ) ←→( ( ϕ ∧ ch ) ∧ ( ϑ ∧ ψ ) )by autolemma MMI_sylanb: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ϑ ←→ ϕshows ( ϑ ∧ ψ ) −→ chusing assms by auto
lemma MMI_an4:
shows ( ( ϕ ∧ ψ ) ∧ ( ch ∧ ϑ ) ) ←→( ( ϕ ∧ ch ) ∧ ( ψ ∧ ϑ ) )by autolemma MMI_syl2anb: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ϑ ←→ ϕ andA3: τ ←→ ψ
shows ( ϑ ∧ τ ) −→ chusing assms by auto
lemma MMI_eqtr2d: assumes A1: ϕ −→ A = B andA2: ϕ −→ B = C
shows ϕ −→ C = A
using assms by auto
lemma MMI_sylbid: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ch −→ ϑ )shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_sylanl1: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑ andA2: τ −→ ϕshows ( ( τ ∧ ψ ) ∧ ch ) −→ ϑusing assms by auto1063

lemma MMI_sylan2b: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ϑ ←→ ψ
shows ( ϕ ∧ ϑ ) −→ chusing assms by auto
lemma MMI_pm3_22:
shows ( ϕ ∧ ψ ) −→ ( ψ ∧ ϕ )by autolemma MMI_ancli: assumes A1: ϕ −→ ψshows ϕ −→ ( ϕ ∧ ψ )using assms by auto
lemma MMI_ad2antlr: assumes A1: ϕ −→ ψshows ( ( ch ∧ ϕ ) ∧ ϑ ) −→ ψusing assms by auto
lemma MMI_biimpa: assumes A1: ϕ −→ ( ψ ←→ ch )shows ( ϕ ∧ ψ ) −→ chusing assms by auto
lemma MMI_sylan2i: assumes A1: ϕ −→ ( ( ψ ∧ ch ) −→ ϑ ) andA2: τ −→ chshows ϕ −→ ( ( ψ ∧ τ ) −→ ϑ )using assms by auto
lemma MMI_3jca: assumes A1: ϕ −→ ψ andA2: ϕ −→ ch andA3: ϕ −→ ϑshows ϕ −→ ( ψ ∧ ch ∧ ϑ )using assms by auto
lemma MMI_com34: assumes A1: ϕ −→ ( ψ −→ ( ch −→ ( ϑ −→ τ ) ) )shows ϕ −→ ( ψ −→ ( ϑ −→ ( ch −→ τ ) ) )using assms by auto
lemma MMI_imp43: assumes A1: ϕ −→ ( ψ −→ ( ch −→ ( ϑ −→ τ ) ) )shows ( ( ϕ ∧ ψ ) ∧ ( ch ∧ ϑ ) ) −→ τusing assms by auto
lemma MMI_3anass:shows ( ϕ ∧ ψ ∧ ch ) ←→ ( ϕ ∧ ( ψ ∧ ch ) )by autolemma MMI_3eqtr4r: assumes A1: A = B and1064

A2: C = A andA3: D = Bshows D = C
using assms by auto
lemma MMI_jctl: assumes A1: ψshows ϕ −→ ( ψ ∧ ϕ )using assms by auto
lemma MMI_sylibr: assumes A1: ϕ −→ ψ andA2: ch ←→ ψ
shows ϕ −→ chusing assms by auto
lemma MMI_mpanl1: assumes A1: ϕ andA2: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑshows ( ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_a1i: assumes A1: ϕshows ψ −→ ϕusing assms by auto
lemma (in MMIsar0) MMI_opreqan12rd: assumes A1: ϕ −→ A = B andA2: ψ −→ C = Dshows( ψ ∧ ϕ ) −→ ( A + C ) = ( B + D )( ψ ∧ ϕ ) −→ ( A · C ) = ( B · D )( ψ ∧ ϕ ) −→ ( A - C ) = ( B - D )( ψ ∧ ϕ ) −→ ( A / C ) = ( B / D )using assms by auto
lemma MMI_3adantl3: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑshows ( ( ϕ ∧ ψ ∧ τ ) ∧ ch ) −→ ϑusing assms by auto
lemma MMI_sylbi: assumes A1: ϕ ←→ ψ andA2: ψ −→ chshows ϕ −→ chusing assms by auto

lemma MMI_eirr:shows ¬ ( A ∈ A )by (rule mem_not_refl)lemma MMI_eleq1i: assumes A1: A = B
shows A ∈ C ←→ B ∈ C

1065

using assms by auto
lemma MMI_mtbir: assumes A1: ¬ ( ψ ) andA2: ϕ ←→ ψ
shows ¬ ( ϕ )using assms by auto
lemma MMI_mto: assumes A1: ¬ ( ψ ) andA2: ϕ −→ ψshows ¬ ( ϕ )using assms by auto
lemma MMI_df_nel:
shows ( A ∈/ B ←→ ¬ ( A ∈ B ) )by autolemma MMI_snid: assumes A1: A isASetshows A ∈ { A }using assms by auto
lemma MMI_en2lp:
shows ¬ ( A ∈ B ∧ B ∈ A )proof
assume A1: A ∈ B ∧ B ∈ A
then have A ∈ B by simp
moreover{ assume ¬ (¬ ( A ∈ B ∧ B ∈ A ))then have B∈A by auto}
ultimately have ¬( A ∈ B ∧ B ∈ A )by (rule mem_asym)with A1 show False by simp
qedlemma MMI_imnan:shows ( ϕ −→ ¬ ( ψ ) ) ←→ ¬ ( ( ϕ ∧ ψ ) )by autolemma MMI_sseqtr4: assumes A1: A ⊆ B and
A2: C = Bshows A ⊆ C
using assms by auto
lemma MMI_ssun1:shows A ⊆ ( A ∪ B )by autolemma MMI_ibar:

1066

shows ϕ −→ ( ψ ←→ ( ϕ ∧ ψ ) )by autolemma MMI_mtbiri: assumes Amin: ¬ ( ch ) andAmaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ¬ ( ψ )using assms by auto
lemma MMI_con2i: assumes Aa: ϕ −→ ¬ ( ψ )shows ψ −→ ¬ ( ϕ )using assms by auto
lemma MMI_intnand: assumes A1: ϕ −→ ¬ ( ψ )shows ϕ −→ ¬ ( ( ch ∧ ψ ) )using assms by auto
lemma MMI_intnanrd: assumes A1: ϕ −→ ¬ ( ψ )shows ϕ −→ ¬ ( ( ψ ∧ ch ) )using assms by auto
lemma MMI_biorf:
shows ¬ ( ϕ ) −→ ( ψ ←→ ( ϕ ∨ ψ ) )by autolemma MMI_bitr2d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ch ←→ ϑ )shows ϕ −→ ( ϑ ←→ ψ )using assms by auto
lemma MMI_orass:shows ( ( ϕ ∨ ψ ) ∨ ch ) ←→ ( ϕ ∨ ( ψ ∨ ch ) )by autolemma MMI_orcom:
shows ( ϕ ∨ ψ ) ←→ ( ψ ∨ ϕ )by autolemma MMI_3bitr4d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ϑ ←→ ψ ) andA3: ϕ −→ ( τ ←→ ch )shows ϕ −→ ( ϑ ←→ τ )using assms by auto
lemma MMI_3imtr4d: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϕ −→ ( ϑ ←→ ψ ) andA3: ϕ −→ ( τ ←→ ch )1067

shows ϕ −→ ( ϑ −→ τ )using assms by auto

lemma MMI_3impdi: assumes A1: ( ( ϕ ∧ ψ ) ∧ ( ϕ ∧ ch ) ) −→ ϑshows ( ϕ ∧ ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_bi2anan9: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ −→ ( τ ←→ η )shows ( ϕ ∧ ϑ ) −→ ( ( ψ ∧ τ ) ←→ ( ch ∧ η ) )using assms by auto
lemma MMI_ssel2:
shows ( ( A ⊆ B ∧ C ∈ A ) −→ C ∈ B )by autolemma MMI_an1rs: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑshows ( ( ϕ ∧ ch ) ∧ ψ ) −→ ϑusing assms by auto

lemma MMI_ralbidva: assumes A1: ∀ x. ( ϕ ∧ x ∈ A ) −→ ( ψ(x) ←→ ch(x))
shows ϕ −→ ( ( ∀ x ∈ A . ψ(x) ) ←→ ( ∀ x ∈ A . ch(x) ) )using assms by auto
lemma MMI_rexbidva: assumes A1: ∀ x. ( ϕ ∧ x ∈ A ) −→ ( ψ(x) ←→ ch(x))
shows ϕ −→ ( ( ∃ x ∈ A . ψ(x) ) ←→ ( ∃ x ∈ A . ch(x) ) )using assms by auto
lemma MMI_con2bid: assumes A1: ϕ −→ ( ψ ←→ ¬ ( ch ) )shows ϕ −→ ( ch ←→ ¬ ( ψ ) )using assms by auto

lemma MMI_so: assumes
A1: ∀ x y z. ( x ∈ A ∧ y ∈ A ∧ z ∈ A ) −→( ( hx,yi ∈ R ←→ ¬ ( ( x = y ∨ hy, xi ∈ R ) ) ) ∧( ( hx, yi ∈ R ∧ hy, zi ∈ R ) −→ hx, zi ∈ R ) )shows R Orders A
using assms StrictOrder_def by auto

lemma MMI_con1bid: assumes A1: ϕ −→ ( ¬ ( ψ ) ←→ ch )1068

shows ϕ −→ ( ¬ ( ch ) ←→ ψ )using assms by auto
lemma MMI_sotrieq:
shows ( (R Orders A) ∧ ( B ∈ A ∧ C ∈ A ) ) −→( B = C ←→ ¬ ( ( hB,Ci ∈ R ∨ hC, Bi ∈ R ) ) )proof { assume A1: R Orders A and A2: B ∈ A ∧ C ∈ Afrom A1 have ∀ x y z. (x∈A ∧ y∈A ∧ z∈A) −→(hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R)) ∧(hx,yi ∈ R ∧ hy,zi ∈ R −→ hx,zi ∈ R)
by (unfold StrictOrder_def)then have∀ x y. x∈A ∧ y∈A −→ (hx,yi ∈ R ←→ ¬(x=y ∨ hy,xi ∈ R))
by autowith A2 have I: hB,Ci ∈ R ←→ ¬(B=C ∨ hC,Bi ∈ R)
by blast
then have B = C ←→ ¬ ( hB,Ci ∈ R ∨ hC, Bi ∈ R )by auto} then show ( (R Orders A) ∧ ( B ∈ A ∧ C ∈ A ) ) −→( B = C ←→ ¬ ( ( hB,Ci ∈ R ∨ hC, Bi ∈ R ) ) ) by simp
qedlemma MMI_bicomd: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ch ←→ ψ )using assms by auto
lemma MMI_sotrieq2:
shows ( R Orders A ∧ ( B ∈ A ∧ C ∈ A ) ) −→( B = C ←→ ( ¬ ( hB, Ci ∈ R ) ∧ ¬ ( hC, Bi ∈ R ) ) )using MMI_sotrieq by auto
lemma MMI_orc:
shows ϕ −→ ( ϕ ∨ ψ )by autolemma MMI_syl6bbr: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϑ ←→ chshows ϕ −→ ( ψ ←→ ϑ )using assms by auto

lemma MMI_orbi1i: assumes A1: ϕ ←→ ψ
shows ( ϕ ∨ ch ) ←→ ( ψ ∨ ch )using assms by auto
lemma MMI_syl5rbbr: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ψ ←→ ϑ

1069

shows ϕ −→ ( ch ←→ ϑ )using assms by auto
lemma MMI_anbi2d: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ( ϑ ∧ ψ ) ←→ ( ϑ ∧ ch ) )using assms by auto
lemma MMI_ord: assumes A1: ϕ −→ ( ψ ∨ ch )shows ϕ −→ ( ¬ ( ψ ) −→ ch )using assms by auto
lemma MMI_impbid: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϕ −→ ( ch −→ ψ )shows ϕ −→ ( ψ ←→ ch )using assms by blast
lemma MMI_jcad: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϕ −→ ( ψ −→ ϑ )shows ϕ −→ ( ψ −→ ( ch ∧ ϑ ) )using assms by auto
lemma MMI_ax_1:
shows ϕ −→ ( ψ −→ ϕ )by autolemma MMI_pm2_24:
shows ϕ −→ ( ¬ ( ϕ ) −→ ψ )by autolemma MMI_imp3a: assumes A1: ϕ −→ ( ψ −→ ( ch −→ ϑ ) )shows ϕ −→ ( ( ψ ∧ ch ) −→ ϑ )using assms by auto
lemma (in MMIsar0) MMI_breq1:
shows
A = B −→ ( A ≤ C ←→ B ≤ C )A = B −→ ( A < C ←→ B < C )by autolemma MMI_biimprd: assumes A1: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ( ch −→ ψ )using assms by auto
lemma MMI_jaod: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϕ −→ ( ϑ −→ ch )shows ϕ −→ ( ( ψ ∨ ϑ ) −→ ch )using assms by auto
lemma MMI_com23: assumes A1: ϕ −→ ( ψ −→ ( ch −→ ϑ ) )1070

shows ϕ −→ ( ch −→ ( ψ −→ ϑ ) )using assms by auto
lemma (in MMIsar0) MMI_breq2:shows
A = B −→ ( C ≤ A ←→ C ≤ B )A = B −→ ( C < A ←→ C < B )by autolemma MMI_syld: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ϕ −→ ( ch −→ ϑ )shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_biimpcd: assumes A1: ϕ −→ ( ψ ←→ ch )shows ψ −→ ( ϕ −→ ch )using assms by auto
lemma MMI_mp2and: assumes A1: ϕ −→ ψ andA2: ϕ −→ ch andA3: ϕ −→ ( ( ψ ∧ ch ) −→ ϑ )shows ϕ −→ ϑusing assms by auto

lemma MMI_sonr:shows ( R Orders A ∧ B ∈ A ) −→ ¬ ( hB,Bi ∈ R )unfolding StrictOrder_def by auto
lemma MMI_orri: assumes A1: ¬ ( ϕ ) −→ ψshows ϕ ∨ ψusing assms by auto
lemma MMI_mpbiri: assumes Amin: ch andAmaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ψusing assms by auto
lemma MMI_pm2_46:
shows ¬ ( ( ϕ ∨ ψ ) ) −→ ¬ ( ψ )by autolemma MMI_elun:shows A ∈ ( B ∪ C ) ←→ ( A ∈ B ∨ A ∈ C )by autolemma (in MMIsar0) MMI_pnfxr:
shows +∞ ∈ IR∗

1071

using cxr_def by simp
lemma MMI_elisseti: assumes A1: A ∈ Bshows A isASet
using assms by auto
lemma (in MMIsar0) MMI_mnfxr:
shows −∞ ∈ IR∗
using cxr_def by simp
lemma MMI_elpr2: assumes A1: B isASet andA2: C isASetshows A ∈ { B , C } ←→ ( A = B ∨ A = C )using assms by auto
lemma MMI_orbi2i: assumes A1: ϕ ←→ ψ
shows ( ch ∨ ϕ ) ←→ ( ch ∨ ψ )using assms by auto
lemma MMI_3orass:shows ( ϕ ∨ ψ ∨ ch ) ←→ ( ϕ ∨ ( ψ ∨ ch ) )by autolemma MMI_bitr4: assumes A1: ϕ ←→ ψ andA2: ch ←→ ψ
shows ϕ ←→ chusing assms by auto
lemma MMI_eleq2:
shows A = B −→ ( C ∈ A ←→ C ∈ B )by autolemma MMI_nelneq:
shows ( A ∈ C ∧ ¬ ( B ∈ C ) ) −→ ¬ ( A = B )by autolemma MMI_df_pr:
shows { A , B } = ( { A } ∪ { B } )by autolemma MMI_ineq2i: assumes A1: A = B
shows ( C ∩ A ) = ( C ∩ B )using assms by auto
lemma MMI_mt2: assumes A1: ψ andA2: ϕ −→ ¬ ( ψ )shows ¬ ( ϕ )1072

using assms by auto
lemma MMI_disjsn:
shows ( A ∩ { B } ) = 0 ←→ ¬ ( B ∈ A )by autolemma MMI_undisj2:
shows ( ( A ∩ B ) =0 ∧ ( A ∩ C ) =0 ) ←→ ( A ∩ ( B ∪ C ) ) = 0
by autolemma MMI_disjssun:shows ( ( A ∩ B ) =by auto0 −→ ( A ⊆ ( B ∪ C ) ←→ A ⊆ C ) )lemma MMI_uncom:
shows ( A ∪ B ) = ( B ∪ A )by autolemma MMI_sseq2i: assumes A1: A = B
shows ( C ⊆ A ←→ C ⊆ B )using assms by auto
lemma MMI_disj:
shows ( A ∩ B ) =0 ←→ ( ∀ x ∈ A . ¬ ( x ∈ B ) )by autolemma MMI_syl5ibr: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ψ ←→ ϑ
shows ϕ −→ ( ϑ −→ ch )using assms by auto
lemma MMI_con3d: assumes A1: ϕ −→ ( ψ −→ ch )shows ϕ −→ ( ¬ ( ch ) −→ ¬ ( ψ ) )using assms by auto

lemma MMI_dfrex2:
shows ( ∃ x ∈ A . ϕ(x) ) ←→by auto¬ ( ( ∀ x ∈ A . ¬ ϕ(x) ) )lemma MMI_visset:
shows x isASetby autolemma MMI_elpr: assumes A1: A isASet1073

shows A ∈ { B , C } ←→ ( A = B ∨ A = C )using assms by auto
lemma MMI_rexbii: assumes A1: ∀ x. ϕ(x) ←→ ψ(x)shows ( ∃ x ∈ A . ϕ(x) ) ←→ ( ∃ x ∈ A . ψ(x) )using assms by auto
lemma MMI_r19_43:
shows ( ∃ x ∈ A . ( ϕ(x) ∨ ψ(x) ) ) ←→( ( ∃ x ∈ A . ϕ(x) ∨ ( ∃ x ∈ A . ψ(x) ) ) )by autolemma MMI_exancom:
shows ( ∃ x . ( ϕ(x) ∧ ψ(x) ) ) ←→( ∃ x . ( ψ(x) ∧ ϕ(x) ) )by autolemma MMI_ceqsexv: assumes A1: A isASet andA2: ∀ x. x = A −→ ( ϕ(x) ←→ ψ(x) )shows ( ∃ x . ( x = A ∧ ϕ(x) ) ) ←→ ψ(A)using assms by auto
lemma MMI_orbi12i_orig: assumes A1: ϕ ←→ ψ andA2: ch ←→ ϑ
shows ( ϕ ∨ ch ) ←→ ( ψ ∨ ϑ )using assms by auto
lemma MMI_orbi12i: assumes A1: (∃ x. ϕ(x)) ←→ ψ andA2: (∃ x. ch(x)) ←→ ϑ
shows ( ∃ x. ϕ(x) ) ∨ (∃ x. ch(x) ) ←→ ( ψ ∨ ϑ )using assms by auto
lemma MMI_syl6ib: assumes A1: ϕ −→ ( ψ −→ ch ) andA2: ch ←→ ϑ
shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_intnan: assumes A1: ¬ ( ϕ )shows ¬ ( ( ψ ∧ ϕ ) )using assms by auto
lemma MMI_intnanr: assumes A1: ¬ ( ϕ )shows ¬ ( ( ϕ ∧ ψ ) )using assms by auto
lemma MMI_pm3_2ni: assumes A1: ¬ ( ϕ ) andA2: ¬ ( ψ )shows ¬ ( ( ϕ ∨ ψ ) )using assms by auto1074

lemma (in MMIsar0) MMI_breq12:shows( A = B ∧ C = D ) −→ ( A < C ←→ B < D )( A = B ∧ C = D ) −→ ( A ≤ C ←→ B ≤ D )by autolemma MMI_necom:
shows A 6= B ←→ B 6= A
by autolemma MMI_3jaoi: assumes A1: ϕ −→ ψ andA2: ch −→ ψ andA3: ϑ −→ ψshows ( ϕ ∨ ch ∨ ϑ ) −→ ψusing assms by auto
lemma MMI_jctr: assumes A1: ψshows ϕ −→ ( ϕ ∧ ψ )using assms by auto
lemma MMI_olc:
shows ϕ −→ ( ψ ∨ ϕ )by autolemma MMI_3syl: assumes A1: ϕ −→ ψ andA2: ψ −→ ch andA3: ch −→ ϑshows ϕ −→ ϑusing assms by auto

lemma MMI_mtbird: assumes Amin: ϕ −→ ¬ ( ch ) andAmaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ¬ ( ψ )using assms by auto
lemma MMI_pm2_21d: assumes A1: ϕ −→ ¬ ( ψ )shows ϕ −→ ( ψ −→ ch )using assms by auto
lemma MMI_3jaodan: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ( ϕ ∧ ϑ ) −→ ch andA3: ( ϕ ∧ τ ) −→ chshows ( ϕ ∧ ( ψ ∨ ϑ ∨ τ ) ) −→ chusing assms by auto
lemma MMI_sylan2br: assumes A1: ( ϕ ∧ ψ ) −→ ch and1075

A2: ψ ←→ ϑ
shows ( ϕ ∧ ϑ ) −→ chusing assms by auto
lemma MMI_3jaoian: assumes A1: ( ϕ ∧ ψ ) −→ ch andA2: ( ϑ ∧ ψ ) −→ ch andA3: ( τ ∧ ψ ) −→ chshows ( ( ϕ ∨ ϑ ∨ τ ) ∧ ψ ) −→ chusing assms by auto
lemma MMI_mtbid: assumes Amin: ϕ −→ ¬ ( ψ ) andAmaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ ¬ ( ch )using assms by auto
lemma MMI_con1d: assumes A1: ϕ −→ ( ¬ ( ψ ) −→ ch )shows ϕ −→ ( ¬ ( ch ) −→ ψ )using assms by auto
lemma MMI_pm2_21nd: assumes A1: ϕ −→ ψshows ϕ −→ ( ¬ ( ψ ) −→ ch )using assms by auto
lemma MMI_syl3an1b: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ andA2: τ ←→ ϕshows ( τ ∧ ψ ∧ ch ) −→ ϑusing assms by auto
lemma MMI_adantld: assumes A1: ϕ −→ ( ψ −→ ch )shows ϕ −→ ( ( ϑ ∧ ψ ) −→ ch )using assms by auto
lemma MMI_adantrd: assumes A1: ϕ −→ ( ψ −→ ch )shows ϕ −→ ( ( ψ ∧ ϑ ) −→ ch )using assms by auto
lemma MMI_anasss: assumes A1: ( ( ϕ ∧ ψ ) ∧ ch ) −→ ϑshows ( ϕ ∧ ( ψ ∧ ch ) ) −→ ϑusing assms by auto
lemma MMI_syl3an3b: assumes A1: ( ϕ ∧ ψ ∧ ch ) −→ ϑ andA2: τ ←→ chshows ( ϕ ∧ ψ ∧ τ ) −→ ϑusing assms by auto

lemma MMI_mpbid: assumes Amin: ϕ −→ ψ and1076

Amaj: ϕ −→ ( ψ ←→ ch )shows ϕ −→ chusing assms by auto
lemma MMI_orbi12d: assumes A1: ϕ −→ ( ψ ←→ ch ) andA2: ϕ −→ ( ϑ ←→ τ )shows ϕ −→ ( ( ψ ∨ ϑ ) ←→ ( ch ∨ τ ) )using assms by auto
lemma MMI_ianor:shows ¬ ( ϕ ∧ ψ ) ←→ ¬ ϕ ∨ ¬ ψ
by autolemma MMI_bitr2: assumes A1: ϕ ←→ ψ andA2: ψ ←→ chshows ch ←→ ϕusing assms by auto
lemma MMI_biimp: assumes A1: ϕ ←→ ψ
shows ϕ −→ ψusing assms by auto
lemma MMI_mpan2d: assumes A1: ϕ −→ ch andA2: ϕ −→ ( ( ψ ∧ ch ) −→ ϑ )shows ϕ −→ ( ψ −→ ϑ )using assms by auto
lemma MMI_ad2antrr: assumes A1: ϕ −→ ψshows ( ( ϕ ∧ ch ) ∧ ϑ ) −→ ψusing assms by auto
lemma MMI_biimpac: assumes A1: ϕ −→ ( ψ ←→ ch )shows ( ψ ∧ ϕ ) −→ chusing assms by auto

lemma MMI_con2bii: assumes A1: ϕ ←→ ¬ ( ψ )shows ψ ←→ ¬ ( ϕ )using assms by auto
lemma MMI_pm3_26bd: assumes A1: ϕ ←→ ( ψ ∧ ch )shows ϕ −→ ψusing assms by auto

lemma MMI_biimpr: assumes A1: ϕ ←→ ψ
shows ψ −→ ϕ1077

using assms by auto
lemma (in MMIsar0) MMI_3brtr3g: assumes A1: ϕ −→ A < B and
A2: A = C and
A3: B = Dshows ϕ −→ C < Dusing assms by auto
lemma (in MMIsar0) MMI_breq12i: assumes A1: A = B and
A2: C = Dshows
A < C ←→ B < D
A ≤ C ←→ B ≤ D
using assms by auto
lemma MMI_negbii: assumes Aa: ϕ ←→ ψ
shows ¬ϕ ←→ ¬ψusing assms by auto

lemma (in MMIsar0) MMI_breq1i: assumes A1: A = B
shows
A < C ←→ B < C
A ≤ C ←→ B ≤ C
using assms by auto

lemma MMI_syl5eqr: assumes A1: ϕ −→ A = B and
A2: A = Cshows ϕ −→ C = B
using assms by auto
lemma (in MMIsar0) MMI_breq2d: assumes A1: ϕ −→ A = B
shows
ϕ −→ C < A ←→ C < B
ϕ −→ C ≤ A ←→ C ≤ B
using assms by auto
lemma MMI_ccase: assumes A1: ϕ ∧ ψ −→ τ andA2: ch ∧ ψ −→ τ andA3: ϕ ∧ ϑ −→ τ andA4: ch ∧ ϑ −→ τshows (ϕ ∨ ch) ∧ (ψ ∨ ϑ) −→ τusing assms by auto
lemma MMI_pm3_27bd: assumes A1: ϕ ←→ ψ ∧ chshows ϕ −→ ch1078

using assms by auto
lemma MMI_nsyl3: assumes A1: ϕ −→ ¬ψ andA2: ch −→ ψshows ch −→ ¬ϕusing assms by auto
lemma MMI_jctild: assumes A1: ϕ −→ ψ −→ ch andA2: ϕ −→ ϑshows ϕ −→
ψ −→ ϑ ∧ chusing assms by auto
lemma MMI_jctird: assumes A1: ϕ −→ ψ −→ ch andA2: ϕ −→ ϑshows ϕ −→
ψ −→ ch ∧ ϑusing assms by auto
lemma MMI_ccase2: assumes A1: ϕ ∧ ψ −→ τ andA2: ch −→ τ andA3: ϑ −→ τshows (ϕ ∨ ch) ∧ (ψ ∨ ϑ) −→ τusing assms by auto

lemma MMI_3bitr3r: assumes A1: ϕ ←→ ψ andA2: ϕ ←→ ch andA3: ψ ←→ ϑ
shows ϑ ←→ chusing assms by auto
lemma (in MMIsar0) MMI_syl6breq: assumes A1: ϕ −→ A < B and
A2: B = Cshowsϕ −→ A < C
using assms by auto

lemma MMI_pm2_61i: assumes A1: ϕ −→ ψ andA2: ¬ϕ −→ ψshows ψusing assms by auto
lemma MMI_syl6req: assumes A1: ϕ −→ A = B and
A2: B = Cshows ϕ −→ C = A

1079

using assms by auto
lemma MMI_pm2_61d: assumes A1: ϕ −→ ψ −→ ch andA2: ϕ −→
¬ψ −→ chshows ϕ −→ chusing assms by auto
lemma MMI_orim1d: assumes A1: ϕ −→ ψ −→ chshows ϕ −→ψ ∨ ϑ −→ ch ∨ ϑusing assms by auto
lemma (in MMIsar0) MMI_breq1d: assumes A1: ϕ −→ A = B
shows
ϕ −→ A < C ←→ B < C
ϕ −→ A ≤ C ←→ B ≤ C
using assms by auto
lemma (in MMIsar0) MMI_breq12d: assumes A1: ϕ −→ A = B andA2: ϕ −→ C = D
shows
ϕ −→ A < C ←→ B < D
ϕ −→ A ≤ C ←→ B ≤ D
using assms by auto
lemma MMI_bibi2d: assumes A1: ϕ −→
ψ ←→ chshows ϕ −→(ϑ ←→ ψ) ←→ϑ ←→ chusing assms by auto

lemma MMI_con4bid: assumes A1: ϕ −→¬ψ ←→ ¬chshows ϕ −→
ψ ←→ chusing assms by auto
lemma MMI_3com13: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows ch ∧ ψ ∧ ϕ −→ ϑusing assms by auto
lemma MMI_3bitr3rd: assumes A1: ϕ −→
ψ ←→ ch andA2: ϕ −→
ψ ←→ ϑ and1080

A3: ϕ −→ch ←→ τshows ϕ −→
τ ←→ ϑ
using assms by auto

lemma MMI_3imtr4g: assumes A1: ϕ −→ ψ −→ ch andA2: ϑ ←→ ψ andA3: τ ←→ chshows ϕ −→
ϑ −→ τ
using assms by auto
lemma MMI_expcom: assumes A1: ϕ ∧ ψ −→ chshows ψ −→ ϕ −→ chusing assms by auto
lemma (in MMIsar0) MMI_breq2i: assumes A1: A = B
shows
C < A ←→ C < B
C ≤ A ←→ C ≤ B
using assms by auto
lemma MMI_3bitr2r: assumes A1: ϕ ←→ ψ andA2: ch ←→ ψ andA3: ch ←→ ϑ
shows ϑ ←→ ϕusing assms by auto
lemma MMI_dedth4h: assumes A1: A = if(ϕ, A, R) −→τ ←→ η and
A2: B = if(ψ, B, S) −→η ←→ ζ andA3: C = if(ch, C, F) −→ζ ←→ si and
A4: D = if(ϑ, D, G) −→ si ←→ rh andA5: rhshows (ϕ ∧ ψ) ∧ ch ∧ ϑ −→ τusing assms by auto
lemma MMI_anbi1d: assumes A1: ϕ −→
ψ ←→ chshows ϕ −→ψ ∧ ϑ ←→ ch ∧ ϑusing assms by auto1081

lemma (in MMIsar0) MMI_breqtrrd: assumes A1: ϕ −→ A < B andA2: ϕ −→ C = B
shows ϕ −→ A < C
using assms by auto

lemma MMI_syl3an: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑ andA2: τ −→ ϕ andA3: η −→ ψ andA4: ζ −→ chshows τ ∧ η ∧ ζ −→ ϑusing assms by auto
lemma MMI_3bitrd: assumes A1: ϕ −→
ψ ←→ ch andA2: ϕ −→ch ←→ ϑ andA3: ϕ −→
ϑ ←→ τ
shows ϕ −→
ψ ←→ τ
using assms by auto

lemma (in MMIsar0) MMI_breqtr: assumes A1: A < B and
A2: B = Cshows A < C
using assms by auto

lemma MMI_mpi: assumes A1: ψ andA2: ϕ −→ ψ −→ chshows ϕ −→ chusing assms by auto
lemma MMI_eqtr2: assumes A1: A = B and
A2: B = Cshows C = A
using assms by auto
lemma MMI_eqneqi: assumes A1: A = B ←→ C = D
shows A 6= B ←→ C 6= Dusing assms by auto
lemma (in MMIsar0) MMI_eqbrtrrd: assumes A1: ϕ −→ A = B and1082

A2: ϕ −→ A < C
shows ϕ −→ B < C
using assms by auto
lemma MMI_mpd: assumes A1: ϕ −→ ψ andA2: ϕ −→ ψ −→ chshows ϕ −→ chusing assms by auto
lemma MMI_mpdan: assumes A1: ϕ −→ ψ andA2: ϕ ∧ ψ −→ chshows ϕ −→ chusing assms by auto

lemma (in MMIsar0) MMI_breqtrd: assumes A1: ϕ −→ A < B andA2: ϕ −→ B = C
shows ϕ −→ A < C
using assms by auto
lemma MMI_mpand: assumes A1: ϕ −→ ψ andA2: ϕ −→
ψ ∧ ch −→ ϑshows ϕ −→ ch −→ ϑusing assms by auto
lemma MMI_imbi1d: assumes A1: ϕ −→
ψ ←→ chshows ϕ −→(ψ −→ ϑ) ←→(ch −→ ϑ)using assms by auto
lemma MMI_mtbii: assumes Amin: ¬ψ andAmaj: ϕ −→
ψ ←→ chshows ϕ −→ ¬chusing assms by auto

lemma MMI_sylan2d: assumes A1: ϕ −→ψ ∧ ch −→ ϑ andA2: ϕ −→ τ −→ chshows ϕ −→ψ ∧ τ −→ ϑusing assms by auto1083

lemma MMI_imp32: assumes A1: ϕ −→
ψ −→ ch −→ ϑshows ϕ ∧ ψ ∧ ch −→ ϑusing assms by auto
lemma (in MMIsar0) MMI_breqan12d: assumes A1: ϕ −→ A = B andA2: ψ −→ C = Dshows
ϕ ∧ ψ −→ A < C ←→ B < Dϕ ∧ ψ −→ A ≤ C ←→ B ≤ D
using assms by auto
lemma MMI_a1dd: assumes A1: ϕ −→ ψ −→ chshows ϕ −→
ψ −→ ϑ −→ chusing assms by auto
lemma (in MMIsar0) MMI_3brtr3d: assumes A1: ϕ −→ A ≤ B andA2: ϕ −→ A = C andA3: ϕ −→ B = D
shows ϕ −→ C ≤ D
using assms by auto
lemma MMI_ad2antll: assumes A1: ϕ −→ ψshows ch ∧ ϑ ∧ ϕ −→ ψusing assms by auto
lemma MMI_adantrrl: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows ϕ ∧ ψ ∧ τ ∧ ch −→ ϑusing assms by auto
lemma MMI_syl2ani: assumes A1: ϕ −→ψ ∧ ch −→ ϑ andA2: τ −→ ψ andA3: η −→ chshows ϕ −→τ ∧ η −→ ϑusing assms by auto
lemma MMI_im2anan9: assumes A1: ϕ −→ ψ −→ ch andA2: ϑ −→
τ −→ η
shows ϕ ∧ ϑ −→ψ ∧ τ −→ ch ∧ ηusing assms by auto
lemma MMI_ancomsd: assumes A1: ϕ −→ψ ∧ ch −→ ϑ1084

shows ϕ −→ch ∧ ψ −→ ϑusing assms by auto
lemma MMI_mpani: assumes A1: ψ andA2: ϕ −→
ψ ∧ ch −→ ϑshows ϕ −→ ch −→ ϑusing assms by auto
lemma MMI_syldan: assumes A1: ϕ ∧ ψ −→ ch andA2: ϕ ∧ ch −→ ϑshows ϕ ∧ ψ −→ ϑusing assms by auto
lemma MMI_mp3anl1: assumes A1: ϕ andA2: (ϕ ∧ ψ ∧ ch) ∧ ϑ −→ τshows (ψ ∧ ch) ∧ ϑ −→ τusing assms by auto
lemma MMI_3ad2ant1: assumes A1: ϕ −→ chshows ϕ ∧ ψ ∧ ϑ −→ chusing assms by auto

lemma MMI_pm3_2:
shows ϕ −→
ψ −→ ϕ ∧ ψby autolemma MMI_pm2_43i: assumes A1: ϕ −→ϕ −→ ψ
shows ϕ −→ ψusing assms by auto
lemma MMI_jctil: assumes A1: ϕ −→ ψ andA2: chshows ϕ −→ ch ∧ ψusing assms by auto
lemma MMI_mpanl12: assumes A1: ϕ andA2: ψ andA3: (ϕ ∧ ψ) ∧ ch −→ ϑshows ch −→ ϑusing assms by auto1085

lemma MMI_mpanr1: assumes A1: ψ andA2: ϕ ∧ ψ ∧ ch −→ ϑshows ϕ ∧ ch −→ ϑusing assms by auto
lemma MMI_ad2antrl: assumes A1: ϕ −→ ψshows ch ∧ ϕ ∧ ϑ −→ ψusing assms by auto
lemma MMI_3adant3r: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows ϕ ∧ ψ ∧ ch ∧ τ −→ ϑusing assms by auto
lemma MMI_3adant1l: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows (τ ∧ ϕ) ∧ ψ ∧ ch −→ ϑusing assms by auto
lemma MMI_3adant2r: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows ϕ ∧ (ψ ∧ τ ) ∧ ch −→ ϑusing assms by auto

lemma MMI_3bitr4rd: assumes A1: ϕ −→
ψ ←→ ch andA2: ϕ −→
ϑ ←→ ψ andA3: ϕ −→
τ ←→ chshows ϕ −→
τ ←→ ϑ
using assms by auto
lemma MMI_3anrev:
shows ϕ ∧ ψ ∧ ch ←→ ch ∧ ψ ∧ ϕ
by autolemma MMI_eqtr4: assumes A1: A = B and
A2: C = Bshows A = C
using assms by auto
lemma MMI_anidm:
shows ϕ ∧ ϕ ←→ ϕ
by autolemma MMI_bi2anan9r: assumes A1: ϕ −→
ψ ←→ ch andA2: ϑ −→1086τ ←→ ηshows ϑ ∧ ϕ −→ψ ∧ τ ←→ ch ∧ ηusing assms by auto
lemma MMI_3imtr3g: assumes A1: ϕ −→ ψ −→ ch andA2: ψ ←→ ϑ andA3: ch ←→ τ
shows ϕ −→
ϑ −→ τ
using assms by auto
lemma MMI_a3d: assumes A1: ϕ −→¬ψ −→ ¬chshows ϕ −→ ch −→ ψusing assms by auto
lemma MMI_sylan9bbr: assumes A1: ϕ −→
ψ ←→ ch andA2: ϑ −→ch ←→ τshows ϑ ∧ ϕ −→
ψ ←→ τ
using assms by auto
lemma MMI_sylan9bb: assumes A1: ϕ −→
ψ ←→ ch andA2: ϑ −→ch ←→ τshows ϕ ∧ ϑ −→
ψ ←→ τ
using assms by auto
lemma MMI_3bitr3g: assumes A1: ϕ −→
ψ ←→ ch andA2: ψ ←→ ϑ andA3: ch ←→ τ
shows ϕ −→
ϑ ←→ τ
using assms by auto
lemma MMI_pm5_21:
shows ¬ϕ ∧ ¬ψ −→ϕ ←→ ψ
by autolemma MMI_an6:1087

shows (ϕ ∧ ψ ∧ ch) ∧ ϑ ∧ τ ∧ η ←→(ϕ ∧ ϑ) ∧ (ψ ∧ τ ) ∧ ch ∧ ηby autolemma MMI_syl3anl1: assumes A1: (ϕ ∧ ψ ∧ ch) ∧ ϑ −→ τ andA2: η −→ ϕshows (η ∧ ψ ∧ ch) ∧ ϑ −→ τusing assms by auto
lemma MMI_imp4a: assumes A1: ϕ −→
ψ −→
ch −→
ϑ −→ τ
shows ϕ −→ψ −→ch ∧ ϑ −→ τusing assms by auto
lemma (in MMIsar0) MMI_breqan12rd: assumes A1: ϕ −→ A = B andA2: ψ −→ C = Dshowsψ ∧ ϕ −→ A < C ←→ B < Dψ ∧ ϕ −→ A ≤ C ←→ B ≤ D
using assms by auto

lemma (in MMIsar0) MMI_3brtr4d: assumes A1: ϕ −→ A < B andA2: ϕ −→ C = A andA3: ϕ −→ D = B
shows ϕ −→ C < Dusing assms by auto
lemma MMI_adantrrr: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows ϕ ∧ ψ ∧ ch ∧ τ −→ ϑusing assms by auto
lemma MMI_adantrlr: assumes A1: ϕ ∧ ψ ∧ ch −→ ϑshows ϕ ∧ (ψ ∧ τ ) ∧ ch −→ ϑusing assms by auto
lemma MMI_imdistani: assumes A1: ϕ −→ ψ −→ chshows ϕ ∧ ψ −→ ϕ ∧ chusing assms by auto
lemma MMI_anabss3: assumes A1: (ϕ ∧ ψ) ∧ ψ −→ chshows ϕ ∧ ψ −→ chusing assms by auto1088

lemma MMI_mp3anl2: assumes A1: ψ andA2: (ϕ ∧ ψ ∧ ch) ∧ ϑ −→ τshows (ϕ ∧ ch) ∧ ϑ −→ τusing assms by auto

lemma MMI_mpanl2: assumes A1: ψ andA2: (ϕ ∧ ψ) ∧ ch −→ ϑshows ϕ ∧ ch −→ ϑusing assms by auto
lemma MMI_mpancom: assumes A1: ψ −→ ϕ andA2: ϕ ∧ ψ −→ chshows ψ −→ chusing assms by auto
lemma MMI_or12:shows ϕ ∨ ψ ∨ ch ←→ ψ ∨ ϕ ∨ chby autolemma MMI_rcla4ev: assumes A1: ∀ x. x = A −→shows A ∈ B ∧ ψ −→ ( ∃ x∈B. ϕ(x) )using assms by auto

ϕ(x) ←→ ψ

lemma MMI_jctir: assumes A1: ϕ −→ ψ andA2: chshows ϕ −→ ψ ∧ chusing assms by auto
lemma MMI_iffalse:shows ¬ϕ −→ if(ϕ, A, B) = B
by autolemma MMI_iftrue:shows ϕ −→ if(ϕ, A, B) = A
by autolemma MMI_pm2_61d2: assumes A1: ϕ −→¬ψ −→ ch andA2: ψ −→ chshows ϕ −→ chusing assms by auto
lemma MMI_pm2_61dan: assumes A1: ϕ ∧ ψ −→ ch andA2: ϕ ∧ ¬ψ −→ chshows ϕ −→ chusing assms by auto1089

lemma MMI_orcanai: assumes A1: ϕ −→ ψ ∨ chshows ϕ ∧ ¬ψ −→ chusing assms by auto
lemma MMI_ifcl:
shows A ∈ C ∧ B ∈ C −→by autoif(ϕ, A, B) ∈ C

lemma MMI_imim2i: assumes A1: ϕ −→ ψshows (ch −→ ϕ) −→ ch −→ ψusing assms by auto
lemma MMI_com13: assumes A1: ϕ −→
ψ −→ ch −→ ϑshows ch −→ψ −→ϕ −→ ϑ
using assms by auto
lemma MMI_rcla4v: assumes A1: ∀ x. x = A −→shows A ∈ B −→ (∀ x∈B. ϕ(x)) −→ ψusing assms by auto

ϕ(x) ←→ ψ

lemma MMI_syl5d: assumes A1: ϕ −→
ψ −→ ch −→ ϑ andA2: ϕ −→ τ −→ chshows ϕ −→ψ −→τ −→ ϑ
using assms by auto
lemma MMI_eqcoms: assumes A1: A = B −→ ϕshows B = A −→ ϕusing assms by auto

lemma MMI_rgen: assumes A1: ∀ x. x ∈ A −→ ϕ(x)shows ∀ x∈A. ϕ(x)using assms by auto
lemma (in MMIsar0) MMI_reex:
shows IR = IR
by autolemma MMI_sstri: assumes A1: A ⊆B and
A2: B ⊆C
shows A ⊆C
using assms by auto1090

lemma MMI_ssexi: assumes A1: B = B and
A2: A ⊆B
shows A = A
using assms by auto

end

74

Complex numbers in Metamatah - introduction

theory MMI_Complex_ZF imports MMI_logic_and_sets
beginThis theory contains theorems (with proofs) about complex numbers imported from the Metamath’s set.mm database. The original Metamath
proofs were mostly written by Norman Megill, see the Metamath Proof
Explorer pages for full atribution. This theory contains about 200 theorems
from ”recnt” to ”div11t”.
lemma (in MMIsar0) MMI_recnt:
shows A ∈ IR −→ A ∈ C
proof have S1: IR ⊆ C by (rule MMI_axresscn)
from S1 show A ∈ IR −→ A ∈ C by (rule MMI_sseli)qedlemma (in MMIsar0) MMI_recn: assumes A1: A ∈ IR
shows A ∈ C
proof have S1: IR ⊆ C by (rule MMI_axresscn)
from A1 have S2: A ∈ IR.
from S1 S2 show A ∈ C by (rule MMI_sselii)qedlemma (in MMIsar0) MMI_recnd: assumes A1: ϕ −→ A ∈ IR
shows ϕ −→ A ∈ C
proof from A1 have S1: ϕ −→ A ∈ IR.
have S2: A ∈ IR −→ A ∈ C by (rule MMI_recnt)
from S1 S2 show ϕ −→ A ∈ C by (rule MMI_syl)qedlemma (in MMIsar0) MMI_elimne0:
shows if ( A 6= 0 , A , 1 ) 6= 0
proof have S1: A = if ( A 6= 0 , A , 1 ) −→1091

( A 6= 0 ←→ if ( A 6= 0 , A , 1 ) 6= 0 ) by (rule MMI_neeq1)
have S2: 1 = if ( A 6= 0 , A , 1 ) −→( 1 6= 0 ←→ if ( A 6= 0 , A , 1 ) 6= 0 ) by (rule MMI_neeq1)
have S3: 1 6= 0 by (rule MMI_ax1ne0)
from S1 S2 S3 show if ( A 6= 0 , A , 1 ) 6= 0 by (rule MMI_elimhyp)qedlemma (in MMIsar0) MMI_addex:
shows + isASet
proof have S1: C isASet by (rule MMI_axcnex)
have S2: C isASet by (rule MMI_axcnex)
from S1 S2 have S3: ( C × C ) isASet by (rule MMI_xpex)
have S4: + : ( C × C ) → C by (rule MMI_axaddopr)
have S5: ( C × C ) isASet −→( + : ( C × C ) → C −→ + isASet ) by (rule MMI_fex)
from S3 S4 S5 show + isASet by (rule MMI_mp2)
qed
lemma (in MMIsar0) MMI_mulex:
shows · isASet
proof have S1: C isASet by (rule MMI_axcnex)
have S2: C isASet by (rule MMI_axcnex)
from S1 S2 have S3: ( C × C ) isASet by (rule MMI_xpex)
have S4: · : ( C × C ) → C by (rule MMI_axmulopr)
have S5: ( C × C ) isASet −→( · : ( C × C ) → C −→ · isASet ) by (rule MMI_fex)
from S3 S4 S5 show · isASet by (rule MMI_mp2)
qed
lemma (in MMIsar0) MMI_adddirt:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) · C ) = ( ( A · C ) + ( B · C ) )proof have S1: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( C · ( A + B ) ) = ( ( C · A ) + ( C · B ) )by (rule MMI_axdistr)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( C · ( A + B ) ) = ( ( C · A ) + ( C · B ) ) by (rule MMI_3coml)have S3: ( ( A + B ) ∈ C ∧ C ∈ C ) −→( ( A + B ) · C ) = ( C · ( A + B ) ) by (rule MMI_axmulcom)
have S4: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
from S3 S4 have S5: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A + B ) · C ) = ( C · ( A + B ) ) by (rule MMI_sylan)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) · C ) = ( C · ( A + B ) ) by (rule MMI_3impa)
have S7: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) = ( C · A )by (rule MMI_axmulcom)

1092

from S7 have S8: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · C ) = ( C ·A )by (rule MMI_3adant2)
have S9: ( B ∈ C ∧ C ∈ C ) −→ ( B · C ) = ( C · B )by (rule MMI_axmulcom)
from S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( B · C ) = ( C· B )by (rule MMI_3adant1)
from S8 S10 have S11: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · C ) + ( B · C ) ) = ( ( C · A ) + ( C · B ) )by (rule MMI_opreq12d)
from S2 S6 S11 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) · C ) = ( ( A · C ) + ( B · C ) )by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_addcl: assumes A1: A ∈ C andA2: B ∈ C
shows ( A + B ) ∈ C
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
from S1 S2 S3 show ( A + B ) ∈ C by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_mulcl: assumes A1: A ∈ C andA2: B ∈ C
shows ( A · B ) ∈ C
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) ∈ C by (rule MMI_axmulcl)
from S1 S2 S3 show ( A · B ) ∈ C by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_addcom: assumes A1: A ∈ C andA2: B ∈ C
shows ( A + B ) = ( B + A )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) = ( B + A )by (rule MMI_axaddcom)
from S1 S2 S3 show ( A + B ) = ( B + A ) by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_mulcom: assumes A1: A ∈ C andA2: B ∈ C

1093

shows ( A · B ) = ( B · A )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) = ( B · A )by (rule MMI_axmulcom)
from S1 S2 S3 show ( A · B ) = ( B · A ) by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_addass: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A + B ) + C ) = ( A + ( B + C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) + C ) =( A + ( B + C ) ) by (rule MMI_axaddass)from S1 S2 S3 S4 show ( ( A + B ) + C ) =( A + ( B + C ) ) by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_mulass: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A · B ) · C ) = ( A · ( B · C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A · B ) · C ) =( A · ( B · C ) ) by (rule MMI_axmulass)from S1 S2 S3 S4 show ( ( A · B ) · C ) = ( A · ( B · C ) )by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_adddi: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A · ( B + C ) ) = ( ( A · B ) + ( A · C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · ( B + C ) ) =( ( A · B ) + ( A · C ) ) by (rule MMI_axdistr)
from S1 S2 S3 S4 show ( A · ( B + C ) ) =( ( A · B ) + ( A · C ) ) by (rule MMI_mp3an)

1094

qed
lemma (in MMIsar0) MMI_adddir: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A + B ) · C ) = ( ( A · C ) + ( B · C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) · C ) =( ( A · C ) + ( B · C ) ) by (rule MMI_adddirt)
from S1 S2 S3 S4 show ( ( A + B ) · C ) =( ( A · C ) + ( B · C ) ) by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_1cn:
shows 1 ∈ C
proof have S1: 1 ∈ IR by (rule MMI_ax1re)from S1 show 1 ∈ C by (rule MMI_recn)
qed
lemma (in MMIsar0) MMI_0cn:
shows 0 ∈ C
proof have S1: ( ( i · i ) + 1 ) = 0 by (rule MMI_axi2m1)
have S2: i ∈ C by (rule MMI_axicn)
have S3: i ∈ C by (rule MMI_axicn)
from S2 S3 have S4: ( i · i ) ∈ C by (rule MMI_mulcl)
have S5: 1 ∈ C by (rule MMI_1cn)from S4 S5 have S6: ( ( i · i ) + 1 ) ∈ C by (rule MMI_addcl)
from S1 S6 show 0 ∈ C by (rule MMI_eqeltrr)
qed
lemma (in MMIsar0) MMI_addid1: assumes A1: A ∈ Cshows ( A + 0 ) = A
proof from A1 have S1: A ∈ C.
have S2: A ∈ C −→ ( A + 0 ) = A by (rule MMI_ax0id)
from S1 S2 show ( A + 0 ) = A by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_addid2: assumes A1: A ∈ Cshows ( 0 + A ) = A
proof have S1: 0 ∈ C by (rule MMI_0cn)from A1 have S2: A ∈ C.
from S1 S2 have S3: ( 0 + A ) = ( A + 0 ) by (rule MMI_addcom)

1095

from A1 have S4: A ∈ C.
from S4 have S5: ( A + 0 ) = A by (rule MMI_addid1)
from S3 S5 show ( 0 + A ) = A by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_mulid1: assumes A1: A ∈ Cshows ( A · 1 ) = A
proof from A1 have S1: A ∈ C.
have S2: A ∈ C −→ ( A · 1 ) = A by (rule MMI_ax1id)
from S1 S2 show ( A · 1 ) = A by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_mulid2: assumes A1: A ∈ Cshows ( 1 · A ) = A
proof have S1: 1 ∈ C by (rule MMI_1cn)from A1 have S2: A ∈ C.
from S1 S2 have S3: ( 1 · A ) = ( A · 1 ) by (rule MMI_mulcom)
from A1 have S4: A ∈ C.
from S4 have S5: ( A · 1 ) = A by (rule MMI_mulid1)
from S3 S5 show ( 1 · A ) = A by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_negex: assumes A1: A ∈ Cshows ∃ x ∈ C . ( A + x ) = 0
proof from A1 have S1: A ∈ C.
have S2: A ∈ C −→ ( ∃ x ∈ C . ( A + x ) = 0 ) by (rule MMI_axnegex)
from S1 S2 show ∃ x ∈ C . ( A + x ) = 0 by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_recex: assumes A1: A ∈ C and
A2: A 6= 0
shows ∃ x ∈ C . ( A · x ) = 1
proof from A1 have S1: A ∈ C.
from A2 have S2: A 6= 0.
have S3: ( A ∈ C ∧ A 6= 0 ) −→ ( ∃ x ∈ C . ( A · x ) = 1 )by (rule MMI_axrecex)
from S1 S2 S3 show ∃ x ∈ C . ( A · x ) = 1 by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_readdcl: assumes A1: A ∈ IR and
A2: B ∈ IR
shows ( A + B ) ∈ IR

1096

proof from A1 have S1: A ∈ IR.
from A2 have S2: B ∈ IR.
have S3: ( A ∈ IR ∧ B ∈ IR ) −→ ( A + B ) ∈ IR by (rule MMI_axaddrcl)
from S1 S2 S3 show ( A + B ) ∈ IR by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_remulcl: assumes A1: A ∈ IR and
A2: B ∈ IR
shows ( A · B ) ∈ IR
proof from A1 have S1: A ∈ IR.
from A2 have S2: B ∈ IR.
have S3: ( A ∈ IR ∧ B ∈ IR ) −→ ( A · B ) ∈ IR by (rule MMI_axmulrcl)
from S1 S2 S3 show ( A · B ) ∈ IR by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_addcan: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A + B ) = ( A + C ) ←→ B = C
proof from A1 have S1: A ∈ C.
from S1 have S2: ∃ x ∈ C . ( A + x ) = 0 by (rule MMI_negex)
from A1 have S3: A ∈ C.
from A2 have S4: B ∈ C.
{ fix x
have S5: ( x ∈ C ∧ A ∈ C ∧ B ∈ C ) −→ ( ( x + A ) + B ) =( x + ( A + B ) ) by (rule MMI_axaddass)from S4 S5 have S6: ( x ∈ C ∧ A ∈ C ) −→ ( ( x + A ) + B ) =( x + ( A + B ) ) by (rule MMI_mp3an3)from A3 have S7: C ∈ C.
have S8: ( x ∈ C ∧ A ∈ C ∧ C ∈ C ) −→ ( ( x + A ) + C ) =( x + ( A + C ) ) by (rule MMI_axaddass)from S7 S8 have S9: ( x ∈ C ∧ A ∈ C ) −→ ( ( x + A ) + C ) =( x + ( A + C ) ) by (rule MMI_mp3an3)from S6 S9 have S10: ( x ∈ C ∧ A ∈ C ) −→( ( ( x + A ) + B ) = ( ( x + A ) + C ) ←→( x + ( A + B ) ) = ( x + ( A + C ) ) )by (rule MMI_eqeq12d)
from S3 S10 have S11: x ∈ C −→ ( ( ( x + A ) + B ) =( ( x + A ) + C ) ←→ ( x + ( A + B ) ) =( x + ( A + C ) ) ) by (rule MMI_mpan2)
have S12: ( A + B ) = ( A + C ) −→ ( x + ( A + B ) ) =( x + ( A + C ) ) by (rule MMI_opreq2)
from S11 S12 have S13: x ∈ C −→ ( ( A + B ) = ( A + C ) −→( ( x + A ) + B ) = ( ( x + A ) + C ) )1097

by (rule MMI_syl5bir)from S13 have S14: ( x ∈ C ∧ ( A + x ) = 0 ) −→ ( ( A + B ) =( A + C ) −→ ( ( x + A ) + B ) =( ( x + A ) + C ) ) by (rule MMI_adantr)
from A1 have S15: A ∈ C.
have S16: ( A ∈ C ∧ x ∈ C ) −→ ( A + x ) = ( x + A )by (rule MMI_axaddcom)
from S15 S16 have S17: x ∈ C −→ ( A + x ) = ( x + A )by (rule MMI_mpan)
from S17 have S18: x ∈ C −→ ( ( A + x ) = 0 ←→( x + A ) = 0 ) by (rule MMI_eqeq1d)
have S19: ( x + A ) = 0 −→ ( ( x + A ) + B ) =( 0 + B ) by (rule MMI_opreq1)
from A2 have S20: B ∈ C.
from S20 have S21: ( 0 + B ) = B by (rule MMI_addid2)
from S19 S21 have S22: ( x + A ) = 0 −→( ( x + A ) + B ) = B by (rule MMI_syl6eq)
have S23: ( x + A ) = 0 −→ ( ( x + A ) + C ) =( 0 + C ) by (rule MMI_opreq1)
from A3 have S24: C ∈ C.
from S24 have S25: ( 0 + C ) = C by (rule MMI_addid2)
from S23 S25 have S26: ( x + A ) = 0 −→( ( x + A ) + C ) = C by (rule MMI_syl6eq)
from S22 S26 have S27: ( x + A ) = 0 −→
( ( ( x + A ) + B ) = ( ( x + A ) + C ) ←→ B = C )by (rule MMI_eqeq12d)
from S18 S27 have S28: x ∈ C −→ ( ( A + x ) = 0 −→
( ( ( x + A ) + B ) = ( ( x + A ) + C ) ←→ B = C ) )by (rule MMI_syl6bi)
from S28 have S29: ( x ∈ C ∧ ( A + x ) = 0 ) −→( ( ( x + A ) + B ) = ( ( x + A ) + C ) ←→ B = C )by (rule MMI_imp)
from S14 S29 have S30: ( x ∈ C ∧ ( A + x ) = 0 ) −→( ( A + B ) = ( A + C ) −→ B = C ) by (rule MMI_sylibd)
from S30 have x ∈ C −→ ( ( A + x ) = 0 −→( ( A + B ) = ( A + C ) −→ B = C ) ) by (rule MMI_ex)} then have S31: ∀ x. (x ∈ C −→ ( ( A + x ) = 0 −→( ( A + B ) = ( A + C ) −→ B = C ) )) by autofrom S31 have S32: ( ∃ x ∈ C . ( A + x ) = 0 ) −→( ( A + B ) = ( A + C ) −→ B = C ) by (rule MMI_r19_23aiv)
from S2 S32 have S33: ( A + B ) = ( A + C ) −→ B = C
by (rule MMI_ax_mp)
have S34: B = C −→ ( A + B ) = ( A + C ) by (rule MMI_opreq2)
from S33 S34 show ( A + B ) = ( A + C ) ←→ B = C
by (rule MMI_impbi)
qedlemma (in MMIsar0) MMI_addcan2: assumes A1: A ∈ C and1098

A2: B ∈ C andA3: C ∈ C
shows ( A + C ) = ( B + C ) ←→ A = B
proof from A1 have S1: A ∈ C.
from A3 have S2: C ∈ C.
from S1 S2 have S3: ( A + C ) = ( C + A ) by (rule MMI_addcom)
from A2 have S4: B ∈ C.
from A3 have S5: C ∈ C.
from S4 S5 have S6: ( B + C ) = ( C + B ) by (rule MMI_addcom)
from S3 S6 have S7: ( A + C ) = ( B + C ) ←→( C + A ) = ( C + B ) by (rule MMI_eqeq12i)
from A3 have S8: C ∈ C.
from A1 have S9: A ∈ C.
from A2 have S10: B ∈ C.
from S8 S9 S10 have S11: ( C + A ) = ( C + B ) ←→ A = B
by (rule MMI_addcan)from S7 S11 show ( A + C ) = ( B + C ) ←→ A = B by (rule MMI_bitr)qed
lemma (in MMIsar0) MMI_addcant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) = ( A + C ) ←→ B = C )proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( A + B ) = ( if ( A ∈ C ,A , 0 ) + B ) by (rule MMI_opreq1)
have S2: A = if ( A ∈ C , A , 0 ) −→( A + C ) = ( if ( A ∈ C , A , 0 ) + C ) by (rule MMI_opreq1)
from S1 S2 have S3: A = if ( A ∈ C , A , 0 ) −→( ( A + B ) = ( A + C ) ←→( if ( A ∈ C , A , 0 ) + B ) = ( if ( A ∈ C , A , 0 ) + C ) )by (rule MMI_eqeq12d)
from S3 have S4: A = if ( A ∈ C , A , 0 ) −→( ( ( A + B ) = ( A + C ) ←→ B = C ) ←→( ( if ( A ∈ C , A , 0 ) + B ) = ( if ( A ∈ C , A , 0 ) + C )←→ B = C ) ) by (rule MMI_bibi1d)
have S5: B = if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) + B ) =( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S5 have S6: B = if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) + B ) = ( if ( A ∈ C , A , 0 ) + C )←→ ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) + C ) ) by (rule MMI_eqeq1d)
have S7: B = if ( B ∈ C , B , 0 ) −→ ( B = C ←→if ( B ∈ C , B , 0 ) = C ) by (rule MMI_eqeq1)
from S6 S7 have S8: B = if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) + B ) =( if ( A ∈ C , A , 0 ) + C ) ←→ B = C ) ←→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =1099

( if ( A ∈ C , A , 0 ) + C ) ←→ if ( B ∈ C , B , 0 ) = C ) )by (rule MMI_bibi12d)
have S9: C = if ( C ∈ C , C , 0 ) −→ ( if ( A ∈ C , A , 0 ) + C) =( if ( A ∈ C , A , 0 ) + if ( C ∈ C , C , 0 ) )by (rule MMI_opreq2)
from S9 have S10: C = if ( C ∈ C , C , 0 ) −→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) + C ) ←→( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) + if ( C ∈ C , C , 0 ) ) )by (rule MMI_eqeq2d)
have S11: C = if ( C ∈ C , C , 0 ) −→ ( if ( B ∈ C , B , 0 ) = C←→
if ( B ∈ C , B , 0 ) = if ( C ∈ C , C , 0 ) ) by (rule MMI_eqeq2)
from S10 S11 have S12: C = if ( C ∈ C , C , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) + C ) ←→ if ( B ∈ C , B , 0 ) = C ) ←→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) + if ( C ∈ C , C , 0 ) ) ←→if ( B ∈ C , B , 0 ) = if ( C ∈ C , C , 0 ) ) ) by (rule MMI_bibi12d)
have S13: 0 ∈ C by (rule MMI_0cn)from S13 have S14: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S15: 0 ∈ C by (rule MMI_0cn)from S15 have S16: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)
have S17: 0 ∈ C by (rule MMI_0cn)from S17 have S18: if ( C ∈ C , C , 0 ) ∈ C by (rule MMI_elimel)from S14 S16 S18 have S19:
( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) + if ( C ∈ C , C , 0 ) ) ←→if ( B ∈ C , B , 0 ) = if ( C ∈ C , C , 0 ) by (rule MMI_addcan)from S4 S8 S12 S19 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) = ( A + C ) ←→ B = C ) by (rule MMI_dedth3h)qedlemma (in MMIsar0) MMI_addcan2t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + C ) = ( B + C ) ←→A = B )
proof have S1: ( C ∈ C ∧ A ∈ C ) −→ ( C + A ) = ( A + C )by (rule MMI_axaddcom)
from S1 have S2: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→ ( C + A ) =( A + C ) by (rule MMI_3adant3)
have S3: ( C ∈ C ∧ B ∈ C ) −→ ( C + B ) = ( B + C )by (rule MMI_axaddcom)
from S3 have S4: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→ ( C + B ) =( B + C ) by (rule MMI_3adant2)

1100

from S2 S4 have S5: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( ( C + A ) = ( C + B ) ←→ ( A + C ) = ( B + C ) )by (rule MMI_eqeq12d)
have S6: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→ ( ( C + A ) =( C + B ) ←→ A = B ) by (rule MMI_addcant)from S5 S6 have S7: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→ ( ( A + C ) =( B + C ) ←→ A = B ) by (rule MMI_bitr3d)
from S7 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + C ) =( B + C ) ←→ A = B ) by (rule MMI_3coml)
qed

lemma (in MMIsar0) MMI_add12t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A + ( B + C ) ) =( B + ( A + C ) )proof have S1: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) = ( B + A )by (rule MMI_axaddcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) + C ) =( ( B + A ) + C ) by (rule MMI_opreq1d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + C ) = ( ( B + A ) + C )by (rule MMI_3adant3)
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) + C ) =( A + ( B + C ) ) by (rule MMI_axaddass)have S5: ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) −→ ( ( B + A ) + C ) =( B + ( A + C ) ) by (rule MMI_axaddass)from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( B + A ) + C ) = ( B + ( A + C ) ) by (rule MMI_3com12)
from S3 S4 S6 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( B + C ) ) = ( B + ( A + C ) )by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_add23t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) + C ) =( ( A + C ) + B )proof have S1: ( B ∈ C ∧ C ∈ C ) −→ ( B + C ) = ( C + B )by (rule MMI_axaddcom)
from S1 have S2: ( B ∈ C ∧ C ∈ C ) −→ ( A + ( B + C ) ) =( A + ( C + B ) ) by (rule MMI_opreq2d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( B + C ) ) = ( A + ( C + B ) )by (rule MMI_3adant1)
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) + C ) =( A + ( B + C ) ) by (rule MMI_axaddass)1101

have S5: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→ ( ( A + C ) + B ) =( A + ( C + B ) ) by (rule MMI_axaddass)from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + C ) + B ) = ( A + ( C + B ) ) by (rule MMI_3com23)
from S3 S4 S6 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + C ) = ( ( A + C ) + B )by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_add4t:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( C + D ) ) = ( ( A + C ) + ( B + D ) )proof have S1: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + C ) = ( ( A + C ) + B ) by (rule MMI_add23t)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A + B ) + C ) + D ) =( ( ( A + C ) + B ) + D ) by (rule MMI_opreq1d)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( ( A + B ) + C ) + D ) =( ( ( A + C ) + B ) + D ) by (rule MMI_3expa)
from S3 have S4: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A + B ) + C ) + D ) =( ( ( A + C ) + B ) + D ) by (rule MMI_adantrr)
have S5: ( ( A + B ) ∈ C ∧ C ∈ C ∧ D ∈ C ) −→( ( ( A + B ) + C ) + D ) =( ( A + B ) + ( C + D ) ) by (rule MMI_axaddass)from S5 have S6: ( ( A + B ) ∈ C ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A + B ) + C ) + D ) =( ( A + B ) + ( C + D ) ) by (rule MMI_3expb)
have S7: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
from S6 S7 have S8: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( ( A + B ) + C ) + D ) =( ( A + B ) + ( C + D ) ) by (rule MMI_sylan)
have S9: ( ( A + C ) ∈ C ∧ B ∈ C ∧ D ∈ C ) −→( ( ( A + C ) + B ) + D ) =( ( A + C ) + ( B + D ) ) by (rule MMI_axaddass)from S9 have S10: ( ( A + C ) ∈ C ∧ ( B ∈ C ∧ D ∈ C ) ) −→( ( ( A + C ) + B ) + D ) =( ( A + C ) + ( B + D ) ) by (rule MMI_3expb)
have S11: ( A ∈ C ∧ C ∈ C ) −→ ( A + C ) ∈ C by (rule MMI_axaddcl)
from S10 S11 have S12: ( ( A ∈ C ∧ C ∈ C ) ∧ ( B ∈ C ∧ D ∈ C )) −→( ( ( A + C ) + B ) + D ) =( ( A + C ) + ( B + D ) ) by (rule MMI_sylan)
from S12 have S13: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→1102

( ( ( A + C ) + B ) + D ) =( ( A + C ) + ( B + D ) ) by (rule MMI_an4s)
from S4 S8 S13 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( B + D ) ) by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_add42t:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( C + D ) ) = ( ( A + C ) + ( D + B ) )proof have S1: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( B + D ) ) by (rule MMI_add4t)
have S2: ( B ∈ C ∧ D ∈ C ) −→ ( B + D ) =( D + B ) by (rule MMI_axaddcom)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B + D ) = ( D + B ) by (rule MMI_ad2ant2l)from S3 have S4: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + C ) + ( B + D ) ) =( ( A + C ) + ( D + B ) ) by (rule MMI_opreq2d)
from S1 S4 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( D + B ) ) by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_add12: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A + ( B + C ) ) = ( B + ( A + C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A + ( B + C ) ) =( B + ( A + C ) ) by (rule MMI_add12t)
from S1 S2 S3 S4 show ( A + ( B + C ) ) =( B + ( A + C ) ) by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_add23: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A + B ) + C ) = ( ( A + C ) + B )proof -

1103

from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + C ) = ( ( A + C ) + B ) by (rule MMI_add23t)
from S1 S2 S3 S4 show ( ( A + B ) + C ) =( ( A + C ) + B ) by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_add4: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: D ∈ C
shows ( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( B + D ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: A ∈ C ∧ B ∈ C by (rule MMI_pm3_2i)
from A3 have S4: C ∈ C.
from A4 have S5: D ∈ C.
from S4 S5 have S6: C ∈ C ∧ D ∈ C by (rule MMI_pm3_2i)
have S7: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( B + D ) ) by (rule MMI_add4t)
from S3 S6 S7 show ( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( B + D ) ) by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_add42: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: D ∈ C
shows ( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( D + B ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
from A4 have S4: D ∈ C.
from S1 S2 S3 S4 have S5: ( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( B + D ) ) by (rule MMI_add4)
from A2 have S6: B ∈ C.
from A4 have S7: D ∈ C.
from S6 S7 have S8: ( B + D ) = ( D + B ) by (rule MMI_addcom)
from S8 have S9: ( ( A + C ) + ( B + D ) ) =( ( A + C ) + ( D + B ) ) by (rule MMI_opreq2i)
from S5 S9 show ( ( A + B ) + ( C + D ) ) =( ( A + C ) + ( D + B ) ) by (rule MMI_eqtr)

1104

qed
lemma (in MMIsar0) MMI_addid2t:
shows A ∈ C −→ ( 0 + A ) = A
proof have S1: 0 ∈ C by (rule MMI_0cn)
have S2: ( 0 ∈ C ∧ A ∈ C ) −→ ( 0 + A ) = ( A + 0 )by (rule MMI_axaddcom)
from S1 S2 have S3: A ∈ C −→ ( 0 + A ) = ( A + 0 )by (rule MMI_mpan)
have S4: A ∈ C −→ ( A + 0 ) = A by (rule MMI_ax0id)
from S3 S4 show A ∈ C −→ ( 0 + A ) = A by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_peano2cn:
shows A ∈ C −→ ( A + 1 ) ∈ C
proof have S1: 1 ∈ C by (rule MMI_1cn)
have S2: ( A ∈ C ∧ 1 ∈ C ) −→ ( A + 1 ) ∈ C by (rule MMI_axaddcl)
from S1 S2 show A ∈ C −→ ( A + 1 ) ∈ C by (rule MMI_mpan2)
qedlemma (in MMIsar0) MMI_peano2re:shows A ∈ IR −→ ( A + 1 ) ∈ IR
proof have S1: 1 ∈ IR by (rule MMI_ax1re)have S2: ( A ∈ IR ∧ 1 ∈ IR ) −→ ( A + 1 ) ∈ IR by (rule MMI_axaddrcl)
from S1 S2 show A ∈ IR −→ ( A + 1 ) ∈ IR by (rule MMI_mpan2)
qedlemma (in MMIsar0) MMI_negeu: assumes A1: A ∈ C andA2: B ∈ C
shows ∃ ! x . x ∈ C ∧ ( A + x ) = B
proof { fix x yhave S1: x = y −→ ( A + x ) = ( A + y ) by (rule MMI_opreq2)
from S1 have x = y −→ ( ( A + x ) = B ←→ ( A + y ) = B )by (rule MMI_eqeq1d)} then have S2: ∀ x y. x = y −→ ( ( A + x ) = B ←→( A + y ) = B ) by simp
from S2 have S3: ( ∃ ! x . x ∈ C ∧ ( A + x ) = B ) ←→( ( ∃ x ∈ C . ( A + x ) = B ) ∧( ∀ x ∈ C . ∀ y ∈ C . ( ( ( A + x ) = B ∧ ( A + y ) = B ) −→x = y ) ) ) by (rule MMI_reu4)
from A1 have S4: A ∈ C.
from S4 have S5: ∃ y ∈ C . ( A + y ) = 0 by (rule MMI_negex)1105

from A2 have S6: B ∈ C.
{ fix yhave S7: ( y ∈ C ∧ B ∈ C ) −→ ( y + B ) ∈ C by (rule MMI_axaddcl)
from S6 S7 have S8: y ∈ C −→ ( y + B ) ∈ C by (rule MMI_mpan2)
have S9: ( y + B ) ∈ C ←→ ( ∃ x ∈ C . x = ( y + B ) )by (rule MMI_risset)
from S8 S9 have S10: y ∈ C −→ ( ∃ x ∈ C . x = ( y + B ) )by (rule MMI_sylib){ fix x
have S11: x = ( y + B ) −→ ( A + x ) =( A + ( y + B ) ) by (rule MMI_opreq2)
from A1 have S12: A ∈ C.
from A2 have S13: B ∈ C.
have S14: ( A ∈ C ∧ y ∈ C ∧ B ∈ C ) −→( ( A + y ) + B ) = ( A + ( y + B ) )by (rule MMI_axaddass)from S12 S13 S14 have S15: y ∈ C −→ ( ( A + y ) + B ) =( A + ( y + B ) ) by (rule MMI_mp3an13)
from S15 have S16: y ∈ C −→ ( A + ( y + B ) ) =( ( A + y ) + B ) by (rule MMI_eqcomd)from S11 S16 have S17: ( y ∈ C ∧ x = ( y + B ) )−→ ( A + x ) = ( ( A + y ) + B ) by (rule MMI_sylan9eqr)
have S18: ( A + y ) = 0 −→( ( A + y ) + B ) = ( 0 + B ) by (rule MMI_opreq1)
from A2 have S19: B ∈ C.
from S19 have S20: ( 0 + B ) = B by (rule MMI_addid2)
from S18 S20 have S21: ( A + y ) = 0 −→( ( A + y ) + B ) = B by (rule MMI_syl6eq)
from S17 S21 have S22: ( ( A + y ) = 0 ∧ ( y ∈ C ∧ x =( y + B ) ) ) −→ ( A + x ) = B by (rule MMI_sylan9eqr)
from S22 have S23: ( A + y ) = 0 −→( y ∈ C −→ ( x = ( y + B ) −→ ( A + x ) = B ) )by (rule MMI_exp32)
from S23 have S24: ( y ∈ C ∧ ( A + y ) = 0 ) −→( x = ( y + B ) −→ ( A + x ) = B ) by (rule MMI_impcom)
from S24 have ( y ∈ C ∧ ( A + y ) = 0 ) −→( x ∈ C −→ ( x = ( y + B ) −→ ( A + x ) = B ) )by (rule MMI_a1d)} then have S25: ∀ x. ( y ∈ C ∧ ( A + y ) = 0 ) −→( x ∈ C −→ ( x = ( y + B ) −→ ( A + x ) = B ) ) by autofrom S25 have S26: ( y ∈ C ∧ ( A + y ) = 0 ) −→( ∀ x ∈ C . ( x = ( y + B ) −→ ( A + x ) = B ) )by (rule MMI_r19_21aiv)
from S26 have S27: y ∈ C −→ ( ( A + y ) = 0 −→( ∀ x ∈ C . ( x = ( y + B ) −→ ( A + x ) = B ) ) )by (rule MMI_ex)
have S28: ( ∀ x ∈ C . ( x = ( y + B ) −→ ( A + x ) = B ) )−→ ( ( ∃ x ∈ C . x = ( y + B ) ) −→( ∃ x ∈ C . ( A + x ) = B ) ) by (rule MMI_r19_22)

1106

from S27 S28 have S29: y ∈ C −→ ( ( A + y ) = 0 −→( ( ∃ x ∈ C . x = ( y + B ) ) −→( ∃ x ∈ C . ( A + x ) = B ) ) ) by (rule MMI_syl6)
from S10 S29 have y ∈ C −→ ( ( A + y ) = 0 −→( ∃ x ∈ C . ( A + x ) = B ) ) by (rule MMI_mpid)} then have S30: ∀ y. y ∈ C −→ ( ( A + y ) = 0 −→( ∃ x ∈ C . ( A + x ) = B ) ) by simp
from S30 have S31: ( ∃ y ∈ C . ( A + y ) = 0 ) −→( ∃ x ∈ C . ( A + x ) = B ) by (rule MMI_r19_23aiv)
from S5 S31 have S32: ∃ x ∈ C . ( A + x ) = B by (rule MMI_ax_mp)
from A1 have S33: A ∈ C.
{ fix x y
have S34: ( A ∈ C ∧ x ∈ C ∧ y ∈ C ) −→( ( A + x ) = ( A + y ) ←→ x = y ) by (rule MMI_addcant)have S35: ( ( A + x ) = B ∧ ( A + y ) = B ) −→( A + x ) = ( A + y ) by (rule MMI_eqtr3t)
from S34 S35 have S36: ( A ∈ C ∧ x ∈ C ∧ y ∈ C ) −→( ( ( A + x ) = B ∧ ( A + y ) = B ) −→ x = y )by (rule MMI_syl5bi)
from S33 S36 have ( x ∈ C ∧ y ∈ C ) −→( ( ( A + x ) = B ∧ ( A + y ) = B ) −→ x = y )by (rule MMI_mp3an1)} then have S37: ∀ x y . ( x ∈ C ∧ y ∈ C ) −→( ( ( A + x ) = B ∧ ( A + y ) = B ) −→ x = y ) by autofrom S37 have S38: ∀ x ∈ C . ∀ y ∈ C . ( ( ( A + x ) = B ∧( A + y ) = B ) −→ x = y ) by (rule MMI_rgen2)
from S3 S32 S38 show ∃ ! x . x ∈ C ∧ ( A + x ) = B
by (rule MMI_mpbir2an)qedlemma (in MMIsar0)
S MMI_subval: assumes A ∈ Cshows A - B ={ x ∈ C . B + x = A }using sub_def by simp

B ∈ C

lemma (in MMIsar0) MMI_df_neg: shows (- A) = 0 - A
using cneg_def by simp

lemma (in MMIsar0) MMI_negeq:
shows A = B −→ (-A) = (- B)
proof have S1: A = B −→ ( 0 - A ) = ( 0 - B ) by (rule MMI_opreq2)
have S2: (-A) = ( 0 - A ) by (rule MMI_df_neg)
have S3: (-B) = ( 0 - B ) by (rule MMI_df_neg)1107

from S1 S2 S3 show A = B −→ (-A) = (-B) by (rule MMI_3eqtr4g)
qed
lemma (in MMIsar0) MMI_negeqi: assumes A1: A = B
shows (- A) = (-B)
proof from A1 have S1: A = B.
have S2: A = B −→ (-A) = (-B) by (rule MMI_negeq)
from S1 S2 show (-A) = (-B) by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_negeqd: assumes A1: ϕ −→ A = B
shows ϕ −→ (-A) = (-B)
proof from A1 have S1: ϕ −→ A = B.
have S2: A = B −→ (-A) = (-B) by (rule MMI_negeq)
from S1 S2 show ϕ −→ (-A) = (-B) by (rule MMI_syl)qedlemma (in MMIsar0) MMI_hbneg: assumes A1: y ∈ A −→ ( ∀ x . y ∈ A )shows y ∈ ((- A)) −→ ( ∀ x . (y ∈ ((using assms by autoA)) ) )

lemma (in MMIsar0) MMI_minusex:
shows ((- A)) isASet by auto

lemma (in MMIsar0) MMI_subcl: assumes A1: A ∈ C andA2: B ∈ C
shows ( A - B ) ∈ C
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
Sfrom S1 S2 have S3: ( A - B ) ={ x ∈ C . ( B + x ) = A }by (rule MMI_subval)
from A2 have S4: B ∈ C.
from A1 have S5: A ∈ C.
from S4 S5 have S6: ∃ ! x . x ∈ C ∧ ( B + x ) = A by (rule MMI_negeu)
have
S S7: ( ∃ ! x . x ∈ C ∧ ( B + x ) = A ) −→{ x ∈ C . ( B + Sx ) = A } ∈ C by (rule MMI_reucl)
from S6 S7 have S8:{ x ∈ C . ( B + x ) = A } ∈ C
by (rule MMI_ax_mp)
from S3 S8 show ( A - B ) ∈ C by simp
qed

1108

lemma (in MMIsar0) MMI_subclt:
shows ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C
proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( A - B ) =( if ( A ∈ C , A , 0 ) - B ) by (rule MMI_opreq1)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→ ( ( A - B ) ∈ C ←→( if ( A ∈ C , A , 0 ) - B ) ∈ C ) by (rule MMI_eleq1d)
have S3: B = if ( B ∈ C , B , 0 ) −→ ( if ( A ∈ C , A , 0 ) - B) =( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S3 have S4: B = if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) - B ) ∈ C ←→( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) ∈ C )by (rule MMI_eleq1d)
have S5: 0 ∈ C by (rule MMI_0cn)from S5 have S6: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S7: 0 ∈ C by (rule MMI_0cn)from S7 have S8: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S6 S8 have S9:( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) ∈ C
by (rule MMI_subcl)
from S2 S4 S9 show ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C
by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_negclt:
shows A ∈ C −→ ( (- A) ) ∈ C
proof have S1: 0 ∈ C by (rule MMI_0cn)
have S2: ( 0 ∈ C ∧ A ∈ C ) −→ ( 0 - A ) ∈ C by (rule MMI_subclt)
from S1 S2 have S3: A ∈ C −→ ( 0 - A ) ∈ C by (rule MMI_mpan)
have S4: ( (- A) ) = ( 0 - A ) by (rule MMI_df_neg)
from S3 S4 show A ∈ C −→ ( (- A) ) ∈ C by (rule MMI_syl5eqel)qedlemma (in MMIsar0) MMI_negcl: assumes A1: A ∈ Cshows ( (- A) ) ∈ C
proof from A1 have S1: A ∈ C.
have S2: A ∈ C −→ ( (- A) ) ∈ C by (rule MMI_negclt)
from S1 S2 show ( (- A) ) ∈ C by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_subadd: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A - B ) = C ←→ ( B + C ) = A
proof -

1109

from A3 have S1: C ∈ C.
{ fix x
have S2: x = C −→ ( ( A - B ) = x ←→ ( A - B ) = C )by (rule MMI_eqeq2)
have S3: x = C −→ ( B + x ) = ( B + C ) by (rule MMI_opreq2)
from S3 have S4: x = C −→ ( ( B + x ) = A ←→ ( B + C ) = A )by (rule MMI_eqeq1d)
from S2 S4 have x = C −→ ( ( ( A - B ) = x ←→( B + x ) = A ) ←→ ( ( A - B ) = C ←→ ( B + C ) = A ) )by (rule MMI_bibi12d)} then have S5: ∀ x. x = C −→ ( ( ( A - B ) = x ←→( B + x ) = A ) ←→ ( ( A - B ) = C ←→( B + C ) = A ) ) by simp
from A2 have S6: B ∈ C.
from A1 have S7: A ∈ C.
from S6 S7 have S8: ∃ ! x . x ∈ C ∧ ( B + x ) = A by (rule MMI_negeu){ fix x
have S9: ( x ∈ C ∧ ( ∃ !Sx . x ∈ C ∧ ( B + x ) = A ) −→( ( B + x ) = A ) ←→{ x ∈ C . ( B + x ) = A } = x )by (rule MMI_reuuni1)
from
S S8 S9 have x ∈ C −→ ( ( B + x ) = A ←→{ x ∈ C . ( B + x ) = A } = x ) by (rule MMI_mpan2)} thenS have S10: ∀ x. x ∈ C −→ ( ( B + x ) = A ←→{ x ∈ C . ( B + x ) = A } = x ) by blastfrom A1 have S11: A ∈ C.
from A2 have S12: B ∈ C.
Sfrom S11 S12 have S13: ( A - B ) ={ x ∈ C . ( B + x ) = A }by (rule MMI_subval)
from
S S13 have S14: ∀ x. ( A - B ) = x ←→{ x ∈ C . ( B + x ) = A } = x by simp
from S10 S14 have S15: ∀ x. x ∈ C −→ ( ( A - B ) = x ←→( B + x ) = A ) by (rule MMI_syl6rbbr)
from S5 S15 have S16: C ∈ C −→ ( ( A - B ) = C ←→( B + C ) = A ) by (rule MMI_vtoclga)from S1 S16 show ( A - B ) = C ←→ ( B + C ) = A
by (rule MMI_ax_mp)
qed

lemma (in MMIsar0) MMI_subsub23: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A - B ) = C ←→ ( A - C ) = B
proof from A2 have S1: B ∈ C.
from A3 have S2: C ∈ C.
from S1 S2 have S3: ( B + C ) = ( C + B ) by (rule MMI_addcom)

1110

from S3 have S4: ( B + C ) = A ←→ ( C + B ) = A
by (rule MMI_eqeq1i)
from A1 have S5: A ∈ C.
from A2 have S6: B ∈ C.
from A3 have S7: C ∈ C.
from S5 S6 S7 have S8: ( A - B ) = C ←→ ( B + C ) = A
by (rule MMI_subadd)
from A1 have S9: A ∈ C.
from A3 have S10: C ∈ C.
from A2 have S11: B ∈ C.
from S9 S10 S11 have S12: ( A - C ) = B ←→ ( C + B ) = A
by (rule MMI_subadd)
from S4 S8 S12 show ( A - B ) = C ←→ ( A - C ) = B
by (rule MMI_3bitr4)
qed
lemma (in MMIsar0) MMI_subaddt:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A - B ) = C ←→( B + C ) = A )proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( A - B ) =( if ( A ∈ C , A , 0 ) - B ) by (rule MMI_opreq1)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→ ( ( A - B ) = C ←→( if ( A ∈ C , A , 0 ) - B ) = C ) by (rule MMI_eqeq1d)
have S3: A = if ( A ∈ C , A , 0 ) −→ ( ( B + C ) = A ←→( B + C ) = if ( A ∈ C , A , 0 ) ) by (rule MMI_eqeq2)
from S2 S3 have S4: A = if ( A ∈ C , A , 0 ) −→( ( ( A - B ) = C ←→ ( B + C ) = A ) ←→( ( if ( A ∈ C , A , 0 ) - B ) = C ←→ ( B + C ) =if ( A ∈ C , A , 0 ) ) ) by (rule MMI_bibi12d)
have S5: B = if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) - B ) =( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S5 have S6: B = if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) - B ) = C ←→( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = C )by (rule MMI_eqeq1d)
have S7: B = if ( B ∈ C , B , 0 ) −→ ( B + C ) =( if ( B ∈ C , B , 0 ) + C ) by (rule MMI_opreq1)
from S7 have S8: B = if ( B ∈ C , B , 0 ) −→( ( B + C ) = if ( A ∈ C , A , 0 ) ←→( if ( B ∈ C , B , 0 ) + C ) = if ( A ∈ C , A , 0 ) )by (rule MMI_eqeq1d)
from S6 S8 have S9: B = if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) - B ) = C ←→( B + C ) = if ( A ∈ C , A , 0 ) ) ←→( ( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = C ←→( if ( B ∈ C , B , 0 ) + C ) = if ( A ∈ C , A , 0 ) ) )1111

by (rule MMI_bibi12d)
have S10: C = if ( C ∈ C , C , 0 ) −→( ( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = C ←→( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ) by (rule MMI_eqeq2)
have S11: C = if ( C ∈ C , C , 0 ) −→( if ( B ∈ C , B , 0 ) + C ) =( if ( B ∈ C , B , 0 ) + if ( C ∈ C , C , 0 ) ) by (rule MMI_opreq2)
from S11 have S12: C = if ( C ∈ C , C , 0 ) −→( ( if ( B ∈ C , B , 0 ) + C ) = if ( A ∈ C , A , 0 ) ←→( if ( B ∈ C , B , 0 ) + if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) ) by (rule MMI_eqeq1d)
from S10 S12 have S13: C = if ( C ∈ C , C , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = C ←→( if ( B ∈ C , B , 0 ) + C ) = if ( A ∈ C , A , 0 ) ) ←→( ( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ←→( if ( B ∈ C , B , 0 ) + if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) ) ) by (rule MMI_bibi12d)
have S14: 0 ∈ C by (rule MMI_0cn)from S14 have S15: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S16: 0 ∈ C by (rule MMI_0cn)from S16 have S17: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)
have S18: 0 ∈ C by (rule MMI_0cn)from S18 have S19: if ( C ∈ C , C , 0 ) ∈ C by (rule MMI_elimel)from S15 S17 S19 have S20:
( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ←→( if ( B ∈ C , B , 0 ) + if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) by (rule MMI_subadd)
from S4 S9 S13 S20 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) = C ←→ ( B + C ) = A ) by (rule MMI_dedth3h)qedlemma (in MMIsar0) MMI_pncan3t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( A + ( B - A ) ) = B
proof have S1: ( B - A ) = ( B - A ) by (rule MMI_eqid)
have S2: ( B ∈ C ∧ A ∈ C ∧ ( B - A ) ∈ C ) −→( ( B - A ) = ( B - A ) ←→ ( A + ( B - A ) ) = B )by (rule MMI_subaddt)
have S3: ( A ∈ C ∧ B ∈ C ) −→ B ∈ C by (rule MMI_pm3_27)
have S4: ( A ∈ C ∧ B ∈ C ) −→ A ∈ C by (rule MMI_pm3_26)
have S5: ( B ∈ C ∧ A ∈ C ) −→ ( B - A ) ∈ C by (rule MMI_subclt)
from S5 have S6: ( A ∈ C ∧ B ∈ C ) −→ ( B - A ) ∈ C
by (rule MMI_ancoms)
from S2 S3 S4 S6 have S7: ( A ∈ C ∧ B ∈ C ) −→ ( ( B - A ) =( B - A ) ←→ ( A + ( B - A ) ) = B ) by (rule MMI_syl3anc)
from S1 S7 show ( A ∈ C ∧ B ∈ C ) −→ ( A + ( B - A ) ) = B

1112

by (rule MMI_mpbii)
qed
lemma (in MMIsar0) MMI_pncan3: assumes A1: A ∈ C andA2: B ∈ C
shows ( A + ( B - A ) ) = B
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A + ( B - A ) ) = B
by (rule MMI_pncan3t)
from S1 S2 S3 show ( A + ( B - A ) ) = B by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_negidt:
shows A ∈ C −→ ( A + ( (- A) ) ) = 0
proof have S1: 0 ∈ C by (rule MMI_0cn)
have S2: ( A ∈ C ∧ 0 ∈ C ) −→ ( A + ( 0 - A ) ) = 0
by (rule MMI_pncan3t)
from S1 S2 have S3: A ∈ C −→ ( A + ( 0 - A ) ) = 0
by (rule MMI_mpan2)
have S4: ( (- A) ) = ( 0 - A ) by (rule MMI_df_neg)
from S4 have S5: ( A + ( (- A) ) ) = ( A + ( 0 - A ) )by (rule MMI_opreq2i)
from S3 S5 show A ∈ C −→ ( A + ( (- A) ) ) = 0 by (rule MMI_syl5eq)
qed
lemma (in MMIsar0) MMI_negid: assumes A1: A ∈ Cshows ( A + ( (- A) ) ) = 0
proof from A1 have S1: A ∈ C.
have S2: A ∈ C −→ ( A + ( (- A) ) ) = 0 by (rule MMI_negidt)
from S1 S2 show ( A + ( (- A) ) ) = 0 by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_negsub: assumes A1: A ∈ C andA2: B ∈ C
shows ( A + ( (- B) ) ) = ( A - B )proof from A2 have S1: B ∈ C.
from A1 have S2: A ∈ C.
from A2 have S3: B ∈ C.
from S3 have S4: ( (- B) ) ∈ C by (rule MMI_negcl)
from S2 S4 have S5: ( A + ( (- B) ) ) ∈ C by (rule MMI_addcl)
from S1 S5 have S6: ( B + ( A + ( (- B) ) ) ) =( ( A + ( (- B) ) ) + B ) by (rule MMI_addcom)
from A1 have S7: A ∈ C.
from S4 have S8: ( (- B) ) ∈ C .

1113

from A2 have S9: B ∈ C.
from S7 S8 S9 have S10: ( ( A + ( (- B) ) ) + B ) =( A + ( ( (- B) ) + B ) ) by (rule MMI_addass)from S4 have S11: ( (- B) ) ∈ C .
from A2 have S12: B ∈ C.
from S11 S12 have S13: ( ( (- B) ) + B ) = ( B + ( (- B) ) )by (rule MMI_addcom)
from A2 have S14: B ∈ C.
from S14 have S15: ( B + ( (- B) ) ) = 0 by (rule MMI_negid)
from S13 S15 have S16: ( ( (- B) ) + B ) = 0 by (rule MMI_eqtr)
from S16 have S17: ( A + ( ( (- B) ) + B ) ) = ( A + 0 )by (rule MMI_opreq2i)
from A1 have S18: A ∈ C.
from S18 have S19: ( A + 0 ) = A by (rule MMI_addid1)
from S10 S17 S19 have S20: ( ( A + ( (- B) ) ) + B ) = A
by (rule MMI_3eqtr)
from S6 S20 have S21: ( B + ( A + ( (- B) ) ) ) = A
by (rule MMI_eqtr)
from A1 have S22: A ∈ C.
from A2 have S23: B ∈ C.
from S5 have S24: ( A + ( (- B) ) ) ∈ C .
from S22 S23 S24 have S25: ( A - B ) = ( A + ( (- B) ) ) ←→( B + ( A + ( (- B) ) ) ) = A by (rule MMI_subadd)
from S21 S25 have S26: ( A - B ) = ( A + ( (- B) ) )by (rule MMI_mpbir)from S26 show ( A + ( (- B) ) ) = ( A - B ) by (rule MMI_eqcomi)qedlemma (in MMIsar0) MMI_negsubt:
shows ( A ∈ C ∧ B ∈ C ) −→ ( A + ( (- B) ) ) = ( A - B )proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( A + ( (- B) ) ) =( if ( A ∈ C , A , 0 ) + ( (- B) ) ) by (rule MMI_opreq1)
have S2: A = if ( A ∈ C , A , 0 ) −→ ( A - B ) =( if ( A ∈ C , A , 0 ) - B ) by (rule MMI_opreq1)
from S1 S2 have S3: A = if ( A ∈ C , A , 0 ) −→( ( A + ( (- B) ) ) = ( A - B ) ←→( if ( A ∈ C , A , 0 ) + ( (- B) ) ) =( if ( A ∈ C , A , 0 ) - B ) ) by (rule MMI_eqeq12d)
have S4: B = if ( B ∈ C , B , 0 ) −→( (- B) ) = ( - if ( B ∈ C , B , 0 ) ) by (rule MMI_negeq)
from S4 have S5: B = if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) + ( (- B) ) ) =( if ( A ∈ C , A , 0 ) + ( - if ( B ∈ C , B , 0 ) ) )by (rule MMI_opreq2d)
have S6: B = if ( B ∈ C , B , 0 ) −→ ( if ( A ∈ C , A , 0 ) - B) =( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) )by (rule MMI_opreq2)1114

from S5 S6 have S7: B = if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) + ( (- B) ) ) =( if ( A ∈ C , A , 0 ) - B ) ←→( if ( A ∈ C , A , 0 ) + ( - if ( B ∈ C , B , 0 ) ) ) =( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) )by (rule MMI_eqeq12d)
have S8: 0 ∈ C by (rule MMI_0cn)from S8 have S9: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S10: 0 ∈ C by (rule MMI_0cn)from S10 have S11: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S9 S11 have S12:
( if ( A ∈ C , A , 0 ) + ( - if ( B ∈ C , B , 0 ) ) ) =( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) )by (rule MMI_negsub)
from S3 S7 S12 show ( A ∈ C ∧ B ∈ C ) −→ ( A + ( (- B) ) ) =( A - B ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_addsubasst:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) - C ) =( A + ( B - C ) )proof have S1: ( A ∈ C ∧ B ∈ C ∧ ( - C ) ∈ C ) −→( ( A + B ) + ( - C ) ) =( A + ( B + ( - C ) ) ) by (rule MMI_axaddass)have S2: C ∈ C −→ ( - C ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + ( - C ) ) =( A + ( B + ( - C ) ) ) by (rule MMI_syl3an3)
have S4: ( ( A + B ) ∈ C ∧ C ∈ C ) −→( ( A + B ) + ( - C ) ) = ( ( A + B ) - C )by (rule MMI_negsubt)
have S5: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
from S4 S5 have S6: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A + B ) + ( - C ) ) = ( ( A + B ) - C )by (rule MMI_sylan)
from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + ( - C ) ) = ( ( A + B ) - C )by (rule MMI_3impa)
have S8: ( B ∈ C ∧ C ∈ C ) −→ ( B + ( - C ) ) = ( B - C )by (rule MMI_negsubt)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B + ( - C ) ) = ( B - C ) by (rule MMI_3adant1)
from S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( B + ( - C ) ) ) = ( A + ( B - C ) )by (rule MMI_opreq2d)
from S3 S7 S10 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - C ) = ( A + ( B - C ) )by (rule MMI_3eqtr3d)

1115

qed
lemma (in MMIsar0) MMI_addsubt:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) - C ) =( ( A - C ) + B )proof have S1: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) = ( B + A )by (rule MMI_axaddcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - C ) =( ( B + A ) - C ) by (rule MMI_opreq1d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - C ) = ( ( B + A ) - C )by (rule MMI_3adant3)
have S4: ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) −→ ( ( B + A ) - C ) =( B + ( A - C ) ) by (rule MMI_addsubasst)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( B + A ) - C ) = ( B + ( A - C ) ) by (rule MMI_3com12)
have S6: ( B ∈ C ∧ ( A - C ) ∈ C ) −→ ( B + ( A - C ) ) =( ( A - C ) + B ) by (rule MMI_axaddcom)
from S6 have S7: B ∈ C −→ ( ( A - C ) ∈ C −→( B + ( A - C ) ) = ( ( A - C ) + B ) ) by (rule MMI_ex)
have S8: ( A ∈ C ∧ C ∈ C ) −→ ( A - C ) ∈ C by (rule MMI_subclt)
from S7 S8 have S9: B ∈ C −→ ( ( A ∈ C ∧ C ∈ C ) −→( B + ( A - C ) ) = ( ( A - C ) + B ) ) by (rule MMI_syl5)
from S9 have S10: B ∈ C −→ ( A ∈ C −→ ( C ∈ C −→( B + ( A - C ) ) = ( ( A - C ) + B ) ) )by (rule MMI_exp3a)
from S10 have S11: A ∈ C −→ ( B ∈ C −→ ( C ∈ C −→( B + ( A - C ) ) = ( ( A - C ) + B ) ) )by (rule MMI_com12)
from S11 have S12: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B + ( A - C ) ) = ( ( A - C ) + B ) by (rule MMI_3imp)
from S3 S5 S12 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - C ) = ( ( A - C ) + B ) by (rule MMI_3eqtrd)
qed

lemma (in MMIsar0) MMI_addsub12t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A + ( B - C ) ) =( B + ( A - C ) )proof have S1: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) = ( B + A )by (rule MMI_axaddcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - C ) =( ( B + A ) - C ) by (rule MMI_opreq1d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - C ) = ( ( B + A ) - C )by (rule MMI_3adant3)1116

have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) - C ) =( A + ( B - C ) ) by (rule MMI_addsubasst)
have S5: ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) −→ ( ( B + A ) - C ) =( B + ( A - C ) ) by (rule MMI_addsubasst)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( B + A ) - C ) = ( B + ( A - C ) ) by (rule MMI_3com12)
from S3 S4 S6 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( B - C ) ) = ( B + ( A - C ) )by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_addsubass: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A + B ) - C ) = ( A + ( B - C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) - C ) =( A + ( B - C ) ) by (rule MMI_addsubasst)
from S1 S2 S3 S4 show ( ( A + B ) - C ) =( A + ( B - C ) ) by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_addsub: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A + B ) - C ) = ( ( A - C ) + B )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) - C ) =( ( A - C ) + B ) by (rule MMI_addsubt)
from S1 S2 S3 S4 show ( ( A + B ) - C ) =( ( A - C ) + B ) by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_2addsubt:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A + B ) + C ) - D ) = ( ( ( A + C ) - D ) + B )proof have S1: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A + B ) + C ) =( ( A + C ) + B ) by (rule MMI_add23t)
from S1 have S2: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A + B ) + C ) = ( ( A + C ) + B ) by (rule MMI_3expa)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→1117

( ( A + B ) + C ) = ( ( A + C ) + B )by (rule MMI_adantrr)
from S3 have S4: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A + B ) + C ) - D ) =( ( ( A + C ) + B ) - D ) by (rule MMI_opreq1d)
have S5: ( ( A + C ) ∈ C ∧ B ∈ C ∧ D ∈ C ) −→( ( ( A + C ) + B ) - D ) =( ( ( A + C ) - D ) + B ) by (rule MMI_addsubt)
from S5 have S6: ( ( A + C ) ∈ C ∧ ( B ∈ C ∧ D ∈ C ) ) −→( ( ( A + C ) + B ) - D ) =( ( ( A + C ) - D ) + B ) by (rule MMI_3expb)
have S7: ( A ∈ C ∧ C ∈ C ) −→ ( A + C ) ∈ C by (rule MMI_axaddcl)
from S6 S7 have S8: ( ( A ∈ C ∧ C ∈ C ) ∧ ( B ∈ C ∧ D ∈ C ) )−→( ( ( A + C ) + B ) - D ) =( ( ( A + C ) - D ) + B ) by (rule MMI_sylan)
from S8 have S9: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A + C ) + B ) - D ) =( ( ( A + C ) - D ) + B ) by (rule MMI_an4s)
from S4 S9 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A + B ) + C ) - D ) =( ( ( A + C ) - D ) + B ) by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_negneg: assumes A1: A ∈ Cshows ( - ( (- A) ) ) = A
proof from A1 have S1: A ∈ C.
from S1 have S2: ( (- A) ) ∈ C by (rule MMI_negcl)
from S2 have S3: ( ( (- A) ) + ( - ( (- A) ) ) ) = 0
by (rule MMI_negid)
from S3 have S4: ( A + ( ( (- A) ) + ( - ( (- A) ) ) ) ) =( A + 0 ) by (rule MMI_opreq2i)
from A1 have S5: A ∈ C.
from S5 have S6: ( A + ( (- A) ) ) = 0 by (rule MMI_negid)
from S6 have S7: ( ( A + ( (- A) ) ) + ( - ( (- A) ) ) ) =( 0 + ( - ( (- A) ) ) ) by (rule MMI_opreq1i)
from A1 have S8: A ∈ C.
from S2 have S9: ( (- A) ) ∈ C .
from S2 have S10: ( (- A) ) ∈ C .
from S10 have S11: ( - ( (- A) ) ) ∈ C by (rule MMI_negcl)
from S8 S9 S11 have S12:
( ( A + ( (- A) ) ) + ( - ( (- A) ) ) ) =( A + ( ( (- A) ) + ( - ( (- A) ) ) ) )by (rule MMI_addass)from S11 have S13: ( - ( (- A) ) ) ∈ C .

1118

from S13 have S14: ( 0 + ( - ( (- A) ) ) ) =( - ( (- A) ) ) by (rule MMI_addid2)
from S7 S12 S14 have S15:
( A + ( ( (- A) ) + ( - ( (- A) ) ) ) ) =( - ( (- A) ) ) by (rule MMI_3eqtr3)
from A1 have S16: A ∈ C.
from S16 have S17: ( A + 0 ) = A by (rule MMI_addid1)
from S4 S15 S17 show ( - ( (- A) ) ) = A by (rule MMI_3eqtr3)
qed
lemma (in MMIsar0) MMI_subid: assumes A1: A ∈ Cshows ( A - A ) = 0
proof from A1 have S1: A ∈ C.
from A1 have S2: A ∈ C.
from S1 S2 have S3: ( A + ( (- A) ) ) = ( A - A )by (rule MMI_negsub)
from A1 have S4: A ∈ C.
from S4 have S5: ( A + ( (- A) ) ) = 0 by (rule MMI_negid)
from S3 S5 show ( A - A ) = 0 by (rule MMI_eqtr3)
qed
lemma (in MMIsar0) MMI_subid1: assumes A1: A ∈ Cshows ( A - 0 ) = A
proof from A1 have S1: A ∈ C.
from S1 have S2: ( 0 + A ) = A by (rule MMI_addid2)
from A1 have S3: A ∈ C.
have S4: 0 ∈ C by (rule MMI_0cn)from A1 have S5: A ∈ C.
from S3 S4 S5 have S6: ( A - 0 ) = A ←→ ( 0 + A ) = A
by (rule MMI_subadd)
from S2 S6 show ( A - 0 ) = A by (rule MMI_mpbir)qedlemma (in MMIsar0) MMI_negnegt:
shows A ∈ C −→ ( - ( (- A) ) ) = A
proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( (- A) ) =( - if ( A ∈ C , A , 0 ) ) by (rule MMI_negeq)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→ ( - ( (-A) ) ) =( - ( - if ( A ∈ C , A , 0 ) ) ) by (rule MMI_negeqd)
have S3: A = if ( A ∈ C , A , 0 ) −→ A = if ( A ∈ C , A , 0 )by (rule MMI_id)
from S2 S3 have S4: A = if ( A ∈ C , A , 0 ) −→( ( - ( (- A) ) ) = A ←→( - ( - if ( A ∈ C , A , 0 ) ) ) = if ( A ∈ C , A , 0 ) )by (rule MMI_eqeq12d)1119

have S5: 0 ∈ C by (rule MMI_0cn)from S5 have S6: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)from S6 have S7: ( - ( - if ( A ∈ C , A , 0 ) ) ) =if ( A ∈ C , A , 0 ) by (rule MMI_negneg)from S4 S7 show A ∈ C −→ ( - ( (- A) ) ) = A by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_subnegt:
shows ( A ∈ C ∧ B ∈ C ) −→ ( A - ( (- B) ) ) = ( A + B )proof have S1: ( A ∈ C ∧ ( (- B) ) ∈ C ) −→( A + ( - ( (- B) ) ) ) = ( A - ( (- B) ) )by (rule MMI_negsubt)
have S2: B ∈ C −→ ( (- B) ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ) −→( A + ( - ( (- B) ) ) ) = ( A - ( (- B) ) )by (rule MMI_sylan2)
have S4: B ∈ C −→ ( - ( (- B) ) ) = B by (rule MMI_negnegt)
from S4 have S5: B ∈ C −→ ( A + ( - ( (- B) ) ) ) =( A + B ) by (rule MMI_opreq2d)
from S5 have S6: ( A ∈ C ∧ B ∈ C ) −→( A + ( - ( (- B) ) ) ) = ( A + B ) by (rule MMI_adantl)
from S3 S6 show ( A ∈ C ∧ B ∈ C ) −→ ( A - ( (- B) ) ) =( A + B ) by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_subidt:
shows A ∈ C −→ ( A - A ) = 0
proof have S1: ( A = if ( A ∈ C , A , 0 ) ∧ A = if ( A ∈ C , A , 0 ) )−→( A - A ) = ( if ( A ∈ C , A , 0 ) - if ( A ∈ C , A , 0 ) )by (rule MMI_opreq12)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→( A - A ) = ( if ( A ∈ C , A , 0 ) - if ( A ∈ C , A , 0 ) )by (rule MMI_anidms)
from S2 have S3: A = if ( A ∈ C , A , 0 ) −→( ( A - A ) = 0 ←→( if ( A ∈ C , A , 0 ) - if ( A ∈ C , A , 0 ) ) = 0 )by (rule MMI_eqeq1d)
have S4: 0 ∈ C by (rule MMI_0cn)from S4 have S5: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)from S5 have S6:( if ( A ∈ C , A , 0 ) - if ( A ∈ C , A , 0 ) ) = 0
by (rule MMI_subid)from S3 S6 show A ∈ C −→ ( A - A ) = 0 by (rule MMI_dedth)
qed

1120

lemma (in MMIsar0) MMI_subid1t:
shows A ∈ C −→ ( A - 0 ) = A
proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( A - 0 ) =( if ( A ∈ C , A , 0 ) - 0 ) by (rule MMI_opreq1)
have S2: A = if ( A ∈ C , A , 0 ) −→A = if ( A ∈ C , A , 0 ) by (rule MMI_id)
from S1 S2 have S3: A = if ( A ∈ C , A , 0 ) −→( ( A - 0 ) = A ←→ ( if ( A ∈ C , A , 0 ) - 0 ) =if ( A ∈ C , A , 0 ) ) by (rule MMI_eqeq12d)
have S4: 0 ∈ C by (rule MMI_0cn)from S4 have S5: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)from S5 have S6: ( if ( A ∈ C , A , 0 ) - 0 ) =if ( A ∈ C , A , 0 ) by (rule MMI_subid1)
from S3 S6 show A ∈ C −→ ( A - 0 ) = A by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_pncant:shows ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - B ) = A
proof have S1: ( A ∈ C ∧ B ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - B ) =( A + ( B - B ) ) by (rule MMI_addsubasst)
from S1 have S2: ( A ∈ C ∧ ( B ∈ C ∧ B ∈ C ) ) −→( ( A + B ) - B ) = ( A + ( B - B ) ) by (rule MMI_3expb)
from S2 have S3: ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - B ) =( A + ( B - B ) ) by (rule MMI_anabsan2)
have S4: B ∈ C −→ ( B - B ) = 0 by (rule MMI_subidt)
from S4 have S5: B ∈ C −→ ( A + ( B - B ) ) = ( A + 0 )by (rule MMI_opreq2d)
have S6: A ∈ C −→ ( A + 0 ) = A by (rule MMI_ax0id)
from S5 S6 have S7: ( A ∈ C ∧ B ∈ C ) −→ ( A + ( B - B ) ) = A
by (rule MMI_sylan9eqr)
from S3 S7 show ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - B ) = A
by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_pncan2t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - A ) = B
proof have S1: ( B ∈ C ∧ A ∈ C ) −→ ( B + A ) = ( A + B )by (rule MMI_axaddcom)
from S1 have S2: ( B ∈ C ∧ A ∈ C ) −→ ( ( B + A ) - A ) =( ( A + B ) - A ) by (rule MMI_opreq1d)
have S3: ( B ∈ C ∧ A ∈ C ) −→ ( ( B + A ) - A ) = B
by (rule MMI_pncant)from S2 S3 have S4: ( B ∈ C ∧ A ∈ C ) −→( ( A + B ) - A ) = B by (rule MMI_eqtr3d)
from S4 show ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - A ) = B

1121

by (rule MMI_ancoms)
qedlemma (in MMIsar0) MMI_npcant:shows ( A ∈ C ∧ B ∈ C ) −→ ( ( A - B ) + B ) = A
proof have S1: ( A ∈ C ∧ B ∈ C ∧ B ∈ C ) −→( ( A + B ) - B ) = ( ( A - B ) + B )by (rule MMI_addsubt)
from S1 have S2: ( A ∈ C ∧ ( B ∈ C ∧ B ∈ C ) ) −→( ( A + B ) - B ) = ( ( A - B ) + B ) by (rule MMI_3expb)
from S2 have S3: ( A ∈ C ∧ B ∈ C ) −→( ( A + B ) - B ) = ( ( A - B ) + B )by (rule MMI_anabsan2)
have S4: ( A ∈ C ∧ B ∈ C ) −→ ( ( A + B ) - B ) = A
by (rule MMI_pncant)from S3 S4 show ( A ∈ C ∧ B ∈ C ) −→ ( ( A - B ) + B ) = A
by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_npncant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) + ( B - C ) ) = ( A - C )proof have S1: ( ( A - B ) ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + B ) - C ) =( ( A - B ) + ( B - C ) ) by (rule MMI_addsubasst)
have S2: ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C by (rule MMI_subclt)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - B ) ∈ C by (rule MMI_3adant3)
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ B ∈ C by (rule MMI_3simp2)
have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
from S1 S3 S4 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + B ) - C ) =( ( A - B ) + ( B - C ) ) by (rule MMI_syl3anc)
have S7: ( A ∈ C ∧ B ∈ C ) −→ ( ( A - B ) + B ) = A
by (rule MMI_npcant)from S7 have S8: ( A ∈ C ∧ B ∈ C ) −→( ( ( A - B ) + B ) - C ) = ( A - C )by (rule MMI_opreq1d)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + B ) - C ) = ( A - C )by (rule MMI_3adant3)
from S6 S9 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) + ( B - C ) ) = ( A - C )by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_nppcant:1122

shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + C ) + B ) = ( A + C )proof have S1: ( ( A - B ) ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( ( ( A - B ) + C ) + B ) =( ( ( A - B ) + B ) + C ) by (rule MMI_add23t)
have S2: ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C by (rule MMI_subclt)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A - B ) ∈ C
by (rule MMI_3adant3)
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ B ∈ C by (rule MMI_3simp2)
from S1 S3 S4 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + C ) + B ) =( ( ( A - B ) + B ) + C ) by (rule MMI_syl3anc)
have S7: ( A ∈ C ∧ B ∈ C ) −→ ( ( A - B ) + B ) = A
by (rule MMI_npcant)from S7 have S8: ( A ∈ C ∧ B ∈ C ) −→( ( ( A - B ) + B ) + C ) = ( A + C )by (rule MMI_opreq1d)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + B ) + C ) = ( A + C )by (rule MMI_3adant3)
from S6 S9 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A - B ) + C ) + B ) = ( A + C ) by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_subneg: assumes A1: A ∈ C andA2: B ∈ C
shows ( A - ( (- B) ) ) = ( A + B )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A - ( (- B) ) ) = ( A + B )by (rule MMI_subnegt)
from S1 S2 S3 show ( A - ( (- B) ) ) = ( A + B )by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_subeq0: assumes A1: A ∈ C andA2: B ∈ C
shows ( A - B ) = 0 ←→ A = B
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: ( A + ( (- B) ) ) = ( A - B )by (rule MMI_negsub)
from S3 have S4: ( A + ( (- B) ) ) = 0 ←→ ( A - B ) = 0
by (rule MMI_eqeq1i)
have S5: ( A + ( (- B) ) ) = 0 −→1123

( ( A + ( (- B) ) ) + B ) = ( 0 + B ) by (rule MMI_opreq1)
from S4 S5 have S6: ( A - B ) = 0 −→( ( A + ( (- B) ) ) + B ) = ( 0 + B ) by (rule MMI_sylbir)from A1 have S7: A ∈ C.
from A2 have S8: B ∈ C.
from S8 have S9: ( (- B) ) ∈ C by (rule MMI_negcl)
from A2 have S10: B ∈ C.
from S7 S9 S10 have S11: ( ( A + ( (- B) ) ) + B ) =( ( A + B ) + ( (- B) ) ) by (rule MMI_add23)
from A1 have S12: A ∈ C.
from A2 have S13: B ∈ C.
from S9 have S14: ( (- B) ) ∈ C .
from S12 S13 S14 have S15: ( ( A + B ) + ( (- B) ) ) =( A + ( B + ( (- B) ) ) ) by (rule MMI_addass)from A2 have S16: B ∈ C.
from S16 have S17: ( B + ( (- B) ) ) = 0 by (rule MMI_negid)
from S17 have S18: ( A + ( B + ( (- B) ) ) ) = ( A + 0 )by (rule MMI_opreq2i)
from A1 have S19: A ∈ C.
from S19 have S20: ( A + 0 ) = A by (rule MMI_addid1)
from S18 S20 have S21: ( A + ( B + ( (- B) ) ) ) = A
by (rule MMI_eqtr)
from S11 S15 S21 have S22: ( ( A + ( (- B) ) ) + B ) = A
by (rule MMI_3eqtr)
from A2 have S23: B ∈ C.
from S23 have S24: ( 0 + B ) = B by (rule MMI_addid2)
from S6 S22 S24 have S25: ( A - B ) = 0 −→ A = B
by (rule MMI_3eqtr3g)
have S26: A = B −→ ( A - B ) = ( B - B ) by (rule MMI_opreq1)
from A2 have S27: B ∈ C.
from S27 have S28: ( B - B ) = 0 by (rule MMI_subid)from S26 S28 have S29: A = B −→ ( A - B ) = 0 by (rule MMI_syl6eq)
from S25 S29 show ( A - B ) = 0 ←→ A = B by (rule MMI_impbi)
qedlemma (in MMIsar0) MMI_neg11: assumes A1: A ∈ C andA2: B ∈ C
shows ( (- A) ) = ( (- B) ) ←→ A = B
proof have S1: ( (- A) ) = ( 0 - A ) by (rule MMI_df_neg)
have S2: ( (- B) ) = ( 0 - B ) by (rule MMI_df_neg)
from S1 S2 have S3: ( (- A) ) = ( (- B) ) ←→ ( 0 - A ) =( 0 - B ) by (rule MMI_eqeq12i)
have S4: 0 ∈ C by (rule MMI_0cn)from A1 have S5: A ∈ C.
have S6: 0 ∈ C by (rule MMI_0cn)from A2 have S7: B ∈ C.
from S6 S7 have S8: ( 0 - B ) ∈ C by (rule MMI_subcl)
from S4 S5 S8 have S9: ( 0 - A ) = ( 0 - B ) ←→1124

( A + ( 0 - B ) ) = 0 by (rule MMI_subadd)
from S2 have S10: ( (- B) ) = ( 0 - B ) .
from S10 have S11: ( A + ( (- B) ) ) = ( A + ( 0 - B ) )by (rule MMI_opreq2i)
from A1 have S12: A ∈ C.
from A2 have S13: B ∈ C.
from S12 S13 have S14: ( A + ( (- B) ) ) = ( A - B )by (rule MMI_negsub)
from S11 S14 have S15: ( A + ( 0 - B ) ) = ( A - B )by (rule MMI_eqtr3)
from S15 have S16: ( A + ( 0 - B ) ) = 0 ←→ ( A - B ) = 0
by (rule MMI_eqeq1i)
from A1 have S17: A ∈ C.
from A2 have S18: B ∈ C.
from S17 S18 have S19: ( A - B ) = 0 ←→ A = B by (rule MMI_subeq0)
from S16 S19 have S20: ( A + ( 0 - B ) ) = 0 ←→ A = B
by (rule MMI_bitr)from S3 S9 S20 show ( (- A) ) = ( (- B) ) ←→ A = B by (rule MMI_3bitr)qed

lemma (in MMIsar0) MMI_negcon1: assumes A1: A ∈ C andA2: B ∈ C
shows ( (- A) ) = B ←→ ( (- B) ) = A
proof from A1 have S1: A ∈ C.
from S1 have S2: ( - ( (- A) ) ) = A by (rule MMI_negneg)from S2 have S3: ( - ( (- A) ) ) = ( (- B) ) ←→ A = ( (-B) )by (rule MMI_eqeq1i)
from A1 have S4: A ∈ C.
from S4 have S5: ( (- A) ) ∈ C by (rule MMI_negcl)
from A2 have S6: B ∈ C.
from S5 S6 have S7: ( - ( (- A) ) ) =( (- B) ) ←→ ( (- A) ) = B by (rule MMI_neg11)
have S8: A = ( (- B) ) ←→ ( (- B) ) = A by (rule MMI_eqcom)
from S3 S7 S8 show ( (- A) ) = B ←→ ( (- B) ) = A by (rule MMI_3bitr3)
qed
lemma (in MMIsar0) MMI_negcon2: assumes A1: A ∈ C andA2: B ∈ C
shows A = ( (- B) ) ←→ B = ( (- A) )proof from A2 have S1: B ∈ C.
from A1 have S2: A ∈ C.
from S1 S2 have S3: ( (- B) ) = A ←→ ( (- A) ) = B
by (rule MMI_negcon1)
have S4: A = ( (- B) ) ←→ ( (- B) ) = A by (rule MMI_eqcom)1125

have S5: B = ( (- A) ) ←→ ( (- A) ) = B by (rule MMI_eqcom)
from S3 S4 S5 show A = ( (- B) ) ←→ B = ( (- A) ) by (rule MMI_3bitr4)
qed
lemma (in MMIsar0) MMI_neg11t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( ( (- A) ) = ( (- B) ) ←→ A = B)
proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( (- A) ) =( - if ( A ∈ C , A , 0 ) ) by (rule MMI_negeq)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→ ( ( (- A) ) =( (- B) ) ←→ ( - if ( A ∈ C , A , 0 ) ) = ( (- B) ) )by (rule MMI_eqeq1d)
have S3: A = if ( A ∈ C , A , 0 ) −→ ( A = B ←→if ( A ∈ C , A , 0 ) = B ) by (rule MMI_eqeq1)
from S2 S3 have S4: A = if ( A ∈ C , A , 0 ) −→( ( ( (- A) ) = ( (- B) ) ←→ A = B ) ←→( ( - if ( A ∈ C , A , 0 ) ) = ( (- B) ) ←→if ( A ∈ C , A , 0 ) = B ) ) by (rule MMI_bibi12d)
have S5: B = if ( B ∈ C , B , 0 ) −→ ( (- B) ) =( - if ( B ∈ C , B , 0 ) ) by (rule MMI_negeq)
from S5 have S6: B = if ( B ∈ C , B , 0 ) −→( ( - if ( A ∈ C , A , 0 ) ) = ( (- B) ) ←→( - if ( A ∈ C , A , 0 ) ) = ( - if ( B ∈ C , B , 0 ) ) )by (rule MMI_eqeq2d)
have S7: B = if ( B ∈ C , B , 0 ) −→ ( if ( A ∈ C , A , 0 ) = B←→
if ( A ∈ C , A , 0 ) = if ( B ∈ C , B , 0 ) ) by (rule MMI_eqeq2)
from S6 S7 have S8: B = if ( B ∈ C , B , 0 ) −→( ( ( - if ( A ∈ C , A , 0 ) ) = ( (- B) ) ←→if ( A ∈ C , A , 0 ) = B ) ←→ ( ( - if ( A ∈ C , A , 0 ) ) =( - if ( B ∈ C , B , 0 ) ) ←→ if ( A ∈ C , A , 0 ) =if ( B ∈ C , B , 0 ) ) ) by (rule MMI_bibi12d)
have S9: 0 ∈ C by (rule MMI_0cn)from S9 have S10: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S11: 0 ∈ C by (rule MMI_0cn)from S11 have S12: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S10 S12 have S13: ( - if ( A ∈ C , A , 0 ) ) =( - if ( B ∈ C , B , 0 ) ) ←→ if ( A ∈ C , A , 0 ) =if ( B ∈ C , B , 0 ) by (rule MMI_neg11)
from S4 S8 S13 show ( A ∈ C ∧ B ∈ C ) −→ ( ( (- A) ) =( (- B) ) ←→ A = B ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_negcon1t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( ( (- A) ) = B ←→ ( (- B) ) = A)
proof have S1: ( ( (- A) ) ∈ C ∧ B ∈ C ) −→ ( ( - ( (- A) ) ) =1126

( (- B) ) ←→ ( (- A) ) = B ) by (rule MMI_neg11t)
have S2: A ∈ C −→ ( (- A) ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ) −→ ( ( - ( (- A) ) ) =( (- B) ) ←→ ( (- A) ) = B ) by (rule MMI_sylan)
have S4: A ∈ C −→ ( - ( (- A) ) ) = A by (rule MMI_negnegt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ) −→ ( - ( (- A) ) ) = A
by (rule MMI_adantr)
from S5 have S6: ( A ∈ C ∧ B ∈ C ) −→ ( ( - ( (- A) ) ) =( (- B) ) ←→ A = ( (- B) ) ) by (rule MMI_eqeq1d)
from S3 S6 have S7: ( A ∈ C ∧ B ∈ C ) −→ ( ( (- A) ) = B ←→ A=
( (- B) ) ) by (rule MMI_bitr3d)
have S8: A = ( (- B) ) ←→ ( (- B) ) = A by (rule MMI_eqcom)
from S7 S8 show ( A ∈ C ∧ B ∈ C ) −→ ( ( (- A) ) = B ←→( (- B) ) = A ) by (rule MMI_syl6bb)
qed
lemma (in MMIsar0) MMI_negcon2t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( A = ( (- B) ) ←→ B = ( (- A) ))proof have S1: ( A ∈ C ∧ B ∈ C ) −→ ( ( (- A) ) = B ←→ ( (- B) ) =A )by (rule MMI_negcon1t)
have S2: A = ( (- B) ) ←→ ( (- B) ) = A by (rule MMI_eqcom)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ) −→ ( A = ( (- B) ) ←→( (- A) ) = B ) by (rule MMI_syl6rbbrA)
have S4: ( (- A) ) = B ←→ B = ( (- A) ) by (rule MMI_eqcom)
from S3 S4 show ( A ∈ C ∧ B ∈ C ) −→ ( A = ( (- B) ) ←→ B =( (-A) ) ) by (rule MMI_syl6bb)

qed
lemma (in MMIsar0) MMI_subcant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A - B ) =( A - C ) ←→ B = C )proof have S1: ( A ∈ C ∧ ( (- B) ) ∈ C ∧ ( - C ) ∈ C ) −→( ( A + ( (- B) ) ) = ( A + ( - C ) ) ←→( (- B) ) = ( - C ) ) by (rule MMI_addcant)have S2: C ∈ C −→ ( - C ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ ( (- B) ) ∈ C ∧ C ∈ C ) −→( ( A + ( (- B) ) ) = ( A + ( - C ) ) ←→( (- B) ) = ( - C ) ) by (rule MMI_syl3an3)
have S4: B ∈ C −→ ( (- B) ) ∈ C by (rule MMI_negclt)
from S3 S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + ( (- B) ) ) = ( A + ( - C ) ) ←→( (- B) ) = ( - C ) ) by (rule MMI_syl3an2)
have S6: ( A ∈ C ∧ B ∈ C ) −→ ( A + ( (- B) ) ) = ( A - B )1127

by (rule MMI_negsubt)
from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( (- B) ) ) = ( A - B ) by (rule MMI_3adant3)
have S8: ( A ∈ C ∧ C ∈ C ) −→ ( A + ( - C ) ) = ( A - C )by (rule MMI_negsubt)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( - C ) ) = ( A - C ) by (rule MMI_3adant2)
from S7 S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + ( (- B) ) ) = ( A + ( - C ) ) ←→( A - B ) = ( A - C ) ) by (rule MMI_eqeq12d)
have S11: ( B ∈ C ∧ C ∈ C ) −→ ( ( (- B) ) = ( - C ) ←→ B = C)
by (rule MMI_neg11t)
from S11 have S12: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( (- B) ) = ( - C ) ←→ B = C ) by (rule MMI_3adant1)
from S5 S10 S12 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) = ( A - C ) ←→ B = C ) by (rule MMI_3bitr3d)
qed
lemma (in MMIsar0) MMI_subcan2t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - C ) = ( B - C ) ←→ A = B )proof have S1: ( A ∈ C ∧ C ∈ C ) −→ ( A + ( - C ) ) = ( A - C )by (rule MMI_negsubt)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( - C ) ) = ( A - C ) by (rule MMI_3adant2)
have S3: ( B ∈ C ∧ C ∈ C ) −→ ( B + ( - C ) ) = ( B - C )by (rule MMI_negsubt)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B + ( - C ) ) = ( B - C ) by (rule MMI_3adant1)
from S2 S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + ( - C ) ) = ( B + ( - C ) ) ←→ ( A - C ) =( B - C ) ) by (rule MMI_eqeq12d)
have S6: ( A ∈ C ∧ B ∈ C ∧ ( - C ) ∈ C ) −→( ( A + ( - C ) ) = ( B + ( - C ) ) ←→ A = B )by (rule MMI_addcan2t)
have S7: C ∈ C −→ ( - C ) ∈ C by (rule MMI_negclt)
from S6 S7 have S8: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + ( - C ) ) = ( B + ( - C ) ) ←→ A = B )by (rule MMI_syl3an3)from S5 S8 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - C ) = ( B - C ) ←→ A = B ) by (rule MMI_bitr3d)
qed
lemma (in MMIsar0) MMI_subcan: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A - B ) = ( A - C ) ←→ B = C

1128

proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A - B ) = ( A - C ) ←→B = C ) by (rule MMI_subcant)from S1 S2 S3 S4 show ( A - B ) = ( A - C ) ←→ B = C
by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_subcan2: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A - C ) = ( B - C ) ←→ A = B
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - C ) = ( B - C ) ←→ A = B ) by (rule MMI_subcan2t)
from S1 S2 S3 S4 show ( A - C ) = ( B - C ) ←→ A = B
by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_subeq0t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( ( A - B ) = 0 ←→ A = B )proof have S1: A = if ( A ∈ C , A , 0 ) −→ ( A - B ) =( if ( A ∈ C , A , 0 ) - B ) by (rule MMI_opreq1)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→ ( ( A - B ) = 0 ←→( if ( A ∈ C , A , 0 ) - B ) = 0 ) by (rule MMI_eqeq1d)
have S3: A = if ( A ∈ C , A , 0 ) −→ ( A = B ←→if ( A ∈ C , A , 0 ) = B ) by (rule MMI_eqeq1)
from S2 S3 have S4: A = if ( A ∈ C , A , 0 ) −→( ( ( A - B ) = 0 ←→ A = B ) ←→( ( if ( A ∈ C , A , 0 ) - B ) = 0 ←→if ( A ∈ C , A , 0 ) = B ) ) by (rule MMI_bibi12d)
have S5: B = if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) - B ) =( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) )by (rule MMI_opreq2)
from S5 have S6: B = if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) - B ) = 0 ←→( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = 0 )by (rule MMI_eqeq1d)
have S7: B = if ( B ∈ C , B , 0 ) −→ ( if ( A ∈ C , A , 0 ) = B←→
if ( A ∈ C , A , 0 ) = if ( B ∈ C , B , 0 ) ) by (rule MMI_eqeq2)1129

from S6 S7 have S8: B = if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) - B ) = 0 ←→if ( A ∈ C , A , 0 ) = B ) ←→( ( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = 0 ←→if ( A ∈ C , A , 0 ) = if ( B ∈ C , B , 0 ) ) )by (rule MMI_bibi12d)
have S9: 0 ∈ C by (rule MMI_0cn)from S9 have S10: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S11: 0 ∈ C by (rule MMI_0cn)from S11 have S12: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S10 S12 have S13:
( if ( A ∈ C , A , 0 ) - if ( B ∈ C , B , 0 ) ) = 0 ←→if ( A ∈ C , A , 0 ) = if ( B ∈ C , B , 0 )by (rule MMI_subeq0)
from S4 S8 S13 show ( A ∈ C ∧ B ∈ C ) −→( ( A - B ) = 0 ←→ A = B ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_neg0:
shows ( - 0 ) = 0
proof have S1: ( - 0 ) = ( 0 - 0 ) by (rule MMI_df_neg)
have S2: 0 ∈ C by (rule MMI_0cn)from S2 have S3: ( 0 - 0 ) = 0 by (rule MMI_subid)from S1 S3 show ( - 0 ) = 0 by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_renegcl: assumes A1: A ∈ IR
shows ( (- A) ) ∈ IR
proof from A1 have S1: A ∈ IR.
have S2: A ∈ IR −→ ( ∃ x ∈ IR . ( A + x ) = 0 ) by (rule MMI_axrnegex)
from S1 S2 have S3: ∃ x ∈ IR . ( A + x ) = 0 by (rule MMI_ax_mp)
have S4: ( ∃ x ∈ IR . ( A + x ) = 0 ) ←→( ∃ x . ( x ∈ IR ∧ ( A + x ) = 0 ) ) by (rule MMI_df_rex)
from S3 S4 have S5: ∃ x . ( x ∈ IR ∧ ( A + x ) = 0 )by (rule MMI_mpbi){ fix x
have S6: x ∈ IR −→ x ∈ C by (rule MMI_recnt)
have S7: 0 ∈ C by (rule MMI_0cn)from A1 have S8: A ∈ IR.
from S8 have S9: A ∈ C by (rule MMI_recn)
have S10: ( 0 ∈ C ∧ A ∈ C ∧ x ∈ C ) −→ ( ( 0 - A ) = x ←→( A + x ) = 0 ) by (rule MMI_subaddt)
from S7 S9 S10 have S11: x ∈ C −→ ( ( 0 - A ) = x ←→( A + x ) = 0 ) by (rule MMI_mp3an12)
from S6 S11 have S12: x ∈ IR −→ ( ( 0 - A ) = x ←→1130

( A + x ) = 0 ) by (rule MMI_syl)have S13: ( (- A) ) = ( 0 - A ) by (rule MMI_df_neg)
from S13 have S14: ( (- A) ) = x ←→ ( 0 - A ) = x
by (rule MMI_eqeq1i)
from S12 S14 have S15: x ∈ IR −→ ( ( (- A) ) = x ←→( A + x ) = 0 ) by (rule MMI_syl5bb)
have S16: x ∈ IR −→ ( ( (- A) ) = x −→ ( (- A) ) ∈ IR )by (rule MMI_eleq1a)from S15 S16 have S17: x ∈ IR −→ ( ( A + x ) = 0 −→( (- A) ) ∈ IR ) by (rule MMI_sylbird)from S17 have ( x ∈ IR ∧ ( A + x ) = 0 ) −→ ( (- A) ) ∈ IR
by (rule MMI_imp)} then have S18:
∀ x . ( x ∈ IR ∧ ( A + x ) = 0 ) −→ ( (- A) ) ∈ IR
by autofrom S18 have S19: ( ∃ x . ( x ∈ IR ∧ ( A + x ) = 0 ) ) −→( (- A) ) ∈ IR by (rule MMI_19_23aiv)
from S5 S19 show ( (- A) ) ∈ IR by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_renegclt:
shows A ∈ IR −→ ( (- A) ) ∈ IR
proof have S1: A = if ( A ∈ IR , A , 1 ) −→ ( (- A) ) =( - if ( A ∈ IR , A , 1 ) ) by (rule MMI_negeq)
from S1 have S2: A = if ( A ∈ IR , A , 1 ) −→ ( ( (-A) ) ∈ IR ←→( - if ( A ∈ IR , A , 1 ) ) ∈ IR ) by (rule MMI_eleq1d)
have S3: 1 ∈ IR by (rule MMI_ax1re)from S3 have S4: if ( A ∈ IR , A , 1 ) ∈ IR by (rule MMI_elimel)from S4 have S5: ( - if ( A ∈ IR , A , 1 ) ) ∈ IR by (rule MMI_renegcl)
from S2 S5 show A ∈ IR −→ ( (- A) ) ∈ IR by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_resubclt:
shows ( A ∈ IR ∧ B ∈ IR ) −→ ( A - B ) ∈ IR
proof have S1: ( A ∈ C ∧ B ∈ C ) −→ ( A + ( (- B) ) ) = ( A - B )by (rule MMI_negsubt)
have S2: A ∈ IR −→ A ∈ C by (rule MMI_recnt)
have S3: B ∈ IR −→ B ∈ C by (rule MMI_recnt)
from S1 S2 S3 have S4: ( A ∈ IR ∧ B ∈ IR ) −→ ( A + ( (- B) ) )=( A - B ) by (rule MMI_syl2an)
have S5: ( A ∈ IR ∧ ( (- B) ) ∈ IR ) −→ ( A + ( (- B) ) ) ∈ IR
by (rule MMI_axaddrcl)
have S6: B ∈ IR −→ ( (- B) ) ∈ IR by (rule MMI_renegclt)
from S5 S6 have S7: ( A ∈ IR ∧ B ∈ IR ) −→ ( A + ( (- B) ) ) ∈ IR1131

by (rule MMI_sylan2)
from S4 S7 show ( A ∈ IR ∧ B ∈ IR ) −→ ( A - B ) ∈ IR
by (rule MMI_eqeltrrd)
qed
lemma (in MMIsar0) MMI_resubcl: assumes A1: A ∈ IR and
A2: B ∈ IR
shows ( A - B ) ∈ IR
proof from A1 have S1: A ∈ IR.
from A2 have S2: B ∈ IR.
have S3: ( A ∈ IR ∧ B ∈ IR ) −→ ( A - B ) ∈ IR by (rule MMI_resubclt)
from S1 S2 S3 show ( A - B ) ∈ IR by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_0re:shows 0 ∈ IR
proof have S1: 1 ∈ C by (rule MMI_1cn)from S1 have S2: ( 1 - 1 ) = 0 by (rule MMI_subid)
have S3: 1 ∈ IR by (rule MMI_ax1re)have S4: 1 ∈ IR by (rule MMI_ax1re)from S3 S4 have S5: ( 1 - 1 ) ∈ IR by (rule MMI_resubcl)
from S2 S5 show 0 ∈ IR by (rule MMI_eqeltrr)
qed

lemma (in MMIsar0) MMI_mulid2t:
shows A ∈ C −→ ( 1 · A ) = A
proof have S1: 1 ∈ C by (rule MMI_1cn)
have S2: ( 1 ∈ C ∧ A ∈ C ) −→ ( 1 · A ) = ( A · 1 )by (rule MMI_axmulcom)
from S1 S2 have S3: A ∈ C −→ ( 1 · A ) = ( A · 1 ) by (rule MMI_mpan)
have S4: A ∈ C −→ ( A · 1 ) = A by (rule MMI_ax1id)
from S3 S4 show A ∈ C −→ ( 1 · A ) = A by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_mul12t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · ( B · C ) ) =( B · ( A · C ) )proof have S1: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) = ( B · A )by (rule MMI_axmulcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→( ( A · B ) · C ) = ( ( B · A ) · C ) by (rule MMI_opreq1d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) · C ) = ( ( B · A ) · C ) by (rule MMI_3adant3)1132

have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) · C ) = ( A · ( B · C ) ) by (rule MMI_axmulass)have S5: ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) −→( ( B · A ) · C ) = ( B · ( A · C ) ) by (rule MMI_axmulass)from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( B · A ) · C ) = ( B · ( A · C ) ) by (rule MMI_3com12)
from S3 S4 S6 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( B · C ) ) = ( B · ( A · C ) ) by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_mul23t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A · B ) · C ) =( ( A · C ) · B )proof have S1: ( B ∈ C ∧ C ∈ C ) −→ ( B · C ) = ( C · B )by (rule MMI_axmulcom)
from S1 have S2: ( B ∈ C ∧ C ∈ C ) −→ ( A · ( B · C ) ) =( A · ( C · B ) ) by (rule MMI_opreq2d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · ( B · C ) )=( A · ( C · B ) ) by (rule MMI_3adant1)
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A · B ) · C ) =( A · ( B · C ) ) by (rule MMI_axmulass)have S5: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→ ( ( A · C ) · B ) =( A · ( C · B ) ) by (rule MMI_axmulass)from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · C ) · B ) = ( A · ( C · B ) ) by (rule MMI_3com23)
from S3 S4 S6 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) · C ) = ( ( A · C ) · B ) by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_mul4t:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · B ) · ( C · D ) ) = ( ( A · C ) · ( B · D ) )proof have S1: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) · C ) = ( ( A · C ) · B ) by (rule MMI_mul23t)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A · B ) · C ) · D ) = ( ( ( A · C ) · B ) · D )by (rule MMI_opreq1d)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( ( A · B ) · C ) · D ) = ( ( ( A · C ) · B ) · D )by (rule MMI_3expa)
from S3 have S4: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · B ) · C ) · D ) = ( ( ( A · C ) · B ) · D )by (rule MMI_adantrr)
have S5: ( ( A · B ) ∈ C ∧ C ∈ C ∧ D ∈ C ) −→( ( ( A · B ) · C ) · D ) = ( ( A · B ) · ( C · D ) )1133

by (rule MMI_axmulass)from S5 have S6: ( ( A · B ) ∈ C ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · B ) · C ) · D ) = ( ( A · B ) · ( C · D ) ) by (rule MMI_3expb)
have S7: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) ∈ C by (rule MMI_axmulcl)
from S6 S7 have S8: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( ( A · B ) · C ) · D ) = ( ( A · B ) · ( C · D ) ) by (rule MMI_sylan)
have S9: ( ( A · C ) ∈ C ∧ B ∈ C ∧ D ∈ C ) −→( ( ( A · C ) · B ) · D ) = ( ( A · C ) · ( B · D ) )by (rule MMI_axmulass)from S9 have S10: ( ( A · C ) ∈ C ∧ ( B ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) · B ) · D ) = ( ( A · C ) · ( B · D ) )by (rule MMI_3expb)
have S11: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) ∈ C by (rule MMI_axmulcl)
from S10 S11 have S12: ( ( A ∈ C ∧ C ∈ C ) ∧ ( B ∈ C ∧ D ∈ C )) −→( ( ( A · C ) · B ) · D ) = ( ( A · C ) · ( B · D ) )by (rule MMI_sylan)
from S12 have S13: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) · B ) · D ) = ( ( A · C ) · ( B · D ) )by (rule MMI_an4s)
from S4 S8 S13 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A · B ) · ( C · D ) ) = ( ( A · C ) · ( B · D ) )by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_muladdt:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) · ( C + D ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )proof have S1: ( ( A + B ) ∈ C ∧ C ∈ C ∧ D ∈ C ) −→( ( A + B ) · ( C + D ) ) =( ( ( A + B ) · C ) + ( ( A + B ) · D ) )by (rule MMI_axdistr)
have S2: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A + B ) ∈ C by (rule MMI_adantr)
have S4: ( C ∈ C ∧ D ∈ C ) −→ C ∈ C by (rule MMI_pm3_26)
from S4 have S5: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→C ∈ C
by (rule MMI_adantl)
have S6: ( C ∈ C ∧ D ∈ C ) −→ D ∈ C by (rule MMI_pm3_27)
from S6 have S7: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→D ∈ Cby (rule MMI_adantl)1134

from S1 S3 S5 S7 have S8:( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) · ( C + D ) ) =( ( ( A + B ) · C ) + ( ( A + B ) · D ) )by (rule MMI_syl3anc)
have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) · C ) = ( ( A · C ) + ( B · C ) )by (rule MMI_adddirt)
from S9 have S10: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A + B ) · C ) = ( ( A · C ) + ( B · C ) )by (rule MMI_3expa)
from S10 have S11: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) · C ) = ( ( A · C ) + ( B · C ) )by (rule MMI_adantrr)
have S12: ( A ∈ C ∧ B ∈ C ∧ D ∈ C ) −→( ( A + B ) · D ) = ( ( A · D ) + ( B · D ) )by (rule MMI_adddirt)
from S12 have S13: ( ( A ∈ C ∧ B ∈ C ) ∧ D ∈ C ) −→( ( A + B ) · D ) = ( ( A · D ) + ( B · D ) )by (rule MMI_3expa)
from S13 have S14: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) · D ) = ( ( A · D ) + ( B · D ) )by (rule MMI_adantrl)
from S11 S14 have S15: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C )) −→( ( ( A + B ) · C ) + ( ( A + B ) · D ) ) =( ( ( A · C ) + ( B · C ) ) + ( ( A · D ) + ( B · D ) ) )by (rule MMI_opreq12d)
have S16:( ( A · C ) ∈ C ∧ ( B · C ) ∈ C ∧( ( A · D ) + ( B · D ) ) ∈ C ) −→( ( ( A · C ) + ( B · C ) ) + ( ( A · D ) + ( B · D ) ) ) =( ( ( A · C ) + ( ( A · D ) + ( B · D ) ) ) + ( B · C ) )by (rule MMI_add23t)
have S17: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) ∈ C by (rule MMI_axmulcl)
from S17 have S18: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A · C ) ∈ C by (rule MMI_ad2ant2r)
have S19: ( B ∈ C ∧ C ∈ C ) −→ ( B · C ) ∈ C by (rule MMI_axmulcl)
from S19 have S20: ( B ∈ C ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B · C ) ∈ C by (rule MMI_adantrr)
from S20 have S21: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B · C ) ∈ C by (rule MMI_adantll)
have S22: ( ( A · D ) ∈ C ∧ ( B · D ) ∈ C ) −→( ( A · D ) + ( B · D ) ) ∈ C by (rule MMI_axaddcl)
have S23: ( A ∈ C ∧ D ∈ C ) −→ ( A · D ) ∈ C by (rule MMI_axmulcl)

1135

have S24: ( B ∈ C ∧ D ∈ C ) −→ ( B · D ) ∈ C by (rule MMI_axmulcl)
from S22 S23 S24 have S25:
( ( A ∈ C ∧ D ∈ C ) ∧ ( B ∈ C ∧ D ∈ C ) ) −→( ( A · D ) + ( B · D ) ) ∈ C by (rule MMI_syl2an)
from S25 have S26: ( ( A ∈ C ∧ B ∈ C ) ∧ D ∈ C ) −→( ( A · D ) + ( B · D ) ) ∈ C by (rule MMI_anandirs)from S26 have S27: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · D ) + ( B · D ) ) ∈ C by (rule MMI_adantrl)
from S16 S18 S21 S27 have S28:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) + ( B · C ) ) + ( ( A · D ) + ( B · D ) ) ) =( ( ( A · C ) + ( ( A · D ) + ( B · D ) ) ) + ( B · C ) )by (rule MMI_syl3anc)
have S29: ( B ∈ C ∧ D ∈ C ) −→ ( B · D ) = ( D · B )by (rule MMI_axmulcom)
from S29 have S30: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B · D ) = ( D · B ) by (rule MMI_ad2ant2l)from S30 have S31: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) + ( A · D ) ) + ( B · D ) ) =( ( ( A · C ) + ( A · D ) ) + ( D · B ) )by (rule MMI_opreq2d)
have S32: ( ( A · C ) ∈ C ∧ ( A · D ) ∈ C ∧ ( B · D ) ∈ C ) −→( ( ( A · C ) + ( A · D ) ) + ( B · D ) ) =( ( A · C ) + ( ( A · D ) + ( B · D ) ) )by (rule MMI_axaddass)from S18 have S33:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→ ( A · C ) ∈ C .
from S23 have S34: ( A ∈ C ∧ D ∈ C ) −→ ( A · D ) ∈ C .
from S34 have S35: ( A ∈ C ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A · D ) ∈ C by (rule MMI_adantrl)
from S35 have S36: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A · D ) ∈ C by (rule MMI_adantlr)
from S24 have S37: ( B ∈ C ∧ D ∈ C ) −→ ( B · D ) ∈ C .
from S37 have S38: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B · D ) ∈ C by (rule MMI_ad2ant2l)from S32 S33 S36 S38 have S39:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) + ( A · D ) ) + ( B · D ) ) =( ( A · C ) + ( ( A · D ) + ( B · D ) ) ) by (rule MMI_syl3anc)
have S40: ( ( A · C ) ∈ C ∧ ( A · D ) ∈ C ∧ ( D · B ) ∈ C ) −→( ( ( A · C ) + ( A · D ) ) + ( D · B ) ) =( ( ( A · C ) + ( D · B ) ) + ( A · D ) ) by (rule MMI_add23t)
from S18 have S41:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→ ( A · C ) ∈ C .

1136

from S36 have S42: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A · D ) ∈ C .
have S43: ( D ∈ C ∧ B ∈ C ) −→ ( D · B ) ∈ C by (rule MMI_axmulcl)
from S43 have S44: ( B ∈ C ∧ D ∈ C ) −→ ( D · B ) ∈ C
by (rule MMI_ancoms)
from S44 have S45: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( D · B ) ∈ C by (rule MMI_ad2ant2l)from S40 S41 S42 S45 have S46:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) + ( A · D ) ) + ( D · B ) ) =( ( ( A · C ) + ( D · B ) ) + ( A · D ) ) by (rule MMI_syl3anc)
from S31 S39 S46 have S47:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · C ) + ( ( A · D ) + ( B · D ) ) ) =( ( ( A · C ) + ( D · B ) ) + ( A · D ) ) by (rule MMI_3eqtr3d)
have S48: ( B ∈ C ∧ C ∈ C ) −→ ( B · C ) = ( C · B )by (rule MMI_axmulcom)
from S48 have S49: ( ( A ∈ C ∧ D ∈ C ) ∧ ( B ∈ C ∧ C ∈ C ) ) −→( B · C ) = ( C · B ) by (rule MMI_adantl)
from S49 have S50: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B · C ) = ( C · B ) by (rule MMI_an42s)
from S47 S50 have S51: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C )) −→( ( ( A · C ) + ( ( A · D ) + ( B · D ) ) ) + ( B · C ) ) =( ( ( ( A · C ) + ( D · B ) ) + ( A · D ) ) + ( C · B ) )by (rule MMI_opreq12d)
have S52:( ( ( A · C ) + ( D · B ) ) ∈ C ∧ ( A · D ) ∈ C ∧( C · B ) ∈ C ) −→( ( ( ( A · C ) + ( D · B ) ) + ( A · D ) ) + ( C · B ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )by (rule MMI_axaddass)have S53: ( ( A · C ) ∈ C ∧ ( D · B ) ∈ C ) −→( ( A · C ) + ( D · B ) ) ∈ C by (rule MMI_axaddcl)
from S17 have S54: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) ∈ C .
from S44 have S55: ( B ∈ C ∧ D ∈ C ) −→ ( D · B ) ∈ C .
from S53 S54 S55 have S56:
( ( A ∈ C ∧ C ∈ C ) ∧ ( B ∈ C ∧ D ∈ C ) ) −→( ( A · C ) + ( D · B ) ) ∈ C by (rule MMI_syl2an)
from S56 have S57: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · C ) + ( D · B ) ) ∈ C by (rule MMI_an4s)
from S36 have S58: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A · D ) ∈ C .

1137

have S59: ( C ∈ C ∧ B ∈ C ) −→ ( C · B ) ∈ C by (rule MMI_axmulcl)
from S59 have S60: ( B ∈ C ∧ C ∈ C ) −→ ( C · B ) ∈ C
by (rule MMI_ancoms)
from S60 have S61: ( ( A ∈ C ∧ D ∈ C ) ∧ ( B ∈ C ∧ C ∈ C ) ) −→( C · B ) ∈ C by (rule MMI_adantl)
from S61 have S62: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( C · B ) ∈ C by (rule MMI_an42s)
from S52 S57 S58 S62 have S63:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( ( A · C ) + ( D · B ) ) + ( A · D ) ) + ( C · B ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )by (rule MMI_syl3anc)
from S28 S51 S63 have S64:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) + ( B · C ) ) + ( ( A · D ) + ( B · D ) ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )by (rule MMI_3eqtrd)
from S8 S15 S64 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + B ) · ( C + D ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )by (rule MMI_3eqtrd)
qed

lemma (in MMIsar0) MMI_muladd11t:
shows ( A ∈ C ∧ B ∈ C ) −→ ( ( 1 + A ) · ( 1 + B ) ) =( ( 1 + A ) + ( B + ( A · B ) ) )proof have S1: 1 ∈ C by (rule MMI_1cn)
have S2: ( ( 1 + A ) ∈ C ∧ 1 ∈ C ∧ B ∈ C ) −→( ( 1 + A ) · ( 1 + B ) ) =( ( ( 1 + A ) · 1 ) + ( ( 1 + A ) · B ) )by (rule MMI_axdistr)
from S1 S2 have S3: ( ( 1 + A ) ∈ C ∧ B ∈ C ) −→( ( 1 + A ) · ( 1 + B ) ) =( ( ( 1 + A ) · 1 ) + ( ( 1 + A ) · B ) )by (rule MMI_mp3an2)
have S4: 1 ∈ C by (rule MMI_1cn)
have S5: ( 1 ∈ C ∧ A ∈ C ) −→ ( 1 + A ) ∈ C by (rule MMI_axaddcl)
from S4 S5 have S6: A ∈ C −→ ( 1 + A ) ∈ C by (rule MMI_mpan)
from S3 S6 have S7: ( A ∈ C ∧ B ∈ C ) −→( ( 1 + A ) · ( 1 + B ) ) =( ( ( 1 + A ) · 1 ) + ( ( 1 + A ) · B ) ) by (rule MMI_sylan)
from S6 have S8: A ∈ C −→ ( 1 + A ) ∈ C .
have S9: ( 1 + A ) ∈ C −→ ( ( 1 + A ) · 1 ) = ( 1 + A )1138

by (rule MMI_ax1id)
from S8 S9 have S10: A ∈ C −→ ( ( 1 + A ) · 1 ) = ( 1 + A )by (rule MMI_syl)from S10 have S11: ( A ∈ C ∧ B ∈ C ) −→( ( 1 + A ) · 1 ) = ( 1 + A ) by (rule MMI_adantr)
have S12: 1 ∈ C by (rule MMI_1cn)
have S13: ( 1 ∈ C ∧ A ∈ C ∧ B ∈ C ) −→ ( ( 1 + A ) · B ) =( ( 1 · B ) + ( A · B ) ) by (rule MMI_adddirt)
from S12 S13 have S14: ( A ∈ C ∧ B ∈ C ) −→ ( ( 1 + A ) · B ) =( ( 1 · B ) + ( A · B ) ) by (rule MMI_mp3an1)
have S15: B ∈ C −→ ( 1 · B ) = B by (rule MMI_mulid2t)
from S15 have S16: ( A ∈ C ∧ B ∈ C ) −→ ( 1 · B ) = B
by (rule MMI_adantl)
from S16 have S17:
( A ∈ C ∧ B ∈ C ) −→ ( ( 1 · B ) + ( A · B ) ) =( B + ( A · B ) ) by (rule MMI_opreq1d)
from S14 S17 have S18:
( A ∈ C ∧ B ∈ C ) −→ ( ( 1 + A ) · B ) =( B + ( A · B ) ) by (rule MMI_eqtrd)
from S11 S18 have S19: ( A ∈ C ∧ B ∈ C ) −→( ( ( 1 + A ) · 1 ) + ( ( 1 + A ) · B ) ) =( ( 1 + A ) + ( B + ( A · B ) ) ) by (rule MMI_opreq12d)
from S7 S19 show ( A ∈ C ∧ B ∈ C ) −→( ( 1 + A ) · ( 1 + B ) ) =( ( 1 + A ) + ( B + ( A · B ) ) )by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_mul12: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A · ( B · C ) ) = ( B · ( A · C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: ( A · B ) = ( B · A ) by (rule MMI_mulcom)
from S3 have S4: ( ( A · B ) · C ) = ( ( B · A ) · C )by (rule MMI_opreq1i)
from A1 have S5: A ∈ C.
from A2 have S6: B ∈ C.
from A3 have S7: C ∈ C.
from S5 S6 S7 have S8: ( ( A · B ) · C ) = ( A · ( B · C ) )by (rule MMI_mulass)from A2 have S9: B ∈ C.
from A1 have S10: A ∈ C.
from A3 have S11: C ∈ C.
from S9 S10 S11 have S12: ( ( B · A ) · C ) = ( B · ( A · C ) )by (rule MMI_mulass)from S4 S8 S12 show ( A · ( B · C ) ) = ( B · ( A · C ) )1139

by (rule MMI_3eqtr3)
qed
lemma (in MMIsar0) MMI_mul23: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A · B ) · C ) = ( ( A · C ) · B )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A · B ) · C ) =( ( A · C ) · B ) by (rule MMI_mul23t)
from S1 S2 S3 S4 show ( ( A · B ) · C ) = ( ( A · C ) · B )by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_mul4: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: D ∈ C
shows ( ( A · B ) · ( C · D ) ) = ( ( A · C ) · ( B · D ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: A ∈ C ∧ B ∈ C by (rule MMI_pm3_2i)
from A3 have S4: C ∈ C.
from A4 have S5: D ∈ C.
from S4 S5 have S6: C ∈ C ∧ D ∈ C by (rule MMI_pm3_2i)
have S7: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · B ) · ( C · D ) ) = ( ( A · C ) · ( B · D ) )by (rule MMI_mul4t)
from S3 S6 S7 show ( ( A · B ) · ( C · D ) ) = ( ( A · C ) · ( B · D) )by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_muladd: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: D ∈ C
shows ( ( A + B ) · ( C + D ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: A ∈ C ∧ B ∈ C by (rule MMI_pm3_2i)
from A3 have S4: C ∈ C.
from A4 have S5: D ∈ C.

1140

from S4 S5 have S6: C ∈ C ∧ D ∈ C by (rule MMI_pm3_2i)
have S7: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) · ( C + D ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )by (rule MMI_muladdt)
from S3 S6 S7 show
( ( A + B ) · ( C + D ) ) =( ( ( A · C ) + ( D · B ) ) + ( ( A · D ) + ( C · B ) ) )by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_subdit:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( B - C ) ) = ( ( A · B ) - ( A · C ) )proof have S1: ( A ∈ C ∧ C ∈ C ∧ ( B - C ) ∈ C ) −→( A · ( C + ( B - C ) ) ) =( ( A · C ) + ( A · ( B - C ) ) ) by (rule MMI_axdistr)
have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ A ∈ C by (rule MMI_3simp1)
have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
have S4: ( B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C by (rule MMI_subclt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C
by (rule MMI_3adant1)
from S1 S2 S3 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( C + ( B - C ) ) ) =( ( A · C ) + ( A · ( B - C ) ) ) by (rule MMI_syl3anc)
have S7: ( C ∈ C ∧ B ∈ C ) −→ ( C + ( B - C ) ) = B by (rule MMI_pncan3t)
from S7 have S8: ( B ∈ C ∧ C ∈ C ) −→ ( C + ( B - C ) ) = B by(rule MMI_ancoms)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( C + ( B - C )) = B by (rule MMI_3adant1)
from S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( C + ( B - C ) ) ) = ( A · B ) by (rule MMI_opreq2d)
from S6 S10 have S11: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · C ) + ( A · ( B - C ) ) ) = ( A · B ) by (rule MMI_eqtr3d)
have S12: ( ( A · B ) ∈ C ∧ ( A · C ) ∈ C ∧ ( A · ( B - C ) ) ∈ C) −→( ( ( A · B ) - ( A · C ) ) = ( A · ( B - C ) ) ←→( ( A · C ) + ( A · ( B - C ) ) ) = ( A · B ) ) by (rule MMI_subaddt)
have S13: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) ∈ C by (rule MMI_axmulcl)
from S13 have S14: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · B ) ∈ C
by (rule MMI_3adant3)
have S15: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) ∈ C by (rule MMI_axmulcl)
from S15 have S16: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · C ) ∈ C
by (rule MMI_3adant2)
have S17: ( A ∈ C ∧ ( B - C ) ∈ C ) −→ ( A · ( B - C ) ) ∈ C

1141

by (rule MMI_axmulcl)
from S4 have S18: ( B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C .
from S17 S18 have S19: ( A ∈ C ∧ ( B ∈ C ∧ C ∈ C ) ) −→( A · ( B - C ) ) ∈ C by (rule MMI_sylan2)
from S19 have S20: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( B - C ) ) ∈ C by (rule MMI_3impb)
from S12 S14 S16 S20 have S21: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( ( A · B ) - ( A · C ) ) = ( A · ( B - C ) ) ←→( ( A · C ) + ( A · ( B - C ) ) ) = ( A · B ) ) by (rule MMI_syl3anc)
from S11 S21 have S22: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) - ( A · C ) ) = ( A · ( B - C ) ) by (rule MMI_mpbird)from S22 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( B - C ) ) = ( ( A · B ) - ( A · C ) ) by (rule MMI_eqcomd)
qed
lemma (in MMIsar0) MMI_subdirt:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) · C ) = ( ( A · C ) - ( B · C ) )proof have S1: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( C · ( A - B ) ) = ( ( C · A ) - ( C · B ) ) by (rule MMI_subdit)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( C · ( A - B ) ) = ( ( C · A ) - ( C · B ) ) by (rule MMI_3coml)have S3: ( ( A - B ) ∈ C ∧ C ∈ C ) −→( ( A - B ) · C ) = ( C · ( A - B ) ) by (rule MMI_axmulcom)
have S4: ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C by (rule MMI_subclt)
from S3 S4 have S5: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A - B ) · C ) = ( C · ( A - B ) ) by (rule MMI_sylan)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) · C ) = ( C · ( A - B ) ) by (rule MMI_3impa)
have S7: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) = ( C · A ) by (rule MMI_axmulcom)
from S7 have S8: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( A · C ) = ( C ·A )by (rule MMI_3adant2)
have S9: ( B ∈ C ∧ C ∈ C ) −→ ( B · C ) = ( C · B ) by (rule MMI_axmulcom)
from S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( B · C ) = ( C· B )by (rule MMI_3adant1)
from S8 S10 have S11: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · C ) - ( B · C ) ) = ( ( C · A ) - ( C · B ) )by (rule MMI_opreq12d)
from S2 S6 S11 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) · C ) = ( ( A · C ) - ( B · C ) ) by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_subdi: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( A · ( B - C ) ) = ( ( A · B ) - ( A · C ) )1142

proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · ( B - C ) ) = ( ( A · B ) - ( A · C ) ) by (rule MMI_subdit)
from S1 S2 S3 S4 show ( A · ( B - C ) ) = ( ( A · B ) - ( A · C ) )by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_subdir: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A - B ) · C ) = ( ( A · C ) - ( B · C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) · C ) = ( ( A · C ) - ( B · C ) ) by (rule MMI_subdirt)
from S1 S2 S3 S4 show ( ( A - B ) · C ) = ( ( A · C ) - ( B · C ) )by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_mul01: assumes A1: A ∈ Cshows ( A · 0 ) = 0
proof from A1 have S1: A ∈ C.
have S2: 0 ∈ C by (rule MMI_0cn)
have S3: 0 ∈ C by (rule MMI_0cn)from S1 S2 S3 have S4: ( A · ( 0 - 0 ) ) = ( ( A · 0 ) - ( A · 0 ))by (rule MMI_subdi)
have S5: 0 ∈ C by (rule MMI_0cn)from S5 have S6: ( 0 - 0 ) = 0 by (rule MMI_subid)from S6 have S7: ( A · ( 0 - 0 ) ) = ( A · 0 ) by (rule MMI_opreq2i)
from A1 have S8: A ∈ C.
have S9: 0 ∈ C by (rule MMI_0cn)from S8 S9 have S10: ( A · 0 ) ∈ C by (rule MMI_mulcl)
from S10 have S11: ( ( A · 0 ) - ( A · 0 ) ) = 0 by (rule MMI_subid)from S4 S7 S11 show ( A · 0 ) = 0 by (rule MMI_3eqtr3)
qed
lemma (in MMIsar0) MMI_mul02: assumes A1: A ∈ Cshows ( 0 · A ) = 0
proof have S1: 0 ∈ C by (rule MMI_0cn)1143

from A1 have S2: A ∈ C.
from S1 S2 have S3: ( 0 · A ) = ( A · 0 ) by (rule MMI_mulcom)
from A1 have S4: A ∈ C.
from S4 have S5: ( A · 0 ) = 0 by (rule MMI_mul01)
from S3 S5 show ( 0 · A ) = 0 by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_1p1times: assumes A1: A ∈ Cshows ( ( 1 + 1 ) · A ) = ( A + A )proof have S1: 1 ∈ C by (rule MMI_1cn)
have S2: 1 ∈ C by (rule MMI_1cn)from A1 have S3: A ∈ C.
from S1 S2 S3 have S4: ( ( 1 + 1 ) · A ) = ( ( 1 · A ) + ( 1 · A ))by (rule MMI_adddir)
from A1 have S5: A ∈ C.
from S5 have S6: ( 1 · A ) = A by (rule MMI_mulid2)
from S6 have S7: ( 1 · A ) = A .
from S6 S7 have S8: ( ( 1 · A ) + ( 1 · A ) ) = ( A + A )by (rule MMI_opreq12i)
from S4 S8 show ( ( 1 + 1 ) · A ) = ( A + A )by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_mul01t:
shows A ∈ C −→ ( A · 0 ) = 0
proof have S1: A = if ( A ∈ C , A , 0 ) −→( A · 0 ) = ( if ( A ∈ C , A , 0 ) · 0 ) by (rule MMI_opreq1)
from S1 have S2: A = if ( A ∈ C , A , 0 ) −→( ( A · 0 ) = 0 ←→ ( if ( A ∈ C , A , 0 ) · 0 ) = 0 ) by (rule MMI_eqeq1d)
have S3: 0 ∈ C by (rule MMI_0cn)from S3 have S4: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)from S4 have S5: ( if ( A ∈ C , A , 0 ) · 0 ) = 0 by (rule MMI_mul01)
from S2 S5 show A ∈ C −→ ( A · 0 ) = 0 by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_mul02t:
shows A ∈ C −→ ( 0 · A ) = 0
proof have S1: 0 ∈ C by (rule MMI_0cn)
have S2: ( 0 ∈ C ∧ A ∈ C ) −→ ( 0 · A ) = ( A · 0 ) by (rule MMI_axmulcom)
from S1 S2 have S3: A ∈ C −→ ( 0 · A ) = ( A · 0 ) by (rule MMI_mpan)
have S4: A ∈ C −→ ( A · 0 ) = 0 by (rule MMI_mul01t)
from S3 S4 show A ∈ C −→ ( 0 · A ) = 0 by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_mulneg1: assumes A1: A ∈ C and1144

A2: B ∈ Cshows ( ( (- A) ) · B ) = ( - ( A · B ) )proof from A2 have S1: B ∈ C.
from S1 have S2: ( B · 0 ) = 0 by (rule MMI_mul01)
from A2 have S3: B ∈ C.
from A1 have S4: A ∈ C.
from S3 S4 have S5: ( B · A ) = ( A · B ) by (rule MMI_mulcom)
from S2 S5 have S6: ( ( B · 0 ) - ( B · A ) ) = ( 0 - ( A · B ) )by (rule MMI_opreq12i)
have S7: ( (- A) ) = ( 0 - A ) by (rule MMI_df_neg)
from S7 have S8: ( ( (- A) ) · B ) = ( ( 0 - A ) · B )by (rule MMI_opreq1i)
have S9: 0 ∈ C by (rule MMI_0cn)from A1 have S10: A ∈ C.
from S9 S10 have S11: ( 0 - A ) ∈ C by (rule MMI_subcl)
from A2 have S12: B ∈ C.
from S11 S12 have S13: ( ( 0 - A ) · B ) = ( B · ( 0 - A ) )by (rule MMI_mulcom)
from A2 have S14: B ∈ C.
have S15: 0 ∈ C by (rule MMI_0cn)from A1 have S16: A ∈ C.
from S14 S15 S16 have
S17: ( B · ( 0 - A ) ) = ( ( B · 0 ) - ( B · A ) )by (rule MMI_subdi)
from S8 S13 S17 have
S18: ( ( (- A) ) · B ) = ( ( B · 0 ) - ( B · A ) ) by (rule MMI_3eqtr)
have S19: ( - ( A · B ) ) = ( 0 - ( A · B ) ) by (rule MMI_df_neg)
from S6 S18 S19 show ( ( (- A) ) · B ) = ( - ( A · B ) )by (rule MMI_3eqtr4)
qed

lemma (in MMIsar0) MMI_mulneg2: assumes A1: A ∈ C andA2: B ∈ C
shows ( A · ( (- B) ) ) =( - ( A · B ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S2 have S3: ( (- B) ) ∈ C by (rule MMI_negcl)
from S1 S3 have S4: ( A · ( (- B) ) ) =( ( (- B) ) · A ) by (rule MMI_mulcom)
from A2 have S5: B ∈ C.
from A1 have S6: A ∈ C.
from S5 S6 have S7: ( ( (- B) ) · A ) =( - ( B · A ) ) by (rule MMI_mulneg1)
from A2 have S8: B ∈ C.

1145

from A1 have S9: A ∈ C.
from S8 S9 have S10: ( B · A ) = ( A · B ) by (rule MMI_mulcom)
from S10 have S11: ( - ( B · A ) ) =( - ( A · B ) ) by (rule MMI_negeqi)
from S4 S7 S11 show ( A · ( (- B) ) ) =( - ( A · B ) ) by (rule MMI_3eqtr)
qedlemma (in MMIsar0) MMI_mul2neg: assumes A1: A ∈ C andA2: B ∈ C
shows ( ( (- A) ) · ( (- B) ) ) =( A · B )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S2 have S3: ( (- B) ) ∈ C by (rule MMI_negcl)
from S1 S3 have S4: ( ( (- A) ) · ( (- B) ) ) =( - ( A · ( (- B) ) ) ) by (rule MMI_mulneg1)
from A1 have S5: A ∈ C.
from S3 have S6: ( (- B) ) ∈ C .
from S5 S6 have S7: ( A · ( (- B) ) ) =( ( (- B) ) · A ) by (rule MMI_mulcom)
from A2 have S8: B ∈ C.
from A1 have S9: A ∈ C.
from S8 S9 have S10: ( ( (- B) ) · A ) =( - ( B · A ) ) by (rule MMI_mulneg1)
from S7 S10 have S11: ( A · ( (- B) ) ) =( - ( B · A ) ) by (rule MMI_eqtr)
from S11 have S12: ( - ( A · ( (- B) ) ) ) =( - ( - ( B · A ) ) ) by (rule MMI_negeqi)
from A2 have S13: B ∈ C.
from A1 have S14: A ∈ C.
from S13 S14 have S15: ( B · A ) ∈ C by (rule MMI_mulcl)
from S15 have S16: ( - ( - ( B · A ) ) ) =( B · A ) by (rule MMI_negneg)from S4 S12 S16 have S17: ( ( (- A) ) · ( (- B) ) ) =( B · A ) by (rule MMI_3eqtr)
from A2 have S18: B ∈ C.
from A1 have S19: A ∈ C.
from S18 S19 have S20: ( B · A ) = ( A · B ) by (rule MMI_mulcom)
from S17 S20 show ( ( (- A) ) · ( (- B) ) ) =( A · B ) by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_negdi: assumes A1: A ∈ C andA2: B ∈ C
shows ( - ( A + B ) ) =( ( (- A) ) + ( (- B) ) )proof -

1146

from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: ( A + B ) ∈ C by (rule MMI_addcl)
from S3 have S4: ( 1 · ( A + B ) ) =( A + B ) by (rule MMI_mulid2)
from S4 have S5: ( - ( 1 · ( A + B ) ) ) =( - ( A + B ) ) by (rule MMI_negeqi)
have S6: 1 ∈ C by (rule MMI_1cn)from S6 have S7: ( - 1 ) ∈ C by (rule MMI_negcl)
from A1 have S8: A ∈ C.
from A2 have S9: B ∈ C.
from S7 S8 S9 have S10: ( ( - 1 ) · ( A + B ) ) =( ( ( - 1 ) · A ) + ( ( - 1 ) · B ) ) by (rule MMI_adddi)
have S11: 1 ∈ C by (rule MMI_1cn)from S3 have S12: ( A + B ) ∈ C .
from S11 S12 have S13: ( ( - 1 ) · ( A + B ) ) =( - ( 1 · ( A + B ) ) ) by (rule MMI_mulneg1)
have S14: 1 ∈ C by (rule MMI_1cn)from A1 have S15: A ∈ C.
from S14 S15 have S16: ( ( - 1 ) · A ) =( - ( 1 · A ) ) by (rule MMI_mulneg1)
from A1 have S17: A ∈ C.
from S17 have S18: ( 1 · A ) = A by (rule MMI_mulid2)
from S18 have S19: ( - ( 1 · A ) ) = ( (- A) ) by (rule MMI_negeqi)
from S16 S19 have S20: ( ( - 1 ) · A ) = ( (- A) ) by (rule MMI_eqtr)
have S21: 1 ∈ C by (rule MMI_1cn)from A2 have S22: B ∈ C.
from S21 S22 have S23: ( ( - 1 ) · B ) =( - ( 1 · B ) ) by (rule MMI_mulneg1)
from A2 have S24: B ∈ C.
from S24 have S25: ( 1 · B ) = B by (rule MMI_mulid2)
from S25 have S26: ( - ( 1 · B ) ) = ( (- B) ) by (rule MMI_negeqi)
from S23 S26 have S27: ( ( - 1 ) · B ) = ( (- B) ) by (rule MMI_eqtr)
from S20 S27 have S28: ( ( ( - 1 ) · A ) + ( ( - 1 ) · B ) ) =( ( (- A) ) + ( (- B) ) ) by (rule MMI_opreq12i)
from S10 S13 S28 have S29: ( - ( 1 · ( A + B ) ) ) =( ( (- A) ) + ( (- B) ) ) by (rule MMI_3eqtr3)
from S5 S29 show ( - ( A + B ) ) =( ( (- A) ) + ( (- B) ) ) by (rule MMI_eqtr3)
qed
lemma (in MMIsar0) MMI_negsubdi: assumes A1: A ∈ C andA2: B ∈ C
shows ( - ( A - B ) ) =( ( (- A) ) + B )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S2 have S3: ( (- B) ) ∈ C by (rule MMI_negcl)

1147

from S1 S3 have S4: ( - ( A + ( (- B) ) ) ) =( ( (- A) ) + ( - ( (- B) ) ) ) by (rule MMI_negdi)
from A1 have S5: A ∈ C.
from A2 have S6: B ∈ C.
from S5 S6 have S7: ( A + ( (- B) ) ) = ( A - B ) by (rule MMI_negsub)
from S7 have S8: ( - ( A + ( (- B) ) ) ) =( - ( A - B ) ) by (rule MMI_negeqi)
from A2 have S9: B ∈ C.
from S9 have S10: ( - ( (- B) ) ) = B by (rule MMI_negneg)from S10 have S11: ( ( (- A) ) + ( - ( (- B) ) ) ) =( ( (- A) ) + B ) by (rule MMI_opreq2i)
from S4 S8 S11 show ( - ( A - B ) ) =( ( (- A) ) + B ) by (rule MMI_3eqtr3)
qed
lemma (in MMIsar0) MMI_negsubdi2: assumes A1: A ∈ C andA2: B ∈ C
shows ( - ( A - B ) ) = ( B - A )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: ( - ( A - B ) ) =( ( (- A) ) + B ) by (rule MMI_negsubdi)
from A1 have S4: A ∈ C.
from S4 have S5: ( (- A) ) ∈ C by (rule MMI_negcl)
from A2 have S6: B ∈ C.
from S5 S6 have S7: ( ( (- A) ) + B ) =( B + ( (- A) ) ) by (rule MMI_addcom)
from A2 have S8: B ∈ C.
from A1 have S9: A ∈ C.
from S8 S9 have S10: ( B + ( (- A) ) ) = ( B - A ) by (rule MMI_negsub)
from S3 S7 S10 show ( - ( A - B ) ) = ( B - A ) by (rule MMI_3eqtr)
qedlemma (in MMIsar0) MMI_mulneg1t:
shows ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · B ) =( - ( A · B ) )proof have S1: A =if ( A ∈ C , A , 0 ) −→( (- A) ) =( - if ( A ∈ C , A , 0 ) ) by (rule MMI_negeq)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→( ( (- A) ) · B ) =( ( - if ( A ∈ C , A , 0 ) ) · B ) by (rule MMI_opreq1d)
have S3: A =if ( A ∈ C , A , 0 ) −→1148

( A · B ) =( if ( A ∈ C , A , 0 ) · B ) by (rule MMI_opreq1)
from S3 have S4: A =if ( A ∈ C , A , 0 ) −→( - ( A · B ) ) =( - ( if ( A ∈ C , A , 0 ) · B ) ) by (rule MMI_negeqd)
from S2 S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( ( (- A) ) · B ) =( - ( A · B ) ) ←→( ( - if ( A ∈ C , A , 0 ) ) · B ) =( - ( if ( A ∈ C , A , 0 ) · B ) ) ) by (rule MMI_eqeq12d)
have S6: B =if ( B ∈ C , B , 0 ) −→( ( - if ( A ∈ C , A , 0 ) ) · B ) =( ( - if ( A ∈ C , A , 0 ) ) · if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
have S7: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) · B ) =( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( - ( if ( A ∈ C , A , 0 ) · B ) ) =( - ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) ) by (rule MMI_negeqd)
from S6 S8 have S9: B =if ( B ∈ C , B , 0 ) −→( ( ( - if ( A ∈ C , A , 0 ) ) · B ) =( - ( if ( A ∈ C , A , 0 ) · B ) ) ←→( ( - if ( A ∈ C , A , 0 ) ) · if ( B ∈ C , B , 0 ) ) =( - ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) ) ) by (rule MMI_eqeq12d)
have S10: 0 ∈ C by (rule MMI_0cn)from S10 have S11: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S12: 0 ∈ C by (rule MMI_0cn)from S12 have S13: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S11 S13 have S14: ( ( - if ( A ∈ C , A , 0 ) ) · if ( B ∈ C, B , 0 ) ) =( - ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) ) by (rule MMI_mulneg1)
from S5 S9 S14 show ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · B ) =( - ( A · B ) ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_mulneg2t:
shows ( A ∈ C ∧ B ∈ C ) −→( A · ( (- B) ) ) =( - ( A · B ) )proof have S1: ( B ∈ C ∧ A ∈ C ) −→( ( (- B) ) · A ) =1149

( - ( B · A ) ) by (rule MMI_mulneg1t)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→( ( (- B) ) · A ) =( - ( B · A ) ) by (rule MMI_ancoms)
have S3: ( A ∈ C ∧ ( (- B) ) ∈ C ) −→( A · ( (- B) ) ) =( ( (- B) ) · A ) by (rule MMI_axmulcom)
have S4: B ∈ C −→ ( (- B) ) ∈ C by (rule MMI_negclt)
from S3 S4 have S5: ( A ∈ C ∧ B ∈ C ) −→( A · ( (- B) ) ) =( ( (- B) ) · A ) by (rule MMI_sylan2)
have S6: ( A ∈ C ∧ B ∈ C ) −→( A · B ) = ( B · A ) by (rule MMI_axmulcom)
from S6 have S7: ( A ∈ C ∧ B ∈ C ) −→( - ( A · B ) ) =( - ( B · A ) ) by (rule MMI_negeqd)
from S2 S5 S7 show ( A ∈ C ∧ B ∈ C ) −→( A · ( (- B) ) ) =( - ( A · B ) ) by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_mulneg12t:
shows ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · B ) =( A · ( (- B) ) )proof have S1: ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · B ) =( - ( A · B ) ) by (rule MMI_mulneg1t)
have S2: ( A ∈ C ∧ B ∈ C ) −→( A · ( (- B) ) ) =( - ( A · B ) ) by (rule MMI_mulneg2t)
from S1 S2 show ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · B ) =( A · ( (- B) ) ) by (rule MMI_eqtr4d)
qed
lemma (in MMIsar0) MMI_mul2negt:
shows ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · ( (- B) ) ) =( A · B )proof have S1: A =if ( A ∈ C , A , 0 ) −→( (- A) ) =( - if ( A ∈ C , A , 0 ) ) by (rule MMI_negeq)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→( ( (- A) ) · ( (- B) ) ) =1150

( ( - if ( A ∈ C , A , 0 ) ) · ( (- B) ) ) by (rule MMI_opreq1d)
have S3: A =if ( A ∈ C , A , 0 ) −→( A · B ) =( if ( A ∈ C , A , 0 ) · B ) by (rule MMI_opreq1)
from S2 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( ( (- A) ) · ( (- B) ) ) =( A · B ) ←→( ( - if ( A ∈ C , A , 0 ) ) · ( (- B) ) ) =( if ( A ∈ C , A , 0 ) · B ) ) by (rule MMI_eqeq12d)
have S5: B =if ( B ∈ C , B , 0 ) −→( (- B) ) =( - if ( B ∈ C , B , 0 ) ) by (rule MMI_negeq)
from S5 have S6: B =if ( B ∈ C , B , 0 ) −→( ( - if ( A ∈ C , A , 0 ) ) · ( (- B) ) ) =( ( - if ( A ∈ C , A , 0 ) ) · ( - if ( B ∈ C , B , 0 ) ) ) by (ruleMMI_opreq2d)
have S7: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) · B ) =( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S6 S7 have S8: B =if ( B ∈ C , B , 0 ) −→( ( ( - if ( A ∈ C , A , 0 ) ) · ( (- B) ) ) =( if ( A ∈ C , A , 0 ) · B ) ←→( ( - if ( A ∈ C , A , 0 ) ) · ( - if ( B ∈ C , B , 0 ) ) ) =( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) ) by (rule MMI_eqeq12d)
have S9: 0 ∈ C by (rule MMI_0cn)from S9 have S10: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S11: 0 ∈ C by (rule MMI_0cn)from S11 have S12: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S10 S12 have S13: ( ( - if ( A ∈ C , A , 0 ) ) · ( - if ( B ∈C , B , 0 ) ) ) =( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) by (rule MMI_mul2neg)from S4 S8 S13 show ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) · ( (- B) ) ) =( A · B ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_negdit:
shows ( A ∈ C ∧ B ∈ C ) −→( - ( A + B ) ) =( ( (- A) ) + ( (- B) ) )proof have S1: A =if ( A ∈ C , A , 0 ) −→1151

( A + B ) =( if ( A ∈ C , A , 0 ) + B ) by (rule MMI_opreq1)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→( - ( A + B ) ) =( - ( if ( A ∈ C , A , 0 ) + B ) ) by (rule MMI_negeqd)
have S3: A =if ( A ∈ C , A , 0 ) −→( (- A) ) =( - if ( A ∈ C , A , 0 ) ) by (rule MMI_negeq)
from S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( (- A) ) + ( (- B) ) ) =( ( - if ( A ∈ C , A , 0 ) ) + ( (- B) ) ) by (rule MMI_opreq1d)
from S2 S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( - ( A + B ) ) =( ( (- A) ) + ( (- B) ) ) ←→( - ( if ( A ∈ C , A , 0 ) + B ) ) =( ( - if ( A ∈ C , A , 0 ) ) + ( (- B) ) ) ) by (rule MMI_eqeq12d)
have S6: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) + B ) =( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S6 have S7: B =if ( B ∈ C , B , 0 ) −→( - ( if ( A ∈ C , A , 0 ) + B ) ) =( - ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) ) by (rule MMI_negeqd)
have S8: B =if ( B ∈ C , B , 0 ) −→( (- B) ) =( - if ( B ∈ C , B , 0 ) ) by (rule MMI_negeq)
from S8 have S9: B =if ( B ∈ C , B , 0 ) −→( ( - if ( A ∈ C , A , 0 ) ) + ( (- B) ) ) =( ( - if ( A ∈ C , A , 0 ) ) + ( - if ( B ∈ C , B , 0 ) ) ) by (ruleMMI_opreq2d)
from S7 S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( - ( if ( A ∈ C , A , 0 ) + B ) ) =( ( - if ( A ∈ C , A , 0 ) ) + ( (- B) ) ) ←→( - ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) ) =( ( - if ( A ∈ C , A , 0 ) ) + ( - if ( B ∈ C , B , 0 ) ) ) ) by (ruleMMI_eqeq12d)
have S11: 0 ∈ C by (rule MMI_0cn)from S11 have S12: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S13: 0 ∈ C by (rule MMI_0cn)from S13 have S14: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S12 S14 have S15: ( - ( if ( A ∈ C , A , 0 ) + if ( B ∈ C ,1152

B , 0 ) ) ) =( ( - if ( A ∈ C , A , 0 ) ) + ( - if ( B ∈ C , B , 0 ) ) ) by (ruleMMI_negdi)
from S5 S10 S15 show ( A ∈ C ∧ B ∈ C ) −→( - ( A + B ) ) =( ( (- A) ) + ( (- B) ) ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_negdi2t:
shows ( A ∈ C ∧ B ∈ C ) −→( - ( A + B ) ) = ( ( (- A) ) - B )proof have S1: ( A ∈ C ∧ B ∈ C ) −→( - ( A + B ) ) =( ( (- A) ) + ( (- B) ) ) by (rule MMI_negdit)
have S2: ( ( (- A) ) ∈ C ∧ B ∈ C ) −→( ( (- A) ) + ( (- B) ) ) =( ( (- A) ) - B ) by (rule MMI_negsubt)
have S3: A ∈ C −→ ( (- A) ) ∈ C by (rule MMI_negclt)
from S2 S3 have S4: ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) + ( (- B) ) ) =( ( (- A) ) - B ) by (rule MMI_sylan)
from S1 S4 show ( A ∈ C ∧ B ∈ C ) −→( - ( A + B ) ) = ( ( (- A) ) - B )by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_negsubdit:
shows ( A ∈ C ∧ B ∈ C ) −→( - ( A - B ) ) = ( ( (- A) ) + B )proof have S1: ( A ∈ C ∧ ( (- B) ) ∈ C ) −→( - ( A + ( (- B) ) ) ) =( ( (- A) ) + ( - ( (- B) ) ) ) by (rule MMI_negdit)
have S2: B ∈ C −→ ( (- B) ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ) −→( - ( A + ( (- B) ) ) ) =( ( (- A) ) + ( - ( (- B) ) ) ) by (rule MMI_sylan2)
have S4: ( A ∈ C ∧ B ∈ C ) −→( A + ( (- B) ) ) = ( A - B ) by (rule MMI_negsubt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ) −→( - ( A + ( (- B) ) ) ) =( - ( A - B ) ) by (rule MMI_negeqd)
have S6: B ∈ C −→ ( - ( (- B) ) ) = B by (rule MMI_negnegt)
from S6 have S7: ( A ∈ C ∧ B ∈ C ) −→ ( - ( (- B) ) ) = B
by (rule MMI_adantl)
from S7 have S8: ( A ∈ C ∧ B ∈ C ) −→1153

( ( (- A) ) + ( - ( (- B) ) ) ) =( ( (- A) ) + B ) by (rule MMI_opreq2d)
from S3 S5 S8 show ( A ∈ C ∧ B ∈ C ) −→( - ( A - B ) ) = ( ( (- A) ) + B )by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_negsubdi2t:
shows ( A ∈ C ∧ B ∈ C ) −→( - ( A - B ) ) = ( B - A )proof have S1: ( A ∈ C ∧ B ∈ C ) −→( - ( A - B ) ) = ( ( (- A) ) + B ) by (rule MMI_negsubdit)
have S2: ( ( (- A) ) ∈ C ∧ B ∈ C ) −→( ( (- A) ) + B ) = ( B + ( (- A) ) ) by (rule MMI_axaddcom)
have S3: A ∈ C −→ ( (- A) ) ∈ C by (rule MMI_negclt)
from S2 S3 have S4: ( A ∈ C ∧ B ∈ C ) −→( ( (- A) ) + B ) = ( B + ( (- A) ) ) by (rule MMI_sylan)
have S5: ( B ∈ C ∧ A ∈ C ) −→( B + ( (- A) ) ) = ( B - A ) by (rule MMI_negsubt)
from S5 have S6: ( A ∈ C ∧ B ∈ C ) −→( B + ( (- A) ) ) = ( B - A ) by (rule MMI_ancoms)
from S1 S4 S6 show ( A ∈ C ∧ B ∈ C ) −→( - ( A - B ) ) = ( B - A )by (rule MMI_3eqtrd)
qed
lemma (in MMIsar0) MMI_subsub2t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( A + ( C - B ) )proof have S1: ( A ∈ C ∧ ( B - C ) ∈ C ) −→( A + ( - ( B - C ) ) ) =( A - ( B - C ) ) by (rule MMI_negsubt)
have S2: ( B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C by (rule MMI_subclt)
from S1 S2 have S3: ( A ∈ C ∧ ( B ∈ C ∧ C ∈ C ) ) −→( A + ( - ( B - C ) ) ) =( A - ( B - C ) ) by (rule MMI_sylan2)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( - ( B - C ) ) ) =( A - ( B - C ) ) by (rule MMI_3impb)
have S5: ( B ∈ C ∧ C ∈ C ) −→( - ( B - C ) ) = ( C - B ) by (rule MMI_negsubdi2t)from S5 have S6: ( B ∈ C ∧ C ∈ C ) −→( A + ( - ( B - C ) ) ) =( A + ( C - B ) ) by (rule MMI_opreq2d)
from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( - ( B - C ) ) ) =( A + ( C - B ) ) by (rule MMI_3adant1)

1154

from S4 S7 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( A + ( C - B ) )by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_subsubt:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( ( A - B ) + C )proof have S1: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( A + ( C - B ) ) by (rule MMI_subsub2t)
have S2: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( ( A + C ) - B ) = ( A + ( C - B ) ) by (rule MMI_addsubasst)
have S3: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( ( A + C ) - B ) = ( ( A - B ) + C ) by (rule MMI_addsubt)
from S2 S3 have S4: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( A + ( C - B ) ) = ( ( A - B ) + C ) by (rule MMI_eqtr3d)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( C - B ) ) = ( ( A - B ) + C ) by (rule MMI_3com23)
from S1 S5 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( ( A - B ) + C )by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_subsub3t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( ( A + C ) - B )proof have S1: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( A + ( C - B ) ) by (rule MMI_subsub2t)
have S2: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( ( A + C ) - B ) = ( A + ( C - B ) ) by (rule MMI_addsubasst)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + C ) - B ) = ( A + ( C - B ) ) by (rule MMI_3com23)
from S1 S3 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - C ) ) = ( ( A + C ) - B )by (rule MMI_eqtr4d)
qed
lemma (in MMIsar0) MMI_subsub4t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - C ) = ( A - ( B + C ) )proof have S1: ( A ∈ C ∧ B ∈ C ∧ ( - C ) ∈ C ) −→( A - ( B - ( - C ) ) ) =( ( A - B ) + ( - C ) ) by (rule MMI_subsubt)
have S2: C ∈ C −→ ( - C ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - ( - C ) ) ) =1155

( ( A - B ) + ( - C ) ) by (rule MMI_syl3an3)
have S4: ( B ∈ C ∧ C ∈ C ) −→( B - ( - C ) ) = ( B + C ) by (rule MMI_subnegt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B - ( - C ) ) = ( B + C ) by (rule MMI_3adant1)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B - ( - C ) ) ) =( A - ( B + C ) ) by (rule MMI_opreq2d)
have S7: ( ( A - B ) ∈ C ∧ C ∈ C ) −→( ( A - B ) + ( - C ) ) =( ( A - B ) - C ) by (rule MMI_negsubt)
have S8: ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C by (rule MMI_subclt)
from S7 S8 have S9: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A - B ) + ( - C ) ) =( ( A - B ) - C ) by (rule MMI_sylan)
from S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) + ( - C ) ) =( ( A - B ) - C ) by (rule MMI_3impa)
from S3 S6 S10 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - C ) = ( A - ( B + C ) )by (rule MMI_3eqtr3rd)
qed
lemma (in MMIsar0) MMI_sub23t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - C ) = ( ( A - C ) - B )proof have S1: ( B ∈ C ∧ C ∈ C ) −→( B + C ) = ( C + B ) by (rule MMI_axaddcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B + C ) = ( C + B ) by (rule MMI_3adant1)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( B + C ) ) = ( A - ( C + B ) ) by (rule MMI_opreq2d)
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - C ) = ( A - ( B + C ) ) by (rule MMI_subsub4t)
have S5: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( ( A - C ) - B ) = ( A - ( C + B ) ) by (rule MMI_subsub4t)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - C ) - B ) = ( A - ( C + B ) ) by (rule MMI_3com23)
from S3 S4 S6 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - C ) = ( ( A - C ) - B )by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_nnncant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B - C ) ) - C ) = ( A - B )proof have S1: ( A ∈ C ∧ ( B - C ) ∈ C ∧ C ∈ C ) −→1156

( ( A - ( B - C ) ) - C ) =( A - ( ( B - C ) + C ) ) by (rule MMI_subsub4t)
have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ A ∈ C by (rule MMI_3simp1)
have S3: ( B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C by (rule MMI_subclt)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B - C ) ∈ C by (rule MMI_3adant1)
have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
from S1 S2 S4 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B - C ) ) - C ) =( A - ( ( B - C ) + C ) ) by (rule MMI_syl3anc)
have S7: ( B ∈ C ∧ C ∈ C ) −→( ( B - C ) + C ) = B by (rule MMI_npcant)from S7 have S8: ( B ∈ C ∧ C ∈ C ) −→( A - ( ( B - C ) + C ) ) = ( A - B ) by (rule MMI_opreq2d)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( ( B - C ) + C ) ) = ( A - B ) by (rule MMI_3adant1)
from S6 S9 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B - C ) ) - C ) = ( A - B )by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_nnncan1t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - ( A - C ) ) = ( C - B )proof have S1: ( ( A - B ) ∈ C ∧ ( A - C ) ∈ C ) −→( ( A - B ) + ( - ( A - C ) ) ) =( ( A - B ) - ( A - C ) ) by (rule MMI_negsubt)
have S2: ( ( A - B ) ∈ C ∧ ( - ( A - C ) ) ∈ C ) −→( ( A - B ) + ( - ( A - C ) ) ) =( ( - ( A - C ) ) + ( A - B ) ) by (rule MMI_axaddcom)
have S3: ( A - C ) ∈ C −→ ( - ( A - C ) ) ∈ C
by (rule MMI_negclt)
from S2 S3 have S4: ( ( A - B ) ∈ C ∧ ( A - C ) ∈ C ) −→( ( A - B ) + ( - ( A - C ) ) ) =( ( - ( A - C ) ) + ( A - B ) ) by (rule MMI_sylan2)
from S1 S4 have S5: ( ( A - B ) ∈ C ∧ ( A - C ) ∈ C ) −→( ( A - B ) - ( A - C ) ) =( ( - ( A - C ) ) + ( A - B ) ) by (rule MMI_eqtr3d)
have S6: ( A ∈ C ∧ B ∈ C ) −→ ( A - B ) ∈ C by (rule MMI_subclt)
from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - B ) ∈ C by (rule MMI_3adant3)
have S8: ( A ∈ C ∧ C ∈ C ) −→ ( A - C ) ∈ C by (rule MMI_subclt)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - C ) ∈ C by (rule MMI_3adant2)
from S5 S7 S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - ( A - C ) ) =( ( - ( A - C ) ) + ( A - B ) ) by (rule MMI_sylanc)
have S11: ( A ∈ C ∧ C ∈ C ) −→1157

( - ( A - C ) ) = ( C - A ) by (rule MMI_negsubdi2t)from S11 have S12: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( - ( A - C ) ) = ( C - A ) by (rule MMI_3adant2)
from S12 have S13: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( - ( A - C ) ) + ( A - B ) ) =( ( C - A ) + ( A - B ) ) by (rule MMI_opreq1d)
have S14: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( ( C - A ) + ( A - B ) ) = ( C - B ) by (rule MMI_npncant)from S14 have S15: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( C - A ) + ( A - B ) ) = ( C - B ) by (rule MMI_3coml)from S10 S13 S15 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - B ) - ( A - C ) ) = ( C - B )by (rule MMI_3eqtrd)
qed

lemma (in MMIsar0) MMI_nnncan2t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - C ) - ( B - C ) ) = ( A - B )proof have S1: ( A ∈ C ∧ ( B - C ) ∈ C ∧ C ∈ C ) −→( ( A - ( B - C ) ) - C ) =( ( A - C ) - ( B - C ) ) by (rule MMI_sub23t)
have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ A ∈ C by (rule MMI_3simp1)
have S3: ( B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C by (rule MMI_subclt)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B - C ) ∈ C by (rule MMI_3adant1)
have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
from S1 S2 S4 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B - C ) ) - C ) =( ( A - C ) - ( B - C ) ) by (rule MMI_syl3anc)
have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B - C ) ) - C ) = ( A - B ) by (rule MMI_nnncant)from S6 S7 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - C ) - ( B - C ) ) = ( A - B ) by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_nncant:shows ( A ∈ C ∧ B ∈ C ) −→( A - ( A - B ) ) = B
proof have S1: 0 ∈ C by (rule MMI_0cn)
have S2: ( A ∈ C ∧ 0 ∈ C ∧ B ∈ C ) −→( ( A - 0 ) - ( A - B ) ) = ( B - 0 ) by (rule MMI_nnncan1t)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ) −→( ( A - 0 ) - ( A - B ) ) = ( B - 0 ) by (rule MMI_mp3an2)
have S4: A ∈ C −→ ( A - 0 ) = A by (rule MMI_subid1t)
from S4 have S5: ( A ∈ C ∧ B ∈ C ) −→ ( A - 0 ) = A

1158

by (rule MMI_adantr)
from S5 have S6: ( A ∈ C ∧ B ∈ C ) −→( ( A - 0 ) - ( A - B ) ) =( A - ( A - B ) ) by (rule MMI_opreq1d)
have S7: B ∈ C −→ ( B - 0 ) = B by (rule MMI_subid1t)
from S7 have S8: ( A ∈ C ∧ B ∈ C ) −→ ( B - 0 ) = B
by (rule MMI_adantl)
from S3 S6 S8 show ( A ∈ C ∧ B ∈ C ) −→( A - ( A - B ) ) = B by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_nppcan2t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B + C ) ) + C ) = ( A - B )proof have S1: ( A ∈ C ∧ ( B + C ) ∈ C ∧ C ∈ C ) −→( A - ( ( B + C ) - C ) ) =( ( A - ( B + C ) ) + C ) by (rule MMI_subsubt)
have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ A ∈ C by (rule MMI_3simp1)
have S3: ( B ∈ C ∧ C ∈ C ) −→ ( B + C ) ∈ C by (rule MMI_axaddcl)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B + C ) ∈ C by (rule MMI_3adant1)
have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
from S1 S2 S4 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( ( B + C ) - C ) ) =( ( A - ( B + C ) ) + C ) by (rule MMI_syl3anc)
have S7: ( B ∈ C ∧ C ∈ C ) −→( ( B + C ) - C ) = B by (rule MMI_pncant)from S7 have S8: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( B + C ) - C ) = B by (rule MMI_3adant1)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A - ( ( B + C ) - C ) ) = ( A - B ) by (rule MMI_opreq2d)
from S6 S9 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A - ( B + C ) ) + C ) = ( A - B ) by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_mulm1t:
shows A ∈ C −→ ( ( - 1 ) · A ) = ( (- A) )proof have S1: 1 ∈ C by (rule MMI_1cn)
have S2: ( 1 ∈ C ∧ A ∈ C ) −→( ( - 1 ) · A ) = ( - ( 1 · A ) ) by (rule MMI_mulneg1t)
from S1 S2 have S3: A ∈ C −→( ( - 1 ) · A ) = ( - ( 1 · A ) ) by (rule MMI_mpan)
have S4: A ∈ C −→ ( 1 · A ) = A by (rule MMI_mulid2t)
from S4 have S5: A ∈ C −→ ( - ( 1 · A ) ) = ( (- A) )by (rule MMI_negeqd)
from S3 S5 show A ∈ C −→ ( ( - 1 ) · A ) = ( (- A) )by (rule MMI_eqtrd)

1159

qed
lemma (in MMIsar0) MMI_mulm1: assumes A1: A ∈ Cshows ( ( - 1 ) · A ) = ( (- A) )proof from A1 have S1: A ∈ C.
have S2: A ∈ C −→ ( ( - 1 ) · A ) = ( (- A) ) by (rule MMI_mulm1t)
from S1 S2 show ( ( - 1 ) · A ) = ( (- A) ) by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_sub4t:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) - ( C + D ) ) =( ( A - C ) + ( B - D ) )proof have S1: ( C ∈ C ∧ D ∈ C ) −→( - ( C + D ) ) =( ( - C ) + ( - D ) ) by (rule MMI_negdit)
from S1 have S2: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( - ( C + D ) ) =( ( - C ) + ( - D ) ) by (rule MMI_adantl)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( - ( C + D ) ) ) =( ( A + B ) + ( ( - C ) + ( - D ) ) )by (rule MMI_opreq2d)
have S4:( ( A ∈ C ∧ B ∈ C ) ∧ ( ( - C ) ∈ C ∧ ( - D ) ∈ C ) ) −→( ( A + B ) + ( ( - C ) + ( - D ) ) ) =( ( A + ( - C ) ) + ( B + ( - D ) ) ) by (rule MMI_add4t)
have S5: C ∈ C −→ ( - C ) ∈ C by (rule MMI_negclt)
have S6: D ∈ C −→ ( - D ) ∈ C by (rule MMI_negclt)
from S5 S6 have S7: ( C ∈ C ∧ D ∈ C ) −→( ( - C ) ∈ C ∧ ( - D ) ∈ C ) by (rule MMI_anim12i)
from S4 S7 have S8: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + B ) + ( ( - C ) + ( - D ) ) ) =( ( A + ( - C ) ) + ( B + ( - D ) ) ) by (rule MMI_sylan2)
from S3 S8 have S9: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + B ) + ( - ( C + D ) ) ) =( ( A + ( - C ) ) + ( B + ( - D ) ) ) by (rule MMI_eqtrd)
have S10: ( ( A + B ) ∈ C ∧ ( C + D ) ∈ C ) −→( ( A + B ) + ( - ( C + D ) ) ) =( ( A + B ) - ( C + D ) ) by (rule MMI_negsubt)
have S11: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
have S12: ( C ∈ C ∧ D ∈ C ) −→ ( C + D ) ∈ C by (rule MMI_axaddcl)
from S10 S11 S12 have S13:1160

( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) + ( - ( C + D ) ) ) =( ( A + B ) - ( C + D ) ) by (rule MMI_syl2an)
have S14: ( A ∈ C ∧ C ∈ C ) −→( A + ( - C ) ) = ( A - C ) by (rule MMI_negsubt)
from S14 have S15: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( A + ( - C ) ) = ( A - C ) by (rule MMI_ad2ant2r)
have S16: ( B ∈ C ∧ D ∈ C ) −→( B + ( - D ) ) = ( B - D ) by (rule MMI_negsubt)
from S16 have S17: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( B + ( - D ) ) = ( B - D ) by (rule MMI_ad2ant2l)from S15 S17 have S18: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C )) −→( ( A + ( - C ) ) + ( B + ( - D ) ) ) =( ( A - C ) + ( B - D ) ) by (rule MMI_opreq12d)
from S9 S13 S18 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + B ) - ( C + D ) ) =( ( A - C ) + ( B - D ) ) by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_sub4: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: D ∈ C
shows ( ( A + B ) - ( C + D ) ) =( ( A - C ) + ( B - D ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: A ∈ C ∧ B ∈ C by (rule MMI_pm3_2i)
from A3 have S4: C ∈ C.
from A4 have S5: D ∈ C.
from S4 S5 have S6: C ∈ C ∧ D ∈ C by (rule MMI_pm3_2i)
have S7: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A + B ) - ( C + D ) ) =( ( A - C ) + ( B - D ) ) by (rule MMI_sub4t)
from S3 S6 S7 show ( ( A + B ) - ( C + D ) ) =( ( A - C ) + ( B - D ) ) by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_mulsubt:
shows ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A - B ) · ( C - D ) ) =( ( ( A · C ) + ( D · B ) ) - ( ( A · D ) + ( C · B ) ) )proof have S1: ( A ∈ C ∧ B ∈ C ) −→1161

( A + ( (- B) ) ) = ( A - B ) by (rule MMI_negsubt)
have S2: ( C ∈ C ∧ D ∈ C ) −→( C + ( - D ) ) = ( C - D ) by (rule MMI_negsubt)
from S1 S2 have S3: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + ( (- B) ) ) · ( C + ( - D ) ) ) =( ( A - B ) · ( C - D ) ) by (rule MMI_opreqan12d)
have S4: ( ( A ∈ C ∧ ( (- B) ) ∈ C ) ∧ ( C ∈ C ∧ ( - D ) ∈ C )) −→( ( A + ( (- B) ) ) · ( C + ( - D ) ) ) =( ( ( A · C ) + ( ( - D ) · ( (- B) ) ) ) + ( ( A · ( - D ) ) + ( C ·( (- B) ) ) ) ) by (rule MMI_muladdt)
have S5: D ∈ C −→ ( - D ) ∈ C by (rule MMI_negclt)
from S4 S5 have S6: ( ( A ∈ C ∧ ( (- B) ) ∈ C ) ∧ ( C ∈ C ∧ D∈ C ) ) −→( ( A + ( (- B) ) ) · ( C + ( - D ) ) ) =( ( ( A · C ) + ( ( - D ) · ( (- B) ) ) ) +( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) ) by (rule MMI_sylanr2)
have S7: B ∈ C −→ ( (- B) ) ∈ C by (rule MMI_negclt)
from S6 S7 have S8: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) )−→( ( A + ( (- B) ) ) · ( C + ( - D ) ) ) =( ( ( A · C ) + ( ( - D ) · ( (- B) ) ) )+ ( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) )by (rule MMI_sylanl2)
have S9: ( D ∈ C ∧ B ∈ C ) −→( ( - D ) · ( (- B) ) ) = ( D · B ) by (rule MMI_mul2negt)
from S9 have S10: ( B ∈ C ∧ D ∈ C ) −→( ( - D ) · ( (- B) ) ) = ( D · B ) by (rule MMI_ancoms)
from S10 have S11: ( B ∈ C ∧ D ∈ C ) −→( ( A · C ) + ( ( - D ) · ( (- B) ) ) ) =( ( A · C ) + ( D · B ) ) by (rule MMI_opreq2d)
from S11 have S12: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · C ) + ( ( - D ) · ( (- B) ) ) ) =( ( A · C ) + ( D · B ) ) by (rule MMI_ad2ant2l)
have S13: ( A ∈ C ∧ D ∈ C ) −→( A · ( - D ) ) = ( - ( A · D ) ) by (rule MMI_mulneg2t)
have S14: ( C ∈ C ∧ B ∈ C ) −→( C · ( (- B) ) ) = ( - ( C · B ) ) by (rule MMI_mulneg2t)
from S13 S14 have S15: ( ( A ∈ C ∧ D ∈ C ) ∧ ( C ∈ C ∧ B ∈ C )) −→( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) =( ( - ( A · D ) ) + ( - ( C · B ) ) ) by (rule MMI_opreqan12d)
have S16: ( ( A · D ) ∈ C ∧ ( C · B ) ∈ C ) −→( - ( ( A · D ) + ( C · B ) ) ) =( ( - ( A · D ) ) + ( - ( C · B ) ) ) by (rule MMI_negdit)
have S17: ( A ∈ C ∧ D ∈ C ) −→ ( A · D ) ∈ C by (rule MMI_axmulcl)
have S18: ( C ∈ C ∧ B ∈ C ) −→ ( C · B ) ∈ C by (rule MMI_axmulcl)

1162

from S16 S17 S18 have S19:
( ( A ∈ C ∧ D ∈ C ) ∧ ( C ∈ C ∧ B ∈ C ) ) −→( - ( ( A · D ) + ( C · B ) ) ) =( ( - ( A · D ) ) + ( - ( C · B ) ) ) by (rule MMI_syl2an)
from S15 S19 have S20: ( ( A ∈ C ∧ D ∈ C ) ∧ ( C ∈ C ∧ B ∈ C )) −→( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) =( - ( ( A · D ) + ( C · B ) ) ) by (rule MMI_eqtr4d)
from S20 have S21: ( ( A ∈ C ∧ D ∈ C ) ∧ ( B ∈ C ∧ C ∈ C ) ) −→( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) =( - ( ( A · D ) + ( C · B ) ) ) by (rule MMI_ancom2s)
from S21 have S22: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) =( - ( ( A · D ) + ( C · B ) ) ) by (rule MMI_an42s)
from S12 S22 have S23: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C )) −→( ( ( A · C ) + ( ( - D ) · ( (- B) ) ) ) +( ( A · ( - D ) ) + ( C · ( (- B) ) ) ) ) =( ( ( A · C ) + ( D · B ) ) + ( - ( ( A · D ) +( C · B ) ) ) ) by (rule MMI_opreq12d)
have S24: ( ( ( A · C ) + ( D · B ) ) ∈ C ∧ ( ( A · D ) +( C · B ) ) ∈ C ) −→( ( ( A · C ) + ( D · B ) ) + ( - ( ( A · D ) + ( C · B ) ) ) ) =( ( ( A · C ) + ( D · B ) ) - ( ( A · D ) + ( C · B ) ) )by (rule MMI_negsubt)
have S25: ( ( A · C ) ∈ C ∧ ( D · B ) ∈ C ) −→( ( A · C ) + ( D · B ) ) ∈ C by (rule MMI_axaddcl)
have S26: ( A ∈ C ∧ C ∈ C ) −→ ( A · C ) ∈ C by (rule MMI_axmulcl)
have S27: ( D ∈ C ∧ B ∈ C ) −→ ( D · B ) ∈ C by (rule MMI_axmulcl)
from S27 have S28: ( B ∈ C ∧ D ∈ C ) −→ ( D · B ) ∈ C
by (rule MMI_ancoms)
from S25 S26 S28 have S29:
( ( A ∈ C ∧ C ∈ C ) ∧ ( B ∈ C ∧ D ∈ C ) ) −→( ( A · C ) + ( D · B ) ) ∈ C by (rule MMI_syl2an)
from S29 have S30: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A · C ) + ( D · B ) ) ∈ C by (rule MMI_an4s)
have S31: ( ( A · D ) ∈ C ∧ ( C · B ) ∈ C ) −→( ( A · D ) + ( C · B ) ) ∈ C by (rule MMI_axaddcl)
from S17 have S32: ( A ∈ C ∧ D ∈ C ) −→ ( A · D ) ∈ C .
from S18 have S33: ( C ∈ C ∧ B ∈ C ) −→ ( C · B ) ∈ C .
from S33 have S34: ( B ∈ C ∧ C ∈ C ) −→ ( C · B ) ∈ C
by (rule MMI_ancoms)
from S31 S32 S34 have S35:
( ( A ∈ C ∧ D ∈ C ) ∧ ( B ∈ C ∧ C ∈ C ) ) −→( ( A · D ) + ( C · B ) ) ∈ C by (rule MMI_syl2an)
from S35 have S36: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→1163

( ( A · D ) + ( C · B ) ) ∈ C by (rule MMI_an42s)
from S24 S30 S36 have S37:
( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( ( A · C ) + ( D · B ) ) + ( - ( ( A · D ) + ( C · B ) ) ) ) =( ( ( A · C ) + ( D · B ) ) - ( ( A · D ) + ( C · B ) ) )by (rule MMI_sylanc)
from S8 S23 S37 have S38: ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C) ) −→( ( A + ( (- B) ) ) · ( C + ( - D ) ) ) =( ( ( A · C ) + ( D · B ) ) - ( ( A · D ) + ( C · B ) ) )by (rule MMI_3eqtrd)
from S3 S38 show ( ( A ∈ C ∧ B ∈ C ) ∧ ( C ∈ C ∧ D ∈ C ) ) −→( ( A - B ) · ( C - D ) ) =( ( ( A · C ) + ( D · B ) ) - ( ( A · D ) + ( C · B ) ) )by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_pnpcant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A + C ) ) = ( B - C )proof have S1: ( ( A ∈ C ∧ B ∈ C ) ∧ ( A ∈ C ∧ C ∈ C ) ) −→( ( A + B ) - ( A + C ) ) =( ( A - A ) + ( B - C ) ) by (rule MMI_sub4t)
from S1 have S2: ( A ∈ C ∧ ( B ∈ C ∧ C ∈ C ) ) −→( ( A + B ) - ( A + C ) ) =( ( A - A ) + ( B - C ) ) by (rule MMI_anandis)
have S3: A ∈ C −→ ( A - A ) = 0 by (rule MMI_subidt)
from S3 have S4: A ∈ C −→( ( A - A ) + ( B - C ) ) =( 0 + ( B - C ) ) by (rule MMI_opreq1d)
have S5: ( B ∈ C ∧ C ∈ C ) −→ ( B - C ) ∈ C by (rule MMI_subclt)
have S6: ( B - C ) ∈ C −→( 0 + ( B - C ) ) = ( B - C ) by (rule MMI_addid2t)
from S5 S6 have S7: ( B ∈ C ∧ C ∈ C ) −→( 0 + ( B - C ) ) = ( B - C ) by (rule MMI_syl)from S4 S7 have S8: ( A ∈ C ∧ ( B ∈ C ∧ C ∈ C ) ) −→( ( A - A ) + ( B - C ) ) = ( B - C ) by (rule MMI_sylan9eq)
from S2 S8 have S9: ( A ∈ C ∧ ( B ∈ C ∧ C ∈ C ) ) −→( ( A + B ) - ( A + C ) ) = ( B - C ) by (rule MMI_eqtrd)
from S9 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A + C ) ) = ( B - C ) by (rule MMI_3impb)
qed
lemma (in MMIsar0) MMI_pnpcan2t:
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + C ) - ( B + C ) ) = ( A - B )1164

proof have S1: ( A ∈ C ∧ C ∈ C ) −→( A + C ) = ( C + A ) by (rule MMI_axaddcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + C ) = ( C + A ) by (rule MMI_3adant2)
have S3: ( B ∈ C ∧ C ∈ C ) −→( B + C ) = ( C + B ) by (rule MMI_axaddcom)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B + C ) = ( C + B ) by (rule MMI_3adant1)
from S2 S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + C ) - ( B + C ) ) =( ( C + A ) - ( C + B ) ) by (rule MMI_opreq12d)
have S6: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( ( C + A ) - ( C + B ) ) = ( A - B ) by (rule MMI_pnpcant)from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( C + A ) - ( C + B ) ) = ( A - B ) by (rule MMI_3coml)from S5 S7 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + C ) - ( B + C ) ) = ( A - B ) by (rule MMI_eqtrd)
qed

lemma (in MMIsar0) MMI_pnncant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A - C ) ) = ( B + C )proof have S1: ( A ∈ C ∧ B ∈ C ∧ ( - C ) ∈ C ) −→( ( A + B ) - ( A + ( - C ) ) ) =( B - ( - C ) ) by (rule MMI_pnpcant)have S2: C ∈ C −→ ( - C ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A + ( - C ) ) ) =( B - ( - C ) ) by (rule MMI_syl3an3)
have S4: ( A ∈ C ∧ C ∈ C ) −→( A + ( - C ) ) = ( A - C ) by (rule MMI_negsubt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( - C ) ) = ( A - C ) by (rule MMI_3adant2)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A + ( - C ) ) ) =( ( A + B ) - ( A - C ) ) by (rule MMI_opreq2d)
have S7: ( B ∈ C ∧ C ∈ C ) −→( B - ( - C ) ) = ( B + C ) by (rule MMI_subnegt)
from S7 have S8: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B - ( - C ) ) = ( B + C ) by (rule MMI_3adant1)
from S3 S6 S8 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A - C ) ) = ( B + C ) by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_ppncant:shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→1165

( ( A + B ) + ( C - B ) ) = ( A + C )proof have S1: ( A ∈ C ∧ B ∈ C ) −→( A + B ) = ( B + A ) by (rule MMI_axaddcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + B ) = ( B + A ) by (rule MMI_3adant3)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( B - C ) ) =( ( B + A ) - ( B - C ) ) by (rule MMI_opreq1d)
have S4: ( ( A + B ) ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( B - C ) ) =( ( A + B ) + ( C - B ) ) by (rule MMI_subsub2t)
have S5: ( A ∈ C ∧ B ∈ C ) −→ ( A + B ) ∈ C by (rule MMI_axaddcl)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + B ) ∈ C by (rule MMI_3adant3)
have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ B ∈ C by (rule MMI_3simp2)
have S8: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ C ∈ C by (rule MMI_3simp3)
from S4 S6 S7 S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( B - C ) ) =( ( A + B ) + ( C - B ) ) by (rule MMI_syl3anc)
have S10: ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) −→( ( B + A ) - ( B - C ) ) = ( A + C ) by (rule MMI_pnncant)from S10 have S11: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( B + A ) - ( B - C ) ) = ( A + C ) by (rule MMI_3com12)
from S3 S9 S11 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) + ( C - B ) ) = ( A + C ) by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_pnncan: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows ( ( A + B ) - ( A - C ) ) = ( B + C )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + B ) - ( A - C ) ) = ( B + C ) by (rule MMI_pnncant)from S1 S2 S3 S4 show ( ( A + B ) - ( A - C ) ) = ( B + C ) by (ruleMMI_mp3an)
qedlemma (in MMIsar0) MMI_mulcan: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C and
A4: A 6= 0
shows ( A · B ) = ( A · C ) ←→ B = C
proof from A1 have S1: A ∈ C.

1166

from A4 have S2: A 6= 0.
from S1 S2 have S3: ∃ x ∈ C . ( A · x ) = 1 by (rule MMI_recex)
from A1 have S4: A ∈ C.
from A2 have S5: B ∈ C.
{ fix x
have S6: ( x ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( ( x · A ) · B ) = ( x · ( A · B ) ) by (rule MMI_axmulass)from S5 S6 have S7: ( x ∈ C ∧ A ∈ C ) −→( ( x · A ) · B ) = ( x · ( A · B ) ) by (rule MMI_mp3an3)from A3 have S8: C ∈ C.
have S9: ( x ∈ C ∧ A ∈ C ∧ C ∈ C ) −→( ( x · A ) · C ) = ( x · ( A · C ) ) by (rule MMI_axmulass)from S8 S9 have S10: ( x ∈ C ∧ A ∈ C ) −→( ( x · A ) · C ) = ( x · ( A · C ) ) by (rule MMI_mp3an3)from S7 S10 have S11: ( x ∈ C ∧ A ∈ C ) −→( ( ( x · A ) · B ) =( ( x · A ) · C ) ←→( x · ( A · B ) ) =( x · ( A · C ) ) ) by (rule MMI_eqeq12d)
from S4 S11 have S12: x ∈ C −→( ( ( x · A ) · B ) =( ( x · A ) · C ) ←→( x · ( A · B ) ) =( x · ( A · C ) ) ) by (rule MMI_mpan2)
have S13:( A · B ) = ( A · C ) −→( x · ( A · B ) ) = ( x · ( A · C ) ) by (rule MMI_opreq2)
from S12 S13 have S14: x ∈ C −→( ( A · B ) = ( A · C ) −→ ( ( x · A ) · B ) =( ( x · A ) · C ) ) by (rule MMI_syl5bir)from S14 have S15:
( x ∈ C ∧ ( A · x ) = 1 ) −→ ( ( A · B ) =( A · C ) −→ ( ( x · A ) · B ) =( ( x · A ) · C ) ) by (rule MMI_adantr)
from A1 have S16: A ∈ C.
have S17: ( A ∈ C ∧ x ∈ C ) −→( A · x ) = ( x · A ) by (rule MMI_axmulcom)
from S16 S17 have S18: x ∈ C −→ ( A · x ) = ( x · A )by (rule MMI_mpan)
from S18 have S19: x ∈ C −→( ( A · x ) = 1 ←→ ( x · A ) = 1 ) by (rule MMI_eqeq1d)
have S20: ( x · A ) =1 −→ ( ( x · A ) · B ) = ( 1 · B ) by (rule MMI_opreq1)
from A2 have S21: B ∈ C.
from S21 have S22: ( 1 · B ) = B by (rule MMI_mulid2)
from S20 S22 have S23: ( x · A ) = 1 −→ ( ( x · A ) · B ) = B
by (rule MMI_syl6eq)
have S24: ( x · A ) =1 −→ ( ( x · A ) · C ) = ( 1 · C ) by (rule MMI_opreq1)

1167

from A3 have S25: C ∈ C.
from S25 have S26: ( 1 · C ) = C by (rule MMI_mulid2)
from S24 S26 have S27: ( x · A ) = 1 −→ ( ( x · A ) · C ) = C
by (rule MMI_syl6eq)
from S23 S27 have S28: ( x · A ) = 1 −→
( ( ( x · A ) · B ) =( ( x · A ) · C ) ←→ B = C ) by (rule MMI_eqeq12d)
from S19 S28 have S29: x ∈ C −→( ( A · x ) = 1 −→
( ( ( x · A ) · B ) =( ( x · A ) · C ) ←→ B = C ) ) by (rule MMI_syl6bi)
from S29 have S30:
( x ∈ C ∧ ( A · x ) = 1 ) −→( ( ( x · A ) · B ) =( ( x · A ) · C ) ←→ B = C ) by (rule MMI_imp)
from S15 S30 have S31:
( x ∈ C ∧ ( A · x ) = 1 ) −→( ( A · B ) = ( A · C ) −→ B = C ) by (rule MMI_sylibd)
from S31 have x ∈ C −→( ( A · x ) = 1 −→ ( ( A · B ) = ( A · C ) −→ B = C ) )by (rule MMI_ex)} then have S32: ∀ x. x ∈ C −→( ( A · x ) = 1 −→ ( ( A · B ) = ( A · C ) −→ B = C ) )by autofrom S32 have S33: ( ∃ x ∈ C . ( A · x ) = 1 ) −→( ( A · B ) = ( A · C ) −→ B = C ) by (rule MMI_r19_23aiv)
from S3 S33 have S34: ( A · B ) = ( A · C ) −→ B = C
by (rule MMI_ax_mp)
have S35: B = C −→ ( A · B ) = ( A · C ) by (rule MMI_opreq2)
from S34 S35 show ( A · B ) = ( A · C ) ←→ B = C by (rule MMI_impbi)
qedlemma (in MMIsar0) MMI_mulcant2: assumes A1: A 6= 0
shows ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) = ( A · C ) ←→ B = C )proof have S1: A =if ( A ∈ C , A , 1 ) −→( A · B ) =( if ( A ∈ C , A , 1 ) · B ) by (rule MMI_opreq1)
have S2: A =if ( A ∈ C , A , 1 ) −→( A · C ) =( if ( A ∈ C , A , 1 ) · C ) by (rule MMI_opreq1)
from S1 S2 have S3: A =if ( A ∈ C , A , 1 ) −→( ( A · B ) =( A · C ) ←→( if ( A ∈ C , A , 1 ) · B ) =1168

( if ( A ∈ C , A , 1 ) · C ) ) by (rule MMI_eqeq12d)
from S3 have S4: A =if ( A ∈ C , A , 1 ) −→( ( ( A · B ) = ( A · C ) ←→ B = C ) ←→( ( if ( A ∈ C , A , 1 ) · B ) =( if ( A ∈ C , A , 1 ) · C ) ←→B = C ) ) by (rule MMI_bibi1d)
have S5: B =if ( B ∈ C , B , 1 ) −→( if ( A ∈ C , A , 1 ) · B ) =( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) by (rule MMI_opreq2)
from S5 have S6: B =if ( B ∈ C , B , 1 ) −→( ( if ( A ∈ C , A , 1 ) · B ) =( if ( A ∈ C , A , 1 ) · C ) ←→( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) =( if ( A ∈ C , A , 1 ) · C ) ) by (rule MMI_eqeq1d)
have S7: B =if ( B ∈ C , B , 1 ) −→( B = C ←→ if ( B ∈ C , B , 1 ) = C ) by (rule MMI_eqeq1)
from S6 S7 have S8: B =if ( B ∈ C , B , 1 ) −→( ( ( if ( A ∈ C , A , 1 ) · B ) = ( if ( A ∈ C , A , 1 ) · C ) ←→B = C ) ←→( ( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) =( if ( A ∈ C , A , 1 ) · C ) ←→if ( B ∈ C , B , 1 ) = C ) ) by (rule MMI_bibi12d)
have S9: C =if ( C ∈ C , C , 1 ) −→( if ( A ∈ C , A , 1 ) · C ) =( if ( A ∈ C , A , 1 ) · if ( C ∈ C , C , 1 ) ) by (rule MMI_opreq2)
from S9 have S10: C =if ( C ∈ C , C , 1 ) −→( ( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) =( if ( A ∈ C , A , 1 ) · C ) ←→( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) =( if ( A ∈ C , A , 1 ) · if ( C ∈ C , C , 1 ) ) ) by (rule MMI_eqeq2d)
have S11: C =if ( C ∈ C , C , 1 ) −→( if ( B ∈ C , B , 1 ) =C ←→if ( B ∈ C , B , 1 ) =if ( C ∈ C , C , 1 ) ) by (rule MMI_eqeq2)
from S10 S11 have S12: C =if ( C ∈ C , C , 1 ) −→( ( ( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) = ( if ( A ∈ C, A , 1 ) · C ) ←→ if ( B ∈ C , B , 1 ) = C ) ←→( ( if ( A ∈ C , A , 1 ) · if ( B ∈ C , B , 1 ) ) =( if ( A ∈ C , A , 1 ) · if ( C ∈ C , C , 1 ) ) ←→1169

if ( B ∈ C , B , 1 ) =if ( C ∈ C , C , 1 ) ) ) by (rule MMI_bibi12d)
have S13: 1 ∈ C by (rule MMI_1cn)from S13 have S14: if ( A ∈ C , A , 1 ) ∈ C by (rule MMI_elimel)
have S15: 1 ∈ C by (rule MMI_1cn)from S15 have S16: if ( B ∈ C , B , 1 ) ∈ C by (rule MMI_elimel)
have S17: 1 ∈ C by (rule MMI_1cn)from S17 have S18: if ( C ∈ C , C , 1 ) ∈ C by (rule MMI_elimel)
have S19: A =if ( A ∈ C , A , 1 ) −→( A 6= 0 ←→ if ( A ∈ C , A , 1 ) 6= 0 ) by (rule MMI_neeq1)
have S20: 1 =if ( A ∈ C , A , 1 ) −→( 1 6= 0 ←→ if ( A ∈ C , A , 1 ) 6= 0 ) by (rule MMI_neeq1)
from A1 have S21: A 6= 0.
have S22: 1 6= 0 by (rule MMI_ax1ne0)
from S19 S20 S21 S22 have S23: if ( A ∈ C , A , 1 ) 6= 0 by (ruleMMI_keephyp)from S14 S16 S18 S23 have S24: ( if ( A ∈ C , A , 1 ) · if ( B ∈ C, B , 1 ) ) =( if ( A ∈ C , A , 1 ) · if ( C ∈ C , C , 1 ) ) ←→if ( B ∈ C , B , 1 ) =if ( C ∈ C , C , 1 ) by (rule MMI_mulcan)
from S4 S8 S12 S24 show ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) = ( A · C ) ←→ B = C ) by (rule MMI_dedth3h)qedlemma (in MMIsar0) MMI_mulcant:shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ A 6= 0 ) −→( ( A · B ) = ( A · C ) ←→ B = C )proof have S1: A =if ( A 6= 0 , A , 1 ) −→( A ∈ C ←→ if ( A 6= 0 , A , 1 ) ∈ C ) by (rule MMI_eleq1)
have S2: A =if ( A 6= 0 , A , 1 ) −→( B ∈ C ←→ B ∈ C ) by (rule MMI_pm4_2i)
have S3: A =if ( A 6= 0 , A , 1 ) −→( C ∈ C ←→ C ∈ C ) by (rule MMI_pm4_2i)
from S1 S2 S3 have S4: A =if ( A 6= 0 , A , 1 ) −→( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ←→( if ( A 6= 0 , A , 1 ) ∈ C ∧ B ∈ C ∧ C ∈ C ) ) by (rule MMI_3anbi123d)have S5: A =if ( A 6= 0 , A , 1 ) −→( A · B ) =( if ( A 6= 0 , A , 1 ) · B ) by (rule MMI_opreq1)
have S6: A =1170

if ( A 6= 0 , A , 1 ) −→( A · C ) =( if ( A 6= 0 , A , 1 ) · C ) by (rule MMI_opreq1)
from S5 S6 have S7: A =if ( A 6= 0 , A , 1 ) −→( ( A · B ) =( A · C ) ←→( if ( A 6= 0 , A , 1 ) · B ) =( if ( A 6= 0 , A , 1 ) · C ) ) by (rule MMI_eqeq12d)
from S7 have S8: A =if ( A 6= 0 , A , 1 ) −→( ( ( A · B ) = ( A · C ) ←→ B = C ) ←→( ( if ( A 6= 0 , A , 1 ) · B ) =( if ( A 6= 0 , A , 1 ) · C ) ←→B = C ) ) by (rule MMI_bibi1d)
from S4 S8 have S9: A =if ( A 6= 0 , A , 1 ) −→( ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ ( ( A · B ) = ( A · C ) ←→ B =C ) ) ←→( ( if ( A 6= 0 , A , 1 ) ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( if ( A 6= 0 , A , 1 ) · B ) =( if ( A 6= 0 , A , 1 ) · C ) ←→B = C ) ) ) by (rule MMI_imbi12d)
have S10: if ( A 6= 0 , A , 1 ) 6= 0 by (rule MMI_elimne0)
from S10 have S11: ( if ( A 6= 0 , A , 1 ) ∈ C ∧ B ∈ C ∧ C ∈ C )−→( ( if ( A 6= 0 , A , 1 ) · B ) =( if ( A 6= 0 , A , 1 ) · C ) ←→ B = C ) by (rule MMI_mulcant2)
from S9 S11 have S12: A 6= 0 −→( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) = ( A · C ) ←→ B = C ) ) by (rule MMI_dedth)from S12 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ A 6= 0 ) −→( ( A · B ) = ( A · C ) ←→ B = C ) by (rule MMI_impcom)
qedlemma (in MMIsar0) MMI_mulcan2t:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · C ) = ( B · C ) ←→ A = B )proof have S1: ( A ∈ C ∧ C ∈ C ) −→( A · C ) = ( C · A ) by (rule MMI_axmulcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · C ) = ( C · A ) by (rule MMI_3adant2)
have S3: ( B ∈ C ∧ C ∈ C ) −→( B · C ) = ( C · B ) by (rule MMI_axmulcom)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B · C ) = ( C · B ) by (rule MMI_3adant1)
from S2 S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · C ) =1171

( B · C ) ←→ ( C · A ) = ( C · B ) ) by (rule MMI_eqeq12d)
from S5 have S6: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · C ) =( B · C ) ←→ ( C · A ) = ( C · B ) ) by (rule MMI_adantr)
have S7: ( ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) ∧ C 6= 0 ) −→( ( C · A ) = ( C · B ) ←→ A = B ) by (rule MMI_mulcant)from S7 have S8: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( C 6= 0 −→( ( C · A ) = ( C · B ) ←→ A = B ) ) by (rule MMI_ex)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( C 6= 0 −→( ( C · A ) = ( C · B ) ←→ A = B ) ) by (rule MMI_3coml)from S9 have S10: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( C · A ) = ( C · B ) ←→ A = B ) by (rule MMI_imp)
from S6 S10 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · C ) = ( B · C ) ←→ A = B ) by (rule MMI_bitrd)
qed
lemma (in MMIsar0) MMI_mul0or: assumes A1: A ∈ C andA2: B ∈ C
shows ( A · B ) = 0 ←→ ( A = 0 ∨ B = 0 )proof have S1: A 6= 0 ←→ ¬ ( A = 0 ) by (rule MMI_df_ne)from A1 have S2: A ∈ C.
from A2 have S3: B ∈ C.
have S4: 0 ∈ C by (rule MMI_0cn)from S2 S3 S4 have S5: A ∈ C ∧ B ∈ C ∧ 0 ∈ C by (rule MMI_3pm3_2i)
have S6: ( ( A ∈ C ∧ B ∈ C ∧ 0 ∈ C ) ∧ A 6= 0 ) −→( ( A · B ) = ( A · 0 ) ←→ B = 0 ) by (rule MMI_mulcant)from S5 S6 have S7: A 6= 0 −→( ( A · B ) = ( A · 0 ) ←→ B = 0 ) by (rule MMI_mpan)
from A1 have S8: A ∈ C.
from S8 have S9: ( A · 0 ) = 0 by (rule MMI_mul01)
from S9 have S10: ( A · B ) = ( A · 0 ) ←→ ( A · B ) = 0 by (ruleMMI_eqeq2i)
from S7 S10 have S11: A 6= 0 −→ ( ( A · B ) = 0 ←→ B = 0 ) by (ruleMMI_syl5bbr)
from S11 have S12: A 6= 0 −→ ( ( A · B ) = 0 −→ B = 0 ) by (ruleMMI_biimpd)
from S1 S12 have S13: ¬ ( A =0 ) −→ ( ( A · B ) = 0 −→ B = 0 ) by (rule MMI_sylbir)from S13 have S14: ( A · B ) =0 −→ ( ¬ ( A = 0 ) −→ B = 0 ) by (rule MMI_com12)
from S14 have S15: ( A · B ) = 0 −→ ( A = 0 ∨ B = 0 ) by (rule MMI_orrd)
have S16: A = 0 −→ ( A · B ) = ( 0 · B ) by (rule MMI_opreq1)
from A2 have S17: B ∈ C.
from S17 have S18: ( 0 · B ) = 0 by (rule MMI_mul02)
from S16 S18 have S19: A = 0 −→ ( A · B ) = 0 by (rule MMI_syl6eq)
have S20: B = 0 −→ ( A · B ) = ( A · 0 ) by (rule MMI_opreq2)

1172

from S9 have S21: ( A · 0 ) = 0 .
from S20 S21 have S22: B = 0 −→ ( A · B ) = 0 by (rule MMI_syl6eq)
from S19 S22 have S23: ( A = 0 ∨ B = 0 ) −→ ( A · B ) = 0 by (ruleMMI_jaoi)from S15 S23 show ( A · B ) = 0 ←→ ( A = 0 ∨ B = 0 ) by (rule MMI_impbi)
qedlemma (in MMIsar0) MMI_msq0: assumes A1: A ∈ Cshows ( A · A ) = 0 ←→ A = 0
proof from A1 have S1: A ∈ C.
from A1 have S2: A ∈ C.
from S1 S2 have S3: ( A · A ) = 0 ←→ ( A = 0 ∨ A = 0 ) by (ruleMMI_mul0or)
have S4: ( A = 0 ∨ A = 0 ) ←→ A = 0 by (rule MMI_oridm)
from S3 S4 show ( A · A ) = 0 ←→ A = 0 by (rule MMI_bitr)qed
lemma (in MMIsar0) MMI_mul0ort:
shows ( A ∈ C ∧ B ∈ C ) −→( ( A · B ) = 0 ←→ ( A = 0 ∨ B = 0 ) )proof have S1: A =if ( A ∈ C , A , 0 ) −→( A · B ) =( if ( A ∈ C , A , 0 ) · B ) by (rule MMI_opreq1)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→( ( A · B ) =0 ←→ ( if ( A ∈ C , A , 0 ) · B ) = 0 ) by (rule MMI_eqeq1d)
have S3: A =if ( A ∈ C , A , 0 ) −→( A = 0 ←→ if ( A ∈ C , A , 0 ) = 0 ) by (rule MMI_eqeq1)
from S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( A = 0 ∨ B = 0 ) ←→( if ( A ∈ C , A , 0 ) = 0 ∨ B = 0 ) ) by (rule MMI_orbi1d)
from S2 S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( ( A · B ) = 0 ←→ ( A = 0 ∨ B = 0 ) ) ←→( ( if ( A ∈ C , A , 0 ) · B ) =0 ←→( if ( A ∈ C , A , 0 ) =0 ∨ B = 0 ) ) ) by (rule MMI_bibi12d)
have S6: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) · B ) =( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S6 have S7: B =1173

if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) · B ) =0 ←→( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) =0 ) by (rule MMI_eqeq1d)
have S8: B =if ( B ∈ C , B , 0 ) −→( B = 0 ←→ if ( B ∈ C , B , 0 ) = 0 ) by (rule MMI_eqeq1)
from S8 have S9: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) = 0 ∨ B = 0 ) ←→( if ( A ∈ C , A , 0 ) =0 ∨ if ( B ∈ C , B , 0 ) = 0 ) ) by (rule MMI_orbi2d)
from S7 S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) · B ) = 0 ←→ ( if ( A ∈ C , A , 0 ) = 0∨ B = 0 ) ) ←→( ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) =0 ←→( if ( A ∈ C , A , 0 ) =0 ∨ if ( B ∈ C , B , 0 ) = 0 ) ) ) by (rule MMI_bibi12d)
have S11: 0 ∈ C by (rule MMI_0cn)from S11 have S12: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S13: 0 ∈ C by (rule MMI_0cn)from S13 have S14: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S12 S14 have S15: ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B ,0 ) ) =
0 ←→( if ( A ∈ C , A , 0 ) =0 ∨ if ( B ∈ C , B , 0 ) = 0 ) by (rule MMI_mul0or)from S5 S10 S15 show ( A ∈ C ∧ B ∈ C ) −→( ( A · B ) = 0 ←→ ( A = 0 ∨ B = 0 ) ) by (rule MMI_dedth2h)qedlemma (in MMIsar0) MMI_muln0bt:
shows ( A ∈ C ∧ B ∈ C ) −→( ( A 6= 0 ∧ B 6= 0 ) ←→ ( A · B ) 6= 0 )proof have S1: ( A ∈ C ∧ B ∈ C ) −→( ( A · B ) = 0 ←→ ( A = 0 ∨ B = 0 ) ) by (rule MMI_mul0ort)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→( ¬ ( ( A · B ) = 0 ) ←→¬ ( ( A = 0 ∨ B = 0 ) ) ) by (rule MMI_negbid)
have S3: ¬ ( ( A = 0 ∨ B = 0 ) ) ←→( ¬ ( A = 0 ) ∧ ¬ ( B = 0 ) ) by (rule MMI_ioran)from S2 S3 have S4: ( A ∈ C ∧ B ∈ C ) −→( ( ¬ ( A = 0 ) ∧ ¬ ( B = 0 ) ) ←→1174

¬ ( ( A · B ) = 0 ) ) by (rule MMI_syl6rbb)
have S5: A 6= 0 ←→ ¬ ( A = 0 ) by (rule MMI_df_ne)
have S6: B 6= 0 ←→ ¬ ( B = 0 ) by (rule MMI_df_ne)from S5 S6 have S7: ( A 6= 0 ∧ B 6= 0 ) ←→( ¬ ( A = 0 ) ∧ ¬ ( B = 0 ) ) by (rule MMI_anbi12i)
have S8: ( A · B ) 6= 0 ←→ ¬ ( ( A · B ) = 0 ) by (rule MMI_df_ne)from S4 S7 S8 show ( A ∈ C ∧ B ∈ C ) −→( ( A 6= 0 ∧ B 6= 0 ) ←→ ( A · B ) 6= 0 ) by (rule MMI_3bitr4g)
qed
lemma (in MMIsar0) MMI_muln0: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0 and
A4: B 6= 0
shows ( A · B ) 6= 0
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: A 6= 0.
from A4 have S4: B 6= 0.
from S3 S4 have S5: A 6= 0 ∧ B 6= 0 by (rule MMI_pm3_2i)
have S6: ( A ∈ C ∧ B ∈ C ) −→( ( A 6= 0 ∧ B 6= 0 ) ←→ ( A · B ) 6= 0 ) by (rule MMI_muln0bt)
from S5 S6 have S7: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) 6= 0 by (ruleMMI_mpbii)
from S1 S2 S7 show ( A · B ) 6= 0 by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_receu: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0
shows ∃ ! x . x ∈ C ∧ ( A · x ) = B
proof { fix x yhave S1: x = y −→ ( A · x ) = ( A · y ) by (rule MMI_opreq2)
from S1 have S2: x = y −→ ( ( A · x ) = B ←→ ( A · y ) = B )by (rule MMI_eqeq1d)} then have S2: ∀ x y. x = y −→ ( ( A · x ) = B ←→ ( A · y ) = B)
by simpfrom S2 have S3:( ∃ ! x . x ∈ C ∧ ( A · x ) = B ) ←→( ( ∃ x ∈ C . ( A · x ) = B ) ∧( ∀ x ∈ C . ∀ y ∈ C . ( ( ( A · x ) = B ∧ ( A · y ) = B ) −→x = y ) ) )by (rule MMI_reu4)
from A1 have S4: A ∈ C.
from A3 have S5: A 6= 0.
from S4 S5 have S6: ∃ y ∈ C . ( A · y ) = 1 by (rule MMI_recex)1175

from A2 have S7: B ∈ C.
{ fix yhave S8: ( y ∈ C ∧ B ∈ C ) −→ ( y · B ) ∈ C by (rule MMI_axmulcl)
from S7 S8 have S9: y ∈ C −→ ( y · B ) ∈ C by (rule MMI_mpan2)
have S10: ( y · B ) ∈ C ←→( ∃ x ∈ C . x = ( y · B ) ) by (rule MMI_risset)
from S9 S10 have S11: y ∈ C −→ ( ∃ x ∈ C . x = ( y · B ) )by (rule MMI_sylib){ fix x
have S12: x = ( y · B ) −→( A · x ) = ( A · ( y · B ) ) by (rule MMI_opreq2)
from A1 have S13: A ∈ C.
from A2 have S14: B ∈ C.
have S15: ( A ∈ C ∧ y ∈ C ∧ B ∈ C ) −→( ( A · y ) · B ) = ( A · ( y · B ) ) by (rule MMI_axmulass)from S13 S14 S15 have S16: y ∈ C −→( ( A · y ) · B ) = ( A · ( y · B ) ) by (rule MMI_mp3an13)
from S16 have S17: y ∈ C −→( A · ( y · B ) ) = ( ( A · y ) · B ) by (rule MMI_eqcomd)from S12 S17 have S18: ( y ∈ C ∧ x =( y · B ) ) −→( A · x ) = ( ( A · y ) · B ) by (rule MMI_sylan9eqr)
have S19: ( A · y ) =1 −→ ( ( A · y ) · B ) = ( 1 · B ) by (rule MMI_opreq1)
from A2 have S20: B ∈ C.
from S20 have S21: ( 1 · B ) = B by (rule MMI_mulid2)
from S19 S21 have S22: ( A · y ) = 1 −→ ( ( A · y ) · B ) = B
by (rule MMI_syl6eq)
from S18 S22 have S23:
( ( A · y ) = 1 ∧ ( y ∈ C ∧ x =( y · B ) ) ) −→ ( A · x ) = B by (rule MMI_sylan9eqr)
from S23 have S24:
( A · y ) = 1 −→ ( y ∈ C −→( x = ( y · B ) −→ ( A · x ) = B ) ) by (rule MMI_exp32)
from S24 have S25: ( y ∈ C ∧ ( A · y ) =1 ) −→( x = ( y · B ) −→ ( A · x ) = B ) by (rule MMI_impcom)
from S25 have( y ∈ C ∧ ( A · y ) = 1 ) −→ ( x ∈ C −→( x = ( y · B ) −→ ( A · x ) = B ) ) by (rule MMI_a1d)} then have S26:
∀ x . ( y ∈ C ∧ ( A · y ) = 1 ) −→ ( x ∈ C −→( x = ( y · B ) −→ ( A · x ) = B ) ) by simp
from S26 have S27:
( y ∈ C ∧ ( A · y ) = 1 ) −→( ∀ x ∈ C . ( x = ( y · B ) −→ ( A · x ) = B ) ) by (rule MMI_r19_21aiv)
from S27 have S28: y ∈ C −→( ( A · y ) = 1 −→( ∀ x ∈ C . ( x = ( y · B ) −→ ( A · x ) = B ) ) ) by (rule MMI_ex)

1176

have S29: ( ∀ x ∈ C . ( x = ( y · B ) −→ ( A · x ) = B ) ) −→( ( ∃ x ∈ C . x = ( y · B ) ) −→( ∃ x ∈ C . ( A · x ) = B ) ) by (rule MMI_r19_22)
from S28 S29 have S30:y ∈ C −→ ( ( A · y ) = 1 −→( ( ∃ x ∈ C . x = ( y · B ) ) −→( ∃ x ∈ C . ( A · x ) = B ) ) ) by (rule MMI_syl6)
from S11 S30 havey ∈ C −→ ( ( A · y ) = 1 −→ ( ∃ x ∈ C . ( A · x ) = B ) )by (rule MMI_mpid)} then have S31:
∀ y . y ∈ C −→ ( ( A · y ) = 1 −→ ( ∃ x ∈ C . ( A · x ) = B) )by simpfrom S31 have S32: ( ∃ y ∈ C . ( A · y ) =1 ) −→ ( ∃ x ∈ C . ( A · x ) = B ) by (rule MMI_r19_23aiv)
from S6 S32 have S33: ∃ x ∈ C . ( A · x ) = B by (rule MMI_ax_mp)
from A1 have S34: A ∈ C.
from A3 have S35: A 6= 0.
{ fix x y
from S35 have S36: ( A ∈ C ∧ x ∈ C ∧ y ∈ C ) −→( ( A · x ) = ( A · y ) ←→ x = y ) by (rule MMI_mulcant2)
have S37:( ( A · x ) =B ∧ ( A · y ) =B ) −→ ( A · x ) = ( A · y ) by (rule MMI_eqtr3t)
from S36 S37 have S38: ( A ∈ C ∧ x ∈ C ∧ y ∈ C ) −→( ( ( A · x ) = B ∧ ( A · y ) = B ) −→x = y ) by (rule MMI_syl5bi)
from S34 S38 have ( x ∈ C ∧ y ∈ C ) −→( ( ( A · x ) = B ∧ ( A · y ) = B ) −→x = y ) by (rule MMI_mp3an1)} then have S39: ∀ x y. ( x ∈ C ∧ y ∈ C ) −→( ( ( A · x ) = B ∧ ( A · y ) = B ) −→x = y ) by autofrom S39 have S40:
∀ x ∈ C . ∀ y ∈ C . ( ( ( A · x ) = B ∧ ( A · y ) = B ) −→x = y ) by (rule MMI_rgen2)
from S3 S33 S40 show ∃ ! x . x ∈ C ∧ ( A · x ) = B by (rule MMI_mpbir2an)qedlemma (in MMIsar0)
S MMI_divval: assumes A ∈ Cshows A / B ={ x ∈ C . B · x = A }using cdiv_def by simp

1177

B ∈ C B 6= 0

lemma (in MMIsar0) MMI_divmul: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C and
A4: B 6= 0
shows ( A / B ) = C ←→ ( B · C ) = A
proof from A3 have S1: C ∈ C.
{ fix x
have S2: x =C −→ ( ( A / B ) = x ←→ ( A / B ) = C ) by (rule MMI_eqeq2)
have S3: x = C −→ ( B · x ) = ( B · C ) by (rule MMI_opreq2)
from S3 have S4: x =C −→ ( ( B · x ) = A ←→ ( B · C ) = A ) by (rule MMI_eqeq1d)
from S2 S4 havex = C −→( ( ( A / B ) = x ←→ ( B · x ) = A ) ←→( ( A / B ) = C ←→ ( B · C ) = A ) ) by (rule MMI_bibi12d)} then have S5: ∀ x. x = C −→( ( ( A / B ) = x ←→ ( B · x ) = A ) ←→( ( A / B ) = C ←→ ( B · C ) = A ) )by simpfrom A2 have S6: B ∈ C.
from A1 have S7: A ∈ C.
from A4 have S8: B 6= 0.
from S6 S7 S8 have S9: ∃ ! x . x ∈ C ∧ ( B · x ) = A by (rule MMI_receu){ fix x
have S10: ( x ∈ C ∧ ( ∃ ! x . x ∈ C ∧ ( B · x ) = A ) ) −→( ( B ·Sx ) =A ←→{ x ∈ C . ( B · x ) = A } = x ) by (rule MMI_reuuni1)
from S9 S10 haveS
x ∈ C −→ ( ( B · x ) = A ←→{ x ∈ C . ( B · x ) = A } =x )by (rule MMI_mpan2)} then have S11:S
∀ x. x ∈ C −→ ( ( B · x ) = A ←→{ x ∈ C . ( B · x ) = A} = x )by blastfrom A1 have S12: A ∈ C.
from A2 have S13: B ∈ C.
from A4 have S14: B 6= 0.
fromS S12 S13 S14 have S15: ( A / B ) ={ x ∈ C . ( B · x ) = A } by (rule MMI_divval)
from S15Shave S16: ∀ x. ( A / B ) =x ←→{ x ∈ C . ( B · x ) = A } = x by simp
from S11 S16 have S17: ∀ x. x ∈ C −→( ( A / B ) = x ←→ ( B · x ) = A ) by (rule MMI_syl6rbbr)
from S5 S17 have S18: C ∈ C −→( ( A / B ) = C ←→ ( B · C ) = A ) by (rule MMI_vtoclga)1178

from S1 S18 show ( A / B ) = C ←→ ( B · C ) = A by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_divmulz: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows B 6= 0 −→( ( A / B ) = C ←→ ( B · C ) = A )proof have S1: B =if ( B 6= 0 , B , 1 ) −→( A / B ) =( A / if ( B 6= 0 , B , 1 ) ) by (rule MMI_opreq2)
from S1 have S2: B =if ( B 6= 0 , B , 1 ) −→( ( A / B ) =C ←→ ( A / if ( B 6= 0 , B , 1 ) ) = C ) by (rule MMI_eqeq1d)
have S3: B =if ( B 6= 0 , B , 1 ) −→( B · C ) =( if ( B 6= 0 , B , 1 ) · C ) by (rule MMI_opreq1)
from S3 have S4: B =if ( B 6= 0 , B , 1 ) −→( ( B · C ) =A ←→ ( if ( B 6= 0 , B , 1 ) · C ) = A ) by (rule MMI_eqeq1d)
from S2 S4 have S5: B =if ( B 6= 0 , B , 1 ) −→( ( ( A / B ) = C ←→ ( B · C ) = A ) ←→( ( A / if ( B 6= 0 , B , 1 ) ) =C ←→( if ( B 6= 0 , B , 1 ) · C ) = A ) ) by (rule MMI_bibi12d)
from A1 have S6: A ∈ C.
from A2 have S7: B ∈ C.
have S8: 1 ∈ C by (rule MMI_1cn)from S7 S8 have S9: if ( B 6= 0 , B , 1 ) ∈ C by (rule MMI_keepel)
from A3 have S10: C ∈ C.
have S11: if ( B 6= 0 , B , 1 ) 6= 0 by (rule MMI_elimne0)
from S6 S9 S10 S11 have S12: ( A / if ( B 6= 0 , B , 1 ) ) =C ←→ ( if ( B 6= 0 , B , 1 ) · C ) = A by (rule MMI_divmul)
from S5 S12 show B 6= 0 −→( ( A / B ) = C ←→ ( B · C ) = A ) by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divmult:shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ ( B · C ) = A )proof have S1: A =if ( A ∈ C , A , 0 ) −→1179

( A / B ) =( if ( A ∈ C , A , 0 ) / B ) by (rule MMI_opreq1)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→( ( A / B ) =C ←→ ( if ( A ∈ C , A , 0 ) / B ) = C ) by (rule MMI_eqeq1d)
have S3: A =if ( A ∈ C , A , 0 ) −→( ( B · C ) =A ←→ ( B · C ) = if ( A ∈ C , A , 0 ) ) by (rule MMI_eqeq2)
from S2 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( ( A / B ) = C ←→ ( B · C ) = A ) ←→( ( if ( A ∈ C , A , 0 ) / B ) =C ←→( B · C ) = if ( A ∈ C , A , 0 ) ) ) by (rule MMI_bibi12d)
from S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( B 6= 0 −→ ( ( A / B ) = C ←→ ( B · C ) = A ) ) ←→( B 6= 0 −→( ( if ( A ∈ C , A , 0 ) / B ) =C ←→( B · C ) = if ( A ∈ C , A , 0 ) ) ) ) by (rule MMI_imbi2d)
have S6: B =if ( B ∈ C , B , 0 ) −→( B 6= 0 ←→ if ( B ∈ C , B , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S7: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) / B ) =( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) / B ) =C ←→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =C ) by (rule MMI_eqeq1d)
have S9: B =if ( B ∈ C , B , 0 ) −→( B · C ) =( if ( B ∈ C , B , 0 ) · C ) by (rule MMI_opreq1)
from S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( B · C ) =if ( A ∈ C , A , 0 ) ←→( if ( B ∈ C , B , 0 ) · C ) =if ( A ∈ C , A , 0 ) ) by (rule MMI_eqeq1d)
from S8 S10 have S11: B =if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) / B ) = C ←→ ( B · C ) = if ( A ∈ C , A

1180

, 0 ) ) ←→( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =C ←→( if ( B ∈ C , B , 0 ) · C ) =if ( A ∈ C , A , 0 ) ) ) by (rule MMI_bibi12d)
from S6 S11 have S12: B =if ( B ∈ C , B , 0 ) −→( ( B 6= 0 −→ ( ( if ( A ∈ C , A , 0 ) / B ) = C ←→ ( B · C ) = if
( A ∈ C , A , 0 ) ) ) ←→( if ( B ∈ C , B , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =C ←→( if ( B ∈ C , B , 0 ) · C ) =if ( A ∈ C , A , 0 ) ) ) ) by (rule MMI_imbi12d)
have S13: C =if ( C ∈ C , C , 0 ) −→( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =C ←→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ) by (rule MMI_eqeq2)
have S14: C =if ( C ∈ C , C , 0 ) −→( if ( B ∈ C , B , 0 ) · C ) =( if ( B ∈ C , B , 0 ) · if ( C ∈ C , C , 0 ) ) by (rule MMI_opreq2)
from S14 have S15: C =if ( C ∈ C , C , 0 ) −→( ( if ( B ∈ C , B , 0 ) · C ) =if ( A ∈ C , A , 0 ) ←→( if ( B ∈ C , B , 0 ) · if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) ) by (rule MMI_eqeq1d)
from S13 S15 have S16: C =if ( C ∈ C , C , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) = C ←→ ( if (B ∈ C , B , 0 ) · C ) = if ( A ∈ C , A , 0 ) ) ←→( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ←→( if ( B ∈ C , B , 0 ) · if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) ) ) by (rule MMI_bibi12d)
from S16 have S17: C =if ( C ∈ C , C , 0 ) −→( ( if ( B ∈ C , B , 0 ) 6= 0 −→ ( ( if ( A ∈ C , A , 0 ) / if ( B∈ C , B , 0 ) ) = C ←→ ( if ( B ∈ C , B , 0 ) · C ) = if ( A ∈ C ,A , 0 ) ) ) ←→( if ( B ∈ C , B , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ←→( if ( B ∈ C , B , 0 ) · if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) ) ) ) by (rule MMI_imbi2d)
have S18: 0 ∈ C by (rule MMI_0cn)

1181

from S18 have S19: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S20: 0 ∈ C by (rule MMI_0cn)from S20 have S21: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)
have S22: 0 ∈ C by (rule MMI_0cn)from S22 have S23: if ( C ∈ C , C , 0 ) ∈ C by (rule MMI_elimel)from S19 S21 S23 have S24: if ( B ∈ C , B , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =if ( C ∈ C , C , 0 ) ←→( if ( B ∈ C , B , 0 ) · if ( C ∈ C , C , 0 ) ) =if ( A ∈ C , A , 0 ) ) by (rule MMI_divmulz)
from S5 S12 S17 S24 have S25: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B 6= 0 −→( ( A / B ) = C ←→ ( B · C ) = A ) ) by (rule MMI_dedth3h)from S25 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ ( B · C ) = A ) by (rule MMI_imp)
qed
lemma (in MMIsar0) MMI_divmul2t:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ A = ( B · C ) )proof have S1: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ ( B · C ) = A ) by (rule MMI_divmult)have S2: ( B · C ) = A ←→ A = ( B · C ) by (rule MMI_eqcom)
from S1 S2 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ A = ( B · C ) ) by (rule MMI_syl6bb)
qed
lemma (in MMIsar0) MMI_divmul3t:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ A = ( C · B ) )proof have S1: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ A = ( B · C ) ) by (rule MMI_divmul2t)
have S2: ( B ∈ C ∧ C ∈ C ) −→( B · C ) = ( C · B ) by (rule MMI_axmulcom)
from S2 have S3: ( B ∈ C ∧ C ∈ C ) −→( A = ( B · C ) ←→ A = ( C · B ) ) by (rule MMI_eqeq2d)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A = ( B · C ) ←→ A = ( C · B ) ) by (rule MMI_3adant1)
from S4 have S5: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( A = ( B · C ) ←→ A = ( C · B ) ) by (rule MMI_adantr)
from S1 S5 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = C ←→ A = ( C · B ) ) by (rule MMI_bitrd)
qed
lemma (in MMIsar0) MMI_divcl: assumes A1: A ∈ C andA2: B ∈ C and
A3: B 6= 0

1182

shows ( A / B ) ∈ C
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: B 6= 0.
S from S1 S2 S3 have S4: ( A / B ) ={ x ∈ C . ( B · x ) = A } by (rule MMI_divval)
from A2 have S5: B ∈ C.
from A1 have S6: A ∈ C.
from A3 have S7: B 6= 0.
from S5 S6 S7 have S8: ∃ ! x . x ∈ C ∧ ( B · x ) = A by (rule MMI_receu)
have S9:S ( ∃! x . x ∈ C ∧ ( B · x ) =A ) −→{ x ∈ C . ( B
S · x ) = A } ∈ C by (rule MMI_reucl)
from S8 S9 have S10:{ x ∈ C . ( B · x ) = A } ∈ C by (rule MMI_ax_mp)
from S4 S10 show ( A / B ) ∈ C by (rule MMI_eqeltr)
qedlemma (in MMIsar0) MMI_divclz: assumes A1: A ∈ C andA2: B ∈ C
shows B 6= 0 −→ ( A / B ) ∈ C
proof have S1: B =if ( B 6= 0 , B , 1 ) −→( A / B ) =( A / if ( B 6= 0 , B , 1 ) ) by (rule MMI_opreq2)
from S1 have S2: B =if ( B 6= 0 , B , 1 ) −→( ( A / B ) ∈ C ←→( A / if ( B 6= 0 , B , 1 ) ) ∈ C ) by (rule MMI_eleq1d)
from A1 have S3: A ∈ C.
from A2 have S4: B ∈ C.
have S5: 1 ∈ C by (rule MMI_1cn)from S4 S5 have S6: if ( B 6= 0 , B , 1 ) ∈ C by (rule MMI_keepel)
have S7: if ( B 6= 0 , B , 1 ) 6= 0 by (rule MMI_elimne0)
from S3 S6 S7 have S8: ( A / if ( B 6= 0 , B , 1 ) ) ∈ C by (ruleMMI_divcl)
from S2 S8 show B 6= 0 −→ ( A / B ) ∈ C by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divclt:
shows ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) ∈ C
proof have S1: A =if ( A ∈ C , A , 0 ) −→( A / B ) =1183

( if ( A ∈ C , A , 0 ) / B ) by (rule MMI_opreq1)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→( ( A / B ) ∈ C ←→( if ( A ∈ C , A , 0 ) / B ) ∈ C ) by (rule MMI_eleq1d)
from S2 have S3: A =if ( A ∈ C , A , 0 ) −→( ( B 6= 0 −→ ( A / B ) ∈ C ) ←→( B 6= 0 −→( if ( A ∈ C , A , 0 ) / B ) ∈ C ) ) by (rule MMI_imbi2d)
have S4: B =if ( B ∈ C , B , 0 ) −→( B 6= 0 ←→ if ( B ∈ C , B , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S5: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) / B ) =( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S5 have S6: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) / B ) ∈ C ←→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) ∈ C ) by (rule MMI_eleq1d)
from S4 S6 have S7: B =if ( B ∈ C , B , 0 ) −→( ( B 6= 0 −→ ( if ( A ∈ C , A , 0 ) / B ) ∈ C ) ←→( if ( B ∈ C , B , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) ∈ C ) ) by (rule MMI_imbi12d)
have S8: 0 ∈ C by (rule MMI_0cn)from S8 have S9: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S10: 0 ∈ C by (rule MMI_0cn)from S10 have S11: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S9 S11 have S12: if ( B ∈ C , B , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) ∈ C by (rule MMI_divclz)
from S3 S7 S12 have S13: ( A ∈ C ∧ B ∈ C ) −→( B 6= 0 −→ ( A / B ) ∈ C ) by (rule MMI_dedth2h)from S13 show ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) ∈ C by (rule MMI_3impia)
qedlemma (in MMIsar0) MMI_reccl: assumes A1: A ∈ C and
A2: A 6= 0
shows ( 1 / A ) ∈ C
proof have S1: 1 ∈ C by (rule MMI_1cn)from A1 have S2: A ∈ C.
from A2 have S3: A 6= 0.
from S1 S2 S3 show ( 1 / A ) ∈ C by (rule MMI_divcl)
qed
lemma (in MMIsar0) MMI_recclz: assumes A1: A ∈ C

1184

shows A 6= 0 −→ ( 1 / A ) ∈ C
proof have S1: 1 ∈ C by (rule MMI_1cn)from A1 have S2: A ∈ C.
from S1 S2 show A 6= 0 −→ ( 1 / A ) ∈ C by (rule MMI_divclz)
qedlemma (in MMIsar0) MMI_recclt:
shows ( A ∈ C ∧ A 6= 0 ) −→ ( 1 / A ) ∈ C
proof have S1: 1 ∈ C by (rule MMI_1cn)
have S2: ( 1 ∈ C ∧ A ∈ C ∧ A 6= 0 ) −→( 1 / A ) ∈ C by (rule MMI_divclt)
from S1 S2 show ( A ∈ C ∧ A 6= 0 ) −→ ( 1 / A ) ∈ C by (rule MMI_mp3an1)
qed
lemma (in MMIsar0) MMI_divcan2: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0
shows ( A · ( B / A ) ) = B
proof have S1: ( B / A ) = ( B / A ) by (rule MMI_eqid)
from A2 have S2: B ∈ C.
from A1 have S3: A ∈ C.
from A2 have S4: B ∈ C.
from A1 have S5: A ∈ C.
from A3 have S6: A 6= 0.
from S4 S5 S6 have S7: ( B / A ) ∈ C by (rule MMI_divcl)
from A3 have S8: A 6= 0.
from S2 S3 S7 S8 have S9: ( B / A ) =( B / A ) ←→ ( A · ( B / A ) ) = B by (rule MMI_divmul)
from S1 S9 show ( A · ( B / A ) ) = B by (rule MMI_mpbi)
qedlemma (in MMIsar0) MMI_divcan1: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0
shows ( ( B / A ) · A ) = B
proof from A2 have S1: B ∈ C.
from A1 have S2: A ∈ C.
from A3 have S3: A 6= 0.
from S1 S2 S3 have S4: ( B / A ) ∈ C by (rule MMI_divcl)
from A1 have S5: A ∈ C.
from S4 S5 have S6: ( ( B / A ) · A ) = ( A · ( B / A ) ) by (ruleMMI_mulcom)
from A1 have S7: A ∈ C.
from A2 have S8: B ∈ C.
from A3 have S9: A 6= 0.

1185

from S7 S8 S9 have S10: ( A · ( B / A ) ) = B by (rule MMI_divcan2)from S6 S10 show ( ( B / A ) · A ) = B by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_divcan1z: assumes A1: A ∈ C andA2: B ∈ C
shows A 6= 0 −→ ( ( B / A ) · A ) = B
proof have S1: A =if ( A 6= 0 , A , 1 ) −→( B / A ) =( B / if ( A 6= 0 , A , 1 ) ) by (rule MMI_opreq2)
have S2: A =if ( A 6= 0 , A , 1 ) −→A = if ( A 6= 0 , A , 1 ) by (rule MMI_id)
from S1 S2 have S3: A =if ( A 6= 0 , A , 1 ) −→( ( B / A ) · A ) =( ( B / if ( A 6= 0 , A , 1 ) ) · if ( A 6= 0 , A , 1 ) ) by (rule MMI_opreq12d)
from S3 have S4: A =if ( A 6= 0 , A , 1 ) −→( ( ( B / A ) · A ) =B ←→( ( B / if ( A 6= 0 , A , 1 ) ) · if ( A 6= 0 , A , 1 ) ) =B ) by (rule MMI_eqeq1d)
from A1 have S5: A ∈ C.
have S6: 1 ∈ C by (rule MMI_1cn)from S5 S6 have S7: if ( A 6= 0 , A , 1 ) ∈ C by (rule MMI_keepel)
from A2 have S8: B ∈ C.
have S9: if ( A 6= 0 , A , 1 ) 6= 0 by (rule MMI_elimne0)
from S7 S8 S9 have S10: ( ( B / if ( A 6= 0 , A , 1 ) ) · if ( A 6=
0 , A , 1 ) ) =B by (rule MMI_divcan1)from S4 S10 show A 6= 0 −→ ( ( B / A ) · A ) = B by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divcan2z: assumes A1: A ∈ C andA2: B ∈ C
shows A 6= 0 −→ ( A · ( B / A ) ) = B
proof have S1: A =if ( A 6= 0 , A , 1 ) −→A = if ( A 6= 0 , A , 1 ) by (rule MMI_id)
have S2: A =if ( A 6= 0 , A , 1 ) −→( B / A ) =( B / if ( A 6= 0 , A , 1 ) ) by (rule MMI_opreq2)
from S1 S2 have S3: A =if ( A 6= 0 , A , 1 ) −→1186

( A · ( B / A ) ) =( if ( A 6= 0 , A , 1 ) · ( B / if ( A 6= 0 , A , 1 ) ) ) by (rule MMI_opreq12d)
from S3 have S4: A =if ( A 6= 0 , A , 1 ) −→( ( A · ( B / A ) ) =B ←→( if ( A 6= 0 , A , 1 ) · ( B / if ( A 6= 0 , A , 1 ) ) ) =B ) by (rule MMI_eqeq1d)
from A1 have S5: A ∈ C.
have S6: 1 ∈ C by (rule MMI_1cn)from S5 S6 have S7: if ( A 6= 0 , A , 1 ) ∈ C by (rule MMI_keepel)
from A2 have S8: B ∈ C.
have S9: if ( A 6= 0 , A , 1 ) 6= 0 by (rule MMI_elimne0)
from S7 S8 S9 have S10: ( if ( A 6= 0 , A , 1 ) · ( B / if ( A 6= 0
, A , 1 ) ) ) =B by (rule MMI_divcan2)from S4 S10 show A 6= 0 −→ ( A · ( B / A ) ) = B by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divcan1t:
shows ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( B / A ) · A ) = B
proof have S1: A =if ( A ∈ C , A , 0 ) −→( A 6= 0 ←→ if ( A ∈ C , A , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S2: A =if ( A ∈ C , A , 0 ) −→( B / A ) =( B / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq2)
have S3: A =if ( A ∈ C , A , 0 ) −→A = if ( A ∈ C , A , 0 ) by (rule MMI_id)
from S2 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( B / A ) · A ) =( ( B / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq12d)
from S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( ( B / A ) · A ) =B ←→( ( B / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A , 0 ) ) =B ) by (rule MMI_eqeq1d)
from S1 S5 have S6: A =if ( A ∈ C , A , 0 ) −→( ( A 6= 0 −→ ( ( B / A ) · A ) = B ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( ( B / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A , 0 ) ) =B ) ) by (rule MMI_imbi12d)

1187

have S7: B =if ( B ∈ C , B , 0 ) −→( B / if ( A ∈ C , A , 0 ) ) =( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq1)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( ( B / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A , 0 ) ) =( ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A, 0 ) ) by (rule MMI_opreq1d)
have S9: B =if ( B ∈ C , B , 0 ) −→B = if ( B ∈ C , B , 0 ) by (rule MMI_id)
from S8 S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( ( B / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A , 0 ) ) =B ←→( ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A, 0 ) ) =if ( B ∈ C , B , 0 ) ) by (rule MMI_eqeq12d)
from S10 have S11: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) 6= 0 −→ ( ( B / if ( A ∈ C , A , 0 ) ) · if
( A ∈ C , A , 0 ) ) = B ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A, 0 ) ) =if ( B ∈ C , B , 0 ) ) ) by (rule MMI_imbi2d)
have S12: 0 ∈ C by (rule MMI_0cn)from S12 have S13: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S14: 0 ∈ C by (rule MMI_0cn)from S14 have S15: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S13 S15 have S16: if ( A ∈ C , A , 0 ) 6= 0 −→( ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A , 0 ) ) · if ( A ∈ C , A, 0 ) ) =if ( B ∈ C , B , 0 ) by (rule MMI_divcan1z)
from S6 S11 S16 have S17: ( A ∈ C ∧ B ∈ C ) −→( A 6= 0 −→ ( ( B / A ) · A ) = B ) by (rule MMI_dedth2h)from S17 show ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( B / A ) · A ) = B by (rule MMI_3impia)
qedlemma (in MMIsar0) MMI_divcan2t:
shows ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( A · ( B / A ) ) = B
proof have S1: A =if ( A ∈ C , A , 0 ) −→( A 6= 0 ←→ if ( A ∈ C , A , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S2: A =1188

if ( A ∈ C , A , 0 ) −→A = if ( A ∈ C , A , 0 ) by (rule MMI_id)
have S3: A =if ( A ∈ C , A , 0 ) −→( B / A ) =( B / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq2)
from S2 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( A · ( B / A ) ) =( if ( A ∈ C , A , 0 ) · ( B / if ( A ∈ C , A , 0 ) ) ) by (rule MMI_opreq12d)
from S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( A · ( B / A ) ) =B ←→( if ( A ∈ C , A , 0 ) · ( B / if ( A ∈ C , A , 0 ) ) ) =B ) by (rule MMI_eqeq1d)
from S1 S5 have S6: A =if ( A ∈ C , A , 0 ) −→( ( A 6= 0 −→ ( A · ( B / A ) ) = B ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) · ( B / if ( A ∈ C , A , 0 ) ) ) =B ) ) by (rule MMI_imbi12d)
have S7: B =if ( B ∈ C , B , 0 ) −→( B / if ( A ∈ C , A , 0 ) ) =( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq1)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) · ( B / if ( A ∈ C , A , 0 ) ) ) =( if ( A ∈ C , A , 0 ) · ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A ,0 ) ) ) by (rule MMI_opreq2d)
have S9: B =if ( B ∈ C , B , 0 ) −→B = if ( B ∈ C , B , 0 ) by (rule MMI_id)
from S8 S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) · ( B / if ( A ∈ C , A , 0 ) ) ) =B ←→( if ( A ∈ C , A , 0 ) · ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A ,0 ) ) ) =if ( B ∈ C , B , 0 ) ) by (rule MMI_eqeq12d)
from S10 have S11: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) 6= 0 −→ ( if ( A ∈ C , A , 0 ) · ( B / if
( A ∈ C , A , 0 ) ) ) = B ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) · ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A ,0 ) ) ) =if ( B ∈ C , B , 0 ) ) ) by (rule MMI_imbi2d)1189

have S12: 0 ∈ C by (rule MMI_0cn)from S12 have S13: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S14: 0 ∈ C by (rule MMI_0cn)from S14 have S15: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S13 S15 have S16: if ( A ∈ C , A , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) · ( if ( B ∈ C , B , 0 ) / if ( A ∈ C , A ,0 ) ) ) =if ( B ∈ C , B , 0 ) by (rule MMI_divcan2z)
from S6 S11 S16 have S17: ( A ∈ C ∧ B ∈ C ) −→( A 6= 0 −→ ( A · ( B / A ) ) = B ) by (rule MMI_dedth2h)from S17 show ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( A · ( B / A ) ) = B by (rule MMI_3impia)
qedlemma (in MMIsar0) MMI_divne0bt:
shows ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A 6= 0 ←→ ( A / B ) 6= 0 )proof have S1: B ∈ C −→ ( B · 0 ) = 0 by (rule MMI_mul01t)
from S1 have S2: B ∈ C −→ ( ( B · 0 ) = A ←→ 0 = A ) by (rule MMI_eqeq1d)
have S3: A = 0 ←→ 0 = A by (rule MMI_eqcom)
from S2 S3 have S4: B ∈ C −→ ( A = 0 ←→ ( B · 0 ) = A ) by (ruleMMI_syl6rbbrA)from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A = 0 ←→ ( B · 0 ) = A ) by (rule MMI_3ad2ant2)
have S6: 0 ∈ C by (rule MMI_0cn)
have S7: ( ( A ∈ C ∧ B ∈ C ∧ 0 ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = 0 ←→ ( B · 0 ) = A ) by (rule MMI_divmult)from S6 S7 have S8: ( ( A ∈ C ∧ B ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) = 0 ←→ ( B · 0 ) = A ) by (rule MMI_mp3anl3)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( ( A / B ) = 0 ←→ ( B · 0 ) = A ) by (rule MMI_3impa)
from S5 S9 have S10: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A = 0 ←→ ( A / B ) = 0 ) by (rule MMI_bitr4d)
from S10 show ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A 6= 0 ←→ ( A / B ) 6= 0 ) by (rule MMI_eqneqd)
qed
lemma (in MMIsar0) MMI_divne0: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0 and
A4: B 6= 0
shows ( A / B ) 6= 0
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A4 have S3: B 6= 0.

1190

from A3 have S4: A 6= 0.
have S5: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A 6= 0 ←→ ( A / B ) 6= 0 ) by (rule MMI_divne0bt)
from S4 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) 6= 0 by (rule MMI_mpbii)
from S1 S2 S3 S6 show ( A / B ) 6= 0 by (rule MMI_mp3an)
qedlemma (in MMIsar0) MMI_recne0z: assumes A1: A ∈ Cshows A 6= 0 −→ ( 1 / A ) 6= 0
proof have S1: A =if ( A 6= 0 , A , 1 ) −→( 1 / A ) =( 1 / if ( A 6= 0 , A , 1 ) ) by (rule MMI_opreq2)
from S1 have S2: A =if ( A 6= 0 , A , 1 ) −→( ( 1 / A ) 6= 0 ←→( 1 / if ( A 6= 0 , A , 1 ) ) 6= 0 ) by (rule MMI_neeq1d)
have S3: 1 ∈ C by (rule MMI_1cn)from A1 have S4: A ∈ C.
have S5: 1 ∈ C by (rule MMI_1cn)from S4 S5 have S6: if ( A 6= 0 , A , 1 ) ∈ C by (rule MMI_keepel)
have S7: 1 6= 0 by (rule MMI_ax1ne0)
have S8: if ( A 6= 0 , A , 1 ) 6= 0 by (rule MMI_elimne0)
from S3 S6 S7 S8 have S9: ( 1 / if ( A 6= 0 , A , 1 ) ) 6= 0 by (ruleMMI_divne0)
from S2 S9 show A 6= 0 −→ ( 1 / A ) 6= 0 by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_recne0t:
shows ( A ∈ C ∧ A 6= 0 ) −→ ( 1 / A ) 6= 0
proof have S1: A =if ( A ∈ C , A , 0 ) −→( A 6= 0 ←→ if ( A ∈ C , A , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S2: A =if ( A ∈ C , A , 0 ) −→( 1 / A ) =( 1 / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq2)
from S2 have S3: A =if ( A ∈ C , A , 0 ) −→( ( 1 / A ) 6= 0 ←→( 1 / if ( A ∈ C , A , 0 ) ) 6= 0 ) by (rule MMI_neeq1d)
from S1 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( A 6= 0 −→ ( 1 / A ) 6= 0 ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( 1 / if ( A ∈ C , A , 0 ) ) 6= 0 ) ) by (rule MMI_imbi12d)

1191

have S5: 0 ∈ C by (rule MMI_0cn)from S5 have S6: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)from S6 have S7: if ( A ∈ C , A , 0 ) 6= 0 −→( 1 / if ( A ∈ C , A , 0 ) ) 6= 0 by (rule MMI_recne0z)
from S4 S7 have S8: A ∈ C −→ ( A 6= 0 −→ ( 1 / A ) 6= 0 ) by (ruleMMI_dedth)from S8 show ( A ∈ C ∧ A 6= 0 ) −→ ( 1 / A ) 6= 0 by (rule MMI_imp)
qed
lemma (in MMIsar0) MMI_recid: assumes A1: A ∈ C and
A2: A 6= 0
shows ( A · ( 1 / A ) ) = 1
proof from A1 have S1: A ∈ C.
have S2: 1 ∈ C by (rule MMI_1cn)from A2 have S3: A 6= 0.
from S1 S2 S3 show ( A · ( 1 / A ) ) = 1 by (rule MMI_divcan2)
qedlemma (in MMIsar0) MMI_recidz: assumes A1: A ∈ Cshows A 6= 0 −→ ( A · ( 1 / A ) ) = 1
proof from A1 have S1: A ∈ C.
have S2: 1 ∈ C by (rule MMI_1cn)from S1 S2 show A 6= 0 −→ ( A · ( 1 / A ) ) = 1 by (rule MMI_divcan2z)
qedlemma (in MMIsar0) MMI_recidt:
shows ( A ∈ C ∧ A 6= 0 ) −→( A · ( 1 / A ) ) = 1
proof have S1: A =if ( A ∈ C , A , 0 ) −→( A 6= 0 ←→ if ( A ∈ C , A , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S2: A =if ( A ∈ C , A , 0 ) −→A = if ( A ∈ C , A , 0 ) by (rule MMI_id)
have S3: A =if ( A ∈ C , A , 0 ) −→( 1 / A ) =( 1 / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq2)
from S2 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( A · ( 1 / A ) ) =( if ( A ∈ C , A , 0 ) · ( 1 / if ( A ∈ C , A , 0 ) ) ) by (rule MMI_opreq12d)
from S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( A · ( 1 / A ) ) =
1 ←→

1192

( if ( A ∈ C , A , 0 ) · ( 1 / if ( A ∈ C , A , 0 ) ) ) =1 ) by (rule MMI_eqeq1d)
from S1 S5 have S6: A =if ( A ∈ C , A , 0 ) −→( ( A 6= 0 −→ ( A · ( 1 / A ) ) = 1 ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) · ( 1 / if ( A ∈ C , A , 0 ) ) ) =1 ) ) by (rule MMI_imbi12d)
have S7: 0 ∈ C by (rule MMI_0cn)from S7 have S8: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)from S8 have S9: if ( A ∈ C , A , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) · ( 1 / if ( A ∈ C , A , 0 ) ) ) =1 by (rule MMI_recidz)
from S6 S9 have S10: A ∈ C −→( A 6= 0 −→ ( A · ( 1 / A ) ) = 1 ) by (rule MMI_dedth)from S10 show ( A ∈ C ∧ A 6= 0 ) −→( A · ( 1 / A ) ) = 1 by (rule MMI_imp)
qed
lemma (in MMIsar0) MMI_recid2t:
shows ( A ∈ C ∧ A 6= 0 ) −→( ( 1 / A ) · A ) = 1
proof have S1: ( ( 1 / A ) ∈ C ∧ A ∈ C ) −→( ( 1 / A ) · A ) = ( A · ( 1 / A ) ) by (rule MMI_axmulcom)
have S2: ( A ∈ C ∧ A 6= 0 ) −→ ( 1 / A ) ∈ C by (rule MMI_recclt)
have S3: ( A ∈ C ∧ A 6= 0 ) −→ A ∈ C by (rule MMI_pm3_26)
from S1 S2 S3 have S4: ( A ∈ C ∧ A 6= 0 ) −→( ( 1 / A ) · A ) = ( A · ( 1 / A ) ) by (rule MMI_sylanc)
have S5: ( A ∈ C ∧ A 6= 0 ) −→( A · ( 1 / A ) ) = 1 by (rule MMI_recidt)
from S4 S5 show ( A ∈ C ∧ A 6= 0 ) −→( ( 1 / A ) · A ) = 1 by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_divrec: assumes A1: A ∈ C andA2: B ∈ C and
A3: B 6= 0
shows ( A / B ) = ( A · ( 1 / B ) )proof from A2 have S1: B ∈ C.
from A1 have S2: A ∈ C.
from A2 have S3: B ∈ C.
from A3 have S4: B 6= 0.
from S3 S4 have S5: ( 1 / B ) ∈ C by (rule MMI_reccl)
from S2 S5 have S6: ( A · ( 1 / B ) ) ∈ C by (rule MMI_mulcl)
from S1 S6 have S7: ( B · ( A · ( 1 / B ) ) ) =( ( A · ( 1 / B ) ) · B ) by (rule MMI_mulcom)
from A1 have S8: A ∈ C.

1193

from S5 have S9: ( 1 / B ) ∈ C .
from A2 have S10: B ∈ C.
from S8 S9 S10 have S11: ( ( A · ( 1 / B ) ) · B ) =( A · ( ( 1 / B ) · B ) ) by (rule MMI_mulass)from A2 have S12: B ∈ C.
have S13: 1 ∈ C by (rule MMI_1cn)from A3 have S14: B 6= 0.
from S12 S13 S14 have S15: ( ( 1 / B ) · B ) = 1 by (rule MMI_divcan1)from S15 have S16: ( A · ( ( 1 / B ) · B ) ) = ( A · 1 ) by (rule MMI_opreq2i)
from A1 have S17: A ∈ C.
from S17 have S18: ( A · 1 ) = A by (rule MMI_mulid1)
from S16 S18 have S19: ( A · ( ( 1 / B ) · B ) ) = A by (rule MMI_eqtr)
from S7 S11 S19 have S20: ( B · ( A · ( 1 / B ) ) ) = A by (rule MMI_3eqtr)
from A1 have S21: A ∈ C.
from A2 have S22: B ∈ C.
from S6 have S23: ( A · ( 1 / B ) ) ∈ C .
from A3 have S24: B 6= 0.
from S21 S22 S23 S24 have S25: ( A / B ) =( A · ( 1 / B ) ) ←→( B · ( A · ( 1 / B ) ) ) = A by (rule MMI_divmul)
from S20 S25 show ( A / B ) = ( A · ( 1 / B ) ) by (rule MMI_mpbir)qedlemma (in MMIsar0) MMI_divrecz: assumes A1: A ∈ C andA2: B ∈ C
shows B 6= 0 −→ ( A / B ) = ( A · ( 1 / B ) )proof have S1: B =if ( B 6= 0 , B , 1 ) −→( A / B ) =( A / if ( B 6= 0 , B , 1 ) ) by (rule MMI_opreq2)
have S2: B =if ( B 6= 0 , B , 1 ) −→( 1 / B ) =( 1 / if ( B 6= 0 , B , 1 ) ) by (rule MMI_opreq2)
from S2 have S3: B =if ( B 6= 0 , B , 1 ) −→( A · ( 1 / B ) ) =( A · ( 1 / if ( B 6= 0 , B , 1 ) ) ) by (rule MMI_opreq2d)
from S1 S3 have S4: B =if ( B 6= 0 , B , 1 ) −→( ( A / B ) =( A · ( 1 / B ) ) ←→( A / if ( B 6= 0 , B , 1 ) ) =( A · ( 1 / if ( B 6= 0 , B , 1 ) ) ) ) by (rule MMI_eqeq12d)
from A1 have S5: A ∈ C.
from A2 have S6: B ∈ C.
have S7: 1 ∈ C by (rule MMI_1cn)from S6 S7 have S8: if ( B 6= 0 , B , 1 ) ∈ C by (rule MMI_keepel)1194

have S9: if ( B 6= 0 , B , 1 ) 6= 0 by (rule MMI_elimne0)
from S5 S8 S9 have S10: ( A / if ( B 6= 0 , B , 1 ) ) =( A · ( 1 / if ( B 6= 0 , B , 1 ) ) ) by (rule MMI_divrec)
from S4 S10 show B 6= 0 −→ ( A / B ) = ( A · ( 1 / B ) )by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divrect:
shows ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) = ( A · ( 1 / B ) )proof have S1: A =if ( A ∈ C , A , 0 ) −→( A / B ) =( if ( A ∈ C , A , 0 ) / B ) by (rule MMI_opreq1)
have S2: A =if ( A ∈ C , A , 0 ) −→( A · ( 1 / B ) ) =( if ( A ∈ C , A , 0 ) · ( 1 / B ) ) by (rule MMI_opreq1)
from S1 S2 have S3: A =if ( A ∈ C , A , 0 ) −→( ( A / B ) =( A · ( 1 / B ) ) ←→( if ( A ∈ C , A , 0 ) / B ) =( if ( A ∈ C , A , 0 ) · ( 1 / B ) ) ) by (rule MMI_eqeq12d)
from S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( B 6= 0 −→ ( A / B ) = ( A · ( 1 / B ) ) ) ←→( B 6= 0 −→( if ( A ∈ C , A , 0 ) / B ) =( if ( A ∈ C , A , 0 ) · ( 1 / B ) ) ) ) by (rule MMI_imbi2d)
have S5: B =if ( B ∈ C , B , 0 ) −→( B 6= 0 ←→ if ( B ∈ C , B , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S6: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) / B ) =( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
have S7: B =if ( B ∈ C , B , 0 ) −→( 1 / B ) =( 1 / if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) · ( 1 / B ) ) =( if ( A ∈ C , A , 0 ) · ( 1 / if ( B ∈ C , B , 0 ) ) ) by (rule MMI_opreq2d)
from S6 S8 have S9: B =1195

if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) / B ) =( if ( A ∈ C , A , 0 ) · ( 1 / B ) ) ←→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) · ( 1 / if ( B ∈ C , B , 0 ) ) ) ) by (ruleMMI_eqeq12d)
from S5 S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( B 6= 0 −→ ( if ( A ∈ C , A , 0 ) / B ) = ( if ( A ∈ C , A , 0 )· ( 1 / B ) ) ) ←→( if ( B ∈ C , B , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) · ( 1 / if ( B ∈ C , B , 0 ) ) ) ) ) by (ruleMMI_imbi12d)
have S11: 0 ∈ C by (rule MMI_0cn)from S11 have S12: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S13: 0 ∈ C by (rule MMI_0cn)from S13 have S14: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S12 S14 have S15: if ( B ∈ C , B , 0 ) 6= 0 −→( if ( A ∈ C , A , 0 ) / if ( B ∈ C , B , 0 ) ) =( if ( A ∈ C , A , 0 ) · ( 1 / if ( B ∈ C , B , 0 ) ) ) by (rule MMI_divrecz)
from S4 S10 S15 have S16: ( A ∈ C ∧ B ∈ C ) −→( B 6= 0 −→( A / B ) = ( A · ( 1 / B ) ) ) by (rule MMI_dedth2h)from S16 show ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) = ( A · ( 1 / B ) ) by (rule MMI_3impia)
qedlemma (in MMIsar0) MMI_divrec2t:
shows ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) = ( ( 1 / B ) · A )proof have S1: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) = ( A · ( 1 / B ) ) by (rule MMI_divrect)
have S2: ( A ∈ C ∧ ( 1 / B ) ∈ C ) −→( A · ( 1 / B ) ) = ( ( 1 / B ) · A ) by (rule MMI_axmulcom)
have S3: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→ A ∈ C by (rule MMI_3simp1)
have S4: ( B ∈ C ∧ B 6= 0 ) −→ ( 1 / B ) ∈ C by (rule MMI_recclt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( 1 / B ) ∈ C by (rule MMI_3adant1)
from S2 S3 S5 have S6: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A · ( 1 / B ) ) = ( ( 1 / B ) · A ) by (rule MMI_sylanc)
from S1 S6 show ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) = ( ( 1 / B ) · A ) by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_divasst:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) = ( A · ( B / C ) )1196

proof have S1: A ∈ C −→ A ∈ C by (rule MMI_id)
have S2: B ∈ C −→ B ∈ C by (rule MMI_id)
have S3: ( C ∈ C ∧ C 6= 0 ) −→ ( 1 / C ) ∈ C by (rule MMI_recclt)
from S1 S2 S3 have S4: ( A ∈ C ∧ B ∈ C ∧ ( C ∈ C ∧ C 6= 0 ) ) −→( A ∈ C ∧ B ∈ C ∧ ( 1 / C ) ∈ C ) by (rule MMI_3anim123i)
from S4 have S5: A ∈ C −→( B ∈ C −→( ( C ∈ C ∧ C 6= 0 ) −→( A ∈ C ∧ B ∈ C ∧ ( 1 / C ) ∈ C ) ) ) by (rule MMI_3exp)
from S5 have S6: A ∈ C −→( B ∈ C −→( C ∈ C −→( C 6= 0 −→( A ∈ C ∧ B ∈ C ∧ ( 1 / C ) ∈ C ) ) ) ) by (rule MMI_exp4a)
from S6 have S7: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A ∈ C ∧ B ∈ C ∧ ( 1 / C ) ∈ C ) by (rule MMI_3imp1)
have S8: ( A ∈ C ∧ B ∈ C ∧ ( 1 / C ) ∈ C ) −→( ( A · B ) · ( 1 / C ) ) =( A · ( B · ( 1 / C ) ) ) by (rule MMI_axmulass)from S7 S8 have S9: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) · ( 1 / C ) ) =( A · ( B · ( 1 / C ) ) ) by (rule MMI_syl)have S10: ( ( A · B ) ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( ( A · B ) / C ) =( ( A · B ) · ( 1 / C ) ) by (rule MMI_divrect)
from S10 have S11: ( ( ( A · B ) ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) =( ( A · B ) · ( 1 / C ) ) by (rule MMI_3expa)
have S12: ( A ∈ C ∧ B ∈ C ) −→ ( A · B ) ∈ C by (rule MMI_axmulcl)
from S12 have S13: ( ( A ∈ C ∧ B ∈ C ) ∧ C ∈ C ) −→( ( A · B ) ∈ C ∧ C ∈ C ) by (rule MMI_anim1i)
from S13 have S14: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · B ) ∈ C ∧ C ∈ C ) by (rule MMI_3impa)
from S11 S14 have S15: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) =( ( A · B ) · ( 1 / C ) ) by (rule MMI_sylan)
have S16: ( B ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( B / C ) = ( B · ( 1 / C ) ) by (rule MMI_divrect)
from S16 have S17: ( ( B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( B / C ) = ( B · ( 1 / C ) ) by (rule MMI_3expa)
from S17 have S18: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( B / C ) = ( B · ( 1 / C ) ) by (rule MMI_3adantl1)
from S18 have S19: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A · ( B / C ) ) =( A · ( B · ( 1 / C ) ) ) by (rule MMI_opreq2d)

1197

from S9 S15 S19 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) = ( A · ( B / C ) ) by (rule MMI_3eqtr4d)
qed
lemma (in MMIsar0) MMI_div23t:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) = ( ( A / C ) · B )proof have S1: ( A ∈ C ∧ B ∈ C ) −→( A · B ) = ( B · A ) by (rule MMI_axmulcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A · B ) = ( B · A ) by (rule MMI_3adant3)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A · B ) = ( B · A ) by (rule MMI_adantr)
from S3 have S4: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) = ( ( B · A ) / C ) by (rule MMI_opreq1d)
have S5: ( ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( B · A ) / C ) = ( B · ( A / C ) ) by (rule MMI_divasst)
from S5 have S6: ( B ∈ C ∧ A ∈ C ∧ C ∈ C ) −→( C 6= 0 −→( ( B · A ) / C ) =( B · ( A / C ) ) ) by (rule MMI_ex)
from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( C 6= 0 −→( ( B · A ) / C ) =( B · ( A / C ) ) ) by (rule MMI_3com12)
from S7 have S8: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( B · A ) / C ) = ( B · ( A / C ) ) by (rule MMI_imp)
have S9: ( B ∈ C ∧ ( A / C ) ∈ C ) −→( B · ( A / C ) ) = ( ( A / C ) · B ) by (rule MMI_axmulcom)
have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ B ∈ C by (rule MMI_3simp2)
from S10 have S11: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→B ∈ C by (rule MMI_adantr)
have S12: ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_divclt)
from S12 have S13: ( ( A ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_3expa)
from S13 have S14: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_3adantl2)
from S9 S11 S14 have S15: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0
) −→( B · ( A / C ) ) = ( ( A / C ) · B ) by (rule MMI_sylanc)
from S4 S8 S15 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) = ( ( A / C ) · B ) by (rule MMI_3eqtrd)
qed
lemma (in MMIsar0) MMI_div13t:

1198

shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) · C ) = ( ( C / B ) · A )proof have S1: ( A ∈ C ∧ C ∈ C ) −→( A · C ) = ( C · A ) by (rule MMI_axmulcom)
from S1 have S2: ( A ∈ C ∧ C ∈ C ) −→( ( A · C ) / B ) = ( ( C · A ) / B ) by (rule MMI_opreq1d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A · C ) / B ) = ( ( C · A ) / B ) by (rule MMI_3adant2)
from S3 have S4: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A · C ) / B ) = ( ( C · A ) / B ) by (rule MMI_adantr)
have S5: ( ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) ∧ B 6= 0 ) −→( ( A · C ) / B ) = ( ( A / B ) · C ) by (rule MMI_div23t)
from S5 have S6: ( A ∈ C ∧ C ∈ C ∧ B ∈ C ) −→( B 6= 0 −→( ( A · C ) / B ) =( ( A / B ) · C ) ) by (rule MMI_ex)
from S6 have S7: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B 6= 0 −→( ( A · C ) / B ) =( ( A / B ) · C ) ) by (rule MMI_3com23)
from S7 have S8: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A · C ) / B ) = ( ( A / B ) · C ) by (rule MMI_imp)
have S9: ( ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) ∧ B 6= 0 ) −→( ( C · A ) / B ) = ( ( C / B ) · A ) by (rule MMI_div23t)
from S9 have S10: ( C ∈ C ∧ A ∈ C ∧ B ∈ C ) −→( B 6= 0 −→( ( C · A ) / B ) =( ( C / B ) · A ) ) by (rule MMI_ex)
from S10 have S11: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( B 6= 0 −→( ( C · A ) / B ) =( ( C / B ) · A ) ) by (rule MMI_3coml)from S11 have S12: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( C · A ) / B ) = ( ( C / B ) · A ) by (rule MMI_imp)
from S4 S8 S12 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ B 6= 0 ) −→( ( A / B ) · C ) = ( ( C / B ) · A ) by (rule MMI_3eqtr3d)
qed
lemma (in MMIsar0) MMI_div12t:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A · ( B / C ) ) = ( B · ( A / C ) )proof have S1: ( A ∈ C ∧ ( B / C ) ∈ C ) −→( A · ( B / C ) ) = ( ( B / C ) · A ) by (rule MMI_axmulcom)
have S2: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ A ∈ C by (rule MMI_3simp1)
from S2 have S3: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→A ∈ C by (rule MMI_adantr)

1199

have S4: ( B ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( B / C ) ∈ C by (rule MMI_divclt)
from S4 have S5: ( ( B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( B / C ) ∈ C by (rule MMI_3expa)
from S5 have S6: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( B / C ) ∈ C by (rule MMI_3adantl1)
from S1 S3 S6 have S7: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A · ( B / C ) ) = ( ( B / C ) · A ) by (rule MMI_sylanc)
have S8: ( ( B ∈ C ∧ C ∈ C ∧ A ∈ C ) ∧ C 6= 0 ) −→( ( B / C ) · A ) = ( ( A / C ) · B ) by (rule MMI_div13t)
from S8 have S9: ( B ∈ C ∧ C ∈ C ∧ A ∈ C ) −→( C 6= 0 −→( ( B / C ) · A ) =( ( A / C ) · B ) ) by (rule MMI_ex)
from S9 have S10: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( C 6= 0 −→( ( B / C ) · A ) =( ( A / C ) · B ) ) by (rule MMI_3comr)from S10 have S11: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( B / C ) · A ) = ( ( A / C ) · B ) by (rule MMI_imp)
have S12: ( ( A / C ) ∈ C ∧ B ∈ C ) −→( ( A / C ) · B ) = ( B · ( A / C ) ) by (rule MMI_axmulcom)
have S13: ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_divclt)
from S13 have S14: ( ( A ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_3expa)
from S14 have S15: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_3adantl2)
have S16: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→ B ∈ C by (rule MMI_3simp2)
from S16 have S17: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→B ∈ C by (rule MMI_adantr)
from S12 S15 S17 have S18: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0
) −→( ( A / C ) · B ) = ( B · ( A / C ) ) by (rule MMI_sylanc)
from S7 S11 S18 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A · ( B / C ) ) = ( B · ( A / C ) ) by (rule MMI_3eqtrd)
qed
lemma (in MMIsar0) MMI_divassz: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows C 6= 0 −→( ( A · B ) / C ) = ( A · ( B / C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.

1200

from S1 S2 S3 have S4: A ∈ C ∧ B ∈ C ∧ C ∈ C by (rule MMI_3pm3_2i)
have S5: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A · B ) / C ) = ( A · ( B / C ) ) by (rule MMI_divasst)
from S4 S5 show C 6= 0 −→( ( A · B ) / C ) = ( A · ( B / C ) ) by (rule MMI_mpan)qedlemma (in MMIsar0) MMI_divass: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: C 6= 0
shows ( ( A · B ) / C ) = ( A · ( B / C ) )proof from A4 have S1: C 6= 0.
from A1 have S2: A ∈ C.
from A2 have S3: B ∈ C.
from A3 have S4: C ∈ C.
from S2 S3 S4 have S5: C 6= 0 −→( ( A · B ) / C ) = ( A · ( B / C ) ) by (rule MMI_divassz)
from S1 S5 show ( ( A · B ) / C ) = ( A · ( B / C ) ) by (rule MMI_ax_mp)
qed
lemma (in MMIsar0) MMI_divdir: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: C 6= 0
shows ( ( A + B ) / C ) =( ( A / C ) + ( B / C ) )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A3 have S3: C ∈ C.
from A4 have S4: C 6= 0.
from S3 S4 have S5: ( 1 / C ) ∈ C by (rule MMI_reccl)
from S1 S2 S5 have S6: ( ( A + B ) · ( 1 / C ) ) =( ( A · ( 1 / C ) ) + ( B · ( 1 / C ) ) ) by (rule MMI_adddir)
from A1 have S7: A ∈ C.
from A2 have S8: B ∈ C.
from S7 S8 have S9: ( A + B ) ∈ C by (rule MMI_addcl)
from A3 have S10: C ∈ C.
from A4 have S11: C 6= 0.
from S9 S10 S11 have S12: ( ( A + B ) / C ) =( ( A + B ) · ( 1 / C ) ) by (rule MMI_divrec)
from A1 have S13: A ∈ C.
from A3 have S14: C ∈ C.
from A4 have S15: C 6= 0.
from S13 S14 S15 have S16: ( A / C ) = ( A · ( 1 / C ) ) by (ruleMMI_divrec)
from A2 have S17: B ∈ C.

1201

from A3 have S18: C ∈ C.
from A4 have S19: C 6= 0.
from S17 S18 S19 have S20: ( B / C ) = ( B · ( 1 / C ) ) by (ruleMMI_divrec)
from S16 S20 have S21: ( ( A / C ) + ( B / C ) ) =( ( A · ( 1 / C ) ) + ( B · ( 1 / C ) ) ) by (rule MMI_opreq12i)
from S6 S12 S21 show ( ( A + B ) / C ) =( ( A / C ) + ( B / C ) ) by (rule MMI_3eqtr4)
qed
lemma (in MMIsar0) MMI_div23: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: C 6= 0
shows ( ( A · B ) / C ) = ( ( A / C ) · B )proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: ( A · B ) = ( B · A ) by (rule MMI_mulcom)
from S3 have S4: ( ( A · B ) / C ) = ( ( B · A ) / C )by (rule MMI_opreq1i)
from A2 have S5: B ∈ C.
from A1 have S6: A ∈ C.
from A3 have S7: C ∈ C.
from A4 have S8: C 6= 0.
from S5 S6 S7 S8 have
S9: ( ( B · A ) / C ) = ( B · ( A / C ) ) by (rule MMI_divass)
from A2 have S10: B ∈ C.
from A1 have S11: A ∈ C.
from A3 have S12: C ∈ C.
from A4 have S13: C 6= 0.
from S11 S12 S13 have S14: ( A / C ) ∈ C by (rule MMI_divcl)
from S10 S14 have S15: ( B · ( A / C ) ) = ( ( A / C ) · B )by (rule MMI_mulcom)
from S4 S9 S15 show ( ( A · B ) / C ) = ( ( A / C ) · B )by (rule MMI_3eqtr)
qedlemma (in MMIsar0) MMI_divdirz: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C
shows C 6= 0 −→( ( A + B ) / C ) =( ( A / C ) + ( B / C ) )proof have S1: C =1202

if ( C 6= 0 , C , 1 ) −→( ( A + B ) / C ) =( ( A + B ) / if ( C 6= 0 , C , 1 ) ) by (rule MMI_opreq2)
have S2: C =if ( C 6= 0 , C , 1 ) −→( A / C ) =( A / if ( C 6= 0 , C , 1 ) ) by (rule MMI_opreq2)
have S3: C =if ( C 6= 0 , C , 1 ) −→( B / C ) =( B / if ( C 6= 0 , C , 1 ) ) by (rule MMI_opreq2)
from S2 S3 have S4: C =if ( C 6= 0 , C , 1 ) −→( ( A / C ) + ( B / C ) ) =( ( A / if ( C 6= 0 , C , 1 ) ) + ( B / if ( C 6= 0 , C , 1 ) ) ) by(rule MMI_opreq12d)
from S1 S4 have S5: C =if ( C 6= 0 , C , 1 ) −→( ( ( A + B ) / C ) =( ( A / C ) + ( B / C ) ) ←→( ( A + B ) / if ( C 6= 0 , C , 1 ) ) =( ( A / if ( C 6= 0 , C , 1 ) ) + ( B / if ( C 6= 0 , C , 1 ) ) ) ) by(rule MMI_eqeq12d)
from A1 have S6: A ∈ C.
from A2 have S7: B ∈ C.
from A3 have S8: C ∈ C.
have S9: 1 ∈ C by (rule MMI_1cn)from S8 S9 have S10: if ( C 6= 0 , C , 1 ) ∈ C by (rule MMI_keepel)
have S11: if ( C 6= 0 , C , 1 ) 6= 0 by (rule MMI_elimne0)
from S6 S7 S10 S11 have S12: ( ( A + B ) / if ( C 6= 0 , C , 1 ) )=( ( A / if ( C 6= 0 , C , 1 ) ) + ( B / if ( C 6= 0 , C , 1 ) ) ) by(rule MMI_divdir)
from S5 S12 show C 6= 0 −→( ( A + B ) / C ) =( ( A / C ) + ( B / C ) ) by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divdirt:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A + B ) / C ) =( ( A / C ) + ( B / C ) )proof have S1: A =if ( A ∈ C , A , 0 ) −→( A + B ) =( if ( A ∈ C , A , 0 ) + B ) by (rule MMI_opreq1)
from S1 have S2: A =if ( A ∈ C , A , 0 ) −→1203

( ( A + B ) / C ) =( ( if ( A ∈ C , A , 0 ) + B ) / C ) by (rule MMI_opreq1d)
have S3: A =if ( A ∈ C , A , 0 ) −→( A / C ) =( if ( A ∈ C , A , 0 ) / C ) by (rule MMI_opreq1)
from S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( A / C ) + ( B / C ) ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( B / C ) ) by (rule MMI_opreq1d)
from S2 S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( ( A + B ) / C ) =( ( A / C ) + ( B / C ) ) ←→( ( if ( A ∈ C , A , 0 ) + B ) / C ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( B / C ) ) ) by (rule MMI_eqeq12d)
from S5 have S6: A =if ( A ∈ C , A , 0 ) −→( ( C 6= 0 −→ ( ( A + B ) / C ) = ( ( A / C ) + ( B / C ) ) ) ←→( C 6= 0 −→( ( if ( A ∈ C , A , 0 ) + B ) / C ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( B / C ) ) ) ) by (rule MMI_imbi2d)
have S7: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) + B ) =( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) + B ) / C ) =( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / C ) by (rule MMI_opreq1d)
have S9: B =if ( B ∈ C , B , 0 ) −→( B / C ) =( if ( B ∈ C , B , 0 ) / C ) by (rule MMI_opreq1)
from S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) / C ) + ( B / C ) ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( if ( B ∈ C , B , 0 ) / C ) ) by(rule MMI_opreq2d)
from S8 S10 have S11: B =if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) + B ) / C ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( B / C ) ) ←→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / C ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( if ( B ∈ C , B , 0 ) / C ) ) ) by(rule MMI_eqeq12d)
from S11 have S12: B =if ( B ∈ C , B , 0 ) −→( ( C 6= 0 −→ ( ( if ( A ∈ C , A , 0 ) + B ) / C ) = ( ( if ( A ∈ C

1204

, A , 0 ) / C ) + ( B / C ) ) ) ←→( C 6= 0 −→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / C ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( if ( B ∈ C , B , 0 ) / C ) ) ) )by (rule MMI_imbi2d)
have S13: C =if ( C ∈ C , C , 0 ) −→( C 6= 0 ←→ if ( C ∈ C , C , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S14: C =if ( C ∈ C , C , 0 ) −→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / C ) =( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / if ( C ∈ C , C, 0 ) ) by (rule MMI_opreq2)
have S15: C =if ( C ∈ C , C , 0 ) −→( if ( A ∈ C , A , 0 ) / C ) =( if ( A ∈ C , A , 0 ) / if ( C ∈ C , C , 0 ) ) by (rule MMI_opreq2)
have S16: C =if ( C ∈ C , C , 0 ) −→( if ( B ∈ C , B , 0 ) / C ) =( if ( B ∈ C , B , 0 ) / if ( C ∈ C , C , 0 ) ) by (rule MMI_opreq2)
from S15 S16 have S17: C =if ( C ∈ C , C , 0 ) −→( ( if ( A ∈ C , A , 0 ) / C ) + ( if ( B ∈ C , B , 0 ) / C ) ) =( ( if ( A ∈ C , A , 0 ) / if ( C ∈ C , C , 0 ) ) + ( if ( B ∈ C ,B , 0 ) / if ( C ∈ C , C , 0 ) ) ) by (rule MMI_opreq12d)
from S14 S17 have S18: C =if ( C ∈ C , C , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / C ) =( ( if ( A ∈ C , A , 0 ) / C ) + ( if ( B ∈ C , B , 0 ) / C ) ) ←→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / if ( C ∈ C , C, 0 ) ) =( ( if ( A ∈ C , A , 0 ) / if ( C ∈ C , C , 0 ) ) + ( if ( B ∈ C ,B , 0 ) / if ( C ∈ C , C , 0 ) ) ) ) by (rule MMI_eqeq12d)
from S13 S18 have S19: C =if ( C ∈ C , C , 0 ) −→( ( C 6= 0 −→ ( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / C) = ( ( if ( A ∈ C , A , 0 ) / C ) + ( if ( B ∈ C , B , 0 ) / C ) )) ←→( if ( C ∈ C , C , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / if ( C ∈ C , C, 0 ) ) =( ( if ( A ∈ C , A , 0 ) / if ( C ∈ C , C , 0 ) ) + ( if ( B ∈ C ,B , 0 ) / if ( C ∈ C , C , 0 ) ) ) ) ) by (rule MMI_imbi12d)
have S20: 0 ∈ C by (rule MMI_0cn)from S20 have S21: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S22: 0 ∈ C by (rule MMI_0cn)from S22 have S23: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)1205

have S24: 0 ∈ C by (rule MMI_0cn)from S24 have S25: if ( C ∈ C , C , 0 ) ∈ C by (rule MMI_elimel)from S21 S23 S25 have S26: if ( C ∈ C , C , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) + if ( B ∈ C , B , 0 ) ) / if ( C ∈ C , C, 0 ) ) =( ( if ( A ∈ C , A , 0 ) / if ( C ∈ C , C , 0 ) ) + ( if ( B ∈ C ,B , 0 ) / if ( C ∈ C , C , 0 ) ) ) by (rule MMI_divdirz)from S6 S12 S19 S26 have S27: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( C 6= 0 −→( ( A + B ) / C ) =( ( A / C ) + ( B / C ) ) ) by (rule MMI_dedth3h)from S27 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A + B ) / C ) =( ( A / C ) + ( B / C ) ) by (rule MMI_imp)
qed
lemma (in MMIsar0) MMI_divcan3: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0
shows ( ( A · B ) / A ) = B
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from A1 have S3: A ∈ C.
from A3 have S4: A 6= 0.
from S1 S2 S3 S4 have S5: ( ( A · B ) / A ) = ( A · ( B / A ) ) by(rule MMI_divass)
from A1 have S6: A ∈ C.
from A2 have S7: B ∈ C.
from A3 have S8: A 6= 0.
from S6 S7 S8 have S9: ( A · ( B / A ) ) = B by (rule MMI_divcan2)from S5 S9 show ( ( A · B ) / A ) = B by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_divcan4: assumes A1: A ∈ C andA2: B ∈ C and
A3: A 6= 0
shows ( ( B · A ) / A ) = B
proof from A2 have S1: B ∈ C.
from A1 have S2: A ∈ C.
from S1 S2 have S3: ( B · A ) = ( A · B ) by (rule MMI_mulcom)
from S3 have S4: ( ( B · A ) / A ) = ( ( A · B ) / A ) by (rule MMI_opreq1i)
from A1 have S5: A ∈ C.
from A2 have S6: B ∈ C.
from A3 have S7: A 6= 0.
from S5 S6 S7 have S8: ( ( A · B ) / A ) = B by (rule MMI_divcan3)from S4 S8 show ( ( B · A ) / A ) = B by (rule MMI_eqtr)
qed

1206

lemma (in MMIsar0) MMI_divcan3z: assumes A1: A ∈ C andA2: B ∈ C
shows A 6= 0 −→ ( ( A · B ) / A ) = B
proof have S1: A =if ( A 6= 0 , A , 1 ) −→( A · B ) =( if ( A 6= 0 , A , 1 ) · B ) by (rule MMI_opreq1)
have S2: A =if ( A 6= 0 , A , 1 ) −→A = if ( A 6= 0 , A , 1 ) by (rule MMI_id)
from S1 S2 have S3: A =if ( A 6= 0 , A , 1 ) −→( ( A · B ) / A ) =( ( if ( A 6= 0 , A , 1 ) · B ) / if ( A 6= 0 , A , 1 ) ) by (rule MMI_opreq12d)
from S3 have S4: A =if ( A 6= 0 , A , 1 ) −→( ( ( A · B ) / A ) =B ←→( ( if ( A 6= 0 , A , 1 ) · B ) / if ( A 6= 0 , A , 1 ) ) =B ) by (rule MMI_eqeq1d)
from A1 have S5: A ∈ C.
have S6: 1 ∈ C by (rule MMI_1cn)from S5 S6 have S7: if ( A 6= 0 , A , 1 ) ∈ C by (rule MMI_keepel)
from A2 have S8: B ∈ C.
have S9: if ( A 6= 0 , A , 1 ) 6= 0 by (rule MMI_elimne0)
from S7 S8 S9 have S10: ( ( if ( A 6= 0 , A , 1 ) · B ) / if ( A 6=
0 , A , 1 ) ) =B by (rule MMI_divcan3)from S4 S10 show A 6= 0 −→ ( ( A · B ) / A ) = B by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divcan4z: assumes A1: A ∈ C andA2: B ∈ C
shows A 6= 0 −→ ( ( B · A ) / A ) = B
proof from A1 have S1: A ∈ C.
from A2 have S2: B ∈ C.
from S1 S2 have S3: A 6= 0 −→ ( ( A · B ) / A ) = B by (rule MMI_divcan3z)
from A2 have S4: B ∈ C.
from A1 have S5: A ∈ C.
from S4 S5 have S6: ( B · A ) = ( A · B ) by (rule MMI_mulcom)
from S6 have S7: ( ( B · A ) / A ) = ( ( A · B ) / A ) by (rule MMI_opreq1i)
from S3 S7 show A 6= 0 −→ ( ( B · A ) / A ) = B by (rule MMI_syl5eq)
qed
lemma (in MMIsar0) MMI_divcan3t:
shows ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→1207

( ( A · B ) / A ) = B
proof have S1: A =if ( A ∈ C , A , 0 ) −→( A 6= 0 ←→ if ( A ∈ C , A , 0 ) 6= 0 ) by (rule MMI_neeq1)
have S2: A =if ( A ∈ C , A , 0 ) −→( A · B ) =( if ( A ∈ C , A , 0 ) · B ) by (rule MMI_opreq1)
have S3: A =if ( A ∈ C , A , 0 ) −→A = if ( A ∈ C , A , 0 ) by (rule MMI_id)
from S2 S3 have S4: A =if ( A ∈ C , A , 0 ) −→( ( A · B ) / A ) =( ( if ( A ∈ C , A , 0 ) · B ) / if ( A ∈ C , A , 0 ) ) by (rule MMI_opreq12d)
from S4 have S5: A =if ( A ∈ C , A , 0 ) −→( ( ( A · B ) / A ) =B ←→( ( if ( A ∈ C , A , 0 ) · B ) / if ( A ∈ C , A , 0 ) ) =B ) by (rule MMI_eqeq1d)
from S1 S5 have S6: A =if ( A ∈ C , A , 0 ) −→( ( A 6= 0 −→ ( ( A · B ) / A ) = B ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) · B ) / if ( A ∈ C , A , 0 ) ) =B ) ) by (rule MMI_imbi12d)
have S7: B =if ( B ∈ C , B , 0 ) −→( if ( A ∈ C , A , 0 ) · B ) =( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) by (rule MMI_opreq2)
from S7 have S8: B =if ( B ∈ C , B , 0 ) −→( ( if ( A ∈ C , A , 0 ) · B ) / if ( A ∈ C , A , 0 ) ) =( ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) / if ( A ∈ C , A, 0 ) ) by (rule MMI_opreq1d)
have S9: B =if ( B ∈ C , B , 0 ) −→B = if ( B ∈ C , B , 0 ) by (rule MMI_id)
from S8 S9 have S10: B =if ( B ∈ C , B , 0 ) −→( ( ( if ( A ∈ C , A , 0 ) · B ) / if ( A ∈ C , A , 0 ) ) =B ←→( ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) / if ( A ∈ C , A, 0 ) ) =if ( B ∈ C , B , 0 ) ) by (rule MMI_eqeq12d)
from S10 have S11: B =if ( B ∈ C , B , 0 ) −→1208

( ( if ( A ∈ C , A , 0 ) 6= 0 −→ ( ( if ( A ∈ C , A , 0 ) · B ) / if
( A ∈ C , A , 0 ) ) = B ) ←→( if ( A ∈ C , A , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) / if ( A ∈ C , A, 0 ) ) =if ( B ∈ C , B , 0 ) ) ) by (rule MMI_imbi2d)
have S12: 0 ∈ C by (rule MMI_0cn)from S12 have S13: if ( A ∈ C , A , 0 ) ∈ C by (rule MMI_elimel)
have S14: 0 ∈ C by (rule MMI_0cn)from S14 have S15: if ( B ∈ C , B , 0 ) ∈ C by (rule MMI_elimel)from S13 S15 have S16: if ( A ∈ C , A , 0 ) 6= 0 −→( ( if ( A ∈ C , A , 0 ) · if ( B ∈ C , B , 0 ) ) / if ( A ∈ C , A, 0 ) ) =if ( B ∈ C , B , 0 ) by (rule MMI_divcan3z)
from S6 S11 S16 have S17: ( A ∈ C ∧ B ∈ C ) −→( A 6= 0 −→ ( ( A · B ) / A ) = B ) by (rule MMI_dedth2h)from S17 show ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( A · B ) / A ) = B by (rule MMI_3impia)
qedlemma (in MMIsar0) MMI_divcan4t:
shows ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( B · A ) / A ) = B
proof have S1: ( A ∈ C ∧ B ∈ C ) −→( A · B ) = ( B · A ) by (rule MMI_axmulcom)
from S1 have S2: ( A ∈ C ∧ B ∈ C ) −→( ( A · B ) / A ) = ( ( B · A ) / A ) by (rule MMI_opreq1d)
from S2 have S3: ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( A · B ) / A ) = ( ( B · A ) / A ) by (rule MMI_3adant3)
have S4: ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( A · B ) / A ) = B by (rule MMI_divcan3t)
from S3 S4 show ( A ∈ C ∧ B ∈ C ∧ A 6= 0 ) −→( ( B · A ) / A ) = B by (rule MMI_eqtr3d)
qed
lemma (in MMIsar0) MMI_div11: assumes A1: A ∈ C andA2: B ∈ C andA3: C ∈ C andA4: C 6= 0
shows ( A / C ) = ( B / C ) ←→ A = B
proof from A3 have S1: C ∈ C.
from A1 have S2: A ∈ C.
from A3 have S3: C ∈ C.
from A4 have S4: C 6= 0.
from S2 S3 S4 have S5: ( A / C ) ∈ C by (rule MMI_divcl)
from A2 have S6: B ∈ C.
from A3 have S7: C ∈ C.

1209

from A4 have S8: C 6= 0.
from S6 S7 S8 have S9: ( B / C ) ∈ C by (rule MMI_divcl)
from A4 have S10: C 6= 0.
from S1 S5 S9 S10 have S11: ( C · ( A / C ) ) =( C · ( B / C ) ) ←→( A / C ) = ( B / C ) by (rule MMI_mulcan)
from A3 have S12: C ∈ C.
from A1 have S13: A ∈ C.
from A4 have S14: C 6= 0.
from S12 S13 S14 have S15: ( C · ( A / C ) ) = A by (rule MMI_divcan2)from A3 have S16: C ∈ C.
from A2 have S17: B ∈ C.
from A4 have S18: C 6= 0.
from S16 S17 S18 have S19: ( C · ( B / C ) ) = B by (rule MMI_divcan2)from S15 S19 have S20: ( C · ( A / C ) ) =( C · ( B / C ) ) ←→ A = B by (rule MMI_eqeq12i)
from S11 S20 show ( A / C ) = ( B / C ) ←→ A = B by (rule MMI_bitr3)
qed
lemma (in MMIsar0) MMI_div11t:
shows ( A ∈ C ∧ B ∈ C ∧ ( C ∈ C ∧ C 6= 0 ) ) −→( ( A / C ) = ( B / C ) ←→ A = B )proof have S1: A =if ( A ∈ C , A , 1 ) −→( A / C ) =( if ( A ∈ C , A , 1 ) / C ) by (rule MMI_opreq1)
from S1 have S2: A =if ( A ∈ C , A , 1 ) −→( ( A / C ) =( B / C ) ←→( if ( A ∈ C , A , 1 ) / C ) =( B / C ) ) by (rule MMI_eqeq1d)
have S3: A =if ( A ∈ C , A , 1 ) −→( A = B ←→ if ( A ∈ C , A , 1 ) = B ) by (rule MMI_eqeq1)
from S2 S3 have S4: A =if ( A ∈ C , A , 1 ) −→( ( ( A / C ) = ( B / C ) ←→ A = B ) ←→( ( if ( A ∈ C , A , 1 ) / C ) =( B / C ) ←→if ( A ∈ C , A , 1 ) = B ) ) by (rule MMI_bibi12d)
have S5: B =if ( B ∈ C , B , 1 ) −→( B / C ) =( if ( B ∈ C , B , 1 ) / C ) by (rule MMI_opreq1)
from S5 have S6: B =if ( B ∈ C , B , 1 ) −→( ( if ( A ∈ C , A , 1 ) / C ) =1210

( B / C ) ←→( if ( A ∈ C , A , 1 ) / C ) =( if ( B ∈ C , B , 1 ) / C ) ) by (rule MMI_eqeq2d)
have S7: B =if ( B ∈ C , B , 1 ) −→( if ( A ∈ C , A , 1 ) =B ←→if ( A ∈ C , A , 1 ) =if ( B ∈ C , B , 1 ) ) by (rule MMI_eqeq2)
from S6 S7 have S8: B =if ( B ∈ C , B , 1 ) −→( ( ( if ( A ∈ C , A , 1 ) / C ) = ( B / C ) ←→ if ( A ∈ C , A , 1) = B ) ←→( ( if ( A ∈ C , A , 1 ) / C ) =( if ( B ∈ C , B , 1 ) / C ) ←→if ( A ∈ C , A , 1 ) =if ( B ∈ C , B , 1 ) ) ) by (rule MMI_bibi12d)
have S9: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( if ( A ∈ C , A , 1 ) / C ) =( if ( A ∈ C , A , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) by (ruleMMI_opreq2)
have S10: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( if ( B ∈ C , B , 1 ) / C ) =( if ( B ∈ C , B , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) by (ruleMMI_opreq2)
from S9 S10 have S11: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( ( if ( A ∈ C , A , 1 ) / C ) =( if ( B ∈ C , B , 1 ) / C ) ←→( if ( A ∈ C , A , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) =( if ( B ∈ C , B , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) ) by (ruleMMI_eqeq12d)
from S11 have S12: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( ( ( if ( A ∈ C , A , 1 ) / C ) = ( if ( B ∈ C , B , 1 ) / C ) ←→if ( A ∈ C , A , 1 ) = if ( B ∈ C , B , 1 ) ) ←→( ( if ( A ∈ C , A , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) =( if ( B ∈ C , B , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) ←→if ( A ∈ C , A , 1 ) =if ( B ∈ C , B , 1 ) ) ) by (rule MMI_bibi1d)
have S13: 1 ∈ C by (rule MMI_1cn)from S13 have S14: if ( A ∈ C , A , 1 ) ∈ C by (rule MMI_elimel)
have S15: 1 ∈ C by (rule MMI_1cn)from S15 have S16: if ( B ∈ C , B , 1 ) ∈ C by (rule MMI_elimel)
have S17: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( C ∈ C ←→1211

if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C ) by (rule MMI_eleq1)
have S18: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( C 6= 0 ←→if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) 6= 0 ) by (rule MMI_neeq1)
from S17 S18 have S19: C =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( ( C ∈ C ∧ C 6= 0 ) ←→( if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C ∧ if ( ( C ∈ C ∧ C 6= 0 ) ,C , 1 ) 6= 0 ) ) by (rule MMI_anbi12d)
have S20: 1 =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( 1 ∈ C ←→if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C ) by (rule MMI_eleq1)
have S21: 1 =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( 1 6= 0 ←→if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) 6= 0 ) by (rule MMI_neeq1)
from S20 S21 have S22: 1 =if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) −→( ( 1 ∈ C ∧ 1 6= 0 ) ←→( if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C ∧ if ( ( C ∈ C ∧ C 6= 0 ) ,C , 1 ) 6= 0 ) ) by (rule MMI_anbi12d)
have S23: 1 ∈ C by (rule MMI_1cn)
have S24: 1 6= 0 by (rule MMI_ax1ne0)
from S23 S24 have S25: 1 ∈ C ∧ 1 6= 0 by (rule MMI_pm3_2i)
from S19 S22 S25 have S26: if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C∧ if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) 6= 0 by (rule MMI_elimhyp)from S26 have S27: if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C by (ruleMMI_pm3_26i)from S26 have S28: if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ∈ C ∧ if (( C ∈ C ∧ C 6= 0 ) , C , 1 ) 6= 0 .
from S28 have S29: if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) 6= 0 by (ruleMMI_pm3_27i)from S14 S16 S27 S29 have S30: ( if ( A ∈ C , A , 1 ) / if ( ( C∈ C ∧ C 6= 0 ) , C , 1 ) ) =( if ( B ∈ C , B , 1 ) / if ( ( C ∈ C ∧ C 6= 0 ) , C , 1 ) ) ←→if ( A ∈ C , A , 1 ) =if ( B ∈ C , B , 1 ) by (rule MMI_div11)
from S4 S8 S12 S30 show ( A ∈ C ∧ B ∈ C ∧ ( C ∈ C ∧ C 6= 0 ) )−→( ( A / C ) = ( B / C ) ←→ A = B ) by (rule MMI_dedth3h)
qed

end

1212

75

Metamath examples

theory MMI_examples imports MMI_Complex_ZF
begin

This theory contains 10 theorems translated from Metamath (with proofs).
It is included in the proof document as an illustration of how a translated
Metamath proof looks like. The ”known theorems.txt” file included in the
IsarMathLib distribution provides a list of all translated facts.
lemma (in MMIsar0) MMI_dividt:
shows ( A ∈ C ∧ A 6= 0 ) −→ ( A / A ) = 1
proof have S1: ( A ∈ C ∧ A ∈ C ∧ A 6= 0 ) −→( A / A ) = ( A · ( 1 / A ) ) by (rule MMI_divrect)
from S1 have S2: ( ( A ∈ C ∧ A ∈ C ) ∧ A 6= 0 ) −→( A / A ) = ( A · ( 1 / A ) ) by (rule MMI_3expa)
from S2 have S3: ( A ∈ C ∧ A 6= 0 ) −→( A / A ) = ( A · ( 1 / A ) ) by (rule MMI_anabsan)
have S4: ( A ∈ C ∧ A 6= 0 ) −→( A · ( 1 / A ) ) = 1 by (rule MMI_recidt)
from S3 S4 show ( A ∈ C ∧ A 6= 0 ) −→ ( A / A ) = 1 by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_div0t:
shows ( A ∈ C ∧ A 6= 0 ) −→ ( 0 / A ) = 0
proof have S1: 0 ∈ C by (rule MMI_0cn)
have S2: ( 0 ∈ C ∧ A ∈ C ∧ A 6= 0 ) −→( 0 / A ) = ( 0 · ( 1 / A ) ) by (rule MMI_divrect)
from S1 S2 have S3: ( A ∈ C ∧ A 6= 0 ) −→( 0 / A ) = ( 0 · ( 1 / A ) ) by (rule MMI_mp3an1)
have S4: ( A ∈ C ∧ A 6= 0 ) −→ ( 1 / A ) ∈ C by (rule MMI_recclt)
have S5: ( 1 / A ) ∈ C −→ ( 0 · ( 1 / A ) ) = 0
by (rule MMI_mul02t)
from S4 S5 have S6: ( A ∈ C ∧ A 6= 0 ) −→( 0 · ( 1 / A ) ) = 0 by (rule MMI_syl)from S3 S6 show ( A ∈ C ∧ A 6= 0 ) −→ ( 0 / A ) = 0 by (rule MMI_eqtrd)
qed
lemma (in MMIsar0) MMI_diveq0t:
shows ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( ( A / C ) = 0 ←→ A = 0 )proof have S1: ( C ∈ C ∧ C 6= 0 ) −→ ( 0 / C ) = 0 by (rule MMI_div0t)
from S1 have S2: ( C ∈ C ∧ C 6= 0 ) −→( ( A / C ) =( 0 / C ) ←→ ( A / C ) = 0 ) by (rule MMI_eqeq2d)
from S2 have S3: ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→1213

( ( A / C ) =( 0 / C ) ←→ ( A / C ) = 0 ) by (rule MMI_3adant1)
have S4: 0 ∈ C by (rule MMI_0cn)
have S5: ( A ∈ C ∧ 0 ∈ C ∧ ( C ∈ C ∧ C 6= 0 ) ) −→( ( A / C ) = ( 0 / C ) ←→ A = 0 ) by (rule MMI_div11t)
from S4 S5 have S6: ( A ∈ C ∧ ( C ∈ C ∧ C 6= 0 ) ) −→( ( A / C ) = ( 0 / C ) ←→ A = 0 ) by (rule MMI_mp3an2)
from S6 have S7: ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( ( A / C ) = ( 0 / C ) ←→ A = 0 ) by (rule MMI_3impb)
from S3 S7 show ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( ( A / C ) = 0 ←→ A = 0 ) by (rule MMI_bitr3d)
qed
lemma (in MMIsar0) MMI_recrec: assumes A1: A ∈ C and
A2: A 6= 0
shows ( 1 / ( 1 / A ) ) = A
proof from A1 have S1: A ∈ C.
from A2 have S2: A 6= 0.
from S1 S2 have S3: ( 1 / A ) ∈ C by (rule MMI_reccl)
have S4: 1 ∈ C by (rule MMI_1cn)from A1 have S5: A ∈ C.
have S6: 1 6= 0 by (rule MMI_ax1ne0)
from A2 have S7: A 6= 0.
from S4 S5 S6 S7 have S8: ( 1 / A ) 6= 0 by (rule MMI_divne0)
from S3 S8 have S9: ( ( 1 / A ) · ( 1 / ( 1 / A ) ) ) = 1
by (rule MMI_recid)
from S9 have S10: ( A · ( ( 1 / A ) · ( 1 / ( 1 / A ) ) ) ) =( A · 1 ) by (rule MMI_opreq2i)
from A1 have S11: A ∈ C.
from A2 have S12: A 6= 0.
from S11 S12 have S13: ( A · ( 1 / A ) ) = 1 by (rule MMI_recid)
from S13 have S14: ( ( A · ( 1 / A ) ) · ( 1 / ( 1 / A ) ) ) =( 1 · ( 1 / ( 1 / A ) ) ) by (rule MMI_opreq1i)
from A1 have S15: A ∈ C.
from S3 have S16: ( 1 / A ) ∈ C .
from S3 have S17: ( 1 / A ) ∈ C .
from S8 have S18: ( 1 / A ) 6= 0 .
from S17 S18 have S19: ( 1 / ( 1 / A ) ) ∈ C by (rule MMI_reccl)
from S15 S16 S19 have S20:
( ( A · ( 1 / A ) ) · ( 1 / ( 1 / A ) ) ) =( A · ( ( 1 / A ) · ( 1 / ( 1 / A ) ) ) ) by (rule MMI_mulass)from S19 have S21: ( 1 / ( 1 / A ) ) ∈ C .
from S21 have S22: ( 1 · ( 1 / ( 1 / A ) ) ) =( 1 / ( 1 / A ) ) by (rule MMI_mulid2)
from S14 S20 S22 have S23:
( A · ( ( 1 / A ) · ( 1 / ( 1 / A ) ) ) ) =( 1 / ( 1 / A ) ) by (rule MMI_3eqtr3)
from A1 have S24: A ∈ C.

1214

from S24 have S25: ( A · 1 ) = A by (rule MMI_mulid1)
from S10 S23 S25 show ( 1 / ( 1 / A ) ) = A by (rule MMI_3eqtr3)
qed
lemma (in MMIsar0) MMI_divid: assumes A1: A ∈ C and
A2: A 6= 0
shows ( A / A ) = 1
proof from A1 have S1: A ∈ C.
from A1 have S2: A ∈ C.
from A2 have S3: A 6= 0.
from S1 S2 S3 have S4: ( A / A ) = ( A · ( 1 / A ) ) by (rule MMI_divrec)
from A1 have S5: A ∈ C.
from A2 have S6: A 6= 0.
from S5 S6 have S7: ( A · ( 1 / A ) ) = 1 by (rule MMI_recid)
from S4 S7 show ( A / A ) = 1 by (rule MMI_eqtr)
qedlemma (in MMIsar0) MMI_div0: assumes A1: A ∈ C and
A2: A 6= 0
shows ( 0 / A ) = 0
proof from A1 have S1: A ∈ C.
from A2 have S2: A 6= 0.
have S3: ( A ∈ C ∧ A 6= 0 ) −→ ( 0 / A ) = 0 by (rule MMI_div0t)
from S1 S2 S3 show ( 0 / A ) = 0 by (rule MMI_mp2an)
qedlemma (in MMIsar0) MMI_div1: assumes A1: A ∈ Cshows ( A / 1 ) = A
proof from A1 have S1: A ∈ C.
from S1 have S2: ( 1 · A ) = A by (rule MMI_mulid2)
from A1 have S3: A ∈ C.
have S4: 1 ∈ C by (rule MMI_1cn)from A1 have S5: A ∈ C.
have S6: 1 6= 0 by (rule MMI_ax1ne0)
from S3 S4 S5 S6 have S7: ( A / 1 ) = A ←→ ( 1 · A ) = A
by (rule MMI_divmul)
from S2 S7 show ( A / 1 ) = A by (rule MMI_mpbir)qedlemma (in MMIsar0) MMI_div1t:shows A ∈ C −→ ( A / 1 ) = A
proof have S1: A =if ( A ∈ C , A , 1 ) −→( A / 1 ) =( if ( A ∈ C , A , 1 ) / 1 ) by (rule MMI_opreq1)

1215

have S2: A =if ( A ∈ C , A , 1 ) −→A = if ( A ∈ C , A , 1 ) by (rule MMI_id)
from S1 S2 have S3: A =if ( A ∈ C , A , 1 ) −→( ( A / 1 ) =A ←→( if ( A ∈ C , A , 1 ) / 1 ) =if ( A ∈ C , A , 1 ) ) by (rule MMI_eqeq12d)
have S4: 1 ∈ C by (rule MMI_1cn)from S4 have S5: if ( A ∈ C , A , 1 ) ∈ C by (rule MMI_elimel)from S5 have S6: ( if ( A ∈ C , A , 1 ) / 1 ) =if ( A ∈ C , A , 1 ) by (rule MMI_div1)
from S3 S6 show A ∈ C −→ ( A / 1 ) = A by (rule MMI_dedth)qedlemma (in MMIsar0) MMI_divnegt:
shows ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( - ( A / B ) ) = ( ( - A ) / B )proof have S1: ( A ∈ C ∧ ( 1 / B ) ∈ C ) −→( ( - A ) · ( 1 / B ) ) =( - ( A · ( 1 / B ) ) ) by (rule MMI_mulneg1t)
have S2: ( B ∈ C ∧ B 6= 0 ) −→ ( 1 / B ) ∈ C by (rule MMI_recclt)
from S1 S2 have S3: ( A ∈ C ∧ ( B ∈ C ∧ B 6= 0 ) ) −→( ( - A ) · ( 1 / B ) ) =( - ( A · ( 1 / B ) ) ) by (rule MMI_sylan2)
from S3 have S4: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( ( - A ) · ( 1 / B ) ) =( - ( A · ( 1 / B ) ) ) by (rule MMI_3impb)
have S5: ( ( - A ) ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( ( - A ) / B ) =( ( - A ) · ( 1 / B ) ) by (rule MMI_divrect)
have S6: A ∈ C −→ ( - A ) ∈ C by (rule MMI_negclt)
from S5 S6 have S7: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( ( - A ) / B ) =( ( - A ) · ( 1 / B ) ) by (rule MMI_syl3an1)
have S8: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( A / B ) = ( A · ( 1 / B ) ) by (rule MMI_divrect)
from S8 have S9: ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( - ( A / B ) ) =( - ( A · ( 1 / B ) ) ) by (rule MMI_negeqd)
from S4 S7 S9 show ( A ∈ C ∧ B ∈ C ∧ B 6= 0 ) −→( - ( A / B ) ) = ( ( - A ) / B ) by (rule MMI_3eqtr4rd)
qed
lemma (in MMIsar0) MMI_divsubdirt:
shows ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A - B ) / C ) =1216

( ( A / C ) - ( B / C ) )proof have S1: ( ( A ∈ C ∧ ( - B ) ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A + ( - B ) ) / C ) =( ( A / C ) + ( ( - B ) / C ) ) by (rule MMI_divdirt)
have S2: B ∈ C −→ ( - B ) ∈ C by (rule MMI_negclt)
from S1 S2 have S3: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A + ( - B ) ) / C ) =( ( A / C ) + ( ( - B ) / C ) ) by (rule MMI_syl3anl2)
have S4: ( A ∈ C ∧ B ∈ C ) −→( A + ( - B ) ) = ( A - B ) by (rule MMI_negsubt)
from S4 have S5: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( A + ( - B ) ) = ( A - B ) by (rule MMI_3adant3)
from S5 have S6: ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) −→( ( A + ( - B ) ) / C ) =( ( A - B ) / C ) by (rule MMI_opreq1d)
from S6 have S7: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A + ( - B ) ) / C ) =( ( A - B ) / C ) by (rule MMI_adantr)
have S8: ( B ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( - ( B / C ) ) = ( ( - B ) / C ) by (rule MMI_divnegt)
from S8 have S9: ( ( B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( - ( B / C ) ) = ( ( - B ) / C ) by (rule MMI_3expa)
from S9 have S10: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( - ( B / C ) ) = ( ( - B ) / C ) by (rule MMI_3adantl1)
from S10 have S11: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A / C ) + ( - ( B / C ) ) ) =( ( A / C ) + ( ( - B ) / C ) ) by (rule MMI_opreq2d)
have S12: ( ( A / C ) ∈ C ∧ ( B / C ) ∈ C ) −→( ( A / C ) + ( - ( B / C ) ) ) =( ( A / C ) - ( B / C ) ) by (rule MMI_negsubt)
have S13: ( A ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_divclt)
from S13 have S14: ( ( A ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_3expa)
from S14 have S15: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( A / C ) ∈ C by (rule MMI_3adantl2)
have S16: ( B ∈ C ∧ C ∈ C ∧ C 6= 0 ) −→( B / C ) ∈ C by (rule MMI_divclt)
from S16 have S17: ( ( B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( B / C ) ∈ C by (rule MMI_3expa)
from S17 have S18: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( B / C ) ∈ C by (rule MMI_3adantl1)
from S12 S15 S18 have S19: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0
) −→( ( A / C ) + ( - ( B / C ) ) ) =( ( A / C ) - ( B / C ) ) by (rule MMI_sylanc)
from S11 S19 have S20: ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→1217

( ( A / C ) + ( ( - B ) / C ) ) =( ( A / C ) - ( B / C ) ) by (rule MMI_eqtr3d)
from S3 S7 S20 show ( ( A ∈ C ∧ B ∈ C ∧ C ∈ C ) ∧ C 6= 0 ) −→( ( A - B ) / C ) =( ( A / C ) - ( B / C ) ) by (rule MMI_3eqtr3d)
qed

end

76

Metamath interface

theory Metamath_Interface imports Complex_ZF MMI_prelude
beginThis theory contains some lemmas that make it possible to use the theorems
translated from Metamath in a the complex0 context.

76.1

MMisar0 and complex0 contexts.

In the section we show a lemma that the assumptions in complex0 context
imply the assumptions of the MMIsar0 context. The Metamath_sampler theory
provides examples how this lemma can be used.
The next lemma states that we can use the theorems proven in the MMIsar0
context in the complex0 context. Unfortunately we have to use low level
Isabelle methods ”rule” and ”unfold” in the proof, simp and blast fail on
the order axioms.
lemma (in complex0) MMIsar_valid:
shows MMIsar0(IR,C,1,0,i,CplxAdd(R,A),CplxMul(R,A,M),
StrictVersion(CplxROrder(R,A,r)))proof let real = IR
let complex = C
let zero = 0
let one = 1
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have (∀ a b. a ∈ real ∧ b ∈ real −→ha, bi ∈ lessrrel ←→ ¬ (a = b ∨ hb, ai ∈ lessrrel))
proof have I:

1218

∀ a b. a ∈ IR ∧ b ∈ IR −→ (a <R b ←→ ¬(a=b ∨ b <R a))using pre_axlttri by blast{ fix a b assume a ∈ real ∧ b ∈ realwith I have (a <R b ←→ ¬(a=b ∨ b <R a))by blast
hence
ha, bi ∈ lessrrel ←→ ¬ (a = b ∨ hb, ai ∈ lessrrel)
by simp} thus (∀ a b. a ∈ real ∧ b ∈ real −→(ha, bi ∈ lessrrel ←→ ¬ (a = b ∨ hb, ai ∈ lessrrel)))by blast
qed
moreoverhave (∀ a b c.
a ∈ real ∧ b ∈ real ∧ c ∈ real −→ha, bi ∈ lessrrel ∧ hb, ci ∈ lessrrel −→ ha, ci ∈ lessrrel)
proof have II: ∀ a b c. a ∈ IR ∧ b ∈ IR ∧ c ∈ IR −→((a <R b ∧ b <R c) −→ a <R c)using pre_axlttrn by blast{ fix a b c assume a ∈ real ∧ b ∈ real ∧ c ∈ realwith II have (a <R b ∧ b <R c) −→ a <R cby blast
hence
ha, bi ∈ lessrrel ∧ hb, ci ∈ lessrrel −→ ha, ci ∈ lessrrel
by simp} thus (∀ a b c.
a ∈ real ∧ b ∈ real ∧ c ∈ real −→ha, bi ∈ lessrrel ∧ hb, ci ∈ lessrrel −→ ha, ci ∈ lessrrel)by blast
qed
moreover have (∀ A B C.
A ∈ real ∧ B ∈ real ∧ C ∈ real −→hA, Bi ∈ lessrrel −→hcaddset hC, Ai, caddset hC, Bii ∈ lessrrel)
using pre_axltadd by simp
moreover have (∀ A B. A ∈ real ∧ B ∈ real −→hzero, Ai ∈ lessrrel ∧ hzero, Bi ∈ lessrrel −→hzero, cmulset hA, Bii ∈ lessrrel)
using pre_axmulgt0 by simp
moreover have(∀ S. S ⊆ real ∧ S 6= 0 ∧ (∃ x∈real. ∀ y∈S. hy, xi ∈ lessrrel) −→(∃ x∈real.
(∀ y∈S. hx, yi ∈/ lessrrel) ∧(∀ y∈real. hy, xi ∈ lessrrel −→ (∃ z∈S. hy, zi ∈ lessrrel))))using pre_axsup by simp
moreover have IR ⊆ C using axresscn by simp
moreover have 1 6= 0 using ax1ne0 by simp
moreover have C isASet by simp1219

moreover have CplxAdd(R,A) : C × C → C
using axaddopr by simp
moreover have CplxMul(R,A,M) : C × C → C
using axmulopr by simp
moreover have∀ a b. a ∈ C ∧ b ∈ C −→ a· b = b · ausing axmulcom by simp
hence (∀ a b. a ∈ C ∧ b ∈ C −→cmulset ha, bi = cmulset hb, ai) by simp
moreover have ∀ a b. a ∈ C ∧ b ∈ C −→ a + b ∈ Cusing axaddcl by simp
hence (∀ a b. a ∈ C ∧ b ∈ C −→caddset ha, bi ∈ C) by simp
moreover have ∀ a b. a ∈ C ∧ b ∈ C −→ a · b ∈ Cusing axmulcl by simp
hence (∀ a b. a ∈ C ∧ b ∈ C −→cmulset ha, bi ∈ C ) by simp
moreover have∀ a b C. a ∈ C ∧ b ∈ C ∧ C ∈ C −→a · (b + C) = a · b + a · Cusing axdistr by simp
hence ∀ a b C.
a ∈ C ∧ b ∈ C ∧ C ∈ C −→cmulset ha, caddset hb, Cii =caddsethcmulset ha, bi, cmulset ha, Cii
by simpmoreover have ∀ a b. a ∈ C ∧ b ∈ C −→a + b = b + a
using axaddcom by simp
hence ∀ a b.
a ∈ C ∧ b ∈ C −→caddset ha, bi = caddset hb, ai by simp
moreover have ∀ a b C. a ∈ C ∧ b ∈ C ∧ C ∈ C −→a + b + C = a + (b + C)using axaddass by simp
hence ∀ a b C.
a ∈ C ∧ b ∈ C ∧ C ∈ C −→caddset hcaddset ha, bi, Ci =caddset ha, caddset hb, Cii by simp
moreover have∀ a b c. a ∈ C ∧ b ∈ C ∧ c ∈ C −→ a·b·c = a·(b·c)
using axmulass by simp
hence ∀ a b C.
a ∈ C ∧ b ∈ C ∧ C ∈ C −→cmulset hcmulset ha, bi, Ci =cmulset ha, cmulset hb, Cii by simp

1220

moreover have 1 ∈ IR using ax1re by simp
moreover have i·i + 1 = 0
using axi2m1 by simp
hence caddset hcmulset hi, ii, 1i = 0 by simp
moreover have ∀ a. a ∈ C −→ a + 0 = ausing ax0id by simp
hence ∀ a. a ∈ C −→ caddset ha, 0i = a by simp
moreover have i ∈ C using axicn by simp
moreover have ∀ a. a ∈ C −→ (∃ x∈C. a + x = 0)
using axnegex by simp
hence ∀ a. a ∈ C −→(∃ x∈C. caddset ha, xi = 0) by simp
moreover have ∀ a. a ∈ C ∧ a 6= 0 −→ (∃ x∈C. a · x = 1)
using axrecex by simp
hence ∀ a. a ∈ C ∧ a 6= 0 −→( ∃ x∈C. cmulset ha, xi = 1 ) by simp
moreover have ∀ a. a ∈ C −→ a·1 = ausing ax1id by simp
hence ∀ a. a ∈ C −→cmulset ha, 1i = a by simp
moreover have ∀ a b. a ∈ IR ∧ b ∈ IR −→ a + b ∈ IR
using axaddrcl by simp
hence ∀ a b. a ∈ IR ∧ b ∈ IR −→caddset ha, bi ∈ IR by simp
moreover have ∀ a b. a ∈ IR ∧ b ∈ IR −→ a · b ∈ IR
using axmulrcl by simp
hence ∀ a b. a ∈ IR ∧ b ∈ IR −→cmulset ha, bi ∈ IR by simp
moreover have ∀ a. a ∈ IR −→ (∃ x∈IR. a + x = 0)
using axrnegex by simp
hence ∀ a. a ∈ IR −→( ∃ x∈IR. caddset ha, xi = 0 ) by simp
moreover have ∀ a. a ∈ IR ∧ a6=0 −→ (∃ x∈IR. a · x = 1)
using axrrecex by simp
hence ∀ a. a ∈ IR ∧ a 6= 0 −→( ∃ x∈IR. cmulset ha, xi = 1) by simp
ultimately have(((( ∀ a b.
a ∈ IR ∧ b ∈ IR −→ha, bi ∈ lessrrel ←→¬ (a = b ∨ hb, ai ∈ lessrrel)) ∧( ∀ a b C.
a ∈ IR ∧ b ∈ IR ∧ C ∈ IR −→1221

ha, bi ∈ lessrrel ∧hb, Ci ∈ lessrrel −→ha, Ci ∈ lessrrel) ∧(∀ a b C.
a ∈ IR ∧ b ∈ IR ∧ C ∈ IR −→ha, bi ∈ lessrrel −→hcaddset hC, ai, caddset hC, bii ∈lessrrel)) ∧(( ∀ a b.
a ∈ IR ∧ b ∈ IR −→h0, ai ∈ lessrrel ∧h0, bi ∈ lessrrel −→h0, cmulset ha, bii ∈lessrrel) ∧( ∀ S. S ⊆ IR ∧ S 6= 0 ∧( ∃ x∈IR. ∀ y∈S. hy, xi ∈ lessrrel) −→( ∃ x∈IR.
( ∀ y∈S. hx, yi ∈/ lessrrel) ∧( ∀ y∈IR. hy, xi ∈ lessrrel −→( ∃ z∈S. hy, zi ∈ lessrrel
)
)
)
)
) ∧
IR ⊆ C ∧1 6= 0) ∧( C isASet ∧ caddset ∈ C × C → C ∧cmulset ∈ C × C → C) ∧((∀ a b.
a ∈ C ∧ b ∈ C −→cmulset ha, bi = cmulset
) ∧

1222

hb, ai(∀ a b. a ∈ C ∧ b ∈ C −→caddset ha, bi ∈ C)) ∧(∀ a b. a ∈ C ∧ b ∈ C −→cmulset ha, bi ∈ C) ∧(∀ a b C.
a ∈ C ∧ b ∈ C ∧ C ∈ C −→cmulset ha, caddset hb, Cii =caddsethcmulset ha, bi, cmulset ha, Cii
)
) ∧

(
(
(∀ a b.
a ∈ C ∧ b ∈ C −→caddset ha, bi = caddset) ∧hb, ai(∀ a b C.
a ∈ C ∧ b ∈ C ∧ C ∈ C −→caddset hcaddset ha, bi, Ci =caddset ha, caddset hb, Cii) ∧(∀ a b C.
a ∈ C ∧ b ∈ C ∧ C ∈ C −→cmulset hcmulset ha, bi, Ci =cmulset ha, cmulset hb, Cii)) ∧(1 ∈ IR ∧caddset hcmulset) ∧hi, ii, 1i = 0(∀ a. a ∈ C −→ caddset) ∧ha, 0i = a

i ∈ C

1223

) ∧
(
(∀ a. a ∈ C −→(∃ x∈C. caddset)) ∧ha, xi = 0( ∀ a. a ∈ C ∧ a 6= 0 −→( ∃ x∈C. cmulset ha, xi = 1)) ∧( ∀ a. a ∈ C −→cmulset ha, 1i = a)) ∧(( ∀ a b. a ∈ IR ∧ b ∈ IR −→caddset ha, bi ∈ IR) ∧( ∀ a b. a ∈ IR ∧ b ∈ IR −→cmulset ha, bi ∈ IR)) ∧( ∀ a. a ∈ IR −→( ∃ x∈IR. caddset)) ∧ha, xi = 0( ∀ a. a ∈ IR ∧ a 6= 0 −→( ∃ x∈IR. cmulset ha, xi = 1))
by blast
then show MMIsar0(IR,C,1,0,i,CplxAdd(R,A),CplxMul(R,A,M),
StrictVersion(CplxROrder(R,A,r))) unfolding MMIsar0_def by blast
qed

end

77

Metamath sampler

theory Metamath_Sampler imports Metamath_Interface MMI_Complex_ZF_2

1224

beginThe theorems translated from Metamath reside in the MMI_Complex_ZF, MMI_Complex_ZF_1
and MMI_Complex_ZF_2 theories. The proofs of these theorems are very verbose and for this reason the theories are not shown in the proof document
or the FormaMath.org site. This theory file contains some examples of theorems translated from Metamath and formulated in the complex0 context.
This serves two purposes: to give an overview of the material covered in thetranslated theorems and to provide examples of how to take a translated
theorem (proven in the MMIsar0 context) and transfer it to the complex0 context. The typical procedure for moving a theorem from MMIsar0 to complex0
is as follows: First we define certain aliases that map names defined in thecomplex0 to their corresponding names in the MMIsar0 context. This makes
it easy to copy and paste the statement of the theorem as displayed with
ProofGeneral. Then we run the Isabelle from ProofGeneral up to the theorem we want to move. When the theorem is verified ProofGeneral displays
the statement in the raw set theory notation, stripped from any notation
defined in the MMIsar0 locale. This is what we copy to the proof in thecomplex0 locale. After that we just can write ”then have ?thesis by simp”
and the simplifier translates the raw set theory notation to the one used incomplex0.

77.1

Extended reals and order

In this sectin we import a couple of theorems about the extended real line
and the linear order on it.
Metamath uses the set of real numbers extended with +∞ and −∞. The+∞ and −∞ symbols are defined quite arbitrarily as C and {C}, respectively. The next lemma that corresponds to Metamath’s renfdisj statesthat +∞ and −∞ are not elements of R.
lemma (in complex0) renfdisj: shows IR ∩ {+∞,−∞} = 0
proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then have real ∩ {complex, {complex}} = 0
by (rule MMIsar0.MMI_renfdisj)

1225

thus IR ∩ {+∞,−∞} = 0 by simp
qed

The order relation used most often in Metamath is defined on the set ofcomplex reals extended with +∞ and −∞. The next lemma allows to use
Metamath’s xrltso that states that the < relations is a strict linear order on
the extended set.
lemma (in complex0) xrltso: shows < Orders IR∗
proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then have(lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪{{complex}} × real) Orders (real ∪ {complex, {complex}})by (rule MMIsar0.MMI_xrltso)
moreover have lessrrel ∩ real × real = lessrrelusing cplx_strict_ord_on_cplx_reals by auto
ultimately show < Orders IR∗ by simp
qed

Metamath defines the usual < and ≤ ordering relations for the extended
real line, including +∞ and −∞.
lemma (in complex0) xrrebndt: assumes A1: x ∈ IR∗
shows x ∈ IR ←→ ( −∞ < x ∧ x < +∞ )proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then have x ∈ IR ∪ {C, {C}} −→x ∈ IR ←→ h{C}, xi ∈ lessrrel ∩ IR × IR ∪ {h{C}, Ci} ∪IR × {C} ∪ {{C}} × IR ∧1226

hx, Ci ∈ lessrrel ∩ IR × IR ∪ {h{C}, Ci} ∪IR × {C} ∪ {{C}} × IR
by (rule MMIsar0.MMI_xrrebndt)
then have x ∈ IR∗ −→ ( x ∈ IR ←→ ( −∞ < x ∧ x < +∞ ) )by simpwith A1 show thesis by simp
qed

A quite involved inequality.
lemma (in complex0) lt2mul2divt:
assumes A1: a ∈ IR b ∈ IR c ∈ IR d ∈ IR and
A2: 0 < b 0 < dshows a·b < c·d ←→ a/d < c/b
proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then have(a ∈ real ∧ b ∈ real) ∧(c ∈ real ∧ d ∈ real) ∧hzero, bi ∈ lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪ {{complex}} × real ∧hzero, di ∈ lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪ {{complex}} × real −→hcmulset ha, bi, cmulset hc, dii ∈lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real
S × {complex} ∪ {{complex}} × real ←→hS {x ∈ complex . cmulset hd, xi = a},{x ∈ complex . cmulset hb, xi = c}i ∈lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × realby (rule MMIsar0.MMI_lt2mul2divt)
with A1 A2 show thesis by simpqed

A real number is smaller than its half iff it is positive.
lemma (in complex0) halfpos: assumes A1: a ∈ IR
shows 0 < a ←→ a/2 < aproof let real = IR
let complex = C

1227

let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))from A1 have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
and a ∈ realusing MMIsar_valid by auto
then havehzero, ai ∈lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real
S × {complex} ∪ {{complex}} × real ←→h {x ∈ complex . cmulset hcaddset hone, onei, xi = a}, ai ∈lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪ {{complex}} × realby (rule MMIsar0.MMI_halfpos)
then show thesis by simp
qed

One more inequality.
lemma (in complex0) ledivp1t:
assumes A1: a ∈ IRb ∈ IR and
A2: 0 ≤ a 0 ≤ bshows (a/(b + 1))·b ≤ a
proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then have(a ∈ real ∧ ha, zeroi ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × real) ∧b ∈ real ∧ hb, zeroi ∈/ lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪{{complex}}S× real −→ha,cmulseth {x ∈ complex . cmulsethcaddsethb, onei, xi = a}, bii ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × realby (rule MMIsar0.MMI_ledivp1t)

1228

with A1 A2 show thesis by simp
qed

77.2

Natural real numbers

In standard mathematics natural numbers are treated as a subset of real
numbers. From the set theory point of view however those are quite different objects. In this section we talk about ”real natural” numbers i.e. theconterpart of natural numbers that is a subset of the reals.
Two ways of saying that there are no natural numbers between n and n + 1.
lemma (in complex0) no_nats_between:
assumes A1: n ∈ IN k ∈ IN
showsn≤k ←→ n < k+1
n < k ←→ n + 1 ≤ k
proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have I: MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then haveTn ∈{N ∈ Pow(real) . one ∈ N ∧(∀ n.Tn ∈ N −→ caddset hn, onei ∈ N)} ∧k ∈{N ∈ Pow(real) . one ∈ N ∧(∀ n. n ∈ N −→ caddset hn, onei ∈ N)} −→hk, ni ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪ real × {complex}∪{{complex}} × real ←→hn, caddset hk, oneii ∈lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪ real × {complex}∪{{complex}} × real by (rule MMIsar0.MMI_nnleltp1t)then have n ∈ IN ∧ k ∈ IN −→ n ≤ k ←→ n < k + 1
by simpwith A1 show n≤k ←→ n < k+1 by simp
from IThaven ∈{N ∈ Pow(real) . one ∈ N ∧(∀ n.Tn ∈ N −→ caddset hn, onei ∈ N)} ∧k ∈{N ∈ Pow(real) . one ∈ N ∧(∀ n. n ∈ N −→ caddset hn, onei ∈ N)} −→1229

hn, ki ∈lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪{{complex}} × real ←→ hk, caddset hn, oneii ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪ real × {complex}∪{{complex}} × real by (rule MMIsar0.MMI_nnltp1let)then have n ∈ IN ∧ k ∈ IN −→ n < k ←→ n + 1 ≤ kby simpwith A1 show n < k ←→ n + 1 ≤ k by simp
qed

Metamath has some very complicated and general version of induction on(complex) natural numbers that I can’t even understand. As an exercise I
derived a more standard version that is imported to the complex0 context
below.
lemma (in complex0) cplx_nat_ind: assumes A1: ψ(1) andA2: ∀ k ∈ IN. ψ(k) −→ ψ(k+1) andA3: n ∈ IN
shows ψ(n)proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have I: MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
moreover from A1 A2 A3 haveψ(one)T∀ k∈ {N ∈ Pow(real) . one ∈ N ∧(∀ n. n ∈ N −→ caddset hn, onei ∈ N)}.
ψ(k)T−→ ψ(caddset hk, onei)n ∈{N ∈ Pow(real) . one ∈ N ∧(∀ n. n ∈ N −→ caddset hn, onei ∈ N)}
by autoultimately show ψ(n) by (rule MMIsar0.nnind1)
qed

Some simple arithmetics.
lemma (in complex0) arith: shows
2 + 2 = 4
2·2 = 4
3·2 = 6
3·3 = 91230

proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have I: MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then havecaddset hcaddset hone, onei, caddset hone, oneii =caddset hcaddset hcaddset hone, onei, onei, oneiby (rule MMIsar0.MMI_2p2e4)
thus 2 + 2 = 4 by simp
from I havecmulsethcaddsethone, onei, caddsethone, oneii =caddsethcaddsethcaddsethone, onei, onei, oneiby (rule MMIsar0.MMI_2t2e4)
thus 2·2 = 4 by simp
from I havecmulsethcaddsethcaddsethone, onei, onei, caddsethone, oneii =caddset hcaddsethcaddsethcaddsethcaddset
hone, onei, onei, onei, onei, oneiby (rule MMIsar0.MMI_3t2e6)
thus 3·2 = 6 by simp
from I have cmulset
hcaddsethcaddsethone, onei, onei,
caddsethcaddsethone, onei, oneii =caddsethcaddsethcaddset hcaddset
hcaddsethcaddsethcaddsethcaddsethone, onei, onei, onei, onei,
onei, onei, onei, oneiby (rule MMIsar0.MMI_3t3e9)
thus 3·3 = 9 by simp
qed

77.3

Infimum and supremum in real numbers

Real numbers form a complete ordered field. Here we import a couple ofMetamath theorems about supremu and infimum.
If a set S has a smallest element, then the infimum of S belongs to it.
lemma (in complex0) lbinfmcl: assumes A1: S ⊆ IR andA2: ∃ x∈S. ∀ y∈S. x ≤ yshows Infim(S,IR,<) ∈ S
proof let real = IR

1231

let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have I: MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then haveS ⊆ real ∧ (∃ x∈S. ∀ y∈S. hy, xi ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × real) −→Sup(S, real,
converse(lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪{{complex}} × real)) ∈ S
by (rule MMIsar0.MMI_lbinfmcl)
then have
S ⊆IR ∧ ( ∃ x∈S. ∀ y∈S. x ≤ y) −→Sup(S,IR,converse(<)) ∈ S by simp
with A1 A2 show thesis using Infim_def by simp
qed

Supremum of any subset of reals that is bounded above is real.
lemma (in complex0) sup_is_real:assumes A ⊆ IR and A 6= 0 and ∃ x∈IR. ∀ y∈A. y ≤ xshows Sup(A,IR,<) ∈ IR
proof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then haveA ⊆ real ∧ A 6= 0 ∧ (∃ x∈real. ∀ y∈A. hx, yi ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × real) −→Sup(A, real,
lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × real) ∈ realby (rule MMIsar0.MMI_suprcl)1232

with assms show thesis by simp
qed

If a real number is smaller that the supremum of A, then we can find anelement of A greater than it.
lemma (in complex0) suprlub:
assumes A ⊆IR and A 6= 0 and ∃ x∈IR. ∀ y∈A. y ≤ x
and B ∈ IR and B < Sup(A,IR,<)
shows ∃ z∈A. B < zproof let real = IR
let complex = C
let one = 1
let zero = 0
let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then have (A ⊆ real ∧ A 6= 0 ∧ (∃ x∈real. ∀ y∈A. hx, yi ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪{{complex}} × real)) ∧ B ∈ real ∧ hB, Sup(A, real,
lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪{{complex}} × real)i ∈ lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪{{complex}} × real −→(∃ z∈A. hB, zi ∈ lessrrel ∩ real × real ∪{h{complex}, complexi} ∪ real × {complex} ∪{{complex}} × real)by (rule MMIsar0.MMI_suprlub)with assms show thesis by simp
qed

Something a bit more interesting: infimum of a set that is bounded below isreal and equal to the minus supremum of the set flipped around zero.
lemma (in complex0) infmsup:
assumes A ⊆ IR and A 6= 0 and ∃ x∈IR. ∀ y∈A. x ≤ yshowsInfim(A,IR,<) ∈ IR
Infim(A,IR,<) = ( -Sup({z ∈ IR. (-z) ∈ A },IR,<) )proof let real = IR
let complex = C
let one = 1
let zero = 01233

let iunit = i
let caddset = CplxAdd(R,A)
let cmulset = CplxMul(R,A,M)
let lessrrel = StrictVersion(CplxROrder(R,A,r))have I: MMIsar0(real, complex, one, zero, iunit, caddset, cmulset, lessrrel)
using MMIsar_valid by simp
then haveA ⊆ real ∧ A 6= 0 ∧ (∃ x∈real. ∀ y∈A. hy, xi ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪{{complex}} × real) −→ Sup(A, real, converse(lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪{{complex}}
× real)) =S{x ∈ complex . S
caddsethSup({z ∈ real .
{x ∈ complex . caddsethz, xi = zero} ∈ A}, real,
lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × real), xi = zero}by (rule MMIsar0.MMI_infmsup)
then have A ⊆IR ∧ ¬(A = 0) ∧ ( ∃ x∈IR. ∀ y∈A. x ≤ y) −→Sup(A,IR,converse(<)) = ( -Sup({z ∈ IR. (-z) ∈ A },IR,<) )by simpwith assms show
Infim(A,IR,<) = ( -Sup({z ∈ IR. (-z) ∈ A },IR,<) )using Infim_def by simp
from I haveA ⊆ real ∧ A 6= 0 ∧ (∃ x∈real. ∀ y∈A. hy, xi ∈/lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪{{complex}} × real) −→ Sup(A, real, converse(lessrrel ∩ real × real ∪ {h{complex}, complexi} ∪real × {complex} ∪ {{complex}} × real)) ∈ realby (rule MMIsar0.MMI_infmrcl)
with assms show Infim(A,IR,<) ∈ IR
using Infim_def by simp
qed
end

References[1] N. A’Campo. A natural construction for the real numbers. 2003.
[2] R. D. Arthan. The Eudoxus Real Numbers. 2004.
[3] R. Street at al. The Efficient Real Numbers. 2003.

1234

[4] Strecker G.E. Herrlich H. When is N lindelöf? Comment. Math. Univ.
Carolinae, 1997.
[5] I. L. Reilly and M. K. Vamanamurthy. Some topological anti-properties.
Illinois J. Math., 24:382–389, 1980.

1235