Skip to content

HIDEKI-SQ/intelligence-relativity

Repository files navigation

Projective Theory of Intelligence

Empirical Validation of the Projective Theory of Intelligence

Tests SP Tests Python 3.10 License: MIT


Overview

This repository contains the complete empirical foundation for the Projective Theory of Intelligence, a theoretical framework proposing that:

Structure (S), Value (V), and Meaning (M) form the foundational triad where meaning emerges as the projection of structure under value illumination.

The framework establishes four fundamental observations:

  • O-1: Natural Orthogonality (SSC ≈ 0 at λ=0)
  • O-2: Topological Dominance (Phase > Metric)
  • O-3: Stress Tolerance (Independent axes)
  • O-4: Value-Gated Coupling (λ controls SSC)

Two Measurement Systems

This repository implements two complementary measurement systems:

System Version Metrics Papers Code
SSC v1.x Semantic-Spatial Correlation I-1, O-1 experiments/
SP v2.x Structural Preservation I-2, O-2, O-3, O-4 experiments_sp/

Both systems use Python 3.10.19 with identical core dependencies.


Repository Structure

intelligence-relativity/
├── src/
│   ├── core/                      # SSC measurement system (v1)
│   │   ├── ssc_computation.py     # SSC measurement
│   │   ├── deterministic.py       # Reproducibility
│   │   ├── generators.py          # Data generation
│   │   └── statistics.py          # Statistical tools
│   │
│   ├── core_sp/                   # SP measurement system (v2)
│   │   ├── sp_metrics.py          # SP computation (ARI-based SP_clu)
│   │   ├── ssc_wrapper.py         # SSC wrapper
│   │   ├── value_gate.py          # Value-gated coupling
│   │   ├── generators.py          # Embedding generation
│   │   ├── topology_ops.py        # Topological operations
│   │   ├── metric_ops.py          # Metric transformations
│   │   └── deterministic.py       # Environment verification
│   │
│   ├── experiments/               # SSC experiments (v1)
│   │   ├── exp_00_baseline.py             # O-1: Baseline
│   │   ├── exp_13_value_gate_sweep.py     # O-4: λ-sweep
│   │   ├── sup_exp_14_bert.py             # BERT validation
│   │   └── ... (17 experiments total)
│   │
│   └── experiments_sp/            # SP experiments (v2)
│       ├── i2_sp_instrument/              # I-2: Measurement system
│       ├── o2_topological_dominance_sp/   # O-2: Topology
│       ├── o3_stress_independence_sp_ssc/ # O-3: Independence
│       ├── o4_value_gate_tradeoff_sp/     # O-4: Value gate
│       └── sp_robustness/                 # Robustness
│
├── demos/                         # Application demos
│   ├── dr_evaluation/             # MNIST evaluation
│   └── things/                    # THINGS embedding demo
│       ├── THINGS_SSC_SP_Demo.ipynb
│       ├── things_demo_summary.csv
│       └── things_demo_raw_results.csv
│
├── results/                       # Experiment results
│   ├── v2.2.0/                    # Previous version results
│   └── v2.3.0/                    # Current version results
│       ├── summary_all_I2.csv
│       ├── summary_all_O2.csv
│       ├── summary_all_O3.csv
│       ├── summary_all_O4.csv
│       ├── summary_all_O4_extra.csv
│       └── summary_all_robust.csv
│
├── tests/                         # Test suite
│   ├── test_core.py              # SSC system tests
│   ├── test_core_sp/             # SP system tests
│   ├── test_experiments_sp/      # SP experiment tests
│   └── test_integration/         # Integration tests
│
├── .github/workflows/
│   ├── tests.yml                 # CI testing
│   ├── sp_tests.yml              # SP system tests
│   ├── run_experiments_sp.yml    # SP experiments
│   └── test_demo.yml             # Demo testing
│
├── requirements.txt              # Unified dependencies
├── CHANGELOG.md                  # Version history
└── README.md                     # This file

Installation

Requirements

  • Python 3.10.19
  • NumPy 1.24.3
  • SciPy 1.10.1
  • scikit-learn (for ARI computation)
  • (Optional) Transformers + PyTorch for BERT experiments
  • (Optional) umap-learn for dimensionality reduction demos

Setup

# Clone repository
git clone https://github.com/HIDEKI-SQ/intelligence-relativity.git
cd intelligence-relativity

# Install dependencies
pip install -r requirements.txt

Quick Start

SSC Experiments (v1)

# Run baseline experiment (O-1)
python -m src.experiments.exp_00_baseline

Output:

SSC: -0.0025 ± 0.0736
90% CI: [-0.0063, 0.0013]
✅ Natural orthogonality confirmed

SP Experiments (v2)

# Run identity/isometry baseline (I-2)
python -m src.experiments_sp.i2_sp_instrument.sp00_identity_isometry

Output:

SP_total: 1.000 (identity)
SP_total: 0.943-0.968 (rotation, all angles)
✅ Rotation invariance confirmed

Dimensionality Reduction Demo

# Compare t-SNE, UMAP, PCA on MNIST
python demos/dr_evaluation/run_dr_demo.py

Run Tests

# Run all tests
pytest tests/ -v

