File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -743,6 +743,7 @@ import Mathlib.Algebra.Order.Ring.Canonical
743
743
import Mathlib.Algebra.Order.Ring.Cast
744
744
import Mathlib.Algebra.Order.Ring.Cone
745
745
import Mathlib.Algebra.Order.Ring.Defs
746
+ import Mathlib.Algebra.Order.Ring.Finset
746
747
import Mathlib.Algebra.Order.Ring.InjSurj
747
748
import Mathlib.Algebra.Order.Ring.Int
748
749
import Mathlib.Algebra.Order.Ring.Nat
Original file line number Diff line number Diff line change
1
+ /-
2
+ Copyright (c) 2022 Eric Wieser, Yaël Dillies, Andrew Yang. All rights reserved.
3
+ Released under Apache 2.0 license as described in the file LICENSE.
4
+ Authors: Eric Wieser, Yaël Dillies, Andrew Yang
5
+ -/
6
+ import Mathlib.Algebra.Order.Field.Canonical.Defs
7
+ import Mathlib.Data.Finset.Lattice.Fold
8
+ import Mathlib.Data.Nat.Cast.Order.Ring
9
+
10
+ /-!
11
+ # `Finset.sup` of `Nat.cast`
12
+ -/
13
+
14
+ open Finset
15
+
16
+ namespace Nat
17
+ variable {ι R : Type *}
18
+
19
+ section LinearOrderedSemiring
20
+ variable [LinearOrderedSemiring R] {s : Finset ι}
21
+
22
+ set_option linter.docPrime false in
23
+ @[simp, norm_cast]
24
+ lemma cast_finsetSup' (f : ι → ℕ) (hs) : ((s.sup' hs f : ℕ) : R) = s.sup' hs fun i ↦ (f i : R) :=
25
+ comp_sup'_eq_sup'_comp _ _ cast_max
26
+
27
+ set_option linter.docPrime false in
28
+ @[simp, norm_cast]
29
+ lemma cast_finsetInf' (f : ι → ℕ) (hs) : (↑(s.inf' hs f) : R) = s.inf' hs fun i ↦ (f i : R) :=
30
+ comp_inf'_eq_inf'_comp _ _ cast_min
31
+
32
+ end LinearOrderedSemiring
33
+
34
+ @[simp, norm_cast]
35
+ lemma cast_finsetSup [CanonicallyLinearOrderedSemifield R] (s : Finset ι) (f : ι → ℕ) :
36
+ (↑(s.sup f) : R) = s.sup fun i ↦ (f i : R) :=
37
+ comp_sup_eq_sup_comp _ cast_max (by simp)
38
+
39
+ end Nat
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ theorem ofNat_nonneg {α} [OrderedSemiring α] (n : ℕ) [n.AtLeastTwo] :
37
37
ofNat_nonneg' n
38
38
39
39
@[simp, norm_cast]
40
- theorem cast_min {α} [LinearOrderedSemiring α] {a b : ℕ} : ((min a b : ℕ) : α) = min (a : α) b :=
40
+ theorem cast_min {α} [LinearOrderedSemiring α] (m n : ℕ) : (↑ (min m n : ℕ) : α) = min (m : α) n :=
41
41
(@mono_cast α _).map_min
42
42
43
43
@[simp, norm_cast]
44
- theorem cast_max {α} [LinearOrderedSemiring α] {a b : ℕ} : ((max a b : ℕ) : α) = max (a : α) b :=
44
+ theorem cast_max {α} [LinearOrderedSemiring α] (m n : ℕ) : (↑ (max m n : ℕ) : α) = max (m : α) n :=
45
45
(@mono_cast α _).map_max
46
46
47
47
section Nontrivial
You can’t perform that action at this time.
0 commit comments