variable 解説に theorem/def の変数取り込み差分と include の実例を追加#2325
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/lean-ja/lean-by-example/sessions/9a810955-8099-4b58-8947-e681218e6dda Co-authored-by: Seasawher <47292598+Seasawher@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix variable command behavior in def and theorem
May 19, 2026
variable 解説に theorem/def の変数取り込み差分と include の実例を追加
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
variableの外側宣言がtheoremとdefで同様に取り込まれるように見える一方、実際は基準が異なるため混乱が起きていました。theoremは statement 基準、defは本体での使用も含むことを、失敗例と修正例で明示しました。変更内容:
variableページの挙動説明を補強LeanByExample/Declarative/Variable.leanにtheorem/defの取り込み基準の違いを説明する節を追加theoremで証明中のみ使う外側変数は自動取り込みされない点を明記include nを使ってtheorem側で明示的に取り込むパターンを追加変更内容: 挙動をそのまま再現できる最小例を追加
#guard_msgsでunknown identifier 'n'を検証する失敗例defが通る対比例include n後にtheoremが通る成功例