Skip to content

Commit 0eaff36

Browse files
chore(Order): Make more arguments explicit (#11033)
Those lemmas have historically been very annoying to use in `rw` since all their arguments were implicit. One too many people complained about it on Zulip, so I'm changing them. Downstream code broken by this change can fix it by adding appropriately many `_`s. Also marks `CauSeq.ext` `@[ext]`. ## `Order.BoundedOrder` * `top_sup_eq` * `sup_top_eq` * `bot_sup_eq` * `sup_bot_eq` * `top_inf_eq` * `inf_top_eq` * `bot_inf_eq` * `inf_bot_eq` ## `Order.Lattice` * `sup_idem` * `sup_comm` * `sup_assoc` * `sup_left_idem` * `sup_right_idem` * `inf_idem` * `inf_comm` * `inf_assoc` * `inf_left_idem` * `inf_right_idem` * `sup_inf_left` * `sup_inf_right` * `inf_sup_left` * `inf_sup_right` ## `Order.MinMax` * `max_min_distrib_left` * `max_min_distrib_right` * `min_max_distrib_left` * `min_max_distrib_right` Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent 7e0bc5a commit 0eaff36

Some content is hidden

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

46 files changed

+242
-303
lines changed

Mathlib/Algebra/Lie/Subalgebra.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,11 @@ instance completeLattice : CompleteLattice (LieSubalgebra R L) :=
528528
instance addCommMonoid : AddCommMonoid (LieSubalgebra R L)
529529
where
530530
add := (· ⊔ ·)
531-
add_assoc _ _ _ := sup_assoc
531+
add_assoc := sup_assoc
532532
zero := ⊥
533-
zero_add _ := bot_sup_eq
534-
add_zero _ := sup_bot_eq
535-
add_comm _ _ := sup_comm
533+
zero_add := bot_sup_eq
534+
add_zero := sup_bot_eq
535+
add_comm := sup_comm
536536

537537
instance : CanonicallyOrderedAddCommMonoid (LieSubalgebra R L) :=
538538
{ LieSubalgebra.addCommMonoid,

Mathlib/Algebra/Lie/Submodule.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,11 @@ theorem iSup_eq_top_iff_coe_toSubmodule {ι : Type*} {N : ι → LieSubmodule R
558558

559559
instance : AddCommMonoid (LieSubmodule R L M) where
560560
add := (· ⊔ ·)
561-
add_assoc _ _ _ := sup_assoc
561+
add_assoc := sup_assoc
562562
zero := ⊥
563-
zero_add _ := bot_sup_eq
564-
add_zero _ := sup_bot_eq
565-
add_comm _ _ := sup_comm
563+
zero_add := bot_sup_eq
564+
add_zero := sup_bot_eq
565+
add_comm := sup_comm
566566

567567
@[simp]
568568
theorem add_eq_sup : N + N' = N ⊔ N' :=

Mathlib/Algebra/Module/Submodule/Pointwise.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ variable [Semiring R] [AddCommMonoid M] [Module R M]
167167
instance pointwiseAddCommMonoid : AddCommMonoid (Submodule R M)
168168
where
169169
add := (· ⊔ ·)
170-
add_assoc _ _ _ := sup_assoc
170+
add_assoc := sup_assoc
171171
zero := ⊥
172-
zero_add _ := bot_sup_eq
173-
add_zero _ := sup_bot_eq
174-
add_comm _ _ := sup_comm
172+
zero_add := bot_sup_eq
173+
add_zero := sup_bot_eq
174+
add_comm := sup_comm
175175
#align submodule.pointwise_add_comm_monoid Submodule.pointwiseAddCommMonoid
176176

177177
@[simp]

Mathlib/Algebra/Order/CauSeq/Basic.lean

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ theorem mk_to_fun (f) (hf : IsCauSeq abv f) : @coeFn (CauSeq β abv) _ _ ⟨f, h
181181
rfl -/
182182
#noalign cau_seq.mk_to_fun
183183

184-
theorem ext {f g : CauSeq β abv} (h : ∀ i, f i = g i) : f = g :=
185-
Subtype.eq (funext h)
184+
@[ext]
185+
theorem ext {f g : CauSeq β abv} (h : ∀ i, f i = g i) : f = g := Subtype.eq (funext h)
186186
#align cau_seq.ext CauSeq.ext
187187

188188
theorem isCauSeq (f : CauSeq β abv) : IsCauSeq abv f :=
@@ -904,21 +904,17 @@ protected theorem lt_inf {a b c : CauSeq α abs} (hb : a < b) (hc : a < c) : a <
904904
#align cau_seq.lt_inf CauSeq.lt_inf
905905

906906
@[simp]
907-
protected theorem sup_idem (a : CauSeq α abs) : a ⊔ a = a :=
908-
Subtype.ext sup_idem
907+
protected theorem sup_idem (a : CauSeq α abs) : a ⊔ a = a := Subtype.ext (sup_idem _)
909908
#align cau_seq.sup_idem CauSeq.sup_idem
910909

911910
@[simp]
912-
protected theorem inf_idem (a : CauSeq α abs) : a ⊓ a = a :=
913-
Subtype.ext inf_idem
911+
protected theorem inf_idem (a : CauSeq α abs) : a ⊓ a = a := Subtype.ext (inf_idem _)
914912
#align cau_seq.inf_idem CauSeq.inf_idem
915913

916-
protected theorem sup_comm (a b : CauSeq α abs) : a ⊔ b = b ⊔ a :=
917-
Subtype.ext sup_comm
914+
protected theorem sup_comm (a b : CauSeq α abs) : a ⊔ b = b ⊔ a := Subtype.ext (sup_comm _ _)
918915
#align cau_seq.sup_comm CauSeq.sup_comm
919916

920-
protected theorem inf_comm (a b : CauSeq α abs) : a ⊓ b = b ⊓ a :=
921-
Subtype.ext inf_comm
917+
protected theorem inf_comm (a b : CauSeq α abs) : a ⊓ b = b ⊓ a := Subtype.ext (inf_comm _ _)
922918
#align cau_seq.inf_comm CauSeq.inf_comm
923919

924920
protected theorem sup_eq_right {a b : CauSeq α abs} (h : a ≤ b) : a ⊔ b ≈ b := by
@@ -998,11 +994,11 @@ protected theorem le_inf {a b c : CauSeq α abs} (hb : a ≤ b) (hc : a ≤ c) :
998994

999995

1000996
protected theorem sup_inf_distrib_left (a b c : CauSeq α abs) : a ⊔ b ⊓ c = (a ⊔ b) ⊓ (a ⊔ c) :=
1001-
Subtype.ext <| funext fun _ => max_min_distrib_left
997+
ext fun _ max_min_distrib_left _ _ _
1002998
#align cau_seq.sup_inf_distrib_left CauSeq.sup_inf_distrib_left
1003999

10041000
protected theorem sup_inf_distrib_right (a b c : CauSeq α abs) : a ⊓ b ⊔ c = (a ⊔ c) ⊓ (b ⊔ c) :=
1005-
Subtype.ext <| funext fun _ => max_min_distrib_right
1001+
ext fun _ max_min_distrib_right _ _ _
10061002
#align cau_seq.sup_inf_distrib_right CauSeq.sup_inf_distrib_right
10071003

10081004
end Abs

Mathlib/Algebra/Order/Group/Abs.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ lemma mabs_div_sup_mul_mabs_div_inf [CovariantClass α α (· * ·) (· ≤ ·)]
193193
_ = (b ⊔ c ⊔ (a ⊔ c)) / ((b ⊔ c) ⊓ (a ⊔ c)) * ((b ⊓ c ⊔ a ⊓ c) / (b ⊓ c ⊓ (a ⊓ c))) := by
194194
rw [sup_div_inf_eq_mabs_div (b ⊓ c) (a ⊓ c)]
195195
_ = (b ⊔ a ⊔ c) / (b ⊓ a ⊔ c) * (((b ⊔ a) ⊓ c) / (b ⊓ a ⊓ c)) := by
196-
rw [← sup_inf_right, ← inf_sup_right, sup_assoc, @sup_comm _ _ c (a ⊔ c), sup_right_idem,
197-
sup_assoc, inf_assoc, @inf_comm _ _ c (a ⊓ c), inf_right_idem, inf_assoc]
196+
rw [← sup_inf_right, ← inf_sup_right, sup_assoc, sup_comm c (a ⊔ c), sup_right_idem,
197+
sup_assoc, inf_assoc, inf_comm c (a ⊓ c), inf_right_idem, inf_assoc]
198198
_ = (b ⊔ a ⊔ c) * ((b ⊔ a) ⊓ c) / ((b ⊓ a ⊔ c) * (b ⊓ a ⊓ c)) := by rw [div_mul_div_comm]
199199
_ = (b ⊔ a) * c / ((b ⊓ a) * c) := by
200200
rw [mul_comm, inf_mul_sup, mul_comm (b ⊓ a ⊔ c), inf_mul_sup]

Mathlib/Algebra/Order/Group/PosPart.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def leOnePart (a : α) : α := a⁻¹ ⊔ 1
9292
@[to_additive] lemma leOnePart_anti : Antitone (leOnePart : α → α) :=
9393
fun _a _b hab ↦ sup_le_sup_right (inv_le_inv_iff.2 hab) _
9494

95-
@[to_additive (attr := simp)] lemma oneLePart_one : (1 : α)⁺ᵐ = 1 := sup_idem
95+
@[to_additive (attr := simp)] lemma oneLePart_one : (1 : α)⁺ᵐ = 1 := sup_idem _
9696
#align lattice_ordered_comm_group.pos_one oneLePart_one
9797
#align lattice_ordered_comm_group.pos_zero posPart_zero
9898

@@ -186,7 +186,7 @@ lemma oneLePart_mul_leOnePart
186186
[CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (a : α) :
187187
a⁺ᵐ * a⁻ᵐ = |a|ₘ := by
188188
rw [oneLePart, sup_mul, one_mul, leOnePart, mul_sup, mul_one, mul_inv_self, sup_assoc,
189-
@sup_assoc _ _ a, sup_eq_right.2 le_sup_right]
189+
← sup_assoc a, sup_eq_right.2 le_sup_right]
190190
exact sup_eq_left.2 <| one_le_mabs a
191191
#align lattice_ordered_comm_group.pos_mul_neg oneLePart_mul_leOnePart
192192
#align lattice_ordered_comm_group.pos_add_neg posPart_add_negPart

Mathlib/Algebra/Order/Support.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ variable [One M]
2424
@[to_additive]
2525
lemma mulSupport_sup [SemilatticeSup M] (f g : α → M) :
2626
mulSupport (fun x ↦ f x ⊔ g x) ⊆ mulSupport f ∪ mulSupport g :=
27-
mulSupport_binop_subset (· ⊔ ·) sup_idem f g
27+
mulSupport_binop_subset (· ⊔ ·) (sup_idem _) f g
2828
#align function.mul_support_sup Function.mulSupport_sup
2929
#align function.support_sup Function.support_sup
3030

3131
@[to_additive]
3232
lemma mulSupport_inf [SemilatticeInf M] (f g : α → M) :
3333
mulSupport (fun x ↦ f x ⊓ g x) ⊆ mulSupport f ∪ mulSupport g :=
34-
mulSupport_binop_subset (· ⊓ ·) inf_idem f g
34+
mulSupport_binop_subset (· ⊓ ·) (inf_idem _) f g
3535
#align function.mul_support_inf Function.mulSupport_inf
3636
#align function.support_inf Function.support_inf
3737

Mathlib/Algebra/Ring/BooleanRing.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,14 @@ def GeneralizedBooleanAlgebra.toNonUnitalCommRing [GeneralizedBooleanAlgebra α]
442442
zero := ⊥
443443
zero_add := bot_symmDiff
444444
add_zero := symmDiff_bot
445-
zero_mul _ := bot_inf_eq
446-
mul_zero _ := inf_bot_eq
445+
zero_mul := bot_inf_eq
446+
mul_zero := inf_bot_eq
447447
neg := id
448448
add_left_neg := symmDiff_self
449449
add_comm := symmDiff_comm
450450
mul := (· ⊓ ·)
451-
mul_assoc _ _ _ := inf_assoc
452-
mul_comm _ _ := inf_comm
451+
mul_assoc := inf_assoc
452+
mul_comm := inf_comm
453453
left_distrib := inf_symmDiff_distrib_left
454454
right_distrib := inf_symmDiff_distrib_right
455455
#align generalized_boolean_algebra.to_non_unital_comm_ring GeneralizedBooleanAlgebra.toNonUnitalCommRing
@@ -469,12 +469,12 @@ variable [BooleanAlgebra α] [BooleanAlgebra β] [BooleanAlgebra γ]
469469
* `1` unfolds to `⊤`
470470
-/
471471
@[reducible]
472-
def BooleanAlgebra.toBooleanRing : BooleanRing α :=
473-
{ GeneralizedBooleanAlgebra.toNonUnitalCommRing with
474-
one := ⊤
475-
one_mul := fun _ => top_inf_eq
476-
mul_one := fun _ => inf_top_eq
477-
mul_self := fun b => inf_idem }
472+
def BooleanAlgebra.toBooleanRing : BooleanRing α where
473+
__ := GeneralizedBooleanAlgebra.toNonUnitalCommRing
474+
one := ⊤
475+
one_mul := top_inf_eq
476+
mul_one := inf_top_eq
477+
mul_self := inf_idem
478478
#align boolean_algebra.to_boolean_ring BooleanAlgebra.toBooleanRing
479479

480480
scoped[BooleanRingOfBooleanAlgebra]

Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ lemma XYIdeal_mul_XYIdeal {x₁ x₂ y₁ y₂ : F} (h₁ : W.equation x₁ y₁
266266
XYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
267267
(C <| W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) := by
268268
have sup_rw : ∀ a b c d : Ideal W.CoordinateRing, a ⊔ (b ⊔ (c ⊔ d)) = a ⊔ d ⊔ b ⊔ c :=
269-
fun _ _ c _ => by rw [← sup_assoc, @sup_comm _ _ c, sup_sup_sup_comm, ← sup_assoc]
269+
fun _ _ c _ => by rw [← sup_assoc, sup_comm c, sup_sup_sup_comm, ← sup_assoc]
270270
rw [XYIdeal_add_eq, XIdeal, mul_comm, XYIdeal_eq₁ W x₁ y₁ <| W.slope x₁ x₂ y₁ y₂, XYIdeal,
271271
XYIdeal_eq₂ h₁ h₂ hxy, XYIdeal, span_pair_mul_span_pair]
272272
simp_rw [span_insert, sup_rw, Ideal.sup_mul, span_singleton_mul_span_singleton]

Mathlib/AlgebraicGeometry/Properties.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ theorem eq_zero_of_basicOpen_eq_bot {X : Scheme} [hX : IsReduced X] {U : Opens X
165165
specialize H (X.presheaf.map i.op s)
166166
erw [Scheme.basicOpen_res] at H
167167
rw [hs] at H
168-
specialize H inf_bot_eq ⟨x, hx⟩
168+
specialize H (inf_bot_eq _) ⟨x, hx⟩
169169
erw [TopCat.Presheaf.germ_res_apply] at H
170170
exact H
171171
· rintro X Y f hf

0 commit comments

Comments
 (0)