Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
File size: 80,294 Bytes
afd65d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
\chapter{Dimension theory}

\label{chdimension}
\textbf{Dimension theory} assigns to each commutative ring---say,
noetherian---an invariant called the dimension. The most standard definition,
that of Krull dimension (which we shall not adopt at first), defines the
dimension in terms of the maximal lengths of ascending chains of prime ideals. 
In general, however, the geometric intuition behind dimension is that it
should assign to an affine ring---say, one of the form $\mathbb{C}[x_1, \dots,
X_n]/I$---something like the ``topological dimension'' of the affine variety
in $\mathbb{C}^n$ cut out by the ideal $I$. 

In this chapter, we shall obtain three different expressions for the dimension
of a noetherian local ring $(R, \mathfrak{m})$, each of which will be useful
at different times in proving results. 

\section{The Hilbert function and the dimension of a local ring}
\subsection{Integer-valued polynomials}

It is now necessary to do a small amount of general algebra.

Let $P \in \mathbb{Q}[t]$. We consider the question of when $P$ maps the
integers $\mathbb{Z}$, or more generally the sufficiently large integers, into
$\mathbb{Z}$. Of course, any polynomial in $\mathbb{Z}[t]$ will do this, but
there are others: consider $\frac{1}{2}(t^2 -t)$, for instance.

\begin{proposition}\label{integervalued} 
Let $P \in \mathbb{Q}[t]$. Then $P(m)$ is an integer for $m \gg 0$ integral if and only if
$P$ can be written in the form
\[ P(t) = \sum_n c_n \binom{t}{n}, \quad c_n \in \mathbb{Z}.  \]
In particular, $P(\mathbb{Z}) \subset \mathbb{Z}$.
\end{proposition} 
So $P$ is a $\mathbb{Z}$-linear function of binomial coefficients. 
\begin{proof} 
Note that the set $\left\{\binom{t}{n}\right\}_{n \in \mathbb{Z}_{\geq 0}}$ forms a basis for the set of
polynomials $\mathbb{Q}[t]$. It is thus clear that $P(t)$ can be written as
a rational combination $\sum c_n \binom{t}{n}$ for the $c_n \in \mathbb{Q}$.
We need to argue that the $c_n \in \mathbb{Z}$ in fact.

Consider the operator $\Delta$ defined on functions $\mathbb{Z} \to
\mathbb{C}$ as follows:
\[( \Delta f)(m) = f(m) - f(m-1).  \]
It is obvious that if $f$ takes integer values for $m \gg 0$, then so does
$\Delta f$. It is also easy to check that $\Delta \binom{t}{n} =
\binom{t}{n-1}$.

By looking at the
function $\Delta P = \sum c_n \binom{t}{n-1}$ (which takes values in $\mathbb{Z}$), it is easy to see that the $c_n \in \mathbb{Z}$ by induction
on the degree. 
It is also easy to see directly that the binomial coefficients take values in
$\mathbb{Z}$ at \emph{all} arguments.
\end{proof} 



\subsection{Definition and examples}
Let $R$ be a   ring. 
\begin{question} 
What is a good definition for $\dim(R)$? Actually, more generally, 
what is the dimension of $R$ at a given ``point'' (i.e. prime ideal)?
\end{question} 

Geometrically, think of $\spec R$, for any ring; pick some point corresponding to a maximal
ideal $\mathfrak{m} \subset R$. We want to define the \textbf{dimension of $R$}
at $\mathfrak{m}$. This is to be thought of kind of like ``dimension over the
complex numbers,'' for algebraic varieties defined over $\mathbb{C}$. But it
should be purely algebraic. 
What might you do?


Here  is an idea. For a topological space $X$ to be $n$-dimensional at $x \in
X$, there should be $n$ coordinates at the point $x$. In other words, the
point $x$ should be uniquely  defined
by the zero locus of $n$ points on the space.
Motivated by this, we could try defining $\dim_{\mathfrak{m}} R$
to be the number of generators of $\mathfrak{m}$.
However, this is a bad definition, as $\mathfrak{m}$ may not have the same number of
generators as $\mathfrak{m}R_{\mathfrak{m}}$. In other words, it is not a
truly \emph{local} definition.
\begin{example} 
Let $R$ be a noetherian integrally closed domain which is not a UFD. Let $\mathfrak{p}
\subset R$ be a prime ideal which is minimal over a principal ideal but which
is not itself principal. Then $\mathfrak{p}R_{\mathfrak{p}}$ is generated by
one element, as we will eventually see, but $\mathfrak{p}$ is not.
\end{example} 

We want our definition of dimension to be
local.
So this leads us to:
\begin{definition} 
If $R$ is a (noetherian) \emph{local} ring with maximal ideal $\mathfrak{m}$,
then the \textbf{embedding dimension} of $R$, denoted $\emdim R$ is
the minimal number of generators for $\mathfrak{m}$. If $R$ is a  noetherian
ring and $\mathfrak{p} \subset R$ a prime ideal, then the \textbf{embedding
dimension at $\mathfrak{p}$} is that of the local ring $R_{\mathfrak{p}}$.
\end{definition} 

In the above definition, it is clearly sufficient to study what happens for
local rings, and we impose that restriction for now. By Nakayama's lemma, the
embedding dimension is the minimal number of generators of
$\mathfrak{m}/\mathfrak{m}^2$, or the $R/\mathfrak{m}$-dimension of that vector
space:
\[ \emdim R = \dim_{R/\mathfrak{m}} \mathfrak{m}/ \mathfrak{m}^2.  \]


In general, however, the embedding dimension is not going to coincide with the
intuitive ``geometric'' dimension of an algebraic
variety.

\begin{example} 
Let $R = \mathbb{C}[t^2, t^3] \subset \mathbb{C}[t]$, which is the coordinate
ring of a cubic curve $y^2 =x^3$ as $R \simeq \mathbb{C}[x,y]/(x^2 - y^3)$
via $x = t^3, y = t^2$. Let us localize at the prime ideal $\mathfrak{p} = (t^2,
t^3)$: we get $R_{\mathfrak{p}}$. 

Now $\spec R$ is singular at the origin. In fact, as a result, $\mathfrak{p}
R_{\mathfrak{p}} \subset R_{\mathfrak{p}}$ needs two generators, but the
variety it corresponds to is one-dimensional.
\end{example} 

So the embedding dimension is the smallest dimension into which you can embed
$R$ into a smooth space.
But for singular varieties this is not the dimension we want. 

So instead of considering simply $\mathfrak{m}/\mathfrak{m}^2$, let us
consider the \emph{sequence} of finite-dimensional vector spaces
\[ \mathfrak{m}^k/\mathfrak{m}^{k+1}.  \]
Computing these dimensions as a function of $k$ gives some invariant that describes the local
geometry of $\spec R$.

We shall eventually prove:
\begin{theorem} \label{hilbfnispolynomial}
Let $(R, \mathfrak{m})$ be a local noetherian ring. Then there exists a
polynomial
$f \in \mathbb{Q}[t]$ such that
\[ f(n) =  \ell(R/\mathfrak{m}^n) = \sum_{i=0}^{n-1} \dim
\mathfrak{m}^i/\mathfrak{m}^{i+1} \quad \forall n \gg 0.  \]

Moreover, $\deg f \leq \dim \mathfrak{m}/\mathfrak{m}^2$.
\end{theorem}


Note that this polynomial is well-defined, as any two polynomials agreeing for large $n$
coincide. Note also that $R/\mathfrak{m}^n$ is artinian so of finite length,
and that we have used the fact that the length is additive for short exact
sequences. We would have liked to write $\dim R/\mathfrak{m}^n$, but we can't,
in general, so we use the substitute of the length. 

Based on this, we define:
\begin{definition} 
The \textbf{dimension} of the local ring $R$ is the degree of the polynomial
$f$ above. For an arbitrary noetherian ring $R$, we define $\dim R =
\sup_{\mathfrak{p} \in \spec R} \dim (R_{\mathfrak{p}})$.
\end{definition} 


Let us now do a few example computations. 

\begin{example}[The affine line] \label{easydimcomputation}
\label{dimaffineline}
Consider the local ring $(R, \mathfrak{m}) = \mathbb{C}[t]_{(t)}$. Then $\mathfrak{m} = (t)$ and
$\mathfrak{m}^k/\mathfrak{m}^{k+1}$ is one-dimensional, generated by $t^k$. In
particular, the ring has dimension one. 
\end{example} 

\begin{example}[A singular curve] Consider $R = \mathbb{C}[t^2, t^3]_{(t^2, t^3)}$, the local ring of $y^2 = x^3$
at zero. Then $\mathfrak{m}^n$ is generated by $t^{2n}, t^{2n+1}, \dots$.
$\mathfrak{m}^{n+1}$ is generated by $t^{2n+2}, t^{2n+3}, \dots$. So the
quotients all have dimension two. The dimension of these quotients is a little
larger than in \rref{easydimcomputation}, but they do not grow. The ring still has dimension one. 
\end{example} 

\begin{example}[The affine plane] \label{dimaffineplane}
Consider $R = \mathbb{C}[x,y]_{(x,y)}$. Then $\mathfrak{m}^k$ is generated by
polynomials in $x,y$ that are homogeneous in degree $k$. So $\mathfrak{m}^k/\mathfrak{m}^{k+1}$
has dimensions that \emph{grow} linearly in $k$. This is a genuinely two-dimensional
example. 
\end{example} 

It is this difference between constant linear and quadratic growth in
$R/\mathfrak{m}^n$ as $n \to \infty$, and not the size of the initial terms,
that we want for our definition of dimension.

Let us now generalize \rref{dimaffineline} and \rref{dimaffineplane}
above to affine spaces of arbitrary dimension. 
\begin{example}[Affine space] 
Consider $R = \mathbb{C}[x_1, \dots, x_n]_{(x_1, \dots, x_n)}$. 
This represents the variety $\mathbb{C}^n = \mathbb{A}^n_{\mathbb{C}}$ near the origin geometrically, so
it should intuitively have dimension $n$. Let us check that it does. 

Namely, we need to compute the polynomial $f$ above. Here $R/\mathfrak{m}^k$ looks like the set of
polynomials of degree $<k$ over $\mathbb{C}$. The dimension as a vector space
of this is
given by some binomial coefficient $\binom{n+k-1}{n}$. This is a polynomial in
$k$ of degree $n$. In particular, $\ell(R/\mathfrak{m}^k)$ grows like $k^n$.
So $R$ is $n$-dimensional. 
\end{example} 


Finally, we offer one more example, showing that DVRs have dimension one. In
fact, among noetherian integrally closed local domains, DVRs are
\emph{characterized} by this property (\rref{} of \rref{}).

\begin{example}[The dimension of a DVR]
Let $R$ be a DVR. Then $\mathfrak{m}^k/\mathfrak{m}^{k+1}$ is of length one for
each $k$. So $R/\mathfrak{m}^k$ has length $k$. Thus we can take $f(t) = t$, so
$R$ has dimension one.
\end{example} 

\subsection{The Hilbert function is a polynomial} 

While we have given a definition of dimension and computed various examples,
we have yet to check that our definition is well-defined. 
Namely, we have to prove \rref{hilbfnispolynomial}.

\begin{proof}[Proof of  \rref{hilbfnispolynomial}]
Fix a noetherian local ring $(R, \mathfrak{m})$. We are to show that
$\ell(R/\mathfrak{m}^n)$ is a polynomial for $n \gg 0$. We also have to bound
this degree by $\dim_{R/\mathfrak{m}} \mathfrak{m}/\mathfrak{m}^2$, the
embedding dimension. We will do this by reducing to a general fact about
graded modules over a polynomial ring.

Let $S = \bigoplus_n  \mathfrak{m}^n/\mathfrak{m}^{n+1}$. Then $S$ has a
natural grading, and in fact it is a graded ring in a natural way from the
multiplication map 
\[ \mathfrak{m}^{n_1} \times \mathfrak{m}^{n_2} \to \mathfrak{m}^{n_1 + n_2}.  \]
In fact, $S$ is the \emph{associated graded ring} of the $\mathfrak{m}$-adic filtration.
Note that $S_0 = R/\mathfrak{m}$ is a field, which we will denote by  $k$.
So $S$ is a graded $k$-algebra.

