diff --git a/.github/workflows/c296-regular-point-chart.yml b/.github/workflows/c296-regular-point-chart.yml new file mode 100644 index 000000000..72f647d0e --- /dev/null +++ b/.github/workflows/c296-regular-point-chart.yml @@ -0,0 +1,56 @@ +name: C296 regular-point chart + +on: + pull_request: + paths: + - "frontiers/regular_point_chart_20261020/**" + - ".github/workflows/c296-regular-point-chart.yml" + workflow_dispatch: + +permissions: + contents: read + +jobs: + regular-point-chart: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + fetch-depth: 0 + - uses: leanprover/lean-action@f061402b660e0c34644504b324e830f2991d4865 + with: + auto-config: 'false' + build: 'false' + test: 'false' + lint: 'false' + use-mathlib-cache: 'true' + use-github-cache: 'false' + lake-package-directory: frontiers/regular_point_chart_20261020 + - name: Build and kernel-check the exact C296 interface + working-directory: frontiers/regular_point_chart_20261020 + run: | + set -euo pipefail + lean --version + lake build RegularPointChart RegularPointChartInterface + lake env lean -E warning RegularPointChart.lean + lake env lean -E warning RegularPointChartInterface.lean + lake env leanchecker RegularPointChart + lake env leanchecker RegularPointChartInterface + lake env lean RegularPointChartAxiomAudit.lean + - name: Mutation-test the negative diagnostic classifier + working-directory: frontiers/regular_point_chart_20261020 + run: | + set -euo pipefail + bash scripts/test_negative_classifier.sh + - name: Require omission of noncriticality to be rejected + working-directory: frontiers/regular_point_chart_20261020 + run: | + set -euo pipefail + set +e + lake env lean WithoutNoncriticality.lean > negative.log 2>&1 + status=$? + set -e + cat negative.log + bash scripts/classify_negative.sh negative.log "$status" diff --git a/docs/superpowers/plans/2026-10-20-c296-regular-point-chart.md b/docs/superpowers/plans/2026-10-20-c296-regular-point-chart.md new file mode 100644 index 000000000..f09c352f4 --- /dev/null +++ b/docs/superpowers/plans/2026-10-20-c296-regular-point-chart.md @@ -0,0 +1,111 @@ +# C296 Regular-Point Chart Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Kernel-check the literal regular scalar chart at a noncritical point of the project space `E d`, without weakening C294's closed-superlevel local-path-connectivity premise. + +**Architecture:** Add one isolated Lean package based on Math- PR #487 head `7af365e8c8db1ae0275d4efe08a70a678f153ca2`. The package copies C294's exact `Lifetime.lean` input, proves only the strict-derivative/surjective-derivative chart interface, and carries positive, negative, and axiom-audit modules. A packet-specific GitHub workflow provides red-then-green hosted execution because the local runtime cannot read `/proc//exe` in this environment. + +**Tech Stack:** Lean 4.34.1; Mathlib `d13f23b723b8a846827a245b89c10fc7d3f11612`; GitHub Actions `leanprover/lean-action@f061402b660e0c34644504b324e830f2991d4865`. + +**Spec:** `frontiers/critical_level_attainment_20261020/SCOPE.md`, narrowed by C295 finding `Math-#487/6289066726` and C296 pickup `Math-#487/6289277782`. + +## Global Constraints + +- Preserve every existing C294/C293 byte; the new packet is additive. +- Scientific effect remains NONE; no formal or scientific registry promotion. +- Do not prove or suggest a critical-point Morse chart, quotient transport, half-space relative LPC, or removal of C294's `LocallyPathConnectedSpace` premise. +- Pin Lean 4.34.1, Mathlib `d13f23b723b8a846827a245b89c10fc7d3f11612`, and every hosted source head used as evidence. +- Treat the local `/proc//exe` denial as a stop for local Lean execution; do not patch or bypass it. + +## Review Focus + +- Noncriticality must be used to prove the scalar derivative is nonzero; the negative module omits exactly that premise. +- Continuous-linear-map versus linear-map coercion must preserve the exact derivative and range statement. +- First-coordinate equality is global as a function equality, while inverse/homeomorphism claims remain restricted to source/target. +- The base point and `(g x, 0)` must be proved members of the chart's source and target. +- No theorem may silently imply closed-superlevel local path connectivity at critical points. + +--- + +### Task 1: Hosted red test for the missing project chart + +**Files:** +- Create: `frontiers/regular_point_chart_20261020/lean-toolchain` +- Create: `frontiers/regular_point_chart_20261020/lakefile.toml` +- Create: `frontiers/regular_point_chart_20261020/Lifetime.lean` +- Create: `frontiers/regular_point_chart_20261020/RegularPointChart.lean` +- Test: `frontiers/regular_point_chart_20261020/RegularPointChartInterface.lean` +- Create: `.github/workflows/c296-regular-point-chart.yml` + +**Interfaces:** +- Consumes: C294 `UniversalLaw.Spec.Lifetime.E`, `IsSmooth`, and `IsCriticalPoint` from the exact copied `Lifetime.lean`. +- Produces: a failing interface test naming the intended `regularPointChart` declaration and its source/target identities. + +- [x] **Step 1: Write the failing interface test** + +The test imports `RegularPointChart` and invokes the wished-for chart plus first-coordinate, self, source-membership, and target-membership declarations at arbitrary `d`, `g`, and `x` under smoothness and noncriticality. + +- [x] **Step 2: Run the hosted test to verify it fails** + +Run: open a draft PR from `codex/c296-regular-point-chart-20261020` to `codex/c294-critical-level-attainment-20261020` and wait for `c296-regular-point-chart`. + +Expected: FAIL at the exact red commit because `regularPointChart` (or its first intended helper) is unknown; setup/toolchain/source errors do not count as RED. + +- [x] **Step 3: Commit the red harness** + +Commit message: `test: pin C296 regular-point chart interface` + +### Task 2: Minimal literal chart implementation + +**Files:** +- Modify: `frontiers/regular_point_chart_20261020/RegularPointChart.lean` +- Test: `frontiers/regular_point_chart_20261020/RegularPointChartInterface.lean` +- Test: `frontiers/regular_point_chart_20261020/WithoutNoncriticality.lean` +- Test: `frontiers/regular_point_chart_20261020/RegularPointChartAxiomAudit.lean` + +**Interfaces:** +- Consumes: `(hg 1).hasStrictFDerivAt`, `Module.Dual.range_eq_top_of_ne_zero`, and `HasStrictFDerivAt.implicitToOpenPartialHomeomorph` at the pinned Mathlib revision. +- Produces: `regularPointDerivative_range_eq_top`, `regularPointHasStrictFDerivAt`, `regularPointChart`, `regularPointChart_fst`, `regularPointChart_self`, `mem_regularPointChart_source`, and `mem_regularPointChart_target`. + +- [x] **Step 1: Implement only the derivative and chart declarations required by the failing interface test** + +Use `fderiv ℝ g x` literally; derive strict differentiability from `IsSmooth`; convert noncriticality to a nonzero continuous linear functional, then to full scalar range; invoke the existing Mathlib chart. + +- [x] **Step 2: Add the omitted-noncriticality interface rejection** + +The negative module must fail by leaving the required `¬ IsCriticalPoint d g x` argument unsupplied. The workflow must require a nonzero exit and a diagnostic mentioning `IsCriticalPoint`; timeout/import/syntax/unknown-production-identifier failures do not count. + +- [x] **Step 3: Run hosted tests to verify they pass** + +Expected: positive modules build with warnings as errors; the negative module is rejected for the intended missing premise; named-module `leanchecker` and the axiom audit succeed. + +- [x] **Step 4: Commit the minimal implementation** + +Commit message: `feat: instantiate the regular scalar chart` + +### Task 3: Freeze source identities and hand off review + +**Files:** +- Create: `frontiers/regular_point_chart_20261020/README.md` +- Create: `frontiers/regular_point_chart_20261020/SCOPE.md` +- Create: `frontiers/regular_point_chart_20261020/SOURCE_SHA256SUMS` +- Create: `frontiers/regular_point_chart_20261020/RESULTS.md` + +**Interfaces:** +- Consumes: exact green head, workflow run/job identities, test streams, and Git blob/SHA-256 identities. +- Produces: a source-bound reviewable packet and explicit release record; no acceptance or integration claim. + +- [x] **Step 1: Record exact source, toolchain, positive/negative, axiom, and hosted-run identities** + +- [ ] **Step 2: Re-run the full hosted workflow at the frozen documentation head** + +Expected: all C296 jobs green at the new exact head; previous green evidence is stale if source bytes changed. + +- [ ] **Step 3: Commit documentation and request bounded nonauthor review** + +Commit message: `docs: freeze C296 execution scope` + +- [ ] **Step 4: Post result/release on Math-#487 and pointer on main#419** + +The release must state exact head, source blobs/digests, run IDs, negative-control reason, axiom scope, local platform denial, and all exclusions. diff --git a/frontiers/regular_point_chart_20261020/README.md b/frontiers/regular_point_chart_20261020/README.md new file mode 100644 index 000000000..f6af6b350 --- /dev/null +++ b/frontiers/regular_point_chart_20261020/README.md @@ -0,0 +1,35 @@ +# C296: regular scalar chart at a noncritical point + +C296 instantiates Mathlib's finite-dimensional implicit-function chart for the +literal C294 project space `E d` and a smooth scalar function `g : E d → ℝ` at +a point `x` satisfying `¬ IsCriticalPoint d g x`. + +The production module proves that the derivative has full scalar range, derives +the strict derivative from the project's `IsSmooth` predicate, and exposes an +`OpenPartialHomeomorph (E d) (ℝ × (fderiv ℝ g x).ker)`. Its first coordinate is +exactly `g`; it sends `x` to `(g x, 0)`; and those points are members of the +chart's source and target. + +This is a local regular-point tool only. It does not construct a chart at a +critical point, prove a Morse normal form, transport local path connectivity +through a quotient or half-space, or remove C294's explicit +`LocallyPathConnectedSpace` premise. Scientific effect is **NONE**. + +## Reproduction + +From this directory, with the pinned toolchain available: + +```text +lake build RegularPointChart RegularPointChartInterface +lake env lean -E warning RegularPointChart.lean +lake env lean -E warning RegularPointChartInterface.lean +lake env leanchecker RegularPointChart +lake env leanchecker RegularPointChartInterface +lake env lean RegularPointChartAxiomAudit.lean +``` + +`WithoutNoncriticality.lean` is a negative fixture and must fail with a type +mismatch requiring `¬ IsCriticalPoint`. See `RESULTS.md` for hosted identities +and `SCOPE.md` for the exact boundary. + +[Owner mandate](https://github.com/d6g8k5htny-coder/main/blob/b665307520948308a53d190d7341bf301df3b3a2/governance/OWNER_MANDATE_20261015.md) · [Standing delegation](https://github.com/d6g8k5htny-coder/main/blob/main/governance/OP-AUTONOMY-20260923-v2.1.md) diff --git a/frontiers/regular_point_chart_20261020/RESULTS.md b/frontiers/regular_point_chart_20261020/RESULTS.md new file mode 100644 index 000000000..719488d47 --- /dev/null +++ b/frontiers/regular_point_chart_20261020/RESULTS.md @@ -0,0 +1,49 @@ +# C296 hosted results + +## Source identities + +- base and PR target: Math- PR #487 head + `7af365e8c8db1ae0275d4efe08a70a678f153ca2`; +- implementation GREEN head: `4aaddf42c474eee783f08b0350e705cea2cff181`; +- production Git blob: `77a75a4611040973ad355aff40555a808f1816e7`; +- positive-interface blob: `4885f7a0e8fdb7f1d3ab308991b043c438dbb8ef`; +- negative-control blob: `dd97a6073da0ea9bf87a19cb910daea2b46ca365`; +- axiom-audit blob: `2d77d76781209655c1a02478f5dccc827d573a78`; +- exact external C294 `Lifetime.lean` blob: + `f2508f7f2e3fd42f22f5aa52bc5ead5ff9e73b9a`; +- Lean `v4.34.1`, commit `5045d0056413266e57c625dcd7c365b10e377c52`; +- Mathlib `d13f23b723b8a846827a245b89c10fc7d3f11612`; +- workflow action `leanprover/lean-action@f061402b660e0c34644504b324e830f2991d4865`. + +`SOURCE_SHA256SUMS` binds the complete implementation, interface/control, +toolchain/dependency, workflow, and consumed C294 source bytes. + +## Verified execution + +GitHub Actions run +[39415169578](https://github.com/d6g8k5htny-coder/Math-/actions/runs/39415169578), +job `118602321184`, succeeded at the implementation GREEN head. + +- `Lifetime`, `RegularPointChart`, and `RegularPointChartInterface` built; +- production and interface passed Lean `-E warning` rechecks; +- standalone `leanchecker` passed for both named new modules; +- all seven audited declarations reported only `propext`, + `Classical.choice`, and `Quot.sound`; +- the omitted-noncriticality fixture exited nonzero with the intended type + mismatch: `regularPointChart hg` still required + `¬ IsCriticalPoint d g ...`; +- the exact GREEN-head repository downstream hard gate passed in run + [39415169606](https://github.com/d6g8k5htny-coder/Math-/actions/runs/39415169606). + +Earlier runs preserve setup and harness failures rather than suppressing them: +`39412669016`, `39413381712`, `39413746410`, `39414329053`, and +`39414753347`. The valid RED is run `39412930269`, job `118594890340`, which +built the exact consumed source and rejected the missing chart declarations. + +## Limits + +Local Lean execution was unavailable because the downloaded Lean 4.34.1 runtime +could not read `/proc//exe` in this environment. No runtime patch or bypass +was attempted. Hosted checks are execution evidence, not scientific acceptance, +external independent replay, correspondence review, or authorization to merge. +Scientific effect remains **NONE**. diff --git a/frontiers/regular_point_chart_20261020/RegularPointChart.lean b/frontiers/regular_point_chart_20261020/RegularPointChart.lean new file mode 100644 index 000000000..77a75a461 --- /dev/null +++ b/frontiers/regular_point_chart_20261020/RegularPointChart.lean @@ -0,0 +1,64 @@ +import Lifetime + +/-! +# Regular scalar chart at a noncritical point + +The construction is the finite-dimensional scalar specialization of Mathlib's +strict implicit-function chart. It uses noncriticality only to prove that the +derivative has full range. +-/ + +namespace UniversalLaw.Spec.Lifetime + +variable {d : ℕ} {g : E d → ℝ} {x : E d} + +/-- At a noncritical point, the scalar derivative has full range. -/ +theorem regularPointDerivative_range_eq_top (hx : ¬ IsCriticalPoint d g x) : + (fderiv ℝ g x).range = ⊤ := by + have hne : (fderiv ℝ g x).toLinearMap ≠ 0 := by + intro hzero + apply hx + unfold IsCriticalPoint + ext y + have hy := LinearMap.congr_fun hzero y + simpa using hy + exact Module.Dual.range_eq_top_of_ne_zero hne + +/-- Smoothness supplies the strict derivative used by the chart. -/ +theorem regularPointHasStrictFDerivAt (hg : IsSmooth d g) : + HasStrictFDerivAt g (fderiv ℝ g x) x := + (hg 1).hasStrictFDerivAt (by norm_num) + +/-- The literal local scalar chart at a noncritical point. -/ +noncomputable def regularPointChart (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + OpenPartialHomeomorph (E d) (ℝ × (fderiv ℝ g x).ker) := + (regularPointHasStrictFDerivAt hg).implicitToOpenPartialHomeomorph + g (fderiv ℝ g x) (regularPointDerivative_range_eq_top hx) + +/-- The chart's first coordinate is exactly `g`, globally as a function equality. -/ +@[simp] +theorem regularPointChart_fst (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) (y : E d) : + (regularPointChart hg hx y).1 = g y := by + exact HasStrictFDerivAt.implicitToOpenPartialHomeomorph_fst + (regularPointHasStrictFDerivAt hg) (regularPointDerivative_range_eq_top hx) y + +/-- The chart sends the base point to `(g x, 0)`. -/ +@[simp] +theorem regularPointChart_self (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + regularPointChart hg hx x = (g x, 0) := by + exact HasStrictFDerivAt.implicitToOpenPartialHomeomorph_self + (regularPointHasStrictFDerivAt hg) (regularPointDerivative_range_eq_top hx) + +/-- The base point belongs to the chart source. -/ +theorem mem_regularPointChart_source (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + x ∈ (regularPointChart hg hx).source := by + exact HasStrictFDerivAt.mem_implicitToOpenPartialHomeomorph_source + (regularPointHasStrictFDerivAt hg) (regularPointDerivative_range_eq_top hx) + +/-- The image base point belongs to the chart target. -/ +theorem mem_regularPointChart_target (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + (g x, 0) ∈ (regularPointChart hg hx).target := by + exact HasStrictFDerivAt.mem_implicitToOpenPartialHomeomorph_target + (regularPointHasStrictFDerivAt hg) (regularPointDerivative_range_eq_top hx) + +end UniversalLaw.Spec.Lifetime diff --git a/frontiers/regular_point_chart_20261020/RegularPointChartAxiomAudit.lean b/frontiers/regular_point_chart_20261020/RegularPointChartAxiomAudit.lean new file mode 100644 index 000000000..2d77d7678 --- /dev/null +++ b/frontiers/regular_point_chart_20261020/RegularPointChartAxiomAudit.lean @@ -0,0 +1,9 @@ +import RegularPointChart + +#print axioms UniversalLaw.Spec.Lifetime.regularPointDerivative_range_eq_top +#print axioms UniversalLaw.Spec.Lifetime.regularPointHasStrictFDerivAt +#print axioms UniversalLaw.Spec.Lifetime.regularPointChart +#print axioms UniversalLaw.Spec.Lifetime.regularPointChart_fst +#print axioms UniversalLaw.Spec.Lifetime.regularPointChart_self +#print axioms UniversalLaw.Spec.Lifetime.mem_regularPointChart_source +#print axioms UniversalLaw.Spec.Lifetime.mem_regularPointChart_target diff --git a/frontiers/regular_point_chart_20261020/RegularPointChartInterface.lean b/frontiers/regular_point_chart_20261020/RegularPointChartInterface.lean new file mode 100644 index 000000000..4885f7a0e --- /dev/null +++ b/frontiers/regular_point_chart_20261020/RegularPointChartInterface.lean @@ -0,0 +1,33 @@ +import RegularPointChart + +open scoped Topology + +namespace UniversalLaw.Spec.Lifetime + +noncomputable section + +variable {d : ℕ} {g : E d → ℝ} {x : E d} + +example (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + OpenPartialHomeomorph (E d) (ℝ × (fderiv ℝ g x).ker) := + regularPointChart hg hx + +example (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) (y : E d) : + (regularPointChart hg hx y).1 = g y := + regularPointChart_fst hg hx y + +example (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + regularPointChart hg hx x = (g x, 0) := + regularPointChart_self hg hx + +example (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + x ∈ (regularPointChart hg hx).source := + mem_regularPointChart_source hg hx + +example (hg : IsSmooth d g) (hx : ¬ IsCriticalPoint d g x) : + (g x, 0) ∈ (regularPointChart hg hx).target := + mem_regularPointChart_target hg hx + +end + +end UniversalLaw.Spec.Lifetime diff --git a/frontiers/regular_point_chart_20261020/SCOPE.md b/frontiers/regular_point_chart_20261020/SCOPE.md new file mode 100644 index 000000000..6021c2aba --- /dev/null +++ b/frontiers/regular_point_chart_20261020/SCOPE.md @@ -0,0 +1,42 @@ +# C296 scope + +## Exact claim + +For arbitrary `d`, `g : E d → ℝ`, and `x : E d`, the packet consumes: + +- `hg : IsSmooth d g`; +- `hx : ¬ IsCriticalPoint d g x`. + +It proves the literal derivative range equality, the strict derivative, and the +regular scalar chart with its first-coordinate, base-point, source-membership, +and target-membership identities. The derivative is exactly +`fderiv ℝ g x`; it is not replaced by an abstract equivalent. + +## Logical boundary + +Noncriticality is used to show that the continuous linear functional is +nonzero, then `Module.Dual.range_eq_top_of_ne_zero` yields scalar surjectivity. +Smoothness at order one supplies `HasStrictFDerivAt`. Mathlib's existing +`HasStrictFDerivAt.implicitToOpenPartialHomeomorph` supplies the chart. + +The equality of the first coordinate with `g` is global as an equality of the +underlying chart function. Inverse and homeomorphism properties remain +restricted to the chart source and target. No global product decomposition is +claimed. + +## Explicit exclusions + +- no chart or normal form at a critical point; +- no Morse lemma formalization; +- no proof that a closed superlevel is locally path connected; +- no quotient, half-space, or relative-LPC transport; +- no removal or weakening of C294 premises; +- no stochastic, persistence-pairing, registry, acceptance, or integration + transition. + +`WithoutNoncriticality.lean` omits only `hx`. A qualifying negative result is a +nonzero Lean exit with a type mismatch exposing `¬ IsCriticalPoint`; timeout, +setup, syntax, import, or unknown-production-identifier errors do not qualify. + +The exact C294 `Lifetime.lean` is consumed in place through a read-only Lake +library. Existing C294 bytes are not copied or modified. diff --git a/frontiers/regular_point_chart_20261020/SOURCE_SHA256SUMS b/frontiers/regular_point_chart_20261020/SOURCE_SHA256SUMS new file mode 100644 index 000000000..54c1c894d --- /dev/null +++ b/frontiers/regular_point_chart_20261020/SOURCE_SHA256SUMS @@ -0,0 +1,9 @@ +1ff2d19ee045175a510d994ad539476e1d5df98247ec4b4d6267fedc7909f996 ../../.github/workflows/c296-regular-point-chart.yml +90f4892608e953ecc696bb32ea159d1c178ceb8a1c6edfd11acfceb14af462c6 ../critical_level_attainment_20261020/final-project/Lifetime.lean +5568c8d6e03f7064cd5924ebe2814ae746100505ae31789d5c975902528f9fa2 RegularPointChart.lean +d87cc945b859472417ce9ef1c197a34f5ea4b63e65a857ce24316f435288e051 RegularPointChartInterface.lean +da7256bbe6baa41e2fda6888d80b72dce73c27eac5ad641ad9b875243370acf7 WithoutNoncriticality.lean +b1cfc6126c9885e30a4b3d8eac3e96b57e92f88930faa5e6eacbf06fb3ed78b8 RegularPointChartAxiomAudit.lean +3c154a9b908e97ae98c8f2ac0062be391bde49c13f8d436fedbbc8b1b9d88213 lakefile.toml +a5f438c3066ea36abd201994397d4b75234b7fff52d2ef8de9dea64f874baf6b lake-manifest.json +d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b lean-toolchain diff --git a/frontiers/regular_point_chart_20261020/WithoutNoncriticality.lean b/frontiers/regular_point_chart_20261020/WithoutNoncriticality.lean new file mode 100644 index 000000000..dd97a6073 --- /dev/null +++ b/frontiers/regular_point_chart_20261020/WithoutNoncriticality.lean @@ -0,0 +1,17 @@ +import RegularPointChart + +namespace UniversalLaw.Spec.Lifetime + +noncomputable section + +variable {d : ℕ} {g : E d → ℝ} {x : E d} + +-- This must be rejected: smoothness alone does not provide the required +-- `¬ IsCriticalPoint d g x` argument. +example (hg : IsSmooth d g) : + OpenPartialHomeomorph (E d) (ℝ × (fderiv ℝ g x).ker) := + regularPointChart hg + +end + +end UniversalLaw.Spec.Lifetime diff --git a/frontiers/regular_point_chart_20261020/lake-manifest.json b/frontiers/regular_point_chart_20261020/lake-manifest.json new file mode 100644 index 000000000..8ceb35d8b --- /dev/null +++ b/frontiers/regular_point_chart_20261020/lake-manifest.json @@ -0,0 +1,118 @@ +{ + "version": "1.2.0", + "packagesDir": ".lake/packages", + "packages": [ + { + "name": "plausible", + "url": "https://github.com/leanprover-community/plausible", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "LeanSearchClient", + "url": "https://github.com/leanprover-community/LeanSearchClient", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "ddf04cf3949fa556442341e87d47f9f6e6074707", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "importGraph", + "url": "https://github.com/leanprover-community/import-graph", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "e928b72544873815af278d38681b31c0293588e3", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "proofwidgets", + "url": "https://github.com/leanprover-community/ProofWidgets4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "106ff4fafc74ef4ac99d81dbf3ab399118f497a5", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.lean" + }, + { + "name": "aesop", + "url": "https://github.com/leanprover-community/aesop", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "355695d523e41d0554926416cba2a2b3544fbbc9", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "Qq", + "url": "https://github.com/leanprover-community/quote4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "batteries", + "url": "https://github.com/leanprover-community/batteries", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "Cli", + "url": "https://github.com/leanprover/lean4-cli", + "type": "git", + "subDir": null, + "scope": "leanprover", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.34.0", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "name": "mathlib", + "url": "https://github.com/leanprover-community/mathlib4.git", + "type": "git", + "subDir": null, + "scope": "", + "rev": "d13f23b723b8a846827a245b89c10fc7d3f11612", + "manifestFile": "lake-manifest.json", + "inputRev": "d13f23b723b8a846827a245b89c10fc7d3f11612", + "inherited": false, + "configFile": "lakefile.lean" + } + ], + "name": "c296_regular_point_chart", + "lakeDir": ".lake", + "fixedToolchain": true +} + diff --git a/frontiers/regular_point_chart_20261020/lakefile.toml b/frontiers/regular_point_chart_20261020/lakefile.toml new file mode 100644 index 000000000..96f302070 --- /dev/null +++ b/frontiers/regular_point_chart_20261020/lakefile.toml @@ -0,0 +1,18 @@ +name = "c296_regular_point_chart" +version = "0.1.0" +defaultTargets = ["RegularPointChartInterface"] + +[[require]] +name = "mathlib" +git = "https://github.com/leanprover-community/mathlib4.git" +rev = "d13f23b723b8a846827a245b89c10fc7d3f11612" + +[[lean_lib]] +name = "Lifetime" +srcDir = "../critical_level_attainment_20261020/final-project" + +[[lean_lib]] +name = "RegularPointChart" + +[[lean_lib]] +name = "RegularPointChartInterface" diff --git a/frontiers/regular_point_chart_20261020/lean-toolchain b/frontiers/regular_point_chart_20261020/lean-toolchain new file mode 100644 index 000000000..ba8ebf2db --- /dev/null +++ b/frontiers/regular_point_chart_20261020/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.34.1 diff --git a/frontiers/regular_point_chart_20261020/scripts/classify_negative.sh b/frontiers/regular_point_chart_20261020/scripts/classify_negative.sh new file mode 100644 index 000000000..a481c4eda --- /dev/null +++ b/frontiers/regular_point_chart_20261020/scripts/classify_negative.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ "$#" -ne 2 ]]; then + echo "usage: $0 LOG EXIT_STATUS" >&2 + exit 2 +fi + +log="$1" +status="$2" + +[[ "$status" =~ ^[0-9]+$ ]] || { + echo "negative classifier: invalid exit status" >&2 + exit 2 +} + +if [[ "$status" -eq 0 ]]; then + echo "negative classifier: fixture unexpectedly succeeded" >&2 + exit 1 +fi + +if [[ "$status" -eq 124 || "$status" -eq 137 || "$status" -eq 143 ]]; then + echo "negative classifier: rejected timeout/termination exit status" >&2 + exit 1 +fi + +if grep -Eiq \ + 'unknown (module|package|identifier)|invalid import|failed to (resolve|load|fetch|clone|download)|cannot find|no such file|file not found|command not found|fatal: unable to access|could not resolve host|HTTP[^[:alnum:]]*(403|404|5[0-9][0-9])|parser error|syntax error|invalid syntax|unexpected (token|identifier|end)|expected token|timed? ?out|timeout|killed|out of memory|oom|memory exhausted|resource temporarily unavailable|no space left|signal 9|exit code 137' \ + "$log"; then + echo "negative classifier: rejected setup/syntax/resource failure" >&2 + exit 1 +fi + +grep -Eq 'WithoutNoncriticality\.lean:[0-9]+:[0-9]+: error: Type mismatch' "$log" +grep -Eq '¬[[:space:]]*IsCriticalPoint' "$log" +grep -Fq '→ OpenPartialHomeomorph' "$log" + +echo "negative classifier: intended missing-noncriticality type mismatch" diff --git a/frontiers/regular_point_chart_20261020/scripts/test_negative_classifier.sh b/frontiers/regular_point_chart_20261020/scripts/test_negative_classifier.sh new file mode 100644 index 000000000..cd0bc960a --- /dev/null +++ b/frontiers/regular_point_chart_20261020/scripts/test_negative_classifier.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +set -euo pipefail + +classifier="$(dirname "$0")/classify_negative.sh" +tmp="$(mktemp -d)" +trap 'rm -rf "$tmp"' EXIT + +expect_pass() { + local name="$1" status="$2" log="$3" + if ! bash "$classifier" "$log" "$status"; then + echo "expected pass: $name" >&2 + exit 1 + fi +} + +expect_fail() { + local name="$1" status="$2" log="$3" + if bash "$classifier" "$log" "$status"; then + echo "expected rejection: $name" >&2 + exit 1 + fi +} + +cat > "$tmp/intended.log" <<'EOF' +WithoutNoncriticality.lean:13:2: error: Type mismatch + regularPointChart hSmooth ?_ x +has type + ¬IsCriticalPoint d g x → OpenPartialHomeomorph (E d) (ℝ × ker) +EOF +expect_pass intended 1 "$tmp/intended.log" + +cat > "$tmp/syntax-token.log" <<'EOF' +WithoutNoncriticality.lean:13:2: error: unexpected token 'end'; expected term +-- IsCriticalPoint regularPointChart +EOF +expect_fail syntax-token 1 "$tmp/syntax-token.log" + +cat > "$tmp/resource-token.log" <<'EOF' +regularPointChart noncritical +lake env lean: Killed +fatal: out of memory +EOF +expect_fail resource-token 137 "$tmp/resource-token.log" + +cat > "$tmp/setup-token.log" <<'EOF' +noncritical regularPointChart +error: unknown module prefix 'Mathlib' +EOF +expect_fail setup-token 1 "$tmp/setup-token.log" + +expect_fail unexpected-success 0 "$tmp/intended.log" +expect_fail resource-exit-status 137 "$tmp/intended.log" + +expect_usage() { + local name="$1" status="$2" log="$3" rc=0 + bash "$classifier" "$log" "$status" || rc=$? + if [[ "$rc" -ne 2 ]]; then + echo "expected usage error (exit 2): $name" >&2 + exit 1 + fi +} + +# Each control below keeps all three intended markers, so only the check +# under test can reject it. +with_intended() { + local out="$1"; shift + cat "$tmp/intended.log" > "$out" + printf '%s\n' "$@" >> "$out" +} + +for sig in \ + "error: unknown package 'Mathlib'" \ + "error: invalid import: Foo" \ + "error: failed to fetch dependency" \ + "error: cannot find module Foo" \ + "no such file or directory" \ + "error: file not found: Foo.lean" \ + "lake: command not found" \ + "fatal: unable to access 'https://example.invalid/'" \ + "could not resolve host: example.invalid" \ + "HTTP 403" \ + "parser error" \ + "syntax error" \ + "invalid syntax" \ + "unexpected identifier" \ + "expected token" \ + "operation timed out" \ + "lake env lean: Killed" \ + "fatal: out of memory" \ + "OOM" \ + "memory exhausted" \ + "resource temporarily unavailable" \ + "no space left on device" \ + "terminated by signal 9" \ + "exit code 137"; do + with_intended "$tmp/signature.log" "$sig" + expect_fail "intended-plus: $sig" 1 "$tmp/signature.log" +done + +for st in 124 143; do + expect_fail "resource-exit-status-$st" "$st" "$tmp/intended.log" +done + +sed '/error: Type mismatch/d' "$tmp/intended.log" > "$tmp/no-mismatch.log" +expect_fail missing-type-mismatch 1 "$tmp/no-mismatch.log" +sed 's/error: Type mismatch/error: unsolved goals/' "$tmp/intended.log" > "$tmp/other-error.log" +expect_fail other-error-kind 1 "$tmp/other-error.log" +sed 's/¬IsCriticalPoint/IsCriticalPoint/' "$tmp/intended.log" > "$tmp/no-negation.log" +expect_fail missing-negated-premise 1 "$tmp/no-negation.log" +sed 's/→ OpenPartialHomeomorph/→ PartialEquiv/' "$tmp/intended.log" > "$tmp/no-chart.log" +expect_fail missing-chart-codomain 1 "$tmp/no-chart.log" +expect_usage non-numeric-status x "$tmp/intended.log" + +echo "negative classifier mutation tests: PASS"