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

Commit aa32922

Browse files
committed
chore(data/set/pointwise): split file, reducing dependencies (#16950)
This splits `data.set.pointwise` and `data.finset.pointwise` each into several smaller files. This allows us to remove or defer some imports, e.g. of `order.well_founded_set` and of `algebra.big_operators.basic`. No changes to statements of theorems, just relocating. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent ad7dca6 commit aa32922

File tree

22 files changed

+403
-354
lines changed

22 files changed

+403
-354
lines changed

src/algebra/add_torsor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Joseph Myers. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Joseph Myers, Yury Kudryashov
55
-/
6-
import data.set.pointwise
6+
import data.set.pointwise.basic
77

88
/-!
99
# Torsors of additive group actions

src/algebra/algebra/operations.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import algebra.module.submodule.bilinear
99
import algebra.module.opposites
1010
import data.finset.pointwise
1111
import data.set.semiring
12+
import data.set.pointwise.big_operators
1213
import group_theory.group_action.sub_mul_action.pointwise
1314

1415
/-!

src/algebra/bounds.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury G. Kudryashov
55
-/
6-
import data.set.pointwise
6+
import data.set.pointwise.basic
77
import order.conditionally_complete_lattice
88

99
/-!

src/algebra/module/pointwise_pi.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2021 Alex J. Best. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alex J. Best
55
-/
6-
import data.set.pointwise
6+
import data.set.pointwise.basic
77
import group_theory.group_action.pi
88

99
/-!

src/algebra/order/pointwise.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alex J. Best, Yaël Dillies
55
-/
66
import algebra.bounds
7+
import data.set.pointwise.basic
78

89
/-!
910
# Pointwise operations on ordered algebraic objects

src/algebra/order/smul.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import algebra.module.pi
77
import algebra.module.prod
88
import algebra.order.field
99
import algebra.order.pi
10-
import data.set.pointwise
10+
import data.set.pointwise.basic
1111
import tactic.positivity
1212

1313
/-!

src/algebra/star/pointwise.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jireh Loreaux
55
-/
66
import algebra.star.basic
7-
import data.set.pointwise
7+
import data.set.pointwise.basic
88

99
/-!
1010
# Pointwise star operation on sets

src/analysis/convex/body.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Authors: Paul A. Reichert
66
import analysis.convex.basic
77
import analysis.normed_space.basic
88
import data.real.nnreal
9-
import data.set.pointwise
9+
import data.set.pointwise.basic
1010
import topology.subset_properties
1111

1212
/-!

src/data/finset/mul_antidiagonal.lean

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/-
2+
Copyright (c) 2020 Floris van Doorn. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Floris van Doorn, Yaël Dillies
5+
-/
6+
import data.set.pointwise.basic
7+
import data.set.mul_antidiagonal
8+
9+
/-! # Multiplication antidiagonal as a `finset`.
10+
11+
We construct the `finset` of all pairs
12+
of an element in `s` and an element in `t` that multiply to `a`,
13+
given that `s` and `t` are well-ordered.-/
14+
15+
namespace set
16+
17+
open_locale pointwise
18+
variables {α : Type*} {s t : set α}
19+
20+
@[to_additive]
21+
lemma is_pwo.mul [ordered_cancel_comm_monoid α] (hs : s.is_pwo) (ht : t.is_pwo) : is_pwo (s * t) :=
22+
by { rw ←image_mul_prod, exact (hs.prod ht).image_of_monotone (monotone_fst.mul' monotone_snd) }
23+
24+
variables [linear_ordered_cancel_comm_monoid α]
25+
26+
@[to_additive]
27+
lemma is_wf.mul (hs : s.is_wf) (ht : t.is_wf) : is_wf (s * t) := (hs.is_pwo.mul ht.is_pwo).is_wf
28+
29+
@[to_additive]
30+
lemma is_wf.min_mul (hs : s.is_wf) (ht : t.is_wf) (hsn : s.nonempty) (htn : t.nonempty) :
31+
(hs.mul ht).min (hsn.mul htn) = hs.min hsn * ht.min htn :=
32+
begin
33+
refine le_antisymm (is_wf.min_le _ _ (mem_mul.2 ⟨_, _, hs.min_mem _, ht.min_mem _, rfl⟩)) _,
34+
rw is_wf.le_min_iff,
35+
rintro _ ⟨x, y, hx, hy, rfl⟩,
36+
exact mul_le_mul' (hs.min_le _ hx) (ht.min_le _ hy),
37+
end
38+
39+
end set
40+
41+
namespace finset
42+
43+
open_locale pointwise
44+
45+
variables {α : Type*}
46+
variables [ordered_cancel_comm_monoid α] {s t : set α} (hs : s.is_pwo) (ht : t.is_pwo) (a : α)
47+
48+
/-- `finset.mul_antidiagonal_of_is_wf hs ht a` is the set of all pairs of an element in `s` and an
49+
element in `t` that multiply to `a`, but its construction requires proofs that `s` and `t` are
50+
well-ordered. -/
51+
@[to_additive "`finset.add_antidiagonal_of_is_wf hs ht a` is the set of all pairs of an element in
52+
`s` and an element in `t` that add to `a`, but its construction requires proofs that `s` and `t` are
53+
well-ordered."]
54+
noncomputable def mul_antidiagonal : finset (α × α) :=
55+
(set.mul_antidiagonal.finite_of_is_pwo hs ht a).to_finset
56+
57+
variables {hs ht a} {u : set α} {hu : u.is_pwo} {x : α × α}
58+
59+
@[simp, to_additive]
60+
lemma mem_mul_antidiagonal : x ∈ mul_antidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a :=
61+
by simp [mul_antidiagonal, and_rotate]
62+
63+
@[to_additive] lemma mul_antidiagonal_mono_left (h : u ⊆ s) :
64+
mul_antidiagonal hu ht a ⊆ mul_antidiagonal hs ht a :=
65+
set.finite.to_finset_subset.2 $ set.mul_antidiagonal_mono_left h
66+
67+
@[to_additive] lemma mul_antidiagonal_mono_right (h : u ⊆ t) :
68+
mul_antidiagonal hs hu a ⊆ mul_antidiagonal hs ht a :=
69+
set.finite.to_finset_subset.2 $ set.mul_antidiagonal_mono_right h
70+
71+
@[simp, to_additive] lemma swap_mem_mul_antidiagonal :
72+
x.swap ∈ finset.mul_antidiagonal hs ht a ↔ x ∈ finset.mul_antidiagonal ht hs a :=
73+
by simp [mul_comm, and.left_comm]
74+
75+
@[to_additive]
76+
lemma support_mul_antidiagonal_subset_mul : {a | (mul_antidiagonal hs ht a).nonempty} ⊆ s * t :=
77+
λ a ⟨b, hb⟩, by { rw mem_mul_antidiagonal at hb, exact ⟨b.1, b.2, hb⟩ }
78+
79+
@[to_additive]
80+
lemma is_pwo_support_mul_antidiagonal : {a | (mul_antidiagonal hs ht a).nonempty}.is_pwo :=
81+
(hs.mul ht).mono support_mul_antidiagonal_subset_mul
82+
83+
@[to_additive]
84+
lemma mul_antidiagonal_min_mul_min {α} [linear_ordered_cancel_comm_monoid α] {s t : set α}
85+
(hs : s.is_wf) (ht : t.is_wf) (hns : s.nonempty) (hnt : t.nonempty) :
86+
mul_antidiagonal hs.is_pwo ht.is_pwo ((hs.min hns) * (ht.min hnt)) = {(hs.min hns, ht.min hnt)} :=
87+
begin
88+
ext ⟨a, b⟩,
89+
simp only [mem_mul_antidiagonal, mem_singleton, prod.ext_iff],
90+
split,
91+
{ rintro ⟨has, hat, hst⟩,
92+
obtain rfl := (hs.min_le hns has).eq_of_not_lt
93+
(λ hlt, (mul_lt_mul_of_lt_of_le hlt $ ht.min_le hnt hat).ne' hst),
94+
exact ⟨rfl, mul_left_cancel hst⟩ },
95+
{ rintro ⟨rfl, rfl⟩,
96+
exact ⟨hs.min_mem _, ht.min_mem _, rfl⟩ }
97+
end
98+
99+
end finset

src/data/finset/pointwise.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Floris van Doorn, Yaël Dillies
55
-/
66
import data.finset.n_ary
77
import data.finset.preimage
8-
import data.set.pointwise
8+
import data.set.pointwise.basic
99

1010
/-!
1111
# Pointwise operations of finsets

0 commit comments

Comments
 (0)