FORMALIZED MATHEMATICS Volume 7, Number 1, 1998 University of Białystok

The Composition of Functors and Transformations in Alternative Categories

Artur Korniłowicz University of Białystok

MML Identifier: FUNCTOR3.

The articles [5], [6], [2], [8], [7], [3], [1], [4], and [9] provide the notation and terminology for this paper.

1. Preliminaries

One can verify that there exists a non empty category structure which is transitive, associative, and strict and has units.

Let A be a non empty transitive category structure and let B be a non empty category structure with units. One can verify that there exists a functor structure from A to B which is strict, comp-preserving, comp-reversing, precovariant, precontravariant, and feasible.

Let A be a transitive non empty category structure with units and let B be a non empty category structure with units. Observe that there exists a functor structure from A to B which is strict, comp-preserving, comp-reversing, precovariant, precontravariant, feasible, and id-preserving.

Let A be a transitive non empty category structure with units and let B be a non empty category structure with units. Observe that there exists a functor from A to B which is strict, feasible, covariant, and contravariant.

Next we state several propositions:

(1) Let C be a category, o_{1}, o_{2}, o_{3}, o_{4} be objects of C, a be a morphism from o_{1} to o_{2}, b be a morphism from o_{2} to o_{3}, c be a morphism from o_{1} to o_{4}, and d be a morphism from o_{4} to o_{3}. Suppose b·a = d·c and a·a^{−1} = id_{(o_{2})} and d^{−1} · d = id_{(o_{4})} and ⟨o_{1}, o_{2}⟩ ≠ ∅ and ⟨o_{2}, o_{1}⟩ ≠ ∅ and ⟨o_{2}, o_{3}⟩ ≠ ∅ and ⟨o_{3}, o_{4}⟩ ≠ ∅ and ⟨o_{4}, o_{3}⟩ ≠ ∅. Then c · a^{−1} = d^{−1} · b.

(2) Let A be a non empty transitive category structure, B, C be non empty category structures with units, F be a feasible precovariant functor structure from A to B, G be a functor structure from B to C, and o, o_{1} be objects of A. Then Morph-Map_{G·F}(o, o_{1}) = Morph-Map_{G}(F (o), F (o_{1})) · Morph-Map_{F} (o, o_{1}).

(3) Let A be a non empty transitive category structure, B, C be non empty category structures with units, F be a feasible precontravariant functor structure from A to B, G be a functor structure from B to C, and o, o_{1} be objects of A. Then Morph-Map_{G·F}(o, o_{1}) = Morph-Map_{G}(F (o_{1}), F (o)) · Morph-Map_{F} (o, o_{1}).

(4) Let A be a non empty transitive category structure, B be a non empty category structure with units, and F be a feasible precovariant functor structure from A to B. Then id_{B} · F = the functor structure of F.

(5) Let A be a transitive non empty category structure with units, B be a non empty category structure with units, and F be a feasible precovariant functor structure from A to B. Then F · id_{A} = the functor structure of F.

For simplicity, we use the following convention: A denotes a non empty category structure, B, C denote non empty reflexive category structures, F denotes a feasible precovariant functor structure from A to B, G denotes a feasible precovariant functor structure from B to C, M denotes a feasible precontravariant functor structure from A to B, N denotes a feasible precontravariant functor structure from B to C, o_{1}, o_{2} denote objects of A, and m denotes a morphism from o_{1} to o_{2}.

The following four propositions are true:

(6) If ⟨o_{1}, o_{2}⟩ ≠ ∅, then (G · F)(m) = G(F (m)).

(7) If ⟨o_{1}, o_{2}⟩ ≠ ∅, then (N · M)(m) = N(M(m)).

(8) If ⟨o_{1}, o_{2}⟩ ≠ ∅, then (N · F)(m) = N(F (m)).

(9) If ⟨o_{1}, o_{2}⟩ ≠ ∅, then (G · M)(m) = G(M(m)).

Let A be a non empty transitive category structure, let B be a transitive non empty category structure with units, let C be a non empty category structure with units, let F be a feasible precovariant comp-preserving functor structure from A to B, and let G be a feasible precovariant comp-preserving functor structure from B to C. One can check that G · F is comp-preserving.

Let A be a non empty transitive category structure, let B be a transitive non empty category structure with units, let C be a non empty category structure with units, let F be a feasible precontravariant comp-reversing functor structure from A to B, and let G be a feasible precontravariant comp-reversing functor structure from B to C. One can check that G · F is comp-preserving.

Let A be a non empty transitive category structure, let B be a transitive non empty category structure with units, let C be a non empty category structure with units, let F be a feasible precovariant comp-preserving functor structure from A to B, and let G be a feasible precontravariant comp-reversing functor structure from B to C. One can verify that G · F is comp-reversing.

Let A be a non empty transitive category structure, let B be a transitive non empty category structure with units, let C be a non empty category structure with units, let F be a feasible precontravariant comp-reversing functor structure from A to B, and let G be a feasible precovariant comp-preserving functor structure from B to C. One can verify that G · F is comp-reversing.

Let A, B be transitive non empty category structures with units, let C be a non empty category structure with units, let F be a covariant functor from A to B, and let G be a covariant functor from B to C. Then G · F is a strict covariant functor from A to C.

Let A, B be transitive non empty category structures with units, let C be a non empty category structure with units, let F be a contravariant functor from A to B, and let G be a contravariant functor from B to C. Then G · F is a strict covariant functor from A to C.

Let A, B be transitive non empty category structures with units, let C be a non empty category structure with units, let F be a covariant functor from A to B, and let G be a contravariant functor from B to C. Then G · F is a strict contravariant functor from A to C.

Let A, B be transitive non empty category structures with units, let C be a non empty category structure with units, let F be a contravariant functor from A to B, and let G be a covariant functor from B to C. Then G · F is a strict contravariant functor from A to C.

For simplicity, we adopt the following convention: A, B, C, D are transitive non empty category structures with units, F_{1}, F_{2}, F_{3} are covariant functors from A to B, G_{1}, G_{2}, G_{3} are covariant functors from B to C, H_{1}, H_{2} are covariant functors from C to D, p is a transformation from F_{1} to F_{2}, p_{1} is a transformation from F_{2} to F_{3}, q is a transformation from G_{1} to G_{2}, q_{1} is a transformation from G_{2} to G_{3}, and r is a transformation from H_{1} to H_{2}.

The following proposition is true

(10) If F_{1} is transformable to F_{2} and G_{1} is transformable to G_{2}, then G_{1} · F_{1} is transformable to G_{2} · F_{2}.

2. The Composition of Functors with Transformations

Let A, B, C be transitive non empty category structures with units, let F_{1}, F_{2} be covariant functors from A to B, let t be a transformation from F_{1} to F_{2}, and let G be a covariant functor from B to C. Let us assume that F_{1} is transformable to F_{2}. The functor G · t yields a transformation from G · F_{1} to G · F_{2} and is defined as follows:

(Def. 1) For every object o of A holds (G · t)(o) = G(t[o]).

Next we state the proposition

(11) For every object o of A such that F_{1} is transformable to F_{2} holds (G_{1} ·

p)[o] = G_{1}(p[o]). Let A, B, C be transitive non empty category structures with units, let G_{1},

G_{2} be covariant functors from B to C, let F be a covariant functor from A to B, and let s be a transformation from G_{1} to G_{2}. Let us assume that G_{1} is transformable to G_{2}. The functor s · F yielding a transformation from G_{1} · F to G_{2} · F is defined by:

(Def. 2) For every object o of A holds (s · F)(o) = s[F (o)].

Next we state a number of propositions:

(12) For every object o of A such that G_{1} is transformable to G_{2} holds (q · F_{1})[o] = q[F_{1}(o)].

(13) If F_{1} is transformable to F_{2} and F_{2} is transformable to F_{3}, then G_{1} ·(p_{1}^{∘} p) = G_{1} · p_{1} ^{∘} G_{1} · p.

(14) If G_{1} is transformable to G_{2} and G_{2} is transformable to G_{3}, then (q_{1} ^{∘} q) · F_{1} = q_{1} · F_{1} ^{∘} q · F_{1}.

(15) If H_{1} is transformable to H_{2}, then (r · G_{1}) · F_{1} = r · (G_{1} · F_{1}).

(16) If G_{1} is transformable to G_{2}, then (H_{1} · q) · F_{1} = H_{1} · (q · F_{1}).

(17) If F_{1} is transformable to F_{2}, then (H_{1} · G_{1}) · p = H_{1} · (G_{1} · p).

(18) id_{(G_{1})} ·F_{1} = id_{G_{1}·F_{1}}.

(19) G_{1} · id_{(F_{1})} = id_{G_{1}·F_{1}}.

(20) If F_{1} is transformable to F_{2}, then id_{B} · p = p.

(21) If G_{1} is transformable to G_{2}, then q · id_{B} = q.

3. The Composition of Transformations

Let A, B, C be transitive non empty category structures with units, let F_{1}, F_{2} be covariant functors from A to B, let G_{1}, G_{2} be covariant functors from B to C, let t be a transformation from F_{1} to F_{2}, and let s be a transformation from G_{1} to G_{2}. The functor s t yielding a transformation from G_{1} · F_{1} to G_{2} · F_{2} is defined as follows:

(Def. 3) s t = s · F_{2} ^{∘} G_{1} · t.

The following propositions are true:

(22) Let q be a natural transformation from G_{1} to G_{2}. Suppose F_{1} is transformable to F_{2} and G_{1} is naturally transformable to G_{2}. Then q p = G_{2} · p^{∘} q · F_{1}.

(23) If F_{1} is transformable to F_{2}, then id_{id_{B}} p = p.

(24) If G_{1} is transformable to G_{2}, then q id_{id_{B}} = q.

(25) If F_{1} is transformable to F_{2}, then G_{1} · p = id_{(G_{1})} p.

(26) If G_{1} is transformable to G_{2}, then q · F_{1} = q id_{(F_{1})} .

We use the following convention: A, B, C, D are categories, F_{1}, F_{2}, F_{3} are covariant functors from A to B, and G_{1}, G_{2}, G_{3} are covariant functors from B to C.

One can prove the following proposition

(27) Let H_{1}, H_{2} be covariant functors from C to D, t be a transformation from F_{1} to F_{2}, s be a transformation from G_{1} to G_{2}, and u be a transformation from H_{1} to H_{2}. Suppose F_{1} is transformable to F_{2} and G_{1} is transformable to G_{2} and H_{1} is transformable to H_{2}. Then (u s) t = u (s t).

In the sequel t denotes a natural transformation from F_{1} to F_{2}, s denotes a natural transformation from G_{1} to G_{2}, and s_{1} denotes a natural transformation from G_{2} to G_{3}.

One can prove the following propositions:

(28) If F_{1} is naturally transformable to F_{2}, then G_{1} · t is a natural transformation from G_{1} · F_{1} to G_{1} · F_{2}.

(29) If G_{1} is naturally transformable to G_{2}, then s · F_{1} is a natural transformation from G_{1} · F_{1} to G_{2} · F_{1}.

(30) Suppose F_{1} is naturally transformable to F_{2} and G_{1} is naturally transformable to G_{2}. Then G_{1} · F_{1} is naturally transformable to G_{2} · F_{2} and s t is a natural transformation from G_{1} · F_{1} to G_{2} · F_{2}.

(31) Let t be a transformation from F_{1} to F_{2} and t_{1} be a transformation from

F_{2} to F_{3}. Suppose that

(i) F_{1} is naturally transformable to F_{2}, (ii) F_{2} is naturally transformable to F_{3}, (iii) G_{1} is naturally transformable to G_{2}, and (iv) G_{2} is naturally transformable to G_{3}.

Then (s_{1} ^{∘} s) (t_{1} ^{∘} t) = s_{1} t_{1} ^{∘} s t.

4. Natural Equivalences

One can prove the following proposition

(32) Suppose F_{1} is naturally transformable to F_{2} and F_{2} is transformable to F_{1} and for every object a of A holds t[a] is iso. Then (i) F_{2} is naturally transformable to F_{1}, and (ii) there exists a natural transformation f from F_{2} to F_{1} such that for

every object a of A holds f(a) = t[a]^{−1} and f[a] is iso. Let A, B be categories and let F_{1}, F_{2} be covariant functors from A to B. We

say that F_{1}, F_{2} are naturally equivalent if and only if the conditions (Def. 4) are satisfied.

(Def. 4)(i) F_{1} is naturally transformable to F_{2}, (ii) F_{2} is transformable to F_{1}, and (iii) there exists a natural transformation t from F_{1} to F_{2} such that for

every object a of A holds t[a] is iso. Let us notice that the predicate F_{1}, F_{2} are naturally equivalent is reflexive and symmetric.

Let A, B be categories and let F_{1}, F_{2} be covariant functors from A to B. Let us assume that F_{1}, F_{2} are naturally equivalent. A natural transformation from F_{1} to F_{2} is said to be a natural equivalence of F_{1} and F_{2} if:

(Def. 5) For every object a of A holds it[a] is iso.

In the sequel e is a natural equivalence of F_{1} and F_{2}, e_{1} is a natural equivalence of F_{2} and F_{3}, and f is a natural equivalence of G_{1} and G_{2}.

One can prove the following propositions:

(33) Suppose F_{1}, F_{2} are naturally equivalent and F_{2}, F_{3} are naturally equivalent. Then F_{1}, F_{3} are naturally equivalent.

(34) Suppose F_{1}, F_{2} are naturally equivalent and F_{2}, F_{3} are naturally equivalent. Then e_{1} ^{∘} e is a natural equivalence of F_{1} and F_{3}.

(35) Suppose F_{1}, F_{2} are naturally equivalent. Then G_{1}·F_{1}, G_{1}·F_{2} are naturally equivalent and G_{1} · e is a natural equivalence of G_{1} · F_{1} and G_{1} · F_{2}.

(36) Suppose G_{1}, G_{2} are naturally equivalent. Then G_{1} · F_{1}, G_{2} · F_{1} are naturally equivalent and f · F_{1} is a natural equivalence of G_{1} · F_{1} and G_{2} · F_{1}.

(37) Suppose F_{1}, F_{2} are naturally equivalent and G_{1}, G_{2} are naturally equivalent. Then G_{1} · F_{1}, G_{2} · F_{2} are naturally equivalent and f e is a natural equivalence of G_{1} · F_{1} and G_{2} · F_{2}.

Let A, B be categories, let F_{1}, F_{2} be covariant functors from A to B, and let e be a natural equivalence of F_{1} and F_{2}. Let us assume that F_{1}, F_{2} are naturally equivalent. The functor e^{−1} yielding a natural equivalence of F_{2} and F_{1} is defined as follows:

(Def. 6) For every object a of A holds e^{−1} (a) = e[a]^{−1} .

The following propositions are true:

(38) For every object o of A such that F_{1}, F_{2} are naturally equivalent holds e^{−1} [o] = e[o]^{−1} .

(39) If F_{1}, F_{2} are naturally equivalent, then e^{∘} e^{−1} = id_{(F_{2})} .

the composition of functors and … 7

(40) If F_{1}, F_{2} are naturally equivalent, then e^{−1} ^{∘} e = id_{(F_{1})} .

Let A, B be categories and let F be a covariant functor from A to B. Then id_{F} is a natural equivalence of F and F.

The following three propositions are true:

(41) If F_{1}, F_{2} are naturally equivalent, then (e^{−1} )^{−1} = e.

(42) Let k be a natural equivalence of F_{1} and F_{3}. Suppose k = e_{1} ^{∘} e and F_{1}, F_{2} are naturally equivalent and F_{2}, F_{3} are naturally equivalent. Then k^{−1} = e^{−1} ^{∘} e_{1}^{−1} .

(43) (id_{(F_{1})})^{−1} = id_{(F_{1})} .

References

[1] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[2] Beata Madras. Basic properties of objects and morphisms. Formalized Mathematics, 6(3):329–334, 1997.

[3] Robert Nieszczerzewski. Category of functors between alternative categories. Formalized Mathematics, 6(3):371–375, 1997.

[4] Andrzej Trybulec. Many-sorted sets. Formalized Mathematics, 4(1):15–22, 1993.

[5] Andrzej Trybulec. Categories without uniqueness of cod and dom. Formalized Mathematics, 5(2):259–267, 1996.

[6] Andrzej Trybulec. Examples of category structures. Formalized Mathematics, 5(4):493– 500, 1996.

[7] Andrzej Trybulec. Functors for alternative categories. Formalized Mathematics, 5(4):595– 608, 1996.

[8] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[9] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

Received January 21, 1998 8 artur korniłowicz

Completely-Irreducible Elements^{1}

Robert Milewski University of Białystok

Summary. The article is a translation of [5, 92–93].

MML Identifier: WAYBEL16.

The terminology and notation used here are introduced in the following articles: [16], [1], [14], [12], [15], [13], [3], [4], [9], [6], [10], [11], [2], [7], and [8].

1. Preliminaries

The following propositions are true:

(1) For every sup-semilattice L and for all elements x, y of L holds ⌈−⌉_{L}(↑x ∩ ↑y) = x ⊔ y.

(2) For every semilattice L and for all elements x, y of L holds ⨆_{L}(↓x∩↓y) = x ⊓ y.

(3) Let L be a non empty relational structure and x, y be elements of L. If x is maximal in (the carrier of L) \ ↑y, then ↑x \ {x} = ↑x ∩ ↑y.

(4) Let L be a non empty relational structure and x, y be elements of L. If x is minimal in (the carrier of L) \ ↓y, then ↓x \ {x} = ↓x ∩ ↓y.

(5) Let L be a poset with l.u.b.’s, X, Y be subsets of L, and X′, Y′ be subsets of L^{op}. If X = X′ and Y = Y′, then X ⊔ Y = X′⊓ Y′.

(6) Let L be a poset with g.l.b.’s, X, Y be subsets of L, and X′, Y′ be subsets of L^{op}. If X = X′ and Y = Y′, then X ⊓ Y = X′⊔ Y′.

(7) For every non empty reflexive transitive relational structure L holds Filt(L) = Ids(L^{op}).

1This work has been supported by KBN Grant 8 T11C 018 12.

(8) For every non empty reflexive transitive relational structure L holds Ids(L) = Filt(L^{op}).

2. Free Generation Set

Let S, T be complete non empty posets. A map from S into T is said to be a CLHomomorphism of S, T if:

(Def. 1) It is directed-sups-preserving and infs-preserving.

Let S be a continuous complete non empty poset and let A be a subset of S. We say that A is a free generator set if and only if the condition (Def. 2) is satisfied.

(Def. 2) Let T be a continuous complete non empty poset and f be a function from A into the carrier of T. Then there exists a CLHomomorphism h of S, T such that h↾A = f and for every CLHomomorphism h′ of S, T such that h′↾A = f holds h′= h.

Let L be an upper-bounded non empty poset. One can check that Filt(L) is non empty.

The following propositions are true:

(9) For every set X and for every non empty subset Y of ⟨Filt(2_{⊆}^{X}), ⊆⟩ holds ⋂ Y is a filter of 2_{⊆}^{X}.

(10) For every set X and for every non empty subset Y of ⟨Filt(2_{⊆}^{X}), ⊆⟩ holds inf Y exists in ⟨Filt(2_{⊆}^{X}), ⊆⟩ and ⌈−⌉_{(⟨Filt(2_{⊆}^{X}),⊆⟩)}Y = ⋂ Y.

(11) For every set X holds 2^{X} is a filter of 2_{⊆}^{X}.

(12) For every set X holds {X} is a filter of 2_{⊆}^{X}.

(13) For every set X holds ⟨Filt(2_{⊆}^{X}), ⊆⟩ is upper-bounded.

(14) For every set X holds ⟨Filt(2_{⊆}^{X}), ⊆⟩ is lower-bounded.

(15) For every set X holds ⊤_{⟨Filt(2_{⊆}^{X}),⊆⟩} = 2^{X}.

(16) For every set X holds ⊥_{⟨Filt(2_{⊆}^{X}),⊆⟩} = {X}.

(17) For every non empty set X and for every non empty subset Y of ⟨X, ⊆⟩ such that sup Y exists in ⟨X, ⊆⟩ holds ⋃ Y ⊆ supY.

(18) For every upper-bounded semilattice L holds ⟨Filt(L), ⊆⟩ is complete. Let L be an upper-bounded semilattice. Note that ⟨Filt(L), ⊆⟩ is complete.

3. Completely-Irreducible Elements

Let L be a non empty relational structure and let p be an element of L. We say that p is completely-irreducible if and only if:

(Def. 3) Min ↑p \ {p} exists in L.

We now state the proposition

(19) Let L be a non empty relational structure and p be an element of L. If

p is completely-irreducible, then ⌈−⌉_{L}(↑p \ {p}) ≠ p. Let L be a non empty relational structure. The functor IrrL yielding a subset

of L is defined by: (Def. 4) For every element x of L holds x ∈ IrrL iff x is completely-irreducible.

The following propositions are true:

(20) Let L be a non empty poset and p be an element of L. Then p is completely-irreducible if and only if there exists an element q of L such that p < q and for every element s of L such that p < s holds q s and ↑p = {p} ∪ ↑q.

(21) For every upper-bounded non empty poset L holds ⊤_{L} ∉ IrrL.

(22) For every semilattice L holds IrrL ⊆ IRR(L).

(23) For every semilattice L and for every element x of L such that x is completely-irreducible holds x is irreducible.

(24) Let L be a non empty poset and x be an element of L. Suppose x is completely-irreducible. Let X be a subset of L. If inf X exists in L and x = inf X, then x ∈ X.

(25) For every non empty poset L and for every subset X of L such that X is order-generating holds IrrL ⊆ X.

(26) Let L be a complete lattice and p be an element of L. Given an element k of L such that p is maximal in (the carrier of L)\↑k. Then p is completelyirreducible.

(27) Let L be a transitive antisymmetric relational structure with l.u.b.’s and p, q, u be elements of L. Suppose p < q and for every element s of L such that p < s holds q s and u p̸. Then p ⊔ u = q ⊔ u.

(28) Let L be a distributive lattice and p, q, u be elements of L. Suppose p < q and for every element s of L such that p < s holds q s and u p̸. Then u ⊓ q p̸.

(29) Let L be a distributive complete lattice. Suppose L^{op} is meet-continuous. Let p be an element of L. Suppose p is completely-irreducible. Then (the carrier of L) \ ↓p is an open filter of L.

(30) Let L be a distributive complete lattice. Suppose L^{op} is meet-continuous. Let p be an element of L. Suppose p is completely-irreducible. Then there exists an element k of L such that k ∈ the carrier of CompactSublatt(L) and p is maximal in (the carrier of L) \ ↑k.

(31) Let L be a lower-bounded algebraic lattice and x, y be elements of L. Suppose y x̸. Then there exists an element p of L such that p is

12 robert milewski

completely-irreducible and x p and y p̸.

(32) Let L be a lower-bounded algebraic lattice. Then IrrL is order-generating and for every subset X of L such that X is order-generating holds IrrL ⊆ X.

(33) For every lower-bounded algebraic lattice L and for every element s of L holds s = ⌈−⌉_{L}(↑s ∩ IrrL).

(34) Let L be a complete non empty poset, X be a subset of L, and p be an element of L. If p is completely-irreducible and p = inf X, then p ∈ X.

(35) Let L be a complete algebraic lattice and p be an element of L. Suppose p is completely-irreducible. Then p = ⌈−⌉_{L}{x; x ranges over elements of L: x ∈ ↑p ∧ ⋁_{k: element of L} (k ∈ the carrier of CompactSublatt(L) ∧ x is maximal in (the carrier of L) \ ↑k)}.

(36) Let L be a complete algebraic lattice and p be an element of L. Then there exists an element k of L such that k ∈ the carrier of CompactSublatt(L) and p is maximal in (the carrier of L) \ ↑k if and only if p is completely-irreducible.

References

[1] Grzegorz Bancerek. Complete lattices. Formalized Mathematics, 2(5):719–725, 1991.

[2] Grzegorz Bancerek. Bounds in posets and relational substructures. Formalized Mathematics, 6(1):81–91, 1997.

[3] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[4] Czesław Byliński. Galois connections. Formalized Mathematics, 6(1):131–143, 1997.

[5] G. Gierz, K.H. Hofmann, K. Keimel, J.D. Lawson, M. Mislove, and D.S. Scott. A Compendium of Continuous Lattices. Springer-Verlag, Berlin, Heidelberg, New York, 1980.

[6] Adam Grabowski. Auxiliary and approximating relations. Formalized Mathematics, 6(2):179–188, 1997.

[7] Adam Grabowski and Robert Milewski. Boolean posets, posets under inclusion and products of relational structures. Formalized Mathematics, 6(1):117–121, 1997.

[8] Artur Korniłowicz. Definitions and properties of the join and meet of subsets. Formalized Mathematics, 6(1):153–158, 1997.

[9] Artur Korniłowicz. Meet–continuous lattices. Formalized Mathematics, 6(1):159–167, 1997.

[10] Beata Madras. Irreducible and prime elements. Formalized Mathematics, 6(2):233–239, 1997.

[11] Robert Milewski. Algebraic lattices. Formalized Mathematics, 6(2):249–254, 1997.

[12] Beata Padlewska. Families of sets. Formalized Mathematics, 1(1):147–152, 1990.

[13] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[14] Wojciech A. Trybulec. Partially ordered sets. Formalized Mathematics, 1(2):313–319, 1990.

[15] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[16] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

Scott-Continuous Functions^{1}

Adam Grabowski University of Białystok

Summary. The article is a translation of [7, pp. 112–113].

MML Identifier: WAYBEL17.

The articles [6], [2], [12], [1], [14], [8], [11], [15], [13], [4], [5], [10], [9], [3], and [16] provide the terminology and notation for this paper.

1. Preliminaries

Let S be a non empty set and let a, b be elements of S. The functor a, b, ... yields a function from ℕ into S and is defined by the condition (Def. 1).

(Def. 1) Let i be a natural number. Then

(i) if there exists a natural number k such that i = 2·k, then (a, b, ...)(i) = a, and

(ii) if it is not true that there exists a natural number k such that i = 2 · k,

then (a, b, ...)(i) = b. We now state two propositions:

(1) Let S, T be non empty reflexive relational structures, f be a map from S into T, and P be a lower subset of T. If f is monotone, then f^{−1} (P) is lower.

(2) Let S, T be non empty reflexive relational structures, f be a map from S into T, and P be an upper subset of T. If f is monotone, then f^{−1} (P) is upper.

1This work has been supported by KBN Grant 8 T11C 018 12.

Let T be an up-complete lattice and let S be an inaccessible subset of T. Note that − S is directly closed.

Next we state the proposition

(3) Let S, T be reflexive antisymmetric non empty relational structures and f be a map from S into T. If f is directed-sups-preserving, then f is monotone.

Let S, T be reflexive antisymmetric non empty relational structures. Observe that every map from S into T which is directed-sups-preserving is also monotone.

Next we state the proposition

(4) Let S, T be up-complete Scott top-lattices and f be a map from S into T. If f is continuous, then f is monotone.

2. Poset of Continuous Maps

Let S be a set and let T be a reflexive relational structure. One can verify that S ⟼→ T is reflexive-yielding.

Let S be a non empty set and let T be a complete lattice. Observe that T^{S} is complete.

Let S, T be up-complete Scott top-lattices. The functor SCMaps(S, T) yields a strict full relational substructure of MonMaps(S, T) and is defined by:

(Def. 2) For every map f from S into T holds f ∈ the carrier of SCMaps(S, T)

iff f is continuous. Let S, T be up-complete Scott top-lattices. Note that SCMaps(S, T) is non

empty.

3. Some Special Nets

Let S be a non empty relational structure and let a, b be elements of the carrier of S. The functor NetStr(a, b) yields a strict non empty net structure over S and is defined by the conditions (Def. 3).

(Def. 3)(i) The carrier of NetStr(a, b) = ℕ, (ii) the mapping of NetStr(a, b) = a, b, ..., and (iii) for all elements i, j of the carrier of NetStr(a, b) and for all natural

numbers i′, j′ such that i = i′ and j = j′ holds i j iff i′ j′. Let S be a non empty relational structure and let a, b be elements of the

carrier of S. Note that NetStr(a, b) is reflexive transitive directed and antisymmetric.

We now state four propositions:

(5) Let S be a non empty relational structure, a, b be elements of the carrier of S, and i be an element of the carrier of NetStr(a, b). Then (NetStr(a, b))(i) = a or (NetStr(a, b))(i) = b.

(6) Let S be a non empty relational structure, a, b be elements of the carrier of S, i, j be elements of the carrier of NetStr(a, b), and i′, j′ be natural numbers such that i′= i and j′= i′+ 1 and j′= j. Then

(i) if (NetStr(a, b))(i) = a, then (NetStr(a, b))(j) = b, and (ii) if (NetStr(a, b))(i) = b, then (NetStr(a, b))(j) = a.

(7) For every poset S with g.l.b.’s and for all elements a, b of the carrier of S holds lim inf NetStr(a, b) = a ⊓ b.

(8) Let S, T be posets with g.l.b.’s, a, b be elements of the carrier of S, and f be a map from S into T. Then lim inf(f · NetStr(a, b)) = f(a) ⊓ f(b).

Let S be a non empty relational structure and let D be a non empty subset of S. The functor NetStr(D) yielding a strict net structure over S is defined by:

(Def. 4) NetStr(D) = ⟨D, (the internal relation of S) |^{2} D, id_{the carrier of S}↾D⟩. We now state the proposition

(9) Let S be a non empty reflexive relational structure and D be a non empty subset of S. Then NetStr(D) = NetStr(D, id_{the carrier of S}↾D).

Let S be a non empty reflexive relational structure and let D be a directed non empty subset of S. Note that NetStr(D) is non empty directed and reflexive.

Let S be a non empty reflexive transitive relational structure and let D be a directed non empty subset of S. One can check that NetStr(D) is transitive.

Let S be a non empty reflexive relational structure and let D be a directed non empty subset of S. Observe that NetStr(D) is monotone.

We now state the proposition

(10) For every up-complete lattice S and for every directed non empty subset D of S holds lim inf NetStr(D) = supD.

4. Monotone Maps

We now state several propositions:

(11) Let S, T be lattices and f be a map from S into T. If for every net N in S holds f(lim inf N) lim inf(f · N), then f is monotone.

(12) Let S, T be continuous lower-bounded lattices and f be a map from S into T. Suppose f is directed-sups-preserving. Let x be an element of S. Then f(x) = ⨆_{T} {f(w); w ranges over elements of S: w ≪ x}.

(13) Let S be a lattice, T be an up-complete lower-bounded lattice, and f be a map from S into T. Suppose that for every element x of S holds f(x) = ⨆_{T} {f(w); w ranges over elements of S: w ≪ x}. Then f is monotone.

(14) Let S be an up-complete lower-bounded lattice, T be a continuous lowerbounded lattice, and f be a map from S into T. Suppose that for every element x of S holds f(x) = ⨆_{T} {f(w); w ranges over elements of S: w ≪ x}. Let x be an element of S and y be an element of T. Then y ≪ f(x) if and only if there exists an element w of S such that w ≪ x and y ≪ f(w).

(15) Let S, T be non empty relational structures, D be a subset of S, and f be a map from S into T. Suppose that

(i) sup D exists in S and sup f^{∘}D exists in T, or

(ii) S is complete and antisymmetric and T is complete and antisymmetric.

If f is monotone, then sup(f^{∘}D) f(supD).

(16) Let S, T be non empty reflexive antisymmetric relational structures, D be a directed non empty subset of S, and f be a map from S into T. Suppose sup D exists in S and sup f^{∘}D exists in T or S is up-complete and T is up-complete. If f is monotone, then sup(f^{∘}D) f(supD).

(17) Let S, T be non empty relational structures, D be a subset of S, and f be a map from S into T. Suppose that

(i) inf D exists in S and inf f^{∘}D exists in T, or

(ii) S is complete and antisymmetric and T is complete and antisymmetric.

If f is monotone, then f(inf D) inf(f^{∘}D).

(18) Let S, T be up-complete lattices, f be a map from S into T, and N be a monotone non empty net structure over S. If f is monotone, then f · N is monotone.

Let S, T be up-complete lattices, let f be a monotone map from S into T, and let N be a monotone non empty net structure over S. Observe that f · N is monotone.

The following two propositions are true:

(19) Let S, T be up-complete lattices and f be a map from S into T. Suppose that for every net N in S holds f(lim inf N) lim inf(f · N). Let D be a directed non empty subset of S. Then sup(f^{∘}D) = f(supD).

(20) Let S, T be complete lattices, f be a map from S into T, N be a net in S, j be an element of the carrier of N, and j′ be an element of the carrier of f · N. Suppose j′ = j. Suppose f is monotone. Then f(⌈−⌉_{S}{N(k); k ranges over elements of the carrier of N: k j}) ⌈−⌉_{T} {(f ·N)(l); l ranges over elements of the carrier of f · N : l j′}.

5. Necessary and Sufficient Conditions of Scott-continuity

We now state two propositions:

(21) Let S, T be complete Scott top-lattices and f be a map from S into T. Then f is continuous if and only if for every net N in S holds f(lim inf N) lim inf(f · N).

(22) Let S, T be complete Scott top-lattices and f be a map from S into T.

Then f is continuous if and only if f is directed-sups-preserving. Let S, T be complete Scott top-lattices. Observe that every map from S into

T which is continuous is also directed-sups-preserving and every map from S into T which is directed-sups-preserving is also continuous.

One can prove the following propositions:

(23) Let S, T be continuous complete Scott top-lattices and f be a map from S into T. Then f is continuous if and only if for every element x of S and for every element y of T holds y ≪ f(x) iff there exists an element w of S such that w ≪ x and y ≪ f(w).

(24) Let S, T be continuous complete Scott top-lattices and f be a map from S into T. Then f is continuous if and only if for every element x of S holds f(x) = ⨆_{T} {f(w); w ranges over elements of S: w ≪ x}.

(25) Let S be a lattice, T be a complete lattice, and f be a map from S into T. Suppose that for every element x of S holds f(x) = ⨆_{T} {f(w); w ranges over elements of S: w x ∧ w is compact}. Then f is monotone.

(26) Let S, T be complete Scott top-lattices and f be a map from S into T. Suppose that for every element x of S holds f(x) = ⨆_{T} {f(w); w ranges over elements of S: w x ∧ w is compact}. Let x be an element of S. Then f(x) = ⨆_{T} {f(w); w ranges over elements of S: w ≪ x}.

(27) Let S, T be complete Scott top-lattices and f be a map from S into T. Suppose S is algebraic and T is algebraic. Then f is continuous if and only if for every element x of S and for every element k of T such that k ∈ the carrier of CompactSublatt(T) holds k f(x) iff there exists an element j of S such that j ∈ the carrier of CompactSublatt(S) and j x and k f(j).

(28) Let S, T be complete Scott top-lattices and f be a map from S into T. Suppose S is algebraic and T is algebraic. Then f is continuous if and only if for every element x of S holds f(x) = ⨆_{T} {f(w); w ranges over elements of S: w x ∧ w is compact}.

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

18 adam grabowski

[2] Grzegorz Bancerek. Complete lattices. Formalized Mathematics, 2(5):719–725, 1991.

[3] Grzegorz Bancerek. Bounds in posets and relational substructures. Formalized Mathematics, 6(1):81–91, 1997.

[4] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[5] Grzegorz Bancerek. The “way-below” relation. Formalized Mathematics, 6(1):169–176, 1997.

[6] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[7] G. Gierz, K.H. Hofmann, K. Keimel, J.D. Lawson, M. Mislove, and D.S. Scott. A Compendium of Continuous Lattices. Springer-Verlag, Berlin, Heidelberg, New York, 1980.

[8] Adam Grabowski. On the category of posets. Formalized Mathematics, 5(4):501–505, 1996.

[9] Artur Korniłowicz. On the topological properties of meet-continuous lattices. Formalized Mathematics, 6(2):269–277, 1997.

[10] Robert Milewski. Algebraic lattices. Formalized Mathematics, 6(2):249–254, 1997.

[11] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[12] Andrzej Trybulec. Natural transformations. Discrete categories. Formalized Mathematics, 2(4):467–474, 1991.

[13] Andrzej Trybulec. Scott topology. Formalized Mathematics, 6(2):311–319, 1997.

[14] Wojciech A. Trybulec. Partially ordered sets. Formalized Mathematics, 1(2):313–319, 1990.

[15] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[16] Mariusz Żynel and Czesław Byliński. Properties of relational structures, posets, lattices and maps. Formalized Mathematics, 6(1):123–130, 1997.

Natural Numbers

Robert Milewski University of Białystok

MML Identifier: NAT 2.

The papers [6], [4], [2], [7], [1], [3], [5], and [8] provide the terminology and notation for this paper.

1. Preliminaries

In this article we present several logical schemes. The scheme NonUniqRecExD deals with a non empty set A, an element B of A, and a ternary predicate P, and states that:

There exists a function f from ℕ into A such that f(0) = B and for every element n of ℕ holds P[n, f(n), f(n + 1)]

provided the following condition is satisfied:

• For every natural number n and for every element x of A there exists an element y of A such that P[n, x, y].

The scheme NonUniqFinRecExD deals with a non empty set A, an element B of A, a natural number C, and a ternary predicate P, and states that:

There exists a finite sequence p of elements of A such that lenp = C but p(1) = B or C = 0 but for every natural number n such that 1 n and n C − 1 holds P[n, p(n), p(n + 1)]

provided the parameters meet the following requirement:

• Let n be a natural number. Suppose 1 n and n C − 1. Let x be an element of A. Then there exists an element y of A such that P[n, x, y].

The scheme NonUniqPiFinRecExD deals with a non empty set A, an element B of A, a natural number C, and a ternary predicate P, and states that:

There exists a finite sequence p of elements of A such that lenp = C but π_{1}p = B or C = 0 but for every natural number n such that 1 n and n C − 1 holds P[n, π_{n}p, π_{n+1}p]

provided the following condition is met:

• Let n be a natural number. Suppose 1 n and n C − 1. Let x be an element of A. Then there exists an element y of A such that P[n, x, y].

The following two propositions are true:

(1) For every real number x holds x < ⌊x⌋+ 1.

(2) For all real numbers x, y such that x 0 and y > 0 holds \frac{x}{⌊\frac{x}{y} ⌋+1} < y.

2. Division and Rest of Division

The following propositions are true:

(3) For every natural number n holds n is empty iff n = 0.

(4) For every natural number n holds 0 ÷ n = 0.

(5) For every non empty natural number n holds n ÷ n = 1.

(6) For every natural number n holds n ÷ 1 = n.

(7) For all natural numbers i, j, k, l such that i j and k j holds if i = (j − ′k) + l, then k = (j − ′i) + l.

(8) For all natural numbers i, n such that i ∈ Segn holds (n− ′i)+1 ∈ Segn.

(9) For all natural numbers i, j such that j < i holds (i− ′(j +1))+1 = i− ′j.

(10) For all natural numbers i, j such that i j holds j − ′i = 0.

(11) For all non empty natural numbers i, j holds i − ′j < i.

(12) Let n, k be natural numbers. Suppose k n. Then the n-th power of 2 = (the k-th power of 2) ·(the (n − ′k)-th power of 2).

(13) For all natural numbers n, k such that k n holds the k-th power of 2 | the n-th power of 2.

(14) For all natural numbers n, k such that k > 0 and n ÷ k = 0 holds n < k.

(15) For all natural numbers n, k such that k > 0 and k n holds n ÷ k 1.

(16) For all natural numbers n, k such that k ≠ 0 holds (n+k)÷k = (n÷k)+1.

(17) For all natural numbers n, k, i such that k | n and 1 n and 1 i and i k holds (n − ′i) ÷ k = (n ÷ k) − 1.

(18) Let n, k be natural numbers. Suppose k n. Then (the n-th power of 2) ÷(the k-th power of 2) = the (n − ′k)-th power of 2.

(19) For every natural number n such that n > 0 holds (the n-th power of 2) mod 2 = 0.

(20) For every natural number n such that n > 0 holds n mod 2 = 0 iff (n − ′1) mod 2 = 1.

(21) For every non empty natural number n such that n ≠ 1 holds n > 1.

(22) For all natural numbers n, k such that n k and k < n + n holds k ÷ n = 1.

(23) For every natural number n holds n is even iff n mod 2 = 0.

(24) For every natural number n holds n is odd iff n mod 2 = 1.

(25) For all natural numbers n, k, t such that 1 t and k n and 2 · t | k holds n ÷ t is even iff (n − ′k) ÷ t is even.

(26) For all natural numbers n, m, k such that n m holds n ÷ k m ÷ k.

(27) For all natural numbers n, k such that k 2 · n holds (k + 1) ÷ 2 n.

(28) For every even natural number n holds n ÷ 2 = (n + 1) ÷ 2.

(29) For all natural numbers n, k, i holds n ÷ k ÷ i = n ÷ k · i.

Let n be a natural number. We say that n is non trivial if and only if: (Def. 1) n ≠ 0 and n ≠ 1.

One can verify that every natural number which is non trivial is also non empty.

One can check that there exists a natural number which is non trivial.

The following two propositions are true:

(30) For every natural number k holds k is non trivial iff k is non empty and k ≠ 1.

(31) For every non trivial natural number k holds k 2.

The scheme Ind from 2 concerns a unary predicate P, and states that:

For every non trivial natural number k holds P[k] provided the following conditions are met:

• P[2], and

• For every non trivial natural number k such that P[k] holds P[k+ 1].

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[2] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[3] Krzysztof Hryniewiecki. Basic properties of real numbers. Formalized Mathematics, 1(1):35–40, 1990.

[4] Takaya Nishiyama and Yasuho Mizuhara. Binary arithmetics. Formalized Mathematics, 4(1):83–86, 1993.

[5] Konrad Raczkowski and Andrzej Nędzusiak. Serieses. Formalized Mathematics, 2(4):449– 452, 1991.

[6] Piotr Rudnicki and Andrzej Trybulec. Abian’s fixed point theorem. Formalized Mathematics, 6(3):335–338, 1997.

[7] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

22 robert milewski

[8] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

Received February 23, 1998

Binary Arithmetics. Binary Sequences

Robert Milewski University of Białystok

MML Identifier: BINARI 3.

The notation and terminology used here are introduced in the following papers: [10], [9], [7], [3], [2], [4], [12], [6], [5], [14], [1], [8], [15], [11], and [13].

1. Binary Arithmetics

The following propositions are true:

(1) For every non empty natural number n and for every tuple F of n and Boolean holds Absval(F) < the n-th power of 2.

(2) For every non empty natural number n and for all tuples F_{1}, F_{2} of n and Boolean such that Absval(F_{1}) = Absval(F_{2}) holds F_{1} = F_{2}.

(3) For all finite sequences t_{1}, t_{2} such that Rev(t_{1}) = Rev(t_{2}) holds t_{1} = t_{2}.

(4) For every natural number n holds ⟨\underbrace{0, …, 0}_{n+1}⟩ = ⟨\underbrace{0, …, 0}_{n}⟩^{⌢} ⟨0⟩.

(5) For every natural number n holds ⟨\underbrace{0, …, 0}_{n}⟩ ∈ Boolean^{∗}.

(6) For every natural number n and for every tuple y of n and Boolean such

that y = ⟨\underbrace{0, …, 0}_{n}⟩ holds ¬y = n ↦ 1.

(7) For every non empty natural number n and for every tuple F of n and Boolean such that F = ⟨\underbrace{0, …, 0}_{n}⟩ holds Absval(F) = 0.

(8) Let n be a non empty natural number and F be a tuple of n and Boolean. If F = ⟨\underbrace{0, …, 0}_{n}⟩, then Absval(¬F) = (the n-th power of 2)−1.

(9) For every natural number n holds Rev(⟨\underbrace{0, …, 0}_{n}⟩) = ⟨\underbrace{0, …, 0}_{n}⟩.

(10) For every natural number n and for every tuple y of n and Boolean such

that y = ⟨\underbrace{0, …, 0}_{n}⟩ holds Rev(¬y) = ¬y.

(11) Bin1(1) = ⟨true⟩.

(12) For every non empty natural number n holds Absval(Bin1(n)) = 1.

(13) For all elements x, y of Boolean holds x ∨ y = true iff x = true or y = true and x ∨ y = false iff x = false and y = false.

(14) For all elements x, y of Boolean holds add ovfl(⟨x⟩, ⟨y⟩) = true iff x = true and y = true.

(15) ¬⟨false⟩ = ⟨true⟩.

(16) ¬⟨true⟩ = ⟨false⟩.

(17) ⟨false⟩ + ⟨false⟩ = ⟨false⟩.

(18) ⟨false⟩ + ⟨true⟩ = ⟨true⟩ and ⟨true⟩ + ⟨false⟩ = ⟨true⟩.

(19) ⟨true⟩ + ⟨true⟩ = ⟨false⟩.

(20) Let n be a non empty natural number and x, y be tuples of n and Boolean. Suppose π_{n}x = true and π_{n} carry(x, Bin1(n)) = true. Let k be a non empty natural number. If k ≠ 1 and k n, then π_{k}x = true and π_{k} carry(x, Bin1(n)) = true.

(21) For every non empty natural number n and for every tuple x of n and Boolean such that π_{n}x = true and π_{n} carry(x, Bin1(n)) = true holds carry(x, Bin1(n)) = ¬ Bin1(n).

(22) Let n be a non empty natural number and x, y be tuples of n and Boolean. If y = ⟨\underbrace{0, …, 0}_{n}⟩ and π_{n}x = true and π_{n} carry(x, Bin1(n)) = true,

then x = ¬y.

(23) For every non empty natural number n and for every tuple y of n and Boolean such that y = ⟨\underbrace{0, …, 0}_{n}⟩ holds carry(¬y, Bin1(n)) = ¬ Bin1(n).

(24) Let n be a non empty natural number and x, y be tuples of n and Boolean. If y = ⟨\underbrace{0, …, 0}_{n}⟩, then add ovfl(x, Bin1(n)) = true iff x = ¬y.

(25) For every non empty natural number n and for every tuple z of n and Boolean such that z = ⟨\underbrace{0, …, 0}_{n}⟩ holds ¬z + Bin1(n) = z.

2. Binary Sequences

Let n, k be natural numbers. The functor n -BinarySequence(k) yielding a tuple of n and Boolean is defined by:

(Def. 1) For every natural number i such that i ∈ Segn holds π_{i}(n -BinarySequence(k)) = ((k ÷ (the (i − ′1)-th power of 2)) mod 2 = 0 → false, true).

One can prove the following propositions:

(26) For every natural number n holds n -BinarySequence(0) = ⟨\underbrace{0, …, 0}_{n}⟩.

(27) For all natural numbers n, k such that k < the n-th power of 2 holds ((n + 1) -BinarySequence(k))(n + 1) = false.

(28) Let n be a non empty natural number and k be a natural number. If k < the n-th power of 2, then (n + 1) -BinarySequence(k) = (n -BinarySequence(k))^{⌢} ⟨false⟩.

(29) For every non empty natural number n holds (n+1) -BinarySequence(the n-th power of 2) = ⟨\underbrace{0, …, 0}_{n}⟩^{⌢} ⟨true⟩.

(30) Let n be a non empty natural number and k be a natural number. Suppose the n-th power of 2 k and k < the (n + 1)-th power of 2. Then ((n + 1) -BinarySequence(k))(n + 1) = true.

(31) Let n be a non empty natural number and k be a natural number. Suppose the n-th power of 2 k and k < the (n + 1)-th power of 2. Then (n + 1) -BinarySequence(k) = (n -BinarySequence(k − ′(the n-th power of 2)))^{⌢}⟨true⟩.

(32) Let n be a non empty natural number and k be a natural number. Suppose k < the n-th power of 2. Let x be a tuple of n and Boolean. If x = ⟨\underbrace{0, …, 0}_{n}⟩, then n -BinarySequence(k) = ¬x iff k = (the n-th power of

2)−1.

(33) Let n be a non empty natural number and k be a natural number. If k + 1 < the n-th power of 2, then add ovfl(n -BinarySequence(k), Bin1(n)) = false.

(34) Let n be a non empty natural number and k be a natural number. If k + 1 < the n-th power of 2, then n -BinarySequence(k + 1) = (n -BinarySequence(k)) + Bin1(n).

(35) For all natural numbers n, i holds (n + 1) -BinarySequence(i) = ⟨i mod 2⟩^{⌢} (n -BinarySequence(i ÷ 2)).

(36) For every non empty natural number n and for every natural number k such that k < the n-th power of 2 holds Absval(n -BinarySequence(k)) = k.

(37) For every non empty natural number n and for every tuple x of n and Boolean holds n -BinarySequence(Absval(x)) = x.

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[2] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[3] Czesław Byliński. Binary operations applied to finite sequences. Formalized Mathematics, 1(4):643–649, 1990.

[4] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[5] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[6] Czesław Byliński. Some properties of restrictions of finite sequences. Formalized Mathematics, 5(2):241–245, 1996.

[7] Agata Darmochwał. The Euclidean space. Formalized Mathematics, 2(4):599–603, 1991.

[8] Krzysztof Hryniewiecki. Basic properties of real numbers. Formalized Mathematics, 1(1):35–40, 1990.

[9] Yasuho Mizuhara and Takaya Nishiyama. Binary arithmetics, addition and subtraction of integers. Formalized Mathematics, 5(1):27–29, 1996.

[10] Takaya Nishiyama and Yasuho Mizuhara. Binary arithmetics. Formalized Mathematics, 4(1):83–86, 1993.

[11] Konrad Raczkowski and Andrzej Nędzusiak. Serieses. Formalized Mathematics, 2(4):449– 452, 1991.

[12] Wojciech A. Trybulec. Pigeon hole principle. Formalized Mathematics, 1(3):575–579, 1990.

[13] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[14] Edmund Woronowicz. Many–argument relations. Formalized Mathematics, 1(4):733–737, 1990.

[15] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

Full Trees

Robert Milewski University of Białystok

MML Identifier: BINTREE2.

The articles [13], [12], [6], [17], [1], [15], [11], [5], [7], [10], [8], [18], [2], [19], [14], [16], [3], [4], and [9] provide the terminology and notation for this paper.

1. Trees and Binary Trees

One can prove the following propositions:

(1) For every set D and for every finite sequence p and for every natural number n such that p ∈ D^{∗} holds p↾ Segn ∈ D^{∗}.

(2) For every binary tree T holds every element of T is a finite sequence of elements of Boolean.

Let T be a binary tree. We see that the element of T is a finite sequence of elements of Boolean.

Next we state several propositions:

(3) For every tree T such that T = {0, 1}^{∗} holds T is binary.

(4) For every tree T such that T = {0, 1}^{∗} holds Leaves(T) = ∅.

(5) Let T be a binary tree, n be a natural number, and t be an element of T. If t ∈ T -level(n), then t is a tuple of n and Boolean.

(6) For every tree T such that for every element t of T holds succt = {t^{⌢} ⟨0⟩, t^{⌢} ⟨1⟩} holds Leaves(T) = ∅.

(7) For every tree T such that for every element t of T holds succt = {t^{⌢} ⟨0⟩, t^{⌢} ⟨1⟩} holds T is binary.

(8) For every tree T holds T = {0, 1}^{∗} iff for every element t of T holds succt = {t^{⌢} ⟨0⟩, t^{⌢} ⟨1⟩}.

In this article we present several logical schemes. The scheme Decorated-BinTreeEx deals with a non empty set A, an element B of A, and a ternary predicate P, and states that:

There exists a binary tree D decorated with elements of A such that domD = {0, 1}^{∗} and D(ε) = B and for every node x of D holds P[D(x), D(x^{⌢} ⟨0⟩), D(x^{⌢} ⟨1⟩)]

provided the following requirement is met:

• For every element a of A there exist elements b, c of A such that P[a, b, c].

The scheme DecoratedBinTreeEx1 deals with a non empty set A, an element B of A, and two binary predicates P, Q, and states that:

There exists a binary tree D decorated with elements of A such that domD = {0, 1}^{∗} and D(ε) = B and for every node x of D holds P[D(x), D(x^{⌢} ⟨0⟩)] and Q[D(x), D(x^{⌢} ⟨1⟩)]

provided the following requirements are met:

• For every element a of A there exists an element b of A such that P[a, b], and

• For every element a of A there exists an element b of A such that Q[a, b].

Let T be a binary tree and let n be a non empty natural number. The functor NumberOnLevel(n, T) yields a function from T -level(n) into ℕ and is defined as follows:

(Def. 1) For every element t of T such that t ∈ T -level(n) and for every tuple F of n and Boolean such that F = Rev(t) holds (NumberOnLevel(n, T))(t) = Absval(F) + 1.

Let T be a binary tree and let n be a non empty natural number. Note that NumberOnLevel(n, T) is one-to-one.

2. Full Trees

Let T be a tree. We say that T is full if and only if: (Def. 2) T = {0, 1}^{∗}.

We now state three propositions:

(9) {0, 1}^{∗} is a tree.

(10) For every tree T such that T = {0, 1}^{∗} and for every natural number n

holds ⟨\underbrace{0, …, 0}_{n}⟩ ∈ T -level(n).

(11) Let T be a tree. Suppose T = {0, 1}^{∗}. Let n be a non empty natural number and y be a tuple of n and Boolean. Then y ∈ T -level(n).

Let T be a binary tree and let n be a natural number. Observe that T -level(n) is finite.

One can check that every tree which is full is also binary. One can verify that there exists a tree which is full. One can prove the following proposition

(12) For every full tree T and for every non empty natural number n holds

Seg(the n-th power of 2) ⊆ rngNumberOnLevel(n, T). Let T be a full tree and let n be a non empty natural number. The functor

FinSeqLevel(n, T) yielding a finite sequence of elements of T -level(n) is defined by:

(Def. 3) FinSeqLevel(n, T) = (NumberOnLevel(n, T))^{−1} .

Let T be a full tree and let n be a non empty natural number. Note that FinSeqLevel(n, T) is one-to-one.

Next we state a number of propositions:

(13) For every full tree T and for every non empty natural number n holds (NumberOnLevel(n, T))(⟨\underbrace{0, …, 0}_{n}⟩) = 1.

(14) Let T be a full tree, n be a non empty natural number, and y be a tuple of n and Boolean. If y = ⟨\underbrace{0, …, 0}_{n}⟩, then (NumberOnLevel(n, T))(¬y) = the

n-th power of 2.

(15) For every full tree T and for every non empty natural number n holds (FinSeqLevel(n, T))(1) = ⟨\underbrace{0, …, 0}_{n}⟩.

(16) Let T be a full tree, n be a non empty natural number, and y be a tuple of n and Boolean. If y = ⟨\underbrace{0, …, 0}_{n}⟩, then (FinSeqLevel(n, T))(the

n-th power of 2) = ¬y.

(17) Let T be a full tree, n be a non empty natural number, and i be a natural number. If i ∈ Seg(the n-th power of 2), then (FinSeqLevel(n, T))(i) = Rev(n -BinarySequence(i − ′1)).

(18) For every full tree T and for every natural number n holds \overline{\overline{T -level(n)}} = the n-th power of 2.

(19) For every full tree T and for every non empty natural number n holds lenFinSeqLevel(n, T) = the n-th power of 2.

(20) For every full tree T and for every non empty natural number n holds domFinSeqLevel(n, T) = Seg(the n-th power of 2).

(21) For every full tree T and for every non empty natural number n holds rngFinSeqLevel(n, T) = T -level(n).

(22) For every full tree T holds (FinSeqLevel(1, T))(1) = ⟨0⟩.

(23) For every full tree T holds (FinSeqLevel(1, T))(2) = ⟨1⟩.

(24) Let T be a full tree and n, i be non empty natural numbers. Suppose i the (n + 1)-th power of 2. Let F be a tuple of n and Boolean. If F = (FinSeqLevel(n, T))((i + 1) ÷ 2), then (FinSeqLevel(n + 1, T))(i) = F ^{⌢} ⟨(i + 1) mod 2⟩.

References

[1] Grzegorz Bancerek. Cardinal numbers. Formalized Mathematics, 1(2):377–382, 1990.

[2] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[3] Grzegorz Bancerek. Introduction to trees. Formalized Mathematics, 1(2):421–427, 1990.

[4] Grzegorz Bancerek. König’s lemma. Formalized Mathematics, 2(3):397–402, 1991.

[5] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[6] Grzegorz Bancerek and Piotr Rudnicki. On defining functions on binary trees. Formalized Mathematics, 5(1):9–13, 1996.

[7] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[8] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[9] Czesław Byliński. Some basic properties of sets. Formalized Mathematics, 1(1):47–53, 1990.

[10] Czesław Byliński. Some properties of restrictions of finite sequences. Formalized Mathematics, 5(2):241–245, 1996.

[11] Agata Darmochwał. The Euclidean space. Formalized Mathematics, 2(4):599–603, 1991.

[12] Robert Milewski. Binary arithmetics. Binary sequences. Formalized Mathematics, 7(1):23–26, 1998.

[13] Takaya Nishiyama and Yasuho Mizuhara. Binary arithmetics. Formalized Mathematics, 4(1):83–86, 1993.

[14] Konrad Raczkowski and Andrzej Nędzusiak. Serieses. Formalized Mathematics, 2(4):449– 452, 1991.

[15] Andrzej Trybulec. Domains and their Cartesian products. Formalized Mathematics, 1(1):115–122, 1990.

[16] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[17] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[18] Edmund Woronowicz. Many–argument relations. Formalized Mathematics, 1(4):733–737, 1990.

[19] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

On T_{1} Reflex of Topological Space

Adam Naumowicz University of Białystok

Mariusz Łapiński University of Białystok

Summary. This article contains a definition of T_{1} reflex of a topological space as a quotient space which is T_{1} and fulfils the condition that every continuous map f from a topological space T into S being T_{1} space can be considered as a superposition of two continuous maps: the first from T onto its T_{1} reflex and the last from T_{1} reflex of T into S.

MML Identifier: T 1TOPSP.

The articles [11], [9], [7], [2], [3], [6], [12], [5], [10], [8], [4], and [1] provide the notation and terminology for this paper.

In this paper X denotes a non empty set and w denotes a set. One can prove the following propositions:

(1) For every set y and for all functions f, g holds (f ·g)^{−1} (y) = g^{−1} (f^{−1} (y)).

(2) Let T be a non empty topological space, A be a non empty partition of the carrier of T, and y be a subset of the carrier of the decomposition space of A. Then (the projection onto A)^{−1} (y) = ⋃ y.

(3) For every non empty set X and for every partition S of X and for every subset A of S holds ⋃ S \ ⋃ A = ⋃(S \ A).

(4) For every non empty set X and for every subset A of X and for every partition S of X such that A ∈ S holds ⋃(S \ {A}) = X \ A.

(5) Let T be a non empty topological space, S be a non empty partition of the carrier of T, A be a subset of the decomposition space of S, and B be a subset of T. If B = ⋃ A, then A is closed iff B is closed.

Let X be a non empty set, let x be an element of X, and let S_{1} be a partition of X. The functor EqClass(x, S_{1}) yielding a subset of X is defined by:

(Def. 1) x ∈ EqClass(x, S_{1}) and EqClass(x, S_{1}) ∈ S_{1}. Next we state two propositions:

(6) For all partitions S_{1}, S_{2} of X such that for every element x of X holds EqClass(x, S_{1}) = EqClass(x, S_{2}) holds S_{1} = S_{2}.

(7) For every non empty set X holds {X} is a partition of X. Let X be a set. Partition family of X is defined by:

(Def. 2) For every set S such that S ∈ it holds S is a partition of X.

Let X be a non empty set. One can check that there exists a partition of X which is non empty.

One can prove the following proposition

(8) For every set X and for every partition p of X holds {p} is a partition family of X.

Let X be a set. One can check that there exists a partition family of X which is non empty.

Next we state two propositions:

(9) For every partition S_{1} of X and for all elements x, y of X such that EqClass(x, S_{1}) meets EqClass(y, S_{1}) holds EqClass(x, S_{1}) = EqClass(y, S_{1}).

(10) Let A be a set, X be a non empty set, and S be a partition of X. If

A ∈ S, then there exists an element x of X such that A = EqClass(x, S). Let X be a non empty set and let F be a non empty partition family of X.

The functor IntersectionF yields a non empty partition of X and is defined as follows:

(Def. 3) For every element x of X holds EqClass(x, IntersectionF) =

⋂{EqClass(x, S); S ranges over partitions of X: S ∈ F }. In the sequel T denotes a non empty topological space. One can prove the following proposition

(11) {A; A ranges over partitions of the carrier of T: A is closed} is a partition

family of the carrier of T. Let us consider T. The functor ClosedPartitionsT yields a non empty par-

tition family of the carrier of T and is defined by: (Def. 4) ClosedPartitionsT = {A; A ranges over partitions of the carrier of T: A

is closed}. Let T be a non empty topological space. The functor T_{1}-reflexT yields a

topological space and is defined as follows: (Def. 5) T_{1}-reflexT = the decomposition space of IntersectionClosedPartitionsT.

Let us consider T. Note that T_{1}-reflexT is strict and non empty. Next we state the proposition

(12) For every non empty topological space T holds T_{1}-reflexT is a T_{1} space. Let T be a non empty topological space. The functor T_{1}-reflectT yielding a

continuous map from T into T_{1}-reflexT is defined as follows:

on T_{1} reflex of topological space 33

(Def. 6) T_{1}-reflectT = the projection onto IntersectionClosedPartitionsT.

The following four propositions are true:

(13) Let T, T_{1} be non empty topological spaces and f be a continuous map

from T into T_{1}. Suppose T_{1} is a T_{1} space. Then

(i) {f^{−1} ({z}); z ranges over elements of T_{1}: z ∈ rngf} is a partition of the carrier of T, and

(ii) for every subset A of T such that A ∈ {f^{−1} ({z}); z ranges over elements

of T_{1}: z ∈ rngf} holds A is closed.

(14) Let T, T_{1} be non empty topological spaces and f be a continuous map from T into T_{1}. Suppose T_{1} is a T_{1} space. Let given w and x be an element of T. If w = EqClass(x, IntersectionClosedPartitionsT), then w ⊆ f^{−1} ({f(x)}).

(15) Let T, T_{1} be non empty topological spaces and f be a continuous map from T into T_{1}. Suppose T_{1} is a T_{1} space. Let given w. Suppose w ∈ the carrier of T_{1}-reflexT. Then there exists an element z of T_{1} such that z ∈ rngf and w ⊆ f^{−1} ({z}).

(16) Let T, T_{1} be non empty topological spaces and f be a continuous map from T into T_{1}. Suppose T_{1} is a T_{1} space. Then there exists a continuous map h from T_{1}-reflexT into T_{1} such that f = h · T_{1}-reflectT.

Let T, S be non empty topological spaces and let f be a continuous map from T into S. The functor T_{1}-reflexf yields a continuous map from T_{1}-reflexT into T_{1}-reflexS and is defined as follows:

(Def. 7) T_{1}-reflectS · f = T_{1}-reflexf · T_{1}-reflectT.

References

[1] Józef Białas and Yatsuka Nakamura. Dyadic numbers and T_{4} topological spaces. Formalized Mathematics, 5(3):361–366, 1996.

[2] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[3] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[4] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

[5] Beata Padlewska. Families of sets. Formalized Mathematics, 1(1):147–152, 1990.

[6] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[7] Konrad Raczkowski and Paweł Sadowski. Equivalence relations and classes of abstraction. Formalized Mathematics, 1(3):441–444, 1990.

[8] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[9] Andrzej Trybulec. A Borsuk theorem on homotopy types. Formalized Mathematics, 2(4):535–545, 1991.

[10] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[11] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

34 adam naumowicz and mariusz łapiński

[12] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics,

1(1):73–83, 1990.

Received March 7, 1998

Bases and Refinements of Topologies^{1}

Grzegorz Bancerek University of Białystok

MML Identifier: YELLOW 9.

The notation and terminology used in this paper are introduced in the following articles: [18], [14], [11], [7], [1], [13], [16], [10], [4], [19], [9], [17], [12], [6], [15], [3], [8], [2], and [5].

1. Subsets as Nets

Let A be a set and let B be a non empty set. Observe that B^{A} is non empty.

In this article we present several logical schemes. The scheme FraenkelInvolution deals with a non empty set A, subsets B, C of A, and a unary functor F yielding an element of A, and states that:

B = {F(a); a ranges over elements of A : a ∈ C} provided the parameters have the following properties:

• C = {F(a); a ranges over elements of A : a ∈ B}, and

• For every element a of A holds F(F(a)) = a.

The scheme FraenkelComplement1 deals with a non empty relational structure A, a family B of subsets of A, a set C, and a unary functor F yielding a subset of A, and states that:

B^{c} = {− F(a); a ranges over elements of A : a ∈ C} provided the parameters meet the following requirement:

• B = {F(a); a ranges over elements of A : a ∈ C}.

The scheme FraenkelComplement2 deals with a non empty relational structure A, a family B of subsets of A, a set C, and a unary functor F yielding a subset of A, and states that:

B^{c} = {F(a); a ranges over elements of A : a ∈ C} provided the parameters meet the following requirement:

1This work has been supported by KBN Grant 8 T11C 018 12.

• B = {− F(a); a ranges over elements of A : a ∈ C}.

We now state several propositions:

(1) For every non empty relational structure R and for all elements x, y of R holds y ∈ − ↑x iff x y̸.

(2) Let S be a 1-sorted structure, T be a non empty 1-sorted structure, f be a map from S into T, and X be a subset of the carrier of T. Then − f^{−1} (X) = f^{−1} (− X).

(3) For every 1-sorted structure T and for every family F of subsets of T holds F^{c} = {− a; a ranges over subsets of T: a ∈ F }.

(4) Let R be a non empty relational structure and F be a subset of R. Then ↑F = ⋃{↑x; x ranges over elements of R: x ∈ F } and ↓F = ⋃{↓x; x ranges over elements of R: x ∈ F }.

(5) Let R be a non empty relational structure, A be a family of subsets of R, and F be a subset of R. If A = {− ↑x; x ranges over elements of R: x ∈ F }, then Intersect(A) = − ↑F .

Let us mention that there exists a FR-structure which is strict, trivial, reflexive, non empty, discrete, and finite.

One can check that there exists a top-lattice which is strict, complete, and trivial.

Let S be a non empty relational structure and let T be an upper-bounded non empty reflexive antisymmetric relational structure. Note that there exists a map from S into T which is infs-preserving.

Let S be a non empty relational structure and let T be a lower-bounded non empty reflexive antisymmetric relational structure. Note that there exists a map from S into T which is sups-preserving.

Let R, S be 1-sorted structures. Let us assume that the carrier of S ⊆ the carrier of R. The functor incl(S, R) yields a map from S into R and is defined as follows:

(Def. 1) incl(S, R) = id_{the carrier of S}.

Let R be a non empty relational structure and let S be a non empty relational substructure of R. One can check that incl(S, R) is monotone.

Let R be a non empty relational structure and let X be a non empty subset of the carrier of R. Note that sub(X) is non empty.

Let R be a non empty relational structure and let X be a non empty subset of the carrier of R. The functor ⟨X; id⟩ yielding a strict non empty net structure over R is defined as follows:

(Def. 2) ⟨X; id⟩ = incl(sub(X), R) · ⟨sub(X); id⟩. The functor ⟨X^{op}; id⟩ yielding a strict non empty net structure over R is defined as follows:

(Def. 3) ⟨X^{op}; id⟩ = incl(sub(X), R) · ⟨(sub(X))^{op}; id⟩. One can prove the following propositions:

(6) Let R be a non empty relational structure and X be a non empty subset of R. Then

(i) the carrier of ⟨X; id⟩ = X, (ii) ⟨X; id⟩ is a full relational substructure of R, and (iii) for every element x of ⟨X; id⟩ holds ⟨X; id⟩(x) = x.

(7) Let R be a non empty relational structure and X be a non empty subset of R. Then

(i) the carrier of ⟨X^{op}; id⟩ = X, (ii) ⟨X^{op}; id⟩ is a full relational substructure of R^{op}, and (iii) for every element x of ⟨X^{op}; id⟩ holds ⟨X^{op}; id⟩(x) = x. Let R be a non empty reflexive relational structure and let X be a non empty

subset of R. One can check that ⟨X; id⟩ is reflexive and ⟨X^{op}; id⟩ is reflexive.

Let R be a non empty transitive relational structure and let X be a non empty subset of R. Observe that ⟨X; id⟩ is transitive and ⟨X^{op}; id⟩ is transitive.

Let R be a non empty reflexive relational structure and let I be a directed subset of R. Note that sub(I) is directed.

Let R be a non empty reflexive relational structure and let I be a directed non empty subset of R. Note that ⟨I; id⟩ is directed.

Let R be a non empty reflexive relational structure and let F be a filtered non empty subset of R. One can verify that ⟨(sub(F))^{op}; id⟩ is directed.

Let R be a non empty reflexive relational structure and let F be a filtered non empty subset of R. Note that ⟨F^{op}; id⟩ is directed.

2. Operations on Families of Open Sets

One can prove the following propositions:

(8) For every topological space T such that T is empty holds the topology of T = {∅}.

(9) Let T be a trivial non empty topological space. Then

(i) the topology of T = 2^{the carrier of T} , and (ii) for every point x of T holds the carrier of T = {x} and the topology of

T = {∅, {x}}.

(10) Let T be a trivial non empty topological space. Then {the carrier of T } is a basis of T and ∅ is a prebasis of T and {∅} is a prebasis of T.

(11) For all sets X, Y and for every family A of subsets of X such that A = {Y } holds FinMeetCl(A) = {Y, X} and UniCl(A) = {Y, ∅}.

(12) For every set X and for all families A, B of subsets of X such that A = B ∪ {X} or B = A \ {X} holds Intersect(A) = Intersect(B).

(13) For every set X and for all families A, B of subsets of X such that A = B ∪ {X} or B = A \ {X} holds FinMeetCl(A) = FinMeetCl(B).

(14) Let X be a set and A be a family of subsets of X. Suppose X ∈ A. Let x be a set. Then x ∈ FinMeetCl(A) if and only if there exists a finite non empty family Y of subsets of X such that Y ⊆ A and x = Intersect(Y).

(15) For every set X and for every family A of subsets of X holds UniCl(UniCl(A)) = UniCl(A).

(16) For every set X and for every empty family A of subsets of X holds UniCl(A) = {∅}.

(17) For every set X and for every empty family A of subsets of X holds FinMeetCl(A) = {X}.

(18) For every set X and for every family A of subsets of X such that A = {∅, X} holds UniCl(A) = A and FinMeetCl(A) = A.

(19) Let X, Y be sets, A be a family of subsets of X, and B be a family of

subsets of Y. Then

(i) if A ⊆ B, then UniCl(A) ⊆ UniCl(B), and (ii) if A = B, then UniCl(A) = UniCl(B).

(20) Let X, Y be sets, A be a family of subsets of X, and B be a family of subsets of Y. If A = B and X ∈ A and X ⊆ Y, then FinMeetCl(B) = {Y } ∪ FinMeetCl(A).

(21) For every set X and for every family A of subsets of X holds UniCl(FinMeetCl(UniCl(A))) = UniCl(FinMeetCl(A)).

3. Bases

Next we state a number of propositions:

(22) Let T be a topological space and K be a family of subsets of T. Then the topology of T = UniCl(K) if and only if K is a basis of T.

(23) Let T be a topological space and K be a family of subsets of the carrier of T. Then K is a prebasis of T if and only if FinMeetCl(K) is a basis of T.

(24) Let T be a non empty topological space and B be a family of subsets of T. If UniCl(B) is a prebasis of T, then B is a prebasis of T.

(25) Let T_{1}, T_{2} be topological spaces and B be a basis of T_{1}. Suppose the carrier of T_{1} = the carrier of T_{2} and B is a basis of T_{2}. Then the topology of T_{1} = the topology of T_{2}.

(26) Let T_{1}, T_{2} be topological spaces and P be a prebasis of T_{1}. Suppose the carrier of T_{1} = the carrier of T_{2} and P is a prebasis of T_{2}. Then the topology of T_{1} = the topology of T_{2}.

(27) For every topological space T holds every basis of T is open and is a prebasis of T.

(28) For every topological space T holds every prebasis of T is open.

(29) Let T be a non empty topological space and B be a prebasis of T. Then B ∪ {the carrier of T } is a prebasis of T.

(30) For every topological space T and for every basis B of T holds B ∪ {the carrier of T } is a basis of T.

(31) Let T be a topological space, B be a basis of T, and A be a subset of T. Then A is open if and only if for every point p of T such that p ∈ A there exists a subset a of T such that a ∈ B and p ∈ a and a ⊆ A.

(32) Let T be a topological space and B be a family of subsets of T. Suppose

that

(i) B ⊆ the topology of T, and (ii) for every subset A of T such that A is open and for every point p of T

such that p ∈ A there exists a subset a of T such that a ∈ B and p ∈ a and a ⊆ A. Then B is a basis of T.

(33) Let S be a topological space, T be a non empty topological space, K be a basis of T, and f be a map from S into T. Then f is continuous if and only if for every subset A of T such that A ∈ K holds f^{−1} (− A) is closed.

(34) Let S be a topological space, T be a non empty topological space, K be a basis of T, and f be a map from S into T. Then f is continuous if and only if for every subset A of T such that A ∈ K holds f^{−1} (A) is open.

(35) Let S be a topological space, T be a non empty topological space, K be a prebasis of T, and f be a map from S into T. Then f is continuous if and only if for every subset A of T such that A ∈ K holds f^{−1} (− A) is closed.

(36) Let S be a topological space, T be a non empty topological space, K be a prebasis of T, and f be a map from S into T. Then f is continuous if and only if for every subset A of T such that A ∈ K holds f^{−1} (A) is open.

(37) Let T be a non empty topological space, x be a point of T, X be a subset of T, and K be a basis of T. Suppose that for every subset A of T such that A ∈ K and x ∈ A holds A meets X. Then x ∈ \overline{X}.

(38) Let T be a non empty topological space, x be a point of T, X be a subset of T, and K be a prebasis of T. Suppose that for every finite family Z of subsets of T such that Z ⊆ K and x ∈ Intersect(Z) holds Intersect(Z) meets X. Then x ∈ \overline{X}.

(39) Let T be a non empty topological space, K be a prebasis of T, x be a point of T, and N be a net in T. Suppose that for every subset A of T such that A ∈ K and x ∈ A holds N is eventually in A. Let S be a subset of T. If rngnetmap(N, T) ⊆ S, then x ∈ \overline{S}.

4. Product Topologies

The following four propositions are true:

(40) Let T_{1}, T_{2} be non empty topological spaces, B_{1} be a basis of T_{1}, and B_{2} be a basis of T_{2}. Then {[: a, b:]; a ranges over subsets of T_{1}, b ranges over subsets of T_{2}: a ∈ B_{1} ∧ b ∈ B_{2}} is a basis of [: T_{1}, T_{2} :].

(41) Let T_{1}, T_{2} be non empty topological spaces, B_{1} be a prebasis of T_{1}, and B_{2} be a prebasis of T_{2}. Then {[: the carrier of T_{1}, b:]; b ranges over subsets of T_{2}: b ∈ B_{2}}∪{[: a, the carrier of T_{2} :]; a ranges over subsets of T_{1}: a ∈ B_{1}} is a prebasis of [: T_{1}, T_{2} :].

(42) Let X_{1}, X_{2} be sets, A be a family of subsets of [: X_{1}, X_{2} :], A_{1} be a non empty family of subsets of X_{1}, and A_{2} be a non empty family of subsets of X_{2}. Suppose A = {[: a, b:]; a ranges over subsets of X_{1}, b ranges over subsets of X_{2}: a ∈ A_{1} ∧ b ∈ A_{2}}. Then Intersect(A) = [: Intersect(A_{1}), Intersect(A_{2}) :].

(43) Let T_{1}, T_{2} be non empty topological spaces, B_{1} be a prebasis of T_{1}, and B_{2} be a prebasis of T_{2}. Suppose ⋃ B_{1} = the carrier of T_{1} and ⋃ B_{2} = the carrier of T_{2}. Then {[: a, b:]; a ranges over subsets of T_{1}, b ranges over subsets of T_{2}: a ∈ B_{1} ∧ b ∈ B_{2}} is a prebasis of [: T_{1}, T_{2} :].

5. Topological Augmentations

Let R be a relational structure. A FR-structure is called a topological augmentation of R if:

(Def. 4) The relational structure of it = the relational structure of R.

Let R be a relational structure and let T be a topological augmentation of R. We introduce T is correct as a synonym of T is topological space-like.

Let R be a relational structure. Note that there exists a topological augmentation of R which is correct, discrete, and strict.

We now state three propositions:

(44) Every FR-structure T is a topological augmentation of T.

(45) Let S be a FR-structure and T be a topological augmentation of S. Then S is a topological augmentation of T.

(46) Let R be a relational structure and T_{1} be a topological augmentation of R. Then every topological augmentation of T_{1} is a topological augmentation of R.

Let R be a non empty relational structure. One can check that every topological augmentation of R is non empty.

Let R be a reflexive relational structure. Note that every topological augmentation of R is reflexive.

Let R be a transitive relational structure. One can check that every topological augmentation of R is transitive.

Let R be an antisymmetric relational structure. One can verify that every topological augmentation of R is antisymmetric.

Let R be a complete non empty relational structure. Observe that every topological augmentation of R is complete.

We now state three propositions:

(47) Let S be a complete reflexive antisymmetric non empty relational structure and T be a non empty reflexive relational structure. Suppose the relational structure of S = the relational structure of T. Let A be a subset of S and C be a subset of T. If A = C and A is inaccessible, then C is inaccessible.

(48) Let S be a non empty reflexive relational structure and T be a topological augmentation of S. If the topology of T = σ(S), then T is correct.

(49) Let S be a complete lattice and T be a topological augmentation of S. If the topology of T = σ(S), then T is Scott.

Let R be a complete lattice. One can verify that there exists a topological augmentation of R which is Scott, strict, and correct.

The following three propositions are true:

(50) Let S, T be complete Scott non empty reflexive transitive antisymmetric FR-structures. Suppose the relational structure of S = the relational structure of T. Let F be a subset of S and G be a subset of T. If F = G, then if F is open, then G is open.

(51) For every complete lattice S and for every Scott topological augmentation T of S holds the topology of T = σ(S).

(52) Let S, T be complete lattices. Suppose the relational structure of S = the relational structure of T. Then σ(S) = σ(T).

Let R be a complete lattice. Observe that every topological augmentation of R which is Scott is also correct.

6. Refinements

Let T be a topological structure. A topological space is said to be a topological extension of T if:

(Def. 5) The carrier of T = the carrier of it and the topology of T ⊆ the topology

of it. One can prove the following proposition

(53) Let S be a topological structure. Then there exists a topological extension T of S such that T is strict and the topology of S is a prebasis of T.

Let T be a topological structure. Note that there exists a topological extension of T which is strict and discrete.

Let T_{1}, T_{2} be topological structures. A topological space is said to be a refinement of T_{1} and T_{2} if it satisfies the conditions (Def. 6).

(Def. 6)(i) The carrier of it = (the carrier of T_{1}) ∪ (the carrier of T_{2}), and (ii) (the topology of T_{1}) ∪ (the topology of T_{2}) is a prebasis of it. Let T_{1} be a non empty topological structure and let T_{2} be a topological

structure. Observe that every refinement of T_{1} and T_{2} is non empty and every refinement of T_{2} and T_{1} is non empty.

The following propositions are true:

(54) Let T_{1}, T_{2} be topological structures and T, T′ be refinements of T_{1} and T_{2}. Then the topological structure of T = the topological structure of T′.

(55) For all topological structures T_{1}, T_{2} holds every refinement of T_{1} and T_{2} is a refinement of T_{2} and T_{1}.

(56) Let T_{1}, T_{2} be topological structures, T be a refinement of T_{1} and T_{2}, and X be a family of subsets of T. Suppose X = (the topology of T_{1}) ∪ (the topology of T_{2}). Then the topology of T = UniCl(FinMeetCl(X)).

(57) Let T_{1}, T_{2} be topological structures. Suppose the carrier of T_{1} = the carrier of T_{2}. Then every refinement of T_{1} and T_{2} is a topological extension of T_{1} and a topological extension of T_{2}.

(58) Let T_{1}, T_{2} be non empty topological spaces, T be a refinement of T_{1} and T_{2}, B_{1} be a prebasis of T_{1}, and B_{2} be a prebasis of T_{2}. Then B_{1} ∪B_{2} ∪{the carrier of T_{1}, the carrier of T_{2}} is a prebasis of T.

(59) Let T_{1}, T_{2} be non empty topological spaces, B_{1} be a basis of T_{1}, B_{2} be a basis of T_{2}, and T be a refinement of T_{1} and T_{2}. Then B_{1} ∪ B_{2} ∪ B_{1} ⋒ B_{2} is a basis of T.

(60) Let T_{1}, T_{2} be non empty topological spaces. Suppose the carrier of T_{1} = the carrier of T_{2}. Let T be a refinement of T_{1} and T_{2}. Then (the topology of T_{1}) ⋒ (the topology of T_{2}) is a basis of T.

bases and refinements of topologies 43

(61) Let L be a non empty relational structure, T_{1}, T_{2} be correct topological augmentations of L, and T be a refinement of T_{1} and T_{2}. Then (the topology of T_{1}) ⋒ (the topology of T_{2}) is a basis of T.

References

[1] Grzegorz Bancerek. Complete lattices. Formalized Mathematics, 2(5):719–725, 1991.

[2] Grzegorz Bancerek. Bounds in posets and relational substructures. Formalized Mathematics, 6(1):81–91, 1997.

[3] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[4] Józef Białas. Group and field definitions. Formalized Mathematics, 1(3):433–439, 1990.

[5] Czesław Byliński. Some basic properties of sets. Formalized Mathematics, 1(1):47–53, 1990.

[6] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

[7] Agata Darmochwał. Finite sets. Formalized Mathematics, 1(1):165–167, 1990.

[8] Artur Korniłowicz. On the topological properties of meet-continuous lattices. Formalized Mathematics, 6(2):269–277, 1997.

[9] Beata Padlewska. Families of sets. Formalized Mathematics, 1(1):147–152, 1990.

[10] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[11] Alexander Yu. Shibakov and Andrzej Trybulec. The Cantor set. Formalized Mathematics, 5(2):233–236, 1996.

[12] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[13] Andrzej Trybulec. Tuples, projections and Cartesian products. Formalized Mathematics, 1(1):97–105, 1990.

[14] Andrzej Trybulec. A Borsuk theorem on homotopy types. Formalized Mathematics, 2(4):535–545, 1991.

[15] Andrzej Trybulec. Scott topology. Formalized Mathematics, 6(2):311–319, 1997.

[16] Wojciech A. Trybulec. Partially ordered sets. Formalized Mathematics, 1(2):313–319, 1990.

[17] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[18] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[19] Edmund Woronowicz. Relations defined on sets. Formalized Mathematics, 1(1):181–186, 1990.

Received March 9, 1998 44 grzegorz bancerek

The Properties of Product of Relational Structures^{1}

Artur Korniłowicz University of Białystok

Summary. This work contains useful facts about the product of relational structures. It continues the formalization of [6].

MML Identifier: YELLOW10.

The articles [14], [1], [13], [12], [3], [5], [9], [4], [10], [11], [2], [7], and [8] provide the notation and terminology for this paper.

1. On the Elements of Product of Relational Structures

Let S, T be non empty upper-bounded relational structures. One can check that [: S, T :] is upper-bounded.

Let S, T be non empty lower-bounded relational structures. Observe that [: S, T :] is lower-bounded.

The following propositions are true:

(1) Let S, T be non empty relational structures. If [: S, T :] is upper-bounded, then S is upper-bounded and T is upper-bounded.

(2) Let S, T be non empty relational structures. If [: S, T :] is lower-bounded, then S is lower-bounded and T is lower-bounded.

(3) For all upper-bounded antisymmetric non empty relational structures S, T holds ⊤_{[: S, T :]} = ⟨⟨⊤_{S}, ⊤_{T} ⟩⟩.

(4) For all lower-bounded antisymmetric non empty relational structures S, T holds ⊥_{[: S, T :]} = ⟨⟨⊥_{S}, ⊥_{T} ⟩⟩.

1This work has been supported by KBN Grant 8 T11C 018 12.

(5) Let S, T be lower-bounded antisymmetric non empty relational structures and D be a subset of [: S, T :]. If [: S, T :] is complete or sup D exists in [: S, T :], then supD = ⟨⟨supπ_{1}(D), supπ_{2}(D)⟩⟩.

(6) Let S, T be upper-bounded antisymmetric non empty relational structures and D be a subset of [: S, T :]. If [: S, T :] is complete or inf D exists in [: S, T :], then inf D = ⟨⟨inf π_{1}(D), inf π_{2}(D)⟩⟩.

(7) Let S, T be non empty relational structures and x, y be elements of [: S, T :]. Then x {y} if and only if the following conditions are satisfied:

(i) x_{1} {y_{1}}, and (ii) x_{2} {y_{2}}.

(8) Let S, T be non empty relational structures and x, y, z be elements of [: S, T :]. Then x {y, z} if and only if the following conditions are satisfied:

(i) x_{1} {y_{1}, z_{1}}, and (ii) x_{2} {y_{2}, z_{2}}.

(9) Let S, T be non empty relational structures and x, y be elements of [: S, T :]. Then x {y} if and only if the following conditions are satisfied:

(i) x_{1} {y_{1}}, and (ii) x_{2} {y_{2}}.

(10) Let S, T be non empty relational structures and x, y, z be elements of [: S, T :]. Then x {y, z} if and only if the following conditions are satisfied:

(i) x_{1} {y_{1}, z_{1}}, and (ii) x_{2} {y_{2}, z_{2}}.

(11) Let S, T be non empty antisymmetric relational structures and x, y be elements of [: S, T :]. Then inf {x, y} exists in [: S, T :] if and only if inf {x_{1}, y_{1}} exists in S and inf {x_{2}, y_{2}} exists in T.

(12) Let S, T be non empty antisymmetric relational structures and x, y be elements of [: S, T :]. Then sup {x, y} exists in [: S, T :] if and only if sup {x_{1}, y_{1}} exists in S and sup {x_{2}, y_{2}} exists in T.

(13) Let S, T be antisymmetric relational structures with g.l.b.’s and x, y be elements of [: S, T :]. Then (x ⊓ y)_{1} = x_{1} ⊓ y_{1} and (x ⊓ y)_{2} = x_{2} ⊓ y_{2}.

(14) Let S, T be antisymmetric relational structures with l.u.b.’s and x, y be elements of [: S, T :]. Then (x ⊔ y)_{1} = x_{1} ⊔ y_{1} and (x ⊔ y)_{2} = x_{2} ⊔ y_{2}.

(15) Let S, T be antisymmetric relational structures with g.l.b.’s, x_{1}, y_{1} be elements of S, and x_{2}, y_{2} be elements of T. Then ⟨⟨x_{1} ⊓ y_{1}, x_{2} ⊓ y_{2}⟩⟩= ⟨⟨x_{1}, x_{2}⟩⟩⊓ ⟨⟨y_{1}, y_{2}⟩⟩.

(16) Let S, T be antisymmetric relational structures with l.u.b.’s, x_{1}, y_{1} be elements of S, and x_{2}, y_{2} be elements of T. Then ⟨⟨x_{1} ⊔ y_{1}, x_{2} ⊔ y_{2}⟩⟩= ⟨⟨x_{1}, x_{2}⟩⟩⊔ ⟨⟨y_{1}, y_{2}⟩⟩.

Let S be an antisymmetric relational structure with l.u.b.’s and g.l.b.’s and let x, y be elements of S. Let us note that the predicate y is a complement of x is symmetric.

One can prove the following propositions:

(17) Let S, T be bounded antisymmetric relational structures with l.u.b.’s and g.l.b.’s and x, y be elements of [: S, T :]. Then x is a complement of y if and only if x_{1} is a complement of y_{1} and x_{2} is a complement of y_{2}.

(18) Let S, T be antisymmetric up-complete non empty reflexive relational structures, a, c be elements of S, and b, d be elements of T. If ⟨⟨a, b⟩⟩≪ ⟨⟨c, d⟩⟩, then a ≪ c and b ≪ d.

(19) Let S, T be up-complete non empty posets, a, c be elements of S, and b, d be elements of T. Then ⟨⟨a, b⟩⟩≪ ⟨⟨c, d⟩⟩ if and only if a ≪ c and b ≪ d.

(20) Let S, T be antisymmetric up-complete non empty reflexive relational structures and x, y be elements of [: S, T :]. If x ≪ y, then x_{1} ≪ y_{1} and x_{2} ≪ y_{2}.

(21) Let S, T be up-complete non empty posets and x, y be elements of [: S,

T :]. Then x ≪ y if and only if the following conditions are satisfied:

(i) x_{1} ≪ y_{1}, and (ii) x_{2} ≪ y_{2}.

(22) Let S, T be antisymmetric up-complete non empty reflexive relational structures and x be an element of [: S, T :]. If x is compact, then x_{1} is compact and x_{2} is compact.

(23) Let S, T be up-complete non empty posets and x be an element of [: S, T :]. If x_{1} is compact and x_{2} is compact, then x is compact.

2. On the Subsets of Product of Relational Structures

The following propositions are true:

(24) Let S, T be antisymmetric relational structures with g.l.b.’s and X, Y be subsets of [: S, T :]. Then π_{1}(X ⊓ Y) = π_{1}(X) ⊓ π_{1}(Y) and π_{2}(X ⊓ Y) = π_{2}(X) ⊓ π_{2}(Y).

(25) Let S, T be antisymmetric relational structures with l.u.b.’s and X, Y be subsets of [: S, T :]. Then π_{1}(X ⊔ Y) = π_{1}(X) ⊔ π_{1}(Y) and π_{2}(X ⊔ Y) = π_{2}(X) ⊔ π_{2}(Y).

(26) For all relational structures S, T and for every subset X of [: S, T :] holds ↓X ⊆ [: ↓π_{1}(X), ↓π_{2}(X) :].

(27) For all relational structures S, T and for every subset X of S and for every subset Y of T holds [: ↓X, ↓Y :] = ↓[: X, Y :].

(28) For all relational structures S, T and for every subset X of [: S, T :] holds π_{1}(↓X) ⊆ ↓π_{1}(X) and π_{2}(↓X) ⊆ ↓π_{2}(X).

(29) Let S be a relational structure, T be a reflexive relational structure, and X be a subset of [: S, T :]. Then π_{1}(↓X) = ↓π_{1}(X).

(30) Let S be a reflexive relational structure, T be a relational structure, and X be a subset of [: S, T :]. Then π_{2}(↓X) = ↓π_{2}(X).

(31) For all relational structures S, T and for every subset X of [: S, T :] holds ↑X ⊆ [: ↑π_{1}(X), ↑π_{2}(X) :].

(32) For all relational structures S, T and for every subset X of S and for every subset Y of T holds [: ↑X, ↑Y :] = ↑[: X, Y :].

(33) For all relational structures S, T and for every subset X of [: S, T :] holds π_{1}(↑X) ⊆ ↑π_{1}(X) and π_{2}(↑X) ⊆ ↑π_{2}(X).

(34) Let S be a relational structure, T be a reflexive relational structure, and X be a subset of [: S, T :]. Then π_{1}(↑X) = ↑π_{1}(X).

(35) Let S be a reflexive relational structure, T be a relational structure, and X be a subset of [: S, T :]. Then π_{2}(↑X) = ↑π_{2}(X).

(36) Let S, T be non empty relational structures, s be an element of S, and t be an element of T. Then [: ↓s, ↓t:] = ↓⟨⟨s, t⟩⟩.

(37) For all non empty relational structures S, T and for every element x of [: S, T :] holds π_{1}(↓x) ⊆ ↓(x_{1}) and π_{2}(↓x) ⊆ ↓(x_{2}).

(38) Let S be a non empty relational structure, T be a non empty reflexive relational structure, and x be an element of [: S, T :]. Then π_{1}(↓x) = ↓(x_{1}).

(39) Let S be a non empty reflexive relational structure, T be a non empty relational structure, and x be an element of [: S, T :]. Then π_{2}(↓x) = ↓(x_{2}).

(40) Let S, T be non empty relational structures, s be an element of S, and t be an element of T. Then [: ↑s, ↑t:] = ↑⟨⟨s, t⟩⟩.

(41) For all non empty relational structures S, T and for every element x of [: S, T :] holds π_{1}(↑x) ⊆ ↑(x_{1}) and π_{2}(↑x) ⊆ ↑(x_{2}).

(42) Let S be a non empty relational structure, T be a non empty reflexive relational structure, and x be an element of [: S, T :]. Then π_{1}(↑x) = ↑(x_{1}).

(43) Let S be a non empty reflexive relational structure, T be a non empty relational structure, and x be an element of [: S, T :]. Then π_{2}(↑x) = ↑(x_{2}).

(44) For all up-complete non empty posets S, T and for every element s of S and for every element t of T holds [: ↓↓s, ↓↓t:] = ↓↓⟨⟨s, t⟩⟩.

(45) Let S, T be antisymmetric up-complete non empty reflexive relational structures and x be an element of [: S, T :]. Then π_{1}(↓↓x) ⊆ ↓↓(x_{1}) and π_{2}(↓↓x) ⊆ ↓↓(x_{2}).

(46) Let S be an up-complete non empty poset, T be an up-complete lowerbounded non empty poset, and x be an element of [: S, T :]. Then π_{1}(↓↓x) =

↓↓(x_{1}).

(47) Let S be an up-complete lower-bounded non empty poset, T be an upcomplete non empty poset, and x be an element of [: S, T :]. Then π_{2}(↓↓x) = ↓↓(x_{2}).

(48) For all up-complete non empty posets S, T and for every element s of S and for every element t of T holds [: ↑↑s, ↑↑t:] = ↑↑⟨⟨s, t⟩⟩.

(49) Let S, T be antisymmetric up-complete non empty reflexive relational structures and x be an element of [: S, T :]. Then π_{1}(↑↑x) ⊆ ↑↑(x_{1}) and π_{2}(↑↑x) ⊆ ↑↑(x_{2}).

(50) For all up-complete non empty posets S, T and for every element s of S and for every element t of T holds [: compactbelow(s), compactbelow(t) :] = compactbelow(⟨⟨s, t⟩⟩).

(51) Let S, T be antisymmetric up-complete non empty reflexive relational structures and x be an element of [: S, T :]. Then π_{1}(compactbelow(x)) ⊆ compactbelow(x_{1}) and π_{2}(compactbelow(x)) ⊆ compactbelow(x_{2}).

(52) Let S be an up-complete non empty poset, T be an up-complete lower-bounded non empty poset, and x be an element of [: S, T :]. Then π_{1}(compactbelow(x)) = compactbelow(x_{1}).

(53) Let S be an up-complete lower-bounded non empty poset, T be an up-complete non empty poset, and x be an element of [: S, T :]. Then π_{2}(compactbelow(x)) = compactbelow(x_{2}).

Let S be a non empty reflexive relational structure. One can verify that every subset of S which is empty is also open.

The following propositions are true:

(54) Let S, T be antisymmetric up-complete non empty reflexive relational structures and X be a subset of [: S, T :]. If X is open, then π_{1}(X) is open and π_{2}(X) is open.

(55) Let S, T be up-complete non empty posets, X be a subset of S, and Y be a subset of T. If X is open and Y is open, then [: X, Y :] is open.

(56) Let S, T be antisymmetric up-complete non empty reflexive relational structures and X be a subset of [: S, T :]. If X is inaccessible, then π_{1}(X) is inaccessible and π_{2}(X) is inaccessible.

(57) Let S, T be antisymmetric up-complete non empty reflexive relational structures, X be an upper subset of S, and Y be an upper subset of T. If X is inaccessible and Y is inaccessible, then [: X, Y :] is inaccessible.

(58) Let S, T be antisymmetric up-complete non empty reflexive relational structures, X be a subset of S, and Y be a subset of T such that [: X, Y :] is directly closed. Then

(i) if Y ≠ ∅, then X is directly closed, and (ii) if X ≠ ∅, then Y is directly closed.

(59) Let S, T be antisymmetric up-complete non empty reflexive relational structures, X be a subset of S, and Y be a subset of T. Suppose X is directly closed and Y is directly closed. Then [: X, Y :] is directly closed.

(60) Let S, T be antisymmetric up-complete non empty reflexive relational structures and X be a subset of [: S, T :]. If X has the property (S), then π_{1}(X) has the property (S) and π_{2}(X) has the property (S).

(61) Let S, T be up-complete non empty posets, X be a subset of S, and Y be a subset of T. If X has the property (S) and Y has the property (S), then [: X, Y :] has the property (S).

3. On the Products of Relational Structures

We now state the proposition

(62) Let S, T be non empty reflexive relational structures. Suppose the relational structure of S = the relational structure of T and S is inf-complete. Then T is inf-complete.

Let S be an inf-complete non empty reflexive relational structure. Observe that the relational structure of S is inf-complete.

Let S, T be inf-complete non empty reflexive relational structures. Observe that [: S, T :] is inf-complete.

The following proposition is true

(63) Let S, T be non empty reflexive relational structures. If [: S, T :] is inf-

complete, then S is inf-complete and T is inf-complete. Let S, T be complemented bounded antisymmetric non empty relational

structures with g.l.b.’s and l.u.b.’s. Observe that [: S, T :] is complemented.

Next we state the proposition

(64) Let S, T be bounded antisymmetric relational structures with g.l.b.’s and l.u.b.’s. If [: S, T :] is complemented, then S is complemented and T is complemented.

Let S, T be distributive antisymmetric non empty relational structures with g.l.b.’s and l.u.b.’s. Observe that [: S, T :] is distributive.

The following propositions are true:

(65) Let S be an antisymmetric relational structure with g.l.b.’s and l.u.b.’s and T be a reflexive antisymmetric relational structure with g.l.b.’s and l.u.b.’s. If [: S, T :] is distributive, then S is distributive.

(66) Let S be a reflexive antisymmetric relational structure with g.l.b.’s and l.u.b.’s and T be an antisymmetric relational structure with g.l.b.’s and l.u.b.’s. If [: S, T :] is distributive, then T is distributive.

the properties of product of relational … 51

Let S, T be meet-continuous semilattices. Observe that [: S, T :] satisfies MC. We now state the proposition

(67) For all semilattices S, T such that [: S, T :] is meet-continuous holds S is

meet-continuous and T is meet-continuous. Let S, T be up-complete inf-complete non empty posets satisfying axiom of

approximation. Note that [: S, T :] satisfies axiom of approximation.

Let S, T be continuous inf-complete non empty posets. Observe that [: S, T :] is continuous.

Next we state the proposition

(68) Let S, T be up-complete lower-bounded non empty posets. If [: S, T :] is

continuous, then S is continuous and T is continuous. Let S, T be up-complete lower-bounded sup-semilattices satisfying axiom

K. Note that [: S, T :] satisfies axiom K.

Let S, T be complete algebraic lower-bounded sup-semilattices. Note that [: S, T :] is algebraic.

The following proposition is true

(69) For all lower-bounded non empty posets S, T such that [: S, T :] is alge-

braic holds S is algebraic and T is algebraic. Let S, T be arithmetic lower-bounded lattices. Note that [: S, T :] is arithme-

tic.

Next we state the proposition

(70) For all lower-bounded lattices S, T such that [: S, T :] is arithmetic holds S is arithmetic and T is arithmetic.

References

[1] Grzegorz Bancerek. Complete lattices. Formalized Mathematics, 2(5):719–725, 1991.

[2] Grzegorz Bancerek. Bounds in posets and relational substructures. Formalized Mathematics, 6(1):81–91, 1997.

[3] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[4] Grzegorz Bancerek. The “way-below” relation. Formalized Mathematics, 6(1):169–176, 1997.

[5] Czesław Byliński. Galois connections. Formalized Mathematics, 6(1):131–143, 1997.

[6] G. Gierz, K.H. Hofmann, K. Keimel, J.D. Lawson, M. Mislove, and D.S. Scott. A Compendium of Continuous Lattices. Springer-Verlag, Berlin, Heidelberg, New York, 1980.

[7] Artur Korniłowicz. Cartesian products of relations and relational structures. Formalized Mathematics, 6(1):145–152, 1997.

[8] Artur Korniłowicz. Definitions and properties of the join and meet of subsets. Formalized Mathematics, 6(1):153–158, 1997.

[9] Artur Korniłowicz. Meet–continuous lattices. Formalized Mathematics, 6(1):159–167, 1997.

[10] Beata Madras. Irreducible and prime elements. Formalized Mathematics, 6(2):233–239, 1997.

[11] Robert Milewski. Algebraic lattices. Formalized Mathematics, 6(2):249–254, 1997.

[12] Andrzej Trybulec. Scott topology. Formalized Mathematics, 6(2):311–319, 1997.

[13] Wojciech A. Trybulec. Partially ordered sets. Formalized Mathematics, 1(2):313–319,

52 artur korniłowicz

[14] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Ma-

thematics, 1(1):17–23, 1990.

Received March 27, 1998

On the Characterization of Modular and Distributive Lattices^{1}

Adam Naumowicz University of Białystok

Summary. This article contains definitions of the ”pentagon” lattice N_{5} and the ”diamond” lattice M_{3}. It is followed by the characterization of modular and distributive lattices depending on the possible shape of substructures. The last part treats of interval-like sublattices of any lattice.

MML Identifier: YELLOW11.

The papers [8], [5], [1], [7], [6], [3], [4], and [2] provide the notation and terminology for this paper.

1. Preliminaries

One can prove the following propositions:

(1) 3 = {0, 1, 2}.

(2) 2 \ 1 = {1}.

(3) 3 \ 1 = {1, 2}.

(4) 3 \ 2 = {2}.

(5) Let L be an antisymmetric reflexive relational structure with g.l.b.’s and l.u.b.’s and a, b be elements of L. Then a ⊓ b = b if and only if a ⊔ b = a.

(6) For every lattice L and for all elements a, b, c of L holds (a⊓b)⊔(a⊓c) a ⊓ (b ⊔ c).

(7) For every lattice L and for all elements a, b, c of L holds a ⊔ (b ⊓ c) (a ⊔ b) ⊓ (a ⊔ c).

1This work has been supported by KBN Grant 8 T11C 018 12.

(8) For every lattice L and for all elements a, b, c of L such that a c holds a ⊔ (b ⊓ c) (a ⊔ b) ⊓ c.

2. Diamond and Pentagon

The relational structure N_{5} is defined as follows: (Def. 1) N_{5} = ⟨{0, 3 \ 1, 2, 3 \ 2, 3}, ⊆⟩.

Let us note that N_{5} is strict reflexive transitive and antisymmetric and N_{5} has g.l.b.’s and l.u.b.’s.

The relational structure M_{3} is defined by: (Def. 2) M_{3} = ⟨{0, 1, 2 \ 1, 3 \ 2, 3}, ⊆⟩.

Let us note that M_{3} is strict reflexive transitive and antisymmetric and M_{3} has g.l.b.’s and l.u.b.’s.

One can prove the following two propositions:

(9) Let L be a lattice. Then the following statements are equivalent

(i) there exists a full sublattice K of L such that N_{5} and K are isomorphic, (ii) there exist elements a, b, c, d, e of L such that a ≠ b and a ≠ c and

a ≠ d and a ≠ e and b ≠ c and b ≠ d and b ≠ e and c ≠ d and c ≠ e and d ≠ e and a ⊓ b = a and a ⊓ c = a and c ⊓ e = c and d ⊓ e = d and b ⊓ c = a and b ⊓ d = b and c ⊓ d = a and b ⊔ c = e and c ⊔ d = e.

(10) Let L be a lattice. Then the following statements are equivalent (i) there exists a full sublattice K of L such that M_{3} and K are isomorphic, (ii) there exist elements a, b, c, d, e of L such that a ≠ b and a ≠ c and

a ≠ d and a ≠ e and b ≠ c and b ≠ d and b ≠ e and c ≠ d and c ≠ e and d ≠ e and a ⊓ b = a and a ⊓ c = a and a ⊓ d = a and b ⊓ e = b and c ⊓ e = c and d ⊓ e = d and b ⊓ c = a and b ⊓ d = a and c ⊓ d = a and b ⊔ c = e and b ⊔ d = e and c ⊔ d = e.

Let L be a non empty relational structure. We say that L is modular if and only if:

(Def. 3) For all elements a, b, c of L such that a c holds a ⊔ (b ⊓ c) = (a ⊔ b) ⊓ c.

Let us note that every non empty antisymmetric reflexive relational structure with g.l.b.’s which is distributive is also modular.

Next we state two propositions:

(11) Let L be a lattice. Then L is modular if and only if it is not true that there exists a full sublattice K of L such that N_{5} and K are isomorphic.

(12) Let L be a lattice. Suppose L is modular. Then L is distributive if and only if it is not true that there exists a full sublattice K of L such that M_{3} and K are isomorphic.

3. Intervals of a Lattice

Let L be a non empty relational structure and let a, b be elements of L. The functor [a, b] yielding a subset of L is defined as follows:

(Def. 4) For every element c of L holds c ∈ [a, b] iff a c and c b.

Let L be a non empty relational structure and let I_{1} be a subset of L. We say that I_{1} is interval if and only if:

(Def. 5) There exist elements a, b of L such that I_{1} = [a, b].

Let L be a non empty reflexive transitive relational structure. One can check that every subset of L which is non empty and interval is also directed and every subset of L which is non empty and interval is also filtered.

Let L be a non empty relational structure and let a, b be elements of L. Observe that [a, b] is interval.

Next we state the proposition

(13) For every non empty reflexive transitive relational structure L and for

all elements a, b of L holds [a, b] = ↑a ∩ ↓b. Let L be a poset with g.l.b.’s and let a, b be elements of L. Observe that

sub([a, b]) is meet-inheriting.

Let L be a poset with l.u.b.’s and let a, b be elements of L. Note that sub([a, b]) is join-inheriting.

One can prove the following proposition

(14) Let L be a lattice and a, b be elements of L. If L is modular, then

sub([b, a ⊔ b]) and sub([a ⊓ b, a]) are isomorphic. Let us mention that there exists a lattice which is finite and non empty. Let us note that every semilattice which is finite is also lower-bounded. Let us note that every lattice which is finite is also complete.

References

[1] Grzegorz Bancerek. Complete lattices. Formalized Mathematics, 2(5):719–725, 1991.

[2] Grzegorz Bancerek. Bounds in posets and relational substructures. Formalized Mathematics, 6(1):81–91, 1997.

[3] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[4] Czesław Byliński. Galois connections. Formalized Mathematics, 6(1):131–143, 1997.

[5] Andrzej Trybulec. Enumerated sets. Formalized Mathematics, 1(1):25–34, 1990.

[6] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[7] Wojciech A. Trybulec. Partially ordered sets. Formalized Mathematics, 1(2):313–319, 1990.

[8] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

Received April 3, 1998 56 adam naumowicz

Injective Spaces^{1}

Jarosław Gryko University of Białystok

MML Identifier: WAYBEL18.

The notation and terminology used in this paper have been introduced in the following articles: [20], [16], [13], [1], [14], [7], [6], [5], [17], [10], [11], [12], [19], [15], [8], [22], [18], [2], [3], [9], [21], and [4].

1. Product Topologies

The following propositions are true:

(1) Let x, y, z, Z be sets. Then Z ⊆ {x, y, z} if and only if one of the following conditions is satisfied:

(i) Z = ∅, or (ii) Z = {x}, or (iii) Z = {y}, or (iv) Z = {z}, or

(v) Z = {x, y}, or (vi) Z = {y, z}, or (vii) Z = {x, z}, or (viii) Z = {x, y, z}.

(2) For every set X and for all families A, B of subsets of X such that B = A \ {∅} or A = B ∪ {∅} holds UniCl(A) = UniCl(B).

(3) Let T be a topological space and K be a family of subsets of T. Then K is a basis of T if and only if K \ {∅} is a basis of T.

Let F be a binary relation. We say that F is topological space yielding if and only if:

1This work has been supported by KBN Grant 8 T11C 018 12.

(Def. 1) For every set x such that x ∈ rngF holds x is a topological space.

One can verify that every function which is topological space yielding is also 1-sorted yielding.

Let I be a set. Note that there exists a many sorted set indexed by I which is topological space yielding.

Let I be a set. One can check that there exists a many sorted set indexed by I which is topological space yielding and nonempty.

Let J be a non empty set, let A be a topological space yielding many sorted set indexed by J, and let j be an element of J. Then A(j) is a topological space.

Let I be a set and let J be a topological space yielding many sorted set indexed by I. The product prebasis for J is a family of subsets of ∏ (the support of J) and is defined by the condition (Def. 2).

(Def. 2) Let x be a subset of ∏ (the support of J). Then x ∈ the product prebasis for J if and only if there exists a set i and there exists a topological space T and there exists a subset V of T such that i ∈ I and V is open and T = J(i) and x = ∏((the support of J) +·(i, V)).

Next we state the proposition

(4) For every set X and for every family A of subsets of X holds ⟨X, UniCl(FinMeetCl(A))⟩ is topological space-like.

Let I be a set and let J be a topological space yielding nonempty many sorted set indexed by I. The functor ∏ J yielding a strict topological space is defined by:

(Def. 3) The carrier of ∏ J = ∏ (the support of J) and the product prebasis for

J is a prebasis of ∏ J. Let I be a set and let J be a topological space yielding nonempty many

sorted set indexed by I. One can check that ∏ J is non empty.

Let I be a non empty set, let J be a topological space yielding nonempty many sorted set indexed by I, and let i be an element of I. Then J(i) is a non empty topological space.

Let I be a set and let J be a topological space yielding nonempty many sorted set indexed by I. Observe that every element of the carrier of ∏ J is function-like and relation-like.

Let I be a non empty set, let J be a topological space yielding nonempty many sorted set indexed by I, let x be an element of the carrier of ∏ J, and let i be an element of I. Then x(i) is an element of J(i).

Let I be a non empty set, let J be a topological space yielding nonempty many sorted set indexed by I, and let i be an element of I. The functor proj(J, i) yielding a map from ∏ J into J(i) is defined as follows:

(Def. 4) proj(J, i) = proj(the support of J, i).

One can prove the following propositions:

(5) Let I be a non empty set, J be a topological space yielding nonempty many sorted set indexed by I, i be an element of I, and P be a subset of the carrier of J(i). Then (proj(J, i))^{−1} (P) = ∏((the support of J) +·(i, P)).

(6) Let I be a non empty set, J be a topological space yielding nonempty many sorted set indexed by I, and i be an element of I. Then proj(J, i) is continuous.

(7) Let X be a non empty topological space, I be a non empty set, J be a topological space yielding nonempty many sorted set indexed by I, and f be a map from X into ∏ J. Then f is continuous if and only if for every element i of I holds proj(J, i) · f is continuous.

2. Injective Spaces

Let Z be a topological structure. We say that Z is injective if and only if the condition (Def. 5) is satisfied.

(Def. 5) Let X be a non empty topological space and f be a map from X into Z. Suppose f is continuous. Let Y be a non empty topological space. Suppose X is a subspace of Y. Then there exists a map g from Y into Z such that g is continuous and g↾the carrier of X = f.

One can prove the following two propositions:

(8) Let I be a non empty set and J be a topological space yielding nonempty many sorted set indexed by I. If for every element i of I holds J(i) is injective, then ∏ J is injective.

(9) Let T be a non empty topological space. Suppose T is injective. Let S be a non empty subspace of T. If S is a retract of T, then S is injective.

Let X be a 1-sorted structure, let Y be a topological structure, and let f be a map from X into Y. The functor Imf yielding a subspace of Y is defined as follows:

(Def. 6) Imf = Y ↾ rngf.

Let X be a non empty 1-sorted structure, let Y be a non empty topological structure, and let f be a map from X into Y. Note that Imf is non empty.

One can prove the following proposition

(10) Let X be a 1-sorted structure, Y be a topological structure, and f be a

map from X into Y. Then the carrier of Imf = rngf. Let X be a 1-sorted structure, let Y be a non empty topological structure,

and let f be a map from X into Y. The functor f^{∘} yielding a map from X into Imf is defined by:

(Def. 7) f^{∘} = f.

Next we state the proposition

(11) Let X, Y be non empty topological spaces and f be a map from X into

Y. If f is continuous, then f^{∘} is continuous. Let X be a 1-sorted structure, let Y be a non empty topological structure,

and let f be a map from X into Y. One can verify that f^{∘} is onto.

Let X, Y be topological structures. We say that X is a topological retract of Y if and only if:

(Def. 8) There exists a map f from Y into Y such that f is continuous and

f · f = f and Imf and X are homeomorphic. The following proposition is true

(12) Let T, S be non empty topological spaces. Suppose T is injective. Let f be a map from T into S. If f^{∘} is a homeomorphism, then T is a topological retract of S.

The Sierpiński space is a strict topological structure and is defined by the conditions (Def. 9).

(Def. 9)(i) The carrier of the Sierpiński space = {0, 1}, and (ii) the topology of the Sierpiński space = {∅, {1}, {0, 1}}. Let us note that the Sierpiński space is non empty and topological space-like. One can check that the Sierpiński space is discernible. Let us note that the Sierpiński space is injective. Let I be a set and let S be a non empty 1-sorted structure. One can verify

that I ⟼→ S is nonempty.

Let I be a set and let T be a topological space. One can check that I ⟼→ T is topological space yielding.

Let I be a set and let L be a reflexive relational structure. One can check that I ⟼→ L is reflexive-yielding.

Let I be a non empty set and let L be a non empty antisymmetric relational structure. Note that ∏(I ⟼→ L) is antisymmetric.

Let I be a non empty set and let L be a non empty transitive relational structure. One can check that ∏(I ⟼→ L) is transitive.

The following two propositions are true:

(13) Let T be a Scott topological augmentation of 2_{⊆}^{1} . Then the topology of T = the topology of the Sierpiński space.

(14) Let I be a non empty set. Then {∏((the support of I ⟼→ the Sierpiński space)+·(i, {1})) : i ranges over elements of I} is a prebasis of ∏(I ⟼→ the Sierpiński space).

Let I be a non empty set and let L be a complete lattice. One can check that ∏(I ⟼→ L) is complete and has l.u.b.’s.

Let I be a non empty set and let X be an algebraic lower-bounded lattice. One can check that ∏(I ⟼→ X) is algebraic.

injective spaces 61

Next we state several propositions:

(15) Let X be a non empty set. Then there exists a map f from 2_{⊆}^{X} into ∏(X ⟼→ 2_{⊆}^{1} ) such that f is isomorphic and for every subset Y of X holds f(Y) = χ_{Y,X}.

(16) Let I be a non empty set and T be a Scott topological augmentation of ∏(I ⟼→ 2_{⊆}^{1} ). Then the topology of T = the topology of ∏(I ⟼→ the Sierpiński space).

(17) Let T, S be non empty topological spaces. Suppose the carrier of T = the carrier of S and the topology of T = the topology of S and T is injective. Then S is injective.

(18) For every non empty set I holds every Scott topological augmentation of ∏ I ⟼→ 2_{⊆}^{1} is injective.

(19) Let T be a T_{0}-space. Then there exists a non empty set M and there exists a map f from T into ∏(M ⟼→ the Sierpiński space) such that f^{∘} is a homeomorphism.

(20) Let T be a T_{0}-space. Suppose T is injective. Then there exists a non empty set M such that T is a topological retract of ∏(M ⟼→ the Sierpiński space).

References

[1] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[2] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[3] Grzegorz Bancerek. The “way-below” relation. Formalized Mathematics, 6(1):169–176, 1997.

[4] Grzegorz Bancerek. Bases and refinements of topologies. Formalized Mathematics, 7(1):35–43, 1998.

[5] Grzegorz Bancerek and Andrzej Trybulec. Miscellaneous facts about functions. Formalized Mathematics, 5(4):485–492, 1996.

[6] Czesław Byliński. Basic functions and operations on functions. Formalized Mathematics, 1(1):245–254, 1990.

[7] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[8] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

[9] Adam Grabowski and Robert Milewski. Boolean posets, posets under inclusion and products of relational structures. Formalized Mathematics, 6(1):117–121, 1997.

[10] Beata Madras. Product of family of universal algebras. Formalized Mathematics, 4(1):103– 108, 1993.

[11] Yatsuka Nakamura, Piotr Rudnicki, Andrzej Trybulec, and Pauline N. Kawamoto. Preliminaries to circuits, I. Formalized Mathematics, 5(2):167–172, 1996.

[12] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[13] Alexander Yu. Shibakov and Andrzej Trybulec. The Cantor set. Formalized Mathematics, 5(2):233–236, 1996.

[14] Andrzej Trybulec. Enumerated sets. Formalized Mathematics, 1(1):25–34, 1990.

[15] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11,

62 jarosław gryko

[16] Andrzej Trybulec. A Borsuk theorem on homotopy types. Formalized Mathematics, 2(4):535–545, 1991.

[17] Andrzej Trybulec. Many-sorted sets. Formalized Mathematics, 4(1):15–22, 1993.

[18] Andrzej Trybulec. Scott topology. Formalized Mathematics, 6(2):311–319, 1997.

[19] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[20] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[21] Mariusz Żynel and Czesław Byliński. Properties of relational structures, posets, lattices and maps. Formalized Mathematics, 6(1):123–130, 1997.

[22] Mariusz Żynel and Adam Guzowski. T_{0} topological spaces. Formalized Mathematics, 5(1):75–77, 1996.

Received April 17, 1998

On the Characterization of Hausdorff Spaces^{1}

Artur Korniłowicz University of Białystok

MML Identifier: YELLOW12.

The terminology and notation used in this paper are introduced in the following papers: [24], [19], [17], [10], [16], [7], [8], [6], [1], [18], [22], [15], [25], [23], [11], [26], [21], [3], [14], [4], [2], [12], [13], [20], [5], and [9].

1. The Properties of Some Functions

In this paper A, B, X, Y denote sets. Let X be an empty set. Note that ⋃ X is empty. Next we state several propositions:

(1) (δ_{X})^{∘}A ⊆ [: A, A:].

(2) (δ_{X})^{−1} ([: A, A:]) ⊆ A.

(3) For every subset A of X holds (δ_{X})^{−1} ([: A, A:]) = A.

(4) dom⟨π_{2}(X ×Y), π_{1}(X ×Y)⟩ = [: X, Y :] and rng⟨π_{2}(X ×Y), π_{1}(X ×Y)⟩ = [: Y, X:].

(5) ⟨π_{2}(X × Y), π_{1}(X × Y)⟩^{∘}[: A, B:] ⊆ [: B, A:].

(6) For every subset A of X and for every subset B of Y holds ⟨π_{2}(X × Y), π_{1}(X × Y)⟩^{∘}[: A, B:] = [: B, A:].

(7) ⟨π_{2}(X × Y), π_{1}(X × Y)⟩ is one-to-one. Let X, Y be sets. One can verify that ⟨π_{2}(X × Y), π_{1}(X × Y)⟩ is one-to-one. The following proposition is true

(8) ⟨π_{2}(X × Y), π_{1}(X × Y)⟩^{−1} = ⟨π_{2}(Y × X), π_{1}(Y × X)⟩.

1This work has been supported by KBN Grant 8 T11C 018 12.

2. The Properties of the Relational Structures

Next we state a number of propositions:

(9) Let L_{1} be a semilattice, L_{2} be a non empty relational structure, x, y be elements of L_{1}, and x_{1}, y_{1} be elements of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and x = x_{1} and y = y_{1}. Then x ⊓ y = x_{1} ⊓ y_{1}.

(10) Let L_{1} be a sup-semilattice, L_{2} be a non empty relational structure, x, y be elements of L_{1}, and x_{1}, y_{1} be elements of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and x = x_{1} and y = y_{1}. Then x ⊔ y = x_{1} ⊔ y_{1}.

(11) Let L_{1} be a semilattice, L_{2} be a non empty relational structure, X, Y be subsets of L_{1}, and X_{1}, Y_{1} be subsets of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and X = X_{1} and Y = Y_{1}. Then X ⊓ Y = X_{1} ⊓ Y_{1}.

(12) Let L_{1} be a sup-semilattice, L_{2} be a non empty relational structure, X, Y be subsets of L_{1}, and X_{1}, Y_{1} be subsets of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and X = X_{1} and Y = Y_{1}. Then X ⊔ Y = X_{1} ⊔ Y_{1}.

(13) Let L_{1} be an antisymmetric up-complete non empty reflexive relational structure, L_{2} be a non empty reflexive relational structure, x be an element of L_{1}, and y be an element of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and x = y. Then ↓↓x = ↓↓y and ↑↑x = ↑↑y.

(14) Let L_{1} be a meet-continuous semilattice and L_{2} be a non empty reflexive relational structure. Suppose the relational structure of L_{1} = the relational structure of L_{2}. Then L_{2} is meet-continuous.

(15) Let L_{1} be a continuous antisymmetric non empty reflexive relational structure and L_{2} be a non empty reflexive relational structure. Suppose the relational structure of L_{1} = the relational structure of L_{2}. Then L_{2} is continuous.

(16) Let L_{1}, L_{2} be relational structures, A be a subset of L_{1}, and J be a subset of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and A = J. Then sub(A) = sub(J).

(17) Let L_{1}, L_{2} be non empty relational structures, A be a relational sub-

structure of L_{1}, and J be a relational substructure of L_{2}. Suppose that (i) the relational structure of L_{1} = the relational structure of L_{2}, (ii) the relational structure of A = the relational structure of J, and (iii) A is meet-inheriting.

Then J is meet-inheriting.

(18) Let L_{1}, L_{2} be non empty relational structures, A be a relational sub-

structure of L_{1}, and J be a relational substructure of L_{2}. Suppose that (i) the relational structure of L_{1} = the relational structure of L_{2}, (ii) the relational structure of A = the relational structure of J, and (iii) A is join-inheriting.

Then J is join-inheriting.

(19) Let L_{1} be an up-complete antisymmetric non empty reflexive relational structure, L_{2} be a non empty reflexive relational structure, X be a subset of L_{1}, and Y be a subset of L_{2} such that the relational structure of L_{1} = the relational structure of L_{2} and X = Y and X has the property (S). Then Y has the property (S).

(20) Let L_{1} be an up-complete antisymmetric non empty reflexive relational structure, L_{2} be a non empty reflexive relational structure, X be a subset of L_{1}, and Y be a subset of L_{2}. Suppose the relational structure of L_{1} = the relational structure of L_{2} and X = Y and X is directly closed. Then Y is directly closed.

(21) Let N be an antisymmetric relational structure with g.l.b.’s, D, E be subsets of N, and X be an upper subset of N. If D ∩ X = ∅, then (D ⊓ E) ∩ X = ∅.

(22) Let R be a reflexive non empty relational structure. Then △_{the carrier of R} ⊆ (the internal relation of R) ∩ (the internal relation of R^{⌣}).

(23) Let R be an antisymmetric relational structure. Then (the internal relation of R) ∩ (the internal relation of R^{⌣}) ⊆ △_{the carrier of R}.

(24) Let R be an upper-bounded semilattice and X be a subset of [: R, R:].

If inf (⊓_{R})^{∘}X exists in R, then ⊓_{R} preserves inf of X. Let R be a complete semilattice. One can verify that ⊓_{R} is infs-preserving. Next we state the proposition

(25) Let R be a lower-bounded sup-semilattice and X be a subset of [: R, R:].

If sup (⊔_{R})^{∘}X exists in R, then ⊔_{R} preserves sup of X. Let R be a complete sup-semilattice. Note that ⊔_{R} is sups-preserving. One can prove the following propositions:

(26) For every semilattice N and for every subset A of N such that sub(A) is meet-inheriting holds A is filtered.

(27) For every sup-semilattice N and for every subset A of N such that sub(A) is join-inheriting holds A is directed.

(28) Let N be a transitive relational structure and A, J be subsets of N. If A is coarser than ↑J, then ↑A ⊆ ↑J.

(29) For every transitive relational structure N and for all subsets A, J of N such that A is finer than ↓J holds ↓A ⊆ ↓J.

(30) Let N be a non empty reflexive relational structure, x be an element of N, and X be a subset of N. If x ∈ X, then ↑x ⊆ ↑X.

(31) Let N be a non empty reflexive relational structure, x be an element of N, and X be a subset of N. If x ∈ X, then ↓x ⊆ ↓X.

3. On the Hausdorff Spaces

In the sequel R, S, T denote non empty topological spaces.

Let T be a non empty topological structure. One can verify that the topological structure of T is non empty.

Let T be a topological space. Observe that the topological structure of T is topological space-like.

Next we state three propositions:

(32) Let S, T be topological structures and B be a basis of S. Suppose the topological structure of S = the topological structure of T. Then B is a basis of T.

(33) Let S, T be topological structures and B be a prebasis of S. Suppose the topological structure of S = the topological structure of T. Then B is a prebasis of T.

(34) Every basis of T is non empty.

Let T be a non empty topological space. Note that every basis of T is non empty.

The following proposition is true

(35) For every point x of T holds every basis of x is non empty.

Let T be a non empty topological space and let x be a point of T. One can check that every basis of x is non empty.

Next we state a number of propositions:

(36) Let S_{1}, T_{1}, S_{2}, T_{2} be non empty topological spaces, f be a map from S_{1}

into S_{2}, and g be a map from T_{1} into T_{2}. Suppose that

(i) the topological structure of S_{1} = the topological structure of T_{1}, (ii) the topological structure of S_{2} = the topological structure of T_{2}, (iii) f = g, and (iv) f is continuous.

Then g is continuous.

(37) △_{the carrier of T} = {p; p ranges over points of [: T, T :]: π_{1}((the carrier of T) × the carrier of T)(p) = π_{2}((the carrier of T) × the carrier of T)(p)}.

(38) δ_{the carrier of T} is a continuous map from T into [: T, T :].

(39) π_{1}((the carrier of S) × the carrier of T ) is a continuous map from [: S, T :] into S.

(40) π_{2}((the carrier of S) × the carrier of T ) is a continuous map from [: S, T :] into T.

(41) Let f be a continuous map from T into S and g be a continuous map from T into R. Then ⟨f, g⟩ is a continuous map from T into [: S, R:].

(42) ⟨π_{2}((the carrier of S)×the carrier of T), π_{1}((the carrier of S)×the carrier of T)⟩ is a continuous map from [: S, T :] into [: T, S:].

(43) Let f be a map from [: S, T :] into [: T, S:]. Suppose f = ⟨π_{2}((the carrier of S) × the carrier of T), π_{1}((the carrier of S) × the carrier of T)⟩. Then f is a homeomorphism.

(44) [: S, T :] and [: T, S:] are homeomorphic.

(45) Let T be a Hausdorff non empty topological space and f, g be continuous

maps from S into T. Then

(i) for every subset X of S such that X = {p; p ranges over points of S: f(p) ≠ g(p)} holds X is open, and

(ii) for every subset X of S such that X = {p; p ranges over points of S:

f(p) = g(p)} holds X is closed.

(46) T is Hausdorff iff for every subset A of [: T, T :] such that A =

△_{the carrier of T} holds A is closed. Let S, T be topological structures. Note that there exists a refinement of S

and T which is strict.

Let S be a non empty topological structure and let T be a topological structure. Observe that there exists a refinement of S and T which is strict and non empty and there exists a refinement of T and S which is strict and non empty.

We now state the proposition

(47) Let R, S, T be topological structures. Then R is a refinement of S and

T if and only if the topological structure of R is a refinement of S and T. For simplicity, we adopt the following convention: S_{1}, S_{2}, T_{1}, T_{2} are non

empty topological spaces, R is a refinement of [: S_{1}, T_{1} :] and [: S_{2}, T_{2} :], R_{1} is a refinement of S_{1} and S_{2}, and R_{2} is a refinement of T_{1} and T_{2}.

The following three propositions are true:

(48) Suppose the carrier of S_{1} = the carrier of S_{2} and the carrier of T_{1} = the carrier of T_{2}. Then {[: U_{1}, V_{1} :] ∩ [: U_{2}, V_{2} :]; U_{1} ranges over subsets of S_{1}, U_{2} ranges over subsets of S_{2}, V_{1} ranges over subsets of T_{1}, V_{2} ranges over subsets of T_{2}: U_{1} is open ∧ U_{2} is open ∧ V_{1} is open ∧ V_{2} is open} is a basis of R.

(49) Suppose the carrier of S_{1} = the carrier of S_{2} and the carrier of T_{1} = the carrier of T_{2}. Then the carrier of [: R_{1}, R_{2} :] = the carrier of R and the topology of [: R_{1}, R_{2} :] = the topology of R.

(50) Suppose the carrier of S_{1} = the carrier of S_{2} and the carrier of T_{1} = the carrier of T_{2}. Then [: R_{1}, R_{2} :] is a refinement of [: S_{1}, T_{1} :] and [: S_{2}, T_{2} :].

68 artur korniłowicz

References

[1] Grzegorz Bancerek. Complete lattices. Formalized Mathematics, 2(5):719–725, 1991.

[2] Grzegorz Bancerek. Bounds in posets and relational substructures. Formalized Mathematics, 6(1):81–91, 1997.

[3] Grzegorz Bancerek. Directed sets, nets, ideals, filters, and maps. Formalized Mathematics, 6(1):93–107, 1997.

[4] Grzegorz Bancerek. The “way-below” relation. Formalized Mathematics, 6(1):169–176, 1997.

[5] Grzegorz Bancerek. Bases and refinements of topologies. Formalized Mathematics, 7(1):35–43, 1998.

[6] Czesław Byliński. Basic functions and operations on functions. Formalized Mathematics, 1(1):245–254, 1990.

[7] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[8] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[9] Czesław Byliński. Some basic properties of sets. Formalized Mathematics, 1(1):47–53, 1990.

[10] Agata Darmochwał. Compact spaces. Formalized Mathematics, 1(2):383–386, 1990.

[11] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

[12] Artur Korniłowicz. Cartesian products of relations and relational structures. Formalized Mathematics, 6(1):145–152, 1997.

[13] Artur Korniłowicz. Definitions and properties of the join and meet of subsets. Formalized Mathematics, 6(1):153–158, 1997.

[14] Artur Korniłowicz. Meet–continuous lattices. Formalized Mathematics, 6(1):159–167, 1997.

[15] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[16] Konrad Raczkowski and Paweł Sadowski. Equivalence relations and classes of abstraction. Formalized Mathematics, 1(3):441–444, 1990.

[17] Alexander Yu. Shibakov and Andrzej Trybulec. The Cantor set. Formalized Mathematics, 5(2):233–236, 1996.

[18] Andrzej Trybulec. Tuples, projections and Cartesian products. Formalized Mathematics, 1(1):97–105, 1990.

[19] Andrzej Trybulec. A Borsuk theorem on homotopy types. Formalized Mathematics, 2(4):535–545, 1991.

[20] Andrzej Trybulec. Baire spaces, Sober spaces. Formalized Mathematics, 6(2):289–294, 1997.

[21] Andrzej Trybulec. Scott topology. Formalized Mathematics, 6(2):311–319, 1997.

[22] Wojciech A. Trybulec. Partially ordered sets. Formalized Mathematics, 1(2):313–319, 1990.

[23] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[24] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[25] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

[26] Mariusz Żynel and Adam Guzowski. T_{0} topological spaces. Formalized Mathematics, 5(1):75–77, 1996.

Received April 18, 1998

The Field of Quotients Over an Integral Domain

Christoph Schwarzweller University of Tübingen

Summary. We introduce the field of quotients over an integral domain following the well-known construction using pairs over integral domains. In addition we define ring homomorphisms and prove some basic facts about fields of quotients including their universal property.

MML Identifier: QUOFIELD.

The papers [1], [13], [10], [2], [3], [7], [9], [11], [12], [5], [6], [8], and [4] provide the terminology and notation for this paper.

1. Preliminaries

Let I be a non empty zero structure. The functor Q(I) is a subset of [: the carrier of I, the carrier of I:] and is defined by:

(Def. 1) For every set u holds u ∈ Q(I) iff there exist elements a, b of the carrier

of I such that u = ⟨⟨a, b⟩⟩ and b ≠ 0_{I}. Next we state the proposition

(1) For every non degenerated non empty multiplicative loop with zero struc-

ture I holds Q(I) is non empty. The following two propositions are true:

(2) Let I be a non degenerated non empty multiplicative loop with zero structure and u be an element of Q(I). Then u_{2} ≠ 0_{I}.

(3) Let I be a non degenerated non empty multiplicative loop with zero structure and u be an element of Q(I). Then u_{1} is an element of the carrier of I and u_{2} is an element of the carrier of I.

Let I be a non degenerated integral domain-like non empty double loop structure and let u, v be elements of Q(I). The functor u+v yielding an element of Q(I) is defined by:

(Def. 2) u + v = ⟨⟨u_{1} · v_{2} + v_{1} · u_{2}, u_{2} · v_{2} ⟩⟩.

Let I be a non degenerated integral domain-like non empty double loop structure and let u, v be elements of Q(I). The functor u · v yielding an element of Q(I) is defined as follows:

(Def. 3) u · v = ⟨⟨u_{1} · v_{1}, u_{2} · v_{2} ⟩⟩.

The following two propositions are true:

(4) Let I be a non degenerated integral domain-like associative commutative Abelian add-associative distributive non empty double loop structure and u, v, w be elements of Q(I). Then u+(v+w) = (u+v)+w and u+v = v+u.

(5) Let I be a non degenerated integral domain-like associative commutative Abelian non empty double loop structure and u, v, w be elements of Q(I). Then u · (v · w) = (u · v) · w and u · v = v · u.

Let I be a non degenerated integral domain-like associative commutative Abelian add-associative distributive non empty double loop structure and let u, v be elements of Q(I). Let us notice that the functor u + v is commutative.

Let I be a non degenerated integral domain-like associative commutative Abelian non empty double loop structure and let u, v be elements of Q(I). Let us note that the functor u · v is commutative.

Let I be a non degenerated non empty multiplicative loop with zero structure and let u be an element of Q(I). The functor QClass(u) is a subset of Q(I) and is defined as follows:

(Def. 4) For every element z of Q(I) holds z ∈ QClass(u) iff z_{1} · u_{2} = z_{2} · u_{1}. The following proposition is true

(6) Let I be a non degenerated commutative non empty multiplicative loop with zero structure and u be an element of Q(I). Then u ∈ QClass(u).

Let I be a non degenerated commutative non empty multiplicative loop with zero structure and let u be an element of Q(I). Observe that QClass(u) is non empty.

Let I be a non degenerated non empty multiplicative loop with zero structure. The functor Quot(I) is a family of subsets of Q(I) and is defined by:

(Def. 5) For every subset A of Q(I) holds A ∈ Quot(I) iff there exists an element

u of Q(I) such that A = QClass(u). Next we state the proposition

(7) For every non degenerated non empty multiplicative loop with zero structure I holds Quot(I) is non empty.

Next we state two propositions:

(8) Let I be a non degenerated integral domain-like ring and u, v be elements of Q(I). If there exists an element w of Quot(I) such that u ∈ w and v ∈ w, then u_{1} · v_{2} = v_{1} · u_{2}.

(9) For every non degenerated integral domain-like ring I and for all elements u, v of Quot(I) such that u ∩ v ≠ ∅ holds u = v.

2. Defining the Operations

Let I be a non degenerated integral domain-like ring and let u, v be elements of Quot(I). The functor u +_{q} v yielding an element of Quot(I) is defined by the condition (Def. 6).

(Def. 6) Let z be an element of Q(I). Then z ∈ u +_{q} v if and only if there exist elements a, b of Q(I) such that a ∈ u and b ∈ v and z_{1} · (a_{2} · b_{2}) = z_{2} · (a_{1} · b_{2} + b_{1} · a_{2}).

Let I be a non degenerated integral domain-like ring and let u, v be elements of Quot(I). The functor u ·_{q} v yielding an element of Quot(I) is defined by the condition (Def. 7).

(Def. 7) Let z be an element of Q(I). Then z ∈ u ·_{q} v if and only if there exist

elements a, b of Q(I) such that a ∈ u and b ∈ v and z_{1}·(a_{2}·b_{2}) = z_{2}·(a_{1}·b_{1}). Next we state the proposition

(10) Let I be a non degenerated non empty multiplicative loop with zero structure and u be an element of Q(I). Then QClass(u) is an element of Quot(I).

We now state two propositions:

(11) For every non degenerated integral domain-like ring I and for all elements u, v of Q(I) holds QClass(u) +_{q} QClass(v) = QClass(u + v).

(12) For every non degenerated integral domain-like ring I and for all elements

u, v of Q(I) holds QClass(u) ·_{q} QClass(v) = QClass(u · v). Let I be a non degenerated integral domain-like ring. The functor 0_{q}(I)

yielding an element of Quot(I) is defined by: (Def. 8) For every element z of Q(I) holds z ∈ 0_{q}(I) iff z_{1} = 0_{I}.

Let I be a non degenerated integral domain-like ring. The functor 1_{q}(I) yielding an element of Quot(I) is defined as follows:

(Def. 9) For every element z of Q(I) holds z ∈ 1_{q}(I) iff z_{1} = z_{2}.

Let I be a non degenerated integral domain-like ring and let u be an element of Quot(I). The functor −_{q}u yielding an element of Quot(I) is defined by:

(Def. 10) For every element z of Q(I) holds z ∈ −_{q}u iff there exists an element a of Q(I) such that a ∈ u and z_{1} · a_{2} = z_{2} · − a_{1}.

Let I be a non degenerated integral domain-like ring and let u be an element of Quot(I). Let us assume that u ≠ 0_{q}(I). The functor u_{q}^{−1} yields an element of Quot(I) and is defined by:

(Def. 11) For every element z of Q(I) holds z ∈ u_{q}^{−1} iff there exists an element a

of Q(I) such that a ∈ u and z_{1} · a_{1} = z_{2} · a_{2}. The following propositions are true:

(13) Let I be a non degenerated integral domain-like ring and u, v, w be elements of Quot(I). Then u+_{q}(v+_{q}w) = (u+_{q}v)+_{q}w and u+_{q}v = v+_{q}u.

(14) For every non degenerated integral domain-like ring I and for every element u of Quot(I) holds u +_{q} 0_{q}(I) = u and 0_{q}(I) +_{q} u = u.

(15) Let I be a non degenerated integral domain-like ring and u, v, w be elements of Quot(I). Then u ·_{q} (v ·_{q} w) = (u ·_{q} v) ·_{q} w and u ·_{q} v = v ·_{q} u.

(16) For every non degenerated integral domain-like ring I and for every element u of Quot(I) holds u ·_{q} 1_{q}(I) = u and 1_{q}(I) ·_{q} u = u.

(17) For every non degenerated integral domain-like ring I and for all elements u, v, w of Quot(I) holds (u +_{q} v) ·_{q} w = (u ·_{q} w) +_{q} (v ·_{q} w).

(18) For every non degenerated integral domain-like ring I and for all elements u, v, w of Quot(I) holds u ·_{q} (v +_{q} w) = (u ·_{q} v) +_{q} (u ·_{q} w).

(19) For every non degenerated integral domain-like ring I and for every element u of Quot(I) holds u +_{q} −_{q}u = 0_{q}(I) and −_{q}u +_{q} u = 0_{q}(I).

(20) Let I be a non degenerated integral domain-like ring and u be an element of Quot(I). If u ≠ 0_{q}(I), then u ·_{q} u_{q}^{−1} = 1_{q}(I) and u_{q}^{−1} ·_{q} u = 1_{q}(I).

(21) For every non degenerated integral domain-like ring I holds 1_{q}(I) ≠ 0_{q}(I).

Let I be a non degenerated integral domain-like ring. The functor +_{q}(I) yielding a binary operation on Quot(I) is defined as follows:

(Def. 12) For all elements u, v of Quot(I) holds (+_{q}(I))(u, v) = u +_{q} v.

Let I be a non degenerated integral domain-like ring. The functor ·_{q}(I) yields a binary operation on Quot(I) and is defined as follows:

(Def. 13) For all elements u, v of Quot(I) holds (·_{q}(I))(u, v) = u ·_{q} v.

Let I be a non degenerated integral domain-like ring. The functor −_{q}(I) yields a unary operation on Quot(I) and is defined as follows:

(Def. 14) For every element u of Quot(I) holds (−_{q}(I))(u) = −_{q}u.

Let I be a non degenerated integral domain-like ring. The functor _{q}^{−1} (I) yields a unary operation on Quot(I) and is defined as follows:

(Def. 15) For every element u of Quot(I) holds (_{q}^{−1} (I))(u) = u_{q}^{−1} .

We now state a number of propositions:

(22) For every non degenerated integral domain-like ring I and for all elements u, v, w of Quot(I) holds (+_{q}(I))((+_{q}(I))(u, v), w) = (+_{q}(I))(u, (+_{q}(I))(v, w)).

(23) For every non degenerated integral domain-like ring I and for all elements u, v of Quot(I) holds (+_{q}(I))(u, v) = (+_{q}(I))(v, u).

(24) For every non degenerated integral domain-like ring I and for every element u of Quot(I) holds (+_{q}(I))(u, 0_{q}(I)) = u and (+_{q}(I))(0_{q}(I), u) = u.

(25) For every non degenerated integral domain-like ring I and for all elements u, v, w of Quot(I) holds (·_{q}(I))((·_{q}(I))(u, v), w) = (·_{q}(I))(u, (·_{q}(I))(v, w)).

(26) For every non degenerated integral domain-like ring I and for all elements u, v of Quot(I) holds (·_{q}(I))(u, v) = (·_{q}(I))(v, u).

(27) For every non degenerated integral domain-like ring I and for every element u of Quot(I) holds (·_{q}(I))(u, 1_{q}(I)) = u and (·_{q}(I))(1_{q}(I), u) = u.

(28) Let I be a non degenerated integral domain-like ring and u, v, w be elements of Quot(I). Then (·_{q}(I))((+_{q}(I))(u, v), w) = (+_{q}(I))((·_{q}(I))(u, w), (·_{q}(I))(v, w)).

(29) Let I be a non degenerated integral domain-like ring and u, v, w be elements of Quot(I). Then (·_{q}(I))(u, (+_{q}(I))(v, w)) = (+_{q}(I))((·_{q}(I))(u, v), (·_{q}(I))(u, w)).

(30) Let I be a non degenerated integral domain-like ring and u be an element of Quot(I). Then (+_{q}(I))(u, (−_{q}(I))(u)) = 0_{q}(I) and (+_{q}(I))((−_{q}(I))(u),

u) = 0_{q}(I).

(31) Let I be a non degenerated integral domain-like ring and u be an element of Quot(I). If u ≠ 0_{q}(I), then (·_{q}(I))(u, (_{q}^{−1} (I))(u)) = 1_{q}(I) and (·_{q}(I))((_{q}^{−1} (I))(u), u) = 1_{q}(I).

3. Defining the Field of Quotients

Let I be a non degenerated integral domain-like ring. The field of quotients of I yields a strict double loop structure and is defined as follows:

(Def. 16) The field of quotients of I = ⟨Quot(I), +_{q}(I), ·_{q}(I), 1_{q}(I), 0_{q}(I)⟩.

Let I be a non degenerated integral domain-like ring. Observe that the field of quotients of I is non empty.

The following propositions are true:

(32) Let I be a non degenerated integral domain-like ring. Then (i) the carrier of the field of quotients of I = Quot(I), (ii) the addition of the field of quotients of I = +_{q}(I), (iii) the multiplication of the field of quotients of I = ·_{q}(I), (iv) the zero of the field of quotients of I = 0_{q}(I), and

(v) the unity of the field of quotients of I = 1_{q}(I).

(33) Let I be a non degenerated integral domain-like ring and u, v be elements of the carrier of the field of quotients of I. Then (+_{q}(I))(u, v) is an element of the carrier of the field of quotients of I.

(34) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Then (−_{q}(I))(u) is an element of the carrier of the field of quotients of I.

(35) Let I be a non degenerated integral domain-like ring and u, v be elements of the carrier of the field of quotients of I. Then (·_{q}(I))(u, v) is an element of the carrier of the field of quotients of I.

(36) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Then (_{q}^{−1} (I))(u) is an element of the carrier of the field of quotients of I.

(37) Let I be a non degenerated integral domain-like ring and u, v be elements

of the carrier of the field of quotients of I. Then u + v = (+_{q}(I))(u, v). Let I be a non degenerated integral domain-like ring. One can verify that the

field of quotients of I is add-associative right zeroed and right complementable.

Next we state a number of propositions:

(38) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Then − u = (−_{q}(I))(u).

(39) Let I be a non degenerated integral domain-like ring and u, v be elements of the carrier of the field of quotients of I. Then u · v = (·_{q}(I))(u, v).

(40) Let I be a non degenerated integral domain-like ring. Then 1_{the field of quotients of I} = 1_{q}(I) and 0_{the field of quotients of I} = 0_{q}(I).

(41) Let I be a non degenerated integral domain-like ring and u, v, w be elements of the carrier of the field of quotients of I. Then (u + v) + w = u + (v + w).

(42) Let I be a non degenerated integral domain-like ring and u, v be elements of the carrier of the field of quotients of I. Then u + v = v + u.

(43) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Then u + 0_{the field of quotients of I} = u.

(44) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Then u + − u = 0_{the field of quotients of I}.

(45) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Then 1_{the field of quotients of I} ·u = u.

(46) Let I be a non degenerated integral domain-like ring and u, v be elements of the carrier of the field of quotients of I. Then u · v = v · u.

(47) Let I be a non degenerated integral domain-like ring and u, v, w be elements of the carrier of the field of quotients of I. Then (u · v) · w = u · (v · w).

(48) Let I be a non degenerated integral domain-like ring and u be an element of the carrier of the field of quotients of I. Suppose u ≠ 0_{the field of quotients of I}. Then there exists an element v of the carrier of the field of quotients of I such that u · v = 1_{the field of quotients of I}.

(49) Let I be a non degenerated integral domain-like ring. Then the field of quotients of I is an add-associative right zeroed right complementable Abelian commutative associative left unital distributive field-like non degenerated non empty double loop structure.

Let I be a non degenerated integral domain-like ring. Note that the field of quotients of I is Abelian commutative associative left unital distributive fieldlike and non degenerated.

Next we state the proposition

(50) Let I be a non degenerated integral domain-like ring and x be an element of the carrier of the field of quotients of I. Suppose x ≠ 0_{the field of quotients of I}. Let a be an element of the carrier of I. Suppose a ≠ 0_{I}. Let u be an element of Q(I). Suppose x = QClass(u) and u = ⟨⟨a, 1_{I} ⟩⟩. Let v be an element of Q(I). If v = ⟨⟨1_{I}, a⟩⟩, then x^{−1} = QClass(v).

Let us observe that every add-associative right zeroed right complementable commutative associative left unital distributive field-like non degenerated non empty double loop structure is integral domain-like and right unital.

One can check that there exists a non empty double loop structure which is add-associative, right zeroed, right complementable, Abelian, commutative, associative, left unital, distributive, field-like, and non degenerated.

Let F be a commutative associative left unital distributive field-like non empty double loop structure and let x, y be elements of the carrier of F. The functor \frac{x}{y} yields an element of the carrier of F and is defined as follows:

(Def. 17) \frac{x}{y} = x · y^{−1} .

One can prove the following propositions:

(51) Let F be a non degenerated field-like ring and a, b, c, d be elements of the carrier of F. If b ≠ 0_{F} and d ≠ 0_{F} , then \frac{a}{b} · \frac{c}{d} = \frac{a·c}{b·d}.

(52) Let F be a non degenerated field-like ring and a, b, c, d be elements of the carrier of F. If b ≠ 0_{F} and d ≠ 0_{F} , then \frac{a}{b} + \frac{c}{d} = \frac{a·d+c·b}{b·d}.

4. Defining Ring Homomorphisms

Let R, S be non empty double loop structures and let f be a map from R into S. We say that f is a ring homomorphism if and only if:

(Def. 21)^{1} f is additive, multiplicative, and unity-preserving.

Let R, S be non empty double loop structures. One can verify that every map from R into S which is ring homomorphism is also additive, multiplicative, and unity-preserving and every map from R into S which is additive, multiplicative, and unity-preserving is also a ring homomorphism.

Let R, S be non empty double loop structures and let f be a map from R into S. We say that f is a ring epimorphism if and only if:

(Def. 22) f is a ring homomorphism and rngf = the carrier of S.

We say that f is a ring monomorphism if and only if: (Def. 23) f is a ring homomorphism and one-to-one.

We introduce f is an embedding as a synonym of f is a ring monomorphism.

Let R, S be non empty double loop structures and let f be a map from R into S. We say that f is a ring isomorphism if and only if:

(Def. 24) f is a ring monomorphism and a ring epimorphism.

Let R, S be non empty double loop structures. Note that every map from R into S which is ring isomorphism is also a ring monomorphism and a ring epimorphism and every map from R into S which is ring monomorphism and ring epimorphism is also a ring isomorphism.

We now state several propositions:

(53) For all rings R, S and for every map f from R into S such that f is a ring homomorphism holds f(0_{R}) = 0_{S}.

(54) Let R, S be rings and f be a map from R into S. Suppose f is a ring monomorphism. Let x be an element of the carrier of R. Then f(x) = 0_{S} if and only if x = 0_{R}.

(55) Let R, S be non degenerated field-like rings and f be a map from R into S. Suppose f is a ring homomorphism. Let x be an element of the carrier of R. If x ≠ 0_{R}, then f(x^{−1} ) = f(x)^{−1} .

(56) Let R, S be non degenerated field-like rings and f be a map from R into S. Suppose f is a ring homomorphism. Let x, y be elements of the carrier of R. If y ≠ 0_{R}, then f(x · y^{−1} ) = f(x) · f(y)^{−1} .

(57) Let R, S, T be rings and f be a map from R into S. Suppose f is a ring homomorphism. Let g be a map from S into T. If g is a ring homomorphism, then g · f is a ring homomorphism.

1The definitions (Def. 18)–(Def. 20) have been removed.

(58) For every non empty double loop structure R holds id_{R} is a ring homo-

morphism. Let R, S be non empty double loop structures. We say that R is embedded

in S if and only if: (Def. 25) There exists a map from R into S which is a ring monomorphism.

Let R, S be non empty double loop structures. We say that R is ring isomorphic to S if and only if:

(Def. 26) There exists a map from R into S which is a ring isomorphism. Let us note that the predicate R is ring isomorphic to S is symmetric.

5. Some Further Properties

Let I be a non empty zero structure and let x, y be elements of the carrier of I. Let us assume that y ≠ 0_{I}. The functor quotient(x, y) yielding an element of Q(I) is defined as follows:

(Def. 27) quotient(x, y) = ⟨⟨x, y⟩⟩.

Let I be a non degenerated integral domain-like ring. The canonical homomorphism of I into quotient field is a map from I into the field of quotients of I and is defined by the condition (Def. 28).

(Def. 28) Let x be an element of the carrier of I. Then (the canonical homomor-

phism of I into quotient field)(x) = QClass(quotient(x, 1_{I})). Next we state four propositions:

(59) Let I be a non degenerated integral domain-like ring. Then the canonical homomorphism of I into quotient field is a ring homomorphism.

(60) Let I be a non degenerated integral domain-like ring. Then the canonical homomorphism of I into quotient field is an embedding.

(61) For every non degenerated integral domain-like ring I holds I is embedded in the field of quotients of I.

(62) Let F be a non degenerated field-like integral domain-like ring. Then F

is ring isomorphic to the field of quotients of F. Let I be a non degenerated integral domain-like ring. Note that the field of

quotients of I is integral domain-like right unital and right-distributive.

One can prove the following proposition

(63) Let I be a non degenerated integral domain-like ring. Then the field of quotients of the field of quotients of I is ring isomorphic to the field of quotients of I.

Let I be a non empty double loop structure, let F be a non empty double loop structure, and let f be a map from I into F. We say that F is a field of quotients for I via f if and only if the conditions (Def. 29) are satisfied.

78 christoph schwarzweller

(Def. 29)(i) f is a ring monomorphism, and

(ii) for every add-associative right zeroed right complementable Abelian commutative associative left unital distributive field-like non degenerated non empty double loop structure F′ and for every map f′ from I into F′ such that f′is a ring monomorphism there exists a map h from F into F′ such that h is a ring homomorphism and h · f = f′ and for every map h′ from F into F′ such that h′ is a ring homomorphism and h′· f = f′ holds h′= h.

Next we state two propositions:

(64) Let I be a non degenerated integral domain-like ring. Then there exists an add-associative right zeroed right complementable Abelian commutative associative left unital distributive field-like non degenerated non empty double loop structure F and there exists a map f from I into F such that F is a field of quotients for I via f.

(65) Let I be an integral domain-like ring, F, F′ be add-associative right zeroed right complementable Abelian commutative associative left unital distributive field-like non degenerated non empty double loop structures, f be a map from I into F, and f′ be a map from I into F′. Suppose F is a field of quotients for I via f and F′ is a field of quotients for I via f′. Then F is ring isomorphic to F′.

References

[1] Czesław Byliński. Binary operations. Formalized Mathematics, 1(1):175–180, 1990.

[2] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[3] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[4] Czesław Byliński. Some basic properties of sets. Formalized Mathematics, 1(1):47–53, 1990.

[5] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

[6] Eugeniusz Kusak, Wojciech Leończuk, and Michał Muzalewski. Abelian groups, fields and vector spaces. Formalized Mathematics, 1(2):335–342, 1990.

[7] Michał Muzalewski. Categories of groups. Formalized Mathematics, 2(4):563–571, 1991.

[8] Michał Muzalewski. Construction of rings and left-, right-, and bi-modules over a ring. Formalized Mathematics, 2(1):3–11, 1991.

[9] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[10] Andrzej Trybulec. Domains and their Cartesian products. Formalized Mathematics, 1(1):115–122, 1990.

[11] Wojciech A. Trybulec. Vectors in real linear space. Formalized Mathematics, 1(2):291–296, 1990.

[12] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[13] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

Received May 4, 1998

First-countable, Sequential, and Frechet Spaces

Bartłomiej Skorulski University of Białystok

Summary. This article contains a definition of three classes of topological spaces: first-countable, Frechet, and sequential. Next there are some facts about them, that every first-countable space is Frechet and every Frechet space is sequential. Next section constains a formalized construction of topological space which is Frechet but not first-countable. This article is based on [9, pp. 73–81].

MML Identifier: FRECHET.

The notation and terminology used here are introduced in the following papers: [19], [2], [15], [4], [5], [6], [11], [1], [13], [3], [12], [14], [10], [20], [21], [18], [16], [8], [7], and [17].

1. Preliminaries

One can prove the following proposition

(1) For every non empty 1-sorted structure T and for every sequence S of T holds rngS is a subset of T.

Let T be a non empty 1-sorted structure and let S be a sequence of T. Then rngS is a subset of T.

The following propositions are true:

(2) Let T_{1} be a non empty 1-sorted structure, T_{2} be a 1-sorted structure, and S be a sequence of T_{1}. If rngS ⊆ the carrier of T_{2}, then S is a sequence of T_{2}.

(3) For every non empty topological space T and for every point x of T and for every basis B of x holds B ≠ ∅.

Let T be a non empty topological space and let x be a point of T. Note that every basis of x is non empty.

We now state a number of propositions:

(4) For every topological space T and for all subsets A, B of T such that A is open and B is closed holds A \ B is open.

(5) Let T be a topological structure. Suppose that

(i) ∅_{T} is closed, (ii) Ω_{T} is closed, (iii) for all subsets A, B of T such that A is closed and B is closed holds

A ∪ B is closed, and (iv) for every family F of subsets of T such that F is closed holds ⋂ F is

closed. Then T is a topological space.

(6) Let T be a topological space, S be a non empty topological structure, and f be a map from T into S. Suppose that for every subset A of S holds A is closed iff f^{−1} (A) is closed. Then S is a topological space.

(7) Let x be a point of the metric space of real numbers and x′, r be real numbers. If x′= x and r > 0, then Ball(x, r) = ]x′− r, x′+ r[.

(8) Let A be a subset of ℝ^{1}. Then A is open if and only if for every real number x such that x ∈ A there exists a real number r such that r > 0 and ]x − r, x + r[ ⊆ A.

(9) For every sequence S of ℝ^{1} such that for every natural number n holds S(n) ∈ ]n − \frac{1}{4}, n + \frac{1}{4}[ holds rngS is closed.

(10) For every subset B of ℝ^{1} such that B = ℕ holds B is closed.

(11) Let M be a metric space, x be a point of M_{top}, and x′ be a point of M.

Suppose x = x′. Then there exists a basis B of x such that

(i) B = \{Ball(x′, \frac{1}{n}); n ranges over natural numbers: n ≠ 0\}, (ii) B is countable, and (iii) there exists a function f from ℕ into B such that for every set n

such that n ∈ ℕ there exists a natural number n′ such that n = n′ and f(n) = Ball(x′, \frac{1}{n′+1}).

(12) For all functions f, g holds rng(f+·g) = f^{∘}(domf \ domg) ∪ rngg.

(13) For all sets A, B such that B ⊆ A holds (id_{A})^{∘}B = B.

(14) For all sets B, x holds dom(B ⟼→ x) = B.

(15) For all sets A, B, x holds dom(id_{A}+·(B ⟼→ x)) = A ∪ B.

(16) For all sets A, B, x such that B ≠ ∅ holds rng(id_{A}+·(B ⟼→ x)) = (A \ B) ∪ {x}.

(17) For all sets A, B, C, x such that C ⊆ A holds (id_{A}+·(B ⟼→ x))^{−1} (C \ {x}) = C \ B \ {x}.

(18) For all sets A, B, x such that x ∉ A holds (id_{A}+·(B ⟼→ x))^{−1} ({x}) = B.

(19) For all sets A, B, C, x such that C ⊆ A and x ∉ A holds (id_{A}+·(B ⟼→ x))^{−1} (C ∪ {x}) = C ∪ B.

(20) For all sets A, B, C, x such that C ⊆ A and x ∉ A holds (id_{A}+·(B ⟼→ x))^{−1} (C \ {x}) = C \ B.

2. First-countable, Sequential, and Frechet Spaces

Let T be a non empty topological structure. We say that T is first-countable if and only if:

(Def. 1) For every point x of T holds there exists a basis of x which is countable.

The following two propositions are true:

(21) For every metric space M holds M_{top} is first-countable.

(22) ℝ^{1} is first-countable.

Let us note that ℝ^{1} is first-countable. Let T be a topological structure, let S be a sequence of T, and let x be a

point of T. We say that S is convergent to x if and only if the condition (Def. 2) is satisfied.

(Def. 2) Let U_{1} be a subset of T. Suppose U_{1} is open and x ∈ U_{1}. Then there exists a natural number n such that for every natural number m such that n m holds S(m) ∈ U_{1}.

The following proposition is true

(23) Let T be a non empty topological structure, x be a point of T, and S be

a sequence of T. If S = ℕ ⟼→ x, then S is convergent to x. Let T be a topological structure and let S be a sequence of T. We say that

S is convergent if and only if: (Def. 3) There exists a point x of T such that S is convergent to x.

Let T be a non empty topological structure and let S be a sequence of T. The functor LimS yields a subset of T and is defined as follows:

(Def. 4) For every point x of T holds x ∈ LimS iff S is convergent to x.

Let T be a non empty topological structure. We say that T is Frechet if and only if the condition (Def. 5) is satisfied.

(Def. 5) Let A be a subset of T and x be a point of T. If x ∈ \overline{A}, then there exists

a sequence S of T such that rngS ⊆ A and x ∈ LimS. Let T be a non empty topological structure. We say that T is sequential if

and only if the condition (Def. 6) is satisfied. (Def. 6) Let A be a subset of T. Then A is closed if and only if for every sequence

S of T such that S is convergent and rngS ⊆ A holds LimS ⊆ A. The following proposition is true (24) For every non empty topological space T such that T is first-countable

holds T is Frechet. Let us observe that every non empty topological space which is first-countable

is also Frechet.

We now state four propositions:

(25) ℝ^{1} is Frechet.

(26) Let T be a non empty topological space and A be a subset of T. Suppose A is closed. Let S be a sequence of T. If S is convergent and rngS ⊆ A, then LimS ⊆ A.

(27) Let T be a non empty topological space. Suppose that for every subset A of T such that for every sequence S of T such that S is convergent and rngS ⊆ A holds LimS ⊆ A holds A is closed. Then T is sequential.

(28) For every non empty topological space T such that T is Frechet holds T

is sequential. Let us mention that every non empty topological space which is Frechet is

also sequential.

Next we state the proposition

(29) ℝ^{1} is sequential.

3. Counterexample of Frechet but Not First-countable Space

The strict non empty topological space ℝ/ℕ^{1} is defined by the conditions (Def. 7).

(Def. 7)(i) The carrier of ℝ/ℕ^{1} = (ℝ \ ℕ) ∪ {ℝ}, and

(ii) there exists a map f from ℝ^{1} into ℝ/ℕ^{1} such that f = id_{ℝ}+·(ℕ ⟼→ ℝ)

and for every subset A of ℝ/ℕ^{1} holds A is closed iff f^{−1} (A) is closed.

We now state several propositions:

(30) ℝ is a point of ℝ/ℕ^{1}.

(31) Let A be a subset of ℝ/ℕ^{1}. Then A is open and ℝ ∈ A if and only

if there exists a subset O of ℝ^{1} such that O is open and ℕ ⊆ O and A = (O \ ℕ) ∪ {ℝ}.

(32) For every set A holds A is a subset of ℝ/ℕ^{1} and ℝ ∉ A iff A is a subset

of ℝ^{1} and ℕ ∩ A = ∅.

(33) Let A be a subset of ℝ^{1} and B be a subset of ℝ/ℕ^{1}. If A = B, then ℕ ∩ A = ∅ and A is open iff ℝ ∉ B and B is open.

(34) For every subset A of ℝ/ℕ^{1} such that A = {ℝ} holds A is closed.

first-countable, sequential, and frechet … 83

(35) ℝ/ℕ^{1} is not first-countable.

(36) ℝ/ℕ^{1} is Frechet.

(37) It is not true that for every non empty topological space T such that T is Frechet holds T is first-countable.

4. Auxiliary Theorems

Next we state three propositions:

(38) \frac{1}{4} > 0 and \frac{1}{4} < \frac{1}{2}.

(39) For every real number r there exists a natural number n such that r < n.

(40) For every real number r such that r > 0 there exists a natural number n such that \frac{1}{n} < r and n ≠ 0.

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[2] Grzegorz Bancerek. Countable sets and Hessenberg’s theorem. Formalized Mathematics, 2(1):65–69, 1991.

[3] Leszek Borys. Paracompact and metrizable spaces. Formalized Mathematics, 2(4):481– 485, 1991.

[4] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[5] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[6] Czesław Byliński. The modification of a function by a function and the iteration of the composition of a function. Formalized Mathematics, 1(3):521–527, 1990.

[7] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

[8] Agata Darmochwał and Yatsuka Nakamura. Metric spaces as topological spaces - fundamental concepts. Formalized Mathematics, 2(4):605–608, 1991.

[9] Ryszard Engelking. General Topology, volume 60 of Monografie Matematyczne. PWN - Polish Scientific Publishers, Warsaw, 1977.

[10] Krzysztof Hryniewiecki. Basic properties of real numbers. Formalized Mathematics, 1(1):35–40, 1990.

[11] Stanisława Kanas, Adam Lecko, and Mariusz Startek. Metric spaces. Formalized Mathematics, 1(3):607–610, 1990.

[12] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[13] Jan Popiołek. Real normed space. Formalized Mathematics, 2(1):111–115, 1991.

[14] Konrad Raczkowski and Paweł Sadowski. Topological properties of subsets in real numbers. Formalized Mathematics, 1(4):777–780, 1990.

[15] Andrzej Trybulec. Binary operations applied to functions. Formalized Mathematics, 1(2):329–334, 1990.

[16] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[17] Andrzej Trybulec. Baire spaces, Sober spaces. Formalized Mathematics, 6(2):289–294, 1997.

[18] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

84 bartłomiej skorulski

[19] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[20] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

[21] Edmund Woronowicz. Relations defined on sets. Formalized Mathematics, 1(1):181–186, 1990.

Received May 13, 1998

On the Composition of Non-parahalting Macro Instructions

Piotr Rudnicki^{1} University of Alberta Edmonton

Summary. An attempt to use the Times macro, [2], was the origin of writing this article. First, the semantics of the macro composition as developed in [23, 3, 4] is extended to the case of macro instructions which are not always halting. Next, several functors extending the memory handling for SCM _{FSA} , [18], are defined; they are convenient when writing more complicated programs. After this preparatory work, we define a macro instruction computing the Fibonacci sequence (see the SCM program computing the same sequence in [10]) and prove its correctness. The semantics of the Times macro is given in [2] only for the case when the iterated instruction is parahalting; this is remedied in [17].

MML Identifier: SFMASTR1.

The notation and terminology used in this paper are introduced in the following papers: [16], [21], [19], [27], [5], [7], [15], [12], [14], [13], [11], [25], [6], [9], [28], [23], [3], [4], [1], [24], [22], [8], [18], [26], and [20].

1. Good Instructions and Good Macro Instruction

Let i be an instruction of SCM _{FSA}. We say that i is good if and only if: (Def. 1) Macro(i) is good.

Let a be a read-write integer location and let b be an integer location. One can check the following observations:

∗ a:=b is good,

1This work was partially supported by NSERC Grant OGP9207 and NATO CRG 951368.

∗ AddTo(a, b) is good,

∗ SubFrom(a, b) is good, and

∗ MultBy(a, b) is good. Let us note that there exists an instruction of SCM _{FSA} which is good and

parahalting.

Let a, b be read-write integer locations. Observe that Divide(a, b) is good. Let l be an instruction-location of SCM _{FSA}. One can verify that goto l is

good.

Let a be an integer location and let l be an instruction-location of SCM _{FSA}. Note that if a = 0 goto l is good and if a > 0 goto l is good.

Let a be an integer location, let f be a finite sequence location, and let b be a read-write integer location. One can check that b:=f_{a} is good.

Let f be a finite sequence location and let b be a read-write integer location. One can verify that b:=lenf is good.

Let f be a finite sequence location and let a be an integer location. One can check that f:=⟨\underbrace{0, …, 0}_{a}⟩ is good. Let b be an integer location. Note that f_{a}:=b

is good.

Let us note that there exists an instruction of SCM _{FSA} which is good. Let i be a good instruction of SCM _{FSA}. Note that Macro(i) is good. Let i, j be good instructions of SCM _{FSA}. Note that i;j is good. Let i be a good instruction of SCM _{FSA} and let I be a good macro instruc-

tion. Note that i;I is good and I;i is good.

Let a, b be read-write integer locations. Note that swap(a, b) is good. Let I be a good macro instruction and let a be a read-write integer location.

One can verify that Times(a, I) is good.

One can prove the following proposition

(1) For every integer location a and for every macro instruction I such that a ∉ UsedIntLoc(I) holds I does not destroy a.

2. Composition of Non-parahalting Macro Instructions

For simplicity, we use the following convention: s, S denote states of SCM _{FSA}, I, J denote macro instructions, I_{1} denotes a good macro instruction, i denotes a good parahalting instruction of SCM _{FSA}, j denotes a parahalting instruction of SCM _{FSA}, a, b denote integer locations, and f denotes a finite sequence location.

We now state a number of propositions:

(2) (I+·Start-At(insloc(0)))↾D = ∅, where D = Int-Locations∪ FinSeq-Locations.

(3) If I is halting on Initialize(S) and closed on Initialize(S) and J is closed on IExec(I, S), then I;J is closed on Initialize(S).

(4) If I is halting on Initialize(S) and J is halting on IExec(I, S) and I is closed on Initialize(S) and J is closed on IExec(I, S), then I;J is halting on Initialize(S).

(5) Suppose I is closed on s and I+·Start-At(insloc(0)) ⊆ s and s is halting. Let m be a natural number. Suppose m LifeSpan(s). Then (Computation(s))(m) and (Computation(s+·(I;J)))(m) are equal outside the instruction locations of SCM _{FSA}.

(6) Suppose I_{1} is halting on Initialize(s) and J is halting on IExec(I_{1}, s) and I_{1} is closed on Initialize(s) and J is closed on IExec(I_{1}, s). Then LifeSpan(s+·Initialized(I_{1};J)) = LifeSpan(s+·Initialized(I_{1})) + 1 + LifeSpan(Result(s+·Initialized(I_{1}))+·Initialized(J)).

(7) Suppose I_{1} is halting on Initialize(s) and J is halting on IExec(I_{1}, s) and I_{1} is closed on Initialize(s) and J is closed on IExec(I_{1}, s). Then IExec(I_{1};J, s) = IExec(J, IExec(I_{1}, s))+·Start-At(IC_{IExec(J,IExec(I_{1},s))} + cardI_{1}).

(8) Suppose that

(i) I_{1} is parahalting, or halting on Initialize(s), or closed on Initialize(s), and

(ii) J is parahalting, or halting on IExec(I_{1}, s), or closed on IExec(I_{1}, s).

Then (IExec(I_{1};J, s))(a) = (IExec(J, IExec(I_{1}, s)))(a).

(9) Suppose that

(i) I_{1} is parahalting, or halting on Initialize(s), or closed on Initialize(s), and

(ii) J is parahalting, or halting on IExec(I_{1}, s), or closed on IExec(I_{1}, s).

Then (IExec(I_{1};J, s))(f) = (IExec(J, IExec(I_{1}, s)))(f).

(10) Suppose that

(i) I_{1} is parahalting, or halting on Initialize(s), or closed on Initialize(s), and

(ii) J is parahalting, or halting on IExec(I_{1}, s), or closed on IExec(I_{1}, s). Then IExec(I_{1};J, s)↾D = IExec(J, IExec(I_{1}, s))↾D, where D = Int-Locations∪ FinSeq-Locations.

(11) If I_{1} is parahalting, or closed on Initialize(s), or halting on Initialize(s), then Initialize(IExec(I_{1}, s))↾D = IExec(I_{1}, s)↾D, where D = Int-Locations∪ FinSeq-Locations.

(12) If I_{1} is parahalting, or halting on Initialize(s), or closed on Initialize(s), then (IExec(I_{1};j, s))(a) = (Exec(j, IExec(I_{1}, s)))(a).

(13) If I_{1} is parahalting, or halting on Initialize(s), or closed on Initialize(s), then (IExec(I_{1};j, s))(f) = (Exec(j, IExec(I_{1}, s)))(f).

(14) If I_{1} is parahalting, or halting on Initialize(s), or closed on Initialize(s), then IExec(I_{1};j, s)↾D = Exec(j, IExec(I_{1}, s))↾D, where D = Int-Locations∪ FinSeq-Locations.

(15) If J is parahalting, or halting on Exec(i, Initialize(s)), or closed on Exec(i, Initialize(s)), then (IExec(i;J, s))(a) = (IExec(J, Exec(i, Initialize(s))))(a).

(16) If J is parahalting, or halting on Exec(i, Initialize(s)), or closed on Exec(i, Initialize(s)), then (IExec(i;J, s))(f) = (IExec(J, Exec(i, Initialize(s))))(f).

(17) If J is parahalting, or halting on Exec(i, Initialize(s)), or closed on Exec(i, Initialize(s)), then IExec(i;J, s)↾D = IExec(J, Exec(i, Initialize(s))) ↾D, where D = Int-Locations∪ FinSeq-Locations.

3. Memory Allocation

In the sequel L is a finite subset of Int-Locations and m, n are natural numbers.

Let d be an integer location. Then {d} is a subset of Int-Locations. Let e be an integer location. Then {d, e} is a subset of Int-Locations. Let f be an integer location. Then {d, e, f} is a subset of Int-Locations. Let g be an integer location. Then {d, e, f, g} is a subset of Int-Locations.

Let L be a finite subset of Int-Locations. The functor RWNotIn-seqL yields a function from ℕ into 2^{ℕ} and is defined by the conditions (Def. 2).

(Def. 2)(i) (RWNotIn-seqL)(0) = {k; k ranges over natural numbers: intloc(k) ∉

L ∧ k ≠ 0}, (ii) for every natural number i and for every non empty subset s_{1} of ℕ

such that (RWNotIn-seqL)(i) = s_{1} holds (RWNotIn-seqL)(i + 1) = s_{1} \ {mins_{1}}, and

(iii) for every natural number i holds (RWNotIn-seqL)(i) is infinite. Let L be a finite subset of Int-Locations and let n be a natural number. Note

that (RWNotIn-seqL)(n) is non empty.

One can prove the following propositions:

(18) 0 ∉ (RWNotIn-seqL)(n) and for every m such that m ∈ (RWNotIn-seqL)(n) holds intloc(m) ∉ L.

(19) min(RWNotIn-seqL)(n) < min(RWNotIn-seqL)(n + 1).

(20) If n < m, then min(RWNotIn-seqL)(n) < min(RWNotIn-seqL)(m). Let n be a natural number and let L be a finite subset of Int-Locations. The

functor n^{th}-RWNotIn(L) yields an integer location and is defined as follows: (Def. 3) n^{th}-RWNotIn(L) = intloc(min(RWNotIn-seqL)(n)).

We introduce 1^{st} -RWNotIn(L), 2^{nd}-RWNotIn(L), 3^{rd} -RWNotIn(L) as synonyms of n^{th}-RWNotIn(L).

Let n be a natural number and let L be a finite subset of Int-Locations. One can verify that n^{th}-RWNotIn(L) is read-write.

We now state two propositions:

(21) n^{th}-RWNotIn(L) ∉ L.

(22) If n ≠ m, then n^{th}-RWNotIn(L) ≠ m^{th}-RWNotIn(L).

Let n be a natural number and let p be a programmed finite partial state of SCM _{FSA}. The functor n^{th}-NotUsed(p) yielding an integer location is defined by:

(Def. 4) n^{th}-NotUsed(p) = n^{th}-RWNotIn(UsedIntLoc(p)). We introduce 1^{st}-NotUsed(p), 2^{nd}-NotUsed(p), 3^{rd}-NotUsed(p) as synonyms of n^{th}-NotUsed(p).

Let n be a natural number and let p be a programmed finite partial state of SCM _{FSA}. Observe that n^{th}-NotUsed(p) is read-write.

4. A Macro for the Fibonacci Sequence

One can prove the following proposition

(23) a ∈ UsedIntLoc(swap(a, b)) and b ∈ UsedIntLoc(swap(a, b)).

Let N, r_{1} be integer locations. The functor Fib macro(N, r_{1}) yielding a macro instruction is defined by:

(Def. 5) Fib macro(N, r_{1}) = (N_{1}:=N); SubFrom(r_{1}, r_{1}); (n_{1}:= intloc(0)); (a_{1}:=N_{1}); Times(a_{1}, AddTo(r_{1}, n_{1}); swap(r_{1}, n_{1})); (N:=N_{1}), where N_{1} = 2^{nd}-RWNotIn(UsedIntLoc(swap(r_{1}, n_{1}))), n_{1} = 1^{st} -RWNotIn ({N, r_{1}}), and a_{1} = 1^{st} -RWNotIn(UsedIntLoc(swap(r_{1}, n_{1}))).

Next we state the proposition

(24) Let N, r_{1} be read-write integer locations. Suppose N ≠ r_{1}. Let n be a natural number. If n = s(N), then (IExec(Fib macro(N, r_{1}), s))(r_{1}) = Fib(n) and (IExec(Fib macro(N, r_{1}), s))(N) = s(N).

90 piotr rudnicki

References

[1] Noriko Asamoto. Constant assignment macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):59–63, 1997.

[2] Noriko Asamoto. The loop and Times macroinstruction for SCM _{FSA} . Formalized Mathematics, 6(4):483–497, 1997.

[3] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part II. Formalized Mathematics, 6(1):41–47, 1997.

[4] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part III. Formalized Mathematics, 6(1):53–57, 1997.

[5] Grzegorz Bancerek. Cardinal numbers. Formalized Mathematics, 1(2):377–382, 1990.

[6] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[7] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[8] Grzegorz Bancerek and Piotr Rudnicki. Development of terminology for scm. Formalized Mathematics, 4(1):61–67, 1993.

[9] Grzegorz Bancerek and Piotr Rudnicki. Two programs for scm. Part I - preliminaries. Formalized Mathematics, 4(1):69–72, 1993.

[10] Grzegorz Bancerek and Piotr Rudnicki. Two programs for scm. Part II - programs. Formalized Mathematics, 4(1):73–75, 1993.

[11] Grzegorz Bancerek and Andrzej Trybulec. Miscellaneous facts about functions. Formalized Mathematics, 5(4):485–492, 1996.

[12] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[13] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[14] Agata Darmochwał. Finite sets. Formalized Mathematics, 1(1):165–167, 1990.

[15] Agata Darmochwał and Andrzej Trybulec. Similarity of formulae. Formalized Mathematics, 2(5):635–642, 1991.

[16] Yatsuka Nakamura and Andrzej Trybulec. A mathematical model of CPU. Formalized Mathematics, 3(2):151–160, 1992.

[17] Piotr Rudnicki. Another times macro instruction. Formalized Mathematics, 7(1):101–105, 1998.

[18] Piotr Rudnicki and Andrzej Trybulec. Memory handling for SCM _{FSA} . Formalized Mathematics, 6(1):29–36, 1997.

[19] Yasushi Tanaka. On the decomposition of the states of SCM. Formalized Mathematics, 5(1):1–8, 1996.

[20] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[21] Andrzej Trybulec and Yatsuka Nakamura. Some remarks on the simple concrete model of computer. Formalized Mathematics, 4(1):51–56, 1993.

[22] Andrzej Trybulec and Yatsuka Nakamura. Modifying addresses of instructions of SCM _{FSA} . Formalized Mathematics, 5(4):571–576, 1996.

[23] Andrzej Trybulec, Yatsuka Nakamura, and Noriko Asamoto. On the compositions of macro instructions. Part I. Formalized Mathematics, 6(1):21–27, 1997.

[24] Andrzej Trybulec, Yatsuka Nakamura, and Piotr Rudnicki. The SCM _{FSA} computer. Formalized Mathematics, 5(4):519–528, 1996.

[25] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[26] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[27] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[28] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

The while Macro Instructions of SCM _{FSA}. Part II

Piotr Rudnicki^{1} University of Alberta Edmonton

Summary. An attempt to use the while macro, [14], was the origin of writing this article. The while semantics, as given by J.-C. Chen, is slightly extended by weakening its correctness conditions and this forced a quite straightforward remake of a number of theorems from [14]. Numerous additional properties of the while macro are then proven. In the last section, we define a macro instruction computing the fusc function (see the SCM program computing the same function in [10]) and prove its correctness.

MML Identifier: SCMFSA9A.

The papers [17], [15], [21], [19], [26], [7], [11], [12], [13], [24], [6], [29], [9], [27], [28], [4], [5], [3], [1], [2], [23], [22], [14], [8], [16], [18], [25], and [20] provide the notation and terminology for this paper.

1. Arithmetic Preliminaries

We follow the rules: k, m, n are natural numbers, i, j are integers, and r is a real number.

The scheme MinPred deals with a unary functor F yielding a natural number and a unary predicate P, and states that:

There exists k such that P[k] and for every n such that P[n] holds k n

provided the parameters meet the following condition:

1This work was partially supported by NSERC Grant OGP9207 and NATO CRG 951368.

• For every k holds F(k + 1) < F(k) or P[k]. We now state several propositions:

(1) n is odd iff there exists a natural number k such that n = 2 · k + 1.

(2) If 0 r, then 0 ⌊r⌋.

(3) If 0 < n, then 0 (m qua integer) ÷n.

(4) If 0 < i and 1 < j, then i ÷ j < i.

(5) If 0 < n, then (m qua integer) ÷n = m÷n and (m qua integer) modn = m mod n.

2. SCM _{FSA} Preliminaries

In the sequel l is an instruction-location of SCM _{FSA} and i is an instruction of SCM _{FSA}.

Next we state several propositions:

(6) Let N be a non empty set with non empty elements, S be a halting von Neumann definite AMI over N, s be a state of S, and k be a natural number. If CurInstr((Computation(s))(k)) = halt_{S}, then (Computation(s))(LifeSpan(s)) = (Computation(s))(k).

(7) UsedIntLoc(l⟼→ . i) = UsedIntLoc(i).

(8) UsedInt^{∗} Loc(l⟼→ . i) = UsedInt^{∗} Loc(i).

(9) UsedIntLoc(Stop_{SCM_{FSA}} ) = ∅.

(10) UsedInt^{∗} Loc(Stop_{SCM_{FSA}} ) = ∅.

(11) UsedIntLoc(Goto(l)) = ∅.

(12) UsedInt^{∗} Loc(Goto(l)) = ∅.

For simplicity, we use the following convention: s, s_{1}, s_{2} are states of SCM _{FSA}, a is a read-write integer location, b is an integer location, f is a finite sequence location, I, J are macro instructions, I_{1} is a good macro instruction, and i, j, k are natural numbers.

The following four propositions are true:

(13) UsedIntLoc(if b = 0 then I else J) = {b} ∪ UsedIntLoc(I) ∪ UsedIntLoc(J).

(14) For every integer location a holds UsedInt^{∗} Loc(if a = 0 then I else J) = UsedInt^{∗} Loc(I) ∪ UsedInt^{∗} Loc(J).

(15) UsedIntLoc(if b > 0 then I else J) = {b} ∪ UsedIntLoc(I) ∪ UsedIntLoc(J).

(16) UsedInt^{∗} Loc(if b > 0 then I else J) = UsedInt^{∗} Loc(I)∪UsedInt^{∗} Loc(J).

3. The while=0 Macro Instruction

Next we state two propositions:

(17) UsedIntLoc(while b = 0 do I) = {b} ∪ UsedIntLoc(I).

(18) UsedInt^{∗} Loc(while b = 0 do I) = UsedInt^{∗} Loc(I).

Let s be a state of SCM _{FSA}, let a be a read-write integer location, and let I be a macro instruction. The predicate ProperBodyWhile=0(a, I, s) is defined as follows:

(Def. 1) For every natural number k such that (StepWhile=0(a, I, s))(k)(a) = 0 holds I is closed on (StepWhile=0(a, I, s))(k) and halting on (StepWhile=0(a, I, s))(k).

The predicate WithVariantWhile=0(a, I, s) is defined by the condition (Def. 2). (Def. 2) There exists a function f from ∏ (the object kind of SCM _{FSA}) into ℕ

such that for every natural number k holds f((StepWhile=0(a, I, s))(k + 1)) < f((StepWhile=0(a, I, s))(k)) or (StepWhile=0(a, I, s))(k)(a) ≠ 0.

We now state several propositions:

(19) For every parahalting macro instruction I holds ProperBodyWhile=0(a, I, s).

(20) If ProperBodyWhile=0(a, I, s) and WithVariantWhile=0(a, I, s), then while a = 0 do I is halting on s and while a = 0 do I is closed on s.

(21) For every parahalting macro instruction I such that WithVariantWhile=0(a, I, s) holds while a = 0 do I is halting on s and while a = 0 do I is closed on s.

(22) If (while a = 0 do I)+·S_{1} ⊆ s and s(a) ≠ 0, then LifeSpan(s) = 4 and for every natural number k holds (Computation(s))(k)↾D = s↾D, where S_{1} = Start-At(insloc(0)) and D = Int-Locations∪ FinSeq-Locations.

(23) If I is closed on s and halting on s and s(a) = 0, then (Computation(s+·((while a = 0 do I)+·S_{1})))(LifeSpan(s+·(I+·S_{1})) + 3)↾D = (Computation(s+·(I+·S_{1})))(LifeSpan(s+·(I+·S_{1})))↾D, where S_{1} = Start-At(insloc(0)) and D = Int-Locations∪ FinSeq-Locations.

(24) If (StepWhile=0(a, I, s))(k)(a) ≠ 0, then (StepWhile=0(a, I, s))(k + 1)↾D = (StepWhile=0(a, I, s))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

(25) Suppose I is halting on Initialize((StepWhile=0(a, I, s))(k)), closed on Initialize((StepWhile=0(a, I, s))(k)), and parahalting and (StepWhile=0(a, I, s))(k)(a) = 0 and (StepWhile=0(a, I, s))(k)(intloc(0)) = 1. Then (StepWhile=0(a, I, s))(k+1)↾D = IExec(I, (StepWhile=0(a, I, s)) (k))↾D, where D = Int-Locations∪ FinSeq-Locations.

(26) If ProperBodyWhile=0(a, I_{1}, s) or I_{1} is parahalting and if s(intloc(0)) = 1, then for every k holds (StepWhile=0(a, I_{1}, s))(k)(intloc(0)) = 1.

(27) If ProperBodyWhile=0(a, I, s_{1}) and s_{1}↾D = s_{2}↾D, then for every k holds (StepWhile=0(a, I, s_{1}))(k)↾D = (StepWhile=0(a, I, s_{2}))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

Let s be a state of SCM _{FSA}, let a be a read-write integer location, and let I be a macro instruction. Let us assume that ProperBodyWhile=0(a, I, s) or I is parahalting and WithVariantWhile=0(a, I, s). The functor ExitsAtWhile=0(a, I, s) yielding a natural number is defined by the condition (Def. 3).

(Def. 3) There exists a natural number k such that (i) ExitsAtWhile=0(a, I, s) = k, (ii) (StepWhile=0(a, I, s))(k)(a) ≠ 0, (iii) for every natural number i such that (StepWhile=0(a, I, s))(i)(a) ≠ 0

holds k i, and (iv) (Computation(s+·((while a = 0 do I)+·S_{1})))(LifeSpan(s+·((while a =

0 do I)+·S_{1})))↾D = (StepWhile=0(a, I, s))(k)↾D, where S_{1} = Start-At(insloc(0)) and D = Int-Locations∪ FinSeq-Locations.

One can prove the following two propositions:

(28) If s(intloc(0)) = 1 and s(a) ≠ 0, then IExec(while a = 0 do I, s)↾D = s↾D, where D = Int-Locations∪ FinSeq-Locations.

(29) If ProperBodyWhile=0(a, I, Initialize(s)) or I is parahalting and if WithVariantWhile=0(a, I, Initialize(s)), then IExec(while a = 0 do I, s)↾D = (StepWhile=0(a, I, Initialize(s)))(ExitsAtWhile=0(a, I, Initialize(s)))↾D, where D = Int-Locations∪ FinSeq-Locations.

4. The while¿0 Macro Instruction

The following propositions are true:

(30) UsedIntLoc(while b > 0 do I) = {b} ∪ UsedIntLoc(I).

(31) UsedInt^{∗} Loc(while b > 0 do I) = UsedInt^{∗} Loc(I).

Let s be a state of SCM _{FSA}, let a be a read-write integer location, and let I be a macro instruction. The predicate ProperBodyWhile>0(a, I, s) is defined as follows:

(Def. 4) For every natural number k such that (StepWhile>0(a, I, s))(k)(a) > 0 holds I is closed on (StepWhile>0(a, I, s))(k) and halting on (StepWhile>0(a, I, s))(k).

The predicate WithVariantWhile>0(a, I, s) is defined by the condition (Def. 5).

(Def. 5) There exists a function f from ∏ (the object kind of SCM _{FSA}) into ℕ such that for every natural number k holds f((StepWhile>0(a, I, s))(k + 1)) < f((StepWhile>0(a, I, s))(k)) or (StepWhile>0(a, I, s))(k)(a) 0.

Next we state several propositions:

(32) For every parahalting macro instruction I holds ProperBodyWhile>0(a, I, s).

(33) If ProperBodyWhile>0(a, I, s) and WithVariantWhile>0(a, I, s), then while a > 0 do I is halting on s and while a > 0 do I is closed on s.

(34) For every parahalting macro instruction I such that WithVariantWhile>0(a, I, s) holds while a > 0 do I is halting on s and while a > 0 do I is closed on s.

(35) If (while a > 0 do I)+·S_{1} ⊆ s and s(a) 0, then LifeSpan(s) = 4 and for every natural number k holds (Computation(s))(k)↾D = s↾D, where S_{1} = Start-At(insloc(0)) and D = Int-Locations∪ FinSeq-Locations.

(36) If I is closed on s and halting on s and s(a) > 0, then (Computation(s+·((while a > 0 do I)+·S_{1})))(LifeSpan(s+·(I+·S_{1})) + 3)↾D = (Computation(s+·(I+·S_{1})))(LifeSpan(s+·(I+·S_{1})))↾D, where S_{1} = Start-At(insloc(0)) and D = Int-Locations∪ FinSeq-Locations.

(37) If (StepWhile>0(a, I, s))(k)(a) 0, then (StepWhile>0(a, I, s))(k + 1)↾D = (StepWhile>0(a, I, s))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

(38) Suppose I is halting on Initialize((StepWhile>0(a, I, s))(k)), closed on Initialize((StepWhile>0(a, I, s))(k)), and parahalting and (StepWhile>0 (a, I, s))(k)(a) > 0 and (StepWhile>0(a, I, s))(k)(intloc(0)) = 1. Then (StepWhile>0(a, I, s))(k + 1)↾D = IExec(I, (StepWhile>0(a, I, s)) (k))↾D, where D = Int-Locations∪ FinSeq-Locations.

(39) If ProperBodyWhile>0(a, I_{1}, s) or I_{1} is parahalting and if s(intloc(0)) = 1, then for every k holds (StepWhile>0(a, I_{1}, s))(k)(intloc(0)) = 1.

(40) If ProperBodyWhile>0(a, I, s_{1}) and s_{1}↾D = s_{2}↾D, then for every k holds (StepWhile>0(a, I, s_{1}))(k)↾D = (StepWhile>0(a, I, s_{2}))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

Let s be a state of SCM _{FSA}, let a be a read-write integer location, and let I be a macro instruction. Let us assume that ProperBodyWhile>0(a, I, s) or I is parahalting and WithVariantWhile>0(a, I, s).

The functor ExitsAtWhile>0(a, I, s) yields a natural number and is defined by the condition (Def. 6).

(Def. 6) There exists a natural number k such that (i) ExitsAtWhile>0(a, I, s) = k, (ii) (StepWhile>0(a, I, s))(k)(a) 0, (iii) for every natural number i such that (StepWhile>0(a, I, s))(i)(a) 0

holds k i, and (iv) (Computation(s+·((while a > 0 do I)+·S_{1})))(LifeSpan(s+·((while a >

0 do I)+·S_{1})))↾D = (StepWhile>0(a, I, s))(k)↾D, where S_{1} = Start-At(insloc(0)) and D = Int-Locations∪ FinSeq-Locations.

Next we state several propositions:

(41) If s(intloc(0)) = 1 and s(a) 0, then IExec(while a > 0 do I, s)↾D = s↾D, where D = Int-Locations∪ FinSeq-Locations.

(42) If ProperBodyWhile>0(a, I, Initialize(s)) or I is parahalting and if WithVariantWhile>0(a, I, Initialize(s)), then IExec(while a > 0 do I, s)↾D = (StepWhile>0(a, I, Initialize(s)))(ExitsAtWhile>0(a, I, Initialize(s)))↾D, where D = Int-Locations∪ FinSeq-Locations.

(43) If (StepWhile>0(a, I, s))(k)(a) 0, then for every natural number n such that k n holds (StepWhile>0(a, I, s))(n)↾D = (StepWhile>0(a, I, s))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

(44) If s_{1}↾D = s_{2}↾D and ProperBodyWhile>0(a, I, s_{1}), then ProperBodyWhile>0(a, I, s_{2}), where D = Int-Locations∪ FinSeq-Locations.

(45) Suppose s(intloc(0)) = 1 and ProperBodyWhile>0(a, I_{1}, s) and WithVariantWhile>0(a, I_{1}, s). Let given i, j. Suppose i ≠ j and i ExitsAtWhile>0(a, I_{1}, s) and j ExitsAtWhile>0(a, I_{1}, s). Then (StepWhile>0(a, I_{1}, s))(i) ≠ (StepWhile>0(a, I_{1}, s))(j) and (StepWhile>0(a, I_{1}, s))(i)↾D ≠ (StepWhile>0(a, I_{1}, s))(j)↾D, where D = Int-Locations∪ FinSeq-Locations.

Let f be a function from ∏ (the object kind of SCM _{FSA}) into ℕ. We say that f is on data only if and only if:

(Def. 7) For all s_{1}, s_{2} such that s_{1}↾D = s_{2}↾D holds f(s_{1}) = f(s_{2}), where D = Int-Locations∪ FinSeq-Locations.

We now state two propositions:

(46) Suppose s(intloc(0)) = 1 and ProperBodyWhile>0(a, I_{1}, s) and WithVariantWhile>0(a, I_{1}, s). Then there exists a function f from ∏ (the object kind of SCM _{FSA}) into ℕ such that f is on data only and for every natural number k holds f((StepWhile>0(a, I_{1}, s))(k + 1)) < f((StepWhile>0(a, I_{1}, s))(k)) or (StepWhile>0(a, I_{1}, s))(k)(a) 0.

(47) If s_{1}(intloc(0)) = 1 and s_{1}↾D = s_{2}↾D and ProperBodyWhile>0(a, I_{1}, s_{1}) and WithVariantWhile>0(a, I_{1}, s_{1}), then WithVariantWhile>0(a, I_{1}, s_{2}), where D = Int-Locations∪ FinSeq-Locations. the while macro instructions of … 97

5. A Macro for the fusc Function

Let N, r_{1} be integer locations. The functor Fusc macro(N, r_{1}) yields a macro instruction and is defined as follows:

(Def. 8) Fusc macro(N, r_{1}) = SubFrom(r_{1}, r_{1}); (n_{1}:= intloc(0)); (a_{1}:=N); (while a_{1} > 0 do ((r_{2}:=2); Divide(a_{1}, r_{2}); (if r_{2} = 0 then Macro(AddTo(n_{1}, r_{1})) else Macro(AddTo(r_{1}, n_{1}))))), where n_{1} = 1^{st} -RWNotIn({N, r_{1}}), a_{1} = 2^{nd}-RWNotIn({N, r_{1}}), and r_{2} = 3^{rd} -RWNotIn({N, r_{1}}).

One can prove the following proposition

(48) Let N, r_{1} be read-write integer locations. Suppose N ≠ r_{1}. Let n be a natural number. If n = s(N), then (IExec(Fusc macro(N, r_{1}), s))(r_{1}) = Fusc(n) and (IExec(Fusc macro(N, r_{1}), s))(N) = n.

References

[1] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part I. Formalized Mathematics, 6(1):65–72, 1997.

[2] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):73–80, 1997.

[3] Noriko Asamoto. Constant assignment macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):59–63, 1997.

[4] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part II. Formalized Mathematics, 6(1):41–47, 1997.

[5] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part III. Formalized Mathematics, 6(1):53–57, 1997.

[6] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[7] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[8] Grzegorz Bancerek and Piotr Rudnicki. Development of terminology for scm. Formalized Mathematics, 4(1):61–67, 1993.

[9] Grzegorz Bancerek and Piotr Rudnicki. Two programs for scm. Part I - preliminaries. Formalized Mathematics, 4(1):69–72, 1993.

[10] Grzegorz Bancerek and Piotr Rudnicki. Two programs for scm. Part II - programs. Formalized Mathematics, 4(1):73–75, 1993.

[11] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[12] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[13] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, [14] Jing-Chao Chen. While macro instructions of SCM _{FSA} . Formalized Mathematics,

6(4):553–561, 1997.

[15] Yatsuka Nakamura and Andrzej Trybulec. A mathematical model of CPU. Formalized Mathematics, 3(2):151–160, 1992.

[16] Piotr Rudnicki. On the composition of non-parahalting macro instructions. Formalized Mathematics, 7(1):87–92, 1998.

[17] Piotr Rudnicki and Andrzej Trybulec. Abian’s fixed point theorem. Formalized Mathematics, 6(3):335–338, 1997.

[18] Piotr Rudnicki and Andrzej Trybulec. Memory handling for SCM _{FSA} . Formalized Mathematics, 6(1):29–36, 1997.

[19] Yasushi Tanaka. On the decomposition of the states of SCM. Formalized Mathematics, 5(1):1–8, 1996.

[20] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[21] Andrzej Trybulec and Yatsuka Nakamura. Some remarks on the simple concrete model of computer. Formalized Mathematics, 4(1):51–56, 1993.

[22] Andrzej Trybulec and Yatsuka Nakamura. Modifying addresses of instructions of SCM _{FSA} . Formalized Mathematics, 5(4):571–576, 1996.

[23] Andrzej Trybulec, Yatsuka Nakamura, and Piotr Rudnicki. The SCM _{FSA} computer. Formalized Mathematics, 5(4):519–528, 1996.

[24] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[25] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[26] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[27] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

[28] Edmund Woronowicz. Relations defined on sets. Formalized Mathematics, 1(1):181–186, 1990.

[29] Wojciech Zielonka. Preliminaries to the Lambek calculus. Formalized Mathematics, 2(3):413–418, 1991.

Another times Macro Instruction

Piotr Rudnicki^{1} University of Alberta Edmonton

Summary. The semantics of the times macro is given in [2] only for the case when the body of the macro is parahalting. We remedy this by defining a new times macro instruction in terms of while (see [9, 13]). The semantics of the new times macro is given in a way analogous to the semantics of while macros. The new times uses an anonymous variable to control the number of its executions. We present two examples: a trivial one and a remake of the macro for the Fibonacci sequence (see [12]).

MML Identifier: SFMASTR2.

The terminology and notation used in this paper are introduced in the following articles: [11], [16], [21], [6], [8], [19], [5], [7], [10], [22], [3], [4], [1], [18], [17], [12], [14], [20], and [15].

1. SCM _{FSA} Preliminaries

For simplicity, we follow the rules: s, s_{1}, s_{2} denote states of SCM _{FSA}, a, b denote integer locations, d denotes a read-write integer location, f denotes a finite sequence location, I denotes a macro instruction, J denotes a good macro instruction, and k denotes a natural number.

One can prove the following propositions:

(1) If I is closed on Initialize(s) and halting on Initialize(s) and b ∉ UsedIntLoc(I), then (IExec(I, s))(b) = (Initialize(s))(b).

(2) If I is closed on Initialize(s) and halting on Initialize(s) and f ∉ UsedInt^{∗} Loc(I), then (IExec(I, s))(f) = (Initialize(s))(f).

1This work was partially supported by NSERC Grant OGP9207 and NATO CRG 951368.

(3) Suppose I is closed on Initialize(s), halting on Initialize(s), and parahalting but s(intloc(0)) = 1 or a is read-write but a ∉ UsedIntLoc(I). Then (IExec(I, s))(a) = s(a).

(4) If s(intloc(0)) = 1, then I is closed on s iff I is closed on Initialize(s).

(5) If s(intloc(0)) = 1, then I is closed on s and halting on s iff I is closed on Initialize(s) and halting on Initialize(s).

(6) Let I_{1} be a subset of Int-Locations and F_{1} be a subset of FinSeq-Locations. Then s_{1}↾(I_{1} ∪ F_{1}) = s_{2}↾(I_{1} ∪ F_{1}) if and only if the following conditions are satisfied:

(i) for every integer location x such that x ∈ I_{1} holds s_{1}(x) = s_{2}(x), and (ii) for every finite sequence location x such that x ∈ F_{1} holds s_{1}(x) =

s_{2}(x).

(7) Let I_{1} be a subset of Int-Locations. Then s_{1}↾(I_{1} ∪ FinSeq-Locations) = s_{2}↾(I_{1} ∪ FinSeq-Locations) if and only if the following conditions are satisfied:

(i) for every integer location x such that x ∈ I_{1} holds s_{1}(x) = s_{2}(x), and (ii) for every finite sequence location x holds s_{1}(x) = s_{2}(x).

2. Another times Macro Instruction

Let a be an integer location and let I be a macro instruction. The functor times(a, I) yields a macro instruction and is defined by:

(Def. 1) times(a, I) = (a_{1}:=a);(while a_{1} > 0 do (I;SubFrom(a_{1}, intloc(0)))),

where a_{1} = 1^{st} -RWNotIn({a} ∪ UsedIntLoc(I)). We introduce a timesI as a synonym of times(a, I).

Next we state two propositions:

(8) {b} ∪ UsedIntLoc(I) ⊆ UsedIntLoc(times(b, I)).

(9) UsedInt^{∗} Loc(times(b, I)) = UsedInt^{∗} Loc(I). Let I be a good macro instruction and let a be an integer location. Observe

that times(a, I) is good.

Let s be a state of SCM _{FSA}, let I be a macro instruction, and let a be an integer location. The functor StepTimes(a, I, s) yields a function from ℕ into ∏ (the object kind of SCM _{FSA}) and is defined by:

(Def. 2) StepTimes(a, I, s) = StepWhile>0(a_{1}, I;SubFrom(a_{1}, intloc(0)), Exec(a_{1}:=a, Initialize(s))), where a_{1} = 1^{st} -RWNotIn({a} ∪ UsedIntLoc(I)).

Next we state several propositions:

(10) (StepTimes(a, J, s))(0)(intloc(0)) = 1.

(11) If s(intloc(0)) = 1 or a is read-write, then (StepTimes(a, J, s)) (0)(1^{st} -RWNotIn({a} ∪ UsedIntLoc(J))) = s(a).

(12) Suppose (StepTimes(a, J, s))(k)(intloc(0)) = 1 and J is closed on (StepTimes(a, J, s))(k) and halting on (StepTimes(a, J, s))(k). Then (StepTimes(a, J, s))(k + 1)(intloc(0)) = 1 and if (StepTimes(a, J, s))(k) (1^{st} -RWNotIn({a}∪UsedIntLoc(J))) > 0, then (StepTimes(a, J, s))(k+1) (1^{st} -RWNotIn({a} ∪ UsedIntLoc(J))) = (StepTimes(a, J, s))(k) (1^{st} -RWNotIn({a} ∪ UsedIntLoc(J))) − 1.

(13) If s(intloc(0)) = 1 or a is read-write, then (StepTimes(a, I, s))(0)(a) = s(a).

(14) (StepTimes(a, I, s))(0)(f) = s(f).

Let s be a state of SCM _{FSA}, let a be an integer location, and let I be a macro instruction. We say that ProperTimesBody a, I, s if and only if:

(Def. 3) For every natural number k such that k < s(a) holds I is closed on

(StepTimes(a, I, s))(k) and halting on (StepTimes(a, I, s))(k). One can prove the following propositions:

(15) If I is parahalting, then ProperTimesBody a, I, s.

(16) If ProperTimesBody a, J, s, then for every k such that k s(a) holds (StepTimes(a, J, s))(k)(intloc(0)) = 1.

(17) Suppose s(intloc(0)) = 1 or a is read-write but ProperTimesBody a, J, s. Let given k. If k s(a), then (StepTimes(a, J, s))(k)(1^{st} -RWNotIn({a} ∪ UsedIntLoc(J))) + k = s(a).

(18) Suppose ProperTimesBody a, J, s but 0 s(a) but s(intloc(0)) = 1 or a is read-write. Let given k. If k s(a), then (StepTimes(a, J, s))(k) (1^{st} -RWNotIn({a} ∪ UsedIntLoc(J))) = 0 and (StepTimes(a, J, s)) (k)(intloc(0)) = 1.

(19) If s(intloc(0)) = 1, then (StepTimes(a, I, s))(0)↾(UsedIntLoc(I) ∪ FinSeq-Locations) = s↾(UsedIntLoc(I) ∪ FinSeq-Locations).

(20) Suppose (StepTimes(a, J, s))(k)(intloc(0)) = 1 and J is halting on Initialize((StepTimes(a, J, s))(k)) and closed on Initialize((StepTimes(a, J, s)) (k)) and (StepTimes(a, J, s))(k)(1^{st} -RWNotIn({a}∪UsedIntLoc(J))) > 0. Then (StepTimes(a, J, s))(k + 1)↾(UsedIntLoc(J) ∪ FinSeq-Locations) = IExec(J, (StepTimes(a, J, s))(k))↾(UsedIntLoc(J) ∪ FinSeq-Locations).

(21) Suppose ProperTimesBody a, J, s or J is parahalting but k < s(a) but s(intloc(0)) = 1 or a is read-write. Then (StepTimes(a, J, s))(k + 1)↾(UsedIntLoc(J) ∪ FinSeq-Locations) = IExec(J, (StepTimes(a, J, s))(k))↾(UsedIntLoc(J) ∪ FinSeq-Locations).

(22) If s(a) 0 and s(intloc(0)) = 1, then IExec(times(a, I), s)↾(UsedIntLoc(I)∪ FinSeq-Locations) = s↾(UsedIntLoc(I) ∪ FinSeq-Locations).

(23) Suppose s(a) = k but ProperTimesBody a, J, s or J is parahalting but s(intloc(0)) = 1 or a is read-write. Then IExec(times(a, J), s)↾D = (StepTimes(a, J, s))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

(24) If s(intloc(0)) = 1 and if ProperTimesBody a, J, s or J is parahalting, then times(a, J) is closed on s and times(a, J) is halting on s.

3. A Trivial Example

Let d be a read-write integer location. The functor triv-times(d) yields a macro instruction and is defined as follows:

(Def. 4) triv-times(d) = times(d, (while d = 0 do Macro(d:=d)); SubFrom(d, intloc(0))).

One can prove the following propositions:

(25) If s(d) 0, then (IExec(triv-times(d), s))(d) = s(d).

(26) If 0 s(d), then (IExec(triv-times(d), s))(d) = 0.

4. A Macro for the Fibonacci Sequence

Let N, r_{1} be integer locations. The functor Fib-macro(N, r_{1}) yields a macro instruction and is defined by:

(Def. 5) Fib-macro(N, r_{1}) = (N_{1}:=N); SubFrom(r_{1}, r_{1}); (n_{1}:= intloc(0)); times(N, AddTo(r_{1}, n_{1}); swap(r_{1}, n_{1})); (N:=N_{1}), where N_{1} = 1^{st}-NotUsed(times(N, AddTo(r_{1}, n_{1}); swap(r_{1}, n_{1}))) and n_{1} = 1^{st} -RWNotIn({N, r_{1}}).

One can prove the following proposition

(27) Let N, r_{1} be read-write integer locations. Suppose N ≠ r_{1}. Let n be a natural number. If n = s(N), then (IExec(Fib-macro(N, r_{1}), s))(r_{1}) = Fib(n) and (IExec(Fib-macro(N, r_{1}), s))(N) = s(N). another times macro instruction 103

References

[1] Noriko Asamoto. Constant assignment macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):59–63, 1997.

[2] Noriko Asamoto. The loop and Times macroinstruction for SCM _{FSA} . Formalized Mathematics, 6(4):483–497, 1997.

[3] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part II. Formalized Mathematics, 6(1):41–47, 1997.

[4] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part III. Formalized Mathematics, 6(1):53–57, 1997.

[5] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[6] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[7] Grzegorz Bancerek and Piotr Rudnicki. Two programs for scm. Part I - preliminaries. Formalized Mathematics, 4(1):69–72, 1993.

[8] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[9] Jing-Chao Chen. While macro instructions of SCM _{FSA} . Formalized Mathematics, 6(4):553–561, 1997.

[10] Krzysztof Hryniewiecki. Basic properties of real numbers. Formalized Mathematics, 1(1):35–40, 1990.

[11] Yatsuka Nakamura and Andrzej Trybulec. A mathematical model of CPU. Formalized Mathematics, 3(2):151–160, 1992.

[12] Piotr Rudnicki. On the composition of non-parahalting macro instructions. Formalized Mathematics, 7(1):87–92, 1998.

[13] Piotr Rudnicki. The while macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 7(1):93–100, 1998.

[14] Piotr Rudnicki and Andrzej Trybulec. Memory handling for SCM _{FSA} . Formalized Mathematics, 6(1):29–36, 1997.

[15] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[16] Andrzej Trybulec and Yatsuka Nakamura. Some remarks on the simple concrete model of computer. Formalized Mathematics, 4(1):51–56, 1993.

[17] Andrzej Trybulec and Yatsuka Nakamura. Modifying addresses of instructions of SCM _{FSA} . Formalized Mathematics, 5(4):571–576, 1996.

[18] Andrzej Trybulec, Yatsuka Nakamura, and Piotr Rudnicki. The SCM _{FSA} computer. Formalized Mathematics, 5(4):519–528, 1996.

[19] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[20] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[21] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[22] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

104 piotr rudnicki

The for (going up) Macro Instruction

Piotr Rudnicki^{1} University of Alberta Edmonton

Summary. We define a for type (going up) macro instruction in terms of the while macro. This gives an iterative macro with an explicit control variable. The for macro is used to define a macro for the selection sort acting on a finite sequence location of SCM _{FSA} . On the way, a macro for finding a minimum in a section of an array is defined.

MML Identifier: SFMASTR3.

The terminology and notation used in this paper have been introduced in the following articles: [16], [21], [28], [6], [7], [9], [26], [10], [11], [8], [25], [15], [5], [13], [29], [30], [23], [3], [4], [2], [1], [24], [22], [12], [19], [17], [18], [27], [20], and [14].

1. General Preliminaries

The following propositions are true:

(1) Let X be a set, p be a permutation of X, and x, y be elements of X. Then p +·(x, p(y)) +·(y, p(x)) is a permutation of X.

(2) Let f be a function and x, y be sets. Suppose x ∈ domf and y ∈ domf. Then there exists a permutation p of domf such that f +·(x, f(y)) +· (y, f(x)) = f · p.

Let X be a finite non empty subset of ℝ. The functor minX yielding a real number is defined by:

1This work was partially supported by NSERC Grant OGP9207 and NATO CRG 951368.

(Def. 1) minX ∈ X and for every real number k such that k ∈ X holds minX

k. Let X be a finite non empty subset of ℤ. The functor minX yielding an

integer is defined by: (Def. 2) There exists a finite non empty subset Y of ℝ such that Y = X and

minX = minY. Let F be a finite sequence of elements of ℤ and let m, n be natural numbers.

Let us assume that 1 m and m n and n lenF. The functor min_{m}^{n} F yields a natural number and is defined as follows:

(Def. 3) There exists a finite non empty subset X of ℤ such that X = rng⟨F (m), …, F (n)⟩ and (min_{m}^{n} F) + 1 = (minX) ↫ ⟨F (m), …, F (n)⟩ + m.

We use the following convention: F, F_{1} denote finite sequences of elements of ℤ and k, m, n, m_{1} denote natural numbers.

The following propositions are true:

(3) Suppose 1 m and m n and n lenF. Then m_{1} = min_{m}^{n} F if and only if the following conditions are satisfied:

(i) m m_{1}, (ii) m_{1} n, (iii) for every natural number i such that m i and i n holds F (m_{1})

F (i), and (iv) for every natural number i such that m i and i < m_{1} holds F (m_{1}) <

F (i).

(4) If 1 m and m lenF, then min_{m}^{m} F = m. Let F be a finite sequence of elements of ℤ and let m, n be natural numbers.

We say that F is non decreasing on m, n if and only if: (Def. 4) For all natural numbers i, j such that m i and i j and j n holds

F (i) F (j). Let F be a finite sequence of elements of ℤ and let n be a natural number.

We say that F is split at n if and only if: (Def. 5) For all natural numbers i, j such that 1 i and i n and n < j and

j lenF holds F (i) F (j). We now state two propositions:

(5) Suppose k + 1 lenF and m_{1} = min_{(k+1)}^{(len F)} F and F is split at k and F is non decreasing on 1, k and F_{1} = F +·(k + 1, F (m_{1})) +·(m_{1}, F (k + 1)). Then F_{1} is non decreasing on 1, k + 1.

(6) If k + 1 lenF and m_{1} = min_{(k+1)}^{(len F)} F and F is split at k and F_{1} = F +·(k + 1, F (m_{1})) +·(m_{1}, F (k + 1)), then F_{1} is split at k + 1.

2. SCM _{FSA} Preliminaries

For simplicity, we use the following convention: s is a state of SCM _{FSA}, a, c are read-write integer locations, a_{1}, b_{1}, c_{1}, d_{1}, x are integer locations, f is a finite sequence location, I, J are macro instructions, I_{1} is a good macro instruction, and k is a natural number.

The following propositions are true:

(7) If I is closed on Initialize(s) and halting on Initialize(s) and I does not destroy a_{1}, then (IExec(I, s))(a_{1}) = (Initialize(s))(a_{1}).

(8) If s(intloc(0)) = 1, then IExec(Stop_{SCM_{FSA}} , s)↾D = s↾D, where D = Int-Locations∪ FinSeq-Locations.

(9) Stop_{SCM_{FSA}} does not refer a_{1}.

(10) If a_{1} ≠ b_{1}, then c_{1}:=b_{1} does not refer a_{1}.

(11) (Exec(a:=f_{b_{1}}, s))(a) = π_{|s(b_{1})|}s(f).

(12) (Exec(f_{a_{1}}:=b_{1}, s))(f) = s(f) +·(|s(a_{1})|, s(b_{1})).

Let a be a read-write integer location, let b be an integer location, and let I, J be good macro instructions. Observe that if a > b then I else J is good.

One can prove the following propositions:

(13) UsedIntLoc(if a_{1} > b_{1} then I else J) = {a_{1}, b_{1}} ∪ UsedIntLoc(I) ∪ UsedIntLoc(J).

(14) If I does not destroy a_{1}, then while b_{1} > 0 do I does not destroy a_{1}.

(15) If c_{1} ≠ a_{1} and I does not destroy c_{1} and J does not destroy c_{1}, then if a_{1} > b_{1} then I else J does not destroy c_{1}.

3. The for-up Macro Instruction

Let a, b, c be integer locations, let I be a macro instruction, and let s be a state of SCM _{FSA}. The functor StepForUp(a, b, c, I, s) yields a function from ℕ into ∏ (the object kind of SCM _{FSA}) and is defined by:

(Def. 6) StepForUp(a, b, c, I, s) = StepWhile>0 (a_{2}, I; AddTo(a, intloc(0)); SubFrom(a_{2}, intloc(0)), s +·(a_{2}, (s(c) − s(b)) + 1) +·(a, s(b))), where a_{2} = 1^{st} -RWNotIn({a, b, c} ∪ UsedIntLoc(I)).

Next we state several propositions:

(16) If s(intloc(0)) = 1, then (StepForUp(a, b_{1}, c_{1}, I, s))(0)(intloc(0)) = 1.

(17) (StepForUp(a, b_{1}, c_{1}, I, s))(0)(a) = s(b_{1}).

(18) If a ≠ b_{1}, then (StepForUp(a, b_{1}, c_{1}, I, s))(0)(b_{1}) = s(b_{1}).

(19) If a ≠ c_{1}, then (StepForUp(a, b_{1}, c_{1}, I, s))(0)(c_{1}) = s(c_{1}).

(20) If a ≠ d_{1} and d_{1} ∈ UsedIntLoc(I), then (StepForUp(a, b_{1}, c_{1}, I, s))(0)(d_{1}) = s(d_{1}).

(21) (StepForUp(a, b_{1}, c_{1}, I, s))(0)(f) = s(f).

(22) Suppose s(intloc(0)) = 1. Let a_{2} be a read-write integer location. If a_{2} = 1^{st} -RWNotIn({a, b_{1}, c_{1}} ∪ UsedIntLoc(I)), then IExec((a_{2}:=c_{1});SubFrom(a_{2}, b_{1});AddTo(a_{2}, intloc(0));(a:=b_{1}), s)↾D = (s+· (a_{2}, (s(c_{1})−s(b_{1}))+1)+·(a, s(b_{1})))↾D, where a_{2} = 1^{st} -RWNotIn({a, b, c}∪ UsedIntLoc(I)) and D = Int-Locations∪ FinSeq-Locations.

Let a, b, c be integer locations, let I be a macro instruction, and let s be a state of SCM _{FSA}. We say that ProperForUpBody a, b, c, I, s if and only if:

(Def. 7) For every natural number i such that i < (s(c)−s(b))+1 holds I is closed

on (StepForUp(a, b, c, I, s))(i) and halting on (StepForUp(a, b, c, I, s))(i). Next we state several propositions:

(23) For every parahalting macro instruction I holds ProperForUpBody a_{1}, b_{1}, c_{1}, I, s.

(24) If (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)(intloc(0)) = 1 and I_{1} is closed on (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k) and halting on (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k), then (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k + 1)(intloc(0)) = 1.

(25) Suppose s(intloc(0)) = 1 and ProperForUpBody a, b_{1}, c_{1}, I_{1}, s. Let given

k. Suppose k (s(c_{1}) − s(b_{1})) + 1. Then

(i) (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)(intloc(0)) = 1, (ii) if I_{1} does not destroy a, then (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)(a) = k +

s(b_{1}) and (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)(a) s(c_{1}) + 1, and (iii) (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)(1^{st} -RWNotIn({a, b_{1}, c_{1}}∪UsedIntLoc(I_{1})))+

k = (s(c_{1}) − s(b_{1})) + 1.

(26) Suppose s(intloc(0)) = 1 and ProperForUpBody a, b_{1}, c_{1}, I_{1}, s. Let given k. Then (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)(1^{st} -RWNotIn({a, b_{1}, c_{1}} ∪ UsedIntLoc(I_{1}))) > 0 if and only if k < (s(c_{1}) − s(b_{1})) + 1.

(27) Suppose s(intloc(0)) = 1 and ProperForUpBody a, b_{1}, c_{1}, I_{1}, s and k < (s(c_{1})−s(b_{1}))+1. Then (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k+1)↾({a, b_{1}, c_{1}}∪ UsedIntLoc(I_{1})∪F_{2}) = IExec(I_{1};AddTo(a, intloc(0)), (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k))↾({a, b_{1}, c_{1}}∪UsedIntLoc(I_{1})∪F_{2}), where F_{2} = FinSeq-Locations.

Let a, b, c be integer locations and let I be a macro instruction. The functor for-up(a, b, c, I) yields a macro instruction and is defined by:

(Def. 8) for-up(a, b, c, I) = (a_{2}:=c); SubFrom(a_{2}, b); AddTo(a_{2}, intloc(0)); (a:=b);(while a_{2} > 0 do (I; AddTo(a, intloc(0));SubFrom(a_{2}, intloc(0)))), where a_{2} = 1^{st} -RWNotIn({a, b, c} ∪ UsedIntLoc(I)).

The following proposition is true

(28) {a_{1}, b_{1}, c_{1}} ∪ UsedIntLoc(I) ⊆ UsedIntLoc(for-up(a_{1}, b_{1}, c_{1}, I)). Let a be a read-write integer location, let b, c be integer locations, and let I

be a good macro instruction. Note that for-up(a, b, c, I) is good.

Next we state four propositions:

(29) If a ≠ a_{1} and a_{1} ≠ 1^{st} -RWNotIn({a, b_{1}, c_{1}} ∪ UsedIntLoc(I)) and I does not destroy a_{1}, then for-up(a, b_{1}, c_{1}, I) does not destroy a_{1}.

(30) Suppose s(intloc(0)) = 1 and s(b_{1}) > s(c_{1}). Then for every x such that x ≠ a and x ∈ {b_{1}, c_{1}} ∪ UsedIntLoc(I) holds (IExec(for-up(a, b_{1}, c_{1}, I), s))(x) = s(x) and for every f holds (IExec(for-up(a, b_{1}, c_{1}, I), s))(f) = s(f).

(31) Suppose s(intloc(0)) = 1 but k = (s(c_{1}) − s(b_{1})) + 1 but ProperForUpBody a, b_{1}, c_{1}, I_{1}, s or I_{1} is parahalting. Then IExec(for-up(a, b_{1}, c_{1}, I_{1}), s)↾D = (StepForUp(a, b_{1}, c_{1}, I_{1}, s))(k)↾D, where D = Int-Locations∪ FinSeq-Locations.

(32) Suppose s(intloc(0)) = 1 but ProperForUpBody a, b_{1}, c_{1}, I_{1}, s or I_{1} is parahalting. Then for-up(a, b_{1}, c_{1}, I_{1}) is closed on s and for-up(a, b_{1}, c_{1}, I_{1}) is halting on s.

4. Finding Minimum in a Section of an Array

Let s_{1}, f_{1}, m_{2} be integer locations and let f be a finite sequence location. The functor FinSeqMin(f, s_{1}, f_{1}, m_{2}) yielding a macro instruction is defined by:

(Def. 9) FinSeqMin(f, s_{1}, f_{1}, m_{2}) = (m_{2}:=s_{1}); for-up(c_{2}, s_{1}, f_{1}, (a_{3}:=f_{c_{2}}); (a_{4}:=f_{m_{2}}); (if a_{4} > a_{3} then Macro(m_{2}:=c_{2}) else (Stop_{SCM_{FSA}} ))), where c_{2} = 3^{rd} -RWNotIn({s_{1}, f_{1}, m_{2}}), a_{3} = 1^{st} -RWNotIn({s_{1}, f_{1}, m_{2}}), and a_{4} = 2^{nd}-RWNotIn({s_{1}, f_{1}, m_{2}}).

Let s_{1}, f_{1} be integer locations, let m_{2} be a read-write integer location, and let f be a finite sequence location. Note that FinSeqMin(f, s_{1}, f_{1}, m_{2}) is good.

The following propositions are true:

(33) If c ≠ a_{1}, then FinSeqMin(f, a_{1}, b_{1}, c) does not destroy a_{1}.

(34) {a_{1}, b_{1}, c} ⊆ UsedIntLoc(FinSeqMin(f, a_{1}, b_{1}, c)).

(35) If s(intloc(0)) = 1, then FinSeqMin(f, a_{1}, b_{1}, c) is closed on s and FinSeqMin(f, a_{1}, b_{1}, c) is halting on s.

(36) If a_{1} ≠ c and b_{1} ≠ c and s(intloc(0)) = 1, then (IExec(FinSeqMin(f, a_{1}, b_{1}, c), s))(f) = s(f) and (IExec(FinSeqMin(f, a_{1}, b_{1}, c), s))(a_{1}) = s(a_{1}) and (IExec(FinSeqMin(f, a_{1}, b_{1}, c), s))(b_{1}) = s(b_{1}).

(37) If 1 s(a_{1}) and s(a_{1}) s(b_{1}) and s(b_{1}) lens(f) and a_{1} ≠ c and b_{1} ≠ c and s(intloc(0)) = 1, then (IExec(FinSeqMin(f, a_{1}, b_{1}, c), s))(c) = min_{|s(a_{1})|}^{|s(b_{1})|} s(f).

5. A Swap Macro Instruction

Let f be a finite sequence location and let a, b be integer locations. The functor swap(f, a, b) yields a macro instruction and is defined as follows:

(Def. 10) swap(f, a, b) = (a_{3}:=f_{a});(a_{4}:=f_{b});(f_{a}:=a_{4});(f_{b}:=a_{3}), where a_{3} =

1^{st} -RWNotIn({s_{1}, f_{1}, m_{2}}) and a_{4} = 2^{nd}-RWNotIn({s_{1}, f_{1}, m_{2}}). Let f be a finite sequence location and let a, b be integer locations. Note

that swap(f, a, b) is good and parahalting.

The following propositions are true:

(38) If c_{1} ≠ 1^{st} -RWNotIn({a_{1}, b_{1}}) and c_{1} ≠ 2^{nd}-RWNotIn({a_{1}, b_{1}}), then swap(f, a_{1}, b_{1}) does not destroy c_{1}.

(39) If 1 s(a_{1}) and s(a_{1}) lens(f) and 1 s(b_{1}) and s(b_{1}) lens(f) and s(intloc(0)) = 1, then (IExec(swap(f, a_{1}, b_{1}), s))(f) = s(f) +· (s(a_{1}), s(f)(s(b_{1}))) +·(s(b_{1}), s(f)(s(a_{1}))).

(40) Suppose 1 s(a_{1}) and s(a_{1}) lens(f) and 1 s(b_{1}) and s(b_{1}) lens(f) and s(intloc(0)) = 1. Then (IExec(swap(f, a_{1}, b_{1}), s))(f)(s(a_{1})) = s(f)(s(b_{1})) and (IExec(swap(f, a_{1}, b_{1}), s))(f)(s(b_{1})) = s(f)(s(a_{1})).

(41) {a_{1}, b_{1}} ⊆ UsedIntLoc(swap(f, a_{1}, b_{1})).

(42) UsedInt^{∗} Loc(swap(f, a_{1}, b_{1})) = {f}.

6. Selection Sort

Let f be a finite sequence location. The functor Selection-sortf yielding a macro instruction is defined as follows:

(Def. 11) Selection-sortf = (f_{1}:=lenf); for-up(c_{2}, intloc(0), f′_{1}, FinSeqMin(f, c_{2}, f′_{1}, m′_{1}); swap(f, c_{2}, m′_{1})), where c_{2} = 3^{rd} -RWNotIn({s_{1}, f_{1}, m_{2}}), f′_{1} = 1^{st}-NotUsed(swap(f, c_{2}, m′_{1})), and m′_{1} = 2^{nd}-RWNotIn(∅_{Int-Locations} ).

the for (going up) macro instruction 111

The following proposition is true

(43) Let S be a state of SCM _{FSA}. Suppose S = IExec(Selection-sortf, s). Then S(f) is non decreasing on 1, lenS(f) and there exists a permutation p of Seglens(f) such that S(f) = s(f) · p.

References

[1] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):73–80, 1997.

[2] Noriko Asamoto. Constant assignment macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):59–63, 1997.

[3] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part II. Formalized Mathematics, 6(1):41–47, 1997.

[4] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part III. Formalized Mathematics, 6(1):53–57, 1997.

[5] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[6] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[7] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[8] Grzegorz Bancerek and Andrzej Trybulec. Miscellaneous facts about functions. Formalized Mathematics, 5(4):485–492, 1996.

[9] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[10] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[11] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[12] Jing-Chao Chen. While macro instructions of SCM _{FSA} . Formalized Mathematics, 6(4):553–561, 1997.

[13] Krzysztof Hryniewiecki. Basic properties of real numbers. Formalized Mathematics, 1(1):35–40, 1990.

[14] Andrzej Kondracki. The chinese remainder theorem. Formalized Mathematics, 6(4):573– 577, 1997.

[15] Rafał Kwiatek and Grzegorz Zwara. The divisibility of integers and integer relative primes. Formalized Mathematics, 1(5):829–832, 1990.

[16] Yatsuka Nakamura and Andrzej Trybulec. A mathematical model of CPU. Formalized Mathematics, 3(2):151–160, 1992.

[17] Piotr Rudnicki. On the composition of non-parahalting macro instructions. Formalized Mathematics, 7(1):87–92, 1998.

[18] Piotr Rudnicki and Andrzej Trybulec. Memory handling for SCM _{FSA} . Formalized Mathematics, 6(1):29–36, 1997.

[19] Andrzej Trybulec. Semilattice operations on finite subsets. Formalized Mathematics, 1(2):369–376, 1990.

[20] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[21] Andrzej Trybulec and Yatsuka Nakamura. Some remarks on the simple concrete model of computer. Formalized Mathematics, 4(1):51–56, 1993.

[22] Andrzej Trybulec and Yatsuka Nakamura. Modifying addresses of instructions of SCM _{FSA} . Formalized Mathematics, 5(4):571–576, 1996.

[23] Andrzej Trybulec, Yatsuka Nakamura, and Noriko Asamoto. On the compositions of macro instructions. Part I. Formalized Mathematics, 6(1):21–27, 1997.

[24] Andrzej Trybulec, Yatsuka Nakamura, and Piotr Rudnicki. The SCM _{FSA} computer. Formalized Mathematics, 5(4):519–528, 1996.

[25] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[26] Wojciech A. Trybulec. Pigeon hole principle. Formalized Mathematics, 1(3):575–579, [27] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[28] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[29] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

[30] Edmund Woronowicz. Relations defined on sets. Formalized Mathematics, 1(1):181–186, 1990.

Bounding Boxes for Special Sequences in E^{2}

Yatsuka Nakamura Shinshu University Nagano

Adam Grabowski^{1} University of Białystok

Summary. This is the continuation of the proof of the Jordan Theorem according to [18].

MML Identifier: JORDAN5D.

The articles [16], [8], [6], [2], [21], [20], [5], [3], [12], [13], [15], [9], [1], [14], [17], [4], [23], [11], [10], [22], [19], and [7] provide the terminology and notation for this paper.

1. Preliminaries

For simplicity, we use the following convention: p, q denote points of E_{T}^{2}, s, r denote real numbers, h denotes a non constant standard special circular sequence, g denotes a finite sequence of elements of E_{T}^{2}, f denotes a non empty finite sequence of elements of E_{T}^{2}, and I, i_{1}, i, j, k denote natural numbers.

We now state a number of propositions:

(1) Let B be a subset of ℝ. Suppose there exists a real number r_{1} such that r_{1} ∈ B and B is lower bounded and for every r such that r ∈ B holds s r. Then s inf B.

(2) Let B be a subset of ℝ. Suppose there exists a real number r_{1} such that r_{1} ∈ B and B is upper bounded and for every r such that r ∈ B holds s r. Then s supB.

(3) π_{len h}h ∈ L(h, lenh − ′1).

1A part of this paper was written while the author visited the Shinshu University in the winter of 1997.

(4) If 3 i, then i mod (i − ′1) = 1.

(5) If p ∈ rngh, then there exists a natural number i such that 1 i and i + 1 lenh and h(i) = p.

(6) For every finite sequence g of elements of ℝ such that r ∈ rngg holds (Inc(g))(1) r and r (Inc(g))(lenInc(g)).

(7) Suppose 1 i and i lenh and 1 I and I widththe Goboard of h. Then ((the Go-board of h)_{1,I})_{1} (π_{i}h)_{1} and (π_{i}h)_{1} ((the Go-board of h)_{len the Go-board of h, I})_{1}.

(8) Suppose 1 i and i lenh and 1 I and I lenthe Goboard of h. Then ((the Go-board of h)_{I,1})_{2} (π_{i}h)_{2} and (π_{i}h)_{2} ((the Go-board of h)_{I,width the Go-board of h})_{2}.

(9) Suppose 1 i and i lenthe Go-board of f. Then there exist k, j such that k ∈ domf and ⟨⟨i, j⟩⟩ ∈ the indices of the Go-board of f and π_{k}f = (the Go-board of f)_{i,j}.

(10) Suppose 1 j and j widththe Go-board of f. Then there exist k, i such that k ∈ domf and ⟨⟨i, j⟩⟩ ∈ the indices of the Go-board of f and π_{k}f = (the Go-board of f)_{i,j}.

(11) Suppose 1 i and i lenthe Go-board of f and 1 j and j widththe Go-board of f. Then there exists k such that k ∈ domf and ⟨⟨i, j⟩⟩∈ the indices of the Go-board of f and (π_{k}f)_{1} = ((the Go-board of f)_{i,j})_{1}.

(12) Suppose 1 i and i lenthe Go-board of f and 1 j and j widththe Go-board of f. Then there exists k such that k ∈ domf and ⟨⟨i, j⟩⟩∈ the indices of the Go-board of f and (π_{k}f)_{2} = ((the Go-board of f)_{i,j})_{2}.

2. Extrema of Projections

One can prove the following propositions:

(13) If 1 i and i lenh, then S-bound L̃(h) (π_{i}h)_{2} and (π_{i}h)_{2} N-bound L̃(h).

(14) If 1 i and i lenh, then W-bound L̃(h) (π_{i}h)_{1} and (π_{i}h)_{1} E-bound L̃(h).

(15) For every subset X of ℝ such that X = {q_{2} : q_{1} = W-bound L̃(h) ∧ q ∈ L̃(h)} holds X = (proj2 ↾ W-most L̃(h))^{∘}(the carrier of (E_{T}^{2})↾ W-most L̃(h)).

(16) For every subset X of ℝ such that X = {q_{2} : q_{1} = E-bound L̃(h) ∧ q ∈ L̃(h)} holds X = (proj2 ↾ E-most L̃(h))^{∘}(the carrier of (E_{T}^{2})↾ E-most L̃(h)).

(17) For every subset X of ℝ such that X = {q_{1} : q_{2} = N-bound L̃(h) ∧ q ∈ L̃(h)} holds X = (proj1 ↾ N-most L̃(h))^{∘}(the carrier of (E_{T}^{2})↾ N-most L̃(h)).

(18) For every subset X of ℝ such that X = {q_{1} : q_{2} = S-bound L̃(h) ∧ q ∈ L̃(h)} holds X = (proj1 ↾ S-most L̃(h))^{∘}(the carrier of (E_{T}^{2})↾ S-most L̃(h)).

(19) For every subset X of ℝ such that X = {q_{1} : q ∈ L̃(g)} holds X = (proj1 ↾ L̃(g))^{∘}(the carrier of (E_{T}^{2})↾L̃(g)).

(20) For every subset X of ℝ such that X = {q_{2} : q ∈ L̃(g)} holds X = (proj2 ↾ L̃(g))^{∘}(the carrier of (E_{T}^{2})↾L̃(g)).

(21) For every subset X of ℝ such that X = {q_{2} : q_{1} = W-bound L̃(h) ∧ q ∈ L̃(h)} holds inf X = inf(proj2 ↾ W-most L̃(h)).

(22) For every subset X of ℝ such that X = {q_{2} : q_{1} = W-bound L̃(h) ∧ q ∈ L̃(h)} holds supX = sup(proj2 ↾ W-most L̃(h)).

(23) For every subset X of ℝ such that X = {q_{2} : q_{1} = E-bound L̃(h) ∧ q ∈ L̃(h)} holds inf X = inf(proj2 ↾ E-most L̃(h)).

(24) For every subset X of ℝ such that X = {q_{2} : q_{1} = E-bound L̃(h) ∧ q ∈ L̃(h)} holds supX = sup(proj2 ↾ E-most L̃(h)).

(25) For every subset X of ℝ such that X = {q_{1} : q ∈ L̃(g)} holds inf X = inf(proj1 ↾ L̃(g)).

(26) For every subset X of ℝ such that X = {q_{1} : q_{2} = S-bound L̃(h) ∧ q ∈ L̃(h)} holds inf X = inf(proj1 ↾ S-most L̃(h)).

(27) For every subset X of ℝ such that X = {q_{1} : q_{2} = S-bound L̃(h) ∧ q ∈ L̃(h)} holds supX = sup(proj1 ↾ S-most L̃(h)).

(28) For every subset X of ℝ such that X = {q_{1} : q_{2} = N-bound L̃(h) ∧ q ∈ L̃(h)} holds inf X = inf(proj1 ↾ N-most L̃(h)).

(29) For every subset X of ℝ such that X = {q_{1} : q_{2} = N-bound L̃(h) ∧ q ∈ L̃(h)} holds supX = sup(proj1 ↾ N-most L̃(h)).

(30) For every subset X of ℝ such that X = {q_{2} : q ∈ L̃(g)} holds inf X = inf(proj2 ↾ L̃(g)).

(31) For every subset X of ℝ such that X = {q_{1} : q ∈ L̃(g)} holds supX = sup(proj1 ↾ L̃(g)).

(32) For every subset X of ℝ such that X = {q_{2} : q ∈ L̃(g)} holds supX = sup(proj2 ↾ L̃(g)).

(33) If p ∈ L̃(h) and 1 I and I widththe Go-board of h, then ((the Go-board of h)_{1,I})_{1} p_{1}.

(34) If p ∈ L̃(h) and 1 I and I widththe Go-board of h, then p_{1} ((the Go-board of h)_{len the Go-board of h, I})_{1}.

(35) If p ∈ L̃(h) and 1 I and I lenthe Go-board of h, then ((the Go-board of h)_{I,1})_{2} p_{2}.

(36) If p ∈ L̃(h) and 1 I and I lenthe Go-board of h, then p_{2} ((the Go-board of h)_{I,width the Go-board of h})_{2}.

(37) Suppose 1 i and i lenthe Go-board of h and 1 j and j widththe Go-board of h. Then there exists q such that q_{1} = ((the Go-board of h)_{i,j})_{1} and q ∈ L̃(h).

(38) Suppose 1 i and i lenthe Go-board of h and 1 j and j widththe Go-board of h. Then there exists q such that q_{2} = ((the Go-board of h)_{i,j})_{2} and q ∈ L̃(h).

(39) W-bound L̃(h) = ((the Go-board of h)_{1,1})_{1}.

(40) S-bound L̃(h) = ((the Go-board of h)_{1,1})_{2}.

(41) E-bound L̃(h) = ((the Go-board of h)_{len the Go-board of h, 1})_{1}.

(42) N-bound L̃(h) = ((the Go-board of h)_{1,width the Go-board of h})_{2}.

(43) Let Y be a non empty finite subset of ℕ. Suppose that (i) 1 i, (ii) i lenf, (iii) 1 I, (iv) I lenthe Go-board of f,

(v) Y = {j : ⟨⟨I, j⟩⟩ ∈ the indices of the Go-board of f ∧ ⋁_{k} (k ∈ domf ∧ π_{k}f = (the Go-board of f)_{I,j})},

(vi) (π_{i}f)_{1} = ((the Go-board of f)_{I,1})_{1}, and (vii) i_{1} = minY.

Then ((the Go-board of f)_{I,i_{1}})_{2} (π_{i}f)_{2}.

(44) Let Y be a non empty finite subset of ℕ. Suppose that (i) 1 i, (ii) i lenh, (iii) 1 I, (iv) I widththe Go-board of h,

(v) Y = {j : ⟨⟨j, I⟩⟩ ∈ the indices of the Go-board of h ∧ ⋁_{k} (k ∈ domh ∧ π_{k}h = (the Go-board of h)_{j,I})},

(vi) (π_{i}h)_{2} = ((the Go-board of h)_{1,I})_{2}, and (vii) i_{1} = minY.

Then ((the Go-board of h)_{i_{1},I})_{1} (π_{i}h)_{1}.

(45) Let Y be a non empty finite subset of ℕ. Suppose that (i) 1 i, (ii) i lenh, (iii) 1 I, (iv) I widththe Go-board of h,

(v) Y = {j : ⟨⟨j, I⟩⟩ ∈ the indices of the Go-board of h ∧ ⋁_{k} (k ∈ domh ∧ π_{k}h = (the Go-board of h)_{j,I})},

(vi) (π_{i}h)_{2} = ((the Go-board of h)_{1,I})_{2}, and (vii) i_{1} = maxY.

Then ((the Go-board of h)_{i_{1},I})_{1} (π_{i}h)_{1}.

(46) Let Y be a non empty finite subset of ℕ. Suppose that (i) 1 i, (ii) i lenf, (iii) 1 I, (iv) I lenthe Go-board of f,

(v) Y = {j : ⟨⟨I, j⟩⟩ ∈ the indices of the Go-board of f ∧ ⋁_{k} (k ∈ domf ∧ π_{k}f = (the Go-board of f)_{I,j})},

(vi) (π_{i}f)_{1} = ((the Go-board of f)_{I,1})_{1}, and (vii) i_{1} = maxY.

Then ((the Go-board of f)_{I,i_{1}})_{2} (π_{i}f)_{2}.

3. Coordinates of the Special Circular Sequences Bounding Boxes

Let g be a non constant standard special circular sequence. The functor i_{SW} g yields a natural number and is defined as follows:

(Def. 1) ⟨⟨1, i_{SW} g⟩⟩ ∈ the indices of the Go-board of g and (the Go-board of

g)_{1,i_{SW} g} = W-min L̃(g). The functor i_{NW} g yields a natural number and is defined by:

(Def. 2) ⟨⟨1, i_{NW} g⟩⟩ ∈ the indices of the Go-board of g and (the Go-board of

g)_{1,i_{NW} g} = W-max L̃(g). The functor i_{SE} g yielding a natural number is defined by the conditions (Def. 3).

(Def. 3)(i) ⟨⟨lenthe Go-board of g, i_{SE} g⟩⟩∈ the indices of the Go-board of g, and

(ii) (the Go-board of g)_{len the Go-board of g, i_{SE} g} = E-min L̃(g). The functor i_{NE} g yielding a natural number is defined by the conditions (Def. 4).

(Def. 4)(i) ⟨⟨lenthe Go-board of g, i_{NE} g⟩⟩ ∈ the indices of the Go-board of g,

and (ii) (the Go-board of g)_{len the Go-board of g, i_{NE} g} = E-max L̃(g).

The functor i_{WS} g yields a natural number and is defined by: (Def. 5) ⟨⟨i_{WS} g, 1⟩⟩ ∈ the indices of the Go-board of g and (the Go-board of

g)_{i_{WS} g,1} = S-min L̃(g). The functor i_{ES} g yields a natural number and is defined by:

(Def. 6) ⟨⟨i_{ES} g, 1⟩⟩ ∈ the indices of the Go-board of g and (the Go-board of

g)_{i_{ES} g,1} = S-max L̃(g). The functor i_{WN} g yields a natural number and is defined by the conditions (Def. 7).

(Def. 7)(i) ⟨⟨i_{WN} g, widththe Go-board of g⟩⟩∈ the indices of the Go-board of g,

and (ii) (the Go-board of g)_{i_{WN} g,width the Go-board of g} = N-min L̃(g).

The functor i_{EN} g yields a natural number and is defined by the conditions (Def. 8).

(Def. 8)(i) ⟨⟨i_{EN} g, widththe Go-board of g⟩⟩∈ the indices of the Go-board of g,

and (ii) (the Go-board of g)_{i_{EN} g,width the Go-board of g} = N-max L̃(g). Next we state two propositions:

(47)(i) 1 i_{WN} h, (ii) i_{WN} h lenthe Go-board of h, (iii) 1 i_{EN} h, (iv) i_{EN} h lenthe Go-board of h,

(v) 1 i_{WS} h, (vi) i_{WS} h lenthe Go-board of h, (vii) 1 i_{ES} h, and (viii) i_{ES} h lenthe Go-board of h. (48)(i) 1 i_{NE} h, (ii) i_{NE} h widththe Go-board of h, (iii) 1 i_{SE} h, (iv) i_{SE} h widththe Go-board of h,

(v) 1 i_{NW} h, (vi) i_{NW} h widththe Go-board of h, (vii) 1 i_{SW} h, and (viii) i_{SW} h widththe Go-board of h.

Let g be a non constant standard special circular sequence. The functor n_{SW} g yields a natural number and is defined as follows:

(Def. 9) 1 n_{SW} g and n_{SW} g + 1 leng and g(n_{SW} g) = W-min L̃(g).

The functor n_{NW} g yielding a natural number is defined as follows: (Def. 10) 1 n_{NW} g and n_{NW} g + 1 leng and g(n_{NW} g) = W-max L̃(g).

The functor n_{SE} g yielding a natural number is defined by: (Def. 11) 1 n_{SE} g and n_{SE} g + 1 leng and g(n_{SE} g) = E-min L̃(g).

The functor n_{NE} g yielding a natural number is defined by: (Def. 12) 1 n_{NE} g and n_{NE} g + 1 leng and g(n_{NE} g) = E-max L̃(g).

The functor n_{WS} g yielding a natural number is defined by: (Def. 13) 1 n_{WS} g and n_{WS} g + 1 leng and g(n_{WS} g) = S-min L̃(g).

The functor n_{ES} g yields a natural number and is defined as follows: (Def. 14) 1 n_{ES} g and n_{ES} g + 1 leng and g(n_{ES} g) = S-max L̃(g).

The functor n_{WN} g yielding a natural number is defined by: (Def. 15) 1 n_{WN} g and n_{WN} g + 1 leng and g(n_{WN} g) = N-min L̃(g).

The functor n_{EN} g yielding a natural number is defined by: (Def. 16) 1 n_{EN} g and n_{EN} g + 1 leng and g(n_{EN} g) = N-max L̃(g).

bounding boxes for special sequences in … 119

Next we state four propositions:

(49) n_{WN} h ≠ n_{WS} h.

(50) n_{SW} h ≠ n_{SE} h.

(51) n_{EN} h ≠ n_{ES} h.

(52) n_{NW} h ≠ n_{NE} h.

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[2] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[3] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[4] Czesław Byliński and Piotr Rudnicki. Bounding boxes for compact sets in E^{2}. Formalized Mathematics, 6(3):427–440, 1997.

[5] Agata Darmochwał. Finite sets. Formalized Mathematics, 1(1):165–167, 1990.

[6] Agata Darmochwał. The Euclidean space. Formalized Mathematics, 2(4):599–603, 1991.

[7] Agata Darmochwał and Yatsuka Nakamura. The topological space E_{T}^{2}. Arcs, line segments and special polygonal arcs. Formalized Mathematics, 2(5):617–621, 1991.

[8] Agata Darmochwał and Andrzej Trybulec. Similarity of formulae. Formalized Mathematics, 2(5):635–642, 1991.

[9] Katarzyna Jankowska. Matrices. Abelian group of matrices. Formalized Mathematics, 2(4):475–480, 1991.

[10] Jarosław Kotowicz. Convergent real sequences. Upper and lower bound of sets of real numbers. Formalized Mathematics, 1(3):477–481, 1990.

[11] Jarosław Kotowicz. Monotone real sequences. Subsequences. Formalized Mathematics, 1(3):471–475, 1990.

[12] Jarosław Kotowicz and Yatsuka Nakamura. Introduction to Go-board - part I. Formalized Mathematics, 3(1):107–115, 1992.

[13] Jarosław Kotowicz and Yatsuka Nakamura. Introduction to Go-board - part II. Formalized Mathematics, 3(1):117–121, 1992.

[14] Yatsuka Nakamura, Piotr Rudnicki, Andrzej Trybulec, and Pauline N. Kawamoto. Preliminaries to circuits, I. Formalized Mathematics, 5(2):167–172, 1996.

[15] Yatsuka Nakamura and Andrzej Trybulec. Decomposing a Go-board into cells. Formalized Mathematics, 5(3):323–328, 1996.

[16] Takaya Nishiyama and Yasuho Mizuhara. Binary arithmetics. Formalized Mathematics, 4(1):83–86, 1993.

[17] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[18] Yukio Takeuchi and Yatsuka Nakamura. On the Jordan curve theorem. Technical Report 19804, Dept. of Information Eng., Shinshu University, 500 Wakasato, Nagano city, Japan, April 1980.

[19] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[20] Andrzej Trybulec. On the decomposition of finite sequences. Formalized Mathematics, 5(3):317–322, 1996.

[21] Wojciech A. Trybulec. Pigeon hole principle. Formalized Mathematics, 1(3):575–579, 1990.

[22] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[23] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

120 yatsuka nakamura and adam grabowski

Euler’s Theorem and Small Fermat’s Theorem

Yoshinori Fujisawa Shinshu University Nagano

Yasushi Fuwa Shinshu University Nagano

Hidetaka Shimizu Information Technology Research Institute of Nagano Prefecture

Summary. This article is concerned with Euler’s theorem and small Fermat’s theorem that play important roles in public-key cryptograms. In the first section, we present some selected theorems on integers. In the following section, we remake definitions about the finite sequence of natural, the function of natural times finite sequence of natural and π of the finite sequence of natural. We also prove some basic theorems that concern these redefinitions. Next, we define the function of modulus for finite sequence of natural and some fundamental theorems about this function are proved. Finally, Euler’s theorem and small Fermat’s theorem are proved.

MML Identifier: EULER 2.

The articles [6], [3], [2], [11], [10], [9], [1], [8], [4], [12], [5], and [7] provide the terminology and notation for this paper.

1. Preliminary

We use the following convention: a, b, m, n, k, l, i, j, n_{1}, n_{2}, n_{3} are natural numbers, t is an integer, and f, F are finite sequences of elements of ℕ.

We now state a number of propositions:

(1) a and b qua integer are relative prime iff a and b are relative prime.

(2) If m > 1 and m · t 1, then t 1.

(3) If m > 1 and m · t 0, then t 0.

(4) If m ≠ 0, then n mod m = (n qua integer) mod m.

(5) Suppose a ≠ 0 and b ≠ 0 and m ≠ 0 and a and m are relative prime and b and m are relative prime. Then m and a · b mod m are relative prime.

(6) Suppose m > 1 and b ≠ 0 and m and n are relative prime and a and m are relative prime and n = a · b mod m. Then m and b are relative prime.

(7) For every n such that n ≠ 0 holds m mod n mod n = m mod n.

(8) For every n such that n ≠ 0 holds (l + m) modn = ((l modn) + (m mod n)) mod n.

(9) For every n such that n ≠ 0 holds l · m mod n = l · (m mod n) mod n.

(10) For every n such that n ≠ 0 holds l · m mod n = (l mod n) · m mod n.

(11) For every n such that n ≠ 0 holds l·mmodn = (lmodn)·(mmodn)modn.

2. Finite Sequence of Naturals

We now state two propositions:

(12) For every finite sequence f of elements of ℕ such that n ≠ 0 and n m holds (f↾m)(n) = f(n).

(13) For every finite sequence f of elements of ℕ such that n m holds

f↾m↾n = f↾n. Let us consider a, f. Then a · f is a finite sequence of elements of ℕ. One can prove the following propositions:

(14) For every finite sequence f of elements of ℕ and for every natural number r holds ∏(f ^{⌢} ⟨r⟩) = ∏ f · r.

(15) For all finite sequences f_{1}, f_{2} of elements of ℕ holds ∏(f_{1} ^{⌢} f_{2}) = ∏ f_{1} · ∏ f_{2}.

(16) ∏(ε_{ℕ}) = 1.

(17) ∏⟨a⟩ = a.

(18) ∏(⟨a⟩^{⌢} F) = a · ∏ F.

(19) ∏⟨n_{1}, n_{2}⟩ = n_{1} · n_{2}.

(20) ∏⟨n_{1}, n_{2}, n_{3}⟩ = n_{1} · n_{2} · n_{3}.

(21) ∏(i ↦ (1 qua real number)) = 1.

(22) ∏((i + j) ↦ m) = ∏(i ↦ m) · ∏(j ↦ m).

(23) ∏((i · j) ↦ m) = ∏(j ↦ ∏(i ↦ m)).

(24) ∏(i ↦ (n_{1} · n_{2})) = ∏(i ↦ n_{1}) · ∏(i ↦ n_{2}).

(25) For all finite sequences R_{1}, R_{2} of elements of ℕ such that R_{1} and R_{2} are fiberwise equipotent holds ∏ R_{1} = ∏ R_{2}.

3. Modulus for Finite Sequence of Naturals

Let f be a finite sequence of elements of ℕ and let m be a natural number. The functor f mod m yielding a finite sequence of elements of ℕ is defined by:

(Def. 1) len(f modm) = lenf and for every natural number i such that i ∈ domf

holds (f mod m)(i) = f(i) mod m. We now state several propositions:

(26) For every finite sequence f of elements of ℕ such that m ≠ 0 holds ∏(f mod m) mod m = ∏ f mod m.

(27) If a ≠ 0 and m > 1 and n ≠ 0 and a · n modm = n modm and m and n are relative prime, then a mod m = 1.

(28) For every F such that m ≠ 0 holds F mod m mod m = F mod m.

(29) For every F such that m ≠ 0 holds a · (F modm) modm = a · F modm.

(30) For all finite sequences F, G of elements of ℕ such that m ≠ 0 holds F ^{⌢} G mod m = (F mod m)^{⌢} (G mod m).

(31) For all finite sequences F, G of elements of ℕ such that m ≠ 0 holds

a · (F ^{⌢} G) mod m = (a · F mod m)^{⌢} (a · G mod m). Let us consider n, k. Then n_{ℕ}^{k} is a natural number. We now state the proposition

(32) If a ≠ 0 and m ≠ 0 and a and m are relative prime, then for every b holds a_{ℕ}^{b} and m are relative prime.

4. Euler’s Theorem and Small Fermat’s Theorem

The following propositions are true:

(33) If a ≠ 0 and m > 1 and a and m are relative prime, then (a_{ℕ}^{Euler m}) mod m = 1.

(34) If a ≠ 0 and m is prime and a and m are relative prime, then (a_{ℕ}^{m}) mod m = a mod m.

Acknowledgments

The authors wish to thank Professor A. Trybulec for all of his advice on this article.

124 yoshinori fujisawa et al.

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[2] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[3] Czesław Byliński. Binary operations applied to finite sequences. Formalized Mathematics, 1(4):643–649, 1990.

[4] Czesław Byliński. The sum and product of finite sequences of real numbers. Formalized Mathematics, 1(4):661–668, 1990.

[5] Agata Darmochwał and Yatsuka Nakamura. The topological space E_{T}^{2}. Arcs, line segments and special polygonal arcs. Formalized Mathematics, 2(5):617–621, 1991.

[6] Yoshinori Fujisawa and Yasushi Fuwa. The Euler’s function. Formalized Mathematics, 6(4):549–551, 1997.

[7] Andrzej Kondracki. The chinese remainder theorem. Formalized Mathematics, 6(4):573– 577, 1997.

[8] Jarosław Kotowicz. Functions and finite sequences of real numbers. Formalized Mathematics, 3(2):275–278, 1992.

[9] Rafał Kwiatek and Grzegorz Zwara. The divisibility of integers and integer relative primes. Formalized Mathematics, 1(5):829–832, 1990.

[10] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[11] Wojciech A. Trybulec. Pigeon hole principle. Formalized Mathematics, 1(3):575–579, 1990.

[12] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

The Product of the Families of the Groups

Artur Korniłowicz University of Białystok

MML Identifier: GROUP 7.

The terminology and notation used here are introduced in the following articles: [6], [1], [4], [2], [3], [9], [10], [8], [12], [13], [11], [7], and [5].

1. Preliminaries

In this paper a, b, c, d, e, f are sets. Next we state three propositions:

(1) If ⟨a⟩ = ⟨b⟩, then a = b.

(2) If ⟨a, b⟩ = ⟨c, d⟩, then a = c and b = d.

(3) If ⟨a, b, c⟩ = ⟨d, e, f⟩, then a = d and b = e and c = f.

2. The Product of the Families of the Groups

We use the following convention: i, I denote sets, f, g, h denote functions, and s denotes a many sorted set indexed by I.

Let R be a binary relation. We say that R is semigroup yielding if and only if:

(Def. 1) For every set y such that y ∈ rngR holds y is a non empty semigroup.

Let us note that every function which is semigroup yielding is also 1-sorted yielding.

Let I be a set. One can verify that there exists a many sorted set indexed by I which is semigroup yielding.

Let us observe that there exists a function which is semigroup yielding.

Let I be a set. A family of semigroups indexed by I is a semigroup yielding many sorted set indexed by I.

Let I be a non empty set, let F be a family of semigroups indexed by I, and let i be an element of I. Then F (i) is a non empty semigroup.

Let I be a set and let F be a family of semigroups indexed by I. One can verify that the support of F is non-empty.

Let I be a set and let F be a family of semigroups indexed by I. The functor ∏ F yielding a strict semigroup is defined by the conditions (Def. 2).

(Def. 2)(i) The carrier of ∏ F = ∏ (the support of F), and

(ii) for all elements f, g of ∏ (the support of F) and for every set i such that i ∈ I there exists a non empty semigroup F_{1} and there exists a function h such that F_{1} = F (i) and h = (the multiplication of ∏ F)(f, g) and h(i) = (the multiplication of F_{1})(f(i), g(i)).

Let I be a set and let F be a family of semigroups indexed by I. Note that ∏ F is non empty.

Let I be a set and let F be a family of semigroups indexed by I. Observe that every element of the carrier of ∏ F is function-like and relation-like.

Let I be a set, let F be a family of semigroups indexed by I, and let f, g be elements of ∏ (the support of F). Observe that (the multiplication of ∏ F)(f,

g) is function-like and relation-like.

One can prove the following proposition

(4) Let F be a family of semigroups indexed by I, G be a non empty semigroup, p, q be elements of the carrier of ∏ F, and x, y be elements of the carrier of G. Suppose i ∈ I and G = F (i) and f = p and g = q and h = p · q and f(i) = x and g(i) = y. Then x · y = h(i).

Let I be a set and let F be a family of semigroups indexed by I. We say that F is group-like if and only if:

(Def. 3) For every set i such that i ∈ I there exists a group-like non empty

semigroup F_{1} such that F_{1} = F (i). We say that F is associative if and only if:

(Def. 4) For every set i such that i ∈ I there exists an associative non empty

semigroup F_{1} such that F_{1} = F (i). We say that F is commutative if and only if:

(Def. 5) For every set i such that i ∈ I there exists a commutative non empty

semigroup F_{1} such that F_{1} = F (i). Let I be a non empty set and let F be a family of semigroups indexed by I.

Let us observe that F is group-like if and only if: (Def. 6) For every element i of I holds F (i) is group-like.

Let us observe that F is associative if and only if: (Def. 7) For every element i of I holds F (i) is associative.

Let us observe that F is commutative if and only if: (Def. 8) For every element i of I holds F (i) is commutative.

Let I be a set. Note that there exists a family of semigroups indexed by I which is group-like, associative, and commutative.

Let I be a set and let F be a group-like family of semigroups indexed by I. Note that ∏ F is group-like.

Let I be a set and let F be an associative family of semigroups indexed by I. One can check that ∏ F is associative.

Let I be a set and let F be a commutative family of semigroups indexed by I. One can verify that ∏ F is commutative.

We now state several propositions:

(5) Let F be a family of semigroups indexed by I and G be a non empty semigroup. If i ∈ I and G = F (i) and ∏ F is group-like, then G is grouplike.

(6) Let F be a family of semigroups indexed by I and G be a non empty semigroup. If i ∈ I and G = F (i) and ∏ F is associative, then G is associative.

(7) Let F be a family of semigroups indexed by I and G be a non empty semigroup. If i ∈ I and G = F (i) and ∏ F is commutative, then G is commutative.

(8) Let F be a group-like family of semigroups indexed by I. Suppose that for every set i such that i ∈ I there exists a group-like non empty semigroup G such that G = F (i) and s(i) = 1_{G}. Then s = 1_{∏ F} .

(9) Let F be a group-like family of semigroups indexed by I and G be a group-like non empty semigroup. If i ∈ I and G = F (i) and f = 1_{∏ F} , then f(i) = 1_{G}.

(10) Let F be an associative group-like family of semigroups indexed by I

and x be an element of the carrier of ∏ F. Suppose that

(i) x = g, and (ii) for every set i such that i ∈ I there exists a group G and there exists

an element y of the carrier of G such that G = F (i) and s(i) = y^{−1} and y = g(i). Then s = x^{−1} .

(11) Let F be an associative group-like family of semigroups indexed by I, x be an element of the carrier of ∏ F, G be a group, and y be an element of the carrier of G. If i ∈ I and G = F (i) and f = x and g = x^{−1} and f(i) = y, then g(i) = y^{−1} .

Let I be a set and let F be an associative group-like family of semigroups indexed by I. The functor sumF yielding a strict subgroup of ∏ F is defined by the condition (Def. 9).

(Def. 9) Let x be a set. Then x ∈ the carrier of sumF if and only if there exists an element g of ∏ (the support of F) and there exists a finite subset J of I and there exists a many sorted set f indexed by J such that g = 1_{∏ F} and x = g+·f and for every set j such that j ∈ J there exists a group-like non empty semigroup G such that G = F (j) and f(j) ∈ the carrier of G and f(j) ≠ 1_{G}.

Let I be a set, let F be an associative group-like family of semigroups indexed by I, and let f, g be elements of the carrier of sumF. One can check that (the multiplication of sumF)(f, g) is function-like and relation-like.

The following proposition is true

(12) For every finite set I and for every associative group-like family F of semigroups indexed by I holds ∏ F = sumF.

3. The Product of One, Two and Three Groups

One can prove the following proposition

(13) For every non empty semigroup G_{1} holds ⟨G_{1}⟩ is a family of semigroups

indexed by {1}. Let G_{1} be a non empty semigroup. Then ⟨G_{1}⟩ is a family of semigroups

indexed by {1}.

We now state the proposition

(14) For every group-like non empty semigroup G_{1} holds ⟨G_{1}⟩ is a group-like

family of semigroups indexed by {1}. Let G_{1} be a group-like non empty semigroup. Then ⟨G_{1}⟩ is a group-like

family of semigroups indexed by {1}.

Next we state the proposition

(15) For every associative non empty semigroup G_{1} holds ⟨G_{1}⟩ is an associa-

tive family of semigroups indexed by {1}. Let G_{1} be an associative non empty semigroup. Then ⟨G_{1}⟩ is an associative

family of semigroups indexed by {1}.

The following proposition is true

(16) For every commutative non empty semigroup G_{1} holds ⟨G_{1}⟩ is a com-

mutative family of semigroups indexed by {1}. Let G_{1} be a commutative non empty semigroup. Then ⟨G_{1}⟩ is a commutative

family of semigroups indexed by {1}.

We now state the proposition

(17) For every group G_{1} holds ⟨G_{1}⟩ is a group-like associative family of semigroups indexed by {1}.

Let G_{1} be a group. Then ⟨G_{1}⟩ is a group-like associative family of semigroups indexed by {1}.

Next we state the proposition

(18) Let G_{1} be a commutative group. Then ⟨G_{1}⟩ is a commutative group-like

associative family of semigroups indexed by {1}. Let G_{1} be a commutative group. Then ⟨G_{1}⟩ is a group-like associative com-

mutative family of semigroups indexed by {1}.

Let G_{1} be a non empty semigroup. Note that every element of ∏ the support of ⟨G_{1}⟩ is finite sequence-like.

Let G_{1} be a non empty semigroup. Note that every element of the carrier of ∏⟨G_{1}⟩ is finite sequence-like.

Let G_{1} be a non empty semigroup and let x be an element of the carrier of G_{1}. Then ⟨x⟩ is an element of ∏⟨G_{1}⟩.

One can prove the following proposition

(19) For all non empty semigroups G_{1}, G_{2} holds ⟨G_{1}, G_{2}⟩ is a family of semi-

groups indexed by {1, 2}. Let G_{1}, G_{2} be non empty semigroups. Then ⟨G_{1}, G_{2}⟩ is a family of semigro-

ups indexed by {1, 2}.

One can prove the following proposition

(20) For all group-like non empty semigroups G_{1}, G_{2} holds ⟨G_{1}, G_{2}⟩ is a

group-like family of semigroups indexed by {1, 2}. Let G_{1}, G_{2} be group-like non empty semigroups. Then ⟨G_{1}, G_{2}⟩ is a group-

like family of semigroups indexed by {1, 2}.

Next we state the proposition

(21) For all associative non empty semigroups G_{1}, G_{2} holds ⟨G_{1}, G_{2}⟩ is an

associative family of semigroups indexed by {1, 2}. Let G_{1}, G_{2} be associative non empty semigroups. Then ⟨G_{1}, G_{2}⟩ is an asso-

ciative family of semigroups indexed by {1, 2}.

One can prove the following proposition

(22) For all commutative non empty semigroups G_{1}, G_{2} holds ⟨G_{1}, G_{2}⟩ is a

commutative family of semigroups indexed by {1, 2}. Let G_{1}, G_{2} be commutative non empty semigroups. Then ⟨G_{1}, G_{2}⟩ is a com-

mutative family of semigroups indexed by {1, 2}.

The following proposition is true

(23) For all groups G_{1}, G_{2} holds ⟨G_{1}, G_{2}⟩ is a group-like associative family of

semigroups indexed by {1, 2}. Let G_{1}, G_{2} be groups. Then ⟨G_{1}, G_{2}⟩ is a group-like associative family of

semigroups indexed by {1, 2}.

Next we state the proposition (24) Let G_{1}, G_{2} be commutative groups. Then ⟨G_{1}, G_{2}⟩ is a group-like asso-

ciative commutative family of semigroups indexed by {1, 2}. Let G_{1}, G_{2} be commutative groups. Then ⟨G_{1}, G_{2}⟩ is a group-like associative

commutative family of semigroups indexed by {1, 2}.

Let G_{1}, G_{2} be non empty semigroups. Note that every element of ∏ the support of ⟨G_{1}, G_{2}⟩ is finite sequence-like.

Let G_{1}, G_{2} be non empty semigroups. Note that every element of the carrier of ∏⟨G_{1}, G_{2}⟩ is finite sequence-like.

Let G_{1}, G_{2} be non empty semigroups, let x be an element of the carrier of G_{1}, and let y be an element of the carrier of G_{2}. Then ⟨x, y⟩ is an element of ∏⟨G_{1}, G_{2}⟩.

One can prove the following proposition

(25) For all non empty semigroups G_{1}, G_{2}, G_{3} holds ⟨G_{1}, G_{2}, G_{3}⟩ is a family

of semigroups indexed by {1, 2, 3}. Let G_{1}, G_{2}, G_{3} be non empty semigroups. Then ⟨G_{1}, G_{2}, G_{3}⟩ is a family of

semigroups indexed by {1, 2, 3}.

Next we state the proposition

(26) For all group-like non empty semigroups G_{1}, G_{2}, G_{3} holds ⟨G_{1}, G_{2}, G_{3}⟩

is a group-like family of semigroups indexed by {1, 2, 3}. Let G_{1}, G_{2}, G_{3} be group-like non empty semigroups. Then ⟨G_{1}, G_{2}, G_{3}⟩ is a

group-like family of semigroups indexed by {1, 2, 3}.

Next we state the proposition

(27) Let G_{1}, G_{2}, G_{3} be associative non empty semigroups. Then ⟨G_{1}, G_{2}, G_{3}⟩

is an associative family of semigroups indexed by {1, 2, 3}. Let G_{1}, G_{2}, G_{3} be associative non empty semigroups. Then ⟨G_{1}, G_{2}, G_{3}⟩ is

an associative family of semigroups indexed by {1, 2, 3}.

One can prove the following proposition

(28) Let G_{1}, G_{2}, G_{3} be commutative non empty semigroups. Then ⟨G_{1}, G_{2},

G_{3}⟩ is a commutative family of semigroups indexed by {1, 2, 3}. Let G_{1}, G_{2}, G_{3} be commutative non empty semigroups. Then ⟨G_{1}, G_{2}, G_{3}⟩

is a commutative family of semigroups indexed by {1, 2, 3}.

Next we state the proposition

(29) For all groups G_{1}, G_{2}, G_{3} holds ⟨G_{1}, G_{2}, G_{3}⟩ is a group-like associative

family of semigroups indexed by {1, 2, 3}. Let G_{1}, G_{2}, G_{3} be groups. Then ⟨G_{1}, G_{2}, G_{3}⟩ is a group-like associative

family of semigroups indexed by {1, 2, 3}.

One can prove the following proposition

(30) Let G_{1}, G_{2}, G_{3} be commutative groups. Then ⟨G_{1}, G_{2}, G_{3}⟩ is a group-like associative commutative family of semigroups indexed by {1, 2, 3}.

Let G_{1}, G_{2}, G_{3} be commutative groups. Then ⟨G_{1}, G_{2}, G_{3}⟩ is a group-like associative commutative family of semigroups indexed by {1, 2, 3}.

Let G_{1}, G_{2}, G_{3} be non empty semigroups. Observe that every element of ∏ the support of ⟨G_{1}, G_{2}, G_{3}⟩ is finite sequence-like.

Let G_{1}, G_{2}, G_{3} be non empty semigroups. Note that every element of the carrier of ∏⟨G_{1}, G_{2}, G_{3}⟩ is finite sequence-like.

Let G_{1}, G_{2}, G_{3} be non empty semigroups, let x be an element of the carrier of G_{1}, let y be an element of the carrier of G_{2}, and let z be an element of the carrier of G_{3}. Then ⟨x, y, z⟩ is an element of ∏⟨G_{1}, G_{2}, G_{3}⟩.

For simplicity, we adopt the following rules: G_{1}, G_{2}, G_{3} denote non empty semigroups, x_{1}, x_{2} denote elements of the carrier of G_{1}, y_{1}, y_{2} denote elements of the carrier of G_{2}, and z_{1}, z_{2} denote elements of the carrier of G_{3}.

One can prove the following propositions:

(31) ⟨x_{1}⟩ · ⟨x_{2}⟩ = ⟨x_{1} · x_{2}⟩.

(32) ⟨x_{1}, y_{1}⟩ · ⟨x_{2}, y_{2}⟩ = ⟨x_{1} · x_{2}, y_{1} · y_{2}⟩.

(33) ⟨x_{1}, y_{1}, z_{1}⟩ · ⟨x_{2}, y_{2}, z_{2}⟩ = ⟨x_{1} · x_{2}, y_{1} · y_{2}, z_{1} · z_{2}⟩.

In the sequel G_{1}, G_{2}, G_{3} denote group-like non empty semigroups.

We now state three propositions:

(34) 1_{∏⟨G_{1}⟩}= ⟨1_{(G_{1})}⟩.

(35) 1_{∏⟨G_{1},G_{2}⟩}= ⟨1_{(G_{1})}, 1_{(G_{2})}⟩.

(36) 1_{∏⟨G_{1},G_{2},G_{3}⟩}= ⟨1_{(G_{1})}, 1_{(G_{2})}, 1_{(G_{3})}⟩.

For simplicity, we adopt the following rules: G_{1}, G_{2}, G_{3} are groups, x is an element of the carrier of G_{1}, y is an element of the carrier of G_{2}, and z is an element of the carrier of G_{3}.

The following propositions are true:

(37) (⟨x⟩ qua element of the carrier of ∏⟨G_{1}⟩)^{−1} = ⟨x^{−1} ⟩.

(38) (⟨x, y⟩ qua element of the carrier of ∏⟨G_{1}, G_{2}⟩)^{−1} = ⟨x^{−1} , y^{−1} ⟩.

(39) (⟨x, y, z⟩ qua element of the carrier of ∏⟨G_{1}, G_{2}, G_{3}⟩)^{−1} = ⟨x^{−1} , y^{−1} , z^{−1} ⟩.

(40) Let f be a function from the carrier of G_{1} into the carrier of ∏⟨G_{1}⟩. Suppose that for every element x of the carrier of G_{1} holds f(x) = ⟨x⟩. Then f is a homomorphism from G_{1} to ∏⟨G_{1}⟩.

(41) Let f be a homomorphism from G_{1} to ∏⟨G_{1}⟩. Suppose that for every element x of the carrier of G_{1} holds f(x) = ⟨x⟩. Then f is an isomorphism.

(42) G_{1} and ∏⟨G_{1}⟩ are isomorphic.

References

[1] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

132 artur korniłowicz

[2] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[3] Czesław Byliński. Functions from a set to a set. Formalized Mathematics, 1(1):153–164, 1990.

[4] Agata Darmochwał. Finite sets. Formalized Mathematics, 1(1):165–167, 1990.

[5] Eugeniusz Kusak, Wojciech Leończuk, and Michał Muzalewski. Abelian groups, fields and vector spaces. Formalized Mathematics, 1(2):335–342, 1990.

[6] Andrzej Trybulec. Enumerated sets. Formalized Mathematics, 1(1):25–34, 1990.

[7] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[8] Andrzej Trybulec. Many-sorted sets. Formalized Mathematics, 4(1):15–22, 1993.

[9] Wojciech A. Trybulec. Groups. Formalized Mathematics, 1(5):821–827, 1990.

[10] Wojciech A. Trybulec and Michał J. Trybulec. Homomorphisms and isomorphisms of groups. Quotient group. Formalized Mathematics, 2(4):573–578, 1991.

[11] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[12] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

[13] Edmund Woronowicz. Relations defined on sets. Formalized Mathematics, 1(1):181–186, 1990.

On the Dividing Function of the Simple Closed Curve into Segments

Yatsuka Nakamura Shinshu University Nagano

Summary. At the beginning, the concept of the segment of the simple closed curve in 2-dimensional Euclidean space is defined. Some properties of segments are shown in the succeeding theorems. At the end, the existence of the function which can divide the simple closed curve into segments is shown. We can make the diameter of segments as small as we want.

MML Identifier: JORDAN7.

The terminology and notation used in this paper are introduced in the following papers: [17], [5], [7], [2], [15], [3], [11], [12], [13], [1], [14], [4], [18], [16], [10], [8], [9], and [6].

1. Definition of the Segment and Its Property

In this paper p, p_{1}, q are points of E_{T}^{2}. The following three propositions are true:

(1) Let P be a compact non empty subset of E_{T}^{2}. Suppose P is a simple closed curve. Then W-minP ∈ LowerArcP and E-maxP ∈ LowerArcP and W-minP ∈ UpperArcP and E-maxP ∈ UpperArcP.

(2) For every compact non empty subset P of E_{T}^{2} and for every q such that P is a simple closed curve and LE(q, W-minP, P) holds q = W-minP.

(3) For every compact non empty subset P of E_{T}^{2} and for every q such that P is a simple closed curve and q ∈ P holds LE(W-minP, q, P).

Let P be a compact non empty subset of E_{T}^{2} and let q_{1}, q_{2} be points of E_{T}^{2}. The functor Segment(q_{1}, q_{2}, P) yields a subset of E_{T}^{2} and is defined by:

(Def. 1) Segment(q_{1}, q_{2}, P) = \{ \begin{matrix}\{p : LE(q_{1}, p, P) ∧ LE(p, q_{2}, P)\}, \\ if q_{2} ≠ W-minP, \\ \{p_{1} : LE(q_{1}, p_{1}, P) ∨ q_{1} ∈ P ∧ p_{1} = W-minP \}, \\ otherwise. \end{matrix}

One can prove the following propositions:

(4) For every compact non empty subset P of E_{T}^{2} such that P is a simple closed curve holds Segment(W-minP, E-maxP, P) = UpperArcP and Segment(E-maxP, W-minP, P) = LowerArcP.

(5) Let P be a compact non empty subset of E_{T}^{2} and q_{1}, q_{2} be points of E_{T}^{2}. If P is a simple closed curve and LE(q_{1}, q_{2}, P), then q_{1} ∈ P and q_{2} ∈ P.

(6) Let P be a compact non empty subset of E_{T}^{2} and q_{1}, q_{2} be points of E_{T}^{2}. If P is a simple closed curve and LE(q_{1}, q_{2}, P), then q_{1} ∈ Segment(q_{1}, q_{2}, P) and q_{2} ∈ Segment(q_{1}, q_{2}, P).

(7) Let P be a compact non empty subset of E_{T}^{2} and q be a point of E_{T}^{2}. If P is a simple closed curve and q ∈ P and q ≠ W-minP, then Segment(q, q, P) = {q}.

(8) Let P be a compact non empty subset of E_{T}^{2} and q_{1}, q_{2} be points of E_{T}^{2}. If P is a simple closed curve and q_{1} ≠ W-minP and q_{2} ≠ W-minP, then W-minP ∉ Segment(q_{1}, q_{2}, P).

(9) Let P be a compact non empty subset of E_{T}^{2} and q_{1}, q_{2}, q_{3} be points of E_{T}^{2}. Suppose P is a simple closed curve and LE(q_{1}, q_{2}, P) and LE(q_{2}, q_{3}, P) and q_{1} = q_{2} and q_{1} = W-minP and q_{1} ≠ q_{3} and q_{2} = q_{3} and q_{2} = W-minP. Then Segment(q_{1}, q_{2}, P) ∩ Segment(q_{2}, q_{3}, P) = {q_{2}}.

(10) Let P be a compact non empty subset of E_{T}^{2} and q_{1}, q_{2} be points of E_{T}^{2}. Suppose P is a simple closed curve and LE(q_{1}, q_{2}, P) and q_{1} ≠ q_{2} and q_{1} ≠ W-minP. Then Segment(q_{2}, W-minP, P) ∩ Segment(W-minP, q_{1}, P) = {W-minP }.

(11) Let P be a compact non empty subset of E_{T}^{2} and q_{1}, q_{2}, q_{3}, q_{4} be points of E_{T}^{2}. Suppose P is a simple closed curve and LE(q_{1}, q_{2}, P) and LE(q_{2}, q_{3}, P) and LE(q_{3}, q_{4}, P) and q_{1} ≠ q_{2} and q_{2} ≠ q_{3}. Then Segment(q_{1}, q_{2}, P) ∩ Segment(q_{3}, q_{4}, P) = ∅.

2. A Function to Divide the Simple Closed Curve

In the sequel n is a natural number. We now state three propositions:

(12) Let P be a non empty subset of the carrier of E_{T}^{n} and f be a map from 𝕀 into (E_{T}^{n})↾P. Suppose P ≠ ∅ and f is a homeomorphism. Then there exists a map g from 𝕀 into E_{T}^{n} such that f = g and g is continuous and one-to-one.

(13) For every finite sequence f of elements of ℝ such that f is increasing holds f is one-to-one.

(14) Let P be a compact non empty subset of E_{T}^{2} and e be a real number. Suppose P is a simple closed curve and e > 0. Then there exists a finite sequence h of elements of the carrier of E_{T}^{2} such that

(i) h(1) = W-minP, (ii) h is one-to-one, (iii) 8 lenh, (iv) rngh ⊆ P,

(v) for every natural number i such that 1 i and i < lenh holds LE(π_{i}h, π_{i+1}h, P),

(vi) for every natural number i and for every subset W of the carrier of E^{2} such that 1 i and i < lenh and W = Segment(π_{i}h, π_{i+1}h, P) holds ØW < e,

(vii) for every subset W of the carrier of E^{2} such that W =

Segment(π_{len h}h, π_{1}h, P) holds ØW < e, (viii) for every natural number i such that 1 i and i + 1 < lenh holds

Segment(π_{i}h, π_{i+1}h, P) ∩ Segment(π_{i+1}h, π_{i+2}h, P) = {π_{i+1}h}, (ix) Segment(π_{len h}h, π_{1}h, P) ∩ Segment(π_{1}h, π_{2}h, P) = {π_{1}h}, and

(x) for all natural numbers i, j such that 1 i and i < lenh and 1 j and j < lenh and i ≠ j and i and j are not adjacent holds Segment(π_{i}h, π_{i+1}h, P) ∩ Segment(π_{j}h, π_{j+1}h, P) = ∅.

References

[1] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[2] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[3] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

[4] Czesław Byliński and Piotr Rudnicki. Bounding boxes for compact sets in E^{2}. Formalized Mathematics, 6(3):427–440, 1997.

[5] Agata Darmochwał. Compact spaces. Formalized Mathematics, 1(2):383–386, 1990.

[6] Agata Darmochwał. Families of subsets, subspaces and mappings in topological spaces. Formalized Mathematics, 1(2):257–261, 1990.

136 yatsuka nakamura

[7] Agata Darmochwał. The Euclidean space. Formalized Mathematics, 2(4):599–603, 1991.

[8] Agata Darmochwał and Yatsuka Nakamura. Metric spaces as topological spaces - fundamental concepts. Formalized Mathematics, 2(4):605–608, 1991.

[9] Agata Darmochwał and Yatsuka Nakamura. The topological space E_{T}^{2}. Simple closed curves. Formalized Mathematics, 2(5):663–664, 1991.

[10] Alicia de la Cruz. Totally bounded metric spaces. Formalized Mathematics, 2(4):559–562, 1991.

[11] Jarosław Kotowicz and Yatsuka Nakamura. Introduction to Go-board - part I. Formalized Mathematics, 3(1):107–115, 1992.

[12] Yatsuka Nakamura and Andrzej Trybulec. Adjacency concept for pairs of natural numbers. Formalized Mathematics, 6(1):1–3, 1997.

[13] Yatsuka Nakamura and Andrzej Trybulec. A decomposition of a simple closed curves and the order of their points. Formalized Mathematics, 6(4):563–572, 1997.

[14] Beata Padlewska and Agata Darmochwał. Topological spaces and continuous functions. Formalized Mathematics, 1(1):223–230, 1990.

[15] Wojciech A. Trybulec. Pigeon hole principle. Formalized Mathematics, 1(3):575–579, 1990.

[16] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[17] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[18] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

Initialization Halting Concepts and Their Basic Properties of SCM _{FSA}

Jing-Chao Chen Shanghai Jiaotong University Yatsuka Nakamura Shinshu University Nagano

Summary. Up to now, many properties of macro instructions of SCM _{FSA} are described by the parahalting concepts. However, many practical programs are not always halting while they are halting for initialization states. For this reason, we propose initialization halting concepts. That a program is initialization halting (called ”InitHalting” for short) means it is halting for initialization states.In order to make the halting proof of more complicated programs easy, we present ”InitHalting” basic properties of the compositions of the macro instructions, if-Macro (conditional branch macro instructions) and Times-Macro (for-loop macro instructions) etc.

MML Identifier: SCM HALT.

The terminology and notation used in this paper have been introduced in the following articles: [14], [18], [16], [26], [7], [9], [12], [11], [24], [8], [13], [27], [22], [5], [6], [3], [1], [2], [4], [23], [19], [20], [21], [10], [15], [25], and [17].

1. The Definition of Several Notions Related to Initialization

For simplicity, we adopt the following rules: m is a natural number, I is a macro instruction, s, s_{1}, s_{2} are states of SCM _{FSA}, a is an integer location, and f is a finite sequence location.

Let I be a macro instruction. We say that I is InitClosed if and only if: (Def. 1) For every state s of SCM _{FSA} and for every natural number n such that

Initialized(I) ⊆ s holds IC_{(Computation (s))(n)} ∈ domI. We say that I is InitHalting if and only if:

(Def. 2) Initialized(I) is halting.

We say that I is keepInt0 1 if and only if: (Def. 3) For every state s of SCM _{FSA} such that Initialized(I) ⊆ s and for every

natural number k holds (Computation(s))(k)(intloc(0)) = 1.

2. The Relationship Between Initialization Halting and Unconditional Halting

The following four propositions are true:

(1) For every set x and for all natural numbers i, m, n such that x ∈ dom((intloc(i)⟼→ . m)+·Start-At(insloc(n))) holds x = intloc(i) or x = IC_{SCM _{FSA}} .

(2) For every macro instruction I and for all natural numbers i, m, n holds domI ∩ dom((intloc(i)⟼→ . m)+·Start-At(insloc(n))) = ∅.

(3) Initialized(I) = I+·((intloc(0)⟼→ . 1)+·Start-At(insloc(0))).

(4) Macro(halt_{SCM _{FSA}} ) is InitHalting. Let us mention that there exists a macro instruction which is InitHalting. One can prove the following three propositions:

(5) For every InitHalting macro instruction I such that Initialized(I) ⊆ s holds s is halting.

(6) I+·Start-At(insloc(0)) ⊆ Initialized(I).

(7) For every macro instruction I and for every state s of SCM _{FSA} such that Initialized(I) ⊆ s holds s(intloc(0)) = 1.

Let us mention that every macro instruction which is paraclosed is also InitClosed.

Let us note that every macro instruction which is parahalting is also InitHalting.

One can check the following observations:

∗ every macro instruction which is InitHalting is also InitClosed,

∗ every macro instruction which is keepInt0 1 is also InitClosed, and

∗ every macro instruction which is keeping 0 is also keepInt0 1.

3. The Other Properties of Initialization Halting

One can prove the following two propositions:

(8) Let I be a InitHalting macro instruction and a be a read-write integer location. If a ∉ UsedIntLoc(I), then (IExec(I, s))(a) = s(a).

(9) Let I be a InitHalting macro instruction and f be a finite sequence location. If f ∉ UsedInt^{∗} Loc(I), then (IExec(I, s))(f) = s(f).

Let I be a InitHalting macro instruction. Note that Initialized(I) is halting. Let us observe that every macro instruction which is InitHalting is also non

empty.

The following propositions are true:

(10) For every InitHalting macro instruction I holds domI ≠ ∅.

(11) For every InitHalting macro instruction I holds insloc(0) ∈ domI.

(12) Let J be a InitHalting macro instruction. Suppose Initialized(J) ⊆ s_{1}. Let n be a natural number. Suppose ProgramPart(Relocated(J, n)) ⊆ s_{2} and IC_{(s_{2})} = insloc(n) and s_{1}↾(Int-Locations∪ FinSeq-Locations) = s_{2}↾(Int-Locations∪ FinSeq-Locations). Let i be a natural number. Then IC_{(Computation (s_{1}))(i)} + n = IC_{(Computation (s_{2}))(i)} and IncAddr(CurInstr ((Computation(s_{1}))(i)), n) = CurInstr((Computation(s_{2}))(i)) and (Computation(s_{1}))(i)↾(Int-Locations∪ FinSeq-Locations) = (Computation(s_{2}))(i)↾(Int-Locations∪ FinSeq-Locations).

(13) If Initialized(I) ⊆ s, then I ⊆ s.

(14) Let I be a InitHalting macro instruction. Suppose Initialized(I) ⊆ s_{1} and Initialized(I) ⊆ s_{2} and s_{1} and s_{2} are equal outside the instruction locations of SCM _{FSA}. Let k be a natural number. Then (Computation(s_{1}))(k) and (Computation(s_{2}))(k) are equal outside the instruction locations of SCM _{FSA} and CurInstr((Computation(s_{1}))(k)) = CurInstr((Computation(s_{2}))(k)).

(15) Let I be a InitHalting macro instruction. Suppose Initialized(I) ⊆ s_{1} and Initialized(I) ⊆ s_{2} and s_{1} and s_{2} are equal outside the instruction locations of SCM _{FSA}. Then LifeSpan(s_{1}) = LifeSpan(s_{2}) and Result(s_{1}) and Result(s_{2}) are equal outside the instruction locations of SCM _{FSA}.

(16) Macro(halt_{SCM _{FSA}} ) is keeping 0 and InitHalting.

Let us observe that there exists a macro instruction which is keeping 0 and InitHalting.

One can verify that there exists a macro instruction which is keepInt0 1 and InitHalting.

Next we state several propositions:

(17) For every keepInt0 1 InitHalting macro instruction I holds (IExec(I, s))(intloc(0)) = 1.

(18) Let I be a InitClosed macro instruction and J be a macro instruction. Suppose Initialized(I) ⊆ s and s is halting. Let given m. Suppose m LifeSpan(s). Then (Computation(s))(m) and (Computation(s+·(I;J)))(m) are equal outside the instruction locations of SCM _{FSA}.

(19) For all natural numbers i, m, n holds s+·I+·((intloc(i)⟼→ . m)+·Start-At (insloc(n))) = (s+·((intloc(i)⟼→ . m)+·Start-At(insloc(n))))+·I.

(20) If (intloc(0)⟼→ . 1)+·Start-At(insloc(0)) ⊆ s, then Initialized(I) ⊆ s+·(I+·((intloc(0)⟼→ . 1)+·Start-At(insloc(0)))) and s+·(I+·((intloc(0)⟼→ . 1) +·Start-At(insloc(0)))) = s+·I and s+·(I+·((intloc(0)⟼→ . 1) +·Start-At(insloc(0))))+·Directed(I) = s+·Directed(I).

(21) For every InitClosed macro instruction I such that s+·I is halting and Directed(I) ⊆ s and (intloc(0)⟼→ . 1)+·Start-At(insloc(0)) ⊆ s holds IC_{(Computation (s))(LifeSpan (s+·I)+1)} = insloc(cardI).

(22) Let I be a InitClosed macro instruction. Suppose s+·I is halting and Directed(I) ⊆ s and (intloc(0)⟼→ . 1)+·Start-At(insloc(0)) ⊆ s. Then (Computation(s))(LifeSpan(s+·I))↾(Int-Locations∪ FinSeq-Locations) = (Computation(s))(LifeSpan(s+·I)+1)↾(Int-Locations∪ FinSeq-Locations).

(23) Let I be a InitHalting macro instruction. Suppose Initialized(I) ⊆ s. Let k be a natural number. If k LifeSpan(s), then CurInstr((Computation(s+·Directed(I)))(k)) ≠ halt_{SCM _{FSA}} .

(24) Let I be a InitClosed macro instruction. Suppose s+·Initialized(I) is halting. Let J be a macro instruction and k be a natural number. Suppose k LifeSpan(s+·Initialized(I)). Then (Computation(s+·Initialized(I)))(k) and (Computation(s+·Initialized(I;J)))(k) are equal outside the instruction locations of SCM _{FSA}.

4. The Initialization Halting for Two Continuous Macro-Instructions

One can prove the following proposition

(25) Let I be a keepInt0 1 InitHalting macro instruction, J be a InitHalting macro instruction, and s be a state of SCM _{FSA}. Suppose Initialized(I;J) ⊆ s. Then

(i) IC_{(Computation (s))(LifeSpan (s+·I)+1)} = insloc(cardI), (ii) (Computation(s))(LifeSpan(s+·I)+1)↾(Int-Locations∪ FinSeq-Locations) =

((Computation(s+·I))(LifeSpan(s+·I))+·Initialized(J))↾(Int-Locations∪ FinSeq-Locations),

(iii) ProgramPart(Relocated(J, cardI)) ⊆ (Computation(s))(LifeSpan(s+·I)+

1), (iv) (Computation(s))(LifeSpan(s+·I) + 1)(intloc(0)) = 1,

(v) s is halting, (vi) LifeSpan(s) = LifeSpan(s+·I)+1+LifeSpan(Result(s+·I)+·Initialized(J)),

and (vii) if J is keeping 0, then (Result(s))(intloc(0)) = 1.

Let I be a keepInt0 1 InitHalting macro instruction and let J be a InitHalting macro instruction. Note that I;J is InitHalting.

Next we state four propositions:

(26) Let I be a keepInt0 1 macro instruction. Suppose s+·I is halting. Let J be a InitClosed macro instruction. Suppose Initialized(I;J) ⊆ s. Let k be a natural number. Then (Computation(Result(s+·I)+·Initialized(J)))(k) +·Start-At(IC_{(Computation (Result(s+·I)+·Initialized (J)))(k)} + cardI) and (Computation(s+·(I;J)))(LifeSpan(s+·I) + 1 + k) are equal outside the instruction locations of SCM _{FSA}.

(27) Let I be a keepInt0 1 macro instruction. Suppose s+·Initialized(I) is not halting. Let J be a macro instruction and k be a natural number. Then (Computation(s+·Initialized(I)))(k) and (Computation(s+·Initialized (I;J)))(k) are equal outside the instruction locations of SCM _{FSA}.

(28) Let I be a keepInt0 1 InitHalting macro instruction and J be a InitHalting macro instruction. Then LifeSpan(s+·Initialized(I;J)) = LifeSpan(s+·Initialized(I)) + 1 + LifeSpan(Result(s+·Initialized(I)) +·Initialized(J)).

(29) Let I be a keepInt0 1 InitHalting macro instruction and J be a InitHalting macro instruction. Then IExec(I;J, s) = IExec(J, IExec(I, s)) +·Start-At(IC_{IExec(J,IExec(I,s))} + cardI).

Let i be a parahalting instruction of SCM _{FSA}. Observe that Macro(i) is InitHalting.

Let i be a parahalting instruction of SCM _{FSA} and let J be a parahalting macro instruction. Observe that i;J is InitHalting.

Let i be a keeping 0 parahalting instruction of SCM _{FSA} and let J be a InitHalting macro instruction. Note that i;J is InitHalting.

Let I, J be keepInt0 1 macro instructions. One can verify that I;J is keepInt0 1.

Let j be a keeping 0 parahalting instruction of SCM _{FSA} and let I be a keepInt0 1 InitHalting macro instruction. One can check that I;j is InitHalting and keepInt0 1.

Let i be a keeping 0 parahalting instruction of SCM _{FSA} and let J be a keepInt0 1 InitHalting macro instruction. Observe that i;J is InitHalting and keepInt0 1.

Let j be a parahalting instruction of SCM _{FSA} and let I be a parahalting macro instruction. One can check that I;j is InitHalting.

Let i, j be parahalting instructions of SCM _{FSA}. One can check that i;j is InitHalting.

Next we state several propositions:

(30) Let I be a keepInt0 1 InitHalting macro instruction and J be a InitHalting macro instruction. Then (IExec(I;J, s))(a) =

(IExec(J, IExec(I, s)))(a).

(31) Let I be a keepInt0 1 InitHalting macro instruction and J be a InitHalting macro instruction. Then (IExec(I;J, s))(f) = (IExec(J, IExec(I, s)))(f).

(32) For every keepInt0 1 InitHalting macro instruction I and for every state s of SCM _{FSA} holds Initialize(IExec(I, s))↾(Int-Locations∪ FinSeq-Locations) = IExec(I, s)↾(Int-Locations∪ FinSeq-Locations).

(33) Let I be a keepInt0 1 InitHalting macro instruction and j be a parahalting instruction of SCM _{FSA}. Then (IExec(I;j, s))(a) = (Exec(j, IExec(I, s)))(a).

(34) Let I be a keepInt0 1 InitHalting macro instruction and j be a parahalting instruction of SCM _{FSA}. Then (IExec(I;j, s))(f) = (Exec(j, IExec(I, s)))(f).

Let I be a macro instruction and let s be a state of SCM _{FSA}. We say that I is closed onInit s if and only if:

(Def. 4) For every natural number k holds IC_{(Computation (s+·Initialized (I)))(k)} ∈

domI. We say that I is halting onInit s if and only if:

(Def. 5) s+·Initialized(I) is halting.

We now state three propositions:

(35) Let I be a macro instruction. Then I is InitClosed if and only if for every state s of SCM _{FSA} holds I is closed onInit s.

(36) Let I be a macro instruction. Then I is InitHalting if and only if for every state s of SCM _{FSA} holds I is halting onInit s.

(37) Let s be a state of SCM _{FSA}, I be a macro instruction, and a be an integer location. Suppose I does not destroy a and I is closed onInit s and Initialized(I) ⊆ s. Let k be a natural number. Then (Computation(s))(k)(a) = s(a).

Let us observe that there exists a macro instruction which is InitHalting and good.

Let us observe that every macro instruction which is InitClosed and good is also keepInt0 1.

Let us mention that Stop_{SCM_{FSA}} is InitHalting and good. We now state several propositions:

(38) Let s be a state of SCM _{FSA}, i be a keeping 0 parahalting instruction of SCM _{FSA}, J be a InitHalting macro instruction, and a be an integer location. Then (IExec(i;J, s))(a) = (IExec(J, Exec(i, Initialize(s))))(a).

(39) Let s be a state of SCM _{FSA}, i be a keeping 0 parahalting instruction of SCM _{FSA}, J be a InitHalting macro instruction, and f be a finite sequence location. Then (IExec(i;J, s))(f) = (IExec(J, Exec(i, Initialize(s))))(f).

(40) Let s be a state of SCM _{FSA} and I be a macro instruction. Then I is closed onInit s if and only if I is closed on Initialize(s).

(41) Let s be a state of SCM _{FSA} and I be a macro instruction. Then I is halting onInit s if and only if I is halting on Initialize(s).

(42) For every macro instruction I and for every state s of SCM _{FSA} holds IExec(I, s) = IExec(I, Initialize(s)).

5. IF-Programs with Initialization Halting

The following propositions are true:

(43) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) = 0 and I is closed onInit s and I is halting onInit s. Then if a = 0 then I else J is closed onInit s and if a = 0 then I else J is halting onInit s.

(44) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) = 0 and I is closed onInit s and I is halting onInit s. Then IExec(if a = 0 then I else J, s) = IExec(I, s)+·Start-At(insloc(cardI + cardJ + 3)).

(45) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) ≠ 0 and J is closed onInit s and J is halting onInit s. Then if a = 0 then I else J is closed onInit s and if a = 0 then I else J is halting onInit s.

(46) Let I, J be macro instructions, a be a read-write integer location, and s be a state of SCM _{FSA}. Suppose s(a) ≠ 0 and J is closed onInit s and J is halting onInit s. Then IExec(if a = 0 then I else J, s) = IExec(J, s)+·Start-At(insloc(cardI + cardJ + 3)).

(47) Let s be a state of SCM _{FSA}, I, J be InitHalting macro instructions, and a be a read-write integer location. Then if a = 0 then I else J is InitHalting and if s(a) = 0, then IExec(if a = 0 then I else J, s) = IExec(I, s)+·Start-At(insloc(cardI + cardJ + 3)) and if s(a) ≠ 0, then IExec(if a = 0 then I else J, s) = IExec(J, s)+·Start-At(insloc(cardI + cardJ + 3)).

(48) Let s be a state of SCM _{FSA}, I, J be InitHalting macro instructions,

and a be a read-write integer location. Then

(i) IC_{IExec(if a=0 then I else J,s)} = insloc(cardI + cardJ + 3), (ii) if s(a) = 0, then for every integer location d holds (IExec(if a =

0 then I else J, s))(d) = (IExec(I, s))(d) and for every finite sequence location f holds (IExec(if a = 0 then I else J, s))(f) = (IExec(I, s))(f), and (iii) if s(a) ≠ 0, then for every integer location d holds (IExec(if a =

0 then I else J, s))(d) = (IExec(J, s))(d) and for every finite sequence location f holds (IExec(if a = 0 then I else J, s))(f) = (IExec(J, s))(f).

(49) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) > 0 and I is closed onInit s and I is halting onInit s. Then if a > 0 then I else J is closed onInit s and if a > 0 then I else J is halting onInit s.

(50) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) > 0 and I is closed onInit s and I is halting onInit s. Then IExec(if a > 0 then I else J, s) = IExec(I, s)+·Start-At(insloc(cardI + cardJ + 3)).

(51) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) 0 and J is closed onInit s and J is halting onInit s. Then if a > 0 then I else J is closed onInit s and if a > 0 then I else J is halting onInit s.

(52) Let I, J be macro instructions, a be a read-write integer location, and s be a state of SCM _{FSA}. Suppose s(a) 0 and J is closed onInit s and J is halting onInit s. Then IExec(if a > 0 then I else J, s) = IExec(J, s)+·Start-At(insloc(cardI + cardJ + 3)).

(53) Let s be a state of SCM _{FSA}, I, J be InitHalting macro instructions, and a be a read-write integer location. Then if a > 0 then I else J is InitHalting and if s(a) > 0, then IExec(if a > 0 then I else J, s) = IExec(I, s)+·Start-At(insloc(cardI + cardJ + 3)) and if s(a) 0, then IExec(if a > 0 then I else J, s) = IExec(J, s)+·Start-At(insloc(cardI + cardJ + 3)).

(54) Let s be a state of SCM _{FSA}, I, J be InitHalting macro instructions,

and a be a read-write integer location. Then

(i) IC_{IExec(if a>0 then I else J,s)} = insloc(cardI + cardJ + 3), (ii) if s(a) > 0, then for every integer location d holds (IExec(if a >

0 then I else J, s))(d) = (IExec(I, s))(d) and for every finite sequence location f holds (IExec(if a > 0 then I else J, s))(f) = (IExec(I, s))(f), and

(iii) if s(a) 0, then for every integer location d holds (IExec(if a > 0 then I else J, s))(d) = (IExec(J, s))(d) and for every finite sequence location f holds (IExec(if a > 0 then I else J, s))(f) = (IExec(J, s))(f).

(55) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) < 0 and I is closed onInit s and I is halting onInit s. Then IExec(if a < 0 then I else J, s) = IExec(I, s)+·Start-At(insloc(cardI + cardJ + cardJ + 7)).

(56) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) = 0 and J is closed onInit s and J is halting onInit s. Then IExec(if a < 0 then I else J, s) = IExec(J, s)+·Start-At(insloc(cardI + cardJ + cardJ + 7)).

(57) Let s be a state of SCM _{FSA}, I, J be macro instructions, and a be a read-write integer location. Suppose s(a) > 0 and J is closed onInit s and J is halting onInit s. Then IExec(if a < 0 then I else J, s) = IExec(J, s)+·Start-At(insloc(cardI + cardJ + cardJ + 7)).

(58) Let s be a state of SCM _{FSA}, I, J be InitHalting macro instructions,

and a be a read-write integer location. Then

(i) if a < 0 then I else J is InitHalting, (ii) if s(a) < 0, then IExec(if a < 0 then I else J, s) =

IExec(I, s)+·Start-At(insloc(cardI + cardJ + cardJ + 7)), and (iii) if s(a) 0, then IExec(if a < 0 then I else J, s) =

IExec(J, s)+·Start-At(insloc(cardI + cardJ + cardJ + 7)). Let I, J be InitHalting macro instructions and let a be a read-write integer

location. One can verify the following observations: ∗ if a = 0 then I else J is InitHalting,

∗ if a > 0 then I else J is InitHalting, and

∗ if a < 0 then I else J is InitHalting. Next we state a number of propositions:

(59) For every macro instruction I holds I is InitHalting iff for every state s of SCM _{FSA} holds I is halting on Initialize(s).

(60) For every macro instruction I holds I is InitClosed iff for every state s of SCM _{FSA} holds I is closed on Initialize(s).

(61) Let s be a state of SCM _{FSA}, I be a InitHalting macro instruction, and a be a read-write integer location. Then (IExec(I, s))(a) = (Computation(Initialize(s)+·(I+·Start-At(insloc(0))))) (LifeSpan(Initialize(s)+·(I+·Start-At(insloc(0)))))(a).

(62) Let s be a state of SCM _{FSA}, I be a InitHalting macro instruction, a be an integer location, and k be a natural number. If I does not destroy a, then (IExec(I, s))(a) = (Computation(Initialize(s)+·(I+·Start-At(insloc(0)))))(k)(a).

(63) Let s be a state of SCM _{FSA}, I be a InitHalting macro instruction, and a be an integer location. If I does not destroy a, then (IExec(I, s))(a) = (Initialize(s))(a).

(64) Let s be a state of SCM _{FSA}, I be a keepInt0 1 InitHalting macro instruction, and a be a read-write integer location. Suppose I does not destroy a. Then (Computation(Initialize(s)+·((I;SubFrom(a, intloc(0))) +·Start-At(insloc(0)))))(LifeSpan(Initialize(s)+·((I;SubFrom(a, intloc(0))) +·Start-At(insloc(0)))))(a) = s(a) − 1.

(65) Let s be a state of SCM _{FSA} and I be a InitClosed macro instruction. Suppose Initialized(I) ⊆ s and s is halting. Let m be a natural number. Suppose m LifeSpan(s). Then (Computation(s))(m) and (Computation(s+·loopI))(m) are equal outside the instruction locations of SCM _{FSA}.

(66) Let s be a state of SCM _{FSA} and I be a InitHalting macro instruction. Suppose Initialized(I) ⊆ s. Let k be a natural number. If k LifeSpan(s), then CurInstr((Computation(s+·loopI))(k)) ≠ halt_{SCM _{FSA}} .

(67) I ⊆ s+·Initialized(I).

(68) Let s be a state of SCM _{FSA} and I be a macro instruction. Suppose I is closed onInit s and I is halting onInit s. Let m be a natural number. Suppose m LifeSpan(s+·Initialized(I)). Then (Computation(s+·Initialized(I)))(m) and (Computation(s+·Initialized (loopI)))(m) are equal outside the instruction locations of SCM _{FSA}.

(69) Let s be a state of SCM _{FSA} and I be a macro instruction. Suppose I is closed onInit s and I is halting onInit s. Let m be a natural number. If m < LifeSpan(s+·Initialized(I)), then CurInstr((Computation(s+·Initialized(I)))(m)) = CurInstr((Computation(s+·Initialized(loopI)))(m)).

(70) For every instruction-location l of SCM _{FSA} holds l ∉ dom((intloc(0)⟼→ . 1) +·Start-At(insloc(0))).

(71) Let s be a state of SCM _{FSA} and I be a macro instruction. Suppose I is closed onInit s and I is halting onInit s. Then CurInstr((Computation(s+·Initialized(loopI))) (LifeSpan(s+·Initialized(I)))) = goto insloc(0) and for every natural number m such that m LifeSpan(s+·Initialized(I)) holds CurInstr((Computation(s+·Initialized(loopI)))(m)) ≠ halt_{SCM _{FSA}} .

(72) Let s be a state of SCM _{FSA} and I be a macro instruction. Suppose I is closed onInit s and I is halting onInit s. Then CurInstr((Computation(s+·Initialized(loopI)))(LifeSpan (s+·Initialized(I)))) = goto insloc(0).

(73) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, and a be a read-write integer location. Suppose I does not destroy a and s(intloc(0)) = 1 and s(a) > 0. Then loopif a = 0 then Goto(insloc(2)) else (I;SubFrom(a, intloc(0))) is pseudo-closed on s.

(74) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, and a be a read-write integer location. Suppose I does not destroy a and s(a) > 0. Then Initialized(loopif a = 0 then Goto(insloc(2)) else (I;SubFrom(a, intloc(0)))) is pseudo-closed on s.

6. LOOP-Programs with Initialization Halting

We now state two propositions:

(75) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, and a be a read-write integer location. Suppose I does not destroy a and s(intloc(0)) = 1. Then Times(a, I) is closed on s and Times(a, I) is halting on s.

(76) Let I be a good InitHalting macro instruction and a be a read-write integer location. If I does not destroy a, then Initialized(Times(a, I)) is halting.

Let a be a read-write integer location and let I be a good macro instruction. Observe that Times(a, I) is good.

Next we state several propositions:

(77) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, and a be a read-write integer location. Suppose I does not destroy a and s(intloc(0)) = 1 and s(a) > 0. Then there exists a state s_{2} of SCM _{FSA} and there exists a natural number k such that

(i) s_{2} = s+·Initialized(loopif a = 0 then Goto(insloc(2)) else (I;SubFrom(a, intloc(0)))),

(ii) k = LifeSpan(s+·Initialized(if a = 0 then Goto(insloc(2))

else (I;SubFrom(a, intloc(0))))) + 1, (iii) (Computation(s_{2}))(k)(a) = s(a) − 1, (iv) (Computation(s_{2}))(k)(intloc(0)) = 1,

(v) for every read-write integer location b such that b ≠ a holds (Computation(s_{2}))(k)(b) = (IExec(I, s))(b),

(vi) for every finite sequence location f holds (Computation(s_{2}))(k)(f) =

(IExec(I, s))(f), (vii) IC_{(Computation (s_{2}))(k)} = insloc(0), and (viii) for every natural number n such that n k holds

IC_{(Computation (s_{2}))(n)} ∈ domloopif a = 0 then Goto(insloc(2)) else (I;SubFrom(a, intloc(0))).

(78) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, and a be a read-write integer location. If s(intloc(0)) = 1 and s(a) 0, then IExec(Times(a, I), s)↾(Int-Locations∪ FinSeq-Locations) = s↾(Int-Locations∪ FinSeq-Locations).

(79) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, and a be a read-write integer location. Suppose I does not destroy a and s(a) > 0. Then (IExec(I;SubFrom(a, intloc(0)), s))(a) = s(a) − 1 and IExec(Times(a, I), s)↾(Int-Locations∪ FinSeq-Locations) = IExec(Times(a, I), IExec(I;SubFrom(a, intloc(0)), s))↾(Int-Locations∪ FinSeq-Locations).

(80) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, f be a finite sequence location, and a be a read-write integer location. If s(a) 0, then (IExec(Times(a, I), s))(f) = s(f).

(81) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, b be an integer location, and a be a read-write integer location. If s(a) 0, then (IExec(Times(a, I), s))(b) = (Initialize(s))(b).

(82) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, f be a finite sequence location, and a be a read-write integer location. If I does not destroy a and s(a) > 0, then (IExec(Times(a, I), s))(f) = (IExec(Times(a, I), IExec(I;SubFrom(a, intloc(0)), s)))(f).

(83) Let s be a state of SCM _{FSA}, I be a good InitHalting macro instruction, b be an integer location, and a be a read-write integer location. If I does not destroy a and s(a) > 0, then (IExec(Times(a, I), s))(b) = (IExec(Times(a, I), IExec(I;SubFrom(a, intloc(0)), s)))(b).

Let i be an instruction of SCM _{FSA}. We say that i is good if and only if: (Def. 6) i does not destroy intloc(0).

Let us observe that there exists an instruction of SCM _{FSA} which is parahalting and good.

Let i be a good instruction of SCM _{FSA} and let J be a good macro instruction. Observe that i;J is good and J;i is good.

Let i, j be good instructions of SCM _{FSA}. Note that i;j is good. Let a be a read-write integer location and let b be an integer location. Ob-

serve that a:=b is good and SubFrom(a, b) is good.

Let a be a read-write integer location, let b be an integer location, and let f be a finite sequence location. Observe that a:=f_{b} is good.

Let a, b be integer locations and let f be a finite sequence location. One can check that f_{a}:=b is good.

Let a be a read-write integer location and let f be a finite sequence location. One can verify that a:=lenf is good.

Let n be a natural number. One can check that intloc(n + 1) is read-write.

References

[1] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part I. Formalized Mathematics, 6(1):65–72, 1997.

[2] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):73–80, 1997.

[3] Noriko Asamoto. Constant assignment macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):59–63, 1997.

[4] Noriko Asamoto. The loop and Times macroinstruction for SCM _{FSA} . Formalized Mathematics, 6(4):483–497, 1997.

initialization halting concepts and their … 149

[5] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part II. Formalized Mathematics, 6(1):41–47, 1997.

[6] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part III. Formalized Mathematics, 6(1):53–57, 1997.

[7] Grzegorz Bancerek. Cardinal numbers. Formalized Mathematics, 1(2):377–382, 1990.

[8] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[9] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[10] Grzegorz Bancerek and Piotr Rudnicki. Development of terminology for scm. Formalized Mathematics, 4(1):61–67, 1993.

[11] Grzegorz Bancerek and Andrzej Trybulec. Miscellaneous facts about functions. Formalized Mathematics, 5(4):485–492, 1996.

[12] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[13] Krzysztof Hryniewiecki. Basic properties of real numbers. Formalized Mathematics, 1(1):35–40, 1990.

[14] Yatsuka Nakamura and Andrzej Trybulec. A mathematical model of CPU. Formalized Mathematics, 3(2):151–160, 1992.

[15] Piotr Rudnicki and Andrzej Trybulec. Memory handling for SCM _{FSA} . Formalized Mathematics, 6(1):29–36, 1997.

[16] Yasushi Tanaka. On the decomposition of the states of SCM. Formalized Mathematics, 5(1):1–8, 1996.

[17] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[18] Andrzej Trybulec and Yatsuka Nakamura. Some remarks on the simple concrete model of computer. Formalized Mathematics, 4(1):51–56, 1993.

[19] Andrzej Trybulec and Yatsuka Nakamura. Computation in SCM _{FSA} . Formalized Mathematics, 5(4):537–542, 1996.

[20] Andrzej Trybulec and Yatsuka Nakamura. Modifying addresses of instructions of SCM _{FSA} . Formalized Mathematics, 5(4):571–576, 1996.

[21] Andrzej Trybulec and Yatsuka Nakamura. Relocability for SCM _{FSA} . Formalized Mathematics, 5(4):583–586, 1996.

[22] Andrzej Trybulec, Yatsuka Nakamura, and Noriko Asamoto. On the compositions of macro instructions. Part I. Formalized Mathematics, 6(1):21–27, 1997.

[23] Andrzej Trybulec, Yatsuka Nakamura, and Piotr Rudnicki. The SCM _{FSA} computer. Formalized Mathematics, 5(4):519–528, 1996.

[24] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[25] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[26] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[27] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

150 jing-chao chen and yatsuka nakamura

Bubble Sort on SCM _{FSA}

Jing-Chao Chen Shanghai Jiaotong University Yatsuka Nakamura Shinshu University Nagano

Summary. We present the bubble sorting algorithm using macro instructions such as the if-Macro (conditional branch macro instructions) and the Times-Macro (for-loop macro instructions) etc. The correctness proof of the program should include the proof of autonomic, halting and the correctness of the program result. In the three terms, we justify rigorously the correctness of the bubble sorting algorithm. In order to prove it is autonomic, we use the following theorem: if all variables used by the program are initialized, it is autonomic. This justification method probably reveals that autonomic concept is not important.

MML Identifier: SCMBSORT.

The articles [18], [24], [21], [19], [31], [7], [9], [12], [22], [10], [13], [29], [14], [15], [11], [28], [8], [32], [17], [26], [5], [6], [3], [1], [2], [4], [27], [25], [16], [20], [30], and [23] provide the terminology and notation for this paper.

1. Preliminaries

For simplicity, we adopt the following rules: p is a programmed finite partial state of SCM _{FSA}, i_{1} is an instruction of SCM _{FSA}, i, j, k are natural numbers, f_{1}, f are finite sequence locations, a, b, d_{1}, d_{2} are integer locations, l, l_{1} are instructions-locations of SCM _{FSA}, and s_{1} is a state of SCM _{FSA}.

We now state a number of propositions:

(1) Let I, J be macro instructions and a, b be integer locations. Suppose I does not destroy b and J does not destroy b. Then if a > 0 then I else J does not destroy b.

(2) Let I, J be macro instructions and a, b be integer locations. Suppose I does not destroy b and J does not destroy b. Then if a = 0 then I else J does not destroy b.

(3) Let I be a macro instruction and a, b be integer locations. If I does not destroy b and a ≠ b, then Times(a, I) does not destroy b.

(4) For every function f and for all sets n, m holds (f+·(n⟼→ . m)+·(m⟼→ . n))(m) = n.

(5) For every function f and for all sets n, m holds (f+·(n⟼→ . m)+·(m⟼→ . n))(n) = m.

(6) For every function f and for all sets n, m, x such that x ∈ domf and x ≠ m and x ≠ n holds (f+·(n⟼→ . m)+·(m⟼→ . n))(x) = f(x).

(7) Let f, g be functions and m, n be sets. Suppose that

(i) f(m) = g(n), (ii) f(n) = g(m), (iii) m ∈ domf, (iv) n ∈ domf,

(v) domf = domg, and (vi) for every set k such that k ≠ m and k ≠ n and k ∈ domf holds

f(k) = g(k). Then f and g are fiberwise equipotent.

(8) Let s be a state of SCM _{FSA}, f be a finite sequence location, and a, b be integer locations. Then (Exec(b:=f_{a}, s))(b) = π_{|s(a)|}s(f).

(9) Let s be a state of SCM _{FSA}, f be a finite sequence location, and a, b be integer locations. Then (Exec(f_{a}:=b, s))(f) = s(f) +·(|s(a)|, s(b)).

(10) Let s be a state of SCM _{FSA}, f be a finite sequence location, m, n be natural numbers, and a be an integer location. If m ≠ n + 1, then (Exec(intloc(m):=f_{a}, Initialize(s)))(intloc(n + 1)) = s(intloc(n + 1)).

(11) Let s be a state of SCM _{FSA}, m, n be natural numbers, and a be an integer location. If m ≠ n+1, then (Exec(intloc(m):=a, Initialize(s)))(intloc(n+ 1)) = s(intloc(n + 1)).

(12) Let s be a state of SCM _{FSA}, f be a finite sequence location, and a be a read-write integer location. Then (IExec(Stop_{SCM_{FSA}} , s))(a) = s(a) and (IExec(Stop_{SCM_{FSA}} , s))(f) = s(f).

In the sequel n denotes a natural number. One can prove the following propositions:

(13) If n 10, then n = 0 or n = 1 or n = 2 or n = 3 or n = 4 or n = 5 or n = 6 or n = 7 or n = 8 or n = 9 or n = 10.

(14) Suppose n 12. Then n = 0 or n = 1 or n = 2 or n = 3 or n = 4 or n = 5 or n = 6 or n = 7 or n = 8 or n = 9 or n = 10 or n = 11 or n = 12.

(15) Let f, g be functions and X be a set. If domf = domg and for every set x such that x ∈ X holds f(x) = g(x), then f↾X = g↾X.

(16) If i_{1} ∈ rngp and if i_{1} = a:=b or i_{1} = AddTo(a, b) or i_{1} = SubFrom(a, b) or i_{1} = MultBy(a, b) or i_{1} = Divide(a, b), then a ∈ UsedIntLoc(p) and b ∈ UsedIntLoc(p).

(17) If i_{1} ∈ rngp and if i_{1} = if a = 0 goto l_{1} or i_{1} = if a > 0 goto l_{1}, then a ∈ UsedIntLoc(p).

(18) If i_{1} ∈ rngp and if i_{1} = b:=f_{1}_{a} or i_{1} = f_{1}_{a}:=b, then a ∈ UsedIntLoc(p) and b ∈ UsedIntLoc(p).

(19) If i_{1} ∈ rngp and if i_{1} = b:=f_{1}_{a} or i_{1} = f_{1}_{a}:=b, then f_{1} ∈ UsedInt^{∗} Loc(p).

(20) If i_{1} ∈ rngp and if i_{1} = a:=lenf_{1} or i_{1} = f_{1}:=⟨\underbrace{0, …, 0}_{a}⟩, then a ∈

UsedIntLoc(p).

(21) If i_{1} ∈ rngp and if i_{1} = a:=lenf_{1} or i_{1} = f_{1}:=⟨\underbrace{0, …, 0}_{a}⟩, then f_{1} ∈

UsedInt^{∗} Loc(p).

(22) Let p be a macro instruction, s_{2}, s_{3} be states of SCM _{FSA}, and given i. If p ⊆ s_{2} and p ⊆ s_{3}, then (Computation(s_{2}))(i)↾ domp = (Computation(s_{3}))(i)↾ domp.

(23) Let t be a finite partial state of SCM _{FSA}, p be a macro instruction, and x be a set. Suppose domt ⊆ Int-Locations∪ FinSeq-Locations and x ∈ domt∪UsedInt^{∗} Loc(p)∪UsedIntLoc(p). Then x is an integer location or a finite sequence location.

(24) For every f_{1} holds (Exec(Divide(d_{1}, d_{2}), s_{1}))(f_{1}) = s_{1}(f_{1}) and (Exec(Divide(d_{1}, d_{2}), s_{1}))(IC_{SCM _{FSA}} ) = Next(IC_{(s_{1})}).

(25) Let i, k be natural numbers, t be a finite partial state of SCM _{FSA}, p be

a macro instruction, and s_{2}, s_{3} be states of SCM _{FSA}. Suppose that

(i) k i, (ii) p ⊆ s_{2}, (iii) p ⊆ s_{3}, (iv) domt ⊆ Int-Locations∪ FinSeq-Locations,

(v) for every j holds IC_{(Computation (s_{2}))(j)} ∈ domp and IC_{(Computation (s_{3}))(j)} ∈ domp,

(vi) (Computation(s_{2}))(k)(IC_{SCM _{FSA}} ) = (Computation(s_{3}))(k)(IC_{SCM _{FSA}} ),

and (vii) (Computation(s_{2}))(k)↾(domt ∪ UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)) =

(Computation(s_{3}))(k)↾(domt ∪ UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)). Then (Computation(s_{2}))(i)(IC_{SCM _{FSA}} ) = (Computation(s_{3}))(i)(IC_{SCM _{FSA}} ) and (Computation(s_{2}))(i)↾(domt ∪ UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)) = (Computation(s_{3}))(i)↾(domt ∪ UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)).

(26) Let i, k be natural numbers, p be a macro instruction, and s_{2}, s_{3} be states of SCM _{FSA}. Suppose k i and p ⊆ s_{2} and p ⊆ s_{3} and for every j holds IC_{(Computation (s_{2}))(j)} ∈ domp and IC_{(Computation (s_{3}))(j)} ∈ domp and (Computation(s_{2}))(k)(IC_{SCM _{FSA}} ) = (Computation(s_{3}))(k)(IC_{SCM _{FSA}} ) and (Computation(s_{2}))(k)↾(UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)) = (Computation(s_{3}))(k)↾(UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)). Then (Computation(s_{2}))(i)(IC_{SCM _{FSA}} ) = (Computation(s_{3}))(i)(IC_{SCM _{FSA}} ) and (Computation(s_{2}))(i)↾(UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)) = (Computation(s_{3}))(i)↾(UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p)).

(27) UsedIntLoc(Stop_{SCM_{FSA}} ) = ∅.

(28) UsedIntLoc(Goto(l)) = ∅.

(29) For all macro instructions I, J and for every integer location a holds UsedIntLoc(if a = 0 then I else J) = {a} ∪ UsedIntLoc(I) ∪ UsedIntLoc(J) and UsedIntLoc(if a > 0 then I else J) = {a} ∪ UsedIntLoc(I) ∪ UsedIntLoc(J).

(30) For every macro instruction I and for every instruction-location l of SCM _{FSA} holds UsedIntLoc(Directed(I, l)) = UsedIntLoc(I).

(31) For every integer location a and for every macro instruction I holds UsedIntLoc(Times(a, I)) = UsedIntLoc(I) ∪ {a, intloc(0)}.

(32) For all sets x_{1}, x_{2}, x_{3} holds {x_{2}, x_{1}} ∪ {x_{3}, x_{1}} = {x_{1}, x_{2}, x_{3}}.

(33) UsedInt^{∗} Loc(Stop_{SCM_{FSA}} ) = ∅.

(34) UsedInt^{∗} Loc(Goto(l)) = ∅.

(35) For all macro instructions I, J and for every integer location a holds UsedInt^{∗} Loc(if a = 0 then I else J) = UsedInt^{∗} Loc(I) ∪ UsedInt^{∗} Loc(J) and UsedInt^{∗} Loc(if a > 0 then I else J) = UsedInt^{∗} Loc(I) ∪ UsedInt^{∗} Loc(J).

(36) For every macro instruction I and for every instruction-location l of SCM _{FSA} holds UsedInt^{∗} Loc(Directed(I, l)) = UsedInt^{∗} Loc(I).

(37) For every integer location a and for every macro instruction I holds

UsedInt^{∗} Loc(Times(a, I)) = UsedInt^{∗} Loc(I). Let f be a finite sequence location and let t be a finite sequence of elements

of ℤ. Then f⟼→ . t is a finite partial state of SCM _{FSA}.

One can prove the following propositions:

(38) Every finite sequence of elements of ℤ is a finite sequence of elements of ℝ.

(39) Let t be a finite sequence of elements of ℤ. Then there exists a finite sequence u of elements of ℝ such that t and u are fiberwise equipotent and u is a finite sequence of elements of ℤ and non-increasing.

(40) dom((intloc(0)⟼→ . 1)+·Start-At(insloc(0))) = {intloc(0), IC_{SCM _{FSA}} }.

(41) For every macro instruction I holds domInitialized(I) = domI ∪ {intloc(0), IC_{SCM _{FSA}} }.

(42) Let w be a finite sequence of elements of ℤ, f be a finite sequence location, and I be a macro instruction. Then dom(Initialized(I)+·(f⟼→ . w)) = domI ∪ {intloc(0), IC_{SCM _{FSA}} , f}.

(43) For every instruction-location l of SCM _{FSA} holds IC_{SCM _{FSA}} ≠ l.

(44) For every integer location a and for every macro instruction I holds cardTimes(a, I) = cardI + 12.

(45) For all instructions i_{2}, i_{3}, i_{4} of SCM _{FSA} holds card(i_{2};i_{3};i_{4}) = 6, where i_{2} = b_{4}:=b_{3}, b_{4} = intloc(3 + 1), b_{3} = intloc(2 + 1), i_{3} = SubFrom(b_{3}, a_{0}), a_{0} = intloc(0), i_{4} = b_{5}:=f_{0}_{b_{3}}, b_{5} = intloc(4 + 1), and f_{0} = fsloc(0).

(46) Let t be a finite sequence of elements of ℤ, f be a finite sequence location, and I be a macro instruction. Then domInitialized(I) ∩ dom(f⟼→ . t) = ∅.

(47) Let w be a finite sequence of elements of ℤ, f be a finite sequence location, and I be a macro instruction. Then Initialized(I)+·(f⟼→ . w) starts at insloc(0).

(48) Let I, J be macro instructions, k be a natural number, and i be an instruction of SCM _{FSA}. If k < cardJ and i = J(insloc(k)), then (I;J)(insloc(cardI + k)) = IncAddr(i, cardI).

(49) Suppose that (i) i_{1} = a:=b, or (ii) i_{1} = AddTo(a, b), or (iii) i_{1} = SubFrom(a, b), or (iv) i_{1} = MultBy(a, b), or

(v) i_{1} = Divide(a, b), or (vi) i_{1} = goto l_{1}, or (vii) i_{1} = if a = 0 goto l_{1}, or (viii) i_{1} = if a > 0 goto l_{1}, or (ix) i_{1} = b:=f_{a}, or

(x) i_{1} = f_{a}:=b, or (xi) i_{1} = a:=lenf, or

(xii) i_{1} = f:=⟨\underbrace{0, …, 0}_{a}⟩.

Then i_{1} ≠ halt_{SCM _{FSA}} .

(50) Let I, J be macro instructions, k be a natural number, and i be an instruction of SCM _{FSA}. Suppose for every natural number n holds IncAddr(i, n) = i and i ≠ halt_{SCM _{FSA}} and k = cardI. Then (I;i;J)(insloc(k)) = i and (I;i;J)(insloc(k + 1)) = goto insloc(cardI + 2).

(51) Let I, J be macro instructions and k be a natural number. If k = cardI, then (I;(a:=b);J)(insloc(k)) = a:=b and (I;(a:=b);J)(insloc(k + 1)) =

goto insloc(cardI + 2).

(52) Let I, J be macro instructions and k be a natural number. If k = cardI, then (I;(a:=lenf);J)(insloc(k)) = a:=lenf and (I;(a:=lenf);J)(insloc(k + 1)) = goto insloc(cardI + 2).

(53) Let w be a finite sequence of elements of ℤ, f be a finite sequence location, s be a state of SCM _{FSA}, and I be a macro instruction. If Initialized(I)+·(f⟼→ . w) ⊆ s, then I ⊆ s.

(54) Let w be a finite sequence of elements of ℤ, f be a finite sequence location, s be a state of SCM _{FSA}, and I be a macro instruction. If Initialized(I)+·(f⟼→ . w) ⊆ s, then s(f) = w and s(intloc(0)) = 1.

(55) For every finite sequence location f and for every integer location a and for every state s of SCM _{FSA} holds {a, IC_{SCM _{FSA}} , f} ⊆ doms.

(56) For every macro instruction p and for every state s of SCM _{FSA} holds UsedInt^{∗} Loc(p) ∪ UsedIntLoc(p) ⊆ doms.

(57) Let s be a state of SCM _{FSA}, I be a macro instruction, and f be a finite sequence location. Then (Result(s+·Initialized(I)))(f) = (IExec(I, s))(f).

2. The Program Code for Buble Sort

Let f be a finite sequence location. The functor bubble-sort(f) yields a macro instruction and is defined as follows:

(Def. 1) bubble-sort(f) = i_{5}; (a_{1}:=lenf); Times(a_{1}, (a_{2}:=a_{1}); SubFrom(a_{2}, a_{0}); (a_{3}:=lenf); Times(a_{2}, (a_{4}:=a_{3}); SubFrom(a_{3}, a_{0}); (a_{5}:=f_{a_{3}}); (a_{6}:=f_{a_{4}}); SubFrom(a_{6}, a_{5}); (if a_{6} > 0 then (a_{6}:=f_{a_{4}});(f_{a_{3}}:=a_{6});(f_{a_{4}}:=a_{5}) else (Stop_{SCM_{FSA}} )))), where i_{5} = (a_{2}:=a_{0});(a_{3}:=a_{0});(a_{4}:=a_{0});(a_{5}:=a_{0});(a_{6}:=a_{0}), a_{2} = intloc(2), a_{0} = intloc(0), a_{3} = intloc(3), a_{4} = intloc(4), a_{5} = intloc(5), a_{6} = intloc(6), and a_{1} = intloc(1).

The macro instruction the bubble sort algorithm is defined by: (Def. 2) The bubble sort algorithm = bubble-sort(fsloc(0)).

The following propositions are true:

(58) For every finite sequence location f holds UsedIntLoc(bubble-sort(f)) = {a_{0}, a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}}, where a_{0} = intloc(0), a_{1} = intloc(1), a_{2} = intloc(2), a_{3} = intloc(3), a_{4} = intloc(4), a_{5} = intloc(5), and a_{6} = intloc(6).

(59) For every finite sequence location f holds UsedInt^{∗} Loc(bubble-sort(f)) = {f}.

3. Defining Relationship Between the Input and Output of Sorting Algorithms

The partial function Sorting-Function from FinPartSt(SCM _{FSA}) to FinPartSt(SCM _{FSA}) is defined by the condition (Def. 3).

(Def. 3) Let p, q be finite partial states of SCM _{FSA}. Then ⟨⟨p, q⟩⟩ ∈ Sorting-Function if and only if there exists a finite sequence t of elements of ℤ and there exists a finite sequence u of elements of ℝ such that t and u are fiberwise equipotent and u is a finite sequence of elements of ℤ and non-increasing and p = fsloc(0)⟼→ . t and q = fsloc(0)⟼→ . u.

We now state two propositions:

(60) For every set p holds p ∈ domSorting-Function iff there exists a finite sequence t of elements of ℤ such that p = fsloc(0)⟼→ . t.

(61) Let t be a finite sequence of elements of ℤ. Then there exists a finite

sequence u of elements of ℝ such that

(i) t and u are fiberwise equipotent, (ii) u is non-increasing and a finite sequence of elements of ℤ, and (iii) (Sorting-Function)(fsloc(0)⟼→ . t) = fsloc(0)⟼→ . u.

4. The Basic Property of Buble Sort

Next we state several propositions:

(62) For every finite sequence location f holds cardbubble-sort(f) = 63.

(63) For every finite sequence location f and for every natural number k such that k < 63 holds insloc(k) ∈ dombubble-sort(f).

(64) bubble-sort(fsloc(0)) is keepInt0 1 and InitHalting.

(65) Let s be a state of SCM _{FSA}. Then (i) s(f_{0}) and (IExec(bubble-sort(f_{0}), s))(f_{0}) are fiberwise equipotent, and (ii) for all natural numbers i, j such that i 1 and j lens(f_{0}) and i < j

and for all integers x_{1}, x_{2} such that x_{1} = (IExec(bubble-sort(f_{0}), s))(f_{0})(i) and x_{2} = (IExec(bubble-sort(f_{0}), s))(f_{0})(j) holds x_{1} x_{2}, 158 jing-chao chen and yatsuka nakamura

where f_{0} = fsloc(0).

(66) Let i be a natural number, s be a state of SCM _{FSA}, and w be a finite sequence of elements of ℤ. Suppose Initialized(the bubble sort algorithm) +·(fsloc(0)⟼→ . w) ⊆ s. Then IC_{(Computation (s))(i)} ∈ dom(the bubble sort algorithm).

(67) Let s be a state of SCM _{FSA} and t be a finite sequence of elements of ℤ. Suppose Initialized(the bubble sort algorithm) +·(fsloc(0)⟼→ . t) ⊆ s. Then there exists a finite sequence u of elements of ℝ such that

(i) t and u are fiberwise equipotent, (ii) u is non-increasing and a finite sequence of elements of ℤ, and (iii) (Result(s))(fsloc(0)) = u.

5. The Correctness and Autonomousness of Buble Sort Algorithm

We now state two propositions:

(68) For every finite sequence w of elements of ℤ holds Initialized(the bubble sort algorithm) +·(fsloc(0)⟼→ . w) is autonomic.

(69) Initialized(the bubble sort algorithm) computes Sorting-Function.

References

[1] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part I. Formalized Mathematics, 6(1):65–72, 1997.

[2] Noriko Asamoto. Conditional branch macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):73–80, 1997.

[3] Noriko Asamoto. Constant assignment macro instructions of SCM _{FSA} . Part II. Formalized Mathematics, 6(1):59–63, 1997.

[4] Noriko Asamoto. The loop and Times macroinstruction for SCM _{FSA} . Formalized Mathematics, 6(4):483–497, 1997.

[5] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part II. Formalized Mathematics, 6(1):41–47, 1997.

[6] Noriko Asamoto, Yatsuka Nakamura, Piotr Rudnicki, and Andrzej Trybulec. On the composition of macro instructions. Part III. Formalized Mathematics, 6(1):53–57, 1997.

[7] Grzegorz Bancerek. Cardinal numbers. Formalized Mathematics, 1(2):377–382, 1990.

[8] Grzegorz Bancerek. The fundamental properties of natural numbers. Formalized Mathematics, 1(1):41–46, 1990.

[9] Grzegorz Bancerek. König’s theorem. Formalized Mathematics, 1(3):589–593, 1990.

[10] Grzegorz Bancerek and Krzysztof Hryniewiecki. Segments of natural numbers and finite sequences. Formalized Mathematics, 1(1):107–114, 1990.

[11] Grzegorz Bancerek and Andrzej Trybulec. Miscellaneous facts about functions. Formalized Mathematics, 5(4):485–492, 1996.

[12] Czesław Byliński. A classical first order language. Formalized Mathematics, 1(4):669–676, 1990.

[13] Czesław Byliński. Finite sequences and tuples of elements of a non-empty sets. Formalized Mathematics, 1(3):529–536, 1990.

[14] Czesław Byliński. Functions and their basic properties. Formalized Mathematics, 1(1):55– 65, 1990.

bubble sort on SCM _{FSA} 159

[15] Czesław Byliński. The modification of a function by a function and the iteration of the composition of a function. Formalized Mathematics, 1(3):521–527, 1990.

[16] Jing-Chao Chen and Yatsuka Nakamura. Initialization halting concepts and their basic properties of SCM _{FSA} . Formalized Mathematics, 7(1):139–151, 1998.

[17] Jarosław Kotowicz. Functions and finite sequences of real numbers. Formalized Mathematics, 3(2):275–278, 1992.

[18] Yatsuka Nakamura and Andrzej Trybulec. A mathematical model of CPU. Formalized Mathematics, 3(2):151–160, 1992.

[19] Jan Popiołek. Some properties of functions modul and signum. Formalized Mathematics, 1(2):263–264, 1990.

[20] Piotr Rudnicki and Andrzej Trybulec. Memory handling for SCM _{FSA} . Formalized Mathematics, 6(1):29–36, 1997.

[21] Yasushi Tanaka. On the decomposition of the states of SCM. Formalized Mathematics, 5(1):1–8, 1996.

[22] Andrzej Trybulec. Enumerated sets. Formalized Mathematics, 1(1):25–34, 1990.

[23] Andrzej Trybulec. Tarski Grothendieck set theory. Formalized Mathematics, 1(1):9–11, 1990.

[24] Andrzej Trybulec and Yatsuka Nakamura. Some remarks on the simple concrete model of computer. Formalized Mathematics, 4(1):51–56, 1993.

[25] Andrzej Trybulec and Yatsuka Nakamura. Modifying addresses of instructions of SCM _{FSA} . Formalized Mathematics, 5(4):571–576, 1996.

[26] Andrzej Trybulec, Yatsuka Nakamura, and Noriko Asamoto. On the compositions of macro instructions. Part I. Formalized Mathematics, 6(1):21–27, 1997.

[27] Andrzej Trybulec, Yatsuka Nakamura, and Piotr Rudnicki. The SCM _{FSA} computer. Formalized Mathematics, 5(4):519–528, 1996.

[28] Michał J. Trybulec. Integers. Formalized Mathematics, 1(3):501–505, 1990.

[29] Wojciech A. Trybulec. Pigeon hole principle. Formalized Mathematics, 1(3):575–579, 1990.

[30] Zinaida Trybulec. Properties of subsets. Formalized Mathematics, 1(1):67–71, 1990.

[31] Zinaida Trybulec and Halina Święczkowska. Boolean properties of sets. Formalized Mathematics, 1(1):17–23, 1990.

[32] Edmund Woronowicz. Relations and their basic properties. Formalized Mathematics, 1(1):73–83, 1990.

Index of MML Identifiers

BINARI 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

BINTREE2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

EULER 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

FRECHET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81

FUNCTOR3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1

GROUP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

JORDAN5D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

JORDAN7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

NAT 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

QUOFIELD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

SCMBSORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

SCMFSA9A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

SCM HALT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139

SFMASTR1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

SFMASTR2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

SFMASTR3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

T 1TOPSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

WAYBEL16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

WAYBEL17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

WAYBEL18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

YELLOW 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

YELLOW10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

YELLOW11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

YELLOW12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Contents Formaliz. Math. 7 (1)

The Composition of Functors and Transformations in Alternative

Categories

By Artur Korniłowicz  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Completely-Irreducible Elements

By Robert Milewski  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Scott-Continuous Functions

By Adam Grabowski . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Natural Numbers

By Robert Milewski  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Binary Arithmetics. Binary Sequences

By Robert Milewski  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Full Trees

By Robert Milewski  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

On T_{1} Reflex of Topological Space

By Adam Naumowicz and Mariusz Łapiński  . . . . . . . . . . . . . . . 31

Bases and Refinements of Topologies

By Grzegorz Bancerek  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

The Properties of Product of Relational Structures

By Artur Korniłowicz  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

On the Characterization of Modular and Distributive Lattices

By Adam Naumowicz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Injective Spaces

By Jarosław Gryko  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Continued on inside back cover

On the Characterization of Hausdorff Spaces

By Artur Korniłowicz  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

The Field of Quotients Over an Integral Domain

By Christoph Schwarzweller  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

First-countable, Sequential, and Frechet Spaces

By Bartłomiej Skorulski  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

On the Composition of Non-parahalting Macro Instructions

By Piotr Rudnicki  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

The while Macro Instructions of SCM _{FSA}. Part II

By Piotr Rudnicki  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

Another times Macro Instruction

By Piotr Rudnicki  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

The for (going up) Macro Instruction

By Piotr Rudnicki  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

Bounding Boxes for Special Sequences in E^{2}

By Yatsuka Nakamura and Adam Grabowski  . . . . . . . . . . . . 115

Euler’s Theorem and Small Fermat’s Theorem

By Yoshinori Fujisawa et al.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

The Product of the Families of the Groups

By Artur Korniłowicz  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

On the Dividing Function of the Simple Closed Curve into Seg-

ments

By Yatsuka Nakamura  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

Initialization Halting Concepts and Their Basic Properties of

SCM _{FSA}
By Jing-Chao Chen and Yatsuka Nakamura  . . . . . . . . . . . . . . 139

Bubble Sort on SCM _{FSA}

By Jing-Chao Chen and Yatsuka Nakamura  . . . . . . . . . . . . . . 153

Index of MML Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162