Skip to content
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

[Merged by Bors] - feat: two easy lemmas about List.Lex #6395

Closed
wants to merge 3 commits into from

Conversation

dagurtomas
Copy link
Collaborator

Proves that [] is the "bottom element" for List.Lex r for any relation r and that List.Lex r [a] [b] iff r a b


Open in Gitpod

@dagurtomas dagurtomas added awaiting-review The author would like community review of the PR awaiting-CI labels Aug 6, 2023
@@ -61,6 +61,19 @@ theorem not_nil_right (r : α → α → Prop) (l : List α) : ¬Lex r l [] :=
fun.
#align list.lex.not_nil_right List.Lex.not_nil_right

theorem nil_left_or_nil_eq {r : α → α → Prop} (l : List α) : List.Lex r [] l ∨ [] = l := by
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a version assuming IsRefl r that says List.Lex r [] l?

Copy link
Collaborator Author

@dagurtomas dagurtomas Aug 6, 2023

Choose a reason for hiding this comment

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

That result is not true. List.Lex is not reflexive even though r is.

Indeed, we have: List.Lex.not_nil_right : ¬List.Lex r l [], in particular ¬List.Lex r [] []

@bors
Copy link

bors bot commented Aug 6, 2023

✌️ dagurtomas can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

refine' ⟨fun h ↦ _, List.Lex.rel⟩
by_contra h'
cases h
· apply not_nil_right r []; assumption
· apply h'; assumption
theorem singleton_iff {r : α → α → Prop} (a b : α) : List.Lex r [a] [b] ↔ r a b :=
⟨fun | rel h => h, List.Lex.rel⟩
Copy link
Member

Choose a reason for hiding this comment

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

by_contra was overkill :)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@dagurtomas
Copy link
Collaborator Author

bors r+

bors bot pushed a commit that referenced this pull request Aug 7, 2023
Proves that `[]` is the "bottom element" for `List.Lex r` for any relation `r` and that `List.Lex r [a] [b]` iff `r a b` 



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Aug 7, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: two easy lemmas about List.Lex [Merged by Bors] - feat: two easy lemmas about List.Lex Aug 7, 2023
@bors bors bot closed this Aug 7, 2023
@bors bors bot deleted the TrivialListLexLemmas branch August 7, 2023 10:05
semorrison pushed a commit that referenced this pull request Aug 14, 2023
Proves that `[]` is the "bottom element" for `List.Lex r` for any relation `r` and that `List.Lex r [a] [b]` iff `r a b` 



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
bors bot pushed a commit that referenced this pull request Nov 1, 2023
Nobeling's theorem: the Z-module of locally constant maps from a profinite set to the integers is free.

-  [x] depends on: #6360 
-  [x] depends on: #6373 
-  [x] depends on: #6395 
-  [x] depends on: #6396  
-  [x] depends on: #6432
-  [x] depends on: #6520
-  [x] depends on: #6578
-  [x] depends on: #6589 
-  [x] depends on: #6722 
-  [x] depends on: #7829 
-  [x] depends on: #7895 
-  [x] depends on: #7896 
-  [x] depends on: #7897  
-  [x] depends on: #7899
fgdorais pushed a commit that referenced this pull request Nov 1, 2023
Nobeling's theorem: the Z-module of locally constant maps from a profinite set to the integers is free.

-  [x] depends on: #6360 
-  [x] depends on: #6373 
-  [x] depends on: #6395 
-  [x] depends on: #6396  
-  [x] depends on: #6432
-  [x] depends on: #6520
-  [x] depends on: #6578
-  [x] depends on: #6589 
-  [x] depends on: #6722 
-  [x] depends on: #7829 
-  [x] depends on: #7895 
-  [x] depends on: #7896 
-  [x] depends on: #7897  
-  [x] depends on: #7899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review The author would like community review of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants