Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 2dbf07a

Browse files
committed
chore(.): adapt to change by_cases t with h to by_cases h : t 746134d11ceec378a53ffd3b7ab8626fb291f3bd
1 parent ea19776 commit 2dbf07a

File tree

17 files changed

+79
-79
lines changed

17 files changed

+79
-79
lines changed

analysis/ennreal.lean

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,24 @@ protected lemma mul_assoc : ∀a b c:ennreal, a * b * c = a * (b * c) :=
174174
begin
175175
rw [forall_ennreal], constructor,
176176
{ intros ra ha,
177-
by_cases ra = 0 with ha', simp [*, ennreal.mul_zero, ennreal.zero_mul],
177+
by_cases ha' : ra = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
178178
rw [forall_ennreal], constructor,
179179
{ intros rb hrb,
180-
by_cases rb = 0 with hb', simp [*, ennreal.mul_zero, ennreal.zero_mul],
180+
by_cases hb' : rb = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
181181
rw [forall_ennreal], constructor,
182182
{ intros rc hrc, simp [*, zero_le_mul, mul_assoc] },
183183
simp [*, zero_le_mul, mul_eq_zero_iff_eq_zero_or_eq_zero] },
184184
rw [forall_ennreal], constructor,
185185
{ intros rc hrc,
186-
by_cases rc = 0 with hc', simp [*, ennreal.mul_zero, ennreal.zero_mul],
186+
by_cases hc' : rc = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
187187
simp [*, zero_le_mul] },
188188
simp [*] },
189189
rw [forall_ennreal], constructor,
190190
{ intros rb hrb,
191-
by_cases rb = 0 with hb', simp [*, ennreal.mul_zero, ennreal.zero_mul],
191+
by_cases hb' : rb = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
192192
rw [forall_ennreal], constructor,
193193
{ intros rc hrc,
194-
by_cases rc = 0 with hb';
194+
by_cases hb' : rc = 0;
195195
simp [*, zero_le_mul, ennreal.mul_zero, mul_eq_zero_iff_eq_zero_or_eq_zero] },
196196
simp [*, zero_le_mul, mul_eq_zero_iff_eq_zero_or_eq_zero] },
197197
intro c, by_cases c = 0; simp *
@@ -201,24 +201,24 @@ protected lemma left_distrib : ∀a b c:ennreal, a * (b + c) = a * b + a * c :=
201201
begin
202202
rw [forall_ennreal], constructor,
203203
{ intros ra ha,
204-
by_cases ra = 0 with ha', simp [*, ennreal.mul_zero, ennreal.zero_mul],
204+
by_cases ha' : ra = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
205205
rw [forall_ennreal], constructor,
206206
{ intros rb hrb,
207-
by_cases rb = 0 with hb', simp [*, ennreal.mul_zero, ennreal.zero_mul],
207+
by_cases hb' : rb = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
208208
rw [forall_ennreal], constructor,
209209
{ intros rc hrc, simp [*, zero_le_mul, add_nonneg, left_distrib] },
210210
simp [*, zero_le_mul, mul_eq_zero_iff_eq_zero_or_eq_zero] },
211211
rw [forall_ennreal], constructor,
212212
{ intros rc hrc,
213-
by_cases rc = 0 with hc', simp [*, ennreal.mul_zero, ennreal.zero_mul],
213+
by_cases hv' : rc = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
214214
simp [*, zero_le_mul] },
215215
simp [*] },
216216
rw [forall_ennreal], constructor,
217217
{ intros rb hrb,
218-
by_cases rb = 0 with hb', simp [*, ennreal.mul_zero, ennreal.zero_mul],
218+
by_cases hb' : rb = 0, simp [*, ennreal.mul_zero, ennreal.zero_mul],
219219
rw [forall_ennreal], constructor,
220220
{ intros rc hrc,
221-
by_cases rc = 0 with hb';
221+
by_cases hb' : rc = 0;
222222
simp [*, zero_le_mul, ennreal.mul_zero, mul_eq_zero_iff_eq_zero_or_eq_zero, add_nonneg,
223223
add_eq_zero_iff_eq_zero_and_eq_zero_of_nonneg_of_nonneg] },
224224
simp [*, zero_le_mul, mul_eq_zero_iff_eq_zero_or_eq_zero] },
@@ -318,8 +318,8 @@ end
318318

