

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































HT and TT 2011
H. A. Priestley
GRF is an ALGEBRA course, and specifically a course about algebraic structures. This introduc- tory section revisits ideas met in the early part of Analysis I and in Linear Algebra I, to set the scene and provide motivation.
0.1 Familiar number systems
Consider the traditional number systems
N = { 0 , 1 , 2 ,... } the natural numbers Z = { m − n | m, n ∈ N } the integers Q = { m/n | m, n ∈ Z, n 6 = 0 } the rational numbers R the real numbers C the complex numbers
for which we have N ⊂ Z ⊂ Q ⊂ R ⊂ C.
These come equipped with the familiar arithmetic operations of sum and product.
The real numbers: Analysis I built on the real numbers. Right at the start of that course you were given a set of assumptions about R, falling under three headings: (1) Algebraic properties (laws of arithmetic), (2) order properties, (3) Completeness Axiom; summarised as saying the real numbers form a complete ordered field.
(1) The algebraic properties of R You were told in Analysis I: Addition: for each pair of real numbers a and b there exists a unique real number a + b such that
(2) Order properties: R comes equipped with an order relation < whereby each real number is classified uniquely as positive (> 0), negative (< 0), or zero. The properties ((P1)–(P3) in Analysis I handout) tell us how order interacts with + and · and so provide rules for manipu- lating inequalities. (In addition they imply the trichotomy law: for all a, b ∈ R, we have exactly one of a > b, a < b or a = b. This allows us to think of R as a ‘number line’.) Note that the modulus function draws on the order structure. (3) Completeness Axiom: Concerns the order relation. Central to the development of real analysis.
The complex numbers, C: In summary, C has arithmetic properties just the same as those for R. There is no total order on C compatible with the arithmetic operations. Important good feature: polynomials (with real or complex coefficients) always have a full complement of roots in C.
The rational numbers, Q: Same arithmetic and order properties as for R. Completeness Axiom fails.
The integers, Z: Arithmetic behaves as for Q and R with the critical exception that not every non-zero integer has an inverse for multiplication: for example, there is no n ∈ Z such that 2·n = 1.
The natural numbers, N are what number theory is all about. But N’s arithmetic is defective: we can’t in general perform either subtraction or division, so we shall usually work in Z when talking about such concepts as factorisation. N, ordered by 0 < 1 < 2... , also has an important ancillary role in the study of the rings of integers and polynomials (see Sections 3,4,5).
Restricting operations to subsets: We have N ⊂ Z ⊂ Q ⊂ R. The sum and product on each of N, Z and Q are those they inherit from R. For a non-empty subset S of R, we say that S is closed under + if a, b ∈ S implies a + b ∈ S, and likewise for ·. In this terminology N, Z and Q are closed under + and ·. The operations + and · on R are subject to a list of axioms (rules), as recalled in (1) above. Observe that these axioms are of two kinds:
(∀) those which have only universal quantifiers ∀;
(∃) those which contain an existential quantifier ∃ and so assert the existence of something.
Examples of axioms of type (∀) for R are commutativity and associativity of both + and ·, and the distributive law. For example, commutativity of + says
(∀a ∈ R)(∀b ∈ R) a + b = b + a.
An axiom of type (∃) for R is that asserting that we have a zero element for addition:
(∃ 0 ∈ R)
∀a ∈ R) a + 0 = 0 + a = a.
Let S be any non-empty subset of R closed under + and ·. Then any axiom of type (∀) which holds in (R; +, ·) also holds in (S; +, ·)—it is inherited. By contrast, an axiom of type (∃) may or may not hold on S: it depends whether or not the element or elements whose existence in R it guarantees actually belong to S.
Aside: do the number systems exist? [Informal comments in lecture.]
1.1 Binary operations. Let S be a non-empty set. A map (bop) ⋆ : S × S → S, (a, b) 7 → a ⋆ b
is called a binary operation on S. So ⋆ takes 2 inputs a, b from S and produces a single output a ⋆ b ∈ S. In this situation we may say that ‘S is closed under ⋆’. Aside: A unary operation on a non-empty set S is a map from S to S. Examples are a 7 → (−a) on Z, a 7 → 2 a on C.
Let ⋆ be a binary operation on a set S. We say
In summary: we shall want to consider binary operations which are associative, but we do not restrict to those which are commutative.
1.2 Examples of binary operations.
(1) Addition, +, is a commutative and associative binary operation on each of the following:
N, Z, Q, R, C, Mm,n(R) (m, n > 1), real polynomials. But + is NOT a binary operation on the set S = { 0 , 1 }: we have 1 ∈ S but 1 + 1 = 2 ∈/ S.
(2) Multiplication, ·, is an associative and commutative binary operation on each of the following:
N, Z, Q, R, C, real polynomials. Matrix multiplication is an associative binary operation on Mn(R); for n > 2 this is NOT commutative. Here, and in (1) too, there is no reason to restrict to real matrices and polynomials. We could equally well have considered matrices with entries drawn from C or polynomials with complex coefficients.
(3) Assume that S is a non-empty subset of R closed under multiplication and such that S 6 = { 0 }. Then · is a binary operation on S r { 0 }.
(4) On a finite set S a binary operation may be specified by a table: for example:
0 1
You may recognise these tables as specifying binary arithmetic, that is, addition and multipli- cation mod (or modulo) 2.
Exercise example: Formulate addition and multiplication tables for ‘arithmetic modulo 3’ on the set { 0 , 1 , 2 } and for ‘arithmetic modulo 4’ on { 0 , 1 , 2 , 3 }. [We’ll look systematically at arithmetic modulo n later on.]
(5) Exercise example: By constructing appropriate tables give examples of (i) a binary operation on { 0 , 1 } which is not commutative and (ii) a binary operation on { 0 , 1 } which is not associative.
(6) Scalar product on R^3 is given by
(a 1 , a 2 , a 3 ) · (b 1 , b 2 , b 3 ) = a 1 b 1 + a 2 b 2 + a 3 b 3.
Here the input is two vectors in R^3 but the output is a real number, NOT another element of R^3. Thus scalar product is NOT a binary operation on R^3.
(7) Vector product on R^3 is given by
(a 1 , a 2 , a 3 ) ∧ (b 1 , b 2 , b 3 ) = (a 2 b 2 − a 3 b 3 , a 3 b 3 − a 1 b 1 , a 1 b 1 − a 2 b 2 ).
It defines a map from R^3 × R^3 to R^3. With · standing for scalar product,
(a ∧ b) ∧ c = (a · c)b − (b · c)a,
whereas a ∧ (b ∧ c) = (a · c)b − (a · b)c.
From this we see easily that associativity fails when, for example,
a = (1, 0 , 0), b = c = (1, 1 , 1).
Furthermore, and this is very unlike ‘ordinary’ algebra,
a ∧ (b ∧ c) + b ∧ (c ∧ a) + c ∧ (a ∧ b) = 0.
1.3 An important example: composition of maps. Let X be a set. Consider the set S of maps f : X → X. For f, g ∈ S define the composition g ◦ f by
∀x ∈ X (g ◦ f )(x) = g(f (x)).
Then ◦ is a binary operation on S. We claim that ◦ is associative. Let f, g, h ∈ S. We require to show that, for each x ∈ X, we have (h ◦ (g ◦ f ))(x) = ((h ◦ g) ◦ f )(x). But
(h ◦ (g ◦ f ))(x) = h((g ◦ f )(x)) = h(g(f (x))) = (h ◦ g)(f (x)) = ((h ◦ g) ◦ f )(x),
as required. In particular composition is an associative binary operation on the set Sym(n) of permutations of { 1 ,... , n}. For n > 3, ◦ on Sym(n) is not commutative. [Exercise: give an example.]
1.4 The definition of a group. Let G be a non-empty set and let ⋆ be a binary operation on G:
(bop) ⋆ : G × G → G, (a, b) 7 → a ⋆ b.
Then (G; ⋆) is a group if the following axioms are satisfied: (G1) associativity: a ⋆ (b ⋆ c) = (a ⋆ b) ⋆ c for all a, b, c ∈ G G2) identity element: there exists e ∈ G such that a ⋆ e = e ⋆ a = a for all a ∈ G.
Our next example is of sufficient importance to deserve a theorem all to itself.
1.5 Theorem (bijections on a set X). Fix a non-empty set X and let
Sym(X) = { f : X → X | f is a bijection },
and let ◦ denote composition of maps.
(1) ◦ is a binary operation on Sym(X).
(2) Sym(X); ◦) is a group.
Proof. (1) To verify (bop) we need the fact that the composition of two bijections is a bijection. You met this in Introduction to Pure Mathematics. For (2) we must verify (G1)–(G3). (G1) Composition of maps is always associative (see 1.3), so in particular composition of bijective maps is associative. So (G1) holds. (G2) It’s up to us to exhibit an identity element, confirm that it belongs to Sym(X) and serves as e in (G2). Note that the identity map id is indeed a bijection and satisfies id ◦ f = f ◦ id = f. (G3) Fix f ∈ Sym(X). Then, as a bijection, f has an inverse map f −^1 which is also a bijection and satisfies f ◦ f −^1 = id = f −^1 ◦ f.
As a special case we have that Sym(n), the permutations of an n-element set, is a group under the usual composition of permutations.
2.1 The definition of a ring. A structure (R, +, ·) is a ring if R is a non-empty set and + and · are binary operations:
such that
Addition: (R, +) is an abelian group, that is,
(A1) associativity: for all a, b, c ∈ R we have a + (b + c) = (a + b) + c (A2) zero element: there exists 0 ∈ R such that for all a ∈ R we have a + 0 = 0 + a = a (A3) inverses: for any a ∈ R there exists −a ∈ R such that a + (−a) = (−a) + a = 0 (A4) commutativity: for all a, b ∈ R we have a + b = b + a
Multiplication:
(M1) associativity: for all a, b, c ∈ R we have a · (b · c) = (a · b) · c
Addition and multiplication together
(D) for all a, b, c ∈ R,
a · (b + c) = a · b + a · c and (a + b) · c = a · b + b · c.
We sometimes say ‘R is a ring’, taken it as given that the ring operations are denoted + and ·. As in ordinary arithmetic we shall frequently suppress · and write ab instead of a · b.
We do NOT demand that multiplication in a ring be commutative. As a consequence we must postulate distributivity as 2 laws, since neither follows from the other in general.
Notation: subtraction and division We write a − b as shorthand for a + (−b) and a/b as shorthand for a · (1/b) when 1/b exists.
2.2 Special types of rings: definitions. Assume (R; +, ·) is a ring. We say R is a commutative ring if its multiplication · is commutative, that is,
(M4) Commutativity: a · b = b · a for all a, b ∈ R.
We say R is a ring with 1 (or ring with identity) if there exists an identity for multiplication, that is,
(M2) identity element: there exists 1 ∈ R such that for all a ∈ R we have a · 1 = 1 · a = a.
We next record some basic facts about rings. To simplify the statements we have restricted attention to commutative rings.
2.4 Calculational rules for rings. Assume that (R; +, ·) is a commutative ring. Let a, b, c ∈ R. (i) If a + b = a + c then b = c. (ii) If a + a = a then a = 0. (iii) −(−a) = a. (iv) 0a = 0. (v) −(ab) = (−a)b = a(−b). Assume in addition that R has an identity 1 Then (vi) (−1)a = −a.
(vii) If a ∈ R has a multiplicative identity a−^1 then ab = 0 implies b = 0.
Proof. Very similar to the do-it-once-in-a-lifetime, axiom-chasing proofs you have already seen, or had to do, in the context of R, or (in the case of (i)–(iv)), seen for addition in a vector space.
2.5 Subrings and the Subring Test. [Compare with the Subspace Test from LAI] Let (R; +, ·) be a ring and let S be a non-empty subset of R. Then (S; +, ·) is a subring of R if it is a ring with respect to the operations it inherits from R.
The Subring Test Let (R; +, ·) be a ring and let S ⊆ R. Then (S; +, ·) is a subring of R if (and only if) S is non-empty and the following hold: (SR1) a + b ∈ S for any a, b ∈ S; (SR2) a − b ∈ S for any a, b ∈ S; (SR3) ab ∈ S for any a, b ∈ S. Here (SR1) and (SR3) are just the (bop) conditions we require for S. (A1), (M1) and (D) are inherited from R. The only (∃) axioms are (A2) and (A3). Since S 6 = ∅ we can pick some c ∈ S. Then, by (SR2), 0 = c − c ∈ S. By (SR2) again, −a = 0 − a ∈ S. Exercise: prove that if S is a subring of R then, with an obvious notation, necessarily 0S = 0R and (−a)S = (−a)R. Examples
(1) Z and Q are subrings of R;
(2) R, regarded as numbers of the form a + 0i for a ∈ R, is a subring of C.
(3) In the polynomial ring R[x], the polynomials of even degree form a subring but the polynomials of odd degree do NOT form a subring because x · x = x^2 is not of odd degree.
(4) nZ := {nk | k ∈ Z} is a subring of Z for any n ∈ N.
More examples on Problem sheet 1.
2.6 New rings from old: products and functions. Products of rings Let R 1 and R 2 be rings. Define binary operations on R 1 ×R 2 coordinatewise: for r 1 , r′ 1 ∈ R 1 and r 2 , r′ 2 ∈ R 2 , let (r 1 , r 2 ) + (r′ 1 , r′ 2 ) := (r 1 + r 1 , r 2 + r′ 2 ), (r 1 , r 2 ) · (r′ 1 , r′ 2 ) := (r 1 · r′ 1 , r 2 · r′ 2 ). Consider the ring axioms in two groups:
Rings of functions: [Lecture example] Let R be a ring and X a non-empty set. Denote by RX^ := { f : X → R, with sum, f + g, and product, ·, defined pointwise: ∀x ∈ X (f + g)(x) = f (x) + g(x), ∀x ∈ X (f · g)(x) = f (x) · g(x).
In the remainder of this section we consider some very special, but very important, classes of rings, of which our most familiar rings provide examples.
2.7 Fields and integral domains A commutative ring with identity, (R, +, ·) satisfies all of the axioms (A1)–(A4), (that is, (R, +) is an abelian group); (M1), (M2), (M4); (D) (distributivity). What’s ‘missing’ here is (M3) inverses: for all a ∈ R with a 6 = 0 there exists 1/a ∈ R (alternatively written a−^1 ) such that a · 1 /a = 1/a · a = 1. Definition of a field: A structure (R, +, ·), where + and · are binary operations on R is a field if (A1)–(A4), (M1)–(M4), and (D) hold, and 0 6 = 1. This can be expressed in a more modular way as follows (R, +, ·) is a field if (A) (R, +) is an abelian group;
(M) R r { 0 }, ·) is an abelian group;
(D) the distributive laws hold. Exercise: convince yourself that the two formulations of the definition of a field are the same.
Examples of fields: The following are fields: Q, R, C. The following commutative rings with identity fail to be fields: Z, K[x]; here K denotes R, or C, or any other field, and K[x] the polynomials with coefficients in K.
Definitions: In a commutative ring we call an element a 6 = 0 a zero divisor if there exists b 6 = 0 such that a · b = 0. A commutative ring with identity in which 0 6 = 1 is an integral domain (ID) if it has no zero divisors. Observation (cancellation property): in an integral domain ab = ac and a 6 = 0 implies b = c.
Examples of integral domains (1) We claim that any field is an integral domain. To prove this, assume that (R, +, ·) is a field and let a, b ∈ R be such that a · b = 0. If a 6 = 0 then a−^1 exists, and we have
0 = a−^1 · 0 = a−^1 · (a · b) = (a−^1 · a) · b = 1 · b = b.
and likewise with the roles of a and b reversed. (2) Z and K[x] are integral domains which fail to be fields. (3) R^2 , with coordinatewise addition and multiplication (see 2.3) is a commutative ring with iden- tity which fails to be an integral domain (and so is not a field):
(0, 1) · (1, 0) = (0, 0).
2.8 Theorem. A finite integral domain is a field.
Proof. Let R be a finite integral domain and list its distinct elements as a 1 ,... , an. Let b ∈ R, b 6 =
2.9 Units. Let R be a commutative ring with 1. Then 0 6 = u ∈ R is a unit if there exists v ∈ R such that uv = vu = 1; we write as usual v = u−^1. Thus the units are those elements (necessarily non-zero) which have multiplicative inverses.
Examples (1) In a field, every non-zero element is a unit. (2) In Z, the units are ±1. (3) In the ring of real or complex polynomials, or more generally the ring K[x] of polynomials over a field K, the units are the non-zero constant polynomials.
Summing up what we have about Z so far.:–
2.10 Theorem (the integers as a ring). (i) Z is a commutative ring with 1. (ii) n ∈ Z has a multiplicative inverse in Z (that is, n is a unit) if and only if n = ± 1.
(iii) Z fails to be a field, but is an integral domain:
(ID) ab = 0 implies a = 0 or b = 0.
We now look at what we can say about division in Z. [Lecture example: how does school ‘long division’ work?]
4.1 Theorem (the division algorithm for N). Let a, b ∈ N with b 6 = 0. Then there exist unique natural numbers q and r such that a = qb + r and 0 6 r < b.
Proof. Assume a < b. Then a = 0b + a so q = 0 and r = a do the job. Now assume a > b > 0. Consider
S = { m ∈ N | mb − a > 0 }.
Then S 6 = ∅ because N (as a subset of R) is not bounded above. By the Well-ordering Property there exists a least element, k say, in S. Note 0 ∈/ S and so k > 1. Let q = k − 1 and r = a − qb. Then q ∈ N r S (by leastness of k) so r > 0. Also q + 1 = k ∈ S so that (q + 1)b > a. Hence b > r.
Corollary (the division algorithm for Z). Let a, b ∈ Z with b 6 = 0. Then there exist unique integers q and r such that a = qb + r and 0 6 r < |b|.
Proof. [omitted from lecture] (i) a > 0, b > 0. Apply the theorem. (ii) a > 0, b < 0. Then −b > 0 and by the theorem there exist q′, r′^ ∈ N with a = q′(−b) + r′^ and 0 6 r′^ < −b = |b|. Let q = −q′^ and r = r′.
(iii) a < 0, b > 0. By the theorem, there exist q′′, r′′^ ∈ Z such that −a = q′′b + r′′^ and 0 6 r′′^ < b. If r′′^ = 0, take q = −q′′^ and r = 0. If r′′^ > 0, take r = b − r′′^ and note that 0 < r < b. Also let q = (−q′′^ − 1) and note that a = −q′′b − r′′^ = −q′′b + (r − b) = qb + r, as we require.
(iv) a < 0, b < 0. Apply the result from case (iii) with b replaced by −b, in the same way as in case (ii).
Uniqueness of q and r in the Division Algorithm Assume there is another pair of integers ˜q and ˜r such that a = ˜qb + ˜r with 0 6 ˜r < |b|. Then, from a = qb + r = ˜qb + ˜r, we deduce that (q − q˜)b = ˜r − r. So ˜r = r would force q = ˜q (note that property (ID) is used here). So suppose for a contradiction that ˜r 6 = r. Suppose b > 0 (the case b < 0 works similarly). Without loss of generality, ˜r > r and hence q > ˜q. But then
b > ˜r > ˜r − r = (q − q˜)b > 0.
But this would give 0 < (q − q˜) < 1, with (q − q˜) ∈ N and this is impossible.
We next give an application of the Division Algorithm which will be important later on, specif- ically in our study of groups.
4.2 Theorem (subrings of Z).
(1) Let S be a non-empty subset of Z closed under addition and subtraction. Then there exists n ∈ N such that S = nZ; = {nk | k ∈ Z}.
(2) The subrings of Z are exactly the sets of the form nZ for n ∈ Z.
Proof. (1) Since S 6 = ∅ there exists some m ∈ S. Then 0 = m − m ∈ S. If S = { 0 }, then S = 0Z. Now assume S 6 = { 0 }. Then there exists some m 6 = 0 in S. Also −m = 0 − m ∈ S. Therefore S contains a positive integer. By the Well-order Property of N there exists a least positive member of S; call it n. We claim S = nZ. We can prove by induction that n ∈ S implies nZ ⊆ S (see Problem sheet 2, question 2). Now let a ∈ S. By the Division Algorithm there exist q, r ∈ Z such that a = qn + r, with 0 6 r < n. But then r = a − qn ∈ S. By leastness of n we must have r = 0. Therefore a ∈ nZ. (2) We noted earlier that every set nZ is a subring of Z. (1) supplies the converse.
4.4 The highest common factor of two integers: definitions and uniqueness. Let a and b be two non-zero integers. Assume that c is a positive integer such that
(HCF1) c|a and c|b;
(HCF2) for all integers d such that d|a and d|b, then d|c.
Then c is called the highest common factor (or the greatest common divisor) of a and b, and denoted hcf(a, b) (or gcd(a, b)). It is convenient, by convention, to extend the definition by taking, for any integer a, hcf(a, 0) = hcf(0, a) = a.
Notes: Observe that if c satisfies (HCF1) and (HCF2) above then so does (−1)c = −c. By requiring the hcf of a and b to be positive we ensure it is unique, provided it exists (Exercise: check uniqueness, using the Divisors Lemma from 4.3). So we really can talk about the hcf rather than an hcf of given integers, provided there is an hcf at all. Observe that for any a, b ∈ Z r { 0 },
hcf(a, b) = hcf(a, |b|) = hcf(|a|, b) = hcf(|a|, |b|).
We can therefore restrict attention to positive integers.
But do hcf’s exist? How do we find them if they do? The following lemma is a key ingredient in proving the existence of hcf’s.
4.5 Invariance Lemma (for hcf’s of positive integers) Let a and b be positive integers. Write
a = qb + r with q, r ∈ N and 0 6 r < b.
Assume hcf(b, r) exists. Then hcf(a, b) exists and equals hcf(b, r).
Proof. Let c := hcf(b, r). We shall show that c satisfies conditions (HCF1) and (HCF2) in the definition of hcf(a, b). First note that c|b and c|r. Hence c|qb + 1r = a by Divisors Lemma, part (iii). Now assume that d|a and d|b. From property (iii) in the Divisors Lemma we get d|r = a − qb. Hence d|c by condition (HCF2) applied to the pair b and r. In the process of moving from the pair (a, b) to the pair (b, r)
[:Lecture example : computing hcf(72, 15).]
4.6 Theorem (Euclid’s algorithm, from Euclid’s Elements, Book 7, Propositions 1 and 2).
(1) Let a and b be positive integers, then hcf(a, b) exists;
(2) (the hcf formula) there exist integers m and n such that
hcf(a, b) = ma + nb.
Proof. Without loss of generality we may assume that 0 < b 6 a. In what follows, all quantities appearing are integers and at each step the division algorithm is invoked. We can write
a = q 0 b + r 0 where 0 < r 0 < b b = q 1 r 0 + r 1 where 0 < r 1 < r 0 r 0 = q 2 r 1 + r 2 where 0 < r 2 < r 1
......... rk− 3 = qk− 1 rk− 2 + rk− 1 where 0 < rk− 1 < rk− 2 rk− 2 = qkrk− 1 + rk where 0 = rk
where we stop as soon as we reach a zero remainder. This must happen in a finite number of steps, by the Going Down Lemma (see Section 3). The Invariance Lemma 4.5 tells us that hcf(a, b) = hcf(b, r 0 ) =... = hcf(rk− 2 , rk− 1 ) = rk− 1.
To obtain the hcf formula we retrace our steps: write rk− 1 in terms of rk− 2 , then substitute the resulting formula for rk− 1 into the equation for rk− 3 and so on until a formula in a and b of the required form is obtained. More formally: argue by induction on k.
Exercise example. (corrected) Find the highest common factor of a = 38793 and b = 89531 and express it as ma + nb. [Ans: hcf(a, b) = 1 = 13469 · 38793 + (−5836) · 89531 (note m and n are not unique—recall Problem sheet 2, Question 4).
4.7 Implementing Euclid’s Algorithm in practice. [web notes only] Euclid’s Algorithm to compute the hcf of positive integers a and b Input a and b. Step 1. Let x := min{a, b} and y := max{a, b}. Step 2. Find integers q and 0 6 r < x such that y = qx + r. Step 3. IF r = 0, THEN output y ELSE put x := b and y := r and GOTO Step 2.
Extending Euclid’s algorithm to incorporate obtaining the hcf formula. By refining the strategy in Theorem 4.6 by adding some extra book-keeping we can obtain a simple ‘one- pass’ procedure for calculating both hcf(a, b) and possible values for m, n in hcf(a, b) = ma + nb. Notation: When, from the division algorithm, we have a = qb + r with 0 6 r < b, let us write q := q(a, b).
Input: positive integers a and b. Generate natural numbers ri, qi, mi and ni as follows: Step 1: Set r 0 := max{a, b}, m 0 := 1, n 0 := 0, r 1 := min{a, b}, n 1 := 0, n 1 := 1, i := 1.