File: Mathlib/Data/Holor.lean

full_name: HolorIndex
code: /-- `HolorIndex ds` is the type of valid index tuples used to identify an entry of a holor
of dimensions `ds`. -/
def HolorIndex (ds : List ℕ) : Type 
goal: Type

full_name: HolorIndex.take
code: def take : ∀ {ds₁ : List ℕ}, HolorIndex (ds₁ ++ ds₂) → HolorIndex ds₁
  
goal: HolorIndex (ds₁ ++ ds₂) → HolorIndex ds₁

full_name: HolorIndex.drop
code: def drop : ∀ {ds₁ : List ℕ}, HolorIndex (ds₁ ++ ds₂) → HolorIndex ds₂
  
goal: HolorIndex (ds₁ ++ ds₂) → HolorIndex ds₂

full_name: HolorIndex.cast_type
code: theorem cast_type (is : List ℕ) (eq : ds₁ = ds₂) (h : Forall₂ (· < ·) is ds₁) :
    (cast (congr_arg HolorIndex eq) ⟨is, h⟩).val = is 
goal: ↑(cast ⋯ ⟨is, h⟩) = is

full_name: HolorIndex.assocRight
code: def assocRight : HolorIndex (ds₁ ++ ds₂ ++ ds₃) → HolorIndex (ds₁ ++ (ds₂ ++ ds₃)) 
goal: HolorIndex (ds₁ ++ ds₂ ++ ds₃) → HolorIndex (ds₁ ++ (ds₂ ++ ds₃))

full_name: HolorIndex.assocLeft
code: def assocLeft : HolorIndex (ds₁ ++ (ds₂ ++ ds₃)) → HolorIndex (ds₁ ++ ds₂ ++ ds₃) 
goal: HolorIndex (ds₁ ++ (ds₂ ++ ds₃)) → HolorIndex (ds₁ ++ ds₂ ++ ds₃)

full_name: HolorIndex.take_take
code: theorem take_take : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.take = t.take.take
  
goal: t.assocRight.take = t.take.take

full_name: HolorIndex.drop_take
code: theorem drop_take : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.drop.take = t.take.drop
  
goal: t.assocRight.drop.take = t.take.drop

full_name: HolorIndex.drop_drop
code: theorem drop_drop : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.drop.drop = t.drop
  
goal: t.assocRight.drop.drop = t.drop

full_name: Holor
code: /-- Holor (indexed collections of tensor coefficients) -/
def Holor (α : Type u) (ds : List ℕ) 
goal: Type u

full_name: Holor.instInhabited
code: instance [Inhabited α] : Inhabited (Holor α ds) 
goal: Inhabited (Holor α ds)

full_name: Holor.instZero
code: instance [Zero α] : Zero (Holor α ds) 
goal: Zero (Holor α ds)

full_name: Holor.instAdd
code: instance [Add α] : Add (Holor α ds) 
goal: Add (Holor α ds)

full_name: Holor.instNeg
code: instance [Neg α] : Neg (Holor α ds) 
goal: Neg (Holor α ds)

full_name: Holor.instAddSemigroup
code: instance [AddSemigroup α] : AddSemigroup (Holor α ds) 
goal: AddSemigroup (Holor α ds)

full_name: Holor.instAddCommSemigroup
code: instance [AddCommSemigroup α] : AddCommSemigroup (Holor α ds) 
goal: AddCommSemigroup (Holor α ds)

full_name: Holor.instAddMonoid
code: instance [AddMonoid α] : AddMonoid (Holor α ds) 
goal: AddMonoid (Holor α ds)

full_name: Holor.instAddCommMonoid
code: instance [AddCommMonoid α] : AddCommMonoid (Holor α ds) 
goal: AddCommMonoid (Holor α ds)

full_name: Holor.instAddGroup
code: instance [AddGroup α] : AddGroup (Holor α ds) 
goal: AddGroup (Holor α ds)

full_name: Holor.instAddCommGroup
code: instance [AddCommGroup α] : AddCommGroup (Holor α ds) 
goal: AddCommGroup (Holor α ds)

full_name: Holor.instSMulOfMul
code: instance [Mul α] : SMul α (Holor α ds) 
goal: SMul α (Holor α ds)

full_name: Holor.instModule
code: instance [Semiring α] : Module α (Holor α ds) 
goal: Module α (Holor α ds)

