Skip to content

v0.53.0

Choose a tag to compare

@gmpassos gmpassos released this 01 Dec 23:47
· 18 commits to main since this release
dc0ba4b

Mutual definitions and theorems. Functions defined together on types
defined together (a tree's size calls its forest's, and back), and
theorems proved together by mutual induction, with Lean and without it.
The new forests example (example/lean_to_prooflang/forests) has 16
obligations: all verified by Lean and strictly by verify --offline, 11
by ProofLang's kernel without Lean (the automated module's 8 among them).

  • The language:
    • mutual definition and mutual theorem. A run of either in the
      source is one group: any other declaration, a proof included, ends
      it. A group's members may call each other, and each one declares its
      result type. A group is one Lean mutual … end block, whose recursion
      Lean checks is structural.
    • Mutual induction. strategy induction(on = t) on a theorem of a
      group proves each constructor case with, for every field whose type
      another theorem of the group is about, that theorem at the field. In
      Lean it is a match t with whose arms state those hypotheses as calls
      (have ih₁ := sizeF_doubleF children). A theorem so proved is about
      one variable of a type without parameters or indices, and no two of a
      group are about the same type: both are errors with the reason.
  • Without Lean:
    • Mutual definitions compile to the block recursor, one motive per
      type, a call on a field being its induction hypothesis. Each set of
      members that call each other (size and sizeF, not sum and sumF
      written in the same run) is compiled on its own, and must define one
      f(x: T) → R: match x: per type of the block, R not mentioning x.
    • Mutual induction is the block recursor into Prop, the group's
      statements its motives (λ _, True for a type no theorem is about).
      It proves the whole group at once and cites none of it.
    • Linking. Lean's compilation of a mutual group (brecOn over the
      block) is proved equal to the native one, all members at once, by the
      block recursor. So the forests example verifies strictly offline.
  • Not yet: a hand-written recursive tactic proof (a by: block that
    calls its sibling) runs only in Lean; the native tactics run no
    recursion, nor a tactic match. Nested types still have no native
    match or induction.
  • Hashes. A mutual definition group is hashed as one: each member's
    hash depends on every member (a reference to one of them hashed as its
    position), so editing one member changes all of theirs, and renaming
    one changes none.