Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/MathlibTest/Widget/     Datei vom 15.10.2026 mit Größe 1 kB image not shown  

Quelle  CalcQuestionMark.lean   Sprache: Lean

 

module
import Mathlib.Tactic.Widget.Calc

/-!
Note that while the suggestions look incorrectly indented here,
this is an artifact of the rendering to a string for `guard_msgs` (https://github.com/leanprover/lean4/issues/7191).

When used from the widget that appears in VSCode, they insert correctly-indented code.
-/


/--
info: Create calc tactic:
  [apply] calc
    1 = 1 := by sorry
---
warning: declaration uses `sorry`
-/

#guard_msgs in
example : 1 = 1 := by
  have := 0
  calc?


/--
info: Create calc tactic:
  [apply] calc
    a ≤ a := by sorry
---
warning: declaration uses `sorry`
-/

#guard_msgs in
example (a : Nat) : a ≤ a := by
  calc?

-- an indented `calc?`

/--
info: Create calc tactic:
  [apply] calc
    a ≤ a := by sorry
---
warning: declaration uses `sorry`
-/

#guard_msgs in
example (a : Nat) : a ≤ a := by
  focus
    calc?

-- a deliberately long line
/--
info: Create calc tactic:
  [apply] calc
    1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
              1 +
            1 +
          1 =
        8 + 8 + 8 + 8 :=
      by sorry
---
warning: declaration uses `sorry`
-/

#guard_msgs in
example :
    1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
    1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
    1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
    1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 8 + 8 + 8 + 8 := by
  calc?

Messung
CHZG
9310010097

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland