Skip to content

Commit 294458c

Browse files
committed
chore(*): rename some defs to camelCase (#19795)
1 parent 31530f3 commit 294458c

File tree

6 files changed

+47
-18
lines changed

6 files changed

+47
-18
lines changed

Mathlib/CategoryTheory/Monoidal/Bimon_.lean

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,20 @@ def trivial : Bimon_ C := Comon_.trivial (Mon_ C)
157157

158158
/-- The bimonoid morphism from the trivial bimonoid to any bimonoid. -/
159159
@[simps]
160-
def trivial_to (A : Bimon_ C) : trivial C ⟶ A :=
160+
def trivialTo (A : Bimon_ C) : trivial C ⟶ A :=
161161
{ hom := (default : Mon_.trivial C ⟶ A.X), }
162162

163+
@[deprecated (since := "2024-12-07")] alias trivial_to := trivialTo
164+
@[deprecated (since := "2024-12-07")] alias trivial_to_hom := trivialTo_hom
165+
163166
/-- The bimonoid morphism from any bimonoid to the trivial bimonoid. -/
164167
@[simps!]
165-
def to_trivial (A : Bimon_ C) : A ⟶ trivial C :=
168+
def toTrivial (A : Bimon_ C) : A ⟶ trivial C :=
166169
(default : @Quiver.Hom (Comon_ (Mon_ C)) _ A (Comon_.trivial (Mon_ C)))
167170

171+
@[deprecated (since := "2024-12-07")] alias to_trivial := toTrivial
172+
@[deprecated (since := "2024-12-07")] alias to_trivial_hom := toTrivial_hom
173+
168174
/-! # Additional lemmas -/
169175

170176
variable {C}

Mathlib/Data/Set/Lattice.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,12 @@ theorem sUnion_powerset_gc :
924924
gc_sSup_Iic
925925

926926
/-- `⋃₀` and `𝒫` form a Galois insertion. -/
927-
def sUnion_powerset_gi :
927+
def sUnionPowersetGI :
928928
GaloisInsertion (⋃₀ · : Set (Set α) → Set α) (𝒫 · : Set α → Set (Set α)) :=
929929
gi_sSup_Iic
930930

931+
@[deprecated (since := "2024-12-07")] alias sUnion_powerset_gi := sUnionPowersetGI
932+
931933
/-- If all sets in a collection are either `∅` or `Set.univ`, then so is their union. -/
932934
theorem sUnion_mem_empty_univ {S : Set (Set α)} (h : S ⊆ {∅, univ}) :
933935
⋃₀ S ∈ ({∅, univ} : Set (Set α)) := by

Mathlib/LinearAlgebra/FreeProduct/Basic.lean

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ universe uS uA uB
6868
then their quotients are also `R`-equivalent.
6969
7070
(Special case of the third isomorphism theorem.)-/
71-
def algEquiv_quot_algEquiv
71+
def algEquivQuotAlgEquiv
7272
{R : Type u} [CommSemiring R] {A B : Type v} [Semiring A] [Semiring B]
7373
[Algebra R A] [Algebra R B] (f : A ≃ₐ[R] B) (rel : A → A → Prop) :
7474
RingQuot rel ≃ₐ[R] RingQuot (rel on f.symm) :=
@@ -83,16 +83,20 @@ def algEquiv_quot_algEquiv
8383
fun x y h ↦ by apply RingQuot.mkAlgHom_rel; simpa⟩))
8484
(by ext b; simp) (by ext a; simp)
8585

