Lean Kernel Arena / nanobruijn

Checker "nanobruijn"

Version: master (97a206e) · 📄 Declaration · 🔗 Source

Nanobruijn - An experimental Lean 4 kernel using pure de Bruijn indices.

Forked from nanoda_lib, this variant replaces the locally-nameless binding representation with pure de Bruijn indices. Written in Rust.

Key ideas:

  • Pure de Bruijn indices instead of locally-nameless: entering a binder requires no substitution — variables are shifted lazily when read from the local context.
  • Lazy shifting via pointer+offset pairs: instead of allocating shifted expression nodes, each pointer carries an integer offset. Shifting is O(1) "pointer arithmetic". Expressions that differ only by a uniform index shift share a single DAG node.
  • Depth-stratified caching: cache entries are bucketed by binding depth, so results at one depth can be reused at another by adjusting the offset. Closed (variable-free) expressions live in a global bucket that survives all context changes.
  • Lazy frame invalidation: when leaving a binder, the cache frame is kept rather than discarded. If the next binder entry has the same type, the frame (with all its cached results) is reused.

This is an experimental checker, not intended for production use. All code modifications from the original nanoda_lib were written by Claude (Anthropic).

Completeness (rightfully accepted tests)

96/96

Soundness (rightfully rejected tests)

45/45

Declined tests

0

Test Expected Result ⏱️ 🧠
bogus1 7 ms 11.4 MB
cedar 👍 👍 1.3 m (-44%) 917.2 MB (-24%)
constlevels 7 ms 11.7 MB
cslib 👍 👍 2.3 m (-45%) 1.5 GB (-30%)
init 👍 👍 40.1 s (-45%) 480.3 MB (-13%)
init-prelude 👍 👍 231 ms (-43%) 33.1 MB
level-imax-leq 3 ms 5.1 MB
level-imax-normalization 3 ms 5.4 MB
mathlib 👍 👍 31.0 m (-5%) 6.0 GB (-34%)
mlir 👍 👍 2.7 s (-47%) 97.4 MB
nat-rec-rules 4 ms 7.4 MB
perf/app-lam 👍 👍 40 ms (-99%) 18.2 MB (-99%)
perf/grind-ring-5 👍 👍 8.0 s (+229%) 238.5 MB (+3%)
perf/shift-cascade 👍 👍 191 ms (+267%) 44.9 MB
std 👍 👍 1.1 m (-46%) 758.4 MB (-25%)
tutorial/001_basicDef 👍 👍 2 ms 3.1 MB
tutorial/002_badDef 2 ms 3.2 MB
tutorial/003_arrowType 👍 👍 2 ms 3.0 MB
tutorial/004_dependentType 👍 👍 2 ms 2.9 MB
tutorial/005_constType 👍 👍 2 ms 3.0 MB
tutorial/006_betaReduction 👍 👍 3 ms 5.1 MB
tutorial/007_betaReduction2 👍 👍 3 ms 4.9 MB
tutorial/008_forallSortWhnf 👍 👍 3 ms 4.6 MB
tutorial/009_forallSortBad 3 ms 5.0 MB
tutorial/010_nonTypeType 2 ms 3.1 MB
tutorial/011_nonPropThm 2 ms 2.9 MB
tutorial/012_levelComp1 👍 👍 2 ms 3.0 MB
tutorial/013_levelComp2 👍 👍 2 ms 3.1 MB
tutorial/014_levelComp3 👍 👍 2 ms 3.0 MB
tutorial/015_levelParams 👍 👍 3 ms 4.9 MB
tutorial/016_tut06_bad01 2 ms 3.1 MB
tutorial/017_levelComp4 👍 👍 2 ms 2.9 MB
tutorial/018_levelComp5 👍 👍 2 ms 2.8 MB
tutorial/019_imax1 👍 👍 2 ms 2.9 MB
tutorial/020_imax2 👍 👍 2 ms 2.9 MB
tutorial/021_inferVar 👍 👍 2 ms 2.8 MB
tutorial/022_defEqLambda 👍 👍 3 ms 4.6 MB
tutorial/023_peano1 👍 👍 3 ms 6.9 MB
tutorial/024_peano2 👍 👍 4 ms 8.9 MB
tutorial/025_peano3 👍 👍 4 ms 7.2 MB
tutorial/026_letType 👍 👍 3 ms 4.8 MB
tutorial/027_letTypeDep 👍 👍 3 ms 4.9 MB
tutorial/028_letRed 👍 👍 3 ms 4.8 MB
tutorial/029_empty 👍 👍 2 ms 3.0 MB
tutorial/030_boolType 👍 👍 2 ms 3.1 MB
tutorial/031_twoBool 👍 👍 2 ms 3.2 MB
tutorial/032_andType 👍 👍 3 ms 7.0 MB
tutorial/033_prodType 👍 👍 3 ms 7.0 MB
tutorial/034_pprodType 👍 👍 3 ms 7.1 MB
tutorial/035_pUnitType 👍 👍 2 ms 3.0 MB
tutorial/036_eqType 👍 👍 4 ms 8.8 MB
tutorial/037_natDef 👍 👍 2 ms 3.2 MB
tutorial/038_rbTreeDef 👍 👍 5 ms 7.3 MB
tutorial/039_inductBadNonSort 2 ms 3.0 MB
tutorial/040_inductBadNonSort2 2 ms 3.0 MB
tutorial/041_inductLevelParam 2 ms 3.1 MB
tutorial/042_inductTooFewParams 2 ms 2.9 MB
tutorial/043_inductWrongCtorParams 2 ms 3.2 MB
tutorial/044_inductWrongCtorResParams 3 ms 5.0 MB
tutorial/045_inductWrongCtorResLevel 3 ms 5.0 MB
tutorial/046_inductInIndex 2 ms 3.2 MB
tutorial/047_indNeg 2 ms 3.0 MB
tutorial/048_reduceCtorParam.mk 👍 👍 4 ms 8.5 MB
tutorial/049_reduceCtorType.mk 3 ms 5.1 MB
tutorial/050_indNegReducible 2 ms 3.2 MB
tutorial/051_predWithTypeField 👍 👍 2 ms 3.0 MB
tutorial/052_typeWithTypeField 👍 👍 2 ms 3.2 MB
tutorial/053_typeWithTypeFieldPoly 👍 👍 2 ms 3.1 MB
tutorial/054_typeWithTooHighTypeField.mk 2 ms 3.2 MB
tutorial/055_emptyRec 👍 👍 2 ms 3.2 MB
tutorial/056_boolRec 👍 👍 3 ms 4.9 MB
tutorial/057_twoBoolRec 👍 👍 3 ms 5.2 MB
tutorial/058_andRec 👍 👍 4 ms 8.4 MB
tutorial/059_prodRec 👍 👍 4 ms 9.1 MB
tutorial/060_pprodRec 👍 👍 4 ms 8.8 MB
tutorial/061_punitRec 👍 👍 2 ms 3.1 MB
tutorial/062_eqRec 👍 👍 5 ms 10.5 MB
tutorial/063_nRec 👍 👍 2 ms 3.0 MB
tutorial/064_rbTreeRef 👍 👍 5 ms 7.9 MB
tutorial/065_boolPropRec 👍 👍 2 ms 3.1 MB
tutorial/066_existsRec 👍 👍 5 ms 10.8 MB
tutorial/067_sortElimPropRec 👍 👍 4 ms 9.0 MB
tutorial/068_sortElimProp2Rec 👍 👍 5 ms 11.0 MB
tutorial/069_boolRecEqns 👍 👍 6 ms 10.8 MB
tutorial/070_prodRecEqns 👍 👍 6 ms 10.9 MB
tutorial/071_nRecReduction 👍 👍 6 ms 10.9 MB
tutorial/072_listRecReduction 👍 👍 7 ms 11.3 MB
tutorial/073_RBTree.id_spec 👍 👍 9 ms 13.5 MB
tutorial/074_And.right 👍 👍 5 ms 10.8 MB
tutorial/075_Prod.snd 👍 👍 5 ms 10.9 MB
tutorial/076_PProd.snd 👍 👍 5 ms 11.0 MB
tutorial/077_PSigma.snd 👍 👍 5 ms 10.6 MB
tutorial/078_projOutOfRange 4 ms 8.8 MB
tutorial/079_projNotStruct 2 ms 3.4 MB
tutorial/080_projProp1 👍 👍 6 ms 10.6 MB
tutorial/081_projProp2 6 ms 10.8 MB
tutorial/082_projProp3 👍 👍 6 ms 10.6 MB
tutorial/083_projProp4 6 ms 10.8 MB
tutorial/084_projProp5 6 ms 10.9 MB
tutorial/085_projProp6 6 ms 10.9 MB
tutorial/086_projDataIndexRec 👍 👍 4 ms 8.5 MB
tutorial/087_projIndexData 4 ms 8.8 MB
tutorial/088_projIndexData2 4 ms 8.5 MB
tutorial/089_projRed 👍 👍 7 ms 11.4 MB
tutorial/090_ruleK 👍 👍 5 ms 11.1 MB
tutorial/091_ruleKbad 5 ms 10.5 MB
tutorial/092_ruleKAcc 6 ms 9.9 MB
tutorial/093_aNatLit 👍 👍 2 ms 3.2 MB
tutorial/094_natLitEq 👍 👍 5 ms 10.9 MB
tutorial/095_proofIrrelevance 👍 👍 5 ms 11.0 MB
tutorial/096_unitEta1 👍 👍 5 ms 9.5 MB
tutorial/097_unitEta2 👍 👍 5 ms 10.9 MB
tutorial/098_unitEta3 👍 👍 5 ms 10.9 MB
tutorial/099_structEta 👍 👍 7 ms 11.4 MB
tutorial/100_funEta 👍 👍 5 ms 10.9 MB
tutorial/101_funEtaDep 👍 👍 5 ms 10.4 MB
tutorial/102_funEtaBad 5 ms 10.8 MB
tutorial/103_etaRuleK 5 ms 10.9 MB
tutorial/104_etaCtor 5 ms 10.8 MB
tutorial/105_reflOccLeft 2 ms 3.2 MB
tutorial/106_reflOccInIndex 2 ms 3.2 MB
tutorial/107_reduceCtorParamRefl.mk 👍 👍 4 ms 9.1 MB
tutorial/108_reduceCtorParamRefl2.mk 👍 👍 4 ms 7.2 MB
tutorial/109_rTreeRec 👍 👍 2 ms 3.1 MB
tutorial/110_rtreeRecReduction 👍 👍 6 ms 10.8 MB
tutorial/111_accRecType 👍 👍 5 ms 10.8 MB
tutorial/112_accRecReduction 👍 👍 6 ms 10.8 MB
tutorial/113_accRecNoEta 6 ms 10.5 MB
tutorial/114_quotMkType 👍 👍 3 ms 5.1 MB
tutorial/115_quotIndType 👍 👍 5 ms 10.5 MB
tutorial/116_quotLiftType 👍 👍 5 ms 10.8 MB
tutorial/117_quotSoundType 👍 👍 5 ms 10.8 MB
tutorial/118_quotLiftReduction 👍 👍 5 ms 10.6 MB
tutorial/119_quotIndReduction 👍 👍 4 ms 9.4 MB
tutorial/120_dup_defs 2 ms 3.0 MB
tutorial/121_dup_ind_def 2 ms 3.0 MB
tutorial/122_dup_ctor_def 2 ms 3.0 MB
tutorial/123_dup_rec_def 2 ms 3.0 MB
tutorial/124_dup_rec_def2 2 ms 3.0 MB
tutorial/125_dup_ctor_rec 2 ms 3.0 MB
tutorial/126_DupConCon 2 ms 3.0 MB

