This repository was archived by the owner on Jul 24, 2024. It is now read-only.
induction from start#555
Merged
johoelzl merged 1 commit intoleanprover-community:masterfrom Jan 23, 2019
Merged
Conversation
mdickinson
reviewed
Dec 28, 2018
data/nat/basic.lean
Outdated
| -- induction | ||
|
|
||
| lemma induction_from_start (P : nat → Prop) {m} (h0 : P m) (h1 : ∀ n ≥ m, P n → P (n + 1)) : ∀ n ≥ m, P n := | ||
| begin |
There was a problem hiding this comment.
You could use nat.less_than_or_equal.rec for a significantly shorter proof:
begin
apply nat.less_than_or_equal.rec h0,
exact h1
end
Member
There was a problem hiding this comment.
The given proof makes more sense when P : nat -> Sort l instead of Prop
Collaborator
Author
There was a problem hiding this comment.
Indeed, this is much more efficient. Thanks!
|
|
||
| lemma induction_from_start (P : nat → Prop) {m} (h0 : P m) (h1 : ∀ n ≥ m, P n → P (n + 1)) : ∀ n ≥ m, P n := | ||
| by apply nat.less_than_or_equal.rec h0; exact h1 | ||
|
|
Member
There was a problem hiding this comment.
Should this be tagged @[elab_as_eliminator] and P made implicit?
Member
There was a problem hiding this comment.
how about calling this le_induction to match le_rec_on in #585 ?
6 tasks
Collaborator
Author
|
Subsumed by #585 |
Collaborator
Author
|
In fact, #585 does not exactly cover this... |
Member
|
There is a conflict? Please rebase |
7cb88d6 to
065dc14
Compare
Collaborator
Author
|
Rebased (and squashed) |
065dc14 to
790bad8
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Induction on nat, from a starting point which may be different from 0. Contributed by Mario on Zulip. I needed it for my developments and I am sure it will be useful to others also. Not sure about the name of the lemma, though.