Data terms for the 1/40 certificate #
The certificate data of Theorem S4 (grid points, bands, chord conditions and the weighted row tags of each case) is written in the generated Lean files as string literals. The term elaborators of this file turn such a string into a term:
s4_qtree% "n d …": anLTree ℚof the rationalsn/d(one pair per line);s4_ntree3% "a b c …": anLTree (Nat × Nat × Nat)(one triple per line);s4_ctree% "n₁ d₁ n₂ d₂ n₃ d₃ …": anLTree (ℚ × ℚ × ℚ)(one triple per line);s4_rows% "z tag args …": a balancedWTree Tagof weighted row tags (one per line).
The elaborators only build terms; the kernel checks every use of the data. LTree stores
the entry of index i at the path of the binary digits of i, lowest digit first, so that
LTree.get is a short kernel computation.
The entry of index k: the lowest binary digit of k picks the subtree.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A natural-number literal for a certificate entry.
Equations
Instances For
The rational constructor term mkRat n d for a nonnegative entry.
Equations
- Esgk.S4.rationalExpression n d = Lean.mkApp2 (Lean.mkConst `mkRat) (Lean.mkApp (Lean.mkConst `Int.ofNat) (Esgk.S4.naturalExpression n)) (Esgk.S4.naturalExpression d)
Instances For
Split one certificate line into its nonempty space-delimited fields.
Equations
- Esgk.S4.splitWords line = List.filter (fun (x : String) => decide (x ≠ "")) line.splitOn
Instances For
Read the nonempty rows of a certificate and keep their literal line numbers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read a natural field with a diagnostic pointing to the input row.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read exactly the declared number of natural-number fields.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Build a rational literal with a nonzero denominator.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The constructor term for a pair with the supplied component types.
Equations
- Esgk.S4.productExpression α β a b = Lean.mkApp4 (Lean.mkConst `Prod.mk [Lean.Level.zero, Lean.Level.zero]) α β a b
Instances For
The product type of two certificate component types.
Equations
- Esgk.S4.productType α β = Lean.mkApp2 (Lean.mkConst `Prod [Lean.Level.zero, Lean.Level.zero]) α β
Instances For
Elaborate rational pairs into a low-bit-indexed tree.
Equations
- Esgk.S4.«termS4_qtree%_» = Lean.ParserDescr.node `Esgk.S4.«termS4_qtree%_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "s4_qtree% ") (Lean.ParserDescr.const `str))
Instances For
Elaborate triples of natural numbers into a low-bit-indexed tree.
Equations
- Esgk.S4.«termS4_ntree3%_» = Lean.ParserDescr.node `Esgk.S4.«termS4_ntree3%_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "s4_ntree3% ") (Lean.ParserDescr.const `str))
Instances For
Elaborate triples of rational numbers into a low-bit-indexed tree.
Equations
- Esgk.S4.«termS4_ctree%_» = Lean.ParserDescr.node `Esgk.S4.«termS4_ctree%_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "s4_ctree% ") (Lean.ParserDescr.const `str))
Instances For
The constructor and the number of arguments of a tag name.
Equations
- Esgk.S4.tagConstructor "amono" = some (`Esgk.S4.Tag.amono, 2)
- Esgk.S4.tagConstructor "xmono" = some (`Esgk.S4.Tag.xmono, 2)
- Esgk.S4.tagConstructor "xpos" = some (`Esgk.S4.Tag.xpos, 1)
- Esgk.S4.tagConstructor "xleq" = some (`Esgk.S4.Tag.xleq, 1)
- Esgk.S4.tagConstructor "a2lo" = some (`Esgk.S4.Tag.a2lo, 1)
- Esgk.S4.tagConstructor "mlo" = some (`Esgk.S4.Tag.mlo, 0)
- Esgk.S4.tagConstructor "layer" = some (`Esgk.S4.Tag.layer, 2)
- Esgk.S4.tagConstructor "pa" = some (`Esgk.S4.Tag.pa, 4)
- Esgk.S4.tagConstructor "pb" = some (`Esgk.S4.Tag.pb, 4)
- Esgk.S4.tagConstructor "pc" = some (`Esgk.S4.Tag.pc, 4)
- Esgk.S4.tagConstructor "aa" = some (`Esgk.S4.Tag.aa, 5)
- Esgk.S4.tagConstructor "jj" = some (`Esgk.S4.Tag.jj, 5)
- Esgk.S4.tagConstructor "ab1" = some (`Esgk.S4.Tag.ab1, 2)
- Esgk.S4.tagConstructor "ab2" = some (`Esgk.S4.Tag.ab2, 1)
- Esgk.S4.tagConstructor "ab3" = some (`Esgk.S4.Tag.ab3, 3)
- Esgk.S4.tagConstructor "ab4" = some (`Esgk.S4.Tag.ab4, 3)
- Esgk.S4.tagConstructor "ab6u" = some (`Esgk.S4.Tag.ab6u, 2)
- Esgk.S4.tagConstructor "ab6v" = some (`Esgk.S4.Tag.ab6v, 3)
- Esgk.S4.tagConstructor "caselo" = some (`Esgk.S4.Tag.caselo, 0)
- Esgk.S4.tagConstructor "casehi" = some (`Esgk.S4.Tag.casehi, 0)
- Esgk.S4.tagConstructor x✝ = none
Instances For
Elaborate weighted geometric row tags into a balanced certificate tree.
Equations
- Esgk.S4.«termS4_rows%_» = Lean.ParserDescr.node `Esgk.S4.«termS4_rows%_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "s4_rows% ") (Lean.ParserDescr.const `str))