Documentation
Acmoi
.
Exercise7_2
Search
Google site search
return to top
source
Imports
Init
Mathlib.Data.Set.Finite
Imported by
width
width_nil
width_single
width_stay
disjoint_lists
width_disjoint
width_comm
width_append
source
def
width
{n :
ℕ
}
:
List
(
Fin
n
)
→
ℕ
Equations
width
x
=
x
.toFinset
.card
Instances For
source
theorem
width_nil
{n :
ℕ
}
:
width
[]
=
0
source
theorem
width_single
{n :
ℕ
}
(a :
Fin
n
.succ
)
:
width
[
a
]
=
1
source
theorem
width_stay
{n :
ℕ
}
(a :
Fin
n
.succ
)
(x :
List
(
Fin
n
.succ
)
)
(h :
a
∈
x
.toFinset
)
:
width
(
a
::
x
)
=
width
x
source
def
disjoint_lists
{α :
Type
}
[
DecidableEq
α
]
(x :
List
α
)
(y :
List
α
)
:
Prop
Equations
disjoint_lists
x
y
=
Disjoint
x
.toFinset
y
.toFinset
Instances For
source
theorem
width_disjoint
{n :
ℕ
}
{x :
List
(
Fin
n
)
}
{y :
List
(
Fin
n
)
}
(h :
disjoint_lists
x
y
)
:
width
(
x
++
y
)
=
width
x
+
width
y
source
theorem
width_comm
{n :
ℕ
}
(x :
List
(
Fin
n
)
)
(y :
List
(
Fin
n
)
)
:
width
(
x
++
y
)
=
width
(
y
++
x
)
source
theorem
width_append
{n :
ℕ
}
(x :
List
(
Fin
n
)
)
(y :
List
(
Fin
n
)
)
:
width
(
x
++
y
)
≤
width
x
+
width
y