markdown
関係の合成と閉包md 17aed13
lecture/math/discrete-math/relation-composition-and-closure.lecture.n.md
Download PDF

関係かんけいrelationの合成ごうせいcompositionと閉包へいほうclosure

date2026-07-02document_iddoc_83c064857b7cf6d74b3b53741e63e4bddescription関係の合成を、二段階の到達可能性として導入し、反射閉包・対称閉包・推移閉包を、何を最小限追加する操作かとして整理する講義である。prerequisites関係の基本 / 直積集合の基本 / 数学的帰納法と再帰的定義type講義content_typelecturestatusactiverelateddata/lecture/math/discrete-math/discrete-mathematics-portal.lecture.n.md / data/lecture/math/discrete-math/mathematical-induction-and-recursive-definitions.lecture.n.md / data/lecture/math/discrete-math/relation-basics.lecture.n.md / data/lecture/math/discrete-math/equivalence-relations-and-partitions.lecture.n.md / data/lecture/math/discrete-math/partial-and-total-orders.lecture.n.md / data/exercise/math/discrete-math/relations-and-equivalence-relations.exercise.n.md
mathdiscrete-mathrelation-compositionclosurelecture

Composition合成ごうせい and closure閉包へいほう of relations関係かんけい

1導入どうにゅう

関係かんけいrelationを一回いっかいだけ確認かくにんするのではなく、「関係かんけいを続つづけて使つかうとどこへ到達とうたつできるか」を扱あつかいたい場合ばあいがある。たとえば、駅えきどうしの直通ちょくつうの関係かんけいが与あたえられたとき、乗のり換かえを許ゆるせばどこへ行いけるかを知しりたい。この発想はっそうが関係かんけいrelationの合成ごうせいcompositionである。

閉包へいほうclosureは、ある性質せいしつpropertyを満みたすために不足ふそくしている順序対じゅんじょついordered pairを最小限さいしょうげん追加ついかする操作そうさである。

合成ごうせいcompositionでは「1 回かいで行いける」ことと「何回なんかいか使つかえば行いける」ことを区別くべつする。閉包へいほうclosureは元もとの関係かんけいrelationを含ふくんだまま性質せいしつを満みたすようにするので、既存きそんの順序対じゅんじょついordered pairは失うしなわれない。

1Introduction

Sometimes we do not want to check a relation関係かんけい only once; we want to know where repeated use of the relation can reach. For example, if direct train connections are given, we may want to know what stations are reachable with transfers. This idea is composition合成ごうせい of relations.

A closure閉包へいほう is an operation that adds the minimum missing ordered pairs順序対じゅんじょつい needed to satisfy a property性質せいしつ.

Composition distinguishes what is reachable in one use of a relation from what is reachable after finitely many uses. A closure retains every pair in the original relation while adding what is needed, so no existing pair is lost.

2用語ようごと定義ていぎ:合成ごうせいcomposition

R⊆A×B、S⊆B×C を関係かんけいrelationとする。合成関係ごうせいかんけいcomposite relation S∘R⊆A×C を

a(S∘R)c⟺あるb∈Bが存在してaRbかつbSc

で定義ていぎする。これは「a から b へ R で進すすみ、b から c へ S で進すすめる」ことを表あらわす。

2Terms and definition: composition合成ごうせい

Let R⊆A×B and S⊆B×C be relations関係かんけい. Define the composite relation合成関係ごうせいかんけい S∘R⊆A×C by

a(S∘R)c⟺thereexistsb∈BsuchthataRbandbSc.

This says that we can move from a to b by R and then from b to c by S.

3用語ようごと定義ていぎ:恒等関係こうとうかんけいidentity relationと逆関係ぎゃくかんけいinverse relation

A 上うえの恒等関係こうとうかんけいidentity relationを

ΔA={(a,a)∣a∈A}⊆A×A

と書かく。また、R⊆A×B に対たいする逆関係ぎゃくかんけいinverse relation R-1⊆B×A を

R-1={(b,a)∣(a,b)∈R}

