Playground Documentation Challenges Full Docs

show

What is visible here: the scope, nearby facts, labels — and a search

Overview

show() prints into the log what one needs to know at this place: the enclosing for and if, the facts already there and what the labels hold. show("text") searches the visible facts and labels for a piece of text. Nothing is produced.

show()show("searchText")show(| theoremLabel)show("check", leftExpression -> rightExpression; …)show("facts", expression1, expression2, …)show("type", expression1, expression2, …)
()
The context here: visible atoms, types, assumptions, labels, rules.
"searchText"
Visible facts and labels whose text contains it.
theoremLabel
The contract of each conclusion of the theorem — what a call would require — without applying it.
"check", statements
For each statement: is it already a visible fact?
"facts", expressions
The visible facts with this left side.
"type", expressions
The types of the expressions.

Command Properties

Group
Tools
Produces
Nothing: no statements, no label (a label on show is an error). The command is a tool; the journal and the checker do not see it.
Delivery & Label
—
Mechanism
show(): the enclosing scopes of this file, inner first — the nearest if is marked «a call taking this if closes it» (contradict[| …], deduce[| …]), the nearest for «a call taking this for delivers above it» (generalize[| …], obtain[| …]); then the facts of this file, nearest first (at most 40), and the labels declared in this file. A label statement is printed as a theorem: the for and if between the place it was delivered to and the label declaration are its parameters and conditions. show("text"): every visible fact and label whose printed form (or name) contains the text, from all files. The search is literal: bound variables keep the names they were printed with (1 + x, not 1 + y).

Basic examples

Context and search

▶ Run

Contract and exact queries

▶ Run
ℹ
show prints into the log only. Remove it when the proof is done: it changes nothing, but the log of a finished file stays shorter.

Details

A Formall proof goes forward, so there is no «goal» as in tactic provers. What one needs to know before the next command is the place itself: which for and if enclose it (what a call that takes its blocks — contradict, deduce, generalize, obtain — will close or lift over), which facts are already there and which labels hold what. show() prints exactly this into the log, like the infoview of Lean. show("text") searches the visible facts and labels, including those of imported files — a quick way to find the name of a lemma.

Exact queries

show("check", P -> true) reports FOUND with the source statement or NOT FOUND. It uses the visible-statement lookup used by calls, including type-polymorphic statements. It does not rewrite, apply a theorem or infer a value: NOT FOUND means that the requested fact is not already available, not that it cannot be proved. The same statement-list syntax and default right-hand values as in if are accepted.

show("facts", P) lists visible statements whose left side is exactly P (up to bound-variable renaming and type-scheme matching), nearest first, with a count and at most 40 entries per expression. Unlike text search, it does not find occurrences of P inside other expressions. show("type", P, f) prints the type of each expression; neither query evaluates it.

show(theoremLabel) prints every conclusion and its own contract: atom and type parameters, assumptions, rules and lock obligations. Assumptions are checked as written against the current facts. This is a template inspection, without argument substitution, inference or checking lock realizations; it is not a verdict that theoremLabel[] will succeed or fail. Different conclusions may have different contracts.