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

Commit 5816424

Browse files
committed
refactor(*): use 'lemma' iff statement is private
1 parent b9f1d64 commit 5816424

39 files changed

+931
-931
lines changed

algebra/lattice/basic.lean

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ section
2020
variable {α : Type u}
2121

2222
-- TODO: this seems crazy, but it also seems to work reasonably well
23-
@[ematch] lemma le_antisymm' [weak_order α] : ∀ {a b : α}, (: a ≤ b :) → b ≤ a → a = b :=
23+
@[ematch] theorem le_antisymm' [weak_order α] : ∀ {a b : α}, (: a ≤ b :) → b ≤ a → a = b :=
2424
weak_order.le_antisymm
2525
end
2626

@@ -47,17 +47,17 @@ class order_top (α : Type u) extends has_top α, weak_order α :=
4747
section order_top
4848
variables {α : Type u} [order_top α] {a : α}
4949

50-
@[simp] lemma le_top : a ≤ ⊤ :=
50+
@[simp] theorem le_top : a ≤ ⊤ :=
5151
order_top.le_top a
5252

53-
lemma top_unique (h : ⊤ ≤ a) : a = ⊤ :=
53+
theorem top_unique (h : ⊤ ≤ a) : a = ⊤ :=
5454
le_antisymm le_top h
5555

5656
-- TODO: delete in favor of the next?
57-
lemma eq_top_iff : a = ⊤ ↔ ⊤ ≤ a :=
57+
theorem eq_top_iff : a = ⊤ ↔ ⊤ ≤ a :=
5858
⟨assume eq, eq.symm ▸ le_refl ⊤, top_unique⟩
5959

60-
@[simp] lemma top_le_iff : ⊤ ≤ a ↔ a = ⊤ :=
60+
@[simp] theorem top_le_iff : ⊤ ≤ a ↔ a = ⊤ :=
6161
⟨top_unique, λ h, h.symm ▸ le_refl ⊤⟩
6262

6363
end order_top
@@ -68,19 +68,19 @@ class order_bot (α : Type u) extends has_bot α, weak_order α :=
6868
section order_bot
6969
variables {α : Type u} [order_bot α] {a : α}
7070

71-
@[simp] lemma bot_le : ⊥ ≤ a := order_bot.bot_le a
71+
@[simp] theorem bot_le : ⊥ ≤ a := order_bot.bot_le a
7272

73-
lemma bot_unique (h : a ≤ ⊥) : a = ⊥ :=
73+
theorem bot_unique (h : a ≤ ⊥) : a = ⊥ :=
7474
le_antisymm h bot_le
7575

7676
-- TODO: delete?
77-
lemma eq_bot_iff : a = ⊥ ↔ a ≤ ⊥ :=
77+
theorem eq_bot_iff : a = ⊥ ↔ a ≤ ⊥ :=
7878
⟨assume eq, eq.symm ▸ le_refl ⊥, bot_unique⟩
7979

80-
@[simp] lemma le_bot_iff : a ≤ ⊥ ↔ a = ⊥ :=
80+
@[simp] theorem le_bot_iff : a ≤ ⊥ ↔ a = ⊥ :=
8181
⟨bot_unique, assume h, h.symm ▸ le_refl ⊥⟩
8282

83-
lemma neq_bot_of_le_neq_bot {a b : α} (hb : b ≠ ⊥) (hab : b ≤ a) : a ≠ ⊥ :=
83+
theorem neq_bot_of_le_neq_bot {a b : α} (hb : b ≠ ⊥) (hab : b ≤ a) : a ≠ ⊥ :=
8484
assume ha, hb $ bot_unique $ ha ▸ hab
8585

8686
end order_bot
@@ -93,55 +93,55 @@ class semilattice_sup (α : Type u) extends has_sup α, weak_order α :=
9393
section semilattice_sup
9494
variables {α : Type u} [semilattice_sup α] {a b c d : α}
9595

96-
lemma le_sup_left : a ≤ a ⊔ b :=
96+
theorem le_sup_left : a ≤ a ⊔ b :=
9797
semilattice_sup.le_sup_left a b
9898

99-
@[ematch] lemma le_sup_left' : a ≤ (: a ⊔ b :) :=
99+
@[ematch] theorem le_sup_left' : a ≤ (: a ⊔ b :) :=
100100
semilattice_sup.le_sup_left a b
101101

102-
lemma le_sup_right : b ≤ a ⊔ b :=
102+
theorem le_sup_right : b ≤ a ⊔ b :=
103103
semilattice_sup.le_sup_right a b
104104

105-
@[ematch] lemma le_sup_right' : b ≤ (: a ⊔ b :) :=
105+
@[ematch] theorem le_sup_right' : b ≤ (: a ⊔ b :) :=
106106
semilattice_sup.le_sup_right a b
107107

108-
lemma le_sup_left_of_le (h : c ≤ a) : c ≤ a ⊔ b :=
108+
theorem le_sup_left_of_le (h : c ≤ a) : c ≤ a ⊔ b :=
109109
by finish
110110

111-
lemma le_sup_right_of_le (h : c ≤ b) : c ≤ a ⊔ b :=
111+
theorem le_sup_right_of_le (h : c ≤ b) : c ≤ a ⊔ b :=
112112
by finish
113113

114-
lemma sup_le : a ≤ c → b ≤ c → a ⊔ b ≤ c :=
114+
theorem sup_le : a ≤ c → b ≤ c → a ⊔ b ≤ c :=
115115
semilattice_sup.sup_le a b c
116116

117-
@[simp] lemma sup_le_iff : a ⊔ b ≤ c ↔ a ≤ c ∧ b ≤ c :=
117+
@[simp] theorem sup_le_iff : a ⊔ b ≤ c ↔ a ≤ c ∧ b ≤ c :=
118118
⟨assume h : a ⊔ b ≤ c, ⟨le_trans le_sup_left h, le_trans le_sup_right h⟩,
119119
assume ⟨h₁, h₂⟩, sup_le h₁ h₂⟩
120120

121121
-- TODO: if we just write le_antisymm, Lean doesn't know which ≤ we want to use
122122
-- Can we do anything about that?
123-
lemma sup_of_le_left (h : b ≤ a) : a ⊔ b = a :=
123+
theorem sup_of_le_left (h : b ≤ a) : a ⊔ b = a :=
124124
by apply le_antisymm; finish
125125

126-
lemma sup_of_le_right (h : a ≤ b) : a ⊔ b = b :=
126+
theorem sup_of_le_right (h : a ≤ b) : a ⊔ b = b :=
127127
by apply le_antisymm; finish
128128

129-
lemma sup_le_sup (h₁ : a ≤ b) (h₂ : c ≤ d) : a ⊔ c ≤ b ⊔ d :=
129+
theorem sup_le_sup (h₁ : a ≤ b) (h₂ : c ≤ d) : a ⊔ c ≤ b ⊔ d :=
130130
by finish
131131

132-
lemma le_of_sup_eq (h : a ⊔ b = b) : a ≤ b :=
132+
theorem le_of_sup_eq (h : a ⊔ b = b) : a ≤ b :=
133133
by finish
134134

135-
@[simp] lemma sup_idem : a ⊔ a = a :=
135+
@[simp] theorem sup_idem : a ⊔ a = a :=
136136
by apply le_antisymm; finish
137137

138-
lemma sup_comm : a ⊔ b = b ⊔ a :=
138+
theorem sup_comm : a ⊔ b = b ⊔ a :=
139139
by apply le_antisymm; finish
140140

141141
instance semilattice_sup_to_is_commutative [semilattice_sup α] : is_commutative α (⊔) :=
142142
⟨@sup_comm _ _⟩
143143

144-
lemma sup_assoc : a ⊔ b ⊔ c = a ⊔ (b ⊔ c) :=
144+
theorem sup_assoc : a ⊔ b ⊔ c = a ⊔ (b ⊔ c) :=
145145
by apply le_antisymm; finish
146146

147147
instance semilattice_sup_to_is_associative [semilattice_sup α] : is_associative α (⊔) :=
@@ -157,53 +157,53 @@ class semilattice_inf (α : Type u) extends has_inf α, weak_order α :=
157157
section semilattice_inf
158158
variables {α : Type u} [semilattice_inf α] {a b c d : α}
159159

160-
lemma inf_le_left : a ⊓ b ≤ a :=
160+
theorem inf_le_left : a ⊓ b ≤ a :=
161161
semilattice_inf.inf_le_left a b
162162

163-
@[ematch] lemma inf_le_left' : (: a ⊓ b :) ≤ a :=
163+
@[ematch] theorem inf_le_left' : (: a ⊓ b :) ≤ a :=
164164
semilattice_inf.inf_le_left a b
165165

166-
lemma inf_le_right : a ⊓ b ≤ b :=
166+
theorem inf_le_right : a ⊓ b ≤ b :=
167167
semilattice_inf.inf_le_right a b
168168

169-
@[ematch] lemma inf_le_right' : (: a ⊓ b :) ≤ b :=
169+
@[ematch] theorem inf_le_right' : (: a ⊓ b :) ≤ b :=
170170
semilattice_inf.inf_le_right a b
171171

172-
lemma le_inf : a ≤ b → a ≤ c → a ≤ b ⊓ c :=
172+
theorem le_inf : a ≤ b → a ≤ c → a ≤ b ⊓ c :=
173173
semilattice_inf.le_inf a b c
174174

175-
lemma inf_le_left_of_le (h : a ≤ c) : a ⊓ b ≤ c :=
175+
theorem inf_le_left_of_le (h : a ≤ c) : a ⊓ b ≤ c :=
176176
le_trans inf_le_left h
177177

178-
lemma inf_le_right_of_le (h : b ≤ c) : a ⊓ b ≤ c :=
178+
theorem inf_le_right_of_le (h : b ≤ c) : a ⊓ b ≤ c :=
179179
le_trans inf_le_right h
180180

181-
@[simp] lemma le_inf_iff : a ≤ b ⊓ c ↔ a ≤ b ∧ a ≤ c :=
181+
@[simp] theorem le_inf_iff : a ≤ b ⊓ c ↔ a ≤ b ∧ a ≤ c :=
182182
⟨assume h : a ≤ b ⊓ c, ⟨le_trans h inf_le_left, le_trans h inf_le_right⟩,
183183
assume ⟨h₁, h₂⟩, le_inf h₁ h₂⟩
184184

185-
lemma inf_of_le_left (h : a ≤ b) : a ⊓ b = a :=
185+
theorem inf_of_le_left (h : a ≤ b) : a ⊓ b = a :=
186186
by apply le_antisymm; finish
187187

188-
lemma inf_of_le_right (h : b ≤ a) : a ⊓ b = b :=
188+
theorem inf_of_le_right (h : b ≤ a) : a ⊓ b = b :=
189189
by apply le_antisymm; finish
190190

191-
lemma inf_le_inf (h₁ : a ≤ b) (h₂ : c ≤ d) : a ⊓ c ≤ b ⊓ d :=
191+
theorem inf_le_inf (h₁ : a ≤ b) (h₂ : c ≤ d) : a ⊓ c ≤ b ⊓ d :=
192192
by finish
193193

194-
lemma le_of_inf_eq (h : a ⊓ b = a) : a ≤ b :=
194+
theorem le_of_inf_eq (h : a ⊓ b = a) : a ≤ b :=
195195
by finish
196196

197-
@[simp] lemma inf_idem : a ⊓ a = a :=
197+
@[simp] theorem inf_idem : a ⊓ a = a :=
198198
by apply le_antisymm; finish
199199

200-
lemma inf_comm : a ⊓ b = b ⊓ a :=
200+
theorem inf_comm : a ⊓ b = b ⊓ a :=
201201
by apply le_antisymm; finish
202202

203203
instance semilattice_inf_to_is_commutative [semilattice_inf α] : is_commutative α (⊓) :=
204204
⟨@inf_comm _ _⟩
205205

206-
lemma inf_assoc : a ⊓ b ⊓ c = a ⊓ (b ⊓ c) :=
206+
theorem inf_assoc : a ⊓ b ⊓ c = a ⊓ (b ⊓ c) :=
207207
by apply le_antisymm; finish
208208

209209
instance semilattice_inf_to_is_associative [semilattice_inf α] : is_associative α (⊓) :=
@@ -216,10 +216,10 @@ class semilattice_sup_top (α : Type u) extends order_top α, semilattice_sup α
216216
section semilattice_sup_top
217217
variables {α : Type u} [semilattice_sup_top α] {a : α}
218218

219-
@[simp] lemma top_sup_eq : ⊤ ⊔ a = ⊤ :=
219+
@[simp] theorem top_sup_eq : ⊤ ⊔ a = ⊤ :=
220220
sup_of_le_left le_top
221221

222-
@[simp] lemma sup_top_eq : a ⊔ ⊤ = ⊤ :=
222+
@[simp] theorem sup_top_eq : a ⊔ ⊤ = ⊤ :=
223223
sup_of_le_right le_top
224224