Detailed results

Test "bogus1"

Expected: ✋ reject · Size: 11.4 KB · Lines: 198 · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

A clearly bogus proof. Also serves as an example for how to write simple cases.

Test result: ✋ rejected · exit code 1 · wall time: 16 ms · instructions: 42.5 M · max rss memory: 11.4 MB

stderr:
SPtr parse: 143 parser entries → 130 DAG entries, 21 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = C(True) (shift=65535 nlbv=0)
    v = App(App(App(C(Eq)+65535,C(Nat)+65535)+65535,App(App(App(C(ofNat)+65535,C(Nat)+65535)+65535,NatLit(0)+65535)+65535,App(C(instOfNatNat)+65535,NatLit(0)+65535)+65535)+65535)+65535,App(App(App(C(ofNat)+65535,C(Nat)+65535)+65535,NatLit(1)+65535)+65535,App(C(instOfNatNat)+65535,NatLit(1)+65535)+65535)+65535) (shift=65535 nlbv=0)
    LEAF DIFF at depth 0: C(True) vs App(App(App(C(Eq)+65535,C(Nat)+65535)+65535,App(App(App(...+65535,...+65535)+65535,NatLit(0)+65535)+65535,App(C(instOfNatNat)+65535,NatLit(0)+65535)+65535)+65535)+65535,App(App(App(C(ofNat)+65535,C(Nat)+65535)+65535,NatLit(1)+65535)+65535,App(C(instOfNatNat)+65535,NatLit(1)+65535)+65535)+65535)

thread 'thread_2' (20136) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20133) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20132) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "cedar"

Expected: 👍 accept · Size: 728.6 MB · Lines: 13.4 M · lean4export: 3.1.0 · Lean: 4.26.0 · 📄 Declaration · 🔗 Source

Lean formalization of, and proofs about, Cedar.

Auto-generated documentation is available at https://cedar-policy.github.io/cedar-spec/docs/.

This test case exports the whole Cedar module and as such contains even unused parts Init and Batteries.

Test result: 👍 accepted · exit code 0 · wall time: 33.5 s · instructions: 474.0 G · max rss memory: 917.2 MB

stderr:
SPtr parse: 12395703 parser entries → 10023098 DAG entries, 5405887 OSNF-shifted

Test "constlevels"

Expected: ✋ reject · Size: 15.3 KB · Lines: 283 · lean4export: 3.1.0 · Lean: 4.29.0-rc2 · 📄 Declaration

Regression test for undefined behavior in lazy_delta_reduction_step in the official kernel

In the function lazy_delta_reduction_step, the official kernel expects unfold_definition to always succeed. However, if the constant has an incorrect number of level parameters, it actually fails, which leads to memory corruption in lazy_delta_reduction_step.

This test is to check that the official kernel and also other kernels that closely follow the logic of the official kernel correctly handle this unfolding failure.

The issue in the official kernel was originally reported as https://github.com/leanprover/lean4/issues/10577.

Test result: ✋ rejected · exit code 1 · wall time: 12 ms · instructions: 40.0 M · max rss memory: 11.7 MB

stderr:
SPtr parse: 204 parser entries → 181 DAG entries, 41 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Sort(ExportFile@1) (shift=65535 nlbv=0)
    v = C(Nat) (shift=65535 nlbv=0)
    LEAF DIFF at depth 0: Sort(ExportFile@1) vs C(Nat)

thread 'thread_2' (20158) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20155) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20154) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "cslib"

Expected: 👍 accept · Size: 1.2 GB · Lines: 22.8 M · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The Lean Computer Science Library (CSLib).

Test result: 👍 accepted · exit code 0 · wall time: 59.8 s · instructions: 824.3 G · max rss memory: 1.5 GB

stderr:
SPtr parse: 21039124 parser entries → 16531821 DAG entries, 9620080 OSNF-shifted

Test "init"

Expected: 👍 accept · Size: 309.5 MB · Lines: 6.1 M · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

The Init module export from Lean 4 core.

This test contains the fundamental building blocks of Lean 4, including:

  • Basic data types (Nat, List, Array, String, etc.)
  • Core tactics and syntax
  • Foundational mathematical structures
  • Essential metaprogramming infrastructure

This is one of the smallest meaningful test cases, making it ideal for initial checker validation and debugging.

Test result: 👍 accepted · exit code 0 · wall time: 15.8 s · instructions: 240.8 G · max rss memory: 480.3 MB

stderr:
SPtr parse: 5726477 parser entries → 4649726 DAG entries, 2891062 OSNF-shifted

Test "init-prelude"

Expected: 👍 accept · Size: 3.5 MB · Lines: 63.7 k · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

The Init.Prelude module export.

Test result: 👍 accepted · exit code 0 · wall time: 95 ms · instructions: 1.4 G · max rss memory: 33.1 MB

stderr:
SPtr parse: 54535 parser entries → 46382 DAG entries, 18969 OSNF-shifted

Test "level-imax-leq"

Expected: ✋ reject · Size: 5.6 KB · Lines: 93 · lean4export: 3.1.0 · Lean: 4.29.0-rc1 · 📄 Declaration

Proof of False via incorrect universe level comparison for imax.

A correct kernel must reject leq(imax(u,v)+1, imax(u,v)), since at u=0, v=0 this becomes leq(1, 0) which is false. However, a checker that only compares the imax arguments structurally (without accounting for an accumulated successor offset) will incorrectly accept it.

This allows defining a universe-collapsing identity function down.{u,v} : Sort (succ (imax u v)) → Sort (imax u v), which is used to cast between True and False via Bool.rec at Sort (imax 0 0) = Prop.

Nanoda incorrectly accepted this proof until it was fixed.

Test result: ✋ rejected · exit code 1 · wall time: 9 ms · instructions: 17.5 M · max rss memory: 5.1 MB

stderr:
SPtr parse: 59 parser entries → 56 DAG entries, 4 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Sort(ExportFile@6)+65535,Sort(ExportFile@6)+65535) (shift=65535 nlbv=0)
    v = Pi(Sort(ExportFile@6)+65535,Sort(ExportFile@5)+65535) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        LEAF DIFF at depth 1: Sort(ExportFile@6) vs Sort(ExportFile@5)

thread 'thread_0' (20202) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20201) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20200) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "level-imax-normalization"

Expected: ✋ reject · Size: 5.8 KB · Lines: 96 · lean4export: 3.1.0 · Lean: 4.26.0 · 📄 Declaration

Proof of False via incorrect universe level normalization for imax.

A correct kernel must distinguish imax 0 v from succ(imax 0 v), since at v=0 these evaluate to 0 and 1 respectively. However, a level normalization algorithm that drops an accumulated successor offset when decomposing imax u (param v) will produce identical normal forms for both, causing the equivalence check to incorrectly return true.

This allows defining a universe-collapsing identity function down.{v} : Sort (succ (imax 0 v)) → Sort (imax 0 v), and then myProp : Prop := down.{0} Bool (a Prop that is computationally Bool). Proof irrelevance on myProp equates Bool.true and Bool.false, and Bool.rec maps this into False.

Test result: ✋ rejected · exit code 1 · wall time: 10 ms · instructions: 17.8 M · max rss memory: 5.4 MB

stderr:
SPtr parse: 60 parser entries → 57 DAG entries, 4 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Sort(ExportFile@5)+65535,Sort(ExportFile@5)+65535) (shift=65535 nlbv=0)
    v = Pi(Sort(ExportFile@5)+65535,Sort(ExportFile@4)+65535) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        LEAF DIFF at depth 1: Sort(ExportFile@5) vs Sort(ExportFile@4)

thread 'thread_3' (20216) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20212) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20211) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "mathlib"

Expected: 👍 accept · Size: 5.2 GB · Lines: 100.0 M · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

The complete Mathlib library export.

