Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

""" 

Unramified Extension Generic 

 

This file implements the shared functionality for unramified extensions. 

 

AUTHORS: 

 

- David Roe 

""" 

from __future__ import absolute_import 

 

#***************************************************************************** 

# Copyright (C) 2008 David Roe <roed.math@gmail.com> 

# William Stein <wstein@gmail.com> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# as published by the Free Software Foundation; either version 2 of 

# the License, or (at your option) any later version. 

# 

# http://www.gnu.org/licenses/ 

#***************************************************************************** 

 

 

from .padic_extension_generic import pAdicExtensionGeneric 

from .misc import precprint 

from sage.rings.finite_rings.finite_field_constructor import GF 

from sage.misc.cachefunc import cached_method 

 

class UnramifiedExtensionGeneric(pAdicExtensionGeneric): 

""" 

An unramified extension of Qp or Zp. 

""" 

def __init__(self, poly, prec, print_mode, names, element_class): 

""" 

Initializes self 

 

INPUT: 

 

- poly -- Polynomial defining this extension. 

- prec -- The precision cap 

- print_mode -- a dictionary with print options 

- names -- a 4-tuple, (variable_name, residue_name, 

unramified_subextension_variable_name, uniformizer_name) 

- element_class -- the class for elements of this unramified extension. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(27) #indirect doctest 

""" 

#base = poly.base_ring() 

#if base.is_field(): 

# self._PQR = pqr.PolynomialQuotientRing_field(poly.parent(), poly, name = names) 

#else: 

# self._PQR = pqr.PolynomialQuotientRing_domain(poly.parent(), poly, name = names) 

pAdicExtensionGeneric.__init__(self, poly, prec, print_mode, names, element_class) 

self._res_field = GF(self.prime_pow.pow_Integer_Integer(poly.degree()), name = names[1], modulus = poly.change_ring(poly.base_ring().residue_field())) 

 

def _repr_(self, do_latex = False): 

r""" 

Representation. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R #indirect doctest 

Unramified Extension in a defined by x^3 + 3*x + 3 with capped relative precision 20 over 5-adic Ring 

sage: latex(R) #indirect doctest 

\mathbf{Z}_{5^{3}} 

""" 

if do_latex: 

if self.is_field(): 

return "\\mathbf{Q}_{%s^{%s}}" % (self.prime(), self.degree()) 

else: 

return "\\mathbf{Z}_{%s^{%s}}" % (self.prime(), self.degree()) 

return "Unramified Extension in %s defined by %s %s over %s-adic %s"%(self.variable_name(), self.defining_polynomial(exact=True), precprint(self._prec_type(), self.precision_cap(), self.prime()), self.prime(), "Field" if self.is_field() else "Ring") 

 

def ramification_index(self, K = None): 

""" 

Returns the ramification index of self over the subring K. 

 

INPUT: 

 

- K -- a subring (or subfield) of self. Defaults to the 

base. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R.ramification_index() 

1 

""" 

if K is None: 

return 1 

elif K is self: 

return 1 

else: 

raise NotImplementedError 

 

def inertia_degree(self, K = None): 

""" 

Returns the inertia degree of self over the subring K. 

 

INPUT: 

 

- K -- a subring (or subfield) of self. Defaults to the 

base. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R.inertia_degree() 

3 

""" 

if K is None: 

return self.modulus().degree() 

elif K is self: 

return 1 

else: 

raise NotImplementedError 

 

#def extension(self, *args, **kwds): 

# raise NotImplementedError 

 

#def get_extension(self): 

# raise NotImplementedError 

 

def residue_class_field(self): 

""" 

Returns the residue class field. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R.residue_class_field() 

Finite Field in a0 of size 5^3 

""" 

#should eventually take advantage of finite field 

#\code{extension} or finite field 

#\code{unramified_extension_of_degree} over the automatic 

#coercion base. 

return self._res_field 

 

def residue_ring(self, n): 

""" 

Return the quotient of the ring of integers by the nth power of its maximal ideal. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125) 

sage: R.residue_ring(1) 

Finite Field in a0 of size 5^3 

 

The following requires implementing more general Artinian rings:: 

 

sage: R.residue_ring(2) 

Traceback (most recent call last): 

... 

NotImplementedError 

""" 

if n == 1: 

return self._res_field 

else: 

raise NotImplementedError 

 

def discriminant(self, K=None): 

""" 

Returns the discriminant of self over the subring K. 

 

INPUT: 

 

- K -- a subring/subfield (defaults to the base ring). 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125) 

sage: R.discriminant() 

Traceback (most recent call last): 

... 

NotImplementedError 

""" 

if K is self: 

return 1 

else: 

raise NotImplementedError 

 

#def automorphisms(self): 

# raise NotImplementedError 

 

#def galois_group(self): 

# r""" 

# Returns the Galois group of self's fraction field over Qp. 

