Preview Runtime Showcase

2. Code Panels🔗

Definition2.1
L∃∀Nused by 0

In-module external definition panel sample.

Lean code for Definition2.11 definition
  • def PreviewRuntimeShowcase.CodePanelDecls.previewExternalDefinitionPreviewRuntimeShowcase.CodePanelDecls.previewExternalDefinition : Nat : NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    
    def PreviewRuntimeShowcase.CodePanelDecls.previewExternalDefinitionPreviewRuntimeShowcase.CodePanelDecls.previewExternalDefinition : Nat :
      NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    
    complete
Definition2.2
L∃∀Nused by 0

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

Lean code for Definition2.21 definition
  • abbrev PreviewRuntimeShowcase.CodePanelDecls.previewExternalAbbrevPreviewRuntimeShowcase.CodePanelDecls.previewExternalAbbrev : Nat : NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    
    abbrev PreviewRuntimeShowcase.CodePanelDecls.previewExternalAbbrevPreviewRuntimeShowcase.CodePanelDecls.previewExternalAbbrev : Nat :
      NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    
    complete
Theorem2.3
L∃∀Nused by 0

In-module external theorem panel sample.

Lean code for Theorem2.31 theorem
  • theorem PreviewRuntimeShowcase.CodePanelDecls.previewExternalTheoremPreviewRuntimeShowcase.CodePanelDecls.previewExternalTheorem : True : TrueTrue : Prop`True` is a proposition and has only an introduction rule, `True.intro : True`.
    In other words, `True` is simply true, and has a canonical proof, `True.intro`
    For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
    
    theorem PreviewRuntimeShowcase.CodePanelDecls.previewExternalTheoremPreviewRuntimeShowcase.CodePanelDecls.previewExternalTheorem : True :
      TrueTrue : Prop`True` is a proposition and has only an introduction rule, `True.intro : True`.
    In other words, `True` is simply true, and has a canonical proof, `True.intro`
    For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
    
    complete
Theorem2.4
L∃∀Nused by 0

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

Lean code for Theorem2.41 theorem, incomplete
  • theorem PreviewRuntimeShowcase.CodePanelDecls.previewExternalSorryPreviewRuntimeShowcase.CodePanelDecls.previewExternalSorry : True : TrueTrue : Prop`True` is a proposition and has only an introduction rule, `True.intro : True`.
    In other words, `True` is simply true, and has a canonical proof, `True.intro`
    For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
    
    theorem PreviewRuntimeShowcase.CodePanelDecls.previewExternalSorryPreviewRuntimeShowcase.CodePanelDecls.previewExternalSorry : True :
      TrueTrue : Prop`True` is a proposition and has only an introduction rule, `True.intro : True`.
    In other words, `True` is simply true, and has a canonical proof, `True.intro`
    For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
    
    contains sorry in proof
Definition2.5
L∃∀Nused by 0

Out-of-module external definition panel sample.

Lean code for Definition2.51 definition
  • def Nat.addNat.add : Nat → Nat → NatAddition 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.
     : NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
      NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
      NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    
    def Nat.addNat.add : Nat → Nat → NatAddition 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.
     : NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
      NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
      NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    
    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.
    
    complete
Theorem2.6
L∃∀Nused by 0

Out-of-module external theorem panel sample.

