File size: 258,582 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
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
\input{preamble}

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

\title{Examples}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

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

\noindent
This chapter will contain examples which illuminate the theory.





\section{An empty limit}
\label{section-empty-limit}

\noindent
This example is due to Waterhouse, see \cite{Waterhouse}.
Let $S$ be an uncountable set. For every finite subset
$T \subset S$ consider the set $M_T$ of injective maps $T \to \mathbf{N}$.
For $T \subset T' \subset S$ finite the restriction $M_{T'} \to M_T$
is surjective. Thus we have an inverse system over the
directed partially ordered set of finite subsets of $S$
with surjective transition maps.
But $\lim M_T = \emptyset$ as an element in the limit would
define an injective map $S \to \mathbf{N}$.



\section{A zero limit}
\label{section-zero-limit}

\noindent
Let $(S_i)_{i \in I}$ be a directed inverse system of nonempty sets
with surjective transition maps and
with $\lim S_i = \emptyset$, see Section \ref{section-empty-limit}.
Let $K$ be a field and set
$$
V_i = \bigoplus\nolimits_{s \in S_i} K
$$
Then the transition maps $V_i \to V_j$ are surjective for $i \geq j$.
However, $\lim V_i = 0$. Namely, if $v = (v_i)$ is an element of the
limit, then the support of $v_i$ would be a finite subset $T_i \subset S_i$
with $\lim T_i \not = \emptyset$, see
Categories, Lemma \ref{categories-lemma-nonempty-limit}.

\medskip\noindent
For each $i$ consider the unique $K$-linear map $V_i \to K$ which sends
each basis vector $s \in S_i$ to $1$. Let $W_i \subset V_i$
be the kernel. Then
$$
0 \to (W_i) \to (V_i) \to (K) \to 0
$$
is a nonsplit short exact sequence of inverse systems of vector spaces
over the directed set $I$. Hence
$W_i$ is a directed system of $K$-vector spaces
with surjective transition maps, vanishing limit, and nonvanishing
$R^1\lim$.



\section{Non-quasi-compact inverse limit of quasi-compact spaces}
\label{section-lim-not-quasi-compact}

\noindent
Let $\mathbf{N}$ denote the set of natural numbers.
For every integer $n$, let $I_n$ denote the set of all natural numbers $> n$.
Define $T_n$ to be the unique topology on $\mathbf{N}$ with basis
$\{1\}, \ldots , \{n\}, I_n$.  Denote by $X_n$ the topological space
$(\mathbf{N}, T_n)$.  For each $m < n$, the identity map,
$$
f_{n, m} : X_n \longrightarrow X_m
$$
is continuous.  Obviously for $m < n < p$, the composition
$f_{p, n} \circ f_{n, m}$ equals $f_{p, m}$.  So $((X_n), (f_{n,m}))$
is a directed inverse system of quasi-compact topological spaces.

\medskip\noindent
Let $T$ be the discrete topology on $\mathbf{N}$, and let $X$ be
$(\mathbf{N}, T)$. Then for every integer $n$, the identity map,
$$
f_n : X \longrightarrow X_n
$$
is continuous. We claim that this is the inverse limit of the directed
system above. Let $(Y, S)$ be any topological space. For every integer $n$,
let
$$
g_n : (Y, S) \longrightarrow (\mathbf{N}, T_n)
$$
be a continuous map. Assume that for every $m < n$ we have
$f_{n,m} \circ g_n = g_m$, i.e., the system $(g_n)$ is compatible
with the directed system above. In particular, all of the set maps
$g_n$ are equal to a common set map
$$
g : Y \longrightarrow \mathbf{N}.
$$
Moreover, for every integer $n$, since $\{n\}$ is open in $X_n$,
also $g^{-1}(\{n\}) = g_n^{-1}(\{n\})$ is open in $Y$.
Therefore the set map $g$ is continuous for the topology $S$ on $Y$
and the topology $T$ on $\mathbf{N}$. Thus $(X, (f_n))$ is the inverse
limit of the directed system above.

\medskip\noindent
However, clearly $X$ is not quasi-compact, since the infinite open
covering by singleton sets has no inverse limit.

\begin{lemma}
\label{lemma-lim-not-quasi-compact}
There exists an inverse system of quasi-compact topological spaces
over $\mathbf{N}$ whose limit is not quasi-compact.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}






\section{The structure sheaf on the fibre product}
\label{section-silly}

\noindent
Let $X, Y, S, a, b, p, q, f$ be as in the introduction to
Derived Categories of Schemes,
Section \ref{perfect-section-kunneth}. Picture:
$$
\xymatrix{
& X \times_S Y \ar[ld]^p \ar[rd]_q \ar[dd]^f \\
X \ar[rd]_a & & Y \ar[ld]^b \\
& S
}
$$
Then we have a canonical map
$$
can :
p^{-1}\mathcal{O}_X \otimes_{f^{-1}\mathcal{O}_S} q^{-1}\mathcal{O}_Y
\longrightarrow
\mathcal{O}_{X \times_S Y}
$$
which is not an isomorphism in general.

\medskip\noindent
For example, let $S = \Spec(\mathbf{R})$, $X = \Spec(\mathbf{C})$, and
$Y = \Spec(\mathbf{C})$. Then
$X \times_S Y = \Spec(\mathbf{C}) \amalg \Spec(\mathbf{C})$
is a discrete space with two points
and the sheaves $p^{-1}\mathcal{O}_X$, $q^{-1}\mathcal{O}_Y$
and $f^{-1}\mathcal{O}_S$ are the constant sheaves with values
$\mathbf{C}$, $\mathbf{C}$, and $\mathbf{R}$.
Hence the source of $can$ is the constant sheaf
with value $\mathbf{C} \otimes_\mathbf{R} \mathbf{C}$
on the discrete space with two points. Thus its global
sections have dimension $8$ as an $\mathbf{R}$-vector space
whereas taking global sections of the target of $can$
we obtain $\mathbf{C} \times \mathbf{C}$
which has dimension $4$ as an $\mathbf{R}$-vector space.

\medskip\noindent
Another example is the following. Let $k$ be an algebraically
closed field. Consider
$S = \Spec(k)$, $X = \mathbf{A}^1_k$, and $Y = \mathbf{A}^1_k$.
Then for $U \subset X \times_S Y = \mathbf{A}^2_k$ nonempty open
the images $p(U) \subset X = \mathbf{A}^1_k$ and $q(U) \subset \mathbf{A}^1_k$
are open and the reader can show that
$$
\left(
p^{-1}\mathcal{O}_X \otimes_{f^{-1}\mathcal{O}_S} q^{-1}\mathcal{O}_Y
\right)(U) = \mathcal{O}_X(p(U)) \otimes_k \mathcal{O}_Y(q(U))
$$
This is not equal to $\mathcal{O}_{X \times_S Y}(U)$
if $U$ is the complement of an irreducible curve $C$ in
$X \times_S Y = \mathbf{A}^2_k$ such that both $p|_C$ and $q|_C$
are nonconstant.

\medskip\noindent
Returning to the general case, let $z = (x, y, s, \mathfrak p)$
be a point of $X \times_S Y$ as in
Schemes, Lemma \ref{schemes-lemma-points-fibre-product}.
Then on stalks at $z$ the map $can$ gives the map
$$
can_z :
\mathcal{O}_{X, x} \otimes_{\mathcal{O}_{S, s}} \mathcal{O}_{Y, y}
\longrightarrow
\mathcal{O}_{X \times_S Y, z}
$$
This is a flat ring homomorphism as the target is a localization of the
source (details omitted; hint reduce to the case that $X$, $Y$, and $S$
are affine).
Observe that the source is in general not a local ring, and this gives
another way to see that $can$ is not an isomorphism in general.

\medskip\noindent
More generally, suppose we have an $\mathcal{O}_X$-module $\mathcal{F}$ and an
$\mathcal{O}_Y$-module $\mathcal{G}$. Then there is a canonical map
\begin{align*}
& p^{-1}\mathcal{F} \otimes_{f^{-1}\mathcal{O}_S} q^{-1}\mathcal{G} \\
& =
p^{-1}(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{O}_X)
\otimes_{f^{-1}\mathcal{O}_S}
q^{-1}(\mathcal{O}_Y \otimes_{\mathcal{O}_Y} \mathcal{G}) \\
& =
p^{-1}\mathcal{F} \otimes_{p^{-1}\mathcal{O}_X} p^{-1}\mathcal{O}_X
\otimes_{f^{-1}\mathcal{O}_S}
q^{-1}\mathcal{O}_Y \otimes_{q^{-1}\mathcal{O}_Y} q^{-1}\mathcal{G} \\
& \xrightarrow{can}
p^{-1}\mathcal{F} \otimes_{q^{-1}\mathcal{O}_X}
\mathcal{O}_{X \times_S Y}
\otimes_{q^{-1}\mathcal{O}_Y} q^{-1}\mathcal{G}  \\
& =
p^{-1}\mathcal{F} \otimes_{q^{-1}\mathcal{O}_X}
\mathcal{O}_{X \times_S Y}
\otimes_{\mathcal{O}_{X \times_S Y}}
\mathcal{O}_{X \times_S Y}
\otimes_{q^{-1}\mathcal{O}_Y} q^{-1}\mathcal{G}  \\
& =
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times_S Y}} q^*\mathcal{G}
\end{align*}
which is rarely an isomorphism.





\section{A nonintegral connected scheme whose local rings are domains}
\label{section-connected-locally-integral-not-integral}

\noindent
We give an example of an affine scheme $X = \Spec(A)$ which is
connected, all of whose local rings are domains, but which is not integral.
Connectedness of $X$ means $A$ has no nontrivial idempotents, see
Algebra, Lemma \ref{algebra-lemma-disjoint-decomposition}.
The local rings of $X$ are domains if, whenever $fg = 0$ in $A$, every
point of $X$ has a neighborhood where either $f$ or $g$ vanishes.
As long as $A$ is not a domain, then $X$ is not integral
(Properties, Definition \ref{properties-definition-integral}).

\medskip\noindent
Roughly speaking, the construction is as follows: let $X_0$ be the cross
(the union of coordinate axes) on the affine plane. Then let $X_1$ be
the (reduced) full preimage of $X_0$ on the blowup of the plane ($X_1$
has three rational components forming a chain).  Then blow up the
resulting surface at the two singularities of $X_1$, and let $X_2$ be
the reduced preimage of $X_1$ (which has five rational components), etc.
Take $X$ to be the inverse limit. The only problem with this construction
is that blowups glue in a projective line, so $X_1$ is not affine. Let us
correct this by glueing in an affine line instead (so our scheme will be an
open subset in what was described above).

\medskip\noindent
Here is a completely algebraic construction: For every $k \ge 0$, let $A_k$
be the following ring: its elements are collections of
polynomials $p_i \in \mathbf{C}[x]$ where $i = 0, \ldots, 2^k$ such that
$p_i(1) = p_{i + 1}(0)$. Set $X_k = \Spec(A_k)$. Observe that $X_k$ is
a union of $2^k + 1$ affine lines that meet transversally in a chain.
Define a ring homomorphism $A_k \to A_{k + 1}$ by
$$
(p_0, \ldots, p_{2^k})
\longmapsto
(p_0, p_0(1), p_1, p_1(1), \ldots, p_{2^k}),
$$
in other words, every other polynomial is constant. This identifies
$A_k$ with a subring of $A_{k + 1}$. Let $A$ be the direct limit of $A_k$
(basically, their union). Set $X = \Spec(A)$. For every $k$, we have
a natural embedding $A_k \to A$, that is, a map $X\to X_k$.
Each $A_k$ is connected but not integral; this implies that $A$ is
connected but not integral. It remains to show that the local rings of
$A$ are domains.

\medskip\noindent
Take $f, g \in A$ with $fg = 0$ and $x \in X$. Let us construct a
neighborhood of $x$ on which one of $f$ and $g$ vanishes. Choose $k$
such that $f, g \in A_{k - 1}$ (note the $k - 1$ index).
Let $y$ be the image of $x$ in $X_k$. It suffices to prove that $y$ has
a neighborhood on which either $f$ or $g$ viewed as sections of
$\mathcal{O}_{X_k}$ vanishes.
If $y$ is a smooth point of $X_k$, that is, it lies on only one of the
$2^k + 1$ lines, this is obvious. We can therefore assume that $y$ is one
of the $2^k$ singular points, so two components of $X_k$ pass through
$y$. However, on one of these two components (the one with odd index),
both $f$ and $g$ are constant, since they are pullbacks of functions on
$X_{k - 1}$. Since $fg = 0$ everywhere, either $f$ or $g$ (say, $f$)
vanishes on the other component.
This implies that $f$ vanishes on both components, as required.






\section{Noncomplete completion}
\label{section-noncomplete-completion}

\noindent
Let $R$ be a ring and let $\mathfrak m$ be a maximal ideal. Consider the
completion
$$
R^\wedge = \lim R/\mathfrak m^n.
$$
Note that $R^\wedge$ is a local ring with maximal ideal
$\mathfrak m' = \Ker(R^\wedge \to R/\mathfrak m)$.
Namely, if $x = (x_n) \in R^\wedge$ is not in $\mathfrak m'$, then
$y = (x_n^{-1}) \in R^\wedge$ satisfies $xy = 1$, whence $R^\wedge$ is local by
Algebra, Lemma \ref{algebra-lemma-characterize-local-ring}. Now it is
always true that $R^\wedge$ complete in its limit topology (see the
discussion in
More on Algebra, Section \ref{more-algebra-section-topological-ring}).
But beyond that, we have the following questions:
\begin{enumerate}
\item Is it true that $\mathfrak m R^\wedge = \mathfrak m'$?
\item Is $R^\wedge$ viewed as an $R^\wedge$-module $\mathfrak m'$-adically
complete?
\item Is $R^\wedge$ viewed as an $R$-module $\mathfrak m$-adically complete?
\end{enumerate}
It turns out that these questions all have a negative answer.
The example below was taken from an unpublished note of
Bart de Smit and Hendrik Lenstra. See also
\cite[Exercise III.2.12]{Bourbaki-CA} and
\cite[Example 1.8]{Yekutieli}

\medskip\noindent
Let $k$ be a field, $R = k[x_1, x_2, x_3, \ldots]$, and
$\mathfrak m = (x_1, x_2, x_3, \ldots)$.
We will think of an element $f$ of $R^\wedge$ as a (possibly) infinite sum
$$
f = \sum a_I x^I
$$
(using multi-index notation) such that for each $d \geq 0$ there
are only finitely many nonzero $a_I$ for $|I| = d$. The maximal
ideal $\mathfrak m' \subset R^\wedge$ is the collection of $f$ with
zero constant term. In particular, the element
$$
f = x_1 + x_2^2 + x_3^3 + \ldots
$$
is in $\mathfrak m'$ but not in $\mathfrak m R^\wedge$ which
shows that (1) is false in this example. However, if (1) is
false, then (3) is necessarily false because
$\mathfrak m' = \Ker(R^\wedge \to R/\mathfrak m)$
and we can apply
Algebra, Lemma \ref{algebra-lemma-hathat} with $n = 1$.

