{
  "$schema": "../../../schemas/mko-v0.4.schema.json",
  "schema_version": "mko-v0.4",
  "id": "mko-random-variable",
  "semantic_family_id": "sf-random-variable",
  "type": "definition",
  "version": "0.10.0",
  "language": "zh-Hant",
  "titles": {
    "zh-Hant": "有限樣本空間的實值隨機變數"
  },
  "summary": {
    "zh-Hant": "有限模型中的隨機變數是基本結果到實數的總函數；它不是基本結果，也不是權重本身。"
  },
  "statement": {
    "zh-Hant": "在非空有限樣本空間 S、事件族 F=𝒫(S) 和合法機率律 P 下，實值隨機變數為總函數 X:S→R。對任何實數子集合 T，其原像 {s∈S:X(s)∈T} 是事件；點機率 P(X=t) 是所有 X(s)=t 的結果權重之和。"
  },
  "formula": {
    "tex": "X:S\\to R",
    "mathml": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><mi>X</mi><mo>:</mo><mi>S</mi><mo>→</mo><mi>R</mi></mrow></math>",
    "semantic_ast": {
      "type": "mapping",
      "function": {
        "type": "symbol",
        "name": "X",
        "glyph": "X"
      },
      "domain": {
        "type": "symbol",
        "name": "S",
        "glyph": "S"
      },
      "codomain": {
        "type": "symbol",
        "name": "R",
        "glyph": "R"
      }
    },
    "compiler": {
      "id": "ocme-formula-core",
      "version": "0.4.0",
      "source_sha256": "af797de7d4c2e57e5eb44c962b613473a75e8991e875f8629d5c21ebd68081ef"
    }
  },
  "assumptions": [
    {
      "id": "a1",
      "zh-Hant": "S 非空有限，事件族為全冪集，X 在每個基本結果有唯一實數值。"
    },
    {
      "id": "a2",
      "zh-Hant": "值、值域、原像事件題只讀取函數資料，不猜機率律；點機率題另明示合法有理權重。"
    }
  ],
  "symbols": [
    {
      "token": "X",
      "role": "real_random_variable",
      "role_zh": "實值隨機變數",
      "scope": "representative_formula"
    },
    {
      "token": "S",
      "role": "finite_sample_space",
      "role_zh": "非空有限樣本空間",
      "scope": "representative_formula"
    },
    {
      "token": "R",
      "role": "real_codomain",
      "role_zh": "實數陪域",
      "scope": "representative_formula"
    }
  ],
  "dependencies": [
    {
      "id": "mko-function-mapping",
      "title_zh": "函數映射",
      "reason_zh": "隨機變數的函數總定義性。"
    },
    {
      "id": "mko-sample-space",
      "title_zh": "樣本空間",
      "reason_zh": "輸入是基本結果而不是隨機變數值。"
    },
    {
      "id": "mko-real-number",
      "title_zh": "實數",
      "reason_zh": "輸出限定實數。"
    },
    {
      "id": "mko-probability",
      "title_zh": "有限樣本空間上的機率",
      "reason_zh": "點機率需要權重及事件機率。"
    }
  ],
  "explanation": {
    "paragraphs_zh": [
      "不同基本結果可以有相同隨機變數值；值域去除重複值，但計算點機率時須把所有原像權重相加。",
      "原像事件可由 X(s)≥t 等明示條件篩選基本結果。事件集合不是一個數值機率，沒給權重時不假設等可能。",
      "本輪使用整數結果標籤與整數輸出值的精確切片。有限全冪集使所有原像皆為事件；一般可測空間、連續密度與機率分布表示另有義務。"
    ],
    "common_misconception_zh": "把隨機變數當成一次抽樣結果、把值域基數當成機率，或漏加相同輸出值的權重。"
  },
  "proofs": [],
  "computational_companions": [],
  "verification": {
    "computational_status": "not_evaluated_no_computational_claim",
    "warning_zh": "有限函數和點質量可完整重算；一般可測性與分布推前的形式橋仍未附 Evidence。",
    "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": "綁定有限 PMF、總函數、preimage event 與 pushforward；一般 Measurable 另列。"
  },
  "provenance": {
    "origin": "ocme_local_ai_materialization_candidate",
    "note_zh": "依 research/atlas-random-variable.md 整理；2026-10-04 脈衝 R05（使用者手動接續 2026-10-05 工作序列；實際日期仍為 2026-10-04），英文及 Lean 依使用者指示延後。",
    "content_license": "CC-BY-SA-4.0",
    "code_license": "MIT",
    "created_at": "2026-10-04"
  }
}
