Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
File size: 122,896 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
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
\input{preamble}

% OK, start here.
%
\begin{document}

\title{Deformation Problems}

\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
The goal of this chapter is to work out examples of the general theory
developed in the chapters Formal Deformation Theory,
Deformation Theory, The Cotangent Complex.

\medskip\noindent
Section 3 of the paper \cite{Sch} by Schlessinger discusses some
examples as well.






\section{Examples of deformation problems}
\label{section-examples}

\noindent
List of things that should go here:
\begin{enumerate}
\item Deformations of schemes:
\begin{enumerate}
\item The Rim-Schlessinger condition.
\item Computing the tangent space.
\item Computing the infinitesimal deformations.
\item The deformation category of an affine hypersurface.
\end{enumerate}
\item Deformations of sheaves (for example fix $X/S$, a finite type point
$s$ of $S$, and a quasi-coherent sheaf $\mathcal{F}_s$ over $X_s$).
\item Deformations of algebraic spaces (very similar to deformations
of schemes; maybe even easier?).
\item Deformations of maps (eg morphisms between schemes; you can fix
both or one of the target and/or source).
\item Add more here.
\end{enumerate}





\section{General outline}
\label{section-general}

\noindent
This section lays out the procedure for discussing the next few examples.

\medskip\noindent
Step I. For each section we fix a Noetherian ring $\Lambda$ and
we fix a finite ring map $\Lambda \to k$ where $k$ is a field.
As usual we let $\mathcal{C}_\Lambda = \mathcal{C}_{\Lambda, k}$
be our base category, see
Formal Deformation Theory,
Definition \ref{formal-defos-definition-CLambda}.

\medskip\noindent
Step II. In each section we define a category $\mathcal{F}$
cofibred in groupoids over $\mathcal{C}_\Lambda$. Occassionally
we will consider instead a functor
$F : \mathcal{C}_\Lambda \to \textit{Sets}$.

\medskip\noindent
Step III. We explain to what extent $\mathcal{F}$ satisfies
the Rim-Schlesssinger condition (RS) discussed in
Formal Deformation Theory, Section \ref{formal-defos-section-RS-condition}.
Similarly, we may discuss to what extent our $\mathcal{F}$
satisfies (S1) and (S2) or to what extent $F$ satisfies
the corresponding Schlessinger's conditions (H1) and (H2).
See Formal Deformation Theory, Section
\ref{formal-defos-section-schlessinger-conditions}.

\medskip\noindent
Step IV. Let $x_0$ be an object of $\mathcal{F}(k)$, in other words an object
of $\mathcal{F}$ over $k$. In this chapter we will use the notation
$$
\Deformationcategory_{x_0} = \mathcal{F}_{x_0}
$$
to denote the predeformation category constructed in
Formal Deformation Theory, Remark
\ref{formal-defos-remark-localize-cofibered-groupoid}.
If $\mathcal{F}$ satisfies (RS), then
$\Deformationcategory_{x_0}$ is a deformation category
(Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-localize-RS})
and satisfies (S1) and (S2)
(Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-implies-S1-S2}).
If (S1) and (S2) are satisfied, then
an important question is whether the tangent space
$$
T\Deformationcategory_{x_0} = T_{x_0}\mathcal{F} = T\mathcal{F}_{x_0}
$$
(see Formal Deformation Theory, Remark
\ref{formal-defos-remark-tangent-space-cofibered-groupoid} and
Definition \ref{formal-defos-definition-tangent-space})
is finite dimensional. Namely, this insures that
$\Deformationcategory_{x_0}$ has a versal formal object
(Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-versal-object-existence}).

\medskip\noindent
Step V. If $\mathcal{F}$ passes Step IV, then the next question is whether
the $k$-vector space
$$
\text{Inf}(\Deformationcategory_{x_0}) = \text{Inf}_{x_0}(\mathcal{F})
$$
of infinitesimal automorphisms of $x_0$ is finite dimensional.
Namely, if true, this implies that
$\Deformationcategory_{x_0}$ admits a presentation by a
smooth prorepresentable groupoid in functors on $\mathcal{C}_\Lambda$, see
Formal Deformation Theory, Theorem
\ref{formal-defos-theorem-presentation-deformation-groupoid}.




\section{Finite projective modules}
\label{section-finite-projective-modules}

\noindent
This section is just a warmup. Of course finite projective modules
should not have any ``moduli''.

\begin{example}[Finite projective modules]
\label{example-finite-projective-modules}
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a pair $(A, M)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$ and a
finite projective $A$-module $M$, and
\item a morphism $(f, g) : (B, N) \to (A, M)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a map $g : N \to M$ which is $f$-linear and induces
an isomorpism $N \otimes_{B, f} A \cong M$.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, M)$ to $A$
and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a finite dimensional $k$-vector space $V$,
let $x_0 = (k, V)$ be the corresponding object of $\mathcal{F}(k)$.
We set
$$
\Deformationcategory_V = \mathcal{F}_{x_0}
$$
\end{example}

\noindent
Since every finite projective module over a local ring is finite free
(Algebra, Lemma \ref{algebra-lemma-finite-projective})
we see that
$$
\begin{matrix}
\text{isomorphism classes} \\
\text{of objects of }\mathcal{F}(A)
\end{matrix}
= \coprod\nolimits_{n \geq 0} \{*\}
$$
Although this means that the deformation theory of $\mathcal{F}$
is essentially trivial, we still work through the steps outlined
in Section \ref{section-general} to provide an easy example.

\begin{lemma}
\label{lemma-finite-projective-modules-RS}
Example \ref{example-finite-projective-modules}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_V$ is a deformation category
for any finite dimensional vector space $V$ over $k$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.

\medskip\noindent
Thus we have to show that the category of finite projective modules
over $A_1 \times_A A_2$ is equivalent to the fibre product
of the categories of finite projective modules over $A_1$ and $A_2$
over the category of finite projective modules over $A$.
This is a special case of More on Algebra, Lemma
\ref{more-algebra-lemma-finitely-presented-module-over-fibre-product}.
We recall that the inverse functor sends the triple
$(M_1, M_2, \varphi)$ where
$M_1$ is a finite projective $A_1$-module,
$M_2$ is a finite projective $A_2$-module, and
$\varphi : M_1 \otimes_{A_1} A \to M_2 \otimes_{A_2} A$
is an isomorphism of $A$-module, to the finite projective
$A_1 \times_A A_2$-module $M_1 \times_\varphi M_2$.
\end{proof}

\begin{lemma}
\label{lemma-finite-projective-modules-TI}
In Example \ref{example-finite-projective-modules}
let $V$ be a finite dimensional $k$-vector space. Then
$$
T\Deformationcategory_V = (0)
\quad\text{and}\quad
\text{Inf}(\Deformationcategory_V) = \text{End}_k(V)
$$
are finite dimensional.
\end{lemma}

\begin{proof}
With $\mathcal{F}$ as in Example \ref{example-finite-projective-modules}
set $x_0 = (k, V) \in \Ob(\mathcal{F}(k))$.
Recall that $T\Deformationcategory_V = T_{x_0}\mathcal{F}$
is the set of isomorphism
classes of pairs $(x, \alpha)$ consisting of an object $x$ of $\mathcal{F}
$ over the dual numbers $k[\epsilon]$ and a morphism
$\alpha : x \to x_0$ of $\mathcal{F}$ lying over $k[\epsilon] \to k$.

\medskip\noindent
Up to isomorphism, there is a unique pair $(M, \alpha)$ consisting of a
finite projective module $M$ over $k[\epsilon]$
and $k[\epsilon]$-linear map $\alpha : M \to V$
which induces an isomorphism $M \otimes_{k[\epsilon]} k \to V$.
For example, if $V = k^{\oplus n}$, then we take
$M = k[\epsilon]^{\oplus n}$ with the obvious map $\alpha$.

\medskip\noindent
Similarly, $\text{Inf}(\Deformationcategory_V) = \text{Inf}_{x_0}(\mathcal{F})$
is the set of automorphisms
of the trivial deformation $x'_0$ of $x_0$ over $k[\epsilon]$.
See Formal Deformation Theory, Definition
\ref{formal-defos-definition-infinitesimal-auts} for details.

\medskip\noindent
Given $(M, \alpha)$ as in the second paragraph, we see that an element of
$\text{Inf}_{x_0}(\mathcal{F})$ is an automorphism $\gamma : M \to M$ with
$\gamma \bmod \epsilon = \text{id}$. Then we can write
$\gamma = \text{id}_M + \epsilon \psi$ where
$\psi : M/\epsilon M \to M/\epsilon M$ is $k$-linear.
Using $\alpha$ we can think of $\psi$ as an element of
$\text{End}_k(V)$ and this finishes the proof.
\end{proof}


\section{Representations of a group}
\label{section-representations}

\noindent
The deformation theory of representations can be very interesting.

\begin{example}[Representations of a group]
\label{example-representations}
Let $\Gamma$ be a group.
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a triple $(A, M, \rho)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$, a finite projective $A$-module $M$,
and a homomorphism $\rho : \Gamma \to \text{GL}_A(M)$, and
\item a morphism $(f, g) : (B, N, \tau) \to (A, M, \rho)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a map $g : N \to M$ which is $f$-linear and $\Gamma$-equivariant
and induces an isomorpism $N \otimes_{B, f} A \cong M$.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, M, \rho)$
to $A$ and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a finite dimensional $k$-vector space $V$ and a representation
$\rho_0 : \Gamma \to \text{GL}_k(V)$,
let $x_0 = (k, V, \rho_0)$ be the corresponding object of $\mathcal{F}(k)$.
We set
$$
\Deformationcategory_{V, \rho_0} = \mathcal{F}_{x_0}
$$
\end{example}

\noindent
Since every finite projective module over a local ring is finite free
(Algebra, Lemma \ref{algebra-lemma-finite-projective})
we see that
$$
\begin{matrix}
\text{isomorphism classes} \\
\text{of objects of }\mathcal{F}(A)
\end{matrix}
=
\coprod\nolimits_{n \geq 0}\quad
\begin{matrix}
\text{GL}_n(A)\text{-conjugacy classes of}\\
\text{homomorphisms }\rho : \Gamma \to \text{GL}_n(A)
\end{matrix}
$$
This is already more interesting than the discussion in
Section \ref{section-finite-projective-modules}.

\begin{lemma}
\label{lemma-representations-RS}
Example \ref{example-representations}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_{V, \rho_0}$ is a deformation category
for any finite dimensional representation
$\rho_0 : \Gamma \to \text{GL}_k(V)$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.

\medskip\noindent
Consider an object
$$
((A_1, M_1, \rho_1), (A_2, M_2, \rho_2), (\text{id}_A, \varphi))
$$
of the category $\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$.
Then, as seen in the proof of Lemma \ref{lemma-finite-projective-modules-RS},
we can consider the finite projective
$A_1 \times_A A_2$-module $M_1 \times_\varphi M_2$.
Since $\varphi$ is compatible with the given actions we obtain
$$
\rho_1 \times \rho_2 : \Gamma \longrightarrow
\text{GL}_{A_1 \times_A A_2}(M_1 \times_\varphi M_2)
$$
Then $(M_1 \times_\varphi M_2, \rho_1 \times \rho_2)$
is an object of $\mathcal{F}(A_1 \times_A A_2)$.
This construction determines a quasi-inverse to our functor.
\end{proof}

\begin{lemma}
\label{lemma-representations-TI}
In Example \ref{example-representations} let 
$\rho_0 : \Gamma \to \text{GL}_k(V)$
be a finite dimensional representation. Then
$$
T\Deformationcategory_{V, \rho_0} = \Ext^1_{k[\Gamma]}(V, V) =
H^1(\Gamma, \text{End}_k(V))
\quad\text{and}\quad
\text{Inf}(\Deformationcategory_{V, \rho_0}) = H^0(\Gamma, \text{End}_k(V))
$$
Thus $\text{Inf}(\Deformationcategory_{V, \rho_0})$
is always finite dimensional
and $T\Deformationcategory_{V, \rho_0}$ is finite dimensional
if $\Gamma$ is finitely generated.
\end{lemma}

\begin{proof}
We first deal with the infinitesimal automorphisms.
Let $M = V \otimes_k k[\epsilon]$ with induced action
$\rho_0' : \Gamma \to \text{GL}_n(M)$.
Then an infinitesimal automorphism, i.e., an element of
$\text{Inf}(\Deformationcategory_{V, \rho_0})$,
is given by an automorphism
$\gamma = \text{id} + \epsilon \psi : M \to M$
as in the proof of Lemma \ref{lemma-finite-projective-modules-TI},
where moreover $\psi$ has to commute
with the action of $\Gamma$ (given by $\rho_0$).
Thus we see that
$$
\text{Inf}(\Deformationcategory_{V, \rho_0}) = H^0(\Gamma, \text{End}_k(V))
$$
as predicted in the lemma.

\medskip\noindent
Next, let $(k[\epsilon], M, \rho)$ be an object of $\mathcal{F}$
over $k[\epsilon]$ and let $\alpha : M \to V$ be a $\Gamma$-equivariant map
inducing an isomorphism $M/\epsilon M \to V$.
Since $M$ is free as a $k[\epsilon]$-module we obtain
an extension of $\Gamma$-modules
$$
0 \to V \to M \xrightarrow{\alpha} V \to 0
$$
We omit the detailed construction of the map on the left.
Conversely, if we have an extension of $\Gamma$-modules as
above, then we can use this to make a $k[\epsilon]$-module
structure on $M$ and get an object of $\mathcal{F}(k[\epsilon])$
together with a map $\alpha$ as above.
It follows that
$$
T\Deformationcategory_{V, \rho_0} = \Ext^1_{k[\Gamma]}(V, V)
$$
as predicted in the lemma. This is equal to
$H^1(\Gamma, \text{End}_k(V))$ by
\'Etale Cohomology, Lemma \ref{etale-cohomology-lemma-ext-modules-hom}.

\medskip\noindent
The statement on dimensions follows from
\'Etale Cohomology, Lemma
\ref{etale-cohomology-lemma-finite-dim-group-cohomology}.
\end{proof}

\noindent
In Example \ref{example-representations} if $\Gamma$ is finitely generated
and $(V, \rho_0)$ is a finite dimensional representation of $\Gamma$
over $k$, then $\Deformationcategory_{V, \rho_0}$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$
and a fortiori has a (minimal) versal formal object. This follows
from Lemmas \ref{lemma-representations-RS} and \ref{lemma-representations-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-representations-hull}
In Example \ref{example-representations} assume $\Gamma$ finitely generated.
Let $\rho_0 : \Gamma \to \text{GL}_k(V)$ be a finite dimensional representation.
Assume $\Lambda$ is a complete local ring with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_{V, \rho_0}(A))/\cong
$$
of isomorphism classes of objects has a hull. If
$H^0(\Gamma, \text{End}_k(V)) = k$, then $F$ is
prorepresentable.
\end{lemma}

\begin{proof}
The existence of a hull follows from Lemmas \ref{lemma-representations-RS} and
\ref{lemma-representations-TI} and
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2}
and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}.

\medskip\noindent
Assume $H^0(\Gamma, \text{End}_k(V)) = k$. To see that $F$
is prorepresentable it suffices to show that $F$ is a
deformation functor, see Formal Deformation Theory, Theorem
\ref{formal-defos-theorem-Schlessinger-prorepresentability}.
In other words, we have to show $F$ satisfies (RS).
For this we can use the criterion of Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-associated-functor}.
The required surjectivity of automorphism groups will follow if we
show that
$$
A \cdot \text{id}_M =
\text{End}_{A[\Gamma]}(M)
$$
for any object $(A, M, \rho)$ of $\mathcal{F}$ such that
$M \otimes_A k$ is isomorphic to $V$ as a representation of $\Gamma$.
Since the left hand side is contained in the right hand side,
it suffices to show
$\text{length}_A \text{End}_{A[\Gamma]}(M) \leq \text{length}_A A$.
Choose pairwise distinct ideals
$(0) = I_n \subset \ldots \subset I_1 \subset A$
with $n = \text{length}(A)$. By correspondingly filtering
$M$, we see that it suffices to prove $\Hom_{A[\Gamma]}(M, I_tM/I_{t + 1}M)$
has length $1$. Since $I_tM/I_{t + 1}M \cong M \otimes_A k$
and since any $A[\Gamma]$-module map $M \to M \otimes_A k$ factors
uniquely through the quotient map $M \to M \otimes_A k$
to give an element of
$$
\text{End}_{A[\Gamma]}(M \otimes_A k) = \text{End}_{k[\Gamma]}(V) = k
$$
we conclude.
\end{proof}



\section{Continuous representations}
\label{section-continuous-representations}

\noindent
A very interesting thing one can do is to take an infinite Galois
group and study the deformation theory of its representations, see
\cite{Mazur-deforming}.

