Skip to content

feat: keywords guarded, fix, cofix, and iinductive - #651

Open
oliversoeser wants to merge 100 commits into
leanprover-community:masterfrom
oliversoeser:rec-keywords
Open

feat: keywords guarded, fix, cofix, and iinductive#651
oliversoeser wants to merge 100 commits into
leanprover-community:masterfrom
oliversoeser:rec-keywords

Conversation

@oliversoeser

Copy link
Copy Markdown
Contributor

Description

This adds keywords that allow for straightforward recursive definitions of predicates, automatically producing a pre-definition, proving relevant properties, and constructing a fixpoint. Furthermore, iinductive utilises these for definitions of inductive predicates using a syntax familiar from Lean's usual inductive.

Fixes #427 and #428

Depends on #558 and #595

Checklist

  • My code follows the mathlib naming and code style conventions
  • I have added my name to the authors section of any appropriate files

@MackieLoeffel MackieLoeffel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only had a brief look at this. Can you please make this a stacked PR such that it is easier to review?

elabFixpointDef ``bi_least_fixpoint ``least_fixpoint_unfold mods name binders ty body monoPf nePf

/-- Recursive definition via the greatest fixpoint. -/
elab mods:declModifiers "cofix " name:ident binders:fixpointBinder*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a cofix? command that shows the code that it generates? This would be very useful for debugging and understanding what the command does. The same applies to the other commands that generate Lean code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iris data structures

2 participants