aboutsummaryrefslogtreecommitdiff
path: root/docs/af_code.tex
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2019-09-20 10:11:55 +0200
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2019-09-20 10:11:55 +0200
commitc1a5a3de06e21f616d1e5a5d99579d9437f2b12c (patch)
tree67d30384dd3f9ca54eb440d7965515b0d41d60e4 /docs/af_code.tex
parentec512abcc914e42a0a8fabb51b4106aec90773c5 (diff)
downloadkummer-degrees-c1a5a3de06e21f616d1e5a5d99579d9437f2b12c.tar.gz
kummer-degrees-c1a5a3de06e21f616d1e5a5d99579d9437f2b12c.zip
New documentation
Diffstat (limited to 'docs/af_code.tex')
-rw-r--r--docs/af_code.tex466
1 files changed, 0 insertions, 466 deletions
diff --git a/docs/af_code.tex b/docs/af_code.tex
deleted file mode 100644
index eefb98f..0000000
--- a/docs/af_code.tex
+++ /dev/null
@@ -1,466 +0,0 @@
1\documentclass[10pt,a4paper]{article}
2\usepackage[utf8]{inputenc}
3\usepackage{amsmath}
4\usepackage{amsthm}
5\usepackage[all]{xy}
6\usepackage{amsfonts}
7\usepackage{color}
8\usepackage{amssymb}
9\usepackage{float}
10\usepackage[a4paper, top=3cm, bottom=3cm, left=2.5cm, right=2.5cm]{geometry}
11\usepackage{listings}
12\usepackage{algorithm}
13%\usepackage{algorithmic}
14\usepackage{algpseudocode}
15
16\DeclareMathOperator{\alg}{alg}
17\DeclareMathOperator{\obj}{Obj}
18\DeclareMathOperator{\Hom}{Hom}
19\DeclareMathOperator{\End}{End}
20\DeclareMathOperator{\hol}{Hol}
21\DeclareMathOperator{\aut}{Aut}
22\DeclareMathOperator{\gal}{Gal}
23\DeclareMathOperator{\id}{id}
24\DeclareMathOperator{\res}{res}
25\DeclareMathOperator{\im}{Im}
26\DeclareMathOperator{\Id}{Id}
27\DeclareMathOperator{\fib}{Fib}
28\DeclareMathOperator{\spec}{Spec}
29\DeclareMathOperator{\proj}{Proj}
30\DeclareMathOperator{\trdeg}{trdeg}
31\DeclareMathOperator{\car}{char}
32\DeclareMathOperator{\Frac}{Frac}
33\DeclareMathOperator{\reduced}{red}
34\DeclareMathOperator{\real}{Re}
35\DeclareMathOperator{\imag}{Im}
36\DeclareMathOperator{\vol}{vol}
37\DeclareMathOperator{\den}{den}
38\DeclareMathOperator{\rank}{rank}
39\DeclareMathOperator{\lcm}{lcm}
40\DeclareMathOperator{\rad}{rad}
41\DeclareMathOperator{\ord}{ord}
42\DeclareMathOperator{\Br}{Br}
43\DeclareMathOperator{\inv}{inv}
44\DeclareMathOperator{\Nm}{Nm}
45\DeclareMathOperator{\Tr}{Tr}
46\DeclareMathOperator{\an}{an}
47\DeclareMathOperator{\op}{op}
48\DeclareMathOperator{\sep}{sep}
49\DeclareMathOperator{\unr}{unr}
50\DeclareMathOperator{\et}{\acute et}
51\DeclareMathOperator{\ev}{ev}
52\DeclareMathOperator{\gl}{GL}
53\DeclareMathOperator{\SL}{SL}
54\DeclareMathOperator{\mat}{Mat}
55\DeclareMathOperator{\ab}{ab}
56\DeclareMathOperator{\tors}{tors}
57\DeclareMathOperator{\ed}{ed}
58
59\newcommand{\grp}{\textsc{Grp}}
60\newcommand{\set}{\textsc{Set}}
61\newcommand{\x}{\mathbf{x}}
62\newcommand{\naturalto}{\overset{.}{\to}}
63\newcommand{\qbar}{\overline{\mathbb{Q}}}
64\newcommand{\zbar}{\overline{\mathbb{Z}}}
65
66\newcommand{\pro}{\mathbb{P}}
67\newcommand{\aff}{\mathbb{A}}
68\newcommand{\quat}{\mathbb{H}}
69\newcommand{\rea}{\mathbb{R}}
70\newcommand{\kiu}{\mathbb{Q}}
71\newcommand{\F}{\mathbb{F}}
72\newcommand{\zee}{\mathbb{Z}}
73\newcommand{\ow}{\mathcal{O}}
74\newcommand{\mcx}{\mathcal{X}}
75\newcommand{\mcy}{\mathcal{Y}}
76\newcommand{\mcs}{\mathcal{S}}
77\newcommand{\mca}{\mathcal{A}}
78\newcommand{\mcb}{\mathcal{B}}
79\newcommand{\mcf}{\mathcal{F}}
80\newcommand{\mcg}{\mathcal{G}}
81\newcommand{\mct}{\mathcal{T}}
82\newcommand{\mcq}{\mathcal{Q}}
83\newcommand{\mcr}{\mathcal{R}}
84\newcommand{\adl}{\mathbf{A}}
85\newcommand{\mbk}{\mathbf{k}}
86\newcommand{\m}{\mathfrak{m}}
87\newcommand{\p}{\mathfrak{p}}
88
89\newcommand{\kbar}{\overline{K}}
90
91\newtheorem{lemma}{Lemma}
92\newtheorem{proposition}[lemma]{Proposition}
93\newtheorem{conjecture}[lemma]{Conjecture}
94\newtheorem{corollary}[lemma]{Corollary}
95\newtheorem{definition}[lemma]{Definition}
96\newtheorem{theorem}[lemma]{Theorem}
97\newtheorem{cond-thm}[lemma]{Conditional Theorem}
98\theoremstyle{definition}
99\newtheorem{remark}[lemma]{Remark}
100
101\author{Sebastiano Tronto}
102
103
104\begin{document}
105
106We begin by giving the code for the function that computes the adelic failure, both in SageMath and in pseudocode. Then we procede to breaking it down into different subcases, in order to check that it computes the correct values.
107
108\section{The SageMath Code}
109
110The function \texttt{adelic\_failure\_gb} takes two parameters as input: a list $B=\{B_0,\dots, B_t\}$ and an integer $d$. Each $B_i$ is itself a list of elements of $G$, and we require the following:
111\begin{itemize}
112\item Each element of $B_i=\{B_{i,0},\dots,B_{i,t_i}\}$ has $2$-divisibility $i$, using the terminology of \cite{DebryPerucca}.
113\item $\mathcal{B}=\bigcup_{i=1}^t B_i$ is a $2$-maximal basis for $G$.
114\item The integer $d$ is either $-1$ or $1\leq d\leq t$. For $i\in\{1,\dots,t\}\setminus\{d\}$ we have $B_i\subseteq \mathbb{Q}_+$. If $d\neq -1$ we have $B_{d,0}<0$ and $B_{d,j}>0$ for $j\neq 0$.
115\end{itemize}
116The output is a list $A=\{A_1,\dots,A_{N_0}\}$, where each $A_n=\{A_{n,0},\dots,A_{n,r_n}\}$ is a list of pairs $A_{n,i}=(d_{n,i},f_{n,i})$. We have $N_0=\max(3,t+1)$ if $d=t$, while $N_0=\max(3,t)$ otherwise. For each $1\leq n\leq N_0$ and each $i\leq r_n$, the integer $d_{n,i}$ is a divisor of $M_0=d_{N_0,r_{N_0}}$ and a multiple of $2^i$, and $f_{n,i}$ is the ``adelic failure'' (old definition), i.e.:
117\begin{align*}
118f_{n,i}=\left[\mathbb{Q}_{2^i}\left(G^{1/2^i}\right)\cap \mathbb{Q}_{d_{i,n}}:\mathbb{Q}_{2^i}\right].
119\end{align*}
120
121\lstset{language=Python}
122\begin{lstlisting}
123def adelic_failure_gb( B, d ):
124
125 ad_fail = [] # The table to be returned at the end.
126
127 if d == len(B)-1:
128 N = max(3,len(B)+1)
129 else:
130 N = max(3,len(B))
131
132 # The shortlist grows at each step, so we build it incrementally.
133 shortlist = []
134 # The "special element" is (n,b) = \zeta_{2^n}\sqrt{b}.
135 special_element = (1,1)
136
137 M = 1 # M also grows with n.
138
139 for n in range( 1, N+1 ): # Read as: 1 \leq n \leq N
140
141 # We add the new elements to the shortlist, modifying M if needed.
142 # This is not done in case we are in the extra "fake" level.
143 if n-1 < len(B):
144 for g in B[n-1]:
145 if g < 0 and n > 1:
146 special_element = ( n+1, abs(g)^(1/(2^(n-1))) )
147 M = lcm( M, special_embed( special_element ) )
148 else:
149 b = g^(1/(2^(n-1))) # b is 2-indivisible
150 shortlist.append( b )
151 M = lcm( M, cyc_embed(b) )
152
153 # We add a root of an even power of the negative generator, as soon as
154 # we are beyond its level.
155 if d != -1 and n == d+2:
156 b = abs(B[d][0])^(1/2^d)
157 shortlist.append( b )
158 M = lcm( M, cyc_embed(b) )
159
160 M = lcm(M,2^n)
161
162 if n <= d:
163 M = lcm( M, 2^(n+1) )
164
165 if n == 1 and d >= 1:
166 shortlist.append(-1)
167 if n > 1 and -1 in shortlist:
168 shortlist.remove(-1)
169
170 aux = [] # Next line of ad_fail table
171
172 for dM in divisors( M ):
173 if dM % (2^n) != 0:
174 continue
175
176 S = [ product(s) for s in subsets( shortlist ) ]
177 H = [ cyc_embed( s ) for s in S ]
178 r = len( [ b for b in H if dM % b == 0 ] )
179
180 if n <= d and dM % (2^(n+1)) == 0 and n > 1:
181 r *= 2
182
183 if 8 in H and dM % 8 == 0 and (n >= 3 or (n == 2 and n <= d)):
184 r = r/2
185
186 if special_element != (1,1) and special_element[0] == n+1:
187 nothing_to_do = False
188 intersecting_QdM = False
189 for s in S:
190 new_special = ( n+1, special_element[1] * s )
191 m = special_embed( new_special )
192 if n == 2 and m == 4: # \zeta_8 times 2 times square
193 nothing_to_do = True
194 if dM % m == 0:
195 intersecting_QdM = True
196 if intersecting_QdM and not nothing_to_do:
197 r *= 2
198
199 aux.append( (dM,r) )
200
201 ad_fail.append(aux)
202
203 return ad_fail
204\end{lstlisting}
205
206We have used the following auxiliary functions:
207
208\begin{lstlisting}
209# Computes the minimal cyclotomic field containing \sqrt(b)
210def cyc_embed( b ):
211 m = squarefree_part(b)
212 if m%4 != 1:
213 m *= 4
214 return abs(m)
215
216# Computes the minimal cyclotomic field containing \zeta_{2^n}\sqrt(b)
217def special_embed( (n,b) ):
218 m = squarefree_part(b)
219 if n == 3 and m % 2 == 0:
220 return 4 * cyc_embed(m/2)
221 else:
222 return lcm( 2^n, cyc_embed(b) )
223\end{lstlisting}
224
225\section{The Pseudocode}
226We translate the SageMath code into pseudocode for ease of readability.
227
228\begin{algorithm}
229\caption{Compute the adelic failure}
230\begin{algorithmic}
231\State Let $B$, $t$, $d$ and $N$ as described in the previous section
232\State Let $M\leftarrow1$, $\texttt{special\_element}\leftarrow1$ and $\texttt{shortlist}\leftarrow[\,]$
233
234\State
235
236\For {$n=1$ to $N$}
237\If{$n-1<t$}
238\For{$g\in B_{n-1}$}
239\If{$g<0$ and $n>1$}
240\State $\texttt{special\_element}\leftarrow(n+1,\sqrt[2^{n-1}]{|g|})$
241\State $M\leftarrow\lcm(M,\texttt{special\_embed}(\texttt{special\_element}))$
242\Else
243\State Add $\sqrt[2^{n-1}]{g}$ to \texttt{shortlist}
244\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(g))$
245\EndIf
246\EndFor
247\EndIf
248
249\State
250
251\If{$n=d+2$ and $d\neq -1$}
252\State Add $\sqrt[2^{d}]{|B_{d,0}|}$ to \texttt{shortlist}
253\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(|B_{d,0}|))$
254\EndIf
255
256\State
257\If{$n\leq d$}
258\State $M\leftarrow\lcm(M,2^{n+1})$
259\Else
260\State $M\leftarrow\lcm(M,2^n)$
261\EndIf
262\State
263
264\If{$n=1$ and $d\geq 1$}
265\State Add $-1$ to \texttt{shortlist}
266\EndIf
267\State
268\If{$n>1$}
269\State Remove $-1$ from \texttt{shortlist} (if present)
270\EndIf
271\State
272\algstore{alg1}
273\end{algorithmic}
274\end{algorithm}
275\pagebreak
276
277\begin{algorithm}
278\begin{algorithmic}
279\algrestore{alg1}
280\ForAll{$d_M\in \texttt{divisors}(M)$ such that $2^n\,|\,M$}
281\State $S\leftarrow\left\{\prod_{x\in T}x\,|\,T\subseteq\texttt{shortlist}\right\}$
282\State $H\leftarrow\left\{\min\left\{x\in\mathbb{Z}_{>0}\,|\sqrt{s}\in \mathbb{Q}_x\right\}\,|\,s\in S\right\}$
283\State $r\leftarrow\# \left\{s\in S\,|\, \sqrt{s}\in\mathbb{Q}_{d_M}\right\}$
284\State
285\If{$q<n\leq d$ and $2^{n+1}\,|\,{d_M}$}
286\State $r\leftarrow 2r$
287\EndIf
288\State
289\If{$8\in H$ and $8\,|\,d_M$ and (either $n\geq 3$ or $n=2\leq d$)}
290\State $r\leftarrow r/2$
291\EndIf
292\State
293
294\If{$\texttt{special\_element}=\zeta_{2^{n+1}}\sqrt{b}$ for some $b\in\mathbb{Q}$}
295\State $\texttt{specials}\leftarrow\{\zeta_{2^{n+1}}\sqrt{bs}\,|\,s\in S\}$
296\If{$\exists x\in \texttt{specials}$ such that $x\in\mathbb{Q}_{d_M}$ and $\texttt{special\_embed}(s)\neq 4\,\forall s\in\texttt{specials}$}
297\State $r\leftarrow 2r$
298\EndIf
299\EndIf
300\State
301\State Declare $\left[\mathbb{Q}_{2^n}\left(\sqrt[2^n]{G}\right)\cap \mathbb{Q}_{d_M}:\mathbb{Q}_{2^n}\right]=r$.
302
303\EndFor
304\EndFor
305\end{algorithmic}
306\end{algorithm}
307
308\section{Pseudocode, the sub-cases}
309
310We divide the pseudocode in sub-cases.
311
312\subsection{Case $G\leq \mathbb{Q}_+^\times$}
313
314\begin{algorithm}
315\caption{Adelic failure, case $G\leq \mathbb{Q}^\times$}
316
317\begin{algorithmic}
318\For {$n=1$ to $N$}
319\For{$g\in B_{n-1}$}
320\State Add $\sqrt[2^{n-1}]{g}$ to \texttt{shortlist}
321\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(g))$
322\EndFor
323\State
324\State $M\leftarrow\lcm(M,2^n)$
325\State
326\ForAll{$d_M\in \texttt{divisors}(M)$ such that $2^n\,|\,M$}
327\State $S\leftarrow\left\{\prod_{x\in T}x\,|\,T\subseteq\texttt{shortlist}\right\}$
328\State $H\leftarrow\left\{\min\left\{x\in\mathbb{Z}_{>0}\,|\sqrt{s}\in \mathbb{Q}_x\right\}\,|\,s\in S\right\}$
329\State $r\leftarrow\# \left\{s\in S\,|\, \sqrt{s}\in\mathbb{Q}_{d_M}\right\}$
330%\State
331\State Declare $\left[\mathbb{Q}_{2^n}\left(\sqrt[2^n]{G}\right)\cap \mathbb{Q}_{d_M}:\mathbb{Q}_{2^n}\right]=\begin{cases}
332r/2&\text{ if }8\in H\text{ and }n\geq 3,\\
333r&\text{ otherwise}.
334\end{cases}$
335\EndFor
336\EndFor
337\end{algorithmic}
338
339\end{algorithm}
340\pagebreak
341\subsection{Case $d\neq -1$, $n\leq d$}
342For this and the following cases, we assume we are already inside the main \texttt{for} cycle, since we have particular assumptions on $n$.
343\begin{algorithm}
344\caption{Adelic failure, case $d\neq -1$, $n\leq d$}
345\begin{algorithmic}
346\For{$g\in B_{n-1}$}
347\State Add $\sqrt[2^{n-1}]{g}$ to \texttt{shortlist}
348\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(g))$
349\EndFor
350\State
351\State $M\leftarrow\lcm(M,2^{n+1})$
352\State
353\If{$n=1$ and $d\geq 1$}
354\State Add $-1$ to \texttt{shortlist}
355\EndIf
356\State
357\If{$n>1$}
358\State Remove $-1$ from \texttt{shortlist} (if present)
359\EndIf
360\State
361\ForAll{$d_M\in \texttt{divisors}(M)$ such that $2^n\,|\,M$}
362\State $S\leftarrow\left\{\prod_{x\in T}x\,|\,T\subseteq\texttt{shortlist}\right\}$
363\State $H\leftarrow\left\{\min\left\{x\in\mathbb{Z}_{>0}\,|\sqrt{s}\in \mathbb{Q}_x\right\}\,|\,s\in S\right\}$
364\State $r\leftarrow\# \left\{s\in S\,|\, \sqrt{s}\in\mathbb{Q}_{d_M}\right\}$
365\State
366\If{$n>1$ and $2^{n+1}\,|\,d_M$}
367\State $r\leftarrow 2r$
368\EndIf
369\State Declare $\left[\mathbb{Q}_{2^n}\left(\sqrt[2^n]{G}\right)\cap \mathbb{Q}_{d_M}:\mathbb{Q}_{2^n}\right]=\begin{cases}
370r/2&\text{ if }8\in H\text{ and }n\geq 3,\\
371r/2&\text{ if }8\in H\text{ and }n=2\text{ and }8\,|\,d_M\\
372r&\text{ otherwise}.
373\end{cases}$
374\EndFor
375\end{algorithmic}
376
377\end{algorithm}
378
379
380\pagebreak
381\subsection{Case $d\neq -1$, $n\geq d+2$}
382
383\begin{algorithm}
384\caption{Adelic failure, case $d\neq -1$, $n\geq d+2$}
385\begin{algorithmic}
386\If{$n-1<t$}
387\For{$g\in B_{n-1}$}
388\State Add $\sqrt[2^{n-1}]{g}$ to \texttt{shortlist}
389\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(g))$
390\EndFor
391\EndIf
392\State
393
394\If{$n=d+2$}
395\State Add $\sqrt[2^{d}]{|B_{d,0}|}$ to \texttt{shortlist}
396\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(|B_{d,0}|))$
397\EndIf
398
399\State
400\State $M\leftarrow\lcm(M,2^{n})$
401\State
402\ForAll{$d_M\in \texttt{divisors}(M)$ such that $2^n\,|\,M$}
403\State $S\leftarrow\left\{\prod_{x\in T}x\,|\,T\subseteq\texttt{shortlist}\right\}$
404\State $H\leftarrow\left\{\min\left\{x\in\mathbb{Z}_{>0}\,|\sqrt{s}\in \mathbb{Q}_x\right\}\,|\,s\in S\right\}$
405\State $r\leftarrow\# \left\{s\in S\,|\, \sqrt{s}\in\mathbb{Q}_{d_M}\right\}$
406\State Declare $\left[\mathbb{Q}_{2^n}\left(\sqrt[2^n]{G}\right)\cap \mathbb{Q}_{d_M}:\mathbb{Q}_{2^n}\right]=\begin{cases}
407r/2&\text{ if }8\in H,\\
408r&\text{ otherwise}.
409\end{cases}$
410\EndFor
411\end{algorithmic}
412
413\end{algorithm}
414
415\pagebreak
416
417\subsection{Case $d\neq -1$, $n= d+1$}
418
419\begin{algorithm}
420\caption{Adelic failure, case $d\neq -1$, $n= d+1$}
421\begin{algorithmic}
422\For{$g\in B_{n-1}$}
423\If{$g<0$}
424\State $\texttt{special\_element}\leftarrow(n+1,\sqrt[2^{n-1}]{|g|})$
425\State $M\leftarrow\lcm(M,\texttt{special\_embed}(\texttt{special\_element}))$
426\Else
427\State Add $\sqrt[2^{n-1}]{g}$ to \texttt{shortlist}
428\State $M\leftarrow\lcm(M,\texttt{cyc\_embed}(g))$
429\EndIf
430\EndFor
431\State
432\State $M\leftarrow\lcm(M,2^{n})$
433\State
434\State Remove $-1$ from \texttt{shortlist} (if present)
435
436
437\State
438\ForAll{$d_M\in \texttt{divisors}(M)$ such that $2^n\,|\,M$}
439\State $S\leftarrow\left\{\prod_{x\in T}x\,|\,T\subseteq\texttt{shortlist}\right\}$
440\State $H\leftarrow\left\{\min\left\{x\in\mathbb{Z}_{>0}\,|\sqrt{s}\in \mathbb{Q}_x\right\}\,|\,s\in S\right\}$
441\State $r\leftarrow\# \left\{s\in S\,|\, \sqrt{s}\in\mathbb{Q}_{d_M}\right\}$
442\State
443%\State $\texttt{specials}\leftarrow\{\zeta_{2^{n+1}}\sqrt{bs}\,|\,s\in S\}$
444\If{$\exists x\in \{\zeta_{2^{n+1}}\sqrt{bs}\,|\,s\in S\}\cap\mathbb{Q}_{d_M}$ and $\texttt{special\_embed}(s)\neq 4\,\forall s\in\texttt{specials}$}
445\State $r\leftarrow 2r$
446\EndIf
447\State Declare $\left[\mathbb{Q}_{2^n}\left(\sqrt[2^n]{G}\right)\cap \mathbb{Q}_{d_M}:\mathbb{Q}_{2^n}\right]=\begin{cases}
448r/2&\text{ if }8\in H\text{ and }n\geq 3,\\
449r&\text{ otherwise}.
450\end{cases}$
451\EndFor
452\end{algorithmic}
453
454\end{algorithm}
455
456\begin{thebibliography}{10} \expandafter\ifx\csname url\endcsname\relax \def\url#1{\texttt{#1}}\fi \expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi
457
458\bibitem{DebryPerucca}
459\textsc{Debry, C. - Perucca, A.}: \emph{Reductions of algebraic integers}, J. Number Theory, {\bf 167} (2016), 259--283.
460
461%\bibitem{PeruccaSgobba}
462%\textsc{Perucca, A. - Sgobba, P.}: \emph{Kummer Theory for Number Fields}, preprint.
463
464\end{thebibliography}
465
466\end{document} \ No newline at end of file

Generated with cgit - Back to sebastiano.tronto.net