Lean Kernel Arena / pestka

Checker "pestka"

Language: Aver Aver · Version: 9eb7bb9 · 📄 Declaration · 🔗 Source

Pestka is a type checker for Lean 4 exports written in Aver, a statically typed language designed for AI to write and humans to review, which compiles to Rust. It implements Lean's type theory on its own (universe levels, definitional equality, inductive types with their recursors, quotients, and the Nat and String literal extensions), following the reference kernel's substitution-based algorithm, without NbE, to see how far that algorithm can be pushed. It was written by an AI agent under human guidance.

The export is first converted to Susz, a binary form of lean4export's ndjson, by the susz converter (Rust). The converter is not trusted: Susz holds structure only, and Pestka checks every reference, count and offset itself. An export the converter finds invalid is rejected, one it cannot convert is declined. Pestka reads a theorem's proof from the Susz file only when the theorem is checked.

Declarations are checked on four workers, each keeping what it finds from one declaration to the next, grouped by namespace so that this is reused while still warm. A free variable is named by its type, value and how many of its kind are open, so a binder opened again gets the same variable and what was found under it holds again. Proof arguments of one constant are not compared. Weak head normalization runs a lazy machine that unfolds a matcher into its callers once and goes from a casesOn straight to its branch. A recursive definition that keeps unfolding gets a rule, derived once by reducing it on fresh variables, which later calls take instead of unfolding it.

The build installs susz 0.1.2 and the Aver release pinned in .aver-version (0.35.0) from crates.io, and builds Pestka with a profile from checking Init. The same source compiled to WebAssembly is the pestka-wasm entry.

Soundness (rightfully rejected tests)

84 ✅ 0 ❌ 0 🚫

Completeness (rightfully accepted tests)

139 ✅ 0 ❌ 0 🚫

Corner cases (no outcome prescribed)

30 ✅ 0 🚫

