@@ -40,19 +40,11 @@ instance : DFunLike ZHat ℕ+ (fun (N : ℕ+) ↦ ZMod N) where
40
40
coe z := z.1
41
41
coe_injective' M N := by simp_all
42
42
43
- -- Try to avoid introducing `z.1` and `z.2`.
44
- -- @[ simp ]
45
- -- lemma val_apply (z : ZHat) (n : ℕ+) : z.1 n = z n := rfl
46
-
47
43
lemma prop (z : ZHat) (D N : ℕ+) (h : (D : ℕ) ∣ N) : ZMod.castHom h (ZMod D) (z N) = z D := z.2 ..
48
44
49
45
@[ext]
50
- lemma ext (x y : ZHat) (h : ∀ n : ℕ+, x n = y n) : x = y := by
51
- cases x
52
- cases y
53
- congr
54
- ext n
55
- apply h
46
+ lemma ext (x y : ZHat) (h : ∀ n : ℕ+, x n = y n) : x = y :=
47
+ Subtype.ext <| funext <| h
56
48
57
49
@[simp] lemma zero_val (n : ℕ+) : (0 : ZHat) n = 0 := rfl
58
50
@[simp] lemma one_val (n : ℕ+) : (1 : ZHat) n = 1 := rfl
@@ -79,12 +71,10 @@ instance charZero : CharZero ZHat := ⟨ fun a b h ↦ by
79
71
· simp [Nat.succ_eq_add_one, Nat.lt_add_one_iff]
80
72
· simp [Nat.succ_eq_add_one, Nat.lt_add_one_iff]
81
73
⟩
82
- --lemma NonAssocSemiring.Nontrivial_iff (R : Type) [NonAssocSemiring R] :
83
- -- Nontrivial R ↔ (0 : R) ≠ 1 :=
84
- -- ⟨fun _ ↦ zero_ne_one' R, fun a ↦ ⟨0, 1, a⟩⟩
85
74
86
75
open BigOperators Nat Finset in
87
- /-- A nonarchimedean analogue $0! + 1! + 2! + \cdots$ of $e=1/0! + 1/1! + 1/2! + \cdots$. -/
76
+ /-- A nonarchimedean analogue `0! + 1! + 2! + ⋯` of `e = 1/0! + 1/1! + 1/2! + ⋯`.
77
+ It is defined as the function whose value at `ZMod n` is the sum of `i!` for `0 ≤ i < n`.-/
88
78
def e : ZHat := ⟨fun (n : ℕ+) ↦ ∑ i in range (n : ℕ), i !, by
89
79
intros D N hDN
90
80
dsimp only
0 commit comments