\medskip\noindent
To finish we prove that $R^\wedge$ is not $\mathfrak m'$-adically complete.
For $n \geq 1$ let $K_n = \Ker(R^\wedge \to R/\mathfrak m^n)$. Then
we have short exact sequences
$$
0 \to K_n/(\mathfrak m')^n \to R^\wedge/(\mathfrak m')^n \to
R/\mathfrak m^n \to 0
$$
The projection map $R^\wedge \to R/\mathfrak m^{n + 1}$ sends
$(\mathfrak m')^n$ onto $\mathfrak m^n/\mathfrak m^{n + 1}$.
It follows that $K_{n + 1} \to K_n/(\mathfrak m')^n$ is surjective.
Hence the inverse system $\left(K_n/(\mathfrak m')^n\right)$
has surjective transition maps and
taking inverse limits we obtain an exact sequence
$$
0 \to \lim K_n/(\mathfrak m')^n \to
\lim R^\wedge/(\mathfrak m')^n \to
\lim R/\mathfrak m^n \to 0
$$
by Algebra, Lemma \ref{algebra-lemma-Mittag-Leffler}.
Thus we see that $R^\wedge$ is complete with respect to $\mathfrak m'$
if and only if $K_n = (\mathfrak m')^n$ for all $n \geq 1$.

\medskip\noindent
To show that $R^\wedge$ is not $\mathfrak m'$-adically complete
in our example we show that $K_2 = \Ker(R^\wedge \to R/\mathfrak m^2)$
is not equal to $(\mathfrak m')^2$.
Note that an element of $(\mathfrak m')^2$
can be written as a finite sum
\begin{equation}
\label{equation-sum}
\sum\nolimits_{i = 1, \ldots, t} f_i g_i
\end{equation}
with $f_i, g_i \in R^\wedge$ having vanishing constant terms.
To get an example we are going to choose an $z \in K_2$
of the form
$$
z = z_1 + z_2 + z_3 + \ldots
$$
with the following properties
\begin{enumerate}
\item there exist sequences $1 < d_1 < d_2 < d_3 < \ldots $ and
$0 < n_1 < n_2 < n_3 < \ldots$ such that
$z_i \in k[x_{n_i}, x_{n_i + 1}, \ldots, x_{n_{i + 1} - 1}]$
homogeneous of degree $d_i$, and
\item in the ring $k[[x_{n_i}, x_{n_i + 1}, \ldots, x_{n_{i + 1} - 1}]]$
the element $z_i$ cannot be written as a sum (\ref{equation-sum})
with $t \leq i$.
\end{enumerate}
Clearly this implies that $z$ is not in $(\mathfrak m')^2$
because the image of the relation (\ref{equation-sum}) in the
ring $k[[x_{n_i}, x_{n_i + 1}, \ldots, x_{n_{i + 1} - 1}]]$
for $i$ large enough would produce a contradiction. Hence it suffices
to prove that for all $t > 0$ there exists a $d \gg 0$ and an integer
$n$ such that we can find an homogeneous element
$z \in k[x_1, \ldots, x_n]$ of degree $d$ which cannot be written as
a sum (\ref{equation-sum}) for the given $t$ in $k[[x_1, \ldots, x_n]]$.
Take $n > 2t$ and any $d > 1$ prime to the characteristic of $k$ and
set $z = \sum_{i = 1, \ldots, n} x_i^d$. Then the vanishing locus
of the ideal
$$
(\frac{\partial z}{\partial x_1}, \ldots, \frac{\partial z}{\partial x_n})
=
(dx_1^{d - 1}, \ldots, dx_n^{d - 1})
$$
consists of one point. On the other hand,
$$
\frac{\partial ( \sum\nolimits_{i = 1, \ldots, t} f_i g_i ) }{\partial x_j}
\in (f_1, \ldots, f_t, g_1, \ldots, g_t)
$$
by the Leibniz rule and hence the vanishing locus of these derivatives
contains at least
$$
V(f_1, \ldots, f_t, g_1, \ldots, g_t) \subset
\Spec(k[[x_1, \ldots, x_n]]).
$$
Hence this is a contradiction as the dimension of
$V(f_1, \ldots, f_t, g_1, \ldots, g_t)$ is at least $n - 2t \geq 1$.

\begin{lemma}
\label{lemma-noncomplete-completion}
There exists a local ring $R$ and a maximal ideal $\mathfrak m$ such that
the completion $R^\wedge$ of $R$ with respect to $\mathfrak m$ has the
following properties
\begin{enumerate}
\item $R^\wedge$ is local, but its maximal ideal is not equal to
$\mathfrak m R^\wedge$,
\item $R^\wedge$ is not a complete local ring, and
\item $R^\wedge$ is not $\mathfrak m$-adically complete as an $R$-module.
\end{enumerate}
\end{lemma}

\begin{proof}
This follows from the discussion above as (with $R = k[x_1, x_2, x_3, \ldots]$)
the completion of the localization $R_{\mathfrak m}$ is equal to the
completion of $R$.
\end{proof}





\section{Noncomplete quotient}
\label{section-noncomplete-quotient}

\noindent
Let $k$ be a field. Let
$$
R = k[t, z_1, z_2, z_3, \ldots, w_1, w_2, w_3, \ldots, x]/
(z_it - x^iw_i, z_i w_j)
$$
Note that in particular $z_iz_jt = 0$ in this ring. Any element $f$ of $R$
can be uniquely written as a finite sum
$$
f = \sum\nolimits_{i = 0, \ldots, d} f_i x^i
$$
where each $f_i \in k[t, z_i, w_j]$ has no terms involving the products
$z_it$ or $z_iw_j$. Moreover, if $f$ is written in this way, then
$f \in (x^n)$ if and only if $f_i = 0$ for $i < n$.
So $x$ is a nonzerodivisor and $\bigcap (x^n) = 0$.
Let $R^\wedge$ be the completion of $R$ with respect to the ideal $(x)$.
Note that $R^\wedge$ is $(x)$-adically complete, see
Algebra, Lemma \ref{algebra-lemma-hathat-finitely-generated}.
By the above we see that an element of $R^\wedge$ can be uniquely written
as an infinite sum
$$
f = \sum\nolimits_{i = 0}^\infty f_i x^i
$$
where each $f_i \in k[t, z_i, w_j]$ has no terms involving the products
$z_it$ or $z_iw_j$. Consider the element
$$
f = \sum\nolimits_{i = 1}^\infty x^i w_i =
xw_1 + x^2w_2 + x^3w_3 + \ldots
$$
i.e., we have $f_n = w_n$. Note that $f \in (t , x^n)$ for every $n$
because $x^mw_m \in (t)$ for all $m$.
We claim that $f \not \in (t)$. To prove this assume that
$tg = f$ where $g = \sum g_lx^l$ in canonical form as above.
Since $tz_iz_j = 0$ we may as well assume that none of the $g_l$ have
terms involving the products $z_iz_j$. Examining the process to
get $tg$ in canonical form we see the following:
Given any term $c m$ of $g_l$ where $c \in k$ and $m$ is a
monomial in $t, z_i, w_j$ and we make the following replacement
\begin{enumerate}
\item if the monomial $m$ does not involve any $z_i$, then $ctm$ is
a term of $f_l$, and
\item if the monomial $m$ does involve a $z_i$ then it is equal to
$m = z_i$ and we see that $cw_i$ is term of $f_{l + i}$.
\end{enumerate}
Since $g_0$ is a polynomial only finitely many of the variables $z_i$
occur in it. Pick $n$ such that $z_n$ does not occur in $g_0$.
Then the rules above show that $w_n$ does not occur in $f_n$ which is
a contradiction. It follows that $R^\wedge/(t)$ is not complete, see
Algebra, Lemma \ref{algebra-lemma-quotient-complete}.

\begin{lemma}
\label{lemma-noncomplete-quotient}
There exists a ring $R$ complete with respect to a principal ideal
$I$ and a principal ideal $J$ such that $R/J$ is not $I$-adically
complete.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{Completion is not exact}
\label{section-completion-not-exact}

\noindent
A quick example is the following. Suppose that $R = k[t]$. Let
$P = K = \bigoplus_{n \in \mathbf{N}} R$ and
$M = \bigoplus_{n \in \mathbf{N}} R/(t^n)$. Then there is a short exact
sequence $0 \to K \to P \to M \to 0$ where the first map is given by
multiplication by $t^n$ on the $n$th summand. We claim that
$0 \to K^\wedge \to P^\wedge \to M^\wedge \to 0$ is not exact in the middle.
Namely, $\xi = (t^2, t^3, t^4, \ldots) \in P^\wedge$ maps to zero in
$M^\wedge$ but is not in the image of $K^\wedge \to P^\wedge$, because
it would be the image of $(t, t, t, \ldots)$ which is not an element of
$K^\wedge$.

\medskip\noindent
A ``smaller'' example is the following. In the situation of
Lemma \ref{lemma-noncomplete-quotient}
the short exact sequence $0 \to J \to R \to R/J \to 0$ does not remain
exact after completion. Namely, if $f \in J$ is a generator, then
$f : R \to J$ is surjective, hence $R \to J^\wedge$ is surjective, hence
the image of $J^\wedge \to R$ is $(f) = J$ but the fact that
$R/J$ is noncomplete means that the kernel of the surjection
$R \to (R/J)^\wedge$ is strictly bigger than $J$, see
Algebra, Lemmas \ref{algebra-lemma-completion-generalities} and
\ref{algebra-lemma-quotient-complete}.
By the same token the sequence
$R \to R \to R/(f) \to 0$ does not remain exact on completion.

\begin{lemma}
\label{lemma-completion-not-exact}
\begin{slogan}
Completion is neither left nor right exact in general.
\end{slogan}
Completion is not an exact functor in general; it is not even
right exact in general. This holds even when $I$ is finitely
generated on the category of finitely presented modules.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{The category of complete modules is not abelian}
\label{section-non-abelian}


\noindent
Let $R$ be a ring and let $I \subset R$ be a finitely generated ideal.
Consider the category $\mathcal{A}$ of $I$-adically complete
$R$-modules, see
Algebra, Definition \ref{algebra-definition-complete}.
Let $\varphi : M \to N$ be a morphism of $\mathcal{A}$.
The cokernel of $\varphi$ in $\mathcal{A}$ is the completion
$(\Coker(\varphi))^\wedge$ of the usual cokernel
(as $I$ is finitely generated this completion is complete, see
Algebra, Lemma \ref{algebra-lemma-hathat-finitely-generated}).
Let $K = \Ker(\varphi)$. We claim that $K$ is complete and
hence is the kernel of $\varphi$ in $\mathcal{A}$. Namely, let
$K^\wedge$ be the completion. As $M$ is complete we obtain a factorization
$$
K \to K^\wedge \to M \xrightarrow{\varphi} N
$$
Since $\varphi$ is continuous for the $I$-adic topology, $K \to K^\wedge$
has dense image, and $K = \Ker(\varphi)$ we conclude that $K^\wedge$
maps into $K$. Thus $K^\wedge = K \oplus C$ and $K$ is a direct summand
of a complete module, hence complete.

\medskip\noindent
We will give an example that shows that $\Im \not = \Coim$
in general. We take $R = \mathbf{Z}_p = \lim_n \mathbf{Z}/p^n\mathbf{Z}$
to be the ring of $p$-adic integers and we take $I = (p)$.
Consider the map
$$
\text{diag}(1, p, p^2, \ldots) :
\left(\bigoplus\nolimits_{n \geq 1} \mathbf{Z}_p\right)^\wedge
\longrightarrow
\prod\nolimits_{n \geq 1} \mathbf{Z}_p
$$
where the left hand side is the $p$-adic completion of the direct sum.
Hence an element of the left hand side is a vector $(x_1, x_2, x_3, \ldots)$
with $x_i \in \mathbf{Z}_p$ with $p$-adic valuation $v_p(x_i) \to \infty$ as
$i \to \infty$. This maps to $(x_1, px_2, p^2x_3, \ldots)$. Hence we see
that $(1, p, p^2, \ldots)$ is in the closure of the image but not in
the image. By our description of kernels and cokernels above it is
clear that $\Im \not = \Coim$ for this map.

\begin{lemma}
\label{lemma-complete-modules-not-abelian}
Let $R$ be a ring and let $I \subset R$ be a finitely generated ideal.
The category of $I$-adically complete $R$-modules has kernels and
cokernels but is not abelian in general.
\end{lemma}

\begin{proof}
See above.
\end{proof}





\section{The category of derived complete modules}
\label{section-derived-complete-modules}

\noindent
Please read More on Algebra, Section
\ref{more-algebra-section-derived-complete-modules}
before reading this section.

\medskip\noindent
Let $A$ be a ring, let $I$ be an ideal of $A$, and denote $\mathcal{C}$
the category of derived complete modules as defined in
More on Algebra, Definition \ref{more-algebra-definition-derived-complete}.

\medskip\noindent
Let $T$ be a set and let $M_t$, $t \in T$ be a family of derived complete
modules. We claim that in general $\bigoplus M_t$ is not a derived complete
module. For a specific example, let $A = \mathbf{Z}_p$ and $I = (p)$ and
consider $\bigoplus_{n \in \mathbf{N}} \mathbf{Z}_p$. The map from
$\bigoplus_{n \in \mathbf{N}} \mathbf{Z}_p$ to its $p$-adic completion
isn't surjective. This means that $\bigoplus_{n \in \mathbf{N}} \mathbf{Z}_p$
cannot be derived complete as this would imply otherwise, see
More on Algebra, Lemma \ref{more-algebra-lemma-complete-derived-complete}.
Hence the inclusion functor $\mathcal{C} \to \text{Mod}_A$ does not commute
with either direct sums or (filtered) colimits.

\medskip\noindent
Assume $I$ is finitely generated. By the discussion in More on Algebra, Section
\ref{more-algebra-section-derived-complete-modules} the category
$\mathcal{C}$ has arbitrary colimits. However, we claim that filtered colimits
are not exact in the category $\mathcal{C}$. Namely, suppose that
$A = \mathbf{Z}_p$ and $I = (p)$. One has inclusions
$f_n : \mathbf{Z}_p/p\mathbf{Z}_p \to \mathbf{Z}_p/p^n\mathbf{Z}_p$
of $p$-adically complete $A$-modules given by multiplication by
$p^{n - 1}$. There are commutative diagrams
$$
\xymatrix{
\mathbf{Z}_p/p\mathbf{Z}_p \ar[r]_{f_n} \ar[d]^1 &
\mathbf{Z}_p/p^n\mathbf{Z}_p \ar[d]_p \\
\mathbf{Z}_p/p\mathbf{Z}_p \ar[r]^{f_{n + 1}} &
\mathbf{Z}_p/p^{n + 1}\mathbf{Z}_p
}
$$
We claim: the colimit of these inclusions in the category $\mathcal{C}$
gives the map $\mathbf{Z}_p/p\mathbf{Z}_p \to 0$. Namely, the colimit in
$\text{Mod}_A$ of the system on the right is $\mathbf{Q}_p/\mathbf{Z}_p$.
Thus the colimit in $\mathcal{C}$ is
$$
H^0((\mathbf{Q}_p/\mathbf{Z}_p)^\wedge) =
H^0(\mathbf{Z}_p[1]) = 0
$$
by More on Algebra, Section
\ref{more-algebra-section-derived-complete-modules}
where ${}^\wedge$ is derived completion.
This proves our claim.

\begin{lemma}
\label{lemma-derived-complete-modules}
Let $A$ be a ring and let $I \subset A$ be an ideal.
The category $\mathcal{C}$ of derived complete modules
is abelian and the inclusion functor $F : \mathcal{C} \to \text{Mod}_A$
is exact and commutes with arbitrary limits.
If $I$ is finitely generated, then $\mathcal{C}$ has
arbitrary direct sums and colimits, but $F$ does not commute with these
in general. Finally, filtered colimits are not exact in $\mathcal{C}$
in general, hence $\mathcal{C}$ is not a Grothendieck abelian category.
\end{lemma}

\begin{proof}
See More on Algebra, Lemma \ref{more-algebra-lemma-derived-complete-modules}
and discussion above.
\end{proof}





\section{Nonflat completions}
\label{section-nonflat}

\noindent
The completion of a ring with respect to an ideal isn't always flat,
contrary to the Noetherian case. We have seen two examples of this
phenomenon in
More on Algebra, Example \ref{more-algebra-example-not-glueing-pair}.
In this section we give two more examples.

\begin{lemma}
\label{lemma-countable-fg-tensor}
Let $R$ be a ring. Let $M$ be an $R$-module which is countable.
Then $M$ is a finite $R$-module if and only if
$M \otimes_R R^\mathbf{N} \to M^\mathbf{N}$ is surjective.
\end{lemma}

\begin{proof}
If $M$ is a finite module, then the map is surjective by Algebra, Proposition
\ref{algebra-proposition-fg-tensor}. Conversely, assume the map is surjective.
Let $m_1, m_2, m_3, \ldots$ be an enumeration of the elements of $M$.
Let $\sum_{j = 1, \ldots, m} x_j \otimes a_j$ be an element of the
tensor product mapping to the element $(m_n) \in M^\mathbf{N}$. Then
we see that $x_1, \ldots, x_m$ generate $M$ over $R$ as in the proof of
Algebra, Proposition \ref{algebra-proposition-fg-tensor}.
\end{proof}

\begin{lemma}
\label{lemma-countable-fp-tensor}
Let $R$ be a countable ring. Let $M$ be a countable $R$-module. Then $M$
is finitely presented if and only if the canonical map
$M \otimes_R R^\mathbf{N} \to M^\mathbf{N}$ is an isomorphism.
\end{lemma}

\begin{proof}
If $M$ is a finitely presented module, then the map is an isomorphism
by Algebra, Proposition \ref{algebra-proposition-fp-tensor}. Conversely,
assume the map is an isomorphism. By Lemma \ref{lemma-countable-fg-tensor}
the module $M$ is finite. Choose a surjection $R^{\oplus m} \to M$ with
kernel $K$. Then $K$ is countable as a submodule of $R^{\oplus m}$.
Arguing as in the proof of Algebra, Proposition
\ref{algebra-proposition-fp-tensor} we see that
$K \otimes_R R^\mathbf{N} \to K^\mathbf{N}$ is surjective.
Hence we conclude that $K$ is a finite $R$-module by
Lemma \ref{lemma-countable-fg-tensor}.
Thus $M$ is finitely presented.
\end{proof}

\begin{lemma}
\label{lemma-countable-coherent}
Let $R$ be a countable ring. Then $R$ is coherent if and only if
$R^\mathbf{N}$ is a flat $R$-module.
\end{lemma}

\begin{proof}
If $R$ is coherent, then $R^\mathbf{N}$ is a flat module by
Algebra, Proposition \ref{algebra-proposition-characterize-coherent}.
Assume $R^\mathbf{N}$ is flat. Let $I \subset R$ be a finitely
generated ideal. To prove the lemma we show that $I$ is finitely
presented as an $R$-module. Namely, the map
$I \otimes_R R^\mathbf{N} \to R^\mathbf{N}$ is
injective as $R^\mathbf{N}$ is flat and its image is
$I^\mathbf{N}$ by Lemma \ref{lemma-countable-fg-tensor}.
Thus we conclude by Lemma \ref{lemma-countable-fp-tensor}.
\end{proof}

\noindent
Let $R$ be a countable ring. Observe that $R[[x]]$ is isomorphic to
$R^\mathbf{N}$ as an $R$-module. By Lemma \ref{lemma-countable-coherent}
we see that $R \to R[[x]]$ is flat if and only if $R$ is coherent.
There are plenty of noncoherent countable rings, for example
$$
R = k[y, z, a_1, b_1, a_2, b_2, a_3, b_3, \ldots]/
(a_1 y + b_1 z, a_2 y + b_2 z, a_3 y + b_3 z, \ldots)
$$
where $k$ is a countable field. This ring is not coherent because
the ideal $(y, z)$ of $R$ is not a finitely presented $R$-module.
Note that $R[[x]]$ is the completion of $R[x]$ by the principal
ideal $(x)$.

\begin{lemma}
\label{lemma-completion-polynomial-ring-not-flat}
There exists a ring such that the completion $R[[x]]$ of $R[x]$
at $(x)$ is not flat over $R$ and a fortiori not flat over $R[x]$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
It turns out there is a ring $R$ such that $R[[x]]$ is flat
over $R$, but $R[[x]]$ is not flat over $R[x]$. See
\href{https://math.stackexchange.com/users/164860/badam-baplan}{this post}
by Badam Baplan. Namely, let
$R$ be a valuation ring. Then $R$ is coherent (Algebra, Example
\ref{algebra-example-valuation-ring-coherent}) and hence
$R[[x]]$ is flat over $R$ by 
Algebra, Proposition \ref{algebra-proposition-characterize-coherent}.
On the other hand, we have the following lemma.

\begin{lemma}
\label{lemma-almost-integral-when-powerseries-flat}
Let $R$ be a domain with fraction field $K$.
If $R[[x]]$ is flat over $R[x]$, then $R$ is normal if and only
if $R$ is completely normal
(Algebra, Definition \ref{algebra-definition-almost-integral}).
\end{lemma}

\begin{proof}
Suppose we have $\alpha \in K$ and a nonzero $r \in R$ such that
$r \alpha^n \in R$ for all $n \geq 1$. Then we consider
$f = \sum r \alpha^{n - 1} x^n$ in $R[[x]]$. Write $\alpha = a/b$
for $a, b \in R$ with $b$ nonzero. Then we see that $(a x - b)f = -rb$.
It follows that $rb$ is in the ideal $(ax - b)R[[x]]$.
Let $S = \{h \in R[x] : h(0) = 1\}$. This is a multiplicative subset
and flatness of $R[x] \to R[[x]]$ implies that $S^{-1}R[x] \to R[[x]]$
is faithfully flat (details omitted; hint: use Algebra, Lemma
\ref{algebra-lemma-ff-rings}). Hence
$$
S^{-1}R/(ax - b)S^{-1}R \to R[[x]]/(ax - b)R[[x]]
$$
is injective. We conclude that
$h rb = (ax - b) g$ for some $h \in S$ and $g \in R[x]$.
Writing $h = 1 + h_1 x + \ldots + h_d x^d$ shows that we obtain
$$
1 + h_1 x + \ldots + h_d x^d = (1/r)(\alpha x - 1)g
$$
This factorization in $K[x]$ gives a corresponding factorization
in $K[x^{-1}]$ which shows that $\alpha$ is the root of a monic
polynomial with coefficients in $R$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-completion-polynomial-ring-not-flat-bis}
If $R$ is a valuation ring of dimension $> 1$, then $R[[x]]$
is flat over $R$ but not flat over $R[x]$.
\end{lemma}

\begin{proof}
The arguments above show that this is true if we can show that
$R$ is not completely normal (valuation rings are
normal, see Algebra, Lemma \ref{algebra-lemma-valuation-ring-normal}).
Let $\mathfrak p \subset \mathfrak m \subset R$ be a chain of primes.
Pick nonzero $x \in \mathfrak p$ and $y \in \mathfrak m \setminus \mathfrak p$.
Then $x y^{-n} \in R$ for all $n \geq 1$ (if not then $y^n/x \in R$
which is absurd because $y \not \in \mathfrak p$). Hence $1/y$ is
almost integral over $R$ but not in $R$.
\end{proof}

\noindent
Next, we will construct an example where the completion of a localization
is nonflat. To do this consider the ring
$$
R = k[y, z, a_1, a_2, a_3, \ldots]/(ya_i, a_i a_j)
$$
Denote $f \in R$ the residue class of $z$. We claim the ring map
\begin{equation}
\label{equation-nonflat}
R[[x]] \longrightarrow R_f[[x]]
\end{equation}
isn't flat. Let $I$ be the kernel of $y : R[[x]] \to R[[x]]$. A typical
element $g$ of $I$ looks like $g = \sum g_{n, m} a_mx^n$
where $g_{n, m} \in k[z]$ and for a given $n$ only a finite number of
nonzero $g_{n, m}$. Let $J$ be the kernel of $y : R_f[[x]] \to R_f[[x]]$.
We claim that $J \not = I R_f[[x]]$. Namely, if this were true then we
would have
$$
\sum z^{-n} a_n x^n = \sum\nolimits_{i = 1, \ldots, m} h_i g_i
$$
for some $m \geq 1$, $g_i \in I$, and $h_i \in R_f[[x]]$. Say
$h_i = \bar h_i \bmod (y, a_1, a_2, a_3, \ldots)$
with $\bar h_i \in k[z, 1/z][[x]]$.  Looking at the coefficient of
$a_n$ and using the description of the elements $g_i$ above we would get
$$
z^{-n} x^n = \sum \bar h_i \bar g_{i, n}
$$
for some $\bar g_{i, n} \in k[z][[x]]$. This would mean that
all $z^{-n}x^n$ are contained in the finite $k[z][[x]]$-module
generated by the elements $\bar h_i$. Since $k[z][[x]]$ is Noetherian
this implies that the $R[z][[x]]$-submodule of $k[z, 1/z][[x]]$
generated by $1, z^{-1}x, z^{-2}x^2, \ldots$ is finite. By
Algebra, Lemma \ref{algebra-lemma-characterize-integral-element}
we would conclude that $z^{-1}x$ is integral over $k[z][[x]]$
which is absurd. On the other hand,
if (\ref{equation-nonflat}) were flat, then we would
get $J = IR_f[[x]]$ by tensoring the exact sequence
$0 \to I \to R[[x]] \xrightarrow{y} R[[x]]$ with $R_f[[x]]$.

\begin{lemma}
\label{lemma-nonflat-completion-localization}
There exists a ring $A$ complete with respect to a principal ideal $I$
and an element $f \in A$ such that the $I$-adic completion
$A_f^\wedge$ of $A_f$ is not flat over $A$.
\end{lemma}

\begin{proof}
Set $A = R[[x]]$ and $I = (x)$ and observe that $R_f[[x]]$
is the completion of $R[[x]]_f$.
\end{proof}





\section{Nonabelian category of quasi-coherent modules}
\label{section-nonabelian-QCoh}

\noindent
In Sheaves on Stacks, Section \ref{stacks-sheaves-section-quasi-coherent}
we defined the category of quasi-coherent modules on a category fibred in
groupoids over $\Sch$. Although we show in
Sheaves on Stacks, Section
\ref{stacks-sheaves-section-quasi-coherent-algebraic-stacks}
that this category is abelian for algebraic stacks, in this
section we show that this is not the case for formal algebraic spaces.

\medskip\noindent
Namely, consider $\mathbf{Z}_p$ viewed as topological ring using
the $p$-adic topology. Let $X = \text{Spf}(\mathbf{Z}_p)$, see
Formal Spaces, Definition
\ref{formal-spaces-definition-affine-formal-spectrum}.
Then $X$ is a sheaf in sets on $(\Sch/\mathbf{Z})_{fppf}$
and gives rise to a stack in setoids $\mathcal{X}$, see 
Stacks, Lemma \ref{stacks-lemma-when-stack-in-sets}.
Thus the discussion of Sheaves on Stacks, Section
\ref{stacks-sheaves-section-quasi-coherent-algebraic-stacks}
applies. 

\medskip\noindent
Let $\mathcal{F}$ be a quasi-coherent module on $\mathcal{X}$.
Since $X = \colim \Spec(\mathbf{Z}/p^n\mathbf{Z})$ it is clear from
Sheaves on Stacks, Lemma \ref{stacks-sheaves-lemma-quasi-coherent}
that $\mathcal{F}$ is given by a sequence $(\mathcal{F}_n)$ where
\begin{enumerate}
\item $\mathcal{F}_n$ is a quasi-coherent module on
$\Spec(\mathbf{Z}/p^n\mathbf{Z})$, and
\item the transition maps give isomorphisms
$\mathcal{F}_n = \mathcal{F}_{n + 1}/p^n\mathcal{F}_{n + 1}$.
\end{enumerate}
Converting into modules we see that $\mathcal{F}$ corresponds to a
system $(M_n)$ where each $M_n$ is an abelian group annihilated
by $p^n$ and the transition maps induce isomorphisms
$M_n = M_{n + 1}/p^n M_{n + 1}$. In this situation the module
$M = \lim M_n$ is a $p$-adically complete module and $M_n = M/p^n M$, see
Algebra, Lemma \ref{algebra-lemma-limit-complete}.
We conclude that the category of quasi-coherent modules on $X$
is equivalent to the category of $p$-adically complete
abelian groups. This category is not abelian, see
Section \ref{section-non-abelian}.

\begin{lemma}
\label{lemma-quasi-coherent-not-abelian}
The category of quasi-coherent\footnote{With quasi-coherent modules
as defined above. Due to how things are setup in the Stacks project,
this is really the correct definition; as seen above our definition
agrees with what one would naively have defined to be quasi-coherent modules
on $\text{Spf}(A)$, namely complete $A$-modules.}
modules on a formal algebraic space
$X$ is not abelian in general, even if $X$ is a Noetherian affine
formal algebraic space.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}


\section{Regular sequences and base change}
\label{section-regular-base-change}

\noindent
We are going to construct a ring $R$ with a regular sequence
$(x, y, z)$ such that there exists a nonzero element $\delta \in R/zR$
with $x\delta = y\delta = 0$.

\medskip\noindent
To construct our example we first
construct a peculiar module $E$ over the ring $k[x, y, z]$
where $k$ is any field. Namely, $E$ will be a push-out as
in the following diagram
$$
\xymatrix{
\frac{xk[x, y, z, y^{-1}]}{xyk[x, y, z]} \ar[r] \ar[d]^{z/x} &
\frac{k[x, y, z, x^{-1}, y^{-1}]}{yk[x, y, z, x^{-1}]} \ar[r] \ar[d] &
\frac{k[x, y, z, x^{-1}, y^{-1}]}{yk[x, y, z, x^{-1}] + xk[x, y, z, y^{-1}]}
\ar[d] \\
\frac{k[x, y, z, y^{-1}]}{yzk[x, y, z]} \ar[r] &
E \ar[r] &
\frac{k[x, y, z, x^{-1}, y^{-1}]}{yk[x, y, z, x^{-1}] + xk[x, y, z, y^{-1}]}
}
$$
where the rows are short exact sequences (we dropped the outer zeros due
to typesetting problems). Another way to describe $E$ is as
$$
E = \{(f, g) \mid f \in k[x, y, z, x^{-1}, y^{-1}],
g \in k[x, y, z, y^{-1}] \}/\sim
$$
where $(f, g) \sim (f', g')$ if and only if there exists a
$h \in k[x, y, z, y^{-1}]$ such that
$$
f = f' + xh \bmod yk[x, y, z, x^{-1}], \quad
g = g' - zh \bmod yzk[x, y, z]
$$
We claim: (a) $x : E \to E$ is injective, (b)
$y : E/xE \to E/xE$ is injective, (c) $E/(x, y)E = 0$, (d) there
exists a nonzero element $\delta \in E/zE$ such that
$x\delta = y\delta = 0$.

\medskip\noindent
To prove (a) suppose that $(f, g)$ is a pair that gives rise to an
element of $E$ and that $(xf, xg) \sim 0$. Then there exists a
$h \in k[x, y, z, y^{-1}]$ such that $xf + xh \in yk[x, y, z, x^{-1}]$
and $xg - zh \in yzk[x, y, z]$. We may assume that
$h = \sum a_{i, j, k}x^iy^jz^k$ is a sum of monomials where only
$j \leq 0$ occurs. Then $xg - zh \in yzk[x, y, z]$ implies that
only $i > 0$ occurs, i.e., $h = xh'$ for some $h' \in k[x, y, z, y^{-1}]$.
Then $(f, g) \sim (f + xh', g - zh')$ and we see that we may assume
that $g = 0$ and $h = 0$. In this case $xf \in yk[x, y, z, x^{-1}]$
implies $f \in yk[x, y, z, x^{-1}]$ and we see that $(f, g) \sim 0$.
Thus $x : E \to E$ is injective.

\medskip\noindent
Since multiplication by $x$ is an isomorphism on
$\frac{k[x, y, z, x^{-1}, y^{-1}]}{yk[x, y, z, x^{-1}]}$ we see that
$E/xE$ is isomorphic to
$$
\frac{k[x, y, z, y^{-1}]}{
yzk[x, y, z] + xk[x, y, z, y^{-1}] + zk[x, y, z, y^{-1}]}
=
\frac{k[x, y, z, y^{-1}]}{xk[x, y, z, y^{-1}] + zk[x, y, z, y^{-1}]}
$$
and hence multiplication by $y$ is an isomorphism on $E/xE$. This clearly
implies (b) and (c).

\medskip\noindent
Let $e \in E$ be the equivalence class of $(1, 0)$.
Suppose that $e \in zE$. Then there exist $f \in k[x, y, z, x^{-1}, y^{-1}]$,
$g \in k[x, y, z, y^{-1}]$, and $h \in k[x, y, z, y^{-1}]$ such that
$$
1 + zf + xh \in yk[x, y, z, x^{-1}], \quad
0 + zg - zh \in yzk[x, y, z].
$$
This is impossible: the monomial $1$ cannot occur in
$zf$, nor in $xh$. On the other hand, we have $ye = 0$ and
$xe = (x, 0) \sim (0, -z) = z(0, -1)$. Hence setting $\delta$
equal to the congruence class of $e$ in $E/zE$ we obtain (d).

\begin{lemma}
\label{lemma-strange-regular-sequence}
There exists a local ring $R$ and a regular sequence $x, y, z$
(in the maximal ideal) such that there exists a nonzero element
$\delta \in R/zR$ with $x\delta = y\delta = 0$.
\end{lemma}

\begin{proof}
Let $R = k[x, y, z] \oplus E$ where $E$ is the module above considered
as a square zero ideal. Then it is clear that $x, y, z$ is a regular
sequence in $R$, and that the element $\delta \in E/zE \subset R/zR$
gives an element with the desired properties. To get a local example
we may localize $R$ at the maximal ideal $\mathfrak m = (x, y, z, E)$.
The sequence $x, y, z$ remains a regular sequence (as localization is
exact), and the element $\delta$ remains nonzero as it is supported
at $\mathfrak m$.
\end{proof}

\begin{lemma}
\label{lemma-base-change-regular-sequence}
There exists a local homomorphism of local rings $A \to B$
and a regular sequence $x, y$ in the maximal ideal of $B$ such that
$B/(x, y)$ is flat over $A$, but such that the images
$\overline{x}, \overline{y}$ of $x, y$ in $B/\mathfrak m_AB$ do not
form a regular sequence, nor even a Koszul-regular sequence.
\end{lemma}

\begin{proof}
Set $A = k[z]_{(z)}$ and let $B = (k[x, y, z] \oplus E)_{(x, y, z, E)}$.
Since $x, y, z$ is a regular sequence in $B$, see proof of
Lemma \ref{lemma-strange-regular-sequence},
we see that $x, y$ is a regular sequence in $B$ and that
$B/(x, y)$ is a torsion free $A$-module, hence flat.
On the other hand, there exists a nonzero element
$\delta \in B/\mathfrak m_AB = B/zB$ which is annihilated
by $\overline{x}, \overline{y}$. Hence
$H_2(K_\bullet(B/\mathfrak m_AB, \overline{x}, \overline{y})) \not = 0$.
Thus $\overline{x}, \overline{y}$ is not Koszul-regular, in particular
it is not a regular sequence, see
More on Algebra, Lemma \ref{more-algebra-lemma-regular-koszul-regular}.
\end{proof}





\section{A Noetherian ring of infinite dimension}
\label{section-Noetherian-infinite-dimension}

\noindent
A Noetherian local ring has finite dimension as we saw in
Algebra, Proposition \ref{algebra-proposition-dimension}.
But there exist Noetherian rings of infinite dimension.
See \cite[Appendix, Example 1]{Nagata}.

\medskip\noindent
Namely, let $k$ be a field, and consider the ring
$$
R = k[x_1, x_2, x_3, \ldots ].
$$
Let $\mathfrak p_i = (x_{2^{i - 1}}, x_{2^{i - 1} + 1}, \ldots, x_{2^i - 1})$
for $i = 1, 2, \ldots$ which are prime ideals of $R$. Let $S$
be the multiplicative subset
$$
S = \bigcap\nolimits_{i \geq 1} (R \setminus \mathfrak p_i).
$$
Consider the ring $A = S^{-1}R$.
We claim that
\begin{enumerate}
\item The maximal ideals of the ring $A$ are the ideals
$\mathfrak m_i = \mathfrak p_iA$.
\item We have $A_{\mathfrak m_i} = R_{\mathfrak p_i}$ which is
a Noetherian local ring of dimension $2^i$.
\item The ring $A$ is Noetherian.
\end{enumerate}
Hence it is clear that this is the example we are looking for.
Details omitted.




\section{Local rings with nonreduced completion}
\label{section-local-completion-nonreduced}

\noindent
In Algebra, Example \ref{algebra-example-bad-dvr-char-p} we gave an example
of a characteristic $p$ Noetherian local domain $R$ of dimension $1$
whose completion is nonreduced. In this section we present the example
of \cite[Proposition 3.1]{Ferrand-Raynaud} which gives a similar
ring in characteristic zero.

\medskip\noindent
Let $\mathbf{C}\{x\}$ be the ring of convergent power series over
the field $\mathbf{C}$ of complex numbers. The ring of all power series
$\mathbf{C}[[x]]$ is its completion. Let $K = \mathbf{C}\{x\}[1/x]$
be the field of convergent Laurent series. The $K$-module
$\Omega_{K/\mathbf{C}}$ of algebraic differentials
of $K$ over $\mathbf{C}$ is an infinite dimensional $K$-vector space
(proof omitted). We may choose $f_n \in x\mathbf{C}\{x\}$,
$n \geq 1$ such that
$
\text{d}x, \text{d}f_1, \text{d}f_2, \ldots
$
are part of a basis of $\Omega_{K/\mathbf{C}}$. Thus we can
find a $\mathbf{C}$-derivation
$$
D : \mathbf{C}\{x\} \longrightarrow \mathbf{C}((x))
$$
such that $D(x) = 0$ and $D(f_i) = x^{-n}$. Let
$$
A = \{f \in \mathbf{C}\{x\} \mid D(f) \in \mathbf{C}[[x]]\}
$$
We claim that
\begin{enumerate}
\item $\mathbf{C}\{x\}$ is integral over $A$,
\item $A$ is a local domain,
\item $\dim(A) = 1$,
\item the maximal ideal of $A$ is generated by $x$ and $xf_1$,
\item $A$ is Noetherian, and
\item the completion of $A$ is equal to the ring of dual numbers
over $\mathbf{C}[[x]]$.
\end{enumerate}
Since the dual numbers are nonreduced the ring $A$ gives the example.

\medskip\noindent
Note that if $0 \not = f \in x\mathbf{C}\{x\}$ then
we may write $D(f) = h/f^n$ for some $n \geq 0$ and $h \in \mathbf{C}[[x]]$.
Hence $D(f^{n + 1}/(n + 1)) \in \mathbf{C}[[x]]$
and $D(f^{n + 2}/(n + 2)) \in \mathbf{C}[[x]]$. Thus we
see $f^{n + 1}, f^{n + 2} \in A$!
In particular we see (1) holds. We also conclude that
the fraction field of $A$ is equal to the fraction field of
$\mathbf{C}\{x\}$. It also follows immediately that
$A \cap x\mathbf{C}\{x\}$ is the set of nonunits of $A$, hence
$A$ is a local domain of dimension $1$. If we can show (4)
then it will follow that $A$ is Noetherian (proof omitted).
Suppose that $f \in A \cap x\mathbf{C}\{x\}$. Write
$D(f) = h$, $h \in \mathbf{C}[[x]]$. Write $h = c + xh'$
with $c \in \mathbf{C}$, $h' \in \mathbf{C}[[x]]$. Then
$D(f - cxf_1) = c + xh' - c = xh'$. On the other hand
$f - cxf_1 = xg$ with $g \in \mathbf{C}\{x\}$, but by the
computation above we have $D(g) = h' \in \mathbf{C}[[x]]$
and hence $g \in A$. Thus $f = cxf_1 + xg \in (x, xf_1)$ as desired.

\medskip\noindent
Finally, why is the completion of $A$ nonreduced? Denote $\hat A$ the
completion of $A$. Of course this maps surjectively to the completion
$\mathbf{C}[[x]]$ of $\mathbf{C}\{x\}$ because $x \in A$. Denote
this map $\psi : \hat A \to \mathbf{C}[[x]]$.
Above we saw that $\mathfrak m_A = (x, xf_1)$
and hence $D(\mathfrak m_A^n) \subset (x^{n - 1})$ by an easy
computation. Thus $D : A \to \mathbf{C}[[x]]$ is continuous and
gives rise to a continuous derivation $\hat D : \hat A \to \mathbf{C}[[x]]$
over $\psi$. Hence we get a ring map
$$
\psi + \epsilon \hat D :
\hat A
\longrightarrow
\mathbf{C}[[x]][\epsilon].
$$
Since $\hat A$ is a one dimensional Noetherian complete local ring, if we
can show this arrow is surjective then it will follow that $\hat A$
is nonreduced. Actually the map is an isomorphism but we omit the
verification of this. The subring $\mathbf{C}[x]_{(x)} \subset A$
gives rise to a map $i : \mathbf{C}[[x]] \to \hat A$ on completions such
that $i \circ \psi = \text{id}$ and such that $D \circ i = 0$
(as $D(x) = 0$ by construction). Consider the elements $x^nf_n \in A$.
We have
$$
(\psi + \epsilon D)(x^nf_n) = x^n f_n + \epsilon
$$
for all $n \geq 1$. Surjectivity easily follows from these remarks.





\section{Another local ring with nonreduced completion}
\label{section-another-local-completion-nonreduced}

\noindent
In this section we make an example of a Noetherian local domain
of dimension $2$ complete with respect to a principal ideal
such that the recompletion of a localization is nonreduced.

\medskip\noindent
Let $p$ be a prime number. Let $k$ be a field of characteristic $p$
such that $k$ has infinite degree over its subfield $k^p$ of $p$th powers.
For example $k = \mathbf{F}_p(t_1, t_2, t_3, \ldots)$.
Consider the ring
$$
A =
\left\{
\begin{matrix}
\sum a_{i, j} x^iy^j \in k[[x, y]] \text{ such that for all }n \geq 0
\text{ we have } \\
[k^p(a_{n, n}, a_{n, n + 1}, a_{n + 1, n},
a_{n, n + 2}, a_{n + 2, n}, \ldots) : k^p] < \infty
\end{matrix}
\right\}
$$
As a set we have
$$
k^p[[x, y]] \subset A  \subset k[[x, y]]
$$
Every element $f$ of $A$ can be uniquely written as a series
$$
f = f_0 + f_1 xy + f_2 (xy)^2 + f_3 (xy)^3 + \ldots
$$
with
$$
f_n = a_{n, n} + a_{n, n + 1} y + a_{n + 1, n} x +
a_{n, n + 2} y^2 + a_{n + 2, n} x^2 + \ldots
$$
and the condition in the formula defining $A$ means that the
coefficients of $f_n$ generate a finite extension of $k^p$.
From this presentation it is clear that $A$ is an
$k^p[[x, y]]$-subalgebra of $k[[x, y]]$ complete with
respect to the ideal $xy$. Moreover, we clearly have
$$
A/xy A = C \times_k D
$$
where $k^p[[x]] \subset C \subset k[[x]]$ and
$k^p[[y]] \subset D \subset k[[y]]$ are the subrings
of power series from
Algebra, Example \ref{algebra-example-bad-dvr-char-p}.
Hence $C$ and $D$ are dvrs and we see that $A/ xy A$ is
Noetherian. By Algebra, Lemma \ref{algebra-lemma-completion-Noetherian} we
conclude that $A$ is Noetherian. Since $\dim(k[[x, y]]) = 2$ using
Algebra, Lemma \ref{algebra-lemma-integral-sub-dim-equal}
we conclude that $\dim(A) = 2$.

\medskip\noindent
Let $f = \sum a_i x^i$ be a power series such that
$k^p(a_0, a_1, a_2, \ldots)$ has infinite degree over $k^p$.
Then $f \not \in A$ but $f^p \in A$. We set
$$
B = A[f] \subset k[[x, y]]
$$
Since $B$ is finite over $A$ we see that $B$ is Noetherian.
Also, $B$ is  complete with respect to the ideal generated by $xy$, see
Algebra, Lemma \ref{algebra-lemma-completion-tensor}.
In fact $B$ is free over $A$ with basis $1, f, f^2, \ldots, f^{p - 1}$;
we omit the proof.

\medskip\noindent
We claim the ring
$$
(B_y)^\wedge = (B[1/y])^\wedge = \lim B[1/y]/(xy)^n B[1/y] =
\lim B[1/y] / x^n B[1/y]
$$
is nonreduced. Namely, this ring is free over
$$
(A_y)^\wedge = (A[1/y])^\wedge = \lim A[1/y]/(xy)^n A[1/y] =
\lim A[1/y] / x^n A[1/y]
$$
with basis $1, f, \ldots, f^{p - 1}$. However, there is an
element $g \in (A_y)^\wedge$ such that $f^p = g^p$. Namely,
we can just take $g = \sum a_i x^i$ (the same expression as
we used for $f$) which makes sense in $(A_y)^\wedge$.
Hence we see that
$$
(B_y)^\wedge = (A_y)^\wedge[f]/(f^p - g^p) \cong
(A_y)^\wedge[\tau]/(\tau^p)
$$
is nonreduced. In fact, this example shows slightly more.
Namely, observe that $(A_y)^\wedge$ is a dvr with
uniformizer $x$ and residue field the fraction field
of the dvr $D$ given above. Hence we see that even
$$
(B_y)^\wedge[1/(xy)] = ((B_y)^\wedge)_{xy}
$$
is nonreduced. This produces an example of the following kind.

\begin{lemma}
\label{lemma-nonreduced-recompletion}
There exists a local Noetherian $2$-dimensional domain $(B, \mathfrak m)$
complete with respect to a principal ideal $I = (b)$ and an
element $f \in \mathfrak m$, $f \not \in I$ such that
the $I$-adic completion $C = (B_f)^\wedge$ of the principal
localization $B_f$ is nonreduced and even such that
$C_b = C[1/b] = (B_f)^\wedge[1/b]$ is nonreduced.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}








\section{A non catenary Noetherian local ring}
\label{section-non-catenary-Noetherian-local}

\noindent
Even though there is a succesful dimension theory of Noetherian local rings
there are non-catenary Noetherian local rings. An example may be found in
\cite[Appendix, Example 2]{Nagata}. In fact, we will present this example
in the simplest case. Namely, we will construct a local Noetherian domain $A$
of dimension $2$ which is not universally catenary. (Note that $A$ is
automatically catenary, see
Exercises, Exercise
\ref{exercises-exercise-Noetherian-local-domain-dim-2-catenary}.)
The existence of a Noetherian local ring which is not universally
catenary implies the existence of a Noetherian local ring which
is not catenary -- and we spell this out at the end of this section
in the particular example at hand.

\medskip\noindent
Let $k$ be a field, and consider the formal power series ring
$k[[x]]$ in one variable over $k$. Let
$$
z = \sum\nolimits_{i = 1}^\infty a_i x^i
$$
be a formal power series. We assume $z$ as an element of the Laurent
series field $k((x)) = k[[x]][1/x]$ is transcendental over $k(x)$.
Put
$$
z_j
=
x^{-j}(z - \sum\nolimits_{i = 1, \ldots, j - 1} a_i x^i)
=
\sum\nolimits_{i = j}^\infty a_i x^{i - j}
\in k[[x]].
$$
Note that $z = xz_1$.
Let $R$ be the subring of $k[[x]]$ generated by $x$, $z$ and all of the
$z_j$, in other words
$$
R = k[x, z_1, z_2, z_3, \ldots ] \subset k[[x]].
$$
Consider the ideals $\mathfrak m = (x)$ and
$\mathfrak n = (x - 1, z_1, z_2, \ldots)$ of $R$.

\medskip\noindent
We have $xz_{j + 1} + a_j = z_j$. Hence $R/\mathfrak m = k$
and $\mathfrak m$ is a maximal ideal. Moreover, any element of $R$
not in $\mathfrak m$ maps to a unit in $k[[x]]$ and hence
$R_{\mathfrak m} \subset k[[x]]$. In fact it is easy to deduce
that $R_{\mathfrak m}$ is a discrete valuation ring and residue
field $k$.

\medskip\noindent
We claim that
$$
R/(x - 1) =
k[x, z_1, z_2, z_3, \ldots ]/(x - 1)
\cong
k[z].
$$
Namely, the relation above implies that
$(x - 1)(z_{j + 1} + a_j) = -z_{j + 1} - a_j + z_j$, and hence
we may express the class of $z_{j + 1}$ in terms of $z_j$ in
the quotient $R/(x - 1)$. Since the fraction field of $R$
has transcendence degree $2$ over $k$ by construction we see that $z$ is
transcendental over $k$ in $R/(x - 1)$, whence the desired isomorphism.
Hence $\mathfrak n = (x - 1, z)$ and is a maximal ideal. In fact the
map
$$
k[x, x^{-1}, z]_{(x - 1, z)} \longrightarrow R_{\mathfrak n}
$$
is an isomorphism (since $x^{-1}$ is invertible in $R_{\mathfrak n}$
and since $z_{j + 1} = x^{-1}z_j - a_j = \ldots = f_j(x, x^{-1}, z)$).
This shows that $R_{\mathfrak n}$ is a regular local ring
of dimension $2$ and residue field $k$.

\medskip\noindent
Let $S$ be the multiplicative subset
$$
S =
(R \setminus \mathfrak m) \cap (R \setminus \mathfrak n) =
R \setminus (\mathfrak m \cup \mathfrak n)
$$
and set $B = S^{-1}R$. We claim that
\begin{enumerate}
\item The ring $B$ is a $k$-algebra.
\item The maximal ideals of the ring $B$ are the two ideals
$\mathfrak mB$ and $\mathfrak nB$.
\item The residue field at these maximal ideals is $k$.
\item We have $B_{\mathfrak mB} = R_{\mathfrak m}$
and $B_{\mathfrak nB} = R_{\mathfrak n}$
which are Noetherian regular local rings of dimensions $1$ and $2$.
\item The ring $B$ is Noetherian.
\end{enumerate}
We omit the details of the verifications.

\medskip\noindent
Whenever given a $k$-algebra $B$ with the properties listed above we
get an example as follows. Take $A = k + \text{rad}(B) \subset B$
with $\text{rad}(B) = \mathfrak mB \cap \mathfrak nB$ the Jacobson radical.
It is easy to see that $B$ is finite over $A$ and hence $A$ is
Noetherian by Eakin's theorem (see \cite{Eakin}, or
\cite[Appendix A1]{Nagata}, or insert future reference here).
Also $A$ is a local domain with the same fraction field as $B$ and
residue field $k$. Since the dimension of $B$ is $2$ we see that $A$
has dimension $2$ as well, by
Algebra, Lemma \ref{algebra-lemma-integral-sub-dim-equal}.

\medskip\noindent
If $A$ were universally catenary then the dimension formula,
Algebra, Lemma \ref{algebra-lemma-dimension-formula}
would give $\dim(B_{\mathfrak mB}) = 2$ contradiction.

\medskip\noindent
Note that $B$ is generated by one element over $A$.
Hence $B = A[x]/\mathfrak p$ for some prime
$\mathfrak p$ of $A[x]$. Let $\mathfrak m' \subset A[x]$ be
the maximal ideal corresponding to $\mathfrak mB$. Then on
the one hand $\dim(A[x]_{\mathfrak m'}) = 3$ and on the
other hand
$$
(0)
\subset \mathfrak pA[x]_{\mathfrak m'}
\subset \mathfrak m'A[x]_{\mathfrak m'}
$$
is a maximal chain of primes. Hence $A[x]_{\mathfrak m'}$ is
an example of a non catenary Noetherian local ring.





\section{Existence of bad local Noetherian rings}
\label{section-bad}

\noindent
Let $(A, \mathfrak m, \kappa)$ be a Noetherian complete local ring.
In \cite{Lech} it was shown that $A$ is the completion of a Noetherian
local domain if $\text{depth}(A) \geq 1$ and $A$ contains either
$\mathbf{Q}$ or $\mathbf{F}_p$ as a subring, or contains $\mathbf{Z}$
as a subring and $A$ is torsion free as a $\mathbf{Z}$-module.
This produces many examples of Noetherian local domains with
``bizarre'' properties.

\medskip\noindent
Applying this for example to $A = \mathbf{C}[[x, y]]/(y^2)$ we find
a Noetherian local domain whose completion is nonreduced.
Please compare with
Section \ref{section-local-completion-nonreduced}.

\medskip\noindent
In \cite{LLPY} conditions were found that characterize when $A$ is
the completion of a reduced local Noetherian ring.

\medskip\noindent
In \cite{Heitmann-completion-UFD} it was shown that $A$ is the completion
of a local Noetherian UFD $R$ if $\text{depth}(A) \geq 2$ and $A$ contains
either $\mathbf{Q}$ or $\mathbf{F}_p$ as a subring, or contains $\mathbf{Z}$
as a subring and $A$ is torsion free as a $\mathbf{Z}$-module.
In particular $R$ is normal (Algebra, Lemma \ref{algebra-lemma-UFD-normal})
hence the henselization of $R$ is a normal domain too
(More on Algebra, Lemma \ref{more-algebra-lemma-henselization-normal}).
Thus $A$ as above is the completion of a henselian Noetherian local
normal domain (because the completion of $R$ and its henselization agree,
see More on Algebra, Lemma \ref{more-algebra-lemma-henselization-noetherian}).

\medskip\noindent
Apply this to find a Noetherian local UFD $R$ such that
$R^\wedge \cong \mathbf{C}[[x, y, z, w]]/(wx, wy)$.
Note that $\Spec(R^\wedge)$ is the
union of a regular $2$-dimensional and a regular $3$-dimensional component.
The ring $R$ cannot be universally catenary: Let
$$
X \longrightarrow \Spec(R)
$$
be the blowing up of the maximal ideal. Then $X$ is an integral scheme.
There is a closed point $x \in X$ such that $\dim(\mathcal{O}_{X, x}) = 2$,
namely, on the level of the complete local ring we pick $x$ to lie on the
strict transform of the $2$-dimensional component and not on the strict
transform of the $3$-dimensional component. By
Morphisms, Lemma \ref{morphisms-lemma-dimension-formula}
we see that $R$ is not universally catenary. Please compare with
Section \ref{section-non-catenary-Noetherian-local}.

\medskip\noindent
The ring above is catenary (being a $3$-dimensional local Noetherian UFD).
However, in \cite{Ogoma-example} the author constructs a normal local
Noetherian domain $R$ with $R^\wedge \cong \mathbf{C}[[x, y, z, w]]/(wx, wy)$
such that $R$ is not catenary. See also \cite{Heitmann-Ogoma} and
\cite{Lech-YAPO}.

\medskip\noindent
In \cite{Heitmann-isolated} it was shown that $A$ is the completion
of a local Noetherian ring $R$ with an isolated singularity
provided $A$ contains either $\mathbf{Q}$ or $\mathbf{F}_p$ as a subring
or $A$ has residue characteristic $p > 0$ and $p$ cannot map to a
nonzero zerodivisor in any proper localization of $A$.
Here we say a Noetherian local ring $R$
has an isolated singularity if $R_\mathfrak p$ is
a regular local ring for all nonmaximal primes $\mathfrak p \subset R$.

\medskip\noindent
The papers \cite{Nishimura-few} and \cite{Nishimura-few-II}
contain long lists of ``bad'' Noetherian
local rings with given completions. In particular it constructs
an example of a $2$-dimensional Nagata local normal domain whose
completion is $\mathbf{C}[[x, y, z]]/(yz)$ and one whose completion
is $\mathbf{C}[[x, y, z]]/(y^2 - z^3)$.

\medskip\noindent
As an aside, in \cite{Loepp} it was shown that $A$ is the completion of an
excellent Noetherian local domain if $A$ is reduced, equidimensional,
and no integer in $A$ is a zero divisor. However, this doesn't lead
to ``bad'' Noetherian local rings as we obtain excellent ones!




\section{Dimension in Noetherian Jacobson rings}
\label{section-noetherian-jacobson}

\noindent
Let $k$ be the algebraic closure of a finite field.
Let $A = k[x, y]$ and $X = \Spec(A)$.
Let $C = V(x)$ be the $y$-axis (this could be any other
$1$-dimensional integral closed subscheme of $X$).
Let $C_1, C_2, C_3, \ldots$ be an enumeration
of the other integral closed subschemes of $X$ of dimension $1$.
Let $p_1, p_2, p_3, \ldots$ be an
enumeration of the closed points of $C$.

\medskip\noindent
Claim: for every $n$ there exists an irreducible closed
$Z_n \subset X$ of dimension $1$ such that
$$
\{p_n\} = Z_n \cap (C \cup C_1 \cup \ldots \cup C_n)
$$
set theoretically. To do this set
$Y = C \cup C_1 \cup C_2 \cup \ldots \cup C_n$.
This is a reduced affine algebraic scheme of dimension $1$ over $k$.
It is enough to find $f \in k[x, y]$ with $V(f) \cap  Y = \{p_n\}$
set theoretically because then we can take $Z_n$ to be a suitable
irreducible component of $V(f)$. Since the restriction map
$$
k[x, y] \longrightarrow \Gamma(Y, \mathcal{O}_Y)
$$
is surjective, it suffices to find a regular function $g$ on $Y$
whose zero set is $\{p_n\}$ set theoretically.
To see this is possible, we choose an effective Cartier divisor
$D \subset Y$ whose support is $p_n$ (this is possible by
Varieties, Lemma \ref{varieties-lemma-complement-codim-1-closed-points}).
Thus it suffices to show that $\mathcal{O}_X(ND) \cong \mathcal{O}_X$
for some $N > 0$. But the Picard group of an affine $1$-dimensional
algebraic scheme over the algebraic closure of a finite field is torsion
(insert future reference here) and we conclude the claim is true.

\medskip\noindent
Choose $Z_n$ as above for all $n$. Since $k[x, y]$ is a UFD
we may write $Z_n = V(f_n)$ for some irreducible element $f_n \in A$.
Let $S \subset k[x, y]$ be the multiplicative subset generated
by $f_1, f_2, f_3, \ldots$. Consider the Noetherian ring $B = S^{-1}A$.

\medskip\noindent
Obviously, the ring map $A \to B$ identifies local rings
and induces an injection $\Spec(B) \to \Spec(A)$.
Moreover, looking at the curve $C_1$ we see that
only the points of $C \cap C_1$ are removed when passing
from $\Spec(A)$ to $\Spec(B)$.
In particular, we see that $\Spec(B)$ has an infinite
number of maximal ideals corresponding to maximal
ideals of $A$. On the other hand, $xB$ is a maximal ideal because
the spectrum of $B/xB$ consists of a unique prime ideal
as we removed all the closed points of $C = V(x)$ (but not
the generic point).
Finally, for $i \geq 1$ consider the curve $C_i$.
Write $C_i = V(g_i)$ for $g_i \in A$ irreducible.
If $C_i = Z_n$ for some $n$, then $g_iB$ is the unit ideal.
If not, then all but finitely many of the closed points
of $C_i$ survive the passage from $A$ to $B$:
namely, only the points of
$(Z_1 \cup \ldots \cup Z_{i - 1} \cup C) \cap C_i$
are removed from $C_i$.

\medskip\noindent
The structure of the prime spectrum of $B$ given above
shows that $B$ is Jacobson by
Algebra, Lemma \ref{algebra-lemma-noetherian-dim-1-Jacobson}.
The maximal ideals are the maximal ideals of $A$
which are in $\Spec(B)$ (and there an inifinitude of these)
together with the maximal ideal $xB$. Thus we see that we have
local rings of dimensions $1$ and $2$.

\begin{lemma}
\label{lemma-Noetherian-Jacobson}
There exists a Jacobson, universally catenary, Noetherian domain $B$
with maximal ideals $\mathfrak m_1, \mathfrak m_2$ such that
$\dim(B_{\mathfrak m_1}) = 1$ and $\dim(B_{\mathfrak m_2}) = 2$.
\end{lemma}

\begin{proof}
The construction of $B$ is given above. We just point out that
$B$ is universally catenary by
Algebra, Lemma \ref{algebra-lemma-localization-catenary} and
Morphisms, Lemma \ref{morphisms-lemma-ubiquity-uc}.
\end{proof}




\section{Underlying space Noetherian not Noetherian}
\label{section-noetherian-not-noetherian}

\noindent
We give two examples to show that a scheme whose underlying topological space
is Noetherian may not be a Noetherian scheme.

\begin{example}
\label{example-many-variables}
Let $k$ be a field, and let $A = k[x_1, x_2, x_3, \dots] /
(x_1^2, x_2^2, x_3^2, \dots)$.  Any prime ideal of $A$ contains the
nilpotents $x_1, x_2, x_3, \dots$, so $\mathfrak p = (x_1, x_2, x_3,
\dots)$ is the only prime ideal of $A$.  Therefore the underlying
topological space of $\operatorname{Spec} A$ is a single point and in
particular is Noetherian.  However $\mathfrak p$ is clearly not finitely
generated.
\end{example}

\begin{example}
\label{example-many-mononials}
Let $k$ be a field, and let $A \subseteq k[x, y]$ be the
subring generated by $k$ and the monomials $\{xy^i\}_{i \ge 0}$.  The prime
ideals of $A$ that do not contain $x$ are in one-to-one correspondence with
the prime ideals of $A_x \cong k[x, x^{-1}, y]$.  If $\mathfrak p$ is a
prime ideal that does contain $x$, then it contains every $xy^i$, $i \ge 0$,
because $(xy^i)^2 = x(xy^{2i}) \in \mathfrak p$ and $\mathfrak p$ is
radical.  Consequently $\mathfrak p = (\{xy^i\}_{i \ge 0})$.  Therefore the
underlying topological space of $\operatorname{Spec} A$ is Noetherian, since
it consists of the points of the Noetherian scheme
$\Spec(A[x, x^{-1}, y])$ and the prime ideal $\mathfrak p$.
But the ring $A$ is non-Noetherian because $\mathfrak p$
is not finitely generated.  Note that
in this example, $A$ also has the property of being a domain.
\end{example}






\section{Non-quasi-affine variety with quasi-affine normalization}
\label{section-nonquasi-affine}

\noindent
The existence of an example of this kind is mentioned in
\cite[II Remark 6.6.13]{EGA}. They refer to the fifth volume of
EGA for such an example, but the fifth volume did not appear.

\medskip\noindent
Let $k$ be a field.
Let $Y = \mathbf{A}^2_k \setminus \{(0, 0)\}$.
We are going to construct a finite surjective birational morphism
$\pi : Y \longrightarrow X$
with $X$ a variety over $k$ such that $X$ is not quasi-affine.
Namely, consider the following curves in $Y$:
$$
\begin{matrix}
C_1 & : & x = 0 \\
C_2 & : & y = 0
\end{matrix}
$$
Note that $C_1 \cap C_2 = \emptyset$. We choose the isomorphism
$\varphi : C_1 \to C_2$, $(0, y) \mapsto (y^{-1}, 0)$.
We claim there is a unique morphism $\pi : Y \to X$ as above
such that
$$
\xymatrix{
C_1
\ar@<1ex>[rr]^{\text{id}} \ar@<-1ex>[rr]_{\varphi}
& &
Y \ar[r]^\pi & X
}
$$
is a coequalizer diagram in the category of varieties (and even in
the category of schemes). Accepting this for the moment let us
show that such an $X$ cannot be quasi-affine. Namely, it is clear
that we would get
$$
\Gamma(X, \mathcal{O}_X) =
\{ f \in k[x, y] \mid f(0, y) = f(y^{-1}, 0)\} =
k \oplus (xy) \subset k[x, y].
$$
In particular these functions do not separate the points $(1, 0)$
and $(-1, 0)$ whose images in $X$ (we will see below) are distinct
(if the characteristic of $k$ is not $2$).

\medskip\noindent
To show that $X$ exists consider the Zariski open
$D(x + y) \subset Y$ of $Y$. This is the spectrum
of the ring
$k[x, y, 1/(x + y)]$
and the curves $C_1$, $C_2$ are completely contained in
$D(x + y)$. Moreover the morphism
$$
C_1 \amalg C_2
\longrightarrow
D(x + y) \cap Y = \Spec(k[x, y, 1/(x + y)])
$$
is a closed immersion. It follows from
More on Algebra, Lemma \ref{more-algebra-lemma-fibre-product-finite-type}
that the ring
$$
A =
\{f \in k[x, y, 1/(x + y)] \mid f(0, y) = f(y^{-1}, 0)\}
$$
is of finite type over $k$. On the other hand we have the open
$D(xy) \subset Y$ of $Y$ which is disjoint from the curves $C_1$
and $C_2$. It is the spectrum of the ring
$$
B = k[x, y, 1/xy].
$$
Note that we have $A_{xy} \cong B_{x + y}$ (since $A$ clearly contains
the elements $xyP(x, y)$ any polynomial $P$ and the element $xy/(x + y)$).
The scheme $X$ is obtained by glueing the affine schemes
$\Spec(A)$ and $\Spec(B)$ using the isomorphism
$A_{xy} \cong B_{x + y}$ and hence is clearly of finite type over
$k$. To see that it is separated one has to show that the
ring map $A \otimes_k B \to B_{x + y}$ is surjective. To see
this use that $A \otimes_k B$ contains the element
$xy/(x + y) \otimes 1/xy$ which maps to $1/(x + y)$.
The morphism $Y \to X$ is given by the natural maps
$D(x + y) \to \Spec(A)$ and $D(xy) \to \Spec(B)$.
Since these are both finite we deduce that $Y \to X$ is finite
as desired. We omit the verification that $X$ is indeed the
coequalizer of the displayed diagram above, however, see
(insert future reference for pushouts in the category of schemes
here). Note that the morphism $\pi : Y \to X$ does
map the points  $(1, 0)$
and $(-1, 0)$ to distinct points in $X$ because the
function $(x + y^3)/(x + y)^2 \in A$ has value
$1/1$, resp.\ $-1/(-1)^2 = -1$ which are always distinct
(unless the characteristic is $2$ -- please find your own points
for characteristic $2$). We summarize this discussion in the
form of a lemma.

\begin{lemma}
\label{lemma-quasi-affine-normalization-not-quasi-affine}
Let $k$ be a field.
There exists a variety $X$ whose normalization is quasi-affine but
which is itself not quasi-affine.
\end{lemma}

\begin{proof}
See discussion above and (insert future reference on normalization here).
\end{proof}



\section{Taking scheme theoretic images}
\label{section-scheme-theoretic-image}

\noindent
Let $k$ be a field. Let $t$ be a variable. Let $Y = \Spec(k[t])$
and $X = \coprod_{n \geq 1} \Spec(k[t]/(t^n))$. Denote
$f : X \to Y$ the morphism
using the closed immersion $\Spec(k[t]/(t^n)) \to \Spec(k[t])$
for each $n \geq 1$. In this case we have
\begin{enumerate}
\item The scheme theoretic image
(Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-image})
of $f$ is $Y$. On the other hand, the image of $f$ is the closed
point $t = 0$ in $Y$. Thus the underlying closed subset of the
scheme theoretic image of $f$
is not equal to the closure of the image of $f$.
\item The formation of the scheme theoretic image does not commute
with restriction to the open subscheme $V = \Spec(k[t, 1/t]) \subset Y$.
Namely, the preimage of $V$ in $X$ is empty and hence the scheme theoretic
image of $f|_{f^{-1}(V)} : f^{-1}(V) \to V$ is the empty scheme.
This is not equal to $Y \cap V$.
\end{enumerate}




\section{Images of locally closed subsets}
\label{section-non-chevalley}

\noindent
Chevalley's theorem says that the image of a constructible set
by a finitely presented morphism of affine schemes is constructible, see
Algebra, Theorem \ref{algebra-theorem-chevalley} and
Morphisms, Section \ref{morphisms-section-constructible}.
We will see the same thing does not hold
for images of locally closed subsets.

\medskip\noindent
Let $k$ be a field of characteristic $0$. Consider the projection morphism
$$
f :
X = \Spec(k[t, x_1, x_2, \ldots, y_1, y_2, \ldots])
\longrightarrow
\Spec(k[x_1, x_2, \ldots, y_1, y_2, \ldots]) = Y
$$
This is a morphism of finite presentation.
Let $Z$ be the closed subset of $X$ defined by
$$
x_1(t - 1) = 0,\quad
x_2(t - 1)(t - 2) = 0,\quad
x_3(t - 1)(t - 2)(t - 3) = 0,\quad \ldots
$$
Let $U = \bigcup_{j \geq 1} U_j$ be the open of $X$ defined by
$$
U_j = \text{points where }y_j(t - 1)(t - 2) ... (t - j)\text{ is nonzero}
$$
Then we have
$$
f(Z \cap U_j) =
\text{points where }x_1, \ldots, x_j\text{ are zero and }y_j\text{ is nonzero}
$$
We claim that $B = f(Z \cap U) = \bigcup_{j \geq 1} f(Z \cap U_j)$ is
not a finite union of locally closed subsets of $Y$.

\medskip\noindent
Proof of the claim. Suppose that $B = A_1 \cup \cdots \cup A_m$
is a finite cover of $B$ by locally closed subsets of $Y$.
We will show by induction on $n$ that $m \geq n$. The base
case $n = 1$ is OK as $B$ is nonempty. Assume $n > 1$ and that
the induction hypothesis holds for $n - 1$. Since the closure of $B$ is
$(x_1 = 0)$, one of the $A_i$ must contain some nonempty open subset of
$(x_1 = 0)$. Then $A_i$ must be open in $(x_1 = 0)$.
But any such open subset cannot contain a point with
$y_1 = 0$; indeed, for points of $B$, $y_1 = 0$ forces $x_2 = 0$,
and this shows $B$ contains no neighborhood of $(x, y)$ inside $(x_1 = 0)$.
Therefore, the remaining $m - 1$ elements restrict
to a constructible cover of $B \cap (y_1 = 0)$.
However, observe that the right shift map
$x_i \mapsto x_{i + 1}$, $y_i \mapsto y_{i + 1}$ identifies $B$
with $B \cap (y_1 = 0)$! Thus by induction hypothesis, we see that
$m - 1 \geq n - 1$ and we conclde $m \geq n$. This finishes
the proof of the induction step and thereby establishes the claim.

\begin{lemma}
\label{lemma-no-chevalley}
There exists a morphism $f : X \to Y$ of finite presentation
between affine schemes and a locally closed subset $T$ of $X$
such that $f(T)$ is not a finite union of locally closed subsets of $Y$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}










\section{A locally closed subscheme which is not open in closed}
\label{section-strange-immersion}

\noindent
This is a copy of
Morphisms, Example \ref{morphisms-example-thibaut}.
Here is an example of an immersion which is not a composition of an
open immersion followed by a closed immersion.
Let $k$ be a field.
Let $X = \Spec(k[x_1, x_2, x_3, \ldots])$.
Let $U = \bigcup_{n = 1}^{\infty} D(x_n)$.
Then $U \to X$ is an open immersion.
Consider the ideals
$$
I_n =
(x_1^n, x_2^n, \ldots, x_{n - 1}^n, x_n - 1, x_{n + 1}, x_{n + 2}, \ldots)
\subset
k[x_1, x_2, x_3, \ldots][1/x_n].
$$
Note that $I_n k[x_1, x_2, x_3, \ldots][1/x_nx_m] = (1)$
for any $m \not = n$. Hence the quasi-coherent ideals
$\widetilde I_n$ on $D(x_n)$ agree on $D(x_nx_m)$, namely
$\widetilde I_n|_{D(x_nx_m)} = \mathcal{O}_{D(x_n x_m)}$ if
$n \not = m$. Hence these ideals glue to a quasi-coherent sheaf of ideals
$\mathcal{I} \subset \mathcal{O}_U$.
Let $Z \subset U$ be the closed subscheme corresponding to
$\mathcal{I}$. Thus $Z \to X$ is an immersion.

\medskip\noindent
We claim that we cannot factor $Z \to X$ as
$Z \to \overline{Z} \to X$, where $\overline{Z} \to X$ is closed
and $Z \to \overline{Z}$ is open. Namely, $\overline{Z}$ would
have to be defined by an ideal $I \subset k[x_1, x_2, x_3, \ldots]$
such that $I_n = I k[x_1, x_2, x_3, \ldots][1/x_n]$.
But the only element $f \in k[x_1, x_2, x_3, \ldots]$
which ends up in all $I_n$ is $0$! Hence $I$ does not exist.

\medskip\noindent
The morphism $Z \to X$ also gives an example of bad behaviour
of scheme theoretic images of immersions. Namely, the arguments above
show that the scheme theoretic image of the immersion $Z \to X$ is $X$.
On the other hand, we see
\begin{enumerate}
\item $Z$ is not topologically dense in $X$, and
\item the scheme theoretic image of $Z = Z \cap U \to U$ is just
$Z$. This is not equal to $U \cap X = U$ and hence formation
of the scheme theoretic image in this case
does not commute with restrictions to opens.
\end{enumerate}






\section{Nonexistence of suitable opens}
\label{section-nonexistence-opens}

\noindent
This section complements the results of
Properties, Section \ref{properties-section-finding-affine-opens}.

\medskip\noindent
Let $k$ be a field and let $A = k[z_1, z_2, z_3, \ldots]/I$ where $I$
is the ideal generated by all pairwise products
$z_iz_j$, $i \not = j$, $i, j \in \mathbf{N}$. Set $S = \Spec(A)$.
Let $s \in S$ be the closed point corresponding to the maximal
ideal $(z_i)$. We claim there is no
quasi-compact open $V \subset S \setminus \{s\}$ which is
dense in $S \setminus \{s\}$. Note that $S \setminus \{s\} = \bigcup D(z_i)$.
Each $D(z_i)$ is open and irreducible with generic point
$\eta_i$. We conclude that $\eta_i \in V$ for all $i$.
However, a principal affine open of $S \setminus \{s\}$ is
of the form $D(f)$ where $f \in (z_1, z_2, \ldots)$. Then
$f \in (z_1, \ldots, z_n)$ for some $n$ and we see that $D(f)$ contains
only finitely many of the points $\eta_i$. Thus $V$ cannot be quasi-compact.

\medskip\noindent
Let $k$ be a field and let $B = k[x, z_1, z_2, z_3, \ldots]/J$ where $J$
is the ideal generated by the products $xz_i$, $i \in \mathbf{N}$ and by
all pairwise products $z_iz_j$, $i \not = j$, $i, j \in \mathbf{N}$.
Set $T = \Spec(B)$. Consider the principal open $U = D(x)$.
We claim there is no quasi-compact open $V \subset S$ such that
$V \cap U = \emptyset$ and $V \cup U$ is dense in $S$.
Let $t \in T$ be the closed point corresponding to the maximal
ideal $(x, z_i)$. The closure of $U$ in $T$ is
$\overline{U} = U \cup \{t\}$. Hence $V \subset \bigcup_i D(z_i)$
is a quasi-compact open. By the arguments of the previous paragraph
we see that $V$ cannot be dense in $\bigcup D(z_i)$.

\begin{lemma}
\label{lemma-complement-of-affine-does-not-contain-qc-dense-open}
Nonexistence quasi-compact opens of affines:
\begin{enumerate}
\item There exist an affine scheme $S$ and affine open $U \subset S$
such that there is no quasi-compact open $V \subset S$ with
$U \cap V = \emptyset$ and $U \cup V$ dense in $S$.
\item There exists an affine scheme $S$ and a closed point $s \in S$ such that
$S \setminus \{s\}$ does not contain a quasi-compact dense open.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Let $X$ be the glueing of two copies of the affine scheme $T$ (see above)
along the affine open $U$. Thus there is a morphism $\pi : X \to T$ and
$X = U_1 \cup U_2$ such that $\pi$ maps $U_i$ isomorphically to $T$ and
$U_1 \cap U_2$ isomorphically to $U$. Note that $X$ is quasi-separated
(by Schemes, Lemma \ref{schemes-lemma-characterize-quasi-separated})
and quasi-compact. We claim there does not exist a separated, dense,
quasi-compact open $W \subset X$. Namely, consider the two closed
points $x_1 \in U_1$, $x_2 \in U_2$ mapping to the closed point $t \in T$
introduced above. Let $\tilde \eta \in U_1 \cap U_2$ be the generic point
mapping to the (unique) generic point $\eta$ of $U$.
Note that $\tilde\eta \leadsto x_1$ and $\tilde\eta \leadsto x_2$
lying over the specialization $\eta \leadsto s$.
Since $\pi|_W : W \to T$ is separated we conclude that we cannot have both
$x_1$ and $x_2 \in W$ (by the valuative criterion of separatedness
Schemes, Lemma \ref{schemes-lemma-valuative-criterion-separatedness}).
Say $x_1 \not \in W$. Then $W \cap U_1$ is a quasi-compact (as $X$
is quasi-separated) dense open of $U_1$ which does not contain $x_1$.
Now observe that there exists an isomorphism $(T, t) \cong (S, s)$
of schemes (by sending $x$ to $z_1$ and $z_i$ to $z_{i + 1}$).
Hence by the first paragraph of this section we arrive at a contradiction.

\begin{lemma}
\label{lemma-no-dense-separated-quasi-compact-open-in-qcqs}
There exists a quasi-compact and quasi-separated scheme $X$ which does
not contain a separated quasi-compact dense open.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}







\section{Nonexistence of quasi-compact dense open subscheme}
\label{section-nonexistence-qc-dense-open-subscheme}

\noindent
Let $X$ be a quasi-compact and quasi-separated algebraic space over a field
$k$. We know that the schematic locus $X' \subset X$ is a dense open
subspace, see
Properties of Spaces, Proposition
\ref{spaces-properties-proposition-locally-quasi-separated-open-dense-scheme}.
In fact, this result holds when $X$ is reasonable, see
Decent Spaces, Proposition
\ref{decent-spaces-proposition-reasonable-open-dense-scheme}.
A natural question is whether one can find a quasi-compact dense
open subscheme of $X$. It turns out this is not possible in general.

\medskip\noindent
Assume the characteristic of $k$ is not 2.
Let $B = k[x, z_1, z_2, z_3, \ldots]/J$ where $J$ is the ideal generated by
the products $xz_i$, $i \in \mathbf{N}$ and by all pairwise products
$z_iz_j$, $i \not = j$, $i, j \in \mathbf{N}$. Set $U = \Spec(B)$.
Denote $0 \in U$ the closed point all of whose coordinates are zero.
Set
$$
j : R = \Delta \amalg \Gamma \longrightarrow U \times_k U
$$
where $\Delta$ is the image of the diagonal morphism of $U$ over $k$ and
$$
\Gamma = \{((x, 0, 0, 0, \ldots), (-x, 0, 0, 0, \ldots))
\mid x \in \mathbf{A}^1_k, x \not = 0\}.
$$
It is clear that $s, t : R \to U$ are \'etale, and hence
$j$ is an \'etale equivalence relation. The quotient $X = U/R$
is an algebraic space (Spaces, Theorem \ref{spaces-theorem-presentation}).
Note that $j$ is not an immersion because
$(0, 0) \in \Delta$ is in the closure of $\Gamma$.
Hence $X$ is not a scheme. On the other hand, $X$ is quasi-separated
as $R$ is quasi-compact. Denote $0_X$ the image of the point $0 \in U$.
We claim that $X \setminus \{0_X\}$ is a scheme, namely
$$
X \setminus \{0_X\} =
\Spec\left(k[x^2, x^{-2}]\right) \amalg
\Spec\left(k[z_1, z_2, z_3, \ldots]/(z_iz_j)\right) \setminus \{0\}
$$
(details omitted). On the other hand, we have seen in
Section \ref{section-nonexistence-opens} that the scheme
on the right hand side does not contain
a quasi-compact dense open.

\begin{lemma}
\label{lemma-nonexistence-qc-dense-open-subscheme}
There exists a quasi-compact and quasi-separated algebraic space
which does not contain a quasi-compact dense open subscheme.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Using the construction of 
Spaces, Example \ref{spaces-example-non-representable-descent}
in the same manner as we used the construction of
Spaces, Example \ref{spaces-example-affine-line-involution}
above, one obtains an example of a quasi-compact, quasi-separated, and
locally separated algebraic space which does not contain a quasi-compact
dense open subscheme.


\section{Affines over algebraic spaces}
\label{section-embedding-affines}

\medskip\noindent
Suppose that $f : Y \to X$ is a morphism of schemes with $f$
locally of finite type and $Y$ affine. Then there exists an immersion
$Y \to \mathbf{A}^n_X$ of $Y$ into affine $n$-space over $X$.
See the slightly more general
Morphisms, Lemma \ref{morphisms-lemma-quasi-affine-finite-type-over-S}.

\medskip\noindent
Now suppose that $f : Y \to X$ is a morphism of algebraic spaces with
$f$ locally of finite type and $Y$ an affine scheme. Then it is not
true in general that we can find an immersion of $Y$ into affine
$n$-space over $X$.

\medskip\noindent
A first (nasty) counter example is $Y = \Spec(k)$ and
$X = [\mathbf{A}^1_k/\mathbf{Z}]$ where $k$ is a field of characteristic zero
and $\mathbf{Z}$ acts on $\mathbf{A}^1_k$ by translation $(n, t) \mapsto t + n$.
Namely, for any morphism $Y \to \mathbf{A}^n_X$ over $X$ we can pullback to
the covering $\mathbf{A}^1_k$ of $X$ and we get an infinite disjoint union of
$\mathbf{A}^1_k$'s mapping into $\mathbf{A}^{n + 1}_k$ which is not an
immersion.

\medskip\noindent
A second counter example is $Y = \mathbf{A}^1_k \to X = \mathbf{A}^1_k/R$
with $R = \{(t, t)\} \amalg \{(t, -t), t \not = 0\}$. Namely, in
this case the morphism $Y \to \mathbf{A}^n_X$ would be given by some
regular functions $f_1, \ldots, f_n$ on $Y$ and hence the
fibre product of $Y$ with the covering
$\mathbf{A}^{n + 1}_k \to \mathbf{A}^n_X$
would be the scheme
$$
\{(f_1(t), \ldots, f_n(t), t)\} \amalg
\{(f_1(t), \ldots, f_n(t), -t), t \not = 0\}
$$
with obvious morphism to $\mathbf{A}^{n + 1}_k$ which is not an immersion.
Note that this gives a counter example with $X$ quasi-separated.

\begin{lemma}
\label{lemma-cannot-embed-into-affine}
There exists a finite type morphism of algebraic spaces $Y \to X$
with $Y$ affine and $X$ quasi-separated, such that there does not exist
an immersion $Y \to \mathbf{A}^n_X$ over $X$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}










\section{Pushforward of quasi-coherent modules}
\label{section-push-quasi-coherent}

\noindent
In Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}
we proved that $f_*$ transforms quasi-coherent modules into quasi-coherent
modules when $f$ is quasi-compact and quasi-separated. Here are some
examples to show that these conditions are both necessary.

\medskip\noindent
Suppose that $Y = \Spec(A)$ is an affine scheme and that
$X = \coprod_{n \in \mathbf{N}} Y$. We claim that $f_*\mathcal{O}_X$
is not quasi-coherent where $f : X \to Y$ is the obvious morphism.
Namely, for $a \in A$ we have
$$
f_*\mathcal{O}_X(D(a)) = \prod\nolimits_{n \in \mathbf{N}} A_a
$$
Hence, in order for $f_*\mathcal{O}_X$ to be quasi-coherent we would need
$$
\prod\nolimits_{n \in \mathbf{N}} A_a
=
\left(\prod\nolimits_{n \in \mathbf{N}} A\right)_a
$$
for all $a \in A$. This isn't true in general, for example if
$A = \mathbf{Z}$ and $a = 2$, then $(1, 1/2, 1/4, 1/8, \ldots)$
is an element of the left hand side which is not in the right hand side.
Note that $f$ is a non-quasi-compact separated morphism.

\medskip\noindent
Let $k$ be a field. Set
$$
A = k[t, z, x_1, x_2, x_3, \ldots]/(tx_1z, t^2x_2^2z, t^3x_3^3z, \ldots)
$$
Let $Y = \Spec(A)$. Let $V \subset Y$ be the open subscheme
$V = D(x_1) \cup D(x_2) \cup \ldots$. Let $X$ be two copies of $Y$
glued along $V$. Let $f : X \to Y$ be the obvious morphism. Then we
have an exact sequence
$$
0 \to f_*\mathcal{O}_X \to
\mathcal{O}_Y \oplus \mathcal{O}_Y \xrightarrow{(1, -1)} j_*\mathcal{O}_V
$$
where $j : V \to Y$ is the inclusion morphism. Since
$$
A \longrightarrow \prod A_{x_n}
$$
is injective (details omitted) we see that $\Gamma(Y, f_*\mathcal{O}_X) = A$.
On the other hand, the kernel of the map
$$
A_t \longrightarrow \prod A_{tx_n}
$$
is nonzero because it contains the element $z$. Hence
$\Gamma(D(t), f_*\mathcal{O}_X)$ is strictly bigger than
$A_t$ because it contains $(z, 0)$. Thus we see that $f_*\mathcal{O}_X$
is not quasi-coherent. Note that $f$ is quasi-compact but
non-quasi-separated.

\begin{lemma}
\label{lemma-pushforward-quasi-coherent}
Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}
is sharp in the sense that one can neither drop the assumption
of quasi-compactness nor the assumption of quasi-separatedness.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}








\section{A nonfinite module with finite free rank 1 stalks}
\label{section-nonfree}

\noindent
Let $R = \mathbf{Q}[x]$. Set
$M = \sum_{n \in \mathbf{N}} \frac{1}{x - n}R$ as a submodule of
the fraction field of $R$. Then $M$ is not finitely generated, but
for every prime $\mathfrak p$ of $R$ we have
$M_{\mathfrak p} \cong R_{\mathfrak p}$ as an
$R_{\mathfrak p}$-module.

\medskip\noindent
An example of a similar flavor is $R = \mathbf{Z}$ and
$M = \sum_{p \text{ prime}} \frac{1}{p} \mathbf{Z} \subset \mathbf{Q}$,
which equals the set of fractions $\frac{a}{b}$ with $b$ nonzero and
squarefree.








\section{A noninvertible ideal invertible in stalks}
\label{section-locally-invertible-not-invertible}

\noindent
Let $A$ be a domain and let $I \subset A$ be a nonzero ideal.
Recall that when we say $I$ is invertible, we mean that
$I$ is invertible as an $A$-module.
We are going to make an example of this situation where
$I$ is not invertible, yet $I_\mathfrak q = (f) \subset A_\mathfrak q$
is a (nonzero) principal ideal for every prime ideal $\mathfrak q \subset A$.
In the literature the property that $I_\mathfrak q$ is principal
for all primes $\mathfrak q$ is sometimes expressed by
saying ``$I$ is a locally principal ideal''. We can't use
this terminology as our ``local'' always means
``local in the Zariski topology'' (or whatever topology we are
currently working with).

\medskip\noindent
Let $R = \mathbf{Q}[x]$ and let $M = \sum \frac{1}{x - n}R$
be the module constructed in Section \ref{section-nonfree}.
Consider the ring\footnote{The ring $A$ is an example
of a non-Noetherian domain whose local rings are Noetherian.}
$$
A = \text{Sym}^*_R(M)
$$
and the ideal $I = M A = \bigoplus_{d \geq 1} \text{Sym}^d_R(M)$.
Since $M$ is not finitely generated as an $R$-module we see that
$I$ cannot be generated by finitely many elements as an ideal in $A$.
Since an invertible module is finitely generated, this means that
$I$ is not invertible.
On the other hand, let $\mathfrak p \subset R$ be a prime ideal.
By construction $M_\mathfrak p \cong R_\mathfrak p$. Hence
$$
A_\mathfrak p = \text{Sym}^*_{R_\mathfrak p}(M_\mathfrak p) \cong
\text{Sym}^*_{R_\mathfrak p}(R_\mathfrak p) =
R_\mathfrak p[T]
$$
as a graded $R_\mathfrak p$-algebra. It follows that
$I_\mathfrak p \subset A_\mathfrak p$ is generated by
the nonzerodivisor $T$.
Thus certainly for any prime ideal $\mathfrak q \subset A$
we see that $I_\mathfrak q$ is generated by a single element.

\begin{lemma}
\label{lemma-locally-principal-not-invertible}
There exists a domain $A$ and a nonzero ideal $I \subset A$
such that $I_\mathfrak q \subset A_\mathfrak q$ is a principal
ideal for all primes $\mathfrak q \subset A$ but $I$ is not an invertible
$A$-module.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}









\section{A finite flat module which is not projective}
\label{section-finite-flat-not-projective}

\noindent
This is a copy of
Algebra, Remark \ref{algebra-remark-warning}.
It is not true that a finite $R$-module which is
$R$-flat is automatically projective. A counter
example is where $R = \mathcal{C}^\infty(\mathbf{R})$
is the ring of infinitely differentiable functions on
$\mathbf{R}$, and $M = R_{\mathfrak m} = R/I$ where
$\mathfrak m = \{f \in R \mid f(0) = 0\}$ and
$I = \{f \in R \mid \exists \epsilon, \epsilon > 0 :
f(x) = 0\ \forall x, |x| < \epsilon\}$.

\medskip\noindent
The morphism $\Spec(R/I) \to \Spec(R)$ is also
an example of a flat closed immersion which is not open.

\begin{lemma}
\label{lemma-finite-flat-non-projective}
Strange flat modules.
\begin{enumerate}
\item There exists a ring $R$ and a finite flat $R$-module $M$ which is
not projective.
\item There exists a closed immersion which is flat but not open.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{A projective module which is not locally free}
\label{section-projective-not-locally-free}

\noindent
We give two examples. One where the rank is between $0$ and $1$
and one where the rank is $\aleph_0$.

\begin{lemma}
\label{lemma-ideal-generated-by-idempotents-projective}
Let $R$ be a ring. Let $I \subset R$ be an ideal generated by
a countable collection of idempotents. Then $I$ is projective
as an $R$-module.
\end{lemma}

\begin{proof}
Say $I = (e_1, e_2, e_3, \ldots)$ with $e_n$ an idempotent of $R$.
After inductively replacing $e_{n + 1}$ by $e_n + (1 - e_n)e_{n + 1}$
we may assume that $(e_1) \subset (e_2) \subset (e_3) \subset \ldots$
and hence $I = \bigcup_{n \geq 1} (e_n) = \colim_n e_nR$.
In this case
$$
\Hom_R(I, M) = \Hom_R(\colim_n e_nR, M)
= \lim_n \Hom_R(e_nR, M) = \lim_n e_nM
$$
Note that the transition maps $e_{n + 1}M \to e_nM$ are given
by multiplication by $e_n$ and are surjective. Hence by
Algebra, Lemma \ref{algebra-lemma-ML-exact-sequence}
the functor $\Hom_R(I, M)$ is exact, i.e., $I$ is a projective
$R$-module.
\end{proof}

\noindent
Suppose that $P \subset Q$ is an inclusion of $R$-modules with $Q$ a
finite $R$-module and $P$ locally free, see
Algebra, Definition \ref{algebra-definition-locally-free}.
Suppose that $Q$ can be generated by $N$ elements as an $R$-module.
Then it follows from
Algebra, Lemma \ref{algebra-lemma-map-cannot-be-injective}
that $P$ is finite locally free (with the free parts having rank
at most $N$). And in this case $P$ is a finite $R$-module, see
Algebra, Lemma \ref{algebra-lemma-finite-projective}.

\medskip\noindent
Combining this with the above we see that a non-finitely-generated
ideal which is generated by a countable collection of idempotents
is projective but not locally free. An explicit example is
$R = \prod_{n \in \mathbf{N}} \mathbf{F}_2$ and
$I$ the ideal generated by the idempotents
$$
e_n = (1, 1, \ldots, 1, 0, \ldots )
$$
where the sequence of $1$'s has length $n$.

\begin{lemma}
\label{lemma-ideal-projective-not-locally-free}
There exists a ring $R$ and an ideal $I$ such that $I$ is projective as
an $R$-module but not locally free as an $R$-module.
\end{lemma}

\begin{proof}
See above.
\end{proof}

\begin{lemma}
\label{lemma-chow-group-product}
Let $K$ be a field.
Let $C_i$, $i = 1, \ldots, n$ be smooth, projective, geometrically irreducible
curves over $K$. Let $P_i \in C_i(K)$ be a rational point and
let $Q_i \in C_i$ be a point such that $[\kappa(Q_i) : K] = 2$.
Then $[P_1 \times \ldots \times P_n]$ is nonzero in
$\CH_0(U_1 \times_K \ldots \times_K U_n)$ where $U_i = C_i \setminus \{Q_i\}$.
\end{lemma}

\begin{proof}
There is a degree map
$\deg : \CH_0(C_1 \times_K \ldots \times_K C_n) \to \mathbf{Z}$
Because each $Q_i$ has degree $2$ over $K$ we see that
any zero cycle supported on the ``boundary''
$$
C_1 \times_K \ldots \times_K C_n
\setminus
U_1 \times_K \ldots \times_K U_n
$$
has degree divisible by $2$.
\end{proof}

\noindent
We can construct another example of a projective but not locally free
module using the lemma above as follows. Let
$C_n$, $n = 1, 2, 3, \ldots$ be smooth, projective, geometrically irreducible
curves over $\mathbf{Q}$ each with a pair of points
$P_n, Q_n \in C_n$ such that $\kappa(P_n) = \mathbf{Q}$ and
$\kappa(Q_n)$ is a quadratic extension of $\mathbf{Q}$.
Set $U_n = C_n \setminus \{Q_n\}$; this is an affine curve.
Let $\mathcal{L}_n$ be the inverse of the ideal sheaf of $P_n$
on $U_n$. Note that $c_1(\mathcal{L}_n) = [P_n]$ in the group of
zero cycles $\CH_0(U_n)$. Set $A_n = \Gamma(U_n, \mathcal{O}_{U_n})$.
Let $L_n = \Gamma(U_n, \mathcal{L}_n)$ which is a locally
free module of rank $1$ over $A_n$. Set
$$
B_n = A_1 \otimes_{\mathbf{Q}} A_2 \otimes_{\mathbf{Q}} \ldots
\otimes_{\mathbf{Q}} A_n
$$
so that $\Spec(B_n) = U_1 \times \ldots \times U_n$ all products
over $\Spec(\mathbf{Q})$. For $i \leq n$ we set
$$
L_{n, i} =
A_1 \otimes_{\mathbf{Q}} \ldots \otimes_{\mathbf{Q}} M_i
\otimes_{\mathbf{Q}} \ldots \otimes_{\mathbf{Q}} A_n
$$
which is a locally free $B_n$-module of rank $1$. Note that this is
also the global sections of $\text{pr}_i^*\mathcal{L}_n$. Set
$$
B_\infty = \colim_n B_n
\quad\text{and}\quad
L_{\infty, i} = \colim_n L_{n, i}
$$
Finally, set
$$
M = \bigoplus\nolimits_{i \geq 1} L_{\infty, i}.
$$
This is a direct sum of finite locally free modules, hence projective.
We claim that $M$ is not locally free. Namely, suppose that
$f \in B_\infty$ is a nonzero function such that $M_f$ is free
over $(B_\infty)_f$. Let $e_1, e_2, \ldots$ be a basis. Choose
$n \geq 1$ such that $f \in B_n$.
Choose $m \geq n + 1$ such that $e_1, \ldots, e_{n + 1}$ are in
$$
\bigoplus\nolimits_{1 \leq i \leq m} L_{m, i}.
$$
Because the elements $e_1, \ldots, e_{n + 1}$ are part of a basis
after a faithfully flat base change we conclude that
the Chern classes
$$
c_i(\text{pr}_1^*\mathcal{L}_1 \oplus \ldots \oplus
\text{pr}_m^*\mathcal{L}_m), \quad i = m, m - 1, \ldots, m - n
$$
are zero in the chow group of
$$
D(f) \subset U_1 \times \ldots \times U_m
$$
Since $f$ is the pullback of a function on $U_1 \times \ldots \times U_n$
this implies in particular that
$$
c_{m - n}(\mathcal{O}_W^{\oplus n} \oplus
\text{pr}_1^*\mathcal{L}_{n + 1} \oplus \ldots
\oplus \text{pr}_{m - n}^*\mathcal{L}_m) = 0.
$$
on the variety
$$
W = (C_{n + 1} \times \ldots \times C_m)_K
$$
over the field $K = \mathbf{Q}(C_1 \times \ldots \times C_n)$.
In other words the cycle
$$
[(P_{n + 1} \times \ldots \times P_m)_K]
$$
is zero in the chow group of zero cycles on $W$. This contradicts
Lemma \ref{lemma-chow-group-product}
above because the points $Q_i$, $n + 1 \leq i \leq m$
induce corresponding points $Q_i'$ on $(C_n)_K$ and as $K/\mathbf{Q}$
is geometrically irreducible we have $[\kappa(Q_i') : K] = 2$.

\begin{lemma}
\label{lemma-projective-not-locally-free}
There exists a countable ring $R$ and a projective module $M$
which is a direct sum of countably many locally free rank $1$
modules such that $M$ is not locally free.
\end{lemma}

\begin{proof}
See above.
\end{proof}







\section{Zero dimensional local ring with nonzero flat ideal}
\label{section-zero-dimensional-flat-ideal}

\noindent
In \cite{Lazard} and \cite{Autour}
there is an example of a zero dimensional local ring with a
nonzero flat ideal. Here is the construction. Let $k$ be a field.
Let $X_i, Y_i$, $i \geq 1$ be variables. Take
$R = k[X_i, Y_i]/(X_i - Y_i X_{i + 1}, Y_i^2)$. Denote $x_i$, resp.\ $y_i$
the image of $X_i$, resp.\ $Y_i$ in this ring. Note that
$$
x_i = y_i x_{i + 1} = y_i y_{i +1} x_{i + 2} =
y_i y_{i + 1} y_{i + 2} x_{i + 3} = \ldots
$$
in this ring. The ring $R$ has only
one prime ideal, namely $\mathfrak m = (x_i, y_i)$. We claim that
the ideal $I = (x_i)$ is flat as an $R$-module.

\medskip\noindent
Note that the annihilator of $x_i$ in $R$ is the ideal
$(x_1, x_2, x_3, \ldots, y_i, y_{i + 1}, y_{i + 2}, \ldots)$.
Consider the $R$-module $M$ generated by elements $e_i$, $i \geq 1$ and
relations $e_i = y_i e_{i + 1}$. Then $M$ is flat as it is the
colimit $\colim_i R$ of copies of $R$ with transition maps
$$
R \xrightarrow{y_1} R \xrightarrow{y_2} R \xrightarrow{y_3} \ldots
$$
Note that the annihilator of $e_i$ in $M$ is the ideal
$(x_1, x_2, x_3, \ldots, y_i, y_{i + 1}, y_{i + 2}, \ldots)$.
Since every element of $M$, resp.\ $I$ can be written as
$f e_i$, resp.\ $h x_i$ for some $f, h \in R$ we see that the
map $M \to I$, $e_i \to x_i$ is an isomorphism and $I$ is flat.

\begin{lemma}
\label{lemma-zero-dimensional-flat-ideal}
\begin{slogan}
Zero dimensional ring with flat ideal.
\end{slogan}
There exists a local ring $R$ with a unique prime ideal
and a nonzero ideal $I \subset R$ which is a flat $R$-module
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}








\section{An epimorphism of zero-dimensional rings which is not surjective}
\label{section-epimorphism-not-surjective}

\noindent
In \cite{Lazard-deux} and \cite{Autour} one can find the following example.
Let $k$ be a field. Consider the ring homomorphism
$$
k[x_1, x_2, \ldots, z_1, z_2, \ldots]/
(x_i^{4^i}, z_i^{4^i})
\longrightarrow
k[x_1, x_2, \ldots, y_1, y_2, \ldots]/
(x_i^{4^i}, y_i - x_{i + 1}y_{i + 1}^2)
$$
which maps $x_i$ to $x_i$ and $z_i$ to $x_iy_i$. Note that $y_i^{4^{i + 1}}$
is zero in the right hand side but that $y_1$ is not zero (details omitted).
This map is not surjective: we can think of the above as a map of
$\mathbf{Z}$-graded algebras by setting $\deg(x_i) = -1$, $\deg(z_i) = 0$,
and $\deg(y_i) = 1$ and then it is clear that $y_1$ is not in the image.
Finally, the map is an epimorphism because
$$
y_{i - 1} \otimes 1 = x_i y_i^2 \otimes 1 = y_i \otimes x_i y_i =
x_i y_i \otimes y_i = 1 \otimes x_i y_i^2.
$$
hence the tensor product of the target over the source is isomorphic
to the target.

\begin{lemma}
\label{lemma-epi-not-surjective}
There exists an epimorphism of local rings of dimension $0$
which is not a surjection.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{Finite type, not finitely presented, flat at prime}
\label{section-ft-not-fp-flat-at-prime}

\noindent
Let $k$ be a field. Consider the local ring $A_0 = k[x, y]_{(x, y)}$.
Denote $\mathfrak p_{0, n} = (y + x^n + x^{2n + 1})$. This is a prime ideal.
Set
$$
A = A_0[z_1, z_2, z_3, \ldots]/(z_n z_m, z_n(y + x^n + x^{2n + 1}))
$$
Note that $A \to A_0$ is a surjection whose kernel is an ideal of
square zero. Hence $A$ is also a local ring and the prime ideals of $A$
are in one-to-one correspondence with the prime ideals of $A_0$.
Denote $\mathfrak p_n$ the prime ideal of $A$ corresponding to
$\mathfrak p_{0, n}$. Observe that $\mathfrak p_n$ is the annihilator
of $z_n$ in $A$. Let
$$
C = A[z]/(xz^2 + z + y)[\frac{1}{2zx + 1}]
$$
Note that $A \to C$ is an \'etale ring map, see
Algebra, Example \ref{algebra-example-make-standard-smooth}.
Let $\mathfrak q \subset C$ be the maximal ideal generated by
$x$, $y$, $z$ and all $z_n$. As $A \to C$ is flat we see that the
annihilator of $z_n$ in $C$ is $\mathfrak p_nC$. We compute
\begin{align*}
C/\mathfrak p_n C
& =
A_0[z]/(xz^2 + z + y, y + x^n + x^{2n + 1})[1/(2zx + 1)] \\
& =
k[x]_{(x)}[z]/(xz^2 + z - x^n - x^{2n + 1})[1/(2zx + 1)] \\
& =
k[x]_{(x)}[z]/(z - x^n) \times
k[x]_{(x)}[z]/(xz + x^{n + 1} + 1)[1/(2zx + 1)] \\
& =
k[x]_{(x)} \times k(x)
\end{align*}
because $(z - x^n)(xz + x^{n + 1} + 1) = xz^2 + z - x^n - x^{2n + 1}$.
Hence we see that $\mathfrak p_nC = \mathfrak r_n \cap \mathfrak q_n$
with $\mathfrak r_n = \mathfrak p_nC + (z - x^n)C$ and
$\mathfrak q_n = \mathfrak p_nC + (xz + x^{n + 1} + 1)C$.
Since $\mathfrak q_n + \mathfrak r_n = C$ we also get
$\mathfrak p_nC = \mathfrak r_n \mathfrak q_n$.
It follows that $\mathfrak q_n$ is the annihilator of $\xi_n = (z - x^n)z_n$.
Observe that on the one hand $\mathfrak r_n \subset \mathfrak q$, and
on the other hand $\mathfrak q_n + \mathfrak q = C$. This follows for example
because $\mathfrak q_n$ is a maximal ideal of $C$ distinct from $\mathfrak q$.
Similarly we have $\mathfrak q_n + \mathfrak q_m = C$ for $n \not = m$.
At this point we let
$$
B = \Im(C \longrightarrow C_{\mathfrak q})
$$
We observe that the elements $\xi_n$ map to zero in $B$ as $xz + x^{n + 1} + 1$
is not in $\mathfrak q$. Denote $\mathfrak q' \subset B$ the image of
$\mathfrak q$. By construction $B$ is a finite type $A$-algebra, with
$B_{\mathfrak q'} \cong C_{\mathfrak q}$. In particular we see that
$B_{\mathfrak q'}$ is flat over $A$.

\medskip\noindent
We claim there does not exist an element $g' \in B$, $g' \not \in \mathfrak q'$
such that $B_{g'}$ is of finite presentation over $A$. We sketch a proof of
this claim. Choose an element $g \in C$ which maps to $g' \in B$.
Consider the map $C_g \to B_{g'}$. By
Algebra, Lemma \ref{algebra-lemma-finite-presentation-independent}
we see that $B_g$ is finitely presented over $A$ if and only if the kernel
of $C_g \to B_{g'}$ is finitely generated. But the element $g \in C$ is
not contained in $\mathfrak q$, hence maps to a nonzero element of
$A_0[z]/(xz^2 + z + y)$. Hence $g$ can only be contained in finitely
many of the prime ideals $\mathfrak q_n$, because the primes
$(y + x^n + x^{2n + 1}, xz + x^{n + 1} + 1)$ are an infinite collection
of codimension 1 points of the 2-dimensional irreducible Noetherian space
$\Spec(k[x, y, z]/(xz^2 + z + y))$. The map
$$
\bigoplus\nolimits_{g \not \in \mathfrak q_n} C/\mathfrak q_n
\longrightarrow
C_g, \quad
(c_n) \longrightarrow \sum c_n \xi_n
$$
is injective and its image is the kernel of $C_g \to B_{g'}$. We omit the
proof of this statement. (Hint: Write $A = A_0 \oplus I$ as an $A_0$-module
where $I$ is the kernel of $A \to A_0$. Similarly, write $C = C_0 \oplus IC$.
Write
$IC = \bigoplus Cz_n \cong \bigoplus (C/\mathfrak r_n \oplus C/\mathfrak q_n)$
and study the effect of multiplication by $g$ on the summands.)
This concludes the sketch of the proof of the claim.
This also proves that $B_{g'}$ is not flat over $A$ for any $g'$ as above.
Namely, if it were flat, then the annihilator of the image of $z_n$ in
$B_{g'}$ would be $\mathfrak p_nB_{g'}$, and would not contain $z - x^n$.

\medskip\noindent
As a consequence we can answer (negatively) a question posed in
\cite[Part I, Remarques (3.4.7) (\romannumeral 5)]{GruRay}.
Here is a precise statement.

\begin{lemma}
\label{lemma-example-raynaud-gruson}
There exists a local ring $A$, a finite type ring map $A \to B$ and a prime
$\mathfrak q$ lying over $\mathfrak m_A$ such that $B_{\mathfrak q}$ is flat
over $A$, and for any element $g \in B$, $g \not \in \mathfrak q$
the ring $B_g$ is neither finitely presented over $A$ nor flat over $A$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}


\section{Finite type, flat and not of finite presentation}
\label{section-finite-type-flat-not-finite-presentation}

\noindent
In this section we give some examples of ring maps and morphisms
which are of finite type and flat but not of finite presentation.

\medskip\noindent
Let $R$ be a ring which has an ideal $I$ such that $R/I$ is a finite
flat module but not projective, see
Section \ref{section-finite-flat-not-projective}
for an explicit example. Note that this means that $I$ is not
finitely generated, see
Algebra, Lemma \ref{algebra-lemma-finitely-generated-pure-ideal}.
Note that $I = I^2$, see
Algebra, Lemma \ref{algebra-lemma-pure}.
The base ring in our examples will be
$R$ and correspondingly the base scheme $S = \Spec(R)$.

\medskip\noindent
Consider the ring map $R \to R \oplus R/I\epsilon$ where
$\epsilon^2 = 0$ by convention. This is a finite, flat
ring map which is not of finite presentation. All the fibre rings
are complete intersections and geometrically irreducible.

\medskip\noindent
Let $A = R[x, y]/(xy, ay; a \in I)$. Note that as an $R$-module
we have $A = \bigoplus_{i \geq 0} Ry^i \oplus \bigoplus_{j > 0} R/Ix^j$.
Hence $R \to A$ is a flat finite type ring map which is not of finite
presentation. Each fibre ring
is isomorphic to either $\kappa(\mathfrak p)[x, y]/(xy)$
or $\kappa(\mathfrak p)[x]$.

\medskip\noindent
We can turn the previous example into a projective morphism by
taking $B = R[X_0, X_1, X_2]/(X_1X_2, aX_2; a \in I)$.
In this case $X = \text{Proj}(B) \to S$ is a proper flat morphism
which is not of finite presentation such that for each $s \in S$
the fibre $X_s$ is isomorphic either to $\mathbf{P}^1_s$ or to
the closed subscheme of $\mathbf{P}^2_s$ defined by the vanishing of
$X_1X_2$ (this is a projective nodal curve of arithmetic genus $0$).

\medskip\noindent
Let $M = R \oplus R \oplus R/I$. Set $B = \text{Sym}_R(M)$ the
symmetric algebra on $M$. Set $X = \text{Proj}(B)$.
Then $X \to S$ is a proper flat morphism, not of finite presentation
such that for $s \in S$ the geometric fibre is isomorphic to either
$\mathbf{P}^1_s$ or $\mathbf{P}^2_s$. In particular these fibres are
smooth and geometrically irreducible.

\begin{lemma}
\label{lemma-finite-type-flat-not-finitely-presented}
There exist examples of
\begin{enumerate}
\item a flat finite type ring map with geometrically irreducible
complete intersection fibre rings which is not of finite presentation,
\item a flat finite type ring map with geometrically connected,
geometrically reduced, dimension 1, complete intersection fibre rings
which is not of finite presentation,
\item a proper flat morphism of schemes $X \to S$ each of whose fibres
is isomorphic to either $\mathbf{P}^1_s$ or to the vanishing locus of
$X_1X_2$ in $\mathbf{P}^2_s$ which is not of finite presentation, and
\item a proper flat morphism of schemes $X \to S$ each of whose
fibres is isomorphic to either $\mathbf{P}^1_s$ or $\mathbf{P}^2_s$
which is not of finite presentation.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{Topology of a finite type ring map}
\label{section-topology-finite-type}

\noindent
Let $A \to B$ be a local map of local domains.
If $A$ is Noetherian, $A \to B$ is essentially of finite type,
and $A/\mathfrak m_A \subset B/\mathfrak m_B$ is finite then there
exists a prime $\mathfrak q \subset B$, $\mathfrak q \not = \mathfrak m_B$
such that $A \to B/\mathfrak q$ is the localization of a quasi-finite ring
map. See
More on Morphisms, Lemma
\ref{more-morphisms-lemma-quasi-finite-quasi-section-meeting-nearby-open}.

\medskip\noindent
In this section we give an example that shows this result is false $A$
is no longer Noetherian. Namely, let $k$ be a field and set
$$
A = \{a_0 + a_1 x + a_2 x^2 + \ldots \mid a_0 \in k, a_i \in k((y))
\text{ for }i\geq 1\}
$$
and
$$
C = \{a_0 + a_1 x + a_2 x^2 + \ldots \mid a_0 \in k[y], a_i \in k((y))
\text{ for }i\geq 1\}.
$$
The inclusion $A \to C$ is of finite type as $C$ is generated by $y$
over $A$. We claim that $A$ is a local ring with maximal ideal
$\mathfrak m = \{a_1 x + a_2 x^2 + \ldots \in A\}$ and no prime
ideals besides $(0)$ and $\mathfrak m$. Namely, an element
$f = a_0 + a_1 x + a_2 x^2 + \ldots$ of $A$ is invertible as soon as
$a_0 \not = 0$. If $\mathfrak q \subset A$ is a nonzero prime ideal,
and $f = a_i x^i + \ldots \in \mathfrak q$, then using properties of
power series one sees that for any $g \in k((y))$ the element
$g^{i + 1} x^{i + 1} \in \mathfrak q$, i.e., $gx \in \mathfrak q$.
This proves that $\mathfrak q = \mathfrak m$.

\medskip\noindent
As to the spectrum of the ring $C$, arguing in the same way as above
we see that any nonzero prime ideal contains the prime
$\mathfrak p = \{a_1 x + a_2 x^2 + \ldots \in C\}$ which lies
over $\mathfrak m$. Thus the only prime of $C$ which lies over
$(0)$ is $(0)$. Set $\mathfrak m_C = yC + \mathfrak p$ and
$B = C_{\mathfrak m_C}$. Then $A \to B$ is the desired example.

\begin{lemma}
\label{lemma-topology-finite-type}
There exists a local homomorphism $A \to B$ of local domains which is
essentially of finite type and such that $A/\mathfrak m_A \to B/\mathfrak m_B$
is finite such that for every prime
$\mathfrak q \not = \mathfrak m_B$ of $B$ the ring map
$A \to B/\mathfrak q$ is not the localization of a quasi-finite ring map.
\end{lemma}

\begin{proof}
See the discussion above.
\end{proof}



\section{Pure not universally pure}
\label{section-pure-not-universally}

\noindent
Let $k$ be a field. Let
$$
R = k[[x, xy, xy^2, \ldots]] \subset k[[x, y]].
$$
In other words, a power series $f \in k[[x, y]]$ is in $R$ if and only
if $f(0, y)$ is a constant. In particular $R[1/x] = k[[x, y]][1/x]$
and $R/xR$ is a local ring with a maximal ideal whose square
is zero. Denote $R[y] \subset k[[x, y]]$ the set of power series
$f \in k[[x, y]]$ such that $f(0, y)$ is a polynomial in $y$. Then
$R \to R[y]$ is a finite type but not finitely presented ring map
which induces an isomorphism after inverting $x$. Also there is a
surjection $R[y]/xR[y] \to k[y]$ whose kernel has square zero. Consider
the finitely presented ring map $R \to S = R[t]/(xt - xy)$.
Again $R[1/x] \to S[1/x]$ is an isomorphism and in this case
$S/xS \cong (R/xR)[t]/(xy)$ maps onto $k[t]$ with nilpotent kernel.
There is a surjection $S \to R[y]$, $t \longmapsto y$ which induces
an isomorphism on inverting $x$ and a surjection with nilpotent kernel
modulo $x$. Hence the kernel of $S \to R[y]$ is locally nilpotent.
In particular $S \to R[y]$ is a universal homeomorphism.

\medskip\noindent
First we claim that $S$ is an $S$-module which is relatively pure
over $R$. Since on inverting $x$ we obtain an isomorphism we only need
to check this at the maximal ideal $\mathfrak m \subset R$. Since
$R$ is complete with respect to its maximal ideal it is henselian
hence we need only check that every prime $\mathfrak p \subset R$,
$\mathfrak p \not = \mathfrak m$, the unique prime $\mathfrak q$
of $S$ lying over $\mathfrak p$ satisfies
$\mathfrak mS + \mathfrak q \not = S$. Since $\mathfrak p \not = \mathfrak m$
it corresponds to a unique prime ideal of $k[[x, y]][1/x]$. Hence
either $\mathfrak p = (0)$ or $\mathfrak p = (f)$ for some
irreducible element $f \in k[[x, y]]$ which is not associated to $x$
(here we use that $k[[x, y]]$ is a UFD -- insert future reference here).
In the first case $\mathfrak q = (0)$ and the result is clear. In the
second case we may multiply $f$ by a unit so that $f \in R[y]$
(Weierstrass preparation; details omitted). Then it is easy to see that
$R[y]/fR[y] \cong k[[x, y]]/(f)$ hence $f$ defines a prime ideal
of $R[y]$ and $\mathfrak mR[y] + fR[y] \not = R[y]$.
Since $S \to R[y]$ is a universal homeomorphism we deduce the
desired result for $S$ also.

\medskip\noindent
Second we claim that $S$ is not universally relatively pure over $R$.
Namely, to see this it suffices to find a valuation ring
$\mathcal{O}$ and a local ring map $R \to \mathcal{O}$ such that
$\Spec(R[y] \otimes_R \mathcal{O}) \to \Spec(\mathcal{O})$
does not hit the closed point of $\Spec(\mathcal{O})$.
Equivalently, we have to find $\varphi : R \to \mathcal{O}$ such that
$\varphi(x) \not = 0$ and $v(\varphi(x)) > v(\varphi(xy))$ where $v$
is the valuation of $\mathcal{O}$.
(Because this means that the valuation of $y$ is negative.)
To do this consider the ring map
$$
R
\longrightarrow
\{a_0 + a_1 x + a_2 x^2 + \ldots \mid a_0 \in k[y^{-1}], a_i \in k((y))\}
$$
defined in the obvious way. We can find a valuation ring $\mathcal{O}$
dominating the localization of the right hand side at the maximal
ideal $(y^{-1}, x)$ and we win.

\begin{lemma}
\label{lemma-pure-not-universally-pure}
There exists a morphism of affine schemes of finite presentation
$X \to S$ and an $\mathcal{O}_X$-module $\mathcal{F}$ of finite presentation
such that $\mathcal{F}$ is pure relative to $S$, but not universally
pure relative to $S$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{A formally smooth non-flat ring map}
\label{section-formally-smooth-nonflat}

\noindent
Let $k$ be a field. Consider the $k$-algebra $k[\mathbf{Q}]$.
This is the $k$-algebra with basis $x_\alpha, \alpha \in \mathbf{Q}$
and multiplication determined by $x_\alpha x_\beta = x_{\alpha + \beta}$.
(In particular $x_0 = 1$.)
Consider the $k$-algebra homomorphism
$$
k[\mathbf{Q}] \longrightarrow k, \quad
x_\alpha \longmapsto 1.
$$
It is surjective with kernel $J$ generated by the elements $x_\alpha - 1$.
Let us compute $J/J^2$. Note that multiplication by $x_\alpha$ on $J/J^2$
is the identity map. Denote $z_\alpha$ the class of $x_\alpha - 1$ modulo
$J^2$. These classes generate $J/J^2$. Since
$$
(x_\alpha - 1)(x_\beta - 1) = x_{\alpha + \beta} - x_\alpha - x_\beta + 1 =
(x_{\alpha + \beta} - 1) - (x_\alpha - 1) - (x_\beta - 1)
$$
we see that $z_{\alpha + \beta} = z_\alpha + z_\beta$ in $J/J^2$.
A general element of $J/J^2$ is of the form $\sum \lambda_\alpha z_\alpha$
with $\lambda_\alpha \in k$ (only finitely many nonzero). Note that if the
characteristic of $k$ is $p > 0$ then
$$
0 = pz_{\alpha/p} = z_{\alpha/p} + \ldots + z_{\alpha/p} = z_\alpha
$$
and we see that $J/J^2 = 0$. If the characteristic of $k$ is zero, then
$$
J/J^2 = \mathbf{Q} \otimes_{\mathbf{Z}} k \cong k
$$
(details omitted) is not zero.

\medskip\noindent
We claim that $k[\mathbf{Q}] \to k$ is a formally smooth ring map
if the characteristic of $k$ is positive. Namely, suppose given a
solid commutative diagram
$$
\xymatrix{
k \ar[r] \ar@{..>}[rd] & A \\
k[\mathbf{Q}] \ar[u] \ar[r]^\varphi & A' \ar[u]
}
$$
with $A' \to A$ a surjection whose kernel $I$ has square zero.
To show that $k[\mathbf{Q}] \to k$ is formally smooth we have to prove
that $\varphi$ factors through $k$. Since $\varphi(x_\alpha - 1)$ maps
to zero in $A$ we see that $\varphi$ induces a map
$\overline{\varphi} : J/J^2 \to I$ whose vanishing is the obstruction
to the desired factorization. Since $J/J^2 = 0$ if the characteristic
is $p > 0$ we get the result we want, i.e., $k[\mathbf{Q}] \to k$ is
formally smooth in this case. Finally, this ring map is not flat, for
example as the nonzerodivisor $x_2 - 1$ is mapped to zero.

\begin{lemma}
\label{lemma-formally-smooth-nonflat}
There exists a formally smooth ring map which is not flat.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}


\section{A formally \'etale non-flat ring map}
\label{section-formally-etale-nonflat}

\noindent
In this section we give a counterexample to the final sentence in
\cite[0, Example 19.10.3(i)]{EGA} (this was not one of the items caught
in their later errata lists). Consider $A \to A/J$ for a local ring $A$
and a nonzero proper ideal $J$ such that $J^2 = J$ (so $J$ isn't finitely
generated); the valuation ring of an algebraically closed non-archimedean
field with $J$ its maximal ideal is a source of such $(A, J)$. These
non-flat quotient maps are formally \'etale. Namely, suppose given a
commutative diagram
$$
\xymatrix{
A/J \ar[r] & R/I \\
A \ar[u] \ar[r]^\varphi & R \ar[u]
}
$$
where $I$ is an ideal of the ring $R$ with $I^2 = 0$. Then $A \to R$
factors uniquely through $A/J$ because
$$
\varphi(J) = \varphi(J^2) \subset (\varphi(J)A)^2 \subset I^2 = 0.
$$
Hence this also provides a counterexample to the formally \'etale case
of the ``structure theorem'' for locally finite type and formally \'etale
morphisms in \cite[IV, Theorem 18.4.6(i)]{EGA}
(but not a counterexample to part (ii), which
is what people actually use in practice). The error in the proof of
the latter is that the very last step of the proof is to invoke the incorrect
\cite[0, Example 19.3.10(i)]{EGA},
which is how the counterexample just mentioned creeps in.

\begin{lemma}
\label{lemma-formally-etale-not-presented}
There exist formally \'etale nonflat ring maps.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{A formally \'etale ring map with nontrivial cotangent complex}
\label{section-formally-etale-nontrivial-cotangent-complex}

\noindent
Let $k$ be a field. Consider the ring
$$
R = k[\{x_n\}_{n \geq 1}, \{y_n\}_{n \geq 1}]/(
x_1y_1, x_{nm}^m - x_n, y_{nm}^m - y_n)
$$
Let $A$ be the localization at the maximal ideal generated by
all $x_n, y_n$ and denote $J \subset A$ the maximal ideal. Set $B = A/J$.
By construction $J^2 = J$ and hence $A \to B$ is formally \'etale (see
Section \ref{section-formally-etale-nonflat}).
We claim that the element $x_1 \otimes y_1$ is a nonzero
element in the kernel of
$$
J \otimes_A J \longrightarrow J.
$$
Namely, $(A, J)$ is the colimit of the localizations
$(A_n, J_n)$ of the rings
$$
R_n = k[x_n, y_n]/(x_n^n y_n^n)
$$
at their corresponding maximal ideals. Then
$x_1 \otimes y_1$ corresponds to the element
$x_n^n \otimes y_n^n \in J_n \otimes_{A_n} J_n$ and is nonzero
(by an explicit computation which we omit). Since $\otimes$ commutes
with colimits we conclude. By
\cite[III Section 3.3]{cotangent}
we see that $J$ is not weakly regular. Hence by
\cite[III Proposition 3.3.3]{cotangent}
we see that the cotangent complex $L_{B/A}$ is not zero. In fact, we can
be more precise. We have $H_0(L_{B/A}) = \Omega_{B/A}$ and
$H_1(L_{B/A}) = 0$ because $J/J^2 = 0$. But from the five-term exact sequence
of Quillen's fundamental spectral sequence
(see Cotangent, Remark \ref{cotangent-remark-elucidate-ss} or
\cite[Corollary 8.2.6]{Reinhard})
and the nonvanishing of
$\text{Tor}_2^A(B, B) = \Ker(J \otimes_A J \to J)$ we conclude that
$H_2(L_{B/A})$ is nonzero.

\begin{lemma}
\label{lemma-formally-etale-nontrivial-cotangent-complex}
There exists a formally \'etale surjective ring map $A \to B$
with $L_{B/A}$ not equal to zero.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}






\section{Flat and formally unramified is not formally \'etale}
\label{section-flat-formally-unramified-not-formally-etale}

\noindent
In More on Morphisms, Lemma
\ref{more-morphisms-lemma-unramified-flat-formally-etale}
it is shown that an unramified flat morphism of schemes $X \to S$
is formally \'etale. The goal of this section is to give two examples
that illustrate that we cannot replace `unramified' by `formally unramified'.
The first example exploits special properties of perfect rings, while the
second example shows the result fails even for maps of Noetherian regular rings.

\begin{lemma}
\label{lemma-perfect-closure-polynomial-ring}
Let $A = \mathbb{F}_p[T]$ be the polynomial ring in one variable over
$\mathbb{F}_p$. Let $A_{perf}$  denote the perfect closure of $A$.
Then $A \rightarrow A_{perf}$ is flat and formally unramified,
but not formally \'etale.
\end{lemma}

\begin{proof}
Note that under the Frobenius map $F_A : A \to A$, the target copy of $A$
is a free-module over the domain with basis $\{1, T, \dots, T^{p - 1}\}$.
Thus, $F_A$ is faithfully flat, and consequently,  so is
$A \to A_{perf}$ since it is a colimit of faithfully flat maps.
Since $A_{perf}$ is a perfect ring, the relative Frobenius
$F_{A_{perf}/A}$ is a surjection. In  other words,
$A_{perf} = A[A_{perf}^p]$, which readily implies
$\Omega_{A_{perf}/A} = 0$. Then
$A \rightarrow A_{perf}$ is formally unramified by
More on Morphisms, Lemma
\ref{more-morphisms-lemma-formally-unramified-differentials}

\medskip\noindent
It suffices to show that $A \rightarrow A_{perf}$
is not formally smooth. Note that since $A$ is a
smooth $\mathbb{F}_p$-algebra, the cotangent complex
$L_{A/\mathbb{F}_P} \simeq \Omega_{A/\mathbb{F}_p}[0]$
is concentrated in degree $0$, see
Cotangent, Lemma \ref{cotangent-lemma-when-projective}. Moreover,
$L_{A_{perf}/\mathbb{F}_p} = 0$ in $D(A_{perf})$
by Cotangent, Lemma \ref{cotangent-lemma-perfect-zero}.
Consider the distinguished triangle of cotangent complexes
$$
L_{A/\mathbb{F}_p} \otimes_A A_{perf} \to
L_{A_{perf}/\mathbb{F}_p} \to
L_{A_{perf}/A} \to
(L_{A/\mathbb{F}_p} \otimes_A A_{perf})[1]
$$
in $D(A_{perf})$, see Cotangent, Section \ref{cotangent-section-triangle}.
We find $L_{A_{perf}/A} = \Omega_{A/\mathbb{F}_p} \otimes_A A_{perf}[1]$,
that is, $L_{A_{perf}/A}$ is equal to a free rank $1$ $A_{perf}$
module placed in degree $-1$. Thus $A \rightarrow A_{perf}$
is not formally smooth by
More on Morphisms, Lemma \ref{more-morphisms-lemma-NL-formally-smooth}
and
Cotangent, Lemma \ref{cotangent-lemma-relation-with-naive-cotangent-complex}.
\end{proof}

\noindent
The next example also involves rings of prime characteristic, but is perhaps
a little more surprising. The drawback is that it requires more knowledge of
characteristic $p$ phenomena than the previous example. Recall that we say a
ring $A$ of prime characteristic is $F$-finite if the Frobenius map on $A$
is finite. 

\begin{lemma}
\label{lemma-completion-etale}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian local ring of prime
characteristic $p > 0$ such that $[\kappa : \kappa^p] < \infty$.
Then the  canonical map  $A \to A^\wedge$ to the completion of $A$
is flat and formally unramified. However, if $A$ is regular but not
excellent, then this map is not formally \'etale.
\end{lemma}

\begin{proof}
Flatness of the completion is
Algebra, Lemma \ref{algebra-lemma-completion-flat}.
To show that the map is formally unramified, it
suffices to show that $\Omega_{A^\wedge/A} = 0$, see
Algebra, Lemma \ref{algebra-lemma-characterize-formally-unramified}.

\medskip\noindent
We sketch a proof. Choose $x_1, \ldots, x_r \in A$ which map to a $p$-basis
$\overline{x}_1, \ldots, \overline{x}_r$ of $\kappa$, i.e.,
such that $\kappa$ is minimally generated by $\overline{x}_i$ over $\kappa^p$.
Choose a minimal set of generators $y_1, \ldots, y_s$ of $\mathfrak m$.
For each $n$ the elements $x_1, \ldots, x_r, y_1, \ldots, y_s$ generate
$A/\mathfrak m^n$ over $(A/\mathfrak m^n)^p$ by Frobenius.
Some details omitted. We conclude that $F : A^\wedge \to A^\wedge$
is finite. Hence $\Omega_{A^\wedge/A}$ is a finite $A^\wedge$-module.
On the other hand, for any $a \in A^\wedge$ and $n$ we can find
$a_0 \in A$ such that $a - a_0 \in \mathfrak m^nA^\wedge$.
We conclude that $\text{d}(a) \in \bigcap \mathfrak m^n \Omega_{A^\wedge/A}$
which implies that $\text{d}(a)$ is zero by
Algebra, Lemma \ref{algebra-lemma-intersect-powers-ideal-module-zero}.
Thus $\Omega_{A^\wedge/A} = 0$.

\medskip\noindent
Suppose $A$ is regular. Then, using the Cohen structure theorem
$x_1, \ldots, x_r, y_1, \ldots, y_s$ is a $p$-basis for the ring
$A^\wedge$, i.e., we have
$$
A^\wedge = \bigoplus\nolimits_{I, J} (A^\wedge)^p
x_1^{i_1} \ldots x_r^{i_r} y_1^{j_1} \ldots y_s^{j_s}
$$
with $I = (i_1, \ldots, i_r)$, $J = (j_1, \ldots, j_s)$ and
$0 \leq i_a, j_b \leq p - 1$. Details omitted. In particular, we see that
$\Omega_{A^\wedge}$ is a free $A^\wedge$-module with basis
$\text{d}(x_1), \ldots, \text{d}(x_r), \text{d}(y_1), \ldots, \text{d}(y_s)$.

\medskip\noindent
Now if $A \to A^\wedge$ is formally \'etale or even just formally smooth,
then we see that $\NL_{A^\wedge/A}$ has vanishing cohomology in degrees $-1, 0$
by Algebra, Proposition \ref{algebra-proposition-characterize-formally-smooth}.
It follows from the Jacobi-Zariski sequence
(Algebra, Lemma \ref{algebra-lemma-exact-sequence-NL}) for the ring
maps $\mathbf{F}_p \to A \to A^\wedge$ that we get an isomorphism
$\Omega_A \otimes_A A^\wedge \cong \Omega_{A^\wedge}$.
Hence we find that $\Omega_A$ is free on
$\text{d}(x_1), \ldots, \text{d}(x_r), \text{d}(y_1), \ldots, \text{d}(y_s)$.
Looking at fraction fields and using that $A$ is normal
we conclude that $a \in A$ is a $p$th power if and only if its image in
$A^\wedge$ is a $p$th power (details omitted; use
Algebra, Lemma \ref{algebra-lemma-derivative-zero-pth-power}).
A second consequence is that the operators $\partial/\partial x_a$ and
$\partial/\partial y_b$ are defined on $A$.

\medskip\noindent
We will show that the above lead to the conclusion that $A$ is finite
over $A^p$ with $p$-basis $x_1, \ldots, x_r, y_1, \ldots, y_s$.
This will contradict the non-excellency of $A$ by a result of
Kunz, see \cite[Corollary 2.6]{Kun76}.
Namely, say $a \in A$ and write
$$
a =  \sum\nolimits_{I, J} (a_{I, J})^p
x_1^{i_1} \ldots x_r^{i_r} y_1^{j_1} \ldots y_s^{j_s}
$$
with $a_{I, J} \in A^\wedge$. To finish the proof it suffices to
show that $a_{I, J} \in A$. Applying the operator
$$
(\partial/\partial x_1)^{p - 1} \ldots
(\partial/\partial x_r)^{p - 1}
(\partial/\partial y_1)^{p - 1} \ldots
(\partial/\partial y_s)^{p - 1}
$$
to both sides we conclude that $a_{I, J}^p \in A$ where
$I = (p - 1, \ldots, p - 1)$ and $J = (p - 1, \ldots, p - 1)$.
By our remark above, this also implies $a_{I, J} \in A$.
After replacing $a$ by $a' = a - a_{I, J}^p x^I y^J$
we can use a $1$-order lower differential operators to get
another coefficient $a_{I, J}$ to be in $A$. Etc.
\end{proof}

\begin{remark}
\label{remark-reference-existence-regular-nonexcellent-rings}
Non-excellent regular rings whose residue fields have a finite $p$-basis
can be constructed even in the function field of $\mathbb{P}^2_k$, over a 
characteristic $p$ field $k = \overline{k}$. See
\cite[$\mathsection 4.1$]{DS18}.
\end{remark}

\noindent
The proof of Lemma \ref{lemma-completion-etale} actually shows a little more.

\begin{lemma}
\label{lemma-excellent-regular-local-rings}
Let $(A, \mathfrak m, \kappa)$ be a regular local ring of characteristic
$p > 0$. Suppose $[\kappa : \kappa^p] < \infty$. Then $A$ is excellent
if and only if $A \to A^\wedge$ is formally \'etale.
\end{lemma}

\begin{proof}
The backward implication follows from Lemma \ref{lemma-completion-etale}.
For the forward implication, note that we already know from
Lemma \ref{lemma-completion-etale}
that $A \to A^\wedge$ is formally unramified or equivalently
that $\Omega_{A^\wedge/A}$ is zero.
Thus, it suffices to show that the completion map is formally smooth when
$A$ is excellent. By N\'eron-Popescu
desingularization $A \to A^\wedge$ can be  written as a filtered
colimit of smooth $A$-algebras
(Smoothing Ring Maps, Theorem \ref{smoothing-theorem-popescu}).
Hence $\NL_{A^\wedge/A}$ has vanishing cohomology in degree $-1$.
Thus $A \to A^\wedge$ is formally smooth by Algebra, Proposition
\ref{algebra-proposition-characterize-formally-smooth}.
\end{proof}










\section{Ideals generated by sets of idempotents and localization}
\label{section-ideal-locally-idempotents}

\noindent
Let $R$ be a ring. Consider the ring
$$
B(R) = R[x_n; n \in \mathbf{Z}]/(x_n(x_n - 1), x_nx_m; n \not = m)
$$
It is easy to show that every prime $\mathfrak q \subset B(R)$
is either of the form
$$
\mathfrak q = \mathfrak pB(R) + (x_n; n \in \mathbf{Z})
$$
or of the form
$$
\mathfrak q =
\mathfrak pB(R) + (x_n - 1) + (x_m; n \not = m, m \in \mathbf{Z}).
$$
Hence we see that
$$
\Spec(B(R)) =
\Spec(R) \amalg \coprod\nolimits_{n \in \mathbf{Z}} \Spec(R)
$$
where the topology is not just the disjoint union topology. It has the
following properties: Each of the copies indexed by $n \in \mathbf{Z}$
is an open subscheme, namely it is the standard open $D(x_n)$.
The "central" copy of $\Spec(R)$ is in the closure of the union
of any infinitely many of the other copies of $\Spec(R)$.
Note that this last copy of $\Spec(R)$ is cut out by the ideal
$(x_n, n \in \mathbf{Z})$ which is generated by the idempotents $x_n$.
Hence we see that if $\Spec(R)$ is connected,
then the decomposition above is exactly the decomposition of
$\Spec(B(R))$ into connected components.

\medskip\noindent
Next, let $A = \mathbf{C}[x, y]/((y - x^2 + 1)(y + x^2 - 1))$.
The spectrum of $A$ consists of two irreducible components
$C_1 = \Spec(A_1)$, $C_2 = \Spec(A_2)$
with $A_1 = \mathbf{C}[x, y]/(y - x^2 + 1)$ and
$A_2 = \mathbf{C}[x, y]/(y + x^2 - 1)$. Note that these are
parametrized by $(x, y) = (t, t^2 - 1)$ and $(x, y) = (t, -t^2 + 1)$
which meet in $P = (-1, 0)$ and $Q = (1, 0)$. We can make a twisted
version of $B(A)$ where we glue $B(A_1)$ to $B(A_2)$ in the following
way: Above $P$ we let $x_n \in B(A_1) \otimes \kappa(P)$
correspond to $x_n \in B(A_2) \otimes \kappa(P)$, but above $Q$
we let $x_n \in B(A_1) \otimes \kappa(Q)$
correspond to $x_{n + 1} \in B(A_2) \otimes \kappa(Q)$.
Let $B^{twist}(A)$ denote the resulting $A$-algebra.
Details omitted. By construction
$B^{twist}(A)$ is Zariski locally over $A$ isomorphic to the untwisted
version. Namely, this happens over both the principal open
$\Spec(A) \setminus \{P\}$
and the principal open $\Spec(A) \setminus \{Q\}$.
However, our choice of glueing produces enough "monodromy" such that
$\Spec(B^{twist}(A))$ is connected (details omitted).
Finally, there is a central copy of
$\Spec(A) \to \Spec(B^{twist}(A))$
which gives a closed subscheme whose ideal is Zariski locally
on $B^{twist}(A)$ cut out by ideals generated by idempotents, but
not globally (as $B^{twist}(A)$ has no nontrivial idempotents).

\begin{lemma}
\label{lemma-not-generated-idempotents}
There exists an affine scheme $X = \Spec(A)$ and a
closed subscheme $T \subset X$ such that $T$ is Zariski locally
on $X$ cut out by ideals generated by idempotents, but
$T$ is not cut out by an ideal generated by idempotents.
\end{lemma}

\begin{proof}
See above.
\end{proof}



\section{A ring map which identifies local rings which is not ind-\'etale}
\label{section-not-ind-etale}

\noindent
Note that the ring map $R \to B(R)$ constructed in
Section \ref{section-ideal-locally-idempotents} is
a colimit of finite products of copies of $R$. Hence $R \to B(R)$
is ind-Zariski, see
Pro-\'etale Cohomology, Definition \ref{proetale-definition-ind-zariski}.
Next, consider the ring map $A \to B^{twist}(A)$
constructed in Section \ref{section-ideal-locally-idempotents}.
Since this ring map is Zariski locally on $\Spec(A)$ isomorphic to an
ind-Zariski ring map $R \to B(R)$ we conclude that it identifies local rings
(see Pro-\'etale Cohomology, Lemma \ref{proetale-lemma-ind-zariski-implies}).
The discussion in Section \ref{section-ideal-locally-idempotents}
shows there is a section
$B^{twist}(A) \to A$ whose kernel is not generated by idempotents.
Now, if $A \to B^{twist}(A)$ were ind-\'etale, i.e.,
$B^{twist}(A) = \colim A_i$ with $A \to A_i$ \'etale,
then the kernel of $A_i \to A$ would be generated by an idempotent
(Algebra, Lemmas \ref{algebra-lemma-map-between-etale} and
\ref{algebra-lemma-surjective-flat-finitely-presented}).
This would contradict the result mentioned above.

\begin{lemma}
\label{lemma-not-ind-etale}
There is a ring map $A \to B$ which identifies local rings but
which is not ind-\'etale. A fortiori it is not ind-Zariski.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}




\section{Non flasque quasi-coherent sheaf associated to injective module}
\label{section-nonflasque}

\noindent
For more examples of this type see \cite[Expos\'e II, Appendix I]{SGA6}
where Illusie explains some examples due to Verdier.

\medskip\noindent
Consider the affine scheme $X = \Spec(A)$ where
$$
A = k[x, y, z_1, z_2, \ldots]/(x^nz_n)
$$
is the ring from
Properties, Example \ref{properties-example-does-not-work-in-general}.
Set $I = (x) \subset A$. Consider the quasi-compact open $U = D(x)$ of $X$.
We have seen in loc.\ cit.\ that there is a section
$s \in \mathcal{O}_X(U)$ which does not come from an $A$-module
map $I^n \to A$ for any $n \geq 0$.

\medskip\noindent
Let $\alpha : A \to J$ be the embedding of $A$ into an injective $A$-module.
Let $Q = J/\alpha(A)$ and denote $\beta : J \to Q$ the quotient map.
We claim that the map
$$
\Gamma(X, \widetilde{J})
\longrightarrow
\Gamma(U, \widetilde{J})
$$
is not surjective. Namely, we claim that $\alpha(s)$ is not in the image.
To see this, we argue by contradiction. So assume that $x \in J$ is an
element which restricts to $\alpha(s)$ over $U$. Then $\beta(x) \in Q$
is an element which restricts to $0$ over $U$. Hence we know that
$I^n\beta(x) = 0$ for some $n$, see
Properties,
Lemma \ref{properties-lemma-sections-over-quasi-compact-open-in-affine}.
This implies that we get a morphism
$\varphi : I^n \to A$, $h \mapsto \alpha^{-1}(hx)$. It is easy to see that
this morphism $\varphi$ gives rise to the section $s$ via the map of
Properties,
Lemma \ref{properties-lemma-sections-over-quasi-compact-open-in-affine}
which is a contradiction.

\begin{lemma}
\label{lemma-nonflasque}
There exists an affine scheme $X = \Spec(A)$ and an injective
$A$-module $J$ such that $\widetilde{J}$ is not a flasque sheaf on $X$.
Even the restriction $\Gamma(X, \widetilde{J}) \to \Gamma(U, \widetilde{J})$
with $U$ a standard open need not be surjective.
\end{lemma}

\begin{proof}
See above.
\end{proof}

\noindent
In fact, we can use a similar construction to get an example of an
injective module whose associated quasi-coherent sheaf has nonzero
cohomology over a quasi-compact open. Namely, we start with the ring
$$
A = k[x, y, w_1, u_1, w_2, u_2, \ldots]/(x^nw_n, y^nu_n, u_n^2, w_n^2)
$$
where $k$ is a field. Choose an injective map $A \to I$ where $I$ is an
injective $A$-module. We claim that the element $1/xy$ in
$A_{xy} \subset I_{xy}$ is not in the image of $I_x \oplus I_y \to I_{xy}$.
Arguing by contradiction, suppose that
$$
\frac{1}{xy} = \frac{i}{x^n} + \frac{j}{y^n}
$$
for some $n \geq 1$ and $i, j \in I$. Clearing denominators we obtain
$$
(xy)^{n + m - 1} = x^my^{n + m}i + x^{n + m}y^mj
$$
for some $m \geq 0$. Multiplying with $u_{n + m}w_{n + m}$ we see
that $u_{n + m}w_{n + m}(xy)^{n + m - 1} = 0$ in $A$ which is the
desired contradiction.
Let $U = D(x) \cup D(y) \subset X = \Spec(A)$. For any $A$-module
$M$ we have an exact sequence
$$
0 \to H^0(U, \widetilde{M}) \to M_x \oplus M_y \to M_{xy} \to
H^1(U, \widetilde{M}) \to 0
$$
by Mayer-Vietoris. We conclude that $H^1(U, \widetilde{I})$ is nonzero.

\begin{lemma}
\label{lemma-nonvanishing}
There exists an affine scheme $X = \Spec(A)$ whose underlying
topological space is Noetherian and an injective
$A$-module $I$ such that $\widetilde{I}$ has nonvanishing $H^1$
on some quasi-compact open $U$ of $X$.
\end{lemma}

\begin{proof}
See above. Note that $\Spec(A) = \Spec(k[x, y])$ as topological spaces.
\end{proof}









\section{A non-separated flat group scheme}
\label{section-non-separated-group-scheme}

\noindent
Every group scheme over a field is separated, see
Groupoids, Lemma \ref{groupoids-lemma-group-scheme-over-field-separated}.
This is not true for group schemes over a base.

\medskip\noindent
Let $k$ be a field. Let $S = \Spec(k[x]) = \mathbf{A}^1_k$.
Let $G$ be the affine line with $0$ doubled (see
Schemes, Example \ref{schemes-example-affine-space-zero-doubled})
seen as a scheme over $S$. Thus a fibre of $G \to S$ is either a
singleton or a set with two elements (one in $U$ and one in $V$).
Thus we can endow these fibres with the structure of a group (by
letting the element in $U$ be the zero of the group structure).
More precisely, $G$ has two opens $U, V$ which map isomorphically
to $S$ such that $U \cap V$ is mapped isomorphically to
$S \setminus \{0\}$. Then
$$
G \times_S G = U \times_S U \cup V \times_S U \cup
U \times_S V \cup V \times_S V
$$
where each piece is isomorphic to $S$. Hence we can define a multiplication
$m : G \times_S G \to G$ as the unique $S$-morphism which maps the first
and the last piece into $U$ and the two middle pieces into $V$. This matches
the pointwise description given above. We omit the
verification that this defines a group scheme structure.

\begin{lemma}
\label{lemma-non-separated-group-scheme}
There exists a flat group scheme of finite type over the affine line
which is not separated.
\end{lemma}

\begin{proof}
See the discussion above.
\end{proof}

\begin{lemma}
\label{lemma-non-quasi-separated-group-scheme}
There exists a flat group scheme of finite type over the infinite
dimensional affine space which is not quasi-separated.
\end{lemma}

\begin{proof}
The same construction as above can be carried out with the infinite dimensional
affine space $S = \mathbf{A}^\infty_k = \Spec k[x_1, x_2, \ldots]$ as the base
and the origin $0 \in S$ corresponding to the maximal ideal
$(x_1, x_2, \ldots)$ as the closed point which is doubled in $G$.
The resulting group scheme $G \rightarrow S$ is 
not quasi-separated as explained in
Schemes, Example \ref{schemes-example-not-quasi-separated}. 
\end{proof}



\section{A non-flat group scheme with flat identity component}
\label{section-non-flat-group-scheme}

\noindent
Let $X \to S$ be a monomorphism of schemes. Let $G = S \amalg X$.
Let $m : G \times_S G \to G$ be the $S$-morphism
$$
G \times_S G = X \times_S X \amalg X \amalg X \amalg S
\longrightarrow G = X \amalg S
$$
which maps the summands $X \times_S X$ and $S$ into $S$ and
maps the summands $X$ into $X$ by the identity morphism.
This defines a group law. To see this we have to show that
$m \circ (m \times \text{id}_G) = m \circ (\text{id}_G \times m)$
as maps $G \times_S G \times_S G \to G$. Decomposing
$G \times_S G \times_S G$ into components as above, we see that
we need to verify this for the restriction to each of the $8$-pieces.
Each piece is isomorphic to either $S$, $X$, $X \times_S X$, or
$X \times_S X \times_S X$. Moreover, both maps map these pieces
to $S$, $X$, $S$, $X$ respectively. Having said this, the fact that
$X \to S$ is a monomorphism implies that $X \times_S X \cong X$
and $X \times_S X \times_S X \cong X$ and that there is in each case
exactly one $S$-morphism $S \to S$ or $X \to X$. Thus we see
that $m \circ (m \times \text{id}_G) = m \circ (\text{id}_G \times m)$.
Thus taking $X \to S$ to be any
nonflat monomorphism of schemes (e.g., a closed immersion)
we get an example of a group scheme
over a base $S$ whose identity component is $S$ (hence flat)
but which is not flat.

\begin{lemma}
\label{lemma-non-flat-group-scheme}
There exists a group scheme $G$ over a base $S$ whose identity
component is flat over $S$ but which is not flat over $S$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}




\section{A non-separated group algebraic space over a field}
\label{section-non-separated-group-space}

\noindent
Every group scheme over a field is separated, see
Groupoids, Lemma \ref{groupoids-lemma-group-scheme-over-field-separated}.
This is not true for group algebraic spaces over a field
(but see end of this section for positive results).

\medskip\noindent
Let $k$ be a field of characteristic zero.
Consider the algebraic space $G = \mathbf{A}^1_k/\mathbf{Z}$ from
Spaces, Example \ref{spaces-example-affine-line-translation}.
By construction $G$ is the fppf sheaf associated to the presheaf
$$
T \longmapsto \Gamma(T, \mathcal{O}_T) / \mathbf{Z}
$$
on the category of schemes over $k$. The obvious addition rule on the presheaf
induces an addition $m : G \times G \to G$ which turns $G$ into a group
algebraic space over $\Spec(k)$. Note that $G$ is not separated
(and not even quasi-separated or locally separated). On the other hand
$G \to \Spec(k)$ is of finite type!

\begin{lemma}
\label{lemma-non-separated-group-space}
There exists a group algebraic space of finite type over a field
which is not separated (and not even quasi-separated or locally separated).
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Positive results: If the group algebraic space $G$ is either
quasi-separated, or locally separated, or more generally a
decent algebraic space, then $G$ is in fact separated, see
More on Groupoids in Spaces, Lemma
\ref{spaces-more-groupoids-lemma-group-scheme-over-field-separated}.
Moreover, a finite type, separated group algebraic space over a
field is in fact a scheme by More on Groupoids in Spaces, Lemma
\ref{spaces-more-groupoids-lemma-group-space-scheme-locally-finite-type-over-k}.
The idea of the proof is that the schematic locus is open dense, see
Properties of Spaces, Proposition
\ref{spaces-properties-proposition-locally-quasi-separated-open-dense-scheme}
or
Decent Spaces, Theorem \ref{decent-spaces-theorem-decent-open-dense-scheme}.
By translating this open we see that
every point of $G$ has an open neighbourhood which is a scheme.




\section{Specializations between points in fibre \'etale morphism}
\label{section-specializations-fibre-etale}

\noindent
If $f : X \to Y$ is an \'etale, or more generally a locally quasi-finite
morphism of schemes, then there are no specializations between points of
fibres, see
Morphisms, Lemma \ref{morphisms-lemma-locally-quasi-finite-fibres}.
However, for morphisms of algebraic spaces this doesn't hold in general.

\medskip\noindent
To give an example, let $k$ be a field.
Set
$$
P = k[u, u^{-1}, y, \{x_n\}_{n \in \mathbf{Z}}].
$$
Consider the action
of $\mathbf{Z}$ on $P$ by $k$-algebra maps generated by the automorphism
$\tau$ given by the rules $\tau(u) = u$, $\tau(y) = uy$, and
$\tau(x_n) = x_{n + 1}$. For $d \geq 1$ set
$I_d = ((1 - u^d)y, x_n - x_{n + d}, n \in \mathbf{Z})$.
Then $V(I_d) \subset \Spec(P)$ is the fix point locus of $\tau^d$.
Let $S \subset P$ be the multiplicative subset generated by $y$ and
all $1 - u^d$, $d \in \mathbf{N}$. Then we
see that $\mathbf{Z}$ acts freely on $U = \Spec(S^{-1}P)$.
Let $X = U/\mathbf{Z}$ be the quotient algebraic space, see
Spaces, Definition \ref{spaces-definition-quotient}.

\medskip\noindent
Consider the prime ideals $\mathfrak p_n = (x_n, x_{n + 1}, \ldots)$ in
$S^{-1}P$. Note that $\tau(\mathfrak p_n) = \mathfrak p_{n + 1}$.
Hence each of these define point $\xi_n \in U$ whose image in $X$ is
the same point $x$ of $X$. Moreover we have the specializations
$$
\ldots \leadsto \xi_n \leadsto \xi_{n - 1} \leadsto \ldots
$$
We conclude that $U \to X$ is an example of the promised type.

\begin{lemma}
\label{lemma-specializations-fibre-etale}
There exists an \'etale morphism of algebraic spaces $f : X \to Y$
and a nontrivial specialization of points $x \leadsto x'$ in $|X|$ with
$f(x) = f(x')$ in $|Y|$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}







\section{A torsor which is not an fppf torsor}
\label{section-torsor-not-fppf}

\noindent
In
Groupoids, Remark \ref{groupoids-remark-fun-with-torsors}
we raise the question whether any $G$-torsor is a $G$-torsor for the
fppf topology. In this section we show that this is not always the case.

\medskip\noindent
Let $k$ be a field. All schemes and stacks are over $k$ in what follows.
Let $G \to \Spec(k)$ be the group scheme
$$
G = (\mu_{2, k})^\infty =
\mu_{2, k} \times_k \mu_{2, k} \times_k \mu_{2, k} \times_k \ldots =
\lim_n (\mu_{2, k})^n
$$
where $\mu_{2, k}$ is the group scheme of second roots of unity over
$\Spec(k)$, see
Groupoids, Example \ref{groupoids-example-roots-of-unity}.
As an inverse limit of affine schemes we see that $G$ is an affine group
scheme. In fact it is the spectrum of the ring
$k[t_1, t_2, t_3, \ldots]/(t_i^2 - 1)$. The multiplication map
$m : G \times_k G \to G$ is on the algebra level given by
$t_i \mapsto t_i \otimes t_i$.

\medskip\noindent
We claim that any $G$-torsor over $k$ is of the form
$$
P = \Spec(k[x_1, x_2, x_3, \ldots]/(x_i^2 - a_i))
$$
for certain $a_i \in k^*$ and with $G$-action $G \times_k P \to P$
given by $x_i \to t_i \otimes x_i$ on the algebra level.
We omit the proof.
Actually for the example we only need that $P$ is a $G$-torsor
which is clear since over $k' = k(\sqrt{a_1}, \sqrt{a_2}, \ldots)$
the scheme $P$ becomes isomorphic to $G$ in a $G$-equivariant manner.
Note that $P$ is trivial if and only if $k' = k$ since if
$P$ has a $k$-rational point then all of the $a_i$ are squares.

\medskip\noindent
We claim that $P$ is an fppf torsor if and only if the field extension
$k' = k(\sqrt{a_1}, \sqrt{a_2}, \ldots)/k$ is finite.
If $k'$ is finite over $k$, then
$\{\Spec(k') \to \Spec(k)\}$
is an fppf covering which trivializes $P$ and we see that $P$ is indeed
an fppf torsor. Conversely, suppose that $P$ is an fppf $G$-torsor.
This means that there exists an fppf covering
$\{S_i \to \Spec(k)\}$ such that each $P_{S_i}$ is trivial.
Pick an $i$ such that $S_i$ is not empty. Let $s \in S_i$ be a closed
point. By
Varieties, Lemma \ref{varieties-lemma-locally-finite-type-Jacobson}
the field extension $\kappa(s)/k$ is finite, and by construction
$P_{\kappa(s)}$ has a $\kappa(s)$-rational point. Thus we see that
$k \subset k' \subset \kappa(s)$ and $k'$ is finite over $k$.

\medskip\noindent
To get an explicit example take $k = \mathbf{Q}$ and $a_i = i$
for example (or $a_i$ is the $i$th prime if you like).

\begin{lemma}
\label{lemma-torsors-principal-spaces-not-equal}
Let $S$ be a scheme. Let $G$ be a group scheme over $S$.
The stack $G\textit{-Principal}$ classifying principal homogeneous $G$-spaces
(see Examples of Stacks, Subsection
\ref{examples-stacks-subsection-principal-homogeneous-spaces})
and the stack $G\textit{-Torsors}$ classifying fppf $G$-torsors
(see Examples of Stacks, Subsection
\ref{examples-stacks-subsection-fppf-torsors})
are not equivalent in general.
\end{lemma}

\begin{proof}
The discussion above shows that the functor
$G\textit{-Torsors} \to G\textit{-Principal}$ isn't essentially
surjective in general.
\end{proof}









\section{Stack with quasi-compact flat covering which is not algebraic}
\label{section-not-algebraic-stack}

\noindent
In this section we briefly describe an example due to Brian Conrad.
You can find the example online at
\href{https://mathoverflow.net/questions/15082/fpqc-covers-of-stacks/15269#15269}{this location}.
Our example is slightly different.

\medskip\noindent
Let $k$ be an algebraically closed field.
All schemes and stacks are over $k$ in what follows.
Let $G \to \Spec(k)$ be an affine group scheme.
In Examples of Stacks,
Lemma \ref{examples-stacks-lemma-classifying-stacks}
we have given several different equivalent ways to view
$\mathcal{X} = [\Spec(k)/G]$ as a stack in groupoids over
$(\Sch/\Spec(k))_{fppf}$. In particular $\mathcal{X}$ classifies
fppf $G$-torsors. More precisely, a $1$-morphism $T \to \mathcal{X}$
corresponds to an fppf $G_T$-torsor $P$ over $T$ and $2$-arrows
correspond to isomorphisms of torsors. It follows that
the diagonal $1$-morphism
$$
\Delta :
\mathcal{X}
\longrightarrow
\mathcal{X} \times_{\Spec(k)} \mathcal{X}
$$
is representable and affine. Namely, given any pair
of fppf $G_T$-torsors $P_1, P_2$ over a scheme $T/k$ the
scheme $\mathit{Isom}(P_1, P_2)$ is affine over $T$.
The trivial $G$-torsor over $\Spec(k)$ defines a $1$-morphism
$$
f : \Spec(k) \longrightarrow \mathcal{X}.
$$
We claim that this is a surjective $1$-morphism. The reason is simply
that by definition for any $1$-morphism $T \to \mathcal{X}$ there exists
a fppf covering $\{T_i \to T\}$ such that $P_{T_i}$ is isomorphic
to the trivial $G_{T_i}$-torsor. Hence the compositions
$T_i \to T \to \mathcal{X}$ factor through $f$. Thus it is clear that
the projection $T \times_\mathcal{X} \Spec(k) \to T$
is surjective (which is how we define the property that $f$ is surjective, see
Algebraic Stacks,
Definition \ref{algebraic-definition-relative-representable-property}).
In a similar way you show that $f$ is quasi-compact and flat (details omitted).
We also record here the observation that
$$
\Spec(k) \times_\mathcal{X} \Spec(k) \cong G
$$
as schemes over $k$.

\medskip\noindent
Suppose there exists a surjective smooth morphism
$p : U \to \mathcal{X}$ where $U$ is a scheme.
Consider the fibre product
$$
\xymatrix{
W \ar[d] \ar[r] & U \ar[d] \\
\Spec(k) \ar[r] & \mathcal{X}
}
$$
Then we see that $W$ is a nonempty smooth scheme over $k$ which
hence has a $k$-point. This means that we can factor $f$ through $U$.
Hence we obtain
$$
G \cong
\Spec(k) \times_\mathcal{X} \Spec(k) \cong
(\Spec(k) \times_k \Spec(k))
\times_{(U \times_k U)}
(U \times_\mathcal{X} U)
$$
and since the projections $U \times_\mathcal{X} U \to U$ were
assumed smooth we conclude that
$U \times_\mathcal{X} U \to U \times_k U$ is
locally of finite type, see
Morphisms, Lemma \ref{morphisms-lemma-permanence-finite-type}.
It follows that in this case $G$ is locally of finite type over $k$.
Altogether we have proved the following lemma (which can be
significantly generalized).

\begin{lemma}
\label{lemma-BG-algebraic}
Let $k$ be a field. Let $G$ be an affine group scheme over $k$.
If the stack $[\Spec(k)/G]$ has a smooth covering by a
scheme, then $G$ is of finite type over $k$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
To get an explicit example as in the title of this section, take for example
$G = (\mu_{2, k})^\infty$ the group scheme of
Section \ref{section-torsor-not-fppf}, which is not locally of finite type
over $k$. By the discussion above we see that
$\mathcal{X} = [\Spec(k)/G]$ has properties (1) and (2) of
Algebraic Stacks, Definition \ref{algebraic-definition-algebraic-stack},
but not property (3). Hence $\mathcal{X}$ is not an algebraic stack.
On the other hand, there does exist a scheme $U$ and a surjective,
flat, quasi-compact morphism $U \to \mathcal{X}$, namely the morphism
$f : \Spec(k) \to \mathcal{X}$ we studied above.






\section{Limit preserving on objects, not limit preserving}
\label{section-limit-preserving}

\noindent
Let $S$ be a nonempty scheme. Let $\mathcal{G}$ be an injective abelian sheaf
on $(\Sch/S)_{fppf}$. We obtain a stack in groupoids
$$
\mathcal{G}\textit{-Torsors} \longrightarrow (\Sch/S)_{fppf}
$$
over $S$, see Examples of Stacks, Lemma
\ref{examples-stacks-lemma-torsors-sheaf-stack-in-groupoids}.
This stack is limit preserving on objects over $(\Sch/S)_{fppf}$ (see
Criteria for Representability, Section \ref{criteria-section-limit-preserving})
because every $\mathcal{G}$-torsor is trivial. On the other hand,
$\mathcal{G}\textit{-Torsors}$ is in general not limit preserving (see
Artin's Axioms, Definition \ref{artin-definition-limit-preserving})
as $\mathcal{G}$ need not be limit preserving as a sheaf. For example,
take any nonzero injective sheaf $\mathcal{I}$ and set
$\mathcal{G} = \prod_{n \in \mathbf{Z}} \mathcal{I}$ to get an
example.

\begin{lemma}
\label{lemma-limit-preserving-on-objects-not-limit-preserving}
Let $S$ be a nonempty scheme. There exists a stack in groupoids
$p : \mathcal{X} \to (\Sch/S)_{fppf}$
such that $p$ is limit preserving on objects, but $\mathcal{X}$ is not
limit preserving.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{A non-algebraic classifying stack}
\label{section-non-algebraic}

\noindent
Let $S = \Spec(\mathbf{F}_p)$ and let $\mu_p$ denote the
group scheme of $p$th roots of unity over $S$. In
Groupoids in Spaces, Section \ref{spaces-groupoids-section-stacks}
we have introduced the quotient stack $[S/\mu_p]$ and in
Examples of Stacks, Section \ref{examples-stacks-section-group-quotient-stacks}
we have shown $[S/\mu_p]$ is the classifying stack for
fppf $\mu_p$-torsors: Given a scheme $T$ over $S$ the category
$\Mor_S(T, [S/\mu_p])$ is canonically equivalent to the
category of fppf $\mu_p$-torsors over $T$. Finally, in
Criteria for Representability, Theorem
\ref{criteria-theorem-flat-groupoid-gives-algebraic-stack}
we have seen that $[S/\mu_p]$ is an algebraic stack.

\medskip\noindent
Now we can ask the question: ``How about the category fibred in groupoids
$\mathcal{S}$ classifying \'etale $\mu_p$-torsors?'' (In other words
$\mathcal{S}$ is a category over $\Sch/S$ whose fibre category over a
scheme $T$ is the category of \'etale $\mu_p$-torsors over $T$.)

\medskip\noindent
The first objection is that this isn't a stack for the fppf topology,
because descent for objects isn't going to hold. For example the
$\mu_p$-torsor $\Spec(\mathbf{F}_p(t)[x]/(x^p - t))$ over
$T = \Spec(\mathbf{F}_p(T))$ is fppf locally trivial, but
not \'etale locally trivial.

\medskip\noindent
A fix for this first problem is to work with the \'etale topology and
in this case descent for objects does work. Indeed it is true that
$\mathcal{S}$ is a stack in groupoids over $(\Sch/S)_\etale$.
Moreover, it is also the case that the diagonal
$\Delta : \mathcal{S} \to \mathcal{S} \times \mathcal{S}$
is representable (by schemes). This is true because given two
$\mu_p$-torsors (whether they be \'etale locally trivial or not)
the sheaf of isomorphisms between them is representable by a scheme.

\medskip\noindent
Thus we can finally ask if there exists a scheme $U$ and a smooth
and surjective $1$-morphism $U \to \mathcal{S}$. We will show in two
ways that this is impossible: by a direct argument (which we advise
the reader to skip) and by an argument using a general result.

\medskip\noindent
Direct argument (sketch): Note that the $1$-morphism
$\mathcal{S} \to \Spec(\mathbf{F}_p)$ satisfies the
infinitesimal lifting criterion for formal smoothness.
This is true because given a first order infinitesimal thickening
of schemes $T \to T'$ the kernel of $\mu_p(T') \to \mu_p(T)$
is isomorphic to the sections of the ideal sheaf of $T$ in $T'$, and
hence $H^1_\etale(T, \mu_p) = H^1_\etale(T', \mu_p)$.
Moreover, $\mathcal{S}$ is a limit preserving stack. Hence
if $U \to \mathcal{S}$ is smooth, then $U \to \Spec(\mathbf{F}_p)$
is limit preserving and satisfies  the
infinitesimal lifting criterion for formal smoothness.
This implies that $U$ is smooth over $\mathbf{F}_p$.
In particular $U$ is reduced, hence $H^1_\etale(U, \mu_p) = 0$.
Thus $U \to \mathcal{S}$ factors as
$U \to \Spec(\mathbf{F}_p) \to \mathcal{S}$
and the first arrow is smooth. By descent of smoothness, we see
that $U \to \mathcal{S}$ being smooth would imply
$\Spec(\mathbf{F}_p) \to \mathcal{S}$ is smooth. However, this
is not the case as
$\Spec(\mathbf{F}_p) \times_\mathcal{S} \Spec(\mathbf{F}_p)$
is $\mu_p$ which is not smooth over $\Spec(\mathbf{F}_p)$.


\medskip\noindent
Structural argument: In
Criteria for Representability, Section \ref{criteria-section-stacks-etale}
we have seen that we can think of algebraic stacks as those
stacks in groupoids for the \'etale topology with diagonal
representable by algebraic spaces having a smooth covering.
Hence if a smooth surjective $U \to \mathcal{S}$ exists then
$\mathcal{S}$ is an algebraic stack, and in particular satisfies
descent in the fppf topology. But we've seen above that $\mathcal{S}$
does not satisfies descent in the fppf topology.

\medskip\noindent
Loosely speaking the arguments above show that the classifying
stack in the \'etale topology for \'etale locally trivial torsors
for a group scheme $G$ over a base $B$ is algebraic if and only
if $G$ is smooth over $B$. One of the advantages of working with
the fppf topology is that it suffices to assume that $G \to B$
is flat and locally of finite presentation. In fact the quotient
stack (for the fppf topology) $[B/G]$ is algebraic if and only
if $G \to B$ is flat and locally of finite presentation, see
Criteria for Representability, Lemma \ref{criteria-lemma-BG-algebraic}.







\section{Sheaf with quasi-compact flat covering which is not algebraic}
\label{section-not-algebraic}

\noindent
Consider the functor $F = (\mathbf{P}^1)^\infty$, i.e., for a scheme $T$
the value $F(T)$ is the set of $f = (f_1, f_2, f_3, \ldots)$ where each
$f_i : T \to \mathbf{P}^1$ is a morphism of schemes. Note that
$\mathbf{P}^1$ satisfies the sheaf property for fpqc coverings, see
Descent, Lemma \ref{descent-lemma-fpqc-universal-effective-epimorphisms}.
A product of sheaves is a sheaf, so $F$ also satisfies the sheaf property for
the fpqc topology. The diagonal of $F$ is representable: if $f : T \to F$
and $g : S \to F$ are morphisms, then $T \times_F S$ is the scheme theoretic
intersection of the closed subschemes $T \times_{f_i, \mathbf{P}^1, g_i} S$
inside the scheme $T \times S$. Consider the group scheme $\text{SL}_2$ which
comes with a surjective smooth affine morphism $\text{SL}_2 \to \mathbf{P}^1$.
Next, consider $U = (\text{SL}_2)^\infty$ with its canonical (product) morphism
$U \to F$. Note that $U$ is an affine scheme. We claim the morphism
$U \to F$ is flat, surjective, and universally open. Namely, suppose
$f : T \to F$ is a morphism. Then $Z = T \times_F U$ is the infinite
fibre product of the schemes $Z_i = T \times_{f_i, \mathbf{P}^1} \text{SL}_2$
over $T$. Each of the morphisms $Z_i \to T$ is surjective smooth and
affine which implies that
$$
Z = Z_1 \times_T Z_2 \times_T Z_3 \times_T \ldots
$$
is a scheme flat and affine over $Z$. A simple limit argument shows that
$Z \to T$ is open as well.

\medskip\noindent
On the other hand, we claim that $F$ isn't an algebraic space.
Namely, if $F$ where an algebraic space it would be a quasi-compact
and separated (by our description of fibre products over $F$) algebraic
space. Hence cohomology of quasi-coherent sheaves would vanish above a
certain cutoff (see
Cohomology of Spaces, Proposition \ref{spaces-cohomology-proposition-vanishing}
and remarks preceding it). But clearly by taking the pullback
of $\mathcal{O}(-2, -2, \ldots, -2)$ under the projection
$$
(\mathbf{P}^1)^\infty \longrightarrow (\mathbf{P}^1)^n
$$
(which has a section) we can obtain a quasi-coherent sheaf whose cohomology
is nonzero in degree $n$. Altogether we obtain an answer to a question asked
by Anton Geraschenko on mathoverflow.

\begin{lemma}
\label{lemma-not-algebraic}
There exists a functor $F : \Sch^{opp} \to \textit{Sets}$
which satisfies the sheaf condition for the fpqc topology, has representable
diagonal $\Delta : F \to F \times F$, and such that there exists a
surjective, flat, universally open, quasi-compact morphism
$U \to F$ where $U$ is a scheme, but such that $F$ is not an algebraic space.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}








\section{Sheaves and specializations}
\label{section-sheaves}

\noindent
In the following we fix a big \'etale site $\Sch_\etale$
as constructed in
Topologies, Definition \ref{topologies-definition-big-etale-site}.
Moreover, a scheme will be an object of this site.
Recall that if $x, x'$ are points of a scheme $X$ we say $x$ is a
{\it specialization} of $x'$ or we write $x' \leadsto x$ if
$x \in \overline{\{x'\}}$. This is true in particular if $x = x'$.

\medskip\noindent
Consider the functor $F : \Sch_\etale \to \textit{Ab}$
defined by the following rules:
$$
F(X) = \prod\nolimits_{x \in X}
\prod\nolimits_{x' \in X, x' \leadsto x, x' \not = x}
\mathbf{Z}/2\mathbf{Z}
$$
Given a scheme $X$ we denote $|X|$ the underlying set of points.
An element $a \in F(X)$ will be viewed as a map of sets
$|X| \times |X| \to \mathbf{Z}/2\mathbf{Z}$, $(x, x') \mapsto a(x, x')$
which is zero if $x = x'$ or if $x$ is not a specialization of $x'$.
Given a morphism of schemes $f : X \to Y$ we define
$$
F(f) : F(Y) \longrightarrow F(X)
$$
by the rule that for $b \in F(Y)$ we set
$$
F(f)(b)(x, x') =
\left\{
\begin{matrix}
0 & \text{if }x\text{ is not a specialization of }x' \\
b(f(x), f(x')) & \text{else.}
\end{matrix}
\right.
$$
Note that this really does define an element of $F(X)$. We claim that if
$f : X \to Y$ and $g : Y \to Z$ are composable morphisms then
$F(f) \circ F(g) = F(g \circ f)$. Namely, let $c \in F(Z)$ and let
$x' \leadsto x$ be a specialization of points in $X$, then
$$
F(g \circ f)(x, x') = c(g(f(x)), g(f(x'))) = F(g)(F(f)(c))(x, x')
$$
because $f(x') \leadsto f(x)$. (This also works if $f(x) = f(x')$.)

\medskip\noindent
Let $G$ be the sheafification of $F$ in the \'etale topology.

\medskip\noindent
I claim that if $X$ is a scheme and $x' \leadsto x$ is a specialization
and $x' \not = x$, then $G(X) \not = 0$. Namely, let $a \in F(X)$ be
an element such that when we think of $a$ as a function
$|X| \times |X| \to \mathbf{Z}/2\mathbf{Z}$ it is nonzero at $(x, x')$.
Let $\{f_i : U_i \to X\}$ be an \'etale covering of $X$. Then we can pick an
$i$ and a point $u_i \in U_i$ with $f_i(u_i) = x$. Since generalizations
lift along flat morphisms (see
Morphisms, Lemma \ref{morphisms-lemma-generalizations-lift-flat})
we can find a specialization $u'_i \leadsto u_i$
with $f_i(u'_i) = x'$. By our construction above we see that
$F(f_i)(a) \not = 0$. Hence $a$ determines a nonzero element of $G(X)$.

\medskip\noindent
Note that if $X = \Spec(k)$ where $k$ is a field (or more generally
a ring all of whose prime ideals are maximal), then $F(X) = 0$
and for every \'etale morphism $U \to X$ we have $F(U) = 0$ because there
are no specializations between distinct points in fibres of an \'etale
morphism. Hence $G(X) = 0$.

\medskip\noindent
Suppose that $X \subset X'$ is a thickening, see
More on Morphisms, Definition \ref{more-morphisms-definition-thickening}.
Then the category of schemes \'etale over $X'$ is equivalent to the
category of schemes \'etale over $X$ by the base change functor
$U' \mapsto U = U' \times_{X'} X$, see
\'Etale Cohomology,
Theorem \ref{etale-cohomology-theorem-topological-invariance}.
Since it is always the case that $F(U) = F(U')$ in this situation
we see that also $G(X) = G(X')$.

\medskip\noindent
As a variant we can consider the presheaf $F_n$ which associates
to a scheme $X$ the collection of maps
$a : |X|^{n + 1} \to \mathbf{Z}/2\mathbf{Z}$ where $a(x_0, \ldots, x_n)$
is nonzero only if $x_n \leadsto \ldots \leadsto x_0$ is a sequence of
specializations and $x_n \not = x_{n - 1} \not = \ldots \not = x_0$.
Let $G_n$ be the sheaf associated to $F_n$.
In exactly the same way as above one shows that $G_n$ is nonzero
if $\dim(X) \geq n$ and is zero if $\dim(X) < n$.

\begin{lemma}
\label{lemma-sheaf-zero-on-low-dimension}
There exists a sheaf of abelian groups $G$ on
$\Sch_\etale$ with the following properties
\begin{enumerate}
\item $G(X) = 0$ whenever $\dim(X) < n$,
\item $G(X)$ is not zero if $\dim(X) \geq n$, and
\item if $X \subset X'$ is a thickening, then $G(X) = G(X')$.
\end{enumerate}
\end{lemma}

\begin{proof}
See the discussion above.
\end{proof}

\begin{remark}
\label{remark-specialization}
Here are some remarks:
\begin{enumerate}
\item The presheaves $F$ and $F_n$ are separated presheaves.
\item It turns out that $F$, $F_n$ are not sheaves.
\item One can show that $G$, $G_n$ is actually a sheaf for the fppf topology.
\end{enumerate}
We will prove these results if we need them.
\end{remark}


\section{Sheaves and constructible functions}
\label{section-constructible-functions}

\noindent
In the following we fix a big \'etale site $\Sch_\etale$ as constructed in
Topologies, Definition \ref{topologies-definition-big-etale-site}.
Moreover, a scheme will be an object of this site.
In this section we say that a {\it constructible partition}
of a scheme $X$ is a locally finite disjoint union decomposition
$X = \coprod_{i \in I} X_i$ such that each $X_i \subset X$ is a
locally constructible subset of $X$. Locally finite means that
for any quasi-compact open $U \subset X$ there are only finitely
many $i \in I$ such that $X_i \cap U$ is not empty.
Note that if $f : X \to Y$ is a morphism of schemes and
$Y = \coprod Y_j$ is a constructible partition, then
$X = \coprod f^{-1}(Y_j)$ is a constructible partition of $X$.
Given a set $S$ and a scheme $X$ a {\it constructible function}
$f : |X| \to S$ is a map such that $X = \coprod_{s \in S} f^{-1}(s)$
is a constructible partition of $X$.
If $G$ is an (abstract group) and $a, b : |X| \to G$ are constructible
functions, then $ab : |X| \to G, x \mapsto a(x)b(x)$ is a constructible
function too. The reason is that given any two constructible partitions
there is a third one refining both.

\medskip\noindent
Let $A$ be any abelian group. For any scheme $X$ we define
$$
F(X) =
\frac{\{a : |X| \to A \mid a \text{ is a constructible function}\}}{\{\text{locally constant functions }|X| \to A\}}
$$
We think of an element $a$ of $F(X)$ simply as a function well defined
up to adding a locally constant one. Given a morphism of schemes
$f : X \to Y$ and an element $b \in F(Y)$, then we define
$F(f)(b) = b \circ f$. Thus $F$ is a presheaf on $\Sch_\etale$.

\medskip\noindent
Note that if $\{f_i : U_i \to X\}$ is an fppf covering, and $a \in F(X)$
is such that $F(f_i)(a) = 0$ in $F(U_i)$, then $a \circ f_i$ is a locally
constant function for each $i$. This means in turn that $a$ is a locally
constant function as the morphisms $f_i$ are open. Hence $a = 0$ in $F(X)$.
Thus we see that $F$ is a separated presheaf (in the fppf topology
hence a fortiori in the \'etale topology).

\medskip\noindent
Let $G$ be the sheafification of $F$ in the \'etale topology.
Since $F$ is separated, and since $F(X) \not = 0$ for example when
$X$ is the spectrum of a discrete valuation ring, we see that $G$
is not zero.

\medskip\noindent
Let $X = \Spec(k)$ where $k$ is a field.
Then any \'etale covering of $X$ can be dominated
by a covering $\{\Spec(k') \to \Spec(k)\}$ with $k'/k$
a finite separable extension of fields. Since $F(\Spec(k')) = 0$
we see that $G(X) = 0$.

\medskip\noindent
Suppose that $X \subset X'$ is a thickening, see
More on Morphisms, Definition \ref{more-morphisms-definition-thickening}.
Then the category of schemes \'etale over $X'$ is equivalent to the
category of schemes \'etale over $X$ by the base change functor
$U' \mapsto U = U' \times_{X'} X$, see
\'Etale Cohomology,
Theorem \ref{etale-cohomology-theorem-topological-invariance}.
Since $F(U) = F(U')$ in this situation we see that also $G(X) = G(X')$.

\medskip\noindent
The sheaf $G$ is limit preserving, see
Limits of Spaces,
Definition \ref{spaces-limits-definition-locally-finite-presentation}.
Namely, let $R$ be a ring which is written as a directed colimit
$R = \colim_i R_i$ of rings. Set $X = \Spec(R)$ and
$X_i = \Spec(R_i)$, so that $X = \lim_i X_i$. Then
$G(X) = \colim_i G(X_i)$. To prove this one first proves that
a constructible partition of $\Spec(R)$ comes from a constructible
partitions of some $\Spec(R_i)$. Hence the result for $F$. To
get the result for the sheafification, use that any \'etale ring map
$R \to R'$ comes from an \'etale ring map $R_i \to R_i'$ for some $i$.
Details omitted.

\begin{lemma}
\label{lemma-weird-sheaf}
There exists a sheaf of abelian groups $G$ on
$\Sch_\etale$ with the following properties
\begin{enumerate}
\item $G(\Spec(k)) = 0$ whenever $k$ is a field,
\item $G$ is limit preserving,
\item if $X \subset X'$ is a thickening, then $G(X) = G(X')$, and
\item $G$ is not zero.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}




\section{The lisse-\'etale site is not functorial}
\label{section-lisse-etale-not-functorial}

\noindent
The {\it lisse-\'etale} site
$X_{lisse,\etale}$ of $X$ is the category of schemes smooth over $X$
endowed with (usual) \'etale coverings, see
Cohomology of Stacks, Section \ref{stacks-cohomology-section-lisse-etale}.
Let $f : X  \to Y$ be a morphism of schemes.
There is a functor
$$
u : Y_{lisse,\etale} \longrightarrow X_{lisse,\etale},\quad
V/Y \longmapsto V \times_Y X
$$
which is continuous. Hence we obtain an adjoint pair of functors
$$
u^s :
\Sh(X_{lisse,\etale})
\longrightarrow
\Sh(Y_{lisse,\etale}),
\quad
u_s :
\Sh(Y_{lisse,\etale})
\longrightarrow
\Sh(X_{lisse,\etale}),
$$
see Sites, Section \ref{sites-section-continuous-functors}.
We claim that, in general, $u$ does {\bf not} define a morphism of sites, see
Sites, Definition \ref{sites-definition-morphism-sites}.
In other words, we claim that $u_s$ is not left exact in general. Note that
representable presheaves are sheaves on lisse-\'etale sites. Hence, by
Sites, Lemma \ref{sites-lemma-pullback-representable-sheaf}
we see that $u_sh_V = h_{V \times_Y X}$. Now consider two morphisms
$$
\xymatrix{
V_1 \ar[rd] \ar@<1ex>[rr]^a \ar@<-1ex>[rr]_b & & V_2 \ar[ld] \\
& Y
}
$$
of schemes $V_1, V_2$ smooth over $Y$. Now if $u_s$ is left exact, then
we would have
$$
u_s \text{Equalizer}(h_a, h_b : h_{V_1} \to h_{V_2})
=
\text{Equalizer}(h_{a \times 1}, h_{b \times 1} :
h_{V_1 \times_Y X} \to h_{V_2 \times_Y X})
$$
We will take the morphisms $a, b : V_1 \to V_2$ such that there exists
no morphism from a scheme smooth over $Y$ into $(a = b) \subset V_1$, i.e.,
such that the left hand side is the empty sheaf, but such that after
base change to $X$ the equalizer is nonempty and smooth over $X$.
A silly example is to take $X = \Spec(\mathbf{F}_p)$,
$Y = \Spec(\mathbf{Z})$ and $V_1 = V_2 = \mathbf{A}^1_\mathbf{Z}$
with morphisms $a(x) = x$ and $b(x) = x + p$. Note that the equalizer
of $a$ and $b$ is the fibre of $\mathbf{A}^1_\mathbf{Z}$ over $(p)$.

\begin{lemma}
\label{lemma-lisse-etale-not-functorial}
The lisse-\'etale site is not functorial, even for morphisms of schemes.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}






\section{Sheaves on the category of Noetherian schemes}
\label{section-sheaves-locally-Noetherian}

\noindent
Let $S$ be a locally Noetherian scheme. As in
Artin's Axioms, Section \ref{artin-section-noetherian}
consider the inclusion functor
$$
u : (\textit{Noetherian}/S)_{fppf} \longrightarrow (\Sch/S)_{fppf}
$$
of the fppf site of locally Noetherian schemes over $S$ into a
big fppf site of $S$. As explained in the section referenced,
this functor is continuous. Hence we obtain an adjoint pair of functors
$$
u^s :
\Sh((\Sch/S)_{fppf})
\longrightarrow
\Sh((\textit{Noetherian}/S)_{fppf})
$$
and
$$
u_s :
\Sh((\textit{Noetherian}/S)_{fppf})
\longrightarrow
\Sh((\Sch/S)_{fppf})
$$
see Sites, Section \ref{sites-section-continuous-functors}.
However, we claim that $u$ in general does not define a
morphism of sites, see Sites, Definition \ref{sites-definition-morphism-sites}.
In other words, we claim that the functor $u_s$ is not left exact in general.

\medskip\noindent
Let $p$ be a prime number and set $S = \Spec(\mathbf{F}_p)$.
Consider the injective map of sheaves
$$
a : \mathcal{F} \longrightarrow \mathcal{G}
$$
on $(\textit{Noetherian}/S)_{fppf}$ defined as follows: for $U$
a locally Noetherian scheme over $S$ we define
$$
\mathcal{G}(U) = \Gamma(U, \mathcal{O}_U)^* =
\Mor_S(U, \mathbf{G}_{m, S})
$$
and we take
$$
\mathcal{F}(U) = \{f \in \mathcal{G}(U) \mid \text{fppf locally }f
\text{ has arbitrary }p\text{-power roots}\}
$$
A Noetherian $\mathbf{F}_p$-algebra $A$ has a nilpotent nilradical
$I \subset A$, the $p$-power roots of $1$ in $A$ are of the
elements of the form $1 + a$, $a \in I$, and hence no-nontrivial
$p$-power root of $1$ has arbitrary $p$-power roots. We conclude
that $\mathcal{F}(U)$ is a $p$-torsion free abelian group for any
locally Noetherian scheme $U$; some details omitted. It follows that
$p : \mathcal{F} \to \mathcal{F}$
is an injective map of abelian sheaves on $(\textit{Noetherian}/S)_{fppf}$.

\medskip\noindent
To get a contradiction, assume $u_s$ is exact. Then
$p : u_s\mathcal{F} \to u_s\mathcal{F}$ is injective too
and we find that $(u_s\mathcal{F})(V)$ is a $p$-torsion
free abelian group for any $V$ over $S$. Since
representable presheaves are sheaves on fppf sites, by
Sites, Lemma \ref{sites-lemma-pullback-representable-sheaf},
we see that $u_s\mathcal{G}$ is represented by
$\mathbf{G}_{m, S}$. Using that $u_s\mathcal{F} \to u_s\mathcal{G}$
is injective, we find a $p$-torsion free subgroup
$$
(u_s\mathcal{F})(V) \subset \Gamma(V, \mathcal{O}_V)^*
$$
for every scheme $V$ over $S$ with the following property:
for every morphism $V \to U$ of schemes over $S$ with $U$
locally Noetherian the subgroup
$$
\mathcal{F}(U) \subset \Gamma(U, \mathcal{O}_U)^*
$$
maps into the subgroup $(u_s\mathcal{F})(V)$ by the restriction
mapping $\Gamma(U, \mathcal{O}_U)^* \to \Gamma(V, \mathcal{O}_V)^*$.

\medskip\noindent
The actual contradiction now is obtained as follows:
let $k = \bigcup_{n \geq 0} \mathbf{F}_p(t^{1/{p^n}})$
and set
$$
B = k \otimes_{\mathbf{F}_p(t)} k
$$
and $V = \Spec(B)$. Since we have the two projection morphisms
$V \to \Spec(k)$ corresponding to the two coprojections $k \to B$
and since $\Spec(k)$ is Noetherian, we conclude the subgroup
$$
(u_s\mathcal{F})(V) \subset B^*
$$
contains $k^* \otimes 1$ and $1 \otimes k^*$. This is a contradiction
because
$$
(t^{1/p} \otimes 1) \cdot (1 \otimes t^{-1/p}) =
t^{1/p} \otimes t^{-1/p}
$$
is a nontrivial $p$-torsion unit of $B$.

\begin{lemma}
\label{lemma-not-a-morphism-of-sites-noetherian-to-all}
With $S = \Spec(\mathbf{F}_p)$ the inclusion functor
$(\textit{Noetherian}/S)_{fppf} \to (\Sch/S)_{fppf}$
does not define a morphism of sites.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}





\section{Derived pushforward of quasi-coherent modules}
\label{section-derived-push-quasi-coherent}

\noindent
Let $k$ be a field of characteristic $p > 0$. Let $S = \Spec(k[x])$.
Let $G = \mathbf{Z}/p\mathbf{Z}$ viewed either as an abstract group
or as a constant group scheme over $S$. Consider the algebraic stack
$\mathcal{X} = [S/G]$ where $G$ acts trivially on $S$, see
Examples of Stacks, Remark \ref{examples-stacks-remark-X-mod-G-group}
and
Criteria for Representability, Lemma \ref{criteria-lemma-BG-algebraic}.
Consider the structure morphism
$$
f : \mathcal{X} \longrightarrow S
$$
This morphism is quasi-compact and quasi-separated. Hence we get a functor
$$
Rf_{\QCoh, *} :
D^{+}_\QCoh(\mathcal{O}_\mathcal{X})
\longrightarrow
D^{+}_\QCoh(\mathcal{O}_S),
$$
see 
Derived Categories of Stacks, Proposition
\ref{stacks-perfect-proposition-derived-direct-image-quasi-coherent}.
Let's compute $Rf_{\QCoh, *}\mathcal{O}_\mathcal{X}$.
Since $D_\QCoh(\mathcal{O}_S)$ is equivalent to
the derived category of $k[x]$-modules (see
Derived Categories of Schemes, Lemma
\ref{perfect-lemma-affine-compare-bounded})
this is equivalent to computing
$R\Gamma(\mathcal{X}, \mathcal{O}_\mathcal{X})$.
For this we can use the covering $S \to \mathcal{X}$ and the spectral
sequence
$$
H^q(S \times_\mathcal{X} \ldots \times_\mathcal{X} S, O)
\Rightarrow H^{p + q}(\mathcal{X}, \mathcal{O}_\mathcal{X})
$$
see
Cohomology of Stacks, Proposition
\ref{stacks-cohomology-proposition-smooth-covering-compute-cohomology}.
Note that
$$
S \times_\mathcal{X} \ldots \times_\mathcal{X} S = S \times G^p
$$
which is affine. Thus the complex
$$
k[x] \to \text{Map}(G, k[x]) \to \text{Map}(G^2, k[x]) \to \ldots
$$
computes $R\Gamma(\mathcal{X}, \mathcal{O}_\mathcal{X})$.
Here for $\varphi \in \text{Map}(G^{p - 1}, k[x])$ its differential is
the map which sends $(g_1, \ldots, g_p)$ to
$$
\varphi(g_2, \ldots, g_p) +
\sum\nolimits_{i = 1}^{p - 1}
(-1)^i\varphi(g_1, \ldots, g_i + g_{i + 1}, \ldots, g_p)
+ (-1)^p\varphi(g_1, \ldots, g_{p - 1}).
$$
This is just the complex computing the group cohomology of $G$ acting
trivially on $k[x]$ (insert future reference here). The cohomology of
the cyclic group $G$ on $k[x]$ is exactly one copy of $k[x]$ in each
cohomological degree $\geq 0$ (insert future reference here). We conclude
that
$$
Rf_*\mathcal{O}_\mathcal{X} = \bigoplus\nolimits_{n \geq 0} \mathcal{O}_S[-n]
$$
Now, consider the complex
$$
E = \bigoplus\nolimits_{m \geq 0} \mathcal{O}_\mathcal{X}[m]
$$
This is an object of $D_\QCoh(\mathcal{O}_\mathcal{X})$. We interrupt the
discussion for a general result.

\begin{lemma}
\label{lemma-is-limit}
Let $\mathcal{X}$ be an algebraic stack. Let $K$ be an object of
$D(\mathcal{O}_\mathcal{X})$ whose cohomology sheaves are locally
quasi-coherent (Sheaves on Stacks, Definition
\ref{stacks-sheaves-definition-locally-quasi-coherent})
and satisfy the flat base change property (Cohomology of Stacks,
Definition \ref{stacks-cohomology-definition-flat-base-change}).
Then there exists a distinguished triangle
$$
K \to
\prod\nolimits_{n \geq 0} \tau_{\geq -n} K \to
\prod\nolimits_{n \geq 0} \tau_{\geq -n} K \to K[1]
$$
in $D(\mathcal{O}_\mathcal{X})$. In other words, $K$ is the derived
limit of its canonical truncations.
\end{lemma}

\begin{proof}
Recall that we work on the ``big fppf site'' $\mathcal{X}_{fppf}$
of $\mathcal{X}$ (by our conventions
for sheaves of $\mathcal{O}_\mathcal{X}$-modules in the chapters
Sheaves on Stacks and Cohomology on Stacks). Let $\mathcal{B}$ be the set
of objects $x$ of $\mathcal{X}_{fppf}$ which lie over an affine scheme $U$. 
Combining
Sheaves on Stacks, Lemmas
\ref{stacks-sheaves-lemma-compare-fppf-etale},
\ref{stacks-sheaves-lemma-cohomology-restriction},
Descent, Lemma \ref{descent-lemma-quasi-coherent-and-flat-base-change},
and
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}
we see that $H^p(x, \mathcal{F}) = 0$ if $\mathcal{F}$ is
locally quasi-coherent and $x \in \mathcal{B}$.
Now the claim follows from
Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-is-limit-dimension}
with $d = 0$.
\end{proof}

\begin{lemma}
\label{lemma-sum-is-product}
Let $\mathcal{X}$ be an algebraic stack. If $\mathcal{F}_n$ is a collection
of locally quasi-coherent sheaves with the flat base change property on
$\mathcal{X}$, then $\oplus_n \mathcal{F}_n[n] \to \prod_n \mathcal{F}_n[n]$
is an isomorphism in $D(\mathcal{O}_\mathcal{X})$.
\end{lemma}

\begin{proof}
This is true because by Lemma \ref{lemma-is-limit} we see that the direct sum
is isomorphic to the product.
\end{proof}

\noindent
We continue our discussion. Since a quasi-coherent module is locally
quasi-coherent and satisfies the flat base change property
(Sheaves on Stacks, Lemma \ref{stacks-sheaves-lemma-quasi-coherent}) we get
$$
E = \prod\nolimits_{m \geq 0} \mathcal{O}_\mathcal{X}[m]
$$
Since cohomology commutes
with limits we see that
$$
Rf_*E = \prod\nolimits_{m \geq 0}
\left(\bigoplus\nolimits_{n \geq 0} \mathcal{O}_S[m - n]\right)
$$
Note that this complex is not an object of $D_\QCoh(\mathcal{O}_S)$
because the cohomology sheaf in degree $0$ is an infinite product of copies
of $\mathcal{O}_S$ which is not even a locally quasi-coherent
$\mathcal{O}_S$-module.

\begin{lemma}
\label{lemma-push-not-OK}
A quasi-compact and quasi-separated morphism
$f : \mathcal{X} \to \mathcal{Y}$ of algebraic stacks
need not induce a functor
$Rf_* : D_\QCoh(\mathcal{O}_\mathcal{X}) \to
D_\QCoh(\mathcal{O}_\mathcal{Y})$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}



\section{A big abelian category}
\label{section-big}

\noindent
The purpose of this section is to give an example of a ``big'' abelian category
$\mathcal{A}$ and objects $M, N$ such that the collection of isomorphism
classes of extensions $\Ext_\mathcal{A}(M, N)$ is not a set.
The example is due to Freyd, see \cite[page 131, Exercise A]{Freyd}.

\medskip\noindent
We define $\mathcal{A}$ as follows. An object of $\mathcal{A}$
consists of a triple $(M, \alpha, f)$ where $M$ is an abelian group and
$\alpha$ is an ordinal and $f : \alpha \to \text{End}(M)$ is a map.
A morphism $(M, \alpha, f) \to (M', \alpha', f')$ is given by a homomorphism
of abelian groups $\varphi : M \to M'$ such that for {\it any} ordinal $\beta$
we have
$$
\varphi \circ f(\beta) = f'(\beta) \circ \varphi
$$
Here the rule is that we set $f(\beta) = 0$ if $\beta$ is not in
$\alpha$ and similarly we set $f'(\beta)$ equal to zero if $\beta$ is not an
element of $\alpha'$. We omit the verification that the category so defined
is abelian.

\medskip\noindent
Consider the object $Z = (\mathbf{Z}, \emptyset, f)$, i.e., all the
operators are zero. The observation is that computed in
$\mathcal{A}$ the group $\Ext^1_\mathcal{A}(Z, Z)$ is a proper class
and not a set. Namely, for each ordinal $\alpha$ we can find an extension
$(M, \alpha + 1, f)$ of $Z$ by $Z$ whose underlying group is
$M = \mathbf{Z} \oplus \mathbf{Z}$ and where the value of $f$ is
always zero except for
$$
f(\alpha) =
\left(
\begin{matrix}
0 & 1 \\
0 & 0
\end{matrix}
\right).
$$
This clearly produces a proper class of isomorphism classes of extensions.
In particular, the derived category of $\mathcal{A}$ has proper classes for
its collections of morphism, see
Derived Categories, Lemma \ref{derived-lemma-ext-1}. This means that some
care has to be exercised when defining Verdier quotients of triangulated
categories.

\begin{lemma}
\label{lemma-big-abelian-category}
There exists a ``big'' abelian category $\mathcal{A}$ whose
$\Ext$-groups are proper classes.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}





\section{Weakly associated points and scheme theoretic density}
\label{section-weak-ass-dense}

\noindent
Let $k$ be a field. Let $R = k[z, x_i, y_i]/(z^2, zx_iy_i)$ where
$i$ runs over the elements of $\mathbf{N}$. Note that $R = R_0 \oplus M_0$ where
$R_0 = k[x_i, y_i]$ is a subring and $M_0$ is an ideal of square zero
with $M_0 \cong R_0/(x_iy_i)$ as $R_0$-module. The prime
$\mathfrak p = (z, x_i)$ is weakly associated to $R$ as an $R$-module
(Algebra, Definition \ref{algebra-definition-weakly-associated}).
Indeed, the element $z$ in $R_\mathfrak p$ is nonzero but annihilated
by $\mathfrak pR_\mathfrak p$. On the other hand, consider the open
subscheme
$$
U = \bigcup D(x_i) \subset \Spec(R) = S
$$
We claim that $U \subset S$ is scheme theoretically dense
(Morphisms, Definition \ref{morphisms-definition-scheme-theoretically-dense}).
To prove this it suffices to show that $\mathcal{O}_S \to j_*\mathcal{O}_U$
is injective where $j : U \to S$ is the inclusion morphism, see 
Morphisms, Lemma \ref{morphisms-lemma-characterize-scheme-theoretically-dense}.
Translated back into algebra, we have to show that for all $g \in R$
the map
$$
R_g \longrightarrow \prod R_{x_ig}
$$
is injective. Write $g = g_0 + m_0$ with $g_0 \in R_0$ and $m_0 \in M_0$.
Then $R_g = R_{g_0}$ (details omitted). Hence we may assume $g \in R_0$.
We may also assume $g$ is not zero. Now $R_g = (R_0)_g \oplus (M_0)_g$.
Since $R_0$ is a domain, the map $(R_0)_g \to \prod (R_0)_{x_ig}$ is
injective. If $g \in (x_iy_i)$ then $(M_0)_g = 0$ and there is nothing
to prove. If $g \not \in (x_iy_i)$ then, since
$(x_iy_i)$ is a radical ideal of $R_0$, we have to show that
$M_0 \to \prod (M_0)_{x_ig}$ is injective. The kernel of
$R_0 \to M_0 \to (M_0)_{x_n}$ is $(x_iy_i, y_n)$. Since
$(x_iy_i, y_n)$ is a radical ideal, if $g \not \in (x_iy_i, y_n)$
then the kernel of $R_0 \to M_0 \to (M_0)_{x_ng}$ is $(x_iy_i, y_n)$.
As $g \not \in (x_iy_i, y_n)$ for all $n \gg 0$ we conclude that
the kernel is contained in $\bigcap_{n \gg 0} (x_iy_i, y_n) = (x_iy_i)$
as desired.

\medskip\noindent
Second example due to Ofer Gabber. Let $k$ be a field and let
$R$, resp.\ $R'$ be the ring of functions $\mathbf{N} \to k$, resp.\ the ring
of eventually constant functions $\mathbf{N} \to k$. Then $\Spec(R)$,
resp.\ $\Spec(R')$ is the
Stone-{\v C}ech compactification\footnote{Every element $f \in R$ is of
the form $ue$ where $u$ is a unit and $e$ is an idempotent. Then
Algebra, Lemma \ref{algebra-lemma-ring-with-only-minimal-primes}
shows $\Spec(R)$ is Hausdorff. On the other hand, $\mathbf{N}$ with the
discrete topology can be viewed as a dense open subset. Given a set map
$\mathbf{N} \to X$ to a Hausdorff, quasi-compact topological space $X$,
we obtain a ring map $\mathcal{C}^0(X; k) \to R$ where $\mathcal{C}^0(X; k)$
is the $k$-algebra of locally constant maps $X \to k$. This gives
$\Spec(R) \to \Spec(\mathcal{C}^0(X; k)) = X$ proving the universal
property.} $\beta\mathbf{N}$, resp.\ the
one point compactification\footnote{Here one argues that there is really
only one extra maximal ideal in $R'$.}
$\mathbf{N}^* = \mathbf{N} \cup \{\infty\}$.
All points are weakly associated since all primes are minimal in the
rings $R$ and $R'$.

\begin{lemma}
\label{lemma-example-schematically-dense-missing-weakly-associated-point}
There exists a reduced scheme $X$ and a schematically dense open
$U \subset X$ such that some weakly associated point $x \in X$ is not in $U$.
\end{lemma}

\begin{proof}
In the first example we have $\mathfrak p \not \in U$ by construction.
In Gabber's examples the schemes $\Spec(R)$ or $\Spec(R')$ are reduced.
\end{proof}



\section{Example of non-additivity of traces}
\label{section-non-additive}

\noindent
Let $k$ be a field and let $R = k[\epsilon]$ be the ring of dual numbers
over $k$. In other words, $R = k[x]/(x^2)$ and $\epsilon$ is the congruence
class of $x$ in $R$. Consider the short exact sequence of complexes
$$
\xymatrix{
0 \ar[d] \ar[r] &
R \ar[d]^\epsilon \ar[r]_1 &
R \ar[d] \\
R \ar[r]^1 & R \ar[r] & 0
}
$$
Here the columns are the complexes, the first row is placed in degree $0$, and
the second row in degree $1$. Denote the first complex (i.e., the
left column) by $A^\bullet$, the second by $B^\bullet$ and the third
$C^\bullet$. We claim that the diagram
\begin{equation}
\label{equation-commutes-up-to-homotopy}
\vcenter{
\xymatrix{
A^\bullet \ar[d]_{1 + \epsilon} \ar[r] &
B^\bullet \ar[r] \ar[d]_1 &
C^\bullet \ar[d]_1 \\
A^\bullet \ar[r] & B^\bullet \ar[r] & C^\bullet
}
}
\end{equation}
commutes in $K(R)$, i.e., is a diagram of complexes commuting up to homotopy.
Namely, the square on the right commutes and the one on the left is off by
the homotopy $1 : A^1 \to B^0$. On the other hand,
$$
\text{Tr}_{A^\bullet}(1 + \epsilon) + \text{Tr}_{C^\bullet}(1)
\not = \text{Tr}_{B^\bullet}(1).
$$

\begin{lemma}
\label{lemma-nonadditivity-of-trace}
There exists a ring $R$, a distinguished triangle
$(K, L, M, \alpha, \beta, \gamma)$ in the homotopy category $K(R)$,
and an endomorphism $(a, b, c)$ of this distinguished triangle, such that
$K$, $L$, $M$ are perfect complexes and
$\text{Tr}_K(a) + \text{Tr}_M(c) \not = \text{Tr}_L(b)$.
\end{lemma}

\begin{proof}
Consider the example above. The map $\gamma : C^\bullet \to A^\bullet[1]$
is given by multiplication by $\epsilon$ in degree $0$, see
Derived Categories, Definition \ref{derived-definition-distinguished-triangle}.
Hence it is also true that
$$
\xymatrix{
C^\bullet \ar[d] \ar[r]_\gamma & A^\bullet[1] \ar[d] \\
C^\bullet \ar[r]^\gamma & A^\bullet[1]
}
$$
commutes in $K(R)$ as $\epsilon(1 + \epsilon) = \epsilon$.
Thus we indeed have a morphism of distinguished triangles.
\end{proof}






\section{Being projective is not local on the base}
\label{section-non-descending-property-projective}

\noindent
In the chapter on descent we have seen that many properties of morphisms
are local on the base, even in the fpqc topology. See
Descent, Sections \ref{descent-section-descending-properties-morphisms},
\ref{descent-section-descending-properties-morphisms-fpqc}, and
\ref{descent-section-descending-properties-morphisms-fppf}.
This is not true for projectivity of morphisms.

\begin{lemma}
\label{lemma-non-descending-property-projective}
The properties
\begin{enumerate}
\item[] $\mathcal{P}(f) =$``$f$ is projective'', and
\item[] $\mathcal{P}(f) =$``$f$ is quasi-projective''
\end{enumerate}
are not Zariski local on the base. A fortiori, they are not fpqc local
on the base.
\end{lemma}

\begin{proof}
Following Hironaka \cite[Example B.3.4.1]{H},
we define a proper morphism of smooth complex 3-folds
$f:V_Y\to Y$
which is Zariski-locally projective, but not projective. Since $f$ is proper
and not projective, it is also not quasi-projective.

\medskip\noindent
Let $Y$ be projective 3-space over the complex numbers ${\mathbf C}$.
Let $C$ and $D$ be smooth conics in $Y$ such
that the closed subscheme $C\cap D$ is reduced and consists
of two complex points $P$ and $Q$. (For example,
let $C=\{ [x,y,z,w]: xy=z^2, w=0\}$, $D=\{ [x,y,z,w]:
xy=w^2, z=0\}$, $P=[1,0,0,0]$,
and $Q=[0,1,0,0]$.) 
On $Y-Q$, first blow up the curve $C$, and then blow
up the strict transform of the curve $D$ (Divisors, Definition 
\ref{divisors-definition-strict-transform}). On $Y-P$, first blow up
the curve $D$, and then blow up the strict transform of the curve
$C$. Over $Y-P-Q$, the two varieties we have constructed are canonically
isomorphic, and so we can glue them over $Y-P-Q$. The result
is a smooth proper 3-fold $V_Y$ over ${\mathbf C}$. The morphism
$f:V_Y\to Y$ is proper and Zariski-locally projective (since
it is a blowup over $Y-P$ and over $Y-Q$), by Divisors,
Lemma \ref{divisors-lemma-blowing-up-projective}. We will show that
$V_Y$ is not projective over ${\mathbf C}$. That will imply that
$f$ is not projective.

\medskip\noindent
To do this, let $L$ be the inverse image in $V_Y$ of a complex point
of $C-P-Q$, and $M$ the inverse image of a complex point of $D-P-Q$.
Then $L$ and $M$ are isomorphic to the projective line
${\mathbf P}^1_{{\mathbf C}}$. 
Next, let $E$ be the inverse image in $V_Y$ of $C\cup D\subset Y$ in $V_Y$;
thus $E\rightarrow C\cup D$ is a proper morphism, with fibers
isomorphic to ${\mathbf P}^1$ over $(C\cup D)-\{P,Q\}$.
The inverse
image of $P$ in $E$ is a union of two lines $L_0$ and $M_0$, and we have
rational equivalences of cycles $L\sim L_0+M_0$ and $M\sim M_0$ on $E$
(using that $C$ and $D$ are isomorphic to ${\mathbf P}^1$).
Note the asymmetry resulting from the order in which we blew
up the two curves. Near $Q$, the opposite happens. So the inverse image
of $Q$ is the union of two lines $L_0'$ and $M_0'$, and we have
rational equivalences $L\sim L_0'$ and $M\sim L_0'+M_0'$ on $E$.
Combining these equivalences, we find that $L_0+M_0'\sim 0$
on $E$ and hence on $V_Y$. If $V_Y$ were projective over ${\mathbf C}$,
it would have
an ample line bundle $H$, which would have degree $> 0$ on all curves
in $V_Y$. In particular $H$ would have positive degree on $L_0+M_0'$,
contradicting that the degree of a line bundle is well-defined
on 1-cycles modulo rational equivalence on a proper scheme
over a field (Chow Homology,
Lemma \ref{chow-lemma-proper-pushforward-rational-equivalence}
and Lemma \ref{chow-lemma-factors}).
So $V_Y$ is not projective over ${\mathbf C}$.
\end{proof}

\noindent
In different terminology, Hironaka's 3-fold $V_Y$ is a small
resolution of the blowup $Y'$ of $Y$ along the reduced subscheme
$C\cup D$; here $Y'$ has two node singularities. If we define $Z$ by blowing
up $Y$ along $C$ and then along the strict transform
of $D$, then $Z$ is a smooth projective 3-fold, and the non-projective
3-fold $V_Y$ differs from $Z$ by a ``flop'' over $Y-P$.


\section{Non-effective descent data for projective schemes}
\label{section-non-effective-descent-projective}

\noindent
In the chapter on descent we have seen that descent data for schemes relative
to an fpqc morphism are effective for several classes
of morphisms. In particular, affine morphisms and more generally
quasi-affine morphisms satisfy descent for fpqc coverings
(Descent, Lemma \ref{descent-lemma-quasi-affine}).
This is not true for projective morphisms.

\begin{lemma}
\label{lemma-non-effective-descent-projective}
There is an etale covering $X\to S$ of schemes and a descent datum
$(V/X,\varphi)$ relative to $X\to S$ such that 
$V\to X$ is projective,
but the descent datum is not effective in the category of schemes.
\end{lemma}

\begin{proof}
We imitate Hironaka's example of a smooth separated complex
algebraic space of dimension 3
which is not a scheme \cite[Example B.3.4.2]{H}.

\medskip\noindent
Consider the action of the group $G = \mathbf{Z}/2 = \{1, g\}$
on projective 3-space
$\mathbf{P}^3$ over the complex numbers by
$$
g[x,y,z,w] = [y,x,w,z].
$$
The action is free outside the two disjoint lines
$L_1=\{ [x,x,z,z]\}$ and $L_2=\{ [x,-x,z,-z]\}$ in
${\mathbf P}^3$. Let $Y={\mathbf P}^3-(L_1\cup L_2)$. There is a
smooth quasi-projective scheme $S=Y/G$ over ${\mathbf C}$ such that
$Y\to S$ is a $G$-torsor (Groupoids,
Definition \ref{groupoids-definition-principal-homogeneous-space}).
Explicitly, we can define $S$ as the image of the open subset $Y$
in ${\mathbf P}^3$ under the morphism
\begin{align*}
{\mathbf P}^3 & \to \text{Proj } {\mathbf C}[x,y,z,w]^G\\
   & = \text{Proj } {\mathbf C}[u_0,u_1,v_0,v_1,v_2]/(v_0v_1=v_2^2),
\end{align*}
where $u_0=x+y$, $u_1=z+w$, $v_0=(x-y)^2$, $v_1=(z-w)^2$,
and $v_2=(x-y)(z-w)$, and the ring is graded with $u_0,u_1$
in degree 1 and $v_0,v_1,v_2$ in degree 2.

\medskip\noindent
Let $C=\{ [x,y,z,w]: xy=z^2, w=0\}$ and $D=\{ [x,y,z,w]:
xy=w^2, z=0\}$. These are smooth conic curves in ${\mathbf P}^3$, contained
in the $G$-invariant open subset $Y$, with $g(C)=D$. Also,
$C\cap D$ consists of the two points $P:=[1,0,0,0]$
and $Q:=[0,1,0,0]$, and these two points are switched by the action
of $G$. 

\medskip\noindent
Let $V_Y\to Y$ be the scheme which over $Y-P$
is defined by blowing up $D$ and then the strict transform
of $C$, and over $Y-Q$ is defined by blowing up $C$ and then
the strict transform of $D$. (This is the same construction
as in the proof of Lemma \ref{lemma-non-descending-property-projective},
except that $Y$ here denotes an open subset of ${\mathbf P}^3$
rather than all of ${\mathbf P}^3$.)
Then the action of $G$ on $Y$ lifts to an action of $G$ on $V_Y$,
which switches the inverse images of $Y-P$ and $Y-Q$. This action
of $G$ on $V_Y$ gives a descent datum $(V_Y/Y,\varphi_Y)$
on $V_Y$ relative to the $G$-torsor
$Y\to S$. The morphism $V_Y\to Y$
is proper but not projective, as shown in the proof
of Lemma \ref{lemma-non-descending-property-projective}.

\medskip\noindent
Let $X$ be the disjoint union of the open subsets $Y-P$ and $Y-Q$;
then we have surjective etale morphisms $X\to Y\to S$.
Let $V$ be the pullback of $V_Y\to Y$ to $X$; then the morphism
$V\to X$ is projective, since $V_Y\to Y$ is a blowup over each of the open
subsets $Y-P$ and $Y-Q$. Moreover, the descent datum $(V_Y/Y,\varphi_Y)$
pulls back to a descent datum $(V/X,\varphi)$ relative to the
etale covering $X\to S$.

\medskip\noindent
Suppose that this descent datum is effective in the category
of schemes. That is, there is a scheme $U\to S$
which pulls back to the morphism $V\to X$ together
with its descent datum. Then $U$ would be the quotient
of $V_Y$ by its $G$-action.
$$
\xymatrix{
V \ar[r]\ar[d]&  X\ar[d] \\
V_Y \ar[r]\ar[d]& Y\ar[d] \\
U \ar[r]& S
}
$$

\medskip\noindent
Let $E$ be the inverse image of $C\cup D\subset Y$ in $V_Y$;
thus $E\rightarrow C\cup D$ is a proper morphism, with fibers
isomorphic to ${\mathbf P}^1$ over $(C\cup D)-\{P,Q\}$.
The inverse image of $P$ in $E$ is a union of two lines $L_0$
and $M_0$. It follows that the inverse image of $Q=g(P)$ in $E$
is the union of two lines $L_0'=g(M_0)$ and $M_0'=g(L_0)$.
As shown in the proof
of Lemma \ref{lemma-non-descending-property-projective},
we have a rational equivalence $L_0+M_0'=L_0+g(L_0)\sim 0$ on $E$.

\medskip\noindent
By descent of closed subschemes, there is a curve $L_1\subset U$
(isomorphic to ${\mathbf P}^1$)
whose inverse image in $V_Y$ is $L_0\cup g(L_0)$. (Use Descent, Lemma
\ref{descent-lemma-affine}, noting that a closed immersion is an affine
morphism.)
Let $R$ be a complex point of $L_1$. Since
we assumed that $U$ is a scheme, we can choose a function
$f$ in the local ring $O_{U,R}$ that vanishes at $R$ but not
on the whole curve $L_1$. Let $D_{\text{loc}}$ be an irreducible component
of the closed subset $\{f = 0\}$ in $\Spec O_{U,R}$; then
$D_{\text{loc}}$ has codimension 1.
The closure of $D_{\text{loc}}$ in $U$ is an irreducible divisor $D_U$
in $U$ which contains the point $R$ but not the whole curve $L_1$.
The inverse image of $D_U$ in $V_Y$ is an effective divisor $D$
which intersects $L_0\cup g(L_0)$ but does not contain either
curve $L_0$ or $g(L_0)$.

\medskip\noindent
Since the complex 3-fold $V_Y$ is smooth, $O(D)$ is a line
bundle on $V_Y$. We use here that a regular local ring is factorial,
or in other words is a UFD, see
More on Algebra, Lemma \ref{more-algebra-lemma-regular-local-UFD}.
The restriction of $O(D)$ to the proper surface
$E\subset V_Y$ is a line bundle which has positive degree on the 1-cycle
$L_0+g(L_0)$, by our information on $D$. Since
$L_0+g(L_0)\sim 0$ on $E$, this contradicts 
that the degree of a line bundle is well-defined
on 1-cycles modulo rational equivalence on a proper scheme
over a field (Chow Homology,
Lemma \ref{chow-lemma-proper-pushforward-rational-equivalence}
and Lemma \ref{chow-lemma-factors}). Therefore the descent datum
$(V/X,\varphi)$ is in fact not effective; that is, $U$ does not exist
as a scheme.
\end{proof}

\noindent
In this example, the descent datum {\it is }effective in the category
of algebraic spaces. More precisely,
$U$ exists as a smooth separated algebraic space
of dimension 3 over ${\mathbf C}$,
for example by Algebraic Spaces, Lemma \ref{spaces-lemma-quotient}.
Hironaka's 3-fold $U$ is a small resolution of the blowup $S'$
of the smooth quasi-projective 3-fold $S$ along the irreducible nodal curve
$(C\cup D)/G$; the 3-fold $S'$ has a node singularity. The
other small resolution of $S'$ (differing from $U$ by a ``flop'')
is again an algebraic space which is not a scheme.






\section{A family of curves whose total space is not a scheme}
\label{section-family-of-curves}

\noindent
In Quot, Section \ref{quot-section-curves} we define a family of curves over
a scheme $S$ to be a proper, flat, finitely presented morphism
of relative dimension $\leq 1$ from an algebraic space $X$ to $S$.
If $S$ is the spectrum of a complete Noetherian local ring, then
$X$ is a scheme, see
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-projective-over-complete}.
In this section we show this is not true in general.

\medskip\noindent
Let $k$ be a field. We start with a proper flat morphism
$$
Y \longrightarrow \mathbf{A}^1_k
$$
and a point $y \in Y(k)$ lying over $0 \in \mathbf{A}^1_k(k)$
with the following properties
\begin{enumerate}
\item the fibre $Y_0$ is a smooth geometrically irreducible curve over $k$,
\item for any proper closed subscheme $T \subset Y$ dominating
$\mathbf{A}^1_k$ the intersection $T \cap Y_0$ contains at least one point
distinct from $y$.
\end{enumerate}
Given such a surface we construct our example as follows.
$$
\xymatrix{
Y \ar[rd] & Z \ar[d] \ar[l] \ar[r] & X \ar[ld] \\
& \mathbf{A}^1_k
}
$$
Here $Z \to Y$ is the blowup of $Y$ in $y$. Let $E \subset Z$ be the
exceptional divisor and let $C \subset Z$ be the strict transform of $Y_0$.
We have $Z_0 = E \cup C$ scheme theoretically (to see this use that
$Y$ is smooth at $y$ and moreover $Y \to \mathbf{A}^1_k$ is smooth at $y$).
By Artin's results (\cite{ArtinII}; use
Semistable Reduction, Lemma \ref{models-lemma-properties-form}
to see that the normal bundle of $C$ is negative)
we can blow down the curve $C$ in $Z$ to obtain an algebraic space $X$
as in the diagram. Let $x \in X(k)$ be the image of $C$.

\medskip\noindent
We claim that $X$ is not a scheme. Namely, if it were a scheme,
then there would be an affine open neighbourhood $U \subset X$ of $x$.
Set $T = X \setminus U$. Then $T$ dominates $\mathbf{A}^1_k$
(as the fibres of $X \to \mathbf{A}^1_k$ are proper of dimension $1$
and the fibres of $U \to \mathbf{A}^1_k$ are affine hence different).
Let $T' \subset Z$ be the closed subscheme mapping isomorphically
to $T$ (as $x \not \in T$). Then the image of $T'$ in $X$
contradicts condition (2) above (as $T' \cap Z_0$ is contained in
the exceptional divisor $E$ of the blowing up $Z \to Y$).

\medskip\noindent
To finish the discussion we need to construct our $Y$.
We will assume the characteristic of $k$ is not $3$.
Write $\mathbf{A}^1_k = \Spec(k[t])$ and take
$$
Y \quad : \quad T_0^3 + T_1^3 + T_2^3 - tT_0T_1T_2 = 0
$$
in $\mathbf{P}^2_{k[t]}$. The fibre of this for $t = 0$
is a smooth projective genus $1$ curve. On the affine piece
$V_+(T_0)$ we get the affine equation
$$
1 + x^3 + y^3 - txy = 0
$$
which defines a smooth surface over $k$. Since the same is true on the other
affine pieces by symmetry we see that $Y$ is a smooth surface.
Finally, we see from the affine equation also that the fraction
field is $k(x, y)$ hence $Y$ is a rational surface.
Now the Picard group of a rational surface is finitely generated
(insert future reference here).
Hence in order to choose $y \in Y_0(k)$ with property (2)
it suffices to choose $y$ such that
\begin{equation}
\label{equation-three}
\mathcal{O}_{Y_0}(ny) \not \in \Im(\Pic(Y) \to \Pic(Y_0))
\text{ for all }n > 0
\end{equation}
Namely, the sum of the $1$-dimensional irreducible components of a $T$
contradicting (2) would give an effective Cartier divisor intersection $Y_0$
in the divisor $ny$ for some $n \geq 1$ and we would conclude
that $\mathcal{O}_{Y_0}(ny)$ is in the image of the restriction map.
Observe that since $Y_0$ has genus $\geq 1$ the map
$$
Y_0(k) \to \Pic(Y_0),\quad y \mapsto \mathcal{O}_{Y_0}(y)
$$
is injective. Now if $k$ is an uncountable algebraically closed field,
then using the countability of $\Pic(Y)$ and the remark
just made, we can find a $y \in Y_0(k)$ satisfying (\ref{equation-three})
and hence (2).

\begin{lemma}
\label{lemma-family-of-curves-not-scheme}
There exists a field $k$ and a family of curves
$X \to \mathbf{A}^1_k$ such that $X$ is not a scheme.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}






\section{Derived base change}
\label{section-derived-base-change}

\noindent
Let $R \to R'$ be a ring map. In
More on Algebra, Section \ref{more-algebra-section-derived-base-change}
we construct a derived base change functor
$- \otimes_R^\mathbf{L} R' : D(R) \to D(R')$.
Next, let $R \to A$ be a second ring map. Picture
$$
\xymatrix{
	A \ar[r] & A \otimes_R R' \ar@{=}[r] & A' \\
R \ar[u] \ar[r] & R' \ar[u] \ar[ur]
}
$$
Given an $A$-module $M$ the tensor product $M \otimes_R R'$ is a
$A \otimes_R R'$-module, i.e., an $A'$-module. For the ring
map $A \to A'$ there is a derived functor
$$
- \otimes_A^\mathbf{L} A' : D(A) \longrightarrow D(A')
$$
but this functor does not agree with $- \otimes_R^\mathbf{L} R'$
in general. More precisely, for $K \in D(A)$ the canonical map
$$
K \otimes_R^{\mathbf{L}} R' \longrightarrow
K \otimes_A^{\mathbf{L}} A'
$$
in $D(R')$ constructed in
More on Algebra, Equation (\ref{more-algebra-equation-comparison-map})
isn't an isomorphism in general. Thus one may wonder if there exists a
``derived base change functor'' $T : D(A) \to D(A')$, i.e., a functor
such that $T(K)$ maps to $K \otimes_R^\mathbf{L} R'$ in $D(R')$.
In this section we show it does not exist in general.

\medskip\noindent
Let $k$ be a field. Set $R = k[x, y]$. Set $R' = R/(xy)$ and $A = R/(x^2)$.
The object $A \otimes_R^\mathbf{L} R'$ in $D(R')$ is represented by
$$
x^2 : R' \longrightarrow R'
$$
and we have $H^0(A \otimes_R^\mathbf{L} R') = A \otimes_R R'$. We claim that
there does not exist an object $E$ of $D(A \otimes_R R')$ mapping to
$A \otimes_R^\mathbf{L} R'$ in $D(R')$. Namely, for such an $E$ the module
$H^0(E)$ would be free, hence $E$ would decompose as
$H^0(E)[0] \oplus H^{-1}(E)[1]$. But it is easy to see that
$A \otimes_R^\mathbf{L} R'$ is not isomorphic to the sum of its
cohomology groups in $D(R')$.

\begin{lemma}
\label{lemma-no-derived-base-change}
Let $R \to R'$ and $R \to A$ be ring maps. In general there does not
exist a functor $T : D(A) \to D(A \otimes_R R')$
of triangulated categories such that an $A$-module $M$ gives an
object $T(M)$ of $D(A \otimes_R R')$ which maps to
$M \otimes_R^\mathbf{L} R'$ under the map $D(A \otimes_R R') \to D(R')$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}




\section{An interesting compact object}
\label{section-interesting-compact}


\noindent
Let $R$ be a ring. Let $(A, \text{d})$ be a differential graded $R$-algebra.
If $A = R$, then we know that every compact object of $D(A, \text{d}) = D(R)$
is represented by a finite complex of finite projective modules. In other
words, compact objects are perfect, see
More on Algebra, Proposition \ref{more-algebra-proposition-perfect-is-compact}.
The analogue in the language of differential graded modules would
be the question: ``Is every compact object of $D(A, \text{d})$ represented
by a differential graded $A$-module $P$ which is finite and
graded projective?''

\medskip\noindent
For general differential graded algebras, this is not true. Namely,
let $k$ be a field of characteristic $2$
(so we don't have to worry about signs).
Let $A = k[x, y]/(y^2)$
with
\begin{enumerate}
\item $x$ of degree $0$
\item $y$ of degree $-1$,
\item $\text{d}(x) = 0$, and
\item $\text{d}(y) = x^2 + x$.
\end{enumerate}
Then $x : A \to A$ is a projector in $K(A, \text{d})$.
Hence we see that
$$
A = \Ker(x) \oplus \Im(1 - x)
$$
in $K(A, \text{d})$, see
Differential Graded Algebra, Lemma \ref{dga-lemma-homotopy-direct-sums} and
Derived Categories, Lemma
\ref{derived-lemma-projectors-have-images-triangulated}.
It is clear that $A$ is a compact object of $D(A, \text{d})$.
Then $\Ker(x)$ is a compact object of $D(A, \text{d})$
as follows from
Derived Categories, Lemma \ref{derived-lemma-compact-objects-subcategory}.

\medskip\noindent
Next, suppose that $M$ is a differential graded (right) $A$-module
representing $\Ker(x)$ and suppose that $M$ is finite and
projective as a graded $A$-module. Because every finite graded projective
module over $k[x, y]/(y^2)$ is graded free, we see that $M$ is
finite free as a graded $k[x, y]/(y^2)$-module (i.e., when we forget
the differential). We set $N = M/M(x^2 + x)$.
Consider the exact sequence
$$
0 \to M \xrightarrow{x^2 + x} M \to N \to 0
$$
Since $x^2 + x$ is of degree $0$, in the center of $A$, and
$\text{d}(x^2 + x) = 0$ we see that this is a short exact sequence
of differential graded $A$-modules. Moreover, as $\text{d}(y) = x^2 + x$
we see that the differential on $N$ is linear. The maps
$$
H^{-1}(N) \to H^0(M)
\quad\text{and}\quad
H^0(M) \to H^0(N)
$$
are isomorphisms as $H^*(M) = H^0(M) = k$ since $M \cong \Ker(x)$
in $D(A, \text{d})$. A computation of the boundary map shows that
$H^*(N) = k[x, y]/(x, y^2)$ as a graded module; we omit
the details. Since $N$ is a free $k[x, y]/(y^2, x^2 + x)$-module
we have a resolution
$$
\ldots \to N[2] \xrightarrow{y} N[1] \xrightarrow{y} N \to N/Ny \to 0
$$
compatible with differentials. Since $N$ is bounded and since
$H^0(N) = k[x,y]/(x, y^2)$ it follows from
Homology, Lemma \ref{homology-lemma-first-quadrant-ss}
that $H^0(N/Ny) = k[x]/(x)$. But as $N/Ny$ is a finite complex of free
$k[x]/(x^2 + x) = k \times k$-modules, we see that its cohomology
has to have even dimension, a contradiction.

\begin{lemma}
\label{lemma-no-good-representatif-compact-object}
There exists a differential graded algebra $(A, \text{d})$ and
a compact object $E$ of $D(A, \text{d})$ such that $E$ cannot
be represented by a finite and graded projective differential
graded $A$-module.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}







\section{Two differential graded categories}
\label{section-nongraded-differential-graded}

\noindent
In this section we construct two differential graded categories satisfying
axioms (A), (B), and (C) as in
Differential Graded Algebra, Situation \ref{dga-situation-ABC}
whose objects do not come with a $\mathbf{Z}$-grading.

\medskip\noindent
{\bf Example I.} Let $X$ be a topological space. Denote
$\underline{\mathbf{Z}}$ the constant sheaf with value $\mathbf{Z}$.
Let $A$ be an $\underline{\mathbf{Z}}$-torsor. In this setting we say
a sheaf of abelian groups $\mathcal{F}$ is {\it $A$-graded} if given a
local section $a \in A(U)$ there is a projector
$p_a : \mathcal{F}|_U \to \mathcal{F}|_U$ such that
whenever we have a local isomorphism $\underline{\mathbf{Z}}|_U \to A|_U$
then $\mathcal{F}|_U = \bigoplus_{n \in \mathbf{Z}} p_n(\mathcal{F})$.
Another way to say this is that locally on $X$ the abelian sheaf
$\mathcal{F}$ has a $\mathbf{Z}$-grading, but on overlaps the different
choices of gradings differ by a shift in degree given by the transition
functions for the torsor $A$.
We say that a pair $(\mathcal{F}, \text{d})$ is an
{\it $A$-graded complex of abelian sheaves}, if $\mathcal{F}$
is an $A$-graded abelian sheaf and $\text{d} : \mathcal{F} \to \mathcal{F}$
is a differential, i.e., $\text{d}^2 = 0$ such that
$p_{a + 1} \circ \text{d} = \text{d} \circ p_a$ for every local
section $a$ of $A$. In other words, $\text{d}(p_a(\mathcal{F}))$
is contained in $p_{a + 1}(\mathcal{F})$.

\medskip\noindent
Next, consider the category $\mathcal{A}$ with
\begin{enumerate}
\item objects are $A$-graded complexes of abelian sheaves, and
\item for objects $(\mathcal{F}, \text{d})$, $(\mathcal{G}, \text{d})$ we set
$$
\Hom_\mathcal{A}((\mathcal{F}, \text{d}), (\mathcal{G}, \text{d})) =
\bigoplus \Hom^n(\mathcal{F}, \mathcal{G})
$$
where $\Hom^n(\mathcal{F}, \mathcal{G})$ is the group of
maps of abelian sheaves $f$ such that
$f(p_a(\mathcal{F})) \subset p_{a + n}(\mathcal{G})$ for all
local sections $a$ of $A$. As differential we take
$\text{d}(f) = \text{d} \circ f - (-1)^n f \circ \text{d}$, see
Differential Graded Algebra, Example \ref{dga-example-category-complexes}.
\end{enumerate}
We omit the verification that this is indeed a differential graded category
satisfying (A), (B), and (C). All the properties may be verified locally on
$X$ where one just recovers the differential graded category of complexes
of abelian sheaves. Thus we obtain a triangulated category
$K(\mathcal{A})$.

\medskip\noindent
Twisted derived category of $X$. Observe that given an object
$(\mathcal{F}, \text{d})$ of $\mathcal{A}$, there is a well defined
$A$-graded cohomology sheaf $H(\mathcal{F}, \text{d})$.
Hence it is clear what is meant by a quasi-isomorphism
in $K(\mathcal{A})$. We can invert quasi-isomorphisms
to obtain the {\it derived category $D(\mathcal{A})$ of complexes of
$A$-graded sheaves}. If $A$ is the trivial torsor, then $D(\mathcal{A})$
is equal to $D(X)$, but for nonzero torsors, one obtains a kind of
{\it twisted} derived category of $X$.

\medskip\noindent
{\bf Example II.} Let $C$ be a smooth curve over a perfect field $k$ of
characteristic $2$. Then $\Omega_{C/k}$ comes endowed with a canonical
square root. Namely, we can write $\Omega_{C/k} = \mathcal{L}^{\otimes 2}$
such that for every local function $f$ on $C$ the section
$\text{d}(f)$ is equal to $s^{\otimes 2}$ for some local section
$s$ of $\mathcal{L}$. The ``reason'' is that
$$
\text{d}(a_0 + a_1t + \ldots +a_dt^d) =
(\sum\nolimits_{i\text{ odd}} a_i^{1/2} t^{(i - 1)/2})^2\text{d}t
$$
(insert future reference here). This in particular determines a
canonical connection
$$
\nabla_{can} :
\Omega_{C/k}
\longrightarrow
\Omega_{C/k} \otimes_{\mathcal{O}_C} \Omega_{C/k}
$$
whose $2$-curvature is zero (namely, the unique connection such that the
squares have derivative equal to zero).
Observe that the category of vector bundles
with connections is a tensor category, hence we also obtain canonical
connections $\nabla_{can}$ on the invertible sheaves
$\Omega_{C/k}^{\otimes n}$ for all $n \in \mathbf{Z}$.

\medskip\noindent
Let $\mathcal{A}$ be the category with
\begin{enumerate}
\item objects are pairs $(\mathcal{F}, \nabla)$ consisting of a
finite locally free sheaf $\mathcal{F}$ endowed with a connection
$$
\nabla :
\mathcal{F}
\longrightarrow
\mathcal{F} \otimes_{\mathcal{O}_C} \Omega_{C/k}
$$
whose $2$-curvature is zero, and
\item morphisms between $(\mathcal{F}, \nabla_\mathcal{F})$ and
$(\mathcal{G}, \nabla_\mathcal{G})$
are given by
$$
\Hom_\mathcal{A}((\mathcal{F}, \nabla_\mathcal{F}),
(\mathcal{G}, \nabla_\mathcal{G})) =
\bigoplus \Hom_{\mathcal{O}_C}(\mathcal{F},
\mathcal{G} \otimes_{\mathcal{O}_C} \Omega_{C/k}^{\otimes n})
$$
For an element
$f : \mathcal{F} \to \mathcal{G} \otimes \Omega_{C/k}^{\otimes n}$
of degree $n$ we set
$$
\text{d}(f) =
\nabla_{\mathcal{G} \otimes \Omega_{C/k}^{\otimes n}} \circ f +
f \circ \nabla_\mathcal{F}
$$
with suitable identifications.
\end{enumerate}
We omit the verification that this forms a differential graded
category with properties (A), (B), (C). Thus we obtain a triangulated
homotopy category $K(\mathcal{A})$.

\medskip\noindent
If $C = \mathbf{P}^1_k$, then $K(\mathcal{A})$ is the zero category.
However, if $C$ is a smooth proper curve of genus $> 1$, then
$K(\mathcal{A})$ is not zero. Namely, suppose that $\mathcal{N}$
is an invertible sheaf
of degree $0 \leq d < g - 1$ with a nonzero section $\sigma$.
Then set
$(\mathcal{F}, \nabla_\mathcal{F}) = (\mathcal{O}_C, \text{d})$
and
$(\mathcal{G}, \nabla_\mathcal{G}) = (\mathcal{N}^{\otimes 2}, \nabla_{can})$.
We see that
$$
\Hom_\mathcal{A}^n((\mathcal{F}, \nabla_\mathcal{F}),
(\mathcal{G}, \nabla_\mathcal{G})) =
\left\{
\begin{matrix}
0 & \text{if} & n < 0 \\
\Gamma(C, \mathcal{N}^{\otimes 2}) & \text{if} & n = 0 \\
\Gamma(C, \mathcal{N}^{\otimes 2} \otimes \Omega_{C/k}) & \text{if} & n = 1
\end{matrix}
\right.
$$
The first $0$ because the degree of
$\mathcal{N}^{\otimes 2} \otimes \Omega_{C/k}^{\otimes -1}$
is negative by the condition $d < g - 1$. Now, the section
$\sigma^{\otimes 2}$ has derivative equal zero, hence the homomorphism
group
$$
\Hom_{K(\mathcal{A})}((\mathcal{F}, \nabla_\mathcal{F}),
(\mathcal{G}, \nabla_\mathcal{G}))
$$
is nonzero.






\section{The stack of proper algebraic spaces is not algebraic}
\label{section-proper-spaces-not-algebraic}

\noindent
In Quot, Section \ref{quot-section-stack-of-spaces}
we introduced and studied the stack in groupoids
$$
p'_{fp, flat, proper} :
\Spacesstack'_{fp, flat, proper}
\longrightarrow
\Sch_{fppf}
$$
the stack whose category of sections over a scheme $S$
is the category of flat, proper, finitely presented algebraic
spaces over $S$. We proved that this satisfies many of
Artin's axioms. In this section we why this stack
is not algebraic by showing that formal effectiveness
fails in general.

\medskip\noindent
The canonical example uses that the universal deformation space of
an abelian variety of dimension $g$ has $g^2$ formal parameters
whereas any effective formal deformation can be defined over a
complete local ring of dimension $\leq g(g + 1)/2$.
Our example will be constructed by writing down a
suitable non-effective deformation of a K3 surface.
We will only sketch the argument and not give all the details.

\medskip\noindent
Let $k = \mathbf{C}$ be the field of complex numbers.
Let $X \subset \mathbf{P}^3_k$ be a smooth degree
$4$ surface over $k$. We have
$\omega_X \cong \Omega^2_{X/k} \cong \mathcal{O}_X$.
Finally, we have
$\dim_k H^0(X, T_{X/k}) = 0$,
$\dim_k H^1(X, T_{X/k}) = 20$, and
$\dim_k H^2(X, T_{X/k}) = 0$.
Since $L_{X/k} = \Omega_{X/k}$ because $X$ is smooth over $k$,
and since $\Ext^i_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) =
H^i(X, T_{X/k})$, and because we have Cotangent, Lemma
\ref{cotangent-lemma-find-obstruction-ringed-topoi}
we find that there is a universal deformation of $X$
over
$$
k[[x_1, \ldots, x_{20}]]
$$
Suppose that this universal deformation is effective
(as in Artin's Axioms, Section \ref{artin-section-formal-objects}).
Then we would get a flat, proper morphism
$$
f : Y \longrightarrow \Spec(k[[x_1, \ldots, x_{20}]])
$$
where $Y$ is an algebraic space recovering the universal deformation.
This is impossible for the following reason. Since $Y$ is separated
we can find an affine open subscheme $V \subset Y$. Since the special
fibre $X$ of $Y$ is smooth, we see that $f$ is smooth. Hence $Y$
is regular being smooth over regular and it follows
that the complement $D$ of $V$ in $Y$ is an effective Cartier divisor.
Then $\mathcal{O}_Y(D)$ is a nontrivial element of $\Pic(Y)$
(to prove this you show that the complement of a nonempty affine open in
a proper smooth algebraic space over a field is always a nontrivial
in the Picard group and you apply this to the generic fibre of $f$).
Finally, to get a contradiction, we show that $\Pic(Y) = 0$.
Namely, the map $\Pic(Y) \to \Pic(X)$ is injective,
because $H^1(X, \mathcal{O}_X) = 0$ (hence all deformations of
$\mathcal{O}_X$ to $Y \times \Spec(k[[x_i]]/\mathfrak m^n)$
are trivial) and Grothendieck's existence theorem
(which says that coherent modules giving rise to the
same sheaves on thickenings are isomorphic).
If $X$ is general enough, then $\Pic(X) = \mathbf{Z}$
generated by $\mathcal{O}_X(1)$. Hence it suffices to show that
$\mathcal{O}_X(n)$, $n > 0$ does not deform to the first
order neighbourhood\footnote{This argument works as long as
the map $c_1 : \Pic(X) \to H^1(X, \Omega_{X/k})$
is injective, which is true for $k$ any field of characteristic zero
and any smooth hypersurface $X$ of degree $4$ in $\mathbf{P}^3_k$.}.
Consider the cup-product
$$
H^1(X, \Omega_{X/k}) \times H^1(X, T_{X/k})
\longrightarrow H^2(X, \mathcal{O}_X)
$$
This is a nondegenerate pairing by coherent duality.
A computation shows that the Chern class
$c_1(\mathcal{O}_X(n)) \in H^1(X, \Omega_{X/k})$
in Hodge cohomology is nonzero.
Hence there is a first order deformation
whose cup product with $c_1(\mathcal{O}_X(n))$ is nonzero.
Then finally, one shows this cup product is the obstruction
class to lifting.

\begin{lemma}
\label{lemma-proper-spaces-not-algebraic}
The stack in groupoids
$$
p'_{fp, flat, proper} :
\Spacesstack'_{fp, flat, proper}
\longrightarrow
\Sch_{fppf}
$$
whose category of sections over a scheme $S$ is the category of
flat, proper, finitely presented algebraic spaces over $S$
(see Quot, Section \ref{quot-section-stack-of-spaces})
is not an algebraic stack.
\end{lemma}

\begin{proof}
If it was an algebraic stack, then every formal object would be
effective, see Artin's Axioms, Lemma \ref{artin-lemma-effective}.
The discussion above show this is not the case
after base change to $\Spec(\mathbf{C})$.
Hence the conclusion.
\end{proof}






\section{An example of a non-algebraic Hom-stack}
\label{section-non-algebraic-hom-stack}

\noindent
Let $\mathcal{Y}, \mathcal{Z}$ be algebraic stacks over a scheme $S$.
The {\it Hom-stack} $\underline{\Mor}_S(\mathcal{Y}, \mathcal{Z})$
is the stack in groupoids over $S$ whose category of sections over
a scheme $T$ is given by the category
$$
\Mor_T(\mathcal{Y} \times_S T, \mathcal{Z} \times_S T)
$$
whose objects are $1$-morphisms and whose morphisms are $2$-morphisms.
We omit the proof this is indeed a stack in groupoids over
$(\Sch/S)_{fppf}$ (insert future reference here). Of course, in
general the Hom-stack will not be algebraic. In this section we
give an example where it is not true and where $\mathcal{Y}$ is
representable by a proper flat scheme over $S$ and $\mathcal{Z}$
is smooth and proper over $S$.

\medskip\noindent
Let $k$ be an algebraically closed field which is not the algebraic
closure of a finite field. Let $S = \Spec(k[[t]])$
and $S_n = \Spec(k[t]/(t^n)) \subset S$. Let $f : X \to S$ be a map
satisfying the following
\begin{enumerate}
\item $f$ is projective and flat, and its fibres are geometrically
connected curves,
\item the fibre $X_0 = X \times_S S_0$ is a nodal curve with smooth
irreducible components whose dual graph has a loop consisting of
rational curves,
\item $X$ is a regular scheme.
\end{enumerate}
To make such a surface $X$ we can take for example
$$
X\quad :\quad T_0T_1T_2 - t(T_0^3 + T_1^3 + T_2^3) = 0
$$
in $\mathbf{P}^2_{k[[t]]}$. Let $A_0$ be a non-zero abelian variety over $k$
for example an elliptic curve.  Let $A = A_0 \times_{\Spec(k)} S$ be the
constant abelian scheme over $S$ associated to $A_0$. We will show that the
stack $\mathcal{X} = \underline{\Mor}_S(X, [S/A]))$ is not algebraic.

\medskip\noindent
Recall that $[S/A]$ is on the one hand the quotient stack of $A$ acting
trivially on $S$ and on
the other hand equal to the stack classifying fppf $A$-torsors, see
Examples of Stacks, Proposition
\ref{examples-stacks-proposition-equal-quotient-stacks}.
Observe that $[S/A] = [\Spec(k)/A_0] \times_{\Spec(k)} S$. This allows
us to describe the fibre category over a scheme $T$ as follows
\begin{align*}
\mathcal{X}_T
& =
\underline{\Mor}_S(X, [S/A])_T \\
& =
\Mor_T(X \times_S T, [S/A] \times_S T) \\
& =
\Mor_S(X \times_S T, [S/A]) \\
& =
\Mor_{\Spec(k)}(X \times_S T, [\Spec(k)/A_0])
\end{align*}
for any $S$-scheme $T$. In other words, the groupoid $\mathcal{X}_T$
is the groupoid of fppf $A_0$-torsors on $X \times_S T$.
Before we discuss why $\mathcal{X}$ is not an algebraic stack,
we need a few lemmas.

\begin{lemma}
\label{lemma-torsors-over-two-dimensional-regular}
Let $W$ be a two dimensional regular integral Noetherian scheme
with function field $K$. Let $G \to W$ be an abelian scheme.
Then the map $H^1_{fppf}(W, G) \to H^1_{fppf}(\Spec(K), G)$
is injective.
\end{lemma}

\begin{proof}[Sketch of proof]
Let $P \to W$ be an fppf $G$-torsor which is trivial in the generic point.
Then we have a morphism $\Spec(K) \to P$ over $W$ and we can take
its scheme theoretic image $Z \subset P$. Since $P \to W$ is proper
(as a torsor for a proper group algebraic space over $W$)
we see that $Z \to W$ is a proper birational morphism.
By Spaces over Fields, Lemma \ref{spaces-over-fields-lemma-finite-in-codim-1}
the morphism $Z \to W$ is finite away from finitely many closed points
of $W$. By (insert future reference on resolving indeterminacies
of morphisms by blowing quadratic transformations for surfaces)
the irreducible components of the geometric fibres of $Z \to W$
are rational curves. By
More on Groupoids in Spaces, Lemma
\ref{spaces-more-groupoids-lemma-no-nonconstant-morphism-from-P1-to-group}
there are no nonconstant morphisms from rational curves
to group schemes or torsors over such.
Hence $Z \to W$ is finite, whence $Z$ is a scheme and $Z \to W$
is an isomorphism by
Morphisms, Lemma \ref{morphisms-lemma-finite-birational-over-normal}.
In other words, the torsor $P$ is trivial.
\end{proof}

\begin{lemma}
\label{lemma-torsors-over-field-torsion}
Let $G$ be a smooth commutative group algebraic space over a field $K$.
Then $H^1_{fppf}(\Spec(K), G)$ is torsion.
\end{lemma}

\begin{proof}
Every $G$-torsor $P$ over $\Spec(K)$ is smooth over $K$ as a form of $G$.
Hence $P$ has a point over a finite separable extension $L/K$.
Say $[L : K] = n$. Let $[n](P)$ denote the $G$-torsor whose class is $n$
times the class of $P$ in $H^1_{fppf}(\Spec(K), G)$. There is a canonical
morphism
$$
P \times_{\Spec(K)} \ldots \times_{\Spec(K)} P \to [n](P)
$$
of algebraic spaces over $K$. This morphism is symmetric as
$G$ is abelian. Hence it factors through the quotient
$$
(P \times_{\Spec(K)} \ldots \times_{\Spec(K)} P)/S_n
$$
On the other hand, the morphism $\Spec(L) \to P$ defines a morphism
$$
(\Spec(L) \times_{\Spec(K)} \ldots \times_{\Spec(K)} \Spec(L))/S_n
\longrightarrow (P \times_{\Spec(K)} \ldots \times_{\Spec(K)} P)/S_n
$$
and the reader can verify that the scheme on the left has a $K$-rational
point. Thus we see that $[n](P)$ is the trivial torsor.
\end{proof}

\noindent
To prove $\mathcal{X} = \underline{\Mor}_S(X, [S/A])$
is not an algebraic stack, by
Artin's Axioms, Lemma \ref{artin-lemma-effective},
it is enough to show the following.

\begin{lemma}
\label{lemma-not-essentially-surjective}
The canonical map $\mathcal{X}(S) \to \lim \mathcal{X}(S_n)$
is not essentially surjective.
\end{lemma}

\begin{proof}[Sketch of proof]
Unwinding definitions, it is enough to check that
$H^1(X, A_0) \to \lim H^1(X_n, A_0)$ is not surjective.
As $X$ is regular and projective, by
Lemmas \ref{lemma-torsors-over-field-torsion} and
\ref{lemma-torsors-over-two-dimensional-regular}
each $A_0$-torsor over $X$ is torsion.
In particular, the group $H^1(X, A_0)$ is torsion.
It is thus enough to show:
(a) the group $H^1(X_0, A_0)$ is non-torsion, and
(b) the maps $H^1(X_{n + 1}, A_0) \to H^1(X_n, A_0)$ are surjective for all $n$.

\medskip\noindent
Ad (a). One constructs a nontorsion $A_0$-torsor $P_0$ on the nodal
curve $X_0$ by glueing trivial $A_0$-torsors on each component
of $X_0$ using non-torsion points on $A_0$ as the isomorphisms
over the nodes. More precisely, let $x \in X_0$ be a node
which occurs in a loop consisting of rational curves.
Let $X'_0 \to X_0$ be the normalization of $X_0$ in $X_0 \setminus \{x\}$.
Let $x', x'' \in X'_0$ be the two points mapping to $x_0$.
Then we take $A_0 \times_{\Spec(k)} X'_0$ and we identify
$A_0 \times {x'}$ with $A_0 \times \{x''\}$ using translation
$A_0 \to A_0$ by a nontorsion point $a_0 \in A_0(k)$ (there is such
a nontorsion point as $k$ is algebraically closed and not the algebraic
closure of a finite field -- this is actually not trivial to prove).
One can show that the glueing is an algebraic space (in fact one can
show it is a scheme) and that it is an nontorsion $A_0$-torsor over $X_0$.
The reason that it is nontorsion is that if $[n](P_0)$ has a section,
then that section produces a morphism $s : X'_0 \to A_0$ such that
$[n](a_0) = s(x') - s(x'')$ in the group law on $A_0(k)$. However,
since the irreducible components of the loop are rational to
section $s$ is constant on them (
More on Groupoids in Spaces, Lemma
\ref{spaces-more-groupoids-lemma-no-nonconstant-morphism-from-P1-to-group}).
Hence $s(x') = s(x'')$ and we obtain a contradiction.

\medskip\noindent
Ad (b). Deformation theory shows that the obstruction to deforming an
$A_0$-torsor $P_n \to X_n$ to an $A_0$-torsor $P_{n + 1} \to X_{n + 1}$
lies in $H^2(X_0, \omega)$ for a suitable vector bundle $\omega$ on $X_0$.
The latter vanishes as $X_0$ is a curve, proving the claim.
\end{proof}

\begin{proposition}
\label{proposition-nonalghomstack}
The stack $\mathcal{X} = \underline{\Mor}_S(X, [S/A])$ is not algebraic.
\end{proposition}

\begin{proof}
See discussion above.
\end{proof}

\begin{remark}
\label{remark-contradict-aoki}
Proposition \ref{proposition-nonalghomstack} contradicts
\cite[Theorem 1.1]{AokiHomStacks}. The problem is the non-effectivity
of formal objects for $\underline{\Mor}_S(X, [S/A])$. The same problem
is mentioned in the Erratum \cite{AokiHomStacksErr} to
\cite{AokiHomStacks}. Unfortunately, the Erratum goes on
to assert that $\underline{\Mor}_S(\mathcal{Y}, \mathcal{Z})$
is algebraic if $\mathcal{Z}$ is separated, which also contradicts
Proposition \ref{proposition-nonalghomstack} as $[S/A]$ is separated.
\end{remark}








\section{An algebraic stack not satisfying strong formal effectiveness}
\label{section-non-formal-effectiveness}

\noindent
This is \cite[Example 4.12]{Bhatt-Algebraize}.
Let $k$ be an algebraically closed field.
Let $A$ be an abelian variety over $k$.
Assume that $A(k)$ is not torsion (this always holds if $k$
is not the algebraic closure of a finite field).
Let $\mathcal{X} = [\Spec(k)/A]$.
We claim there exists an ideal $I \subset k[x, y]$
such that
$$
\mathcal{X}_{\Spec(k[x, y]^\wedge)}
\longrightarrow
\lim \mathcal{X}_{\Spec(k[x, y]/I^n)}
$$
is not essentially surjective. Namely, let $I$
be the ideal generated by $xy(x + y - 1)$.
Then $X_0 = V(I)$ consists of three copies of $\mathbf{A}^1_k$
glued into a triangle at three points. Hence we can make an infinite order
torsor $P_0$ for $A$ over $X_0$ by taking the trivial torsor
over the irreducible components of $X_0$ and glueing
using translation by nontorsion points.
Exactly as in the proof of Lemma \ref{lemma-not-essentially-surjective}
we can lift $P_0$ to a torsor $P_n$ over $X_n = \Spec(k[x, y]/I^n)$.
Since $k[x, y]^\wedge$ is a two dimensional regular domain
we see that any torsor $P$ for $A$ over $\Spec(k[x, y]^\wedge)$
is torsion (Lemmas \ref{lemma-torsors-over-two-dimensional-regular}
and \ref{lemma-torsors-over-field-torsion}). Hence the system of
torsors is not in the image of the displayed functor.

\begin{lemma}
\label{lemma-non-formal-effectiveness}
Let $k$ be an algebraically closed field which is not the closure
of a finite field. Let $A$ be an abelian variety over $k$.
Let $\mathcal{X} = [\Spec(k)/A]$.
There exists an inverse system of $k$-algebras $R_n$
with surjective transition maps whose kernels are locally nilpotent
and a system $(\xi_n)$ of $\mathcal{X}$ lying over the system
$(\Spec(R_n))$ such that this system is not effective
in the sense of Artin's Axioms, Remark \ref{artin-remark-strong-effectiveness}.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}








\section{A counter example to Grothendieck's existence theorem}
\label{section-Grothendieck-existence}

\noindent
Let $k$ be a field and let $A = k[[t]]$. Let $X$ be the glueing of
$U = \Spec(A[x])$ and $V = \Spec(A[y])$ by the identification
$$
U \setminus \{0_U\} \longrightarrow V \setminus \{0_V\}
$$
sending $x$ to $y$ where $0_U \in U$ and $O_V \in V$ are the points
corresponding to the maximal ideals $(x, t)$ and $(y, t)$. Set
$A_n = A/(t^n)$ and set $X_n = X \times_{\Spec(A)} \Spec(A_n)$.
Let $\mathcal{F}_n$ be the coherent sheaf on $X_n$
corresponding to the $A_n[x]$-module $A_n[x]/(x) \cong A_n$
and the $A_n[y]$ module $0$ with obvious glueing.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the sheaf of
ideals generate by $t$. Then $(\mathcal{F}_n)$ is an object of
the category $\textit{Coh}_{\text{support proper over } A}(X, \mathcal{I})$
defined in
Cohomology of Schemes, Section \ref{coherent-section-existence-proper-support}.
On the other hand, this object is not in the image of
the functor
Cohomology of Schemes,
Equation (\ref{coherent-equation-completion-functor-proper-over-A}).
Namely, if it where there would be a finite $A[x]$-module $M$,
a finite $A[y]$-module $N$ and an isomorphism $M[1/t] \cong N[1/t]$
such that $M/t^nM \cong A_n[x]/(x)$ and $N/t^nN = 0$ for all $n$.
It is easy to see that this is impossible.

\begin{lemma}
\label{lemma-counter-Grothendieck-existence}
Counter examples to algebraization of coherent sheaves.
\begin{enumerate}
\item Grothendieck's existence theorem as stated in
Cohomology of Schemes, Theorem \ref{coherent-theorem-grothendieck-existence}
is false if we drop the assumption that $X \to \Spec(A)$ is separated.
\item The stack of coherent sheaves $\Cohstack_{X/B}$
of Quot, Theorems \ref{quot-theorem-coherent-algebraic-general} and
\ref{quot-theorem-coherent-algebraic} is in general
not algebraic if we drop the assumption that $X \to S$ is separated
\item The functor $\Quotfunctor_{\mathcal{F}/X/B}$ of
Quot, Proposition \ref{quot-proposition-quot}
is not an algebraic space in general if we drop the assumption
that $X \to B$ is separated.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) we saw above. This shows that $\textit{Coh}_{X/A}$ fails
axiom [4] of Artin's Axioms, Section \ref{artin-section-axioms}. Hence it
cannot be an algebraic stack by Artin's Axioms, Lemma
\ref{artin-lemma-effective}.
In this way we see that (2) is true. To see (3), note that
there are compatible surjections $\mathcal{O}_{X_n} \to \mathcal{F}_n$
for all $n$. Thus we see that $\Quotfunctor_{\mathcal{O}_X/X/A}$
fails axiom [4] and we see that (3) is true as before.
\end{proof}






\section{Affine formal algebraic spaces}
\label{section-affine-formal-algebraic-space}

\noindent
Let $K$ be a field and let $(V_i)_{i \in I}$ be a directed inverse
system of nonzero vector spaces over $K$ with surjective transition maps and
with $\lim V_i = 0$, see Section \ref{section-zero-limit}.
Let $R_i = K \oplus V_i$ as $K$-algebra where $V_i$ is
an ideal of square zero. Then $R_i$ is an inverse system of
$K$-algebras with surjective transition maps with nilpotent kernels
and with $\lim R_i = K$. The affine formal
algebraic space $X = \colim \Spec(R_i)$ is an example of an affine
formal algebraic space which is not McQuillan.

\begin{lemma}
\label{lemma-affine-not-mcquillan}
There exists an affine formal algebraic space which is not McQuillan.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Let $0 \to W_i \to V_i \to K \to 0$ be a system of exact sequences
as in Section \ref{section-zero-limit}. Let
$A_i = K[V_i]/(ww'; w, w' \in W_i)$.
Then there is a compatible system of surjections $A_i \to K[t]$
with nilpotent kernels and
the transition maps $A_i \to A_j$ are surjective with nilpotent
kernels as well. Recall that $V_i$ is free over $K$ with
basis given by $s \in S_i$. Then, if the characteristic of $K$ is zero,
the degree $d$ part of $A_i$ is free over $K$ with basis given by
$s^d$, $s \in S_i$ each of which map to $t^d$. Hence the inverse system of
the degree $d$ parts of the $A_i$ is isomorphic to the inverse
system of the vector spaces $V_i$. As $\lim V_i = 0$ we conclude that
$\lim A_i = K$, at least when the characteristic of $K$ is zero.
This gives an example of an affine formal algebraic space
whose ``regular functions'' do not separate points.

\begin{lemma}
\label{lemma-affine-formal-functions-do-not-separate-points}
There exists an affine formal algebraic space $X$
whose regular functions do not separate points, in the following sense:
If we write $X = \colim X_\lambda$ as in
Formal Spaces, Definition
\ref{formal-spaces-definition-affine-formal-algebraic-space}
then $\lim \Gamma(X_\lambda, \mathcal{O}_{X_\lambda})$
is a field, but $X_{red}$ has infinitely many points.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Let $K$, $I$, and $(V_i)$ be as above. Consider systems
$$
\Phi = (\Lambda, J_i \subset \Lambda, (M_i) \to (V_i))
$$
where $\Lambda$ is an augmented $K$-algebra,
$J_i \subset \Lambda$ for $i \in I$ is an ideal of square zero,
$(M_i) \to (V_i)$ is a map of inverse systems of $K$-vector spaces
such that $M_i \to V_i$ is surjective for each $i$, such that
$M_i$ has a $\Lambda$-module structure, such that the transition maps
$M_i \to M_j$, $i > j$ are $\Lambda$-linear, and such that
$J_j M_i \subset \Ker(M_i \to M_j)$ for $i > j$.
Claim: There exists a system as above such that $M_j = M_i/J_j M_i$
for all $i > j$.

\medskip\noindent
If the claim is true, then we obtain a representable morphism
$$
\colim_{i \in I} \Spec(\Lambda/J_i \oplus M_i)
\longrightarrow
\text{Spf}(\lim \Lambda/J_i)
$$
of affine formal algebraic spaces whose source is not McQuillan
but the target is. Here $\Lambda/J_i \oplus M_i$ has the usual
$\Lambda/J_i$-algebra structure where $M_i$ is an ideal of square zero.
Representability translates exactly into the
condition that $M_i/J_jM_i = M_j$ for $i > j$. The source
of the morphism is not McQuillan as the projections
$\lim_{i \in I} M_i \to M_i$ are not be surjective. This is true
because the maps $\lim V_i \to V_i$ are not surjective
and we have the surjection $M_i \to V_i$. Some details omitted.

\medskip\noindent
Proof of the claim. First, note that there exists at least one
system, namely
$$
\Phi_0 = (K, J_i = (0), (V_i) \xrightarrow{\text{id}} (V_i))
$$
Given a system $\Phi$ we will prove there exists a morphism of systems
$\Phi \to \Phi'$ (morphisms of systems defined in the obvious manner)
such that $\Ker(M_i/J_j M_i \to M_j)$ maps to zero in
$M'_i/J'_j M'_i$. Once this is done we can do the usual trick
of setting $\Phi_n = (\Phi_{n - 1})'$ inductively for $n \geq 1$ and
taking $\Phi = \colim \Phi_n$ to get a system with the desired properties.
Details omitted.

\medskip\noindent
Construction of $\Phi'$ given $\Phi$. Consider the set $U$ of
triples $u = (i, j, \xi)$ where $i > j$ and $\xi \in \Ker(M_i \to M_j)$.
We will let $s, t : U \to I$ denote the maps $s(i, j, \xi) = i$
and $t(i, j, \xi) = j$. Then we set $\xi_u \in M_{s(u)}$ the third
component of $u$. We take
$$
\Lambda' = \Lambda[x_u; u \in U]/(x_u x_{u'}; u, u' \in U)
$$
with augmentation $\Lambda' \to K$ given by the augmentation of $\Lambda$
and sending $x_u$ to zero.
We take $J'_k = J_k \Lambda' + (x_{u,\ t(u) \geq k})$.
We set
$$
M'_i = M_i \oplus \bigoplus\nolimits_{s(u) \geq i} K\epsilon_{i, u}
$$
As transition maps $M'_i \to M'_j$ for $i > j$ we use
the given map $M_i \to M_j$ and we send $\epsilon_{i, u}$ to
$\epsilon_{j, u}$. The map $M'_i \to V_i$ induces the given map
$M_i \to V_i$ and sends $\epsilon_{i, u}$ to zero.
Finally, we let $\Lambda'$ act on $M'_i$ as follows:
for $\lambda \in \Lambda$ we act by the $\Lambda$-module
structure on $M_i$ and via the augmentation $\Lambda \to K$
on $\epsilon_{i, u}$. The element $x_u$ acts as $0$ on $M_i$
for all $i$. Finally, we define
$$
x_u \epsilon_{i, u} = \text{image of }\xi_u\text{ in }M_i
$$
and we set all other products $x_{u'} \epsilon_{i, u}$ equal to zero.
The displayed formula makes sense because $s(u) \geq i$ and
$\xi_u \in M_{s(u)}$. The main things the check are $J'_j M'_i \subset M'_i$
maps to zero in $M'_j$ for $i > j$ and that $\Ker(M_i \to M_j)$
maps to zero in $M'_i/J_j M'_i$. The reason for the last fact
is that $\xi = x_{(i, j, \xi)} \epsilon_{i, (i, j, \xi)} \in J'_j M'_i$
for any $\xi \in \Ker(M_i \to M_j)$.
We omit the details.

\begin{lemma}
\label{lemma-representable-morphism-affine-formal-not-mcquillan-top}
There exists a representable morphism $f : X \to Y$ of
affine formal algebraic spaces with $Y$ McQuillan, but $X$ not
McQuillan.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}









\section{Flat maps are not directed limits of finitely presented flat maps}
\label{section-flat-not-colimit-flat-finitely-presented}

\noindent
The goal of this section is to give an example of a flat ring map which
is not a filtered colimit of flat and finitely presented ring maps. In
\cite{gabber-nonexcellent} it is shown that if $A$ is a nonexcellent
local ring of dimension $1$ and residue characteristic zero, then the
(flat) ring map $A \to A^\wedge$ to its completion is not a filtered
colimit of finite type flat ring maps. The example in this section
will have a source which is an excellent ring. We encourage the reader
to submit other examples; please email
\href{mailto:stacks.project@gmail.com}{stacks.project@gmail.com}
if you have one.

\medskip\noindent
For the construction, fix a prime $p$, and let
$A = \mathbf{F}_p[x_1, \ldots, x_n]$.
Choose an absolute integral closure $A^+$ of $A$, i.e., $A^+$ is the
integral closure of $A$ in an algebraic closure of its fraction field.
In \cite[\S 6.7]{HHBigCM} it is shown that $A \to A^+$ is flat.

\medskip\noindent
We claim that the $A$-algebra $A^+$ is not a filtered colimit of finitely
presented flat $A$-algebras if $n \geq 3$.

\medskip\noindent
We sketch the argument in the case $n = 3$, and we leave the generalization to
higher $n$ to the reader. It is enough to prove the analogous statement for
the map $R \to R^+$, where $R$ is the strict henselization of $A$ at the
origin and $R^+$ is its absolute integral closure. Observe that $R$
is a henselian regular local ring whose residue field $k$ is an
algebraic closure of $\mathbf{F}_p$.

\medskip\noindent
Choose an ordinary abelian surface $X$ over $k$ and a very ample line bundle
$L$ on $X$. The section ring $\Gamma_*(X, L) = \bigoplus_n H^0(X,L^n)$ is
the coordinate ring of the affine cone over $X$ with respect to $L$. It is
a normal ring for $L$ sufficiently positive. Let $S$ denote the henselization
of $\Gamma_*(X, L)$ at vertex of the cone. Then $S$ is a henselian Noetherian
normal domain of dimension $3$. We obtain a finite injective
map $R \to S$ as the henselization of a Noether normalization
for the finite type $k$-algebra $\Gamma_*(X, L)$. As $R^+$ is an
absolute integral closure of $R$, we can also fix an embedding $S \to R^+$.
Thus $R^+$ is also the absolute integral closure of $S$. To show $R^+$
is not a filtered colimit of flat $R$-algebras, it suffices to show:
\begin{enumerate}
\item If there exists a factorization $S \to P \to R^+$ with $P$ flat
and finite type over $R$, then there exists a factorization
$S \to T \to R^+$ with $T$ finite flat over $R$.
\item For any factorization $S \to T \to R^+$ with $S \to T$ finite,
the ring $T$ is not $R$-flat.
\end{enumerate}
Indeed, since $S$ is finitely presented over $R$, if one could write
$R^+ = \colim_i P_i$ as a filtered colimit of finitely presented flat
$R$-algebras $P_i$, then $S \to R^+$ would factor as $S \to P_i \to R^+$
for $i \gg 0$, which contradicts the above pair of assertions.
Assertion (1) follows from the fact that $R$ is henselian and a
slicing argument, see More on Morphisms, Lemma
\ref{more-morphisms-lemma-qf-fp-flat-neighbourhood-dominates-fppf}.
Part (2) was proven in \cite{BhattSmallCMMod}; for the convenience of
the reader, we recall the argument.

\medskip\noindent
Let $U \subset \Spec(S)$ be the punctured spectrum, so there are natural
maps $X \leftarrow U \subset \Spec(S)$. The first map gives an
identification $H^1(U, \mathcal{O}_U) \simeq H^1(X, \mathcal{O}_X)$.
By passing to the Witt vectors of the perfection and using the
Artin-Schreier sequence\footnote{Here we use that $S$ is a strictly
henselian local ring of characteristic $p$ and hence
$S \to S$, $f \mapsto f^p - f$ is surjective.
Also $S$ is a normal domain and hence
$\Gamma(U, \mathcal{O}_U) = S$. Thus $H^1_\etale(U, \mathbf{Z}/p)$
is the kernel of the map $H^1(U, \mathcal{O}_U) \to H^1(U, \mathcal{O}_U)$
induced by $f \mapsto f^p - f$.}, this gives an identification
$H^1_\etale(U, \mathbf{Z}_p) \simeq H^1_\etale(X, \mathbf{Z}_p)$.
In particular, this group is a finite free $\mathbf{Z}_p$-module of
rank $2$ (since $X$ is ordinary). To get a contradiction assume
there exists an
$R$-flat $T$ as in (2) above. Let $V \subset \Spec(T)$ denote the preimage
of $U$, and write $f : V \to U$ for the induced finite surjective map.
Since $U$ is normal, there is a trace map $f_*\mathbf{Z}_p \to \mathbf{Z}_p$
on $U_\etale$ whose composition with the pullback
$\mathbf{Z}_p \to f_*\mathbf{Z}_p$ is multiplication by $d = \deg(f)$.
Passing to cohomology, and using that $H^1_\etale(U, \mathbf{Z}_p)$
is nontorsion, then shows that $H^1_\etale(V, \mathbf{Z}_p)$ is nonzero.
Since $H^1_\etale(V, \mathbf{Z}_p) \simeq \lim H^1_\etale(V, \mathbf{Z}/p^n)$
as there is no $R^1\lim$ interference, the group
$H^1(V_\etale,\mathbf{Z}/p)$ must be non-zero. Since $T$ is $R$-flat we
have $\Gamma(V, \mathcal{O}_V) = T$ which is strictly henselian and the
Artin-Schreier sequence shows $H^1(V, \mathcal{O}_V) \neq 0$.
This is equivalent to $H^2_\mathfrak m(T) \neq 0$, where
$\mathfrak m \subset R$ is the maximal ideal. Thus, we obtain
a contradiction since $T$ is finite flat (i.e., finite free) as an
$R$-module and $H^2_\mathfrak m(R) = 0$. This contradiction proves (2).

\begin{lemma}
\label{lemma-weird-flat-map}
There exists a commutative ring $A$ and a flat $A$-algebra $B$
which cannot be written as a filtered colimit of finitely
presented flat $A$-algebras. In fact, we may either choose $A$ to
be a finite type $\mathbf{F}_p$-algebra or a $1$-dimensional
Noetherian local ring with residue field of characteristic $0$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}




\section{The category of modules modulo torsion modules}
\label{section-serre-quotient-modulo-torsion-modules}

\noindent
The category of torsion groups is a Serre subcategory
(Homology, Definition \ref{homology-definition-serre-subcategory})
of the category of all abelian groups. More generally, for any ring $A$,
the category of torsion $A$-modules is a Serre subcategory of the
category of all $A$-modules, see
More on Algebra, Section \ref{more-algebra-section-abelian-categories-modules}.
If $A$ is a domain, then the quotient category
(Homology, Lemma \ref{homology-lemma-serre-subcategory-is-kernel})
is equivalent to the category of vector spaces over the fraction field.
This follows from the following more general proposition.

\begin{proposition}
\label{proposition-localization-and-serre-quotients}
Let $A$ be a ring. Let $S$ be a multiplicative subset of $A$.
Let $\text{Mod}_A$ denote the category of $A$-modules and $\mathcal{T}$ its
Serre subcategory of modules for which any element is annihilated by some
element of $S$. Then there is a canonical equivalence
$\text{Mod}_A/\mathcal{T} \rightarrow \text{Mod}_{S^{-1}A}$.
\end{proposition}

\begin{proof}
The functor $\text{Mod}_A \to \text{Mod}_{S^{-1}A}$ given by $M
\mapsto M \otimes_A S^{-1}A$ is exact (by Algebra, Proposition
\ref{algebra-proposition-localization-exact})
and maps modules in $\mathcal{T}$ to zero.
Thus, by the universal property given in Homology, Lemma
\ref{homology-lemma-serre-subcategory-is-kernel}, the functor descends to a
functor $\text{Mod}_A/\mathcal{T} \to \text{Mod}_{S^{-1}A}$.

\medskip\noindent
Conversely, any $A$-module $M$ with $M \otimes_A S^{-1}A = 0$
is an object of $\mathcal{T}$, since
$M \otimes_A S^{-1}A \cong S^{-1} M$
(Algebra, Lemma \ref{algebra-lemma-tensor-localization}). Thus
Homology, Lemma \ref{homology-lemma-quotient-by-kernel-exact-functor}
shows that the functor
$\text{Mod}_A/\mathcal{T} \to \text{Mod}_{S^{-1}A}$ is faithful.

\medskip\noindent
Furthermore, this embedding is essentially surjective: a preimage to an
$S^{-1}A$-module $N$ is $N_A$, that is $N$ regarded as an $A$-module, since the
canonical map $N_A \otimes_A S^{-1}A \to N$ which maps $x \otimes a/s$ to
$(a/s) \cdot x$ is an isomorphism of $S^{-1}A$-modules.
\end{proof}

\begin{proposition}
\label{proposition-quotient-by-torsion-modules}
Let $A$ be a ring. Let $Q(A)$ denote its total quotient ring
(as in Algebra, Example \ref{algebra-example-localize-at-prime}). Let
$\text{Mod}_A$ denote the category of $A$-modules and $\mathcal{T}$ its
Serre subcategory of torsion modules. Let $\text{Mod}_{Q(A)}$
denote the category
of $Q(A)$-modules. Then there is a canonical equivalence
$\text{Mod}_A/\mathcal{T} \rightarrow \text{Mod}_{Q(A)}$.
\end{proposition}

\begin{proof}
Follows immediately from applying Proposition
\ref{proposition-localization-and-serre-quotients} to the multiplicative subset
$S = \{f \in A \mid f \text{ is not a zerodivisor in }A\}$, since a module is a
torsion module if and only if all of its elements are each annihilated by some
element of $S$.
\end{proof}

\begin{proposition}
\label{proposition-quotient-by-finitely-generated-torsion-modules}
Let $A$ be a Noetherian integral domain. Let $K$ denote its field of fractions.
Let $\text{Mod}_A^{fg}$ denote the category of finitely generated $A$-modules
and $\mathcal{T}^{fg}$ its Serre subcategory of finitely generated torsion
modules. Then $\text{Mod}_A^{fg}/\mathcal{T}^{fg}$ is canonically equivalent
to the category of finite dimensional $K$-vector spaces.
\end{proposition}

\begin{proof}
The equivalence given in Proposition
\ref{proposition-quotient-by-torsion-modules} restricts along the embedding
$\text{Mod}_A^{fg}/\mathcal{T}^{fg} \to \text{Mod}_A/\mathcal{T}$ to an
equivalence $\text{Mod}_A^{fg}/\mathcal{T}^{fg} \to \text{Vect}_K^{fd}$.
The Noetherian assumption guarantees that $\text{Mod}_A^{fg}$ is an
abelian category (see
More on Algebra, Section \ref{more-algebra-section-abelian-categories-modules})
and that the canonical functor
$\text{Mod}_A^{fg}/\mathcal{T}^{fg} \to \text{Mod}_A/\mathcal{T}$
is full (else torsion submodules of finitely
generated modules might not be objects of $\mathcal{T}^{fg}$).
\end{proof}

\begin{proposition}
\label{proposition-quotient-abelian-groups-by-torsion-groups}
The quotient of the category of abelian groups modulo its
Serre subcategory of torsion groups is the category of
$\mathbf{Q}$-vector spaces.
\end{proposition}

\begin{proof}
The claim follows directly from
Proposition \ref{proposition-quotient-by-torsion-modules}.
\end{proof}




\section{Different colimit topologies}
\label{section-colimit-topology}

\noindent
This example is \cite[Example 1.2, page 553]{TSH}. Let
$G_n = \mathbf{Q} \times \mathbf{R}^n$, $n \geq 1$ seen as a topological group
for addition endowed with the usual (Euclidean) topology. Consider the closed
embeddings $G_n \to G_{n + 1}$ mapping $(x_0, \ldots, x_n)$ to
$(x_0, \ldots, x_n, 0)$. We claim that $G = \colim G_n$ endowed with the
topology
$$
U \subset G\text{ open} \Leftrightarrow G_n \cap U\text{ open }\forall n
$$
is not a topological group.

\medskip\noindent
To see this we consider the set
$$
U = \{(x_0, x_1, x_2, \ldots)\text{ such that }
|x_j| < |\cos(jx_0)| \text{ for } j > 0\}
$$
Using that $jx_0$ is never an integral multiple of $\pi/2$ as $\pi$
is not rational it is easy to show that $U \cap G_n$ is open. Since
$0 \in U$, if the topology above made $G$ into a topological group,
then there would be an open neighbourhood $V \subset G$ of $0$
such that $V + V \subset U$. Then, for every $j \geq 0$ there would
exist $\epsilon_j > 0$ such that $(0, \ldots, 0, x_j, 0, \ldots) \in V$
for $|x_j| < \epsilon_j$. Since $V + V \subset U$ we would have
$$
(x_0, 0, \ldots, 0, x_j, 0, \ldots) \in U
$$
for $|x_0| < \epsilon_0$ and $|x_j| < \epsilon_j$. However, if we
take $j$ large enough such that $j \epsilon_0 > \pi/2$, then we can
choose $x_0 \in \mathbf{Q}$ such that $|\cos(jx_0)|$ is smaller than
$\epsilon_j$, hence there exists an $x_j$ with
$|\cos(jx_0)| < |x_j| < \epsilon_j$. This contradiction proves the claim.

\begin{lemma}
\label{lemma-colimit-topology}
There exists a system $G_1 \to G_2 \to G_3 \to \ldots$ of (abelian)
topological groups such that $\colim G_n$ taken in the category of
topological spaces is different from $\colim G_n$ taken in the category
of topological groups.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}






\section{Universally submersive but not V covering}
\label{section-universally-submersive-not-V}

\noindent
Let $A$ be a valuation ring. Let $\mathfrak p \subset A$ be a prime
ideal which is neither the minimal prime nor the maximal ideal.
(A good case to keep in mind is when $A$ has three prime ideals
and $\mathfrak p$ is the one in the ``middle''.)
Consider the morphism of affine schemes
$$
\Spec(A_\mathfrak p) \amalg \Spec(A/\mathfrak p) \longrightarrow \Spec(A)
$$
We claim this is universally submersive. In order to prove this, let
$\Spec(B) \to \Spec(A)$ be a morphism of affine schemes given by the ring
map $A \to B$. Then we have to show that
$$
\Spec(B_\mathfrak p) \amalg \Spec(B/\mathfrak pB) \to \Spec(B)
$$
is submersive. First of all it is surjective. Next, suppose that
$T \subset \Spec(B)$ is a subset such that
$T_1 = \Spec(B_\mathfrak p) \cap T$ and $T_2 = \Spec(B/\mathfrak p B) \cap T$
are closed. Then we see that $T$ is the image of the spectrum
of a $B$-algebra because both $T_1$ and $T_2$ are spectra of $B$-algebras.
Hence to show that $T$ is closed it suffices to show that
$T$ is stable under specialization, see
Algebra, Lemma \ref{algebra-lemma-image-stable-specialization-closed}.
To see this, suppose that $p \leadsto q$ is a specialization
of points in $\Spec(B)$ with $p \in T$.
Let $A'$ be a valuation ring and let $\Spec(A') \to \Spec(B)$
be a morphism such that the generic point $\eta$ of $\Spec(A')$
maps to $p$ and the closed point $s$ of $\Spec(A')$ maps to $q$, see
Schemes, Lemma \ref{schemes-lemma-points-specialize}.
Observe that the image of the composition $\gamma : \Spec(A') \to \Spec(A)$
is exactly the set of points $\xi \in \Spec(A)$ with
$\gamma(\eta) \leadsto \xi \leadsto \gamma(s)$ (details omitted).
If $\mathfrak p \not \in \Im(\gamma)$, then we see that
either both $p, q \in \Spec(B_\mathfrak p)$ or
both $p, q \in \Spec(B/\mathfrak pB)$.
In this case the fact that $T_1$, resp.\ $T_2$ is closed
implies that $q \in T_1$, resp.\ $q \in T_2$ and hence $q \in T$.
Finally, suppose $\mathfrak p \in \Im(\gamma)$, say
$\mathfrak p = \gamma(r)$. Then we have specializations
$p \leadsto r$ and $r \leadsto q$. In this case
$p, r \in \Spec(B_\mathfrak p)$ and $r, q \in \Spec(B/\mathfrak pB)$.
Then we fist conclude $r \in T_1 \subset T$, then
$r \in T_2$ as $r$ maps to $\mathfrak p$, and then $q \in T_2 \subset T$
as desired.

\medskip\noindent
On the other hand, we claim that the singleton family
$$
\{\Spec(A_\mathfrak p) \amalg \Spec(A/\mathfrak p) \longrightarrow \Spec(A)\}
$$
is not a V covering. See
Topologies, Definition \ref{topologies-definition-V-covering}.
Namely, if it where a V covering, there would
be an extension of valuation ring $A \subset B$ such that
$\Spec(B) \to \Spec(A)$ factors through
$\Spec(A_\mathfrak p) \amalg \Spec(A/\mathfrak p)$.
This would imply $\Spec(A')$ is disconnected which is absurd.

\begin{lemma}
\label{lemma-universally-submersive-not-V}
There exists a morphism $X \to Y$ of affine schemes
which is universally submersive such that $\{X \to Y\}$
is not a V covering.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}









\section{The spectrum of the integers is not quasi-compact}
\label{section-canonical}

\noindent
Of course the title of this section doesn't refer to
the spectrum of the integers as a topological space,
because any spectrum is quasi-compact as a topological space
(Algebra, Lemma \ref{algebra-lemma-quasi-compact}).
No, it refers to the spectrum of the integers in the
canonical topology on the category of schemes, and the
definition of a quasi-compact object in a site
(Sites, Definition \ref{sites-definition-quasi-compact}).

\medskip\noindent
Let $U$ be a nonprincipal ultrafilter on the set $P$ of prime numbers.
For a subset $T \subset P$ we denote $T^c = P \setminus T$ the complement.
For $A \in U$ let $S_A \subset \mathbf{Z}$ be the multiplicative
subset generated by $p \in A$. Set
$$
\mathbf{Z}_A = S_A^{-1}\mathbf{Z}
$$
Observe that $\Spec(\mathbf{Z}_A) = \{(0)\} \cup A^c \subset \Spec(\mathbf{Z})$
if we think of $P$ as the set of closed points of $\Spec(\mathbf{Z})$.
If $A, B \in U$, then $A \cap B \in U$ and $A \cup B \in U$
and we have
$$
\mathbf{Z}_{A \cap B} =
\mathbf{Z}_A \times_{\mathbf{Z}_{A \cup B}} \mathbf{Z}_B
$$
(fibre product of rings). In particular, for any
integer $n$ and elements $A_1, \ldots, A_n \in U$ the morphisms
$$
\Spec(\mathbf{Z}_{A_1}) \amalg \ldots \amalg \Spec(\mathbf{Z}_{A_n})
\longrightarrow \Spec(\mathbf{Z})
$$
factors through $\Spec(\mathbf{Z}[1/p])$ for some $p$
(namely for any $p \in A_1 \cap \ldots \cap A_n$).
We conclude that the family of flat morphisms
$\{\Spec(\mathbf{Z}_A) \to \Spec(\mathbf{Z})\}_{A \in U}$ is jointly
surjective, but no finite subset is.

\medskip\noindent
For a $\mathbf{Z}$-module $M$ we set
$$
M_A = S_A^{-1}M = M \otimes_{\mathbf{Z}} \mathbf{Z}_A
$$
Claim I: for every $\mathbf{Z}$-module $M$ we have
$$
M =
\text{Equalizer}\left(
\xymatrix{
\prod\nolimits_{A \in U} M_A \ar@<1ex>[r] \ar@<-1ex>[r] &
\prod\nolimits_{A, B \in U} M_{A \cup B}
}
\right)
$$
First, assume $M$ is torsion free. Then $M_A \subset M_P$ for all $A \in U$.
Hence we see that we have to prove
$$
M = \bigcap\nolimits_{A \in U} M_A\text{ inside }M_P = M \otimes \mathbf{Q}
$$
Namely, since $U$ is nonprincipal, for any prime $p$ we have
$\{p\}^c \in U$. Also, $M_{\{p\}^c} = M_{(p)}$ is equal to the
localization at the prime $(p)$.
Thus the above is clear because already $M_{(2)} \cap M_{(3)} = M$.
Next, assume $M$ is torsion. Then we have
$$
M = \bigoplus\nolimits_{p \in P} M[p^\infty]
$$
and correspondingly we have
$$
M_A = \bigoplus\nolimits_{p \not \in A} M[p^\infty]
$$
because we are localizing at the primes in $A$. Suppose that
$(x_A) \in \prod M_A$ is in the equalizer. Denote
$x_p = x_{\{p\}^c} \in M[p^{\infty}]$. Then the equalizer
property says
$$
x_A = (x_p)_{p \not \in A}
$$
and in particular it says that $x_p$ is zero for all but a finite
number of $p \not \in A$. To finish the proof in the torsion case
it suffices to show that $x_p$ is zero for all but a finite number
of primes $p$. If not write $\{p \in P \mid x_p \not = 0\} = T \amalg T'$
as the disjoint union of two infinite sets. Then either
$T \not \in U$ or $T' \not \in U$ because $U$ is an ultrafilter
(namely if both $T, T'$ are in $U$ then $U$ contains $T \cap T' = \emptyset$
which is not allowed). Say $T \not \in U$. Then $T = A^c$ and this
contradicts the finiteness mentioned above.
Finally, suppose that $M$ is a general module. Then we look
at the short exact sequence
$$
0 \to M_{tors} \to M \to M/M_{tors} \to 0
$$
and we look at the following large diagram
$$
\xymatrix{
M_{tors} \ar[r] \ar[d] &
\prod\nolimits_{A \in U} M_{tors, A} \ar@<1ex>[r] \ar@<-1ex>[r] \ar[d] &
\prod\nolimits_{A, B \in U} M_{tors, A \cup B} \ar[d] \\
M \ar[r] \ar[d] &
\prod\nolimits_{A \in U} M_A \ar@<1ex>[r] \ar@<-1ex>[r] \ar[d] &
\prod\nolimits_{A, B \in U} M_{A \cup B} \ar[d] \\
M/M_{tors} \ar[r] &
\prod\nolimits_{A \in U} (M/M_{tors})_A \ar@<1ex>[r] \ar@<-1ex>[r] &
\prod\nolimits_{A, B \in U} (M/M_{tors})_{A \cup B} \\
}
$$
Doing a diagram chase using exactness of the columns and the result
for the torsion module $M_{tors}$ and the torsion free module
$M/M_{tors}$ proving Claim I for $M$.
This gives an example of the phenomenon in the following lemma.

\begin{lemma}
\label{lemma-non-fpqc-descent}
There exists a ring $A$ and an infinite family of flat ring maps
$\{A \to A_i\}_{i \in I}$ such that for every $A$-module $M$ 
$$
M =
\text{Equalizer}\left(
\xymatrix{
\prod\nolimits_{i \in I} M \otimes_A A_i \ar@<1ex>[r] \ar@<-1ex>[r] &
\prod\nolimits_{i, j \in I} M \otimes_A A_i \otimes_A A_j
}
\right)
$$
but there is no finite subfamily where the same thing is true.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
We continue working with our nonprincipal ultrafilter $U$ on the set $P$
of prime numbers.
Let $R$ be a ring. Denote $R_A = S_A^{-1}R = R \otimes \mathbf{Z}_A$
for $A \in U$.
Claim II: given closed subsets $T_A \subset \Spec(R_A)$, $A \in U$
such that
$$
(\Spec(R_{A \cup B}) \to \Spec(R_A))^{-1}T_A =
(\Spec(R_{A \cup B}) \to \Spec(R_B))^{-1}T_B
$$
for all $A, B \in U$, there is a closed subset $T \subset \Spec(R)$
with $T_A = (\Spec(R_A) \to \Spec(R))^{-1}(T)$ for all $A \in U$.
Let $I_A \subset R_A$ for $A \in U$ be the radical ideal cutting out $T_A$.
Then the glueing condition implies
$S_{A \cup B}^{-1}I_A = S_{A \cup B}^{-1}I_B$
in $R_{A \cup B}$ for all $A, B \in U$ (because localization preserves
being a radical ideal). Let $I' \subset R$ be the set of elements
mapping into $I_P \subset R_P = R \otimes \mathbf{Q}$.
Then we see for $A \in U$ that
\begin{enumerate}
\item $I_A \subset I'_A = S_A^{-1}I'$, and
\item $M_A = I'_A/I_A$ is a torsion module.
\end{enumerate}
Of course we obtain canonical identifications
$S_{A \cup B}^{-1}M_A = S_{A \cup B}^{-1}M_B$ for $A, B \in U$.
Decomposing the torsion modules $M_A$ into their $p$-primary
components, the reader easily shows that there exist $p$-power torsion
$R$-modules $M_p$ such that
$$
M_A = \bigoplus\nolimits_{p \not \in A} M_p
$$
compatible with the canonical identifications given above.
Setting $M = \bigoplus_{p \in P} M_p$ we find canonical isomorphisms
$M_A = S_A^{-1}M$ compatible with the above canonical identifications.
Then we get a canonical map
$$
I' \longrightarrow M
$$
of $R$-modules wich recovers the map $I_A \to M_A$ for all $A \in U$.
This is true by all the compatibilities mentioned above and the
claim proved previously that $M$ is the equalizer of the two
maps from $\prod_{A \in U} M_A$ to $\prod_{A, B \in U} M_{A \cup B}$.
Let $I = \Ker(I' \to M)$. Then $I$ is an ideal and
$T = V(I)$ is a closed subset which
recovers the closed subsets $T_A$ for all $A \in U$. This proves Claim II.

\begin{lemma}
\label{lemma-Z-not-quasi-compact}
The scheme $\Spec(\mathbf{Z})$ is not quasi-compact
in the canonical topology on the category of schemes.
\end{lemma}

\begin{proof}
With notation as above consider the family of morphisms
$$
\mathcal{W} = \{\Spec(\mathbf{Z}_A) \to \Spec(\mathbf{Z})\}_{A \in U}
$$
By Descent, Lemma \ref{descent-lemma-universal-effective-epimorphism}
and the two claims proved above
this is a universal effective epimorphism.
In any category with fibre products, the universal effective epimorphisms
give $\mathcal{C}$ the structure of a site (modulo some set theoretical
issues which are easy to fix) defining the canonical topology.
Thus $\mathcal{W}$ is a covering for the canonical topology.
On the other hand, we have seen above that any finite subfamily
$$
\{\Spec(\mathbf{Z}_{A_i}) \to \Spec(\mathbf{Z})\}_{i = 1, \ldots, n},\quad
n \in \mathbf{N}, A_1, \ldots, A_n \in U
$$
factors through $\Spec(\mathbf{Z}[1/p])$ for some $p$.
Hence this finite family cannot be a universal effective epimorphism
and more generally no universal effective epimorphism
$\{g_j : T_j \to \Spec(\mathbf{Z})\}$ can refine
$\{\Spec(\mathbf{Z}_{A_i}) \to \Spec(\mathbf{Z})\}_{i = 1, \ldots, n}$.
By Sites, Definition \ref{sites-definition-quasi-compact}
this means that $\Spec(\mathbf{Z})$ is not quasi-compact
in the canonical topology. To see that our notion of quasi-compactness
agrees with the usual topos theoretic definition, see
Sites, Lemma \ref{sites-lemma-quasi-compact}.
\end{proof}







\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}