FunctionaL-City

🏛️ Constructor Refactor, Infinite Rules, and Why Union Needs a Revisit

Context

FunctionaL City’s algebraic infrastructure has advanced significantly. The original collapse to concrete logic gave us a way to reduce lifted unions into concrete sets. Since then, constructors have been refactored, infinite sets now use rule dictionaries, and implication logic is embedded directly into the constructors. This post documents those changes and explains why union is the next piece to revisit.


Plugging Infinite Evaluation Holes

Earlier, evaluating infinite sets risked runaway computation. The solution was to introduce bounded evaluation: comparisons are only made up to a fixed equivalenceDepth. This prevents uncontrolled expansion while still allowing symbolic exploration.

On top of that, every operation now classifies its result as:

This classification is attached to results along with provenance notes, so remixers can see not just what happened, but why.


Constructor Architecture

Two constructors now define how sets are built:


Set Difference and Implication

Set difference was introduced as a core operation, and implication checks now use it directly. Instead of naïvely enumerating infinite sets, differences are bounded and classified.

This ensures infinite sets are narratable without risking runaway evaluation. Each result carries provenance notes, counterexamples, and cardinality checks.

Examples from recent tests

Implication: ℕ ⇒ ℤ

Success: true 
Message: "All members of ℕ are contained in ℤ — implication holds" 
Provenance: ℕ ⊆ ℤ within bounded depth

Implication: ℤ ⇒ ℕ

Success: false 
Message: "Implication fails — ℤ contains members not in ℕ" 
Counterexamples: [-1; -2; -3; -4; ...]

Implication: setA ⇒ setB

Success: false 
Message: "Implication fails with 2 counterexample(s) found" 
Counterexamples: [2; 4]

Set Difference: ℤ \ ℕ

Success: true 
Message: "Result (ℤ \ ℕℤ) has ℵ₀ cardinality — may be lazily enumerable or infinite" 
Elements (sample): [-1; -2; -3; -4; -5; ...]

Set Difference: ℕ \ Oddsℕ (Odds is a finite set)

Success: true 
Message: "Result (ℕ \ Oddsℕ) has ℵ₀ cardinality — may be lazily enumerable or infinite" 
Elements (sample): [0; 2; 4; 6; 8; 10; 11; 12; 13; 14]

These outputs show how implication and difference now produce diagnostic results with provenance notes, counterexamples, and cardinality checks. Infinite sets are no longer dangerous black boxes — they are bounded, classified, and inspectable.


Why Union Needs a Revisit

Union was originally designed before several key advances in the infrastructure:

With the new architecture in place, union must evolve to align with these changes.

Goals for the Union Revisit

  1. Integrate rule-based infinite sets
    Unions should carry symbolic formulas and registry provenance, not just lifted wrappers.

  2. Narrate compatibility checks
    Collapse should emit overlays when provenance differs or a comparer is missing, so remixers can see why a union is lawful or rejected.

  3. Leverage implication + difference
    Union should scaffold distributivity and absorption laws, using the same bounded evaluation and classification strategy as difference and implication.

  4. Support mixed unions
    Finite ∪ infinite unions should produce symbolic overlays, preserving lineage and computability notes.

By revisiting union with these principles, FunctionaL City ensures that set theory operations remain narratable, remixable, and practical for both coders and remixers.


Next Ordinances

By codifying these ordinances ensures that union joins is a fully narratable and remix‑safe operation.


City Limits

Primitives ordinance book.

First Order Logic ordinance book.

Civic Set ordinance book.

📬 Future Message from the Mayor Dispatches

Keep an eye out for future editions of Message from the Mayor as the city grows and random musings develop along the way. In the meantime, keep an eye on the BlogDistrict README.md for updates.


With this amendment ratified and the roadmap charted, FunctionaL City continues its march toward a narratable, remixable civic future.

Signed, FrankL
Mayor and City Engineer of FunctionaL City