The proof of this basic implication from first principles, an exercise in "Theorem proving in Lean" 4.4, beats all my attempts so far:
open classical
variables (α : Type) (p q : α → Prop)
variable a : α
local attribute [instance] classical.prop_decidable
theorem T08R : (¬ ∀ x, p x) → (∃ x, ¬ p x) :=
begin
intro nAxpx,
--by_contradiction nExnpx,
--apply nAxpx,
end
After the intro
I don't know how to use nAxpx
to go further. I thought of by_contradiction
, but that only introduces the negated existence nExnpx
, which can't be used with cases
, so I can't produce an x : α
. Excluded middle doesn't seem to help either. I can get a proof with mathlib
tactics,
theorem T08R : (¬ ∀ x, p x) → (∃ x, ¬ p x) :=
begin
push_neg,
tauto
end
but don't have enough knowledge to translate that back into tactics mode, so this doesn't help my understanding.