\begin{example}[Representations of a topological group]
\label{example-continuous-representations}
Let $\Gamma$ be a topological group.
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a triple $(A, M, \rho)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$, a finite projective $A$-module $M$,
and a continuous homomorphism $\rho : \Gamma \to \text{GL}_A(M)$
where $\text{GL}_A(M)$ is given the discrete topology\footnote{An alternative
would be to require the $A$-module $M$ with $G$-action given by $\rho$
is an $A\text{-}G$-module as defined in \'Etale Cohomology, Definition
\ref{etale-cohomology-definition-G-module-continuous}. However,
since $M$ is a finite $A$-module, this is equivalent.}, and
\item a morphism $(f, g) : (B, N, \tau) \to (A, M, \rho)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a map $g : N \to M$ which is $f$-linear and $\Gamma$-equivariant
and induces an isomorpism $N \otimes_{B, f} A \cong M$.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, M, \rho)$
to $A$ and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a finite dimensional $k$-vector space $V$ and a
continuous representation $\rho_0 : \Gamma \to \text{GL}_k(V)$,
let $x_0 = (k, V, \rho_0)$ be the corresponding object of $\mathcal{F}(k)$.
We set
$$
\Deformationcategory_{V, \rho_0} = \mathcal{F}_{x_0}
$$
\end{example}

\noindent
Since every finite projective module over a local ring is finite free
(Algebra, Lemma \ref{algebra-lemma-finite-projective})
we see that
$$
\begin{matrix}
\text{isomorphism classes} \\
\text{of objects of }\mathcal{F}(A)
\end{matrix}
=
\coprod\nolimits_{n \geq 0}\quad
\begin{matrix}
\text{GL}_n(A)\text{-conjugacy classes of}\\
\text{continuous homomorphisms }\rho : \Gamma \to \text{GL}_n(A)
\end{matrix}
$$

\begin{lemma}
\label{lemma-continuous-representations-RS}
Example \ref{example-continuous-representations}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_{V, \rho_0}$ is a deformation category
for any finite dimensional continuous representation
$\rho_0 : \Gamma \to \text{GL}_k(V)$.
\end{lemma}

\begin{proof}
The proof is exactly the same as the proof of
Lemma \ref{lemma-representations-RS}.
\end{proof}

\begin{lemma}
\label{lemma-continuous-representations-TI}
In Example \ref{example-continuous-representations} let
$\rho_0 : \Gamma \to \text{GL}_k(V)$ be a finite dimensional
continuous representation. Then
$$
T\Deformationcategory_{V, \rho_0} = H^1(\Gamma, \text{End}_k(V))
\quad\text{and}\quad
\text{Inf}(\Deformationcategory_{V, \rho_0}) = H^0(\Gamma, \text{End}_k(V))
$$
Thus $\text{Inf}(\Deformationcategory_{V, \rho_0})$
is always finite dimensional
and $T\Deformationcategory_{V, \rho_0}$ is finite dimensional
if $\Gamma$ is topologically finitely generated.
\end{lemma}

\begin{proof}
The proof is exactly the same as the proof of
Lemma \ref{lemma-representations-TI}.
\end{proof}

\noindent
In Example \ref{example-continuous-representations} if $\Gamma$
is topologically finitely generated
and $(V, \rho_0)$ is a finite dimensional continuous representation of $\Gamma$
over $k$, then $\Deformationcategory_{V, \rho_0}$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$
and a fortiori has a (minimal) versal formal object. This follows
from Lemmas \ref{lemma-continuous-representations-RS} and
\ref{lemma-continuous-representations-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-continuous-representations-hull}
In Example \ref{example-continuous-representations} assume $\Gamma$
is topologically finitely generated.
Let $\rho_0 : \Gamma \to \text{GL}_k(V)$ be a finite dimensional representation.
Assume $\Lambda$ is a complete local ring with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_{V, \rho_0}(A))/\cong
$$
of isomorphism classes of objects has a hull. If
$H^0(\Gamma, \text{End}_k(V)) = k$, then $F$ is
prorepresentable.
\end{lemma}

\begin{proof}
The proof is exactly the same as the proof of
Lemma \ref{lemma-representations-hull}.
\end{proof}



\section{Graded algebras}
\label{section-graded-algebras}

\noindent
We will use the example in this section in the proof that the stack of
polarized proper schemes is an algebraic stack. For this reason we will
consider commutative graded algebras whose homogeneous parts are
finite projective modules (sometimes called ``locally finite'').

\begin{example}[Graded algebras]
\label{example-graded-algebras}
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a pair $(A, P)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$ and a graded $A$-algebra $P$
such that $P_d$ is a finite projective $A$-module for all $d \geq 0$, and
\item a morphism $(f, g) : (B, Q) \to (A, P)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a map $g : Q \to P$ which is $f$-linear and induces an
isomorpism $Q \otimes_{B, f} A \cong P$.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, P)$
to $A$ and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a graded $k$-algebra $P$ with $\dim_k(P_d) < \infty$ for all
$d \geq 0$, let $x_0 = (k, P)$ be the corresponding object of $\mathcal{F}(k)$.
We set
$$
\Deformationcategory_P = \mathcal{F}_{x_0}
$$
\end{example}

\begin{lemma}
\label{lemma-graded-algebras-RS}
Example \ref{example-graded-algebras}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_P$ is a deformation category
for any graded $k$-algebra $P$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.

\medskip\noindent
Consider an object
$$
((A_1, P_1), (A_2, P_2), (\text{id}_A, \varphi))
$$
of the category $\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$.
Then we consider $P_1 \times_\varphi P_2$. Since
$\varphi : P_1 \otimes_{A_1} A \to P_2 \otimes_{A_2} A$
is an isomorphism of graded algebras, we see that the graded pieces
of $P_1 \times_\varphi P_2$ are finite projective $A_1 \times_A A_2$-modules,
see proof of Lemma \ref{lemma-finite-projective-modules-RS}.
Thus $P_1 \times_\varphi P_2$ is an object of $\mathcal{F}(A_1 \times_A A_2)$.
This construction determines a quasi-inverse to our functor
and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-graded-algebras-TI}
In Example \ref{example-graded-algebras} let $P$ be a graded $k$-algebra.
Then
$$
T\Deformationcategory_P
\quad\text{and}\quad
\text{Inf}(\Deformationcategory_P) = \text{Der}_k(P, P)
$$
are finite dimensional if $P$ is finitely generated over $k$.
\end{lemma}

\begin{proof}
We first deal with the infinitesimal automorphisms.
Let $Q = P \otimes_k k[\epsilon]$.
Then an element of $\text{Inf}(\Deformationcategory_P)$
is given by an automorphism
$\gamma = \text{id} + \epsilon \delta : Q \to Q$
as above where now $\delta : P \to P$.
The fact that $\gamma$ is graded implies that
$\delta$ is homogeneous of degree $0$.
The fact that $\gamma$ is $k$-linear implies that
$\delta$ is $k$-linear.
The fact that $\gamma$ is multiplicative implies that
$\delta$ is a $k$-derivation.
Conversely, given a $k$-derivation $\delta : P \to P$
homogeneous of degree $0$, we obtain an automorphism
$\gamma = \text{id} + \epsilon \delta$ as above.
Thus we see that
$$
\text{Inf}(\Deformationcategory_P) = \text{Der}_k(P, P)
$$
as predicted in the lemma.
Clearly, if $P$ is generated in degrees $P_i$,
$0 \leq i \leq N$, then $\delta$ is determined by
the linear maps $\delta_i : P_i \to P_i$ for
$0 \leq i \leq N$ and we see that
$$
\dim_k \text{Der}_k(P, P) < \infty
$$
as desired.

\medskip\noindent
To finish the proof of the lemma we show that there is a finite
dimensional deformation space. To do this we
choose a presentation
$$
k[X_1, \ldots, X_n]/(F_1, \ldots, F_m) \longrightarrow P
$$
of graded $k$-algebras where $\deg(X_i) = d_i$ and
$F_j$ is homogeneous of degree $e_j$.
Let $Q$ be any graded $k[\epsilon]$-algebra
finite free in each degree which comes with an isomorphsm
$\alpha : Q/\epsilon Q \to P$ so that $(Q, \alpha)$ defines
an element of $T\Deformationcategory_P$.
Choose a homogeneous element $q_i \in Q$ of degree $d_i$
mapping to the image of $X_i$ in $P$.
Then we obtain
$$
k[\epsilon][X_1, \ldots, X_n] \longrightarrow Q,\quad
X_i \longmapsto q_i
$$
and since $P = Q/\epsilon Q$ this map is surjective by Nakayama's lemma.
A small diagram chase shows we can choose homogeneous elements
$F_{\epsilon, j} \in k[\epsilon][X_1, \ldots, X_n]$ of degree $e_j$
mapping to zero in $Q$ and mapping to $F_j$ in $k[X_1, \ldots, X_n]$.
Then
$$
k[\epsilon][X_1, \ldots, X_n]/(F_{\epsilon, 1}, \ldots, F_{\epsilon, m})
\longrightarrow Q
$$
is a presentation of $Q$ by flatness of $Q$ over $k[\epsilon]$.
Write
$$
F_{\epsilon, j} =  F_j + \epsilon G_j
$$
There is some ambiguity in the vector $(G_1, \ldots, G_m)$.
First, using different choices of $F_{\epsilon, j}$
we can modify $G_j$ by an arbitrary element of degree $e_j$
in the kernel of $k[X_1, \ldots, X_n] \to P$.
Hence, instead of $(G_1, \ldots, G_m)$, we remember the
element
$$
(g_1, \ldots, g_m) \in P_{e_1} \oplus \ldots \oplus P_{e_m}
$$
where $g_j$ is the image of $G_j$ in $P_{e_j}$.
Moreover, if we change our choice of $q_i$ into $q_i + \epsilon p_i$
with $p_i$ of degree $d_i$ then a computation (omitted) shows
that $g_j$ changes into
$$
g_j^{new} = g_j - \sum\nolimits_{i = 1}^n p_i \partial F_j / \partial X_i
$$
We conclude that the isomorphism class of $Q$ is determined by the
image of the vector $(G_1, \ldots, G_m)$ in the $k$-vector space
$$
W  = \Coker(P_{d_1} \oplus \ldots \oplus P_{d_n}
\xrightarrow{(\frac{\partial F_j}{\partial X_i})}
P_{e_1} \oplus \ldots \oplus P_{e_m})
$$
In this way we see that we obtain an injection
$$
T\Deformationcategory_P \longrightarrow W
$$
Since $W$ visibly has finite dimension, we conclude that the lemma is true.
\end{proof}

\noindent
In Example \ref{example-graded-algebras} if $P$ is a finitely generated
graded $k$-algebra, then $\Deformationcategory_P$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$
and a fortiori has a (minimal) versal formal object. This follows
from Lemmas \ref{lemma-graded-algebras-RS} and
\ref{lemma-graded-algebras-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-graded-algebras-hull}
In Example \ref{example-graded-algebras} assume $P$ is a finitely generated
graded $k$-algebra. Assume $\Lambda$ is a complete local ring
with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_P(A))/\cong
$$
of isomorphism classes of objects has a hull.
\end{lemma}

\begin{proof}
This follows immediately from Lemmas \ref{lemma-graded-algebras-RS} and
\ref{lemma-graded-algebras-TI} and
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2}
and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}.
\end{proof}







\section{Rings}
\label{section-rings}

\noindent
The deformation theory of rings is the same as the deformation theory
of affine schemes. For rings and schemes when we talk about deformations
it means we are thinking about {\it flat} deformations.

\begin{example}[Rings]
\label{example-rings}
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a pair $(A, P)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$ and a flat $A$-algebra $P$, and
\item a morphism $(f, g) : (B, Q) \to (A, P)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a map $g : Q \to P$ which is $f$-linear and induces an
isomorpism $Q \otimes_{B, f} A \cong P$.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, P)$
to $A$ and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a $k$-algebra $P$, let $x_0 = (k, P)$ be the corresponding object
of $\mathcal{F}(k)$. We set
$$
\Deformationcategory_P = \mathcal{F}_{x_0}
$$
\end{example}

\begin{lemma}
\label{lemma-rings-RS}
Example \ref{example-rings}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_P$ is a deformation category
for any $k$-algebra $P$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.
This is a special case of More on Algebra, Lemma
\ref{more-algebra-lemma-properties-algebras-over-fibre-product}.
\end{proof}

\begin{lemma}
\label{lemma-rings-TI}
In Example \ref{example-rings} let $P$ be a $k$-algebra. Then
$$
T\Deformationcategory_P = \text{Ext}^1_P(\NL_{P/k}, P)
\quad\text{and}\quad
\text{Inf}(\Deformationcategory_P) = \text{Der}_k(P, P)
$$
\end{lemma}

\begin{proof}
Recall that $\text{Inf}(\Deformationcategory_P)$ is the set of
automorphisms of the trivial deformation
$P[\epsilon] = P \otimes_k k[\epsilon]$ of $P$ to $k[\epsilon]$
equal to the identity modulo $\epsilon$.
By Deformation Theory, Lemma \ref{defos-lemma-huge-diagram}
this is equal to $\Hom_P(\Omega_{P/k}, P)$ which in turn is
equal to $\text{Der}_k(P, P)$ by
Algebra, Lemma \ref{algebra-lemma-universal-omega}.

\medskip\noindent
Recall that $T\Deformationcategory_P$ is the set of isomorphism classes
of flat deformations $Q$ of $P$ to $k[\epsilon]$, more precisely,
the set of isomorphism classes of $\Deformationcategory_P(k[\epsilon])$.
Recall that a $k[\epsilon]$-algebra $Q$ with $Q/\epsilon Q = P$
is flat over $k[\epsilon]$ if and only if
$$
0 \to P \xrightarrow{\epsilon} Q \to P \to 0
$$
is exact. This is proven in More on Morphisms, Lemma
\ref{more-morphisms-lemma-deform} and more generally in
Deformation Theory, Lemma \ref{defos-lemma-deform-module}.
Thus we may apply
Deformation Theory, Lemma \ref{defos-lemma-choices}
to see that the set of isomorphism classes of such
deformations is equal to $\text{Ext}^1_P(\NL_{P/k}, P)$.
\end{proof}

\begin{lemma}
\label{lemma-smooth}
In Example \ref{example-rings} let $P$ be a smooth $k$-algebra. Then
$T\Deformationcategory_P = (0)$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-rings-TI} we have to show
$\text{Ext}^1_P(\NL_{P/k}, P) = (0)$.
Since $k \to P$ is smooth $\NL_{P/k}$ is quasi-isomorphic to the
complex consisting of a finite projective
$P$-module placed in degree $0$.
\end{proof}

\begin{lemma}
\label{lemma-finite-type-rings-TI}
In Lemma \ref{lemma-rings-TI} if $P$ is a finite type $k$-algebra, then
\begin{enumerate}
\item $\text{Inf}(\Deformationcategory_P)$ is finite dimensional if and only if
$\dim(P) = 0$, and
\item $T\Deformationcategory_P$ is finite dimensional if
$\Spec(P) \to \Spec(k)$ is smooth except at a finite number of points.
\end{enumerate}
\end{lemma}

\begin{proof}
Proof of (1). We view $\text{Der}_k(P, P)$ as a $P$-module.
If it has finite dimension over $k$, then it has finite length
as a $P$-module, hence it is supported in finitely many
closed points of $\Spec(P)$
(Algebra, Lemma \ref{algebra-lemma-simple-pieces}).
Since $\text{Der}_k(P, P) = \Hom_P(\Omega_{P/k}, P)$
we see that
$\text{Der}_k(P, P)_\mathfrak p = \text{Der}_k(P_\mathfrak p, P_\mathfrak p)$
for any prime $\mathfrak p \subset P$
(this uses Algebra, Lemmas
\ref{algebra-lemma-differentials-localize},
\ref{algebra-lemma-differentials-finitely-presented}, and
\ref{algebra-lemma-hom-from-finitely-presented}).
Let $\mathfrak p$ be a minimal prime ideal of $P$
corresponding to an irreducible component of dimension $d > 0$.
Then $P_\mathfrak p$ is an Artinian local ring
essentially of finite type over $k$ with residue field
and $\Omega_{P_\mathfrak p/k}$ is nonzero for example by
Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}.
Any nonzero finite module over an Artinian local ring
has both a sub and a quotient module isomorphic to the residue field.
Thus we find that
$\text{Der}_k(P_\mathfrak p, P_\mathfrak p) =
\Hom_{P_\mathfrak p}(\Omega_{P_\mathfrak p/k}, P_\mathfrak p)$
is nonzero too. Combining all of the above we find that (1) is true.

