Documentation

ACLibrary.Segtree

@[reducible, inline]
abbrev AtCoder.Segtree.WF' {α : Type u_1} {n : } [Monoid α] (data : Vector α (n * 2)) (k : ) (h' : 1 k := by get_elem_tactic) :
Equations
Instances For
    @[reducible, inline]
    abbrev AtCoder.Segtree.WF {α : Type u_1} {n : } [Monoid α] (data : Vector α (n * 2)) :
    Equations
    Instances For
      structure AtCoder.Segtree (α : Type) [Monoid α] (n : ) :
      Instances For
        def AtCoder.Segtree.mk {α : Type} [Monoid α] (n : ) :
        Segtree α n
        Equations
        Instances For
          theorem AtCoder.Segtree.updateAt_WF' {α : Type} [Monoid α] {n : } (data : Vector α (n * 2)) (k : ) (hk : k < n) (hk' : 1 k) (h : WF' data (k + 1) ) :
          def AtCoder.Segtree.build {α : Type} [Monoid α] {n : } (data : Vector α n) :
          Segtree α n
          Equations
          Instances For
            def AtCoder.Segtree.get {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : Fin n) :
            α
            Equations
            Instances For
              instance AtCoder.Segtree.instGetElemNatLt {α : Type} [Monoid α] {n : } :
              GetElem (Segtree α n) α fun (x : Segtree α n) (i : ) => i < n
              Equations
              theorem AtCoder.Segtree.get_eq_get' {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (h : i < n) :
              t[i] = t.data[i + n]
              @[reducible, inline]
              abbrev AtCoder.Segtree.WF_without {α : Type} [Monoid α] {n : } (data : Vector α (n * 2)) (i : ) :
              Equations
              Instances For
                theorem AtCoder.Segtree.WF_without_WF {α : Type} [Monoid α] {n i : } {data : Vector α (n * 2)} (hwf : WF data) :
                WF_without data i
                theorem AtCoder.Segtree.WF_WF_without_zero {α : Type} [Monoid α] {n : } {data : Vector α (n * 2)} (hwf : WF_without data 0) :
                WF data
                theorem AtCoder.Segtree.WF_without_set {α : Type} [Monoid α] {n : } (data : Vector α (n * 2)) (i : ) (v : α) (h : i < n) (hwf : WF data) :
                WF_without (data.set (i + n) v ) ((i + n) / 2)
                theorem AtCoder.Segtree.WF_without_updateAt {α : Type} [Monoid α] {n : } (data : Vector α (n * 2)) (i : ) (h : i < n) (hwf : WF_without data i) :
                def AtCoder.Segtree.set {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (v : α) (h : i < n := by get_elem_tactic) :
                Segtree α n
                Equations
                Instances For
                  def AtCoder.Segtree.modify {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (f : αα) (h : i < n := by get_elem_tactic) :
                  Segtree α n
                  Equations
                  Instances For
                    @[simp]
                    theorem AtCoder.Segtree.get_updateAt_ne {α : Type} [Monoid α] {n : } (data : Vector α (n * 2)) (i j : ) (h : i < n) (h' : j < n * 2) (h'' : i j) :
                    @[simp]
                    theorem AtCoder.Segtree.buildAt_keep_larger {α : Type} [Monoid α] {n : } (data : Vector α (n * 2)) (i : ) (hwf : WF_without data i) (h : i < n) (k : ) (h' : i < k k < n * 2) :
                    theorem AtCoder.Segtree.get_set_self {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (v : α) (h : i < n) :
                    (t.set i v h)[i] = v
                    theorem AtCoder.Segtree.get_set_ne {α : Type} [Monoid α] {n : } (t : Segtree α n) (i j : ) (v : α) (hi : i < n) (hj : j < n) (h' : i j) :
                    (t.set i v hi)[j] = t[j]
                    def AtCoder.Segtree.fold_all {α : Type} [Monoid α] {n : } (t : Segtree α n) :
                    α
                    Equations
                    Instances For
                      @[irreducible]
                      def AtCoder.Segtree.fold_aux {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (p q : α) (h : 1 l l r r n * 2 := by get_elem_tactic) :
                      α
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def AtCoder.Segtree.fold {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 0 l l r r n := by get_elem_tactic) :
                        α
                        Equations
                        Instances For
                          @[irreducible]
                          def AtCoder.Segtree.fold_naive {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 0 l l r r n := by get_elem_tactic) :
                          α
                          Equations
                          Instances For
                            theorem AtCoder.Segtree.fold_naive'_def {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 1 l l < r r n * 2) :
                            @[simp]
                            theorem AtCoder.Segtree.fold_naive_one {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (h : 0 i i n) :
                            t.fold_naive i i = 1
                            @[simp]
                            theorem AtCoder.Segtree.fold_naive'_one {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (h : 1 i i n * 2) :
                            @[irreducible]
                            def AtCoder.Segtree.leftmost {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (h : 1 i i < 2 * n := by get_elem_tactic) :
                            Equations
                            Instances For
                              @[irreducible]
                              theorem AtCoder.Segtree.leftmost_lower {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (h : 1 i i < 2 * n) :
                              t.leftmost i h n
                              @[irreducible]
                              theorem AtCoder.Segtree.leftmost_upper {α : Type} [Monoid α] {n : } (t : Segtree α n) (i : ) (h : 1 i i < 2 * n) :
                              t.leftmost i h < 2 * n
                              @[irreducible]
                              theorem AtCoder.Segtree.fold_naive_eq_fold_naive' {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 0 l l r r n) (h' : n 1) :
                              t.fold_naive l r h = AtCoder.Segtree.fold_naive'✝ t (l + n) (r + n)
                              @[irreducible]
                              theorem AtCoder.Segtree.fold_naive'_double {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 1 l l r r n) :
                              @[simp, irreducible]
                              theorem AtCoder.Segtree.fold_naive'_r {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 1 l l r r < n * 2) :
                              @[irreducible]
                              theorem AtCoder.Segtree.fold_aux_eq_fold_naive' {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (p q : α) (h' : 1 l l r r n * 2) :
                              t.fold_aux l r p q h' = p * AtCoder.Segtree.fold_naive'✝ t l r h' * q
                              theorem AtCoder.Segtree.fold_eq_fold_naive {α : Type} [Monoid α] {n : } (t : Segtree α n) (l r : ) (h : 0 l l r r n) :
                              t.fold l r h = t.fold_naive l r h