-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.tex
10226 lines (10208 loc) · 654 KB
/
project.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{report}
\usepackage{fullpage}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{datetime}
\usepackage[nottoc]{tocbibind}
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{glossaries}
\usepackage{stackrel}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{enumitem}
\setlistdepth{9}
\newlist{instructions}{enumerate}{9}
\setlist[instructions,1]{label=\arabic*)}
\setlist[instructions,2]{label=\alph*),leftmargin=0.3cm}
\setlist[instructions,3]{label=\roman*),leftmargin=0.3cm}
\setlist[instructions,4]{label=(\arabic*),leftmargin=0.3cm}
\setlist[instructions,5]{label=(\alph*),leftmargin=0.3cm}
\setlist[instructions,6]{label=(\roman*),leftmargin=0.3cm}
\setlist[instructions,7]{label=(\arabic*),leftmargin=0.3cm}
\setlist[instructions,8]{label=(\alph*),leftmargin=0.3cm}
\setlist[instructions,9]{label=(\roman*),leftmargin=0.3cm}
\hypersetup{
colorlinks = true,
linktoc = all,
}
\setlist[enumerate,2,3,4]{leftmargin=0.3cm}
\setlength{\columnsep}{0.7cm}
\mathchardef\mathcomma\mathcode`\,
\mathcode`\,="8000
{
\catcode`,=\active
\gdef,{\mathcomma\discretionary{}{}{}}
}
\DeclareMathOperator*{\diff}{\Delta}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\hsf}{H}
\DeclareMathOperator{\jsc}{J}
\DeclareMathOperator{\mat}{mat}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\comp}{comp}
\DeclareMathOperator{\mon}{mon}
\DeclareMathOperator{\pows}{pows}
\DeclareMathOperator{\cols}{cols}
\DeclareMathOperator{\rows}{rows}
\DeclareMathOperator{\sel}{sel}
\DeclareMathOperator{\last}{last}
\DeclareMathOperator{\Nu}{nu}
\DeclareMathOperator{\De}{de}
\DeclareMathOperator{\Po}{po}
\DeclareMathOperator{\Ne}{ne}
\DeclareMathOperator{\subsetnsim}{\stackrel[\nsim]{}{\subset}}
\DeclareMathOperator{\supsetnsim}{\stackrel[\nsim]{}{\supset}}
\let\div\relax\DeclareMathOperator{\div}{div}
\let\Re\relax\DeclareMathOperator{\Re}{re}
\let\Im\relax\DeclareMathOperator{\Im}{im}
\newcommand{\err}[1]{\ (\mathrm{err}\ #1)}
\newcommand{\for}{\text{ for }}
\newcommand{\ul}[1]{\protect\underline{#1}}
\newcommand{\ol}[1]{\overline{#1}}
\newcommand{\conj}[1]{{(#1)^{-}}}
\newcommand{\pmconj}[1]{{(#1)^{\pm}}}
\newcommand{\iu}{i}
\newcommand{\ju}{j}
\newcommand{\ku}{k}
\newcommand{\kcu}{\conj{k}}
\newcounter{declaration}[part]
\newcounter{declarationtemp}
\newcommand{\declaration}[1]{
\renewcommand\thedeclarationtemp{\thepart:\thedeclaration}
\subsubsection*{Declaration \thedeclarationtemp (#1)}
\label{sec:declaration #1}
\refstepcounter{declarationtemp}
\label{declaration#1}
\addtocounter{declaration}{1}
}
\newcommand{\declarationhr}[1]{\hyperref[sec:declaration #1]{declaration \ref{declaration#1}}}
\newcounter{procedure}[part]
\newcounter{proceduretemp}
\newcommand{\procedure}[1]{
\renewcommand\theproceduretemp{\thepart:\theprocedure}
\subsection*{Procedure \theproceduretemp (#1)}
\label{sec:procedure #1}
\refstepcounter{proceduretemp}
\label{procedure#1}
\addtocounter{procedure}{1}
}
\newcommand{\procedurehr}[1]{\hyperref[sec:procedure #1]{procedure \ref{procedure#1}}}
\newcommand{\objective}{\subsubsection*{Objective}}
\newcommand{\implementation}{\subsubsection*{Implementation}}
\newcounter{subprocedure}[procedure]
\newcounter{subproceduretemp}
\newcommand{\subprocedure}[1]{
\renewcommand\thesubproceduretemp{\thepart:\theprocedure:\thesubprocedure}
\subsubsection*{Subprocedure \thesubproceduretemp}
\label{sec:subprocedure #1}
\refstepcounter{subproceduretemp}
\label{subprocedure#1}
\addtocounter{subprocedure}{1}
}
\newcommand{\subprocedurehr}[1]{\hyperref[sec:subprocedure #1]{subprocedure \ref{subprocedure#1}}}
\newcommand{\subobjective}{\paragraph{Objective}}
\newcommand{\subimplementation}{\paragraph{Implementation}}
\newcounter{mfigure}[part]
\newcommand{\mfigure}{
\subsubsection*{Figure \thepart:\themfigure}
\addtocounter{mfigure}{1}
}
\makenoidxglossaries
\newglossaryentry{integer}{name={integer},description={}}
\newglossaryentry{intPo}{name=$\Po(a)$,description={positive part of $a$}}
\newglossaryentry{intNe}{name=$\Ne(a)$,description={negative part of $a$}}
\newglossaryentry{inta=b}{name=\ensuremath{a=b},description={integer equality}}
\newglossaryentry{inta+b}{name=\ensuremath{a+b},description={integer addition}}
\newglossaryentry{inta}{name=\ensuremath{a},description={}}
\newglossaryentry{int-a}{name=\ensuremath{-a},description={integer negation}}
\newglossaryentry{intab}{name=\ensuremath{ab},description={integer multiplication}}
\newglossaryentry{inta<b}{name=\ensuremath{a<b},description={integer less than}}
\newglossaryentry{int||a||}{name=\ensuremath{\lVert a\rVert},description={absolute value}}
\newglossaryentry{intsgn(a)}{name=\ensuremath{\sgn(a)},description={sign function}}
\newglossaryentry{inthsf(a)}{name=\ensuremath{\hsf(a)},description={Heaviside step function}}
\newglossaryentry{intadivb}{name=\ensuremath{a\div b},description={integer division}}
\newglossaryentry{intamodb}{name=\ensuremath{a\bmod b},description={integer modulus}}
\newglossaryentry{inta=bmodc}{name=\ensuremath{a\equiv b\pmod{c}},description={modular equality}}
\newglossaryentry{int(a,b)}{name=\ensuremath{(a,b)},description={}}
\newglossaryentry{int(a_0,a_1,...,a_n-1)}{name=\ensuremath{(a_0,a_1,\cdots,a_{n-1})},description={}}
\newglossaryentry{intprime}{name={prime number},description={}}
\newglossaryentry{int|a|}{name=\ensuremath{\lvert a\rvert},description={length of list}}
\newglossaryentry{inta^b}{name=\ensuremath{a^{\frown}b},description={list concatenation}}
\newglossaryentry{intf(R)}{name=\ensuremath{f(R)},description={elementwise operation}}
\newglossaryentry{inta_*}{name=\ensuremath{a_*},description={product of list}}
\newglossaryentry{intpif(r)}{name=\ensuremath{\prod_r^Rf(r)},description={pi product notation}}
\newglossaryentry{int[a:b]}{name=\ensuremath{[a:b]},description={integer range}}
\newglossaryentry{int[a,b]}{name=\ensuremath{[a,b]},description={}}
\newglossaryentry{int[a_0,a_1,...,a_n-1]}{name=\ensuremath{[a_0,a_1,\cdots,a_{n-1}]},description={}}
\newglossaryentry{intchibdac}{name=\ensuremath{\chi_{b,d}(a,c)},description={}}
\newglossaryentry{intchib_0,b_1,...,b_n-1a_0a_1,...,a_n-1}{name=\ensuremath{\chi_{b_0,b_1,\cdots,b_{n-1}}(a_0,a_1,\cdots,a_{n-1})},description={}}
\newglossaryentry{intphi(n)}{name=\ensuremath{\phi(n)},description={Euler's phi function}}
\newglossaryentry{intatimesb}{name=\ensuremath{a\times b},description={Cartesian product}}
\newglossaryentry{int[P]}{name=\ensuremath{[P]},description={Iverson bracket}}
\newglossaryentry{inta_+}{name=\ensuremath{a_+},description={sum of list}}
\newglossaryentry{intsigmaf(r)}{name=\ensuremath{\sum_r^Rf(r)},description={sigma summation notation}}
\newglossaryentry{inta^ulb}{name=\ensuremath{a^{\ul{b}}},description={falling power}}
\newglossaryentry{inta^olb}{name=\ensuremath{a^{\ol{b}}},description={rising power}}
\newglossaryentry{intnchooser}{name=\ensuremath{\binom{n}{r}},description={binomial coefficient}}
\newglossaryentry{rational}{name={rational number},description={}}
\newglossaryentry{ratNu}{name=$\Nu(a)$,description={numerator of $a$}}
\newglossaryentry{ratDe}{name=$\De(a)$,description={denominator of $a$}}
\newglossaryentry{rata=b}{name=\ensuremath{a=b},description={rational equality}}
\newglossaryentry{rata+b}{name=\ensuremath{a+b},description={rational addition}}
\newglossaryentry{rata}{name=\ensuremath{a},description={}}
\newglossaryentry{rat-a}{name=\ensuremath{-a},description={rational negation}}
\newglossaryentry{ratab}{name=\ensuremath{ab},description={rational multiplication}}
\newglossaryentry{rat1/a}{name=\ensuremath{\frac{1}{a}},description={rational reciprocal}}
\newglossaryentry{rata<b}{name=\ensuremath{a<b},description={rational less than}}
\newglossaryentry{ratfloor}{name=\ensuremath{\lfloor a\rfloor},description={floor function}}
\newglossaryentry{ratceil}{name=\ensuremath{\lceil a\rceil},description={ceiling function}}
\newglossaryentry{ratminc}{name=\ensuremath{\min(c)},description={minimum of list}}
\newglossaryentry{ratmincr}{name=\ensuremath{\min_r^Rc(r)},description={minimum notation}}
\newglossaryentry{ratmaxc}{name=\ensuremath{\max(c)},description={maximum of list}}
\newglossaryentry{ratmaxcr}{name=\ensuremath{\max_r^Rc(r)},description={maximum notation}}
\newglossaryentry{ratpolynomial}{name={polynomial},description={}}
\newglossaryentry{ratpolya_i}{name=\ensuremath{a_i},description={polynomial coefficient}}
\newglossaryentry{ratpolya=b}{name=\ensuremath{a=b},description={polynomial equality}}
\newglossaryentry{ratpolyLambda}{name=\ensuremath{\Lambda(a,b)},description={polynomial evaluation}}
\newglossaryentry{ratlistcomp}{name=\ensuremath{\langle f(j)\for j\in R\rangle},description={list comprehension}}
\newglossaryentry{ratpolya+b}{name=\ensuremath{a+b},description={polynomial addition}}
\newglossaryentry{ratpolya}{name=\ensuremath{a},description={}}
\newglossaryentry{ratpoly-a}{name=\ensuremath{-a},description={polynomial negation}}
\newglossaryentry{ratpolyab}{name=\ensuremath{ab},description={polynomial multiplication}}
\newglossaryentry{ratpolylambda}{name=\ensuremath{\lambda},description={}}
\newglossaryentry{ratpolydeg}{name=\ensuremath{\deg(a)},description={polynomial degree}}
\newglossaryentry{ratpolymonic}{name={monic polynomial},description={}}
\newglossaryentry{ratpolymon}{name=\ensuremath{\mon(p)},description={}}
\newglossaryentry{ratpolydiv}{name=\ensuremath{a\div b},description={polynomial division}}
\newglossaryentry{ratpolymod}{name=\ensuremath{a\bmod b},description={polynomial modulus}}
\newglossaryentry{perplex}{name={perplex number},description={}}
\newglossaryentry{perplexRe}{name=$\Re(a)$,description={real part of $a$}}
\newglossaryentry{perplexIm}{name=$\Im(a)$,description={imaginary part of $a$}}
\newglossaryentry{perplexa=b}{name=\ensuremath{a=b},description={perplex equality}}
\newglossaryentry{perplexa+b}{name=\ensuremath{a+b},description={perplex addition}}
\newglossaryentry{perplexa}{name=\ensuremath{a},description={}}
\newglossaryentry{perplex-a}{name=\ensuremath{-a},description={perplex negation}}
\newglossaryentry{perplexab}{name=\ensuremath{ab},description={perplex multiplication}}
\newglossaryentry{perplexconj}{name=\ensuremath{\conj{a}},description={perplex conjugate}}
\newglossaryentry{perplexabs^2}{name=\ensuremath{\lVert a\rVert^2},description={hyperbolic distance squared}}
\newglossaryentry{perplex1/a}{name=\ensuremath{\frac{1}{a}},description={perplex reciprocal}}
\newglossaryentry{perplexj}{name=\ensuremath{\ju},description={perplex imaginary unit}}
\newglossaryentry{perplexk}{name=\ensuremath{\ku},description={perplex positive diagonal}}
\newglossaryentry{ratperplexmu}{name=\ensuremath{\mu_p(x)},description={perplex absolute conjugate}}
\newglossaryentry{ratpolyJ}{name=\ensuremath{\jsc_s(x)},description={}}
\newglossaryentry{ratpolySturm}{name={Sturm chain},description={}}
\newglossaryentry{complex}{name={complex number},description={}}
\newglossaryentry{complexRe}{name=$\Re(a)$,description={real part of $a$}}
\newglossaryentry{complexIm}{name=$\Im(a)$,description={imaginary part of $a$}}
\newglossaryentry{complexa=b}{name=\ensuremath{a=b},description={complex equality}}
\newglossaryentry{complexa+b}{name=\ensuremath{a+b},description={complex addition}}
\newglossaryentry{complexa}{name=\ensuremath{a},description={}}
\newglossaryentry{complex-a}{name=\ensuremath{-a},description={complex negation}}
\newglossaryentry{complexab}{name=\ensuremath{ab},description={complex multiplication}}
\newglossaryentry{complexconj}{name=\ensuremath{\conj{a}},description={complex conjugate}}
\newglossaryentry{complexabs^2}{name=\ensuremath{\lVert a\rVert^2},description={Euclidean distance squared}}
\newglossaryentry{complex1/a}{name=\ensuremath{\frac{1}{a}},description={complex reciprocal}}
\newglossaryentry{complexi}{name=\ensuremath{\iu},description={complex imaginary unit}}
\newglossaryentry{complexerr}{name=\ensuremath{a\equiv b\err{c_1}\err{c_2}\cdots\err{c_n}},description={approximate equality}}
\newglossaryentry{complexexp}{name=\ensuremath{\exp_n(a)},description={complex exponential function}}
\newglossaryentry{complexdiff}{name=\ensuremath{\diff_{x=y}^zf(x)},description={differentiation}}
\newglossaryentry{complexcos}{name=\ensuremath{\cos_n(z)},description={cosine}}
\newglossaryentry{complexsin}{name=\ensuremath{\sin_n(z)},description={sine}}
\newglossaryentry{complexbinomialseries}{name=\ensuremath{(1+x)_n^a},description={binomial series}}
\newglossaryentry{complexomega}{name=\ensuremath{\omega(r)},description={}}
\newglossaryentry{complexnaturallogarithm}{name=\ensuremath{\ln_k(1+x)},description={natural logarithm}}
\newglossaryentry{complextau}{name=\ensuremath{\tau_n},description={tau}}
\newglossaryentry{complexpolynomial}{name={complex polynomial},description={}}
\newglossaryentry{differentialtaxicab}{name=\ensuremath{\{x\}},description={taxicab length}}
\newglossaryentry{differentialdiff}{name=\ensuremath{\diff_{x=y}^zf(x)},description={difference quotient}}
\newglossaryentry{differentialln}{name=\ensuremath{\ln_n(x)},description={natural logarithm}}
\newglossaryentry{differentialpow}{name=\ensuremath{x_n^a},description={exponentiation}}
\newglossaryentry{differentialintegral}{name=\ensuremath{\int_r^Rf(r,\delta_r)},description={Riemann sum}}
\newglossaryentry{differentialDeltaX}{name=\ensuremath{\Delta X},description={first difference}}
\newglossaryentry{matrix}{name={matrix},description={}}
\newglossaryentry{matrixentry}{name=\ensuremath{A_{I,J}},description={submatrix}}
\newglossaryentry{matrixA=B}{name=\ensuremath{A=B},description={matrix equality}}
\newglossaryentry{matrixA+B}{name=\ensuremath{A+B},description={matrix addition}}
\newglossaryentry{matrix0mn}{name=\ensuremath{0_{m\times n}},description={$m\times n$ zero matrix}}
\newglossaryentry{matrix-A}{name=\ensuremath{-A},description={matrix negation}}
\newglossaryentry{matrixAB}{name=\ensuremath{AB},description={matrix multiplication}}
\newglossaryentry{matrixamm}{name=\ensuremath{a_{m\times m}},description={scalar matrix}}
\newglossaryentry{matrixrow}{name=\ensuremath{A_{i,*}},description={matrix row}}
\newglossaryentry{matrixcol}{name=\ensuremath{A_{*,i}},description={matrix column}}
\newglossaryentry{matrixdiag}{name={matrix diagonal},description={}}
\newglossaryentry{matrixdiagmatrix}{name={diagonal matrix},description={}}
\newglossaryentry{matrixtilt}{name={tilt matrix},description={}}
\newglossaryentry{matrixA^-1}{name=\ensuremath{A^{-1}},description={}}
\newglossaryentry{matrixrows}{name=\ensuremath{\rows(A)},description={number of rows of $A$}}
\newglossaryentry{matrixcols}{name=\ensuremath{\cols(A)},description={number of columns of $A$}}
\newglossaryentry{matrixbdiag}{name=\ensuremath{\diag(C)},description={block diagonal matrix}}
\newglossaryentry{matrixdet}{name=\ensuremath{\det(A)},description={matrix determinant}}
\newglossaryentry{matrixC_k(A)}{name=\ensuremath{C_k(A)},description={$k$\textsuperscript{th} compound matrix}}
\newglossaryentry{matrixlabelledentry}{name=\ensuremath{A_{\ul{I},\ul{J}}},description={labelled matrix entry}}
\newglossaryentry{matrixtranspose}{name=\ensuremath{A^T},description={matrix transpose}}
\newglossaryentry{matrixleftdiv}{name=\ensuremath{A\backslash B},description={matrix left division}}
\newglossaryentry{matrixrightdiv}{name=\ensuremath{A/B},description={matrix right division}}
\newglossaryentry{matrixe}{name=\ensuremath{(e_i)_{k\times 1}},description={standard unit vector}}
\newglossaryentry{matrixmattp}{name=\ensuremath{\mat_t(p)},description={}}
\newglossaryentry{matrixcompmatrix}{name=\ensuremath{\comp(p)},description={companion matrix}}
\newglossaryentry{matrixlast}{name=\ensuremath{\last_A},description={last polynomial}}
\newglossaryentry{matrixpows}{name=\ensuremath{\pows(A)},description={}}
\newglossaryentry{matrixtr}{name=\ensuremath{\tr(A)},description={matrix trace}}
\newglossaryentry{matrixsymmetric}{name={symmetric matrix},description={}}
\newglossaryentry{matrixsel}{name=\ensuremath{\sel_A},description={selector polynomial}}
\begin{document}
\title{Arithmetic: A Programmatic Approach}
\author{Murisi Tarusenga}
\date{\today{} \currenttime}
\maketitle
\section*{ReadMe}
\subsection*{Introduction}
Procedural mathematics is a method of doing mathematics that stemmed from my dissatisfaction with classical logic and in particular, universal quantification. My intuitive understanding of universal quantification is as an infinite conjunction, i.e. $P_1\land P_2\land P_3\land \cdots$. My uneasiness with the proposition is not deep, it's simply that the proposition's end has always felt inaccessible, out of reach, rarefied. Perhaps my discomfort stems from the fact that I was programming for nearly a decade before learning university-level mathematics, and so I had implicitly/intuitively developed a different more syntactical and restrained understanding of program correctness over an unbounded domain. Procedural mathematics is my attempt at articulating this programmatic understanding.
\subsection*{Background of Procedural Mathematics}
Perhaps it would be easier to describe procedural mathematics by first contrasting it to its alternatives. One method of doing mathematics is through argumentation. In this method, the objects under consideration are first defined, then a statement called a theorem is made, then a deductive argument for why the theorem holds called a proof is provided. Here, proofs can use theorems that have been proven earlier and likewise for definitions. This method is perfectly valid and is underpinned by such concepts as universal quantification for expressing generality, existential quantification for expressing existence, the domains over which they apply, and the logical rules governing their interactions with other logical operators such as conjunction and disjunction. The fact that this so far has been the only known general method for doing mathematics has, I believe, led to a situation where it has been applied in contexts (especially in education and technology) where alternative approaches may have been suitable.
Another method for doing mathematics, albeit incomplete, goes by various names including Transparent Proofs, Transparent Pseudo Proofs, and Gneric Proofs. This method is essentially a specialization of the argumentation method presented above except that instead of giving a deductive argument for why the theorem holds, a deductive argument for why a particular case of a theorem holds is presented in such a way that the main ideas for the proof of the general case are communicated. The benefit of this method is that universal and existential quantification, domains of discourse, and the apparatus of mathematical logic are temporarily backgrounded whilst the techniques specific to the given proof are given center stage. The drawback of this method is that the outcome is not actually a proof because the line between the main ideas of the general proof and the ideas incidental to the particular case is not made explicit. And as soon as this line is made clear, the Transparent Pseudo Proof reverts to being an ordinary proof. Hence in the end, this method only tends to be used in brief proof sketches.
Yet another incomplete method of doing mathematics goes by the name of Proof Without Words. A proof without words is understood to be a theorem statement followed by a diagram or a picture that demonstrates it to be self-evident. It is convenient to extend this definition to include unexplained algorithms because their persuasive effect can be similar to that of diagrams and pictures. Similar to the Transparent Pseudo Proofs mentioned above, this method of doing mathematics excels in emphasizing the content of a proof over its form. Unfortunately Proof Without Words are not quite proofs because the link between the "picture" and the theorem to be proved is necessarily implicit. That something is missing in these kinds of proofs is evidenced by the tendency for their authors to caption diagrams and pictures, and write proofs of correctness for unexplained algorithms so as to "complete" them. What is sought then is a method for doing proof based mathematics that does not depend on the concepts of mathematical logic, nor consequently, argumentation, and yet can scale enough to communicate topics like number theory, real and complex analysis, and linear algebra.
\subsection*{Description of Procedural Mathematics}
Overall, this method replaces proving stated mathematical theorems with inventing correct procedures to realize stated objectives. To achieve this, the first part of this method calls for the elucidation of the mathematical semantic rules being followed; their adherence is the criterion for “correctness”. Rules whose adherence is known to guarantee that procedure implementations meet stated objectives in practice (like those of elementary algebra) are what would typically be chosen here. The use of semantic rules in this method is similar to its use in computer science, though the types of rules are markedly different. There, type systems and ownership systems are the most common semantic rules and they serve to prevent syntactically valid programs from compiling when objects of an incorrect type are found in certain contexts within the source code or when object access patterns in the source code are incorrect respectively. The key point of semantic rules is that they serve to rule out grammatically correct instructions before they are even “executed”.
So far with our semantic rules we have enough to “prove” “theorems” true in a programmatic manner. But just like machine code is hard to read and write for programmers, our newfangled “proofs” would be hard to read and write for mathemticians. The next parts of this method are about using commonplace software engineering techniques to structure our “proofs” better and hence allow them to scale enough to realize complex objectives. The second part of this method is the declaration of terminology that will later be used. Declarations are more similar to their namesake in computer programming than they are to definitions in proof-based mathematics. Their purpose is to simplify/make concise instructions that involve manipulating complex structures, just like in computer programming. Nevertheless, the conceptual role of declarations is analogous to that of definitions in mathematics: they give single a name to a group of related ideas; and this in turn enables comprehension of more complex structures.
The third part of this method is announcement of the mathematical objective to be achieved. Some reasonable objectives might be to show that an arithmetical equality holds, construct an object with certain properties, or construct another procedure with a potentially different objective. Again, objectives are more similar to the comments that one might see above a procedure in a computer program’s source code than they are to a theorem statement in proof-based mathematics. Their purpose is to enable readers to understand more complex proofs by sometimes getting them to see certain parts of proofs as black boxes that have the effect given by their objective. For this reason procedure objectives could be said to play a role analogous to theorem statements in proof-based mathematics. However there are some conceptual differences: unlike the theorem statement of a proof, a procedure objective is not a fact nor is it a logical consequence of a group of axioms; rather it is merely a description of the intent of the associated implementation.
The last part of this method is the implementation of a semantically valid procedure for achieving the stated objective. This procedure might in turn use previous procedures or even the current procedure (in which case, the procedure is said to be recursive) to achieve sub-objectives. Semantically valid procedures are very similar to source code written in a statically typed programming language because both comprise an unambiguous set of instructions that can be carried out by a practitioner and both are constructed according to some agreed upon some set of semantic rules. Their dissimilarity is that semantically valid procedures would usually be written in a natural language grammar for a human audience whereas source code is usually written in an artificial grammar primarily for execution on a computer. Semantically valid procedures are also similar to deductive proofs in that both are constructed according to rules which serve to bestow correctness upon the proof; however they are crucially different in that one is instructional whilst the other is argumentative in nature.
\subsection*{Comparing Procedural Mathematics}
\begin{tabular}{|p{3.6cm}|p{3.6cm}|p{3.6cm}|p{3.6cm}|p{3.6cm}|p{3.6cm}|}
\hline & \textbf{Classical Mathematics} & \textbf{Transparent / Wordless Proofs} & \textbf{Procedural Mathematics} \\
\hline \textbf{Grammatical Mood} & Factual because proofs establish theorems, which are facts about abstract objects. For example, claims that a proposition holds on every member of a domain are valid. & Factual because the theorems being proved are identical to their equivalents in classical mathematics. & Intentional because procedures are labelled only with their intent. I.e. no claim is made that procedures achieve the objectives on every member of a domain. \\
\hline \textbf{Generality} & Full. Universal quantifiers are used to express the generality of propositions over infinite domains. & None becuase a theorem is proven for only one well-chosen case. That being said, most readers should be able to generalize proof to other cases. & Full. Symbols are used to indicate values that are only known at "run-time". At "run-time" these symbols take on a single value, rather than ranging over a set. \\
\hline \textbf{Transparency} & Optional because the logical and object language can be inseparably mixed. For example, a non-constructive arithmetical proof generally cannot be put in purely arithmetical terms. & More than in classical mathematics because theorems are proven only on explicitly selected objects. I.e. transparent proofs enforce more terms in the object language than classical proofs. & Full because procedural mathematics is about providing instructions to do mathematics rather than "doing" mathematics. Hence procedure execution yields artifacts purely in the object language. \\
\hline \textbf{Correctness Criterion} & All inferences leading to theorem must originate from stated inference rules and must trace back to stated axioms. & Almost the same as classical mathematics, but the generalization steps are not made explicit. & Adherence of procedure implementations to well-chosen mathematical semantic rules with the objective in a "conclusive" position. \\
\hline \textbf{Expressiveness} & Full. Sufficient for doing pure and applied mathematics and includes topics like transfinite set theory. & Subset of classical mathematics where existential statements have witnesses because proofs are done on explicitly chosen witnesses. & Subset of classical mathematics. Captures topics like trigonometry and calculus. Fails to express topics like transfinite set theory. \\
\hline \textbf{Imports} & Universal and existential quantification, transfinite set theory, inference rules, axioms. & Inference rules and axioms. Universal and existential quantification are made implicit. & Data structures, procedures, lambdas, recursion, static analysis. \\
\hline \textbf{Treatment of Contradictions} & The derivation of a contradiction from an assumption implies that the assumption is false. Justified by the law of noncontradiction. & Largely outside the scope of transparent / wordless proofs. Where they do occur, interpretation is the same as that of classical mathematics. & Sentences are shown to be "impossible" by providing a procedure (with an effectively empty domain) to transform it into a more obviously "impossible" sentence.
\end{tabular}
The above table shows the similarities and differences between the four methods of doing mathematics presented above. Note that they are not all trying to do exactly the same thing, as is evidenced by the variations in their grammatical moods. Also note that while procedural mathematics is strictly less expressive than classical mathematics, it may just be expressive enough to conduct most fields of applied mathemtics within.
\subsection*{Methodology of Mathematical Experiment}
Above I have described a general method for doing mathematics but did not provide evidence that it is workable. The rest of this book intends to prove that this approach is indeed generally usable by reformulating the elementary parts of number theory, hard analysis, calculus, and linear algebra using the tools of procedural mathematics. So, while formal mathematics usually takes the format of definition-theorem-proof, this project has the format of declaration-procedure objective-procedure implementation. So where there usually would have been a statement and proof of Euler's totient theorem, \procedurehr{1.50} is provided, and where there would have been a definition of Euler's totient function, \declarationhr{1.16} is provided. Perhaps not surprisingly, software programming tools and concepts like lambdas, procedures, recursion, and modularity have turned out to be instrumental in rendering intelligable what could have been an indecipharable network of instructions/operations.
\tableofcontents
\twocolumn\printnoidxglossary[title={Declarations},sort=def]\onecolumn
\clearpage
\part{Integer Arithmetic}
\chapter{Integer Arithmetic}
\begin{multicols*}{2}
\declaration{1.22}
The phrase "\gls{integer}" will be used as a shorthand for an ordered pair of natural numbers.
\declaration{1.23}
The phrase "the positive part of $a$" and the notation \gls{intPo}, where $a$ is an integer, will be used as a shorthand for the first entry of $a$.
\declaration{1.24}
The phrase "the negative part of $a$" and the notation \gls{intNe}, where $a$ is an integer, will be used as a shorthand for the second entry of $a$.
\declaration{1.25}
The phrase "\gls{inta=b}", where $a,b$ are integers, will be used as a shorthand for "$\Po(a)+\Ne(b)=\Ne(a)+\Po(b)$".
\procedure{1.65}
\objective
Choose an integer $a$. The objective of the following instructions is to show that $a=a$.
\implementation
\begin{enumerate}
\item \textbf{Show that $a=a$ using \declarationhr{1.25} given that $\Po(a)+\Ne(a)=\Ne(a)+\Po(a)$.}
\end{enumerate}
\procedure{1.66}
\objective
Choose two integers $a,b$ such that $a=b$. The objective of the following instructions is to show that $b=a$.
\implementation
\begin{enumerate}
\item \textbf{Using \declarationhr{1.25}, show that $b=a$}
\begin{enumerate}
\item given that $\Po(b)+\Ne(a)=\Ne(b)+\Po(a)$
\item given that $\Po(a)+\Ne(b)=\Ne(a)+\Po(b)$
\item given that $a=b$.
\end{enumerate}
\end{enumerate}
\procedure{1.67}
\objective
Choose three integers $a,b,c$ such that $a=b$ and $b=c$. The objective of the following instructions is to show that $a=c$.
\implementation
\begin{enumerate}
\item Show that $\Po(a)+\Ne(b)=\Ne(a)+\Po(b)$ using \declarationhr{1.25}.
\item Show that $\Po(b)+\Ne(c)=\Ne(b)+\Po(c)$ using \declarationhr{1.25}.
\item \textbf{Hence show that $a=c$}
\begin{enumerate}
\item given that $\Po(a)+\Ne(c)=\Ne(a)+\Po(c)$
\item given that $\Po(a)+\Ne(b)+\Po(b)+\Ne(c)=\Ne(a)+\Po(b)+\Ne(b)+\Po(c)$.
\end{enumerate}
\end{enumerate}
\declaration{1.26}
The notation \gls{inta+b}, where $a,b$ are integers, will be used as a shorthand for the pair $\langle\Po(a)+\Po(b),\Ne(a)+\Ne(b)\rangle$.
\procedure{1.68}
\objective
Choose four integers $a,b,c,d$ such that $a=c$ and $b=d$. The objective of the following instructions is to show that $a+b=c+d$.
\implementation
\begin{enumerate}
\item Show that $\Po(a)+\Ne(c)=\Ne(a)+\Po(c)$ using \declarationhr{1.25}.
\item Show that $\Po(b)+\Ne(d)=\Ne(b)+\Po(d)$ using \declarationhr{1.25}.
\item Hence using \declarationhr{1.26}, show that $a+b$
\begin{enumerate}
\item $=\langle\Po(a),\Ne(a)\rangle+\langle\Po(b),\Ne(b)\rangle$
\item $=\langle\Po(a)+\Po(b),\Ne(a)+\Ne(b)\rangle$
\item $=\langle\Po(a)+\Po(b)+\Ne(c)+\Ne(d),\Ne(a)+\Ne(b)+\Ne(c)+\Ne(d)\rangle$
\item $=\langle(\Po(a)+\Ne(c))+(\Po(b)+\Ne(d)),\Ne(a)+\Ne(b)+\Ne(c)+\Ne(d)\rangle$
\item $=\langle(\Ne(a)+\Po(c))+(\Ne(b)+\Po(d)),\Ne(a)+\Ne(b)+\Ne(c)+\Ne(d)\rangle$
\item $=\langle\Ne(a)+\Ne(b)+\Po(c)+\Po(d),\Ne(a)+\Ne(b)+\Ne(c)+\Ne(d)\rangle$
\item $=\langle\Po(c)+\Po(d),\Ne(c)+\Ne(d)\rangle$
\item $=\langle\Po(c),\Ne(c)\rangle+\langle\Po(d),\Ne(d)\rangle$
\item $=c+d$.
\end{enumerate}
\end{enumerate}
\procedure{1.69}
\objective
Choose three integers $a,b,c$. The objective of the following instructions is to show that $(a+b)+c=a+(b+c)$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.26}, show that $(a+b)+c$
\begin{enumerate}
\item $=\langle\Po(a)+\Po(b),\Ne(a)+\Ne(b)\rangle+\langle\Po(c),\Ne(c)\rangle$
\item $=\langle(\Po(a)+\Po(b))+\Po(c),(\Ne(a)+\Ne(b))+\Ne(c)\rangle$
\item $=\langle\Po(a)+(\Po(b)+\Po(c)),\Ne(a)+(\Ne(b)+\Ne(c))\rangle$
\item $=\langle\Po(a),\Ne(a)\rangle+\langle\Po(b)+\Po(c),\Ne(b)+\Ne(c)\rangle$
\item $=a+(b+c)$.
\end{enumerate}
\end{enumerate}
\procedure{1.70}
\objective
Choose two integers $a,b$. The objective of the following instructions is to show that $a+b=b+a$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.26}, show that $a+b$
\begin{enumerate}
\item $=\langle\Po(a)+\Po(b),\Ne(a)+\Ne(b)\rangle$
\item $=\langle\Po(b)+\Po(a),\Ne(b)+\Ne(a)\rangle$
\item $=b+a$.
\end{enumerate}
\end{enumerate}
\declaration{1.27}
The notation \gls{inta}, where $a$ is a natural number, will contextually be used as a shorthand for the pair $\langle a,0\rangle$.
\procedure{1.71}
\objective
Choose an integer $a$. The objective of the following instructions is to show that $0+a=a$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.26}, show that $0+a$
\begin{enumerate}
\item $=\langle 0,0\rangle+\langle\Po(a),\Ne(a)\rangle$
\item $=\langle 0+\Po(a),0+\Ne(a)\rangle$
\item $=\langle\Po(a),\Ne(a)\rangle$
\item $=a$.
\end{enumerate}
\end{enumerate}
\declaration{1.28}
The notation \gls{int-a}, where $a$ is an integer, will be used as a shorthand for the pair $\langle\Ne(a),\Po(a)\rangle$.
\procedure{1.72}
\objective
Choose two integers $a,b$ such that $a=b$. The objective of the following instructions is to show that $-a=-b$.
\implementation
\begin{enumerate}
\item Show that $\Po(a)+\Ne(b)=\Ne(a)+\Po(b)$ using \declarationhr{1.25}.
\item Hence using \declarationhr{1.28}, show that $-a$
\begin{enumerate}
\item $=\langle\Ne(a),\Po(a)\rangle$
\item $=\langle\Ne(a)+\Po(b),\Po(a)+\Po(b)\rangle$
\item $=\langle\Po(a)+\Ne(b),\Po(a)+\Po(b)\rangle$
\item $=\langle\Ne(b),\Po(b)\rangle$
\item $=-b$.
\end{enumerate}
\end{enumerate}
\procedure{1.73}
\objective
Choose an integer $a$. The objective of the following instructions is to show that $-a+a=0$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.26}, show that $-a+a$
\begin{enumerate}
\item $=(-a)+a$
\item $=\langle\Ne(a),\Po(a)\rangle+\langle\Po(a),\Ne(a)\rangle$
\item $=\langle\Ne(a)+\Po(a),\Po(a)+\Ne(a)\rangle$
\item $=\langle 0,0\rangle$
\item $=0$.
\end{enumerate}
\end{enumerate}
\declaration{1.29}
The notation \gls{intab}, where $a,b$ are integers, will be used as a shorthand for the pair $\langle\Po(a)\Po(b)+\Ne(a)\Ne(b),\Po(a)\Ne(b)+\Ne(a)\Po(b)\rangle$.
\procedure{1.74}
\objective
Choose four integers $a,b,c,d$ such that $a=c$ and $b=d$. The objective of the following instructions is to show that $ab=cd$.
\implementation
\begin{enumerate}
\item Show that $\Po(a)+\Ne(c)=\Ne(a)+\Po(c)$ using \declarationhr{1.25}.
\item Show that $\Po(b)+\Ne(d)=\Ne(b)+\Po(d)$ using \declarationhr{1.25}.
\item Hence using \declarationhr{1.29}, show that $ab$
\begin{enumerate}
\item $=\langle\Po(a)\Po(b)+\Ne(a)\Ne(b),\Po(a)\Ne(b)+\Ne(a)\Po(b)\rangle$
\item $=\langle\Po(a)\Po(b)+\Ne(a)\Ne(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d),\Po(a)\Ne(b)+\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle\Po(a)(\Po(b)+\Ne(d))+\Ne(a)\Ne(b)+\Ne(c)\Po(d)+\Po(c)\Ne(d),\Po(a)\Ne(b)+\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle\Po(a)(\Ne(b)+\Po(d))+\Ne(a)\Ne(b)+\Ne(c)\Po(d)+\Po(c)\Ne(d),\Po(a)\Ne(b)+\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle(\Po(a)+\Ne(c))\Po(d)+\Ne(a)\Ne(b)+\Po(c)\Ne(d),\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle(\Ne(a)+\Po(c))\Po(d)+\Ne(a)\Ne(b)+\Po(c)\Ne(d),\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle\Ne(a)(\Po(d)+\Ne(b))+\Po(c)\Po(d)+\Po(c)\Ne(d),\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle\Ne(a)(\Po(b)+\Ne(d))+\Po(c)\Po(d)+\Po(c)\Ne(d),\Ne(a)\Po(b)+\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle(\Ne(a)+\Po(c))\Ne(d)+\Po(c)\Po(d),\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle(\Po(a)+\Ne(c))\Ne(d)+\Po(c)\Po(d),\Po(a)\Ne(d)+\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=\langle\Ne(c)\Ne(d)+\Po(c)\Po(d),\Ne(c)\Po(d)+\Po(c)\Ne(d)\rangle$
\item $=cd$.
\end{enumerate}
\end{enumerate}
\procedure{1.75}
\objective
Choose three integers $a,b,c$. The objective of the following instructions is to show that $(ab)c=a(bc)$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.29}, show that $(ab)c$
\begin{enumerate}
\item $=\langle\Po(a)\Po(b)+\Ne(a)\Ne(b),\Po(a)\Ne(b)+\Ne(a)\Po(b)\rangle\langle\Po(c),\Ne(c)\rangle$
\item $=\langle(\Po(a)\Po(b)+\Ne(a)\Ne(b))\Po(c)+(\Po(a)\Ne(b)+\Ne(a)\Po(b))\Ne(c),(\Po(a)\Po(b)+\Ne(a)\Ne(b))\Ne(c)+(\Po(a)\Ne(b)+\Ne(a)\Po(b))\Po(c)\rangle$
\item $=\langle\Po(a)(\Po(b)\Po(c)+\Ne(b)\Ne(c))+\Ne(a)(\Po(b)\Ne(c)+\Ne(b)\Po(c)),\Po(a)(\Po(b)\Ne(c)+\Ne(b)\Po(c))+\Ne(a)(\Po(b)\Po(c)+\Ne(b)\Ne(c))\rangle$
\item $=\langle\Po(a),\Ne(a)\rangle\langle\Po(b)\Po(c)+\Ne(b)\Ne(c),\Po(b)\Ne(c)+\Ne(b)\Po(c)\rangle$
\item $=a(bc)$.
\end{enumerate}
\end{enumerate}
\procedure{1.76}
\objective
Choose two integers $a,b$. The objective of the following instructions is to show that $ab=ba$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.29}, show that $ab$
\begin{enumerate}
\item $=\langle\Po(a)\Po(b)+\Ne(a)\Ne(b),\Po(a)\Ne(b)+\Ne(a)\Po(b)\rangle$
\item $=\langle\Po(b)\Po(a)+\Ne(b)\Ne(a),\Po(b)\Ne(a)+\Ne(b)\Po(a)\rangle$
\item $=ba$.
\end{enumerate}
\end{enumerate}
\procedure{1.77}
\objective
Choose an integer $a$. The objective of the following instructions is to show that $1a=a$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.29}, show that $1a$
\begin{enumerate}
\item $=\langle 1,0\rangle\langle\Po(a),\Ne(a)\rangle$
\item $=\langle 1\Po(a)+0\Ne(a),1\Ne(a)+0\Po(a)\rangle$
\item $=\langle\Po(a),\Ne(a)\rangle$
\item $=a$.
\end{enumerate}
\end{enumerate}
\procedure{1.78}
\objective
Choose three integers $a,b,c$. The objective of the following instructions is to show that $a(b+c)=ab+ac$.
\implementation
\begin{enumerate}
\item Using \declarationhr{1.26} and \declarationhr{1.29}, show that $a(b+c)$
\begin{enumerate}
\item $=\langle\Po(a),\Ne(a)\rangle\langle\Po(b)+\Po(c),\Ne(b)+\Ne(c)\rangle$
\item $=\langle\Po(a)(\Po(b)+\Po(c))+\Ne(a)(\Ne(b)+\Ne(c)),\Po(a)(\Ne(b)+\Ne(c))+\Ne(a)(\Po(b)+\Po(c))\rangle$
\item $=\langle(\Po(a)\Po(b)+\Ne(a)\Ne(b))+(\Po(a)\Po(c)+\Ne(a)\Ne(c)),(\Po(a)\Ne(b)+\Ne(a)\Po(b))+(\Po(a)\Ne(c)+\Ne(a)\Po(c))\rangle$
\item $=\langle\Po(a)\Po(b)+\Ne(a)\Ne(b),\Po(a)\Ne(b)+\Ne(a)\Po(b)\rangle+\langle\Po(a)\Po(c)+\Ne(a)\Ne(c),\Po(a)\Ne(c)+\Ne(a)\Po(c)\rangle$
\item $=ab+ac$.
\end{enumerate}
\end{enumerate}
\procedure{1.91}
\objective
Choose an integer $a$. The objective of the following instructions is to show that $(-1)^{2a}=1$ and $(-1)^{2a+1}=-1$.
\implementation
\begin{enumerate}
\item Show that $(-1)^2=(-1)(-1)+1+(-1)=(-1)((-1)+1)+1=(-1)0+1=1$.
\item \textbf{Hence show that $(-1)^{2a}=((-1)^2)^a=1^a=1$.}
\item \textbf{Also show that $(-1)^{2a+1}=(-1)^{2a}(-1)=1(-1)=-1$.}
\end{enumerate}
\declaration{1.30}
The phrases "\gls{inta<b}" and "$b>a$", where $a,b$ are rational numbers, will be used as a shorthand for "$\Po(a)+\Ne(b)<\Ne(a)+\Po(b)$".
\procedure{1.79}
\objective
Choose four integers $a,b,c,d$ such that $a<b$, $a=c$ and $b=d$. The objective of the following instructions is to show that $c<d$.
\implementation
\begin{enumerate}
\item Show that $\Po(a)+\Ne(c)=\Ne(a)+\Po(c)$ using \declarationhr{1.25}.
\item Show that $\Po(b)+\Ne(d)=\Ne(b)+\Po(d)$ using \declarationhr{1.25}.
\item Show that $\Po(a)+\Ne(b)<\Ne(a)+\Po(b)$ using \declarationhr{1.30}.
\item Hence show that $\Po(c)+\Ne(d)$
\begin{enumerate}
\item $=(\Ne(a)+\Po(c))+(\Po(b)+\Ne(d))-\Ne(a)-\Po(b)$
\item $=(\Po(a)+\Ne(c))+(\Ne(b)+\Po(d))-\Ne(a)-\Po(b)$
\item $=(\Po(a)+\Ne(b))+\Ne(c)+\Po(d)-\Ne(a)-\Po(b)$
\item $<(\Ne(a)+\Po(b))+\Ne(c)+\Po(d)-\Ne(a)-\Po(b)$
\item $=\Ne(c)+\Po(d)$.
\end{enumerate}
\item \textbf{Hence show that $c<d$ using \declarationhr{1.30}.}
\end{enumerate}
\procedure{1.80}
\objective
Choose three integers $a,b,c$ such that $a<b$. The objective of the following instructions is to show that $a+c<b+c$.
\implementation
\begin{enumerate}
\item Show that $\Po(a)+\Ne(b)<\Ne(a)+\Po(b)$ using \declarationhr{1.30}.
\item Hence show that $\Po(a+c)+\Ne(b+c)$
\begin{enumerate}
\item $=\Po(a)+\Po(c)+\Ne(b)+\Ne(c)$
\item $=(\Po(a)+\Ne(b))+\Po(c)+\Ne(c)$
\item $=(\Ne(a)+\Po(b))+\Po(c)+\Ne(c)$
\item $=\Ne(a)+\Ne(c)+\Po(b)+\Po(c)$
\item $=\Ne(a+c)+\Po(b+c)$.
\end{enumerate}
\item \textbf{Hence show that $a+c<b+c$ using \declarationhr{1.30}.}
\end{enumerate}
\procedure{1.81}
\objective
Choose two integers $a,b$. The objective of the following instructions is to show that $a<b$, $a=b$ and $a>b$.
\implementation
\begin{enumerate}
\item Show that either
\begin{enumerate}
\item $\Po(a)+\Ne(b)<\Ne(a)+\Po(b)$
\item $\Po(a)+\Ne(b)=\Ne(a)+\Po(b)$
\item $\Po(a)+\Ne(b)>\Ne(a)+\Po(b)$
\end{enumerate}
\item Hence show that either
\begin{enumerate}
\item $a<b$ using \declarationhr{1.30} given that $\Po(a)+\Ne(b)<\Ne(a)+\Po(b)$.
\item $a=b$ using \declarationhr{1.25} given that $\Po(a)+\Ne(b)=\Ne(a)+\Po(b)$.
\item $a>b$ using \declarationhr{1.30} given that $\Po(a)+\Ne(b)>\Ne(a)+\Po(b)$.
\end{enumerate}
\end{enumerate}
\procedure{1.85}
\objective
Choose two integers $a,b$ such that $0<a$ and $0<b$. The objective of the following instructions is to show that $0<a+b$.
\implementation
\begin{enumerate}
\item Show that $\Ne(a)=\Po(0)+\Ne(a)<\Ne(0)+\Po(a)=\Po(a)$ using \declarationhr{1.30}.
\item Show that $\Ne(b)=\Po(0)+\Ne(b)<\Ne(0)+\Po(b)=\Po(b)$ using \declarationhr{1.30}.
\item Show that $\Po(0)+\Ne(a+b)=\Ne(a+b)=\Ne(a)+\Ne(b)<\Po(a)+\Po(b)=\Po(a+b)=\Ne(0)+\Po(a+b)$.
\item \textbf{Hence show that $0<a+b$ given that $\Po(0)+\Ne(a+b)<\Ne(0)+\Po(a+b)$.}
\end{enumerate}
\procedure{1.86}
\objective
Choose two integers $a,b$ such that $0<a$ and $0<b$. The objective of the following instructions is to show that $0<ab$.
\implementation
\begin{enumerate}
\item Show that $\Ne(a)=\Po(0)+\Ne(a)<\Ne(0)+\Po(a)=\Po(a)$ using \declarationhr{1.30}.
\item Hence show that $0<\Po(a)-\Ne(a)$.
\item Show that $\Ne(b)=\Po(0)+\Ne(b)<\Ne(0)+\Po(b)=\Po(b)$ using \declarationhr{1.30}.
\item Hence show that $0<\Po(b)-\Ne(b)$.
\item \textbf{Hence show that $0<ab$}
\begin{enumerate}
\item given that $\Po(0)+\Ne(ab)=\Ne(a)\Po(b)+\Po(a)\Ne(b)<\Po(a)\Po(b)+\Ne(a)\Ne(b)=\Ne(0)+\Po(ab)$
\item given that $\Ne(a)(\Po(b)-\Ne(b))<\Po(a)(\Po(b)-\Ne(b))$
\item given that $0<(\Po(a)-\Ne(a))(\Po(b)-\Ne(b))$.
\end{enumerate}
\end{enumerate}
\declaration{1.34}
The notation \gls{int||a||} will be used as a shorthand for the following expression:
\begin{enumerate}
\item $-a$ if $a<0$
\item $a$ if $a\ge 0$
\end{enumerate}
\procedure{1.87}
\objective
Choose two integers $a,b$. The objective of the following instructions is to show that $\lVert ab\rVert=\lVert a\rVert\lVert b\rVert$.
\implementation
\begin{enumerate}
\item If $a\ge 0$ and $b\ge 0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $\lVert ab\rVert=ab=\lVert a\rVert\lVert b\rVert$ given that $ab\ge 0$.}
\end{enumerate}
\item Otherwise if $a<0$ and $b\ge 0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $\lVert ab\rVert=-(ab)=(-a)b=\lVert a\rVert\lVert b\rVert$ given that $ab<0$.}
\end{enumerate}
\item Otherwise if $a\ge 0$ and $b<0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $\lVert ab\rVert=-(ab)=a(-b)=\lVert a\rVert\lVert b\rVert$ given that $ab<0$.}
\end{enumerate}
\item Otherwise do the following:
\begin{enumerate}
\item \textbf{Show that $\lVert ab\rVert=ab=(-a)(-b)=\lVert a\rVert\lVert b\rVert$.}
\begin{enumerate}
\item given that $ab>0$
\item given that $a<0$ and $b<0$.
\end{enumerate}
\end{enumerate}
\end{enumerate}
\procedure{1.88}
\objective
Choose two integers $a,b$. The objective of the following instructions is to show that $\lVert a+b\rVert\le\lVert a\rVert+\lVert b\rVert$.
\implementation
\begin{enumerate}
\item If $a+b\ge 0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $\lVert a+b\rVert=a+b\le\lVert a\rVert+\lVert b\rVert$}
\begin{enumerate}
\item given that $a\le\lVert a\rVert$
\item and $b\le\lVert b\rVert$.
\end{enumerate}
\end{enumerate}
\item Otherwise do the following:
\begin{enumerate}
\item \textbf{Show that $\lVert a+b\rVert=-(a+b)=(-a)+(-b)\le\lVert a\rVert+\lVert b\rVert$}
\begin{enumerate}
\item given that $-a\le\lVert a\rVert$
\item and $-b\le\lVert b\rVert$
\item and $a+b<0$.
\end{enumerate}
\end{enumerate}
\end{enumerate}
\procedure{1.89}
\objective
Choose two integers $a,b$. The objective of the following instructions is to show that $\lVert a\rVert-\lVert b\rVert\le\lVert a-b\rVert$.
\implementation
\begin{enumerate}
\item Show that $\lVert a\rVert=\lVert b+(a-b)\rVert\le\lVert b\rVert+\lVert a-b\rVert$ using \procedurehr{1.88}.
\item \textbf{Hence show that $\lVert a\rVert-\lVert b\rVert\le\lVert a-b\rVert$.}
\end{enumerate}
\declaration{1.03}
The notation \gls{intsgn(a)} will be used as a shorthand for the following expression:
\begin{enumerate}
\item $-1$ if $a<0$
\item $0$ if $a=0$
\item $1$ if $a>0$
\end{enumerate}
\declaration{sun0902201144}
The notation \gls{inthsf(a)} will be used as a shorthand for the following expression:
\begin{enumerate}
\item $0$ if $a<0$
\item $1$ if $a\ge 0$
\end{enumerate}
\procedure{1.90}
\objective
Choose an integer $a$. The objective of the following instructions is to show that $a=\sgn(a)\lVert a\rVert$.
\implementation
\begin{enumerate}
\item If $a>0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $a=1a=\sgn(a)\lVert a\rVert$}
\begin{enumerate}
\item given that $\lVert a\rVert=a$
\item and $\sgn(a)=1$.
\end{enumerate}
\end{enumerate}
\item If $a=0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $a=0=\sgn(a)0=\sgn(a)\lVert a\rVert$ given that $\lVert a\rVert=a=0$.}
\end{enumerate}
\item Otherwise if $a<0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $a=(-1)(-a)=\sgn(a)\lVert a\rVert$}
\begin{enumerate}
\item given that $\lVert a\rVert=-a$
\item and $\sgn(a)=-1$.
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{multicols*}
\chapter{Modular Arithmetic}
\begin{multicols*}{2}
\procedure{1.00}
\objective
Choose an integer $a$ and a positive integer $b$. The objective of the following instructions is to construct integers $n$ and $m$ such that $a=nb+m$ and $0\le m<b$.
\implementation
\begin{enumerate}
\item Let $n=0$.
\item While $(n+1)b\le a$, do the following:
\begin{enumerate}
\item Let $n$ receive $n+1$.
\item Show that $nb\le a$.
\end{enumerate}
\item While $nb>a$, do the following:
\begin{enumerate}
\item Let $n$ receive $n-1$.
\item Show that $(n+1)b>a$.
\end{enumerate}
\item Hence show that $nb\le a$ and $(n+1)b>a$.
\item Let $m=a-nb$.
\item \textbf{Now show that $b>a-nb=m\ge 0$ and $a=bn+a-nb=nb+m$.}
\item \textbf{Yield $\langle n,m\rangle$.}
\end{enumerate}
\declaration{1.00}
The notation \gls{intadivb} will be used to refer to the first part of the pair yielded by executing \procedurehr{1.00} on $\langle a,b\rangle$.
\declaration{1.01}
The notation \gls{intamodb} will be used to refer to the second part of the pair yielded by executing \procedurehr{1.00} on $\langle a,b\rangle$.
\declaration{1.02}
The notation \gls{inta=bmodc} will be used as a shorthand for "$a\bmod c=b\bmod c$".
\procedure{1.01}
\objective
Choose four integers $a,b,c,d$ and a positive integer $e$ in such a way that $a\equiv c\pmod{e}$ and $b\equiv d\pmod{e}$. The objective of the following instructions is to show that $a+b\equiv c+d\pmod{e}$.
\implementation
\begin{enumerate}
\item Show that $a+b$
\begin{enumerate}
\item $\equiv(a\div e)e+(a\bmod e)+(b\div e)e+(b\bmod e)$
\item $\equiv(a\bmod e)+(b\bmod e)$
\item $\equiv(c\bmod e)+(d\bmod e)$
\item $\equiv(c\div e)e+(c\bmod e)+(d\div e)e+(d\bmod e)$
\item \textbf{$\equiv c+d\pmod{e}$.}
\end{enumerate}
\end{enumerate}
\procedure{1.02}
\objective
Choose four integers $a,b,c,d$ and a positive integer $e$ in such a way that $a\equiv c\pmod{e}$ and $b\equiv d\pmod{e}$. The objective of the following instructions is to show that $ab\equiv cd\pmod{e}$.
\implementation
\begin{enumerate}
\item Show that $ab$
\begin{enumerate}
\item $\equiv((a\div e)e+(a\bmod e))((b\div e)e+(b\bmod e))$
\item $\equiv(a\div e)(b\div e)e^2+(a\div e)(b\bmod e)e+(a\bmod e)(b\div e)e+(a\bmod e)(b\bmod e)$
\item $\equiv(a\bmod e)(b\bmod e)$
\item $\equiv(c\bmod e)(d\bmod e)$
\item $\equiv(c\div e)(d\div e)e^2+(c\div e)(d\bmod e)e+(c\bmod e)(d\div e)e+(c\bmod e)(d\bmod e)$
\item \textbf{$\equiv cd\pmod{e}$.}
\end{enumerate}
\end{enumerate}
\procedure{1.03}
\objective
Choose an integer $a$ and two positive integers $b,c$. The objective of the following instructions is to show that $(a\bmod bc)\bmod b=a\bmod b$.
\implementation
\begin{enumerate}
\item \textbf{Show that $(a\bmod bc)\bmod b=(a-(a\div bc)bc)\bmod b=a\bmod b$.}
\end{enumerate}
\procedure{1.04}
\objective
Choose a positive integer $a$ and four integers $b_1,b_0,c_1,c_0$ such that $0\le b_0<a$, $0\le c_0<a$, and $b_1a+b_0=c_1a+c_0$. The objective of the following instructions is to show that $b_1=c_1$ and $b_0=c_0$.
\implementation
\begin{enumerate}
\item \textbf{Show that $b_0=b_0\bmod a=(b_1a+b_0)\bmod a=(c_1a+c_0)\bmod a=c_0\bmod a=c_0$.}
\item \textbf{Therefore show that $b_1=c_1$ given that $b_1a=c_1a$.}
\end{enumerate}
\procedure{1.05}
\objective
Choose an integer $a$ and two positive integers $b,c$. The objective of the following instructions is to show that $ca\bmod cb=c(a\bmod b)$ and that $ca\div cb=a\div b$.
\implementation
\begin{enumerate}
\item Show that $bc(a\div b)+c(a\bmod b)=c(b(a\div b)+a\bmod b)=ca=cb(ca\div cb)+ca\bmod cb$.
\item Show that $0\le a\bmod b<b$.
\item Show that $0\le c(a\bmod b)<cb$.
\item Show that $0\le ca\bmod cb<cb$.
\item \textbf{Hence show that $c(a\bmod b)=ca\bmod cb$ and $a\div b=ca\div cb$ using \procedurehr{1.04}.}
\end{enumerate}
\procedure{1.06}
\objective
Choose two integers $a,b$ and a positive integer $c$ such that $a\bmod c+b\bmod c<c$. The objective of the following instructions is to show that $a\div c+b\div c=(a+b)\div c$ and $a\bmod c+b\bmod c=(a+b)\bmod c$.
\implementation
\begin{enumerate}
\item Show that $a=c(a\div c)+a\bmod c$.
\item Show that $b=c(b\div c)+b\bmod c$.
\item Therefore show that $a+b=c(a\div c+b\div c)+(a\bmod c+b\bmod c)$.
\item Show that $0\le a\bmod c+b\bmod c<c$.
\item Also show that $a+b=((a+b)\div c)c+(a+b)\bmod c$.
\item Show that $0\le(a+b)\bmod c<c$.
\item \textbf{Hence show that $a\div c+b\div c=(a+b)\div c$ and $a\bmod c+b\bmod c=(a+b)\bmod c$ using \procedurehr{1.04}.}
\end{enumerate}
\procedure{1.07}
\objective
Choose two integers $a,b$ and a positive integer $c$ such that $a\bmod c+b\bmod c\ge c$. The objective of the following instructions is to show that $1+a\div c+b\div c=(a+b)\div c$ and $a\bmod c+b\bmod c-c=(a+b)\bmod c$.
\implementation
\begin{enumerate}
\item Show that $a=c(a\div c)+a\bmod c$.
\item Show that $b=c(b\div c)+b\bmod c$.
\item Therefore show that $a+b=c(a\div c+b\div c)+a\bmod c+b\bmod c=c(1+a\div c+b\div c)+(a\bmod c+b\bmod c-c)$.
\item Show that $c\le a\bmod c+b\bmod c<2c$.
\item Therefore show that $0\le a\bmod c+b\bmod c-c<c$.
\item Also show that $a+b=c((a+b)\div c)+(a+b)\bmod c$.
\item Show that $0\le (a+b)\bmod c<c$.
\item \textbf{Therefore show that $1+a\div c+b\div c=(a+b)\div c$ and $a\bmod c+b\bmod c-c=(a+b)\bmod c$ using \procedurehr{1.04}.}
\end{enumerate}
\procedure{1.08}
\objective
Choose an integer $a$ and two positive integers $b,c$. The objective of the following instructions is to show that $a\div bc=(a\div b)\div c$ and $a\bmod bc=((a\div b)\bmod c)b+a\bmod b$.
\implementation
\begin{enumerate}
\item Show that $a=(((a\div b)\div c)c+(a\div b)\bmod c)b+a\bmod b=((a\div b)\div c)bc+((a\div b)\bmod c)b+a\bmod b$
\begin{enumerate}
\item given that $a=(a\div b)b+a\bmod b$
\item given that $a\div b=((a\div b)\div c)c+(a\div b)\bmod c$.
\end{enumerate}
\item Show that $0\le((a\div b)\bmod c)b\le cb-b$ given that $0\le(a\div b)\bmod c\le c-1$.
\item Therefore show that $0\le ((a\div b)\bmod c)b+a\bmod b<cb$ given that $0\le a\bmod b<b$.
\item Now show that $a=(a\div bc)bc+a\bmod bc$ and $0\le a\bmod bc<bc$.
\item \textbf{Therefore show that $(a\div b)\div c=a\div bc$ and $((a\div b)\bmod c)b+a\bmod b=a\bmod bc$ using \procedurehr{1.04}.}
\end{enumerate}
\procedure{1.09}
\objective
Choose an integer $a$ and a non-negative integer $b$. The objective of the following instructions is to consruct integers $c,d,e,f,g$ such that $a=cd$, $b=ce$, $fa+gb=c$, and if $b=0$, then $c=\lvert a\rvert$, otherwise $0<c\le b$.
\implementation
\begin{enumerate}
\item If $b=0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $a=\sgn(a)\lvert a\rvert$.}
\item \textbf{Show that $b=0\lvert a\rvert$.}
\item \textbf{Show that $\lvert a\rvert=\sgn(a)a+0b$.}
\item \textbf{Yield $\langle\lvert a\rvert,\sgn(a),0,\sgn(a),0\rangle$.}
\end{enumerate}
\item Otherwise do the following:
\begin{enumerate}
\item Show that $0\le a\bmod b<b$.
\item Use \procedurehr{1.09} on $\langle b,a\bmod b\rangle$ to construct $\langle c,d,e,f,g\rangle$ and show that:
\begin{enumerate}
\item $b=cd$
\item $a\bmod b=ce$
\item $c=\lVert b\rVert$ if $a\bmod b=0$, otherwise $0<c\le a\bmod b$
\item $fb+g(a\mod b)=c$.
\end{enumerate}
\item \textbf{Hence show that $a=(a\div b)b+(a\bmod b)=c(d(a\div b)+e)$.}
\item \textbf{Also show that $(f-g(a\div b))b+ga=fb+g(a-(a\div b)b)=fb+g(a\bmod b)=c$.}
\item If $a\bmod b=0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $0<b=c\le b$ given that $b\ge 0$, $b\ne 0$, and $c=\lVert b\rVert=b$.}
\end{enumerate}
\item Otherwise do the following:
\begin{enumerate}
\item \textbf{Show that $0<c\le a\bmod b<b$ given $0<c\le a\bmod b$.}
\end{enumerate}
\item \textbf{Therefore yield $\langle c,d(a\div b)+e,d,g,f-g(a\div b)\rangle$.}
\end{enumerate}
\end{enumerate}
\declaration{1.04}
The notation \gls{int(a,b)} will be used to refer to the first part of the quintuple constructed by using \procedurehr{1.09} on the pair $\langle a,b\rangle$.
\procedure{1.10}
\objective
Choose an integer $a$ and a positive integer $b$. Let $1\le c\le b$ be the largest integer such that $a\bmod c=0$ and $b\bmod c=0$. The objective of the following instructions is to either show that $0\ne 0$ or $(a,b)=c$.
\implementation
\begin{enumerate}
\item Use \procedurehr{1.09} on $\langle a,b\rangle$ to construct $\langle d,e,f,g,h\rangle$ and show that:
\begin{enumerate}
\item $a=ed$
\item $b=fd$
\item $ga+hb=d$
\item $0<d\le b$.
\end{enumerate}
\item If $d>c$, then do the following:
\begin{enumerate}
\item Show that $a\bmod d\ne 0$ or $b\bmod d\ne 0$ given that $0<d\le b$ is larger than the largest integer such that $a\bmod c=0$ and $b\bmod c=0$.
\item If $a\bmod d\ne 0$, then do the following:
\begin{enumerate}
\item Show that $a\bmod d=0$ given that $a=ed$.
\item \textbf{Hence show that $0\ne 0$ given that $a\bmod d\ne 0$ and $a\bmod d=0$.}
\item \textbf{Abort procedure.}
\end{enumerate}
\item Otherwise if $b\bmod d\ne 0$, then do the following:
\begin{enumerate}
\item Show that $b\bmod d=0$ given that $b=fd$.
\item \textbf{Hence show that $0\ne 0$ given that $b\bmod d\ne 0$ and $b\bmod d=0$.}
\item \textbf{Abort procedure.}
\end{enumerate}
\end{enumerate}
\item Otherwise if $d<c$, then do the following:
\begin{enumerate}
\item Show that $0\equiv gc(a\div c)+hc(b\div c)=g(c(a\div c)+a\bmod c)+h(c(b\div c)+b\bmod c)=ga+hb=d\not\equiv 0\pmod{c}$ given that:
\begin{enumerate}
\item $ga+hb=d$
\item $a\bmod c=0$
\item $b\bmod c=0$.
\end{enumerate}
\item \textbf{Hence show that $0\ne 0$.}
\item \textbf{Abort procedure.}
\end{enumerate}
\item \textbf{Otherwise show that $(a,b)=d=c$.}
\end{enumerate}
\procedure{1.11}
\objective
Choose integers $a,c,d,j$ and a non-negative integer $b$. Use \procedurehr{1.09} on $\langle a,b\rangle$ to construct $\langle e,f,g,h,i\rangle$. The objective of the following instructions is to show that $ca+db=(c+gj)a+(d-fj)b$.
\implementation
\begin{enumerate}
\item \textbf{Show that $(c+gj)a+(d-fj)b=ca+db+gja-fjb=ca+db+gjef-fjeg=ca+db$.}
\end{enumerate}
\procedure{1.12}
\objective
Choose integers $a,c,d$ and a non-negative integer $b$ such that $ca+db=(a,b)$. Use \procedurehr{1.09} on $\langle a,b\rangle$ to construct $\langle e,f,g,h,i\rangle$. The objective of the following instructions is to construct a $j$ such that $c=h+gj$ and $d=i-fj$.
\implementation
\begin{enumerate}
\item Use \procedurehr{1.09} on $\langle a,b\rangle$ to show that:
\begin{enumerate}
\item $a=ef$
\item $b=eg$
\item $ha+ib=e$.
\end{enumerate}
\item Show that $cf+dg=1$
\begin{enumerate}
\item given that $cef+deg=ca+db=(a,b)=e$
\item given that $a=ef$ and $b=eg$.
\end{enumerate}
\item Show that $hf+ig=1$
\begin{enumerate}
\item given that $hef+ieg=ha+ib=e$
\item given that $a=ef$ and $b=eg$.
\end{enumerate}
\item Let $j=ci-hd$.
\item \textbf{Show that $c=h+cig-hdg=h+g(ci-hd)=h+gj$}
\begin{enumerate}
\item given that $c-cig=c(1-ig)=chf=h(1-dg)=h-hdg$
\item given that $cf=1-dg$.
\end{enumerate}
\item \textbf{Show that $d=i-icf+dhf=i-f(ic-dh)=i-fj$}
\begin{enumerate}
\item given that $d-dhf=d(1-hf)=dig=i(1-cf)=i-icf$
\item given that $dg=1-cf$.
\end{enumerate}
\item \textbf{Yield $\langle j\rangle$.}
\end{enumerate}
\procedure{1.13}
\objective
Choose an integer $a$ and a positive integer $b$ such that $0<(a,b)<b$. The objective of the following instructions is to show that $0\ne 0$ or $a\bmod b\ne 0$.
\implementation
\begin{enumerate}
\item If $a\bmod b=0$, then do the following:
\begin{enumerate}
\item Show that $af\equiv 0f\equiv 0\pmod{b}$ given that $a\bmod b=0$.
\item Use \procedurehr{1.09} on $\langle a,b\rangle$ to construct $\langle c,d,e,f,g\rangle$ and show that:
\begin{enumerate}
\item $fa+gb=c=(a,b)$
\item $0<c=(a,b)\le b$.
\end{enumerate}
\item Hence show that $fa\equiv(a,b)\not\equiv 0\pmod{b}$ given that $0<(a,b)<b$.
\item Hence show that $0\ne 0$ given that $0\equiv af\not\equiv 0\pmod{b}$.
\item \textbf{Abort procedure.}
\end{enumerate}
\item \textbf{Otherwise show that $a\bmod b\ne 0$.}
\end{enumerate}
\procedure{1.14}
\objective
Choose five integers $a,d,e,f,g$ and two non-negative integers $b,c$ such that $a=cd$, $b=ce$, and $fa+gb=c$. The objective of the following instructions is to show that $0<0$ or $(a,b)=c$.
\implementation
\begin{enumerate}
\item Use \procedurehr{1.09} on $\langle a,b\rangle$ to construct $\langle u,v,x,y,z\rangle$ and show that:
\begin{enumerate}
\item $u\ge 0$
\item $a=uv$
\item $b=xu$
\item $u=ya+zb$.
\end{enumerate}
\item Hence show that $c=fa+gb=(fv+gx)u$.
\item If $u=0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $c=(fv+gx)u=0=u=(a,b)$.}
\item \textbf{Yield.}
\end{enumerate}
\item Show that $u=ya+zb=(yd+ze)c$ given that $u=ya+zb$, $a=cd$, and $b=ce$.
\item If $c=0$, then do the following:
\begin{enumerate}
\item \textbf{Show that $(a,b)=u=(yd+ze)c=0=c$.}
\item \textbf{Yield.}
\end{enumerate}