\begin{lemma} 
$S$ is a finitely generated $k$-algebra. In fact, $S$ can be generated by at
most $\emdim(R)$ elements.
\end{lemma} 
\begin{proof} 
Let $x_1, \dots, x_r$ be generators for $\mathfrak{m} $ with $r = \emdim(R)$.
They  (or rather, their images) are thus a $k$-basis
for $\mathfrak{m}/\mathfrak{m}^2$.
Then their images in $\mathfrak{m}/\mathfrak{m}^2 \subset S$ generate $S$.
This follows because $S_1$ generates $S$ as an $S_0$-algebra: the products of
the elements in $\mathfrak{m}$ generate the higher powers of $\mathfrak{m}$.
\end{proof} 

So $S$ is a graded quotient of the polynomial ring $k[t_1, \dots, t_r]$, with
$t_i $ mapping to $x_i$. In particular, $S$ is a finitely generated, graded $k[t_1,
\dots, t_r]$-module.
Note that also $\ell(R/\mathfrak{m}^n)  = \dim_{k}(S_0) + \dots +
\dim_{k}(S_{n-1})$ for any $n$, thanks to the filtration. This is the
invariant we are interested in.

It will now suffice to prove the following more general proposition.
\begin{proposition} \label{hilbfngeneral}
Let $M$ be any finitely generated graded module over the polynomial ring
$k[x_1, \dots, x_r]$. Then
there exists a polynomial $f_M^+ \in \mathbb{Q}[t]$ of degree $ \leq r$, such that
\[ f_M^+(t) = \sum_{s \leq t} \dim M_s \quad t \gg 0.   \]
\end{proposition} 
Applying this to $M = S$ will give the desired result. We can forget about
everything else, and look at this problem over graded polynomial rings.

This function is called the \textbf{Hilbert function}.

