@@ -112,6 +112,9 @@ instance : has_one ℤ_[p] := ⟨⟨1, by norm_num⟩⟩
112
112
@[simp, norm_cast] lemma coe_one : ((1 : ℤ_[p]) : ℚ_[p]) = 1 := rfl
113
113
@[simp, norm_cast] lemma coe_zero : ((0 : ℤ_[p]) : ℚ_[p]) = 0 := rfl
114
114
115
+ lemma coe_eq_zero (z : ℤ_[p]) : (z : ℚ_[p]) = 0 ↔ z = 0 :=
116
+ ⟨λ h, by {rw ← coe_zero at h, exact subtype.coe_inj.mp h}, λ h, by {rw h, exact coe_zero}⟩
117
+
115
118
instance : add_comm_group ℤ_[p] :=
116
119
(by apply_instance : add_comm_group (subring p))
117
120
@@ -531,4 +534,52 @@ instance : is_adic_complete (maximal_ideal ℤ_[p]) ℤ_[p] :=
531
534
532
535
end dvr
533
536
537
+ section fraction_ring
538
+
539
+ instance algebra : algebra ℤ_[p] ℚ_[p] := ring_hom.to_algebra (padic_int.coe.ring_hom)
540
+
541
+ @[simp] lemma algebra_map_apply (x : ℤ_[p]) : algebra_map ℤ_[p] ℚ_[p] x = x := rfl
542
+
543
+ instance is_fraction_ring : is_fraction_ring ℤ_[p] ℚ_[p] :=
544
+ { map_units := λ ⟨x, hx⟩,
545
+ begin
546
+ rw [set_like.coe_mk, algebra_map_apply, is_unit_iff_ne_zero, ne.def, padic_int.coe_eq_zero],
547
+ exact mem_non_zero_divisors_iff_ne_zero.mp hx,
548
+ end ,
549
+ surj := λ x,
550
+ begin
551
+ by_cases hx : ∥ x ∥ ≤ 1 ,
552
+ { use (⟨x, hx⟩, 1 ),
553
+ rw [submonoid.coe_one, map_one, mul_one],
554
+ refl, },
555
+ { set n := int.to_nat(- x.valuation) with hn,
556
+ have hn_coe : (n : ℤ) = -x.valuation,
557
+ { rw [hn, int.to_nat_of_nonneg],
558
+ rw right.nonneg_neg_iff,
559
+ rw padic.norm_le_one_iff_val_nonneg at hx,
560
+ exact le_of_lt (not_le.mp hx) },
561
+ set a := x * p^n with ha,
562
+ have ha_norm : ∥ a ∥ = 1 ,
563
+ { have hx : x ≠ 0 ,
564
+ { intro h0,
565
+ rw [h0, norm_zero] at hx,
566
+ exact hx (zero_le_one) },
567
+ rw [ha, padic_norm_e.mul, ← zpow_coe_nat, padic_norm_e.norm_p_pow,
568
+ padic.norm_eq_pow_val hx, ← zpow_add' , hn_coe, neg_neg, add_left_neg, zpow_zero],
569
+ exact or.inl (nat.cast_ne_zero.mpr (ne_zero.ne p)), },
570
+ use (⟨a, le_of_eq ha_norm⟩,
571
+ ⟨(p^n : ℤ_[p]), mem_non_zero_divisors_iff_ne_zero.mpr (ne_zero.ne _)⟩),
572
+ simp only [set_like.coe_mk, map_pow, map_nat_cast, algebra_map_apply,
573
+ padic_int.coe_pow, padic_int.coe_nat_cast, subtype.coe_mk] }
574
+ end ,
575
+ eq_iff_exists := λ x y,
576
+ begin
577
+ rw [algebra_map_apply, algebra_map_apply, subtype.coe_inj],
578
+ refine ⟨λ h, ⟨1 , by rw h⟩, _⟩,
579
+ rintro ⟨⟨c, hc⟩, h⟩,
580
+ exact (mul_eq_mul_right_iff.mp h).resolve_right (mem_non_zero_divisors_iff_ne_zero.mp hc)
581
+ end }
582
+
583
+ end fraction_ring
584
+
534
585
end padic_int
0 commit comments