Test Expected Result ⏱️ 🧠
cedar 👍 👍 22.2 s (÷6.4) 1.4 GB (0%)
con-leche 👍 👍 14.5 s (÷7.6) 1.2 GB (+40%)
cslib 👍 👍 68.9 s (÷7.5) 3.1 GB (-8%)
init 👍 👍 9.51 s (÷7.0) 985.9 MB (+65%)
init-prelude 👍 👍 67.4 ms (÷5.5) 51.9 MB (÷2.1)
mathlib 👍 👍 3.63 min (÷8.7) 5.3 GB (-46%)
navier-stokes-euler 👍 👍 54.4 s (÷12) 3.4 GB (+35%)
reachability 👍 👍 4.30 s (÷5.5) 339.9 MB (÷4.9)
std 👍 👍 15.9 s (÷7.1) 1.3 GB (+43%)
30 85.9 ms 21.7 MB
closure-level-subst ✋ ✋ 1.97 ms 13.3 MB
constlevels ✋ ✋ 2.20 ms 13.7 MB
ctor-num-fields ✋ ✋ 2.33 ms 13.3 MB
eta-ctor-alias ✋ ✋ 2.07 ms 13.6 MB
k-rec-conv ✋ ✋ 2.18 ms 13.7 MB
large-elim-param ✋ ✋ 2.15 ms 19.9 MB
large-elim-prop-bool ✋ ✋ 2.26 ms 13.8 MB
level-imax-leq ✋ ✋ 2.00 ms 13.5 MB
level-imax-normalization ✋ ✋ 2.04 ms 13.5 MB
loose-bvar-value ✋ ✋ 1.93 ms 13.3 MB
nat-rec-k-lie ✋ ✋ 2.01 ms 13.4 MB
nat-rec-rules ✋ ✋ 2.03 ms 13.2 MB
nested-name-capture ✋ ✋ 2.51 ms 13.9 MB
nested-rec-rule-nfields ✋ ✋ 2.70 ms 13.7 MB
nested-unused-param ✋ ✋ 3.27 ms 15.8 MB
open-term-cache-context ✋ ✋ 1.93 ms 13.2 MB
orphan-rec ✋ ✋ 2.00 ms 19.8 MB
pi-closure-context ✋ ✋ 2.00 ms 19.9 MB
proj-non-structure ✋ ✋ 2.02 ms 13.3 MB
proj-of-imax-prop ✋ ✋ 2.29 ms 13.8 MB
proj-of-stuck-prop ✋ ✋ 6.98 ms 19.7 MB
proj-of-subst-prop ✋ ✋ 6.92 ms 21.7 MB
rec-k-lie ✋ ✋ 1.98 ms 13.3 MB
rec-missing-ih ✋ ✋ 7.16 ms 19.7 MB
rec-of-subst-prop ✋ ✋ 7.37 ms 21.6 MB
rec-rule-proof-irrel ✋ ✋ 2.36 ms 13.6 MB
rec-rule-proof-irrel-nested ✋ ✋ 2.59 ms 13.5 MB
rec-rule-wrong-arg ✋ ✋ 2.29 ms 13.8 MB
rec-type-proof-irrel ✋ ✋ 2.36 ms 13.5 MB
unit-rec-rule ✋ ✋ 2.03 ms 20.0 MB
1 72.5 ms 19.8 MB
alg-conv-trans-acc 🤷 ✋ 3.43 ms 15.7 MB
alg-conv-trans-acc-left 🤷 👍 3.40 ms 15.7 MB
alg-conv-trans-acc-right 🤷 👍 3.46 ms 15.6 MB
alg-conv-trans-quot 🤷 ✋ 2.07 ms 13.8 MB
alg-conv-trans-quot-left 🤷 ✋ 2.07 ms 13.8 MB
alg-conv-trans-quot-left-def 🤷 👍 2.09 ms 13.6 MB
alg-conv-trans-quot-right 🤷 👍 2.07 ms 13.7 MB
eta-ctor 🤷 ✋ 2.11 ms 13.4 MB
eta-rec-struct 🤷 ✋ 2.13 ms 13.7 MB
eta-rule-k 🤷 ✋ 2.04 ms 13.6 MB
eta-struct-major-and 🤷 👍 2.10 ms 13.7 MB
eta-struct-major-and-no-whnf 🤷 👍 2.41 ms 13.7 MB
eta-struct-major-no-whnf 🤷 👍 2.59 ms 13.6 MB
eta-unit-like-nested 🤷 ✋ 2.29 ms 13.8 MB
eta-unit-like-pi 🤷 ✋ 2.03 ms 13.7 MB
eta-unit-like-proof-field 🤷 ✋ 2.06 ms 13.5 MB
eta-unit-like-struct 🤷 ✋ 2.06 ms 13.7 MB
imax-nested-absorption 🤷 ✋ 1.91 ms 13.1 MB
imax-right-successor 🤷 👍 1.92 ms 12.7 MB
large-elim-maybe-prop 🤷 ✋ 1.95 ms 13.4 MB
let-value-type-mismatch 🤷 ✋ 1.98 ms 19.8 MB
nested-nonuniform-param 🤷 ✋ 2.13 ms 19.7 MB
nested-redex-aux 🤷 👍 3.15 ms 13.6 MB
positivity-whnf 🤷 ✋ 1.98 ms 13.4 MB
proj-maybe-prop 🤷 👍 2.11 ms 13.3 MB
proj-maybe-prop-past 🤷 👍 2.11 ms 13.6 MB
proof-param-ok 👍 👍 1.96 ms 13.5 MB
proof-param-swap 🤷 ✋ 1.92 ms 13.0 MB
subject-reduction-redex 🤷 👍 3.47 ms 15.6 MB
subject-reduction-reduct 🤷 ✋ 3.39 ms 15.6 MB
vanishing-occurrence 🤷 👍 2.07 ms 13.4 MB
10 21.8 ms 35.8 MB
extra-rec ✋ ✋ 1.92 ms 13.3 MB
inductive-undeclared-universe ✋ ✋ 1.95 ms 12.9 MB
level-index-out-of-order 👍 👍 2.06 ms 35.8 MB
nat-lit-add 👍 👍 2.43 ms 13.8 MB
nat-lit-add-bad ✋ ✋ 2.43 ms 13.8 MB
nat-lit-ble 👍 👍 2.49 ms 13.9 MB
nat-lit-sub 👍 👍 2.49 ms 13.7 MB
orphan-ctor ✋ ✋ 2.00 ms 19.8 MB
proj-of-prop ✋ ✋ 2.01 ms 13.7 MB
sparse-name-index 👍 👍 1.98 ms 19.6 MB
32 14.7 s (÷5.7) 3.9 GB
app-lam 👍 👍 189 ms (÷26) 132.3 MB (÷11)
args-before-unfold 👍 👍 5.12 ms (÷7.9) 20.1 MB (÷5.1)
beta-ladder 👍 👍 52.1 ms (÷32) 48.1 MB (÷11)
church-numerals 👍 👍 13.6 ms (÷3.8) 36.3 MB (÷3.1)
discarded-argument 👍 👍 2.15 ms (÷79) 13.7 MB (÷7.4)
discarded-argument-match 👍 👍 2.42 ms (÷60) 13.7 MB (÷7.5)
folded-constant-first 👍 👍 5.85 ms (÷7.7) 19.3 MB (÷5.4)
folded-constant-last 👍 👍 5.85 ms (÷7.7) 17.3 MB (÷6.0)
fueled-chain 👍 👍 20.1 ms (÷6.6) 36.0 MB (÷3.1)
gf3-matrix-product 👍 👍 5.45 s (+97%) 3.9 GB (+10%)
grind-ring-5 👍 👍 598 ms (÷3.6) 130.5 MB (÷2.0)
identical-nesting 👍 👍 2.07 ms (÷16) 13.7 MB (÷7.4)
irrelevance-before-evaluation 👍 👍 2.18 ms (÷15) 13.9 MB (÷7.3)
irrelevance-refutes 👍 👍 2.17 ms (÷15) 13.6 MB (÷7.4)
let-fold 👍 👍 8.52 ms (÷7.4) 21.8 MB (÷4.7)
let-ladder 👍 👍 49.4 ms (÷20) 52.0 MB (÷6.5)
magma-list-deep-n21 👍 👍 141 ms (÷19) 44.2 MB (÷16)
magma-list-deep-n36 👍 👍 1.40 s (÷25) 57.7 MB (÷138)
magma-list-pair-n21 👍 👍 4.43 s (÷4.2) 967.0 MB (÷4.2)
magma-list-pair-n7 👍 👍 345 ms (÷4.9) 108.1 MB (÷4.2)
magma-string-n4 👍 👍 649 ms (÷5.5) 168.8 MB (+8%)
magma-string-pair-n9 👍 👍 1.20 s (÷6.9) 265.0 MB (÷3.9)
proj-cheap-struct 👍 👍 3.61 ms (÷11) 15.6 MB (÷6.5)
proj-lazy-struct 👍 👍 2.83 ms (÷13) 15.6 MB (÷6.5)
proj-stuck-struct 👍 👍 2.92 ms (÷12) 15.7 MB (÷6.5)
prop-struct-projections 👍 👍 30.3 ms (÷3.4) 24.0 MB (÷4.4)
refute-cheap-first ✋ ✋ 2.28 ms (÷18) 13.6 MB (÷7.6)
refute-cheap-last ✋ ✋ 11.1 ms (÷16) 16.0 MB (÷6.4)
repeated-subproblem 👍 👍 2.20 ms (÷15) 13.9 MB (÷7.3)
shared-subterm 👍 👍 48.0 ms (-23%) 23.4 MB (÷4.6)
shift-cascade 👍 👍 20.2 ms (÷2.5) 20.0 MB (÷5.2)
unroll-versus-evaluate 👍 👍 2.43 ms (÷15) 16.6 MB (÷6.1)
141 281 ms 35.7 MB
001_basicDef 👍 👍 1.98 ms 19.7 MB
002_badDef ✋ ✋ 1.90 ms 12.7 MB
003_arrowType 👍 👍 2.06 ms 35.7 MB
004_dependentType 👍 👍 1.90 ms 12.9 MB
005_constType 👍 👍 1.91 ms 13.0 MB
006_betaReduction 👍 👍 1.91 ms 13.4 MB
007_betaReduction2 👍 👍 1.99 ms 20.1 MB
008_forallSortWhnf 👍 👍 1.99 ms 19.9 MB
009_forallSortBad ✋ ✋ 1.92 ms 13.1 MB
010_nonTypeType ✋ ✋ 2.07 ms 35.5 MB
011_nonTypeAxiom ✋ ✋ 1.91 ms 13.0 MB
012_nonPropThm ✋ ✋ 1.91 ms 13.0 MB
013_thmProof 👍 👍 1.92 ms 13.1 MB
014_selfProof ✋ ✋ 1.90 ms 13.0 MB
015_levelComp1 👍 👍 1.98 ms 19.4 MB
016_levelComp2 👍 👍 1.98 ms 19.8 MB
017_levelComp3 👍 👍 1.98 ms 19.9 MB
018_levelParams 👍 👍 1.92 ms 13.2 MB
019_tut06_bad01 ✋ ✋ 2.05 ms 35.7 MB
020_levelComp4 👍 👍 1.98 ms 20.1 MB
021_levelComp5 👍 👍 1.90 ms 13.0 MB
022_imax1 👍 👍 1.91 ms 12.9 MB
023_imax2 👍 👍 1.91 ms 13.0 MB
024_levelMaxComm 👍 👍 1.98 ms 19.7 MB
025_levelMaxAssoc 👍 👍 1.99 ms 19.8 MB
026_levelMaxIdem 👍 👍 1.90 ms 12.8 MB
027_levelMaxAbsorb 👍 👍 1.99 ms 19.6 MB
028_inferVar 👍 👍 1.90 ms 12.7 MB
029_defEqLambda 👍 👍 1.91 ms 12.9 MB
030_peano1 👍 👍 1.96 ms 13.3 MB
031_peano2 👍 👍 1.99 ms 13.3 MB
032_peano3 👍 👍 2.02 ms 13.5 MB
033_letType 👍 👍 1.98 ms 19.7 MB
034_letTypeDep 👍 👍 1.92 ms 13.6 MB
035_letRed 👍 👍 1.91 ms 13.5 MB
036_empty 👍 👍 2.00 ms 19.9 MB
037_boolType 👍 👍 1.95 ms 13.5 MB
038_twoBool 👍 👍 2.00 ms 13.1 MB
039_andType 👍 👍 1.97 ms 13.3 MB
040_prodType 👍 👍 1.99 ms 13.2 MB
041_pprodType 👍 👍 1.99 ms 13.6 MB
042_pUnitType 👍 👍 1.94 ms 13.4 MB
043_eqType 👍 👍 1.97 ms 13.2 MB
044_natDef 👍 👍 1.97 ms 13.3 MB
045_rbTreeDef 👍 👍 2.30 ms 13.3 MB
046_inductBadNonSort ✋ ✋ 1.99 ms 19.8 MB
047_inductBadNonSort2 ✋ ✋ 1.91 ms 13.2 MB
048_inductLevelParam ✋ ✋ 2.06 ms 35.4 MB
049_inductTooFewParams ✋ ✋ 1.90 ms 12.9 MB
050_inductWrongCtorParams ✋ ✋ 1.92 ms 13.3 MB
051_inductWrongCtorResParams ✋ ✋ 1.91 ms 13.0 MB
052_inductWrongCtorResLevel ✋ ✋ 1.92 ms 13.0 MB
053_inductInIndex ✋ ✋ 2.00 ms 19.7 MB
054_indNeg ✋ ✋ 1.99 ms 19.7 MB
055_reduceCtorParam.mk 👍 👍 1.98 ms 13.8 MB
056_reduceCtorType.mk ✋ ✋ 1.93 ms 13.3 MB
057_indNegReducible ✋ ✋ 1.93 ms 13.3 MB
058_predWithTypeField 👍 👍 2.02 ms 19.6 MB
059_typeWithTypeField 👍 👍 1.95 ms 13.4 MB
060_typeWithTypeFieldPoly 👍 👍 1.95 ms 13.3 MB
061_typeWithTooHighTypeField.mk ✋ ✋ 1.91 ms 13.2 MB
062_emptyRec 👍 👍 1.92 ms 13.6 MB
063_boolRec 👍 👍 1.96 ms 13.8 MB
064_twoBoolRec 👍 👍 2.01 ms 13.5 MB
065_andRec 👍 👍 1.98 ms 13.5 MB
066_prodRec 👍 👍 2.07 ms 19.7 MB
067_pprodRec 👍 👍 2.00 ms 13.5 MB
068_punitRec 👍 👍 1.95 ms 13.4 MB
069_eqRec 👍 👍 1.98 ms 13.5 MB
070_nRec 👍 👍 1.98 ms 13.5 MB
071_rbTreeRef 👍 👍 2.33 ms 13.7 MB
072_boolPropRec 👍 👍 1.95 ms 13.3 MB
073_BogusRecursor ✋ ✋ 1.95 ms 13.6 MB
074_existsRec 👍 👍 1.99 ms 13.2 MB
075_typeSingletonRecReduction 👍 👍 2.08 ms 13.6 MB
076_sortElimPropRec 👍 👍 2.04 ms 13.3 MB
077_sortElimProp2Rec 👍 👍 2.05 ms 13.7 MB
078_boolRecEqns 👍 👍 2.14 ms 13.5 MB
079_prodRecEqns 👍 👍 2.18 ms 19.7 MB
080_nRecReduction 👍 👍 2.18 ms 13.8 MB
081_listRecReduction 👍 👍 2.28 ms 13.6 MB
082_RBTree.id_spec 👍 👍 2.90 ms 13.6 MB
083_And.right 👍 👍 1.99 ms 13.6 MB
084_Prod.snd 👍 👍 2.00 ms 13.7 MB
085_PProd.snd 👍 👍 2.00 ms 13.4 MB
086_PSigma.snd 👍 👍 2.10 ms 19.9 MB
087_projOutOfRange ✋ ✋ 1.98 ms 13.7 MB
088_projNotStruct ✋ ✋ 1.97 ms 13.4 MB
089_projProp1 👍 👍 2.10 ms 13.6 MB
090_projProp2 ✋ ✋ 2.10 ms 13.5 MB
091_projProp3 👍 👍 2.11 ms 13.7 MB
092_projProp4 ✋ ✋ 2.18 ms 19.9 MB
093_projProp5 ✋ ✋ 2.11 ms 13.6 MB
094_projProp6 ✋ ✋ 2.11 ms 13.4 MB
095_projDataIndexRec 👍 👍 2.06 ms 13.5 MB
096_projIndexData ✋ ✋ 2.25 ms 13.7 MB
097_projIndexData2 ✋ ✋ 2.25 ms 13.7 MB
098_projRed 👍 👍 2.13 ms 13.8 MB
099_ruleK 👍 👍 2.04 ms 13.6 MB
100_ruleKbad ✋ ✋ 2.05 ms 13.7 MB
101_ruleKAcc ✋ ✋ 2.21 ms 13.9 MB
102_aNatLit 👍 👍 1.97 ms 13.7 MB
103_natLitEq 👍 👍 2.04 ms 13.8 MB
104_proofIrrelevance 👍 👍 1.99 ms 13.7 MB
105_proofIrrelevanceBad ✋ ✋ 2.00 ms 13.8 MB
106_proofIrrelevanceWhnf 👍 👍 2.00 ms 13.6 MB
107_proofIrrelevanceUnderBinder 👍 👍 1.94 ms 13.4 MB
108_unitEta1 👍 👍 2.03 ms 13.5 MB
109_unitEta2 👍 👍 2.03 ms 13.9 MB
110_unitEta3 👍 👍 2.03 ms 13.4 MB
111_indexedUnitEta ✋ ✋ 2.07 ms 13.8 MB
112_structEta 👍 👍 2.18 ms 13.4 MB
113_indexedStructEta ✋ ✋ 2.11 ms 13.6 MB
114_funEta 👍 👍 2.00 ms 13.5 MB
115_funEtaDep 👍 👍 2.00 ms 13.7 MB
116_funEtaBad ✋ ✋ 2.00 ms 13.4 MB
117_reflOccLeft ✋ ✋ 1.98 ms 13.4 MB
118_reflOccInIndex ✋ ✋ 1.99 ms 13.4 MB
119_reduceCtorParamRefl.mk 👍 👍 2.00 ms 13.3 MB
120_reduceCtorParamRefl2.mk 👍 👍 2.00 ms 13.7 MB
121_rTreeRec 👍 👍 2.03 ms 13.7 MB
122_rtreeRecReduction 👍 👍 2.14 ms 13.8 MB
123_accRecType 👍 👍 2.08 ms 13.6 MB
124_accRecReduction 👍 👍 2.21 ms 13.5 MB
125_accRecNoEta ✋ ✋ 2.21 ms 13.8 MB
126_quotMkType 👍 👍 2.02 ms 13.6 MB
127_quotIndType 👍 👍 2.03 ms 13.4 MB
128_quotLiftType 👍 👍 2.03 ms 13.4 MB
129_quotSoundType 👍 👍 2.04 ms 13.7 MB
130_quotLiftReduction 👍 👍 2.05 ms 13.6 MB
131_quotIndReduction 👍 👍 2.05 ms 13.9 MB
132_dup_defs ✋ ✋ 1.49 ms 4.0 MB
133_dup_ind_def ✋ ✋ 1.51 ms 3.6 MB
134_dup_ctor_def ✋ ✋ 1.50 ms 3.7 MB
135_dup_rec_def ✋ ✋ 1.51 ms 3.8 MB
136_misnamed_rec_user ✋ ✋ 2.01 ms 19.7 MB
137_dup_rec_def2 ✋ ✋ 1.92 ms 12.8 MB
138_dup_ctor_rec ✋ ✋ 1.50 ms 3.9 MB
139_DupConCon ✋ ✋ 1.51 ms 3.8 MB
140_falseFromUnsafe ✋ ✋ 2.00 ms 19.7 MB
141_falseFromPartial ✋ ✋ 1.92 ms 13.4 MB