Refinement.lean
/-
Copyright 2026 Google LLC
All code is licensed under the Apache License, Version 2.0 (the "Apache 2.0"); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import LibsignalBinary.Specifications.SignalSession.CliElf
public import Symbolic.Specifications.Refinement.ElfBinding
import Symbolic.Proofs.TopLevelHelpers.Composed.Cli.RefinementElf
Trace Refinement for the libsignal-cli Binary
Trusted: the statement.
Proves comp_refines_cli_placed (CompRefinesCliBinaryPlaced cliElfBytes, Symbolic/), built by lake build CliElfLib. Across every pair of multi-block placements (mpl, mmpl) linked in cliElfBytes (LibsignalBinary/), the compiled AArch64 libsignal-cli binary refines the composed PQXDH ∘ SPQR ∘ Triple Ratchet symbolic model up to cryptographic byte collisions, and every reachable guarded CLI call terminates with a process outcome (CliElfProgressPlaced: no fault, trap, or divergence; SIGABRT aborts terminate the trace at CliTraces.).
Combined with Symbolic/ via comp_ (Symbolic/), this yields signal_ (Symbolic/). Non-vacuity of the extern and hook hypotheses is proved in Symbolic/; placement witnesses and symbol-label gate A (A-LINK, Computational/) are exported in Symbolic/.
@[expose] public sectionset_option autoImplicit falsenamespace Proven.Refinementopen CryptoVerification.SignalSession (cliElfBytes)open DY.Libsignal.Composed.Refinement.Cli (CompRefinesCliBinaryPlaced)theorem comp_refines_cli_placed
Relocatable trace refinement and progress for the SHA-256-pinned libsignal-cli AArch64 binary (CompRefinesCliBinaryPlaced cliElfBytes, Symbolic/). For every pair of multi-block placements mpl (libsignalSessionLib.cliElfBytes mpl) and mmpl (VerifiedLibraries.cliElfBytes mmpl), cliElfBytes parses as an ELF image satisfying CliElfCodeMatchesPlaced mpl mmpl, every reachable guarded CLI call terminates with a process outcome (CliElfProgressPlaced mpl mmpl), and under any valid cryptographic extern interpretation and matching CLI hooks, every guarded execution trace of cliRunPlacedSig mpl mmpl from initDirs is explained by a reachable model run (Explains) or encounters a cryptographic collision after an explained prefix (Collision).
theorem comp_refines_cli_placed :
CompRefinesCliBinaryPlaced cliElfBytes := ⋯end Proven.Refinement