Zulip Chat Archive
Stream: new members
Topic: Concise way of proving contradiction in linear inequalities
Andrea Delmastro (Apr 13 2022 at 10:17):
Hello, I am looking for a concise way of proving the following contradiction:
example (x : string) (a : ℕ) (f : string → ℕ) (h₁ : a ≤ f x) (h₂ : f x < a) : false :=
begin
sorry
end
Is there a simple way (maybe a tactic?) that doesn't bother my code with this technical lemma?
Yaël Dillies (Apr 13 2022 at 10:21):
exact h₁.not_lt h₂
Yaël Dillies (Apr 13 2022 at 10:22):
linarith
will also do it, but that's a bit overpowered.
Arthur Paulino (Apr 13 2022 at 10:22):
Does library_search
help here?
Kevin Buzzard (Apr 13 2022 at 10:22):
And then the begin/end
(which switches from term mode to tactic mode) cancels with the exact
(which switches from tactic mode into term mode)
Andrea Delmastro (Apr 13 2022 at 10:32):
Oops! It was way easier than I tought. Thank you all
Arthur Paulino (Apr 13 2022 at 11:54):
@Andrea Delmastro library_search
does help:
example (x : string) (a : ℕ) (f : string → ℕ) (h₁ : a ≤ f x) (h₂ : f x < a) : false :=
by library_search -- exact nat.lt_le_antisymm h₂ h₁
Last updated: Dec 20 2023 at 11:08 UTC