feat: rename tactic byCases => by_cases
This commit is contained in:
parent
1491253479
commit
712d6726e4
4 changed files with 6 additions and 4 deletions
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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 => _)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue