Skip to content

Commit af3f4b8

Browse files
proofs(coq): assert single_op_reversible model gap (Qed → Admitted) (#48)
`proofs/coq/filesystem_composition.v::single_op_reversible` ended with `Qed.` despite containing a mid-proof `admit.` in the OpRmdir branch. Modern Coq (8.10+) treats this as an incomplete proof and refuses to discharge it — meaning the file did not compile under `coqc` (the `verify-proofs` job in `.github/workflows/validation.yml` is currently disabled per `_CoqProject`). Switching to `Admitted.` registers the missing branches as Axiom-equivalents, so `Print Assumptions` on any downstream theorem now correctly surfaces `single_op_reversible` as a dependency rather than silently treating it as a closed fact. While writing the docstring, also found that the OpDeleteFile branch invoked `apply create_delete_file_reversible. assumption.`, which proves the *forward* direction `delete_file (create_file fs) = fs`. The branch needs the *reverse* `create_file (delete_file fs) = fs`, which is the same model gap as OpRmdir (both rely on `default_perms` matching the original). Now also explicitly `admit`. Three closure paths documented in the docstring + in `docs/PROOF-NARRATIVE.adoc § Assumption Registry`: (A) strengthen `reversible` to require default_perms on the original (B) add `OpMkdirWithPerms` / `OpCreateFileWithPerms` variants whose `reverse_op` carries the perm snapshot (C) `Filesystem × UndoLog` model This PR does *not* attempt the closure — that requires the local Coq build oracle to be working end-to-end. The composition.v file has additional cascading proof-script errors at: * line 271 — `operation_sequence_reversible`: stale rewrite direction * line 327 — `reversible_creates_CNO`: `rewrite app_nil_r` targets a subterm that simpl already eliminated * line 407 — `path_prefix_app_invert`: argument-shape mismatch * line 365 — missing `Require Import Lia.` for the `lia` tactic * file_content_operations.v:133 — `rewrite Hntype` fails to find a matching subterm These will need a coordinated proof-debt sweep with the build oracle running locally. Filed at docs/PROOF-OPEN-FRONTIER.adoc § Tier S F-2. Refs #42 (proof inventory). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6963886 commit af3f4b8

1 file changed

Lines changed: 43 additions & 12 deletions

File tree

proofs/coq/filesystem_composition.v

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,44 @@ Proof.
180180
assumption.
181181
Qed.
182182

183-
(** Generic single operation reversibility *)
183+
(** Generic single operation reversibility.
184+
185+
PROOF STATUS: Admitted — see [docs/PROOF-NARRATIVE.adoc] § Assumption
186+
Registry. The OpRmdir and OpDeleteFile branches both depend on the
187+
same model gap: [mkdir] / [create_file] write [default_perms], but
188+
the original entry may have had non-default permissions, so
189+
[mkdir(rmdir(fs))] ≠ [fs] and [create_file(delete_file(fs))] ≠ [fs]
190+
when the original perms were not default.
191+
192+
Three closure paths on file: (A) strengthen [reversible (OpRmdir p) fs]
193+
and [reversible (OpDeleteFile p) fs] to additionally require
194+
[fs p = Some (mkFSNode _ default_perms)]; (B) add [OpMkdirWithPerms]
195+
and [OpCreateFileWithPerms] variants whose [reverse_op] carries the
196+
original perm snapshot; (C) move to a [Filesystem × UndoLog] model
197+
where the inverse operation reads the snapshot from the log.
198+
199+
Two pre-existing bugs were uncovered while writing this docstring:
200+
201+
(1) The original form ended [Qed.] after a mid-proof [admit.] in
202+
the OpRmdir branch. Modern Coq treats this as an incomplete
203+
proof and refuses — meaning the file did not previously
204+
compile under [coqc] (CI status: verify-proofs job is disabled
205+
per [_CoqProject]). Switching to [Admitted.] registers the
206+
missing branches as Axiom-equivalents.
207+
208+
(2) The original OpDeleteFile branch invoked
209+
[apply create_delete_file_reversible. assumption.], which
210+
proves [delete_file p (create_file p fs) = fs] — the *forward*
211+
direction. The OpDeleteFile branch of [single_op_reversible]
212+
needs the *reverse* direction
213+
[create_file p (delete_file p fs) = fs], which is unprovable
214+
under the same model gap. Now also explicitly [admit].
215+
216+
Downstream theorems ([operation_sequence_reversible],
217+
[two_op_sequence_reversible], [three_op_sequence_reversible],
218+
[reversible_creates_CNO]) keep their proof scripts; they now show
219+
[single_op_reversible] in their [Print Assumptions] output, which
220+
is the correct behaviour for an unproven leaf. *)
184221
Theorem single_op_reversible :
185222
forall op fs,
186223
reversible op fs ->
@@ -191,20 +228,14 @@ Proof.
191228
- (* OpMkdir *)
192229
apply single_mkdir_reversible.
193230
assumption.
194-
- (* OpRmdir *)
195-
(* MODEL GAP (pre-existing): mkdir restores with default_perms, but the original
196-
directory may have had different permissions, so mkdir(rmdir(fs)) ≠ fs in general.
197-
Full reversibility requires the undo stack to preserve original node data.
198-
This is a known limitation of the current Filesystem = Path -> option FSNode model. *)
199-
simpl in *. admit.
231+
- (* OpRmdir — model gap, see header docstring *)
232+
admit.
200233
- (* OpCreateFile *)
201234
apply single_create_file_reversible.
202235
assumption.
203-
- (* OpDeleteFile *)
204-
simpl in *.
205-
apply create_delete_file_reversible.
206-
assumption.
207-
Qed.
236+
- (* OpDeleteFile — model gap, see header docstring *)
237+
admit.
238+
Admitted.
208239

209240
(** * Composition Theorems *)
210241

0 commit comments

Comments
 (0)