\medskip\noindent
Proof of (2). For a prime $\mathfrak p$ of $P$ we will use that
$\NL_{P_\mathfrak p/k} = (\NL_{P/k})_\mathfrak p$
(Algebra, Lemma \ref{algebra-lemma-localize-NL})
and we will
use that
$\text{Ext}_P^1(\NL_{P/k}, P)_\mathfrak p =
\text{Ext}_{P_\mathfrak p}^1(\NL_{P_\mathfrak p/k}, P_\mathfrak p)$
(More on Algebra, Lemma
\ref{more-algebra-lemma-pseudo-coherence-and-base-change-ext}).
Given a prime $\mathfrak p \subset P$
then $k \to P$ is smooth at $\mathfrak p$ if and only if
$(\NL_{P/k})_\mathfrak p$ is quasi-isomorphic
to a finite projective module placed in degree $0$ (this follows
immediately from the definition of a smooth ring map but it also
follows from the stronger Algebra, Lemma \ref{algebra-lemma-smooth-at-point}).

\medskip\noindent
Assume that $P$ is smooth over $k$ at all but finitely many primes.
Then these ``bad'' primes are maximal ideals
$\mathfrak m_1, \ldots, \mathfrak m_n \subset P$ by
Algebra, Lemma \ref{algebra-lemma-finite-type-algebra-finite-nr-primes}
and the fact that the ``bad'' primes form a closed subset of $\Spec(P)$.
For $\mathfrak p \not \in \{\mathfrak m_1, \ldots, \mathfrak m_n\}$
we have $\text{Ext}^1_P(\NL_{P/k}, P)_\mathfrak p = 0$ by the results above.
Thus $\text{Ext}^1_P(\NL_{P/k}, P)$ is a finite $P$-module
whose support is contained in $\{\mathfrak m_1, \ldots, \mathfrak m_r\}$.
By Algebra, Proposition
\ref{algebra-proposition-minimal-primes-associated-primes}
for example, we find that the dimension over $k$ of
$\text{Ext}^1_P(\NL_{P/k}, P)$ is a finite integer combination
of $\dim_k \kappa(\mathfrak m_i)$ and hence finite by
the Hilbert Nullstellensatz
(Algebra, Theorem \ref{algebra-theorem-nullstellensatz}).
\end{proof}

\noindent
In Example \ref{example-rings}, let $P$ be a finite type
$k$-algebra. Then $\Deformationcategory_P$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$ if and only if $\dim(P) = 0$.
Furthermore, $\Deformationcategory_P$ has a versal formal
object if $\Spec(P) \to \Spec(k)$ has finitely many
singular points. This follows from Lemmas \ref{lemma-rings-RS} and
\ref{lemma-finite-type-rings-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-rings-hull}
In Example \ref{example-rings} assume $P$ is a finite type
$k$-algebra such that $\Spec(P) \to \Spec(k)$ is smooth except
at a finite number of points.
Assume $\Lambda$ is a complete local ring with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_P(A))/\cong
$$
of isomorphism classes of objects has a hull.
\end{lemma}

\begin{proof}
This follows immediately from Lemmas \ref{lemma-rings-RS} and
\ref{lemma-finite-type-rings-TI} and
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2}
and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}.
\end{proof}

\begin{lemma}
\label{lemma-localization}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Let $S \subset P$ be a multiplicative subset. There is a natural functor
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{S^{-1}P}
$$
of deformation categories.
\end{lemma}

\begin{proof}
Given a deformation of $P$ we can take the localization
of it to get a deformation of the localization; this is
clear and we encourage the reader to skip the proof. More precisely,
let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e.,
an object of $\Deformationcategory_P$. Let $S_Q \subset Q$ be the
inverse image of $S$. Then
Hence $(A, S_Q^{-1}Q) \to (k, S^{-1}P)$
is the desired object of $\Deformationcategory_{S^{-1}P}$.
\end{proof}

\begin{lemma}
\label{lemma-henselization}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Let $J \subset P$ be an ideal.
Denote $(P^h, J^h)$ the henselization of the pair $(P, J)$.
There is a natural functor
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{P^h}
$$
of deformation categories.
\end{lemma}

\begin{proof}
Given a deformation of $P$ we can take the henselization
of it to get a deformation of the henselization; this is
clear and we encourage the reader to skip the proof. More precisely,
let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e.,
an object of $\Deformationcategory_P$. Denote $J_Q \subset Q$ the inverse
image of $J$ in $Q$. Let $(Q^h, J_Q^h)$ be the henselization of
the pair $(Q, J_Q)$. Recall that $Q \to Q^h$ is flat
(More on Algebra, Lemma \ref{more-algebra-lemma-henselization-flat})
and hence $Q^h$ is flat over $A$.
By More on Algebra, Lemma \ref{more-algebra-lemma-henselization-integral}
we see that the map $Q^h \to P^h$ induces an isomorphism
$Q^h \otimes_A k = Q^h \otimes_Q P = P^h$.
Hence $(A, Q^h) \to (k, P^h)$ is the desired object of
$\Deformationcategory_{P^h}$.
\end{proof}

\begin{lemma}
\label{lemma-strict-henselization}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Assume $P$ is a local ring and let $P^{sh}$ be a strict henselization of $P$.
There is a natural functor
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{P^{sh}}
$$
of deformation categories.
\end{lemma}

\begin{proof}
Given a deformation of $P$ we can take the strict henselization
of it to get a deformation of the strict henselization; this is
clear and we encourage the reader to skip the proof. More precisely,
let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e.,
an object of $\Deformationcategory_P$. Since the kernel of the surjection
$Q \to P$ is nilpotent, we find that $Q$ is a local ring with the
same residue field as $P$. Let $Q^{sh}$ be the strict henselization
of $Q$. Recall that $Q \to Q^{sh}$ is flat
(More on Algebra, Lemma \ref{more-algebra-lemma-dumb-properties-henselization})
and hence $Q^{sh}$ is flat over $A$.
By Algebra, Lemma \ref{algebra-lemma-quotient-strict-henselization}
we see that the map $Q^{sh} \to P^{sh}$ induces an isomorphism
$Q^{sh} \otimes_A k = Q^{sh} \otimes_Q P = P^{sh}$.
Hence $(A, Q^{sh}) \to (k, P^{sh})$ is the desired object of
$\Deformationcategory_{P^{sh}}$.
\end{proof}

\begin{lemma}
\label{lemma-completion}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Assume $P$ Noetherian and let $J \subset P$ be an ideal.
Denote $P^\wedge$ the $J$-adic completion.
There is a natural functor
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{P^\wedge}
$$
of deformation categories.
\end{lemma}

\begin{proof}
Given a deformation of $P$ we can take the completion
of it to get a deformation of the completion; this is
clear and we encourage the reader to skip the proof. More precisely,
let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e.,
an object of $\Deformationcategory_P$. Observe that $Q$ is a Noetherian
ring: the kernel of the surjective ring map $Q \to P$ is
nilpotent and finitely generated and $P$ is Noetherian; apply
Algebra, Lemma \ref{algebra-lemma-completion-Noetherian}.
Denote $J_Q \subset Q$ the inverse
image of $J$ in $Q$. Let $Q^\wedge$ be the $J_Q$-adic completion of $Q$.
Recall that $Q \to Q^\wedge$ is flat
(Algebra, Lemma \ref{algebra-lemma-completion-flat})
and hence $Q^\wedge$ is flat over $A$.
The induced map $Q^\wedge \to P^\wedge$ induces an isomorphism
$Q^\wedge \otimes_A k = Q^\wedge \otimes_Q P = P^\wedge$ by
Algebra, Lemma \ref{algebra-lemma-completion-tensor} for example.
Hence $(A, Q^\wedge) \to (k, P^\wedge)$
is the desired object of $\Deformationcategory_{P^\wedge}$.
\end{proof}

\begin{lemma}
\label{lemma-power-series-rings-TI}
In Lemma \ref{lemma-rings-TI} if $P = k[[x_1, \ldots, x_n]]/(f)$
for some nonzero $f \in (x_1, \ldots, x_n)^2$, then
\begin{enumerate}
\item $\text{Inf}(\Deformationcategory_P)$ is finite dimensional
if and only if $n = 1$, and
\item $T\Deformationcategory_P$ is finite dimensional if
$$
\sqrt{(f, \partial f/\partial x_1, \ldots,  \partial f/\partial x_n)} =
(x_1, \ldots, x_n)
$$
\end{enumerate}
\end{lemma}

\begin{proof}
Proof of (1). Consider the derivations $\partial/\partial x_i$ of
$k[[x_1, \ldots, x_n]]$ over $k$. Write $f_i = \partial f/\partial x_i$.
The derivation
$$
\theta = \sum h_i \partial/\partial x_i
$$
of $k[[x_1, \ldots, x_n]]$
induces a derivation of $P = k[[x_1, \ldots, x_n]]/(f)$
if and only if
$\sum h_i f_i \in (f)$. Moreover, the induced derivation of $P$
is zero if and only if $h_i \in (f)$ for $i = 1, \ldots, n$.
Thus we find
$$
\Ker((f_1, \ldots, f_n) : P^{\oplus n} \longrightarrow P) \subset
\text{Der}_k(P, P)
$$
The left hand side is a finite dimensional $k$-vector space only if
$n = 1$; we omit the proof. We also leave it to the reader to see
that the right hand side has finite dimension if $n = 1$.
This proves (1).

\medskip\noindent
Proof of (2). Let $Q$ be a flat deformation of $P$ over $k[\epsilon]$
as in the proof of Lemma \ref{lemma-rings-TI}. Choose lifts $q_i \in Q$
of the image of $x_i$ in $P$. Then $Q$ is a complete local ring
with maximal ideal generated by $q_1, \ldots, q_n$ and $\epsilon$
(small argument omitted). Thus we get a surjection
$$
k[\epsilon][[x_1, \ldots, x_n]] \longrightarrow Q,\quad
x_i \longmapsto q_i
$$
Choose an element of the form
$f + \epsilon g \in k[\epsilon][[x_1, \ldots, x_n]]$
mapping to zero in $Q$. Observe that $g$ is well defined modulo $(f)$.
Since $Q$ is flat over $k[\epsilon]$ we get
$$
Q = k[\epsilon][[x_1, \ldots, x_n]]/(f + \epsilon g)
$$
Finally, if we changing the choice of $q_i$ amounts to
changing the coordinates $x_i$ into $x_i + \epsilon h_i$
for some $h_i \in k[[x_1, \ldots, x_n]]$. Then
$f + \epsilon g$ changes into $f + \epsilon (g + \sum h_i f_i)$
where $f_i = \partial f/\partial x_i$. Thus we see that the
isomorphism class of the deformation $Q$ is determined
by an element of
$$
k[[x_1, \ldots, x_n]]/
(f, \partial f/\partial x_1, \ldots,  \partial f/\partial x_n)
$$
This has finite dimension over $k$ if and only if
its support is the closed point of $k[[x_1, \ldots, x_n]]$
if and only if
$\sqrt{(f, \partial f/\partial x_1, \ldots,  \partial f/\partial x_n)} =
(x_1, \ldots, x_n)$.
\end{proof}






\section{Schemes}
\label{section-schemes}

\noindent
The deformation theory of schemes.

\begin{example}[Schemes]
\label{example-schemes}
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a pair $(A, X)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$ and a scheme $X$ flat over $A$, and
\item a morphism $(f, g) : (B, Y) \to (A, X)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a morphism $g : X \to Y$ such that
$$
\xymatrix{
X \ar[r]_g \ar[d] & Y \ar[d] \\
\Spec(A) \ar[r]^f & \Spec(B)
}
$$
is a cartesian commutative diagram of schemes.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, X)$
to $A$ and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a scheme $X$ over $k$, let $x_0 = (k, X)$ be the corresponding object
of $\mathcal{F}(k)$. We set
$$
\Deformationcategory_X = \mathcal{F}_{x_0}
$$
\end{example}

\begin{lemma}
\label{lemma-schemes-RS}
Example \ref{example-schemes}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_X$ is a deformation category
for any scheme $X$ over $k$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.
Observe that
$$
\xymatrix{
\Spec(A) \ar[r] \ar[d] & \Spec(A_2) \ar[d] \\
\Spec(A_1) \ar[r] &
\Spec(A_1 \times_A A_2)
}
$$
is a pushout diagram as in More on Morphisms, Lemma
\ref{more-morphisms-lemma-pushout-along-thickening}.
Thus the lemma is a special case of More on Morphisms, Lemma
\ref{more-morphisms-lemma-equivalence-categories-schemes-over-pushout-flat}.
\end{proof}

\begin{lemma}
\label{lemma-schemes-TI}
In Example \ref{example-schemes} let $X$ be a scheme over $k$. Then
$$
\text{Inf}(\Deformationcategory_X) =
\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X) =
\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) =
\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X)
$$
and
$$
T\Deformationcategory_X =
\text{Ext}^1_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)
$$
\end{lemma}

\begin{proof}
Recall that $\text{Inf}(\Deformationcategory_X)$ is the set of
automorphisms of the trivial deformation
$X' = X \times_{\Spec(k)} \Spec(k[\epsilon])$ of $X$ to $k[\epsilon]$
equal to the identity modulo $\epsilon$.
By Deformation Theory, Lemma \ref{defos-lemma-deform}
this is equal to $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$.
The equality $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X) =
\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X)$ follows from
More on Morphisms, Lemma
\ref{more-morphisms-lemma-netherlander-quasi-coherent}.
The equality
$\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) =
\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X)$
follows from Morphisms, Lemma
\ref{morphisms-lemma-universal-derivation-universal}.

\medskip\noindent
Recall that $T_{x_0}\Deformationcategory_X$ is the set of isomorphism classes
of flat deformations $X'$ of $X$ to $k[\epsilon]$, more precisely,
the set of isomorphism classes of $\Deformationcategory_X(k[\epsilon])$.
Thus the second statement of the lemma follows from
Deformation Theory, Lemma \ref{defos-lemma-deform}.
\end{proof}

\begin{lemma}
\label{lemma-proper-schemes-TI}
In Lemma \ref{lemma-schemes-TI} if $X$ is proper over $k$, then
$\text{Inf}(\Deformationcategory_X)$ and $T\Deformationcategory_X$ are
finite dimensional.
\end{lemma}

\begin{proof}
By the lemma we have to show
$\Ext^1_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ and
$\Ext^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ are finite
dimensional. By More on Morphisms, Lemma
\ref{more-morphisms-lemma-netherlander-fp}
and the fact that $X$ is Noetherian, we see that
$\NL_{X/k}$ has coherent cohomology sheaves zero except
in degrees $0$ and $-1$.
By Derived Categories of Schemes, Lemma \ref{perfect-lemma-ext-finite}
the displayed $\Ext$-groups are finite $k$-vector spaces
and the proof is complete.
\end{proof}

\noindent
In Example \ref{example-schemes} if $X$ is a proper scheme over $k$,
then $\Deformationcategory_X$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$
and a fortiori has a (minimal) versal formal object. This follows
from Lemmas \ref{lemma-schemes-RS} and
\ref{lemma-proper-schemes-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-schemes-hull}
In Example \ref{example-schemes} assume $X$ is a proper $k$-scheme.
Assume $\Lambda$ is a complete local ring with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_X(A))/\cong
$$
of isomorphism classes of objects has a hull. If
$\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$, then
$F$ is prorepresentable.
\end{lemma}

\begin{proof}
The existence of a hull follows immediately from
Lemmas \ref{lemma-schemes-RS} and \ref{lemma-proper-schemes-TI} and
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2}
and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}.

\medskip\noindent
Assume $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$. Then
$\Deformationcategory_X$ and $F$ are equivalent by
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-infdef-trivial}.
Hence $F$ is a deformation functor (because $\Deformationcategory_X$ is a
deformation category) with finite tangent space and we can apply
Formal Deformation Theory, Theorem
\ref{formal-defos-theorem-Schlessinger-prorepresentability}.
\end{proof}

\begin{lemma}
\label{lemma-open}
In Example \ref{example-schemes} let $X$ be a scheme over $k$.
Let $U \subset X$ be an open subscheme.
There is a natural functor
$$
\Deformationcategory_X \longrightarrow \Deformationcategory_U
$$
of deformation categories.
\end{lemma}

\begin{proof}
Given a deformation of $X$ we can take the corresponding open
of it to get a deformation of $U$. We omit the details.
\end{proof}

\begin{lemma}
\label{lemma-affine}
In Example \ref{example-schemes} let $X = \Spec(P)$ be an
affine scheme over $k$. With $\Deformationcategory_P$ as in
Example \ref{example-rings} there is a natural equivalence
$$
\Deformationcategory_X \longrightarrow \Deformationcategory_P
$$
of deformation categories.
\end{lemma}

\begin{proof}
The functor sends $(A, Y)$ to $\Gamma(Y, \mathcal{O}_Y)$.
This works because
any deformation of $X$ is affine by
More on Morphisms, Lemma \ref{more-morphisms-lemma-thickening-affine-scheme}.
\end{proof}

\begin{lemma}
\label{lemma-local-ring}
In Example \ref{example-schemes} let $X$ be a scheme over $k$
Let $p \in X$ be a point. With $\Deformationcategory_{\mathcal{O}_{X, p}}$
as in Example \ref{example-rings} there is a natural functor
$$
\Deformationcategory_X
\longrightarrow
\Deformationcategory_{\mathcal{O}_{X, p}}
$$
of deformation categories.
\end{lemma}

