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

Commit c1a5ae9

Browse files
urkudbryangingechen
andcommitted
chore(order/directed): use implicit args in iffs (#3411)
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
1 parent 5fe67b7 commit c1a5ae9

File tree

10 files changed

+20
-22
lines changed

10 files changed

+20
-22
lines changed

src/analysis/convex/cone.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ begin
350350
refine ⟨linear_pmap.Sup c c_chain.directed_on, _, λ _, linear_pmap.le_Sup c_chain.directed_on⟩,
351351
rintros ⟨x, hx⟩ hxs,
352352
have hdir : directed_on (≤) (linear_pmap.domain '' c),
353-
from (directed_on_image _).2 (c_chain.directed_on.mono _ linear_pmap.domain_mono.monotone),
353+
from directed_on_image.2 (c_chain.directed_on.mono linear_pmap.domain_mono.monotone),
354354
rcases (mem_Sup_of_directed (cne.image _) hdir).1 hx with ⟨_, ⟨f, hfc, rfl⟩, hfx⟩,
355355
have : f ≤ linear_pmap.Sup c c_chain.directed_on, from linear_pmap.le_Sup _ hfc,
356356
convert ← hcs hfc ⟨x, hfx⟩ hxs,

src/group_theory/subgroup.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ lemma mem_Sup_of_directed_on {K : set (subgroup G)} (Kne : K.nonempty)
490490
x ∈ Sup K ↔ ∃ s ∈ K, x ∈ s :=
491491
begin
492492
haveI : nonempty K := Kne.to_subtype,
493-
rw [Sup_eq_supr, supr_subtype', mem_supr_of_directed, subtype.exists],
494-
exact (directed_on_iff_directed _).1 hK
493+
simp only [Sup_eq_supr', mem_supr_of_directed hK.directed_coe, set_coe.exists, subtype.coe_mk]
495494
end
496495

497496
variables {N : Type*} [group N] {P : Type*} [group P]

src/group_theory/submonoid/membership.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ lemma mem_Sup_of_directed_on {S : set (submonoid M)} (Sne : S.nonempty)
100100
x ∈ Sup S ↔ ∃ s ∈ S, x ∈ s :=
101101
begin
102102
haveI : nonempty S := Sne.to_subtype,
103-
rw [Sup_eq_supr, supr_subtype', mem_supr_of_directed, subtype.exists],
104-
exact (directed_on_iff_directed _).1 hS
103+
simp only [Sup_eq_supr', mem_supr_of_directed hS.directed_coe, set_coe.exists, subtype.coe_mk]
105104
end
106105

107106
@[to_additive]

src/linear_algebra/basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,7 @@ theorem mem_Sup_of_directed {s : set (submodule R M)}
728728
z ∈ Sup s ↔ ∃ y ∈ s, z ∈ y :=
729729
begin
730730
haveI : nonempty s := hs.to_subtype,
731-
rw [Sup_eq_supr, supr_subtype', mem_supr_of_directed, subtype.exists],
732-
exact (directed_on_iff_directed _).1 hdir
731+
simp only [Sup_eq_supr', mem_supr_of_directed _ hdir.directed_coe, set_coe.exists, subtype.coe_mk]
733732
end
734733

735734
section

src/linear_algebra/basis.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,16 +373,13 @@ lemma linear_independent_sUnion_of_directed {s : set (set M)}
373373
(h : ∀ a ∈ s, linear_independent R (λ x, x : (a : set M) → M)) :
374374
linear_independent R (λ x, x : (⋃₀ s) → M) :=
375375
by rw sUnion_eq_Union; exact
376-
linear_independent_Union_of_directed
377-
((directed_on_iff_directed _).1 hs) (by simpa using h)
376+
linear_independent_Union_of_directed hs.directed_coe (by simpa using h)
378377

379378
lemma linear_independent_bUnion_of_directed {η} {s : set η} {t : η → set M}
380379
(hs : directed_on (t ⁻¹'o (⊆)) s) (h : ∀a∈s, linear_independent R (λ x, x : t a → M)) :
381380
linear_independent R (λ x, x : (⋃a∈s, t a) → M) :=
382381
by rw bUnion_eq_Union; exact
383-
linear_independent_Union_of_directed
384-
((directed_comp _ _ _).2 $ (directed_on_iff_directed _).1 hs)
385-
(by simpa using h)
382+
linear_independent_Union_of_directed (directed_comp.2 $ hs.directed_coe) (by simpa using h)
386383

387384
lemma linear_independent_Union_finite_subtype {ι : Type*} {f : ι → set M}
388385
(hl : ∀i, linear_independent R (λ x, x : f i → M))

src/linear_algebra/linear_pmap.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private lemma Sup_aux (c : set (linear_pmap R E F)) (hc : directed_on (≤) c) :
287287
begin
288288
cases c.eq_empty_or_nonempty with ceq cne, { subst c, simp },
289289
have hdir : directed_on (≤) (domain '' c),
290-
from (directed_on_image _).2 (hc.mono _ domain_mono.monotone),
290+
from directed_on_image.2 (hc.mono domain_mono.monotone),
291291
have P : Π x : Sup (domain '' c), {p : c // (x : E) ∈ p.val.domain },
292292
{ rintros x,
293293
apply classical.indefinite_description,

src/order/complete_lattice.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ lemma infi_subtype' {p : ι → Prop} {f : ∀ i, p i → α} :
806806
(@infi_subtype _ _ _ p (λ x, f x.val x.property)).symm
807807

808808
lemma infi_subtype'' {ι} (s : set ι) (f : ι → α) :
809-
(⨅ i : s, f i) = ⨅ (t : ι) (H : t ∈ s), f t :=
809+
(⨅ i : s, f i) = ⨅ (t : ι) (H : t ∈ s), f t :=
810810
infi_subtype
811811

812812
lemma is_glb_binfi {s : set β} {f : β → α} : is_glb (f '' s) (⨅ x ∈ s, f x) :=
@@ -818,9 +818,12 @@ le_antisymm
818818
(supr_le $ assume i, supr_le $ assume : p i, le_supr _ _)
819819

820820
lemma supr_subtype' {p : ι → Prop} {f : ∀ i, p i → α} :
821-
(⨆ i (h : p i), f i h) = (⨆ x : subtype p, f x.val x.property) :=
821+
(⨆ i (h : p i), f i h) = (⨆ x : subtype p, f x x.property) :=
822822
(@supr_subtype _ _ _ p (λ x, f x.val x.property)).symm
823823

824+
lemma Sup_eq_supr' {s : set α} : Sup s = ⨆ x : s, (x : α) :=
825+
by rw [Sup_eq_supr, supr_subtype']; refl
826+
824827
lemma is_lub_bsupr {s : set β} {f : β → α} : is_lub (f '' s) (⨆ x ∈ s, f x) :=
825828
by simpa only [range_comp, subtype.range_coe, supr_subtype'] using @is_lub_supr α s _ (f ∘ coe)
826829

src/order/directed.lean

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ def directed (f : ι → α) := ∀x y, ∃z, f x ≼ f z ∧ f y ≼ f z
1919
pair of elements in the set. -/
2020
def directed_on (s : set α) := ∀ (x ∈ s) (y ∈ s), ∃z ∈ s, x ≼ z ∧ y ≼ z
2121

22+
variables {r}
23+
2224
theorem directed_on_iff_directed {s} : @directed_on α r s ↔ directed r (coe : s → α) :=
2325
by simp [directed, directed_on]; refine ball_congr (λ x hx, by simp; refl)
2426

27+
alias directed_on_iff_directed ↔ directed_on.directed_coe _
28+
2529
theorem directed_on_image {s} {f : β → α} :
2630
directed_on r (f '' s) ↔ directed_on (f ⁻¹'o r) s :=
2731
by simp only [directed_on, set.ball_image_iff, set.bex_image_iff, order.preimage]
@@ -31,19 +35,17 @@ theorem directed_on.mono {s : set α} (h : directed_on r s)
3135
directed_on r' s :=
3236
λ x hx y hy, let ⟨z, zs, xz, yz⟩ := h x hx y hy in ⟨z, zs, H xz, H yz⟩
3337

34-
theorem directed_comp {ι} (f : ι → β) (g : β → α) :
38+
theorem directed_comp {ι} {f : ι → β} {g : β → α} :
3539
directed r (g ∘ f) ↔ directed (g ⁻¹'o r) f := iff.rfl
3640

37-
variable {r}
38-
3941
theorem directed.mono {s : α → α → Prop} {ι} {f : ι → α}
4042
(H : ∀ a b, r a b → s a b) (h : directed r f) : directed s f :=
4143
λ a b, let ⟨c, h₁, h₂⟩ := h a b in ⟨c, H _ _ h₁, H _ _ h₂⟩
4244

4345
theorem directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : ι → α}
4446
(hg : ∀ ⦃x y⦄, x ≼ y → rb (g x) (g y)) (hf : directed r f) :
4547
directed rb (g ∘ f) :=
46-
(directed_comp rb f g).2 $ hf.mono hg
48+
directed_comp.2 $ hf.mono hg
4749

4850
/-- A monotone function on a sup-semilattice is directed. -/
4951
lemma directed_of_sup [semilattice_sup α] {f : α → β} {r : β → β → Prop}

src/ring_theory/subsemiring.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ lemma mem_Sup_of_directed_on {S : set (subsemiring R)} (Sne : S.nonempty)
481481
x ∈ Sup S ↔ ∃ s ∈ S, x ∈ s :=
482482
begin
483483
haveI : nonempty S := Sne.to_subtype,
484-
rw [Sup_eq_supr, supr_subtype', mem_supr_of_directed, subtype.exists],
485-
exact (directed_on_iff_directed _).1 hS
484+
simp only [Sup_eq_supr', mem_supr_of_directed hS.directed_coe, set_coe.exists, subtype.coe_mk]
486485
end
487486

488487
lemma coe_Sup_of_directed_on {S : set (subsemiring R)} (Sne : S.nonempty) (hS : directed_on (≤) S) :

src/topology/algebra/infinite_sum.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ theorem rel_supr_sum [complete_lattice β] (m : β → α) (m0 : m ⊥ = 0)
440440
(s : δ → β) (t : finset δ) :
441441
R (m (⨆ d ∈ t, s d)) (∑ d in t, m (s d)) :=
442442
by { cases t.nonempty_encodable, rw [supr_subtype'], convert rel_supr_tsum m m0 R m_supr _,
443-
rw [← finset.tsum_subtype], refl, assumption }
443+
rw [← finset.tsum_subtype], assumption }
444444

445445
/-- If a function is countably sub-additive then it is binary sub-additive -/
446446
theorem rel_sup_add [complete_lattice β] (m : β → α) (m0 : m ⊥ = 0)

0 commit comments

Comments
 (0)