#!/bin/bash # Verify a route's Lean submission locally. # # GOLDBACH_LEAN_PROJECT=/path/to/conditional-goldbach-lean/formalization \ # scripts/lean-local.sh h-log routes/my-route # # This copies UserChallenge.lean and UserSolution.lean into the Li–Liu project. # Use a disposable copy of that project, or the Docker image. set -euo pipefail TARGET="${1:?target id, e.g. h-log or r}" ROUTE="${2:?route folder, e.g. routes/my-route}" ROOT="$(cd "$(dirname "$0")/.." && pwd)" PROJECT="${GOLDBACH_LEAN_PROJECT:?set GOLDBACH_LEAN_PROJECT to the Li-Liu formalization dir}" test -d "$PROJECT/ConditionalGoldbach" || { echo "$PROJECT: not the Li-Liu formalization (no ConditionalGoldbach/)" >&2 exit 1 } test -f "$ROOT/targets/$TARGET/Challenge.lean" || { echo "unknown target: $TARGET" >&2 exit 1 } test -f "$ROUTE/Solution.lean" || { echo "$ROUTE/Solution.lean: missing" >&2 exit 1 } cp "$ROOT/targets/$TARGET/Challenge.lean" "$PROJECT/ConditionalGoldbach/UserChallenge.lean" cp "$ROUTE/Solution.lean" "$PROJECT/ConditionalGoldbach/UserSolution.lean" cd "$PROJECT" lake build ConditionalGoldbach.UserChallenge lake build ConditionalGoldbach.UserSolution lake comparator --config "$ROOT/targets/$TARGET/comparator.json" echo echo "$TARGET: comparator passed. Run #print axioms if you need the axiom list."