This test contains all the mathematical definitions, theorems, and proofs from Mathlib, representing the largest and most comprehensive test case in the Lean kernel arena.

Test result: 👍 accepted · exit code 0 · wall time: 10.3 m · instructions: 11.2 T · max rss memory: 6.0 GB

stderr:
SPtr parse: 95334373 parser entries → 68370705 DAG entries, 51292421 OSNF-shifted

Test "mlir"

Expected: 👍 accept · Size: 28.8 MB · Lines: 576.3 k · lean4export: 3.1.0 · Lean: 4.27.0-nightly-2025-12-01 · 📄 Declaration · 🔗 Source

The main theorems from lean-mlir.

Test result: 👍 accepted · exit code 0 · wall time: 978 ms · instructions: 16.0 G · max rss memory: 97.4 MB

stderr:
SPtr parse: 535275 parser entries → 406021 DAG entries, 250386 OSNF-shifted

Test "nat-rec-rules"

Expected: ✋ reject · Size: 8.2 KB · Lines: 128 · lean4export: 3.1.0 · Lean: 4.29.0-rc1 · 📄 Declaration

Proof of False via incorrect recursor rule validation.

When processing an inductive type declaration, a correct kernel must verify that the generated recursor rules match the ones provided in the export data. A checker that accidentally compares the imported rules against themselves (instead of against independently constructed rules) will accept arbitrary recursor reduction behavior.

This test defines Nat with a wrong Nat.rec succ rule that always returns hzero (ignoring the induction hypothesis). Combined with a nat literal extension that hardcodes correct arithmetic for concrete nat literals but falls back to the wrong Nat.rec rules for symbolic arguments, this creates an inconsistency that yields a proof of False.

Nanoda incorrectly accepted this proof until it was fixed.

Test result: ✋ rejected · exit code 1 · wall time: 10 ms · instructions: 22.0 M · max rss memory: 7.4 MB

stderr:
SPtr parse: 92 parser entries → 89 DAG entries, 6 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Lam(Pi(C(Nat)+65535,Sort(ExportFile@1)+65535)+65535,Lam(App(V0+0,C(zero)+65535)+0,Lam(Pi(C(Nat)+65535,Pi(App(V0+2,V0+0)+0,App(V0+2,App(C(succ)+65535,V0+0)+0)+1)+0)+0,Lam(C(Nat)+65535,V0+1)+1)+0)+0) (shift=65535 nlbv=0)
    v = Lam(Pi(C(Nat)+65535,Sort(ExportFile@1)+65535)+65535,Lam(App(V0+0,C(zero)+65535)+0,Lam(Pi(C(Nat)+65535,Pi(App(V0+2,V0+0)+0,App(V0+2,App(C(succ)+65535,V0+0)+0)+1)+0)+0,Lam(C(Nat)+65535,App(App(V0+1,V0+0)+0,App(App(App(App(C(rec)+65535,V0+0)+1,V0+0)+1,V0+0)+1,V0+0)+0)+0)+0)+0)+0) (shift=65535 nlbv=0)
    DIFF Lam at depth 0
        DIFF Lam at depth 1
            DIFF Lam at depth 2
                DIFF Pi at depth 3
                    DIFF Pi at depth 4
                SHIFT DIFF: shift=1 vs shift=0
                DIFF Lam at depth 3
                    SHIFT DIFF: shift=2 vs shift=0
                    LEAF DIFF at depth 4: V0 vs App(App(V0+1,V0+0)+0,App(App(App(App(...+65535,...+0)+1,V0+0)+1,V0+0)+1,V0+0)+0)

thread 'thread_0' (20313) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20312) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20311) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "perf/app-lam"

Expected: 👍 accept · Size: 1.2 MB · Lines: 28.6 k · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

A synthetically generated term with n levels of alternating applications and lambdas, with DAG sharing.

At each level, a constant is applied to two identical lambda arguments. The export format records these as a single shared expression (DAG). Each lambda body grows with the nesting depth, referencing all enclosing binders.

This tests two aspects of checker performance:

Infer cache: Since both arguments at each level are the same expression, a checker without an infer cache re-infers the type of each shared subterm, doubling work at every level — O(2ⁿ) total.

Substitution cost: Even with a cache, type-inferring each lambda requires substituting into its body (size O(n)) at each of the n levels, giving O(n²) total. Whether this cost arises depends on the checker's binder representation.

Test result: 👍 accepted · exit code 0 · wall time: 42 ms · instructions: 239.5 M · max rss memory: 18.2 MB

stderr:
SPtr parse: 24427 parser entries → 20388 DAG entries, 8082 OSNF-shifted

Test "perf/grind-ring-5"

Expected: 👍 accept · Size: 9.7 MB · Lines: 199.2 k · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

A grind tactic test from the Lean 4 test suite.

This produces a theorem with a rather large proof term that needs fast reduction.

Test result: 👍 accepted · exit code 0 · wall time: 3.8 s · instructions: 48.1 G · max rss memory: 238.5 MB

stderr:
SPtr parse: 180991 parser entries → 154201 DAG entries, 76589 OSNF-shifted

Test "perf/shift-cascade"

Expected: 👍 accept · Size: 256.3 KB · Lines: 5.1 k · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

Stress test for cascading substitution overhead in kernel let processing.

N nested let bindings inside a lambda, where each value references the outer lambda parameter and the previous binding:

fun (a : Nat → Nat) => let f₁ := fun x => a x let f₂ := fun x => a (f₁ x) ... let fₙ := fun x => a (fₙ₋₁ x) fₙ 0

The kernel processes each let by substituting the value into the body. Each value has a free bvar (references a), so substitution under inner binders creates shifted copies. In a de Bruijn kernel with deferred shifts, these Shift(val, offset) wrappers accumulate: step k must traverse through O(k) wrappers from previous steps, giving O(N²) total work.

A locally-nameless kernel substitutes fvars that need no shifting, giving O(N) total.

N=1000 in the Lean source. Increase to stress further.

Test result: 👍 accepted · exit code 0 · wall time: 139 ms · instructions: 1.1 G · max rss memory: 44.9 MB

stderr:
SPtr parse: 4089 parser entries → 3085 DAG entries, 12 OSNF-shifted

Test "std"

Expected: 👍 accept · Size: 526.1 MB · Lines: 10.0 M · lean4export: 3.1.0 · Lean: 4.29.0 · 📄 Declaration · 🔗 Source

The complete Std library export from Lean 4.

This test contains the standard library extensions beyond core Lean 4, including:

  • Enhanced data structures (HashMap, RBTree, etc.)
  • Additional mathematical operations
  • Extended list and array operations
  • Utility functions and theorems

This represents a medium-sized test case, larger than core modules but smaller than Mathlib, making it useful for performance testing.

Test result: 👍 accepted · exit code 0 · wall time: 27.0 s · instructions: 403.6 G · max rss memory: 758.4 MB

stderr:
SPtr parse: 9396483 parser entries → 7560431 DAG entries, 4452082 OSNF-shifted

Test "tutorial/001_basicDef"

Expected: 👍 accept · Size: 371 B · Lines: 6 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Basic definition

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 12.7 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

Test "tutorial/002_badDef"

Expected: ✋ reject · Size: 369 B · Lines: 6 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Mismatched types

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.1 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Sort(TcCtx@1) (shift=65535 nlbv=0)
    v = Sort(ExportFile@0) (shift=65535 nlbv=0)
    LEAF DIFF at depth 0: Sort(TcCtx@1) vs Sort(ExportFile@0)

thread 'thread_0' (20382) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20381) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20380) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/003_arrowType"

Expected: 👍 accept · Size: 626 B · Lines: 12 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Arrow type (function type)

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.7 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 3 parser entries → 3 DAG entries, 0 OSNF-shifted

Test "tutorial/004_dependentType"

Expected: 👍 accept · Size: 464 B · Lines: 7 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Dependent type (forall)

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.6 M · max rss memory: 2.9 MB

stderr:
SPtr parse: 3 parser entries → 3 DAG entries, 0 OSNF-shifted

Test "tutorial/005_constType"

Expected: 👍 accept · Size: 901 B · Lines: 17 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Lambda expression

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 12.8 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 6 parser entries → 6 DAG entries, 0 OSNF-shifted

Test "tutorial/006_betaReduction"

Expected: 👍 accept · Size: 1.3 KB · Lines: 27 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Lambda reduction

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 16.1 M · max rss memory: 5.1 MB

stderr:
SPtr parse: 13 parser entries → 12 DAG entries, 0 OSNF-shifted

Test "tutorial/007_betaReduction2"

Expected: 👍 accept · Size: 1.4 KB · Lines: 28 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Lambda reduction under binder

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 16.2 M · max rss memory: 4.9 MB

stderr:
SPtr parse: 14 parser entries → 13 DAG entries, 0 OSNF-shifted

Test "tutorial/008_forallSortWhnf"

Expected: 👍 accept · Size: 1.2 KB · Lines: 25 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The binding domain of a forall may need to be reduce before it is a sort

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 16.0 M · max rss memory: 4.6 MB

stderr:
SPtr parse: 13 parser entries → 12 DAG entries, 0 OSNF-shifted

Test "tutorial/009_forallSortBad"

Expected: ✋ reject · Size: 1.2 KB · Lines: 26 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The binding domain of a forall has to be a sort

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 16.4 M · max rss memory: 5.0 MB

stderr:
SPtr parse: 14 parser entries → 13 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20459) panicked at src/tc.rs:510:17:
infer_sort_of: expected Sort, got "V0" from e="V0", infer="V0", depth=2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20458) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20457) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/010_nonTypeType"

Expected: ✋ reject · Size: 1.1 KB · Lines: 21 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The type of a declaration has to be a type, not some other expression

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.2 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 8 parser entries → 8 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20470) panicked at src/tc.rs:489:18:
ensur_sort could not produce a sort
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20469) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20468) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/011_nonPropThm"