full_name: Holor.mul
code: /-- The tensor product of two holors. -/
def mul [Mul α] (x : Holor α ds₁) (y : Holor α ds₂) : Holor α (ds₁ ++ ds₂) 
goal: Holor α (ds₁ ++ ds₂)

full_name: Holor.«_aux_Mathlib_Data_Holor___macroRules_Holor_term_⊗__1»
code: local infixl:70 " ⊗ " => mul
goal: Lean.Macro

full_name: Holor._aux_Mathlib_Data_Holor___unexpand_Holor_mul_1
code: local infixl:70 " ⊗ " => mul
goal: Lean.PrettyPrinter.Unexpander

full_name: Holor.cast_type
code: theorem cast_type (eq : ds₁ = ds₂) (a : Holor α ds₁) :
    cast (congr_arg (Holor α) eq) a = fun t => a (cast (congr_arg HolorIndex eq.symm) t) 
goal: cast ⋯ a = fun t => a (cast ⋯ t)

full_name: Holor.assocRight
code: def assocRight : Holor α (ds₁ ++ ds₂ ++ ds₃) → Holor α (ds₁ ++ (ds₂ ++ ds₃)) 
goal: Holor α (ds₁ ++ ds₂ ++ ds₃) → Holor α (ds₁ ++ (ds₂ ++ ds₃))

full_name: Holor.assocLeft
code: def assocLeft : Holor α (ds₁ ++ (ds₂ ++ ds₃)) → Holor α (ds₁ ++ ds₂ ++ ds₃) 
goal: Holor α (ds₁ ++ (ds₂ ++ ds₃)) → Holor α (ds₁ ++ ds₂ ++ ds₃)

full_name: Holor.mul_assoc0
code: theorem mul_assoc0 [Semigroup α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₃) :
    x ⊗ y ⊗ z = (x ⊗ (y ⊗ z)).assocLeft 
goal: (x.mul y).mul z = (x.mul (y.mul z)).assocLeft

full_name: Holor.mul_assoc
code: theorem mul_assoc [Semigroup α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₃) :
    HEq (mul (mul x y) z) (mul x (mul y z)) 
goal: HEq ((x.mul y).mul z) (x.mul (y.mul z))

full_name: Holor.mul_left_distrib
code: theorem mul_left_distrib [Distrib α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₂) :
    x ⊗ (y + z) = x ⊗ y + x ⊗ z 
goal: x.mul (y + z) = x.mul y + x.mul z

full_name: Holor.mul_right_distrib
code: theorem mul_right_distrib [Distrib α] (x : Holor α ds₁) (y : Holor α ds₁) (z : Holor α ds₂) :
    (x + y) ⊗ z = x ⊗ z + y ⊗ z 
goal: (x + y).mul z = x.mul z + y.mul z

full_name: Holor.zero_mul
code: @[simp]
nonrec theorem zero_mul {α : Type} [Ring α] (x : Holor α ds₂) : (0 : Holor α ds₁) ⊗ x = 0 
goal: Holor.mul 0 x = 0

full_name: Holor.mul_zero
code: @[simp]
nonrec theorem mul_zero {α : Type} [Ring α] (x : Holor α ds₁) : x ⊗ (0 : Holor α ds₂) = 0 
goal: x.mul 0 = 0

full_name: Holor.mul_scalar_mul
code: theorem mul_scalar_mul [Monoid α] (x : Holor α []) (y : Holor α ds) :
    x ⊗ y = x ⟨[], Forall₂.nil⟩ • y 
goal: x.mul y = x ⟨[], ⋯⟩ • y

full_name: Holor.slice
code: /-- A slice is a subholor consisting of all entries with initial index i. -/
def slice (x : Holor α (d :: ds)) (i : ℕ) (h : i < d) : Holor α ds 
goal: Holor α ds

full_name: Holor.unitVec
code: /-- The 1-dimensional "unit" holor with 1 in the `j`th position. -/
def unitVec [Monoid α] [AddMonoid α] (d : ℕ) (j : ℕ) : Holor α [d] 
goal: Holor α [d]

full_name: Holor.holor_index_cons_decomp
code: theorem holor_index_cons_decomp (p : HolorIndex (d :: ds) → Prop) :
    ∀ t : HolorIndex (d :: ds),
      (∀ i is, ∀ h : t.1 = i :: is, p ⟨i :: is, by rw [← h]; exact t.2⟩) → p t
  
goal: (∀ (i : ℕ) (is : List ℕ) (h : ↑t = i :: is), p ⟨i :: is, ⋯⟩) → p t

full_name: Holor.slice_eq
code: /-- Two holors are equal if all their slices are equal. -/
theorem slice_eq (x : Holor α (d :: ds)) (y : Holor α (d :: ds)) (h : slice x = slice y) : x = y 
goal: x = y

full_name: Holor.slice_unitVec_mul
code: theorem slice_unitVec_mul [Ring α] {i : ℕ} {j : ℕ} (hid : i < d) (x : Holor α ds) :
    slice (unitVec d j ⊗ x) i hid = if i = j then x else 0 
goal: ((Holor.unitVec d j).mul x).slice i hid = if i = j then x else 0

full_name: Holor.slice_add
code: theorem slice_add [Add α] (i : ℕ) (hid : i < d) (x : Holor α (d :: ds)) (y : Holor α (d :: ds)) :
    slice x i hid + slice y i hid = slice (x + y) i hid 
goal: x.slice i hid + y.slice i hid = (x + y).slice i hid

full_name: Holor.slice_zero
code: theorem slice_zero [Zero α] (i : ℕ) (hid : i < d) : slice (0 : Holor α (d :: ds)) i hid = 0 
goal: Holor.slice 0 i hid = 0

full_name: Holor.slice_sum
code: theorem slice_sum [AddCommMonoid α] {β : Type} (i : ℕ) (hid : i < d) (s : Finset β)
    (f : β → Holor α (d :: ds)) : (∑ x ∈ s, slice (f x) i hid) = slice (∑ x ∈ s, f x) i hid 
goal: ∑ x ∈ s, (f x).slice i hid = (∑ x ∈ s, f x).slice i hid

full_name: Holor.sum_unitVec_mul_slice
code: /-- The original holor can be recovered from its slices by multiplying with unit vectors and
summing up. -/
@[simp]
theorem sum_unitVec_mul_slice [Ring α] (x : Holor α (d :: ds)) :
    (∑ i ∈ (Finset.range d).attach,
        unitVec d i ⊗ slice x i (Nat.succ_le_of_lt (Finset.mem_range.1 i.prop))) =
      x 
goal: ∑ i ∈ (Finset.range d).attach, (Holor.unitVec d ↑i).mul (x.slice ↑i ⋯) = x

full_name: Holor.CPRankMax1.cons
code: /-- `CPRankMax1 x` means `x` has CP rank at most 1, that is,
  it is the tensor product of 1-dimensional holors. -/
inductive CPRankMax1 [Mul α] : ∀ {ds}, Holor α ds → Prop
  | nil (x : Holor α []) : CPRankMax1 x
  | cons {d} {ds} (x : Holor α [d]) (y : Holor α ds) : CPRankMax1 y → CPRankMax1 (x ⊗ y)
goal: y.CPRankMax1 → (x.mul y).CPRankMax1

full_name: Holor.CPRankMax1
code: /-- `CPRankMax1 x` means `x` has CP rank at most 1, that is,
  it is the tensor product of 1-dimensional holors. -/
inductive CPRankMax1 [Mul α] : ∀ {ds}, Holor α ds → Prop
  | nil (x : Holor α []) : CPRankMax1 x
  | cons {d} {ds} (x : Holor α [d]) (y : Holor α ds) : CPRankMax1 y → CPRankMax1 (x ⊗ y)
goal: Holor α ds → Prop

full_name: Holor.CPRankMax1.nil
code: /-- `CPRankMax1 x` means `x` has CP rank at most 1, that is,
  it is the tensor product of 1-dimensional holors. -/
inductive CPRankMax1 [Mul α] : ∀ {ds}, Holor α ds → Prop
  | nil (x : Holor α []) : CPRankMax1 x
  | cons {d} {ds} (x : Holor α [d]) (y : Holor α ds) : CPRankMax1 y → CPRankMax1 (x ⊗ y)
goal: x.CPRankMax1

full_name: Holor.CPRankMax
code: /-- `CPRankMax N x` means `x` has CP rank at most `N`, that is,
  it can be written as the sum of N holors of rank at most 1. -/
