{
  "id": "KL-FCS-061",
  "version": "1.0.0",
  "domain": "Relational algebra",
  "kind": "relational",
  "title": "Intersection distributes over union",
  "problem": "Decide the proposed set identity over every triple of finite-universe relations.",
  "specification": {
    "universe_size": 3,
    "law": "intersection-distribution",
    "semantics": "Mathematical sets; unique values; no NULL or tuple multiplicity."
  },
  "claim": {
    "equivalent_on_domain": true
  },
  "witness": {
    "sample": {
      "A": [
        0,
        1
      ],
      "B": [
        1,
        2
      ],
      "C": [
        0
      ],
      "left": [
        0,
        1
      ],
      "right": [
        0,
        1
      ]
    }
  },
  "verification_scope": "Complete relation assignments · 512 triples",
  "explanation": "The finite universe makes every relation assignment enumerable. The sample output illustrates the identity or supplies a direct refutation.",
  "limitations": "Finite enumeration is bounded to this universe; these artifacts do not certify an SQL optimizer or measured execution speed.",
  "verification_status": "mechanically-checked",
  "review_status": "awaiting-independent-review",
  "provenance": {
    "origin": "Original Kenton Labs reference instance, authored with Codex assistance on 2026-10-11.",
    "external_dataset": null,
    "model_run": null
  },
  "references": [
    "https://www.postgresql.org/docs/current/explicit-joins.html"
  ],
  "license_status": "not-yet-selected",
  "dataset": {
    "family": "relational-algebra",
    "task": "Decide the proposed set identity over every triple of finite-universe relations.",
    "input_encoding": "Structured JSON; field meanings are stated in the specification.",
    "coverage": "Complete relation assignments · 512 triples",
    "acceptance": [
      "Enumerate every subset of the universe.",
      "Evaluate both expressions on every triple of sets.",
      "Compare the complete finite-domain outputs.",
      "Replay a concrete sample, including a differing output for a false identity."
    ],
    "generation": "Deterministic finite fixture; full enumeration or witness replay as stated.",
    "split_policy": "Reference corpus for exposition and reproduction; no train/test evaluation split is claimed."
  },
  "lesson": {
    "motivation": "Check query identities over explicit finite set semantics, and retain counterexamples to invalid rewrites.",
    "definitions": [
      {
        "term": "Set semantics",
        "definition": "Each value occurs at most once; duplicates and NULLs are absent."
      },
      {
        "term": "Relational identity",
        "definition": "Two query expressions with the same output on every admitted relation."
      },
      {
        "term": "Counterexample",
        "definition": "A concrete set assignment making the outputs differ."
      }
    ],
    "reasoning": [
      "Enumerate every subset of the universe.",
      "Evaluate both expressions on every triple of sets.",
      "Compare the complete finite-domain outputs.",
      "Replay a concrete sample, including a differing output for a false identity."
    ],
    "worked_example": "The finite universe makes every relation assignment enumerable. The sample output illustrates the identity or supplies a direct refutation.",
    "complexity": "A universe of n values has 2ⁿ subsets; three relation inputs create 2³ⁿ assignments.",
    "common_error": "SQL bag semantics, NULL values, and outer joins can invalidate a rewrite valid for mathematical sets.",
    "further_work": "Add equijoin trees, bag multiplicities, NULL handling, and an explicit query-cost model."
  },
  "related_ids": [
    "KL-FCS-062",
    "KL-FCS-063"
  ]
}
