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

Commit 61ccaf6

Browse files
urkudmergify[bot]
authored andcommitted
chore(*): fix various issues reported by sanity_check_mathlib (#1469)
* chore(*): fix various issues reported by `sanity_check_mathlib` * Drop a misleading comment, fix the proof
1 parent 65bf45c commit 61ccaf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+90
-83
lines changed

src/algebra/direct_limit.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ namespace direct_limit
195195
variables (f : Π i j, i ≤ j → G i → G j)
196196
variables [Π i j hij, is_add_group_hom (f i j hij)] [directed_system G f]
197197

198-
def directed_system : module.directed_system G (λ i j hij, is_add_group_hom.to_linear_map $ f i j hij) :=
198+
lemma directed_system : module.directed_system G (λ i j hij, is_add_group_hom.to_linear_map $ f i j hij) :=
199199
⟨directed_system.map_self f, directed_system.map_map f⟩
200200

201201
local attribute [instance] directed_system

src/algebra/field.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def mk0 (a : α) (ha : a ≠ 0) : units α :=
3939
@[simp] lemma mk0_coe (u : units α) (h : (u : α) ≠ 0) : mk0 (u : α) h = u :=
4040
units.ext rfl
4141

42-
@[simp] lemma units.mk0_inj {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) :
42+
@[simp] lemma mk0_inj {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) :
4343
units.mk0 a ha = units.mk0 b hb ↔ a = b :=
4444
⟨λ h, by injection h, λ h, units.ext h⟩
4545

src/algebra/group/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ section add_group
140140

141141
local attribute [simp] sub_eq_add_neg
142142

143-
def sub_sub_cancel := @sub_sub_self
144-
145143
@[simp] lemma sub_left_inj : a - b = a - c ↔ b = c :=
146144
(add_left_inj _).trans neg_inj'
147145

@@ -187,6 +185,8 @@ end add_group
187185
section add_comm_group
188186
variables [add_comm_group α] {a b c : α}
189187

188+
lemma sub_sub_cancel (a b : α) : a - (a - b) = b := sub_sub_self a b
189+
190190
lemma sub_eq_neg_add (a b : α) : a - b = -b + a :=
191191
add_comm _ _
192192

src/algebra/group/with_one.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ variables [group α]
187187
@[simp] lemma inv_one : (1 : with_zero α)⁻¹ = 1 :=
188188
show ((1⁻¹ : α) : with_zero α) = 1, by simp [coe_one]
189189

190-
definition with_zero.div (x y : with_zero α) : with_zero α :=
190+
definition div (x y : with_zero α) : with_zero α :=
191191
x * y⁻¹
192192

193193
instance : has_div (with_zero α) := ⟨with_zero.div⟩

src/algebra/ordered_field.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import algebra.ordered_ring algebra.field
88
section linear_ordered_field
99
variables {α : Type*} [linear_ordered_field α] {a b c d : α}
1010

11-
def div_pos := @div_pos_of_pos_of_pos
11+
lemma div_pos : 0 < a → 0 < b → 0 < a / b := div_pos_of_pos_of_pos
1212

1313
lemma inv_pos {a : α} : 0 < a → 0 < a⁻¹ :=
1414
by rw [inv_eq_one_div]; exact div_pos zero_lt_one
@@ -87,7 +87,7 @@ lt_iff_lt_of_le_iff_le (inv_le hb ha)
8787
lemma one_div_lt_one_div (ha : 0 < a) (hb : 0 < b) : 1 / a < 1 / b ↔ b < a :=
8888
lt_iff_lt_of_le_iff_le (one_div_le_one_div hb ha)
8989

90-
def div_nonneg := @div_nonneg_of_nonneg_of_pos
90+
lemma div_nonneg : 0 ≤ a → 0 < b → 0 ≤ a / b := div_nonneg_of_nonneg_of_pos
9191

9292
lemma div_lt_div_right (hc : 0 < c) : a / c < b / c ↔ a < b :=
9393
⟨lt_imp_lt_of_le_imp_le (λ h, div_le_div_of_le_of_pos h hc),
@@ -125,7 +125,7 @@ lemma half_pos {a : α} (h : 0 < a) : 0 < a / 2 := div_pos h two_pos
125125

126126
lemma one_half_pos : (0:α) < 1 / 2 := half_pos zero_lt_one
127127

128-
def half_lt_self := @div_two_lt_of_pos
128+
lemma half_lt_self : 0 < a → a / 2 < a := div_two_lt_of_pos
129129

130130
lemma one_half_lt_one : (1 / 2 : α) < 1 := half_lt_self zero_lt_one
131131

src/algebra/ordered_ring.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ instance to_ordered_ring : ordered_ring α :=
252252
mul_pos := λ a b, by simp [pos_def.symm]; exact mul_pos,
253253
..s }
254254

