Files
lean4/tests/playground/sleep_save.lean
2023-06-07 14:29:45 -07:00

38 lines
803 B
Lean4
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
macro "expensive_tactic" : tactic => `(tactic| sleep 5000)
example (h₁ : x = y) (h₂ : y = z) : z = x := by
expensive_tactic
save
have : y = x := h₁.symm
have : z = y := h₂.symm
trace "hello world"
apply this.trans
exact y = x
example (h₁ : p q) (h₂ : p x = 0) (h₃ : q y = 0) : x * y = 0 := by
expensive_tactic
save
match h₁ with
| .inr h =>
expensive_tactic
save
have : y = 0 := h₃ h
simp [*]
| .inl h => stop done
example (h₁ : p q) (h₂ : p x = 0) (h₃ : q y = 0) : x * y = 0 := by
expensive_tactic
save
cases h₁ with
| inr h =>
expensive_tactic
save
have : y = 0 := h₃ h
simp [*]
| inl h => stop
expensive_tactic
save
have : x = 0 := h₂ h
simp [*]
done