Appending two ColorIndexLists #
We define conditional appending of ColorIndexList
's.
It is conditional on AppendCond
being true, which we define.
Append #
def
IndexNotation.ColorIndexList.AppendCond
{π : TensorColor}
[IndexNotation π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
:
The condition on the ColorIndexList
s l
and l2
so that on appending they form
a ColorIndexList
.
Note: AppendCond
does not form an equivalence relation as it is not reflexive or
transitive.
Equations
Instances For
def
IndexNotation.ColorIndexList.append
{π : TensorColor}
[IndexNotation π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
(h : l.AppendCond l2)
:
Given two ColorIndexList
s satisfying AppendCond
. The correponding combined
ColorIndexList
.
Equations
Instances For
The join of two ColorIndexList
satisfying the condition AppendCond
that they
can be appended to form a ColorIndexList
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
IndexNotation.ColorIndexList.append_toIndexList
{π : TensorColor}
[IndexNotation π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
(h : l.AppendCond l2)
:
theorem
IndexNotation.ColorIndexList.AppendCond.symm
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
:
l2.AppendCond l
theorem
IndexNotation.ColorIndexList.AppendCond.inr
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
{l3 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
(h' : (l.append l2 h).AppendCond l3)
:
l2.AppendCond l3
theorem
IndexNotation.ColorIndexList.AppendCond.assoc
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
{l3 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
(h' : (l.append l2 h).AppendCond l3)
:
l.AppendCond (l2.append l3 β―)
theorem
IndexNotation.ColorIndexList.AppendCond.swap
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
{l3 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
(h' : (l.append l2 h).AppendCond l3)
:
(l2.append l β―).AppendCond l3
theorem
IndexNotation.ColorIndexList.AppendCond.contr_left
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
:
l.contr.AppendCond l2
If AppendCond l l2
then AppendCond l.contr l2
. Note that the inverse
is generally not true.
theorem
IndexNotation.ColorIndexList.AppendCond.contr_right
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
:
l.AppendCond l2.contr
theorem
IndexNotation.ColorIndexList.AppendCond.contr
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
:
l.contr.AppendCond l2.contr
def
IndexNotation.ColorIndexList.AppendCond.bool
{π : TensorColor}
[DecidableEq π.Color]
(l : IndexNotation.IndexList π.Color)
(l2 : IndexNotation.IndexList π.Color)
:
A boolean which is true for two index lists l
and l2
if on appending
they can form a ColorIndexList
.
Equations
- IndexNotation.ColorIndexList.AppendCond.bool l l2 = if Β¬(l ++ l2).withUniqueDual = (l ++ l2).withDual then false else IndexNotation.IndexList.ColorCond.bool (l ++ l2)
Instances For
theorem
IndexNotation.ColorIndexList.AppendCond.bool_iff
{π : TensorColor}
[DecidableEq π.Color]
(l : IndexNotation.IndexList π.Color)
(l2 : IndexNotation.IndexList π.Color)
:
theorem
IndexNotation.ColorIndexList.AppendCond.iff_bool
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
:
l.AppendCond l2 β IndexNotation.ColorIndexList.AppendCond.bool l.toIndexList l2.toIndexList = true
theorem
IndexNotation.ColorIndexList.AppendCond.countId_contr_fst_eq_zero_mem_snd
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
{I : IndexNotation.Index π.Color}
(hI : I β l2.val)
:
theorem
IndexNotation.ColorIndexList.AppendCond.countId_contr_snd_eq_zero_mem_fst
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
{l : IndexNotation.ColorIndexList π}
{l2 : IndexNotation.ColorIndexList π}
(h : l.AppendCond l2)
{I : IndexNotation.Index π.Color}
(hI : I β l.val)
:
theorem
IndexNotation.ColorIndexList.append_contr_left
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
(h : l.AppendCond l2)
:
(l.contr.append l2 β―).contr = (l.append l2 h).contr
theorem
IndexNotation.ColorIndexList.append_contr_right
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
(h : l.AppendCond l2)
:
(l.append l2.contr β―).contr = (l.append l2 h).contr
theorem
IndexNotation.ColorIndexList.append_contr
{π : TensorColor}
[IndexNotation π.Color]
[DecidableEq π.Color]
(l : IndexNotation.ColorIndexList π)
(l2 : IndexNotation.ColorIndexList π)
(h : l.AppendCond l2)
:
(l.contr.append l2.contr β―).contr = (l.append l2 h).contr