{"repo":"pvsnp","commit":{"oid":"118eb9c9aec819f90f93b9ba0ecefa9f0d2d3b6a","tree":"af8519c9560cdd88040b71c2ddd2c10d97361c4a","parents":["5bdcd988ce31c5e20bc679e5aca17f88eaa6ccc7"],"author":{"name":"Claude","email":"noreply@anthropic.com","time_ms":1795945504000},"committer":{"name":"Claude","email":"noreply@anthropic.com","time_ms":1795945504000},"subject":"Make an Embedding's back map the exact inverse of emb","message":"Make an Embedding's back map the exact inverse of emb\n\nReview finding: Embedding only required back (emb i) = some i, which\nallows back to map a second tape onto a used one; such a lift would\noverwrite a tape the docs call untouched. Add emb_back, so back j = some\ni only when emb i = j, and prove it for castLE and skipOne.\n\nCo-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>\n"},"diff":{"base":"5bdcd988ce31c5e20bc679e5aca17f88eaa6ccc7","head":"118eb9c9aec819f90f93b9ba0ecefa9f0d2d3b6a","stat":{"files":1,"additions":21,"deletions":1},"files":[{"path":"PvsNP/Machine/Lift.lean","status":"modified","additions":21,"deletions":1,"binary":false,"patch":"--- a/PvsNP/Machine/Lift.lean\n+++ b/PvsNP/Machine/Lift.lean\n@@ -18,11 +18,14 @@\n namespace PvsNP\n \n /-- How the tapes of a `k + 1`-tape machine sit among `k' + 1` tapes: `emb` places each small tape,\n-and `back` recognises the places (`none` for a tape the small machine does not use). -/\n+and `back` recognises the places (`none` for a tape the small machine does not use). The two laws\n+make `back` exactly the inverse of `emb` on its image, so `emb` is injective and every tape outside\n+the image is left alone. -/\n structure Embedding (k k' : Nat) where\n   emb : Fin (k + 1) → Fin (k' + 1)\n   back : Fin (k' + 1) → Option (Fin (k + 1))\n   back_emb : ∀ i, back (emb i) = some i\n+  emb_back : ∀ j i, back j = some i → emb i = j\n \n namespace Embedding\n \n@@ -31,6 +34,10 @@\n   emb i := ⟨i.val, by omega⟩\n   back j := if hj : j.val < k + 1 then some ⟨j.val, hj⟩ else none\n   back_emb i := by simp [i.isLt]\n+  emb_back j i h := by\n+    split at h\n+    · cases h; rfl\n+    · cases h\n \n /-- Tape `0` stays; tape `i + 1` becomes tape `i + 2`. Tape `1` is not used. -/\n def skipOne {k k' : Nat} (h : k + 1 ≤ k') : Embedding k k' where\n@@ -48,6 +55,19 @@\n       have h3 : i.val + 1 - 1 < k + 1 := by omega\n       simp only [hi, h1, h2, h3, ↓reduceIte, ↓reduceDIte, Option.some.injEq]\n       exact Fin.ext (by simp)\n+  emb_back j i h := by\n+    apply Fin.ext\n+    by_cases h0 : j.val = 0\n+    · simp only [h0, ↓reduceIte, Option.some.injEq] at h\n+      subst h; simp [h0]\n+    · by_cases h1 : j.val = 1\n+      · simp [h1] at h\n+      · simp only [h0, h1, ↓reduceIte] at h\n+        split at h\n+        · cases h\n+          have : j.val - 1 ≠ 0 := by omega\n+          simp [this]; omega\n+        · cases h\n \n end Embedding\n \n","truncated":false}],"truncated":false},"jit":null,"api":"/v1/repos/pvsnp/commit?rev=118eb9c9aec819f90f93b9ba0ecefa9f0d2d3b6a","api_url":"https://git.neoopensource.com/v1/repos/pvsnp/commit?rev=118eb9c9aec819f90f93b9ba0ecefa9f0d2d3b6a"}