Zulip Chat Archive

Stream: new members

Topic: logic


BANGJI HU (Oct 26 2024 at 13:42):

the statment below are true or false?
(∃ x : A, true) → (∃ x: A, PP x → ∀ x : A,PP x)

Edward van de Meent (Oct 26 2024 at 13:44):

It is true

Edward van de Meent (Oct 26 2024 at 13:45):

The bracketing might be a bit subtle though

Edward van de Meent (Oct 26 2024 at 13:46):

the statement you want is
(∃ x : A, true) → (∃ x: A, (PP x → ∀ y : A,PP y))

Edward van de Meent (Oct 26 2024 at 13:47):

Or at least, that version is true (for all A).

BANGJI HU (Oct 26 2024 at 13:56):

variable (A : Type)
variable (PP : A  Prop)

theorem existence_implication :
  ( x : A, true)  ( x : A, (PP x   y : A, PP y)) :=
begin
  assume h :  x : A, true,

  have h1 :  x : A, (PP x   y : A, PP y),
  {
    cases h with w hw,
    apply exists.intro w,
    assume HPPw : PP w,
    assume y : A,
    sorry
  },

  exact h1
end

BANGJI HU (Oct 26 2024 at 13:58):

here is my lean3 code but seem to be some problem

BANGJI HU (Oct 26 2024 at 14:12):

@Edward van de Meent

Edward van de Meent (Oct 26 2024 at 14:14):

I'm sorry, I don't know lean3 syntax

BANGJI HU (Oct 26 2024 at 14:19):

A : Type,
PP : A → Prop,
w : A,
hw : true,
HPPw : PP w,
y : A
⊢ PP y

BANGJI HU (Oct 26 2024 at 14:22):

exact HPPw?

BANGJI HU (Oct 26 2024 at 14:22):

@Edward van de Meent

Edward van de Meent (Oct 26 2024 at 14:23):

Do you understand why the statement is true? Can you explain it in words?

BANGJI HU (Oct 26 2024 at 14:37):

Using symbols alone rather than words always causes confusion.

BANGJI HU (Oct 26 2024 at 14:39):

If set A is not empty (i.e., there exists at least one element), then there exists an element x such that if x has the property PP, then all elements in set A also have the property PP.

BANGJI HU (Oct 26 2024 at 14:40):

so i think trivial will work

Edward van de Meent (Oct 26 2024 at 14:43):

the fact that this is true is not exactly trivial. the key lies in the fact that the proof uses case distinction on if PP holds for all elements or not

Edward van de Meent (Oct 26 2024 at 14:43):

translating that to lean should do the trick

BANGJI HU (Oct 26 2024 at 14:51):

(x : A, true) → ( x: A, (PP x → y : A,PP y))equivalent?

Alex Mobius (Oct 26 2024 at 17:22):

I suggest doing excluded-middle to the inner arrow.

Philippe Duchon (Oct 26 2024 at 19:10):

In words: either there exists some (y:A) such that PP y does not hold, or PP holds for all A's.

In the latter case, then the x whose existence is guaranteed by the premise can be used to prove the goal. In the former case, this y can be used (and the implication is proved differently in the two cases).

And IIRC, you do need the law of excluded middle (i.e., classical logic) for this.

edklencl (Oct 27 2024 at 04:21):

axiom em :  (P : Prop), P  ¬P
theorem excluded_middle_example {A : Type} (P : A  Prop) :
  ( x : A, P x) 
  ( x : A, P x   y : A, P y) 
   z : A, P z :=
begin

  intros h1 h2,

  cases (em ( y : A, ¬P y)) with case1 case2,
  {
    exact h1 },
  {
   exact h1 },
end

edklencl (Oct 27 2024 at 04:21):

here is my lean 3 code

Philippe Duchon (Oct 27 2024 at 10:12):

This is not a good example of using the excluded middle: since your first premise is just the same as your final goal, you could just use fun h1 _ => h1 (which is, in fact, what you are doing, only shorter: in both cases, your solution is h1)

(Not sure if this would be compatible with Lean 3)

edklencl (Oct 27 2024 at 10:56):

variable (A : Type)
variable (PP : A  Prop)

theorem existence_implication :
  ( x : A, true)  ( x : A, (PP x   y : A, PP y)) :=
begin
  assume h :  x : A, true,

  have h1 :  x : A, (PP x   y : A, PP y),
  {
    cases h with w hw,
    apply exists.intro w,
    assume HPPw : PP w,
    assume y : A,
    sorry
  },

  exact h1
end

Alex Mobius (Oct 27 2024 at 10:57):

What are you having trouble with?

Alex Mobius (Oct 27 2024 at 11:06):

The first "assume" in your code can probably be replaced with intro h, since it is your given.

Here's how I'd go about applying law of excluded middle here (by_cases is a tactic that applies law of excluded middle and immediately splits into cases of true and false):

import Init.Classical

variable (A : Type)
variable (PP : A  Prop)

theorem existence_implication :
  ( x : A, true)  ( x : A, (PP x   y : A, PP y)) := by
  intro h
  have  some_x, True  := h

  by_cases forall x, PP x
  case pos PP_U_true =>
    -- PP is universal
    sorry
  case neg PP_U_false =>
    -- PP is not universal
    sorry

Last updated: May 02 2025 at 03:31 UTC