Documentation

PolygonalNumbers.Polygonal

def IsTriangular (n : ℤ) :
Equations
Instances For
    def IsnPolygonal (s : ℤ) :
    s ≥ 3 → (n : ℕ) → Prop
    Equations
    Instances For
      def IsnPolygonal' (s : ℤ) :
      s ≥ 3 → (n : ℕ) → Prop
      Equations
      Instances For
        def IsnPolygonal'' (s : ℤ) :
        s ≥ 3 → (n : ℕ) → Prop
        Equations
        Instances For
          def IsnPolygonal₀ (s : ℤ) :
          s ≥ 3 → (n : ℕ) → Prop
          Equations
          Instances For
            Equations
            Instances For
              def Polygonal (s : ℤ) (hs : s ≥ 3) :
              Equations
              Instances For
                def foldrfun (s : ℤ) (hs : s ≥ 3) (x1 : Polygonal s hs) (x2 : ℤ) :
                Equations
                Instances For
                  def sumPolyToInt (s : ℤ) (hs : s ≥ 3) (S : List (Polygonal s hs)) :
                  Equations
                  Instances For
                    theorem kfactq (k : ℚ) :
                    k * (k - 1) = k ^ 2 - k

                    Both conditions IsnPolygonal and IsnPolygonal' are equivalent.

                    instance instBEqPolygonal {s : ℤ} {hs : s ≥ 3} :
                    BEq (Polygonal s hs)
                    Equations
                    instance instLawfulBEqPolygonal {s : ℤ} {hs : s ≥ 3} :
                    instance instDecidableEqPolygonal {s : ℤ} {hs : s ≥ 3} :
                    Equations
                    instance instLEPolygonal {s : ℤ} {hs : s ≥ 3} :
                    LE (Polygonal s hs)
                    Equations
                    • instLEPolygonal = { le := fun (a b : Polygonal s hs) => ↑a ≤ ↑b }
                    theorem Polyrw (s : ℤ) (hs : s ≥ 3) (n : ℕ) :
                    theorem one_is_poly (s : ℤ) (hs : s ≥ 3) :
                    theorem zero_is_poly (s : ℤ) (hs : s ≥ 3) :
                    def PolyOne (s : ℤ) (hs : s ≥ 3) :
                    Equations
                    Instances For
                      def PolyZero (s : ℤ) (hs : s ≥ 3) :
                      Equations
                      Instances For
                        instance instDecidableIsnPolygonal₀ {m : ℤ} {n : m ≥ 3} {h : ℕ} :
                        Equations
                        • instDecidableIsnPolygonal₀ = id instDecidableOr
                        instance instDecidableIsnPolygonal {m : ℤ} {n : m ≥ 3} {h : ℕ} :
                        Equations
                        theorem polyform (m : ℤ) (r : ℕ) (hm2geq3 : m + 2 ≥ 3) :
                        ↑m / 2 * (↑r ^ 2 - ↑r) + ↑r = ↑|⌈↑m / 2 * (↑r ^ 2 - ↑r) + ↑r⌉|
                        theorem polyformval (m : ℤ) (r : ℕ) (hm2geq3 : m + 2 ≥ 3) :
                        IsnPolygonal (m + 2) hm2geq3 ⌈↑m / 2 * (↑r ^ 2 - ↑r) + ↑r⌉.natAbs
                        def getnthpoly (s : ℤ) (hs : s ≥ 3) (n : ℕ) :
                        Equations
                        Instances For
                          theorem getnthpoly_monotone (s : ℤ) (hs : s ≥ 3) (n : ℕ) :
                          ↑(getnthpoly s hs n) ≤ ↑(getnthpoly s hs (n + 1))
                          theorem getnthpoly_polyone (s : ℤ) (hs : s ≥ 3) :
                          getnthpoly s hs 1 = PolyOne s hs
                          theorem getnthpoly_intone (s : ℤ) (hs : s ≥ 3) :
                          ↑(getnthpoly s hs 1) = 1
                          theorem getnthpoly_geq (s : ℤ) (hs : s ≥ 3) (n : ℕ) :
                          ↑(getnthpoly s hs n) ≥ n
                          theorem poly_set (s : ℤ) (hs : s ≥ 3) :
                          {x : ℕ | IsnPolygonal s hs x} = {x : ℕ | ∃ (n : ℕ), ↑(getnthpoly s hs n) = x}
                          def getnthpolyfun (s : ℤ) (hs : s ≥ 3) (a : ℕ) :
                          Equations
                          Instances For
                            def getlepoly₀ (s : ℤ) (hs : s ≥ 3) (b : ℕ) :
                            Equations
                            Instances For
                              def finCaseDec (p : ℕ → Prop) (n : ℕ) [DecidablePred p] :
                              Decidable (∃ a < n + 1, p a)
                              Equations
                              Instances For
                                theorem getlepoly₀Correct (s : ℤ) (hs : s ≥ 3) (n : ℕ) :
                                ↑(getlepoly₀ s hs n) = {a : Polygonal s hs | ↑a ≤ n}
                                def IsNKPolygonal (s : ℤ) (hs : s ≥ 3) (k n : ℕ) :
                                Equations
                                Instances For
                                  Equations
                                  instance instDecidablePredNatIsNKPolygonal (s : ℤ) (hs : s ≥ 3) (k : ℕ) :
                                  Equations
                                  • One or more equations did not get rendered due to their size.