-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(logic/hydra): induction on an unordered pair #15286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to duplicate the fix
, fix_eq
and induction
lemmas for every well-founded relation. Did you see such pattern elsewhere in mathlib?
I'm now a bit regretful that I didn't include the condition a ∈ s
in cut_expand
; if I did so then you should be able to use the map α × α → multiset α
, show that game_add_swap
is contained in the inv_image
of cut_expand
, then prove game_add_swap_aux
(aside: shouldn't it be called acc.game_add_swap
?) using acc_of_singleton
and acc.cut_expand
(which shouldn't need the is_irrefl
hypothesis if cut_expand
required a ∈ s
).
The reason I'm specializing Also, every well founded relation is irreflexive, so maybe what you're saying can still be done? I would still like to have the |
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
Regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding game_add_swap_aux: this is just the conjunction of two applications of acc.game_add_swap, so I don't think it deserves any role beyond being an auxiliary result.
OK, I missed that game_add_swap_aux
is a conjunction,and acc.game_add_swap
already exists and is what I expect.
The reason I'm specializing fix and fix_eq specifically for these two relations is so that they can be comfortably be used as lemmas on two variables, rather than lemmas on a single pair.
OK, I missed that they take C : α → α → Sort*
instead of the uncurried form.
Also, every well founded relation is irreflexive, so maybe what you're saying can still be done? I would still like to have the fix and fix_eq theorems close to their current form if we did this: it's easier to prove a relation between four elements than it is to prove a relation between two multisets.
You can prove well_founded.game_add_swap
this way but not acc.game_add_swap
, and I think we should have the acc result for completeness. The form of the fix and fix_eq theorems looks good.
game_add_swap
I just learned about |
I'll redo this in terms of |
I just came up with another proof of well-foundedness of I'm not sure |
We define the relation
game_add_swap r a b = game_add r r a b ∨ game_add r r a.swap b
and prove its well-foundedness. This formalizes induction on an unordered pair, where either entry decreases.To facilitate using these relations, we also add custom induction/recursion lemmas for
game_add
andgame_add_swap
.