-
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
[Merged by Bors] - feat(data/set/intervals/infinite): intervals are infinite #4241
Conversation
rwbarton
commented
Sep 24, 2020
Should we have things like: variables {α : Type*} [preorder α]
noncomputable
instance has_bot_of_finite [fintype α] [nonempty α] : has_bot α :=
⟨classical.some $ (fintype.well_founded_of_trans_of_irrefl _ : well_founded (@has_lt.lt α _)).has_min univ univ_nonempty⟩
lemma fintype.not_lt_bot [fintype α] [nonempty α] : ∀ x : α, ¬ x < ⊥ :=
begin
classical,
rcases classical.some_spec ((fintype.well_founded_of_trans_of_irrefl _ : well_founded (@has_lt.lt α _)).has_min univ univ_nonempty) with ⟨-, H⟩,
exact λ x, H x trivial
end (maybe not as a global instance) and the version with |
I think those should definitely not be global instances. Otherwise you'll get a lot of pain when using |
src/data/set/intervals/infinite.lean
Outdated
obtain ⟨m, -, hm⟩ : ∃ (m : Ioo a b) _, | ||
∀ d ∈ univ, ¬ d < m := this.has_min univ ⟨⟨c, hc₁, hc₂⟩, trivial⟩, | ||
obtain ⟨z, hz₁, hz₂⟩ : ∃ (z : α), a < z ∧ z < m := dense m.2.1, | ||
refine hm ⟨z, hz₁, lt_trans hz₂ m.2.2⟩ trivial hz₂ |
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.
refine hm ⟨z, hz₁, lt_trans hz₂ m.2.2⟩ trivial hz₂ | |
exact hm ⟨z, hz₁, lt_trans hz₂ m.2.2⟩ trivial hz₂ |
src/data/set/intervals/infinite.lean
Outdated
obtain ⟨m, -, hm⟩ : ∃ (m : Iio b) _, | ||
∀ d ∈ univ, ¬ d < m := this.has_min univ ⟨⟨c, hc⟩, trivial⟩, | ||
obtain ⟨z, hz⟩ : ∃ (z : α), z < m := no_bot _, | ||
refine hm ⟨z, lt_trans hz m.2⟩ trivial hz |
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.
refine hm ⟨z, lt_trans hz m.2⟩ trivial hz | |
exact hm ⟨z, lt_trans hz m.2⟩ trivial hz |
@PatrickMassot Would those definitions help in golfing these proofs? |
I refactored the proofs along the general lines of Patrick's suggestion. |
LGTM bors merge |
bors wake up |
bors merge |
Hmm, bors seems to have crashed on this again. Third time's the charm? |
Build failed (retrying...): |
Pull request successfully merged into master. Build succeeded: |