Documentation

Seymour.Basic.Basic

Basics #

This is the stem file (imported by every other file in this project). This file provides notation used throughout the project, some very basic lemmas, and a little bit of configuration.

Notation #

@[reducible, inline]
abbrev Z2 :

The finite field on 2 elements; write Z2 for "value" type but Fin 2 for "indexing" type.

Equations
Instances For
    @[reducible, inline]
    abbrev Z3 :

    The finite field on 3 elements; write Z3 for "value" type but Fin 3 for "indexing" type.

    Equations
    Instances For

      Roughly speaking a ᕃ A is A ∪ {a}.

      Equations
      Instances For

        Writing X ⫗ Y is slightly more general than writing X ∩ Y = ∅.

        Equations
        Instances For

          The left-to-right direction of .

          Equations
          Instances For

            The right-to-left direction of .

            Equations
            Instances For

              Writing ↓t is slightly more general than writing Function.const _ t.

              Equations
              Instances For

                We denote the cardinality of a Fintype the same way the cardinality of a Finset is denoted.

                Equations
                Instances For

                  Canonical bijection between subtypes corresponding to equal sets.

                  Equations
                  Instances For

                    The "left" or "top" variant.

                    Equations
                    Instances For

                      The "right" or "bottom" variant.

                      Equations
                      Instances For

                        Glue rows of two matrices.

                        Equations
                        Instances For

                          Glue cols of two matrices.

                          Equations
                          Instances For

                            Glue four matrices into one block matrix.

                            Equations
                            Instances For

                              Convert vector to a single-row matrix.

                              Equations
                              Instances For

                                Convert vector to a single-col matrix.

                                Equations
                                Instances For

                                  Outer product of two vectors (the column vector comes on left; the row vector comes on right).

                                  Equations
                                  Instances For

                                    Element-wise product of two matrices (rarely used).

                                    Equations
                                    Instances For
                                      @[reducible, inline]
                                      abbrev Function.range {α ι : Type} (f : ια) :
                                      Set α

                                      The set of possible outputs of a function.

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

                                            Basic lemmas #

                                            theorem and_congr_l {P₁ P₂ : Prop} (hP : P₁ P₂) (Q : Prop) :
                                            P₁ Q P₂ Q
                                            theorem and_congr_r {P₁ P₂ : Prop} (hP : P₁ P₂) (Q : Prop) :
                                            Q P₁ Q P₂
                                            theorem exists_minimal_nat_le_of_exists {n : } (P : {a : | a n}Prop) (hP : P n, ) :
                                            ∃ (n_1 : {a : | a n}), Minimal P n_1
                                            theorem exists_minimal_nat_of_exists {P : Prop} (hP : ∃ (n : ), P n) :
                                            ∃ (n : ), Minimal P n
                                            theorem dite_of_true {α : Type} {P : Prop} [Decidable P] (p : P) {f : Pα} {a : α} :
                                            (if hp : P then f hp else a) = f p
                                            theorem dite_of_false {α : Type} {P : Prop} [Decidable P] (p : ¬P) {f : Pα} {a : α} :
                                            (if hp : P then f hp else a) = a
                                            theorem Function.range_eq {α ι : Type} (f : ια) :
                                            f.range = {a : α | ∃ (i : ι), f i = a}
                                            theorem Finset.sum_of_single_nonzero {α ι : Type} (s : Finset ι) [AddCommMonoid α] (f : ια) (a : ι) (ha : a s) (hf : is, i af i = 0) :
                                            s.sum f = f a
                                            theorem fintype_sum_of_single_nonzero {α ι : Type} [Fintype ι] [AddCommMonoid α] (f : ια) (a : ι) (hf : ∀ (i : ι), i af i = 0) :
                                            theorem sum_elem_of_single_nonzero {α ι : Type} [AddCommMonoid α] {f : ια} {S : Set ι} [Fintype S] {a : ι} (haS : a S) (hf : ∀ (i : ι), i af i = 0) :
                                            i : S, f i = f a
                                            theorem sum_insert_elem {α ι : Type} [DecidableEq ι] [AddCommMonoid α] {S : Set ι} [Fintype S] {a : ι} (ha : aS) (f : ια) :
                                            i : ↑(a S), f i = f a + i : S, f i
                                            theorem finset_toSet_sum {α ι : Type} [AddCommMonoid α] {s : Finset ι} {S : Set ι} [Fintype S] (hsS : s = S) (f : ια) :
                                            i : s, f i = i : S, f i
                                            theorem sum_over_fin_succ_of_only_zeroth_nonzero {α : Type} {n : } [AddCommMonoid α] {f : Fin n.succα} (hf : ∀ (i : Fin n.succ), i 0f i = 0) :

                                            Conversion between set-based notions and type-based notions #

                                            def HasSubset.Subset.elem {α : Type} {X Y : Set α} (hXY : X Y) (x : X) :
                                            Y

                                            Given X ⊆ Y cast an element of X as an element of Y.

                                            Equations
                                            • hXY.elem x = x,
                                            Instances For
                                              theorem HasSubset.Subset.elem_injective {α : Type} {X Y : Set α} (hXY : X Y) :
                                              theorem HasSubset.Subset.elem_range {α : Type} {X Y : Set α} (hXY : X Y) :
                                              hXY.elem.range = {a : Y | a X}
                                              def Subtype.toSum {α : Type} {X Y : Set α} [(a : α) → Decidable (a X)] [(a : α) → Decidable (a Y)] (i : ↑(X Y)) :
                                              X Y

                                              Convert (X ∪ Y).Elem to X.Elem ⊕ Y.Elem.

                                              Equations
                                              • i.toSum = if hiX : i X then i, hiX else if hiY : i Y then i, hiY else .elim
                                              Instances For
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[simp]
                                                  theorem toSum_left {α : Type} {X Y : Set α} [(a : α) → Decidable (a X)] [(a : α) → Decidable (a Y)] {i : ↑(X Y)} (hi : i X) :
                                                  i.toSum = i, hi
                                                  @[simp]
                                                  theorem toSum_right {α : Type} {X Y : Set α} [(a : α) → Decidable (a X)] [(a : α) → Decidable (a Y)] {i : ↑(X Y)} (hiX : iX) (hiY : i Y) :
                                                  i.toSum = i, hiY
                                                  def Sum.toUnion {α : Type} {X Y : Set α} (i : X Y) :
                                                  ↑(X Y)

                                                  Convert X.Elem ⊕ Y.Elem to (X ∪ Y).Elem.

                                                  Equations
                                                  Instances For
                                                    @[simp]
                                                    theorem toUnion_left {α : Type} {X Y : Set α} (x : X) :
                                                    (x).toUnion = x,
                                                    @[simp]
                                                    theorem toUnion_right {α : Type} {X Y : Set α} (y : Y) :
                                                    (y).toUnion = y,
                                                    @[simp]
                                                    theorem toSum_toUnion {α : Type} {X Y : Set α} [(a : α) → Decidable (a X)] [(a : α) → Decidable (a Y)] (i : ↑(X Y)) :
                                                    i.toSum.toUnion = i

                                                    Converting (X ∪ Y).Elem to X.Elem ⊕ Y.Elem and back to (X ∪ Y).Elem gives the original element.

                                                    @[simp]
                                                    theorem toUnion_toSum {α : Type} {X Y : Set α} [(a : α) → Decidable (a X)] [(a : α) → Decidable (a Y)] (hXY : X Y) (i : X Y) :
                                                    i.toUnion.toSum = i

                                                    Converting X.Elem ⊕ Y.Elem to (X ∪ Y).Elem and back to X.Elem ⊕ Y.Elem gives the original element, assuming that X and Y are disjoint.

                                                    Aesop modifiers #

                                                    Nonterminal aesop (dangerous).

                                                    Equations
                                                    Instances For