feat: rename tactic byCases => by_cases

This commit is contained in:
Leonardo de Moura 2022-02-10 17:11:07 -08:00
parent 1491253479
commit 712d6726e4
4 changed files with 6 additions and 4 deletions

View file

@ -27,3 +27,5 @@ theorem dep_congr [DecidableEq ι] {p : ι → Set α} [∀ i, Inhabited (p i)]
* [Relax auto-implicit restrictions](https://github.com/leanprover/lean4/pull/1011). The command `set_option relaxedAutoImplicit false` disables the relaxations.
* `contradiction` tactic now closes the goal if there is a `False.elim` application in the target.
* Renamed tatic `byCases` => `by_cases` (motivation: enforcing naming convention).

View file

@ -125,7 +125,7 @@ theorem byCases {p q : Prop} (hpq : p → q) (hnpq : ¬p → q) : q :=
theorem byContradiction {p : Prop} (h : ¬p → False) : p :=
Decidable.byContradiction (dec := propDecidable _) h
macro "byCases" h:ident ":" e:term : tactic =>
macro "by_cases" h:ident ":" e:term : tactic =>
`(cases em $e:term with
| inl $h:ident => _
| inr $h:ident => _)

View file

@ -105,7 +105,7 @@ where
| var i =>
cases a with
| var j =>
byCases h : i > j
by_cases h : i > j
focus
simp [sort.swap, h]
match h:sort.swap (var j) b with
@ -123,7 +123,7 @@ where
| var j =>
cases e₁ with
| var i =>
byCases h : i > j
by_cases h : i > j
focus simp [sort.swap, h, denote, Context.comm]
focus simp [sort.swap, h]
| _ => rfl

View file

@ -1,7 +1,7 @@
example : (p → q → False) ↔ (¬ p ¬ q) := by
apply Iff.intro
. intro h
byCases hp:p <;> byCases hq:q
by_cases hp:p <;> by_cases hq:q
. specialize h hp hq; contradiction
. exact Or.inr hq
. exact Or.inl hp