で定義ていぎする。

3Terms and definitions: identity relation恒等関係こうとうかんけい and inverse relation逆関係ぎゃくかんけい

The identity relation恒等関係こうとうかんけい on A is written

ΔA={(a,a)∣a∈A}⊆A×A.

For R⊆A×B, the inverse relation逆関係ぎゃくかんけい R-1⊆B×A is

R-1={(b,a)∣(a,b)∈R}.

4閉包へいほうclosureとは何なにか

この節せつでは R⊆A×A を A 上うえの関係かんけいrelationとする。

反射閉包はんしゃへいほうreflexive closureは、反射性はんしゃせいreflexivityを満みたすために必要ひつような (a,a) を追加ついかした関係かんけいrelationである。

Rref=R∪ΔA

対称閉包たいしょうへいほうsymmetric closureは、逆向ぎゃくむきの順序対じゅんじょついordered pairを追加ついかした関係かんけいrelationである。

Rsym=R∪R-1

推移閉包すいいへいほうtransitive closureは、aRb と bRc から必要ひつようになる aRc を繰くり返かえし追加ついかした最小さいしょうの推移的すいいてきtransitiveな関係かんけいrelationであり、R+ と書かく。

4What is closure閉包へいほう?

In this section, let R⊆A×A be a relation関係かんけい on A.

The reflexive closure反射閉包はんしゃへいほう adds the self-pairs (a,a) needed for reflexivity反射性はんしゃせい.

Rref=R∪ΔA

The symmetric closure対称閉包たいしょうへいほう adds reverse ordered pairs順序対じゅんじょつい.

Rsym=R∪R-1

The transitive closure推移閉包すいいへいほう, denoted by R+, is the smallest transitive推移的すいいてき relation関係かんけい obtained by repeatedly adding pairs aRc forced by aRb and bRc.

5方針ほうしん

閉包へいほうclosureを作つくるときは、「性質せいしつを満みたすまで何なにを追加ついかするか」を追跡ついせきする。ただし、元もとの関係かんけいrelationを壊こわしてはいけない。閉包へいほうclosureは削除さくじょではなく追加ついかの操作そうさである。

ここで経路けいろpathとは、aRb、bRc のように関係かんけいrelationの矢印やじるしを有限回ゆうげんかい続つづけて辿たどる列れつである。有向ゆうこうグラフdirected graphという語ごは、元げんelementを点てん、順序対じゅんじょついordered pairを矢印やじるしとして描えがく見方みかただけを指さす。

反射閉包はんしゃへいほうreflexive closureは対角成分たいかくせいぶんを追加ついかし、対称閉包たいしょうへいほうsymmetric closureは矢印やじるしを逆向ぎゃくむきにも追加ついかし、推移閉包すいいへいほうtransitive closureは経路けいろで到達とうたつできる先さきを直接ちょくせつの関係かんけいrelationとして追加ついかする。

最小さいしょうの追加ついかminimal additionであることも閉包へいほうの一部いちぶである。つまり、元もとの関係かんけいrelationを含ふくみ、求もとめる性質せいしつを満みたすどの関係かんけいrelationにも、閉包へいほうで追加ついかした順序対じゅんじょついordered pairは含ふくまれる。

5Strategy

When constructing a closure閉包へいほう, track what must be added until the desired property性質せいしつ holds. The original relation関係かんけい must not be destroyed. A closure is an adding operation, not a deleting operation.

Here a path経路けいろ means a finite chain that follows relation arrows, such as aRb and then bRc. The term directed graph有向ゆうこうグラフ means only the viewpoint of drawing elements元げん as points and ordered pairs順序対じゅんじょつい as arrows.

The reflexive closure反射閉包はんしゃへいほう adds diagonal pairs, the symmetric closure対称閉包たいしょうへいほう adds reverse arrows, and the transitive closure推移閉包すいいへいほう adds direct relation pairs for destinations reachable by paths.

Being a minimal addition最小さいしょうの追加ついか is also part of closure. That is, every relation関係かんけい that contains the original relation and satisfies the desired property must contain the ordered pairs順序対じゅんじょつい added by the closure.

6直感的ちょっかんてきな説明せつめい

関係かんけいrelationを有向ゆうこうグラフとして見みると、合成ごうせいcompositionは 2 本ほんの矢印やじるしを続つづけて進すすむことである。推移閉包すいいへいほうtransitive closureは、何本なんぼんかの矢印やじるしを辿たどって到達とうたつできるなら、直接ちょくせつの矢印やじるしも追加ついかしたものと考かんがえられる。

この見方みかたでは、推移閉包すいいへいほうtransitive closureは到達可能性とうたつかのうせいを記録きろくする関係かんけいrelationである。元もとの関係かんけいrelationは「1 歩ぽで行いける」、推移閉包すいいへいほうtransitive closureは「何なに歩ぽかで行いける」を表あらわす。

経路けいろpathの長ながさで考かんがえると、反射閉包はんしゃへいほうreflexive closureは長ながさ 0 の移動いどうを許ゆるし、推移閉包すいいへいほうtransitive closureは正せいの長ながさの経路けいろで到達とうたつできる先さきを直接ちょくせつの関係かんけいとして加くわえる。

6Intuitive explanation

If a relation関係かんけい is viewed as a directed graph, composition合成ごうせい means following two arrows in sequence. The transitive closure推移閉包すいいへいほう can be thought of as adding a direct arrow whenever a destination is reachable by following some number of arrows.

In this view, the transitive closure is the relation関係かんけい that records reachability. The original relation means “reachable in one step,” while the transitive closure means “reachable in some positive number of steps.”

In terms of path length, the reflexive closure反射閉包はんしゃへいほう allows movement of length 0, while the transitive closure推移閉包すいいへいほう adds destinations reachable by paths of positive length as direct relation pairs.

7例題れいだい:推移閉包すいいへいほうtransitive closureを作つくる

7.1問題もんだい

A={1,2,3} 上うえの関係かんけいrelation R={(1,2),(2,3)} の推移閉包すいいへいほうtransitive closureを求もとめよ。

7Worked example: construct a transitive closure推移閉包すいいへいほう

7.1Problem

Find the transitive closure推移閉包すいいへいほう of the relation関係かんけい R={(1,2),(2,3)} on A={1,2,3}.

7.2解説かいせつ

1R2 かつ 2R3 なので、推移性すいいせいtransitivityを満みたすには 1R3 が必要ひつようである。したがって (1,3) を追加ついかする。

追加後ついかごの関係かんけいrelationは

R+={(1,2),(2,3),(1,3)}

である。これ以上いじょう新あたらしく追加ついかする順序対じゅんじょついordered pairはない。よってこれが推移閉包すいいへいほうtransitive closureである。

7.2Explanation

Because 1R2 and 2R3, transitivity推移性すいいせい requires 1R3. Therefore add (1,3).

The resulting relation関係かんけい is

R+={(1,2),(2,3),(1,3)}.

No further ordered pair順序対じゅんじょつい is forced, so this is the transitive closure推移閉包すいいへいほう.

8証明しょうめい補足ほそく:推移閉包すいいへいほうtransitive closureの最小性さいしょうせい

集合しゅうごう A 上うえの関係かんけい R に対たいして、R の反復はんぷくを

R1=R,Rn+1=R∘Rn(n[PARSE ERROR: Undefined("Command(\"ge\")")]1)

と再帰的さいきてきに定義ていぎする。(a,b)∈Rn は、a から b へ R の矢印やじるしをちょうど n 本ほん辿たどる経路けいろpathがあることを意味いみする。この記法きほうを用もちいると、推移閉包すいいへいほうtransitive closureは

R+=R∪R2∪R3∪⋯

と書かける。

R+ は R を含ふくむ。また、(a,b)∈R+、(b,c)∈R+ なら、ある m,n[PARSE ERROR: Undefined("Command(\"ge\")")]1 が存在そんざいして (a,b)∈Rm、(b,c)∈Rn である。経路けいろpathを連結れんけつすれば (a,c)∈Rm+n なので (a,c)∈R+ である。

さらに、S⊆A×A が R⊆S を満みたす A 上うえの推移的すいいてきな関係かんけいなら、すべての n[PARSE ERROR: Undefined("Command(\"ge\")")]1 について Rn⊆S であることを数学的帰納法すうがくてききのうほうmathematical inductionで示しめせる。基底段階きていだんかいでは R1=R⊆S である。帰納法きのうほうの仮定かてい Rn⊆S のもとで (a,c)∈Rn+1=R∘Rn とすると、ある b∈A が存在そんざいして (a,b)∈Rn⊆S かつ (b,c)∈R⊆S となる。S の推移性すいいせいより (a,c)∈S なので、Rn+1⊆S である。よって R+⊆S であり、R+ は R を含ふくむ推移的すいいてきな関係かんけいの中なかで最小さいしょうである。

8Proof supplement: minimality of the transitive closure推移閉包すいいへいほう

For a relation関係かんけい R on a set A, define its iterates recursively by

R1=R,Rn+1=R∘Rn(n[PARSE ERROR: Undefined("Command(\"ge\")")]1).

The statement (a,b)∈Rn means that a path経路けいろ of exactly n arrows of R leads from a to b. With this notation, the transitive closure推移閉包すいいへいほう is

R+=R∪R2∪R3∪⋯.

The relation R+ contains R. Also, if (a,b)∈R+ and (b,c)∈R+, then for some m,n[PARSE ERROR: Undefined("Command(\"ge\")")]1, (a,b)∈Rm and (b,c)∈Rn. Concatenating the paths gives (a,c)∈Rm+n, so (a,c)∈R+.

Finally, let S⊆A×A be any transitive relation on A with R⊆S. We prove Rn⊆S for every n[PARSE ERROR: Undefined("Command(\"ge\")")]1 by mathematical induction数学的帰納法すうがくてききのうほう. The base case is R1=R⊆S. For the induction step, assume Rn⊆S and take (a,c)∈Rn+1=R∘Rn. There is some b∈A with (a,b)∈Rn⊆S and (b,c)∈R⊆S. Transitivity of S gives (a,c)∈S, so Rn+1⊆S. Hence R+⊆S, and R+ is the smallest transitive relation containing R.

9見分みわけ方かたと関連かんれんリンク

  • 関係かんけいを続つづけて使つかうなら、合成ごうせいcompositionを考かんがえる。
  • 足たりない自己じこループを追加ついかするなら、反射閉包はんしゃへいほうreflexive closureである。
  • 逆向ぎゃくむきの矢印やじるしを追加ついかするなら、対称閉包たいしょうへいほうsymmetric closureである。
  • 到達可能性とうたつかのうせいを直接ちょくせつの関係かんけいrelationとして記録きろくするなら、推移閉包すいいへいほうtransitive closureである。
data/lecture/math/discrete-math/relation-basics.lecture.n.md data/lecture/math/discrete-math/mathematical-induction-and-recursive-definitions.lecture.n.md data/lecture/math/discrete-math/equivalence-relations-and-partitions.lecture.n.md

9How to identify it and related links

  • If a relation is used repeatedly, think of composition合成ごうせい.
  • If missing self-loops are added, it is the reflexive closure反射閉包はんしゃへいほう.
  • If reverse arrows are added, it is the symmetric closure対称閉包たいしょうへいほう.
  • If reachability is recorded as a direct relation関係かんけい, it is the transitive closure推移閉包すいいへいほう.
data/lecture/math/discrete-math/relation-basics.lecture.n.md data/lecture/math/discrete-math/mathematical-induction-and-recursive-definitions.lecture.n.md data/lecture/math/discrete-math/equivalence-relations-and-partitions.lecture.n.md
raw .n.md をコピー
loc をコピー (filepath:line ~ line)
copy share link
copy encoded share link
path をコピー
copy share link
copy encoded share link
copy share link
copy encoded share link
タブを全て閉じる