# Run specific subsystem
pytest tests/test_core.py -v              # SSC system
pytest tests/test_core_sp/ -v             # SP system
pytest tests/test_experiments_sp/ -v      # SP experiments

Core Concepts

Semantic-Spatial Correlation (SSC)

Primary measurement for O-1 validation:

from src.core import compute_ssc

# Compute SSC between semantic and spatial distances
ssc = compute_ssc(semantic_distances, spatial_distances)

# Expected: SSC ≈ 0 at λ=0 (Natural Orthogonality)

Structural Preservation (SP)

Three-component measurement for structure preservation:

from src.core_sp import compute_sp_total

# Compute SP between baseline and transformed coordinates
sp = compute_sp_total(
    base_coords=original_coords,
    trans_coords=transformed_coords,
    layout_type="grid"
)

# Components: SP_adj (adjacency), SP_ord (order), SP_clu (clustering)
# Returns: SP_total in [0, 1]

SP_ord (v2.2.0): Uses Kendall's τ on pairwise distances, ensuring rotation invariance.

SP_clu (v2.3.0): Uses Adjusted Rand Index (ARI) for cluster comparison, computed for all layout types. ARI is invariant to label permutation and corrects for chance agreement.

Value-Gated Coupling

Control semantic-spatial coupling via λ parameter:

from src.core_sp import apply_value_gate

# Apply value gate to coordinates
coords_gated = apply_value_gate(
    base_coords=coords,
    embeddings=semantic_embeddings,
    lam=0.5  # 0=no coupling, 1=full coupling
)

# Expected: SSC increases monotonically with λ (O-4)

Demos

THINGS Embedding Demo

Demonstrates SSC × SP measurement on human-derived similarity embeddings:

Location: demos/things/THINGS_SSC_SP_Demo.ipynb

What it does:

  • Loads THINGS embedding (1,854 object concepts, 120 dimensions)
  • Applies MDS, t-SNE, UMAP
  • Computes SSC and SP for each method
  • Compares across subset sizes and seeds

Example results (N=500, k_nn=10):

Method SSC SP_total SP_adj SP_ord SP_clu
MDS 0.725 0.422 0.127 0.772 0.367
t-SNE 0.661 0.532 0.350 0.738 0.507
UMAP 0.631 0.526 0.301 0.725 0.550

Key finding: MDS achieves highest SSC but lowest SP_adj, while t-SNE/UMAP balance local and global structure preservation.

Dimensionality Reduction Evaluation (MNIST)

Location: demos/dr_evaluation/

Compares t-SNE, UMAP, PCA on MNIST digit embeddings.


Experiment Results

v2.3.0 Results (1,000 trials)

Complete results in results/v2.3.0/:

I-2: Instrument Validation

Transform SP
Identity 1.000
Rotation (any angle) 0.943–0.968
Uniform scale 1.000
Full destruction 0.196

O-2: Topological Dominance

Condition SP
Topology p=0.7 0.343
Metric shear k=0.7 0.719

O-3: Independence (Stress Tolerance)

Stress Type SP SSC
Coord noise σ=0.7 0.219 ≈0
Semantic noise σ=0.7 1.000 ≈0

O-4: Value Gate (λ Trade-off)

λ SP SSC (Synth) SSC (BERT)
0.0 1.000 -0.001 -0.000
0.6 0.301 0.139 0.276
1.0 0.183 0.289 0.718

Reproducibility

Deterministic Execution

All experiments execute with:

  • Fixed seeds: Every random operation reproducible
  • Locked dependencies: Exact versions in requirements.txt
  • Single-threaded BLAS: Eliminates non-determinism
  • Environment logging: Automatic env.txt generation

Example

from src.core_sp import set_deterministic_mode, verify_environment

# Enable deterministic mode
set_deterministic_mode()

# Generate environment record
verify_environment("outputs_sp/env.txt")

CI/CD

  • Tests: Run on every push
  • Experiments: On-demand via GitHub Actions
  • Standard deviation: 0.00 across runs

Citation

@software{intelligence_relativity_2026,
  author = {HIDEKI},
  title = {Projective Theory of Intelligence: Empirical Validation},
  version = {2.3.0},
  year = {2026},
  url = {https://github.com/HIDEKI-SQ/intelligence-relativity},
  note = {Complete validation framework for SSC and SP measurement systems}
}

License

MIT License - see LICENSE file for details.


Contributing

This repository contains validated measurement systems. For extensions:

  1. Fork the repository
  2. Run test suite: pytest tests/ -v
  3. Add your extension
  4. Ensure deterministic reproducibility
  5. Submit pull request

Contact

Author: HIDEKI
ORCID: 0009-0002-0019-6608
Email: hideki@r3776.jp
GitHub: @HIDEKI-SQ
Repository: https://github.com/HIDEKI-SQ/intelligence-relativity

For questions or bug reports, please open an issue.


Version History

See CHANGELOG.md for detailed version history.

Latest: v2.3.0 - ARI-based SP_clu, computed for all layout types


Complete empirical foundation for the Projective Theory of Intelligence

Deterministic reproducibility across all experiments (Python 3.10.19, NumPy 1.24.3)

About

Toward a Projectivity of Intelligence: Experimental series and theoretical integration

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages