You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CFLs not closed under intersection — explicit witnesses (cfl_not_closed_inter) (#109)
Completes §7.3: the explicit **"context-free languages are not closed
under intersection"** theorem, built from scratch in core Lean
(Mathlib-free, single-file). Follow-up to #108 (`aⁿbⁿcⁿ ∉ CFL`).
## `cfl_not_closed_inter`
```
∃ K₁ K₂, IsCFL K₁ ∧ IsCFL K₂ ∧ ¬ IsCFL (fun w => K₁ w ∧ K₂ w)
```
Witnesses `L₁ = {aⁱbⁱcʲ : i,j ≥ 1}` and `L₂ = {aᵐbⁿcⁿ : m,n ≥ 1}`:
- **Each is context-free** — an explicit ε-free binary-normal-form
grammar (`R1`, `R2`, 7 nonterminals each: start, the balanced-pair
recursion, the star recursion, three terminals) with **full exact
generation**:
- *soundness* (`sound_all1` / `sound_all2`): one structural induction
over the parse tree with inversion on the root production — every tree's
yield lies in its nonterminal's language (`Char1` / `Char2`);
- *completeness* (`tree_X1`/`tree_Y1`, `tree_A2'`/`tree_W2`): a parse
tree built for every word in the language.
- **Their intersection is `{aⁿbⁿcⁿ}`** (`inter_eq`): `L₁` forces `#a =
#b`, `L₂` forces `#b = #c`; equating the three letter-counts
(`count_tri_a/b/c`) forces all three equal.
- `{aⁿbⁿcⁿ}` is **not** context-free (`anbncn_not_cfl`, #108) —
contradiction.
Closure under **complement** is refuted by the same witnesses via De
Morgan against CFL ∪-closure (noted in the docstring).
## Trust base
Standard classical kernel constants only: `cfl_not_closed_inter` →
`propext, Classical.choice, Quot.sound`;
`isCFL_L1`/`isCFL_L2`/`inter_eq` → `propext, Quot.sound`. No holes, no
project-specific assumptions (axiom table in
`GRAMMAR-PROOF-INVENTORY.md`).
## Verification
`lean docs/proofs/verification/WokeGrammarPumping.lean` exits 0, no
warnings.
With this, **§7 is fully machine-checked end-to-end**: Chomsky position,
non-regularity (DFA fooling-set), CFL positive closure (∪, ·, *), the
CFL pumping lemma, `aⁿbⁿcⁿ ∉ CFL`, and ∩ non-closure — all from scratch,
Mathlib-free.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_015oyMquf4daB6hMhmqB1wAL
---
_Generated by [Claude
Code](https://claude.ai/code/session_015oyMquf4daB6hMhmqB1wAL)_
Co-authored-by: Claude <noreply@anthropic.com>
| T7.3b | §7.3 CFL **not** closed under ∩, ¬ | ⚠️ canonical witness done; wrapper remaining|**P6**|`aⁿbⁿcⁿ ∉ CFL` (T7.0b) is the crux and is proved; remaining: the two witness CFLs `{aⁿbⁿcᵐ}`,`{aᵐbⁿcⁿ}`(BNF grammars + exact generation) whose intersection is `aⁿbⁿcⁿ`| IN PROGRESS|
76
+
| T7.3b | §7.3 CFL **not** closed under ∩| ✅ done from scratch|**P6→done**|`WokeGrammarPumping.lean`: `cfl_not_closed_inter` — witnesses `L₁={aⁱbⁱcʲ}`,`L₂={aᵐbⁿcⁿ}`are CFL (explicit BNF grammars `R1`,`R2` + soundness via tree inversion + completeness via tree building), `L₁∩L₂={aⁿbⁿcⁿ}` not CFL (T7.0b) | MACHINE-CHECKED|
0 commit comments