chars int64 40 24k | content_type stringclasses 9
values | id stringlengths 13 64 | source stringclasses 5
values | subset stringclasses 31
values | text stringlengths 40 24k |
|---|---|---|---|---|---|
279 | leanexplore_declaration | leanexplore:379919 | leanexplore_sqlite | leanexplore_declarations | lemma coe_norm (z : 𝓞) :
(norm z : ℝ) =
(z.re - 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi) ^ 2 +
(z.im_i + 2⁻¹ * z.im_o - 2⁻¹ * z.im_oi) ^ 2 +
(2⁻¹ * z.im_o + 2⁻¹ * z.im_oi) ^ 2 +
(2⁻¹ * z.im_o - 2⁻¹ * z.im_oi) ^ 2 := by
rw [norm]
field_simp
norm_cast
ring |
46 | leanexplore_declaration | leanexplore:379920 | leanexplore_sqlite | leanexplore_declarations | lemma norm_zero : norm 0 = 0 := by simp [norm] |
45 | leanexplore_declaration | leanexplore:379921 | leanexplore_sqlite | leanexplore_declarations | lemma norm_one : norm 1 = 1 := by simp [norm] |
253 | leanexplore_declaration | leanexplore:379922 | leanexplore_sqlite | leanexplore_declarations | lemma norm_mul (x y : 𝓞) : norm (x * y) = norm x * norm y := by
rw [← Int.cast_inj (α := 𝓞)]
simp_rw [norm_eq_mul_conj, star_mul]
rw [mul_assoc, ← mul_assoc y, ← norm_eq_mul_conj]
rw [Int.cast_comm, ← mul_assoc, ← norm_eq_mul_conj, Int.cast_mul] |
105 | leanexplore_declaration | leanexplore:379923 | leanexplore_sqlite | leanexplore_declarations | lemma norm_nonneg (x : 𝓞) : 0 ≤ norm x := by
rw [← Int.cast_nonneg_iff (R := ℝ), coe_norm]
positivity |
1,071 | leanexplore_declaration | leanexplore:379924 | leanexplore_sqlite | leanexplore_declarations | lemma norm_eq_zero (x : 𝓞) : norm x = 0 ↔ x = 0 := by
constructor
swap
· rintro rfl; exact norm_zero
intro h
rw [← Int.cast_eq_zero (α := ℝ), coe_norm] at h
field_simp at h
norm_cast at h
have h4 := eq_zero_of_add_nonpos_right (by positivity) (by positivity) h.le
rw [sq_eq_zero_iff, sub_eq_zero] at h... |
219 | leanexplore_declaration | leanexplore:379925 | leanexplore_sqlite | leanexplore_declarations | lemma normSq_toQuaternion (z : 𝓞) : normSq (toQuaternion z) = norm z := by
apply coe_injective
rw [← self_mul_star, ← toQuaternion_star, ← toQuaternion_mul, ← norm_eq_mul_conj,
toQuaternion_intCast, coe_intCast] |
1,963 | leanexplore_declaration | leanexplore:379926 | leanexplore_sqlite | leanexplore_declarations | lemma exists_near (a : ℍ) : ∃ q : 𝓞, dist a (toQuaternion q) < 1 := by
have four_inv : (4⁻¹ : ℝ) = 2⁻¹ ^ 2 := by norm_num
have (r : ℝ) : (r - round r) ^ 2 ≤ 4⁻¹ := by
rw [four_inv, sq_le_sq]
apply (abs_sub_round _).trans_eq
rw [abs_of_nonneg]
all_goals norm_num
let x := round a.re
let y := roun... |
1,022 | leanexplore_declaration | leanexplore:379927 | leanexplore_sqlite | leanexplore_declarations | lemma quot_rem (a b : 𝓞) (hb : b ≠ 0) : ∃ q r : 𝓞, a = q * b + r ∧ norm r < norm b := by
let a' := toQuaternion a
let b' := toQuaternion b
have hb' : b' ≠ 0 := toQuaternion_ne_zero_iff.mpr hb
let q' := a' / b'
obtain ⟨q : 𝓞, hq : dist q' (toQuaternion q) < 1⟩ : ∃ _, _ := exists_near q'
refine ⟨q, a - q *... |
1,223 | leanexplore_declaration | leanexplore:379928 | leanexplore_sqlite | leanexplore_declarations | lemma left_ideal_princ (I : Submodule 𝓞 𝓞) : ∃ a : 𝓞, I = Submodule.span 𝓞 {a} := by
by_cases h_bot : I = ⊥
· use 0
rw [Eq.comm]
simp only [h_bot, Submodule.span_singleton_eq_bot]
let S := {a : 𝓞 // a ∈ I ∧ a ≠ 0}
have : Nonempty S := by
simp only [ne_eq, nonempty_subtype, S]
exact Submodul... |
109 | leanexplore_declaration | leanexplore:379929 | leanexplore_sqlite | leanexplore_declarations | /-- The base change of the Hurwitz quaternions to ZHat. -/
noncomputable def HurwitzHat : Type := 𝓞 ⊗[ℤ] ZHat |
93 | leanexplore_declaration | leanexplore:379930 | leanexplore_sqlite | leanexplore_declarations | /-- The base change of the Hurwitz quaternions to ZHat. -/
scoped notation "𝓞^" => HurwitzHat |
66 | leanexplore_declaration | leanexplore:379931 | leanexplore_sqlite | leanexplore_declarations | noncomputable instance : Ring 𝓞^ := Algebra.TensorProduct.instRing |
95 | leanexplore_declaration | leanexplore:379932 | leanexplore_sqlite | leanexplore_declarations | /-- The quaternion algebra ℚ + ℚi + ℚj + ℚk. -/
noncomputable def HurwitzRat : Type := ℚ ⊗[ℤ] 𝓞 |
81 | leanexplore_declaration | leanexplore:379933 | leanexplore_sqlite | leanexplore_declarations | /-- The quaternion algebra ℚ + ℚi + ℚj + ℚk. -/
scoped notation "D" => HurwitzRat |
65 | leanexplore_declaration | leanexplore:379934 | leanexplore_sqlite | leanexplore_declarations | noncomputable instance : Ring D := Algebra.TensorProduct.instRing |
185 | leanexplore_declaration | leanexplore:379935 | leanexplore_sqlite | leanexplore_declarations | /-- The "profinite Hurwitz quaternions" over the finite adeles of ℚ; a free rank 4 module
generated by 1, i, j, and (1+i+j+k)/2. -/
noncomputable def HurwitzRatHat : Type := D ⊗[ℤ] ZHat |
169 | leanexplore_declaration | leanexplore:379936 | leanexplore_sqlite | leanexplore_declarations | /-- The "profinite Hurwitz quaternions" over the finite adeles of ℚ; a free rank 4 module
generated by 1, i, j, and (1+i+j+k)/2. -/
scoped notation "D^" => HurwitzRatHat |
66 | leanexplore_declaration | leanexplore:379937 | leanexplore_sqlite | leanexplore_declarations | noncomputable instance : Ring D^ := Algebra.TensorProduct.instRing |
153 | leanexplore_declaration | leanexplore:379938 | leanexplore_sqlite | leanexplore_declarations | /-- The inclusion from D=ℚ+ℚi+ℚj+ℚk to D ⊗ 𝔸, with 𝔸 the finite adeles of ℚ. -/
noncomputable abbrev j₁ : D →ₐ[ℤ] D^ := Algebra.TensorProduct.includeLeft |
69 | leanexplore_declaration | leanexplore:379939 | leanexplore_sqlite | leanexplore_declarations | lemma injective_hRat :
Function.Injective j₁ := sorry -- flatness |
75 | leanexplore_declaration | leanexplore:379940 | leanexplore_sqlite | leanexplore_declarations | noncomputable instance : Ring (ℚ ⊗[ℤ] 𝓞^) := Algebra.TensorProduct.instRing |
77 | leanexplore_declaration | leanexplore:379941 | leanexplore_sqlite | leanexplore_declarations | noncomputable instance : Ring (D ⊗[ℤ] ZHat) := Algebra.TensorProduct.instRing |
307 | leanexplore_declaration | leanexplore:379942 | leanexplore_sqlite | leanexplore_declarations | /-- The inclusion from the profinite Hurwitz quaternions to to 𝔸+𝔸i+𝔸j+𝔸k,
with 𝔸 the finite adeles of ℚ. -/
noncomputable abbrev j₂ : 𝓞^ →ₐ[ℤ] D^ :=
((Algebra.TensorProduct.assoc ℤ ℤ ℤ ℚ 𝓞 ZHat).symm : ℚ ⊗[ℤ] 𝓞^ ≃ₐ[ℤ] D ⊗[ℤ] ZHat).toAlgHom.comp
(Algebra.TensorProduct.includeRight : 𝓞^ →ₐ[ℤ] ℚ ⊗[ℤ] 𝓞^) |
69 | leanexplore_declaration | leanexplore:379943 | leanexplore_sqlite | leanexplore_declarations | lemma injective_zHat :
Function.Injective j₂ := sorry -- flatness |
102 | leanexplore_declaration | leanexplore:379944 | leanexplore_sqlite | leanexplore_declarations | lemma canonicalForm (z : D^) : ∃ (N : ℕ+) (z' : 𝓞^), z = j₁ ((N⁻¹ : ℚ) ⊗ₜ 1 : D) * j₂ z' := by
sorry |
87 | leanexplore_declaration | leanexplore:379945 | leanexplore_sqlite | leanexplore_declarations | lemma completed_units (z : D^ˣ) : ∃ (u : Dˣ) (v : 𝓞^ˣ), (z : D^) = j₁ u * j₂ v := sorry |
1,040 | leanexplore_declaration | leanexplore:379946 | leanexplore_sqlite | leanexplore_declarations | /-- We define the profinite completion of ℤ explicitly as compatible elements of ℤ/Nℤ for
all positive integers `N`. We declare it as a subring of `∏_{N ≥ 1} (ℤ/Nℤ)`, and then promote it
to a type. -/
def ZHat : Type := {
carrier := { f : Π M : ℕ+, ZMod M | ∀ (D N : ℕ+) (h : (D : ℕ) ∣ N),
ZMod.castHom h (ZMod D) ... |
108 | leanexplore_declaration | leanexplore:379948 | leanexplore_sqlite | leanexplore_declarations | instance : DFunLike ZHat ℕ+ (fun (N : ℕ+) ↦ ZMod N) where
coe z := z.1
coe_injective' M N := by simp_all |
204 | leanexplore_declaration | leanexplore:379949 | leanexplore_sqlite | leanexplore_declarations | /-- The canonical "reduce mod M" map from `ZHat` to `ℤ/Mℤ`. -/
def toZMod (M : ℕ+) : ZHat →+* ZMod M where
toFun x := x M
map_one' := rfl
map_mul' _ _ := rfl
map_zero' := rfl
map_add' _ _ := rfl |
62 | leanexplore_declaration | leanexplore:379950 | leanexplore_sqlite | leanexplore_declarations | lemma toZMod_def (M : ℕ+) (X : ZHat) : X.toZMod M = X M := rfl |
98 | leanexplore_declaration | leanexplore:379951 | leanexplore_sqlite | leanexplore_declarations | lemma prop (z : ZHat) (D N : ℕ+) (h : (D : ℕ) ∣ N) : ZMod.castHom h (ZMod D) (z N) = z D := z.2 .. |
95 | leanexplore_declaration | leanexplore:379952 | leanexplore_sqlite | leanexplore_declarations | @[ext]
lemma ext (x y : ZHat) (h : ∀ n : ℕ+, x n = y n) : x = y :=
Subtype.ext <| funext <| h |
66 | leanexplore_declaration | leanexplore:379953 | leanexplore_sqlite | leanexplore_declarations | @[ext]
lemma ext (x y : ZHat) (h : ∀ n : ℕ+, x n = y n) : x = y := |
114 | leanexplore_declaration | leanexplore:379954 | leanexplore_sqlite | leanexplore_declarations | @[simp] lemma zero_val (n : ℕ+) : (0 : ZHat) n = 0 := rfl
@[simp] lemma one_val (n : ℕ+) : (1 : ZHat) n = 1 := rfl |
114 | leanexplore_declaration | leanexplore:379955 | leanexplore_sqlite | leanexplore_declarations | @[simp] lemma one_val (n : ℕ+) : (1 : ZHat) n = 1 := rfl
@[simp] lemma ofNat_val (m : ℕ) [m.AtLeastTwo] (n : ℕ+) : |
198 | leanexplore_declaration | leanexplore:379956 | leanexplore_sqlite | leanexplore_declarations | @[simp] lemma ofNat_val (m : ℕ) [m.AtLeastTwo] (n : ℕ+) :
(OfNat.ofNat m : ZHat) n = (OfNat.ofNat m : ZMod n) := rfl
@[simp] lemma natCast_val (m : ℕ) (n : ℕ+) : (m : ZHat) n = (m : ZMod n) := rfl |
159 | leanexplore_declaration | leanexplore:379957 | leanexplore_sqlite | leanexplore_declarations | @[simp] lemma natCast_val (m : ℕ) (n : ℕ+) : (m : ZHat) n = (m : ZMod n) := rfl
@[simp] lemma intCast_val (m : ℤ) (n : ℕ+) : (m : ZHat) n = (m : ZMod n) := rfl |
79 | leanexplore_declaration | leanexplore:379958 | leanexplore_sqlite | leanexplore_declarations | @[simp] lemma intCast_val (m : ℤ) (n : ℕ+) : (m : ZHat) n = (m : ZMod n) := rfl |
50 | leanexplore_declaration | leanexplore:379959 | leanexplore_sqlite | leanexplore_declarations | instance commRing : CommRing ZHat := inferInstance |
155 | leanexplore_declaration | leanexplore:379960 | leanexplore_sqlite | leanexplore_declarations | lemma zeroNeOne : (0 : ZHat) ≠ 1 := by
intro h
have h2 : (0 : ZHat) 2 = (1 : ZHat) 2 := by simp [h]
rw [zero_val, one_val] at h2
revert h2 ; decide |
58 | leanexplore_declaration | leanexplore:379961 | leanexplore_sqlite | leanexplore_declarations | instance nontrivial : Nontrivial ZHat := ⟨0, 1, zeroNeOne⟩ |
289 | leanexplore_declaration | leanexplore:379962 | leanexplore_sqlite | leanexplore_declarations | instance charZero : CharZero ZHat := ⟨ fun a b h ↦ by
rw [ZHat.ext_iff] at h
specialize h ⟨_, (max a b).succ_pos⟩
apply_fun ZMod.val at h
rwa [natCast_val, ZMod.val_cast_of_lt, natCast_val, ZMod.val_cast_of_lt] at h
· simp [Nat.succ_eq_add_one]
· simp [Nat.succ_eq_add_one]
⟩ |
505 | leanexplore_declaration | leanexplore:379963 | leanexplore_sqlite | leanexplore_declarations | /-- A nonarchimedean analogue `0! + 1! + 2! + ⋯` of `e = 1/0! + 1/1! + 1/2! + ⋯`.
It is defined as the function whose value at `ZMod n` is the sum of `i!` for `0 ≤ i < n`. -/
def e : ZHat := ⟨fun (n : ℕ+) ↦ ∑ i ∈ range (n : ℕ), i !, by
intros D N hDN
dsimp only
obtain ⟨k, hk⟩ := exists_add_of_le <| le_of_dvd N.po... |
71 | leanexplore_declaration | leanexplore:379964 | leanexplore_sqlite | leanexplore_declarations | lemma e_def (n : ℕ+) : e n = ∑ i ∈ range (n : ℕ), (i ! : ZMod n) := rfl |
449 | leanexplore_declaration | leanexplore:379965 | leanexplore_sqlite | leanexplore_declarations | lemma _root_.Nat.sum_factorial_lt_factorial_succ {j : ℕ} (hj : 1 < j) :
∑ i ∈ range (j + 1), i ! < (j + 1) ! := by
calc
∑ i ∈ range (j + 1), i ! < ∑ _i ∈ range (j + 1), j ! := ?_
_ = (j + 1) * (j !) := by rw [sum_const, card_range, smul_eq_mul]
_ = (j + 1)! := Nat.factorial_succ _
apply sum_lt_sum (... |
347 | leanexplore_declaration | leanexplore:379966 | leanexplore_sqlite | leanexplore_declarations | lemma _root_.Nat.sum_factorial_lt_two_mul_factorial {j : ℕ} (hj : 3 ≤ j) :
∑ i ∈ range (j + 1), i ! < 2 * j ! := by
induction j, hj using Nat.le_induction with
| base => simp [sum_range_succ, factorial_succ]
| succ j hj ih =>
rw [two_mul] at ih ⊢
rw [sum_range_succ]
gcongr
apply sum_factorial_... |
371 | leanexplore_declaration | leanexplore:379967 | leanexplore_sqlite | leanexplore_declarations | lemma e_factorial_succ (j : ℕ) :
e ⟨(j + 1)!, by positivity⟩ = ∑ i ∈ range (j + 1), i ! := by
simp_rw [e_def, PNat.mk_coe, cast_sum]
obtain ⟨k, hk⟩ := exists_add_of_le <| self_le_factorial (j + 1)
simp_rw [hk, sum_range_add, add_eq_left]
refine sum_eq_zero (fun i _ => ?_)
rw [ZMod.natCast_eq_zero_iff]
e... |
2,091 | leanexplore_declaration | leanexplore:379968 | leanexplore_sqlite | leanexplore_declarations | /-- Nonarchimedean $e$ is not an integer. -/
lemma e_not_in_Int : ∀ a : ℤ, e ≠ a := by
rintro (a|a) ha
· obtain ⟨j, honelt, hj⟩ : ∃ j : ℕ, 1 < j ∧ a < ∑ i ∈ range (j + 1), i ! := by
refine ⟨a + 2, ?_, ?_⟩
· simp only [lt_add_iff_pos_left, add_pos_iff, zero_lt_one, or_true]
rw [sum_range_add]
... |
210 | leanexplore_declaration | leanexplore:379969 | leanexplore_sqlite | leanexplore_declarations | lemma torsionfree_aux (a b : ℕ) [NeZero b] (h : a ∣ b) (x : ZMod b) (hx : a ∣ x.val) :
ZMod.castHom h (ZMod a) x = 0 := by
rw [ZMod.castHom_apply, ZMod.cast_eq_val]
obtain ⟨y, hy⟩ := hx
rw [hy]
simp |
86 | leanexplore_declaration | leanexplore:379970 | leanexplore_sqlite | leanexplore_declarations | @[simp]
lemma nat_mul_apply (N : ℕ) (z : ZHat) (k : ℕ+) : (N * z) k = N * (z k) := rfl |
88 | leanexplore_declaration | leanexplore:379971 | leanexplore_sqlite | leanexplore_declarations | @[simp]
lemma pnat_mul_apply (N : ℕ+) (z : ZHat) (k : ℕ+) : (N * z) k = N * (z k) := rfl |
438 | leanexplore_declaration | leanexplore:379972 | leanexplore_sqlite | leanexplore_declarations | theorem eq_zero_of_mul_eq_zero (N : ℕ+) (a : ZHat) (ha : N * a = 0) : a = 0 := by
ext j
rw [zero_val, ← a.prop j (N * j) (by simp)]
apply torsionfree_aux
apply Nat.dvd_of_mul_dvd_mul_left N.pos
rw [← PNat.mul_coe]
apply Nat.dvd_of_mod_eq_zero
have : N * a (N * j) = 0 := by
rw [← pnat_mul_apply]
si... |
226 | leanexplore_declaration | leanexplore:379973 | leanexplore_sqlite | leanexplore_declarations | lemma torsionfree (N : ℕ+) : Function.Injective (fun z : ZHat ↦ N * z) := by
rw [← AddMonoidHom.coe_mulLeft, injective_iff_map_eq_zero]
intro a ha
rw [AddMonoidHom.coe_mulLeft] at ha
exact eq_zero_of_mul_eq_zero N a ha |
713 | leanexplore_declaration | leanexplore:379974 | leanexplore_sqlite | leanexplore_declarations | instance ZHat_flat : Module.Flat ℤ ZHat := by
rw [IsDedekindDomain.flat_iff_torsion_eq_bot]
rw [eq_bot_iff]
intro x hx
simp only [Submodule.mem_torsion'_iff, Subtype.exists, Submonoid.mk_smul, zsmul_eq_mul,
exists_prop, Submodule.mem_bot, mem_nonZeroDivisors_iff_ne_zero] at hx ⊢
obtain ⟨N, hN⟩ := hx
cas... |
468 | leanexplore_declaration | leanexplore:379975 | leanexplore_sqlite | leanexplore_declarations | lemma y_mul_N_eq_z (N : ℕ+) (z : ZHat) (hz : z N = 0) (j : ℕ+) :
N * ((z (N * j)).val / (N : ℕ) : ZMod j) = z j := by
have hhj := z.prop N (N * j) (by simp only [PNat.mul_coe, dvd_mul_right])
rw [hz, ZMod.castHom_apply, ZMod.cast_eq_val, ZMod.natCast_eq_zero_iff] at hhj
rw [← Nat.cast_mul, mul_comm, Nat.div_m... |
1,094 | leanexplore_declaration | leanexplore:379976 | leanexplore_sqlite | leanexplore_declarations | lemma multiples (N : ℕ+) (z : ZHat) : (∃ (y : ZHat), N * y = z) ↔ z N = 0 := by
constructor
· intro ⟨y, hy⟩
rw [← hy]
change N * (y N) = 0
simp
· intro h
let y : ZHat := {
val := fun j ↦ (z (N * j)).val / (N : ℕ)
property := by
intro j k hjk
have hj := z.prop N (N * j) ... |
288 | leanexplore_declaration | leanexplore:379977 | leanexplore_sqlite | leanexplore_declarations | lemma nat_dense (N : ℕ+) (z : ZHat) : ∃ (q : ZHat) (r : ℕ), z = N * q + r ∧ r < N := by
let r : ℕ := (z N : ZMod N).val
have h : (z - r) N = 0 := by change z N - r = 0; simp [r]
rw [← multiples] at h
obtain ⟨q, hq⟩ := h
exact ⟨q, r, by linear_combination -hq, ZMod.val_lt (z N)⟩ |
139 | leanexplore_declaration | leanexplore:379978 | leanexplore_sqlite | leanexplore_declarations | /-- The "profinite completion" of ℚ is defined to be `ℚ ⊗ ZHat`, with `ZHat` the profinite
completion of `ℤ`. -/
abbrev QHat := ℚ ⊗[ℤ] ZHat |
1,003 | leanexplore_declaration | leanexplore:379979 | leanexplore_sqlite | leanexplore_declarations | lemma canonicalForm (z : QHat) : ∃ (N : ℕ+) (z' : ZHat), z = (1 / N : ℚ) ⊗ₜ z' := by
induction z using TensorProduct.induction_on with
| zero =>
refine ⟨1, 0, ?_⟩
simp
| tmul q z =>
refine ⟨⟨q.den, q.den_pos ⟩, q.num * z, ?_⟩
simp_rw [← zsmul_eq_mul, TensorProduct.tmul_smul, TensorProduct.smul_tmu... |
56 | leanexplore_declaration | leanexplore:379980 | leanexplore_sqlite | leanexplore_declarations | def IsCoprime (N : ℕ+) (z : ZHat) : Prop := IsUnit (z N) |
399 | leanexplore_declaration | leanexplore:379981 | leanexplore_sqlite | leanexplore_declarations | lemma isUnit_iff_coprime (n : ℕ) (m : ZMod n) : IsUnit m ↔ m.val.Coprime n := by
refine ⟨fun H ↦ ?_, fun H ↦ ?_⟩
· have H' := val_coe_unit_coprime H.unit
rwa [IsUnit.unit_spec] at H'
let m' : (ZMod n)ˣ := {
val := m
inv := m⁻¹
val_inv := by rw [mul_inv_eq_gcd, H.gcd_eq_one, Nat.cast_one]
inv_v... |
158 | leanexplore_declaration | leanexplore:379982 | leanexplore_sqlite | leanexplore_declarations | lemma isCoprime_iff_coprime (N : ℕ+) (z : ZHat) : IsCoprime N z ↔ Nat.Coprime N (z N).val := by
unfold IsCoprime
rw [isUnit_iff_coprime, Nat.coprime_comm] |
79 | leanexplore_declaration | leanexplore:379983 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev i₂ : ZHat →ₐ[ℤ] QHat := Algebra.TensorProduct.includeRight |
563 | leanexplore_declaration | leanexplore:379984 | leanexplore_sqlite | leanexplore_declarations | lemma injective_zHat :
Function.Injective i₂ := by
intro a b h
have h₁ := LinearMap.rTensor_tmul ZHat (f := Algebra.linearMap ℤ ℚ) a 1
have h₂ := LinearMap.rTensor_tmul ZHat (f := Algebra.linearMap ℤ ℚ) b 1
simp only [Algebra.linearMap_apply, map_one] at h₁ h₂
dsimp at h
rw [← h₁... |
119 | leanexplore_declaration | leanexplore:379985 | leanexplore_sqlite | leanexplore_declarations | instance nontrivial_QHat : Nontrivial QHat where
exists_pair_ne := ⟨1 ⊗ₜ 0, 1 ⊗ₜ 1, injective_zHat.ne ZHat.zeroNeOne⟩ |
75 | leanexplore_declaration | leanexplore:379986 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev i₁ : ℚ →ₐ[ℤ] QHat := Algebra.TensorProduct.includeLeft |
81 | leanexplore_declaration | leanexplore:379987 | leanexplore_sqlite | leanexplore_declarations | lemma injective_rat :
Function.Injective i₁ := RingHom.injective i₁.toRingHom |
101 | leanexplore_declaration | leanexplore:379988 | leanexplore_sqlite | leanexplore_declarations | theorem PNat.lcm_comm (m n : ℕ+) : PNat.lcm m n = PNat.lcm n m := PNat.eq <| by
simp [Nat.lcm_comm] |
6,352 | leanexplore_declaration | leanexplore:379989 | leanexplore_sqlite | leanexplore_declarations | lemma lowestTerms (x : QHat) : (∃ N z, IsCoprime N z ∧ x = (1 / N : ℚ) ⊗ₜ z) ∧
(∀ N₁ N₂ z₁ z₂,
IsCoprime N₁ z₁ ∧ IsCoprime N₂ z₂ ∧ (1 / N₁ : ℚ) ⊗ₜ z₁ = (1 / N₂ : ℚ) ⊗ₜ[ℤ] z₂ →
N₁ = N₂ ∧ z₁ = z₂) := by
constructor
· -- Existence: by the previous lemma, an arbitrary element [x] can be written as z/N;
... |
76 | leanexplore_declaration | leanexplore:379990 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev ratsub : AddSubgroup QHat :=
(i₁ : ℚ →+ QHat).range |
80 | leanexplore_declaration | leanexplore:379991 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev zHatsub : AddSubgroup QHat :=
(i₂ : ZHat →+ QHat).range |
90 | leanexplore_declaration | leanexplore:379992 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev zsub : AddSubgroup QHat :=
(Int.castRingHom QHat : ℤ →+ QHat).range |
156 | leanexplore_declaration | leanexplore:379993 | leanexplore_sqlite | leanexplore_declarations | lemma ZMod.isUnit_natAbs {z : ℤ} {N : ℕ} : IsUnit (z.natAbs : ZMod N) ↔ IsUnit (z : ZMod N) := by
cases z.natAbs_eq with
| inl h | inr h => rw [h]; simp |
330 | leanexplore_declaration | leanexplore:379994 | leanexplore_sqlite | leanexplore_declarations | @[simp]
lemma _root_.Algebra.TensorProduct.one_tmul_intCast {R : Type*} {A : Type*} {B : Type*}
[CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B] {z : ℤ} :
(1 : A) ⊗ₜ[R] (z : B) = (z : TensorProduct R A B) := by
rw [← map_intCast (F := B →ₐ[R] TensorProduct R A B),
Algebra.TensorProduct.includeRi... |
1,252 | leanexplore_declaration | leanexplore:379995 | leanexplore_sqlite | leanexplore_declarations | lemma rat_meet_zHat : ratsub ⊓ zHatsub = zsub := by
apply le_antisymm
· intro x ⟨⟨l, hl⟩, ⟨r, hr⟩⟩
simp only [AddMonoidHom.coe_coe, Algebra.TensorProduct.includeLeft_apply,
Algebra.TensorProduct.includeRight_apply] at hl hr
rcases lowestTerms x with ⟨⟨N, z, hNz, hx⟩, unique⟩
have cop1 : IsCoprime ... |
665 | leanexplore_declaration | leanexplore:379996 | leanexplore_sqlite | leanexplore_declarations | lemma rat_join_zHat : ratsub ⊔ zHatsub = ⊤ := by
rw [eq_top_iff]
intro x _
rcases x.canonicalForm with ⟨N, z, hNz⟩
rcases ZHat.nat_dense N z with ⟨q, r, hz, _⟩
have h : z - r = N * q := sub_eq_of_eq_add hz
rw [AddSubgroup.mem_sup]
use ((r : ℤ) / N : ℚ) ⊗ₜ[ℤ] 1
constructor
· simp
use 1 ⊗ₜ[ℤ] q
cons... |
89 | leanexplore_declaration | leanexplore:379997 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev unitsratsub : Subgroup QHatˣ :=
(Units.map (i₁ : ℚ →* QHat)).range |
93 | leanexplore_declaration | leanexplore:379998 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev unitszHatsub : Subgroup QHatˣ :=
(Units.map (i₂ : ZHat →* QHat)).range |
105 | leanexplore_declaration | leanexplore:379999 | leanexplore_sqlite | leanexplore_declarations | noncomputable abbrev unitszsub : Subgroup QHatˣ :=
(Units.map (Int.castRingHom QHat : ℤ →* QHat)).range |
2,829 | leanexplore_declaration | leanexplore:380000 | leanexplore_sqlite | leanexplore_declarations | lemma unitsrat_meet_unitszHat : unitsratsub ⊓ unitszHatsub = unitszsub := by
apply le_antisymm
· intro x ⟨⟨q, hxq⟩, ⟨zHat, hxzHat⟩⟩
obtain ⟨z, (hz : (z : QHat) = x)⟩ : (x : QHat) ∈ zsub := by
rw [← rat_meet_zHat]
exact ⟨⟨q, by simp [← hxq]⟩, zHat, by simp [← hxzHat]⟩
have znez : z ≠ 0 := by
... |
329 | leanexplore_declaration | leanexplore:380001 | leanexplore_sqlite | leanexplore_declarations | @[simp]
lemma _root_.Algebra.TensorProduct.intCast_tmul_one {R : Type*} {A : Type*} {B : Type*}
[CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B] {z : ℤ} :
(z : A) ⊗ₜ[R] (1 : B) = (z : TensorProduct R A B) := by
rw [← map_intCast (F := A →ₐ[R] TensorProduct R A B),
Algebra.TensorProduct.includeLe... |
330 | leanexplore_declaration | leanexplore:380002 | leanexplore_sqlite | leanexplore_declarations | @[simp]
lemma _root_.Algebra.TensorProduct.one_tmul_natCast {R : Type*} {A : Type*} {B : Type*}
[CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B] {n : ℕ} :
(1 : A) ⊗ₜ[R] (n : B) = (n : TensorProduct R A B) := by
rw [← map_natCast (F := B →ₐ[R] TensorProduct R A B),
Algebra.TensorProduct.includeRi... |
6,013 | leanexplore_declaration | leanexplore:380003 | leanexplore_sqlite | leanexplore_declarations | lemma unitsrat_join_unitszHat : unitsratsub ⊔ unitszHatsub = ⊤ := by
rw [eq_top_iff]
rintro y -
rcases canonicalForm y.val with ⟨N, x, hy⟩
rcases canonicalForm (y⁻¹.val) with ⟨N2, x2, hy2⟩
set xinv := (1 / (N * N2) : ℚ) ⊗ₜ[ℤ] x2 with xinv_def
have : (i₂ x) * xinv = 1 := by
rw [xinv_def, Algebra.TensorPr... |
305 | leanexplore_declaration | leanexplore:380004 | leanexplore_sqlite | leanexplore_declarations | lemma exists_ofAdd_natCast_of_le_one {x : ℤᵐ⁰} (hx : x ≠ 0) (hx' : x ≤ 1) :
∃ (k : ℕ), (Multiplicative.ofAdd (-(k : ℤ))) = x := by
lift x to Multiplicative ℤ using hx
norm_cast at hx'
obtain ⟨k, hk⟩ := Int.eq_ofNat_of_zero_le (Int.neg_nonneg_of_nonpos hx')
use k
rw [← hk, Int.neg_neg]
rfl |
290 | leanexplore_declaration | leanexplore:380005 | leanexplore_sqlite | leanexplore_declarations | lemma exists_ofAdd_natCast_lt {x : ℤᵐ⁰} (hx : x ≠ 0) :
∃ (k : ℕ), (Multiplicative.ofAdd (-(k : ℤ))) < x := by
obtain ⟨y, hnz, hyx⟩ := WithZero.exists_ne_zero_and_lt hx
lift y to Multiplicative ℤ using hnz
use y.natAbs
apply lt_of_le_of_lt _ hyx
norm_cast
exact inv_mabs_le y |
138 | leanexplore_declaration | leanexplore:380006 | leanexplore_sqlite | leanexplore_declarations | lemma ne_zero_of_some_le_intValuation {a : A} {m : Multiplicative ℤ} (h : m ≤ v.intValuation a)
: a ≠ 0 := by
rintro rfl
simp at h |
684 | leanexplore_declaration | leanexplore:380007 | leanexplore_sqlite | leanexplore_declarations | lemma emultiplicity_eq_of_valuation_eq_ofAdd {a : A} {k : ℕ}
(hv : v.intValuation a = (Multiplicative.ofAdd (-(k : ℤ)))) :
emultiplicity v.asIdeal (Ideal.span {a}) = k := by
classical
have hnz : a ≠ 0 := ne_zero_of_some_le_intValuation _ (le_of_eq hv.symm)
have hnb : Ideal.span {a} ≠ ⊥ := by
rwa [ne_e... |
1,854 | leanexplore_declaration | leanexplore:380008 | leanexplore_sqlite | leanexplore_declarations | /-- Given `a, b ∈ A` and `v b ≤ v a` we can find `y in A` such that `y` is close to `a / b` by
the valuation v. -/
lemma exists_adicValued_mul_sub_le {a b : A} {γ : WithZero (Multiplicative ℤ)} (hγ : γ ≠ 0)
(hle : γ ≤ v.intValuation a)
(hle' : v.intValuation b ≤ v.intValuation a) :
∃ y, v.intValuation (... |
2,280 | leanexplore_declaration | leanexplore:380009 | leanexplore_sqlite | leanexplore_declarations | lemma exists_adicValued_sub_lt_of_adicValued_le_one {x : (WithVal (v.valuation K))}
(γ : ((WithZero (Multiplicative ℤ)))ˣ) (hx : Valued.v x ≤ 1) :
∃a, Valued.v ((algebraMap A K a) - (x : v.adicCompletion K)) < γ.val := by
-- Write `x = n / d`
obtain ⟨⟨n, d, hd⟩, hnd⟩ := IsLocalization.surj (nonZeroDivisors ... |
301 | leanexplore_declaration | leanexplore:380010 | leanexplore_sqlite | leanexplore_declarations | instance : Valuation.IsRankOneDiscrete vK where
exists_generator_lt_one' := by
have h : (v.valuation K).IsRankOneDiscrete := Valuation.IsRankOneDiscrete.mk' (valuation K v)
exact ⟨h.generator, by rw [h.generator_zpowers_eq_valueGroup, adicCompletion_valueGroup_eq],
h.generator_lt_one⟩ |
1,782 | leanexplore_declaration | leanexplore:380011 | leanexplore_sqlite | leanexplore_declarations | /-- The closure of `A` in `K_v` is `𝒪_v`. -/
theorem closureAlgebraMapIntegers_eq_integers :
closure (algebraMap A (v.adicCompletion K)).range =
SetLike.coe (v.adicCompletionIntegers K) := by
apply subset_antisymm
-- We know `closure A ⊆ 𝒪_v` because `𝒪_v` is closed and `A ⊆ 𝒪_v`
· apply closure_minim... |
515 | leanexplore_declaration | leanexplore:380012 | leanexplore_sqlite | leanexplore_declarations | /-- `A` is dense in `𝒪_v`. -/
theorem denseRange_of_integerAlgebraMap :
DenseRange (algebraMap A (v.adicCompletionIntegers K)) := by
rw [denseRange_iff_closure_range, Set.eq_univ_iff_forall]
intro x
rw [closure_subtype]
suffices h : Subtype.val ''
Set.range ((algebraMap A ↥(adicCompletionIntegers K v... |
1,086 | leanexplore_declaration | leanexplore:380013 | leanexplore_sqlite | leanexplore_declarations | /-- An element of `𝒪_v` can be approximated by an element of `A`. -/
theorem exists_adicValued_sub_lt_of_adicCompletionInteger
(x : v.adicCompletionIntegers K) (γ : ℤᵐ⁰ˣ) :
∃a, Valued.v ((algebraMap A K a) - (x : v.adicCompletion K)) < γ.val := by
have h := closureAlgebraMapIntegers_eq_integers K v
rw [Set... |
199 | leanexplore_declaration | leanexplore:380014 | leanexplore_sqlite | leanexplore_declarations | /-- The maximal ideal of the integers of the completion of `v`. -/
noncomputable abbrev completionIdeal : Ideal (v.adicCompletionIntegers K) :=
IsLocalRing.maximalIdeal (adicCompletionIntegers K v) |
153 | leanexplore_declaration | leanexplore:380015 | leanexplore_sqlite | leanexplore_declarations | lemma mem_completionIdeal_iff (x : v.adicCompletionIntegers K) :
x ∈ completionIdeal K v ↔ Valued.v x.val < 1 :=
Valuation.mem_maximalIdeal_iff _ _ |
144 | leanexplore_declaration | leanexplore:380016 | leanexplore_sqlite | leanexplore_declarations | lemma algebraMap_completionIntegers (x : A) :
(algebraMap A (v.adicCompletionIntegers K) x) = (algebraMap A (v.adicCompletion K) x) :=
rfl |
260 | leanexplore_declaration | leanexplore:380017 | leanexplore_sqlite | leanexplore_declarations | instance : (v.completionIdeal K).LiesOver v.asIdeal where
over := by
rw [Ideal.under_def]
ext x
simp only [Ideal.mem_comap, mem_completionIdeal_iff, algebraMap_completionIntegers,
valuedAdicCompletion_eq_valuation, valuation_lt_one_iff_mem] |
333 | leanexplore_declaration | leanexplore:380018 | leanexplore_sqlite | leanexplore_declarations | /-- The canonical ring homomorphism from A / v to 𝓞ᵥ / v, where 𝓞ᵥ is the integers of the
completion Kᵥ of the field of fractions of A. -/
noncomputable def ResidueFieldToCompletionResidueField :
A ⧸ v.asIdeal →+* ResidueField (v.adicCompletionIntegers K) :=
Ideal.quotientMap _ (algebraMap _ _) <| le_of_eq Idea... |
1,083 | leanexplore_declaration | leanexplore:380019 | leanexplore_sqlite | leanexplore_declarations | /-- The canonical isomorphism from A / v to 𝓞ᵥ / v, where 𝓞ᵥ is the integers of the
completion Kᵥ of the field of fractions K of A. -/
noncomputable def ResidueFieldEquivCompletionResidueField :
A ⧸ v.asIdeal ≃+* ResidueField (v.adicCompletionIntegers K) := by
apply RingEquiv.ofBijective (ResidueFieldToCompleti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.