Expected: ✋ reject · Size: 428 B · Lines: 7 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The type of a theorem has to be a proposition

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 13.0 M · max rss memory: 2.9 MB

stderr:
SPtr parse: 3 parser entries → 3 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20481) panicked at src/tc.rs:109:45:
called `Result::unwrap()` on an `Err` value: "Theorem type for nonPropThm must be `Prop` (sort 0); found type 1"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20480) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20479) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/012_levelComp1"

Expected: 👍 accept · Size: 395 B · Lines: 7 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Some level computation

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.6 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

Test "tutorial/013_levelComp2"

Expected: 👍 accept · Size: 413 B · Lines: 8 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Some level computation

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.6 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

Test "tutorial/014_levelComp3"

Expected: 👍 accept · Size: 431 B · Lines: 9 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Some level computation

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.5 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

Test "tutorial/015_levelParams"

Expected: 👍 accept · Size: 1.4 KB · Lines: 29 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Level parameters

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 16.3 M · max rss memory: 4.9 MB

stderr:
SPtr parse: 13 parser entries → 12 DAG entries, 0 OSNF-shifted

Test "tutorial/016_tut06_bad01"

Expected: ✋ reject · Size: 431 B · Lines: 8 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Duplicate universe parameters

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 13.0 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20536) panicked at src/tc.rs:405:9:
assertion failed: self.ctx.no_dupes_all_params(info.uparams)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20535) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20534) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/017_levelComp4"

Expected: 👍 accept · Size: 428 B · Lines: 8 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Some level computation

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.6 M · max rss memory: 2.9 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

Test "tutorial/018_levelComp5"

Expected: 👍 accept · Size: 428 B · Lines: 8 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Some level computation

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.7 M · max rss memory: 2.8 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

Test "tutorial/019_imax1"

Expected: 👍 accept · Size: 813 B · Lines: 16 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type inference for forall using imax

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.8 M · max rss memory: 2.9 MB

stderr:
SPtr parse: 6 parser entries → 6 DAG entries, 0 OSNF-shifted

Test "tutorial/020_imax2"

Expected: 👍 accept · Size: 832 B · Lines: 17 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type inference for forall using imax

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.8 M · max rss memory: 2.9 MB

stderr:
SPtr parse: 6 parser entries → 6 DAG entries, 0 OSNF-shifted

Test "tutorial/021_inferVar"

Expected: 👍 accept · Size: 717 B · Lines: 12 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type inference of local variables

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.7 M · max rss memory: 2.8 MB

stderr:
SPtr parse: 7 parser entries → 6 DAG entries, 0 OSNF-shifted

Test "tutorial/022_defEqLambda"

Expected: 👍 accept · Size: 1.4 KB · Lines: 26 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Definitional equality between lambdas

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 16.1 M · max rss memory: 4.6 MB

stderr:
SPtr parse: 15 parser entries → 13 DAG entries, 1 OSNF-shifted

Test "tutorial/023_peano1"

Expected: 👍 accept · Size: 3.6 KB · Lines: 73 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Peano arithmetic: 2 = 2

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 20.3 M · max rss memory: 6.9 MB

stderr:
SPtr parse: 41 parser entries → 35 DAG entries, 5 OSNF-shifted

Test "tutorial/024_peano2"

Expected: 👍 accept · Size: 4.5 KB · Lines: 90 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Peano arithmetic: 1 + 1 = 2

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 24.1 M · max rss memory: 8.9 MB

stderr:
SPtr parse: 55 parser entries → 49 DAG entries, 7 OSNF-shifted

Test "tutorial/025_peano3"

Expected: 👍 accept · Size: 4.9 KB · Lines: 98 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Peano arithmetic: 2 * 2 = 4

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 24.0 M · max rss memory: 7.2 MB

stderr:
SPtr parse: 59 parser entries → 53 DAG entries, 7 OSNF-shifted

Test "tutorial/026_letType"

Expected: 👍 accept · Size: 493 B · Lines: 9 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type checking a non-dependent let

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 16.0 M · max rss memory: 4.8 MB

stderr:
SPtr parse: 4 parser entries → 4 DAG entries, 0 OSNF-shifted

Test "tutorial/027_letTypeDep"

Expected: 👍 accept · Size: 1.2 KB · Lines: 26 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type checking a dependent let

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 16.1 M · max rss memory: 4.9 MB

stderr:
SPtr parse: 11 parser entries → 11 DAG entries, 0 OSNF-shifted

Test "tutorial/028_letRed"

Expected: 👍 accept · Size: 631 B · Lines: 12 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reducing a let

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 16.0 M · max rss memory: 4.8 MB

stderr:
SPtr parse: 5 parser entries → 5 DAG entries, 0 OSNF-shifted

Test "tutorial/029_empty"

Expected: 👍 accept · Size: 1.2 KB · Lines: 20 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A simple empty inductive type

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 12.8 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 9 parser entries → 8 DAG entries, 0 OSNF-shifted

Test "tutorial/030_boolType"

Expected: 👍 accept · Size: 2.3 KB · Lines: 37 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A simple enumeration inductive type

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.2 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 22 parser entries → 20 DAG entries, 2 OSNF-shifted

Test "tutorial/031_twoBool"

Expected: 👍 accept · Size: 4.2 KB · Lines: 65 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A simple product type

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.4 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 43 parser entries → 40 DAG entries, 4 OSNF-shifted

Test "tutorial/032_andType"

Expected: 👍 accept · Size: 3.2 KB · Lines: 57 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A parametrized product type (no level parameters)

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 20.2 M · max rss memory: 7.0 MB

stderr:
SPtr parse: 41 parser entries → 35 DAG entries, 8 OSNF-shifted

Test "tutorial/033_prodType"

Expected: 👍 accept · Size: 3.8 KB · Lines: 76 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A parametrized product type (with level parameters)

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 20.3 M · max rss memory: 7.0 MB

stderr:
SPtr parse: 47 parser entries → 41 DAG entries, 8 OSNF-shifted

Test "tutorial/034_pprodType"

Expected: 👍 accept · Size: 3.8 KB · Lines: 75 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A parametrized product type (with more general level parameters)

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 20.3 M · max rss memory: 7.1 MB

stderr:
SPtr parse: 47 parser entries → 41 DAG entries, 8 OSNF-shifted

Test "tutorial/035_pUnitType"

Expected: 👍 accept · Size: 1.8 KB · Lines: 31 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Level-polymorphic unit type

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 13.1 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 16 parser entries → 15 DAG entries, 0 OSNF-shifted

Test "tutorial/036_eqType"

Expected: 👍 accept · Size: 3.2 KB · Lines: 62 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Equality, as an important indexed non-recursive data type

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 23.6 M · max rss memory: 8.8 MB

stderr:
SPtr parse: 42 parser entries → 34 DAG entries, 9 OSNF-shifted

Test "tutorial/037_natDef"

Expected: 👍 accept · Size: 3.3 KB · Lines: 61 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A recursive inductive data type

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.5 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 36 parser entries → 33 DAG entries, 5 OSNF-shifted

Test "tutorial/038_rbTreeDef"

Expected: 👍 accept · Size: 15.7 KB · Lines: 296 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A recursive indexed data type

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 27.0 M · max rss memory: 7.3 MB

stderr:
SPtr parse: 248 parser entries → 198 DAG entries, 105 OSNF-shifted

Test "tutorial/039_inductBadNonSort"

Expected: ✋ reject · Size: 1.2 KB · Lines: 20 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive type with a non-sort type

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.2 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 7 parser entries → 7 DAG entries, 0 OSNF-shifted

thread 'thread_1' (20790) panicked at src/tc.rs:489:18:
ensur_sort could not produce a sort
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20788) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20787) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/040_inductBadNonSort2"

Expected: ✋ reject · Size: 602 B · Lines: 8 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Another inductive type with a non-sort type

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 13.0 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

thread 'thread_2' (20802) panicked at src/tc.rs:489:18:
ensur_sort could not produce a sort
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20799) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20798) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/041_inductLevelParam"

Expected: ✋ reject · Size: 519 B · Lines: 7 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive with duplicate level params

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.1 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 1 parser entries → 1 DAG entries, 0 OSNF-shifted

thread 'thread_3' (20814) panicked at src/tc.rs:405:9:
assertion failed: self.ctx.no_dupes_all_params(info.uparams)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20810) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20809) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/042_inductTooFewParams"

Expected: ✋ reject · Size: 552 B · Lines: 6 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive with too few parameters in the type

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 13.1 M · max rss memory: 2.9 MB

stderr:
SPtr parse: 2 parser entries → 2 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20822) panicked at src/inductive.rs:353:22:
exhausted telescope early
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20821) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20820) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/043_inductWrongCtorParams"

Expected: ✋ reject · Size: 1.2 KB · Lines: 16 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive with a constructor with wrong parameters

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.4 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 7 parser entries → 7 DAG entries, 0 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Sort(ExportFile@1) (shift=65535 nlbv=0)
    v = Sort(ExportFile@0) (shift=65535 nlbv=0)
    LEAF DIFF at depth 0: Sort(ExportFile@1) vs Sort(ExportFile@0)

thread 'thread_1' (20834) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20832) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20831) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/044_inductWrongCtorResParams"

Expected: ✋ reject · Size: 1.3 KB · Lines: 19 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive with a constructor with wrong parameters in result (they are swapped)

Test result: ✋ rejected · exit code 1 · wall time: 9 ms · instructions: 16.5 M · max rss memory: 5.0 MB

stderr:
SPtr parse: 11 parser entries → 10 DAG entries, 0 OSNF-shifted