\begin{proof}[Proof of \rref{hilbfngeneral}]
Note that if we have an exact sequence of graded modules over the polynomial
ring,
\[ 0 \to M' \to M \to M'' \to 0,   \]
and polynomials $f_{M'}, f_{M''}$ as in the proposition, then $f_M$ exists and 
\[ f_M = f_{M'} + f_{M''}.  \] This is obvious from the definitions.
Next, we observe that if $M$ is a finitely generated graded module, over two
different polynomial rings, but with the same grading, then the existence (and
value) of $f_M$ is independent of which polynomial ring one considers.
Finally, we observe that it is sufficient to prove that $f_M(t) = \dim M_t$ is a
polynomial in $t$ for $t \gg 0$.

We will
use these three observations and induct on $n$.

If $n  = 0$, then $M$ is a finite-dimensional graded vector space over
$k$, and the grading must be concentrated in finitely many degrees. Thus
the result is evident as $f_{M}(t)$ will just equal $\dim M$ (which will be the
appropriate dimension for $t \gg 0$). 

Suppose $n > 0$.  Then
consider the filtration of $M$
\[ 0 \subset \ker( x_1: M \to M) \subset \ker (x_1^2: M \to M) \subset \dots
\subset M.  \]
This must stabilize by noetherianness at some $M' \subset M$. Each of the
quotients $\ker( x_1^i)/\ker (x_1^{i+1})$ is a finitely generated module over
$k[x_1, \dots,
x_n]/(x_1)$, which is a smaller polynomial ring.  So each of these quotients
$\ker (x_1^{i+1})/\ker (x_1^{i})$ has a Hilbert function of degree $\leq n-1$ by
the inductive hypothesis. 

Climbing up the filtration, we see that  $M'$ has a Hilbert function which is the sum of the Hilbert functions of
these quotients $\ker(x_1^{i+1})/\ker(x_1^{i})$. In particular, $f_{M'}$ exists. If we show that $f_{M/M'}$
exists, then $f_M$ necessarily exists. So we might as well show that the
Hilbert function $f_M$ exists when $x_1$ is  a non-zerodivisor on $M$. 

So, we have reduced to the case where $M \stackrel{x_1}{\to} M$
is injective.
Now $M$ has a filtration
\[ M \supset x_1 M \supset x_1^2 M \supset \dots  \]
which is an exhaustive filtration of $M$ in that nothing can be divisible by
powers of $x_1$ over and over, or the degree would not be finite. So it
follows that  $\bigcap x_1^m M = 0$. 

Let $N = M/x_1 M $, which is isomorphic to $ x_1^m M/x_1^{m+1} M$ since $M \stackrel{x_1}{\to} M$ is
injective. Here $N$ is a finitely generated graded module over $k[x_2, \dots, x_n]$, and by the
inductive hypothesis on $n$, we see that there is a polynomial $f_N^+$ of degree $\leq n-1$ such that
\[ f_N^+(t) = \sum_{t' \leq t} \dim N_{t'}, \quad t \gg 0.  \]

Fix $t \gg 0$ and consider the $k$-vector space $M_t$, which has a finite filtration 
\[ M_t \supset (x_1 M)_t \supset (x_1^2 M)_t \supset \dots  \]
which has successive quotients that are the  graded pieces of $N \simeq
M/x_1 M \simeq x_1 M/x_1^2 M \simeq \dots$ in dimensions $t, t-1, \dots$. We
find that
\[ (x_1^2 M)_t/(x_1^3 M)_t \simeq N_{t-2},  \]
for instance. Summing this, we find that
\[ \dim M_t = \dim N_t + \dim N_{t-1} + \dots . \]
The sum above is actually finite. In fact, by finite generation, there is $K
\gg 0 $ such that $\dim N_q  = 0$ for $q< -K$. From this, we find that 
\[ \dim M_t = \sum_{t' = -K}^{t} \dim N_{t'},  \]
which implies that $\dim M_t$ is a polynomial for $t \gg 0$. This completes
the proof.
\end{proof} 
\end{proof}


Let $(R, \mathfrak{m})$ a noetherian local ring and $M$ a finitely generated
$R$-module. 
\begin{proposition} \label{hilbertlocalring} 
$\ell(M/\mathfrak{m}^m M)$ is a polynomial for $m \gg 0$. 
\end{proposition} 
\begin{proof} 
This follows from \rref{hilbfngeneral}, and in fact we have
essentially seen the argument above. Indeed, we consider the
associated graded module
\[ N = \bigoplus \mathfrak{m}^k M/\mathfrak{m}^{k+1}M , \]
which is finitely generated over the associated graded ring
\[ \bigoplus \mathfrak{m}^k/\mathfrak{m}^{k+1}.  \]
Consequently, the graded pieces of $N$ have dimensions growing polynomially
for large degrees. This implies the result. 

\end{proof} 
\begin{definition} 
We define the \textbf{Hilbert function} $H_M(m)$  to be the unique polynomial
such that 
\[ H_M(m) = \ell(M/ \mathfrak{m}^m M), \quad m \gg 0.  \]
\end{definition} 

It is clear, incidentally, that $H_M$ is integer-valued, so we see by
\rref{integervalued} that $H_M$ is a $\mathbb{Z}$-linear
combination of binomial coefficients.

\subsection{The dimension of a module}
Let $R $ be a local noetherian ring with maximal ideal $\mathfrak{m}$. We
have seen (\rref{hilbertlocalring}) that  there is a polynomial $H(t)$ with
\[ H(t) = \ell(R/\mathfrak{m}^t), \quad t \gg 0.  \]
Earlier, we defined the \textbf{dimension} of $R$ is the degree of $f_M^+$. 
Since the degree of the Hilbert function is at most the number of generators
of the polynomial ring, we saw that 
\[ \dim R \leq \emdim R.  \]

Armed with the machinery of the Hilbert function, we can extend this
definition to modules.
\begin{definition} 
If $R$ is local noetherian, and $N$ a finite $R$-module, then $N$ has a
Hilbert polynomial $H_N(t)$ which when evaluated at $t \gg 0$ gives
the length $\ell(N/\mathfrak{m}^t N)$.
We say that the \textbf{dimension of
$N$} is the degree of this Hilbert polynomial.
\end{definition} 

Clearly, the dimension of the \emph{ring} $R$ is the same thing as that of the
\emph{module} $R$.

We next show that the dimension behaves well with respect to short exact
sequences. This is actually slightly subtle since, in general, tensoring with
$R/\mathfrak{m}^t$ is not exact; it turns out to be \emph{close} to being
exact by the Artin-Rees lemma. 
On the other hand, the corresponding fact for modules over a \emph{polynomial
ring} is very easy, as 
no tensoring was involved in the definition.

\begin{proposition} 
Suppose we have an exact sequence
\[ 0 \to M' \to M \to M'' \to 0 \]
of graded modules over a polynomial ring $k[x_1, \dots, x_n]$.	Then
\[ f_M(t) = f_{M'}(t) + f_{M''}(t), \quad  f_M^+(t) = f_{M'}^+(t) +
f_{M''}^+(t). \]
As a result, $\deg f_M = \max \deg f_{M'}, \deg f_{M''}$.
\end{proposition} 
\begin{proof} The first part is obvious as the dimension is additive on vector
spaces. The second part follows because Hilbert functions have nonnegative
leading coefficients.
\end{proof} 

\begin{proposition} \label{dimexactseq}
Fix an exact sequence
\[ 0 \to N' \to N \to N'' \to 0  \]
of finite $R$-modules. Then $\dim N = \max (\dim N', \dim N'')$.
\end{proposition} 
\begin{proof} 
We have an exact sequence
\[ 0 \to K \to N/\mathfrak{m}^t N \to N''/\mathfrak{m}^t N'' \to 0  \]
where $K$ is the kernel. Here $K = (N' + \mathfrak{m}^t N)/ \mathfrak{m}^t N
= N'/( N' \cap \mathfrak{m}^t N)$. This is not quite $N'/\mathfrak{m}^t N'$,
but it's pretty close. 
We have a surjection
\[ N'/\mathfrak{m}^t N \twoheadrightarrow N'/(N' \cap \mathfrak{m}^t N) = K. \]
In particular, 
\[ \ell(K) \leq \ell(N'/\mathfrak{m}^t N').  \]
On the other hand, we have the Artin-Rees lemma, which gives an inequality in
the opposite direction. We have a containment
\[ \mathfrak{m}^t N' \subset N' \cap \mathfrak{m}^t N \subset
\mathfrak{m}^{t-c} N'  \]
for some $c$. This implies that $\ell(K) \geq \ell( N'/\mathfrak{m}^{t-c} N')$. 

Define $M = \bigoplus \mathfrak{m}^t N/\mathfrak{m}^{t+1} N$, and define $M',
M''$ similarly in terms of $N', N''$. Then we have seen that 
\[ \boxed{f_M^+(t-c) \leq \ell(K) \leq f_M^+(t).}  \]
We also know that the length of $K$ plus the length of $N''/\mathfrak{m}^t N''$
is $f_M^+(t)$, i.e.
\[ \ell(K) + f_{M''}^+(t) = f_M^+(t).  \]
Now the length of $K$ is a polynomial in $t$ which is pretty similar to
$f_{M'}^+$, in that the leading coefficient is the same. So we have an
approximate equality $f_{M'}^+(t) + f_{M''}^+(t) \simeq f_M^+(t)$. This implies the
result since the degree of $f_M^+$ is $\dim N$ (and similarly for the others). 
\end{proof} 



\begin{proposition} 
$\dim R$ is the same as $\dim R/\rad R$.
\end{proposition} 
I.e., the dimension doesn't change when you kill off nilpotent elements, which
is what you would expect, as nilpotents don't affect $\spec (R)$.
\begin{proof} 
For this, we need a little more information about Hilbert functions.
We thus digress substantially. 


Finally, let us return to the claim about dimension and nilpotents. Let $R$ be
a local noetherian ring and $I = \rad (R)$. Then $I$ is a finite $R$-module. In
particular, $I$ is nilpotent, so $I^n  = 0$ for $n \gg 0$. We will show that
\[ \dim R/I = \dim R/I^2 = \dots \]
which will imply the result, as eventually the powers become zero. 

In particular, we have to show for each $k$, 
\[ \dim R/I^k  = \dim R/I^{k+1}.  \]
There is an exact sequence
\[ 0 \to I^k/I^{k+1} \to R/I^{k+1} \to R/I^k \to 0.  \]
The dimension of these rings is the same thing as the dimensions as
$R$-modules. So we can use this short exact sequence of modules. By the
previous result, we are reduced to showing that
\[ \dim I^k/I^{k+1} \leq \dim R/I^k.  \]
Well, note that $I$ kills $I^k/I^{k+1}$. In particular, $I^k/I^{k+1}$ is a finitely generated
$R/I^k$-module. There is an exact sequence
\[ \bigoplus_N R/I^k \to I^k/I^{k+1} \to 0  \]
which implies that $\dim I^k/I^{k+1} \leq \dim \bigoplus_N R/I^k = \dim R/I^k$.
\end{proof} 

\begin{example} 
Let $\mathfrak{p} \subset \mathbb{C}[x_1, \dots, x_n]$ and let $R =
(\mathbb{C}[x_1,\dots, x_n]/\mathfrak{p})_{\mathfrak{m}}$ for some maximal
ideal $\mathfrak{m}$. What is $\dim R$? 
What does dimension mean for coordinate rings over $\mathbb{C}$?

Recall by the Noether normalization theorem that there exists a polynomial ring
$\mathbb{C}[y_1, \dots, y_m]$ contained in $S=\mathbb{C}[x_1,\dots,
x_n]/\mathfrak{p}$ and $S$ is a finite integral extension over this polynomial ring. 
We claim that 
\[ \dim R = m.  \]
There is not sufficient time for that today. 
\end{example} 

\subsection{Dimension depends only on the support}

Let $(R, \mathfrak{m})$ be a local noetherian ring. Let $M$ be a finitely generated
$R$-module. 	We defined the \textbf{Hilbert polynomial} of $M$ to be the
polynomial which evaluates at $t \gg 0$ to $\ell(M/\mathfrak{m}^tM)$. We proved
last time that such a polynomial always exists, and called its degree the
\textbf{dimension of $M$}. However, 
we shall now see that $\dim M$ really depends only on the support\footnote{
Recall that $\supp M = \left\{\mathfrak{p}: M_{\mathfrak{p}}\neq 0\right\}$.} $\supp M$.
In this sense, the dimension is really a statement about the \emph{topological
space} $\supp M \subset \spec R$, not about $M$ itself. 


In other words, we will prove:
\begin{proposition} 
$\dim M$ depends only on $\supp M$.
\end{proposition} 

In fact, we shall show:

\begin{proposition} 
$\dim M = \max_{\mathfrak{p} \in \supp M} \dim R/\mathfrak{p}$.
\end{proposition} 
\begin{proof} 
By \rref{filtrationlemma} in \rref{noetherian}, there is a finite filtration 
\[ 0 = M_0 \subset M_1 \subset \dots \subset M_m = M,  \]
such that each of the successive quotients is isomorphic to $R/\mathfrak{p}_i
\subset R$
for some prime ideal $\mathfrak{p}_i$. Given a short exact sequence
of modules, we know that the dimension in the middle is the maximum of the dimensions at the
two ends (\rref{dimexactseq}). Iterating this, we see that the
dimension of $M$ is the maximum of the
dimension of the successive quotients $M_i/M_{i-1}$.

But the $\mathfrak{p}_i$'s that occur
are all in $\supp M$, so we find 
\[ \dim M = \max_{\mathfrak{p}_i} R/\mathfrak{p}_i \leq \max_{\mathfrak{p} \in \supp M} \dim R/\mathfrak{p}.  \]
We must show the reverse inequality. But fix any prime $\mathfrak{p} \in \supp
M$. Then $M_{\mathfrak{p}} \neq 0$, so one of the $R/\mathfrak{p}_i$ localized
at  $\mathfrak{p}$ must be nonzero, as localization is an exact functor. Thus
$\mathfrak{p}$ must contain some $\mathfrak{p}_i$. So $R/\mathfrak{p}$ is a
quotient of $R/\mathfrak{p}_i$. In particular,
\[ \dim R/\mathfrak{p} \leq \dim R/\mathfrak{p}_i.  \]
\end{proof} 

Having proved this, we throw out the notation $\dim M$, and henceforth write
instead $\dim \supp M$.



%% N. B. This following material on affine rings should be added in 
\begin{comment}
\subsection{The dimension of an affine ring} Last time, we made a claim. If $R$
is a domain and a finite module over a polynomial ring $k[x_1, \dots, x_n]$,
then $R_{\mathfrak{m}}$ for any maximal $\mathfrak{m} \subset R$ has dimension
$n$. This connects the dimension with the transcendence degree. 

First, let us talk about finite extensions of rings. Let $R$ be a commutative
ring and let $R \to R'$ be a morphism that makes $R'$ a finitely generated $R$-module (in
particular, integral over $R$). Let $\mathfrak{m}' \subset R'$ be maximal. Let
$\mathfrak{m}$ be the pull-back to $R$, which is also maximal (as $R \to R'$ is
integral). 
Let $M$ be a finitely generated $R'$-module, hence also a finitely generated $R$-module. 

We can look at $M_{\mathfrak{m}}$ as an $R_{\mathfrak{m}}$-module or
$M_{\mathfrak{m}'}$ as an $R'_{\mathfrak{m}'}$-module. Either of these will be
finitely generated. 

\begin{proposition} 
$\dim \supp M_{\mathfrak{m}}  \geq \dim \supp M_{\mathfrak{m}'}$.
\end{proposition} 
Here $M_{\mathfrak{m}}$ is an $R_{\mathfrak{m}}$-module, $M_{\mathfrak{m}'}$ is
an $R'_{\mathfrak{m}'}$-module. 

\begin{proof} 
Consider $R/\mathfrak{m} \to R'/\mathfrak{m} R' \to R'/\mathfrak{m}'$. Then we
see that $R'/\mathfrak{m} R'$ is a finite $R/\mathfrak{m}$-module, so a
finite-dimensional $R/\mathfrak{m}$-vector space. In particular,
$R'/\mathfrak{m} R'$ is of finite length as an $R/\mathfrak{m}$-module, in
particular an artinian ring. It is thus a product of local artinian rings.
These artinian rings are the localizations of $R'/\mathfrak{m}R'$ at ideals of
$R'$ lying over $\mathfrak{m}$. One of these ideals is $\mathfrak{m}'$. 
So in particular
\[ R'/\mathfrak{m}R \simeq R'/\mathfrak{m}'\times \mathrm{other \ factors}.  \]
The nilradical of an artinian ring being nilpotent, we see that
$\mathfrak{m}'^c R'_{\mathfrak{m}'} \subset \mathfrak{m} R'_{\mathfrak{m}}$ for
some $c$.

OK, I'm not following this---too tired. Will pick this up someday.
\end{proof} 


\begin{proposition} 
$\dim \supp M_{\mathfrak{m}} = \max_{\mathfrak{m}' \mid \mathfrak{m}} \dim
\supp M_{\mathfrak{m}'}$.
\end{proposition} 

This means $\mathfrak{m}'$ lies over $\mathfrak{m}$.
\begin{proof} 
Done similarly, using artinian techniques. I'm kind of tired.
\end{proof} 
\end{comment}
\begin{example} 
Let $R' = \mathbb{C}[x_1, \dots, x_n]/\mathfrak{p}$. Noether normalization says
that there exists a finite injective map $\mathbb{C}[y_1, \dots, y_a] \to R'$.
The claim is that
\[ \dim R'_{\mathfrak{m}} =a  \]
for any maximal ideal $\mathfrak{m} \subset R'$. We are set up to prove a
slightly weaker definition. In particular (see below for the definition of the
dimension of a non-local ring), by the proposition, we
find the weaker claim
\[ \dim R' = a,  \]
as the dimension of a polynomial ring $\mathbb{C}[y_1, \dots, y_a]$ is $a$.
(\textbf{I don't think we have proved this yet.})
\end{example} 



\section{Other definitions and characterizations of dimension}

\subsection{The topological characterization of dimension} We now want a topological
characterization of dimension. So, first, we want to study how dimension
changes as we do things to a module. Let $M$ be a finitely generated $R$-module over a local
noetherian ring $R$. Let $x \in \mathfrak{m}$ for $\mathfrak{m}$ as the maximal
ideal.
You might ask
\begin{quote}
What is the relation between $\dim \supp M$ and $\dim \supp M/xM$?
\end{quote}
Well, $M$ surjects onto $M/xM$, so we have the inequality $\geq$. But we think
of dimension as describing the number of parameters you need to describe
something. The number of parameters shouldn't change too much with going from
$M$ to $M/xM$. Indeed, as one can check,
\[ \supp M/xM = \supp M \cap V(x)  \]
and intersecting $\supp M$ with the ``hypersurface'' $V(x)$ should shrink the
dimension by one. 


We thus make:
\begin{prediction}
\[ \dim \supp M/xM = \dim \supp M - 1.  \]
\end{prediction}
Obviously this is not always true, e.g. if $x$ acts by zero on $M$. But we want
to rule that out. 
Under reasonable cases, in fact, the prediction is correct:

\begin{proposition} \label{dimdropsbyone}
Suppose $x \in \mathfrak{m}$ is a nonzerodivisor on $M$. Then 
\[ \dim \supp M/xM = \dim \supp M - 1.  \]
\end{proposition} 
\begin{proof} 
To see this, we look at Hilbert polynomials. Let us consider the exact sequence
\[ 0 \to xM \to M \to M/xM \to 0  \]
which leads to an exact sequence for each $t$,
\[ 0 \to xM/(xM \cap \mathfrak{m}^t M) \to M/\mathfrak{m}^t M \to M/(xM  +
\mathfrak{m}^t M) \to 0 . \]
For $t$ large, the lengths of these things are given by Hilbert polynomials,
as the thing on the right is $M/xM \otimes_R R/\mathfrak{m}^t$. 
We have
\[ f_M^+(t) = f_{M/xM}^+(t) + \ell(xM/ (x M \cap \mathfrak{m}^t M), \quad t
\gg 0.  \]
In particular, $\ell( xM/ (xM \cap \mathfrak{m}^t M))$ is a polynomial in $t$.
What can we say about it? Well, $xM \simeq M$ as $x$ is a nonzerodivisor. In
particular
\[ xM / (xM \cap \mathfrak{m}^t M) \simeq M/N_t  \]
where
\[ N_t = \left\{a \in M: xa \in \mathfrak{m}^t M\right\} . \]
In particular, $N_t \supset \mathfrak{m}^{t-1} M$. This tells us that
$\ell(M/N_t) \leq \ell(M/\mathfrak{m}^{t-1} M) = f_M^+(t-1)$ for $t \gg 0$.
Combining this with the above information, we learn that
\[ f_M^+(t) \leq f_{M/xM}^+(t) + f_M^+(t-1),   \]
which implies that $f_{M/xM}^+(t)$ is at least the successive difference
$f_M^+(t) - f_M^+(t-1)$. This last polynomial has degree $\dim \supp M -1$. In
particular, $f_{M/xM}^+(t)$ has degree at least $\dim \supp M -1 $. This gives
us one direction, actually the hard one. We showed that intersecting something with codimension one
doesn't drive the dimension down too much. 

Let us now do the other direction. We essentially did this last time via the
Artin-Rees lemma. We know that $N_t = \left\{a \in M: xa \in
\mathfrak{m}^t\right\}$. The Artin-Rees lemma tells us that there is a constant
$c$ such that $N_{t+c} \subset \mathfrak{m}^t M$ for all $t$. Therefore,
$\ell(M/N_{t+c}) \geq \ell(M/\mathfrak{m}^t M) = f_M^+(t), t \gg 0$. Now
remember the exact sequence $0 \to M/N_t \to M/\mathfrak{m}^t M \to M/(xM +
\mathfrak{m}^t M) \to 0$. We see from this that
\[ \ell(M/ \mathfrak{m}^t M) = \ell(M/N_t) + f_{M/xM}^+(t) \geq f_M^+(t-c) +
f_{M/xM}^+(t), \quad t \gg 0,  \]
which implies that
\[ f_{M/xM}^+(t) \leq f_M^+(t) - f_M^+(t-c),  \]
so the degree must go down. And we find that $\deg f_{M/xM}^+ < \deg f_{M}^+$.
\end{proof} 

This gives us an algorithm of computing the dimension of an $R$-module $M$. 
First, it reduces to computing $\dim R/\mathfrak{p}$ for $\mathfrak{p} \subset
R$ a prime ideal. We may assume that $R$ is a domain and that we are looking
for $\dim R$. Geometrically, this
corresponds to taking an irreducible component of $\spec R$.

Now choose any $x
\in R$ such that $x$ is nonzero but noninvertible. If there is no such element,
then $R$ is a field and has dimension zero. Then compute $\dim R/x$
(recursively) and add one.

Notice that this algorithm said nothing about Hilbert polynomials, and only
talked about the structure of prime ideals.

\subsection{Recap}
Last time, we were talking about dimension theory. 
Recall that $R$ is a local noetherian ring with maximal ideal $\mathfrak{m}$,
$M$ a finitely generated $R$-module. We can look at the lengths $\ell(M/\mathfrak{m}^t M)$
for varying $t$; for $t \gg 0$ this is a polynomial function. The degree of
this polynomial is called the \textbf{dimension} of $\supp M$. 

\begin{remark} 
If $M = 0$, then we define $\dim \supp M = -1$ by convention.
\end{remark} 

Last time, we showed that if $M \neq 0$ and $x \in \mathfrak{m}$ such that $x$
is a nonzerodivisor on $M$ (i.e. $M \stackrel{x}{\to} M$ injective), then 
\[ \boxed{ \dim \supp M/xM = \dim \supp M - 1.}\]
Using this, we could give a recursion for calculating the dimension. 
To compute $\dim R = \dim \spec R$, we note three properties:
\begin{enumerate}
\item $\dim R = \sup_{\mathfrak{p} \ \mathrm{a \ minimal \ prime}}
R/\mathfrak{p}$. Intuitively, this says that a variety which is the union of
irreducible components has dimension equal to the maximum of these irreducibles.
\item $\dim R = 0$ for $R$  a field. This is obvious from the definitions.
\item If $R$ is a domain, and $x \in \mathfrak{m} - \left\{0\right\}$, then
$\dim R/(x) +1 = \dim R $. This is obvious from the boxed formula as $x$ is a nonzerodivisor.
\end{enumerate}

These three properties \emph{uniquely characterize} the dimension invariant. 

\textbf{More precisely, if
$d: \left\{\mathrm{local \ noetherian \ rings}\right\} \to \mathbb{Z}_{\geq 0}$
satisfies the above three properties, then $d = \dim $. }
\begin{proof} 
Induction on $\dim R$. It is clearly sufficient to prove this for $R$ a domain. 
If $R$ is a field, then it's clear; if $\dim R>0$, the third condition lets us
reduce to a case covered by the inductive hypothesis (i.e. go down).
\end{proof} 

Let us rephrase 3 above:
\begin{quote}
3': If $R$ is a domain and not a field, then 
\[ \dim R = \sup_{x \in \mathfrak{m} - 0} \dim R/(x) + 1. \]
\end{quote}
Obviously 3' implies 3, and it is clear by the same argument that 1,2, 3'
characterize the notion of dimension.

\subsection{Krull dimension} We shall now define another notion of
dimension, and show that it is equivalent to the older one by showing that it
satisfies these axioms.

\begin{definition} 
Let $R$ be a commutative ring. A \textbf{chain of prime ideals} in $R$ is a finite
sequence
\[ \mathfrak{p}_0 \subsetneq \mathfrak{p}_1 \subsetneq \dots \subsetneq
\mathfrak{p}_n.  \]
This chain is said to have \textbf{length $n$.}
\end{definition} 

\begin{definition} 
The \textbf{Krull dimension} of $R$ is equal to the maximum length of any chain
of prime ideals. This might be $\infty$, but we will soon see this cannot
happen for $R$ local and noetherian.
\end{definition} 

\begin{remark} 
For any maximal chain $\left\{\mathfrak{p}_i, 0 \leq i \leq n\right\}$ of primes (i.e. which can't be expanded), we must have
that $\mathfrak{p}_0$ is minimal prime and $\mathfrak{p}_n$ a maximal ideal.
\end{remark} 

\begin{theorem} 
For a noetherian local ring $R$, the Krull dimension of $R$ exists and is equal
to the usual $\dim R$.
\end{theorem}
\begin{proof} 
We will show that the Krull dimension satisfies the above axioms. For now,
write $\krdim$ for Krull dimension.

\begin{enumerate}
\item First, note that $\krdim(R) = \max_{\mathfrak{p} \in R \
\mathrm{minimal}}  \krdim(R/\mathfrak{p})$. This is because any chain of prime
ideals in $R$ contains a minimal prime. So any chain of prime ideals in $R$ can
be viewed as a chain in \emph{some} $R/\mathfrak{p}$, and conversely.
\item Second, we need to check that $\krdim(R) = 0$ for $R$ a field. This is
obvious, as there is precisely one prime ideal.
\item The third condition is interesting. We must check that for $(R,
\mathfrak{m})$ a local
domain, 
\[ \krdim(R) = \max_{x \in \mathfrak{m} - \left\{0\right\}} \krdim(R/(x)) + 1.  \]
If we prove this, we will have shown that condition 3' is satisfied by the
Krull dimension. It will follow by the inductive argument above that $\krdim(R)
= \dim (R)$ for any $R$. 
There are two inequalities to prove. First, we must show
\[ \krdim(R) \geq \krdim(R/x) +1, \quad \forall x \in \mathfrak{m} - 0.  \]
So suppose $k = \krdim(R/x)$. We want to show that there is a chain of prime
ideals of length $k+1$ in $R$. So say $\mathfrak{p}_0 \subsetneq \dots
\subsetneq \mathfrak{p}_k$ is a chain of length $k$ in $R/(x)$. The inverse
images in $R$ give a proper chain of primes in $R$ of  length $k$, all of which
contain $(x)$ and thus properly contain $0$. Thus adding zero will give a chain
of primes in $R$ of length $k+1$. 

Conversely, we want to show that if there is a chain of primes in $R$ of
length  $k+1$, then there is a chain of length $k$ in $R/(x)$ for some $x \in
\mathfrak{m} - \left\{0\right\}$. Let us write the chain  of length $k+1$:
\[ \mathfrak{q}_{-1} \subset \mathfrak{q}_0 \subsetneq \dots \subsetneq
\mathfrak{q}_k \subset R . \]
Now evidently $\mathfrak{q}_0$ contains some $x \in \mathfrak{m} - 0$. Then the
chain $\mathfrak{q}_0 \subsetneq \dots \subsetneq \mathfrak{q}_k$ can be
identified with a chain in $R/(x)$ for this $x$. So for this $x$, we have that
$\krdim R \leq \sup \krdim R/(x) + 1$.
\end{enumerate}
\end{proof} 

There is thus a combinatorial definition of definition.

Geometrically, let $X = \spec R$ for $R$ an affine ring over $\mathbb{C}$ (a
polynomial ring mod some ideal). Then $R$ has Krull dimension $\geq k$ iff there is a
chain of irreducible subvarieties of $X$,
\[ X_0 \supset X_1 \supset \dots \supset X_k . \]
You will meet justification for this in \rref{subsectiondimension} below.

\begin{remark}[\textbf{Warning!}] Let $R$ be a local noetherian ring of dimension $k$. This
means that there is a chain of prime ideals of length $k$, and no longer
chains. Thus there is a maximal chain whose length is $k$. However, not all
maximal chains in $\spec R$ have length $k$. 
\end{remark} 

\begin{example} 
Let $R =( \mathbb{C}[X,Y,Z]/(XY,XZ))_{(X,Y,Z)}$. It is left as an
exercise to the reader to see that there are maximal chains of
length not two.

There are more complicated local noetherian \emph{domains} which have maximal
chains of prime ideals not of the same length. These examples are not what you
would encounter in daily experience, and are necessarily complicated. This
cannot happen for finitely generated domains over a field.
\end{example} 

\begin{example} 
An easier way all maximal chains could fail to be of the same length is if
$\spec R$ has two components (in which case $R = R_0 \times R_1$ for rings
$R_0, R_1$). 
\end{example} 


\subsection{Yet another definition}
Let's start by thinking about the definition of a module. Recall that if $(R,
\mathfrak{m})$ is
a local noetherian ring and $M$ a finitely generated $R$-module, and $x \in \mathfrak{m}$ is
a nonzerodivisor on $M$, then
\[ \dim \supp M/xM = \dim \supp M -1.  \]

\begin{question} 
What if $x$ is  a zerodivisor? 
\end{question} 

This is not necessarily true (e.g. if $x \in \ann(M)$). Nonetheless, we claim
that even in this case:
\begin{proposition} 
For any $x \in \mathfrak{m}$,
\[ \boxed{ \dim \supp M \geq \dim \supp M/xM \geq \dim \supp M -1 .}\]
\end{proposition} 
The upper bound on $\dim M/xM$ is obvious as $M/xM$ is a quotient of $M$. The
lower bound is trickier. 

\begin{proof} 
Let $N = \left\{a \in M: x^n a = 0 \ \mathrm{for \ some \ } n \right\}$. We can
construct an exact sequence
\[ 0 \to N \to M \to M/N \to 0.  \]
Let $M'' = M/N$.
Now $x$ is a nonzerodivisor on $M/N$ by construction. We claim that 
\[ 0 \to N/xN \to M/xM \to M''/xM'' \to 0  \]
is exact as well. For this we only need to see exactness at the beginning,
i.e. injectivity of $N/xN \to M/xM$. So
we need to show that if $a \in N$ and $a \in xM$, then $a \in x N$.

To see this, suppose $a = xb$ where $b \in M$. Then if $\phi: M \to M''$, then
$\phi(b) \in M''$ is killed by $x$ as $x \phi(b) = \phi(bx) = \phi(a)$.
This means that $\phi(b)=0$ as $M'' \stackrel{x}{\to} M''$ is injective. Thus
$b \in N$ in fact. So $a \in xN$ in fact.

From the exactness, we see that (as $x$ is a nonzerodivisor on $M''$)
\begin{align*} \dim M/xM & = \max (\dim M''/xM'', \dim N/xN) \geq \max(\dim M'' -1, \dim
N)\\ &  \geq \max( \dim M'', \dim N)-1  .  \end{align*}
The reason for the last claim is that $\supp N/xN = \supp N$ as $N$ is
$x$-torsion, and the dimension depends only on the support. But the thing on the right is just $\dim M -1$. 
\end{proof} 

As a result, we find:

\begin{proposition} 
$\dim \supp M$ is the minimal integer $n$ such that there exist elements $x_1,
\dots, x_n \in \mathfrak{m}$ with $M/(x_1 , \dots, x_n) M$ has finite length. 
\end{proposition} 
Note that $n$ always exists, since we can look at a bunch of generators of the
maximal ideal, and $M/\mathfrak{m}M $ is a finite-dimensional vector space and
is thus of finite length.
\begin{proof} 
Induction on $\dim \supp M$. Note that $\dim \supp(M)=0$ if and only if the
Hilbert polynomial has degree zero, i.e. $M$ has finite length or that $n=0$
($n$ being defined as in the statement). 

Suppose $\dim \supp M > 0$. \begin{enumerate}
\item  We first show that there are $x_1, \dots, x_{\dim M}$
with $M/(x_1, \dots, x_{\dim M})M$ have finite length. 
Let $M' \subset M$ be the maximal submodule having finite length. There
is an exact sequence
\[ 0 \to M' \to M \to M'' \to 0  \]
where $M'' = M/M'$ has no finite length submodules. In this case, we can
basically ignore $M'$, and replace $M$ by $M''$. The reason is that modding out
by $M'$ doesn't affect either $n$ or the dimension. 

So let us replace $M$ with
$M''$ and thereby assume that $M$ has no finite length submodules. In
particular, $M$ does not contain a copy of $R/\mathfrak{m}$, i.e. $\mathfrak{m}
\notin \ass(M)$. 
By prime avoidance, this means that there is $x_1 \in \mathfrak{m}$ that acts as
a nonzerodivisor on $M$. Thus
\[ \dim M/x_1M = \dim M -1.  \]
The inductive hypothesis says that there are $x_2, \dots, x_{\dim M}$ with
$$(M/x_1 M)/(x_2, \dots, x_{\dim M}) (M/xM) \simeq M/(x_1, \dots, x_{\dim M})M $$
of finite length. This shows the claim.
\item Conversely, suppose that there $M/(x_1, \dots, x_n)M$ has finite length.
Then we claim that $n \geq \dim M$. This follows because we had the previous
result that modding out by a single element can chop off the dimension by at
most $1$. Recursively applying this, and using the fact that $\dim$ of a
finite length module is zero, we find
\[ 0 = \dim M/(x_1 , \dots, x_n )M \geq \dim M -n. \]
\end{enumerate}
\end{proof} 


\begin{corollary} 
Let $(R, \mathfrak{m})$ be a local noetherian ring. Then $\dim R$ is equal to the minimal $n$
such that there exist $x_1, \dots, x_n \in R$ with $R/(x_1, \dots, x_n) R$ is
artinian. Or, equivalently, such that $(x_1, \dots, x_n)$ contains a power of
$\mathfrak{m}$.
\end{corollary}


\begin{remark} 
We manifestly have here that the dimension of $R$ is at most the embedding
dimension. Here, we're not worried about generating the maximal ideal, but
simply something containing a power of it.
\end{remark} 
\lecture{11/5}

We have been talking about dimension. Let $R$ be a local noetherian ring with
maximal ideal $\mathfrak{m}$. Then, as we have said in previous lectures, $\dim R$ can be characterized by:
\begin{enumerate}
\item The minimal $n$ such that there is an $n$-primary ideal generated by $n$
elements $x_1, \dots, x_n \in \mathfrak{m}$. That is, the closed point
$\mathfrak{m}$ of
$\spec R$ is cut out \emph{set-theoretically} by the intersection $\bigcap
V(x_i)$. This is one way of saying that the closed point can be defined by $n$
parameters. 
\item The \emph{maximal} $n$ such that there exists a chain of prime ideals
\[ \mathfrak{p}_0 \subset \mathfrak{p}_1 \subset \dots \subset \mathfrak{p}_n. \]
\item The degree of the Hilbert polynomial $f^+(t)$, which equals
$\ell(R/\mathfrak{m}^t)$ for $t \gg 0$.
\end{enumerate}


\subsection{Krull's Hauptidealsatz}


Let $R$ be a local noetherian ring.
The following is now clear from what we have shown:

\begin{theorem} \label{hauptv1}
$R$ has dimension $1$ if and only if there is a nonzerodivisor $x \in \mathfrak{m}$ such that
$R/(x)$ is artinian.
\end{theorem} 



\begin{remark} 
Let $R$ be a domain. We said that a nonzero prime $\mathfrak{p} \subset R$ is
\textbf{height one} if $\mathfrak{p}$ is minimal among the prime ideals
containing some nonzero $x \in R$. 

According to Krull's Hauptidealsatz, $\mathfrak{p}$ has height one \textbf{if
and only if $\dim R_{\mathfrak{p}} = 1$.}
\end{remark} 


We can generalize the notion of $\mathfrak{p}$ as follows.
\begin{definition} 
Let $R$ be a noetherian ring (not necessarily local), and $\mathfrak{p} \in
\spec R$. Then we define the \textbf{height} of $\mathfrak{p}$, denoted
$\het(\mathfrak{p})$, as $\dim R_{\mathfrak{p}}$.
We know that this is the length of a maximal chain of primes in
$R_{\mathfrak{p}}$. This is thus the maximal length of prime ideals of $R$, 
\[ \mathfrak{p}_0 \subset \dots \subset \mathfrak{p}_n = \mathfrak{p}  \]
that ends in $\mathfrak{p}$. This is the origin of the term ``height.''
\end{definition} 

\begin{remark} 
Sometimes, the height is called the \textbf{codimension}. This corresponds to
the codimension in $\spec R$ of the corresponding irreducible closed subset of
$\spec R$.
\end{remark} 

\begin{theorem}[Krull's Hauptidealsatz]  Let $R$ be a noetherian ring, and $x
\in R$ a nonzerodivisor. If $\mathfrak{p} \in \spec R$ is minimal over $x$,
then $\mathfrak{p}$ has height one.
\end{theorem} 
\begin{proof} 
Immediate from \cref{hauptv1}.
\end{proof} 

\begin{theorem}[Artin-Tate]
Let $A$ be a noetherian domain. Then the following are equivalent:
\begin{enumerate}
\item There is $f \in A-\left\{0\right\} $ such that $A_f$ is a field.
\item $A$ has finitely many maximal ideals and has dimension at most 1.
\end{enumerate}
\end{theorem} 
\begin{proof} We follow \cite{EGA}.

Suppose first that there is $f$ with $A_f$ a field. 
Then all nonzero prime ideals of $A$ contain $f$. 
We need to deduce that $A$ has dimension $\leq 1$. Without loss of generality,
we may assume that $A$ is not a field.

There are finitely many primes $\mathfrak{p}_1,\dots, \mathfrak{p}_k$ which
are minimal over $f$; these are all height one. The claim is that any maximal ideal of $A$ is of this
form. Suppose $\mathfrak{m}$ were maximal and not one of the $\mathfrak{p}_i$.
Then by prime avoidance, there is $g \in \mathfrak{m}$ which
lies in no $\mathfrak{p}_i$. A minimal prime $\mathfrak{P}$ of $g$ has height
one, so by our assumptions contains $f$. However, it is then one of the
$\mathfrak{p}_i$; this is a contradiction as $g \in \mathfrak{P}$.
\end{proof} 


\subsection{Further remarks}

We can recast earlier notions in terms of dimension.
\begin{remark} 
A noetherian ring has dimension zero if and only if $R$ is artinian. Indeed,
$R$ has dimension zero iff all primes are maximal.
\end{remark} 


\begin{remark} 
A noetherian domain has dimension zero iff it is a field. Indeed, in this case
$(0)$ is maximal.
\end{remark} 

\begin{remark} 
$R$ has dimension $\leq 1$ if and only if every non-minimal prime of $R$ is
maximal. That is, there are no chains of length $\geq 2$.
\end{remark} 

\begin{remark} 
A (noetherian) domain  $R$ has dimension $\leq 1$ iff every nonzero prime ideal
is maximal.
\end{remark} 

In particular,
\begin{proposition} 
$R$ is Dedekind iff it is a noetherian, integrally closed domain of dimension
$1$. 
\end{proposition} 


\section{Further topics}

\subsection{Change of rings}
Let $f: R \to R'$ be  a map of noetherian rings. 

\begin{question} 
What is the relationship between $\dim R$ and $\dim R'$?
\end{question} 

A map $f$ gives a map $\spec R' \to \spec R$, where $\spec R'$ is the union
of various fibers over the points of $\spec R$. You might imagine that the
dimension is the dimension of $R$ plus the fiber dimension. This is sometimes
true.

Now assume that $R, R'$ are \emph{local}  with maximal ideals $\mathfrak{m},
\mathfrak{m}'$. Assume furthermore that $f$ is local, i.e. $f(\mathfrak{m})
\subset \mathfrak{m}'$.

\begin{theorem} 
$\dim R' \leq \dim R +  \dim R'/\mathfrak{m}R'$. Equality holds if $f: R \to
R'$ is flat.
\end{theorem} 

Here $R'/\mathfrak{m}R'$ is to be interpreted as the ``fiber'' of $\spec R'$
above $\mathfrak{m} \in \spec R$. The fibers can behave weirdly as the
basepoint varies in $\spec R$, so we can't
expect equality in general.

\begin{remark} 
Let us review flatness as it has been a while. An $R$-module $M$ is \emph{flat} iff
the operation of tensoring with $M$ is an exact functor. The map $f: R \to R'$
is \emph{flat} iff $R'$ is a flat $R$-module. Since the construction of taking
fibers is a tensor product (i.e. $R'/\mathfrak{m}R' = R' \otimes_R
R/\mathfrak{m}$), perhaps the condition of flatness here is not as surprising as
it might be.
\end{remark} 

\begin{proof} 
Let us first prove the inequality. Say $$\dim R = a,  \ \dim R'/\mathfrak{m}R'
= b.$$ We'd like to see that
\[ \dim R' \leq a+b.  \]
To do this, we need to find $a+b$ elements in the maximal ideal $\mathfrak{m}'$
that generate a $\mathfrak{m}'$-primary ideal of $R'$. 

There are elements $x_1, \dots, x_a \in \mathfrak{m}$ that generate an
$\mathfrak{m}$-primary ideal $I = (x_1, \dots, x_a)$ in $R$. There is a surjection $R'/I R'
\twoheadrightarrow R'/\mathfrak{m}R'$.
The kernel $\mathfrak{m}R'/IR'$ is nilpotent since $I$ contains a power of
$\mathfrak{m}$. 	We've seen that nilpotents \emph{don't} affect the dimension.
In particular, 
\[ \dim R'/IR' = \dim R'/\mathfrak{m}R' = b.  \]
There are thus elements $y_1, \dots, y_b \in \mathfrak{m}'/IR'$ such that the
ideal $J = (y_1, \dots, y_b) \subset R'/I R'$ is $\mathfrak{m}'/IR'$-primary.
The inverse image of $J$ in $R'$, call it $\overline{J} \subset R'$, is
$\mathfrak{m}'$-primary. However, $\overline{J}$ is generated by the $a+b$
elements
\[ f(x_1), \dots, f(x_a), \overline{y_1}, \dots, \overline{y_b}  \]
if the $\overline{y_i}$ lift $y_i$. 

But we don't always have equality. Nonetheless, if all the fibers are similar,
then we should expect that the dimension of the ``total space'' $\spec R'$ is
the dimension of the ``base'' $\spec R$ plus the ``fiber'' dimension $\spec
R'/\mathfrak{m}R'$.  
\emph{The precise condition of $f$ flat articulates the condition that the fibers
 ``behave well.'' }
Why this is so is something of a mystery, for now.
But for some evidence, take the present result about fiber dimension.

Anyway, let us now prove equality for flat $R$-algebras. As before, write $a =
\dim R, b = \dim R'/\mathfrak{m}R'$. We'd like to show that
\[ \dim R' \geq a+b.  \]
By what has been shown, this will be enough.
This is going to be tricky since we now need to give \emph{lower bounds} on the
dimension; finding a sequence $x_{1}, \dots, x_{a+b}$ such that the quotient
$R/(x_1, \dots, x_{a+b})$ is artinian would bound \emph{above} the dimension.

So our strategy will be to find a chain of primes of length $a+b$. Well, first
we know that there are primes
\[ \mathfrak{q}_0 \subset \mathfrak{q}_1 \subset \dots \subset \mathfrak{q}_b
\subset R'/\mathfrak{m}R'.  \]
Let $\overline{\mathfrak{q}_i}$ be the inverse images in $R'$. Then the
$\overline{\mathfrak{q}_i}$ are a strictly ascending chain of primes in $R'$ where
$\overline{\mathfrak{q}_0}$ contains $\mathfrak{m}R'$. So we have a chain of
length $b$; we need to extend this by additional terms.

Now $f^{-1}(\overline{\mathfrak{q}_0})$ contains $\mathfrak{m}$, hence is
$\mathfrak{m}$. Since $\dim R = a$, there is a chain
$\left\{\mathfrak{p}_i\right\}$ of prime ideals of length
$a$ going down from $f^{-1}(\overline{\mathfrak{q}_0}) = \mathfrak{m}$. We are 
now going to find primes $\mathfrak{p}_i' \subset R'$ forming a chain such that
$f^{-1}(\mathfrak{p}_i') = \mathfrak{p}_i$. In other words, we are going to
\emph{lift} the chain $\mathfrak{p}_i$ to $\spec R'$. We can do this at the
first stage for $i=a$, where $\mathfrak{p}_a = \mathfrak{m}$ and we can set
$\mathfrak{p}'_a = \overline{\mathfrak{q}_0}$. If we can indeed do this
lifting, and catenate the chains $\overline{\mathfrak{q}_j}, \mathfrak{p}'_i$,
then we will have a chain of the appropriate length.

We will proceed by descending induction. Assume that we have
$\mathfrak{p}_{i+1}' \subset R'$ and $f^{-1}(\mathfrak{p}_{i+1}') =
\mathfrak{p}_{i+1} \subset R$. We want to find $\mathfrak{p}_i' \subset
\mathfrak{p}'_{i+1}$ such that $f^{-1}(\mathfrak{p}_i') = \mathfrak{p}_i$. The
existence of that prime is a consequence of the following general fact.

\begin{theorem}[Going down] Let $f: R \to R'$ be a flat map of
noetherian commutative
rings. Suppose $\mathfrak{q} \in \spec R'$, and let $\mathfrak{p}
=f^{-1}(\mathfrak{q})$. Suppose $\mathfrak{p}_0 \subset \mathfrak{p}$ is a
prime of $R$. Then there is a prime $\mathfrak{q}_0 \subset \mathfrak{q}$ with 
\[ f^{-1}(\mathfrak{q}_0) = \mathfrak{p}_0.  \]
\end{theorem} 
\begin{proof} 
We may replace $R'$ with $R'_{\mathfrak{q}}$. There is still a map
\[ R \to R_{\mathfrak{q}}'  \]
which is flat as localization is flat. The maximal ideal in $R'_{\mathfrak{q}}$
has inverse image $\mathfrak{p}$. So the problem now reduces to finding
\emph{some} $\mathfrak{p}_0$ in the localization that pulls back appropriately.

Anyhow, throwing out the old $R$ and replacing with the localization, we may
assume that $R'$ is local and $\mathfrak{q}$ the maximal ideal. (The condition
$\mathfrak{q}_0 \subset \mathfrak{q}$ is now automatic.) 

The claim now is that we can replace $R$ with $R/\mathfrak{p}_0$ and $R'$ with
$R'/\mathfrak{p}_0 R' = R' \otimes R/\mathfrak{p}_0$. We can do this because
base change preserves flatness (see below), and in this case we can reduce to the case of
$\mathfrak{p}_0 = (0)$---in particular, $R$ is a domain. 
Taking these quotients just replaces $\spec R, \spec R'$ with closed subsets
where all the action happens anyhow.

Under these replacements, we now have:
\begin{enumerate}
\item $R'$ is local with maximal ideal $\mathfrak{q}$ 
\item $R$ is a domain and $\mathfrak{p}_0 = (0)$.
\end{enumerate}
We want a prime of $R'$ that pulls back to $(0)$ in $R$. I claim that any
minimal prime of $R'$ will work. 
Suppose otherwise. Let $\mathfrak{q}_0 \subset R'$ be a minimal prime, and
suppose $x \in R \cap f^{-1}(\mathfrak{q}_0) - \left\{0\right\}$. But
$\mathfrak{q}_0 \in \ass(R')$. So $f(x)$ is
a zerodivisor on $R'$. Thus multiplication by $x$ on $R'$ is not injective. 

But, $R$ is a domain, so $R \stackrel{x}{\to} R$ is injective. Tensoring with
$R'$ must preserve this, implying that $R' \stackrel{x}{\to} R'$ is injective
because $R'$ is flat. This is a contradiction.
\end{proof} 

We used:
\begin{lemma} 
Let $R \to R'$ be a flat map, and $S$ an $R$-algebra. Then $S \to S \otimes_R
R'$ is a flat map.
\end{lemma} 
\begin{proof} 
The construction of taking an $S$-module with $S \otimes_R R'$ is an exact
functor, because that's the same thing as taking an $S$-module, restricting to
$R$, and tensoring with $R'$.
\end{proof} 
The proof of the fiber dimension theorem is now complete.

\end{proof} 



\subsection{The dimension of a polynomial ring}

Adding an indeterminate variable corresponds geometrically to taking the
product with the affine line, and so should increase the dimension by one. We
show that this is indeed the case.
\label{dimpoly}
\begin{theorem} 
Let $R$ be a noetherian ring. Then $\dim R[X] = \dim R+1$.
\end{theorem} 

Interestingly, this is \emph{false} if $R$ is non-noetherian, cf. \cite{}.
Let $R$ be a ring of dimension $n$. 

\begin{lemma} 
$\dim R[x] \geq \dim R+1$.
\end{lemma} 
\begin{proof} 
Let $\mathfrak{p}_0 \subset \dots \subset \mathfrak{p}_n$ be a chain of primes of
length $n = \dim R$. Then $\mathfrak{p}_0 R[x] \subset \dots \subset
\mathfrak{p}_n R[x] \subset (x, \mathfrak{p}_n)R[x]$ is a chain of primes in
$R[x]$ of length $n+1$ because of the following fact: if $\mathfrak{q} \subset
R$ is prime, then so is $\mathfrak{q}R[x] \subset R[x]$.\footnote{This is
because $R[x]/\mathfrak{q}R[x] = (R/\mathfrak{q})[x]$ is a domain.} Note also
that as $\mathfrak{p}_n \subsetneq R$, we have that $\mathfrak{p}_n R[x]
\subsetneq (x, \mathfrak{p}_n)$. So this is indeed a legitimate chain. 
\end{proof} 

Now we need only show:
\begin{lemma} 
Let $R$ be noetherian of dimension $n$. Then $\dim R[x] \leq \dim R+1$.
\end{lemma} 
\begin{proof} 
Let $\mathfrak{q}_0 \subset \dots \subset \mathfrak{q}_m \subset R[x]$ be a chain of primes
in $R[x]$. Let $\mathfrak{m} = \mathfrak{q}_m \cap R$. Then if we localize and
replace $R$ with $R_{\mathfrak{m}}$, we get a chain of primes of length $m$ in
$R_{\mathfrak{m}}[x]$. 
In fact, we get more. We get a chain of primes of length $m$ in
$(R[x])_{\mathfrak{q}_m}$, and a \emph{local } inclusion of noetherian local rings
\[ R_{\mathfrak{m}} \hookrightarrow (R[x])_{\mathfrak{q}_m} . \]
To this we can apply the fiber dimension theorem. In particular, this implies
that
\[ m \leq \dim (R[x])_{\mathfrak{q}_m} \leq \dim R_{\mathfrak{m}} + \dim
(R[x])_{\mathfrak{q}_m} /\mathfrak{m} (R[x])_{\mathfrak{q}_m}. \]
Here $\dim R_{\mathfrak{m}} \leq \dim R = n$. So if we show that $\dim
(R[x])_{\mathfrak{q}_m} /\mathfrak{m} (R[x])_{\mathfrak{q}_m} \leq 1$, we will
have seen that $m \leq n+1$, and will be done. But this last ring is a
localization of $(R_{\mathfrak{m}}/\mathfrak{m}R_{\mathfrak{m}})[x]$, which is
a PID by the euclidean algorithm for polynomial rings over a field, and thus of
dimension  $\leq 1$.
\end{proof} 

\subsection{A refined fiber dimension theorem}

Let $R$ be a local noetherian domain, and let $R \to S$ be an injection of
rings making $S$ into an $R$-algebra. Suppose $S$ is also a local domain, such
that the morphism $R \to S$ is local. This is essentially the setup of
\cref{dimpoly}, but in this section, we make the refining assumption that $S$
is \emph{essentially of finite type} over $R$; in other words, $S$ is the
localization of a finitely generated $R$-algebra.

Let $k$ be the residue field of $R$, and $k'$ that of $S$; because $R \to S$ is
local, there is induced a morphism of fields $k \to k'$. 
We shall prove, following \cite{EGA}:
\newcommand{\trdeg}{\mathrm{tr.deg.}}
\begin{theorem}[Dimension formula]
\begin{equation}\label{strongfiberdim} \dim S + \trdeg S/R \leq \dim R + \trdeg
k'/k.  \end{equation}
\end{theorem} 
Here $\trdeg B/A$ is more properly the transcendence degree of the quotient
field of $B$ over that of $A$.
Geometrically, it corresponds to the dimension of the ``generic'' fiber. 

\begin{proof} Let $\mathfrak{m} \subset R$ be the maximal ideal.
We know that $S$ is a localization of an algebra of the form
$(R[x_1, \dots, x_k])/\mathfrak{p}$ where $\mathfrak{p} \subset R[x_1, \dots,
x_n]$ is a prime ideal $\mathfrak{q}$.
We induct on $k$.

Since we can ``d\'evissage'' the extension $R \to S$ as the
composite
\[ R \to (R[x_1, \dots, x_{k-1}]/(\mathfrak{p} \cap R[x_1, \dots,
x_{k-1}])_{\mathfrak{q'}}  \to S, \]
(where $\mathfrak{q}' \in \spec R[x_1, \dots, x_{k-1}]/(\mathfrak{p} \cap R[x_1, \dots,
x_{k-1}]$ is the pull-back of $\mathfrak{q}$),
we see that it suffices to prove \eqref{strongfiberdim} when $k=1$, that is $S$
is the localization of a quotient of $R[x]$.

So suppose $k=1$. Then we have $S = (R[x])_{\mathfrak{q}}/\mathfrak{p}$ where
$\mathfrak{q} \subset R[x]$ is another prime ideal lying over $\mathfrak{m}$.
Let us start by considering the case where $\mathfrak{q} = 0$.

\begin{lemma} Let $(R, \mathfrak{m})$ be a local noetherian domain as above.
Let $S = R[x]_{\mathfrak{q}}$ where $\mathfrak{q} \in \spec R[x]$ is a prime
lying over $\mathfrak{m}$. Then \eqref{strongfiberdim} holds with equality.
\end{lemma} 
\begin{proof}
In this case, $\trdeg S/R = 1$. Now $\mathfrak{q}$
could be $\mathfrak{m} R[x]$ or a prime ideal containing that, which is then
automatically
maximal, as we know from the proof of \cref{dimpoly}. Indeed, primes
containing $\mathfrak{m}R[x]$ are
in bijection with primes of $R/\mathfrak{m}[x]$, and these come in two forms:
zero, and those generated by one element. (Note that in the former case, the
residue field is the field of rational functions $k(x)$ and in the second, the residue field is finite over
$k$.)

\begin{enumerate}
\item 
In the first case, $\dim S = \dim R[x]_{\mathfrak{m}R[x]} = \dim R$ and but the
residue field extension is $(R[x]_{\mathfrak{m}R[x]})/\mathfrak{m}
R[x]_{\mathfrak{m}R[x]} = k(x)$, so $\trdeg k'/k = 1$ and the formula is
satisfied. 
\item  In the second case, $\mathfrak{q}$ properly contains $\mathfrak{m}
R[x]$.
Then $\dim R[x]_{\mathfrak{q}} = \dim R + 1$, but the residue field extension
is finite. So in this case too, the formula is satisfied.
\end{enumerate}
\end{proof}


Now, finally, we have to consider the case where $\mathfrak{p} \subset R[x]$ is
not zero, and we have $S = (R[x]/\mathfrak{p})_{\mathfrak{q}}$ for
$\mathfrak{q} \in \spec R[x]/\mathfrak{p}$ lying over $\mathfrak{m}$.
In this case, $\trdeg S/R = 0$. So we need to prove
\[ \dim S \leq \dim R + \trdeg k'/k.  \]
Let us, by abuse of notation, identify $\mathfrak{q}$ with its preimage in
$R[x]$.
(Recall that $\spec R[x]/\mathfrak{p}$ is canonically identified as a closed
subset of $\spec R[x]$.)
Then we know that
\( \dim ( R[x]/\mathfrak{p})_{\mathfrak{q}}  \)
is the largest chain of primes in $R[x]$ between $\mathfrak{p}, \mathfrak{q}$.
In particular, it is at most $\dim R[x]_{\mathfrak{q}} - \mathrm{height}
\mathfrak{p}
\leq \dim R + 1 - 1 = \dim R$. So the result is clear.
\end{proof} 

In \cite{EGA}, this is used to prove the geometric result that if $\phi:X  \to
Y$ is a morphism of varieties over an algebraically closed field (or a morphism
of finite type between nice schemes), then the local dimension (that is, the
dimension at $x$) of
the fiber $\phi^{-1}(\phi(x))$ is an upper semi-continuous function of $x \in X$.
\subsection{An infinite-dimensional noetherian ring}

We shall now present an example, due to Nagata, of an infinite-dimensional
noetherian ring. Note that such a ring cannot be \emph{local}.

Consider the ring $R=\mathbb{C}[\{x_{i,j}\}_{0 \leq i \leq j}]$ of polynomials in 
infinitely many variables $x_{i,j}$. 
This is clearly an infinite-dimensional ring, but it is also not noetherian.
We will localize it suitably to make it noetherian.

Let $\mathfrak{p}_n \subset R$ be the
ideal  $(x_{1,n}, x_{2,n}, \dots, x_{n,n})$ for all $i \leq n$.
Let $S = R - \bigcup \mathfrak{p}_n$; this is a multiplicatively closed set. 

\begin{theorem}[Nagata] The ring $S^{-1}R$ is noetherian and has infinite
dimension.
\end{theorem} 

We start with
\begin{proposition} 
The ring in the statement of the problem is noetherian.
\end{proposition} 

The proof is slightly messy, so we first prove a few lemmas.

Let $R' = S^{-1}R$ as in the problem statement. We start by proving that every ideal in $R'$ is contained
in one of the $\mathfrak{p}_n$ (which, by abuse of notation, we identify with
their localizations in $R' = S^{-1}R$). 
In particular, the $\mathfrak{p}_n$ are the maximal ideals in $R'$.

\begin{lemma} 
The $\mathfrak{p}_n$ are the maximal ideals in $R'$.
\end{lemma} 
\begin{proof} 
We start with an observation:
\begin{quote}
If $f \neq 0 $, then $f$ belongs to only finitely many $\mathfrak{p}_n$.
\end{quote}
To see this, let us use the following notation. If $M$ is a monomial, we let
$S(M)$ denote the set of subscripts $x_{a,b}$ that occur and $S_2(M)$ the set
of second subscripts (i.e. the $b$'s). 
For $f \in R$, we define $S(f)$ to be the intersection of the $S(M)$ for $M$ a
monomial occurring nontrivially in $f$. Similarly we define $S_2(f)$.

Let us prove:
\begin{lemma} 
$f \in \mathfrak{p}_n$ iff $n \in S_2(f)$. Moreover, $S(f)$ and $S_2(f)$ are
finite for any $f \neq 0$.
\end{lemma} 
\begin{proof} 
Indeed, $f \in \mathfrak{p}_n$ iff every monomial in $f$ is divisible by some
$x_{i,n}, i \leq n$, as $\mathfrak{p}_n  = (x_{i,n})_{i \leq n}$. From this the first assertion is clear. The second too,
because $f$ will contain a nonzero monomial, and that can be divisible by only
finitely many $x_{a,b}$.
\end{proof} 
From this, it is clear how to define $ S_2(f)$ for any element in $R'$,
not necessarily a polynomial in $R$. Namely, it is the set of $n$ such that $f
\in \mathfrak{p}_n$. 
It is now clear, from the second statement of the lemma, that any $f \neq 0$ lies in \emph{only finitely many
$\mathfrak{p}_n$}. In particular, the observation has been proved. 

Let $\mathcal{T} = \left\{ S_2(f), f \in I - 0\right\}$. \emph{I claim that
$\emptyset \in \mathcal{T}$ iff $I = (1)$.} For $\emptyset \in \mathcal{T}$ iff
there is a polynomial lying in no $\mathfrak{p}_n$. Since the union $\bigcup
\mathfrak{p}_n$ is the set of non-units (by construction), we find that the
assertion is clear.


\begin{lemma} 
$\mathcal{T}$ is closed under finite intersections.
\end{lemma} 
\begin{proof} 
Suppose $T_1, T_2 \in \mathcal{T}$. Without loss of generality, there are
\emph{polynomials} $F_1, F_2 \in R$ such that $S_2(F_1) = T_1, S_2(F_2) = T_2$.
A generic linear combination $a F_1 + bF_2$ will involve no cancellation for
$a, b \in \mathbb{C}$, and
the monomials in this linear combination will be the union of those in $F_1$
and those in $F_2$ (scaled appropriately). So $S_2(aF_1 + bF_2) = S_2(F_1) \cap S_2(F_2)$.
\end{proof} 

Finally, we can prove the result that the $\mathfrak{p}_n$ are the only maximal
ideals. Suppose $I$ was contained in no $\mathfrak{p}_n$, and form the set
$\mathcal{T}$ as above. This is a collection of finite sets. Since $I
\not\subset \mathfrak{p}_n$ for each $n$, we find that $n \notin \bigcap_{T \in
\mathcal{T}} T$. This intersection is thus empty. It follows that there is a
\emph{finite} intersection of sets in $\mathcal{T}$
which is empty as $\mathcal{T}$ consists of finite sets. But $\mathcal{T}$ is closed under intersections. There is thus
an element in $I$ whose $S_2$ is empty, and is thus a unit. Thus $I = (1)$.
\end{proof} 

We have proved that the $\mathfrak{p}_n$ are the only maximal ideals. This is
not enough, though. We need:
\begin{lemma} 
$R'_{\mathfrak{p}_n}$ is noetherian for each $n$. 
\end{lemma} 
\begin{proof} 
Indeed, any polynomial involving the variables $x_{a,b}$ for $ b \neq n$ is
invertible in this ring. We see that this ring contains the field
\[ \mathbb{C}(\{x_{a,b}, b \neq n\}),  \]
and over it is contained in the field $\mathbb{C}(\left\{x_{a,b}, \forall
a,b\right\})$. It is a localization of the algebra $\mathbb{C}(\{x_{a,b}, b
\neq n\})[x_{1,n} , \dots, x_{n,n}]$ and is consequently noetherian by
Hilbert's basis theorem.
\end{proof} 

The proof will be completed with:
\begin{lemma} 
Let $R$ be a ring. Suppose every element $x \neq 0$ in the ring belongs to only
finitely many maximal ideals, and suppose that $R_{\mathfrak{m}}$ is noetherian
for each $\mathfrak{m} \subset R$ maximal. Then $R$ is noetherian. 
\end{lemma} 
\begin{proof} 
Let $I \subset R$ be a nonzero ideal. We must show that it is finitely generated. We
know that $I$ is contained in only finitely many maximal ideals $\mathfrak{m}_1
, \dots , \mathfrak{m}_k$. 
At each of these maximal ideals, we know that $I_{\mathfrak{m}_i}$ is finitely
generated. Clearing denominators, we can choose a finite set of generators in
$R$. So we can collect them together and get a finite set $a_1, \dots, a_N
\subset I$
which generate $I_{\mathfrak{m}_i} \subset R_{\mathfrak{m}_i}$ for each $i$. It
is not necessarily true that $J = (a_1, \dots, a_N) = I$, though we do have
$\subset$. However, $I_{\mathfrak{m}} = J_{\mathfrak{m}}$ except at finitely
many maximal ideals $\mathfrak{n}_1, \dots, \mathfrak{n}_M$ because a nonzero
element is a.e. a unit. However, these $\mathfrak{n}_j$ are not among the
$\mathfrak{m}_i$. In particular, for each $j$, there is $b_j \in I -
\mathfrak{n}_j$ as $I \not\subset \mathfrak{n}_j$. Then we find that the ideal
\[ (a_1, \dots, a_N, b_1, \dots, b_M) \subset I \]
becomes equal to $I$ in all the localizations. So it is $I$, and $I$ is finitely generated 

\end{proof} 

We need only see that the ring $R'$ has infinite dimension. But for each $n$, there
is a chain of primes $(x_{1,n}) \subset (x_{1,n}, x_{2,n}) \subset
\dots \subset (x_{1,n}, \dots, x_{n,n})$ of length $n-1$. The supremum of the
lengths is thus infinite.

\subsection{Catenary rings}
 \begin{definition}
   A ring $R$ is \emph{catenary} if given any two primes $\mathfrak{p}\subsetneq \mathfrak{p}'$, any two
   maximal prime chains from $\mathfrak{p}$ to $\mathfrak{p}'$ have the same length.
 \end{definition}
 Nagata showed that there are noetherian domains which are not catenary. We
 shall see that \emph{affine rings}, or rings finitely generated over a field,
 are always catenary.

 \begin{definition}
   If $\mathfrak{p}\in \spec R$, then $\dim \mathfrak{p}:= \dim R/\mathfrak{p}$.
 \end{definition}


\begin{lemma}
   Let $S$ be a $k$-affine domain with $tr.d._k S=n$, and let $\mathfrak{p}\in
	\spec S$ be height one. Then
   $tr.d._k (S/\mathfrak{p})=n-1$.
 \end{lemma}
 \begin{proof}
   \underline{Case 1}: assume $S=k[x_1,\dots, x_n]$ is a polynomial algebra. In this
   case, height 1 primes are principal, so $\mathfrak{p}=(f)$ for some $f$. Say $f$ has positive
   degree with respect to $x_1$, so $f = g_r(x_2,\dots, x_n)x_1^r + \cdots$. We have
   that $k[x_2,\dots, x_n]\cap (f)=(0)$ (just look at degree with respect to $x_1$). It
   follows that $k[x_2,\dots, x_n]\hookrightarrow S/(f)$, so $\bar x_2,\dots, \bar x_n$
   are algebraically independent in $S/\mathfrak{p}$. By $\bar x_1$ is algebraic over $Q(k[\bar
   x_2,\dots, \bar x_n])$ as witnessed by $f$. This, $tr.d._k S/\mathfrak{p}=n-1$.

   \underline{Case 2}: reduction to case 1. Let $R=k[x_1,\dots, x_n]$ be a Noether
   normalization for $S$, and let $\mathfrak{p}_0=\mathfrak{p}\cap R$. Observe that Going Down applies
   (because $S$ is a domain and $R$ is normal). It follows that $ht_R(\mathfrak{p}_0)=ht_S(\mathfrak{p})=1$.
   By case 1, we get that $tr.d. (R/\mathfrak{p}_0)=n-1$. By $(\ast)$, we get that $tr.d.
   R/\mathfrak{p}_0=tr.d. (S/\mathfrak{p})$.
 \end{proof}


 \begin{theorem}
   Any $k$-affine algebra $S$ is catenary (even if $S$ is not a domain). In fact, any
   saturated prime chain from $\mathfrak{p}$ to $\mathfrak{p}'$ has length $\dim \mathfrak{p} - \dim \mathfrak{p}'$. If $S$ is a
   domain, then all maximal ideals have the same height.
 \end{theorem}
 \begin{proof}
   Consider any chain $\mathfrak{p}\subsetneq \mathfrak{p}_1\subsetneq \cdots \subsetneq \mathfrak{p}_r = \mathfrak{p}'$. Then we
   get the chain
   \[
    S/\mathfrak{p} \twoheadrightarrow S/\mathfrak{p}_1 \twoheadrightarrow \cdots \twoheadrightarrow S/\mathfrak{p}_r
    = S/\mathfrak{p}'
   \]
   Here $\mathfrak{p}_i/\mathfrak{p}_{i-1}$ is height 1 in $S/\mathfrak{p}_{i-1}$, so each arrow decreases the
   transcendence degree by exactly 1. Therefore, $tr.d._k S/\mathfrak{p}' = tr.d._k S/\mathfrak{p} -r$.
   \[
    r = tr.d._k S/\mathfrak{p} - tr.d._k S/\mathfrak{p}' = \dim S/\mathfrak{p} - \dim S/\mathfrak{p}' = \dim \mathfrak{p}-\dim \mathfrak{p}'.
   \]
   To get the last statement, take $\mathfrak{p}=0$ and $\mathfrak{p}'=\mathfrak{m}$. Then we get that $ht(\mathfrak{m})=\dim S$.
 \end{proof}
 Note that the last statement fails in general.
 \begin{example}
   Take $S=k\times k[x_1,\dots, x_n]$. Then $ht(0\times k[x_1,\dots, x_n])=0$, but
   $ht\bigl(k\times (x_1,\dots, x_n)\bigr) = n$.
 \end{example}
 But that example is not connected.
 \begin{example}
   $S = k[x,y,z]/(xy,xz)$.
 \end{example}
 But this example is not a domain. In general, for any prime $\mathfrak{p}$ in any ring $S$, we
 have
 \[
    ht(\mathfrak{p}) + \dim \mathfrak{p} \le \dim S.
 \]
 \begin{theorem}
   Let $S$ be an affine algebra, with  minimal primes $ \{\mathfrak{p}_1,\dots, \mathfrak{p}_r\}$. Then the following
   are equivalent.
   \begin{enumerate}
     \item $\dim \mathfrak{p}_i$ are all equal.
     \item $ht(\mathfrak{p})+\dim \mathfrak{p} =\dim S$ for all primes $\mathfrak{p}\in \spec S$. In particular, if $S$
     is a domain, we get this condition.
   \end{enumerate}
 \end{theorem}
 \begin{proof}
   $(1\Rightarrow 2)$ $ht(\mathfrak{p})$ is the length of some saturated prime chain from $\mathfrak{p}$ to
   some minimal prime $\mathfrak{p}_i$. This length is $\dim \mathfrak{p}_i - \dim \mathfrak{p} = \dim S - \dim \mathfrak{p}$ (by
   condition 1). Thus, we get $(2)$.

   $(2\Rightarrow 1)$ Apply (2) to the minimal prime $\mathfrak{p}_i$ to get $\dim \mathfrak{p}_i=\dim S$ for
   all $i$.
 \end{proof}
 We finish with a (non-affine) noetherian domain $S$ with maximal ideals of different
 heights. We need the following fact.\\
 \underline{Fact}: If $R$ is a ring with $a\in R$, then there is a canonical $R$-algebra
 isomorphism $R[x]/(ax-1) \cong R[a^{-1}]$, $x\leftrightarrow a^{-1}$.
 \begin{example}
   Let $\bigl(R,(\mathfrak{p}i)\bigr)$ be a DVR with quotient field $K$. Let $S=R[x]$, and assume
   for now that we know that $\dim S=2$. Look at $\mathfrak{m}_2=(\mathfrak{p}i,x)$ and $\mathfrak{m}_1=(\mathfrak{p}i x-1)$.
   Note that $\mathfrak{m}_1$ is maximal because $S/\mathfrak{m}_1 = K$. It is easy to show that
   $ht(\mathfrak{m}_1)=1$. However, $\mathfrak{m}_2\supsetneq (x)\supsetneq (0)$, so $ht(\mathfrak{m}_2)=2$.
 \end{example}

\subsection{Dimension theory for topological spaces}
\label{subsectiondimension}
The present subsection (which consists mostly of exercises) is a digression   that may illuminate the notion of
Krull dimension.

\begin{definition} 
Let $X$ be a topological space.\footnote{We do not include the empty space.} Recall that $ X$ is
\textbf{irreducible} if  cannot be written as the union of
two proper closed subsets $F_1, F_2 \subsetneq X$.

We say that a subset of $X$ is irreducible if it is irreducible with respect
to the induced topology.
\end{definition} 

In general, this notion is not valid from the topological spaces familiar from
analysis. For instance:

\begin{exercise} 
Points are the only irreducible subsets of $\mathbb{R}$.
\end{exercise} 

Nonetheless, irreducible sets behave very nicely with respect to certain
operations. As you will now prove, if $U \subset X$ is an open subset, then
the irreducible closed subsets of $U$ are in bijection with the irreducible
closed subsets of $X$ that intersect $U$. 
\begin{exercise} \label{irredifeveryopenisdense}
A space is irreducible if and only if every open set is dense, or
alternatively if every open set is connected.
\end{exercise} 

\begin{exercise} 
Let $X$ be a space, $Y \subset X$ an irreducible subset. Then 
$\overline{Y} \subset X$ is irreducible.
\end{exercise} 

\begin{exercise} 
Let $X$ be a space, $U \subset X$ an open subset. 
Then the map $Z \to Z \cap U$ gives a bijection between the irreducible
closed subsets of $X$ meeting $U$ and the irreducible closed subsets of $U$.
The inverse is given by $Z' \to \overline{Z'}$.
\end{exercise} 

As stated above, the  notion of irreducibility is useless for spaces
like manifolds. In fact, by \rref{irredifeveryopenisdense}, a
Hausdorff space cannot be irreducible unless it consists of one point.
However, for the highly non-Hausdorff spaces encountered in algebraic geometry, this notion is very
useful.

Let $R$ be a commutative ring, and $X = \spec R$.

\begin{exercise} 
A closed subset $F \subset \spec R$ is irreducible if and only if it can be
written in the form $F = V(\mathfrak{p})$ for $\mathfrak{p} \subset R$ prime.
In particular, $\spec R$ is irreducible if and only if $R$ has one minimal
prime. 
\end{exercise} 

In fact, spectra of rings are particularly nice: they are \textbf{sober
spaces.}
\begin{definition} 
A space $X$ is called \textbf{sober} if to every irreducible closed $F \subset
X$, there is a unique point $\xi \in F$ such that $F = \overline{ \left\{\xi\right\}}$. 
This point is called the \textbf{generic point.}
\end{definition} 

\begin{exercise} 
Check that if $X$ is any topological space and $\xi  \in X$, then the closure
$\overline{\left\{\xi\right\}}$ of the point $\xi$ is irreducible.
\end{exercise} 

\begin{exercise} 
Show that $\spec R$ for $R$ a ring is sober.
\end{exercise} 

\begin{exercise} 
Let $X$ be a space with a cover $\left\{X_\alpha\right\}$ by open subsets,
each of which is a sober space. Then $X$ is a sober space. (Hint: any
irreducible closed subset must intersect one of the $X_\alpha$, so is the
closure of its intersection with that one.)
\end{exercise} 

We now come to the main motivation of this subsection, and the reason for its
inclusion here.

\begin{definition} 
Let $X$ be a topological space. Then the \textbf{dimension} (or
\textbf{combinatorial dimension}) of $X$ is the maximal $k$ such that a chain
\[ F_0 \subsetneq F_1 \subsetneq \dots \subsetneq F_k \subset X  \]
with the $F_i$ irreducible, exists. This number is denoted $\dim X$ and may be
infinite.
\end{definition} 

\begin{exercise} 
What is the Krull dimension of $\mathbb{R}$?
\end{exercise} 

\begin{exercise} 
Let $X = \bigcup X_i$ be the finite union of subsets $X_i \subset X$. 

\end{exercise} 

\begin{exercise} 
Let $R$ be a ring. Then $\dim \spec R$ is equal to the Krull dimension of $R$. 
\end{exercise} 

Most of the spaces one wishes to work with in standard algebraic geometry have a
strong form of compactness. Actually, compactness is the wrong word, since the
spaces of algebraic geometry are not Hausdorff.

\begin{definition} 
A space is \textbf{noetherian} if every descending sequence of closed subsets
$F_0 \supset F_1 \supset \dots$ stabilizes.
\end{definition} 

\begin{exercise} 
If $R$ is noetherian, $\spec R$ is noetherian as a topological space.
\end{exercise} 


\subsection{The dimension of a tensor product of fields}

The following very clear result  gives us the dimension of the tensor product
of fields.
\begin{theorem}[Grothendieck-Sharp] 
Let $K, L$ be field extensions of a field $k$. Then
\[ \dim K \otimes_k L = \mathrm{min}(\mathrm{tr.deg.} K, \mathrm{tr.deg.} L).  \]
\end{theorem} 
This result is stated in the errata of \cite{EGA}, vol IV (4.2.1.5), but that
did not make it
 well-known; apparently it was independently discovered and published again by R. Y. Sharp, ten years
 later.\footnote{Thanks to Georges Elencwajg for a helpful discussion at 
\url{http://math.stackexchange.com/questions/56669/a-tensor-product-of-a-power-series/56794}.}
Note that in general, this tensor product is \emph{not} noetherian.

\begin{proof} 
We start by assuming $K$ is a finitely generated, purely transcendental extension of $k$.
Then $K $ is the quotient field of a polynomial ring $k[x_1, \dots, x_n]$.
It follows that $K \otimes_k L$ is a localization of $L[x_1, \dots, x_n]$, and
consequently of dimension at most $n = \mathrm{tr.deg.} K$.

Now the claim is that if $\mathrm{tr.deg.} L > n$, then we have equality
\[ \dim K \otimes_k L = n.  \]
To see this, we have to show that $K \otimes_k L$ admits an $L$-homomorphism to
$L$. For then there will be a maximal ideal $\mathfrak{m}$ of $K \otimes_k L$ which comes from
a maximal ideal $\mathfrak{M}$ of $L[x_1, \dots, x_n]$ (corresponding to this
homomorphism). Consequently, we will have $(K \otimes_k L)_{\mathfrak{m}}  =
(L[x_1, \dots, x_n])_{\mathfrak{M}},$ which has dimension $n$.

So we need to produce this homomorphism $K \otimes_k L \to L$. Since $K =
k(x_1, \dots, x_n)$ and $L$ has transcendence degree more than $n$, we just choose $n$ 
algebraically independent elements of $L$, and use that to define a map of
$k$-algebras $K \to L$. By the universal property of the tensor product, we get
a section $K \otimes_k L \to L$.
This proves the result in the case where $K$ is a finitely generated, purely
transcendental extension.

Now we assume that $K$ has 
finite transcendence degree over $k$, but is not necessarily purely
transcendental. Then $K$ contains a subfield $E$ which is purely transcendental
over $k$ and such that $E/K$ is algebraic. Then $K \otimes_k L$ is
\emph{integral} over its subring $E \otimes_k L$. The previous analysis applies
to $E \otimes_k L$, and by integrality the dimensions of the two objects are
the same.

Finally, we need to consider the case when $K$ is allowed to have infinite
transcendence degree over $k$. Again, we may assume that $K$ is the quotient
field of the polynomial ring $k[\left\{x_\alpha\right\}]$ (by the integrality
argument above). 
We need to show that if $L$ has \emph{larger} transcendence degree than $K$,
then $\dim K \otimes_k L = \infty$. As before, there is a section $K \otimes_k
L \to L$, and $K \otimes_k L$ is a localization of  the
polynomial ring $L[\left\{x_\alpha\right\}]$.
If we take the maximal ideal in $L[\left\{x_\alpha\right\}]$ corresponding to
this section $K \otimes_k L \to L$, it is of the form $(x_\alpha -
t_\alpha)_\alpha$
for the $t_\alpha \in L$. It is easy to check that the localization of
$L[\left\{x_\alpha\right\}]$ at this maximal ideal, which is a localization of
$K \otimes_k L$, has infinite dimension.
\end{proof}