prove associativity of compose (really ugly proof; want to clean it up when I have some time)