225225
end semilattice_sup_top
@@ -229,13 +229,13 @@ class semilattice_sup_bot (α : Type u) extends order_bot α, semilattice_sup α
229229
section semilattice_sup_bot
230230
variables {α : Type u} [semilattice_sup_bot α] {a b : α}
231231

232-
@[simp] lemma bot_sup_eq : ⊥ ⊔ a = a :=
232+
@[simp] theorem bot_sup_eq : ⊥ ⊔ a = a :=
233233
sup_of_le_right bot_le
234234

235-
@[simp] lemma sup_bot_eq : a ⊔ ⊥ = a :=
235+
@[simp] theorem sup_bot_eq : a ⊔ ⊥ = a :=
236236
sup_of_le_left bot_le
237237

238-
@[simp] lemma sup_eq_bot_iff : a ⊔ b = ⊥ ↔ (a = ⊥ ∧ b = ⊥) :=
238+
@[simp] theorem sup_eq_bot_iff : a ⊔ b = ⊥ ↔ (a = ⊥ ∧ b = ⊥) :=
239239
by rw [eq_bot_iff, sup_le_iff]; simp
240240

241241
end semilattice_sup_bot
@@ -245,13 +245,13 @@ class semilattice_inf_top (α : Type u) extends order_top α, semilattice_inf α
245245
section semilattice_inf_top
246246
variables {α : Type u} [semilattice_inf_top α] {a b : α}
247247

248-
@[simp] lemma top_inf_eq : ⊤ ⊓ a = a :=
248+
@[simp] theorem top_inf_eq : ⊤ ⊓ a = a :=
249249
inf_of_le_right le_top
250250

251-
@[simp] lemma inf_top_eq : a ⊓ ⊤ = a :=
251+
@[simp] theorem inf_top_eq : a ⊓ ⊤ = a :=
252252
inf_of_le_left le_top
253253

254-
@[simp] lemma inf_eq_top_iff : a ⊓ b = ⊤ ↔ (a = ⊤ ∧ b = ⊤) :=
254+
@[simp] theorem inf_eq_top_iff : a ⊓ b = ⊤ ↔ (a = ⊤ ∧ b = ⊤) :=
255255
by rw [eq_top_iff, le_inf_iff]; simp
256256

257257
end semilattice_inf_top
@@ -261,10 +261,10 @@ class semilattice_inf_bot (α : Type u) extends order_bot α, semilattice_inf α
261261
section semilattice_inf_bot
262262
variables {α : Type u} [semilattice_inf_bot α] {a : α}
263263

264-
@[simp] lemma bot_inf_eq : ⊥ ⊓ a = ⊥ :=
264+
@[simp] theorem bot_inf_eq : ⊥ ⊓ a = ⊥ :=
265265
inf_of_le_left bot_le
266266

267-
@[simp] lemma inf_bot_eq : a ⊓ ⊥ = ⊥ :=
267+
@[simp] theorem inf_bot_eq : a ⊓ ⊥ = ⊥ :=
268268
inf_of_le_right bot_le
269269

270270
end semilattice_inf_bot
@@ -278,16 +278,16 @@ variables {α : Type u} [lattice α] {a b c d : α}
278278

279279
/- Distributivity laws -/
280280
/- TODO: better names? -/
281-
lemma sup_inf_le : a ⊔ (b ⊓ c) ≤ (a ⊔ b) ⊓ (a ⊔ c) :=
281+
theorem sup_inf_le : a ⊔ (b ⊓ c) ≤ (a ⊔ b) ⊓ (a ⊔ c) :=
282282
by finish
283283

284-
lemma le_inf_sup : (a ⊓ b) ⊔ (a ⊓ c) ≤ a ⊓ (b ⊔ c) :=
284+
theorem le_inf_sup : (a ⊓ b) ⊔ (a ⊓ c) ≤ a ⊓ (b ⊔ c) :=
285285
by finish
286286

287-
lemma inf_sup_self : a ⊓ (a ⊔ b) = a :=
287+
theorem inf_sup_self : a ⊓ (a ⊔ b) = a :=
288288
le_antisymm (by finish) (by finish)
289289

290-
lemma sup_inf_self : a ⊔ (a ⊓ b) = a :=
290+
theorem sup_inf_self : a ⊔ (a ⊓ b) = a :=
291291
le_antisymm (by finish) (by finish)
292292

293293
end lattice

0 commit comments

Comments
 (0)