Lean Kernel Arena / ocaml4lean

Checker "ocaml4lean"

Version: 3753af7 · 📄 Declaration · 🔗 Source

ocaml4lean is an independent Lean 4 kernel in OCaml 5. It follows the official kernel's algorithm, including its definitional equality heuristics: lazy delta reduction, proof irrelevance, eta, structure eta, unit-like types, Nat and String literals, and eagerReduce.

  • Inductives. It re-derives every inductive block from the types and constructors, including the nested-to-mutual translation and the auxiliary recursors. Every exported constructor and recursor must be identical to the derived one.
  • Terms. Terms use locally nameless de Bruijn indices, and free variables carry their types. The environment read from the file is hash-consed. Terms built during checking are not interned; they are compared structurally behind a hash check.
  • Parallelism. Declarations are checked on 4 OCaml domains. Each block sees only the constants declared before it in the file, so the verdict is the same as a sequential replay.
  • Dependencies. None beyond the OCaml compiler. It uses its own bignum module for Nat literals.
  • Exit codes. It never declines and accepts any axiom, as the official kernel does. Errors (unparsable input, running out of stack or memory) exit with code 3 and are never reported as a rejection.

The parsed environment takes about as much memory as the export file. For inputs over 1 GB the checker compacts the heap after parsing and lowers the GC's space overhead, keeping peak memory near twice the input size.

Written by Claude (Anthropic), directed by yoonwoojeong.

Soundness (rightfully rejected tests)

80 ✅ 0 ❌ 0 🚫

Completeness (rightfully accepted tests)

137 ✅ 0 ❌ 1 🚫

Corner cases (no outcome prescribed)

27 ✅ 3 🚫