\begin{proof}
Choose an affine open $U = \Spec(P) \subset X$ containing $p$.
Then $\mathcal{O}_{X, p}$ is a localization of $P$. We combine
the functors from
Lemmas \ref{lemma-open}, \ref{lemma-affine}, and \ref{lemma-localization}.
\end{proof}

\begin{situation}
\label{situation-glueing}
Let $\Lambda \to k$ be as in Section \ref{section-general}.
Let $X$ be a scheme over $k$ which has an affine open covering
$X = U_1 \cup U_2$ with $U_{12} = U_1 \cap U_2$ affine too.
Write $U_1 = \Spec(P_1)$, $U_2 = \Spec(P_2)$ and $U_{12} = \Spec(P_{12})$.
Let $\Deformationcategory_X$, $\Deformationcategory_{U_1}$,
$\Deformationcategory_{U_2}$, and $\Deformationcategory_{U_{12}}$
be as in Example \ref{example-schemes} and let
$\Deformationcategory_{P_1}$, $\Deformationcategory_{P_2}$, and
$\Deformationcategory_{P_{12}}$ be as in Example \ref{example-rings}.
\end{situation}

\begin{lemma}
\label{lemma-glueing}
In Situation \ref{situation-glueing}
there is an equivalence
$$
\Deformationcategory_X =
\Deformationcategory_{P_1}
\times_{\Deformationcategory_{P_{12}}}
\Deformationcategory_{P_2}
$$
of deformation categories, see Examples \ref{example-schemes} and
\ref{example-rings}.
\end{lemma}

\begin{proof}
It suffices to show that the functors of Lemma \ref{lemma-open}
define an equivalence
$$
\Deformationcategory_X \longrightarrow
\Deformationcategory_{U_1}
\times_{\Deformationcategory_{U_{12}}}
\Deformationcategory_{U_2}
$$
because then we can apply Lemma \ref{lemma-affine} to translate into rings.
To do this we construct a quasi-inverse. Denote
$F_i : \Deformationcategory_{U_i} \to \Deformationcategory_{U_{12}}$
the functor of Lemma \ref{lemma-open}.
An object of the RHS is given by an $A$ in $\mathcal{C}_\Lambda$,
objects $(A, V_1) \to (k, U_1)$ and $(A, V_2) \to (k, U_2)$, and
a morphism
$$
g : F_1(A, V_1) \to F_2(A, V_2)
$$
Now $F_i(A, V_i) = (A, V_{i, 3 - i})$ where $V_{i, 3 - i} \subset V_i$
is the open subscheme whose base change to $k$ is $U_{12} \subset U_i$.
The morphism $g$ defines an isomorphism
$V_{1, 2} \to V_{2, 1}$ of schemes over $A$ compatible
with $\text{id} : U_{12} \to U_{12}$ over $k$.
Thus $(\{1, 2\}, V_i, V_{i, 3 - i}, g, g^{-1})$ is a glueing
data as in Schemes, Section \ref{schemes-section-glueing-schemes}.
Let $Y$ be the glueing, see Schemes, Lemma \ref{schemes-lemma-glue}.
Then $Y$ is a scheme over $A$ and the
compatibilities mentioned above show that
there is a canonical isomorphism
$Y \times_{\Spec(A)} \Spec(k) = X$.
Thus $(A, Y) \to (k, X)$ is an object of $\Deformationcategory_X$.
We omit the verification that this construction is a functor
and is quasi-inverse to the given one.
\end{proof}






\section{Morphisms of Schemes}
\label{section-schemes-morphisms}

\noindent
The deformation theory of morphisms of schemes.
Of course this is just an example of
deformations of diagrams of schemes.

\begin{example}[Morphisms of schemes]
\label{example-schemes-morphisms}
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a pair $(A, X \to Y)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$ and a morphism
$X \to Y$ of schemes over $A$ with both $X$ and $Y$ flat over $A$, and
\item a morphism $(f, g, h) : (A', X' \to Y') \to (A, X \to Y)$ consists of
a morphism $f : A' \to A$ in $\mathcal{C}_\Lambda$ together
with morphisms of schemes $g : X \to X'$ and $h : Y \to Y'$ such that
$$
\xymatrix{
X \ar[r]_g \ar[d] & X' \ar[d] \\
Y \ar[r]_h \ar[d] & Y' \ar[d] \\
\Spec(A) \ar[r]^f & \Spec(A')
}
$$
is a commutative diagram of schemes where both squares are cartesian.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, X \to Y)$
to $A$ and $(f, g, h)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given a morphism of schemes $X \to Y$ over $k$, let $x_0 = (k, X \to Y)$
be the corresponding object of $\mathcal{F}(k)$. We set
$$
\Deformationcategory_{X \to Y} = \mathcal{F}_{x_0}
$$
\end{example}

\begin{lemma}
\label{lemma-schemes-morphisms-RS}
Example \ref{example-schemes-morphisms}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_{X \to Y}$ is a deformation category
for any morphism of schemes $X \to Y$ over $k$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.
Observe that
$$
\xymatrix{
\Spec(A) \ar[r] \ar[d] & \Spec(A_2) \ar[d] \\
\Spec(A_1) \ar[r] &
\Spec(A_1 \times_A A_2)
}
$$
is a pushout diagram as in More on Morphisms, Lemma
\ref{more-morphisms-lemma-pushout-along-thickening}.
Thus the lemma follows immediately from
More on Morphisms, Lemma
\ref{more-morphisms-lemma-equivalence-categories-schemes-over-pushout-flat}
as this describes the category of schemes flat over $A_1 \times_A A_2$
as the fibre product of the category of schemes flat over $A_1$
with the category of schemes flat over $A_2$ over the category of
schemes flat over $A$.
\end{proof}

\begin{lemma}
\label{lemma-schemes-morphisms-TI}
In Example \ref{example-schemes} let $f : X \to Y$ be a morphism of schemes
over $k$. There is a canonical exact sequence of $k$-vector spaces
$$
\xymatrix{
0 \ar[r] &
\text{Inf}(\Deformationcategory_{X \to Y}) \ar[r] &
\text{Inf}(\Deformationcategory_X \times \Deformationcategory_Y) \ar[r] &
\text{Der}_k(\mathcal{O}_Y, f_*\mathcal{O}_X) \ar[lld] \\
& T\Deformationcategory_{X \to Y} \ar[r] &
T(\Deformationcategory_X \times \Deformationcategory_Y) \ar[r] &
\text{Ext}^1_{\mathcal{O}_X}(Lf^*\NL_{Y/k}, \mathcal{O}_X)
}
$$
\end{lemma}

\begin{proof}
The obvious map of deformation categories
$\Deformationcategory_{X \to Y} \to
\Deformationcategory_X \times \Deformationcategory_Y$
gives two of the arrows in the exact sequence of the lemma.
Recall that $\text{Inf}(\Deformationcategory_{X \to Y})$
is the set of automorphisms of the trivial deformation
$$
f' :  X' = X \times_{\Spec(k)} \Spec(k[\epsilon])
\xrightarrow{f \times \text{id}}
Y' = Y \times_{\Spec(k)} \Spec(k[\epsilon])
$$
of $X \to Y$ to $k[\epsilon]$ equal to the identity modulo $\epsilon$.
This is clearly the same thing as pairs
$(\alpha, \beta) \in
\text{Inf}(\Deformationcategory_X \times \Deformationcategory_Y)$
of infinitesimal automorphisms of $X$ and $Y$ compatible with $f'$, i.e.,
such that $f' \circ \alpha = \beta \circ f'$.
By Deformation Theory, Lemma \ref{defos-lemma-huge-diagram-ringed-spaces}
for an arbitrary pair $(\alpha, \beta)$ the difference between
the morphism $f' : X' \to Y'$ and the morphism
$\beta^{-1} \circ f' \circ \alpha : X' \to Y'$ defines an elment
in
$$
\text{Der}_k(\mathcal{O}_Y, f_*\mathcal{O}_X) =
\Hom_{\mathcal{O}_Y}(\Omega_{Y/k}, f_*\mathcal{O}_X)
$$
Equality by More on Morphisms, Lemma
\ref{more-morphisms-lemma-netherlander-quasi-coherent}.
This defines the last top horizontal arrow and shows exactness
in the first two places. For the map
$$
\text{Der}_k(\mathcal{O}_Y, f_*\mathcal{O}_X)
\to
T\Deformationcategory_{X \to Y}
$$
we interpret elements of the source as morphisms
$f_\epsilon : X' \to Y'$ over $\Spec(k[\epsilon])$
equal to $f$ modulo $\epsilon$
using Deformation Theory, Lemma \ref{defos-lemma-huge-diagram-ringed-spaces}.
We send $f_\epsilon$ to the isomorphism class of
$(f_\epsilon : X' \to Y')$ in $T\Deformationcategory_{X \to Y}$.
Note that $(f_\epsilon : X' \to Y')$ is isomorphic to the
trivial deformation $(f' : X' \to Y')$ exactly when
$f_\epsilon  = \beta^{-1} \circ f \circ \alpha$ for some
pair $(\alpha, \beta)$ which implies exactness in the third spot.
Clearly, if some first order deformation
$(f_\epsilon : X_\epsilon \to Y_\epsilon)$
maps to zero in $T(\Deformationcategory_X \times \Deformationcategory_Y)$,
then we can choose isomorphisms $X' \to X_\epsilon$ and $Y' \to Y_\epsilon$
and we conclude we are in the image of the south-west arrow.
Therefore we have exactness at the fourth spot.
Finally, given two first order deformations $X_\epsilon$, $Y_\epsilon$
of $X$, $Y$ there is an obstruction in
$$
ob(X_\epsilon, Y_\epsilon) \in
\text{Ext}^1_{\mathcal{O}_X}(Lf^*\NL_{Y/k}, \mathcal{O}_X)
$$
which vanishes if and only if $f : X \to Y$ lifts to
$X_\epsilon \to Y_\epsilon$, see
Deformation Theory, Lemma \ref{defos-lemma-huge-diagram-ringed-spaces}.
This finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-proper-schemes-morphisms-TI}
In Lemma \ref{lemma-schemes-morphisms-TI} if $X$ and $Y$ are both
proper over $k$, then
$\text{Inf}(\Deformationcategory_{X \to Y})$ and
$T\Deformationcategory_{X \to Y}$ are finite dimensional.
\end{lemma}

\begin{proof}
Omitted. Hint: argue as in Lemma \ref{lemma-proper-schemes-TI}
and use the exact sequence of the lemma.
\end{proof}

\noindent
In Example \ref{example-schemes-morphisms}
if $X \to Y$ is a morphism of proper schemes over $k$,
then $\Deformationcategory_{X \to Y}$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$
and a fortiori has a (minimal) versal formal object. This follows
from Lemmas \ref{lemma-schemes-morphisms-RS} and
\ref{lemma-proper-schemes-morphisms-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-schemes-morphisms-hull}
In Example \ref{example-schemes-morphisms} assume $X \to Y$
is a morphism of proper $k$-schemes.
Assume $\Lambda$ is a complete local ring with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_{X \to Y}(A))/\cong
$$
of isomorphism classes of objects has a hull. If
$\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) =
\text{Der}_k(\mathcal{O}_Y, \mathcal{O}_Y) = 0$, then
$F$ is prorepresentable.
\end{lemma}

\begin{proof}
The existence of a hull follows immediately from
Lemmas \ref{lemma-schemes-morphisms-RS} and
\ref{lemma-proper-schemes-morphisms-TI} and
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2}
and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}.

\medskip\noindent
Assume $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) =
\text{Der}_k(\mathcal{O}_Y, \mathcal{O}_Y) = 0$. Then
the exact sequence of Lemma \ref{lemma-schemes-morphisms-TI}
combined with Lemma \ref{lemma-schemes-TI}
shows that $\text{Inf}(\Deformationcategory_{X \to Y}) = 0$.
Then $\Deformationcategory_{X \to Y}$ and $F$ are equivalent by
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-infdef-trivial}.
Hence $F$ is a deformation functor (because
$\Deformationcategory_{X \to Y}$ is a
deformation category) with finite tangent space and we can apply
Formal Deformation Theory, Theorem
\ref{formal-defos-theorem-Schlessinger-prorepresentability}.
\end{proof}

\begin{lemma}
\label{lemma-schemes-morphisms-smooth-to-base}
\begin{reference}
This is discussed in \cite[Section 5.3]{Ravi-Murphys-Law} and
\cite[Theorem 3.3]{Ran-deformations}.
\end{reference}
In Example \ref{example-schemes} let $f : X \to Y$ be a morphism of schemes
over $k$. If $f_*\mathcal{O}_X = \mathcal{O}_Y$ and $R^1f_*\mathcal{O}_X = 0$,
then the morphism of deformation categories
$$
\Deformationcategory_{X \to Y} \to \Deformationcategory_X
$$
is an equivalence.
\end{lemma}

\begin{proof}
We construct a quasi-inverse to the forgetful functor of the lemma.
Namely, suppose that $(A, U)$ is an object of $\Deformationcategory_X$.
The given map $X \to U$ is a finite order thickening and we can use
it to identify the underlying topological spaces of $U$ and $X$, see
More on Morphisms, Section \ref{more-morphisms-section-thickenings}.
Thus we may and do think of $\mathcal{O}_U$ as a sheaf of
$A$-algebras on $X$; moreover the fact that $U \to \Spec(A)$ is
flat, means that $\mathcal{O}_U$ is flat as a sheaf of $A$-modules.
In particular, we have a filtration
$$
0 = \mathfrak m_A^n\mathcal{O}_U \subset
\mathfrak m_A^{n - 1}\mathcal{O}_U \subset \ldots \subset
\mathfrak m_A^2\mathcal{O}_U \subset
\mathfrak m_A\mathcal{O}_U \subset \mathcal{O}_U
$$
with subquotients equal to
$\mathcal{O}_X \otimes_k \mathfrak m_A^i/\mathfrak m_A^{i + 1}$
by flatness, see More on Morphisms, Lemma \ref{more-morphisms-lemma-deform}
or the more general Deformation Theory, Lemma \ref{defos-lemma-deform-module}.
Set
$$
\mathcal{O}_V = f_*\mathcal{O}_U
$$
viewed as sheaf of $A$-algebras on $Y$. Since
$R^1f_*\mathcal{O}_X = 0$ we find by the description above that
$R^1f_*(\mathfrak m_A^i\mathcal{O}_U/\mathfrak m_A^{i + 1}\mathcal{O}_U) = 0$
for all $i$. This implies that the sequences
$$
0 \to
(f_*\mathcal{O}_X) \otimes_k \mathfrak m_A^i/\mathfrak m_A^{i + 1} \to
f_*(\mathcal{O}_U/\mathfrak m_A^{i + 1}\mathcal{O}_U) \to
f_*(\mathcal{O}_U/\mathfrak m_A^i\mathcal{O}_U) \to 0
$$
are exact for all $i$. Reading the references given above backwards
(and using induction) we find that $\mathcal{O}_V$ is a flat
sheaf of $A$-algebras with
$\mathcal{O}_V/\mathfrak m_A\mathcal{O}_V = \mathcal{O}_Y$.
Using More on Morphisms, Lemma
\ref{more-morphisms-lemma-first-order-thickening}
we find that $(Y, \mathcal{O}_V)$ is a scheme, call it $V$.
The equality $\mathcal{O}_V = f_*\mathcal{O}_U$ defines a
morphism of ringed spaces $U \to V$ which is easily seen to be
a morphism of schemes. This finishes the proof by the
flatness already established.
\end{proof}







\section{Algebraic spaces}
\label{section-algebraic-spaces}

\noindent
The deformation theory of algebraic spaces.

\begin{example}[Algebraic spaces]
\label{example-spaces}
Let $\mathcal{F}$ be the category defined as follows
\begin{enumerate}
\item an object is a pair $(A, X)$ consisting of an
object $A$ of $\mathcal{C}_\Lambda$ and an algebraic space
$X$ flat over $A$, and
\item a morphism $(f, g) : (B, Y) \to (A, X)$ consists of
a morphism $f : B \to A$ in $\mathcal{C}_\Lambda$ together
with a morphism $g : X \to Y$ of algebraic spaces over $\Lambda$
such that
$$
\xymatrix{
X \ar[r]_g \ar[d] & Y \ar[d] \\
\Spec(A) \ar[r]^f & \Spec(B)
}
$$
is a cartesian commutative diagram of algebraic spaces.
\end{enumerate}
The functor $p : \mathcal{F} \to \mathcal{C}_\Lambda$ sends $(A, X)$
to $A$ and $(f, g)$ to $f$. It is clear that $p$ is cofibred in groupoids.
Given an algebraic space $X$ over $k$, let
$x_0 = (k, X)$ be the corresponding object of $\mathcal{F}(k)$. We set
$$
\Deformationcategory_X = \mathcal{F}_{x_0}
$$
\end{example}

