Skip to content

v0.54.0

Choose a tag to compare

@gmpassos gmpassos released this 02 Dec 00:58
· 15 commits to main since this release
ee03c47

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
      • 1is1: cons(x, nil)has the typeVec(ℕ, 1)), and a numeral against t + cunifiest with the difference (?n + 1against1: ?n := 0`), as Lean's unifier does.
    • 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.
  • Without Lean:
    • A match at an index of its own (one ℕ index, no recursive call)
      compiles to the recursor with the motive λ k t, k = I → R at Eq.refl I. A constructor with no arm, whose index cannot be I, is closed by
      Nat.noConfusion; a wrong one does not check and is left to Lean.
    • cases x with | c names => … and cases x in 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 field m := k − c (Nat.add_right_cancel, then Eq.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 by Nat.noConfusion, the others
      by injecting m + 1 = n + 1 (Nat.succ.inj) and Eq.rec, the cast
      the identity by K.
  • 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.