Preview Runtime Showcase

2. Code Panels🔗

Definition2.1
uses 0used by 0L∃∀N

In-module external definition panel sample.

Lean code for Definition2.11 definition
Definition2.2
uses 0used by 0L∃∀N

Namespace-opened external definition panel sample.

Lean code for Definition2.21 definition
Definition2.3
uses 0used by 0L∃∀N

In-module external Lean abbrev panel sample. Status summaries stay definition-like, while the rendered declaration preserves the abbrev keyword.

Lean code for Definition2.31 definition
Definition2.4
uses 0used by 0L∃∀N

In-module external unsafe definition panel sample.

Lean code for Definition2.41 definition
  • complete
    unsafe def PreviewRuntimeShowcase.CodePanelDecls.previewExternalUnsafeDefinition :
      Nat
    unsafe def PreviewRuntimeShowcase.CodePanelDecls.previewExternalUnsafeDefinition :
      Nat
Definition2.5
uses 0used by 0L∃∀N

External definition panel sample with multiple documented Lean definitions.

Lean code for Definition2.52 definitions
  • def PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedDefinition : Nat
    def PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedDefinition :
      Nat
    The first documented preview definition used to test multi-declaration
    docstring rendering in external code panels.
    
  • def PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedFunction
      (n : Nat) : Nat
    def PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedFunction
      (n : Nat) : Nat
    Adds a small preview offset to `n`.
    
    The second paragraph keeps paragraph spacing visible when several documented
    definitions appear in the same code panel.
    
Theorem2.6
uses 0used by 0L∃∀N

In-module external theorem panel sample.

Lean code for Theorem2.61 theorem
Theorem2.7
uses 0used by 0L∃∀N

External theorem panel sample with a declaration docstring.

Lean code for Theorem2.71 theorem
  • theorem PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedTheorem : True
    theorem PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedTheorem :
      True
    A documented preview theorem whose statement is intentionally small.
    
Theorem2.8
uses 0used by 0L∃∀N

In-module external theorem panel sample with multiple complete declarations.

Lean code for Theorem2.82 theorems
Theorem2.9
uses 0used by 0L∃∀N

In-module external theorem panel with a sorry-backed declaration.

Lean code for Theorem2.91 theorem, incomplete
Theorem2.10
uses 0used by 0L∃∀N

In-module external theorem panel sample with mixed declaration health.

Lean code for Theorem2.102 theorems, 1 incomplete
Theorem2.11
uses 0used by 0!L∃∀N

External theorem panel sample with multiple references and one missing declaration.

Lean code for Theorem2.112 declarations, 1 missing
Definition2.12
uses 0used by 0L∃∀N

Out-of-module external definition panel sample.

Lean code for Definition2.121 definition
  • defdefined in Init/Prelude.lean
    complete
    def Nat.add : Nat  Nat  Nat
    def Nat.add : Nat  Nat  Nat
    Addition of natural numbers, typically used via the `+` operator.
    
    This function is overridden in both the kernel and the compiler to efficiently evaluate using the
    arbitrary-precision arithmetic library. The definition provided here is the logical model.
    
Theorem2.13
uses 0used by 0L∃∀N

Out-of-module external theorem panel sample.

Lean code for Theorem2.131 theorem
  • theoremdefined in Init/Data/Nat/Basic.lean
    complete
    theorem Nat.add_assoc (n m k : Nat) : n + m + k = n + (m + k)
    theorem Nat.add_assoc (n m k : Nat) :
      n + m + k = n + (m + k)
Definition2.14
uses 0used by 0!L∃∀N

External declaration panel with a missing declaration.

Lean code for Definition2.141 declaration, 1 missing
Theorem2.15
uses 0used by 0AL∃∀N

External theorem panel with an axiom-like declaration.

Lean code for Theorem2.151 definition, incomplete
Definition2.16
uses 0used by 0L∃∀N

External inductive panel sample with documented constructors.

Lean code for Definition2.161 definition
  • inductive(2 constructors)defined in PreviewRuntimeShowcase/Chapters/CodePanels.lean
    complete
    inductive PreviewRuntimeShowcase.CodePanelDecls.PreviewStage : Type
    inductive PreviewRuntimeShowcase.CodePanelDecls.PreviewStage :
      Type
    A small inductive type used to exercise rendered constructor lists.
    
    PreviewRuntimeShowcase.CodePanelDecls.PreviewStage.initial :
      PreviewStage
    The initial stage of the preview workflow. 
    PreviewRuntimeShowcase.CodePanelDecls.PreviewStage.step
      (n : Nat) : PreviewStage
    A numbered follow-up stage. 
Definition2.17
uses 0used by 0L∃∀N

External class panel sample with documented methods.

Lean code for Definition2.171 definition
  • complete
    class PreviewRuntimeShowcase.CodePanelDecls.PreviewFold (α : Type) : Type
    class PreviewRuntimeShowcase.CodePanelDecls.PreviewFold
      (α : Type) : Type
    A compact class used to exercise rendered method documentation.
    
    neutral : α
    The neutral preview value. 
    combine : α  α  α
    Combine two preview values. 
Definition2.18
uses 0used by 0L∃∀N

External structure panel sample with a field-heavy package shape.

Lean code for Definition2.181 definition
  • complete
    structure PreviewRuntimeShowcase.CodePanelDecls.PreviewFreyPackage : Type
    structure PreviewRuntimeShowcase.CodePanelDecls.PreviewFreyPackage :
      Type
    A preview Frey package is a compact stand-in for a structure whose constructor
    duplicates a field-heavy mathematical record.
    
    a : Nat
    The first value in the package. 
    b : Nat
    The second value in the package. 
    c : Nat
    The target value in the package. 
    p : Nat
    The prime-like exponent under discussion. 
    hp5 : 5  self.p
    The lower-bound hypothesis on `p`. 
    hFLT : self.a ^ self.p + self.b ^ self.p = self.c ^ self.p
    The Fermat-like equation carried by the package. 
Theorem2.19
uses 0used by 0L∃∀N

External theorem panel sample with a Markdown-like docstring.

Lean code for Theorem2.191 theorem
  • theorem PreviewRuntimeShowcase.CodePanelDecls.PreviewFreyPackage.ofCounterexample
      {a b c p : Nat} (hp5 : 5  p) (H : a ^ p + b ^ p = c ^ p) :
      Nonempty PreviewFreyPackage
    theorem PreviewRuntimeShowcase.CodePanelDecls.PreviewFreyPackage.ofCounterexample
      {a b c p : Nat} (hp5 : 5  p)
      (H : a ^ p + b ^ p = c ^ p) :
      Nonempty PreviewFreyPackage
    Given a counterexample `a^p + b^p = c^p` with `p >= 5`,
    there exists a preview Frey package.
    
Definition2.20
uses 0used by 0L∃∀N

External declaration panel sample mixing definitions, theorems, inductives, classes, and structures.

Lean code for Definition2.205 declarations
  • def PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedDefinition : Nat
    def PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedDefinition :
      Nat
    The first documented preview definition used to test multi-declaration
    docstring rendering in external code panels.
    
  • theorem PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedTheorem : True
    theorem PreviewRuntimeShowcase.CodePanelDecls.previewDocstringedTheorem :
      True
    A documented preview theorem whose statement is intentionally small.
    
  • inductive(2 constructors)defined in PreviewRuntimeShowcase/Chapters/CodePanels.lean
    complete
    inductive PreviewRuntimeShowcase.CodePanelDecls.PreviewStage : Type
    inductive PreviewRuntimeShowcase.CodePanelDecls.PreviewStage :
      Type
    A small inductive type used to exercise rendered constructor lists.
    
    PreviewRuntimeShowcase.CodePanelDecls.PreviewStage.initial :
      PreviewStage
    The initial stage of the preview workflow. 
    PreviewRuntimeShowcase.CodePanelDecls.PreviewStage.step
      (n : Nat) : PreviewStage
    A numbered follow-up stage. 
  • complete
    class PreviewRuntimeShowcase.CodePanelDecls.PreviewFold (α : Type) : Type
    class PreviewRuntimeShowcase.CodePanelDecls.PreviewFold
      (α : Type) : Type
    A compact class used to exercise rendered method documentation.
    
    neutral : α
    The neutral preview value. 
    combine : α  α  α
    Combine two preview values. 
  • complete
    structure PreviewRuntimeShowcase.CodePanelDecls.PreviewFreyPackage : Type
    structure PreviewRuntimeShowcase.CodePanelDecls.PreviewFreyPackage :
      Type
    A preview Frey package is a compact stand-in for a structure whose constructor
    duplicates a field-heavy mathematical record.
    
    a : Nat
    The first value in the package. 
    b : Nat
    The second value in the package. 
    c : Nat
    The target value in the package. 
    p : Nat
    The prime-like exponent under discussion. 
    hp5 : 5  self.p
    The lower-bound hypothesis on `p`. 
    hFLT : self.a ^ self.p + self.b ^ self.p = self.c ^ self.p
    The Fermat-like equation carried by the package. 