319319
lemma of_real_lt_of_real_iff_cases : of_real r < of_real p ↔ 0 < p ∧ r < p :=
320320
begin
321-
by_cases 0 ≤ p with hp,
322-
{ by_cases 0 ≤ r with hr,
321+
by_cases hp : 0 ≤ p,
322+
{ by_cases hr : 0 ≤ r,
323323
{ simp [*, iff_def] {contextual := tt},
324324
show r < p → 0 < p, from lt_of_le_of_lt hr },
325325
{ have h : r ≤ 0, from le_of_lt (lt_of_not_ge hr),

analysis/measure_theory/measurable_space.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ begin
5252
rw [this],
5353
apply is_measurable_Union_nat _,
5454
intro i,
55-
by_cases f i ∈ s with h'; simp [h', h, is_measurable_empty]
55+
by_cases h' : f i ∈ s; simp [h', h, is_measurable_empty]
5656
end
5757

5858
lemma is_measurable_bUnion {f : β → set α} {s : set β} (hs : countable s)

data/array/lemmas.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ list.ext_le (by simp) $ λ j h₁ h₂, begin
7979
have h₃ : j < n, {simpa using h₁},
8080
rw [to_list_nth_le _ _ h₃],
8181
refine let ⟨_, e⟩ := list.nth_eq_some.1 _ in e.symm,
82-
by_cases i.1 = j with ij,
82+
by_cases ij : i.1 = j,
8383
{ subst j, rw [show fin.mk i.val h₃ = i, from fin.eq_of_veq rfl,
8484
array.read_write, list.nth_update_nth_of_lt],
8585
simp [h₃] },
@@ -158,7 +158,7 @@ theorem read_foreach_aux (f : fin n → α → α) (ai : array n α) :
158158
| 0 hi a ⟨j, hj⟩ ji := absurd ji (nat.not_lt_zero _)
159159
| (i+1) hi a ⟨j, hj⟩ ji := begin
160160
dsimp [d_array.iterate_aux], dsimp at ji,
161-
by_cases (⟨i, hi⟩ : fin _) = ⟨j, hj⟩ with e,
161+
by_cases e : (⟨i, hi⟩ : fin _) = ⟨j, hj⟩,
162162
{ rw [e], simp, refl },
163163
{ rw [read_write_of_ne _ _ e, read_foreach_aux _ _ _ ⟨j, hj⟩],
164164
exact (lt_or_eq_of_le (nat.le_of_lt_succ ji)).resolve_right

data/equiv.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,14 @@ protected noncomputable def image {α β} (f : α → β) (s : set α) (H : inje
455455
λ ⟨x, h⟩, subtype.eq (H (classical.some_spec (mem_image_of_mem f h)).2),
456456
λ ⟨y, h⟩, subtype.eq (classical.some_spec h).2
457457

458-
@[simp] theorem image_apply {α β} (f : α → β) (s : set α) (H : injective f) (a h) :
458+
@[simp] theorem image_apply {α β} (f : α → β) (s : set α) (H : injective f) (a h) :
459459
set.image f s H ⟨a, h⟩ = ⟨f a, mem_image_of_mem _ h⟩ := rfl
460460

461461
protected noncomputable def range {α β} (f : α → β) (H : injective f) :
462462
α ≃ range f :=
463463
(set.univ _).symm.trans $ (set.image f univ H).trans (equiv.cast $ by rw range_eq_image)
464464

465-
@[simp] theorem range_apply {α β} (f : α → β) (H : injective f) (a) :
465+
@[simp] theorem range_apply {α β} (f : α → β) (H : injective f) (a) :
466466
set.range f H a = ⟨f a, set.mem_range⟩ :=
467467
by dunfold equiv.set.range equiv.set.univ;
468468
simp [set_coe_cast, range_eq_image]
@@ -490,25 +490,25 @@ by by_cases r = a; simp [swap_core, *]
490490

491491
theorem swap_core_swap_core (r a b : α) : swap_core a b (swap_core a b r) = r :=
492492
begin
493-
by_cases r = b with hb,
494-
{ by_cases r = a with ha,
493+
by_cases hb : r = b,
494+
{ by_cases ha : r = a,
495495
{ simp [hb.symm, ha.symm, swap_core_self] },
496496
{ have : b ≠ a, by rwa [hb] at ha,
497497
simp [swap_core, *] } },
498-
{ by_cases r = a with ha,
498+
{ by_cases ha : r = a,
499499
{ have : b ≠ a, begin rw [ha] at hb, exact ne.symm hb end,
500500
simp [swap_core, *] },
501501
simp [swap_core, *] }
502502
end
503503

504504
theorem swap_core_comm (r a b : α) : swap_core a b r = swap_core b a r :=
505505
begin
506-
by_cases r = b with hb,
507-
{ by_cases r = a with ha,
506+
by_cases hb : r = b,
507+
{ by_cases ha : r = a,
508508
{ simp [hb.symm, ha.symm, swap_core_self] },
509509
{ have : b ≠ a, by rwa [hb] at ha,
510510
simp [swap_core, *] } },
511-
{ by_cases r = a with ha,
511+
{ by_cases ha : r = a,
512512
{ have : a ≠ b, by rwa [ha] at hb,
513513
simp [swap_core, *] },
514514
simp [swap_core, *] }

data/finset.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ by rw [inter_comm, insert_inter_of_mem h, inter_comm]
302302

303303
@[simp] theorem insert_inter_of_not_mem {s₁ s₂ : finset α} {a : α} (h : a ∉ s₂) :
304304
insert a s₁ ∩ s₂ = s₁ ∩ s₂ :=
305-
ext.2 $ assume a', by by_cases a' = a with h'; simp [mem_inter, mem_insert, h, h', and_comm]
305+
ext.2 $ assume a', by by_cases h' : a' = a; simp [mem_inter, mem_insert, h, h', and_comm]
306306

307307
@[simp] theorem inter_insert_of_not_mem {s₁ s₂ : finset α} {a : α} (h : a ∉ s₁) :
308308
s₁ ∩ insert a s₂ = s₁ ∩ s₂ :=

data/finsupp.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ by simp [finset.ext]
7070

7171
def single (a : α) (b : β) : α →₀ β :=
7272
⟨λa', if a = a' then b else 0,
73-
finite_subset (@finite_singleton α a) $ assume a', by by_cases a = a' with h; simp [h]⟩
73+
finite_subset (@finite_singleton α a) $ assume a', by by_cases h : a = a'; simp [h]⟩
7474

7575
lemma single_apply {a a' : α} {b : β} :
7676
(single a b : α →₀ β) a' = (if a = a' then b else 0) :=
@@ -87,7 +87,7 @@ by simp [single_apply, h]
8787
@[simp] lemma single_zero {a : α} : (single a 0 : α →₀ β) = 0 :=
8888
ext $ assume a',
8989
begin
90-
by_cases a = a' with h,
90+
by_cases h : a = a',
9191
{ rw [h, single_eq_same, zero_apply] },
9292
{ rw [single_eq_of_ne h, zero_apply] }
9393
end
@@ -180,7 +180,7 @@ by simp [finsupp.prod]
180180
lemma prod_single_index [add_comm_monoid β] [comm_monoid γ] {a : α} {b : β}
181181
{h : α → β → γ} (h_zero : h a 0 = 1) : (single a b).prod h = h a b :=
182182
begin
183-
by_cases b = 0 with h,
183+
by_cases h : b = 0,
184184
{ simp [h, prod_zero_index, h_zero] },
185185
{ simp [finsupp.prod, support_single_ne_zero h] }
186186
end
@@ -200,7 +200,7 @@ support_zip_with
200200
single a (b₁ + b₂) = single a b₁ + single a b₂ :=
201201
ext $ assume a',
202202
begin
203-
by_cases a = a' with h,
203+
by_cases h : a = a',
204204
{ rw [h, add_apply, single_eq_same, single_eq_same, single_eq_same] },
205205
{ rw [add_apply, single_eq_of_ne h, single_eq_of_ne h, single_eq_of_ne h, zero_add] }
206206
end
@@ -278,7 +278,7 @@ have ∀a:α, f.sum (λa' b, ite (a' = a) b 0) =
278278
({a} : finset α).sum (λa', ite (a' = a) (f a') 0),
279279
begin
280280
intro a,
281-
by_cases a ∈ f.support with h,
281+
by_cases h : a ∈ f.support,
282282
{ have : {a} ⊆ f.support,
283283
{ simp [finset.subset_iff, *] at * },
284284
refine (finset.sum_subset this _).symm,

data/hash_map.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ theorem valid.replace_aux (a : α) (b : β a) : Π (l : list (Σ a, β a)), a
203203
∃ (u w : list Σ a, β a) b', l = u ++ [⟨a, b'⟩] ++ w ∧ replace_aux a b l = u ++ [⟨a, b⟩] ++ w
204204
| [] := false.elim
205205
| (⟨a', b'⟩::t) := begin
206-
by_cases a' = a with e,
206+
by_cases e : a' = a,
207207
{ subst a',
208208
suffices : ∃ u w (b'' : β a),
209209
sigma.mk a b' :: t = u ++ ⟨a, b''⟩ :: w ∧
@@ -257,7 +257,7 @@ theorem valid.erase_aux (a : α) : Π (l : list (Σ a, β a)), a ∈ l.map sigma
257257
∃ (u w : list Σ a, β a) b, l = u ++ [⟨a, b⟩] ++ w ∧ erase_aux a l = u ++ [] ++ w
258258
| [] := false.elim
259259
| (⟨a', b'⟩::t) := begin
260-
by_cases a' = a with e,
260+
by_cases e : a' = a,
261261
{ subst a',
262262
simpa [erase_aux, and_comm] using show ∃ u w (x : β a),
263263
t = u ++ w ∧ sigma.mk a b' :: t = u ++ ⟨a, x⟩ :: w, from ⟨[], t, b', by simp⟩ },
@@ -380,7 +380,7 @@ begin
380380
{ intro m3,
381381
have : a ∈ list.map sigma.fst t.as_list := list.mem_map_of_mem _ (t.mem_as_list.2 ⟨_, m3⟩),
382382
exact dj (list.mem_map_of_mem sigma.fst m1) this },
383-
by_cases mk_idx n' (hash_fn c.1) = i with h,
383+
by_cases h : mk_idx n' (hash_fn c.1) = i,
384384
{ subst h,
385385
have e : sigma.mk a b' = ⟨c.1, c.2⟩,
386386
{ simpa [reinsert_aux, bucket_array.modify, array.read_write, this] using im },
@@ -433,7 +433,7 @@ theorem mem_insert : Π (m : hash_map α β) (a b a' b'),
433433
if a = a' then b == b' else sigma.mk a' b' ∈ bkts.as_list,
434434
{ intros bkts' v1 u w hl hfl veq,
435435
rw [hl, hfl],
436-
by_cases a = a' with h,
436+
by_cases h : a = a',
437437
{ subst a',
438438
suffices : b = b' ∨ sigma.mk a b' ∈ u ∨ sigma.mk a b' ∈ w ↔ b = b',
439439
{ simpa [eq_comm, or.left_comm] },
@@ -445,7 +445,7 @@ theorem mem_insert : Π (m : hash_map α β) (a b a' b'),
445445
simp [hl, list.nodup_append] at nd', simp [nd'] } },
446446
{ suffices : sigma.mk a' b' ∉ v1, {simp [h, ne.symm h, this]},
447447
rcases veq with ⟨rfl, Hnc⟩ | ⟨b'', rfl⟩; simp [ne.symm h] } },
448-
by_cases (contains_aux a bkt : Prop) with Hc,
448+
by_cases Hc : (contains_aux a bkt : Prop),
449449
{ rcases hash_map.valid.replace_aux a b (array.read bkts (mk_idx n (hash_fn a)))
450450
((contains_aux_iff nd).1 Hc) with ⟨u', w', b'', hl', hfl'⟩,
451451
rcases (append_of_modify u' [⟨a, b''⟩] [⟨a, b⟩] w' hl' hfl') with ⟨u, w, hl, hfl⟩,
@@ -458,7 +458,7 @@ theorem mem_insert : Π (m : hash_map α β) (a b a' b'),
458458
let ⟨u, w, hl, hfl⟩ := append_of_modify [] [] [⟨a, b⟩] _ rfl rfl in
459459
lem bkts' _ u w hl hfl $ or.inl ⟨rfl, Hc⟩,
460460
simp [insert, @dif_neg (contains_aux a bkt) _ Hc],
461-
by_cases size' ≤ n.1 with h,
461+
by_cases h : size' ≤ n.1,
462462
-- TODO(Mario): Why does the by_cases assumption look different than the stated one?
463463
{ simpa [show size' ≤ n.1, from h] using mi },
464464
{ let n' : ℕ+ := ⟨n.1 * 2, mul_pos n.2 dec_trivial⟩,
@@ -514,7 +514,7 @@ theorem mem_erase : Π (m : hash_map α β) (a a' b'),
514514
a ≠ a' ∧ sigma.mk a' b' ∈ m.entries
515515
| ⟨hash_fn, size, n, bkts, v⟩ a a' b' := begin
516516
let bkt := bkts.read hash_fn a,
517-
by_cases (contains_aux a bkt : Prop) with Hc,
517+
by_cases Hc : (contains_aux a bkt : Prop),
518518
{ let bkts' := bkts.modify hash_fn a (erase_aux a),
519519
suffices : sigma.mk a' b' ∈ bkts'.as_list ↔ a ≠ a' ∧ sigma.mk a' b' ∈ bkts.as_list,
520520
{ simpa [erase, @dif_pos (contains_aux a bkt) _ Hc] },

data/list/basic.lean

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ assume n, if_neg n
550550
theorem index_of_eq_length {a : α} {l : list α} : index_of a l = length l ↔ a ∉ l :=
551551
begin
552552
induction l with b l ih; simp [-add_comm],
553-
by_cases a = b with h; simp [h, -add_comm],
553+
by_cases h : a = b; simp [h, -add_comm],
554554
{ intro, contradiction },
555555
{ rw ← ih, exact ⟨succ_inj, congr_arg _⟩ }
556556
end
@@ -561,7 +561,7 @@ index_of_eq_length.2
561561
theorem index_of_le_length {a : α} {l : list α} : index_of a l ≤ length l :=
562562
begin
563563
induction l with b l ih; simp [-add_comm, index_of_cons],
564-
by_cases a = b with h; simp [h, -add_comm, zero_le],
564+
by_cases h : a = b; simp [h, -add_comm, zero_le],
565565
exact succ_le_succ ih
566566
end
567567

@@ -622,7 +622,7 @@ ext $ λn, if h₁ : n < length l₁
622622
else let h₁ := le_of_not_gt h₁ in by rw [nth_ge_len h₁, nth_ge_len (by rwa [← hl])]
623623

624624
@[simp] theorem index_of_nth_le [decidable_eq α] {a : α} : ∀ {l : list α} h, nth_le l (index_of a l) h = a
625-
| (b::l) h := by by_cases a = b with h'; simp *
625+
| (b::l) h := by by_cases h' : a = b; simp *
626626

627627
@[simp] theorem index_of_nth [decidable_eq α] {a : α} {l : list α} (h : a ∈ l) : nth l (index_of a l) = some a :=
628628
by rw [nth_le_nth, index_of_nth_le (index_of_lt_length.2 h)]
@@ -1129,7 +1129,7 @@ theorem filter_map_eq_filter (p : α → Prop) [decidable_pred p] :
11291129
begin
11301130
funext l,
11311131
induction l with a l IH, {simp},
1132-
by_cases p a with pa; simp [filter_map, option.guard, pa, IH]
1132+
by_cases pa : p a; simp [filter_map, option.guard, pa, IH]
11331133
end
11341134

11351135
theorem filter_map_filter_map (f : α → option β) (g : β → option γ) (l : list α) :
@@ -1253,11 +1253,11 @@ by rw ← filter_map_eq_filter; exact filter_map_sublist_filter_map _ s
12531253

12541254
@[simp] theorem span_eq_take_drop (p : α → Prop) [decidable_pred p] : ∀ (l : list α), span p l = (take_while p l, drop_while p l)
12551255
| [] := rfl
1256-
| (a::l) := by by_cases p a with pa; simp [span, take_while, drop_while, pa, span_eq_take_drop l]
1256+
| (a::l) := by by_cases pa : p a; simp [span, take_while, drop_while, pa, span_eq_take_drop l]
12571257

12581258
@[simp] theorem take_while_append_drop (p : α → Prop) [decidable_pred p] : ∀ (l : list α), take_while p l ++ drop_while p l = l
12591259
| [] := rfl
1260-
| (a::l) := by by_cases p a with pa; simp [take_while, drop_while, pa, take_while_append_drop l]
1260+
| (a::l) := by by_cases pa : p a; simp [take_while, drop_while, pa, take_while_append_drop l]
12611261

12621262
def countp (p : α → Prop) [decidable_pred p] : list α → nat
12631263
| [] := 0
@@ -1621,7 +1621,7 @@ by simp [insert.def, h]
16211621

16221622
@[simp] theorem mem_insert_iff {a b : α} {l : list α} : a ∈ insert b l ↔ a = b ∨ a ∈ l :=
16231623
begin
1624-
by_cases b ∈ l with h'; simp [h'],
1624+
by_cases h' : b ∈ l; simp [h'],
16251625
apply (or_iff_right_of_imp _).symm,
16261626
exact λ e, e.symm ▸ h'
16271627
end
@@ -1670,7 +1670,7 @@ theorem exists_erase_eq {a : α} {l : list α} (h : a ∈ l) :
16701670
∃ l₁ l₂, a ∉ l₁ ∧ l = l₁ ++ a :: l₂ ∧ l.erase a = l₁ ++ l₂ :=
16711671
by induction l with b l ih; [cases h, {
16721672
simp at h,
1673-
by_cases b = a with e,
1673+
by_cases e : b = a,
16741674
{ subst b, exact ⟨[], l, not_mem_nil _, rfl, by simp⟩ },
16751675
{ exact let ⟨l₁, l₂, h₁, h₂, h₃⟩ := ih (h.resolve_left (ne.symm e)) in
16761676
⟨b::l₁, l₂, not_mem_cons_of_ne_of_not_mem (ne.symm e) h₁,
@@ -1684,7 +1684,7 @@ end
16841684

16851685
theorem erase_append_left {a : α} : ∀ {l₁ : list α} (l₂), a ∈ l₁ → (l₁++l₂).erase a = l₁.erase a ++ l₂
16861686
| (x::xs) l₂ h := begin
1687-
by_cases x = a with h'; simp [h'],
1687+
by_cases h' : x = a; simp [h'],
16881688
rw erase_append_left l₂ (mem_of_ne_of_mem (ne.symm h') h)
16891689
end
16901690

@@ -1939,7 +1939,7 @@ mem_union.2 (or.inr h)
19391939
theorem sublist_suffix_of_union : ∀ l₁ l₂ : list α, ∃ t, t <+ l₁ ∧ t ++ l₂ = l₁ ∪ l₂
19401940
| [] l₂ := ⟨[], by refl, rfl⟩
19411941
| (a::l₁) l₂ := let ⟨t, s, e⟩ := sublist_suffix_of_union l₁ l₂ in
1942-
by simp [e.symm]; by_cases a ∈ t ++ l₂ with h;
1942+
by simp [e.symm]; by_cases h : a ∈ t ++ l₂;
19431943
[existsi t, existsi a::t]; simp [h];
19441944
[apply sublist_cons_of_sublist _ s, apply cons_sublist_cons _ s]
19451945

@@ -2036,7 +2036,7 @@ theorem mem_bag_inter {a : α} : ∀ {l₁ l₂ : list α}, a ∈ l₁.bag_inter
20362036
| [] l₂ := by simp
20372037
| (b::l₁) l₂ := by
20382038
by_cases b ∈ l₂; simp [*, and_or_distrib_left];
2039-
by_cases a = b with ba; simp *
2039+
by_cases ba : a = b; simp *
20402040

20412041
theorem bag_inter_sublist_left : ∀ l₁ l₂ : list α, l₁.bag_inter l₂ <+ l₁
20422042
| [] l₂ := by simp [nil_sublist]
@@ -2523,7 +2523,7 @@ theorem nodup_concat {a : α} {l : list α} (h : a ∉ l) (h' : nodup l) : nodup
25232523
by simp; exact nodup_append_of_nodup h' (nodup_singleton _) (disjoint_singleton.2 h)
25242524

25252525
theorem nodup_insert [decidable_eq α] {a : α} {l : list α} (h : nodup l) : nodup (insert a l) :=
2526-
by by_cases a ∈ l with h'; simp [h', h]; apply nodup_cons h' h
2526+
by by_cases h' : a ∈ l; simp [h', h]; apply nodup_cons h' h
25272527

25282528
theorem nodup_union [decidable_eq α] (l₁ : list α) {l₂ : list α} (h : nodup l₂) :
25292529
nodup (l₁ ∪ l₂) :=

data/list/perm.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ begin
432432
induction h with x _ _ _ _ x y _ _ _ _ _ _ ih_1 ih_2 generalizing t, {simp},
433433
{ by_cases x ∈ t; simp [*, skip] },
434434
{ by_cases x = y, {simp [h]},
435-
by_cases x ∈ t with xt; by_cases y ∈ t with yt,
435+
by_cases xt : x ∈ t; by_cases yt : y ∈ t,
436436
{ simp [xt, yt, mem_erase_of_ne h, mem_erase_of_ne (ne.symm h), erase_comm, swap] },
437437
{ simp [xt, yt, mt mem_of_mem_erase, skip] },
438438
{ simp [xt, yt, mt mem_of_mem_erase, skip] },
@@ -489,8 +489,8 @@ else by simpa [h, mt (mem_of_perm p).2 h] using skip a p
489489
theorem perm_insert_swap (x y : α) (l : list α) :
490490
insert x (insert y l) ~ insert y (insert x l) :=
491491
begin
492-
by_cases x ∈ l with xl; by_cases y ∈ l with yl; simp [xl, yl],
493-
by_cases x = y with xy, { simp [xy] },
492+
by_cases xl : x ∈ l; by_cases yl : y ∈ l; simp [xl, yl],
493+
by_cases xy : x = y, { simp [xy] },
494494
simp [not_mem_cons_of_ne_of_not_mem xy xl,
495495
not_mem_cons_of_ne_of_not_mem (ne.symm xy) yl],
496496
constructor

data/list/sort.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ include totr transr
9393
theorem sorted_ordered_insert (a : α) : ∀ l, sorted r l → sorted r (ordered_insert a l)
9494
| [] h := sorted_singleton a
9595
| (b :: l) h := begin
96-
by_cases a ≼ b with h',
96+
by_cases h' : a ≼ b,
9797
{ simpa [ordered_insert, h', h] using λ b' bm, transr h' (rel_of_sorted_cons h _ bm) },
9898
{ suffices : ∀ (b' : α), b' ∈ ordered_insert r a l → r b b',
9999
{ simpa [ordered_insert, h', sorted_ordered_insert l (sorted_of_sorted_cons h)] },

0 commit comments

Comments
 (0)