255-
def nonneg_ring.to_linear_nonneg_ring
255+
def to_linear_nonneg_ring
256256
(nonneg_total : ∀ a : α, nonneg a ∨ nonneg (-a))
257257
: linear_nonneg_ring α :=
258258
{ nonneg_total := nonneg_total,

src/algebra/pointwise.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ def pointwise_mul_monoid [monoid α] : monoid (set α) :=
7575
local attribute [instance] pointwise_mul_monoid
7676

7777
@[to_additive]
78-
def singleton.is_mul_hom [has_mul α] : is_mul_hom (singleton : α → set α) :=
78+
lemma singleton.is_mul_hom [has_mul α] : is_mul_hom (singleton : α → set α) :=
7979
{ map_mul := λ x y, set.ext $ λ a, by simp [mem_singleton_iff, mem_pointwise_mul] }
8080

8181
@[to_additive is_add_monoid_hom]
82-
def singleton.is_monoid_hom [monoid α] : is_monoid_hom (singleton : α → set α) :=
82+
lemma singleton.is_monoid_hom [monoid α] : is_monoid_hom (singleton : α → set α) :=
8383
{ map_one := rfl, ..singleton.is_mul_hom }
8484

8585
@[to_additive]
@@ -212,7 +212,7 @@ end is_mul_hom
212212

213213
variables [monoid α] [monoid β] [is_monoid_hom f]
214214

215-
def pointwise_mul_image_is_semiring_hom : is_semiring_hom (image f) :=
215+
lemma pointwise_mul_image_is_semiring_hom : is_semiring_hom (image f) :=
216216
{ map_zero := image_empty _,
217217
map_one := by erw [image_singleton, is_monoid_hom.map_one f]; refl,
218218
map_add := image_union _,

src/category/monad/cont.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ instance : is_lawful_monad (cont_t r m) :=
7171
pure_bind := by { intros, ext, refl },
7272
bind_assoc := by { intros, ext, refl } }
7373

74-
def cont_t.monad_lift [monad m] {α} : m α → cont_t r m α :=
74+
def monad_lift [monad m] {α} : m α → cont_t r m α :=
7575
λ x f, x >>= f
7676

7777
instance [monad m] : has_monad_lift m (cont_t r m) :=

src/category/traversable/equiv.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ protected lemma comp_map {α β γ : Type u} (g : α → β) (h : β → γ) (x
3333
equiv.map (h ∘ g) x = equiv.map h (equiv.map g x) :=
3434
by simp [equiv.map]; apply comp_map
3535

36-
protected def is_lawful_functor : @is_lawful_functor _ equiv.functor :=
36+
protected lemma is_lawful_functor : @is_lawful_functor _ equiv.functor :=
3737
{ id_map := @equiv.id_map _ _,
3838
comp_map := @equiv.comp_map _ _ }
3939

40-
protected def is_lawful_functor' [F : _root_.functor t']
40+
protected lemma is_lawful_functor' [F : _root_.functor t']
4141
(h₀ : ∀ {α β} (f : α → β), _root_.functor.map f = equiv.map f)
4242
(h₁ : ∀ {α β} (f : β), _root_.functor.map_const f = (equiv.map ∘ function.const α) f) :
4343
_root_.is_lawful_functor t' :=

src/category_theory/natural_isomorphism.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ def of_components (app : ∀ X : C, (F.obj X) ≅ (G.obj X))
9494
F ≅ G :=
9595
as_iso { app := λ X, (app X).hom }
9696

97-
@[simp] def of_components.app (app' : ∀ X : C, (F.obj X) ≅ (G.obj X)) (naturality) (X) :
97+
@[simp] lemma of_components.app (app' : ∀ X : C, (F.obj X) ≅ (G.obj X)) (naturality) (X) :
9898
(of_components app' naturality).app X = app' X :=
9999
by tidy
100-
@[simp] def of_components.hom_app (app : ∀ X : C, (F.obj X) ≅ (G.obj X)) (naturality) (X) :
100+
@[simp] lemma of_components.hom_app (app : ∀ X : C, (F.obj X) ≅ (G.obj X)) (naturality) (X) :
101101
(of_components app naturality).hom.app X = (app X).hom := rfl
102-
@[simp] def of_components.inv_app (app : ∀ X : C, (F.obj X) ≅ (G.obj X)) (naturality) (X) :
102+
@[simp] lemma of_components.inv_app (app : ∀ X : C, (F.obj X) ≅ (G.obj X)) (naturality) (X) :
103103
(of_components app naturality).inv.app X = (app X).inv := rfl
104104

105105
include

0 commit comments

Comments
 (0)