\begin{lemma}
\label{lemma-spaces-RS}
Example \ref{example-spaces}
satisfies the Rim-Schlessinger condition (RS).
In particular, $\Deformationcategory_X$ is a deformation category
for any algebraic space $X$ over $k$.
\end{lemma}

\begin{proof}
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$.
Assume $A_2 \to A$ is surjective. According to
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-RS-2-categorical}
it suffices to show that the functor
$\mathcal{F}(A_1 \times_A A_2) \to
\mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$
is an equivalence of categories.
Observe that
$$
\xymatrix{
\Spec(A) \ar[r] \ar[d] & \Spec(A_2) \ar[d] \\
\Spec(A_1) \ar[r] &
\Spec(A_1 \times_A A_2)
}
$$
is a pushout diagram as in Pushouts of Spaces, Lemma
\ref{spaces-pushouts-lemma-pushout-along-thickening}.
Thus the lemma is a special case of Pushouts of Spaces, Lemma
\ref{spaces-pushouts-lemma-equivalence-categories-spaces-pushout-flat}.
\end{proof}

\begin{lemma}
\label{lemma-spaces-TI}
In Example \ref{example-spaces} let $X$ be an algebraic space over $k$. Then
$$
\text{Inf}(\Deformationcategory_X) =
\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X) =
\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) =
\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X)
$$
and
$$
T\Deformationcategory_X =
\text{Ext}^1_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)
$$
\end{lemma}

\begin{proof}
Recall that $\text{Inf}(\Deformationcategory_X)$ is the set of
automorphisms of the trivial deformation
$X' = X \times_{\Spec(k)} \Spec(k[\epsilon])$ of $X$ to $k[\epsilon]$
equal to the identity modulo $\epsilon$.
By Deformation Theory, Lemma \ref{defos-lemma-deform-spaces}
this is equal to $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$.
The equality $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X) =
\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X)$ follows from
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-netherlander-quasi-coherent}.
The equality
$\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) =
\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X)$
follows from More on Morphisms of Spaces, Definition
\ref{spaces-more-morphisms-definition-sheaf-differentials} and
Modules on Sites, Definition
\ref{sites-modules-definition-module-differentials}.

\medskip\noindent
Recall that $T_{x_0}\Deformationcategory_X$ is the set of isomorphism classes
of flat deformations $X'$ of $X$ to $k[\epsilon]$, more precisely,
the set of isomorphism classes of $\Deformationcategory_X(k[\epsilon])$.
Thus the second statement of the lemma follows from
Deformation Theory, Lemma \ref{defos-lemma-deform-spaces}.
\end{proof}

\begin{lemma}
\label{lemma-proper-spaces-TI}
In Lemma \ref{lemma-spaces-TI} if $X$ is proper over $k$, then
$\text{Inf}(\Deformationcategory_X)$ and $T\Deformationcategory_X$ are
finite dimensional.
\end{lemma}

\begin{proof}
By the lemma we have to show
$\Ext^1_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ and
$\Ext^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ are finite
dimensional. By More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-netherlander-fp}
and the fact that $X$ is Noetherian, we see that
$\NL_{X/k}$ has coherent cohomology sheaves zero except
in degrees $0$ and $-1$.
By Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-ext-finite}
the displayed $\Ext$-groups are finite $k$-vector spaces
and the proof is complete.
\end{proof}

\noindent
In Example \ref{example-spaces} if $X$ is a proper algebraic space over $k$,
then $\Deformationcategory_X$
admits a presentation by a smooth prorepresentable groupoid in functors
over $\mathcal{C}_\Lambda$
and a fortiori has a (minimal) versal formal object. This follows
from Lemmas \ref{lemma-spaces-RS} and
\ref{lemma-proper-spaces-TI}
and the general discussion in Section \ref{section-general}.

\begin{lemma}
\label{lemma-spaces-hull}
In Example \ref{example-spaces} assume $X$ is a proper algebraic space over $k$.
Assume $\Lambda$ is a complete local ring with residue field $k$
(the classical case). Then the functor
$$
F : \mathcal{C}_\Lambda \longrightarrow \textit{Sets},\quad
A \longmapsto \Ob(\Deformationcategory_X(A))/\cong
$$
of isomorphism classes of objects has a hull. If
$\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$, then
$F$ is prorepresentable.
\end{lemma}

\begin{proof}
The existence of a hull follows immediately from
Lemmas \ref{lemma-spaces-RS} and \ref{lemma-proper-spaces-TI} and
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2}
and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}.

\medskip\noindent
Assume $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$. Then
$\Deformationcategory_X$ and $F$ are equivalent by
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-infdef-trivial}.
Hence $F$ is a deformation functor (because $\Deformationcategory_X$ is a
deformation category) with finite tangent space and we can apply
Formal Deformation Theory, Theorem
\ref{formal-defos-theorem-Schlessinger-prorepresentability}.
\end{proof}





\section{Deformations of completions}
\label{section-compare}

\noindent
In this section we compare the deformation problem posed
by an algebra and its completion.
We first discuss ``liftability''.

\begin{lemma}
\label{lemma-lift-equivalence-module-derived}
Let $A' \to A$ be a surjection of rings with nilpotent kernel.
Let $A' \to P'$ be a flat ring map.
Set $P = P' \otimes_{A'} A$.
Let $M$ be an $A$-flat $P$-module.
Then the following are equivalent
\begin{enumerate}
\item there is an $A'$-flat $P'$-module $M'$ with
$M' \otimes_{P'} P = M$, and
\item there is an object $K' \in D^-(P')$ with
$K' \otimes_{P'}^\mathbf{L} P = M$.
\end{enumerate}
\end{lemma}

\begin{proof}
Suppose that $M'$ is as in (1). Then
$$
M = M' \otimes_P P' = M' \otimes_{A'} A =
M' \otimes_A^\mathbf{L} A' = M' \otimes_{P'}^\mathbf{L} P
$$
The first two equalities are clear, the third holds because
$M'$ is flat over $A'$, and the fourth holds by
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-comparison}.
Thus (2) holds. Conversely, suppose $K'$ is as in (2).
We may and do assume $M$ is nonzero.
Let $t$ be the largest integer such that $H^t(K')$ is nonzero
(exists because $M$ is nonzero).
Then $H^t(K') \otimes_{P'} P = H^t(K' \otimes_{P'}^\mathbf{L} P)$
is zero if $t > 0$. Since the kernel of $P' \to P$ is nilpotent
this implies $H^t(K') = 0$ by Nakayama's lemma a contradiction.
Hence $t = 0$ (the case $t < 0$ is absurd as well).
Then $M' = H^0(K')$ is a $P'$-module such that $M = M' \otimes_{P'} P$
and the spectral sequence for Tor gives an injective map
$$
\text{Tor}_1^{P'}(M', P) \to H^{-1}(M' \otimes_{P'}^\mathbf{L} P) = 0
$$
By the reference on derived base change above
$0 = \text{Tor}_1^{P'}(M', P) = \text{Tor}_1^{A'}(M', A)$.
We conclude that $M'$ is $A'$-flat by
Algebra, Lemma \ref{algebra-lemma-what-does-it-mean}.
\end{proof}

