Advertisement
Guest User

Flat Modules

a guest
Nov 3rd, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.40 KB | None | 0 0
  1. /-
  2. Copyright (c) 2020 Roman Fedorov. All rights reserved.
  3. Released under Apache 2.0 license as described in the file LICENSE.
  4. Authors: Roman Fedorov
  5. Flat modules over rings are defined. It is proved that a module is flat over itself and that the tensor product of
  6. flat modules is flat.
  7. -/
  8. import algebra.module
  9. import linear_algebra.tensor_product
  10. import data.equiv.basic
  11. open tensor_product module linear_map
  12. open_locale tensor_product
  13.  
  14. /-!
  15. # Flat modules over commutative rings.
  16.  
  17. In this file we introduce flat modules over commutative rings. It is proved that
  18.  
  19. ## Main definitions and results
  20.  
  21. - `is_flat` : The definition of a flat module
  22. - `flat_over_self` : A ring is flat as a module over itself,
  23. - `tensor_product_is_flat` : The tensor product of flat modules is flat
  24. - `non_zero_divisor_of_flat` : A non-zero divisor in a ring remains a non-zero divisor
  25. in any flat module
  26.  
  27. ## Auxiliary results
  28.  
  29. - A function whose composition with an invertible function is injective, is itself
  30. injective
  31. - The left and right unit isomorphisms for tensor product are functorial
  32. - The associator for tensor product is functorial in the third variable
  33. -/
  34.  
  35. /- TODO: Direct sum of any family of flat modules is flat. Thus a free module is flat.
  36. The problem is that it should be done for infinite direct sums but they are not yet defined. -/
  37.  
  38.  
  39. universe u
  40.  
  41. variables {R : Type u} [comm_ring R]
  42. variables {M : Type u} {N : Type u} {P : Type u}
  43. variables [add_comm_group M] [add_comm_group N] [add_comm_group P]
  44. variables [module R M] [module R N] [module R P]
  45.  
  46. /-! If a functions becomes injective after composing with an invertible function, then
  47. it was injective from the very beginning. Probably belongs to data.equiv.basic -/
  48. section auxiliary_result_about_functions
  49. universe v
  50. variables {α β γ : Type v}
  51.  
  52. lemma inv_comp (g : α ≃ β) (x : β) : g (g.inv_fun x) = x := by simp
  53. lemma inv_comp' (g : α ≃ β) (x : α) : g.inv_fun (g x) = x := by simp
  54.  
  55. lemma injective_of_comp_bijective (f : β → γ) (g : α ≃ β) :
  56. function.injective (f ∘ g) → function.injective f :=
  57. assume hinj : function.injective (f ∘ g),
  58. assume x y : β,
  59. assume heq : f x = f y,
  60. let h:=g.inv_fun in
  61. have (f ∘ g) (h x) = (f ∘ g) (h y), from calc
  62. (f ∘ g) (h x) = f (g ( h x)) : by simp
  63. ... = f x : by rw [inv_comp g x]
  64. ... = f y : heq
  65. ... = f (g ( h y)) : by rw [inv_comp g y]
  66. ... = (f ∘ g) (h y) : by simp,
  67. have h x = h y, from hinj this,
  68. show x = y, from calc
  69. x = g (h x) : (inv_comp g x).symm
  70. ... = g (h y) : by rw [this]
  71. ... = y : (inv_comp g y)
  72.  
  73. lemma injective_of_comp_bijective' (f : α → β) (g : β ≃ γ) :
  74. function.injective (g ∘ f) → function.injective f :=
  75. assume hinj : function.injective (g ∘ f),
  76. assume x y : α,
  77. assume heq : f x = f y,
  78. let h:=g.inv_fun in
  79. have (g ∘ f) x = (g ∘ f) y, from calc
  80. (g ∘ f) x = g (f x) : by simp
  81. ... = g (f y) : by rw[heq]
  82. ... = (g ∘ f) y : by simp,
  83. show x = y, from hinj this
  84.  
  85. end auxiliary_result_about_functions
  86.  
  87. section functoriality_of_tensor_product
  88.  
  89. /-- The isomorphism R ⊗[R] M ≃ₗ M is functorial in M.
  90. Probably belongs to linear_algebra.tensor_product. -/
  91. theorem tensor_product_lid_functorial (f : M →ₗ[R] N) :
  92. (tensor_product.lid R N : R ⊗[R] N ≃ₗ N) ∘ (map id f : (R ⊗[R] M) →ₗ[R] (R ⊗[R] N)) =
  93. f ∘ (tensor_product.lid R M : R ⊗[R] M ≃ₗ M) :=
  94. let g : R ⊗[R] M ≃ₗ M := tensor_product.lid R M in
  95. let h : R ⊗[R] N ≃ₗ N := tensor_product.lid R N in
  96. let ft : (R ⊗[R] M) →ₗ[R] (R ⊗[R] N) := map id f in
  97. have h_compose : comp h.to_linear_map ft = comp f g.to_linear_map, by
  98. {
  99. apply tensor_product.ext,
  100. intros r m,
  101. repeat{rw [comp_apply]},
  102. exact calc
  103. h.to_linear_map (ft (r ⊗ₜ[R] m)) = (h.to_linear_map) ((linear_map.id r) ⊗ₜ[R] (f m)) :
  104. by rw map_tmul
  105. ... = (tensor_product.lid R N) (r ⊗ₜ[R] (f m)) : rfl
  106. ... = r • f m : by rw [tensor_product.lid_tmul (f m) r]
  107. ... = f (r • m) : (f.map_smul r m).symm
  108. ... = f ((tensor_product.lid R M) (r ⊗ₜ[R] m)) : by rw [tensor_product.lid_tmul m r]
  109. ... = f (g.to_linear_map (r ⊗ₜ[R] m)) : rfl
  110. },
  111. by
  112. {
  113. apply funext,
  114. exact (ext_iff.1 h_compose)
  115. }
  116.  
  117. /-- The isomorphism M ⊗[R] R ≃ₗ M is functorial in M.
  118. Probably belongs to linear_algebra.tensor_product. -/
  119. theorem tensor_product_rid_functorial (f : M →ₗ[R] N) :
  120. (tensor_product.rid R N : N ⊗[R] R ≃ₗ N) ∘ (map f id : (M ⊗[R] R) →ₗ[R] (N ⊗[R] R)) =
  121. f ∘ (tensor_product.rid R M : M ⊗[R] R ≃ₗ M) :=
  122. let g : M ⊗[R] R ≃ₗ M := tensor_product.rid R M in
  123. let h : N ⊗[R] R ≃ₗ N := tensor_product.rid R N in
  124. let ft : (M ⊗[R] R) →ₗ[R] (N ⊗[R] R) := map f id in
  125. have h_compose : (comp h.to_linear_map ft = comp f g.to_linear_map), by
  126. {
  127. apply tensor_product.ext,
  128. intros m r,
  129. repeat{rw [comp_apply]},
  130. exact calc
  131. h.to_linear_map (ft (m ⊗ₜ[R] r)) = (h.to_linear_map) ((f m) ⊗ₜ[R] (linear_map.id r)) :
  132. by rw map_tmul
  133. ... = (tensor_product.rid R N) ((f m) ⊗ₜ[R] r) : rfl
  134. ... = r • f m : by rw [tensor_product.rid_tmul (f m) r]
  135. ... = f (r • m) : (f.map_smul r m).symm
  136. ... = f ((tensor_product.rid R M) (m ⊗ₜ[R] r)) : by rw [tensor_product.rid_tmul m r]
  137. ... = f (g.to_linear_map (m ⊗ₜ[R] r)) : rfl
  138. },
  139. by
  140. {
  141. apply funext,
  142. exact (ext_iff.1 h_compose)
  143. }
  144.  
  145. /-- The associator for tensor product is functorial in the third argument.
  146. Probably belongs to linear_algebra.tensor_product.-/
  147. variable (P)
  148.  
  149. lemma assoc_functorial (Q: Type u) [add_comm_group Q] [module R Q] (f : M →ₗ[R] N) :
  150. let ft : (Q ⊗[R] M) →ₗ[R] (Q ⊗[R] N) := map id f in
  151. let ftt : (P ⊗[R] (Q ⊗[R] M)) →ₗ[R](P ⊗[R] (Q ⊗[R] N)) := map id ft in
  152. let ftt': ((P ⊗[R] Q) ⊗[R] M) →ₗ[R]((P ⊗[R] Q) ⊗[R] N) := map id f in
  153. let α := tensor_product.assoc R P Q M in let β := tensor_product.assoc R P Q N in
  154. comp ftt α.to_linear_map = comp β.to_linear_map ftt' :=
  155. let ft : (Q ⊗[R] M) →ₗ[R] (Q ⊗[R] N) := map id f in
  156. let ftt : (P ⊗[R] (Q ⊗[R] M)) →ₗ[R](P ⊗[R] (Q ⊗[R] N)) := map id ft in
  157. let ftt': ((P ⊗[R] Q) ⊗[R] M) →ₗ[R]((P ⊗[R] Q) ⊗[R] N) := map id f in
  158. let α := tensor_product.assoc R P Q M in let β := tensor_product.assoc R P Q N in
  159. ext_threefold (assume (p : P) (q : Q) (m : M),
  160. have heq₁ : (comp ftt α.to_linear_map) ((p ⊗ₜ q) ⊗ₜ m) = (p ⊗ₜ (q ⊗ₜ f m)), from calc
  161. (comp ftt α.to_linear_map) ((p ⊗ₜ q) ⊗ₜ m) = ftt (α.to_linear_map ((p ⊗ₜ q) ⊗ₜ m)) :
  162. comp_apply _ _ _
  163. ... = ftt (p ⊗ₜ (q ⊗ₜ m)) : by refl
  164. ... = (linear_map.id p) ⊗ₜ ft (q ⊗ₜ m) : map_tmul _ _ _ _
  165. ... = p ⊗ₜ ft (q ⊗ₜ m) : by rw[ id_apply]
  166. ... = p ⊗ₜ ((linear_map.id q) ⊗ₜ f m) : by rw [map_tmul _ _ _ _]
  167. ... = p ⊗ₜ (q ⊗ₜ f m) : by rw[ id_apply],
  168. have heq₂ : (comp β.to_linear_map ftt') ((p ⊗ₜ q) ⊗ₜ m) = (p ⊗ₜ (q ⊗ₜ f m)), from calc
  169. (comp β.to_linear_map ftt') ((p ⊗ₜ q) ⊗ₜ m) = β.to_linear_map (ftt' ((p ⊗ₜ q) ⊗ₜ m)) :
  170. comp_apply _ _ _
  171. ... = β.to_linear_map ((linear_map.id (p ⊗ₜ q)) ⊗ₜ f m) : by rw[map_tmul _ _ _ _]
  172. ... = β.to_linear_map ((p ⊗ₜ q) ⊗ₜ f m) : by rw[ id_apply]
  173. ... = (p ⊗ₜ (q ⊗ₜ f m)) : by refl,
  174. heq₁.trans heq₂)
  175.  
  176. end functoriality_of_tensor_product
  177.  
  178. /-- Scalar multiplication gives a linear map. Probably belongs to linear_algebra.tensor_product.-/
  179. def linear_map_smul (P : Type u) [add_comm_group P] [module R P] (r : R) : P →ₗ[R] P :=
  180. {to_fun := (λ (x : P), r • x),
  181. map_add' := (is_linear_map.is_linear_map_smul r).map_add,
  182. map_smul' := (is_linear_map.is_linear_map_smul r).map_smul}
  183.  
  184. section flat_modules
  185.  
  186. def injective_after_tensoring (P : Type u) [add_comm_group P] [module R P] (f : M →ₗ[R] N): Prop :=
  187. let ft : (P ⊗[R] M) →ₗ[R] (P ⊗[R] N) := map id f in function.injective ft
  188.  
  189. /-- The definition of a flat module-/
  190. def is_flat (P : Type u) [add_comm_group P] [module R P] : Prop :=
  191. ∀ (M : Type u ) (N : Type u) [add_comm_group M] [add_comm_group N],
  192. by exactI ∀ [module R M] [module R N],
  193. by exactI ∀ (f : M →ₗ[R] N), (function.injective f) → (injective_after_tensoring P f)
  194.  
  195. lemma remains_injective_tensor_self (f : M →ₗ[R] N) :
  196. function.injective f → injective_after_tensoring R f :=
  197. assume h_inj : function.injective f,
  198. let g : R ⊗[R] M ≃ₗ M := tensor_product.lid R M in
  199. let h : R ⊗[R] N ≃ₗ N := tensor_product.lid R N in
  200. let ft : (R ⊗[R] M) →ₗ[R] (R ⊗[R] N) := map id f in
  201. have function.injective (f ∘ g),
  202. from function.injective.comp h_inj $ equiv.injective $ linear_equiv.to_equiv g,
  203. have function.injective (h ∘ ft), from eq.subst (tensor_product_lid_functorial f).symm this,
  204. show function.injective ft, from function.injective.of_comp this
  205.  
  206. /-- A module is flat over itself -/
  207. theorem flat_over_self : @is_flat R _ R _ _ :=
  208. λ (M : Type u) (N : Type u) [add_comm_group M] [add_comm_group N],
  209. by exactI λ [module R M] [module R N],
  210. by exactI λ (f : M →ₗ[R] N), (remains_injective_tensor_self f)
  211.  
  212. theorem tensor_product_is_flat (P Q : Type u) [add_comm_group P] [add_comm_group Q]
  213. [module R P] [module R Q] (FLP : @is_flat R _ P _ _) (FLQ : @is_flat R _ Q _ _) :
  214. @is_flat R _ (P ⊗[R] Q) _ _:=
  215. λ (M : Type u) (N : Type u) [add_comm_group M] [add_comm_group N],
  216. by exactI λ [module R M] [module R N],
  217. by exactI λ f : M →ₗ[R] N,
  218. assume inj : function.injective f,
  219. let ft : (Q ⊗[R] M) →ₗ[R] (Q ⊗[R] N) := map id f in
  220. have injt : function.injective ft, from FLQ M N f inj,
  221. let ftt : (P ⊗[R] (Q ⊗[R] M)) →ₗ[R](P ⊗[R] (Q ⊗[R] N)) := map id ft in
  222. have injt : function.injective ftt, from FLP (Q ⊗[R] M) (Q ⊗[R] N) ft injt,
  223. let ftt': ((P ⊗[R] Q) ⊗[R] M) →ₗ[R]((P ⊗[R] Q) ⊗[R] N) := map id f in
  224. let h₁ := tensor_product.assoc R P Q M in let h₂ := tensor_product.assoc R P Q N in
  225. have Comm : comp ftt (h₁.to_linear_map) = comp (h₂.to_linear_map) ftt',
  226. from assoc_functorial P Q f,
  227. have Comm': ftt ∘ h₁ = h₂ ∘ ftt', by {funext, exact
  228. (calc
  229. (ftt ∘ h₁) x = ftt (h₁ x) : rfl
  230. ... = (comp ftt (h₁.to_linear_map)) x : by {rw[comp_apply], refl}
  231. ... = (comp (h₂.to_linear_map) ftt') x : by rw[Comm]
  232. ... = h₂ (ftt' x) : by {rw[comp_apply], refl}
  233. ... = (h₂ ∘ ftt') x : rfl),
  234. },
  235. have function.injective (ftt ∘ h₁),
  236. from function.injective.comp injt $ equiv.injective $ linear_equiv.to_equiv h₁,
  237. have function.injective (h₂ ∘ ftt'), from Comm' ▸ this,
  238. show function.injective ftt',
  239. from injective_of_comp_bijective' ftt' (linear_equiv.to_equiv h₂) this
  240.  
  241. /-- A non-zero divisor in R remains a non-zero divisor on any flat R-module-/
  242. theorem non_zero_divisor_of_flat (P : Type u) [add_comm_group P] [module R P]
  243. (FL : @is_flat R _ P _ _) (r : R) (non_div : function.injective (λ (x : R), r * x)) :
  244. function.injective (λ (x : P), r • x) :=
  245. let f : P →ₗ[R] P := linear_map_smul P r in
  246. let g : R →ₗ[R] R := linear_map_smul R r in
  247. let gt : (P ⊗[R] R) →ₗ[R] (P ⊗[R] R) := map id g in
  248. have h_inj : function.injective gt, from FL R R g non_div,
  249. let h : P ⊗[R] R ≃ₗ P := tensor_product.rid R P in
  250. have gt = map f id, by
  251. {
  252. apply tensor_product.ext,
  253. intros p r',
  254. repeat{rw [comp_apply]},
  255. exact calc
  256. gt (p ⊗ₜ[R] r')= (linear_map.id p) ⊗ₜ[R] (g r') : by rw map_tmul
  257. ... = p ⊗ₜ[R] (r * r') : rfl
  258. ... = (r • p) ⊗ₜ[R] r' : (smul_tmul _ _ _).symm
  259. ... = (f p) ⊗ₜ[R] ( linear_map.id r') : rfl
  260. ... = (map f linear_map.id) (p ⊗ₜ[R] r') : by rw map_tmul
  261. },
  262. have Comm : h ∘ gt = f ∘ h, by rw [this, tensor_product_rid_functorial f],
  263. have function.injective (h ∘ gt),
  264. from function.injective.comp (equiv.injective (linear_equiv.to_equiv h)) h_inj,
  265. have function.injective (f ∘ h), from Comm ▸ this,
  266. show function.injective f, from injective_of_comp_bijective f (linear_equiv.to_equiv h) this
  267.  
  268. end flat_modules
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement