{
  "$schema": "../../../schemas/mko-v0.4.schema.json",
  "schema_version": "mko-v0.4",
  "id": "mko-relation",
  "semantic_family_id": "sf-relation",
  "type": "definition",
  "version": "0.10.0",
  "language": "zh-Hant",
  "titles": {
    "zh-Hant": "二元關係與集合投影"
  },
  "summary": {
    "zh-Hant": "二元關係是指定 A×B 中有序對的集合，不要求每個輸入唯一或必有輸出。"
  },
  "statement": {
    "zh-Hant": "對集合 A、B，從 A 到 B 的二元關係 R 是 A×B 的子集合；xRy 表示 (x,y)∈R。關係定義域 Dom(R)={x∈A:存在 y∈B，使 (x,y)∈R}，關係像 R[C]={y∈B:存在 x∈C，使 (x,y)∈R}，逆關係 R⁻¹={(y,x):(x,y)∈R}⊆B×A。"
  },
  "formula": {
    "tex": "R(x,y)",
    "mathml": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><mi>R</mi><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo></mrow></math>",
    "semantic_ast": {
      "type": "function_call",
      "callee": {
        "type": "symbol",
        "name": "R",
        "glyph": "R"
      },
      "arguments": [
        {
          "type": "symbol",
          "name": "x",
          "glyph": "x"
        },
        {
          "type": "symbol",
          "name": "y",
          "glyph": "y"
        }
      ]
    },
    "compiler": {
      "id": "ocme-formula-core",
      "version": "0.4.0",
      "source_sha256": "def9261af216c3fbcbc3e30454b404b1c72fd67fcca3144dec6fbfc83195fc55"
    }
  },
  "assumptions": [
    {
      "id": "a1",
      "zh-Hant": "來源 A、目標 B 和關係 R 已明示；C 是 A 的子集合。"
    },
    {
      "id": "a2",
      "zh-Hant": "有序對保留方向；本輪題庫是有限整數集合與有序對資料。"
    }
  ],
  "symbols": [
    {
      "token": "R",
      "role": "binary_relation",
      "role_zh": "指定二元關係",
      "scope": "representative_formula"
    },
    {
      "token": "x",
      "role": "source_element",
      "role_zh": "第一分量",
      "scope": "representative_formula"
    },
    {
      "token": "y",
      "role": "target_element",
      "role_zh": "第二分量",
      "scope": "representative_formula"
    }
  ],
  "dependencies": [
    {
      "id": "mko-set-membership",
      "title_zh": "集合成員關係",
      "reason_zh": "關係和有序對成員需用成員語義。"
    },
    {
      "id": "mko-set",
      "title_zh": "集合",
      "reason_zh": "來源、目標、投影與像都是集合。"
    }
  ],
  "explanation": {
    "paragraphs_zh": [
      "R 不必是總函數：一個第一分量可沒有或具有多個第二分量。把 R⊆A×B 的宣告來源 A 叫成 Dom(R) 會漏掉實際第一投影的差異。",
      "R[C] 只收集從 C 中元素連到的輸出，重複值只列一次。空關係與空輸入集合的像均為空。",
      "逆關係交換有序對方向並交換來源／目標；它不自動是反函數，也不提供單射、滿射或可逆性的證明。"
    ],
    "common_misconception_zh": "把宣告來源集合當成實際關係定義域，或把逆關係當成已存在的反函數。"
  },
  "proofs": [],
  "computational_companions": [],
  "verification": {
    "computational_status": "not_evaluated_no_computational_claim",
    "warning_zh": "明示有限關係可完整枚舉；一般關係性質及函數特殊化仍待形式化。",
    "evidence_refs": [],
    "producers": [
      {
        "id": "lean-mathlib",
        "adapter": "formal_system",
        "config_path": "formal/lean/lakefile.toml",
        "status": "configured"
      }
    ]
  },
  "formalization": {
    "status": "not_formalized",
    "target_systems": [
      "Lean 4",
      "Mathlib"
    ],
    "next_obligation_zh": "綁定 Set (A×B)、第一投影、關係像及 converse；函數條件保持為額外限制。"
  },
  "provenance": {
    "origin": "ocme_local_ai_materialization_candidate",
    "note_zh": "依 research/atlas-relation.md 整理；2026-10-03 脈衝 R03（依使用者要求提前完成 2026-10-04 的流程），英文及 Lean 依使用者指示延後。",
    "content_license": "CC-BY-SA-4.0",
    "code_license": "MIT",
    "created_at": "2026-10-03"
  }
}