thread 'thread_1' (20845) panicked at src/inductive.rs:835:9:
assertion failed: self.is_valid_ind_app(st, parent_ind_name, ctor_type_cursor)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20843) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20842) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/045_inductWrongCtorResLevel"

Expected: ✋ reject · Size: 1.4 KB · Lines: 23 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive with a constructor with wrong level parameters in result (they are swapped)

Test result: ✋ rejected · exit code 1 · wall time: 9 ms · instructions: 16.7 M · max rss memory: 5.0 MB

stderr:
SPtr parse: 11 parser entries → 10 DAG entries, 1 OSNF-shifted

thread 'thread_1' (20856) panicked at src/inductive.rs:835:9:
assertion failed: self.is_valid_ind_app(st, parent_ind_name, ctor_type_cursor)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20854) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20853) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/046_inductInIndex"

Expected: ✋ reject · Size: 1.1 KB · Lines: 14 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A constructor with an unexpected occurrence of the type in index position of a return type.

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.3 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 6 parser entries → 6 DAG entries, 0 OSNF-shifted

thread 'thread_1' (20867) panicked at src/inductive.rs:835:9:
assertion failed: self.is_valid_ind_app(st, parent_ind_name, ctor_type_cursor)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20865) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20864) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/047_indNeg"

Expected: ✋ reject · Size: 1000 B · Lines: 12 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The classic example of an inductive with negative recursive occurrence

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.3 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 5 parser entries → 5 DAG entries, 0 OSNF-shifted

thread 'thread_1' (20878) panicked at src/inductive.rs:685:25:
non-positive occurrence
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20876) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20875) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/048_reduceCtorParam.mk"

Expected: 👍 accept · Size: 4.1 KB · Lines: 80 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

When checking inductives, we expect the kernel to reduce the types of constructor arguments.

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 23.9 M · max rss memory: 8.5 MB

stderr:
SPtr parse: 54 parser entries → 45 DAG entries, 12 OSNF-shifted

Test "tutorial/049_reduceCtorType.mk"

Expected: ✋ reject · Size: 1.5 KB · Lines: 26 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

When checking inductives, we expect the kernel to not reduce the type of the constructor itself; that should be all manifest foralls

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 16.5 M · max rss memory: 5.1 MB

stderr:
SPtr parse: 13 parser entries → 12 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20899) panicked at src/inductive.rs:835:9:
assertion failed: self.is_valid_ind_app(st, parent_ind_name, ctor_type_cursor)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20898) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20897) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/050_indNegReducible"

Expected: ✋ reject · Size: 1.9 KB · Lines: 31 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

When checking inductives, we expect the kernel to not reduce the type of the constructor parameters further than head normal form. Recursive occurrences nested inside the head normal form are considered negative occurrences, even if they could be reduced to disappear.

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 13.1 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 14 parser entries → 14 DAG entries, 0 OSNF-shifted

thread 'thread_2' (20912) panicked at src/inductive.rs:685:25:
non-positive occurrence
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20909) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20908) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/051_predWithTypeField"

Expected: 👍 accept · Size: 2.0 KB · Lines: 32 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive proposition can have constructors with fields of arbitrary level.

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.1 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 20 parser entries → 18 DAG entries, 0 OSNF-shifted

Test "tutorial/052_typeWithTypeField"

Expected: 👍 accept · Size: 2.1 KB · Lines: 36 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive type can have fields of level up to that of the inductive.

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 13.1 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 21 parser entries → 19 DAG entries, 0 OSNF-shifted

Test "tutorial/053_typeWithTypeFieldPoly"

Expected: 👍 accept · Size: 2.1 KB · Lines: 38 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive type can have fields of level up to that of the inductive (polymorphic variant).

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.2 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 21 parser entries → 19 DAG entries, 0 OSNF-shifted

Test "tutorial/054_typeWithTooHighTypeField.mk"

Expected: ✋ reject · Size: 947 B · Lines: 11 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive type can have fields of from higher universes.

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 13.2 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 4 parser entries → 4 DAG entries, 0 OSNF-shifted

thread 'thread_0' (20954) panicked at src/inductive.rs:825:17:
Constructor argument was too large for the corresponding inductive type
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (20953) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (20952) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/055_emptyRec"

Expected: 👍 accept · Size: 1.2 KB · Lines: 21 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.1 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 10 parser entries → 9 DAG entries, 0 OSNF-shifted

Test "tutorial/056_boolRec"

Expected: 👍 accept · Size: 3.0 KB · Lines: 53 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 16.5 M · max rss memory: 4.9 MB

stderr:
SPtr parse: 32 parser entries → 29 DAG entries, 5 OSNF-shifted

Test "tutorial/057_twoBoolRec"

Expected: 👍 accept · Size: 4.8 KB · Lines: 78 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 17.0 M · max rss memory: 5.2 MB

stderr:
SPtr parse: 50 parser entries → 47 DAG entries, 6 OSNF-shifted

Test "tutorial/058_andRec"

Expected: 👍 accept · Size: 3.2 KB · Lines: 58 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 23.6 M · max rss memory: 8.4 MB

stderr:
SPtr parse: 42 parser entries → 36 DAG entries, 8 OSNF-shifted

Test "tutorial/059_prodRec"

Expected: 👍 accept · Size: 4.0 KB · Lines: 79 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 23.7 M · max rss memory: 9.1 MB

stderr:
SPtr parse: 49 parser entries → 43 DAG entries, 8 OSNF-shifted

Test "tutorial/060_pprodRec"

Expected: 👍 accept · Size: 4.0 KB · Lines: 78 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 17 ms · instructions: 23.7 M · max rss memory: 8.8 MB

stderr:
SPtr parse: 48 parser entries → 42 DAG entries, 8 OSNF-shifted

Test "tutorial/061_punitRec"

Expected: 👍 accept · Size: 2.2 KB · Lines: 39 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 13.1 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 18 parser entries → 17 DAG entries, 0 OSNF-shifted

Test "tutorial/062_eqRec"

Expected: 👍 accept · Size: 3.3 KB · Lines: 63 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 27.0 M · max rss memory: 10.5 MB

stderr:
SPtr parse: 43 parser entries → 35 DAG entries, 9 OSNF-shifted

Test "tutorial/063_nRec"

Expected: 👍 accept · Size: 3.3 KB · Lines: 61 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 7 ms · instructions: 13.4 M · max rss memory: 3.0 MB

stderr:
SPtr parse: 36 parser entries → 33 DAG entries, 5 OSNF-shifted

Test "tutorial/064_rbTreeRef"

Expected: 👍 accept · Size: 16.2 KB · Lines: 303 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor

Test result: 👍 accepted · exit code 0 · wall time: 12 ms · instructions: 31.6 M · max rss memory: 7.9 MB

stderr:
SPtr parse: 254 parser entries → 204 DAG entries, 105 OSNF-shifted

Test "tutorial/065_boolPropRec"

Expected: 👍 accept · Size: 2.3 KB · Lines: 34 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Inductive predicates eliminate into Prop if they have more than one constructor.

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 13.2 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 22 parser entries → 20 DAG entries, 2 OSNF-shifted

Test "tutorial/066_existsRec"

Expected: 👍 accept · Size: 3.6 KB · Lines: 66 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Inductive predicates eliminate into Prop if they have one constructors and it carries data.

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 27.0 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 45 parser entries → 38 DAG entries, 7 OSNF-shifted

Test "tutorial/067_sortElimPropRec"

Expected: 👍 accept · Size: 5.6 KB · Lines: 97 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Inductive predicates eliminate into Sort if they have one constructors and it carries data, but the data is known from the type, e.g. a parameter or an index

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 24.2 M · max rss memory: 9.0 MB

stderr:
SPtr parse: 69 parser entries → 63 DAG entries, 11 OSNF-shifted

Test "tutorial/068_sortElimProp2Rec"

Expected: 👍 accept · Size: 6.6 KB · Lines: 114 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Inductive predicates eliminate into Sort if they have one constructors and it carries data, but the data is known from the type, e.g. a parameter or an index. However, it must occur directly in the result type, with no intervening reduction.

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 27.8 M · max rss memory: 11.0 MB

stderr:
SPtr parse: 83 parser entries → 77 DAG entries, 12 OSNF-shifted

Test "tutorial/069_boolRecEqns"

Expected: 👍 accept · Size: 10.8 KB · Lines: 199 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of Bool.rec

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 33.6 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 133 parser entries → 120 DAG entries, 25 OSNF-shifted

Test "tutorial/070_prodRecEqns"

Expected: 👍 accept · Size: 10.1 KB · Lines: 205 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of Prod.rec

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 33.8 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 127 parser entries → 111 DAG entries, 28 OSNF-shifted

Test "tutorial/071_nRecReduction"

Expected: 👍 accept · Size: 12.7 KB · Lines: 238 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A proof relying on the reduction behavior of N.rec

Test result: 👍 accepted · exit code 0 · wall time: 12 ms · instructions: 37.1 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 170 parser entries → 157 DAG entries, 26 OSNF-shifted

Test "tutorial/072_listRecReduction"

Expected: 👍 accept · Size: 17.5 KB · Lines: 335 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of List.rec

Test result: 👍 accepted · exit code 0 · wall time: 12 ms · instructions: 41.7 M · max rss memory: 11.3 MB

stderr:
SPtr parse: 256 parser entries → 217 DAG entries, 70 OSNF-shifted

Test "tutorial/073_RBTree.id_spec"

Expected: 👍 accept · Size: 47.9 KB · Lines: 1.0 k · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of RBTree.rec

Test result: 👍 accepted · exit code 0 · wall time: 14 ms · instructions: 53.8 M · max rss memory: 13.5 MB

stderr:
SPtr parse: 878 parser entries → 672 DAG entries, 433 OSNF-shifted

Test "tutorial/074_And.right"

