Skip to content

01 — The 5-Tuple and Family Graph

Core claim: Every heir in Islamic inheritance law is uniquely identified by a 5-dimensional vector $\vec{h} = (g, j, d, q, c)$ computed via BFS traversal of a kinship DAG.


Each potential heir is a point in a 5-dimensional space:

$$\vec{h} = (g, ; j, ; d, ; q, ; c)$$

ComponentNameDomainMeaning
$g$Gender (جنس)${0, 1}$0 = female, 1 = male
$j$Jiha (جهة / Direction)${0, 1, 2, 3, 4}$Relationship class to the deceased
$d$Daraja (درجة / Degree)$\mathbb{N}^+$Generational distance from the deceased
$q$Quwwa (قوة / Strength)${1, 2, 3, 9}$Bond type through the connecting ancestor
$c$Chain validity (صحة السلسلة)${0, 1}$Whether the heir has a valid inheritance path

The jiha classifies the structural relationship between the heir and the deceased:

$j$NameArabicMembers
0SpouseزوجيةHusband, Wife
1DescendantبنوةSon, Daughter, Son’s Son, Son’s Daughter, …
2AscendantأبوةFather, Mother, Grandfather, Grandmother, …
3SiblingأخوةBrothers, Sisters (full, paternal, maternal), their sons
4UncleعمومةPaternal uncles (full, paternal), their sons

Source: The classical ordering of ʿaṣaba directions is: بنوة → أبوة → أخوة → عمومة (see faraid/asaba.md). Spouses ($j=0$) are added as a zeroth class because they exist outside the agnatic hierarchy.

The daraja is the number of generational links between the heir and the deceased:

Heir$d$
Son, Daughter, Father, Mother1
Son’s Son, Grandfather, Grandmother2
Son’s Son’s Son, Great-Grandfather3

For spouses, $d = 0$ (direct contractual bond, no generational distance).

The quwwa encodes the type of blood bond through the connecting ancestor:

$q$NameArabicMeaning
1FullشقيقConnected through both parents
2PaternalلأبConnected through father only
3MaternalلأمConnected through mother only
9N/ANot applicable (direct ancestors/descendants, spouses)

Design note: The value $q = 9$ (rather than $\bot$) ensures that heirs without a quwwa distinction sort last in any lexicographic comparison on this dimension, which is the correct behavior — direct ancestors/descendants are never disambiguated by quwwa.

The chain validity flag is a computed boolean: $c = 1$ if the heir has a valid inheritance path (is a farḍ or ʿaṣaba heir), $c = 0$ if the heir is dhawī al-arḥām (distant kindred).

This is the output of the eligibility test (see §3 below), not a raw coordinate.

Architectural advantage over alternatives: An earlier model used a line component (agnatic/uterine/bilateral) as the 5th dimension. But this information is already encoded in $(j, d, q, g)$. The $c$ flag answers the question the engine actually needs at runtime: is this person a real heir?


The family is represented as a Directed Acyclic Graph (DAG):

  • Each person is a node.
  • Each node stores pointers to its biological parents (at most two edges: father, mother).
  • The graph must be acyclic (no person is their own ancestor).

When an heir is added to an inheritance case, the system performs a Breadth-First Search from the heir node to the deceased node. The path is characterized by:

  • Pivot: The lowest common ancestor (LCA) of the heir and the deceased.
  • upSteps: Generations from the deceased up to the Pivot.
  • downSteps: Generations from the Pivot down to the heir.
HeirPivotupStepsdownSteps
SonDeceased01
FatherFather10
BrotherFather11
CousinGrandfather22
Son’s DaughterDeceased02

The BFS resolver converts the physical path into the mathematical 5-tuple:

ComponentDerivation
$g$Biological sex of the heir node
$j$Determined by path shape: $\text{upSteps}=0 \Rightarrow j=1$; $\text{downSteps}=0 \Rightarrow j=2$; $\text{upSteps}=1, \text{downSteps} \ge 1 \Rightarrow j=3$; $\text{upSteps} \ge 2, \text{downSteps} \ge 1 \Rightarrow j=4$; marital bond $\Rightarrow j=0$
$d$$\max(\text{upSteps}, \text{downSteps})$ for $j \in {1,2}$; $\text{downSteps}$ for $j \in {3,4}$
$q$Determined by the gender composition of the path through the pivot
$c$Computed by the eligibility predicates (§3)

3. Computing $c$: The Eligibility Predicates

Section titled “3. Computing $c$: The Eligibility Predicates”

The chain validity $c$ cannot be read directly from the graph — it must be computed from the path sequence. The rules decompose into three axis-specific predicates:

