lean4-htt/tests/lean/run/4313.lean
Leonardo de Moura 46db59d1d9
fix: split (for if-expressions) should work on non-propositional goals (#4349)
Remark: when splitting an `if-then-else` term, the subgoals now have
tags `isTrue` and `isFalse` instead of `inl` and `inr`.
closes #4313

---------

Co-authored-by: Mario Carneiro <di.gama@gmail.com>
2024-06-05 04:43:46 +00:00

27 lines
772 B
Text
Raw 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 {A B : Prop} {p : Prop} [Decidable p] (h : if p then A else B) :
A B := by
split at h
· exact .inl h
· exact .inr h
example {A B : Type} {p : Prop} [Decidable p] (h : if p then A else B) :
Sum A B := by
split at h
· exact .inl h
· exact .inr h
example {A B : Type} (h : match b with | true => A | false => B) :
Sum A B := by
split at h
· exact .inl h
· exact .inr h
open Int in
theorem bmod_add_bmod_congr : Int.bmod (Int.bmod x n + y) n = Int.bmod (x + y) n := by
rw [bmod_def x n]
split -- `split` now generates the more meaningful `isTrue` and `isFalse` tags.
case isTrue p =>
simp only [emod_add_bmod_congr]
case isFalse p =>
rw [Int.sub_eq_add_neg, Int.add_right_comm, ←Int.sub_eq_add_neg]
simp