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

Commit 00d450e

Browse files
committed
refactor(data/set/pairwise): use {{..}} arguments (#17230)
1 parent c48d7bf commit 00d450e

File tree

35 files changed

+67
-84
lines changed

35 files changed

+67
-84
lines changed

archive/100-theorems-list/82_cubing_a_cube.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ begin
158158
{ rw [←add_le_add_iff_right (1 : ℝ)], convert b_add_w_le_one h, rw hi, rw zero_add },
159159
apply zero_le_b h, apply lt_of_lt_of_le (side_subset h $ (cs i').b_mem_side j).2,
160160
simp [hi, zero_le_b h] },
161-
exact h.pairwise_disjoint i' i hi' ⟨hp, h2p⟩
161+
exact h.pairwise_disjoint hi' ⟨hp, h2p⟩
162162
end
163163

164164
/-- The top of a cube (which is the bottom of the cube shifted up by its width) must be covered by
@@ -176,7 +176,7 @@ begin
176176
rw [← h.2, mem_Union] at this, rcases this with ⟨i', hi'⟩,
177177
rw [mem_Union], use i', refine ⟨_, λ j, hi' j.succ⟩,
178178
have : i ≠ i', { rintro rfl, apply not_le_of_lt (hi' 0).2, rw [hp0], refl },
179-
have := h.1 i i' this, rw [on_fun, to_set_disjoint, exists_fin_succ] at this,
179+
have := h.1 this, rw [on_fun, to_set_disjoint, exists_fin_succ] at this,
180180
rcases this with h0|⟨j, hj⟩,
181181
rw [hp0], symmetry, apply eq_of_Ico_disjoint h0 (by simp [hw]) _,
182182
convert hi' 0, rw [hp0], refl,
@@ -395,9 +395,9 @@ begin
395395
intro j₂, by_cases hj₂ : j₂ = j,
396396
{ simpa [side_tail, p', hj'.symm, hj₂] using hi''.2 j },
397397
{ simpa [hj₂] using hi'.2 j₂ } },
398-
apply not_disjoint_iff.mpr ⟨(cs i).b, (cs i).b_mem_to_set, this⟩ (h.1 i i' i_i') },
398+
apply not_disjoint_iff.mpr ⟨(cs i).b, (cs i).b_mem_to_set, this⟩ (h.1 i_i') },
399399
have i_i'' : i ≠ i'', { intro h, induction h, simpa [hx'.2] using hi''.2 j' },
400-
apply not.elim _ (h.1 i' i'' i'_i''),
400+
apply not.elim _ (h.1 i'_i''),
401401
simp only [on_fun, to_set_disjoint, not_disjoint_iff, forall_fin_succ, not_exists, comp_app],
402402
refine ⟨⟨c.b 0, bottom_mem_side h2i', bottom_mem_side h2i''⟩, _⟩,
403403
intro j₂,

src/algebra/big_operators/finprod.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ begin
792792
rw [← bUnion_univ, ← finset.coe_univ, ← finset.coe_bUnion,
793793
finprod_mem_coe_finset, finset.prod_bUnion],
794794
{ simp only [finprod_mem_coe_finset, finprod_eq_prod_of_fintype] },
795-
{ exact λ x _ y _ hxy, finset.disjoint_coe.1 (h x y hxy) }
795+
{ exact λ x _ y _ hxy, finset.disjoint_coe.1 (h hxy) }
796796
end
797797

798798
/-- Given a family of sets `t : ι → set α`, a finite set `I` in the index type such that all sets

src/algebra/direct_sum/module.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ the two submodules are complementary. Over a `ring R`, this is true as an iff, a
315315
`direct_sum.is_internal_iff_is_compl`. --/
316316
lemma is_internal.is_compl {A : ι → submodule R M} {i j : ι} (hij : i ≠ j)
317317
(h : (set.univ : set ι) = {i, j}) (hi : is_internal A) : is_compl (A i) (A j) :=
318-
⟨hi.submodule_independent.pairwise_disjoint _ _ hij, eq.le $ hi.submodule_supr_eq_top.symm.trans $
318+
⟨hi.submodule_independent.pairwise_disjoint hij, eq.le $ hi.submodule_supr_eq_top.symm.trans $
319319
by rw [←Sup_pair, supr, ←set.image_univ, h, set.image_insert_eq, set.image_singleton]⟩
320320

321321
end semiring

src/algebra/group/pi.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ lemma pi.mul_single_apply_commute [Π i, mul_one_class $ f i] (x : Π i, f i) (i
320320
begin
321321
obtain rfl | hij := decidable.eq_or_ne i j,
322322
{ refl },
323-
{ exact pi.mul_single_commute _ _ hij _ _, },
323+
{ exact pi.mul_single_commute hij _ _, },
324324
end
325325

326326
@[to_additive update_eq_sub_add_single]

src/data/finset/basic.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,11 +2902,7 @@ variables {s : finset α}
29022902

29032903
lemma pairwise_subtype_iff_pairwise_finset' (r : β → β → Prop) (f : α → β) :
29042904
pairwise (r on λ x : s, f x) ↔ (s : set α).pairwise (r on f) :=
2905-
begin
2906-
refine ⟨λ h x hx y hy hxy, h ⟨x, hx⟩ ⟨y, hy⟩ (by simpa only [subtype.mk_eq_mk, ne.def]), _⟩,
2907-
rintros h ⟨x, hx⟩ ⟨y, hy⟩ hxy,
2908-
exact h hx hy (subtype.mk_eq_mk.not.mp hxy)
2909-
end
2905+
pairwise_subtype_iff_pairwise_set (s : set α) (r on f)
29102906

29112907
lemma pairwise_subtype_iff_pairwise_finset (r : α → α → Prop) :
29122908
pairwise (r on λ x : s, x) ↔ (s : set α).pairwise r :=

src/data/mv_polynomial/variables.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ begin
387387
intros v hv v2 hv2,
388388
rw finset.mem_bUnion at hv2,
389389
rcases hv2 with ⟨i, his, hi⟩,
390-
refine h a i _ _ hv _ hi,
390+
refine h _ _ hv _ hi,
391391
rintro rfl,
392392
contradiction }
393393
end

src/data/polynomial/ring_division.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ begin
818818
rw [prod_multiset_root_eq_finset_root, polynomial.map_prod],
819819
refine finset.prod_dvd_of_coprime (λ a _ b _ h, _) (λ a _, _),
820820
{ simp_rw [polynomial.map_pow, polynomial.map_sub, map_C, map_X],
821-
exact (pairwise_coprime_X_sub_C (is_fraction_ring.injective R $ fraction_ring R) _ _ h).pow },
821+
exact (pairwise_coprime_X_sub_C (is_fraction_ring.injective R $ fraction_ring R) h).pow },
822822
{ exact polynomial.map_dvd _ (pow_root_multiplicity_dvd p a) },
823823
end
824824

src/data/set/pairwise.lean

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ section pairwise
3232
variables {f g : ι → α} {s t u : set α} {a b : α}
3333

3434
/-- A relation `r` holds pairwise if `r i j` for all `i ≠ j`. -/
35-
def pairwise (r : α → α → Prop) := ∀ i j, i ≠ j → r i j
35+
def pairwise (r : α → α → Prop) := ∀ i j, i ≠ j → r i j
3636

3737
lemma pairwise.mono (hr : pairwise r) (h : ∀ ⦃i j⦄, r i j → p i j) : pairwise p :=
38-
λ i j hij, h $ hr i j hij
38+
λ i j hij, h $ hr hij
3939

40-
protected lemma pairwise.eq (h : pairwise r) : ¬ r a b → a = b := not_imp_comm.1 $ h _ _
40+
protected lemma pairwise.eq (h : pairwise r) : ¬ r a b → a = b := not_imp_comm.1 $ @h _ _
4141

4242
lemma pairwise_on_bool (hr : symmetric r) {a b : α} : pairwise (r on (λ c, cond c a b)) ↔ r a b :=
4343
by simpa [pairwise, function.on_fun] using @hr a b
@@ -47,15 +47,11 @@ lemma pairwise_disjoint_on_bool [semilattice_inf α] [order_bot α] {a b : α} :
4747
pairwise_on_bool disjoint.symm
4848

4949
lemma symmetric.pairwise_on [linear_order ι] (hr : symmetric r) (f : ι → α) :
50-
pairwise (r on f) ↔ ∀ m n, m < n → r (f m) (f n) :=
51-
⟨λ h m n hmn, h m n hmn.ne, λ h m n hmn, begin
52-
obtain hmn' | hmn' := hmn.lt_or_lt,
53-
{ exact h _ _ hmn' },
54-
{ exact hr (h _ _ hmn') }
55-
end
50+
pairwise (r on f) ↔ ∀ ⦃m n⦄, m < n → r (f m) (f n) :=
51+
⟨λ h m n hmn, h hmn.ne, λ h m n hmn, hmn.lt_or_lt.elim (@h _ _) (λ h', hr (h h'))⟩
5652

5753
lemma pairwise_disjoint_on [semilattice_inf α] [order_bot α] [linear_order ι] (f : ι → α) :
58-
pairwise (disjoint on f) ↔ ∀ m n, m < n → disjoint (f m) (f n) :=
54+
pairwise (disjoint on f) ↔ ∀ m n, m < n → disjoint (f m) (f n) :=
5955
symmetric.pairwise_on disjoint.symm f
6056

6157
lemma pairwise_disjoint.mono [semilattice_inf α] [order_bot α]
@@ -223,20 +219,13 @@ by { rw [sUnion_eq_Union, pairwise_Union (h.directed_coe), set_coe.forall], refl
223219

224220
end set
225221

226-
lemma pairwise.set_pairwise (h : pairwise r) (s : set α) : s.pairwise r := λ x hx y hy, h x y
222+
lemma pairwise.set_pairwise (h : pairwise r) (s : set α) : s.pairwise r := λ x hx y hy hxy, h hxy
227223

228224
end pairwise
229225

230-
lemma pairwise_subtype_iff_pairwise_set {α : Type*} (s : set α) (r : α → α → Prop) :
226+
lemma pairwise_subtype_iff_pairwise_set (s : set α) (r : α → α → Prop) :
231227
pairwise (λ (x : s) (y : s), r x y) ↔ s.pairwise r :=
232-
begin
233-
split,
234-
{ assume h x hx y hy hxy,
235-
exact h ⟨x, hx⟩ ⟨y, hy⟩ (by simpa only [subtype.mk_eq_mk, ne.def]) },
236-
{ rintros h ⟨x, hx⟩ ⟨y, hy⟩ hxy,
237-
simp only [subtype.mk_eq_mk, ne.def] at hxy,
238-
exact h hx hy hxy }
239-
end
228+
by simp only [pairwise, set.pairwise, set_coe.forall, ne.def, subtype.ext_iff, subtype.coe_mk]
240229

241230
alias pairwise_subtype_iff_pairwise_set ↔ pairwise.set_of_subtype set.pairwise.subtype
242231

src/field_theory/separable.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ end
168168

169169
lemma separable_prod {ι : Sort*} [fintype ι] {f : ι → R[X]}
170170
(h1 : pairwise (is_coprime on f)) (h2 : ∀ x, (f x).separable) : (∏ x, f x).separable :=
171-
separable_prod' (λ x hx y hy hxy, h1 x y hxy) (λ x hx, h2 x)
171+
separable_prod' (λ x hx y hy hxy, h1 hxy) (λ x hx, h2 x)
172172

173173
lemma separable.inj_of_prod_X_sub_C [nontrivial R] {ι : Sort*} {f : ι → R} {s : finset ι}
174174
(hfs : (∏ i in s, (X - C (f i))).separable)

src/group_theory/free_product.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ lemma lift_word_ping_pong {i j k} (w : neword H i j) (hk : j ≠ k) :
591591
begin
592592
rename [i → i', j → j', k → m, hk → hm],
593593
induction w with i x hne_one i j k l w₁ hne w₂ hIw₁ hIw₂ generalizing m; clear i' j',
594-
{ simpa using hpp _ _ hm _ hne_one, },
594+
{ simpa using hpp hm _ hne_one, },
595595
{ calc lift f (neword.append w₁ hne w₂).prod • X m
596596
= lift f w₁.prod • lift f w₂.prod • X m : by simp [mul_action.mul_smul]
597597
... ⊆ lift f w₁.prod • X k : set_smul_subset_set_smul_iff.mpr (hIw₂ hm)
@@ -607,7 +607,7 @@ begin
607607
have : X k ⊆ X i,
608608
by simpa [heq1] using lift_word_ping_pong f X hpp w hlast.symm,
609609
obtain ⟨x, hx⟩ := hXnonempty k,
610-
exact hXdisj k i hhead ⟨hx, this hx⟩,
610+
exact hXdisj hhead ⟨hx, this hx⟩,
611611
end
612612

613613
include hnontriv
@@ -796,10 +796,10 @@ begin
796796
{ intros i j hij,
797797
simp only [X'],
798798
apply disjoint.union_left; apply disjoint.union_right,
799-
{ exact hXdisj i j hij, },
799+
{ exact hXdisj hij, },
800800
{ exact hXYdisj i j, },
801801
{ exact (hXYdisj j i).symm, },
802-
{ exact hYdisj i j hij, }, },
802+
{ exact hYdisj hij, }, },
803803

804804
show pairwise (λ i j, ∀ h : H i, h ≠ 1 → f i h • X' j ⊆ X' i),
805805
{ rintros i j hij,
@@ -816,7 +816,7 @@ begin
816816
cases (lt_or_gt_of_ne hnne0).swap with hlt hgt,
817817
{ have h1n : 1 ≤ n := hlt,
818818
calc a i ^ n • X' j ⊆ a i ^ n • (Y i)ᶜ : smul_set_mono
819-
((hXYdisj j i).union_left $ hYdisj j i hij.symm).subset_compl_right
819+
((hXYdisj j i).union_left $ hYdisj hij.symm).subset_compl_right
820820
... ⊆ X i :
821821
begin
822822
refine int.le_induction _ _ _ h1n,
@@ -832,7 +832,7 @@ begin
832832
... ⊆ X' i : set.subset_union_left _ _, },
833833
{ have h1n : n ≤ -1, { apply int.le_of_lt_add_one, simpa using hgt, },
834834
calc a i ^ n • X' j ⊆ a i ^ n • (X i)ᶜ : smul_set_mono
835-
((hXdisj j i hij.symm).union_left (hXYdisj i j).symm).subset_compl_right
835+
((hXdisj hij.symm).union_left (hXYdisj i j).symm).subset_compl_right
836836
... ⊆ Y i :
837837
begin
838838
refine int.le_induction_down _ _ _ h1n,

0 commit comments

Comments
 (0)