Lean Kernel Arena / tenet-hs

Checker "tenet-hs"

Language: Haskell Haskell · Version: 0.1.2 · 📄 Declaration · 🔗 Source

tenet-hs is an independent implementation of the Lean 4 kernel in Haskell, written from the type theory and the reference kernel's behavior rather than translated from it. It is a sibling of Tenet, the .NET implementation, and the two are maintained together: the more independent kernels there are, the more chances to find a bug in the reference kernel, in the others, or in the specification they are all trying to match.

It reads lean4export NDJSON, re-derives every constructor and recursor (nested and mutual inductives included) and compares them field for field with what the exporter wrote, and has no dependencies beyond the libraries that ship with GHC.

Everywhere it deliberately decides something differently from Lean is written down in docs/divergences.md. Two matter here: it checks that the constant named Nat.add behaves like addition before taking the arithmetic shortcut named after it, and it refuses a numeric literal unless the environment's Nat is the inductive the literal denotes. Both are extra checks on the prelude of the kind the arena's README permits. Lean.reduceBool and Lean.reduceNat are declined.

It is single-threaded and slower than the other independent kernels; the reasons, with measurements, are in docs/design.md.

Written by Claude (Anthropic), directed by Keith Adler.

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 👍 👍 2.40 min (+2%) 1.5 GB (+8%)
con-leche 👍 👍 2.17 min (+17%) 1.6 GB (+83%)
cslib 👍 👍 10.1 min (+18%) 4.1 GB (+20%)
init 👍 👍 71.9 s (+8%) 790.7 MB (+32%)
init-prelude 👍 👍 256 ms (-31%) 78.4 MB (-28%)
mathlib 👍 👍 50.0 min (+58%) 11.4 GB (+15%)
navier-stokes-euler 👍 👍 18.2 min (+63%) 3.0 GB (+21%)
reachability 👍 👍 43.7 s (+85%) 1.1 GB (-35%)
std 👍 👍 2.03 min (+8%) 1.3 GB (+37%)
30 126 ms 49.5 MB
closure-level-subst ✋ ✋ 1.19 ms 7.7 MB
constlevels ✋ ✋ 1.78 ms 9.4 MB
ctor-num-fields ✋ ✋ 2.82 ms 11.9 MB
eta-ctor-alias ✋ ✋ 1.39 ms 8.7 MB
k-rec-conv ✋ ✋ 1.72 ms 9.4 MB
large-elim-param ✋ ✋ 1.27 ms 8.2 MB
large-elim-prop-bool ✋ ✋ 2.19 ms 10.3 MB
level-imax-leq ✋ ✋ 1.27 ms 8.2 MB
level-imax-normalization ✋ ✋ 1.28 ms 8.2 MB
loose-bvar-value ✋ ✋ 1.12 ms 8.0 MB
nat-rec-k-lie ✋ ✋ 1.32 ms 8.6 MB
nat-rec-rules ✋ ✋ 1.45 ms 8.7 MB
nested-name-capture ✋ ✋ 2.42 ms 11.0 MB
nested-rec-rule-nfields ✋ ✋ 3.24 ms 12.9 MB
nested-unused-param ✋ ✋ 4.76 ms 16.3 MB
open-term-cache-context ✋ ✋ 1.09 ms 7.4 MB
orphan-rec ✋ ✋ 1.06 ms 7.7 MB
pi-closure-context ✋ ✋ 1.07 ms 7.4 MB
proj-non-structure ✋ ✋ 1.25 ms 8.3 MB
proj-of-imax-prop ✋ ✋ 1.95 ms 9.9 MB
proj-of-stuck-prop ✋ ✋ 20.2 ms 47.9 MB
proj-of-subst-prop ✋ ✋ 18.3 ms 44.3 MB
rec-k-lie ✋ ✋ 1.25 ms 8.3 MB
rec-missing-ih ✋ ✋ 20.7 ms 49.5 MB
rec-of-subst-prop ✋ ✋ 19.3 ms 46.4 MB
rec-rule-proof-irrel ✋ ✋ 2.30 ms 10.7 MB
rec-rule-proof-irrel-nested ✋ ✋ 2.82 ms 12.0 MB
rec-rule-wrong-arg ✋ ✋ 2.09 ms 10.3 MB
rec-type-proof-irrel ✋ ✋ 2.29 ms 10.5 MB
unit-rec-rule ✋ ✋ 1.17 ms 8.0 MB
1 2.42 min 71.8 MB
alg-conv-trans-acc 🤷 ✋ 5.31 ms 17.3 MB
alg-conv-trans-acc-left 🤷 👍 5.23 ms 17.2 MB
alg-conv-trans-acc-right 🤷 👍 5.35 ms 17.5 MB
alg-conv-trans-quot 🤷 ✋ 1.53 ms 8.7 MB
alg-conv-trans-quot-left 🤷 ✋ 1.55 ms 8.9 MB
alg-conv-trans-quot-left-def 🤷 👍 1.55 ms 8.8 MB
alg-conv-trans-quot-right 🤷 👍 1.48 ms 8.7 MB
eta-ctor 🤷 ✋ 1.47 ms 9.0 MB
eta-rec-struct 🤷 ✋ 1.55 ms 9.0 MB
eta-rule-k 🤷 ✋ 1.37 ms 8.3 MB
eta-struct-major-and 🤷 ✋ 1.61 ms 9.1 MB
eta-struct-major-and-no-whnf 🤷 ✋ 66.5 s 71.8 MB
eta-struct-major-no-whnf 🤷 ✋ 78.1 s 71.7 MB
eta-unit-like-nested 🤷 ✋ 1.86 ms 9.8 MB
eta-unit-like-pi 🤷 ✋ 1.31 ms 8.4 MB
eta-unit-like-proof-field 🤷 ✋ 1.35 ms 8.4 MB
eta-unit-like-struct 🤷 ✋ 1.36 ms 8.5 MB
imax-nested-absorption 🤷 ✋ 1.04 ms 7.3 MB
imax-right-successor 🤷 ✋ 1.05 ms 7.4 MB
large-elim-maybe-prop 🤷 ✋ 1.17 ms 8.2 MB
let-value-type-mismatch 🤷 ✋ 1.03 ms 7.2 MB
nested-nonuniform-param 🤷 ✋ 1.39 ms 8.6 MB
nested-redex-aux 🤷 👍 4.04 ms 14.6 MB
positivity-whnf 🤷 ✋ 1.21 ms 8.1 MB
proj-maybe-prop 🤷 👍 1.44 ms 8.5 MB
proj-maybe-prop-past 🤷 👍 1.44 ms 8.7 MB
proof-param-ok 👍 👍 1.15 ms 8.0 MB
proof-param-swap 🤷 ✋ 1.11 ms 7.4 MB
subject-reduction-redex 🤷 👍 5.32 ms 17.2 MB
subject-reduction-reduct 🤷 ✋ 5.26 ms 17.1 MB
vanishing-occurrence 🤷 👍 1.37 ms 8.5 MB
10 16.8 ms 11.5 MB
extra-rec ✋ ✋ 1.06 ms 7.8 MB
inductive-undeclared-universe ✋ ✋ 1.11 ms 7.7 MB
level-index-out-of-order 👍 👍 1.02 ms 7.2 MB
nat-lit-add 👍 👍 2.49 ms 11.1 MB
nat-lit-add-bad ✋ ✋ 2.49 ms 11.0 MB
nat-lit-ble 👍 👍 2.67 ms 11.5 MB
nat-lit-sub 👍 👍 2.71 ms 11.5 MB
orphan-ctor ✋ ✋ 1.06 ms 7.8 MB
proj-of-prop ✋ ✋ 1.19 ms 8.1 MB
sparse-name-index 👍 👍 1.02 ms 7.2 MB
32 5.18 min (×3.7) 3.3 GB
app-lam 👍 👍 15.8 s (×3.2) 3.3 GB (×2.3)
args-before-unfold 👍 👍 8.68 ms (÷4.6) 21.7 MB (÷4.7)
beta-ladder 👍 👍 3.20 s (+92%) 683.3 MB (+28%)
church-numerals 👍 👍 24.8 ms (÷2.1) 56.6 MB (÷2.0)
discarded-argument 👍 👍 10.2 ms (÷17) 24.8 MB (÷4.1)
discarded-argument-match 👍 👍 27.2 ms (÷5.4) 56.4 MB (-45%)
folded-constant-first 👍 👍 12.7 ms (÷3.6) 30.9 MB (÷3.4)
folded-constant-last 👍 👍 12.6 ms (÷3.6) 30.9 MB (÷3.4)
fueled-chain 👍 👍 85.7 ms (-36%) 75.8 MB (-32%)
gf3-matrix-product 👍 👍 1.94 s (-30%) 3.0 GB (-16%)
grind-ring-5 👍 👍 2.53 s (+17%) 243.2 MB (-7%)
identical-nesting 👍 👍 1.44 ms (÷22) 8.8 MB (÷12)
irrelevance-before-evaluation 👍 👍 1.88 ms (÷18) 9.8 MB (÷10)
irrelevance-refutes 👍 👍 1.70 ms (÷19) 9.3 MB (÷11)
let-fold 👍 👍 23.0 ms (÷2.7) 54.2 MB (-47%)
let-ladder 👍 👍 1.91 s (+89%) 634.2 MB (+87%)
magma-list-deep-n21 👍 👍 6.24 s (×2.3) 722.5 MB (+4%)
magma-list-deep-n36 👍 👍 3.65 min (×6.2) 816.5 MB (÷9.8)
magma-list-pair-n21 👍 👍 37.4 s (×2.0) 2.4 GB (-39%)
magma-list-pair-n7 👍 👍 3.29 s (+95%) 571.5 MB (+24%)
magma-string-n4 👍 👍 3.93 s (+10%) 171.4 MB (+9%)
magma-string-pair-n9 👍 👍 15.0 s (+82%) 894.7 MB (-12%)
proj-cheap-struct 👍 👍 5.74 ms (÷6.8) 18.4 MB (÷5.5)
proj-lazy-struct 👍 👍 3.45 ms (÷10) 13.5 MB (÷7.5)
proj-stuck-struct 👍 👍 3.78 ms (÷9.5) 14.0 MB (÷7.2)
prop-struct-projections 👍 👍 75.2 ms (-28%) 76.3 MB (-27%)
refute-cheap-first ✋ ✋ 2.16 ms (÷19) 10.2 MB (÷10)
refute-cheap-last ✋ ✋ 195 ms (+8%) 73.2 MB (-29%)
repeated-subproblem 👍 👍 1.77 ms (÷19) 9.5 MB (÷11)
shared-subterm 👍 👍 32.6 ms (-47%) 71.5 MB (-34%)
shift-cascade 👍 👍 45.5 ms (-10%) 73.3 MB (-29%)
unroll-versus-evaluate 👍 👍 3.30 ms (÷11) 12.5 MB (÷8.1)
141 176 ms 15.1 MB
001_basicDef 👍 👍 1.02 ms 7.2 MB
002_badDef ✋ ✋ 1.02 ms 7.2 MB
003_arrowType 👍 👍 1.03 ms 7.4 MB
004_dependentType 👍 👍 1.02 ms 7.2 MB
005_constType 👍 👍 1.04 ms 7.4 MB
006_betaReduction 👍 👍 1.06 ms 7.4 MB
007_betaReduction2 👍 👍 1.06 ms 7.5 MB
008_forallSortWhnf 👍 👍 1.05 ms 7.5 MB
009_forallSortBad ✋ ✋ 1.06 ms 7.4 MB
010_nonTypeType ✋ ✋ 1.05 ms 7.5 MB
011_nonTypeAxiom ✋ ✋ 1.05 ms 7.4 MB
012_nonPropThm ✋ ✋ 1.03 ms 7.2 MB
013_thmProof 👍 👍 1.06 ms 7.4 MB
014_selfProof ✋ ✋ 1.03 ms 7.3 MB
015_levelComp1 👍 👍 1.02 ms 7.2 MB
016_levelComp2 👍 👍 1.02 ms 7.2 MB
017_levelComp3 👍 👍 1.02 ms 7.3 MB
018_levelParams 👍 👍 1.06 ms 7.4 MB
019_tut06_bad01 ✋ ✋ 1.03 ms 7.0 MB
020_levelComp4 👍 👍 1.02 ms 7.2 MB
021_levelComp5 👍 👍 1.02 ms 7.2 MB
022_imax1 👍 👍 1.04 ms 7.4 MB
023_imax2 👍 👍 1.04 ms 7.4 MB
024_levelMaxComm 👍 👍 1.03 ms 7.2 MB
025_levelMaxAssoc 👍 👍 1.03 ms 7.3 MB
026_levelMaxIdem 👍 👍 1.02 ms 7.2 MB
027_levelMaxAbsorb 👍 👍 1.03 ms 7.2 MB
028_inferVar 👍 👍 1.03 ms 7.3 MB
029_defEqLambda 👍 👍 1.06 ms 7.4 MB
030_peano1 👍 👍 1.16 ms 7.7 MB
031_peano2 👍 👍 1.23 ms 7.8 MB
032_peano3 👍 👍 1.27 ms 7.9 MB
033_letType 👍 👍 1.02 ms 7.3 MB
034_letTypeDep 👍 👍 1.05 ms 7.3 MB
035_letRed 👍 👍 1.03 ms 7.3 MB
036_empty 👍 👍 1.06 ms 7.8 MB
037_boolType 👍 👍 1.11 ms 7.9 MB
038_twoBool 👍 👍 1.21 ms 8.2 MB
039_andType 👍 👍 1.18 ms 8.1 MB
040_prodType 👍 👍 1.21 ms 8.3 MB
041_pprodType 👍 👍 1.21 ms 8.1 MB
042_pUnitType 👍 👍 1.09 ms 7.9 MB
043_eqType 👍 👍 1.18 ms 8.2 MB
044_natDef 👍 👍 1.17 ms 8.2 MB
045_rbTreeDef 👍 👍 2.08 ms 10.5 MB
046_inductBadNonSort ✋ ✋ 1.06 ms 7.7 MB
047_inductBadNonSort2 ✋ ✋ 1.03 ms 7.5 MB
048_inductLevelParam ✋ ✋ 1.03 ms 7.4 MB
049_inductTooFewParams ✋ ✋ 1.03 ms 7.2 MB
050_inductWrongCtorParams ✋ ✋ 1.05 ms 7.4 MB
051_inductWrongCtorResParams ✋ ✋ 1.05 ms 7.3 MB
052_inductWrongCtorResLevel ✋ ✋ 1.06 ms 7.3 MB
053_inductInIndex ✋ ✋ 1.06 ms 7.8 MB
054_indNeg ✋ ✋ 1.06 ms 7.6 MB
055_reduceCtorParam.mk 👍 👍 1.23 ms 8.3 MB
056_reduceCtorType.mk ✋ ✋ 1.08 ms 7.8 MB
057_indNegReducible ✋ ✋ 1.09 ms 7.9 MB
058_predWithTypeField 👍 👍 1.10 ms 7.9 MB
059_typeWithTypeField 👍 👍 1.10 ms 7.9 MB
060_typeWithTypeFieldPoly 👍 👍 1.11 ms 8.0 MB
061_typeWithTooHighTypeField.mk ✋ ✋ 1.05 ms 7.7 MB
062_emptyRec 👍 👍 1.06 ms 7.7 MB
063_boolRec 👍 👍 1.14 ms 8.1 MB
064_twoBoolRec 👍 👍 1.24 ms 8.4 MB
065_andRec 👍 👍 1.19 ms 8.1 MB
066_prodRec 👍 👍 1.23 ms 8.3 MB
067_pprodRec 👍 👍 1.23 ms 8.3 MB
068_punitRec 👍 👍 1.10 ms 8.0 MB
069_eqRec 👍 👍 1.19 ms 8.1 MB
070_nRec 👍 👍 1.17 ms 8.1 MB
071_rbTreeRef 👍 👍 2.16 ms 10.5 MB
072_boolPropRec 👍 👍 1.11 ms 8.0 MB
073_BogusRecursor ✋ ✋ 1.09 ms 7.9 MB
074_existsRec 👍 👍 1.22 ms 8.4 MB
075_typeSingletonRecReduction 👍 👍 1.40 ms 8.7 MB
076_sortElimPropRec 👍 👍 1.31 ms 8.6 MB
077_sortElimProp2Rec 👍 👍 1.36 ms 8.6 MB
078_boolRecEqns 👍 👍 1.58 ms 9.2 MB
079_prodRecEqns 👍 👍 1.56 ms 9.1 MB
080_nRecReduction 👍 👍 1.71 ms 9.4 MB
081_listRecReduction 👍 👍 2.08 ms 10.2 MB
082_RBTree.id_spec 👍 👍 4.23 ms 15.1 MB
083_And.right 👍 👍 1.23 ms 8.3 MB
084_Prod.snd 👍 👍 1.25 ms 8.2 MB
085_PProd.snd 👍 👍 1.25 ms 8.3 MB
086_PSigma.snd 👍 👍 1.30 ms 8.4 MB
087_projOutOfRange ✋ ✋ 1.21 ms 8.3 MB
088_projNotStruct ✋ ✋ 1.18 ms 8.2 MB
089_projProp1 👍 👍 1.46 ms 9.0 MB
090_projProp2 ✋ ✋ 1.47 ms 9.0 MB
091_projProp3 👍 👍 1.46 ms 8.9 MB
092_projProp4 ✋ ✋ 1.47 ms 9.0 MB
093_projProp5 ✋ ✋ 1.48 ms 8.9 MB
094_projProp6 ✋ ✋ 1.47 ms 8.9 MB
095_projDataIndexRec 👍 👍 1.34 ms 8.6 MB
096_projIndexData ✋ ✋ 1.76 ms 9.7 MB
097_projIndexData2 ✋ ✋ 1.76 ms 9.7 MB
098_projRed 👍 👍 1.53 ms 9.1 MB
099_ruleK 👍 👍 1.34 ms 8.7 MB
100_ruleKbad ✋ ✋ 1.38 ms 8.5 MB
101_ruleKAcc ✋ ✋ 1.80 ms 9.8 MB
102_aNatLit 👍 👍 1.16 ms 8.0 MB
103_natLitEq 👍 👍 1.34 ms 8.5 MB
104_proofIrrelevance 👍 👍 1.26 ms 8.3 MB
105_proofIrrelevanceBad ✋ ✋ 1.26 ms 8.2 MB
106_proofIrrelevanceWhnf 👍 👍 1.28 ms 8.5 MB
107_proofIrrelevanceUnderBinder 👍 👍 1.08 ms 7.5 MB
108_unitEta1 👍 👍 1.32 ms 8.5 MB
109_unitEta2 👍 👍 1.30 ms 8.5 MB
110_unitEta3 👍 👍 1.31 ms 8.5 MB
111_indexedUnitEta ✋ ✋ 1.38 ms 8.7 MB
112_structEta 👍 👍 1.72 ms 9.6 MB
113_indexedStructEta ✋ ✋ 1.45 ms 8.9 MB
114_funEta 👍 👍 1.27 ms 8.3 MB
115_funEtaDep 👍 👍 1.28 ms 8.4 MB
116_funEtaBad ✋ ✋ 1.28 ms 8.3 MB
117_reflOccLeft ✋ ✋ 1.20 ms 8.3 MB
118_reflOccInIndex ✋ ✋ 1.21 ms 8.1 MB
119_reduceCtorParamRefl.mk 👍 👍 1.25 ms 8.3 MB
120_reduceCtorParamRefl2.mk 👍 👍 1.25 ms 8.3 MB
121_rTreeRec 👍 👍 1.28 ms 8.4 MB
122_rtreeRecReduction 👍 👍 1.56 ms 9.0 MB
123_accRecType 👍 👍 1.47 ms 8.7 MB
124_accRecReduction 👍 👍 1.83 ms 9.6 MB
125_accRecNoEta ✋ ✋ 1.82 ms 9.6 MB
126_quotMkType 👍 👍 1.30 ms 8.5 MB
127_quotIndType 👍 👍 1.31 ms 8.5 MB
128_quotLiftType 👍 👍 1.32 ms 8.6 MB
129_quotSoundType 👍 👍 1.36 ms 8.6 MB
130_quotLiftReduction 👍 👍 1.42 ms 8.6 MB
131_quotIndReduction 👍 👍 1.42 ms 8.7 MB
132_dup_defs ✋ ✋ 1.03 ms 7.2 MB
133_dup_ind_def ✋ ✋ 1.07 ms 7.5 MB
134_dup_ctor_def ✋ ✋ 1.07 ms 7.9 MB
135_dup_rec_def ✋ ✋ 1.07 ms 7.5 MB
136_misnamed_rec_user ✋ ✋ 1.10 ms 8.0 MB
137_dup_rec_def2 ✋ ✋ 1.07 ms 7.6 MB
138_dup_ctor_rec ✋ ✋ 1.07 ms 7.9 MB
139_DupConCon ✋ ✋ 1.09 ms 7.8 MB
140_falseFromUnsafe ✋ ✋ 1.07 ms 7.7 MB
141_falseFromPartial ✋ ✋ 1.07 ms 7.7 MB