-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathCard.lean
More file actions
114 lines (78 loc) · 2.81 KB
/
Copy pathCard.lean
File metadata and controls
114 lines (78 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/-
Copyright (c) 2026 Snir Broshi. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Snir Broshi
-/
module
public import Mathlib.Data.Set.Card
public import Mathlib.Order.Interval.Finset.Defs
/-!
# Cardinalities of intervals
Cardinalities of intervals can be computed using finsets in locally finite orders.
-/
public section
open Finset
variable {α : Type*}
section Preorder
variable [Preorder α]
section LocallyFiniteOrder
variable [LocallyFiniteOrder α]
@[to_dual self]
theorem Set.cardinalMk_Icc (a b : α) : Cardinal.mk (Set.Icc a b) = #(Finset.Icc a b) := by
simp
@[to_dual self]
theorem Set.encard_Icc (a b : α) : (Set.Icc a b).encard = #(Finset.Icc a b) := by
simp [← Finset.coe_Icc]
@[to_dual self]
theorem Set.ncard_Icc (a b : α) : (Set.Icc a b).ncard = #(Finset.Icc a b) := by
simp [← Finset.coe_Icc]
@[to_dual (reorder := a b)]
theorem Set.cardinalMk_Ico (a b : α) : Cardinal.mk (Set.Ico a b) = #(Finset.Ico a b) := by
simp
@[to_dual (reorder := a b)]
theorem Set.encard_Ico (a b : α) : (Set.Ico a b).encard = #(Finset.Ico a b) := by
simp [← Finset.coe_Ico]
@[to_dual (reorder := a b)]
theorem Set.ncard_Ico (a b : α) : (Set.Ico a b).ncard = #(Finset.Ico a b) := by
simp [← Finset.coe_Ico]
@[to_dual self]
theorem Set.cardinalMk_Ioo (a b : α) : Cardinal.mk (Set.Ioo a b) = #(Finset.Ioo a b) := by
simp
@[to_dual self]
theorem Set.encard_Ioo (a b : α) : (Set.Ioo a b).encard = #(Finset.Ioo a b) := by
simp [← Finset.coe_Ioo]
@[to_dual self]
theorem Set.ncard_Ioo (a b : α) : (Set.Ioo a b).ncard = #(Finset.Ioo a b) := by
simp [← Finset.coe_Ioo]
end LocallyFiniteOrder
section LocallyFiniteOrderTop
variable [LocallyFiniteOrderTop α]
@[to_dual]
theorem Set.cardinalMk_Ici (a : α) : Cardinal.mk (Set.Ici a) = #(Finset.Ici a) := by
simp
@[to_dual]
theorem Set.encard_Ici (a : α) : (Set.Ici a).encard = #(Finset.Ici a) := by
simp [← Finset.coe_Ici]
@[to_dual]
theorem Set.ncard_Ici (a : α) : (Set.Ici a).ncard = #(Finset.Ici a) := by
simp [← Finset.coe_Ici]
@[to_dual]
theorem Set.cardinalMk_Ioi (a : α) : Cardinal.mk (Set.Ioi a) = #(Finset.Ioi a) := by
simp
@[to_dual]
theorem Set.encard_Ioi (a : α) : (Set.Ioi a).encard = #(Finset.Ioi a) := by
simp [← Finset.coe_Ioi]
@[to_dual]
theorem Set.ncard_Ioi (a : α) : (Set.Ioi a).ncard = #(Finset.Ioi a) := by
simp [← Finset.coe_Ioi]
end LocallyFiniteOrderTop
end Preorder
section Lattice
variable [Lattice α] [LocallyFiniteOrder α]
theorem Set.cardinalMk_uIcc (a b : α) : Cardinal.mk (Set.uIcc a b) = #(Finset.uIcc a b) := by
simp
theorem Set.encard_uIcc (a b : α) : (Set.uIcc a b).encard = #(Finset.uIcc a b) := by
simp [← Finset.coe_uIcc]
theorem Set.ncard_uIcc (a b : α) : (Set.uIcc a b).ncard = #(Finset.uIcc a b) := by
simp [← Finset.coe_uIcc]
end Lattice