Expected: 👍 accept · Size: 4.3 KB · Lines: 74 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type-checking simple projection functions

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 27.1 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 55 parser entries → 49 DAG entries, 8 OSNF-shifted

Test "tutorial/075_Prod.snd"

Expected: 👍 accept · Size: 4.5 KB · Lines: 83 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type-checking projection functions with parameters

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 27.3 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 57 parser entries → 51 DAG entries, 8 OSNF-shifted

Test "tutorial/076_PProd.snd"

Expected: 👍 accept · Size: 4.5 KB · Lines: 83 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type-checking projection functions

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 27.1 M · max rss memory: 11.0 MB

stderr:
SPtr parse: 57 parser entries → 51 DAG entries, 8 OSNF-shifted

Test "tutorial/077_PSigma.snd"

Expected: 👍 accept · Size: 5.1 KB · Lines: 96 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type-checking dependent projection functions

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 30.1 M · max rss memory: 10.6 MB

stderr:
SPtr parse: 65 parser entries → 58 DAG entries, 9 OSNF-shifted

Test "tutorial/078_projOutOfRange"

Expected: ✋ reject · Size: 3.8 KB · Lines: 67 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Out of range projection

Test result: ✋ rejected · exit code 1 · wall time: 9 ms · instructions: 23.9 M · max rss memory: 8.8 MB

stderr:
SPtr parse: 48 parser entries → 42 DAG entries, 8 OSNF-shifted

thread 'thread_2' (21220) panicked at src/tc.rs:722:22:
Ran out of constructor telescope getting field: ty_name=And, struct_ty_name=And, idx=2, num_params=2, struct_ty="App(App(C(And)+65535,V0+0)+1,V0+0)", ctor_ty_whnf="App(App(C(And)+65535,V0+0)+1,V0+0)", variant=App
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21217) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21216) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/079_projNotStruct"

Expected: ✋ reject · Size: 3.5 KB · Lines: 64 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projection out something that is not a structure

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.7 M · max rss memory: 3.4 MB

stderr:
SPtr parse: 38 parser entries → 35 DAG entries, 5 OSNF-shifted

thread 'thread_0' (21229) panicked at src/tc.rs:722:22:
Ran out of constructor telescope getting field: ty_name=N, struct_ty_name=N, idx=0, num_params=0, struct_ty="C(N)", ctor_ty_whnf="C(N)", variant=Const
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21228) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21227) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/080_projProp1"

Expected: 👍 accept · Size: 8.2 KB · Lines: 143 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out of a proposition

The lean kernel allows projections out of propositions if they precede all dependent data fields.

Test result: 👍 accepted · exit code 0 · wall time: 12 ms · instructions: 33.5 M · max rss memory: 10.6 MB

stderr:
SPtr parse: 103 parser entries → 92 DAG entries, 19 OSNF-shifted

Test "tutorial/081_projProp2"

Expected: ✋ reject · Size: 8.2 KB · Lines: 143 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out of a proposition

The lean kernel disallows data projections out of propositional structures.

Test result: ✋ rejected · exit code 1 · wall time: 11 ms · instructions: 33.7 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 103 parser entries → 92 DAG entries, 19 OSNF-shifted

thread 'thread_0' (21251) panicked at src/tc.rs:718:21:
infer_proj prop
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21250) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21249) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/082_projProp3"

Expected: 👍 accept · Size: 8.2 KB · Lines: 143 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out of a proposition

The lean kernel allows projections out of propositions if they precede all dependent data fields. Non-dependent data fields are not relevant.

Test result: 👍 accepted · exit code 0 · wall time: 12 ms · instructions: 33.3 M · max rss memory: 10.6 MB

stderr:
SPtr parse: 103 parser entries → 92 DAG entries, 19 OSNF-shifted

Test "tutorial/083_projProp4"

Expected: ✋ reject · Size: 8.2 KB · Lines: 143 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out of a proposition

The lean kernel disallows data projections out of propositional structures.

Test result: ✋ rejected · exit code 1 · wall time: 11 ms · instructions: 33.5 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 103 parser entries → 92 DAG entries, 19 OSNF-shifted

thread 'thread_1' (21274) panicked at src/tc.rs:718:21:
infer_proj prop
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21272) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21271) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/084_projProp5"

Expected: ✋ reject · Size: 8.4 KB · Lines: 148 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out of a proposition

The lean kernel disallows proof projections out of propositional structures that depend on data.

Test result: ✋ rejected · exit code 1 · wall time: 12 ms · instructions: 33.5 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 108 parser entries → 97 DAG entries, 19 OSNF-shifted

thread 'thread_2' (21286) panicked at src/tc.rs:718:21:
infer_proj prop
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21283) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21282) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/085_projProp6"

Expected: ✋ reject · Size: 8.2 KB · Lines: 143 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out of a proposition.

The lean kernel rejects any projections out of a proposition that come after a dependent data field, even if that is not used by the present projection.

Test result: ✋ rejected · exit code 1 · wall time: 11 ms · instructions: 33.5 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 103 parser entries → 92 DAG entries, 19 OSNF-shifted

thread 'thread_1' (21296) panicked at src/tc.rs:703:27:
infer_proj prop
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21294) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21293) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/086_projDataIndexRec"

Expected: 👍 accept · Size: 6.8 KB · Lines: 111 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

The recursor for ProjDataIndex allows elimination into sort.

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 24.2 M · max rss memory: 8.5 MB

stderr:
SPtr parse: 72 parser entries → 67 DAG entries, 8 OSNF-shifted

Test "tutorial/087_projIndexData"

Expected: ✋ reject · Size: 6.8 KB · Lines: 111 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out data is not allowed, even if this data appears as an index and the recursor would allow it.

Test result: ✋ rejected · exit code 1 · wall time: 10 ms · instructions: 24.4 M · max rss memory: 8.8 MB

stderr:
SPtr parse: 72 parser entries → 67 DAG entries, 8 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(C(N)+65535,Pi(App(C(ProjDataIndex)+65535,V0+0)+0,C(True)+65535)+0) (shift=65535 nlbv=0)
    v = Pi(C(N)+65535,Pi(App(C(ProjDataIndex)+65535,V0+0)+0,C(N)+65535)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        DIFF Pi at depth 1
            LEAF DIFF at depth 2: C(True) vs C(N)

thread 'thread_1' (21318) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21316) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21315) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/088_projIndexData2"

Expected: ✋ reject · Size: 6.8 KB · Lines: 111 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projecting out data is not allowed, even if this data appears as an index and the recursor would allow it.

This also forbids projecting out proofs that follow such fields.

Test result: ✋ rejected · exit code 1 · wall time: 22 ms · instructions: 24.4 M · max rss memory: 8.5 MB

stderr:
SPtr parse: 72 parser entries → 67 DAG entries, 8 OSNF-shifted

thread 'thread_2' (21330) panicked at src/tc.rs:722:22:
Ran out of constructor telescope getting field: ty_name=PropStructure, struct_ty_name=ProjDataIndex, idx=1, num_params=1, struct_ty="App(C(ProjDataIndex)+65535,V0+0)", ctor_ty_whnf="App(C(ProjDataIndex)+65535,V0+0)", variant=App
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21327) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21326) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/089_projRed"

Expected: 👍 accept · Size: 9.9 KB · Lines: 177 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Projection reductions

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 39.0 M · max rss memory: 11.4 MB

stderr:
SPtr parse: 131 parser entries → 120 DAG entries, 21 OSNF-shifted

Test "tutorial/090_ruleK"

Expected: 👍 accept · Size: 6.5 KB · Lines: 121 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Rule k for Eq: The recursor reduces even if the major argument is not a constructor, as long replacing the major argument with a constructor is type correct.

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 27.5 M · max rss memory: 11.1 MB

stderr:
SPtr parse: 83 parser entries → 75 DAG entries, 11 OSNF-shifted

Test "tutorial/091_ruleKbad"

Expected: ✋ reject · Size: 6.5 KB · Lines: 121 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Rule k for Eq should not fire if the types of the major argument do not match that of the constructor.

Test result: ✋ rejected · exit code 1 · wall time: 9 ms · instructions: 28.2 M · max rss memory: 10.5 MB

stderr:
SPtr parse: 83 parser entries → 75 DAG entries, 11 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,C(false)+65535)+65535,Pi(C(Bool)+65535,App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,V0+0)+0,V0+0)+0)+65535) (shift=65535 nlbv=0)
    v = Pi(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,C(false)+65535)+65535,Pi(C(Bool)+65535,App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,App(App(App(App(App(App(C(rec)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,Lam(C(Bool)+65535,Lam(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,V0+0)+0,C(Bool)+65535)+0)+65535)+65535,V0+0)+0,C(false)+65535)+0,V0+1)+0)+0,V0+0)+0)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        SHIFT DIFF: shift=65535 vs shift=0
        DIFF Pi at depth 1
            DIFF App at depth 2
                DIFF App at depth 3
                    LEAF DIFF at depth 4: V0 vs App(App(App(App(App(...+65535,...+65535)+65535,Lam(...+65535,...+0)+65535)+65535,V0+0)+0,C(false)+65535)+0,V0+1)

thread 'thread_1' (21362) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21360) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21359) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/092_ruleKAcc"

Expected: ✋ reject · Size: 12.8 KB · Lines: 238 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Rule k should not fire for Acc.

Test result: ✋ rejected · exit code 1 · wall time: 12 ms · instructions: 37.8 M · max rss memory: 9.9 MB

