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

Commit 0f3e083

Browse files
committed
feat(algebra/algebra/basic): relax typeclass assumptions (#14415)
1 parent 346174e commit 0f3e083

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/algebra/algebra/basic.lean

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -444,37 +444,31 @@ variables {R A : Type*}
444444

445445
open algebra
446446

447-
section ring
448-
449-
variables [comm_ring R]
450-
451447
/-- If `algebra_map R A` is injective and `A` has no zero divisors,
452448
`R`-multiples in `A` are zero only if one of the factors is zero.
453449
454450
Cannot be an instance because there is no `injective (algebra_map R A)` typeclass.
455451
-/
456452
lemma of_algebra_map_injective
457-
[semiring A] [algebra R A] [no_zero_divisors A]
453+
[comm_semiring R] [semiring A] [algebra R A] [no_zero_divisors A]
458454
(h : function.injective (algebra_map R A)) : no_zero_smul_divisors R A :=
459455
⟨λ c x hcx, (mul_eq_zero.mp ((smul_def c x).symm.trans hcx)).imp_left
460-
((injective_iff_map_eq_zero (algebra_map R A)).mp h _)
456+
(map_eq_zero_iff (algebra_map R A) h).mp
461457

462458
variables (R A)
463-
lemma algebra_map_injective [ring A] [nontrivial A]
459+
lemma algebra_map_injective [comm_ring R] [ring A] [nontrivial A]
464460
[algebra R A] [no_zero_smul_divisors R A] :
465461
function.injective (algebra_map R A) :=
466462
suffices function.injective (λ (c : R), c • (1 : A)),
467463
by { convert this, ext, rw [algebra.smul_def, mul_one] },
468464
smul_left_injective R one_ne_zero
469465

470466
variables {R A}
471-
lemma iff_algebra_map_injective [ring A] [is_domain A] [algebra R A] :
467+
lemma iff_algebra_map_injective [comm_ring R] [ring A] [is_domain A] [algebra R A] :
472468
no_zero_smul_divisors R A ↔ function.injective (algebra_map R A) :=
473469
⟨@@no_zero_smul_divisors.algebra_map_injective R A _ _ _ _,
474470
no_zero_smul_divisors.of_algebra_map_injective⟩
475471

476-
end ring
477-
478472
section field
479473

480474
variables [field R] [semiring A] [algebra R A]

0 commit comments

Comments
 (0)