lean2js

Lean2Js.Example

source

Business logic written in Lean, and the theorems proved about it #

Ordinary Lean defs, each marked @[ship], and the theorems proved about them. Marking a def reads a declaration out of it, and ship_package gathers them into the program and writes the proof that each declaration denotes the def it was read from.

The program placed here is what ships as packages/verified-example.

def

Lean2Js.Example.add

source
(a b : Int) :
Equations
Instances For
    Used by
      def

      Lean2Js.Example.clampQuantity

      source
      (quantity upper : Int) :

      Clamps a quantity to at least 1 and at most upper.

      Equations
      Instances For
        Used by
          def

          Lean2Js.Example.maxLineQuantity

          source
          :

          The most of one line a single order is billed for.

          Equations
          Instances For
            Used by
              def

              Lean2Js.Example.lineTotal

              source
              (unitPrice quantity : Int) :

              The amount of a line item. The quantity is clamped before multiplying, so a negative quantity never makes the amount negative.

              Equations
              Instances For
                Used by
                  inductive

                  Lean2Js.Example.Role

                  source
                  Instances For
                    Used by
                      def

                      Lean2Js.Example.Role.typeDef

                      source
                      Equations
                      Instances For
                        Used by
                          def

                          Lean2Js.Example.Role.ofValue

                          source
                          Equations
                          Instances For
                            Used by
                              theorem

                              Lean2Js.Example.Role.ofValue_toValue

                              source
                              Used by
                                theorem

                                Lean2Js.Example.Role.toValue_eq

                                source
                                @[simp]
                                Used by
                                  instance

                                  Lean2Js.Example.instEncRole

                                  source
                                  @[instance_reducible]
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Used by
                                    theorem

                                    Lean2Js.Example.Role.toValue_hasTy

                                    source
                                    {p : Core.Program} {x : Role} :
                                    Used by
                                      theorem

                                      Lean2Js.Example.Role.ty_eq

                                      source
                                      @[simp]
                                      Used by
                                        def

                                        Lean2Js.Example.Role.accepts

                                        source
                                        (p : Core.Program) (x : Role) :
                                        Equations
                                        Instances For
                                          Used by
                                            def

                                            Lean2Js.Example.Role.toValue

                                            source
                                            (x : Role) :
                                            Equations
                                            Instances For
                                              Used by
                                                def

                                                Lean2Js.Example.roleRank

                                                source
                                                (role : Role) :
                                                Equations
                                                Instances For
                                                  Used by
                                                    def

                                                    Lean2Js.Example.lineTotals

                                                    source
                                                    (unitPrice : Int) (quantities : List Int) :

                                                    The amount of every line of an order at one unit price.

                                                    Equations
                                                    Instances For
                                                      Used by
                                                        def

                                                        Lean2Js.Example.anyOverLimit

                                                        source
                                                        (amounts : List Int) (limit : Int) :
                                                        Equations
                                                        Instances For
                                                          Used by
                                                            def

                                                            Lean2Js.Example.firstOverLimit

                                                            source
                                                            (amounts : List Int) (limit : Int) :

                                                            The first line that breaks the limit. Lines after it are never looked at.

                                                            Equations
                                                            Instances For
                                                              Used by
                                                                def

                                                                Lean2Js.Example.everyLineWithinLimit

                                                                source
                                                                (amounts : List Int) (limit : Int) :
                                                                Equations
                                                                Instances For
                                                                  Used by
                                                                    def

                                                                    Lean2Js.Example.someLineIsFree

                                                                    source
                                                                    (amounts : List Int) :
                                                                    Equations
                                                                    Instances For
                                                                      Used by
                                                                        def

                                                                        Lean2Js.Example.pageOf

                                                                        source
                                                                        (xs : List Int) (lo hi : Int) :

                                                                        One window of a list. A window reaching past the end is refused rather than shortened.

                                                                        Equations
                                                                        Instances For
                                                                          Used by
                                                                            def

                                                                            Lean2Js.Example.mostRecentFirst

                                                                            source
                                                                            (events : List String) :
                                                                            Equations
                                                                            Instances For
                                                                              Used by
                                                                                def

                                                                                Lean2Js.Example.combinedCart

                                                                                source
                                                                                (saved added : List Int) :
                                                                                Equations
                                                                                Instances For
                                                                                  Used by
                                                                                    def

                                                                                    Lean2Js.Example.headOr

                                                                                    source
                                                                                    (xs : List Int) (fallback : Int) :

                                                                                    An out-of-range read traps rather than yielding undefined.

                                                                                    Equations
                                                                                    Instances For
                                                                                      Used by
                                                                                        def

                                                                                        Lean2Js.Example.slugOf

                                                                                        source
                                                                                        («prefix» name : String) :
                                                                                        Equations
                                                                                        Instances For
                                                                                          Used by
                                                                                            def

                                                                                            Lean2Js.Example.orderReference

                                                                                            source
                                                                                            («prefix» : String) (orderNo : Int) :

                                                                                            The reference an order is filed under: the prefix and the order number in decimal.

                                                                                            Equations
                                                                                            Instances For
                                                                                              Used by
                                                                                                def

                                                                                                Lean2Js.Example.amountOf

                                                                                                source
                                                                                                (field : String) :

                                                                                                The amount a line carries, read back from the string the caller was handed. none unless the string is exactly the decimal spelling of an Int53, so "007", " 5" and "+5" are refused.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  Used by
                                                                                                    def

                                                                                                    Lean2Js.Example.amountOr

                                                                                                    source
                                                                                                    (field : String) (fallback : Int) :

                                                                                                    The same amount, with a fallback for a field that does not spell one.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      Used by
                                                                                                        def

                                                                                                        Lean2Js.Example.separatorAt

                                                                                                        source
                                                                                                        (reference sep : String) :

                                                                                                        Where the separator first sits in a reference, counted in code points. none when the reference carries none. JS's own indexOf counts UTF-16 units and answers -1.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          Used by
                                                                                                            def

                                                                                                            Lean2Js.Example.referencePrefix

                                                                                                            source
                                                                                                            (reference : String) :

                                                                                                            The part of a reference before its first separator, or the whole reference when it carries none.

                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              Used by
                                                                                                                def

                                                                                                                Lean2Js.Example.joinFields

                                                                                                                source
                                                                                                                (fields : List String) (separator : String) :

                                                                                                                A row of an uploaded file written back out: the fields in order with the separator between them. An empty list of fields writes an empty row.

                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  Used by
                                                                                                                    def

                                                                                                                    Lean2Js.Example.referenceFrom

                                                                                                                    source
                                                                                                                    (parts : List String) :

                                                                                                                    The reference an order is filed under, built from parts that are already in hand, under the same separator referencePrefix reads back.

                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      Used by
                                                                                                                        def

                                                                                                                        Lean2Js.Example.refiled

                                                                                                                        source
                                                                                                                        (reference oldSep newSep : String) :

                                                                                                                        A reference filed under one separator, rewritten under another. Every occurrence moves, and a reference carrying none comes back unchanged.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          Used by
                                                                                                                            def

                                                                                                                            Lean2Js.Example.receiptRule

                                                                                                                            source
                                                                                                                            (mark : String) :

                                                                                                                            The rule a printed receipt puts between its sections: mark written out 32 times, which is one column each where mark is a single character.

                                                                                                                            Equations
                                                                                                                            Instances For
                                                                                                                              Used by
                                                                                                                                def

                                                                                                                                Lean2Js.Example.amountColumn

                                                                                                                                source
                                                                                                                                (amount : Int) :

                                                                                                                                An amount in minor units, right-aligned in the column a printed receipt gives it. Too wide an amount keeps its digits and overruns the column.

                                                                                                                                Equations
                                                                                                                                Instances For
                                                                                                                                  Used by
                                                                                                                                    def

                                                                                                                                    Lean2Js.Example.maxReceiptRows

                                                                                                                                    source
                                                                                                                                    :

                                                                                                                                    The most rows a single printed receipt numbers.

                                                                                                                                    Equations
                                                                                                                                    Instances For
                                                                                                                                      Used by
                                                                                                                                        def

                                                                                                                                        Lean2Js.Example.lineNumbers

                                                                                                                                        source
                                                                                                                                        (rows : Int) :

                                                                                                                                        The line numbers a printed receipt gives its rows, counting from one. The count is clamped: a receipt prints at most maxReceiptRows rows, and Arr.range asks that the text bound how far it counts.

                                                                                                                                        Equations
                                                                                                                                        Instances For
                                                                                                                                          Used by
                                                                                                                                            def

                                                                                                                                            Lean2Js.Example.sortsBefore

                                                                                                                                            source
                                                                                                                                            (a b : String) :

                                                                                                                                            Comparison in code point order. JS's < compares UTF-16 units, so it does not agree.

                                                                                                                                            Equations
                                                                                                                                            Instances For
                                                                                                                                              Used by
                                                                                                                                                def

                                                                                                                                                Lean2Js.Example.mentionsTerm

                                                                                                                                                source
                                                                                                                                                (text term : String) :

                                                                                                                                                Whether a free-text note mentions a search term, ignoring case.

                                                                                                                                                Equations
                                                                                                                                                Instances For
                                                                                                                                                  Used by
                                                                                                                                                    def

                                                                                                                                                    Lean2Js.Example.storedCoupon

                                                                                                                                                    source
                                                                                                                                                    (campaign entered : String) :

                                                                                                                                                    A coupon code as it is stored: the campaign prefix and what the customer typed, upper-cased and with the surrounding whitespace gone.

                                                                                                                                                    Equations
                                                                                                                                                    Instances For
                                                                                                                                                      Used by
                                                                                                                                                        def

                                                                                                                                                        Lean2Js.Example.comparable

                                                                                                                                                        source
                                                                                                                                                        (s : String) :

                                                                                                                                                        The spelling two strings are compared under: the surrounding whitespace gone and the case levelled. Every comparison below goes through it and no consumer has any business calling it, which is what @[ship internal] says — it is compiled and called like any other declaration, and appears in neither index.d.ts nor the exports of index.js.

                                                                                                                                                        Equations
                                                                                                                                                        Instances For
                                                                                                                                                          Used by
                                                                                                                                                            def

                                                                                                                                                            Lean2Js.Example.couponApplies

                                                                                                                                                            source
                                                                                                                                                            (code campaign : String) :

                                                                                                                                                            Whether a coupon belongs to a campaign, comparing the way the codes are stored.

                                                                                                                                                            Equations
                                                                                                                                                            Instances For
                                                                                                                                                              Used by
                                                                                                                                                                def

                                                                                                                                                                Lean2Js.Example.fieldCount

                                                                                                                                                                source
                                                                                                                                                                (row separator : String) :

                                                                                                                                                                How many columns a line of an uploaded file carries. An empty separator leaves the line whole rather than cutting it into characters.

                                                                                                                                                                Equations
                                                                                                                                                                Instances For
                                                                                                                                                                  Used by
                                                                                                                                                                    def

                                                                                                                                                                    Lean2Js.Example.truncateLabel

                                                                                                                                                                    source
                                                                                                                                                                    (label : String) (limit : Int) :

                                                                                                                                                                    A label cut to fit, counted in code points so a surrogate pair is never split in half. A negative limit has no string to return and fails the way an out-of-range index does.

                                                                                                                                                                    Equations
                                                                                                                                                                    Instances For
                                                                                                                                                                      Used by
                                                                                                                                                                        def

                                                                                                                                                                        Lean2Js.Example.isSpreadsheet

                                                                                                                                                                        source
                                                                                                                                                                        (fileName : String) :

                                                                                                                                                                        Whether an uploaded file is a spreadsheet, compared the way the names are stored.

                                                                                                                                                                        Equations
                                                                                                                                                                        Instances For
                                                                                                                                                                          Used by
                                                                                                                                                                            def

                                                                                                                                                                            Lean2Js.Example.limitsFor

                                                                                                                                                                            source
                                                                                                                                                                            (role : Role) :

                                                                                                                                                                            What a role may do in a day and in a month.

                                                                                                                                                                            Equations
                                                                                                                                                                            Instances For
                                                                                                                                                                              Used by
                                                                                                                                                                                def

                                                                                                                                                                                Lean2Js.Example.priceOf

                                                                                                                                                                                source
                                                                                                                                                                                (prices : Dict Int) (sku : String) :
                                                                                                                                                                                Equations
                                                                                                                                                                                Instances For
                                                                                                                                                                                  Used by
                                                                                                                                                                                    def

                                                                                                                                                                                    Lean2Js.Example.isListed

                                                                                                                                                                                    source
                                                                                                                                                                                    (prices : Dict Int) (sku : String) :
                                                                                                                                                                                    Equations
                                                                                                                                                                                    Instances For
                                                                                                                                                                                      Used by
                                                                                                                                                                                        def

                                                                                                                                                                                        Lean2Js.Example.repriced

                                                                                                                                                                                        source
                                                                                                                                                                                        (prices : Dict Int) (sku : String) (amount : Int) :

                                                                                                                                                                                        The price book after one price change. A sku already in the book keeps its place.

                                                                                                                                                                                        Equations
                                                                                                                                                                                        Instances For
                                                                                                                                                                                          Used by
                                                                                                                                                                                            def

                                                                                                                                                                                            Lean2Js.Example.listedSkus

                                                                                                                                                                                            source
                                                                                                                                                                                            (prices : Dict Int) :
                                                                                                                                                                                            Equations
                                                                                                                                                                                            Instances For
                                                                                                                                                                                              Used by
                                                                                                                                                                                                def

                                                                                                                                                                                                Lean2Js.Example.listedPrices

                                                                                                                                                                                                source
                                                                                                                                                                                                (prices : Dict Int) :
                                                                                                                                                                                                Equations
                                                                                                                                                                                                Instances For
                                                                                                                                                                                                  Used by
                                                                                                                                                                                                    def

                                                                                                                                                                                                    Lean2Js.Example.withdrawn

                                                                                                                                                                                                    source
                                                                                                                                                                                                    (prices : Dict Int) (sku : String) :

                                                                                                                                                                                                    The price book after a sku is withdrawn. A sku that was never listed leaves the book unchanged.

                                                                                                                                                                                                    Equations
                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                      Used by
                                                                                                                                                                                                        def

                                                                                                                                                                                                        Lean2Js.Example.catalogueSize

                                                                                                                                                                                                        source
                                                                                                                                                                                                        (prices : Dict Int) :
                                                                                                                                                                                                        Equations
                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                          Used by

                                                                                                                                                                                                            The same price book at the other spelling. Dict.Obj crosses the boundary as a plain object rather than as a Map, so JSON.stringify of what these hand back is the book itself. Inside the module the two are one thing, and the operations below are the ones above under different names.

                                                                                                                                                                                                            def

                                                                                                                                                                                                            Lean2Js.Example.objPriceOf

                                                                                                                                                                                                            source
                                                                                                                                                                                                            (prices : Dict.Obj Int) (sku : String) :
                                                                                                                                                                                                            Equations
                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                def

                                                                                                                                                                                                                Lean2Js.Example.objIsListed

                                                                                                                                                                                                                source
                                                                                                                                                                                                                (prices : Dict.Obj Int) (sku : String) :
                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                    def

                                                                                                                                                                                                                    Lean2Js.Example.objRepriced

                                                                                                                                                                                                                    source
                                                                                                                                                                                                                    (prices : Dict.Obj Int) (sku : String) (amount : Int) :

                                                                                                                                                                                                                    The price book after one price change, handed back as an object. A sku already in the book keeps its place.

                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                        def

                                                                                                                                                                                                                        Lean2Js.Example.objWithdrawn

                                                                                                                                                                                                                        source
                                                                                                                                                                                                                        (prices : Dict.Obj Int) (sku : String) :

                                                                                                                                                                                                                        The price book after a sku is withdrawn, handed back as an object.

                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                            def

                                                                                                                                                                                                                            Lean2Js.Example.objListedSkus

                                                                                                                                                                                                                            source
                                                                                                                                                                                                                            (prices : Dict.Obj Int) :
                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                Lean2Js.Example.objListedPrices

                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                (prices : Dict.Obj Int) :
                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                    Lean2Js.Example.objCatalogueSize

                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                    (prices : Dict.Obj Int) :
                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                        Lean2Js.Example.objLimitsFor

                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                        (role : Role) :

                                                                                                                                                                                                                                        What a role may do, written out at the spelling that crosses as a plain object rather than as a Map. Beside limitsFor it is one dictionary written twice: the same entries, the same operations, and what the spelling decides is only what a consumer is handed.

                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                            Lean2Js.Example.divide

                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                            (a b : Int) :

                                                                                                                                                                                                                                            Truncating division. Division by zero traps on the JS side too.

                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                Lean2Js.Example.remainder

                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                (a b : Int) :
                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                    Lean2Js.Example.taxOn

                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                    (amount rate : Int) :

                                                                                                                                                                                                                                                    The tax on an amount in minor units at a rate in basis points, rounded half away from zero — which is the rounding an amount of money gets where nothing says otherwise.

                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                        Lean2Js.Example.shareOf

                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                        (cost parties : Int) :

                                                                                                                                                                                                                                                        What each of parties carries of a cost, rounded up. A count of zero or less is read as one, since a cost carried by nobody is carried by the one who has it.

                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                            Lean2Js.Example.evenShare

                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                            (amount parties : Int) :

                                                                                                                                                                                                                                                            One party's share of an amount split evenly, rounded to the nearest whole unit with a half going away from zero. A count of zero or less is read as one, as shareOf reads it.

                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                Lean2Js.Example.dayOfInstant

                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                (ms : Int) :

                                                                                                                                                                                                                                                                Which whole day an instant falls in, counting from the epoch, where an instant before it belongs to the day it is inside rather than to the one after: divFloor and not div.

                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                    Lean2Js.Example.dayNumber

                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                    (year month day : Int) :

                                                                                                                                                                                                                                                                    The day a calendar date falls on, counting from 1970-01-01.

                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                        Lean2Js.Example.yearOf

                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                        (days : Int) :

                                                                                                                                                                                                                                                                        The calendar year a day number falls in.

                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                            Lean2Js.Example.monthOf

                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                            (days : Int) :

                                                                                                                                                                                                                                                                            The calendar month a day number falls in, 1 through 12.

                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                Lean2Js.Example.dayOfMonthOf

                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                (days : Int) :

                                                                                                                                                                                                                                                                                The day of the month a day number falls on, 1 through 31.

                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                    Lean2Js.Example.weekdayOf

                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                    (days : Int) :

                                                                                                                                                                                                                                                                                    The day of the week a day number falls on, 0 for Sunday through 6 for Saturday.

                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                        Lean2Js.Example.monthLength

                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                        (year month : Int) :

                                                                                                                                                                                                                                                                                        How many days a calendar month holds, a leap February included.

                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                            Lean2Js.Example.negate

                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                            (a : Int) :
                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                Lean2Js.Example.priceGap

                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                (a b : Int) :
                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                    Lean2Js.Example.discounted

                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                    (amount percent : Int) :

                                                                                                                                                                                                                                                                                                    The amount after a percent% discount. The remainder is truncated.

                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                        Lean2Js.Example.tenPercentOff

                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                        (amount : Int) :
                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                            Lean2Js.Example.rebindTwice

                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                            (amount : Int) :

                                                                                                                                                                                                                                                                                                            Binds the same name twice. ESM runs in strict mode, so emitting const twice would fail at import time.

                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                Lean2Js.Example.noDiscount

                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                (amount : Int) :
                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.priced

                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                    (rule : Int → Int) (amount : Int) :

                                                                                                                                                                                                                                                                                                                    Charges an amount under a pricing rule the caller picks. Taking a function keeps it off the public API: there is no way to check at the boundary that one handed in from JS is pure.

                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.memberPrice

                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                        (amount : Int) :
                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.guestPrice

                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                            (amount : Int) :
                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.mixChannels

                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                (a b : UInt32) :
                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.bucketOf

                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                    (key buckets : UInt32) :
                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.clampChannel

                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                        (value lo hi : UInt32) :

                                                                                                                                                                                                                                                                                                                                        A channel value held between a floor and a ceiling.

                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.scaleFee

                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                            (fee factor : BigInt) :
                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.bigQuotient

                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                (a b : BigInt) :
                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.sameLabel

                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                    (a b : String) :
                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.safeQuotientIsPositive

                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                        (a b : Int) :

                                                                                                                                                                                                                                                                                                                                                        Doubles as a check on short-circuiting. When b is 0 the right-hand side is not evaluated.

                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.canCheckout

                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                            (signedIn : Bool) (cartTotal stock : Int) :
                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.cappedCharge

                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                (amount budget : Int) :
                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.atLeast

                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                    (amount floor : Int) :
                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                        structure

                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Money

                                                                                                                                                                                                                                                                                                                                                                        source

                                                                                                                                                                                                                                                                                                                                                                        The constructor is named so that the subset reads it as Money; Lean's default mk would make the generated object's tag mk.

                                                                                                                                                                                                                                                                                                                                                                        constructor Money

                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                            instance

                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.instDecidableEqMoney

                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                            @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.instDecidableEqMoney.decEq

                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                              (x✝ x✝¹ : Money) :
                                                                                                                                                                                                                                                                                                                                                                              Decidable (x✝ = x✝¹)
                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.Money.toValue_eq

                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                  @[simp]
                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.Money.typeDef

                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Money.ofValue

                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                            instance

                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.instEncMoney

                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                            @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Money.ofValue_toValue

                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.Money.toValue

                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.Money.accepts

                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Money.toValue_hasTy

                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.Money.ty_eq

                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                          @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                            inductive

                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.OrderState

                                                                                                                                                                                                                                                                                                                                                                                                            source

                                                                                                                                                                                                                                                                                                                                                                                                            Told apart by kind rather than the default tag: which key reads well is the author's call, and the mark above the type is where it is made. The rest of the types here keep tag, so the generated package carries both.

                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                instance

                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.instInhabitedOrderState

                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.OrderState.ofValue_toValue

                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.OrderState.ofValue

                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.OrderState.typeDef

                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.OrderState.toValue_eq

                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                            @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                              instance

                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.instEncOrderState

                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                              @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.OrderState.accepts

                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.OrderState.toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.OrderState.toValue_hasTy

                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                        {p : Core.Program} {x : OrderState} :
                                                                                                                                                                                                                                                                                                                                                                                                                                        accepts p x → Value.hasTy p x.toValue (Core.Ty.named "OrderState" []) = true
                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.OrderState.ty_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                          @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.addMoney

                                                                                                                                                                                                                                                                                                                                                                                                                                            source

                                                                                                                                                                                                                                                                                                                                                                                                                                            Amounts in different currencies cannot be added. === is unusable on the JS side, so a structural equality helper is called.

                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.sameMoney

                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                (a b : Money) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.currenciesOf

                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                    (items : List Money) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.cartTotal

                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                        (items : List Money) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Adds the amounts up whatever currency each carries; addMoney is the operation that refuses to mix them.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.cheapestFirst

                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                            (items : List Money) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The lines of a cart, cheapest first. Lines that cost the same keep the order they came in.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.inLabelOrder

                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                (labels : List String) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Labels in the order the subset compares strings, which counts code points.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.total

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (xs : List Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.trackingOf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.canRefund

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (role : Role) (state : OrderState) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.firstTracking

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.refundableOnly

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (role : Role) (states : List OrderState) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The orders this role may still refund. The predicate reads role from outside the lambda.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.ship

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (state : OrderState) (trackingId : String) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The state transition to shipped. Rejects states that cannot transition and an empty tracking id.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.quantityLabel

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (quantity : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The label shown next to a line item.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.renewalLabel

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (autoRenew : Bool) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Whether a subscription carries on. Both cases are named, so no fallback is needed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.chargeable

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (amount : Money) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    An amount of zero is free whatever the currency, and an amount carrying no currency cannot be charged at all.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.settleMessage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The shipping line shown once a transition has been attempted. A draft or cancelled order has nothing to show, so one arm reaches past ok and leaves the state itself open.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.settledOrderId

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The order the settlement placed, if it placed one. The wildcard here stands for both the states that are not placed and the error, so the split the certificate makes reaches Except as well.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.dailyLimit

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (role : Role) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                A role with no daily limit recorded may do nothing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.monthlyLimit

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (role : Role) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The same read with the arms the other way round: an arm that binds, then a wildcard for the rest. The certificate splits the scrutinee to show the binding arm did not fire, which Option needs as much as a type the program declares.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        structure

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Paginated

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (T : Type) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        One page of results together with how many there are in all. The subset carries the parameter as a Ty.var and a use substitutes what it was applied to, so the name here is the one the generated type reads as.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        constructor Paginated

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Paginated.toValue_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Paginated.ofValue_toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {T : Type} [Enc T] (x : Example.Paginated T) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.Paginated.ofValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                {T : Type} [Enc T] (v : Value) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.Paginated.typeDef

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        instance

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.instEncPaginated

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {T : Type} [Enc T] :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.Paginated.toValue_hasTy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          {T : Type} [Enc T] {p : Core.Program} {x : Example.Paginated T} :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          accepts p x → Value.hasTy p x.toValue (Core.Ty.named "Paginated" [Enc.ty T]) = true
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Paginated.ty_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            {T : Type} [Enc T] :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Paginated.toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {T : Type} [Enc T] (x : Example.Paginated T) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.Paginated.accepts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  {T : Type} [Enc T] (p : Core.Program) (x : Example.Paginated T) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      inductive

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.Validated

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (E A : Type) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      What a check concluded: the value it accepted, or the reasons it refused. E is named by only one of the two constructors, so a valid term cannot be read off for it and every use carries both arguments.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.Validated.ofValue_toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          {E A : Type} [Enc E] [Enc A] (x : Validated E A) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Validated.toValue_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            {E A : Type} [Enc E] [Enc A] :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Validated.toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {E A : Type} [Enc E] [Enc A] (x : Validated E A) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.Validated.accepts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  {E A : Type} [Enc E] [Enc A] (p : Core.Program) (x : Validated E A) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.Validated.toValue_hasTy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      {E A : Type} [Enc E] [Enc A] {p : Core.Program} {x : Validated E A} :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Validated.ty_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        {E A : Type} [Enc E] [Enc A] :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          instance

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.instEncValidated

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          {E A : Type} [Enc E] [Enc A] :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Validated.ofValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            {E A : Type} [Enc E] [Enc A] (v : Value) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.Validated.typeDef

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.remainingItems

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (page : Paginated Money) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    How many results lie beyond the page in hand.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.firstPage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (amounts : List Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The whole list served as a single page.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.validateQuantity

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (quantity : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Accepts an order quantity or says why it was refused.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.validationMessage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (outcome : Validated String Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The line shown once a quantity has been checked.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.amountWithTax

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (amount : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The amount and the tax charged on it, as the two lines they are billed as.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.currencyOf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (item : Money) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.previewLines

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (amounts : List Int) (upTo : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The lines shown before the fold. A count past the end of the order shows the whole of it, where pageOf would have refused the window.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.linesBelowFold

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (amounts : List Int) (upTo : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.cartIsEmpty

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (items : List Money) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.stocksSku

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (skus : List String) (sku : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.amountsTotal

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (amounts : List Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.spreadsheetCount

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (fileNames : List String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.firstAmount

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (amounts : List Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.latestEvent

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (events : List String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.allLines

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (orders : List (List Int)) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Every line of every order in one list.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.linesWithTax

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (amounts : List Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.noteIsBlank

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (note : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.priceOr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (prices : Dict Int) (sku : String) (fallback : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The listed price, or the fallback where the sku is not in the book.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.byCurrency

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (items : List Money) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            One line per currency. Where a currency appears twice the later line is the one kept.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.quantityOr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (quantity : Option Int) (fallback : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.discountedIfAny

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (amount : Option Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.settledOrElse

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (outcome : Except String Money) (fallback : Money) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.settledCurrency

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.loudRefusal

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The refusal upper-cased. What the settlement accepted is handed back untouched.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.settledMoney

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.trackingIds

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The tracking id of every order that has one, and an empty string for the rest. The match is inside the traversal's own function rather than in a declaration of its own.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.refundCount

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (amounts : List Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            How many of the amounts are refunds, with the test written where the count is.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.creditNoteAmount

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (amount : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                A charge as it appears on a credit note, where money leaving is written negative.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.directionLabel

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (sign : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    What the sign on a statement line means.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        inductive

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Category

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Where a product sits in the catalogue. A group holds categories, so the type names itself and the generated .d.ts type does too.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Category.ty_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Category.toValue_hasTy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {p : Core.Program} (hp : p.findType? "Category" = some typeDef) {x : Category} :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              acceptsV p x → Value.hasTy p x.toValue (Core.Ty.named "Category" []) = true
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.Category.toValues_hasTy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                {p : Core.Program} (hp : p.findType? "Category" = some typeDef) {xs✝ : List Category} :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                acceptsVs p xs✝ → Value.hasElemTy p (List.map toValue xs✝) (Core.Ty.named "Category" []) = true
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.Category.toValue_eq

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @[simp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.Category.ofValues

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Category.denotes_fold

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (p : Core.Program) (env : Env) {β : Type} [Enc β] (f0 : String → β) (f1 : String → List β → β) (b0 b1 : Core.Expr) (htd : p.findType? "Category" = some typeDef) (h0 : ∀ (a0 : String), Denote.Denotes p (("name", Enc.toValue a0) :: env) b0 (f0 a0)) (h1 : ∀ (a0 : String) (a1 : List β), Denote.Denotes p (("name", Enc.toValue a0) :: ("children", Enc.toValue a1) :: env) b1 (f1 a0 a1)) (x : Category) {f : Nat} :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        f ≤ defaultFuel → ∀ (v : Value), evalFold p f env "Category" [] (foldAlts b0 b1) x.toValue = Except.ok v → v = Enc.toValue (fold f0 f1 x)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.Category.denotes_foldList

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (p : Core.Program) (env : Env) {β : Type} [Enc β] (f0 : String → β) (f1 : String → List β → β) (b0 b1 : Core.Expr) (htd : p.findType? "Category" = some typeDef) (h0 : ∀ (a0 : String), Denote.Denotes p (("name", Enc.toValue a0) :: env) b0 (f0 a0)) (h1 : ∀ (a0 : String) (a1 : List β), Denote.Denotes p (("name", Enc.toValue a0) :: ("children", Enc.toValue a1) :: env) b1 (f1 a0 a1)) (xs : List Category) {f : Nat} :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          f ≤ defaultFuel → ∀ (v : List Value), evalFoldList p f env "Category" [] (foldAlts b0 b1) (List.map toValue xs) = Except.ok v → v = List.map Enc.toValue (foldList f0 f1 xs)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Category.ofValues_map

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (xs✝ : List Category) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Category.toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @[irreducible]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.Category.accepts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.Category.ofValue_toValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Category.acceptsV

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.Category.ofValue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.Category.acceptsVs

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.Category.fold

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {β : Type} (f0 : String → β) (f1 : String → List β → β) (x : Category) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    β
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.Category.typeDef

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            instance

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.instEncCategory

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.Category.foldAlts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.Category.foldList

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  {β : Type} (f0 : String → β) (f1 : String → List β → β) (xs : List Category) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  List β
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.categoryName

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (category : Category) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.directChildren

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (category : Category) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          How many categories sit directly under this one. What sits under those is a walk, which is what categoryProducts takes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.categoryProducts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (category : Category) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              How many products the catalogue holds, however deep the groups go. A group answers for everything under it, so this walks the whole tree rather than reading one level of it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.priceOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.discounted_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.settledOrElse_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.firstTracking_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.objIsListed_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.firstPage_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.lineTotals_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (unitPrice : Int) (quantities : List Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.divide_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.noteIsBlank_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.weekdayOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.objListedSkus_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.ship_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (state : OrderState) (trackingId : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.cartTotal_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.validationMessage_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.monthlyLimit_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.monthOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.roleRank_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.safeQuotientIsPositive_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.loudRefusal_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.priceGap_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.objWithdrawn_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.guestPrice_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.settledCurrency_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.evenShare_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.objListedPrices_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.firstAmount_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.bigQuotient_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.cappedCharge_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.spreadsheetCount_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.sameLabel_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.yearOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.trackingOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.add_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.trackingIds_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.canCheckout_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (signedIn : Bool) (cartTotal stock : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.mentionsTerm_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.categoryName_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.amountOr_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.total_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.joinFields_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.listedSkus_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.headOr_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.discountedIfAny_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.separatorAt_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.orderReference_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.settleMessage_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.sameMoney_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.catalogueSize_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.addMoney_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.slugOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    («prefix» name : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.program

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.negate_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.truncateLabel_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.refiled_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (reference oldSep newSep : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.canRefund_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.isSpreadsheet_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.amountWithTax_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.referenceFrom_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.storedCoupon_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.dayOfInstant_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.lineTotal_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (unitPrice quantity : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.byCurrency_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.noDiscount_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.remainingItems_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.inLabelOrder_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.tenPercentOff_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.linesBelowFold_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.objPriceOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.pageOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.quantityOr_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (quantity : Option Int) (fallback : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.lineNumbers_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.settledOrderId_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.atLeast_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.dayNumber_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.amountOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.validateQuantity_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.chargeable_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.dayOfMonthOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.limitsFor_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.remainder_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.monthLength_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.repriced_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (prices : Dict Int) (sku : String) (amount : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.scaleFee_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.sortsBefore_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.bucketOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.clampChannel_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.currencyOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.refundableOnly_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.isListed_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.priceOr_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (prices : Dict Int) (sku : String) (fallback : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.referencePrefix_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.settledMoney_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.comparable_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.cheapestFirst_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.objRepriced_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.currenciesOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.combinedCart_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.directionLabel_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.categoryProducts_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.someLineIsFree_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.couponApplies_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.directChildren_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.anyOverLimit_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.allLines_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.amountsTotal_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.stocksSku_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.everyLineWithinLimit_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.listedPrices_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.firstOverLimit_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.cartIsEmpty_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.mostRecentFirst_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.creditNoteAmount_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.fieldCount_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.previewLines_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.memberPrice_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.objCatalogueSize_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.amountColumn_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.shareOf_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.priced_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (ruleName : String) (rule : Int → Int) (ruleRuns : Denote.DenotesFn program ruleName rule) (amount : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.clampQuantity_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.quantityLabel_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.refundCount_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.taxOn_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.latestEvent_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.mixChannels_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.linesWithTax_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.dailyLimit_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.rebindTwice_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.objLimitsFor_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.renewalLabel_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.withdrawn_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.receiptRule_certificate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.add_comm

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (a b : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            add a b = add b a

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Swapping the arguments of add changes nothing: whatever the two integers, both orders give the same sum.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.cheapest_first_keeps_every_line

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (items : List Money) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (cheapestFirst items).Perm items

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ordering a cart by price loses no line and invents none: the answer holds the same lines as the cart it was given, in some order.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.monthly_limit_is_not_negative

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (role : Role) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                No role's monthly limit is negative, including a role whose book records none.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.nothing_under_it_counts_none

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  A category with nothing under it counts nothing under it, whatever it is called. Two shapes have nothing under them — a leaf, and a group holding no categories — and both are here.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.a_group_counts_what_is_directly_under_it

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (name : String) (children : List Category) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    directChildren (Category.group name children) = Arr.length children

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    A group counts what sits directly under it, however deep those categories go themselves.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.a_leaf_holds_one_product

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      A leaf holds one product, whatever it is called.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.an_empty_group_holds_no_product

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        A group is not itself a product: a group with nothing under it holds none.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.nesting_keeps_the_product

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (outer inner first second : String) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The walk goes past the first level, which is the whole difference from directChildren: a group whose only child is a group holding two leaves holds both those products, where counting what is directly under it answers one.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.a_group_holds_what_its_children_hold

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (name : String) (children : List Category) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            A group holds what its children hold and nothing besides: the count distributes over the children, however deep each of them goes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.failed_settlement_has_no_order_id

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (message : String) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              A settlement that failed carries no order id, whatever it failed with.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.line_total_caps_the_quantity

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (unitPrice quantity : Int) (hq : maxLineQuantity < quantity) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                lineTotal unitPrice quantity = unitPrice * maxLineQuantity

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                A line ordered past the cap is billed at the cap, whatever the unit price.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.reference_from_three_parts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (a b c : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  referenceFrom [a, b, c] = a ++ "-" ++ b ++ "-" ++ c

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Three parts come out of referenceFrom in the order they went in, with a hyphen written between each neighbouring pair. Hyphens the parts themselves carry are not counted, so this says nothing about how many the answer holds.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.line_numbers_counts_the_rows

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (rows : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    A receipt numbers one row per row it prints: as many numbers as the clamped count says, whatever rows was asked for.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.line_numbers_are_rows

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (rows k : Int) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The numbers a receipt prints are exactly the rows it has: a number is one of them when it is at least 1 and at most the clamped count, and is not one of them otherwise.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.money

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (amount : Int) (currency : String) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        An amount of money as it crosses the boundary.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.draft_never_ships

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (trackingId : String) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            evalCall program "ship" [Value.obj "draft" [], Value.str trackingId] = Except.ok (Value.obj "error" [("error", Value.str "a draft order cannot ship")])

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            A draft order cannot ship, whatever tracking id comes with it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.clamped_quantity_in_range

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (quantity : Int) (hlo : int53Min ≤ quantity) (hhi : quantity ≤ int53Max) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ∃ (n : Int), evalCall program "clampQuantity" [Value.int53 quantity, Value.int53 999] = Except.ok (Value.int53 n) ∧ 1 ≤ n ∧ n ≤ 999

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Clamping any Int53 quantity to at most 999 lands between 1 and 999.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.same_currency_adds

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (x y : Int) (currency : String) (hx : int53Min ≤ x ∧ x ≤ int53Max) (hy : int53Min ≤ y ∧ y ≤ int53Max) (hsum : int53Min ≤ x + y ∧ x + y ≤ int53Max) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                evalCall program "addMoney" [money x currency, money y currency] = Except.ok (Value.obj "ok" [("value", money (x + y) currency)])

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Two amounts in the same currency add up, as long as their sum stays within Int53.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The generated function, not just the expression #

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Decl.fragment_correct is about a compiled expression. Decl.decl_correct carries it up to a call of the generated function, entry check and all. It holds of every declaration the program has: the fragment covers the whole subset.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The arguments are whatever Decl.ArgsDecode admits, which is the set the entry check lets through and not just the canonical spelling: a JS value whose keys are in another order, or which carries keys the declared type does not name, decodes to the same Value and is covered by the same theorem.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The claims below hold for every reading of the keys the program compiles under, which for this program is the one its types declare: the compiled module and the encoding read one and the same, so the agreement does not depend on which.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.program_typesNoDictObj

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  No type this program declares carries a dictionary the declaration told the compiler to hand across the boundary as a plain object rather than as a Map. This is the half encodeAt reads — it recurses into a declared type's fields and never into a declaration — so every claim below whose own return type reaches no such dictionary is stated at encodeValue, the spelling it has always had, through encodeAt_eq_encodeValue.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The program itself does hand one across: objRepriced and objWithdrawn return a Dict.Obj Int, so their entries emit the walk out that Compile.retWalk expands and their results are read at encodeAt rather than at encodeValue. Every other obj declaration takes one and returns something that reaches none, so its entry emits no walk and this theorem carries it to encodeValue like any other.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.add_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program addDecl.params jargs args) (he : evalCall program "add" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "add" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Whatever arguments the entry check accepts, the generated add returns what eval returns. Its body is a single binary operation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.discounted_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program discountedDecl.params jargs args) (he : evalCall program "discounted" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "discounted" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The same for a body that opens with a let, which the compiler emits as a const statement.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.rebindTwice_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program rebindTwiceDecl.params jargs args) (he : evalCall program "rebindTwice" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "rebindTwice" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        And for a body whose second let rebinds a name already in scope, which the compiler leaves as an expression rather than a statement.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.memberPrice_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program memberPriceDecl.params jargs args) (he : evalCall program "memberPrice" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "memberPrice" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          And for a body that calls another declaration, handing it a third by name. The call is where the proof leaves the expression it is looking at: priced applies the function it was given, so the claim about memberPrice rests on the same claim about tenPercentOff.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Throwing what the reference semantics throws #

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Decl.decl_traps is the other half of decl_correct: for arguments the entry accepts, a body that throws is matched by a generated function that throws the same code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.program_progOk

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The first of the two checks the emitter runs on a program before it writes anything: every call goes backwards.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.program_cost_fits

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The second: the fuel the artifact runs at covers the deepest call this program can make.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.add_traps

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (err : Err) (htyped : ParamsTyped program addDecl.params args) (hdec : Decl.ArgsDecode program addDecl.params jargs args) (he : evalCall program "add" args = Except.error err) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "add" jargs = Except.error err.code

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                For arguments the entry check decodes to the count and types add declares, whenever eval refuses to return a value the generated function throws the code eval threw. Its body can reach int53Overflow. Running out of fuel is not among the answers: the two checks above rule it out for this program. What falls outside those types never reaches the body at all — that is add_refuses.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.add_overflow_throws

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The trap is reachable, and reached the same way on both sides: one past the top of Int53 throws int53Overflow out of the generated function.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.addMoney_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program addMoneyDecl.params jargs args) (he : evalCall program "addMoney" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "addMoney" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The fragment reaches business logic, not just arithmetic: addMoney reads two fields, compares them, and builds a Result around a constructor.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.ship_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program shipDecl.params jargs args) (he : evalCall program "ship" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "ship" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The fragment reaches a match: ship chooses an arm by the constructor of its scrutinee and reads the fields that arm binds.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.cartTotal_calls_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (v : Value) (hdec : Decl.ArgsDecode program cartTotalDecl.params jargs args) (he : evalCall program "cartTotal" args = Except.ok v) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "cartTotal" jargs = Except.ok (encodeValue v)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        And an array traversal: cartTotal folds a body over the elements, each under its own binding.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.cartTotal_traps

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (err : Err) (htyped : ParamsTyped program cartTotalDecl.params args) (hdec : Decl.ArgsDecode program cartTotalDecl.params jargs args) (he : evalCall program "cartTotal" args = Except.error err) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "cartTotal" jargs = Except.error err.code

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The trap side of a traversal: a fold whose running sum leaves Int53 throws where eval does, at the element that overflowed rather than at the end.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Refusing what the reference semantics refuses #

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Decl.decl_refuses needs no InFragment either — the entry check does not look at the body. What it asks for instead is paramsCheckable, which decl_correct does not: a declaration taking another by name has no boundary to check.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.add_refuses

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Whatever add is handed, if no reading of those JS values is a pair of Int53s, the generated function throws instead of computing. The one shape left out is a dictionary holding a key twice, which a Map cannot hold.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.add_refuses_string

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The hypothesis discharged on a concrete call: a string where an Int53 was declared throws, because no Int53 encodes to one.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.addMoney_traps

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [Core.Discriminators] (m : Js.Module) (hm : Compile.compileProgram program = Except.ok m) (jargs : List Js.JsValue) (args : List Value) (err : Err) (htyped : ParamsTyped program addMoneyDecl.params args) (hdec : Decl.ArgsDecode program addMoneyDecl.params jargs args) (he : evalCall program "addMoney" args = Except.error err) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ∃ (g : Nat), ∀ (g' : Nat), g ≤ g' → Js.callFunctionAt m g' "addMoney" jargs = Except.error err.code

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The same for addMoney, under the same declared types: the only way its body throws is the Int53 overflow of the sum, and the generated function throws that code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.file_reads_back

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The text lean2js writes for this program reads back as the module the compiler built. Nothing in between is assumed: the roundtrip holds of whatever compileProgram produces, so the claim carries no side condition about the shape of the module.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.helpers_ship_as_modelled

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (ext : HelperSem.Ext) (name : String) (args : List Js.JsValue) (r : Js.JsResult) (hok : HelperSem.helperArgsOk name args) (h : Js.helper name args = some r) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The runtime helpers are the last hand-written JavaScript in the artifact, and the model of the generated code reaches most of them through one table. Every row of that table is what the source the compiler prints actually computes; helperArgsOk is what a call to a row is still asked for, and it asks only for the Int53 range a type has already given, the distinct keys a Map cannot break, and the shapes on which __eq's walk and the model's structural equality decide the same thing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    __ck and the seven traversal helpers are not rows: the model evaluates them as rules of its own, and HelperProof answers those against the same printed source.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.entry_check_fits_dts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (jv : Js.JsValue) (ty : Core.Ty) (b : Nat) (d : Js.TyDesc) (hd : Compile.tyDesc program b ty = Except.ok d) (hc : Js.checkTy [] jv d = true) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Everything the entry check lets through is a value admitted by the type the published .d.ts prints for that parameter. The two are not the same set: the check reads a number's range, which a TypeScript type cannot say, so a call the .d.ts accepts can still be refused at the boundary.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.dts_fits_entry_check

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The other direction, and the one a caller feels: an argument the published .d.ts type admits is one the entry check accepts. Dts.inRange is the whole of what is assumed about the value — the Int53 and UInt32 ranges the check reads, which a TypeScript type cannot express. The order the keys arrive in is not read, and neither are keys the type does not declare.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.encoded_values_fit_dts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          What comes back, rather than what goes in: a value the reference semantics gives a declared type to, read out through that type, is one the published .d.ts admits at the type it prints for a return, which is the narrower of the two where the type reaches a dictionary crossing as a plain object. typeSound gives the type to whatever a declaration returns, and decl_correct says the generated function returns exactly that reading — so this is the value a consumer meets. Where the type reaches no such dictionary the reading is the encoding itself (encodeAt_eq_encodeValue, program_typesNoDictObj).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.returned_values_fit_parameter_types

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (ty : Core.Ty) (jv : Js.JsValue) (h : Dts.TsSatOut program ty jv) :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The type the .d.ts prints for a return is one the type it prints for a parameter admits, so a call chained onto another type-checks. That is a statement about the two printed types and nothing else; that the value is accepted at run time is returned_values_pass_the_entry_check. This is what lets encoded_values_fit_dts be handed to dts_fits_entry_check.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.returned_values_pass_the_entry_check

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              And it is accepted, not merely admitted by the type: what one call hands back passes the next call's entry check, with none of the range caveat dts_fits_entry_check carries. The range is what Value.hasTy already says about the value the first call returned, so two exported functions compose with no check of the consumer's own in between. What the second call then computes on is returned_values_read_back_unchanged.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Lean2Js.Example.returned_values_read_back_unchanged

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                source

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The other half of composing two calls: the second entry does not merely accept what the first handed back, it reads it back as the value the first one returned. Together with returned_values_pass_the_entry_check that is the whole of what the crossing costs — what decl_correct says the first call hands back is accepted, and rebuilt as the value it encodes. A dictionary walked out to a plain object becomes the Map the body works in again, and nothing else moves.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Lean2Js.Example.steps_agree

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (fn : String) (d : Core.Decl) (args : List Value) (hd : program.find? fn = some d) (hpub : d.paramsCheckable = true) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ∃ (n : Nat), ∀ (bound : Nat), n ≤ bound → stepCall program bound fn args = evalCall program fn args

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The small-step machine, given enough steps, answers exactly as eval does every call whose arguments the entry check has a shape to read — which is every exported function, and every internal one that takes no function.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lean2Js.Example.no_rate_is_no_tax

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (amount : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    taxOn amount 0 = 0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Nothing is taxed at a rate of zero, whatever the amount.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lean2Js.Example.a_refund_is_taxed_as_the_charge

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (amount rate : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      taxOn (-amount) rate = -taxOn amount rate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      A refund is taxed exactly as the charge it reverses: the tax on a negative amount is the tax on the positive one, negated. Rounding a half upwards, as JavaScript's Math.round does, would not hold this.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Lean2Js.Example.tax_of_five_at_a_tenth

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        taxOn 5 1000 = 1 ∧ taxOn (-5) 1000 = -1

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Where the tax lands exactly on a half, it goes away from zero and is not dropped: a tenth of five is one either way round, where truncating would answer zero to both. Two amounts rather than a rule — the symmetry above holds of truncation too, so it is this that says which way a half goes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Lean2Js.Example.the_day_holds_the_instant

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (ms : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          dayOfInstant ms * 86400000 ≤ ms ∧ ms < (dayOfInstant ms + 1) * 86400000

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The day an instant is filed under is the day that holds it: the instant is at or after that day's first millisecond and before the next day's. It is what says an instant before the epoch belongs to the day it is inside rather than to the one after — truncating division puts the last millisecond before the epoch in day zero, where this rules it out for every instant rather than at one.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            theorem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lean2Js.Example.shares_cover_the_cost

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (cost parties : Int) :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            cost ≤ shareOf cost parties * max parties 1

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The shares cover the cost: what each of the parties carries, multiplied back out, is never less than the cost itself. Rounding up is what holds it, and it holds however many parties there are, a count of zero or less being read as one.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              def

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lean2Js.Example.manifest

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Used by