Definition2.21
uses 0used by 0L∃∀N

Inline code panel sample with complete Lean code.

Lean code for Definition2.21def panelInlineOnlyOk : Nat := 0
Definition2.22
uses 0used by 0L∃∀N

Inline code panel sample with a sorry-backed declaration.

Lean code for Definition2.22theorem declaration uses `sorry`panelInlineOnlySorry : True := True All goals completed! 🐙
Theorem2.23
uses 0used by 0L∃∀N

Inline code panel sample with multiple complete Lean theorems.

Lean code for Theorem2.23theorem panelInlineMultiTheoremOkLeft : True := True All goals completed! 🐙 theorem panelInlineMultiTheoremOkRight : True := True All goals completed! 🐙
Theorem2.24
uses 0used by 0L∃∀N

Inline code panel sample with multiple Lean theorems and mixed declaration health.

Lean code for Theorem2.24theorem panelInlineMultiTheoremWarningOk : True := True All goals completed! 🐙 theorem declaration uses `sorry`panelInlineMultiTheoremWarningSorry : True := True All goals completed! 🐙
Definition2.25
uses 0used by 0L∃∀N

Inline code panel sample with mixed declaration health.

Lean code for Definition2.25def panelInlineOk : Nat := 0 theorem declaration uses `sorry`panelInlineSorry : True := True All goals completed! 🐙
Definition2.26
uses 0used by 0AL∃∀N

Inline code panel sample with an axiom-like declaration.

Lean code for Definition2.26axiom panelInlineAxiom : True
Definition2.27
uses 0used by 0L∃∀N

Inline Lean structure sample with declaration and field docstrings.

Lean code for Definition2.27/-- Inline package docstring used to compare literate Lean against the external declaration renderer. * The field `left` is shown as inline code. * **Bold text** checks richer Markdown. -/ structure PanelInlineDocstringedStructure where /-- The left inline field. -/ left : Nat /-- The right inline field. -/ right : Nat /-- A proof-like field that keeps dependent-looking field layout visible. -/ ordered : left <= right
Definition2.28
uses 0used by 0L∃∀N

Inline Lean inductive sample with declaration and constructor docstrings.

Lean code for Definition2.28/-- Inline workflow stage docstring used to compare constructor documentation. -/ inductive PanelInlineDocstringedStage where /-- The initial inline stage. -/ | initial /-- A follow-up inline stage carrying a counter. -/ | followup (_ : Nat)
Definition2.29
uses 0used by 0L∃∀N

Inline Lean panel sample mixing documented structures, inductives, and classes.

Lean code for Definition2.29/-- Inline mixed configuration docstring. -/ structure PanelInlineMixedConfig where /-- Whether the preview branch is enabled. -/ enabled : Bool /-- Inline mixed state docstring. -/ inductive PanelInlineMixedState where /-- The ready state. -/ | ready /-- The running state with a step count. -/ | running (_ : Nat) /-- Inline mixed fold class docstring. -/ class PanelInlineMixedFold (α : Type) where /-- The empty inline value. -/ empty : α /-- Merge two inline values. -/ merge : α -> α -> α
Definition2.30
uses 0used by 0XL∃∀N

Statement without associated Lean code.