@@ -27,6 +27,7 @@ with respect to an ideal `I`:
27
27
28
28
-/
29
29
30
+ suppress_compilation
30
31
31
32
open Submodule
32
33
@@ -213,11 +214,43 @@ def submodule : Submodule R (∀ n : ℕ, M ⧸ (I ^ n • ⊤ : Submodule R M))
213
214
rw [Pi.add_apply, Pi.add_apply, LinearMap.map_add, hf hmn, hg hmn]
214
215
smul_mem' c f hf m n hmn := by rw [Pi.smul_apply, Pi.smul_apply, LinearMap.map_smul, hf hmn]
215
216
217
+ instance : Zero (AdicCompletion I M) where
218
+ zero := ⟨0 , by simp⟩
219
+
220
+ instance : Add (AdicCompletion I M) where
221
+ add x y := ⟨x.val + y.val, by simp [x.property, y.property]⟩
222
+
223
+ instance : Neg (AdicCompletion I M) where
224
+ neg x := ⟨- x.val, by simp [x.property]⟩
225
+
226
+ instance : Sub (AdicCompletion I M) where
227
+ sub x y := ⟨x.val - y.val, by simp [x.property, y.property]⟩
228
+
229
+ instance : SMul ℕ (AdicCompletion I M) where
230
+ smul n x := ⟨n • x.val, by simp [x.property]⟩
231
+
232
+ instance : SMul ℤ (AdicCompletion I M) where
233
+ smul n x := ⟨n • x.val, by simp [x.property]⟩
234
+
216
235
instance : AddCommGroup (AdicCompletion I M) :=
217
- inferInstanceAs <| AddCommGroup (submodule I M)
236
+ let f : AdicCompletion I M → ∀ n, M ⧸ (I ^ n • ⊤ : Submodule R M) := Subtype.val
237
+ Subtype.val_injective.addCommGroup f rfl (fun _ _ ↦ rfl) (fun _ ↦ rfl) (fun _ _ ↦ rfl)
238
+ (fun _ _ ↦ rfl) (fun _ _ ↦ rfl)
239
+
240
+ instance : SMul R (AdicCompletion I M) where
241
+ smul r x := ⟨r • x.val, by simp [x.property]⟩
218
242
219
243
instance : Module R (AdicCompletion I M) :=
220
- inferInstanceAs <| Module R (submodule I M)
244
+ let f : AdicCompletion I M →+ ∀ n, M ⧸ (I ^ n • ⊤ : Submodule R M) :=
245
+ { toFun := Subtype.val, map_zero' := rfl, map_add' := fun _ _ ↦ rfl }
246
+ Subtype.val_injective.module R f (fun _ _ ↦ rfl)
247
+
248
+ /-- The canonical inclusion from the completion to the product. -/
249
+ @[simps]
250
+ def incl : AdicCompletion I M →ₗ[R] (∀ n, M ⧸ (I ^ n • ⊤ : Submodule R M)) where
251
+ toFun x := x.val
252
+ map_add' _ _ := rfl
253
+ map_smul' _ _ := rfl
221
254
222
255
/-- The canonical linear map to the completion. -/
223
256
def of : M →ₗ[R] AdicCompletion I M where
@@ -279,6 +312,11 @@ theorem val_add (n : ℕ) (f g : AdicCompletion I M) : (f + g).val n = f.val n +
279
312
theorem val_sub (n : ℕ) (f g : AdicCompletion I M) : (f - g).val n = f.val n - g.val n :=
280
313
rfl
281
314
315
+ @[simp]
316
+ theorem val_sum {α : Type *} (s : Finset α) (f : α → AdicCompletion I M) (n : ℕ) :
317
+ (Finset.sum s f).val n = Finset.sum s (fun a ↦ (f a).val n) := by
318
+ simp_rw [← incl_apply, map_sum, Finset.sum_apply]
319
+
282
320
/- No `simp` attribute, since it causes `simp` unification timeouts when considering
283
321
the `AdicCompletion I R` module instance on `AdicCompletion I M` (see `AdicCompletion/Algebra`). -/
284
322
theorem val_smul (n : ℕ) (r : R) (f : AdicCompletion I M) : (r • f).val n = r • f.val n :=
@@ -361,14 +399,39 @@ def submodule : Submodule R (ℕ → M) where
361
399
intro r f hf m n hmn
362
400
exact SModEq.smul (hf hmn) r
363
401
364
- instance : CoeFun (AdicCauchySequence I M) (fun _ ↦ ℕ → M) where
365
- coe f := f.val
402
+ instance : Zero (AdicCauchySequence I M) where
403
+ zero := ⟨0 , fun _ ↦ rfl⟩
404
+
405
+ instance : Add (AdicCauchySequence I M) where
406
+ add x y := ⟨x.val + y.val, fun hmn ↦ SModEq.add (x.property hmn) (y.property hmn)⟩
407
+
408
+ instance : Neg (AdicCauchySequence I M) where
409
+ neg x := ⟨- x.val, fun hmn ↦ SModEq.neg (x.property hmn)⟩
410
+
411
+ instance : Sub (AdicCauchySequence I M) where
412
+ sub x y := ⟨x.val - y.val, fun hmn ↦ SModEq.sub (x.property hmn) (y.property hmn)⟩
366
413
367
- instance : AddCommGroup (AdicCauchySequence I M) :=
368
- inferInstanceAs <| AddCommGroup (AdicCauchySequence.submodule I M)
414
+ instance : SMul ℕ (AdicCauchySequence I M) where
415
+ smul n x := ⟨n • x.val, fun hmn ↦ SModEq.nsmul (x.property hmn) n⟩
416
+
417
+ instance : SMul ℤ (AdicCauchySequence I M) where
418
+ smul n x := ⟨n • x.val, fun hmn ↦ SModEq.zsmul (x.property hmn) n⟩
419
+
420
+ instance : AddCommGroup (AdicCauchySequence I M) := by
421
+ let f : AdicCauchySequence I M → (ℕ → M) := Subtype.val
422
+ apply Subtype.val_injective.addCommGroup f rfl (fun _ _ ↦ rfl) (fun _ ↦ rfl) (fun _ _ ↦ rfl)
423
+ (fun _ _ ↦ rfl) (fun _ _ ↦ rfl)
424
+
425
+ instance : SMul R (AdicCauchySequence I M) where
426
+ smul r x := ⟨r • x.val, fun hmn ↦ SModEq.smul (x.property hmn) r⟩
369
427
370
428
instance : Module R (AdicCauchySequence I M) :=
371
- inferInstanceAs <| Module R (AdicCauchySequence.submodule I M)
429
+ let f : AdicCauchySequence I M →+ (ℕ → M) :=
430
+ { toFun := Subtype.val, map_zero' := rfl, map_add' := fun _ _ ↦ rfl }
431
+ Subtype.val_injective.module R f (fun _ _ ↦ rfl)
432
+
433
+ instance : CoeFun (AdicCauchySequence I M) (fun _ ↦ ℕ → M) where
434
+ coe f := f.val
372
435
373
436
@[simp]
374
437
theorem zero_apply (n : ℕ) : (0 : AdicCauchySequence I M) n = 0 :=
0 commit comments