\begin{lemma}
\label{lemma-lift-equivalence-module}
Consider a commutative diagram of Noetherian rings
$$
\xymatrix{
A' \ar[d] \ar[r] &
P' \ar[d] \ar[r] &
Q' \ar[d] \\
A \ar[r] &
P \ar[r] &
Q
}
$$
with cartesian squares, with flat horizontal arrows, and with
surjective vertial arrows whose kernels are nilpotent.
Let $J' \subset P'$ be an ideal such that $P'/J' = Q'/J'Q'$.
Let $M$ be an $A$-flat $P$-module.
Assume for all $g \in J'$ there exists an $A'$-flat $(P')_g$-module
lifting $M_g$. Then the following are equivalent
\begin{enumerate}
\item $M$ has an $A'$-flat lift to a $P'$-module, and
\item $M \otimes_P Q$ has an $A'$-flat lift to a $Q'$-module.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $I = \Ker(A' \to A)$. By induction on the integer $n > 1$
such that $I^n = 0$ we reduce to the case where $I$ is an ideal
of square zero; details omitted.
We translate the condition of liftability of
$M$ into the problem of finding an object of $D^-(P')$ as in
Lemma \ref{lemma-lift-equivalence-module-derived}.
The obstruction to doing this is the element
$$
\omega(M) \in \text{Ext}^2_P(M, M \otimes_P^\mathbf{L} IP) =
\text{Ext}^2_P(M, M \otimes_P IP)
$$
constructed in
Deformation Theory, Lemma \ref{defos-lemma-canonical-class-algebra}.
The equality in the displayed formula holds as
$M \otimes_P^\mathbf{L} IP = M \otimes_P IP$
since $M$ and $P$ are $A$-flat\footnote{Choose a resolution
$F_\bullet \to I$ by free $A$-modules. Since $A \to P$ is flat,
$P \otimes_A F_\bullet$ is a free resolution of $IP$.
Hence $M \otimes_P^\mathbf{L} IP$ is represented by
$M \otimes_P P \otimes_A F_\bullet = M \otimes_A F_\bullet$.
This only has cohomology in degree $0$ as $M$ is $A$-flat.}.
The obstruction for lifting $M \otimes_P Q$ is similarly
the element
$$
\omega(M \otimes_P Q) \in
\text{Ext}^2_Q(M \otimes_P Q, (M \otimes_P Q) \otimes_Q IQ)
$$
which is the image of $\omega(M)$ by the functoriality
of the construction $\omega(-)$ of
Deformation Theory, Lemma \ref{defos-lemma-canonical-class-algebra}.
By More on Algebra, Lemma \ref{more-algebra-lemma-base-change-RHom}
we have
$$
\text{Ext}^2_Q(M \otimes_P Q, (M \otimes_P Q) \otimes_Q IQ) =
\text{Ext}^2_P(M, M \otimes_P IP) \otimes_P Q
$$
here we use that $P$ is Noetherian and $M$ finite.
Our assumption on $P' \to Q'$ guarantees that for an $P$-module $E$
the map $E \to E \otimes_P Q$ is bijective on $J'$-power torsion, see
More on Algebra, Lemma
\ref{more-algebra-lemma-neighbourhood-equivalence}.
Thus we conclude that it suffices to show $\omega(M)$
is $J'$-power torsion. In other words, it suffices to show that
$\omega(M)$ dies in
$$
\text{Ext}^2_P(M, M \otimes_P IP)_g =
\text{Ext}^2_{P_g}(M_g, M_g \otimes_{P_g} IP_g)
$$
for all $g \in J'$. Howeover, by the compatibility of formation of $\omega(M)$
with base change again, we conclude that this is true as $M_g$
is assumed to have a lift (of course you have to use the whole
string of equivalences again).
\end{proof}

\begin{lemma}
\label{lemma-lift-equivalence}
Let $A' \to A$ be a surjective map of Noetherian rings with nilpotent kernel.
Let $A \to B$ be a finite type flat ring map.
Let $\mathfrak b \subset B$ be an ideal such that
$\Spec(B) \to \Spec(A)$ is syntomic on the complement of $V(\mathfrak b)$.
Then $B$ has a flat lift to $A'$ if and only if the $\mathfrak b$-adic
completion $B^\wedge$ has a flat lift to $A'$.
\end{lemma}

\begin{proof}
Choose an $A$-algebra surjection $P = A[x_1, \ldots, x_n] \to B$.
Let $\mathfrak p \subset P$ be the inverse image of $\mathfrak b$.
Set $P' = A'[x_1, \ldots, x_n]$ and denote $\mathfrak p' \subset P'$
the inverse image of $\mathfrak p$. (Of course $\mathfrak p$
and $\mathfrak p'$ do not designate prime ideals here.)
We will denote $P^\wedge$ and $(P')^\wedge$ the respective completions.

\medskip\noindent
Suppose $A' \to B'$ is a flat lift of $A \to B$, in other words,
$A' \to B'$ is flat and there is an $A$-algebra isomorphism
$B = B' \otimes_{A'} A$. Then we can choose an $A'$-algebra map
$P' \to B'$ lifting the given surjection $P \to B$.
By Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK})
we find that $B'$ is a quotient of $P'$. In particular, we find
that we can endow $B'$ with an $A'$-flat $P'$-module structure
lifting $B$ as an $A$-flat $P$-module.
Conversely, if we can lift $B$ to a $P'$-module $M'$ flat over $A'$,
then $M'$ is a cyclic module $M' \cong P'/J'$ (using Nakayama again)
and setting $B' = P'/J'$ we find a flat lift of $B$ as an algebra.

\medskip\noindent
Set $C = B^\wedge$ and $\mathfrak c = \mathfrak bC$.
Suppose that $A' \to C'$ is a flat lift of $A \to C$.
Then $C'$ is complete with respect to the inverse image $\mathfrak c'$
of $\mathfrak c$
(Algebra, Lemma \ref{algebra-lemma-complete-modulo-nilpotent}).
We choose an $A'$-algebra map $P' \to C'$ lifting
the $A$-algebra map $P \to C$. These maps pass through
completions to give surjections $P^\wedge \to C$ and $(P')^\wedge \to C'$
(for the second again using Nakayama's lemma).
In particular, we find that we can endow $C'$ with an $A'$-flat
$(P')^\wedge$-module structure lifting $C$ as an $A$-flat $P^\wedge$-module.
Conversely, if we can lift $C$ to a $(P')^\wedge$-module $N'$ flat over $A'$,
then $N'$ is a cyclic module $N' \cong (P')^\wedge/\tilde J$
(using Nakayama again) and setting $C' = (P')^\wedge/\tilde J$
we find a flat lift of $C$ as an algebra.

\medskip\noindent
Observe that $P' \to (P')^\wedge$ is a flat ring map which
induces an isomorphism $P'/\mathfrak p' = (P')^\wedge/\mathfrak p'(P')^\wedge$.
We conclude that our lemma is a consequence of
Lemma \ref{lemma-lift-equivalence-module} provided we can
show that $B_g$ lifts to an $A'$-flat $P'_g$-module for
$g \in \mathfrak p'$. However, the ring map $A \to B_g$ is syntomic
and hence lifts to an $A'$-flat algebra $B'$ by
Smoothing Ring Maps, Proposition \ref{smoothing-proposition-lift-smooth}.
Since $A' \to P'_g$ is smooth, we can lift $P_g \to B_g$
to a surjective map $P'_g \to B'$ as before and we get what we want.
\end{proof}

\noindent
Notation. Let $A \to B$ be a ring map. Let $N$ be a $B$-module.
We denote $\text{Exal}_A(B, N)$ the set of isomorphism classes
of extensions
$$
0 \to N \to C \to B \to 0
$$
of $A$-algebras such that $N$ is an ideal of square zero in $C$.
Given a second such $0 \to N \to C' \to B \to 0$ an isomorphism
is a $A$-algebra isomorpism $C \to C'$ such that the diagram
$$
\xymatrix{
0 \ar[r] &
N \ar[r] \ar[d]_{\text{id}} &
C \ar[r] \ar[d] &
B \ar[r] \ar[d]_{\text{id}} & 0 \\
0 \ar[r] &
N \ar[r] &
C' \ar[r] &
B \ar[r] & 0
}
$$
commutes. The assignment $N \mapsto \text{Exal}_A(B, N)$
is a functor which transforms products into products.
Hence this is an additive functor and $\text{Exal}_A(B, N)$
has a natural $B$-module structure. In fact, by
Deformation Theory, Lemma \ref{defos-lemma-choices}
we have $\text{Exal}_A(B, N) = \text{Ext}^1_B(\NL_{B/A}, N)$.

\begin{lemma}
\label{lemma-first-order-completion}
Let $k$ be a field. Let $B$ be a finite type $k$-algebra.
Let $J \subset B$ be an ideal such that
$\Spec(B) \to \Spec(k)$ is smooth on the complement of $V(J)$.
Let $N$ be a finite $B$-module.
Then there is a canonical bijection
$$
\text{Exal}_k(B, N) \to \text{Exal}_k(B^\wedge, N^\wedge)
$$
Here $B^\wedge$ and $N^\wedge$ are the $J$-adic completions.
\end{lemma}

\begin{proof}
The map is given by completion: given $0 \to N \to C \to B \to 0$
in $\text{Exal}_k(B, N)$ we send it to the completion $C^\wedge$
of $C$ with respect to the inverse image of $J$. Compare with
the proof of Lemma \ref{lemma-completion}.

\medskip\noindent
Since $k \to B$ is of finite presentation the complex
$\NL_{B/k}$ can be represented by a complex
$N^{-1} \to N^0$ where $N^i$ is a finite $B$-module, see
Algebra, Section \ref{algebra-section-netherlander} and
in particular
Algebra, Lemma \ref{algebra-lemma-NL-homotopy}.
As $B$ is Noetherian, this means that $\NL_{B/k}$
is pseudo-coherent. For $g \in J$ the $k$-algebra $B_g$
is smooth and hence $(\NL_{B/k})_g = \NL_{B_g/k}$
is quasi-isomorphic to a finite projective $B$-module sitting in degree $0$.
Thus $\text{Ext}^i_B(\NL_{B/k}, N)_g = 0$ for $i \geq 1$
and any $B$-module $N$. By
More on Algebra, Lemma \ref{more-algebra-lemma-ext-annihilated-into}
we conclude that
$$
\text{Ext}^1_B(\NL_{B/k}, N) \longrightarrow
\lim_n \text{Ext}^1_B(\NL_{B/k}, N/J^n N)
$$
is an isomorphism for any finite $B$-module $N$.

\medskip\noindent
Injectivity of the map.
Suppose that $0 \to N \to C \to B \to 0$ is in $\text{Exal}_k(B, N)$
and maps to zero in $\text{Exal}_k(B^\wedge, N^\wedge)$.
Choose a splitting $C^\wedge = B^\wedge \oplus N^\wedge$.
Then the induced map $C \to C^\wedge \to N^\wedge$
gives maps $C \to N/J^nN$ for all $n$.
Hence we see that our element is in the kernel of the maps
$$
\text{Ext}^1_B(\NL_{B/k}, N) \to
\text{Ext}^1_B(\NL_{B/k}, N/J^n N)
$$
for all $n$. By the previous paragraph we conclude that
our element is zero.

\medskip\noindent
Surjectivity of the map. Let $0 \to N^\wedge \to C' \to B^\wedge \to 0$
be an element of $\text{Exal}_k(B^\wedge, N^\wedge)$.
Pulling back by $B \to B^\wedge$ we get an element
$0 \to N^\wedge \to C'' \to B \to 0$ in
$\text{Exal}_k(B, N^\wedge)$.
we have
$$
\text{Ext}^1_B(\NL_{B/k}, N^\wedge) =
\text{Ext}^1_B(\NL_{B/k}, N) \otimes_B B^\wedge =
\text{Ext}^1_B(\NL_{B/k}, N)
$$
The first equality as $N^\wedge = N \otimes_B B^\wedge$
(Algebra, Lemma \ref{algebra-lemma-completion-tensor})
and
More on Algebra, Lemma \ref{more-algebra-lemma-pseudo-coherence-and-ext}.
The second equality because $\text{Ext}^1_B(\NL_{B/k}, N)$
is $J$-power torsion (see above), $B \to B^\wedge$ is flat and induces
an isomorphism $B/J \to B^\wedge/JB^\wedge$, and
More on Algebra, Lemma \ref{more-algebra-lemma-neighbourhood-equivalence}.
Thus we can find a $C \in \text{Exal}_k(B, N)$ mapping to $C''$ in
$\text{Exal}_k(B, N^\wedge)$.
Thus
$$
0 \to N^\wedge \to C' \to B^\wedge \to 0
\quad\text{and}\quad
0 \to N^\wedge \to C^\wedge \to B^\wedge \to 0
$$
are two elements of $\text{Exal}_k(B^\wedge, N^\wedge)$
mapping to the same element of $\text{Exal}_k(B, N^\wedge)$.
Taking the difference we get an element
$0 \to N^\wedge \to C' \to B^\wedge \to 0$ of
$\text{Exal}_k(B^\wedge, N^\wedge)$
whose image in $\text{Exal}_k(B, N^\wedge)$ is zero.
This means there exists
$$
\xymatrix{
0 \ar[r] &
N^\wedge \ar[r] &
C' \ar[r] &
B^\wedge \ar[r] & 0 \\
& & B \ar[u]^\sigma \ar[ru]
}
$$
Let $J' \subset C'$ be the inverse image of $JB^\wedge \subset B^\wedge$.
To finish the proof it suffices to note that
$\sigma$ is continuous for the $J$-adic topology on $B$
and the $J'$-adic topology on $C'$ and that $C'$ is $J'$-adically complete by
Algebra, Lemma \ref{algebra-lemma-complete-modulo-nilpotent}
(here we also use that $C'$ is Noetherian; small detail omitted).
Namely, this means that $\sigma$ factors through the
completion $B^\wedge$ and $C' = 0$ in $\text{Exal}_k(B^\wedge, N^\wedge)$.
\end{proof}

\begin{lemma}
\label{lemma-smooth-completion}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Let $J \subset P$ be an ideal.
Denote $P^\wedge$ the $J$-adic completion. If
\begin{enumerate}
\item $k \to P$ is of finite type, and
\item $\Spec(P) \to \Spec(k)$ is smooth on the complement of $V(J)$.
\end{enumerate}
then the functor between deformation categories of
Lemma \ref{lemma-completion}
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{P^\wedge}
$$
is smooth and induces an isomorphism on tangent spaces.
\end{lemma}

\begin{proof}
We know that $\Deformationcategory_P$ and $\Deformationcategory_{P^\wedge}$
are deformation categories by Lemma \ref{lemma-rings-RS}.
Thus it suffices to check
our functor identifies tangent spaces and a correspondence
between liftability, see
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-easy-check-smooth}.
The property on liftability is proven in
Lemma \ref{lemma-lift-equivalence}
and the isomorphism on tangent spaces is the special case of
Lemma \ref{lemma-first-order-completion} where $N = B$.
\end{proof}



\section{Deformations of localizations}
\label{section-compare-localization}

\noindent
In this section we compare the deformation problem posed
by an algebra and its localization at a multiplicative subset.
We first discuss ``liftability''.

\begin{lemma}
\label{lemma-lift-equivalence-localization}
Let $A' \to A$ be a surjective map of Noetherian rings with nilpotent kernel.
Let $A \to B$ be a finite type flat ring map.
Let $S \subset B$ be a multiplicative subset such that
if $\Spec(B) \to \Spec(A)$ is not syntomic at $\mathfrak q$,
then $S \cap \mathfrak q = \emptyset$.
Then $B$ has a flat lift to $A'$ if and only if
$S^{-1}B$ has a flat lift to $A'$.
\end{lemma}

\begin{proof}
This proof is the same as the proof of
Lemma \ref{lemma-lift-equivalence} but easier. We suggest the
reader to skip the proof.
Choose an $A$-algebra surjection $P = A[x_1, \ldots, x_n] \to B$.
Let $S_P \subset P$ be the inverse image of $S$.
Set $P' = A'[x_1, \ldots, x_n]$ and denote $S_{P'} \subset P'$
the inverse image of $S_P$.

\medskip\noindent
Suppose $A' \to B'$ is a flat lift of $A \to B$, in other words,
$A' \to B'$ is flat and there is an $A$-algebra isomorphism
$B = B' \otimes_{A'} A$. Then we can choose an $A'$-algebra map
$P' \to B'$ lifting the given surjection $P \to B$.
By Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK})
we find that $B'$ is a quotient of $P'$. In particular, we find
that we can endow $B'$ with an $A'$-flat $P'$-module structure
lifting $B$ as an $A$-flat $P$-module.
Conversely, if we can lift $B$ to a $P'$-module $M'$ flat over $A'$,
then $M'$ is a cyclic module $M' \cong P'/J'$ (using Nakayama again)
and setting $B' = P'/J'$ we find a flat lift of $B$ as an algebra.

\medskip\noindent
Set $C = S^{-1}B$. Suppose that $A' \to C'$ is a flat lift of $A \to C$.
Elements of $C'$ which map to invertible elements of $C$ are invertible.
We choose an $A'$-algebra map $P' \to C'$ lifting
the $A$-algebra map $P \to C$. By the remark above
these maps pass through localizations to give surjections
$S_P^{-1}P \to C$ and $S_{P'}^{-1}P' \to C'$
(for the second use Nakayama's lemma).
In particular, we find that we can endow $C'$ with an $A'$-flat
$S_{P'}^{-1}P'$-module structure lifting $C$ as an $A$-flat
$S_P^{-1}P$-module. Conversely, if we can lift $C$ to a
$S_{P'}^{-1}P'$-module $N'$ flat over $A'$, then $N'$
is a cyclic module $N' \cong S_{P'}^{-1}P'/\tilde J$
(using Nakayama again) and setting $C' = S_{P'}^{-1}P'/\tilde J$
we find a flat lift of $C$ as an algebra.

\medskip\noindent
The syntomic locus of a morphism of schemes is open by definition.
Let $J_B \subset B$ be an ideal cutting out the set of points
in $\Spec(B)$ where $\Spec(B) \to \Spec(A)$ is not syntomic.
Denote $J_P \subset P$ and $J_{P'} \subset P'$ the corresponding
ideals. Observe that $P' \to S_{P'}^{-1}P'$ is a flat ring map which
induces an isomorphism $P'/J_{P'} = S_{P'}^{-1}P'/J_{P'}S_{P'}^{-1}P'$
by our assumption on $S$ in the lemma, namely, the assumption
in the lemma is exactly that $B/J_B = S^{-1}(B/J_B)$.
We conclude that our lemma is a consequence of
Lemma \ref{lemma-lift-equivalence-module} provided we can
show that $B_g$ lifts to an $A'$-flat $P'_g$-module for
$g \in J_B$. However, the ring map $A \to B_g$ is syntomic
and hence lifts to an $A'$-flat algebra $B'$ by
Smoothing Ring Maps, Proposition \ref{smoothing-proposition-lift-smooth}.
Since $A' \to P'_g$ is smooth, we can lift $P_g \to B_g$
to a surjective map $P'_g \to B'$ as before and we get what we want.
\end{proof}

\begin{lemma}
\label{lemma-first-order-localization}
Let $k$ be a field. Let $B$ be a finite type $k$-algebra.
Let $S \subset B$ be a multiplicative subset ideal such that
if $\Spec(B) \to \Spec(k)$ is not smooth at $\mathfrak q$
then $S \cap \mathfrak q = \emptyset$.
Let $N$ be a finite $B$-module.
Then there is a canonical bijection
$$
\text{Exal}_k(B, N) \to \text{Exal}_k(S^{-1}B, S^{-1}N)
$$
\end{lemma}

\begin{proof}
This proof is the same as the proof of
Lemma \ref{lemma-first-order-completion} but easier. We suggest the
reader to skip the proof.
The map is given by localization: given $0 \to N \to C \to B \to 0$
in $\text{Exal}_k(B, N)$ we send it to the localization $S_C^{-1}C$
of $C$ with respect to the inverse image $S_C \subset C$ of $S$.
Compare with the proof of Lemma \ref{lemma-localization}.

\medskip\noindent
The smooth locus of a morphism of schemes is open by definition.
Let $J \subset B$ be an ideal cutting out the set of points
in $\Spec(B)$ where $\Spec(B) \to \Spec(A)$ is not smooth.
Since $k \to B$ is of finite presentation the complex
$\NL_{B/k}$ can be represented by a complex
$N^{-1} \to N^0$ where $N^i$ is a finite $B$-module, see
Algebra, Section \ref{algebra-section-netherlander} and
in particular
Algebra, Lemma \ref{algebra-lemma-NL-homotopy}.
As $B$ is Noetherian, this means that $\NL_{B/k}$
is pseudo-coherent. For $g \in J$ the $k$-algebra $B_g$
is smooth and hence $(\NL_{B/k})_g = \NL_{B_g/k}$
is quasi-isomorphic to a finite projective $B$-module sitting in degree $0$.
Thus $\text{Ext}^i_B(\NL_{B/k}, N)_g = 0$ for $i \geq 1$
and any $B$-module $N$. Finally, we have
$$
\text{Ext}^1_{S^{-1}B}(\NL_{S^{-1}B/k}, S^{-1}N) =
\text{Ext}^1_B(\NL_{B/k}, N) \otimes_B S^{-1}B =
\text{Ext}^1_B(\NL_{B/k}, N)
$$
The first equality by
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-RHom}
and Algebra, Lemma \ref{algebra-lemma-localize-NL}.
The second because $\text{Ext}^1_B(\NL_{B/k}, N)$ is $J$-power
torsion and elements of $S$ act invertibly on $J$-power torsion modules.
This concludes the proof by the description of $\text{Exal}_A(B, N)$
as $\text{Ext}^1_B(\NL_{B/A}, N)$ given just above
Lemma \ref{lemma-first-order-completion}.
\end{proof}

\begin{lemma}
\label{lemma-smooth-localization}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Let $S \subset P$ be a multiplicative subset. If
\begin{enumerate}
\item $k \to P$ is of finite type, and
\item $\Spec(P) \to \Spec(k)$ is smooth at all points of
$V(g)$ for all $g \in S$.
\end{enumerate}
then the functor between deformation categories of
Lemma \ref{lemma-localization}
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{S^{-1}P}
$$
is smooth and induces an isomorphism on tangent spaces.
\end{lemma}

\begin{proof}
We know that $\Deformationcategory_P$ and $\Deformationcategory_{S^{-1}P}$
are deformation categories by Lemma \ref{lemma-rings-RS}.
Thus it suffices to check
our functor identifies tangent spaces and a correspondence
between liftability, see
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-easy-check-smooth}.
The property on liftability is proven in
Lemma \ref{lemma-lift-equivalence-localization}
and the isomorphism on tangent spaces is the special case of
Lemma \ref{lemma-first-order-localization} where $N = B$.
\end{proof}



\section{Deformations of henselizations}
\label{section-compare-henselization}

\noindent
In this section we compare the deformation problem posed
by an algebra and its completion.
We first discuss ``liftability''.

\begin{lemma}
\label{lemma-lift-equivalence-henselization}
Let $A' \to A$ be a surjective map of Noetherian rings with nilpotent kernel.
Let $A \to B$ be a finite type flat ring map.
Let $\mathfrak b \subset B$ be an ideal such that
$\Spec(B) \to \Spec(A)$ is syntomic on the complement of $V(\mathfrak b)$.
Let $(B^h, \mathfrak b^h)$ be the henselization of the pair $(B, \mathfrak b)$.
Then $B$ has a flat lift to $A'$ if and only if $B^h$ has a flat lift to $A'$.
\end{lemma}

\begin{proof}[First proof]
This proof is a cheat. Namely, if $B$ has a flat lift $B'$, then
taking the henselization $(B')^h$ we obtain a flat lift of $B^h$
(compare with the proof of Lemma \ref{lemma-henselization}).
Conversely, suppose that $C'$ is an $A'$-flat lift of $(B')^h$.
Then let $\mathfrak c' \subset C'$ be the inverse image of the
ideal $\mathfrak b^h$. Then the completion $(C')^\wedge$ of
$C'$ with respect to $\mathfrak c'$ is a lift of $B^\wedge$ (details omitted).
Hence we see that $B$ has a flat lift by
Lemma \ref{lemma-lift-equivalence}.
\end{proof}

\begin{proof}[Second proof]
Choose an $A$-algebra surjection $P = A[x_1, \ldots, x_n] \to B$.
Let $\mathfrak p \subset P$ be the inverse image of $\mathfrak b$.
Set $P' = A'[x_1, \ldots, x_n]$ and denote $\mathfrak p' \subset P'$
the inverse image of $\mathfrak p$. (Of course $\mathfrak p$
and $\mathfrak p'$ do not designate prime ideals here.)
We will denote $P^h$ and $(P')^h$ the respective henselizations.
We will use that taking henselizations is functorial and that
the henselization of a quotient is the corresponding quotient
of the henselization, see
More on Algebra, Lemmas
\ref{more-algebra-lemma-irreducible-henselian-pair-connected} and
\ref{more-algebra-lemma-henselization-integral}.

\medskip\noindent
Suppose $A' \to B'$ is a flat lift of $A \to B$, in other words,
$A' \to B'$ is flat and there is an $A$-algebra isomorphism
$B = B' \otimes_{A'} A$. Then we can choose an $A'$-algebra map
$P' \to B'$ lifting the given surjection $P \to B$.
By Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK})
we find that $B'$ is a quotient of $P'$. In particular, we find
that we can endow $B'$ with an $A'$-flat $P'$-module structure
lifting $B$ as an $A$-flat $P$-module.
Conversely, if we can lift $B$ to a $P'$-module $M'$ flat over $A'$,
then $M'$ is a cyclic module $M' \cong P'/J'$ (using Nakayama again)
and setting $B' = P'/J'$ we find a flat lift of $B$ as an algebra.

\medskip\noindent
Set $C = B^h$ and $\mathfrak c = \mathfrak bC$.
Suppose that $A' \to C'$ is a flat lift of $A \to C$.
Then $C'$ is henselian with respect to the inverse image
$\mathfrak c'$ of $\mathfrak c$
(by More on Algebra, Lemma \ref{more-algebra-lemma-henselian-henselian-pair}
and the fact that the kernel of $C' \to C$ is nilpotent).
We choose an $A'$-algebra map $P' \to C'$ lifting
the $A$-algebra map $P \to C$. These maps pass through
henselizations to give surjections $P^h \to C$ and $(P')^h \to C'$
(for the second again using Nakayama's lemma).
In particular, we find that we can endow $C'$ with an $A'$-flat
$(P')^h$-module structure lifting $C$ as an $A$-flat $P^h$-module.
Conversely, if we can lift $C$ to a $(P')^h$-module $N'$ flat over $A'$,
then $N'$ is a cyclic module $N' \cong (P')^h/\tilde J$
(using Nakayama again) and setting $C' = (P')^h/\tilde J$
we find a flat lift of $C$ as an algebra.

\medskip\noindent
Observe that $P' \to (P')^h$ is a flat ring map which
induces an isomorphism $P'/\mathfrak p' = (P')^h/\mathfrak p'(P')^h$
(More on Algebra, Lemma \ref{more-algebra-lemma-henselization-flat}).
We conclude that our lemma is a consequence of
Lemma \ref{lemma-lift-equivalence-module} provided we can
show that $B_g$ lifts to an $A'$-flat $P'_g$-module for
$g \in \mathfrak p'$. However, the ring map $A \to B_g$ is syntomic
and hence lifts to an $A'$-flat algebra $B'$ by
Smoothing Ring Maps, Proposition \ref{smoothing-proposition-lift-smooth}.
Since $A' \to P'_g$ is smooth, we can lift $P_g \to B_g$
to a surjective map $P'_g \to B'$ as before and we get what we want.
\end{proof}

\begin{lemma}
\label{lemma-first-order-henselization}
Let $k$ be a field. Let $B$ be a finite type $k$-algebra.
Let $J \subset B$ be an ideal such that
$\Spec(B) \to \Spec(k)$ is smooth on the complement of $V(J)$.
Let $N$ be a finite $B$-module.
Then there is a canonical bijection
$$
\text{Exal}_k(B, N) \to \text{Exal}_k(B^h, N^h)
$$
Here $(B^h, J^h)$ is the henselization of $(B, J)$
and $N^h = N \otimes_B B^h$.
\end{lemma}

\begin{proof}
This proof is the same as the proof of
Lemma \ref{lemma-first-order-completion} but easier. We suggest the
reader to skip the proof.
The map is given by henselization: given $0 \to N \to C \to B \to 0$
in $\text{Exal}_k(B, N)$ we send it to the
henselization $C^h$
of $C$ with respect to the inverse image $J_C \subset C$ of $J$.
Compare with the proof of Lemma \ref{lemma-henselization}.

\medskip\noindent
Since $k \to B$ is of finite presentation the complex
$\NL_{B/k}$ can be represented by a complex
$N^{-1} \to N^0$ where $N^i$ is a finite $B$-module, see
Algebra, Section \ref{algebra-section-netherlander} and
in particular
Algebra, Lemma \ref{algebra-lemma-NL-homotopy}.
As $B$ is Noetherian, this means that $\NL_{B/k}$
is pseudo-coherent. For $g \in J$ the $k$-algebra $B_g$
is smooth and hence $(\NL_{B/k})_g = \NL_{B_g/k}$
is quasi-isomorphic to a finite projective $B$-module sitting in degree $0$.
Thus $\text{Ext}^i_B(\NL_{B/k}, N)_g = 0$ for $i \geq 1$
and any $B$-module $N$. Finally, we have
\begin{align*}
\text{Ext}^1_{B^h}(\NL_{B^h/k}, N^h)
& =
\text{Ext}^1_{B^h}(\NL_{B/k} \otimes_B B^h, N \otimes_B B^h) \\
& =
\text{Ext}^1_B(\NL_{B/k}, N) \otimes_B B^h \\
& =
\text{Ext}^1_B(\NL_{B/k}, N)
\end{align*}
The first equality by
More on Algebra, Lemma \ref{more-algebra-lemma-henselization-NL}
(or rather its analogue for henselizations of pairs).
The second by
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-RHom}.
The third because $\text{Ext}^1_B(\NL_{B/k}, N)$ is $J$-power
torsion, the map $B \to B^h$ is flat and induces an isomorphism
$B/J \to B^h/JB^h$ (More on Algebra, Lemma
\ref{more-algebra-lemma-henselization-flat}), and
More on Algebra, Lemma \ref{more-algebra-lemma-neighbourhood-equivalence}.
This concludes the proof by the description of $\text{Exal}_A(B, N)$
as $\text{Ext}^1_B(\NL_{B/A}, N)$ given just above
Lemma \ref{lemma-first-order-completion}.
\end{proof}

\begin{lemma}
\label{lemma-smooth-henselization}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Let $J \subset P$ be an ideal.
Denote $(P^h, J^h)$ the henselization of the pair $(P, J)$. If
\begin{enumerate}
\item $k \to P$ is of finite type, and
\item $\Spec(P) \to \Spec(k)$ is smooth on the complement of $V(J)$,
\end{enumerate}
then the functor between deformation categories of
Lemma \ref{lemma-henselization}
$$
\Deformationcategory_P \longrightarrow \Deformationcategory_{P^h}
$$
is smooth and induces an isomorphism on tangent spaces.
\end{lemma}

\begin{proof}
We know that $\Deformationcategory_P$ and $\Deformationcategory_{P^h}$
are deformation categories by Lemma \ref{lemma-rings-RS}.
Thus it suffices to check
our functor identifies tangent spaces and a correspondence
between liftability, see
Formal Deformation Theory, Lemma \ref{formal-defos-lemma-easy-check-smooth}.
The property on liftability is proven in
Lemma \ref{lemma-lift-equivalence-henselization}
and the isomorphism on tangent spaces is the special case of
Lemma \ref{lemma-first-order-henselization} where $N = B$.
\end{proof}



\section{Application to isolated singularities}
\label{section-isolated}

\noindent
We apply the discussion above to study the deformation theory
of a finite type algebra with finitely many singular points.

\begin{lemma}
\label{lemma-isolated}
In Example \ref{example-rings} let $P$ be a $k$-algebra.
Assume that $k \to P$ is of finite type and that $\Spec(P) \to \Spec(k)$
is smooth except at the maximal ideals
$\mathfrak m_1, \ldots, \mathfrak m_n$ of $P$.
Let $P_{\mathfrak m_i}$, $P_{\mathfrak m_i}^h$, $P_{\mathfrak m_i}^\wedge$
be the local ring, henselization, completion.
Then the maps of deformation categories
$$
\Deformationcategory_P \to
\prod \Deformationcategory_{P_{\mathfrak m_i}} \to
\prod \Deformationcategory_{P_{\mathfrak m_i}^h} \to
\prod \Deformationcategory_{P_{\mathfrak m_i}^\wedge}
$$
are smooth and induce isomorphisms on their finite dimensional
tangent spaces.
\end{lemma}

\begin{proof}
The tangent space is finite dimensional by
Lemma \ref{lemma-finite-type-rings-TI}.
The functors between the categories are constructed
in Lemmas \ref{lemma-localization}, \ref{lemma-henselization}, and
\ref{lemma-completion} (we omit some verifications of the form:
the completion of the henselization is the completion).

\medskip\noindent
Set $J = \mathfrak m_1 \cap \ldots \cap \mathfrak m_n$ and apply
Lemma \ref{lemma-smooth-completion} to get that
$\Deformationcategory_P \to \Deformationcategory_{P^\wedge}$
is smooth and induces an isomorphism on tangent spaces
where $P^\wedge$ is the $J$-adic completion of $P$.
However, since $P^\wedge = \prod P_{\mathfrak m_i}^\wedge$
we see that the map $\Deformationcategory_P \to
\prod \Deformationcategory_{P_{\mathfrak m_i}^\wedge}$
is smooth and induces an isomorphism on tangent spaces.

\medskip\noindent
Let $(P^h, J^h)$ be the henselization of the pair $(P, J)$.
Then $P^h = \prod P_{\mathfrak m_i}^h$ (look at idempotents
and use More on Algebra, Lemma
\ref{more-algebra-lemma-characterize-henselian-pair}).
Hence we can apply Lemma \ref{lemma-smooth-henselization}
to conclude as in the case of completion.

\medskip\noindent
To get the final case it suffices to show that
$\Deformationcategory_{P_{\mathfrak m_i}} \to
\Deformationcategory_{P_{\mathfrak m_i}^\wedge}$
is smooth and induce isomorphisms on tangent spaces for each $i$ separately.
To do this, we may replace $P$ by a principal localization
whose only singular point is a maximal ideal $\mathfrak m$
(corresponding to $\mathfrak m_i$ in the original $P$).
Then we can apply
Lemma \ref{lemma-smooth-localization}
with multiplicative subset $S = P \setminus \mathfrak m$ to conclude.
Minor details omitted.
\end{proof}






\section{Unobstructed deformation problems}
\label{section-unobstructed}

\noindent
Let $p : \mathcal{F} \to \mathcal{C}_\Lambda$ be a
category cofibred in groupoids. Recall that we say $\mathcal{F}$
is {\it smooth} or {\it unobstructed} if $p$ is smooth.
This means that given a surjection $\varphi : A' \to A$ in
$\mathcal{C}_\Lambda$ and $x \in \Ob(\mathcal{F}(A))$
there exists a morphism $f : x' \to x$ in $\mathcal{F}$
with $p(f) = \varphi$.
See Formal Deformation Theory, Section \ref{formal-defos-section-smooth}.
In this section we give some geometrically meaningful examples.

\begin{lemma}
\label{lemma-lci-unobstructed}
In Example \ref{example-rings} let $P$ be a local complete
intersection over $k$ (Algebra, Definition \ref{algebra-definition-lci-field}).
Then $\Deformationcategory_P$ is unobstructed.
\end{lemma}

\begin{proof}
Let $(A, Q) \to (k, P)$ be an object of $\Deformationcategory_P$.
Then we see that $A \to Q$ is a syntomic ring map by
Algebra, Definition \ref{algebra-definition-lci}.
Hence for any surjection $A' \to A$ in $\mathcal{C}_\Lambda$
we see that there is a morphism $(A', Q') \to (A, Q)$
lifting $A' \to A$ by
Smoothing Ring Maps, Proposition \ref{smoothing-proposition-lift-smooth}.
This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-glueing-smooth}
In Situation \ref{situation-glueing} if $U_{12} \to \Spec(k)$ is smooth,
then the morphism
$$
\Deformationcategory_X
\longrightarrow
\Deformationcategory_{U_1} \times \Deformationcategory_{U_2} =
\Deformationcategory_{P_1} \times \Deformationcategory_{P_2}
$$
is smooth. If in addition
$U_1$ is a local complete intersection over $k$, then
$$
\Deformationcategory_X
\longrightarrow
\Deformationcategory_{U_2} = \Deformationcategory_{P_2}
$$
is smooth.
\end{lemma}

\begin{proof}
The equality signs hold by Lemma \ref{lemma-affine}.
Let us think of $\mathcal{C}_\Lambda$ as a deformation
category over $\mathcal{C}_\Lambda$ as in
Formal Deformation Theory, Section \ref{formal-defos-section-smooth}.
Then
$$
\Deformationcategory_{P_1} \times \Deformationcategory_{P_2} =
\Deformationcategory_{P_1}
\times_{\mathcal{C}_\Lambda}
\Deformationcategory_{P_2},
$$
see Formal Deformation Theory, Remarks
\ref{formal-defos-remarks-cofibered-groupoids}
(\ref{formal-defos-item-product}).
Using
Lemma \ref{lemma-glueing}
the first statement is that the functor
$$
\Deformationcategory_{P_1}
\times_{\Deformationcategory_{P_{12}}}
\Deformationcategory_{P_2}
\longrightarrow
\Deformationcategory_{P_1}
\times_{\mathcal{C}_\Lambda}
\Deformationcategory_{P_2}
$$
is smooth. This follows from Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-map-fibre-products-smooth} as long as
we can show that $T\Deformationcategory_{P_{12}} = (0)$.
This vanishing follows from Lemma \ref{lemma-smooth}
as $P_{12}$ is smooth over $k$.
For the second statement it suffices to show that
$\Deformationcategory_{P_1} \to \mathcal{C}_\Lambda$
is smooth, see Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-smooth-properties}.
In other words, we have to show $\Deformationcategory_{P_1}$
is unobstructed, which is Lemma \ref{lemma-lci-unobstructed}.
\end{proof}

\begin{lemma}
\label{lemma-curve-isolated}
In Example \ref{example-schemes} let $X$ be a scheme over $k$. Assume
\begin{enumerate}
\item $X$ is separated, finite type over $k$ and $\dim(X) \leq 1$,
\item $X \to \Spec(k)$ is smooth except at the closed
points $p_1, \ldots, p_n \in X$.
\end{enumerate}
Let $\mathcal{O}_{X, p_1}$, $\mathcal{O}_{X, p_1}^h$,
$\mathcal{O}_{X, p_1}^\wedge$ be the local ring, henselization, completion.
Consider the maps of deformation categories
$$
\Deformationcategory_X
\longrightarrow
\prod \Deformationcategory_{\mathcal{O}_{X, p_i}}
\longrightarrow
\prod \Deformationcategory_{\mathcal{O}_{X, p_i}^h}
\longrightarrow
\prod \Deformationcategory_{\mathcal{O}_{X, p_i}^\wedge}
$$
The first arrow is smooth and the second and third arrows
are smooth and induce isomorphisms on tangent spaces.
\end{lemma}

\begin{proof}
Choose an affine open $U_2 \subset X$ containing
$p_1, \ldots, p_n$ and the generic point of every irreducible
component of $X$. This is possible by
Varieties, Lemma \ref{varieties-lemma-dim-1-quasi-projective}
and Properties, Lemma \ref{properties-lemma-ample-finite-set-in-affine}.
Then $X \setminus U_2$ is finite and we can choose an affine open
$U_1 \subset X \setminus \{p_1, \ldots, p_n\}$ such that
$X = U_1 \cup U_2$. Set $U_{12} = U_1 \cap U_2$.
Then $U_1$ and $U_{12}$ are smooth affine schemes over $k$.
We conclude that
$$
\Deformationcategory_X \longrightarrow \Deformationcategory_{U_2}
$$
is smooth by Lemma \ref{lemma-glueing-smooth}.
Applying Lemmas \ref{lemma-affine} and \ref{lemma-isolated} we win.
\end{proof}

\begin{lemma}
\label{lemma-curve-isolated-lci}
In Example \ref{example-schemes} let $X$ be a scheme over $k$. Assume
\begin{enumerate}
\item $X$ is separated, finite type over $k$ and $\dim(X) \leq 1$,
\item $X$ is a local complete intersection over $k$, and
\item $X \to \Spec(k)$ is smooth except at finitely many points.
\end{enumerate}
Then $\Deformationcategory_X$ is unobstructed.
\end{lemma}

\begin{proof}
Let $p_1, \ldots, p_n \in X$ be the points where $X \to \Spec(k)$
isn't smooth. Choose an affine open $U_2 \subset X$ containing
$p_1, \ldots, p_n$ and the generic point of every irreducible
component of $X$. This is possible by
Varieties, Lemma \ref{varieties-lemma-dim-1-quasi-projective}
and Properties, Lemma \ref{properties-lemma-ample-finite-set-in-affine}.
Then $X \setminus U_2$ is finite and we can choose an affine open
$U_1 \subset X \setminus \{p_1, \ldots, p_n\}$ such that
$X = U_1 \cup U_2$. Set $U_{12} = U_1 \cap U_2$.
Then $U_1$ and $U_{12}$ are smooth affine schemes over $k$.
We conclude that
$$
\Deformationcategory_X \longrightarrow \Deformationcategory_{U_2}
$$
is smooth by Lemma \ref{lemma-glueing-smooth}.
Applying Lemmas \ref{lemma-affine} and \ref{lemma-lci-unobstructed} we win.
\end{proof}




\section{Smoothings}
\label{section-smoothing}

\noindent
Suppose given a finite type scheme or algebraic space $X$ over a field $k$.
It is often useful to find a flat morphism of finite type $Y \to \Spec(k[[t]])$
whose generic fibre is smooth and whose special fibre is isomorphic to $X$.
Such a thing is called a smoothing of $X$. In this section we will find
a smoothing for $1$-dimensional separated $X$ which have isolated
local complete intersection singularities.

\begin{lemma}
\label{lemma-criterion-smoothing}
Let $k$ be a field. Set $S = \Spec(k[[t]])$ and
$S_n = \Spec(k[t]/(t^n))$. Let $Y \to S$ be a proper, flat morphism
of schemes whose special fibre $X$ is Cohen-Macaulay and
equidimensional of dimension $d$. Denote $X_n = Y \times_S S_n$.
If for some $n \geq 1$ the $d$th Fitting ideal of $\Omega_{X_n/S_n}$
contains $t^{n - 1}$, then the generic fibre of $Y \to S$ is smooth.
\end{lemma}

\begin{proof}
By More on Morphisms, Lemma
\ref{more-morphisms-lemma-flat-finite-presentation-CM-open}
we see that $Y \to S$ is a Cohen-Macaulay morphism.
By Morphisms, Lemma
\ref{morphisms-lemma-flat-finite-presentation-CM-fibres-relative-dimension}
we see that $Y \to S$ has relative dimension $d$.
By Divisors, Lemma \ref{divisors-lemma-d-fitting-ideal-omega-smooth}
the $d$th Fitting ideal $\mathcal{I} \subset \mathcal{O}_Y$
of $\Omega_{Y/S}$ cuts out the singular locus of the morphism $Y \to S$.
In other words, $V(\mathcal{I}) \subset Y$ is the closed subset
of points where $Y \to S$ is not smooth.
By Divisors, Lemma \ref{divisors-lemma-base-change-and-fitting-ideal-omega}
formation of this Fitting ideal commutes with base change.
By assumption we see that $t^{n - 1}$ is a section of
$\mathcal{I} + t^n\mathcal{O}_Y$. Thus for every
$x \in X = V(t) \subset Y$ we conclude that
$t^{n - 1} \in \mathcal{I}_x$ where $\mathcal{I}_x$ is the stalk at $x$.
This implies that $V(\mathcal{I}) \subset V(t)$ in an
open neighbourhood of $X$ in $Y$. Since $Y \to S$
is proper, this implies $V(\mathcal{I}) \subset V(t)$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-jouanolou-type-thing}
Let $k$ be a field. Let $1 \leq c \leq n$ be integers.
Let $f_1, \ldots, f_c \in k[x_1, \ldots x_n]$ be elements.
Let $a_{ij}$, $0 \leq i \leq n$, $1 \leq j \leq c$ be
variables. Consider
$$
g_j = f_j + a_{0j} + a_{1j}x_1 + \ldots + a_{nj}x_n \in
k[a_{ij}][x_1, \ldots, x_n]
$$
Denote $Y \subset \mathbf{A}^{n + c(n + 1)}_k$
the closed subscheme cut out by $g_1, \ldots, g_c$.
Denote $\pi : Y \to \mathbf{A}^{c(n + 1)}_k$ the projection
onto the affine space with variables $a_{ij}$.
Then there is a nonempty Zariski open 
of $\mathbf{A}^{c(n + 1)}_k$ over which $\pi$ is smooth.
\end{lemma}

\begin{proof}
Recall that the set of points where $\pi$ is smooth is open.
Thus the complement, i.e., the singular locus, is closed.
By Chevalley's theorem (in the form of
Morphisms, Lemma \ref{morphisms-lemma-chevalley})
the image of the singular locus is constructible.
Hence if the generic point of $\mathbf{A}^{c(n + 1)}_k$
is not in the image of the singular locus, then
the lemma follows (by Topology, Lemma
\ref{topology-lemma-generic-point-in-constructible} for example).
Thus we have to show there is no point
$y \in Y$ where $\pi$ is not smooth mapping to
the generic point of $\mathbf{A}^{c(n + 1)}_k$.
Consider the matrix of partial derivatives
$$
(\frac{\partial g_j}{\partial x_i}) =
(\frac{\partial f_j}{\partial x_i} + a_{ij})
$$
The image of this matrix in $\kappa(y)$ must have rank $< c$
since otherwise $\pi$ would be smooth at $y$, see discussion in
Smoothing Ring Maps, Section \ref{smoothing-section-singular-ideal}.
Thus we can find $\lambda_1, \ldots, \lambda_c \in \kappa(y)$
not all zero such that the vector $(\lambda_1, \ldots, \lambda_c)$
is in the kernel of this matrix.
After renumbering we may assume $\lambda_1 \not = 0$.
Dividing by $\lambda_1$ we may assume our vector has
the form $(1, \lambda_2, \ldots, \lambda_c)$.
Then we obtain
$$
a_{i1} = -
\frac{\partial f_j}{\partial x_1} -
\sum\nolimits_{j = 2, \ldots, c} \lambda_j(\frac{\partial f_j}{\partial x_i} + a_{ij})
$$
in $\kappa(y)$ for $i = 1, \ldots, n$. Moreover, since $y \in Y$ we also
have
$$
a_{0j} = -f_j - a_{1j}x_1 - \ldots - a_{nj}x_n
$$
in $\kappa(y)$. This means that the subfield of $\kappa(y)$
generated by $a_{ij}$ is contained in the subfield of $\kappa(y)$
generated by the images of $x_1, \ldots, x_n, \lambda_2, \ldots, \lambda_c$,
and $a_{ij}$ except for $a_{i1}$ and $a_{0j}$.
We count and we see that the transcendence degree of this is
at most $c(n + 1) - 1$. Hence $y$ cannot map to the generic point
as desired.
\end{proof}

\begin{lemma}
\label{lemma-smoothing-affine-lci}
Let $k$ be a field. Let $A$ be a global complete interesection
over $k$. There exists a flat finite type ring map
$k[[t]] \to B$ with $B/tB \cong A$ such that
$B[1/t]$ is smooth over $k((t))$.
\end{lemma}

\begin{proof}
Write $A = k[x_1, \ldots, x_n]/(f_1, \ldots, f_c)$ as in
Algebra, Definition \ref{algebra-definition-lci-field}.
We are going to choose
$a_{ij} \in (t) \subset k[[t]]$ and set
$$
g_j = f_j + a_{0j} + a_{1j}x_1 + \ldots + a_{nj}x_n \in
k[[t]][x_1, \ldots, x_n]
$$
After doing this we take
$B = k[[t]][x_1, \ldots, x_n]/(g_1, \ldots, g_c)$.
We claim that $k[[t]] \to B$ is flat at every prime ideal
lying over $(t)$. Namely, the elements $f_1, \ldots, f_c$
form a regular sequence in the local ring at any prime ideal
$\mathfrak p$ of $k[x_1, \ldots, x_n]$ containing $f_1, \ldots, f_c$
(Algebra, Lemma \ref{algebra-lemma-lci}). Thus $g_1, \ldots, g_c$
is locally a lift of a regular sequence and we can apply
Algebra, Lemma \ref{algebra-lemma-grothendieck-regular-sequence}.
Flatness at primes lying over $(0) \subset k[[t]]$ is automatic
because $k((t)) = k[[t]]_{(0)}$ is a field. Thus $B$ is flat
over $k[[t]]$.

\medskip\noindent
All that remains is to show that for suitable choices
of $a_{ij}$ the generic fibre $B_{(0)}$ is smooth over
$k((t))$. For this we have to show that we can choose
our $a_{ij}$ so that the induced morphism
$$
(a_{ij}) : \Spec(k[[t]]) \longrightarrow \mathbf{A}^{c(n + 1)}_k
$$
maps into the nonempty Zariski open of
Lemma \ref{lemma-jouanolou-type-thing}.
This is clear because there is no nonzero polynomial in the
$a_{ij}$ which vanishes on $(t)^{\oplus c(n + 1)}$.
(We leave this as an exercise to the reader.)
\end{proof}

\begin{lemma}
\label{lemma-smoothing-artinian-lci}
Let $k$ be a field. Let $A$ be a finite dimensional $k$-algebra
which is a local complete intersection over $k$. Then there is
a finite flat $k[[t]]$-algebra $B$ with $B/tB \cong A$
and $B[1/t]$ \'etale over $k((t))$.
\end{lemma}

\begin{proof}
Since $A$ is Artinian
(Algebra, Lemma \ref{algebra-lemma-finite-dimensional-algebra}),
we can write $A$ as a product of local Artinian rings
(Algebra, Lemma \ref{algebra-lemma-artinian-finite-length}).
Thus it suffices to prove the lemma if $A$ is local
(this uses that being a local complete intersection is
preserved under taking principal localizations, see
Algebra, Lemma \ref{algebra-lemma-localize-lci}).
In this case $A$ is a global complete intersection.
Consider the algebra $B$ constructed in
Lemma \ref{lemma-smoothing-affine-lci}.
Then $k[[t]] \to B$ is quasi-finite at the unique prime of $B$
lying over $(t)$ (Algebra, Definition \ref{algebra-definition-quasi-finite}).
Observe that $k[[t]]$ is a henselian local ring
(Algebra, Lemma \ref{algebra-lemma-complete-henselian}).
Thus $B = B' \times C$ where $B'$ is finite over $k[[t]]$
and $C$ has no prime lying over $(t)$, see
Algebra, Lemma \ref{algebra-lemma-characterize-henselian}.
Then $B'$ is the ring we are looking for
(recall that \'etale is the same thing as
smooth of relative dimension $0$).
\end{proof}

\begin{lemma}
\label{lemma-smoothing-at-lci-point}
Let $k$ be a field. Let $A$ be a $k$-algebra. Assume
\begin{enumerate}
\item $A$ is a local ring essentially of finite type over $k$,
\item $A$ is a complete intersection over $k$
(Algebra, Definition \ref{algebra-definition-lci-local-ring}).
\end{enumerate}
Set $d = \dim(A) + \text{trdeg}_k(\kappa)$ where $\kappa$
is the residue field of $A$. Then there exists an integer $n$
and a flat, essentially of finite type ring map
$k[[t]] \to B$ with $B/tB \cong A$ such that $t^n$ is in the
$d$th Fitting ideal of $\Omega_{B/k[[t]]}$.
\end{lemma}

\begin{proof}
By Algebra, Lemma \ref{algebra-lemma-lci-local} we can write $A$ as the
localization at a prime $\mathfrak p$ of a global complete intersection $P$
over $k$. Observe that $\dim(P) = d$ by
Algebra, Lemma \ref{algebra-lemma-dimension-at-a-point-finite-type-field}.
By Lemma \ref{lemma-smoothing-affine-lci} we can find a
flat, finite type ring map $k[[t]] \to Q$ such that $P \cong Q/tQ$ and
such that $k((t)) \to Q[1/t]$ is smooth. It follows from the construction
of $Q$ in the lemma that $k[[t]] \to Q$ is a relative global
complete intersection of relative dimension $d$; alternatively,
Algebra, Lemma \ref{algebra-lemma-syntomic} tells us that $Q$ or a
suitable principal localization of $Q$ is such a global complete intersection.
Hence by Divisors, Lemma \ref{divisors-lemma-d-fitting-ideal-omega-smooth}
the $d$th Fitting ideal $I \subset Q$ of $\Omega_{Q/k[[t]]}$
cuts out the singular locus of $\Spec(Q) \to \Spec(k[[t]])$.
Thus $t^n \in I$ for some $n$.
Let $\mathfrak q \subset Q$
be the inverse image of $\mathfrak p$. Set $B = Q_\mathfrak q$.
The lemma is proved.
\end{proof}

\begin{lemma}
\label{lemma-smoothing-proper-curve-isolated-lci}
Let $X$ be a scheme over a field $k$. Assume
\begin{enumerate}
\item $X$ is proper over $k$,
\item $X$ is a local complete intersection over $k$,
\item $X$ has dimension $\leq 1$, and
\item $X \to \Spec(k)$ is smooth except at finitely many points.
\end{enumerate}
Then there exists a flat projective morphism $Y \to \Spec(k[[t]])$
whose generic fibre is smooth and whose special fibre is
isomorphic to $X$.
\end{lemma}

\begin{proof}
Observe that $X$ is Cohen-Macaulay, see
Algebra, Lemma \ref{algebra-lemma-lci-CM}.
Thus $X = X' \amalg X''$ with $\dim(X') = 0$
and $X''$ equidimensional of dimension $1$, see Morphisms, Lemma
\ref{morphisms-lemma-flat-finite-presentation-CM-fibres-relative-dimension}.
Since $X'$ is finite over $k$ (Varieties, Lemma
\ref{varieties-lemma-algebraic-scheme-dim-0})
we can find $Y' \to \Spec(k[[t]])$ with special
fibre $X'$ and generic fibre smooth by
Lemma \ref{lemma-smoothing-artinian-lci}.
Thus it suffices to prove the lemma for $X''$.
After replacing $X$ by $X''$ we have $X$ is
Cohen-Macaulay and equidimensional of dimension $1$.

\medskip\noindent
We are going to use deformation theory for the situation $\Lambda = k \to k$.
Let $p_1, \ldots, p_r \in X$ be the closed singular points of $X$, i.e.,
the points where $X \to \Spec(k)$ isn't smooth. For each $i$ we pick
an integer $n_i$ and a flat, essentially of finite type ring map
$$
k[[t]] \longrightarrow B_i
$$
with $B_i/tB_i \cong \mathcal{O}_{X, p_i}$ such that
$t^{n_i}$ is in the $1$st Fitting ideal of $\Omega_{B_i/k[[t]]}$.
This is possible by Lemma \ref{lemma-smoothing-at-lci-point}.
Observe that the system $(B_i/t^nB_i)$ defines a formal object of
$\Deformationcategory_{\mathcal{O}_{X, p_i}}$ over $k[[t]]$.
By Lemma \ref{lemma-curve-isolated} the map
$$
\Deformationcategory_X
\longrightarrow
\prod\nolimits_{i = 1, \ldots, r} \Deformationcategory_{\mathcal{O}_{X, p_i}}
$$
is a smooth map between deformation categories. Hence by
Formal Deformation Theory, Lemma
\ref{formal-defos-lemma-smooth-morphism-essentially-surjective}
there exists a formal object $(X_n)$ in $\Deformationcategory_X$
mapping to the formal object $\prod_i (B_i/t^n)$ by the arrow above.
By More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-formal-algebraic-space-proper-reldim-1}
there exists a projective scheme $Y$ over $k[[t]]$ and compatible
isomorphisms $Y \times_{\Spec(k[[t]])} \Spec(k[t]/(t^n)) \cong X_n$.
By More on Morphisms, Lemma
\ref{more-morphisms-lemma-check-flatness-on-infinitesimal-nbhds}
we see that $Y \to \Spec(k[[t]])$ is flat.
Since $X$ is Cohen-Macaulay and equidimensional of dimension $1$
we may apply Lemma \ref{lemma-criterion-smoothing}
to check $Y$ has smooth generic fibre\footnote{Warning: in general it is
{\bf not} true that the local ring of $Y$ at the point
$p_i$ is isomorphic to $B_i$. We only know that this is true after
dividing by $t^n$ on both sides!}.
Choose $n$ strictly larger than the maximum of the integers $n_i$ found above.
It we can show $t^{n - 1}$ is in the first Fitting ideal of
$\Omega_{X_n/S_n}$ with $S_n = \Spec(k[t]/(t^n))$, then the proof is done.
To do this it suffices to prove this is true in each of
the local rings of $X_n$ at closed points $p$.
However, if $p$ corresponds to a smooth point for $X \to \Spec(k)$,
then $\Omega_{X_n/S_n, p}$ is free of rank $1$ and the first Fitting
ideal is equal to the local ring. If $p = p_i$ for some $i$, then
$$
\Omega_{X_n/S_n, p_i} =
\Omega_{(B_i/t^nB_i)/(k[t]/(t^n))} =
\Omega_{B_i/k[[t]]}/t^n\Omega_{B_i/k[[t]]}
$$
Since taking Fitting ideals commutes with base change
(with already used this but in this algebraic setting
it follows from More on Algebra, Lemma
\ref{more-algebra-lemma-fitting-ideal-basics}),
and since $n - 1 \geq n_i$ we see that $t^{n - 1}$ is
in the Fitting ideal of this module over $B_i/t^nB_i$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-smoothing-curve-isolated-lci}
Let $k$ be a field and let $X$ be a scheme over $k$. Assume
\begin{enumerate}
\item $X$ is separated, finite type over $k$ and $\dim(X) \leq 1$,
\item $X$ is a local complete intersection over $k$, and
\item $X \to \Spec(k)$ is smooth except at finitely many points.
\end{enumerate}
Then there exists a flat, separated, finite type morphism $Y \to \Spec(k[[t]])$
whose generic fibre is smooth and whose special fibre is
isomorphic to $X$.
\end{lemma}

\begin{proof}
If $X$ is reduced, then we can choose an embedding
$X \subset \overline{X}$ as in
Varieties, Lemma \ref{varieties-lemma-reduced-dim-1-projective-completion}.
Writing $X = \overline{X} \setminus \{x_1, \ldots, x_n\}$
we see that $\mathcal{O}_{\overline{X}, x_i}$ is a discrete
valuation ring and hence in particular a local complete intersection
(Algebra, Definition \ref{algebra-definition-lci-local-ring}).
Thus $\overline{X}$ is a local complete intersection
over $k$ because this holds over the open $X$ and
at the points $x_i$ by Algebra, Lemma \ref{algebra-lemma-lci-local}.
Thus we may apply Lemma \ref{lemma-smoothing-proper-curve-isolated-lci}
to find a projective flat morphism $\overline{Y} \to \Spec(k[[t]])$
whose generic fibre is smooth and whose special fibre
is $\overline{X}$. Then we remove $x_1, \ldots, x_n$
from $\overline{Y}$ to obtain $Y$.

\medskip\noindent
In the general case, write $X = X' \amalg X''$ where
with $\dim(X') = 0$ and $X''$ equidimensional of dimension $1$.
Then $X''$ is reduced and the first paragraph applies to it.
On the other hand, $X'$ can be dealt with
as in the proof of Lemma \ref{lemma-smoothing-proper-curve-isolated-lci}.
Some details omitted.
\end{proof}





\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}