# """ 

# ## 

# ## If K is a number field, then K.galois_group() can return 

# ## other variants, i.e. via Pari or KASH. We could consider 

# ## doing this. 

# ## 

# from sage.groups.perm_gps.permgroup import CyclicPermutationGroup 

# return CyclicPermutationGroup(self.modulus().degree()) 

 

#def is_abelian(self): 

# return True 

 

def is_galois(self, K=None): 

""" 

Returns True if this extension is Galois. 

 

Every unramified extension is Galois. 

 

INPUT: 

 

- K -- a subring/subfield (defaults to the base ring). 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R.is_galois() 

True 

""" 

if K is None or K is self: 

return True 

raise NotImplementedError 

 

def gen(self, n=0): 

""" 

Returns a generator for this unramified extension. 

 

This is an element that satisfies the polynomial defining this 

extension. Such an element will reduce to a generator of the 

corresponding residue field extension. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R.gen() 

a + O(5^20) 

""" 

if n != 0: 

raise IndexError("only one generator") 

return self([0,1]) 

 

@cached_method 

def _frob_gen(self, arithmetic = True): 

""" 

Returns frobenius of the generator for this unramified extension 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(9) 

sage: R._frob_gen() 

(2*a + 1) + (2*a + 2)*3 + (2*a + 2)*3^2 + (2*a + 2)*3^3 + (2*a + 2)*3^4 + (2*a + 2)*3^5 + (2*a + 2)*3^6 + (2*a + 2)*3^7 + (2*a + 2)*3^8 + (2*a + 2)*3^9 + (2*a + 2)*3^10 + (2*a + 2)*3^11 + (2*a + 2)*3^12 + (2*a + 2)*3^13 + (2*a + 2)*3^14 + (2*a + 2)*3^15 + (2*a + 2)*3^16 + (2*a + 2)*3^17 + (2*a + 2)*3^18 + (2*a + 2)*3^19 + O(3^20) 

""" 

p = self.prime() 

exp = p 

a = self.gen() 

if not arithmetic: 

exp = p**(self.degree()-1) 

approx = (self(a.residue()**exp)).lift_to_precision(self.precision_cap()) #first approximation 

f = self.defining_polynomial() 

g = f.derivative() 

while(f(approx) != 0): #hensel lift frobenius(a) 

approx = approx - f(approx)/g(approx) 

return approx 

 

def uniformizer_pow(self, n): 

""" 

Returns the nth power of the uniformizer of self (as an element of self). 

 

EXAMPLES:: 

 

sage: R.<a> = ZqCR(125) 

sage: R.uniformizer_pow(5) 

5^5 + O(5^25) 

""" 

return self(self.prime_pow(n)) 

 

def uniformizer(self): 

""" 

Returns a uniformizer for this extension. 

 

Since this extension is unramified, a uniformizer for the 

ground ring will also be a uniformizer for this extension. 

 

EXAMPLES:: 

 

sage: R.<a> = ZqCR(125) 

sage: R.uniformizer() 

5 + O(5^21) 

""" 

return self(self.ground_ring().uniformizer()) 

 

def _uniformizer_print(self): 

""" 

Returns how the uniformizer is supposed to print. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R._uniformizer_print() 

'5' 

""" 

return self.ground_ring()._uniformizer_print() 

 

def _unram_print(self): 

""" 

Returns how the generator prints. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(125); R._unram_print() 

'a' 

""" 

return self.variable_name() 

 

def has_pth_root(self): 

r""" 

Returns whether or not `\ZZ_p` has a primitive `p^{\mbox{th}}` root of unity. 

 

Since adjoining a `p^{\mbox{th}}` root of unity yields a 

totally ramified extension, self will contain one if and only 

if the ground ring does. 

 

INPUT: 

 

- self -- a p-adic ring 

 

OUTPUT: 

 

- boolean -- whether self has primitive `p^{\mbox{th}}` 

root of unity. 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(1024); R.has_pth_root() 

True 

sage: R.<a> = Zq(17^5); R.has_pth_root() 

False 

""" 

return self.ground_ring().has_pth_root() 

 

def has_root_of_unity(self, n): 

""" 

Returns whether or not `\ZZ_p` has a primitive `n^{\mbox{th}}` 

root of unity. 

 

INPUT: 

 

- self -- a p-adic ring 

- n -- an integer 

 

OUTPUT: 

 

- boolean -- whether self has primitive `n^{\mbox{th}}` 

root of unity 

 

EXAMPLES:: 

 

sage: R.<a> = Zq(37^8) 

sage: R.has_root_of_unity(144) 

True 

sage: R.has_root_of_unity(89) 

True 

sage: R.has_root_of_unity(11) 

False 

""" 

if (self.prime() == 2): 

return n.divides(2*(self.residue_class_field().order()-1)) 

else: 

return n.divides(self.residue_class_field().order() - 1)