Zulip Chat Archive

Stream: lean4

Topic: tactic combinator <|>


Adam Topaz (Dec 16 2022 at 23:22):

What is Lean4's analogue of the tactic combinator <|>? E.g.

example (p q : Prop) (h : p) (h' : q) : q := by
  exact h <|> exact h

Adam Topaz (Dec 16 2022 at 23:35):

This works, but seems way too verbose?

example (p q : Prop) (h : p) (h' : q) : q := by
  try { exact h } <;> exact h'

David Renshaw (Dec 17 2022 at 00:07):

example (p q : Prop) (h : p) (h' : q) : q := by
  first | exact h | exact h'

Arien Malec (Dec 17 2022 at 00:08):

See: https://leanprover.github.io/theorem_proving_in_lean4/tactics.html#tactic-combinators

Adam Topaz (Dec 17 2022 at 00:10):

Thanks!


Last updated: Dec 20 2023 at 11:08 UTC