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

Commit a7f0069

Browse files
urkudrobertylewis
andcommitted
chore(algebra/ring): fix docs, def/lemma (#2972)
Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
1 parent 16ad1b4 commit a7f0069

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

src/algebra/ring.lean

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston
55
-/
66
import algebra.group.hom
77
import algebra.group.units
8+
import tactic.alias
89
import tactic.norm_cast
910
import tactic.split_ifs
1011

1112
/-!
1213
# Properties and homomorphisms of semirings and rings
1314
1415
This file proves simple properties of semirings, rings and domains and their unit groups. It also
15-
defines homomorphisms of semirings and rings, both unbundled (e.g. `is_semiring_hom f`)
16-
and bundled (e.g. `ring_hom a β`, a.k.a. `α →+* β`). The unbundled ones are deprecated
17-
and the plan is to slowly remove them from mathlib.
16+
defines bundled homomorphisms of semirings and rings. As with monoid and groups, we use the same
17+
structure `ring_hom a β`, a.k.a. `α →+* β`, for both homomorphism types.
18+
19+
The unbundled homomorphisms are defined in `deprecated/ring`. They are deprecated and the plan is to
20+
slowly remove them from mathlib.
1821
1922
## Main definitions
2023
21-
is_semiring_hom (deprecated), is_ring_hom (deprecated), ring_hom, nonzero, domain, integral_domain
24+
ring_hom, nonzero, domain, integral_domain
2225
2326
## Notations
2427
@@ -41,8 +44,8 @@ to use this method than to use type class inference.
4144
4245
## Tags
4346
44-
is_ring_hom, is_semiring_hom, ring_hom, semiring_hom, semiring, comm_semiring, ring, comm_ring,
45-
domain, integral_domain, nonzero, units
47+
`ring_hom`, `semiring_hom`, `semiring`, `comm_semiring`, `ring`, `comm_ring`, `domain`, `integral_domain`, `nonzero`,
48+
`units`
4649
-/
4750
universes u v w
4851
variables {α : Type u} {β : Type v} {γ : Type w}
@@ -62,12 +65,12 @@ class distrib (α : Type u) extends has_mul α, has_add α :=
6265
lemma left_distrib [distrib α] (a b c : α) : a * (b + c) = a * b + a * c :=
6366
distrib.left_distrib a b c
6467

65-
def mul_add := @left_distrib
68+
alias left_distrib ← mul_add
6669

6770
lemma right_distrib [distrib α] (a b c : α) : (a + b) * c = a * c + b * c :=
6871
distrib.right_distrib a b c
6972

70-
def add_mul := @right_distrib
73+
alias right_distrib ← add_mul
7174

7275
@[protect_proj, ancestor has_mul has_zero]
7376
class mul_zero_class (α : Type u) extends has_mul α, has_zero α :=
@@ -80,7 +83,8 @@ mul_zero_class.zero_mul a
8083
@[ematch, simp] lemma mul_zero [mul_zero_class α] (a : α) : a * 0 = 0 :=
8184
mul_zero_class.mul_zero a
8285

83-
/-- Predicate typeclass for expressing that a (semi)ring or similar algebraic structure is nonzero. -/
86+
/-- Predicate typeclass for expressing that a (semi)ring or similar algebraic structure
87+
is nonzero. -/
8488
@[protect_proj] class nonzero (α : Type u) [has_zero α] [has_one α] : Prop :=
8589
(zero_ne_one : 0 ≠ (1:α))
8690

@@ -92,7 +96,9 @@ nonzero.zero_ne_one
9296
lemma one_ne_zero [has_zero α] [has_one α] [nonzero α] : (1:α) ≠ 0 :=
9397
zero_ne_one.symm
9498

95-
/- semiring -/
99+
/-!
100+
### Semirings
101+
-/
96102

97103
@[protect_proj, ancestor add_comm_monoid monoid distrib mul_zero_class]
98104
class semiring (α : Type u) extends add_comm_monoid α, monoid α, distrib α, mul_zero_class α
@@ -410,7 +416,9 @@ lemma ring_hom.map_dvd (f : α →+* β) {a b : α} : a ∣ b → f a ∣ f b :=
410416

411417
end comm_semiring
412418

413-
/- ring -/
419+
/-!
420+
### Rings
421+
-/
414422

415423
@[protect_proj, ancestor add_comm_group monoid distrib]
416424
class ring (α : Type u) extends add_comm_group α, monoid α, distrib α
@@ -467,14 +475,14 @@ calc
467475
a * (b - c) = a * b + a * -c : left_distrib a b (-c)
468476
... = a * b - a * c : by simp [sub_eq_add_neg]
469477

470-
def mul_sub := @mul_sub_left_distrib
478+
alias mul_sub_left_distrib ← mul_sub
471479

472480
lemma mul_sub_right_distrib (a b c : α) : (a - b) * c = a * c - b * c :=
473481
calc
474482
(a - b) * c = a * c + -b * c : right_distrib a (-b) c
475483
... = a * c - b * c : by simp [sub_eq_add_neg]
476484

477-
def sub_mul := @mul_sub_right_distrib
485+
alias mul_sub_right_distrib ← sub_mul
478486

479487
/-- An element of a ring multiplied by the additive inverse of one is the element's additive
480488
inverse. -/

src/analysis/normed_space/basic.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,9 +976,10 @@ lemma has_sum_of_subseq_of_summable {f : ι → α} (hf : summable (λa, ∥f a
976976
has_sum f a :=
977977
tendsto_nhds_of_cauchy_seq_of_subseq (cauchy_seq_finset_of_summable_norm hf) hp hs ha
978978

979-
/-- If `∑' i, ∥f i∥` is summable, then `∥(∑' i, f i)∥ ≤ (∑' i, ∥f i∥)`. Note that we do not assume that
980-
`∑' i, f i` is summable, and it might not be the case if `α` is not a complete space. -/
981-
lemma norm_tsum_le_tsum_norm {f : ι → α} (hf : summable (λi, ∥f i∥)) : ∥(∑'i, f i)∥ ≤ (∑' i, ∥f i∥) :=
979+
/-- If `∑' i, ∥f i∥` is summable, then `∥(∑' i, f i)∥ ≤ (∑' i, ∥f i∥)`. Note that we do not assume
980+
that `∑' i, f i` is summable, and it might not be the case if `α` is not a complete space. -/
981+
lemma norm_tsum_le_tsum_norm {f : ι → α} (hf : summable (λi, ∥f i∥)) :
982+
∥(∑'i, f i)∥ ≤ (∑' i, ∥f i∥) :=
982983
begin
983984
by_cases h : summable f,
984985
{ have h₁ : tendsto (λs:finset ι, ∥s.sum f∥) at_top (𝓝 ∥(∑' i, f i)∥) :=

0 commit comments

Comments
 (0)