@@ -65,7 +65,6 @@ namespace Finset
65
65
66
66
/-! ### `0`/`1` as finsets -/
67
67
68
-
69
68
section One
70
69
71
70
variable [One α] {s : Finset α} {a : α}
@@ -169,18 +168,41 @@ theorem singletonOneHom_apply (a : α) : singletonOneHom a = {a} :=
169
168
170
169
/-- Lift a `OneHom` to `Finset` via `image`. -/
171
170
@[to_additive (attr := simps) "Lift a `ZeroHom` to `Finset` via `image`"]
172
- def imageOneHom [DecidableEq β] [One β] [OneHomClass F α β] (f : F) : OneHom (Finset α) (Finset β)
173
- where
171
+ def imageOneHom [DecidableEq β] [One β] [OneHomClass F α β] (f : F) :
172
+ OneHom (Finset α) (Finset β) where
174
173
toFun := Finset.image f
175
174
map_one' := by rw [image_one, map_one, singleton_one]
176
175
#align finset.image_one_hom Finset.imageOneHom
177
176
#align finset.image_zero_hom Finset.imageZeroHom
178
177
178
+ @[to_additive (attr := simp)]
179
+ lemma sup_one [SemilatticeSup β] [OrderBot β] (f : α → β) : sup 1 f = f 1 := sup_singleton
180
+
181
+ @[to_additive (attr := simp)]
182
+ lemma sup'_one [SemilatticeSup β] (f : α → β) : sup' 1 one_nonempty f = f 1 := rfl
183
+
184
+ @[to_additive (attr := simp)]
185
+ lemma inf_one [SemilatticeInf β] [OrderTop β] (f : α → β) : inf 1 f = f 1 := inf_singleton
186
+
187
+ @[to_additive (attr := simp)]
188
+ lemma inf'_one [SemilatticeInf β] (f : α → β) : inf' 1 one_nonempty f = f 1 := rfl
189
+
190
+ @[to_additive (attr := simp)]
191
+ lemma max_one [LinearOrder α] : (1 : Finset α).max = 1 := rfl
192
+
193
+ @[to_additive (attr := simp)]
194
+ lemma min_one [LinearOrder α] : (1 : Finset α).min = 1 := rfl
195
+
196
+ @[to_additive (attr := simp)]
197
+ lemma max'_one [LinearOrder α] : (1 : Finset α).max' one_nonempty = 1 := rfl
198
+
199
+ @[to_additive (attr := simp)]
200
+ lemma min'_one [LinearOrder α] : (1 : Finset α).min' one_nonempty = 1 := rfl
201
+
179
202
end One
180
203
181
204
/-! ### Finset negation/inversion -/
182
205
183
-
184
206
section Inv
185
207
186
208
variable [DecidableEq α] [Inv α] {s s₁ s₂ t t₁ t₂ u : Finset α} {a b : α}
@@ -260,6 +282,26 @@ theorem inv_insert (a : α) (s : Finset α) : (insert a s)⁻¹ = insert a⁻¹
260
282
#align finset.inv_insert Finset.inv_insert
261
283
#align finset.neg_insert Finset.neg_insert
262
284
285
+ @[to_additive (attr := simp)]
286
+ lemma sup_inv [SemilatticeSup β] [OrderBot β] (s : Finset α) (f : α → β) :
287
+ sup s⁻¹ f = sup s (f ·⁻¹) :=
288
+ sup_image ..
289
+
290
+ @[to_additive (attr := simp)]
291
+ lemma sup'_inv [SemilatticeSup β] {s : Finset α} (hs : s⁻¹.Nonempty) (f : α → β) :
292
+ sup' s⁻¹ hs f = sup' s hs.of_inv (f ·⁻¹) :=
293
+ sup'_image ..
294
+
295
+ @[to_additive (attr := simp)]
296
+ lemma inf_inv [SemilatticeInf β] [OrderTop β] (s : Finset α) (f : α → β) :
297
+ inf s⁻¹ f = inf s (f ·⁻¹) :=
298
+ inf_image ..
299
+
300
+ @[to_additive (attr := simp)]
301
+ lemma inf'_inv [SemilatticeInf β] {s : Finset α} (hs : s⁻¹.Nonempty) (f : α → β) :
302
+ inf' s⁻¹ hs f = inf' s hs.of_inv (f ·⁻¹) :=
303
+ inf'_image ..
304
+
263
305
@[to_additive] lemma image_op_inv (s : Finset α) : s⁻¹.image op = (s.image op)⁻¹ :=
264
306
image_comm op_inv
265
307
@@ -520,11 +562,40 @@ def imageMulHom : Finset α →ₙ* Finset β where
520
562
#align finset.image_mul_hom Finset.imageMulHom
521
563
#align finset.image_add_hom Finset.imageAddHom
522
564
565
+ @[to_additive (attr := simp (default + 1))]
566
+ lemma sup_mul_le [SemilatticeSup β] [OrderBot β] {s t : Finset α} {f : α → β} {a : β} :
567
+ sup (s * t) f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x * y) ≤ a :=
568
+ sup_image₂_le
569
+
570
+ @[to_additive]
571
+ lemma sup_mul_left [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
572
+ sup (s * t) f = sup s fun x ↦ sup t (f <| x * ·) :=
573
+ sup_image₂_left ..
574
+
575
+ @[to_additive]
576
+ lemma sup_mul_right [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
577
+ sup (s * t) f = sup t fun y ↦ sup s (f <| · * y) :=
578
+ sup_image₂_right ..
579
+
580
+ @[to_additive (attr := simp (default + 1))]
581
+ lemma le_inf_mul [SemilatticeInf β] [OrderTop β] {s t : Finset α} {f : α → β} {a : β} :
582
+ a ≤ inf (s * t) f ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ f (x * y) :=
583
+ le_inf_image₂
584
+
585
+ @[to_additive]
586
+ lemma inf_mul_left [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
587
+ inf (s * t) f = inf s fun x ↦ inf t (f <| x * ·) :=
588
+ inf_image₂_left ..
589
+
590
+ @[to_additive]
591
+ lemma inf_mul_right [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
592
+ inf (s * t) f = inf t fun y ↦ inf s (f <| · * y) :=
593
+ inf_image₂_right ..
594
+
523
595
end Mul
524
596
525
597
/-! ### Finset subtraction/division -/
526
598
527
-
528
599
section Div
529
600
530
601
variable [DecidableEq α] [Div α] {s s₁ s₂ t t₁ t₂ u : Finset α} {a b : α}
@@ -709,6 +780,36 @@ theorem subset_div {s t : Set α} :
709
780
#align finset.subset_div Finset.subset_div
710
781
#align finset.subset_sub Finset.subset_sub
711
782
783
+ @[to_additive (attr := simp (default + 1))]
784
+ lemma sup_div_le [SemilatticeSup β] [OrderBot β] {s t : Finset α} {f : α → β} {a : β} :
785
+ sup (s / t) f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x / y) ≤ a :=
786
+ sup_image₂_le
787
+
788
+ @[to_additive]
789
+ lemma sup_div_left [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
790
+ sup (s / t) f = sup s fun x ↦ sup t (f <| x / ·) :=
791
+ sup_image₂_left ..
792
+
793
+ @[to_additive]
794
+ lemma sup_div_right [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
795
+ sup (s / t) f = sup t fun y ↦ sup s (f <| · / y) :=
796
+ sup_image₂_right ..
797
+
798
+ @[to_additive (attr := simp (default + 1))]
799
+ lemma le_inf_div [SemilatticeInf β] [OrderTop β] {s t : Finset α} {f : α → β} {a : β} :
800
+ a ≤ inf (s / t) f ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ f (x / y) :=
801
+ le_inf_image₂
802
+
803
+ @[to_additive]
804
+ lemma inf_div_left [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
805
+ inf (s / t) f = inf s fun x ↦ inf t (f <| x / ·) :=
806
+ inf_image₂_left ..
807
+
808
+ @[to_additive]
809
+ lemma inf_div_right [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
810
+ inf (s / t) f = inf t fun y ↦ inf s (f <| · / y) :=
811
+ inf_image₂_right ..
812
+
712
813
end Div
713
814
714
815
/-! ### Instances -/
0 commit comments