86+
@[deprecated (since := "2024-12-07")] alias algEquiv_quot_algEquiv := algEquivQuotAlgEquiv
87+
8688
/--If two (semi)rings are equivalent and their quotients by a relation `rel` are defined,
8789
then their quotients are also equivalent.
8890
8991
(Special case of `algEquiv_quot_algEquiv` when `R = ℕ`, which in turn is a special
9092
case of the third isomorphism theorem.)-/
91-
def equiv_quot_equiv {A B : Type v} [Semiring A] [Semiring B] (f : A ≃+* B) (rel : A → A → Prop) :
93+
def equivQuotEquiv {A B : Type v} [Semiring A] [Semiring B] (f : A ≃+* B) (rel : A → A → Prop) :
9294
RingQuot rel ≃+* RingQuot (rel on f.symm) :=
9395
let f_alg : A ≃ₐ[ℕ] B :=
9496
AlgEquiv.ofRingEquiv (f := f) (fun n ↦ by simp)
95-
algEquiv_quot_algEquiv f_alg rel |>.toRingEquiv
97+
algEquivQuotAlgEquiv f_alg rel |>.toRingEquiv
98+
99+
@[deprecated (since := "2024-12-07")] alias equiv_quot_equiv := equivQuotEquiv
96100

97101
end RingQuot
98102

@@ -143,11 +147,14 @@ theorem rel_id (i : I) : rel R A (ι R <| lof R I A i 1) 1 := rel.id
143147
@[reducible] def _root_.LinearAlgebra.FreeProduct := RingQuot <| FreeProduct.rel R A
144148

145149
/--The free product of the collection of `R`-algebras `A i`, as a quotient of `PowerAlgebra R A`-/
146-
@[reducible] def _root_.LinearAlgebra.FreeProduct_ofPowers := RingQuot <| FreeProduct.rel' R A
150+
@[reducible] def _root_.LinearAlgebra.FreeProductOfPowers := RingQuot <| FreeProduct.rel' R A
151+
152+
@[deprecated (since := "2024-12-07")]
153+
alias _root_.LinearAlgebra.FreeProduct_ofPowers := LinearAlgebra.FreeProductOfPowers
147154

148155
/--The `R`-algebra equivalence relating `FreeProduct` and `FreeProduct_ofPowers`-/
149-
noncomputable def equivPowerAlgebra : FreeProduct_ofPowers R A ≃ₐ[R] FreeProduct R A :=
150-
RingQuot.algEquiv_quot_algEquiv
156+
noncomputable def equivPowerAlgebra : FreeProductOfPowers R A ≃ₐ[R] FreeProduct R A :=
157+
RingQuot.algEquivQuotAlgEquiv
151158
(FreeProduct.powerAlgebra_equiv_freeAlgebra R A |>.symm) (FreeProduct.rel R A)
152159
|>.symm
153160

Mathlib/Tactic/Linter/OldObtain.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,15 @@ open Lean Elab
5454
namespace Mathlib.Linter.Style
5555

5656
/-- Whether a syntax element is an `obtain` tactic call without a provided proof. -/
57-
def is_obtain_without_proof : Syntax → Bool
57+
def isObtainWithoutProof : Syntax → Bool
5858
-- Using the `obtain` tactic without a proof requires proving a type;
5959
-- a pattern is optional.
6060
| `(tactic|obtain : $_type) | `(tactic|obtain $_pat : $_type) => true
6161
| _ => false
6262

63+
/-- Deprecated alias for `Mathlib.Linter.Style.isObtainWithoutProof`. -/
64+
@[deprecated isObtainWithoutProof (since := "2024-12-07")]
65+
def is_obtain_without_proof := @isObtainWithoutProof
6366

6467
/-- The `oldObtain` linter emits a warning upon uses of the "stream-of-conciousness" variants
6568
of the `obtain` tactic, i.e. with the proof postponed. -/
@@ -74,7 +77,7 @@ def oldObtainLinter : Linter where run := withSetOptionIn fun stx => do
7477
return
7578
if (← MonadState.get).messages.hasErrors then
7679
return
77-
if let some head := stx.find? is_obtain_without_proof then
80+
if let some head := stx.find? isObtainWithoutProof then
7881
Linter.logLint linter.oldObtain head m!"Please remove stream-of-conciousness `obtain` syntax"
7982

8083
initialize addLinter oldObtainLinter

Mathlib/Tactic/Linter/Style.lean

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,24 @@ namespace Style.setOption
5252