stderr:
SPtr parse: 189 parser entries → 158 DAG entries, 45 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Sort(ExportFile@1)+65535,Pi(Pi(V0+0,Pi(V0+0,Sort(ExportFile@0)+65535)+1)+0,Pi(V0+1,Pi(App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+1,V0+0)+0,Pi(C(Bool)+65535,App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,V0+0)+0,V0+0)+0)+65535)+0)+0)+0) (shift=65535 nlbv=0)
    v = Pi(Sort(ExportFile@1)+65535,Pi(Pi(V0+0,Pi(V0+0,Sort(ExportFile@0)+65535)+1)+0,Pi(V0+1,Pi(App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+1,V0+0)+0,Pi(C(Bool)+65535,App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,App(App(App(App(App(App(C(rec)+65535,V0+0)+1,V0+0)+3,Lam(V0+4,Lam(App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+4,V0+0)+0,C(Bool)+65535)+0)+0)+0,Lam(V0+4,Lam(Pi(V0+5,Pi(App(App(V0+5,V0+0)+0,V0+1)+0,App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+5,V0+0)+1)+0)+0,Lam(Pi(V0+6,Pi(App(App(V0+6,V0+0)+0,V0+2)+0,App(App(Lam(V0+8,Lam(App(...+8,...+0)+0,C(Bool)+65535)+0)+0,V0+1)+0,App(App(V0+1,V0+0)+1,V0+0)+0)+0)+0)+0,V0+3)+0)+0)+0)+0,V0+2)+0,V0+1)+0)+0,V0+0)+0)+0)+0)+0)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        DIFF Pi at depth 1
            DIFF Pi at depth 2
                DIFF Pi at depth 3
                    SHIFT DIFF: shift=65535 vs shift=0
                    DIFF Pi at depth 4
                        DIFF App at depth 5
                            DIFF App at depth 6
                                LEAF DIFF at depth 7: V0 vs App(App(App(App(App(...+1,...+0)+3,Lam(...+4,...+0)+0)+0,Lam(V0+4,Lam(...+0,...+0)+0)+0)+0,V0+2)+0,V0+1)

thread 'thread_3' (21375) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21371) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21370) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/093_aNatLit"

Expected: 👍 accept · Size: 3.0 KB · Lines: 54 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Type checking Nat literals

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 13.5 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 37 parser entries → 34 DAG entries, 5 OSNF-shifted

Test "tutorial/094_natLitEq"

Expected: 👍 accept · Size: 6.1 KB · Lines: 114 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reducing Nat literals

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 27.6 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 84 parser entries → 75 DAG entries, 14 OSNF-shifted

Test "tutorial/095_proofIrrelevance"

Expected: 👍 accept · Size: 5.0 KB · Lines: 100 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Proof irrelevance

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 29.8 M · max rss memory: 11.0 MB

stderr:
SPtr parse: 66 parser entries → 58 DAG entries, 15 OSNF-shifted

Test "tutorial/096_unitEta1"

Expected: 👍 accept · Size: 6.2 KB · Lines: 116 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Unit eta

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 30.0 M · max rss memory: 9.5 MB

stderr:
SPtr parse: 77 parser entries → 68 DAG entries, 13 OSNF-shifted

Test "tutorial/097_unitEta2"

Expected: 👍 accept · Size: 6.0 KB · Lines: 109 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Unit eta

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 30.1 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 73 parser entries → 64 DAG entries, 13 OSNF-shifted

Test "tutorial/098_unitEta3"

Expected: 👍 accept · Size: 6.0 KB · Lines: 111 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Unit eta

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 30.1 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 75 parser entries → 66 DAG entries, 13 OSNF-shifted

Test "tutorial/099_structEta"

Expected: 👍 accept · Size: 12.5 KB · Lines: 230 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Structure eta

Test result: 👍 accepted · exit code 0 · wall time: 12 ms · instructions: 40.4 M · max rss memory: 11.4 MB

stderr:
SPtr parse: 173 parser entries → 158 DAG entries, 37 OSNF-shifted

Test "tutorial/100_funEta"

Expected: 👍 accept · Size: 5.2 KB · Lines: 104 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Function eta for non-dependent functions.

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 30.0 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 71 parser entries → 63 DAG entries, 14 OSNF-shifted

Test "tutorial/101_funEtaDep"

Expected: 👍 accept · Size: 5.3 KB · Lines: 106 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Function eta for dependent functions (pi types).

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 30.0 M · max rss memory: 10.4 MB

stderr:
SPtr parse: 73 parser entries → 64 DAG entries, 11 OSNF-shifted

Test "tutorial/102_funEtaBad"

Expected: ✋ reject · Size: 4.9 KB · Lines: 97 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Eta should not identify functions with different bodies.

Test result: ✋ rejected · exit code 1 · wall time: 9 ms · instructions: 27.7 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 64 parser entries → 55 DAG entries, 14 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Sort(ExportFile@3)+65535,Pi(Sort(ExportFile@3)+65535,Pi(Pi(V0+0,V0+1)+1,Pi(Pi(V0+1,V0+1)+1,App(App(App(C(Eq)+65535,Pi(V0+1,V0+1)+0)+2,V0+0)+0,V0+0)+0)+0)+0)+0) (shift=65535 nlbv=0)
    v = Pi(Sort(ExportFile@3)+65535,Pi(Sort(ExportFile@3)+65535,Pi(Pi(V0+0,V0+1)+1,Pi(Pi(V0+1,V0+1)+1,App(App(App(C(Eq)+65535,Pi(V0+1,V0+1)+0)+2,Lam(V0+3,App(V0+1,App(V0+2,V0+0)+0)+0)+0)+0,V0+0)+0)+0)+0)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        DIFF Pi at depth 1
            DIFF Pi at depth 2
                DIFF Pi at depth 3
                    DIFF App at depth 4
                        DIFF App at depth 5
                            LEAF DIFF at depth 6: V0 vs Lam(V0+3,App(V0+1,App(V0+2,V0+0)+0)+0)

thread 'thread_2' (21484) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21481) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21480) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/103_etaRuleK"

Expected: ✋ reject · Size: 6.5 KB · Lines: 121 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Corner case for function eta: Does a defeq between a partially applied recursor with rule k and a free variable trigger eta expansion?

Taking the official kernel as the specification, the answer is no. See https://github.com/leanprover/lean4/issues/12520 for a discussion.

Test result: ✋ rejected · exit code 1 · wall time: 10 ms · instructions: 28.1 M · max rss memory: 10.9 MB

stderr:
SPtr parse: 85 parser entries → 77 DAG entries, 11 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Pi(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,C(true)+65535)+65535,C(Bool)+65535)+65535,App(App(App(C(Eq)+65535,Pi(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,C(true)+65535)+65535,C(Bool)+65535)+65535)+65535,V0+0)+0,V0+0)+0) (shift=65535 nlbv=0)
    v = Pi(Pi(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,C(true)+65535)+65535,C(Bool)+65535)+65535,App(App(App(C(Eq)+65535,Pi(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,C(true)+65535)+65535,C(Bool)+65535)+65535)+65535,App(App(App(App(App(C(rec)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,Lam(C(Bool)+65535,Lam(App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535,V0+0)+0,C(Bool)+65535)+0)+65535)+65535,App(V0+0,App(App(C(refl)+65535,C(Bool)+65535)+65535,C(true)+65535)+65535)+0)+0,C(true)+65535)+0)+0,V0+0)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        DIFF App at depth 1
            DIFF App at depth 2
                LEAF DIFF at depth 3: V0 vs App(App(App(App(App(...+65535,...+65535)+65535,C(true)+65535)+65535,Lam(C(Bool)+65535,Lam(...+0,...+65535)+0)+65535)+65535,App(V0+0,App(App(...+65535,...+65535)+65535,C(true)+65535)+65535)+0)+0,C(true)+65535)

thread 'thread_3' (21496) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21492) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21491) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/104_etaCtor"

Expected: ✋ reject · Size: 9.0 KB · Lines: 148 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Corner case for function eta: Does a defeq between a partially applied constructor trigger eta expansion?

Taking the official kernel as the specification, the answer is no. See https://github.com/leanprover/lean4/issues/12520 for a discussion.

Test result: ✋ rejected · exit code 1 · wall time: 10 ms · instructions: 28.5 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 104 parser entries → 95 DAG entries, 13 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Pi(C(True)+65535,C(T)+65535)+65535,App(App(App(C(Eq)+65535,Pi(C(True)+65535,C(T)+65535)+65535)+65535,V0+0)+0,V0+0)+0) (shift=65535 nlbv=0)
    v = Pi(Pi(C(True)+65535,C(T)+65535)+65535,App(App(App(C(Eq)+65535,Pi(C(True)+65535,C(T)+65535)+65535)+65535,App(C(mk)+65535,App(C(val)+65535,App(V0+0,C(intro)+65535)+0)+0)+0)+0,V0+0)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        DIFF App at depth 1
            DIFF App at depth 2
                LEAF DIFF at depth 3: V0 vs App(C(mk)+65535,App(C(val)+65535,App(V0+0,C(intro)+65535)+0)+0)

thread 'thread_2' (21506) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21503) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21502) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/105_reflOccLeft"

Expected: ✋ reject · Size: 3.7 KB · Lines: 61 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Rejection: recursive occurrence on the left of an arrow, behind further arrows inside a constructor argument.

The constructor argument is a function type Nat → (I → Nat).

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 13.9 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 41 parser entries → 38 DAG entries, 5 OSNF-shifted

thread 'thread_3' (21518) panicked at src/inductive.rs:685:25:
non-positive occurrence
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21514) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21513) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/106_reflOccInIndex"

Expected: ✋ reject · Size: 4.0 KB · Lines: 66 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Rejection: recursive occurrence in index position, behind a further arrow.

We build an indexed inductive I : Type → Type with a constructor argument Nat → I (I α), so the recursive occurrence appears as an index argument.

Test result: ✋ rejected · exit code 1 · wall time: 8 ms · instructions: 14.1 M · max rss memory: 3.2 MB

stderr:
SPtr parse: 45 parser entries → 41 DAG entries, 6 OSNF-shifted

