Skip to content

Commit b4387f5

Browse files
committed
Merge branch 'DjangoPeeters-main'
1 parent 523aede commit b4387f5

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

FLT/AutomorphicRepresentation/Example.lean

+54-2
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,61 @@ noncomputable abbrev zHatsub : AddSubgroup QHat :=
340340
noncomputable abbrev zsub : AddSubgroup QHat :=
341341
(Int.castRingHom QHat : ℤ →+ QHat).range
342342

343-
lemma rat_meet_zHat : ratsub ⊓ zHatsub = zsub := sorry
343+
lemma ZMod.isUnit_natAbs {z : ℤ} {N : ℕ} : IsUnit (z.natAbs : ZMod N) ↔ IsUnit (z : ZMod N) := by
344+
cases z.natAbs_eq with
345+
| inl h | inr h => rw [h]; simp [-Int.natCast_natAbs]
344346

345-
lemma rat_join_zHat : ratsub ⊔ zHatsub = ⊤ := sorry
347+
@[simp]
348+
lemma _root_.Algebra.TensorProduct.one_tmul_intCast {R : Type*} {A : Type*} {B : Type*}
349+
[CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B] {z : ℤ} :
350+
(1 : A) ⊗ₜ[R] (z : B) = (z : TensorProduct R A B) := by
351+
rw [← map_intCast (F := B →ₐ[R] TensorProduct R A B),
352+
Algebra.TensorProduct.includeRight_apply]
353+
354+
lemma rat_meet_zHat : ratsub ⊓ zHatsub = zsub := by
355+
apply le_antisymm
356+
· intro x ⟨⟨l, hl⟩, ⟨r, hr⟩⟩
357+
simp only [AddMonoidHom.coe_coe, Algebra.TensorProduct.includeLeft_apply,
358+
Algebra.TensorProduct.includeRight_apply] at hl hr
359+
rcases lowestTerms x with ⟨⟨N, z, hNz, hx⟩, unique⟩
360+
have cop1 : IsCoprime l.den.toPNat' l.num := by
361+
simp_rw [IsCoprime, ZHat.intCast_val, ← ZMod.isUnit_natAbs, ZMod.isUnit_iff_coprime,
362+
PNat.toPNat'_coe l.den_pos]
363+
exact l.reduced
364+
have cop2 : IsCoprime 1 r := by
365+
simp only [IsCoprime, PNat.val_ofNat]
366+
exact isUnit_of_subsingleton _
367+
have hcanon : x = (1/(l.den : ℚ)) ⊗ₜ[ℤ] (l.num : ZHat) := by
368+
nth_rw 1 [← hl, ← Rat.num_div_den l, ← mul_one ((l.num : ℚ) / l.den), div_mul_comm,
369+
mul_comm, ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul, mul_one]
370+
rw [← PNat.toPNat'_coe l.den_pos, hx] at hcanon
371+
obtain ⟨rfl, rfl⟩ := unique _ _ _ _ ⟨hNz, cop1, hcanon⟩
372+
have : 1 = 1 / (((1 : ℕ+) : ℕ) : ℚ) := by simp
373+
nth_rw 1 [← hx, ← hr, this] at hcanon
374+
use l.num; rw [hx, (unique _ 1 _ r ⟨hNz, cop2, hcanon.symm⟩).1]
375+
simp
376+
· exact fun x ⟨k, hk⟩ ↦ by constructor <;> (use k; simp; exact hk)
377+
378+
lemma rat_join_zHat : ratsub ⊔ zHatsub = ⊤ := by
379+
rw [eq_top_iff]
380+
intro x _
381+
rcases x.canonicalForm with ⟨N, z, hNz⟩
382+
rcases ZHat.nat_dense N z with ⟨q, r, hz, _⟩
383+
have h : z - r = N * q := sub_eq_of_eq_add hz
384+
rw [AddSubgroup.mem_sup]
385+
use ((r : ℤ) / N : ℚ) ⊗ₜ[ℤ] 1
386+
constructor
387+
· simp
388+
use 1 ⊗ₜ[ℤ] q
389+
constructor
390+
· simp
391+
nth_rw 1 [← mul_one ((r : ℤ) / N : ℚ), div_mul_comm,
392+
mul_comm, ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul, mul_one]
393+
have : 1 = 1 / (N : ℚ) * (N : ℤ) := by simp
394+
nth_rw 2 [this]
395+
rw [mul_comm, ← zsmul_eq_mul, TensorProduct.smul_tmul, zsmul_eq_mul]
396+
norm_cast; rw [← h, ← TensorProduct.tmul_add]
397+
simp [hNz]
346398

347399
end additive_structure_of_QHat
348400

blueprint/src/chapter/ch05automorphicformexample.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ \section{Additive structure of \texorpdfstring{$\Qhat$}{Qhat}.}
451451
\leanok
452452
The intersection of $\Q$ and $\Zhat$ in $\Qhat$ is $\Z$.
453453
\end{lemma}
454-
\begin{proof}
454+
\begin{proof} \leanok
455455
Clearly $\Z\subseteq\Q\cap\Zhat$. Now suppose that $x\in\Q\cap\Zhat$.
456456
Because $x$ is rational we can write it as $\frac{A}{B}\otimes_t1$ for some
457457
fraction $A/B$ in lowest terms, and hence $x=A/B$ where now we regard $A\in\Zhat$
@@ -468,7 +468,7 @@ \section{Additive structure of \texorpdfstring{$\Qhat$}{Qhat}.}
468468
More precisely, every element of $\Qhat$ can be written as $q+z$ with $q\in\Q$ and $z\in\Zhat$,
469469
or more precisely as $q\otimes_t 1+1\otimes_t z$.
470470
\end{lemma}
471-
\begin{proof}
471+
\begin{proof} \leanok
472472
Write $x\in\Qhat$ as $x=z/N$ in lowest terms. Lift $z_N$ to an integer $t$ and observe
473473
that $(z-t)_N=0$, hence $z-t=Ny$ for some $y\in\Zhat$. Now $x=t/N+y\in\Q+\Zhat$.
474474
\end{proof}

0 commit comments

Comments
 (0)