lean4-htt/tests/elab/rcases1.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

71 lines
1.8 KiB
Text
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.

example (x : α × β × γ) : True := by
rcases x with ⟨a, b, c⟩
trivial
example (x : α × β × γ) : True := by
rcases x with ⟨(a : α) : id α, -, c : id γ⟩
fail_if_success have : β := by assumption
trivial
example (x : (α × β) × γ) : True := by
fail_if_success rcases x with ⟨_a, b, c⟩
fail_if_success rcases x with ⟨⟨a:β, b⟩, c⟩
rcases x with ⟨⟨a:α, b⟩, c⟩
trivial
example : @Inhabited.{1} α × Option β ⊕ γ → True := by
rintro (⟨⟨a⟩, _ | b⟩ | c)
· trivial
· trivial
· trivial
example : cond false Nat Int → cond true Int Nat → Nat ⊕ Unit → True := by
rintro (x y : Int) (z | u)
· trivial
· trivial
example (h : x = 3) (h₂ : x < 4) : x < 4 := by
rcases h with ⟨⟩
exact h₂
example : True := by
obtain (h : True) | ⟨⟨⟩⟩ : True False
· exact Or.inl trivial
trivial
example : True := by
obtain h | ⟨⟨⟩⟩ : True False := Or.inl trivial
trivial
example : True := by
obtain ⟨h, h2⟩ := And.intro trivial trivial
trivial
example : True := by
fail_if_success obtain ⟨h, h2⟩
trivial
example (x y : α × β) : True := by
rcases x, y with ⟨⟨a, b⟩, c, d⟩
trivial
example (x y : α ⊕ β) : True := by
rcases x, y with ⟨a|b, c|d⟩
repeat trivial
example (i j : Nat) : (Σ' x, i ≤ x ∧ x ≤ j) → i ≤ j := by
intro h
rcases h' : h with ⟨x, h₀, h₁⟩
apply Nat.le_trans h₀ h₁
example (x : Quot fun _ _ : α => True) (h : x = x): x = x := by
rcases x with ⟨z⟩
exact h
example (n : Nat) : True := by
obtain _one_lt_n | _n_le_one : 1 < n + 1 n + 1 ≤ 1 := Nat.lt_or_ge 1 (n + 1)
{trivial}; trivial
example (n : Nat) : True := by
obtain _one_lt_n | (_n_le_one : n + 1 ≤ 1) := Nat.lt_or_ge 1 (n + 1)
{trivial}; trivial