feat: iinduction#430
Draft
alvinylt wants to merge 41 commits into
Draft
Conversation
…sses.lean and its type class instances to Instances.lean
This also requires generalisation of ProofModeContinuation
…ext into Iris proof state
To-do: 1. Bug: Some kernel mismatch error when the tactic is used 2. Bug: The variable being performed induction on becomes unnamed 3. Bug: The induction hypotheses are unnamed 4. Feature: Introduction patterns
…bility regarding IH naming
To-do: 1. Prove that the spatial context is empty after reverting hypotheses 2. Remaining tactic syntax 3. Remaining two IntoIH instance
… variable and IH names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the
iinductiontactic.Addresses #360.
This tactic uses the type class
IntoIHand its instances, which are ported fromcoq_tactics.vin the Rocq version. Two of them (intoIH_listForallandintoIH_listForall₂) are newly created in this PR. The type class itself and other instances were already created by @HaleOIC, and they have now been moved from Induction.lean to Classes.lean and Instances.lean, respectively.IntoIHIntoIHintoIH_entailsinto_ih_entailsintoIH_forallinto_ih_forallintoIH_impinto_ih_implintoIH_listForallinto_ih_ForallintoIH_listForall₂into_ih_Forall2In a nutshell, the
iinductiontactic performs the following steps:Lean.Meta.Tactic.inductionto obtain the induction subgoals.While the above steps are basically the same as those in Rocq, the tactic syntax for induction is quite different in Lean. The implementation of
iinductiontherefore intends to follow the syntax ofinductionas detailed in the language specifications of Lean:iinduction eiinduction e using riinduction e generalizing z₁ ... zₙiinduction x with | constr₁ => tac₁ | ... | constrₙ => tacₙSimilar to the built-in
inductiontactic in Lean, the variables and induction hypotheses are assigned inaccessible names unless the user specifies them using thewithsyntax. For example, by usingiinduction nwheren : Nat, one may getn✝andn_ih✝in the step case. Meanwhile, the following assigns the variable and the induction hypothesis the namesnandih, respectively.iinduction n with | zero => ... | succ n ih => ...Several functions in Induction.lean are introduced to parse the syntax and handle the constructor names properly.
Checklist
authorssection of any appropriate files