inductive CPRankMax [Mul α] [AddMonoid α] : ℕ → ∀ {ds}, Holor α ds → Prop
  | zero {ds} : CPRankMax 0 (0 : Holor α ds)
  | succ (n) {ds} (x : Holor α ds) (y : Holor α ds) :
    CPRankMax1 x → CPRankMax n y → CPRankMax (n + 1) (x + y)
goal: ℕ → {ds : List ℕ} → Holor α ds → Prop

full_name: Holor.CPRankMax.zero
code: /-- `CPRankMax N x` means `x` has CP rank at most `N`, that is,
  it can be written as the sum of N holors of rank at most 1. -/
inductive CPRankMax [Mul α] [AddMonoid α] : ℕ → ∀ {ds}, Holor α ds → Prop
  | zero {ds} : CPRankMax 0 (0 : Holor α ds)
  | succ (n) {ds} (x : Holor α ds) (y : Holor α ds) :
    CPRankMax1 x → CPRankMax n y → CPRankMax (n + 1) (x + y)
goal: Holor.CPRankMax 0 0

full_name: Holor.CPRankMax.succ
code: /-- `CPRankMax N x` means `x` has CP rank at most `N`, that is,
  it can be written as the sum of N holors of rank at most 1. -/
inductive CPRankMax [Mul α] [AddMonoid α] : ℕ → ∀ {ds}, Holor α ds → Prop
  | zero {ds} : CPRankMax 0 (0 : Holor α ds)
  | succ (n) {ds} (x : Holor α ds) (y : Holor α ds) :
    CPRankMax1 x → CPRankMax n y → CPRankMax (n + 1) (x + y)
goal: x.CPRankMax1 → Holor.CPRankMax n y → Holor.CPRankMax (n + 1) (x + y)

full_name: Holor.cprankMax_nil
code: theorem cprankMax_nil [Monoid α] [AddMonoid α] (x : Holor α nil) : CPRankMax 1 x 
goal: Holor.CPRankMax 1 x

full_name: Holor.cprankMax_1
code: theorem cprankMax_1 [Monoid α] [AddMonoid α] {x : Holor α ds} (h : CPRankMax1 x) :
    CPRankMax 1 x 
goal: Holor.CPRankMax 1 x

full_name: Holor.cprankMax_add
code: theorem cprankMax_add [Monoid α] [AddMonoid α] :
    ∀ {m : ℕ} {n : ℕ} {x : Holor α ds} {y : Holor α ds},
      CPRankMax m x → CPRankMax n y → CPRankMax (m + n) (x + y)
  
goal: Holor.CPRankMax m x → Holor.CPRankMax n y → Holor.CPRankMax (m + n) (x + y)

full_name: Holor.cprankMax_mul
code: theorem cprankMax_mul [Ring α] :
    ∀ (n : ℕ) (x : Holor α [d]) (y : Holor α ds), CPRankMax n y → CPRankMax n (x ⊗ y)
  
goal: Holor.CPRankMax n y → Holor.CPRankMax n (x.mul y)

full_name: Holor.cprankMax_sum
code: theorem cprankMax_sum [Ring α] {β} {n : ℕ} (s : Finset β) (f : β → Holor α ds) :
    (∀ x ∈ s, CPRankMax n (f x)) → CPRankMax (s.card * n) (∑ x ∈ s, f x) 
goal: (∀ x ∈ s, Holor.CPRankMax n (f x)) → Holor.CPRankMax (s.card * n) (∑ x ∈ s, f x)

full_name: Holor.cprankMax_upper_bound
code: theorem cprankMax_upper_bound [Ring α] : ∀ {ds}, ∀ x : Holor α ds, CPRankMax ds.prod x
  
goal: Holor.CPRankMax ds.prod x

full_name: Holor.cprank
code: /-- The CP rank of a holor `x`: the smallest N such that
  `x` can be written as the sum of N holors of rank at most 1. -/
noncomputable def cprank [Ring α] (x : Holor α ds) : Nat 
goal: ℕ

full_name: Holor.cprank_upper_bound
code: theorem cprank_upper_bound [Ring α] : ∀ {ds}, ∀ x : Holor α ds, cprank x ≤ ds.prod 
goal: x.cprank ≤ ds.prod