lean4-htt/tests/elab/false_or_by_contra.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

51 lines
1.1 KiB
Text

example (w : False) : False := by
false_or_by_contra
guard_target = False
exact w
example : False → Nat := by
false_or_by_contra <;> rename_i h
guard_target = False
guard_hyp h : False
simp_all
example {P : Prop} (p : P) : Nat → Nat → P := by
false_or_by_contra <;> rename_i a b h
guard_target = False
guard_hyp a : Nat
guard_hyp b : Nat
guard_hyp h : ¬ P
simp_all
example {P : Prop} : False → P := by
false_or_by_contra <;> rename_i h w
guard_target = False
guard_hyp h : False
guard_hyp w : ¬ P
simp_all
example (_ : False) : x ≠ y := by
false_or_by_contra <;> rename_i h
guard_hyp h : x = y
guard_target = False
simp_all
example (_ : False) : ¬ P := by
false_or_by_contra <;> rename_i h
guard_hyp h : P
guard_target = False
simp_all
example {P : Prop} (_ : False) : P := by
false_or_by_contra <;> rename_i h
guard_hyp h : ¬ P
guard_target = False
simp_all
-- It doesn't make sense to use contradiction if the goal is a Type (rather than a Prop).
example {P : Type} (_ : False) : P := by
false_or_by_contra
fail_if_success
have : ¬ P := by assumption
guard_target = False
simp_all