Lean code for Theorem2.61 theorem
  • theorem Nat.add_assocNat.add_assoc (n m k : Nat) : n + m + k = n + (m + k) (nNat mNat kNat : NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    ) : nNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. mNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. kNat =Eq.{u_1} {α : Sort u_1} : α → α → PropThe equality relation. It has one introduction rule, `Eq.refl`.
    We use `a = b` as notation for `Eq a b`.
    A fundamental property of equality is that it is an equivalence relation.
    ```
    variable (α : Type) (a b c d : α)
    variable (hab : a = b) (hcb : c = b) (hcd : c = d)
    
    example : a = d :=
      Eq.trans (Eq.trans hab (Eq.symm hcb)) hcd
    ```
    Equality is much more than an equivalence relation, however. It has the important property that every assertion
    respects the equivalence, in the sense that we can substitute equal expressions without changing the truth value.
    That is, given `h1 : a = b` and `h2 : p a`, we can construct a proof for `p b` using substitution: `Eq.subst h1 h2`.
    Example:
    ```
    example (α : Type) (a b : α) (p : α → Prop)
            (h1 : a = b) (h2 : p a) : p b :=
      Eq.subst h1 h2
    
    example (α : Type) (a b : α) (p : α → Prop)
        (h1 : a = b) (h2 : p a) : p b :=
      h1 ▸ h2
    ```
    The triangle in the second presentation is a macro built on top of `Eq.subst` and `Eq.symm`, and you can enter it by typing `\t`.
    For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
    
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `=` in identifiers is `eq`. nNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. (HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`.mNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. kNat)HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`.
    theorem Nat.add_assocNat.add_assoc (n m k : Nat) : n + m + k = n + (m + k) (nNat mNat kNat : NatNat : TypeThe natural numbers, starting at zero.
    
    This type is special-cased by both the kernel and the compiler, and overridden with an efficient
    implementation. Both use a fast arbitrary-precision arithmetic library (usually
    [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
    ) :
      nNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. mNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. kNat =Eq.{u_1} {α : Sort u_1} : α → α → PropThe equality relation. It has one introduction rule, `Eq.refl`.
    We use `a = b` as notation for `Eq a b`.
    A fundamental property of equality is that it is an equivalence relation.
    ```
    variable (α : Type) (a b c d : α)
    variable (hab : a = b) (hcb : c = b) (hcd : c = d)
    
    example : a = d :=
      Eq.trans (Eq.trans hab (Eq.symm hcb)) hcd
    ```
    Equality is much more than an equivalence relation, however. It has the important property that every assertion
    respects the equivalence, in the sense that we can substitute equal expressions without changing the truth value.
    That is, given `h1 : a = b` and `h2 : p a`, we can construct a proof for `p b` using substitution: `Eq.subst h1 h2`.
    Example:
    ```
    example (α : Type) (a b : α) (p : α → Prop)
            (h1 : a = b) (h2 : p a) : p b :=
      Eq.subst h1 h2
    
    example (α : Type) (a b : α) (p : α → Prop)
        (h1 : a = b) (h2 : p a) : p b :=
      h1 ▸ h2
    ```
    The triangle in the second presentation is a macro built on top of `Eq.subst` and `Eq.symm`, and you can enter it by typing `\t`.
    For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
    
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `=` in identifiers is `eq`. nNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. (HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`.mNat +HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`. kNat)HAdd.hAdd.{u, v, w} {α : Type u} {β : Type v} {γ : outParam (Type w)} [self : HAdd α β γ] : α → β → γ`a + b` computes the sum of `a` and `b`.
    The meaning of this notation is type-dependent. 
    
    Conventions for notations in identifiers:
    
     * The recommended spelling of `+` in identifiers is `add`.
    complete
Definition2.7
!L∃∀Nused by 0

External declaration panel with a missing declaration.

Lean code for Definition2.71 declaration, 1 missing
Theorem2.8
AL∃∀Nused by 0

External theorem panel with an axiom-like declaration.

Lean code for Theorem2.81 definition, incomplete
  • axiom PreviewRuntimeShowcase.CodePanelDecls.previewExternalAxiomPreviewRuntimeShowcase.CodePanelDecls.previewExternalAxiom : True : TrueTrue : Prop`True` is a proposition and has only an introduction rule, `True.intro : True`.
    In other words, `True` is simply true, and has a canonical proof, `True.intro`
    For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
    
    axiom PreviewRuntimeShowcase.CodePanelDecls.previewExternalAxiomPreviewRuntimeShowcase.CodePanelDecls.previewExternalAxiom : True :
      TrueTrue : Prop`True` is a proposition and has only an introduction rule, `True.intro : True`.
    In other words, `True` is simply true, and has a canonical proof, `True.intro`
    For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
    
    axiom-like (no body)
Definition2.9
L∃∀Nused by 0

Inline code panel sample with complete Lean code.

Lean code for Definition2.9def panelInlineOnlyOk : Nat := 0
Definition2.10
L∃∀Nused by 0

Inline code panel sample with a sorry-backed declaration.

Lean code for Definition2.10theorem declaration uses `sorry`panelInlineOnlySorry : True := True All goals completed! 🐙
Definition2.11
L∃∀Nused by 0

Inline code panel sample with mixed declaration health.

Lean code for Definition2.11def panelInlineOk : Nat := 0 theorem declaration uses `sorry`panelInlineSorry : True := True All goals completed! 🐙
Definition2.12
AL∃∀Nused by 0

Inline code panel sample with an axiom-like declaration.

Lean code for Definition2.12axiom panelInlineAxiom : True
Definition2.13
XL∃∀Nused by 0

Statement without associated Lean code.