Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions scripts/link_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""Write the field node of each item of the seed list and the skeletons whose node exists.

An item matches a node when the key of the item name is the key of the node name or of an alias of the node, and exactly one node of a kind that fits the kind of the item has the key.
When several nodes of a fitting kind have the key, the one node whose name (not an alias) has the key matches.
When no node of a fitting kind has the key, the one node of any kind whose name has the key matches, for example the statement Russell's paradox for a counterexample item.
The key ignores case, accents, punctuation, the article "the", the possessive 's, a final plural s and the spellings colour/color and -ise/-ize.
The script does not match by the Wikipedia title or the Wikidata item: many items share the article of a broader concept, for example "orthogonal Lie algebra" and "orthogonal group".
The script changes only the lines of the items without a node. It keeps the other lines as they are.
Expand Down Expand Up @@ -64,6 +66,7 @@ def read_nodes():
nodes.append({
"tag": str(fm["tag"]),
"kind": fm.get("kind"),
"name": key(str(fm.get("name", ""))),
"slugs": {key(str(fm.get("name", "")))} | {key(str(a)) for a in fm.get("aliases") or []},
})
return nodes
Expand All @@ -78,14 +81,18 @@ def index(nodes):
return ix


def pick(cands, kind):
def pick(cands, kind, want):
fits = FITS.get(kind, (kind,))
named = [c for c in cands if c["name"] == want]
cands = [c for c in cands if c["kind"] in fits]
if not cands:
return None
# No node of a fitting kind: take the one node with the name.
return named[0]["tag"] if len(named) == 1 else None
# Prefer the first kind of the list, for example a concept for a definition item.
for k in fits:
best = [c for c in cands if c["kind"] == k]
if len(best) > 1:
best = [c for c in best if c["name"] == want]
if best:
return best[0]["tag"] if len(best) == 1 else None
return None
Expand All @@ -105,7 +112,7 @@ def link_file(path, by_key, dry):
if item.get("node"):
stats["had"] += 1
continue
tag = pick(by_key.get(key(item["name"]), []), item.get("kind"))
tag = pick(by_key.get(key(item["name"]), []), item.get("kind"), key(item["name"]))
if not tag:
continue
stats["new"] += 1
Expand Down
42 changes: 21 additions & 21 deletions topics/curricula/seed.yaml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions topics/skeletons/03.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ items:
- {name: formalism, kind: concept, wikipedia: Formalism (philosophy of mathematics), wikidata: Q1433067, node: 46JCQ6KDA4}
- {name: intuitionism, kind: concept, wikipedia: Intuitionism, wikidata: Q10879018, node: XQHF63BBYF}
- {name: Hilbert's program, kind: problem, wikipedia: Hilbert's program, wikidata: Q968548, node: P1RW6JWX73}
- {name: Russell's paradox, kind: counterexample, wikipedia: Russell's paradox, wikidata: Q33401}
- {name: Russell's paradox, kind: counterexample, wikipedia: Russell's paradox, wikidata: Q33401, node: 0HESMMSYEG}
- {name: Burali-Forti paradox, kind: counterexample, wikipedia: Burali-Forti paradox, wikidata: Q1010269, node: CCNCGN3P59}
- {name: Skolem's paradox, kind: example, wikipedia: Skolem's paradox, wikidata: Q1096353, node: 68QZWDXAQ4}
# Propositional logic
Expand Down Expand Up @@ -176,7 +176,7 @@ items:
- {name: Zermelo–Fraenkel set theory, kind: definition, decl: ZFSet, wikipedia: Zermelo–Fraenkel set theory, wikidata: Q191849, mathlib: [mathlib-overview], node: 0HE5WDQ9FJ}
- {name: axiom schema of replacement, kind: definition, wikipedia: Axiom schema of replacement, wikidata: Q1361825, node: D96K8S8R61}
- {name: axiom of regularity, kind: definition, decl: ZFSet.regularity, wikipedia: Axiom of regularity, wikidata: Q470981, node: NFQ9FVCP31}
- {name: axiom of choice, kind: definition, decl: Classical.choice, wikipedia: Axiom of choice, wikidata: Q179692}
- {name: axiom of choice, kind: definition, decl: Classical.choice, wikipedia: Axiom of choice, wikidata: Q179692, node: 0HTGB13FE2}
- {name: Zorn's lemma, kind: statement, decl: zorn_le, wikipedia: Zorn's lemma, wikidata: Q290810, node: 04RXTQA5ZA}
- {name: well-ordering theorem, kind: statement, wikipedia: Well-ordering theorem, wikidata: Q1457052, node: 0N109NG5ZX}
- {name: von Neumann–Bernays–Gödel set theory, kind: definition, wikipedia: Von Neumann–Bernays–Gödel set theory, wikidata: Q278770, node: JTPZ1HZ9KK}
Expand All @@ -197,18 +197,18 @@ items:
- {name: cardinal number, kind: definition, decl: Cardinal, wikipedia: Cardinal number, wikidata: Q163875, mathlib: [mathlib-overview], node: 0EBACQFAZW}
- {name: cardinality, kind: definition, wikipedia: Cardinality, wikidata: Q4049983, node: 0G0ASKNA6Z}
- {name: countable set, kind: definition, decl: Set.Countable, wikipedia: Countable set, wikidata: Q66707394, node: 01TQB88H4C}
- {name: Cantor's diagonal argument, kind: statement, wikipedia: Cantor's diagonal argument, wikidata: Q729471}
- {name: Cantor's diagonal argument, kind: statement, wikipedia: Cantor's diagonal argument, wikidata: Q729471, node: 0XCH8QVDCQ}
- {name: Cantor's theorem, kind: statement, decl: Cardinal.cantor, wikipedia: Cantor's theorem, wikidata: Q474881, node: 0WTEMGYV2C}
- {name: Schröder–Bernstein theorem, kind: statement, decl: Function.Embedding.schroeder_bernstein, wikipedia: Schröder–Bernstein theorem, wikidata: Q1033910, mathlib: [mathlib-100, mathlib-1000], node: 0A9V6RKQG6}
- {name: aleph number, kind: definition, decl: Cardinal.aleph, wikipedia: Aleph number, wikidata: Q908627, mathlib: [mathlib-overview], node: 6Q9Z2BM1XR}
- {name: beth number, kind: definition, decl: Cardinal.beth, wikipedia: Beth number, wikidata: Q831092, mathlib: [mathlib-overview], node: SS6WMEN6KX}
- {name: cardinality of the continuum, kind: definition, decl: Cardinal.continuum, wikipedia: Cardinality of the continuum, wikidata: Q22952648}
- {name: cardinality of the continuum, kind: definition, decl: Cardinal.continuum, wikipedia: Cardinality of the continuum, wikidata: Q22952648, node: 0WC28W9DNM}
- {name: cofinality, kind: definition, decl: Ordinal.cof, wikipedia: Cofinality, wikidata: Q1283623, node: BAWHE1W6MH}
- {name: regular cardinal, kind: definition, decl: Cardinal.IsRegular, wikipedia: Regular cardinal, wikidata: Q1193137, node: 13ZV2F8JAR}
- {name: König's theorem, kind: statement, decl: Cardinal.sum_lt_prod, wikipedia: Kőnig's theorem (set theory), wikidata: Q1077462, mathlib: [mathlib-1000], node: 0JP0ZF57PN}
- {name: continuum hypothesis, kind: problem, wikipedia: Continuum hypothesis, wikidata: Q208416}
- {name: continuum hypothesis, kind: problem, wikipedia: Continuum hypothesis, wikidata: Q208416, node: 0MN2MER9WN}
- {name: Easton's theorem, kind: statement, wikipedia: Easton's theorem, wikidata: Q2226644, node: WQ967Q2XJD}
- {name: singular cardinals hypothesis, kind: problem, wikipedia: Singular cardinals hypothesis, wikidata: Q2289367}
- {name: singular cardinals hypothesis, kind: problem, wikipedia: Singular cardinals hypothesis, wikidata: Q2289367, node: 8SH7WETCKY}
- {name: club set, kind: definition, wikipedia: Club set, wikidata: Q310647, node: YW8YSCFPG5}
- {name: stationary set, kind: definition, wikipedia: Stationary set, wikidata: Q1528401, node: YE6WZR46RQ}
- {name: Fodor's lemma, kind: statement, wikipedia: Fodor's lemma, wikidata: Q1119050, node: 55W1M20Q3F}
Expand Down
2 changes: 1 addition & 1 deletion topics/skeletons/06.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ items:
- {name: linearly ordered group, kind: definition, wikipedia: Linearly ordered group, wikidata: Q10292020, node: P2E8BNYC7B}
- {name: lattice-ordered group, kind: definition, wikipedia: Partially ordered group, wikidata: Q2715875, node: J0DHYQ0MDE}
- {name: Riesz space, kind: definition, wikipedia: Riesz space, wikidata: Q2152570, node: 99709K2NJM}
- {name: Archimedean property, kind: definition, decl: Archimedean, wikipedia: Archimedean property, wikidata: Q634579}
- {name: Archimedean property, kind: definition, decl: Archimedean, wikipedia: Archimedean property, wikidata: Q634579, node: 0A74SX55QP}
- {name: Hölder's theorem on Archimedean groups, kind: statement, decl: Archimedean.exists_orderAddMonoidHom_real_injective, wikipedia: Archimedean group, wikidata: Q4786884, node: CDM40MT3HZ}
- {name: Archimedean equivalence classes, kind: definition, decl: ArchimedeanClass, wikipedia: Archimedean property, wikidata: Q634579, node: RQ4X0EH6NH}
- {name: Hahn embedding theorem, kind: statement, wikipedia: Hahn embedding theorem, wikidata: Q5638886, node: FVPXXFNVQY}
Expand Down
4 changes: 2 additions & 2 deletions topics/skeletons/11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ items:
- {name: Szemerédi's theorem, kind: statement, wikipedia: Szemerédi's theorem, wikidata: Q1046232, node: B23B0QEMN5}
- {name: Green–Tao theorem, kind: statement, wikipedia: Green–Tao theorem, wikidata: Q922012, node: H8BAHWSEMC}
- {name: Collatz conjecture, kind: conjecture, wikipedia: Collatz conjecture, wikidata: Q837314, node: 6PCQEXEX4N}
- {name: Frobenius coin problem, kind: problem, decl: FrobeniusNumber, wikipedia: Coin problem, wikidata: Q2295746}
- {name: Frobenius coin problem, kind: problem, decl: FrobeniusNumber, wikipedia: Coin problem, wikidata: Q2295746, node: 0V11FEXK08}
# Diophantine equations
- {name: Diophantine equation, kind: definition, wikipedia: Diophantine equation, wikidata: Q905896, node: 08B1RTW7VZ}
- {name: Pythagorean triple, kind: definition, decl: PythagoreanTriple.classification, wikipedia: Pythagorean triple, wikidata: Q208225, mathlib: [mathlib-100], node: 0M7ARED5Q7}
Expand All @@ -91,7 +91,7 @@ items:
- {name: Fermat's Last Theorem for exponent four, kind: statement, decl: fermatLastTheoremFour, wikipedia: Fermat's right triangle theorem, wikidata: Q18640217, node: 0E741HSMJ1}
- {name: Catalan's conjecture, kind: statement, wikipedia: Catalan's conjecture, wikidata: Q174955, node: JH6Y2E1ZCN}
- {name: Thue equation, kind: definition, wikipedia: Thue equation, wikidata: Q2378270, node: 3Q6CFPQZDF}
- {name: Hilbert's tenth problem, kind: problem, wikipedia: Hilbert's tenth problem, wikidata: Q986147}
- {name: Hilbert's tenth problem, kind: problem, wikipedia: Hilbert's tenth problem, wikidata: Q986147, node: X8TVJSVTD4}
- {name: Hasse principle, kind: concept, wikipedia: Hasse principle, wikidata: Q2115578, node: EMAR4X3W8D}
- {name: Hasse–Minkowski theorem, kind: statement, wikipedia: Hasse–Minkowski theorem, wikidata: Q1938251, node: R8HCWA981S}
- {name: Chevalley–Warning theorem, kind: statement, wikipedia: Chevalley–Warning theorem, wikidata: Q720469, node: 08895Q5W96}
Expand Down
6 changes: 3 additions & 3 deletions topics/skeletons/12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ items:
- {name: simple extension, kind: definition, decl: IntermediateField.adjoin, wikipedia: Simple extension, wikidata: Q2628674, node: 0N681SSTHC}
- {name: algebraic element, kind: definition, decl: IsAlgebraic, wikipedia: Algebraic element, wikidata: Q162608, mathlib: [mathlib-undergrad], node: 0H628RSGWX}
- {name: algebraic extension, kind: definition, decl: Algebra.IsAlgebraic, wikipedia: Algebraic extension, wikidata: Q550791, mathlib: [mathlib-undergrad, mathlib-overview], node: 0PTBM7K0R2}
- {name: minimal polynomial, kind: definition, decl: minpoly, wikipedia: Minimal polynomial (field theory), wikidata: Q2242730, mathlib: [mathlib-undergrad, mathlib-overview]}
- {name: minimal polynomial, kind: definition, decl: minpoly, wikipedia: Minimal polynomial (field theory), wikidata: Q2242730, mathlib: [mathlib-undergrad, mathlib-overview], node: 03NDVCSHSB}
- {name: irreducibility of the minimal polynomial, kind: statement, decl: minpoly.irreducible, wikipedia: Minimal polynomial (field theory), wikidata: Q2242730, node: 0NFEG48RDR}
- {name: splitting field, kind: definition, decl: Polynomial.SplittingField, wikipedia: Splitting field, wikidata: Q1996100, mathlib: [mathlib-undergrad, mathlib-overview], node: 0KXQKX9P63}
- {name: split polynomial, kind: definition, decl: Polynomial.Splits, wikipedia: Splitting field, wikidata: Q1996100, node: 0JVSNJCN68}
Expand Down Expand Up @@ -183,9 +183,9 @@ items:
- {name: Steinitz's theorem on algebraically closed fields, kind: statement, wikipedia: Algebraically closed field, wikidata: Q1047547, node: CAEHMSX9RT}
# Real fields and ordered fields
- {name: ordered field, kind: definition, wikipedia: Ordered field, wikidata: Q909412, node: 0P3VCBDEE2}
- {name: Archimedean property, kind: definition, wikipedia: Archimedean property, wikidata: Q634579}
- {name: Archimedean property, kind: definition, wikipedia: Archimedean property, wikidata: Q634579, node: 0A74SX55QP}
- {name: formally real field, kind: definition, decl: IsFormallyReal, wikipedia: Formally real field, wikidata: Q17097900, node: X32TSWJSYT}
- {name: real closed field, kind: definition, decl: IsRealClosed, wikipedia: Real closed field, wikidata: Q2068227}
- {name: real closed field, kind: definition, decl: IsRealClosed, wikipedia: Real closed field, wikidata: Q2068227, node: DDY3Q3PJ6W}
- {name: real closure, kind: definition, wikipedia: Real closed field, wikidata: Q2068227, node: 778KFSM09P}
- {name: Artin–Schreier theorem, kind: statement, wikipedia: Real closed field, wikidata: Q2068227, node: 58P0EGAFVV}
- {name: Hilbert's seventeenth problem, kind: problem, wikipedia: Hilbert's seventeenth problem, wikidata: Q2496877, node: J45F4F13VB}
Expand Down
2 changes: 1 addition & 1 deletion topics/skeletons/14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ items:
- {name: Jacobian conjecture, kind: conjecture, wikipedia: Jacobian conjecture, wikidata: Q2605695, node: B5JFXEQQD8}
- {name: resultant, kind: definition, decl: Polynomial.resultant, wikipedia: Resultant, wikidata: Q1168321, node: NNPHTWF645}
# Tropical geometry
- {name: tropical semiring, kind: definition, decl: Tropical, wikipedia: Tropical semiring, wikidata: Q60790098}
- {name: tropical semiring, kind: definition, decl: Tropical, wikipedia: Tropical semiring, wikidata: Q60790098, node: 5PNBCRH2JG}
- {name: tropical geometry, kind: concept, wikipedia: Tropical geometry, wikidata: Q2982669, node: 7YTC3BHK60}
- {name: tropical variety, kind: definition, wikipedia: Tropical geometry, wikidata: Q2982669, node: FT2GJEHWY5}
- {name: Newton polytope, kind: definition, wikipedia: Newton polytope, wikidata: Q99705926, node: CYTTX8KHC8}
Expand Down
8 changes: 4 additions & 4 deletions topics/skeletons/15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ items:
- {name: coordinate vector, kind: definition, wikipedia: Coordinate vector, wikidata: Q1057996, node: 04CYQHN6MC}
- {name: change of basis, kind: concept, wikipedia: Change of basis, wikidata: Q810255, node: 0MKRHZB3WS}
- {name: direct sum of vector spaces, kind: definition, decl: DirectSum, wikipedia: Direct sum of modules, wikidata: Q1142861, node: 0S7W6EG32V}
- {name: quotient space, kind: definition, wikipedia: Quotient space (linear algebra), wikidata: Q1393796}
- {name: quotient space, kind: definition, wikipedia: Quotient space (linear algebra), wikidata: Q1393796, node: 0BR3FY5Q8M}
- {name: dimension of a quotient space, kind: statement, decl: Submodule.finrank_quotient_add_finrank, wikipedia: Quotient space (linear algebra), wikidata: Q1393796, node: 0SXDQ6TN00}
- {name: Grassmann's dimension formula, kind: statement, decl: Submodule.finrank_sup_add_finrank_inf_eq, wikipedia: Dimension (vector space), wikidata: Q929302, node: 06HTJNCMPA}
- {name: complement of a subspace, kind: definition, wikipedia: Complemented subspace, wikidata: Q137454148, node: 0M83V17KHX}
Expand Down Expand Up @@ -55,7 +55,7 @@ items:
- {name: matrix-vector product, kind: definition, decl: Matrix.mulVec, wikipedia: Matrix multiplication, wikidata: Q1049914, node: 0PDVQEP0ZC}
- {name: dot product, kind: definition, decl: dotProduct, wikipedia: Dot product, wikidata: Q181365, node: 0S52TNNTH9}
- {name: cross product, kind: definition, decl: crossProduct, wikipedia: Cross product, wikidata: Q178192, mathlib: [mathlib-undergrad], node: 0N5N15HWZ7}
- {name: identity matrix, kind: definition, decl: Matrix.one, wikipedia: Identity matrix, wikidata: Q193794}
- {name: identity matrix, kind: definition, decl: Matrix.one, wikipedia: Identity matrix, wikidata: Q193794, node: 06DW9BAWB1}
- {name: transpose, kind: definition, decl: Matrix.transpose, wikipedia: Transpose, wikidata: Q223683, node: 09DXWYRD43}
- {name: conjugate transpose, kind: definition, decl: Matrix.conjTranspose, wikipedia: Conjugate transpose, wikidata: Q2051983, node: 0DXKE10PHF}
- {name: trace, kind: definition, decl: Matrix.trace, wikipedia: Trace (linear algebra), wikidata: Q321102, node: 0XC1RDBY7A}
Expand Down Expand Up @@ -143,7 +143,7 @@ items:
- {name: Smith normal form, kind: statement, decl: Module.Basis.SmithNormalForm, wikipedia: Smith normal form, wikidata: Q7545384, node: MV28Z5N9XX}
- {name: Hermite normal form, kind: statement, wikipedia: Hermite normal form, wikidata: Q13650324, node: EHE26PR17K}
- {name: Schur decomposition, kind: statement, wikipedia: Schur decomposition, wikidata: Q1064218, node: V1JG4C7R7B}
- {name: LU decomposition, kind: statement, wikipedia: LU decomposition, wikidata: Q833089}
- {name: LU decomposition, kind: statement, wikipedia: LU decomposition, wikidata: Q833089, node: 0RKG5YW66Y}
- {name: QR decomposition, kind: statement, wikipedia: QR decomposition, wikidata: Q653242, node: 0ERWG4NXQ9}
- {name: Cholesky decomposition, kind: statement, wikipedia: Cholesky decomposition, wikidata: Q515375, node: 0WKG8CYY6A}
- {name: singular value decomposition, kind: statement, wikipedia: Singular value decomposition, wikidata: Q420904, node: 000NPTMX6J}
Expand Down Expand Up @@ -201,7 +201,7 @@ items:
- {name: idempotent matrix, kind: definition, decl: IsIdempotentElem, wikipedia: Idempotent matrix, wikidata: Q3751720, node: 0KCE8CG86P}
- {name: nilpotent matrix, kind: definition, wikipedia: Nilpotent matrix, wikidata: Q650670, node: 07BSPZPSMF}
- {name: Vandermonde matrix, kind: definition, decl: Matrix.vandermonde, wikipedia: Vandermonde matrix, wikidata: Q579544, node: Q3JWBZ7EFY}
- {name: circulant matrix, kind: definition, decl: Matrix.circulant, wikipedia: Circulant matrix, wikidata: Q245457}
- {name: circulant matrix, kind: definition, decl: Matrix.circulant, wikipedia: Circulant matrix, wikidata: Q245457, node: 07HFRH2AWY}
- {name: Toeplitz matrix, kind: definition, wikipedia: Toeplitz matrix, wikidata: Q849428, node: GKY2WSHE26}
- {name: Hankel matrix, kind: definition, wikipedia: Hankel matrix, wikidata: Q1575637, node: PQ1D8FQB3E}
- {name: Hilbert matrix, kind: example, wikipedia: Hilbert matrix, wikidata: Q612991, node: 2DTWB6F5TA}
Expand Down
2 changes: 1 addition & 1 deletion topics/skeletons/16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ items:
- {name: nilpotent element, kind: definition, decl: IsNilpotent, wikipedia: Nilpotent, wikidata: Q840023, node: 0ZB2JG1M9C}
- {name: nil ideal, kind: definition, wikipedia: Nil ideal, wikidata: Q453275, node: NZ1G9WRWFB}
- {name: nilpotent ideal, kind: definition, wikipedia: Nilpotent ideal, wikidata: Q4321370, node: C2H26BYWHE}
- {name: matrix ring, kind: definition, decl: Matrix, wikipedia: Matrix ring, wikidata: Q2915729, mathlib: [mathlib-undergrad, mathlib-overview]}
- {name: matrix ring, kind: definition, decl: Matrix, wikipedia: Matrix ring, wikidata: Q2915729, mathlib: [mathlib-undergrad, mathlib-overview], node: 0FHVPRAE60}
- {name: endomorphism ring, kind: definition, decl: Module.End, wikipedia: Endomorphism ring, wikidata: Q2896709, node: AWSBZWWMG9}
- {name: characteristic of a ring, kind: definition, decl: ringChar, wikipedia: Characteristic (algebra), wikidata: Q836088, mathlib: [mathlib-undergrad, mathlib-overview], node: 0F6ES3BRYP}
- {name: rng, kind: definition, decl: NonUnitalRing, wikipedia: Rng (algebra), wikidata: Q17102802, node: MBK7NFE74S}
Expand Down
Loading
Loading