在 Lean theorem prover 的策略模式下使用 obtain

Use obtain in tactic mode in Lean theorem prover

如何使用形状假设

H : exists x, P x

战术模式?在术语模式下我会使用

obtain x Hx, from H,

完全一样的语法:

example (A : Type) (p : A × A) : A :=
begin
  obtain x y, from p, x
end

您当然可以在from后使用begin...end重新进入战术模式。