{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-pumping-lemma-regular-languages-01",
  "mko_id": "mko-pumping-lemma-regular-languages",
  "title": {
    "zh-Hant": "DFA迴圈量詞與a^n b^n反證",
    "en": "DFA-loop quantifiers and the a^n b^n contradiction"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-pumping-lemma-regular-languages-01",
    "source": {
      "mko_id": "mko-pumping-lemma-regular-languages",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "7466612ae549a8cda880e2921d8c9163ab7681371f543eb905240583b66e6ed4",
      "english_sha256": "b98a8e7b0fb61714b4bea18947593dabe418b1c724d8240eaba1b40c826bd9ec"
    },
    "mode": "theorem_proof",
    "audience_prerequisites": [
      "work"
    ],
    "goal": {
      "zh-Hant": "可見量詞次序、全pump count迴圈證明及全部合法splits。",
      "en": "Expose quantifier order, the all-pump-count loop argument and every legal split."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "前半令D為任意完整DFA，R=L(D)，p=|Q|≥1。後半的L={a^n b^n:n≥0}是另一本欲否定regular的語言；其p只在前半必要條件證成後由regular假設取得。",
          "en": "First let D be any complete DFA, R=L(D), with p=|Q|≥1. The later L={a^n b^n:n≥0} is a separate language whose regularity is to be refuted; its p is obtained from the regularity assumption only after the first part proves the necessary condition."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "work"
        ],
        "before_tex": "\\mathcal T:\\ R\\text{ regular}\\Longrightarrow\\text{the following pumping condition}",
        "after_tex": "\\text{Target: }\\exists p\\ge1\\ \\forall w\\in R,\\ |w|\\ge p\\ \\exists x,y,z\\ \\forall i\\ge0:\\ w=xyz,\\ |xy|\\le p,\\ |y|>0,\\ xy^iz\\in R",
        "relation": "definition",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "此步只設定待證目標與量詞責任，不宣告目標已成立：word先選，split後選，pump count最後選。",
          "en": "This step sets a proof target and its quantifier obligations, not an established conclusion: word first, split next, pump count last."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "work"
          ],
          "explanation": {
            "zh-Hant": "目標將由S02至S04證明；不可把目標自身用作那些證明的前提。",
            "en": "S02 through S04 prove the target; the target itself is not a premise of that proof."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "work"
        ],
        "before_tex": "w\\in R,\\ |w|\\ge p\\text{ arbitrary};\\quad q_j=\\delta^*(q_0,w[0:j])\\ (0\\le j\\le p)",
        "after_tex": "\\exists0\\le r<s\\le p:\\ q_r=q_s",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "任取合格word，前p個symbol給p+1個prefix位置落p個states，鴿籠給重複state。",
          "en": "For an arbitrary qualified word, p+1 prefix positions in p states yield a repeated state by pigeonhole."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "work"
          ],
          "explanation": {
            "zh-Hant": "states序列包含讀零個symbol的q0；論證只用DFA與鴿籠，不用未證目標。",
            "en": "The sequence includes q0 before input; the argument uses the DFA and pigeonhole, not the unproved target."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "S02",
          "work"
        ],
        "before_tex": "x=w[0:r],\\ y=w[r:s],\\ z=w[s:|w|]",
        "after_tex": "|xy|=s\\le p,\\quad|y|=s-r>0,\\quad\\delta^*(q_r,y)=q_r",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "重複state間word片段形成非空loop。",
          "en": "The word segment between repeated states forms a nonempty loop."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S02",
            "work"
          ],
          "explanation": {
            "zh-Hant": "half-open slices給xyz=w且不漏字元。",
            "en": "Half-open slices give xyz=w without omitting symbols."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S04",
        "uses": [
          "G1",
          "S03",
          "work"
        ],
        "before_tex": "\\delta^*(q_r,y)=q_r,\\quad\\delta^*(q_0,w)\\in F",
        "after_tex": "\\forall i\\ge0:\\ \\delta^*(q_0,xy^iz)=\\delta^*(q_0,w)\\in F",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "i=0空loop是base，每多一次y回同state；歸納證所有pump counts均接受。w原先任意，故此刻才完成S01全稱目標。",
          "en": "Zero iterations are the base; each added y returns to the same state, proving acceptance for all pump counts. Since w was arbitrary, this now establishes the universal target of S01."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S03",
            "work"
          ],
          "explanation": {
            "zh-Hant": "結論來自loop invariant，不是測幾個i；|Q|給對所有合格w共同的p。",
            "en": "The loop invariant, not finite i tests, proves the claim;|Q| supplies one p for every qualified w."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S05",
        "uses": [
          "G1",
          "S04",
          "work"
        ],
        "before_tex": "\\text{assume }L=\\{a^nb^n:n\\ge0\\}\\text{ regular};\\quad p\\text{ from the proved condition}",
        "after_tex": "w=a^pb^p\\in L,\\quad |w|=2p\\ge p",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "regular語言具有完整DFA，故現在可用S04已證的必要條件取得p，再選反證word。",
          "en": "A regular language has a complete DFA, so the necessary condition proved at S04 now supplies p before the contradiction word is chosen."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S04",
            "work"
          ],
          "explanation": {
            "zh-Hant": "p先由regular假設及已證條件給出，word再依p選；不是把欲證目標當原始given。",
            "en": "The regularity assumption and proved condition supply p first; the word then depends on p, rather than assuming the unproved target."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "S05",
          "work"
        ],
        "before_tex": "w=xyz,\\quad|xy|\\le p,\\quad|y|>0",
        "after_tex": "x=a^r,\\quad y=a^s,\\quad z=a^{p-r-s}b^p,\\quad0\\le r,\\ 1\\le s,\\ r+s\\le p",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "任意合法split都完全落前p個a內；以(r,s)參數列出全部splits。",
          "en": "Every legal split lies within the first p a's; parameters(r,s) describe all splits."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S05",
            "work"
          ],
          "explanation": {
            "zh-Hant": "沒有假定prover選某個特定split。",
            "en": "No particular prover-selected split is assumed."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S07",
        "uses": [
          "G1",
          "S06",
          "work"
        ],
        "before_tex": "\\forall(r,s):0\\le r,\\ 1\\le s,\\ r+s\\le p,\\quad i=0",
        "after_tex": "xy^0z=a^{p-s}b^p\\notin L\\quad\\text{since }p-s<p",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對每個合法split，同一pump count0都破壞a與b數相等。",
          "en": "For every legal split, pump count 0 destroys equality of a- and b-counts."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S06",
            "work"
          ],
          "explanation": {
            "zh-Hant": "s≥1保證嚴格少a，涵蓋全部splits而非選一案。",
            "en": "s≥1 guarantees strictly fewer a's, covering every split rather than one case."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S08",
        "uses": [
          "G1",
          "S07",
          "work"
        ],
        "before_tex": "\\forall p\\ge1\\ \\exists w\\in L\\ \\forall\\text{ legal splits}\\ \\exists i\\ge0:\\ xy^iz\\notin L",
        "after_tex": "L=\\{a^nb^n:n\\ge0\\}\\text{ is not regular}",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "這是pumping必要條件的量詞否定，因此反證regular假設。",
          "en": "This is the quantified negation of the necessary pumping condition, contradicting regularity."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S07",
            "work"
          ],
          "explanation": {
            "zh-Hant": "對照p=3時全部(r,s)為(0,1),(0,2),(0,3),(1,1),(1,2),(2,1)，皆由同公式拒絕。",
            "en": "At p=3 the complete pairs are(0,1),(0,2),(0,3),(1,1),(1,2),(2,1), all refuted by the same formula."
          }
        },
        "leaf_basis": "work"
      }
    ],
    "result": {
      "zh-Hant": "DFA loop證regular語言的必要pumping property；全部合法splits使a^n b^n非regular。",
      "en": "The DFA loop proves the necessary pumping property for regular languages; all legal splits refute regularity of a^n b^n."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "挑一個split失敗就證非regular。",
          "en": "One failing split proves nonregularity."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "須對prover所有合法splits都提供失敗i。",
          "en": "Every legal prover split needs a refuting i."
        }
      },
      {
        "claim": {
          "zh-Hant": "regular可由有限pump tests證成。",
          "en": "Finite pump tests prove regularity."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "必要條件不等充分條件，且要求全words、全i。",
          "en": "The property is necessary, not sufficient, and quantifies over all words and i."
        }
      },
      {
        "claim": {
          "zh-Hant": "合法y可含b。",
          "en": "A legal y may contain b here."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "|xy|≤p而前p字元全a，故y只含a。",
          "en": "Because|xy|≤p and the first p symbols are all a, y contains only a."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "固定量詞順序exists p forall w in L with |w|≥p exists x,y,z forall i≥0，且w=xyz、|xy|≤p、|y|>0、xy^i z∈L。regular positive family由完整DFA run中的repeated-state loop提供對所有i的symbolic closure，不只測若干i。對L={a^n b^n}選w=a^p b^p，完整枚舉所有合法splits；每個y皆只含a，選i=0即離開L。單一decomposition、有限words或bounded checks不能證regular，且不得倒置對手選word與證明者選decomposition的量詞。",
          "en": "Keep the quantifier order: there exists p, for every w in L with |w|≥p, there exist x,y,z, for every i≥0, with w=xyz, |xy|≤p, |y|>0 and xy^i z in L. Positive regular families use a repeated-state loop in a complete DFA run and a symbolic invariant for every i, not a few pump tests. For L={a^n b^n}, choose w=a^p b^p and address every legal split: y consists only of a symbols, so i=0 leaves the language. One decomposition, bounded words or finite checks do not prove regularity. The adversary chooses the word before the prover chooses the split and the adversary chooses i after that."
        },
        "source": {
          "mko_id": "mko-pumping-lemma-regular-languages",
          "sha256": "7466612ae549a8cda880e2921d8c9163ab7681371f543eb905240583b66e6ed4",
          "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f"
        }
      },
      {
        "id": "work",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "regular語言可由完整有限DFA接受；另使用DFA確定run、鴿籠原理、word分割與長度、數學歸納和量詞否定。目標宣告只是設定待證命題；pumping必要性由DFA run證成，不作自身前提。",
          "en": "A regular language is accepted by a complete finite DFA; also use deterministic runs, pigeonhole, word slicing and length, induction and quantifier negation. A target declaration only sets the proposition to prove; the DFA run establishes pumping necessity without assuming it."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N01",
        "lhs": "1+2+3",
        "rhs": "6"
      },
      {
        "id": "N02",
        "lhs": "3-1",
        "rhs": "3",
        "relation": "<"
      },
      {
        "id": "N03",
        "lhs": "3-3",
        "rhs": "3",
        "relation": "<"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "regular必要條件，非充分條件；不以有限pump tests證regular。",
      "en": "A necessary condition for regularity, not sufficient; no finite pumping tests prove regularity."
    },
    "md_symbols": [
      [
        "p",
        "DFA state數或假設pumping長度",
        "DFA state count or assumed pumping length"
      ],
      [
        "r,s",
        "全部split參數",
        "parameters of all legal splits"
      ],
      [
        "i",
        "最後選的pump count",
        "last-chosen pump count"
      ]
    ],
    "md_error_controls": [
      {
        "title": "量詞順序 / Quantifier order",
        "zh": "p先給、word再選、split回應、i最後攻擊。",
        "en": "p first, then word, then split response, then i."
      },
      {
        "title": "全split / All splits",
        "zh": "以0≤r、1≤s、r+s≤p完整參數化，不列幾個samples代替。",
        "en": "Parameterize all splits by 0≤r,1≤s,r+s≤p rather than a few samples."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "74020259b19fb881bf3f9e3f2ce15d36f3ba93deaa04bee651ffdee1cc305948",
    "original_source_sha256": "ba5e44306bc5a91679067d83527f25fce70d5e9a74dad386eb916092392fbdb2",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "reader_review": "142_of_142_source_bound",
    "wording_review": "original_Lead_decisions_resolved",
    "glossary_reader_paraphrases": [],
    "independent_AI_concurrence": "SCOPED_LEAD_AND_BILINGUAL_CONTEXT_REVIEW",
    "issue_ids": [
      "BR142-S253",
      "BR142-S252"
    ],
    "parent_manifest_sha256": "d29f4cae8229ebd24f60d496cb1d3cd4ad8c0a4dca9d44daab0c3245c544283a",
    "scope": "Owner-adopted reader revision. Lead and bilingual review concern the recorded text and premises; no new universal or Lean proof, canonical promotion or historical-label rewrite."
  }
}
