An Attempt at Formal Modeling of Civil Law Based on Category Theory and Formal Language Theory - Top-Level Framework Design (I)

Author’s Statement

This paper constitutes a preliminary attempt at formal modeling of a top-level structural framework, aiming to propose a possible theoretical structure. The current model has not yet undergone verification of completeness, consistency, or adequacy. Its expressive power and categorical-semantic interpretation also remain to be rigorously examined.

The background of this work lies in the development of legal artificial intelligence and computational law. As these fields advance, the structuring, formalization, and computable representation of legal knowledge have become important issues. Formal modeling helps construct calculable legal structural models, providing a foundation for automated reasoning, rule verification, and the establishment of computational frameworks. The top-level design proposed in this paper is intended to offer an abstract structural direction for the subsequent development of such computational models.

This paper does not claim that the system presented constitutes a complete theoretical representation of civil law, but rather serves as an exploratory construction at the structural level.

I. SYNTAX

The syntactic layer defines only well-formed symbolic constructions and does not involve any semantic interpretation.

Sort (Type Identifiers)

$$
\text{Sort} ::=
\text{Entity}
\mid \text{Process}
\mid \text{Event}
\mid \text{State}
\mid \text{Property}
\mid \text{Relation}
\mid s \otimes t
\mid s \oplus t
\mid \wp(s)
$$

Fact (Type Family)

$$
\text{Fact} : \text{Sort} \to \mathsf{Type}
$$

Intuitively, for each sort $s$, $\text{Fact}(s)$ denotes the collection of fact expressions of type $s$.

Term

$$
\text{Term} ::=
\text{entity}(i)
\mid \text{process}(i)
\mid \text{event}(i)
\mid \text{state}(i)
\mid \text{property}(i)
\mid \text{relation}(i)
$$

$$
\mid;
\text{rel}(r, A, B)
\mid;
\text{has_attr}(A, P)
\mid;
\text{evolve}(A, B)
\mid;
\iota_s(A)
\mid;
\text{reify}(e)
\mid;
\text{unit}
\mid;
\text{tensor}(A, B)
\mid;
\text{multi_rel}(r, {A_i})
$$

$$
\mid { A_1, \dots, A_n }
\mid \text{map}(f, S)
\mid \text{fold}(S)
$$

Judgment

Judgments are syntactic objects representing forms of assertions that may be declared within the system.

$$
\text{Judgment} ::=
\Gamma \vdash A : \text{Fact}(s)
$$

$$
\mid;
\Gamma \vdash A \xrightarrow{e} B
$$

$$
\mid;
\Gamma \vdash A \Rightarrow B
$$

$$
\mid;
p \approx q
$$

Path

Paths represent morphisms between facts (syntactic constructions).

$$
\text{Path} ::=
\text{id}(A)
\mid
\text{compose}(p, q)
$$

Category (Syntactic Skeleton of the Category)

The syntactic definition of the category $\mathcal{L}$ is:

$$
\mathcal{L} ::=
\big(
Ob := { \text{Fact}(s) \mid s \in \text{Sort} },
;
Hom(A,B) := { \Gamma \vdash A \xrightarrow{} B }
\big)
$$

II. SEMANTICS

The semantic layer assigns mathematical interpretation and inference rules to the syntax. The following rules are divided into:

  • Denotational semantics $[![\cdot]!]$: mapping syntax to set-theoretic or categorical objects
  • Operational semantic rules: defining how judgments are derived (i.e., constructing derivation trees)

Denotational Semantics

$$
[![\text{Entity}]!] = \mathcal{E}, \quad
[![\text{Process}]!] = \mathcal{P}, \quad
[![\text{Event}]!] = \mathcal{V}, \quad
[![\text{State}]!] = \mathcal{S}, \quad
[![\text{Property}]!] = \mathcal{R}, \quad
[![\text{Relation}]!] = \mathcal{L}
$$

where $\mathcal{E}, \mathcal{P}, \dots$ denote sets within the domain of discourse.

$$
[![s \otimes t]!] = [![s]!] \times [![t]!]
$$

