lean-proof
Use when asked to prove something in Lean. Covers one-step-at-a-time proving, error priority, working on the hardest case first, proof cleanup, and handling dependent type rewriting issues.
What this skill does
# Lean Proof Methodology These are non-negotiable constraints for writing Lean proofs correctly. ## One Step at a Time Write one tactic, check diagnostics (use `done` to see unsolved goals), repeat. Never write multiple tactics before checking. **`by sorry` is acceptable**: For placeholders you're not actively working on. **`done` is required**: When you expect there to be next steps in an active proof. ## Error Priority Fix errors in this order — higher-priority errors make lower-priority ones unreliable: 1. **Syntax errors** → 2. **Type errors** → 3. **Unsolved goals / tactic failures** → 4. **Linter warnings** "Unsolved goals" errors appear on `by` or `=>` lines, NOT where you add tactics. If there's an "unsolved goals" on line 59 but a tactic error on line 65 — fix line 65 FIRST. Stop writing tactics after any error. ## Work on the Hardest Case First ### Across Theorems Go directly to the target theorem. Don't fill in `sorry`s in helper lemmas first — Lean treats `sorry` as an axiom, so dependent theorems still work. Move sorries earlier in the file by replacing a `sorry` proof with references to simpler lemmas: ```lean -- Before: theorem main_theorem : A = C := by sorry -- After: theorem lemma1 : A = B := by sorry theorem lemma2 : B = C := by sorry theorem main_theorem : A = C := by rw [lemma1, lemma2] ``` ### Within a Proof When a proof has multiple cases, `sorry` the easy cases and work on the hardest one first. If the hard case fails, effort on easy cases is wasted. ```lean match n with | 0 => sorry -- fill in later | 1 => sorry -- fill in later | n + 2 => -- WORK ON THIS FIRST ``` ## Proof Cleanup After getting a proof to work, clean it up immediately: - Combine redundant steps (`rw [a]; rw [b]` → `rw [a, b]`) - Test if `simp` can handle more (remove earlier steps one by one) - Find the truly minimal proof ## Dependent Type Rewriting Issues **When you encounter "motive is not type correct" or similar errors during rewriting:** ### The Problem Rewriting a term `b` that appears in dependent types (like `hab : a ≤ b`) fails because the motive cannot abstract over the dependencies. ```lean have hb : b = f x rw [hb] -- Error: motive is not type correct ``` ### The Solution: Generalize First, Instantiate Last Prove a generalized statement for an arbitrary parameter, then instantiate: ```lean suffices ∀ s, statement_about s by have h_specific := the_equality_you_have convert this ?_ <;> exact h_specific intro s -- Now prove the general statement for arbitrary s ``` This works because the generalized statement has no dependencies on the problematic term, and `convert` handles the dependent type coercions at the end. ## Verification Never declare a proof complete while `sorry` placeholders or error diagnostics remain.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.