A cognitive analysis of Cauchy’s conceptions of function, continuity, limit and infinitesimal, with implications for teaching the calculus