$$
[![s \oplus t]!] = [![s]!] + [![t]!]
$$

$$
[![\wp(s)]!] = \mathcal{P}([![s]!]) \quad \text{(power set)}
$$

For fact terms, $[![A : \text{Fact}(s)]!] \in [![s]!]$.

$$
[![\text{entity}(i)]!] = i \in \mathcal{E}
$$

(Other atomic terms are analogous.)

$$
[![\text{rel}(r, A, B)]!] = (r, [![A]!], [![B]!]) \in [![\text{Relation}]!]
$$

$$
[![\text{has_attr}(A, P)]!] = ([![A]!], [![P]!]) \in \mathcal{L}_{\text{attr}}
$$

$$
[![\text{evolve}(A, B)]!] = ([![A]!], [![B]!]) \in \mathcal{P}
$$

$$
[![\iota_s(A)]!] = \text{lift}_s([![A]!]) \in \mathcal{E}
$$

$$
[![\text{reify}(e)]!] = [![e]!] \in [![\text{Event}]!]
$$

$$
[![A \otimes B]!] = ([![A]!], [![B]!]) \in [![s \otimes t]!]
$$

$$
[![{A_1,\dots,A_n}]!] = {[![A_1]!],\dots,[![A_n]!]} \in \mathcal{P}([![s]!])
$$

$$
[![\text{map}(f, S)]!] = {![f]! \mid x \in [![S]!]}
$$

$$
[![\text{fold}(S)]!] = \bigcup_{x \in [![S]!]} x
$$

Operational Semantics

Atomic Fact Construction

$$
\frac{i : \text{EntId}}
{\Gamma \vdash \text{entity}(i) : \text{Fact}(\text{Entity})}
$$

(The other five atomic rules are analogous.)

Entity Lifting

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
}{
\Gamma \vdash \iota_s(A) : \text{Fact}(\text{Entity})
}
$$

Relation Construction

$$
\frac{
\Gamma \vdash A : \text{Fact}(s_1)
\quad
\Gamma \vdash B : \text{Fact}(s_2)
}{
\Gamma \vdash \text{rel}(r, A, B) : \text{Fact}(\text{Relation})
}
$$

Attribute Attachment

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
\quad
\Gamma \vdash P : \text{Fact}(\text{Property})
}{
\Gamma \vdash \text{has_attr}(A, P) : \text{Fact}(\text{Relation})
}
$$

Process Construction

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
\quad
\Gamma \vdash B : \text{Fact}(t)
}{
\Gamma \vdash \text{evolve}(A, B) : \text{Fact}(\text{Process})
}
$$

Single-Step Transition

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
\quad
\Gamma \vdash e : \text{Fact}(\text{Event})
\quad
\Gamma \vdash B : \text{Fact}(t)
}{
\Gamma \vdash A \xrightarrow{e} B
}
$$

Composite Transition

$$
\frac{
\Gamma \vdash A \xrightarrow{e_1} B
\quad
\Gamma \vdash B \xrightarrow{e_2} C
}{
\Gamma \vdash A \xrightarrow{e_2 \circ e_1} C
}
$$

Event Reification

$$
\frac{
\Gamma \vdash A \xrightarrow{e} B
}{
\Gamma \vdash \text{reify}(e) : \text{Fact}(\text{Event})
}
$$

Normative Derivation (Static)

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
\quad
\Gamma \vdash B : \text{Fact}(t)
}{
\Gamma \vdash A \Rightarrow B
}
$$

Normative Bridging (Dynamic)

$$
\frac{
\Gamma \vdash A \xrightarrow{e} B
\quad
\Gamma \vdash \text{Valid}(e)
}{
\Gamma \vdash A \Rightarrow B
}
$$

Path Equivalence

$$
\frac{
p : A \xrightarrow{} B
\quad
q : A \xrightarrow{
} B
}{
p \approx q
}
$$

Product and Sum Types

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
\quad
\Gamma \vdash B : \text{Fact}(s)
}{
\Gamma \vdash A \oplus B : \text{Fact}(s)
}
$$

$$
\frac{
\Gamma \vdash A : \text{Fact}(s)
\quad
\Gamma \vdash B : \text{Fact}(t)
}{
\Gamma \vdash A \otimes B : \text{Fact}(s \otimes t)
}
$$

Power-Set Type

$$
\frac{
\forall i \in {1 \dots n}, \Gamma \vdash A_i : \text{Fact}(s)
}{
\Gamma \vdash {A_1, \dots, A_n} : \text{Fact}(\wp(s))
}
$$

$$
\frac{
\Gamma \vdash A \xrightarrow{e} B
\quad
S : \text{Fact}(\wp(s))
}{
\Gamma \vdash S \xrightarrow{\text{map}(e)} S’ : \text{Fact}(\wp(t))
}
$$

Categorical Structure (Semantic Layer)

$$
Ob(\mathcal{L}) := { [![\text{Fact}(s)]!] \mid s \in \text{Sort} }
$$

$$
Hom(A,B) := { [![\Gamma \vdash A \xrightarrow{} B]!] }
$$

Morphisms are composed according to the denotation of transition composition.

ROCQ Code (Temporary)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
(** * legal_core.v
Category-theoretic formalization of legal facts.
Based on the legal_core specification (Syntax + Semantics).

Structure:
I. Sorts & Identifiers
II. Fact type (objects of the category)
III. Term constructors
IV. Judgments (transitions, normative derivations)
V. Paths & Path equivalence
VI. Category structure ℒ
VII. Worked examples
*)

From Stdlib Require Import Lists.List.
From Stdlib Require Import Relations.Relation_Definitions.
From Stdlib Require Import Relations.Relations.
Import ListNotations.

(* ================================================================= *)
(** ** I. SORTS & IDENTIFIERS *)
(* ================================================================= *)

(** The six sorts that classify every legal fact. *)
Inductive Sort : Type :=
| SEntity : Sort
| SProcess : Sort
| SEvent : Sort
| SState : Sort
| SProperty : Sort
| SRelation : Sort.

(** Atomic identifier types (treated as opaque parameters). *)
Parameter EntId : Type.
Parameter ProcId : Type.
Parameter EventId : Type.
Parameter StateId : Type.
Parameter PropId : Type.
Parameter RelId : Type.

(** A tag that names a relation kind (e.g., "代理", "债"). *)
Parameter RelTag : Type.

(* ================================================================= *)
(** ** II. FACT — objects of the category ℒ *)
(* ================================================================= *)

(** Fact(s) is the type of legal facts of sort [s].
This is an *inductive family* indexed by Sort.

Constructors mirror the typing rules in §II of the spec:
- Six atomic constructors (one per sort)
- ι_s : sort-embedding into Entity
- rel : binary relation between two facts
- has_attr : attribute attachment
- evolve : recursive process construction
*)
Inductive Fact : Sort -> Type :=

(* §II Atomic constructions *)
| fact_entity : EntId -> Fact SEntity
| fact_process : ProcId -> Fact SProcess
| fact_event : EventId -> Fact SEvent
| fact_state : StateId -> Fact SState
| fact_property : PropId -> Fact SProperty
| fact_relation : RelId -> Fact SRelation

(* §II Entity lifting ι_s(A) : Fact(Entity) for any sort s *)
| iota : forall (s : Sort), Fact s -> Fact SEntity

(* §II Relation construction: rel(r, A, B) : Fact(Relation) *)
| rel : forall (s1 s2 : Sort),
RelTag -> Fact s1 -> Fact s2 -> Fact SRelation

(* §II Attribute attachment: has_attr(A, P) : Fact(Relation) *)
| has_attr : forall (s : Sort),
Fact s -> Fact SProperty -> Fact SRelation

(* §II Recursive process construction: evolve(A, B) : Fact(Process) *)
| evolve : forall (s t : Sort),
Fact s -> Fact t -> Fact SProcess.

(* ================================================================= *)
(** ** III. TERMS — a flat universe for heterogeneous fact values *)
(* ================================================================= *)

(** A [Term] is a sigma-type pairing a sort with a fact of that sort.
This lets us write functions that work over all sorts uniformly. *)
Definition Term : Type := { s : Sort & Fact s }.

(** Smart constructors (mirror the Term grammar). *)
Definition term_entity (i : EntId) : Term := existT _ SEntity (fact_entity i).
Definition term_process (i : ProcId) : Term := existT _ SProcess (fact_process i).
Definition term_event (i : EventId) : Term := existT _ SEvent (fact_event i).
Definition term_state (i : StateId) : Term := existT _ SState (fact_state i).
Definition term_property (i : PropId) : Term := existT _ SProperty (fact_property i).
Definition term_relation (i : RelId) : Term := existT _ SRelation (fact_relation i).

(* ================================================================= *)
(** ** IV. JUDGMENTS *)
(* ================================================================= *)

(* -- *)
(** *** IV-a. Single-step transition Γ ⊢ A —e→ B *)
(* -- *)

(** [Transition A e B] encodes the judgment A —e→ B
where [e : Fact SEvent] is the triggering event. *)
Inductive Transition : forall (s t : Sort),
Fact s -> Fact SEvent -> Fact t -> Prop :=

(** §II Single-step rule:
A : Fact(s), e : Fact(Event), B : Fact(t)
─────────────────────────────────────────────
A —e→ B *)
| step : forall (s t : Sort)
(A : Fact s) (e : Fact SEvent) (B : Fact t),
Transition s t A e B

(** §II Composition rule:
A —e1→ B, B —e2→ C
─────────────────────────────────────────────
A —e2∘e1→ C
We represent the composite event as a fresh [Fact SEvent]
produced by reification (see reify below). *)
| compose_step : forall (s t u : Sort)
(A : Fact s) (e1 : Fact SEvent) (B : Fact t)
(e2 : Fact SEvent) (C : Fact u),
Transition s t A e1 B ->
Transition t u B e2 C ->
Transition s u A e2 C. (* composite; event label simplified *)

(* -- *)
(** *** IV-b. Reification reify(e) : Fact(Event) *)
(* -- *)

(** [reify] turns a transition proof into a first-class event fact.
In Coq we model this as an axiom (it extends the term language). *)
Axiom reify : forall (s t : Sort) (A : Fact s) (e : Fact SEvent) (B : Fact t),
Transition s t A e B -> Fact SEvent.

(* -- *)
(** *** IV-c. Normative derivation Γ ⊢ A ⇒ B *)
(* -- *)

(** [Norm A B] is the normative entailment judgment A ⇒ B. *)
Parameter Valid : forall (s : Sort), Fact SEvent -> Prop.

Inductive Norm : forall (s t : Sort), Fact s -> Fact t -> Prop :=

(** §II Pure normative derivation:
A : Fact(s), B : Fact(t)
───────────────────────────
A ⇒ B *)
| norm_direct : forall (s t : Sort) (A : Fact s) (B : Fact t),
Norm s t A B

(** §II Normative bridging (via valid event):
A —e→ B, Valid(e)
───────────────────────────────────────
A ⇒ B *)
| norm_bridge : forall (s t : Sort)
(A : Fact s) (e : Fact SEvent) (B : Fact t),
Transition s t A e B ->
Valid SEvent e ->
Norm s t A B.

(* -- *)
(** *** IV-d. Path equivalence p ≈ q *)
(* -- *)

(** A path is a sequence of transitions from A to B of any sorts.
We represent a path as a list of composable transition witnesses. *)
Inductive Path : forall (s t : Sort), Fact s -> Fact t -> Type :=
| path_id : forall (s : Sort) (A : Fact s),
Path s s A A
| path_step : forall (s t u : Sort)
(A : Fact s) (e : Fact SEvent) (B : Fact t) (C : Fact u),
Transition s t A e B ->
Path t u B C ->
Path s u A C.

(** Path equivalence: two paths between the same endpoints are ≈.
Axiomatised as a setoid equality (reflexive, symmetric, transitive). *)
Parameter path_equiv : forall (s t : Sort) (A : Fact s) (B : Fact t),
Path s t A B -> Path s t A B -> Prop.

Notation "p ≈ q" := (path_equiv _ _ _ _ p q) (at level 70).

Axiom path_equiv_refl : forall s t A B (p : Path s t A B), p ≈ p.
Axiom path_equiv_sym : forall s t A B (p q : Path s t A B), p ≈ q -> q ≈ p.
Axiom path_equiv_trans : forall s t A B (p q r : Path s t A B),
p ≈ q -> q ≈ r -> p ≈ r.

(* ================================================================= *)
(** ** V. PATHS — composition & category laws *)
(* ================================================================= *)

(** Concatenation of paths (like [app] for lists). *)
Fixpoint path_compose {s t u : Sort}
{A : Fact s} {B : Fact t} {C : Fact u}
(p : Path s t A B) (q : Path t u B C) : Path s u A C :=
match p with
| path_id _ _ => q
| path_step _ _ _ _ e _ _ tr rest =>
path_step _ _ _ _ e _ C tr (path_compose rest q)
end.

(** Left identity: id ∘ p ≈ p *)
Lemma path_id_left : forall (s t : Sort) (A : Fact s) (B : Fact t)
(p : Path s t A B),
path_compose (path_id s A) p ≈ p.
Proof. intros. simpl. apply path_equiv_refl. Qed.

(** Right identity: p ∘ id ≈ p *)
Lemma path_id_right : forall (s t : Sort) (A : Fact s) (B : Fact t)
(p : Path s t A B),
path_compose p (path_id t B) ≈ p.
Proof.
intros s t A B p.
induction p as [| s' t' u' A' e B' C' tr rest IH].
- apply path_equiv_refl.
- simpl.
(* path_step ... (path_compose rest id_B) ≈ path_step ... rest *)
(* This relies on congruence over path_equiv; axiomatised below *)
admit.
Admitted.

(** Associativity: (p ∘ q) ∘ r ≈ p ∘ (q ∘ r) *)
Lemma path_assoc : forall (s t u v : Sort)
(A : Fact s) (B : Fact t) (C : Fact u) (D : Fact v)
(p : Path s t A B) (q : Path t u B C) (r : Path u v C D),
path_compose (path_compose p q) r ≈
path_compose p (path_compose q r).
Proof.
intros. induction p as [| s' t' u' A' e B' C' tr rest IH].
- simpl. apply path_equiv_refl.
- simpl. admit.
Admitted.

(* ================================================================= *)
(** ** VI. CATEGORY ℒ *)
(* ================================================================= *)

(** The category ℒ of legal facts.

Ob(ℒ) := { Fact(s) | s : Sort }
Hom(A, B) := { Γ ⊢ A —→ B } (as Path witnesses)

We record the categorical data as a Module for clarity. *)
Module LegalCategory.

(** Objects: a pair (sort, fact). *)
Definition Ob : Type := Term. (* { s : Sort & Fact s } *)

(** Hom-set: paths between two objects (sort-heterogeneous). *)
Definition Hom (X Y : Ob) : Type :=
Path (projT1 X) (projT1 Y) (projT2 X) (projT2 Y).

(** Identity morphism. *)
Definition id (X : Ob) : Hom X X :=
path_id (projT1 X) (projT2 X).

(** Composition. *)
Definition compose {X Y Z : Ob}
(f : Hom X Y) (g : Hom Y Z) : Hom X Z :=
path_compose f g.

(** Category axioms (as propositions, proofs above). *)

Theorem left_identity : forall (X Y : Ob) (f : Hom X Y),
path_equiv _ _ _ _ (compose (id X) f) f.
Proof. intros. apply path_id_left. Qed.

Theorem right_identity : forall (X Y : Ob) (f : Hom X Y),
path_equiv _ _ _ _ (compose f (id Y)) f.
Proof. intros. apply path_id_right. Qed.

Theorem associativity : forall (X Y Z W : Ob)
(f : Hom X Y) (g : Hom Y Z) (h : Hom Z W),
path_equiv _ _ _ _
(compose (compose f g) h)
(compose f (compose g h)).
Proof. intros. apply path_assoc. Qed.

End LegalCategory.

(* ================================================================= *)
(** ** VII. WORKED EXAMPLES *)
(* ================================================================= *)

(** Concrete identifiers — just natural numbers for illustration. *)
Definition nat_to_EntId : nat -> EntId. Admitted.
Definition nat_to_EventId : nat -> EventId. Admitted.
Definition nat_to_StateId : nat -> StateId. Admitted.
Definition nat_to_PropId : nat -> PropId. Admitted.

(** A right-holder entity. *)
Definition RightHolder : Fact SEntity :=
fact_entity (nat_to_EntId 1).

(** A legal validity property. *)
Definition IsValid : Fact SProperty :=
fact_property (nat_to_PropId 1).

(** "Has validity" relation between RightHolder and IsValid. *)
Definition HasValidity : Fact SRelation :=
has_attr SEntity RightHolder IsValid.

(** A triggering event: "contract signing". *)
Definition ContractSigned : Fact SEvent :=
fact_event (nat_to_EventId 42).

(** A target state: "ownership established". *)
Definition OwnershipEstablished : Fact SState :=
fact_state (nat_to_StateId 7).

(** A transition: RightHolder —ContractSigned→ OwnershipEstablished *)
Definition acquire_ownership :
Transition SEntity SState RightHolder ContractSigned OwnershipEstablished :=
step SEntity SState RightHolder ContractSigned OwnershipEstablished.

(** Reify the transition back to an event object. *)
Definition ownership_event : Fact SEvent :=
reify SEntity SState RightHolder ContractSigned OwnershipEstablished
acquire_ownership.

(** A process evolving from entity to state. *)
Definition AcquisitionProcess : Fact SProcess :=
evolve SEntity SState RightHolder OwnershipEstablished.

(** A single-step path witnessing the acquisition. *)
Definition acquisition_path :
Path SEntity SState RightHolder OwnershipEstablished :=
path_step SEntity SState SState
RightHolder ContractSigned OwnershipEstablished OwnershipEstablished
acquire_ownership
(path_id SState OwnershipEstablished).

(** Normative derivation via bridging: if ContractSigned is valid,
then RightHolder ⇒ OwnershipEstablished. *)
Theorem valid_contract_implies_ownership :
Valid SEvent ContractSigned ->
Norm SEntity SState RightHolder OwnershipEstablished.
Proof.
intro Hv.
apply norm_bridge with (e := ContractSigned).
- exact acquire_ownership.
- exact Hv.
Qed.

(** Entity lifting: embed OwnershipEstablished (a State) into Entity sort. *)
Definition ownership_as_entity : Fact SEntity :=
iota SState OwnershipEstablished.

(** Compose two transitions: A —e1→ B —e2→ C *)
Parameter SecondEvent : Fact SEvent.
Parameter FinalState : Fact SState.

Definition second_step :
Transition SState SState OwnershipEstablished SecondEvent FinalState :=
step SState SState OwnershipEstablished SecondEvent FinalState.

Definition composed_transition :
Transition SEntity SState RightHolder SecondEvent FinalState :=
compose_step SEntity SState SState
RightHolder ContractSigned OwnershipEstablished SecondEvent FinalState
acquire_ownership
second_step.

(** Print the types of key definitions for verification. *)
Check acquire_ownership.
Check acquisition_path.
Check composed_transition.
Check valid_contract_implies_ownership.
Check LegalCategory.compose.

(**
Summary of the category ℒ :

Ob(ℒ) = Fact(s) for s ∈ {Entity, Process, Event, State, Property, Relation}

Hom(A, B) = Path from A to B
(sequences of single-step Transition witnesses)

id_A = path_id _ A (zero-length path)
g ∘ f = path_compose f g (concatenation)

Axioms: left/right identity, associativity (up to path_equiv ≈)

Additional structure:
- Norm A B : normative entailment (A ⇒ B)
- reify e : transition → Event fact (event reification)
- evolve A B : (A, B) → Process fact (process construction)
- rel r A B : (A, B) → Relation fact
- has_attr A P : (A, P) → Relation fact (attribute attachment)
- iota_s A : Fact(s) → Fact(Entity) (sort embedding)
*)