Zulip Chat Archive
Stream: new members
Topic: Two small tactics questions
nrs (Sep 03 2024 at 13:30):
- Is there a block tactic to chain
<;>
? I would like to simplify
example : (∀ x, p x ∧ q x) -> (∀ x, p x) ∧ (∀ x, q x) := by
intro h
constructor <;> intro x <;> specialize h x <;> cases h <;> assumption
- Given anonymous assumptions
left✝ : ∀ (x : α), p x right✝ : ∀ (x : α), q x
, is there a way to apply them both tox
? For example, in order to complete:
example : (∀ x, p x) ∧ (∀ x, q x) -> (∀ x, p x ∧ q x) := by
intro h x
constructor <;> cases h <;> _
Julian Berman (Sep 03 2024 at 13:45):
example (p q : Nat → Prop) : (∀ x, p x ∧ q x) -> (∀ x, p x) ∧ (∀ x, q x) := by
intro h
constructor
all_goals (intro x; specialize h x; cases h; assumption)
nrs (Sep 03 2024 at 13:50):
Julian Berman said:
example (p q : Nat → Prop) : (∀ x, p x ∧ q x) -> (∀ x, p x) ∧ (∀ x, q x) := by intro h constructor all_goals (intro x; specialize h x; cases h; assumption)
ah very neat! thanks a lot! by any chance would you know about the second question? (but already, highly appreciated for the answer to the first question!)
Ruben Van de Velde (Sep 03 2024 at 14:06):
Or simply
example : (∀ x, p x ∧ q x) -> (∀ x, p x) ∧ (∀ x, q x) := by
intro h
constructor <;>
· intro x
specialize h x
cases h
assumption
nrs (Sep 03 2024 at 14:22):
Ruben Van de Velde said:
Or simply
example : (∀ x, p x ∧ q x) -> (∀ x, p x) ∧ (∀ x, q x) := by intro h constructor <;> · intro x specialize h x cases h assumption
very cool! thanks!
Last updated: May 02 2025 at 03:31 UTC