Skip to content

Instantly share code, notes, and snippets.

View alexjbest's full-sized avatar
🐢

Alex J Best alexjbest

🐢
View GitHub Profile
@alexjbest
alexjbest / mbx.vim
Created June 11, 2018 18:40
Mathbook tags for vim html syntax
" mathbook tag names
syn keyword htmlTagName contained definition theorem section subsection subsubsection statement
syn keyword htmlTagName contained m me men mn md mdn mathbook chapter
syn keyword htmlTagName contained frontmatter titlepage preface author
syn keyword htmlTagName contained date docinfo book article subtitle
syn keyword htmlTagName contained backmatter references biblio url
syn keyword htmlTagName contained macros term lemma example proposition proof
syn keyword htmlTagName contained remark personname mrow xref fact corollary title index author objectives p blockquote pre sidebyside sage figure table listing poem program c console image tabular paragraphs definition theorem corollary lemma algorithm proposition claim fact identity axiom conjecture principle heuristic hypothesis assumption remark convention note observation warning insight computation technology aside biographical historical list example question problem project activity exploration task investigation assemblage exercise contr
@alexjbest
alexjbest / pug.vim
Created June 12, 2018 19:54
Some tex imaps for vim
imap ;a \alpha
imap ;b \beta
imap ;c \chi
imap ;d \delta
imap ;e \epsilon
imap ;E \eta
imap ;f \phi
imap ;g \gamma
imap ;h \eta
imap ;i \iota
def f(a,b):
print inspect.currentframe().f_code.co_name + "("+", ".join(map(lambda x: str(x.parent()) + str (x), locals().values()))+")"
return a+b
@alexjbest
alexjbest / zagier.lean
Last active June 11, 2019 22:33
A lean proof that every prime congruent to 1 mod 4 is a sum of two squares, uses mathlib
import data.nat.basic
import data.int.basic
import data.int.modeq
import init.data.fin.ops
import data.zmod.basic
import data.fintype
import data.nat.prime
import tactic.interactive
import tactic.find
import tactic.tidy
@alexjbest
alexjbest / nf.lean
Last active August 2, 2019 09:58
Number fields in lean?
import data.rat.basic
import data.int.basic
import data.nat.basic
import algebra.field
import linear_algebra.finsupp
import ring_theory.polynomial
import ring_theory.algebra
import ring_theory.adjoin_root
import ring_theory.ideals
import algebra.module
@alexjbest
alexjbest / L-ec-ff.sage
Created October 17, 2019 02:08
some sage code to compute L-functions of elliptic curves over function field of genus 0
p=7
L.<t> = FunctionField(GF(p))
S.<x,y> = L[]
E = EllipticCurve(y^2 - x*(x-1)*(x-t^2))
deg = 3 # what degree correct up till
R.<T>= PowerSeriesRing(QQ)
lpol = ((1 + T) * (1 - T))^(-2) # bad factors computed by hand for now
ll = []
for N in range(deg + 1):
for pp in L.places(N):
@alexjbest
alexjbest / amgm.lean
Last active December 15, 2019 00:17
import tactic.basic
import tactic.apply
import tactic.ring
import tactic.abel
import tactic.linarith
import tactic.norm_num
import data.rat.basic
import data.rat.basic
import data.real.basic
import analysis.complex.exponential
@alexjbest
alexjbest / pretextpug.js
Last active March 22, 2021 21:44
A zotero translator to export to pretext with pug
{
"translatorID": "18AAAAAAA9afc-4cd6-8775-1980c3ce0fbf",
"label": "Pretext pug export",
"creator": "Alex J. Best",
"target": "pug",
"minVersion": "1.0.0",
"maxVersion": "",
"priority": 50,
"displayOptions": {
"exportNotes": true
#print ProFiltPseuNormGrp.Top.of.compact_space
#print differential_object.iso_of_components_inv_f
#print add_monoid_hom.id_mem_filtration
#print breen_deligne.universal_map.π_suitable
#print Profinite.iso_of_homeo
#print Mbar.ext_iff
#print polyhedral_lattice.HomZ_map_equiv
#print breen_deligne.data.system_res_def
#print Mbar.Tinv_aux_ne_zero
#print rescale.Tinv'
INFO:werkzeug@2021-06-02 20:29:57,815: * Running on http://127.0.0.1:37777/ (Press CTRL+C to quit)
ERROR:werkzeug@2021-06-02 20:30:02,778: 127.0.0.1 - - [02/Jun/2021 20:30:02] code 400, message Bad request version ('\x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x01\x93ZZ\x00\x00\x00\x17\x00\x00ÿ\x01\x00\x01\x00\x00')
INFO:werkzeug@2021-06-02 20:30:02,778: 127.0.0.1 - - [02/Jun/2021 20:30:02] "üñR<ÿ³ùEF*¦f¾
i"n}ùLIìäý ÷CÅmÕ
.X)ýW À+À/À,À0̨̩ÀÀ7Ùί_YJ 4-M6ÀK_1#á{5*l#t
mK ·éª¬VõÝÅk"zzÀ+À/À,À0̨̩ÀÀUsers/alex/lmfdb/lmfdb/ecnf/main.py", line 184, in <genexpr>
((nf, [url_for('.show_ecnf1', nf=nf), field_pretty(nf)])
File "sage/misc/cachefunc.pyx", line 1001, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:6100)
File "/Users/alex/lmfdb/lmfdb/number_fields/web_number_field.py", line 221, in field_pretty
if not is_fundamental_discriminant(D):