thread 'thread_1' (21527) panicked at src/inductive.rs:825:17:
Constructor argument was too large for the corresponding inductive type
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  assert_def_eq FAILED at depth 2:
    u = Sort(ExportFile@1) (shift=65535 nlbv=0)
    v = C(Nat) (shift=65535 nlbv=0)
    LEAF DIFF at depth 0: Sort(ExportFile@1) vs C(Nat)

thread 'thread_3' (21529) panicked at src/tc.rs:1359:13:
assert_def_eq failed

thread 'main-worker' (21525) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21524) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/107_reduceCtorParamRefl.mk"

Expected: 👍 accept · Size: 4.5 KB · Lines: 88 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

When checking inductives, we expect the kernel to reduce the types of constructor arguments in all positive positions.

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 24.0 M · max rss memory: 9.1 MB

stderr:
SPtr parse: 62 parser entries → 49 DAG entries, 17 OSNF-shifted

Test "tutorial/108_reduceCtorParamRefl2.mk"

Expected: 👍 accept · Size: 4.5 KB · Lines: 88 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

When checking inductives, we expect the kernel to reduce the types of constructor arguments in all positive positions.

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 23.5 M · max rss memory: 7.2 MB

stderr:
SPtr parse: 62 parser entries → 49 DAG entries, 17 OSNF-shifted

Test "tutorial/109_rTreeRec"

Expected: 👍 accept · Size: 5.5 KB · Lines: 91 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of the generated recursor.

Test result: 👍 accepted · exit code 0 · wall time: 8 ms · instructions: 14.1 M · max rss memory: 3.1 MB

stderr:
SPtr parse: 60 parser entries → 56 DAG entries, 7 OSNF-shifted

Test "tutorial/110_rtreeRecReduction"

Expected: 👍 accept · Size: 10.8 KB · Lines: 193 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of RTree.rec on RTree.mk.

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 33.9 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 136 parser entries → 128 DAG entries, 20 OSNF-shifted

Test "tutorial/111_accRecType"

Expected: 👍 accept · Size: 7.5 KB · Lines: 151 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of Acc.rec.

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 28.5 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 124 parser entries → 99 DAG entries, 41 OSNF-shifted

Test "tutorial/112_accRecReduction"

Expected: 👍 accept · Size: 13.4 KB · Lines: 252 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Acc.rec reduces on Acc.intro.

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 37.6 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 202 parser entries → 170 DAG entries, 54 OSNF-shifted

Test "tutorial/113_accRecNoEta"

Expected: ✋ reject · Size: 13.0 KB · Lines: 244 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Acc.rec does not have structure eta.

Test result: ✋ rejected · exit code 1 · wall time: 12 ms · instructions: 38.1 M · max rss memory: 10.5 MB

stderr:
SPtr parse: 195 parser entries → 163 DAG entries, 49 OSNF-shifted
  assert_def_eq FAILED at depth 0:
    u = Pi(Sort(ExportFile@3)+65535,Pi(Pi(V0+0,Pi(V0+0,Sort(ExportFile@0)+65535)+1)+0,Pi(V0+1,Pi(App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+1,V0+0)+0,Pi(C(Bool)+65535,App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,V0+0)+0,V0+0)+0)+65535)+0)+0)+0) (shift=65535 nlbv=0)
    v = Pi(Sort(ExportFile@3)+65535,Pi(Pi(V0+0,Pi(V0+0,Sort(ExportFile@0)+65535)+1)+0,Pi(V0+1,Pi(App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+1,V0+0)+0,Pi(C(Bool)+65535,App(App(App(C(Eq)+65535,C(Bool)+65535)+65535,App(App(App(App(App(App(C(rec)+65535,V0+0)+1,V0+0)+3,Lam(V0+4,Lam(App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+4,V0+0)+0,C(Bool)+65535)+0)+0)+0,Lam(V0+4,Lam(Pi(V0+5,Pi(App(App(V0+5,V0+0)+0,V0+1)+0,App(App(App(C(Acc)+65535,V0+0)+1,V0+0)+5,V0+0)+1)+0)+0,Lam(Pi(V0+6,Pi(App(App(V0+6,V0+0)+0,V0+2)+0,App(App(Lam(V0+8,Lam(App(...+8,...+0)+0,C(Bool)+65535)+0)+0,V0+1)+0,App(App(V0+1,V0+0)+1,V0+0)+0)+0)+0)+0,V0+3)+0)+0)+0)+0,V0+2)+0,V0+1)+0)+0,V0+0)+0)+0)+0)+0)+0) (shift=65535 nlbv=0)
    DIFF Pi at depth 0
        DIFF Pi at depth 1
            DIFF Pi at depth 2
                DIFF Pi at depth 3
                    SHIFT DIFF: shift=65535 vs shift=0
                    DIFF Pi at depth 4
                        DIFF App at depth 5
                            DIFF App at depth 6
                                LEAF DIFF at depth 7: V0 vs App(App(App(App(App(...+1,...+0)+3,Lam(...+4,...+0)+0)+0,Lam(V0+4,Lam(...+0,...+0)+0)+0)+0,V0+2)+0,V0+1)

thread 'thread_3' (21606) panicked at src/tc.rs:1359:13:
assert_def_eq failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main-worker' (21602) panicked at src/tc.rs:266:26:
A thread in `check_all_declars` panicked while being joined: Any { .. }

thread 'main' (21601) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/114_quotMkType"

Expected: 👍 accept · Size: 6.3 KB · Lines: 123 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of Quot.mk.

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 20.3 M · max rss memory: 5.1 MB

stderr:
SPtr parse: 87 parser entries → 72 DAG entries, 24 OSNF-shifted

Test "tutorial/115_quotIndType"

Expected: 👍 accept · Size: 6.3 KB · Lines: 124 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of Quot.ind.

Test result: 👍 accepted · exit code 0 · wall time: 9 ms · instructions: 27.7 M · max rss memory: 10.5 MB

stderr:
SPtr parse: 88 parser entries → 73 DAG entries, 24 OSNF-shifted

Test "tutorial/116_quotLiftType"

Expected: 👍 accept · Size: 6.3 KB · Lines: 124 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of Quot.lift.

Test result: 👍 accepted · exit code 0 · wall time: 20 ms · instructions: 27.7 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 88 parser entries → 73 DAG entries, 24 OSNF-shifted

Test "tutorial/117_quotSoundType"

Expected: 👍 accept · Size: 7.2 KB · Lines: 141 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Asserting the type of Quot.sound.

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 30.5 M · max rss memory: 10.8 MB

stderr:
SPtr parse: 103 parser entries → 84 DAG entries, 32 OSNF-shifted

Test "tutorial/118_quotLiftReduction"

Expected: 👍 accept · Size: 7.8 KB · Lines: 153 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of Quot.lift on Quot.mk.

Test result: 👍 accepted · exit code 0 · wall time: 10 ms · instructions: 28.2 M · max rss memory: 10.6 MB

stderr:
SPtr parse: 116 parser entries → 97 DAG entries, 33 OSNF-shifted

Test "tutorial/119_quotIndReduction"

Expected: 👍 accept · Size: 7.6 KB · Lines: 151 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Reduction behavior of Quot.ind on Quot.mk.

Test result: 👍 accepted · exit code 0 · wall time: 11 ms · instructions: 25.6 M · max rss memory: 9.4 MB

stderr:
SPtr parse: 115 parser entries → 97 DAG entries, 30 OSNF-shifted

Test "tutorial/120_dup_defs"

Expected: ✋ reject · Size: 479 B · Lines: 7 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

Two definitions with the same name

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21679) panicked at src/parser.rs:846:17:
assertion failed: self.declars.insert(name, definition).is_none()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21678) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/121_dup_ind_def"

Expected: ✋ reject · Size: 1.7 KB · Lines: 27 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A definition and a constructor with the same name

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21686) panicked at src/parser.rs:96:9:
assertion `left == right` failed
  left: In(8)
 right: In(4)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21685) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/122_dup_ctor_def"

Expected: ✋ reject · Size: 1.7 KB · Lines: 27 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A definition and a constructor with the same name

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21693) panicked at src/parser.rs:96:9:
assertion `left == right` failed
  left: In(8)
 right: In(4)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21692) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/123_dup_rec_def"

Expected: ✋ reject · Size: 1.7 KB · Lines: 27 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A definition and a recursor with the same name

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21700) panicked at src/parser.rs:96:9:
assertion `left == right` failed
  left: In(8)
 right: In(4)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21699) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/124_dup_rec_def2"

Expected: ✋ reject · Size: 1.7 KB · Lines: 28 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A definition with the name of a recursor, and the recursor named differently. This would pass simple checks for duplicate definitions in the parser, but should still be rejected by the checker.

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21707) panicked at src/parser.rs:96:9:
assertion `left == right` failed
  left: In(9)
 right: In(5)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21706) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/125_dup_ctor_rec"

Expected: ✋ reject · Size: 1.5 KB · Lines: 24 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

A constructor and a recursor with the same name

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21714) panicked at src/parser.rs:96:9:
assertion `left == right` failed
  left: In(6)
 right: In(3)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21713) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }

Test "tutorial/126_DupConCon"

Expected: ✋ reject · Size: 2.2 KB · Lines: 35 · lean4export: 3.1.0 · Lean: 4.27.0-rc1 · 📄 Declaration · 🔗 Source

An inductive with two constructors with the same name

Test result: ✋ rejected · exit code 1 · wall time: 7 ms · instructions: 11.2 M · max rss memory: 3.0 MB

stderr:
thread 'main-worker' (21721) panicked at src/parser.rs:96:9:
assertion `left == right` failed
  left: In(7)
 right: In(4)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (21720) panicked at src/main.rs:11:20:
called `Result::unwrap()` on an `Err` value: Any { .. }