$$c = 1 \iff \text{no female intermediary in the path from deceased to heir}$$

PathSequence$c$
SonM1
Son’s DaughterM → F1
Daughter’s SonF → M0 (dhawī al-arḥām)

Source: faraid/hajb.md — descendants through a female intermediary are not among the prescribed heirs.

$$c = 1 \iff \text{no male between two females in the ascending path}$$

This is the grandmother path-sequence rule. By consensus (ijmāʿ):

“اتفق العلماء على عدم توريث: الجدة المدلية بذكر بين أنثيين” — faraid/jaddah.md

PathGender Sequence$c$Reason
Mother of MotherF → F1Valid
Mother of FatherF → M1Valid (Ḥanbalī: not excluded by father)
Mother of Mother of FatherF → F → M1Valid
Mother of Father of MotherF → M → F0Invalid: male between two females
Father of MotherM → F0Male ascendant through female = dhawī al-arḥām

Critical implementation constraint: The BFS resolver must output the full gender sequence of the ascending path, not just the scalar $d$. The boolean $c$ is then computed by a pattern-match on this sequence (checking for the substring $[\text{F}, \text{M}, \text{F}]$ or a male ancestor reached through a female).

$$c = 1 \iff \text{the path is purely agnatic AND the type constraints are met}$$

Specifically:

  • The path from the deceased up to the pivot must be through males only (agnatic ascent).
  • The path from the pivot down to the heir must be through males only, except for sisters (one step down, female).
  • $q \ne 3$ (maternal siblings inherit by farḍ only, not by ʿaṣaba; but they are valid heirs with $c = 1$).

For collaterals, the constraint is more precisely:

  • Brothers/sisters of all types ($d=1$): always $c = 1$ (including maternal siblings who inherit by farḍ).
  • Sons of brothers ($d \ge 2$): $c = 1$ only if the path downward from the pivot is through males and $q \ne 3$.

4. Universality: The 5-Tuple as Complete Invariant

Section titled “4. Universality: The 5-Tuple as Complete Invariant”

Every heir recognized by classical Islamic inheritance law is uniquely characterized by its 5-tuple. Two persons with identical $(g, j, d, q, c)$ receive identical treatment.

4.2 Verification Against Classical Heir Types

Section titled “4.2 Verification Against Classical Heir Types”
Classical Heir$g$$j$$d$$q$$c$
Husband10091
Wife00091
Son11191
Daughter01191
Son’s Son11291
Son’s Daughter01291
Father12191
Mother02191
Paternal Grandfather12291
Maternal Grandmother02291
Paternal Grandmother02291
Full Brother13111
Full Sister03111
Paternal Brother13121
Paternal Sister03121
Maternal Brother13131
Maternal Sister03131
Full Brother’s Son13211
Paternal Uncle14111
Paternal Uncle (half)14121
Daughter’s Son11290
Mother’s Father12290

Note on the Grandmother Ambiguity: Maternal grandmother and paternal grandmother both resolve to $(0, 2, 2, 9, 1)$ in the scalar tuple. They are distinguished by the path sequence stored in the resolver layer, which feeds into share assignment (the mother’s mother and the father’s mother may share the $\frac{1}{6}$). The 5-tuple determines eligibility and priority; the path origin determines which pool they share within.

Because the engine operates on the abstract 5-tuple rather than a hardcoded list of named relationships, any heir whose tuple can be resolved — even a “10th-degree great-grandson” — is handled correctly by the same axioms. This is the strongest practical evidence that the 5-tuple is the complete invariant.


For any two heir vectors $\vec{h}_1$ and $\vec{h}_2$, define the priority (used in Axiom $\alpha$ for ḥajb):

$$\pi(\vec{h}) = (1 - c, ; j, ; d, ; q)$$

Evaluated lexicographically (lower = higher priority):

  1. Valid heirs ($c=1$, so $1-c=0$) always outrank invalid ones ($c=0$, so $1-c=1$).
  2. Among valid heirs: lower jiha wins (descendants before ascendants before siblings before uncles).
  3. Same jiha: lower daraja wins (closer to the deceased).
  4. Same daraja: lower quwwa wins (full before paternal before maternal).

Within the same priority class, heirs coexist — they share according to Axiom $\beta$.


  • Architecture design: my findings/architercture-summary.md
  • Grandmother path rules: faraid/jaddah.md
  • Exclusion rules: faraid/hajb.md
  • ʿAṣaba ordering: faraid/asaba.md
  • Primary reference: Talkhīṣ Fiqh al-Farāʾiḍ (Ibn ʿUthaymīn)