5353
/-- Whether a syntax element is a `set_option` command, tactic or term:
5454
Return the name of the option being set, if any. -/
55-
def parse_set_option : Syntax → Option Name
55+
def parseSetOption : Syntax → Option Name
5656
-- This handles all four possibilities of `_val`: a string, number, `true` and `false`.
5757
| `(command|set_option $name:ident $_val) => some name.getId
5858
| `(set_option $name:ident $_val in $_x) => some name.getId
5959
| `(tactic|set_option $name:ident $_val in $_x) => some name.getId
6060
| _ => none
6161

62+
/-- Deprecated alias for `Mathlib.Linter.Style.setOption.parseSetOption`. -/
63+
@[deprecated parseSetOption (since := "2024-12-07")]
64+
def parse_set_option := @parseSetOption
65+
6266
/-- Whether a given piece of syntax is a `set_option` command, tactic or term. -/
63-
def is_set_option : Syntax → Bool :=
64-
fun stx ↦ parse_set_option stx matches some _name
67+
def isSetOption : Syntax → Bool :=
68+
fun stx ↦ parseSetOption stx matches some _name
69+
70+
/-- Deprecated alias for `Mathlib.Linter.Style.setOption.isSetOption`. -/
71+
@[deprecated isSetOption (since := "2024-12-07")]
72+
def is_set_option := @isSetOption
6573

6674
/-- The `setOption` linter: this lints any `set_option` command, term or tactic
6775
which sets a `pp`, `profiler` or `trace` option.
@@ -76,8 +84,8 @@ def setOptionLinter : Linter where run := withSetOptionIn fun stx => do
7684
return
7785
if (← MonadState.get).messages.hasErrors then
7886
return
79-
if let some head := stx.find? is_set_option then
80-
if let some name := parse_set_option head then
87+
if let some head := stx.find? isSetOption then
88+
if let some name := parseSetOption head then
8189
let forbidden := [`debug, `pp, `profiler, `trace]
8290
if forbidden.contains name.getRoot then
8391
Linter.logLint linter.style.setOption head

Mathlib/Tactic/MoveAdd.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def pairUp : List (Expr × Bool × Syntax) → List Expr →
336336
To support a new binary operation, extend the list in this definition, so that it contains
337337
enough lemmas to allow `simp` to close a generic permutation goal for the new binary operation.
338338
-/
339-
def move_oper_simpCtx : MetaM Simp.Context := do
339+
def moveOperSimpCtx : MetaM Simp.Context := do
340340
let simpNames := Elab.Tactic.simpOnlyBuiltins ++ [
341341
``add_comm, ``add_assoc, ``add_left_comm, -- for `HAdd.hAdd`
342342
``mul_comm, ``mul_assoc, ``mul_left_comm, -- for `HMul.hMul`
@@ -348,6 +348,9 @@ def move_oper_simpCtx : MetaM Simp.Context := do
348348
let simpThms ← simpNames.foldlM (·.addConst ·) ({} : SimpTheorems)
349349
Simp.mkContext {} (simpTheorems := #[simpThms])
350350

351+
@[deprecated (since := "2024-12-07")]
352+
alias move_oper_simpCtx := moveOperSimpCtx
353+
351354
/-- `reorderAndSimp mv op instr` takes as input an `MVarId` `mv`, the name `op` of a binary
352355
operation and a list of "instructions" `instr` that it passes to `permuteExpr`.
353356
@@ -368,7 +371,7 @@ def reorderAndSimp (mv : MVarId) (instr : List (Expr × Bool)) :
368371
throwError m!"There should only be 2 goals, instead of {twoGoals.length}"
369372
-- `permGoal` is the single goal `mv_permuted`, possibly more operations will be permuted later on
370373
let permGoal ← twoGoals.filterM fun v => return !(← v.isAssigned)
371-
match ← (simpGoal (permGoal[1]!) (← move_oper_simpCtx)) with
374+
match ← (simpGoal (permGoal[1]!) (← moveOperSimpCtx)) with
372375
| (some x, _) => throwError m!"'move_oper' could not solve {indentD x.2}"
373376
| (none, _) => return permGoal
374377

0 commit comments

Comments
 (0)