Test Expected Result ⏱️ 🧠
cedar 👍 👍 2.93 min (+25%) 3.3 GB (×2.5)
con-leche 👍 👍 5.72 min (×3.1) 2.2 GB (×2.6)
cslib 👍 👍 13.9 min (+62%) 5.5 GB (+60%)
init 👍 👍 87.0 s (+31%) 1.3 GB (×2.3)
init-prelude 👍 👍 228 ms (-37%) 43.1 MB (-41%)
mathlib 👍 💥 4.23 min 14.6 GB
navier-stokes-euler 👍 👍 32.2 min (×2.9) 5.5 GB (×2.2)
reachability 👍 👍 40.1 s (+71%) 6.2 GB (×3.8)
std 👍 👍 3.40 min (+82%) 2.8 GB (×3.1)
26 425 ms 31.6 MB
closure-level-subst ✋ ✋ 13.6 ms 23.6 MB
constlevels ✋ ✋ 13.9 ms 25.1 MB
ctor-num-fields ✋ ✋ 14.8 ms 26.8 MB
eta-ctor-alias ✋ ✋ 13.6 ms 24.0 MB
forged-quot-ind ✋ ✋ 13.6 ms 24.4 MB
k-rec-conv ✋ ✋ 14.0 ms 24.0 MB
large-elim-param ✋ ✋ 13.7 ms 23.6 MB
large-elim-prop-bool ✋ ✋ 14.1 ms 25.7 MB
level-imax-leq ✋ ✋ 13.5 ms 23.8 MB
level-imax-normalization ✋ ✋ 13.5 ms 23.6 MB
loose-bvar-value ✋ ✋ 13.2 ms 22.5 MB
nat-rec-k-lie ✋ ✋ 13.9 ms 23.9 MB
nat-rec-rules ✋ ✋ 13.6 ms 24.3 MB
nested-name-capture ✋ ✋ 14.5 ms 25.9 MB
nested-rec-rule-nfields ✋ ✋ 15.3 ms 26.9 MB
nested-unused-param ✋ ✋ 16.5 ms 27.3 MB
orphan-rec ✋ ✋ 13.4 ms 22.2 MB
pi-closure-context ✋ ✋ 13.2 ms 23.1 MB
proj-non-structure ✋ ✋ 13.4 ms 23.2 MB
proj-of-imax-prop ✋ ✋ 14.5 ms 25.4 MB
proj-of-stuck-prop ✋ ✋ 29.6 ms 30.7 MB
proj-of-subst-prop ✋ ✋ 28.4 ms 31.0 MB
rec-k-lie ✋ ✋ 13.4 ms 23.6 MB
rec-missing-ih ✋ ✋ 30.2 ms 31.6 MB
rec-of-subst-prop ✋ ✋ 29.8 ms 30.2 MB
unit-rec-rule ✋ ✋ 13.4 ms 23.4 MB
1 447 ms 28.2 MB
alg-conv-trans-acc 🤷 ✋ 16.9 ms 28.2 MB
alg-conv-trans-acc-left 🤷 💥 17.1 ms 27.2 MB
alg-conv-trans-acc-right 🤷 👍 17.6 ms 27.6 MB
alg-conv-trans-quot 🤷 ✋ 14.0 ms 23.6 MB
alg-conv-trans-quot-left 🤷 ✋ 38.7 ms 23.5 MB
alg-conv-trans-quot-left-def 🤷 👍 14.2 ms 24.1 MB
alg-conv-trans-quot-right 🤷 👍 14.0 ms 24.4 MB
eta-ctor 🤷 ✋ 13.6 ms 24.4 MB
eta-rec-struct 🤷 ✋ 13.7 ms 24.2 MB
eta-rule-k 🤷 ✋ 13.9 ms 23.5 MB
eta-struct-major-and 🤷 ✋ 13.9 ms 24.1 MB
eta-struct-major-and-no-whnf 🤷 ⌛ 0 ms 0 B
eta-struct-major-no-whnf 🤷 ⌛ 0 ms 0 B
eta-unit-like-nested 🤷 ✋ 14.0 ms 25.0 MB
eta-unit-like-pi 🤷 ✋ 13.6 ms 23.6 MB
eta-unit-like-proof-field 🤷 ✋ 13.6 ms 23.6 MB
eta-unit-like-struct 🤷 ✋ 13.5 ms 24.3 MB
imax-nested-absorption 🤷 ✋ 13.1 ms 22.2 MB
imax-right-successor 🤷 ✋ 13.1 ms 22.4 MB
large-elim-maybe-prop 🤷 ✋ 13.1 ms 22.8 MB
let-value-type-mismatch 🤷 ✋ 13.1 ms 21.6 MB
nested-nonuniform-param 🤷 ✋ 13.7 ms 24.3 MB
nested-redex-aux 🤷 👍 16.6 ms 27.0 MB
positivity-whnf 🤷 ✋ 13.3 ms 23.7 MB
proj-maybe-prop 🤷 👍 14.1 ms 24.4 MB
proj-maybe-prop-past 🤷 👍 13.6 ms 24.3 MB
proof-param-ok 👍 👍 13.3 ms 22.3 MB
proof-param-swap 🤷 ✋ 19.6 ms 21.9 MB
subject-reduction-redex 🤷 👍 17.7 ms 27.3 MB
subject-reduction-reduct 🤷 ✋ 17.3 ms 28.2 MB
vanishing-occurrence 🤷 👍 13.5 ms 23.7 MB
10 137 ms 26.2 MB
extra-rec ✋ ✋ 13.2 ms 22.0 MB
inductive-undeclared-universe ✋ ✋ 13.6 ms 22.7 MB
level-index-out-of-order 👍 👍 12.7 ms 20.9 MB
nat-lit-add 👍 👍 14.3 ms 25.4 MB
nat-lit-add-bad ✋ ✋ 14.3 ms 25.6 MB
nat-lit-ble 👍 👍 14.6 ms 26.2 MB
nat-lit-sub 👍 👍 14.5 ms 26.0 MB
orphan-ctor ✋ ✋ 13.3 ms 22.4 MB
proj-of-prop ✋ ✋ 13.9 ms 23.6 MB
sparse-name-index 👍 👍 12.7 ms 20.9 MB
31 2.30 min (+70%) 8.8 GB
app-lam 👍 👍 11.0 s (×2.3) 1.5 GB (+9%)
args-before-unfold 👍 👍 20.1 ms (-44%) 28.2 MB (÷2.3)
beta-ladder 👍 👍 3.13 s (+88%) 479.7 MB (-4%)
church-numerals 👍 👍 59.0 ms (+26%) 36.4 MB (÷2.2)
discarded-argument 👍 👍 33.2 ms (÷5.0) 26.2 MB (÷2.5)
discarded-argument-match 👍 👍 118 ms (-17%) 31.7 MB (÷2.1)
folded-constant-first 👍 👍 29.9 ms (-27%) 29.8 MB (÷2.3)
folded-constant-last 👍 👍 29.6 ms (-27%) 31.7 MB (÷2.2)
fueled-chain 👍 👍 374 ms (×2.9) 43.9 MB (-42%)
grind-ring-5 👍 👍 2.32 s (+8%) 248.1 MB (+9%)
identical-nesting 👍 👍 13.8 ms (÷2.0) 24.0 MB (÷2.8)
irrelevance-before-evaluation 👍 👍 14.5 ms (-50%) 24.3 MB (÷2.7)
irrelevance-refutes 👍 👍 14.0 ms (÷2.0) 24.6 MB (÷2.7)
let-fold 👍 👍 33.2 ms (-43%) 31.4 MB (÷2.1)
let-ladder 👍 👍 1.70 s (+69%) 265.6 MB (-17%)
magma-list-deep-n21 👍 👍 4.98 s (+85%) 786.7 MB (+18%)
magma-list-deep-n36 👍 👍 63.0 s (+78%) 8.8 GB (+12%)
magma-list-pair-n21 👍 👍 32.4 s (+76%) 5.4 GB (+37%)
magma-list-pair-n7 👍 👍 3.14 s (+86%) 593.0 MB (+39%)
magma-string-n4 👍 👍 3.86 s (+9%) 177.0 MB (+46%)
magma-string-pair-n9 👍 👍 11.4 s (+39%) 1.3 GB (+31%)
proj-cheap-struct 👍 👍 17.9 ms (-48%) 27.0 MB (÷2.4)
proj-lazy-struct 👍 👍 15.9 ms (-49%) 27.2 MB (÷2.4)
proj-stuck-struct 👍 👍 15.8 ms (÷2.0) 26.8 MB (÷2.4)
prop-struct-projections 👍 👍 98.7 ms (-1%) 37.2 MB (-47%)
refute-cheap-first ✋ ✋ 14.0 ms (÷3.0) 25.0 MB (÷2.8)
refute-cheap-last ✋ ✋ 34.8 ms (÷5.2) 27.3 MB (÷2.5)
repeated-subproblem 👍 👍 13.9 ms (÷2.1) 24.3 MB (÷2.7)
shared-subterm 👍 👍 48.5 ms (-16%) 31.2 MB (÷2.3)
shift-cascade 👍 👍 22.9 ms (÷2.0) 28.8 MB (÷2.4)
unroll-versus-evaluate 👍 👍 14.9 ms (÷2.1) 26.2 MB (÷2.5)
141 1.89 s 26.8 MB
001_basicDef 👍 👍 12.9 ms 21.0 MB
002_badDef ✋ ✋ 12.8 ms 21.0 MB
003_arrowType 👍 👍 13.2 ms 21.3 MB
004_dependentType 👍 👍 13.1 ms 21.2 MB
005_constType 👍 👍 13.1 ms 21.5 MB
006_betaReduction 👍 👍 13.1 ms 22.2 MB
007_betaReduction2 👍 👍 13.1 ms 21.9 MB
008_forallSortWhnf 👍 👍 13.1 ms 22.0 MB
009_forallSortBad ✋ ✋ 13.3 ms 21.5 MB
010_nonTypeType ✋ ✋ 13.6 ms 21.9 MB
011_nonTypeAxiom ✋ ✋ 13.1 ms 21.6 MB
012_nonPropThm ✋ ✋ 13.4 ms 21.1 MB
013_thmProof 👍 👍 13.2 ms 21.6 MB
014_selfProof ✋ ✋ 13.0 ms 21.3 MB
015_levelComp1 👍 👍 13.0 ms 20.7 MB
016_levelComp2 👍 👍 13.0 ms 21.0 MB
017_levelComp3 👍 👍 13.2 ms 20.8 MB
018_levelParams 👍 👍 13.3 ms 22.1 MB
019_tut06_bad01 ✋ ✋ 13.1 ms 20.9 MB
020_levelComp4 👍 👍 13.0 ms 20.9 MB
021_levelComp5 👍 👍 12.8 ms 20.8 MB
022_imax1 👍 👍 13.1 ms 21.0 MB
023_imax2 👍 👍 13.0 ms 21.3 MB
024_levelMaxComm 👍 👍 13.1 ms 20.8 MB
025_levelMaxAssoc 👍 👍 13.1 ms 21.0 MB
026_levelMaxIdem 👍 👍 13.4 ms 21.1 MB
027_levelMaxAbsorb 👍 👍 13.4 ms 21.0 MB
028_inferVar 👍 👍 12.7 ms 21.1 MB
029_defEqLambda 👍 👍 13.1 ms 21.2 MB
030_peano1 👍 👍 13.4 ms 23.1 MB
031_peano2 👍 👍 13.5 ms 23.3 MB
032_peano3 👍 👍 13.5 ms 23.4 MB
033_letType 👍 👍 13.1 ms 21.3 MB
034_letTypeDep 👍 👍 13.4 ms 22.4 MB
035_letRed 👍 👍 13.3 ms 22.1 MB
036_empty 👍 👍 13.2 ms 22.1 MB
037_boolType 👍 👍 13.3 ms 22.8 MB
038_twoBool 👍 👍 13.6 ms 23.0 MB
039_andType 👍 👍 13.3 ms 22.9 MB
040_prodType 👍 👍 13.2 ms 22.8 MB
041_pprodType 👍 👍 13.4 ms 22.9 MB
042_pUnitType 👍 👍 13.3 ms 22.3 MB
043_eqType 👍 👍 13.2 ms 22.9 MB
044_natDef 👍 👍 13.2 ms 22.5 MB
045_rbTreeDef 👍 👍 14.6 ms 24.8 MB
046_inductBadNonSort ✋ ✋ 13.0 ms 22.2 MB
047_inductBadNonSort2 ✋ ✋ 13.1 ms 22.2 MB
048_inductLevelParam ✋ ✋ 13.0 ms 21.0 MB
049_inductTooFewParams ✋ ✋ 13.1 ms 20.9 MB
050_inductWrongCtorParams ✋ ✋ 13.1 ms 21.4 MB
051_inductWrongCtorResParams ✋ ✋ 12.8 ms 20.9 MB
052_inductWrongCtorResLevel ✋ ✋ 13.4 ms 21.1 MB
053_inductInIndex ✋ ✋ 13.4 ms 22.2 MB
054_indNeg ✋ ✋ 12.8 ms 21.3 MB
055_reduceCtorParam.mk 👍 👍 13.7 ms 22.9 MB
056_reduceCtorType.mk ✋ ✋ 13.3 ms 22.1 MB
057_indNegReducible ✋ ✋ 13.4 ms 22.6 MB
058_predWithTypeField 👍 👍 13.3 ms 22.7 MB
059_typeWithTypeField 👍 👍 13.1 ms 22.7 MB
060_typeWithTypeFieldPoly 👍 👍 13.1 ms 22.6 MB
061_typeWithTooHighTypeField.mk ✋ ✋ 13.7 ms 21.6 MB
062_emptyRec 👍 👍 13.2 ms 22.1 MB
063_boolRec 👍 👍 13.2 ms 22.8 MB
064_twoBoolRec 👍 👍 13.4 ms 23.4 MB
065_andRec 👍 👍 13.3 ms 22.6 MB
066_prodRec 👍 👍 13.3 ms 23.1 MB
067_pprodRec 👍 👍 13.7 ms 22.8 MB
068_punitRec 👍 👍 13.5 ms 22.5 MB
069_eqRec 👍 👍 13.2 ms 22.6 MB
070_nRec 👍 👍 13.4 ms 22.6 MB
071_rbTreeRef 👍 👍 14.6 ms 24.5 MB
072_boolPropRec 👍 👍 13.3 ms 22.4 MB
073_BogusRecursor ✋ ✋ 13.4 ms 22.6 MB
074_existsRec 👍 👍 13.4 ms 22.9 MB
075_typeSingletonRecReduction 👍 👍 13.7 ms 23.9 MB
076_sortElimPropRec 👍 👍 13.5 ms 23.6 MB
077_sortElimProp2Rec 👍 👍 13.7 ms 23.4 MB
078_boolRecEqns 👍 👍 13.9 ms 24.3 MB
079_prodRecEqns 👍 👍 13.7 ms 23.6 MB
080_nRecReduction 👍 👍 14.3 ms 24.2 MB
081_listRecReduction 👍 👍 14.1 ms 24.9 MB
082_RBTree.id_spec 👍 👍 16.6 ms 26.8 MB
083_And.right 👍 👍 13.4 ms 23.1 MB
084_Prod.snd 👍 👍 13.3 ms 23.2 MB
085_PProd.snd 👍 👍 13.6 ms 22.9 MB
086_PSigma.snd 👍 👍 13.4 ms 23.6 MB
087_projOutOfRange ✋ ✋ 13.5 ms 22.3 MB
088_projNotStruct ✋ ✋ 13.3 ms 22.6 MB
089_projProp1 👍 👍 13.7 ms 23.8 MB
090_projProp2 ✋ ✋ 13.7 ms 23.9 MB
091_projProp3 👍 👍 13.8 ms 23.9 MB
092_projProp4 ✋ ✋ 13.6 ms 24.0 MB
093_projProp5 ✋ ✋ 13.7 ms 24.1 MB
094_projProp6 ✋ ✋ 13.5 ms 23.5 MB
095_projDataIndexRec 👍 👍 14.0 ms 23.7 MB
096_projIndexData ✋ ✋ 13.8 ms 24.8 MB
097_projIndexData2 ✋ ✋ 13.9 ms 24.6 MB
098_projRed 👍 👍 13.7 ms 24.0 MB
099_ruleK 👍 👍 14.7 ms 22.2 MB
100_ruleKbad ✋ ✋ 13.5 ms 23.9 MB
101_ruleKAcc ✋ ✋ 13.8 ms 24.3 MB
102_aNatLit 👍 👍 13.3 ms 22.7 MB
103_natLitEq 👍 👍 13.5 ms 23.3 MB
104_proofIrrelevance 👍 👍 13.4 ms 23.3 MB
105_proofIrrelevanceBad ✋ ✋ 13.6 ms 23.4 MB
106_proofIrrelevanceWhnf 👍 👍 13.7 ms 23.9 MB
107_proofIrrelevanceUnderBinder 👍 👍 13.4 ms 22.9 MB
108_unitEta1 👍 👍 13.6 ms 23.7 MB
109_unitEta2 👍 👍 13.5 ms 23.4 MB
110_unitEta3 👍 👍 13.4 ms 23.3 MB
111_indexedUnitEta ✋ ✋ 13.8 ms 23.7 MB
112_structEta 👍 👍 13.7 ms 24.3 MB
113_indexedStructEta ✋ ✋ 13.5 ms 24.0 MB
114_funEta 👍 👍 13.3 ms 23.2 MB
115_funEtaDep 👍 👍 13.6 ms 23.6 MB
116_funEtaBad ✋ ✋ 13.5 ms 23.2 MB
117_reflOccLeft ✋ ✋ 13.3 ms 23.0 MB
118_reflOccInIndex ✋ ✋ 13.3 ms 23.0 MB
119_reduceCtorParamRefl.mk 👍 👍 13.3 ms 22.9 MB
120_reduceCtorParamRefl2.mk 👍 👍 13.3 ms 22.8 MB
121_rTreeRec 👍 👍 13.9 ms 23.6 MB
122_rtreeRecReduction 👍 👍 14.1 ms 24.1 MB
123_accRecType 👍 👍 13.4 ms 23.1 MB
124_accRecReduction 👍 👍 14.6 ms 24.7 MB
125_accRecNoEta ✋ ✋ 13.8 ms 24.5 MB
126_quotMkType 👍 👍 13.4 ms 23.0 MB
127_quotIndType 👍 👍 13.4 ms 23.3 MB
128_quotLiftType 👍 👍 13.4 ms 23.4 MB
129_quotSoundType 👍 👍 13.6 ms 24.0 MB
130_quotLiftReduction 👍 👍 13.9 ms 23.4 MB
131_quotIndReduction 👍 👍 13.7 ms 23.5 MB
132_dup_defs ✋ ✋ 13.1 ms 21.6 MB
133_dup_ind_def ✋ ✋ 13.2 ms 22.4 MB
134_dup_ctor_def ✋ ✋ 13.4 ms 22.5 MB
135_dup_rec_def ✋ ✋ 13.2 ms 22.4 MB
136_misnamed_rec_user ✋ ✋ 13.4 ms 22.5 MB
137_dup_rec_def2 ✋ ✋ 13.4 ms 22.5 MB
138_dup_ctor_rec ✋ ✋ 13.3 ms 21.6 MB
139_DupConCon ✋ ✋ 12.9 ms 21.6 MB
140_falseFromUnsafe ✋ ✋ 13.4 ms 22.3 MB
141_falseFromPartial ✋ ✋ 13.5 ms 22.4 MB