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

Commit a252427

Browse files
committed
chore(algebra/algebra/basic): fix instances names to make doc links work (#10834)
The blank lines avoid sentences being pulled into the bulleted list above them.
1 parent 2043748 commit a252427

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/algebra/algebra/basic.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ See the implementation notes for remarks about non-associative and non-unital al
3737
* `algebra_nat`
3838
* `algebra_int`
3939
* `algebra_rat`
40-
* `opposite.algebra`
40+
* `mul_opposite.algebra`
4141
* `module.End.algebra`
4242
4343
## Notations
@@ -67,6 +67,7 @@ As a result, there are two ways to talk about an `R`-algebra `A` when `A` is a s
6767
variables [comm_semiring R] [semiring A]
6868
variables [module R A] [smul_comm_class R A A] [is_scalar_tower R A A]
6969
```
70+
7071
The first approach implies the second via typeclass search; so any lemma stated with the second set
7172
of arguments will automatically apply to the first set. Typeclass search does not know that the
7273
second approach implies the first, but this can be shown with:
@@ -87,6 +88,7 @@ all be relaxed independently; for instance, this allows us to:
8788
* Replace `comm_semiring R` and `module R A` with `comm_group R'` and `distrib_mul_action R' A`,
8889
which when `R' = units R` lets us talk about the "algebra-like" action of `units R` on an
8990
`R`-algebra `A`.
91+
9092
While `alg_hom R A B` cannot be used in the second approach, `non_unital_alg_hom R A B` still can.
9193
9294
You should always use the first approach when working with associative unital algebras, and mimic
@@ -311,7 +313,7 @@ end id
311313
section prod
312314
variables (R A B)
313315

314-
instance : algebra R (A × B) :=
316+
instance _root_.prod.algebra : algebra R (A × B) :=
315317
{ commutes' := by { rintro r ⟨a, b⟩, dsimp, rw [commutes r a, commutes r b] },
316318
smul_def' := by { rintro r ⟨a, b⟩, dsimp, rw [smul_def r a, smul_def r b] },
317319
.. prod.module,
@@ -1258,7 +1260,7 @@ def to_rat_alg_hom [ring R] [ring S] [algebra ℚ R] [algebra ℚ S] (f : R →+
12581260

12591261
end ring_hom
12601262

1261-
namespace rat
1263+
section rat
12621264

12631265
instance algebra_rat {α} [division_ring α] [char_zero α] : algebra ℚ α :=
12641266
(rat.cast_hom α).to_algebra' $ λ r x, r.cast_commute x

src/number_theory/bernoulli.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ begin
282282
apply sum_congr rfl,
283283
simp_intros m h only [finset.mem_range],
284284
simp only [f, exp_pow_eq_rescale_exp, rescale, one_div, coeff_mk, ring_hom.coe_mk, coeff_exp,
285-
ring_hom.id_apply, cast_mul, rat.algebra_map_rat_rat],
285+
ring_hom.id_apply, cast_mul, algebra_map_rat_rat],
286286
-- manipulate factorials and binomial coefficients
287287
rw [choose_eq_factorial_div_factorial h.le, eq_comm, div_eq_iff (hne q.succ), succ_eq_add_one,
288288
mul_assoc _ _ ↑q.succ!, mul_comm _ ↑q.succ!, ← mul_assoc, div_mul_eq_mul_div,

0 commit comments

Comments
 (0)