Repository navigation
v0.54.0
Indexed families: the remaining native gaps. A written-out vector, a
match at an index of its own (head on Vec(ℕ, n + 1)) and cases at
a numeral index (v: Vec(ℕ, 1)) are proved without Lean and link
strictly offline. The families example grows to 15 obligations, all
proved with Lean, without it, and strictly offline.
- The front end:
- Numerals in unification. Closed arithmetic at ℕ is its value (`0
- 1
is1:cons(x, nil)has the typeVec(ℕ, 1)), and a numeral againstt + cunifiestwith the difference (?n + 1against1:?n := 0`), as Lean's unifier does.
- 1
- Numeral defaulting reaches a type variable a numeral's type was
unified with (cons(5, nil)'sα), so a written-out vector's element
type is ℕ before Lean, and its statement is no longer left with holes.
- Numerals in unification. Closed arithmetic at ℕ is its value (`0
- Without Lean:
- A
matchat an index of its own (one ℕ index, no recursive call)
compiles to the recursor with the motiveλ k t, k = I → RatEq.refl I. A constructor with no arm, whose index cannot beI, is closed by
Nat.noConfusion; a wrong one does not check and is left to Lean. cases x with | c names => …andcases xin the native tactics,
on a project inductive type, at a numeral index too. A constructor
whose index cannot be it is no case (Nat.noConfusion);m + c = k
fixes the fieldm := k − c(Nat.add_right_cancel, thenEq.rec).
The alternative's names go to the explicit fields, as Lean's do.- Linking. Lean's compilation of such a
match(a matcher over
casesOn) is proved equal to the native one: the motive carries the
index equation, the impossible cases byNat.noConfusion, the others
by injectingm + 1 = n + 1(Nat.succ.inj) andEq.rec, the cast
the identity by K.
- A
- Hashes. A declaration whose numerals' types were holes before (a
written-out vector's) now states ℕ, so its hash differs from 0.53.0's.