Zulip Chat Archive
Stream: new members
Topic: Applying only one side of a conjuction
Duncan Skahan (Oct 29 2024 at 12:32):
Is there a way to apply just one side of a conclusion of the form A ∧ B. (I.e. is there a working version of the below proof script?)
theorem g (P Q R A B : Prop) (p : P) (q: Q) (r: R) : A := by
have h (_ : P) (_ : Q) (_ : R) : A ∧ B := by sorry
apply left h
Riccardo Brasca (Oct 29 2024 at 12:34):
h.1
?
Riccardo Brasca (Oct 29 2024 at 12:35):
No sorry, I didn't read carefully.
Markus Himmel (Oct 29 2024 at 12:35):
Perhaps
theorem g (P Q R A B : Prop) (p : P) (q: Q) (r: R) : A := by
have h (_ : P) (_ : Q) (_ : R) : A ∧ B := by sorry
apply (h p q r).left
is what you're looking for?
Riccardo Brasca (Oct 29 2024 at 12:35):
Also refine (h ?_ ?_ ?_).1
does what you want
Duncan Skahan (Oct 29 2024 at 12:36):
I was hoping for something that would create goals for P Q R.
Riccardo Brasca (Oct 29 2024 at 12:36):
refine
does it. It allows you to precisely control what you want to prove later.
Duncan Skahan (Oct 29 2024 at 12:37):
How does ?_
differ from _
?
Riccardo Brasca (Oct 29 2024 at 12:39):
_
means "Lean, please fill it for me", ?_
means "I will fill it later".
Kevin Buzzard (Oct 29 2024 at 21:15):
i.e. ?_
means "create a goal", which is what you want.
Last updated: May 02 2025 at 03:31 UTC