Exercise. Dependent types I › The sum of a family of types › Extensionality [01E6]

Show that the uniqueness rule for the sum {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} is equivalent to the following extensionality rule:

\frac { u,v:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} \quad u.1\equiv v.1:A \quad u.2\equiv v.2:B[u.1] }{ u\equiv v:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }