testing.slim_check.functions
⟷
Mathlib.Testing.SlimCheck.Functions
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -6,7 +6,7 @@ Authors: Simon Hudon
import Data.List.Sigma
import Data.Int.Range
import Data.Finsupp.Defs
-import Data.Finsupp.ToDfinsupp
+import Data.Finsupp.ToDFinsupp
import Tactic.PrettyCases
import Testing.SlimCheck.Sampleable
import Testing.SlimCheck.Testable
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -387,7 +387,7 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
case cons x' xs xs_ih ys h₃ h₂ h₁ =>
cases' ys with y ys
· cases h₃
- dsimp [lookup] at h₃ ; split_ifs at h₃
+ dsimp [lookup] at h₃; split_ifs at h₃
· subst x'; subst val
simp only [mem_cons_iff, true_or_iff, eq_self_iff_true]
· cases' h₀ with _ _ h₀ h₅
@@ -396,8 +396,8 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
specialize xs_ih h₅ ys h₃ h₄ h₆
simp only [Ne.symm h, xs_ih, mem_cons_iff, false_or_iff]
suffices : val ∈ ys; tauto
- erw [← Option.mem_def, mem_lookup_iff] at h₃
- simp only [to_sigma, mem_map, heq_iff_eq, Prod.exists] at h₃
+ erw [← Option.mem_def, mem_lookup_iff] at h₃
+ simp only [to_sigma, mem_map, heq_iff_eq, Prod.exists] at h₃
rcases h₃ with ⟨a, b, h₃, h₄, h₅⟩
subst a; subst b
apply (mem_zip h₃).2
@@ -426,27 +426,27 @@ theorem applyId_injective [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup
by
intro x y h
by_cases hx : x ∈ xs <;> by_cases hy : y ∈ xs
- · rw [mem_iff_nth] at hx hy
+ · rw [mem_iff_nth] at hx hy
cases' hx with i hx
cases' hy with j hy
suffices some x = some y by injection this
have h₂ := h₁.length_eq
- rw [list.apply_id_zip_eq h₀ h₂ _ _ _ hx] at h
+ rw [list.apply_id_zip_eq h₀ h₂ _ _ _ hx] at h
rw [← hx, ← hy]; congr
apply nth_injective _ (h₁.nodup_iff.1 h₀)
· symm; rw [h]
rw [← list.apply_id_zip_eq] <;> assumption
· rw [← h₁.length_eq]
- rw [nth_eq_some] at hx
+ rw [nth_eq_some] at hx
cases' hx with hx hx'
exact hx
- · rw [← apply_id_mem_iff h₀ h₁] at hx hy
- rw [h] at hx
+ · rw [← apply_id_mem_iff h₀ h₁] at hx hy
+ rw [h] at hx
contradiction
- · rw [← apply_id_mem_iff h₀ h₁] at hx hy
- rw [h] at hx
+ · rw [← apply_id_mem_iff h₀ h₁] at hx hy
+ rw [h] at hx
contradiction
- · rwa [list.apply_id_eq_self, list.apply_id_eq_self] at h <;> assumption
+ · rwa [list.apply_id_eq_self, list.apply_id_eq_self] at h <;> assumption
#align slim_check.injective_function.apply_id_injective SlimCheck.InjectiveFunction.applyId_injective
-/
@@ -553,7 +553,7 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
cases' f with xs hperm hnodup
generalize h₀ : map Sigma.fst xs = xs₀
generalize h₁ : xs.map (@id ((Σ _ : α, α) → α) <| @Sigma.snd α fun _ : α => α) = xs₁
- dsimp [id] at h₁
+ dsimp [id] at h₁
have hxs : xs = total_function.list.to_finmap' (xs₀.zip xs₁) :=
by
rw [← h₀, ← h₁, list.to_finmap']; clear h₀ h₁ xs₀ xs₁ hperm hnodup
@@ -567,7 +567,7 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
rw [hxs]; intros
apply apply_id_injective
· rwa [← h₀, hxs, hperm.nodup_iff]
- · rwa [← hxs, h₀, h₁] at hperm
+ · rwa [← hxs, h₀, h₁] at hperm
#align slim_check.injective_function.injective SlimCheck.InjectiveFunction.injective
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,13 +3,13 @@ Copyright (c) 2020 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-/
-import Mathbin.Data.List.Sigma
-import Mathbin.Data.Int.Range
-import Mathbin.Data.Finsupp.Defs
-import Mathbin.Data.Finsupp.ToDfinsupp
-import Mathbin.Tactic.PrettyCases
-import Mathbin.Testing.SlimCheck.Sampleable
-import Mathbin.Testing.SlimCheck.Testable
+import Data.List.Sigma
+import Data.Int.Range
+import Data.Finsupp.Defs
+import Data.Finsupp.ToDfinsupp
+import Tactic.PrettyCases
+import Testing.SlimCheck.Sampleable
+import Testing.SlimCheck.Testable
#align_import testing.slim_check.functions from "leanprover-community/mathlib"@"2fe465deb81bcd7ccafa065bb686888a82f15372"
@@ -370,7 +370,7 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
#align slim_check.injective_function.list.apply_id_zip_eq SlimCheck.InjectiveFunction.List.applyId_zip_eq
-/
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:567:6: unsupported: specialize @hyp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:570:6: unsupported: specialize @hyp -/
#print SlimCheck.InjectiveFunction.applyId_mem_iff /-
theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs) (h₁ : xs ~ ys)
(x : α) : List.applyId.{u} (xs.zip ys) x ∈ ys ↔ x ∈ xs :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/63721b2c3eba6c325ecf8ae8cca27155a4f6306f
@@ -206,7 +206,7 @@ def applyFinsupp (tf : TotalFunction α β) : α →₀ β
· simpa
· simpa [List.dlookup_dedupKeys, WithTop.some_eq_coe]
· intro h
- use (A.lookup a).getD (0 : β)
+ use(A.lookup a).getD (0 : β)
rw [← List.dlookup_dedupKeys] at h ⊢
simp only [h, ← List.mem_dlookup_iff A.nodupkeys_dedupkeys, and_true_iff, not_false_iff,
Option.mem_def]
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,11 +2,6 @@
Copyright (c) 2020 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-
-! This file was ported from Lean 3 source module testing.slim_check.functions
-! leanprover-community/mathlib commit 2fe465deb81bcd7ccafa065bb686888a82f15372
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.List.Sigma
import Mathbin.Data.Int.Range
@@ -16,6 +11,8 @@ import Mathbin.Tactic.PrettyCases
import Mathbin.Testing.SlimCheck.Sampleable
import Mathbin.Testing.SlimCheck.Testable
+#align_import testing.slim_check.functions from "leanprover-community/mathlib"@"2fe465deb81bcd7ccafa065bb686888a82f15372"
+
/-!
## `slim_check`: generators for functions
mathlib commit https://github.com/leanprover-community/mathlib/commit/2fe465deb81bcd7ccafa065bb686888a82f15372
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
! This file was ported from Lean 3 source module testing.slim_check.functions
-! leanprover-community/mathlib commit f9c300047a57aeda7c2fe15a3ac2455eb05ec225
+! leanprover-community/mathlib commit 2fe465deb81bcd7ccafa065bb686888a82f15372
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -19,6 +19,9 @@ import Mathbin.Testing.SlimCheck.Testable
/-!
## `slim_check`: generators for functions
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
This file defines `sampleable` instances for `α → β` functions and
`ℤ → ℤ` injective functions.
mathlib commit https://github.com/leanprover-community/mathlib/commit/4e24c4bfcff371c71f7ba22050308aa17815626c
@@ -231,18 +231,18 @@ instance Finsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (α →₀ β
#align slim_check.total_function.finsupp.sampleable_ext SlimCheck.TotalFunction.Finsupp.sampleableExt
-/
-#print SlimCheck.TotalFunction.Dfinsupp.sampleableExt /-
+#print SlimCheck.TotalFunction.DFinsupp.sampleableExt /-
-- TODO: support a non-constant codomain type
-instance Dfinsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (Π₀ a : α, β)
+instance DFinsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (Π₀ a : α, β)
where
ProxyRepr := TotalFunction α β
- interp := Finsupp.toDfinsupp ∘ TotalFunction.applyFinsupp
+ interp := Finsupp.toDFinsupp ∘ TotalFunction.applyFinsupp
sample := do
let xs ← (Sampleable.sample (List (α × β)) : Gen (List (α × β)))
let ⟨x⟩ ← (ULiftable.up <| sample β : Gen (ULift.{max u v} β))
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
-#align slim_check.total_function.dfinsupp.sampleable_ext SlimCheck.TotalFunction.Dfinsupp.sampleableExt
+#align slim_check.total_function.dfinsupp.sampleable_ext SlimCheck.TotalFunction.DFinsupp.sampleableExt
-/
end Finsupp
mathlib commit https://github.com/leanprover-community/mathlib/commit/1a51edf13debfcbe223fa06b1cb353b9ed9751cc
@@ -59,6 +59,7 @@ variable {α : Type u} {β : Type v} {γ : Sort w}
namespace SlimCheck
+#print SlimCheck.TotalFunction /-
/-- Data structure specifying a total function using a list of pairs
and a default value returned when the input is not in the domain of
the partial function.
@@ -72,18 +73,24 @@ rely on the association list API defined in `data.list.sigma`.
inductive TotalFunction (α : Type u) (β : Type v) : Type max u v
| with_default : List (Σ _ : α, β) → β → total_function
#align slim_check.total_function SlimCheck.TotalFunction
+-/
+#print SlimCheck.TotalFunction.inhabited /-
instance TotalFunction.inhabited [Inhabited β] : Inhabited (TotalFunction α β) :=
- ⟨TotalFunction.with_default ∅ default⟩
+ ⟨TotalFunction.withDefault ∅ default⟩
#align slim_check.total_function.inhabited SlimCheck.TotalFunction.inhabited
+-/
namespace TotalFunction
+#print SlimCheck.TotalFunction.apply /-
/-- Apply a total function to an argument. -/
def apply [DecidableEq α] : TotalFunction α β → α → β
| total_function.with_default m y, x => (m.dlookup x).getD y
#align slim_check.total_function.apply SlimCheck.TotalFunction.apply
+-/
+#print SlimCheck.TotalFunction.reprAux /-
/-- Implementation of `has_repr (total_function α β)`.
Creates a string for a given `finmap` and output, `x₀ ↦ y₀, .. xₙ ↦ yₙ`
@@ -94,21 +101,26 @@ def reprAux [Repr α] [Repr β] (m : List (Σ _ : α, β)) : String :=
List.qsort (fun x y => x < y)
(m.map fun x => s!"{(repr <| Sigma.fst x)} ↦ {repr <| Sigma.snd x}, ")
#align slim_check.total_function.repr_aux SlimCheck.TotalFunction.reprAux
+-/
+#print SlimCheck.TotalFunction.repr /-
/-- Produce a string for a given `total_function`.
The output is of the form `[x₀ ↦ f x₀, .. xₙ ↦ f xₙ, _ ↦ y]`.
-/
protected def repr [Repr α] [Repr β] : TotalFunction α β → String
| total_function.with_default m y => s!"[{(reprAux m)}_ ↦ {Repr.repr y}]"
#align slim_check.total_function.repr SlimCheck.TotalFunction.repr
+-/
instance (α : Type u) (β : Type v) [Repr α] [Repr β] : Repr (TotalFunction α β) :=
⟨TotalFunction.repr⟩
+#print SlimCheck.TotalFunction.List.toFinmap' /-
/-- Create a `finmap` from a list of pairs. -/
def List.toFinmap' (xs : List (α × β)) : List (Σ _ : α, β) :=
xs.map Prod.toSigma
#align slim_check.total_function.list.to_finmap' SlimCheck.TotalFunction.List.toFinmap'
+-/
section
@@ -124,6 +136,7 @@ instance (priority := 2000) : SizeOf (TotalFunction α β) :=
variable [DecidableEq α]
+#print SlimCheck.TotalFunction.shrink /-
/-- Shrink a total function by shrinking the lists that represent it. -/
protected def shrink : ShrinkFn (TotalFunction α β)
| ⟨m, x⟩ =>
@@ -132,9 +145,11 @@ protected def shrink : ShrinkFn (TotalFunction α β)
lt_of_le_of_lt
(by unfold_wf <;> refine' @List.sizeOf_dedupKeys _ _ _ (@sampleable.wf _ _) _) h⟩
#align slim_check.total_function.shrink SlimCheck.TotalFunction.shrink
+-/
variable [Repr α] [Repr β]
+#print SlimCheck.TotalFunction.Pi.sampleableExt /-
instance Pi.sampleableExt : SampleableExt (α → β)
where
ProxyRepr := TotalFunction α β
@@ -145,6 +160,7 @@ instance Pi.sampleableExt : SampleableExt (α → β)
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
#align slim_check.total_function.pi.sampleable_ext SlimCheck.TotalFunction.Pi.sampleableExt
+-/
end
@@ -152,21 +168,26 @@ section Finsupp
variable [Zero β]
+#print SlimCheck.TotalFunction.zeroDefault /-
/-- Map a total_function to one whose default value is zero so that it represents a finsupp. -/
@[simp]
def zeroDefault : TotalFunction α β → TotalFunction α β
- | with_default A y => with_default A 0
+ | with_default A y => withDefault A 0
#align slim_check.total_function.zero_default SlimCheck.TotalFunction.zeroDefault
+-/
variable [DecidableEq α] [DecidableEq β]
+#print SlimCheck.TotalFunction.zeroDefaultSupp /-
/-- The support of a zero default `total_function`. -/
@[simp]
def zeroDefaultSupp : TotalFunction α β → Finset α
| with_default A y =>
List.toFinset <| (A.dedupKeys.filterₓ fun ab => Sigma.snd ab ≠ 0).map Sigma.fst
#align slim_check.total_function.zero_default_supp SlimCheck.TotalFunction.zeroDefaultSupp
+-/
+#print SlimCheck.TotalFunction.applyFinsupp /-
/-- Create a finitely supported function from a total function by taking the default value to
zero. -/
def applyFinsupp (tf : TotalFunction α β) : α →₀ β
@@ -193,9 +214,11 @@ def applyFinsupp (tf : TotalFunction α β) : α →₀ β
· simpa using h
· simp
#align slim_check.total_function.apply_finsupp SlimCheck.TotalFunction.applyFinsupp
+-/
variable [Sampleable α] [Sampleable β]
+#print SlimCheck.TotalFunction.Finsupp.sampleableExt /-
instance Finsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (α →₀ β)
where
ProxyRepr := TotalFunction α β
@@ -206,7 +229,9 @@ instance Finsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (α →₀ β
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
#align slim_check.total_function.finsupp.sampleable_ext SlimCheck.TotalFunction.Finsupp.sampleableExt
+-/
+#print SlimCheck.TotalFunction.Dfinsupp.sampleableExt /-
-- TODO: support a non-constant codomain type
instance Dfinsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (Π₀ a : α, β)
where
@@ -218,6 +243,7 @@ instance Dfinsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (Π₀ a :
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
#align slim_check.total_function.dfinsupp.sampleable_ext SlimCheck.TotalFunction.Dfinsupp.sampleableExt
+-/
end Finsupp
@@ -225,6 +251,7 @@ section SampleableExt
open SampleableExt
+#print SlimCheck.TotalFunction.PiPred.sampleableExt /-
instance (priority := 2000) PiPred.sampleableExt [SampleableExt (α → Bool)] :
SampleableExt.{u + 1} (α → Prop)
where
@@ -233,7 +260,9 @@ instance (priority := 2000) PiPred.sampleableExt [SampleableExt (α → Bool)] :
sample := sample (α → Bool)
shrink := shrink
#align slim_check.total_function.pi_pred.sampleable_ext SlimCheck.TotalFunction.PiPred.sampleableExt
+-/
+#print SlimCheck.TotalFunction.PiUncurry.sampleableExt /-
instance (priority := 2000) PiUncurry.sampleableExt [SampleableExt (α × β → γ)] :
SampleableExt.{imax (u + 1) (v + 1) w} (α → β → γ)
where
@@ -242,11 +271,13 @@ instance (priority := 2000) PiUncurry.sampleableExt [SampleableExt (α × β →
sample := sample (α × β → γ)
shrink := shrink
#align slim_check.total_function.pi_uncurry.sampleable_ext SlimCheck.TotalFunction.PiUncurry.sampleableExt
+-/
end SampleableExt
end TotalFunction
+#print SlimCheck.InjectiveFunction /-
/-- Data structure specifying a total function using a list of pairs
and a default value returned when the input is not in the domain of
the partial function.
@@ -262,17 +293,21 @@ inductive InjectiveFunction (α : Type u) : Type u
map_to_self (xs : List (Σ _ : α, α)) :
xs.map Sigma.fst ~ xs.map Sigma.snd → List.Nodup (xs.map Sigma.snd) → injective_function
#align slim_check.injective_function SlimCheck.InjectiveFunction
+-/
instance : Inhabited (InjectiveFunction α) :=
⟨⟨[], List.Perm.nil, List.nodup_nil⟩⟩
namespace InjectiveFunction
+#print SlimCheck.InjectiveFunction.apply /-
/-- Apply a total function to an argument. -/
def apply [DecidableEq α] : InjectiveFunction α → α → α
| injective_function.map_to_self m _ _, x => (m.dlookup x).getD x
#align slim_check.injective_function.apply SlimCheck.InjectiveFunction.apply
+-/
+#print SlimCheck.InjectiveFunction.repr /-
/-- Produce a string for a given `total_function`.
The output is of the form `[x₀ ↦ f x₀, .. xₙ ↦ f xₙ, x ↦ x]`.
Unlike for `total_function`, the default value is not a constant
@@ -281,23 +316,28 @@ but the identity function.
protected def repr [Repr α] : InjectiveFunction α → String
| injective_function.map_to_self m _ _ => s! "[{TotalFunction.reprAux m}x ↦ x]"
#align slim_check.injective_function.repr SlimCheck.InjectiveFunction.repr
+-/
instance (α : Type u) [Repr α] : Repr (InjectiveFunction α) :=
⟨InjectiveFunction.repr⟩
+#print SlimCheck.InjectiveFunction.List.applyId /-
/-- Interpret a list of pairs as a total function, defaulting to
the identity function when no entries are found for a given function -/
def List.applyId [DecidableEq α] (xs : List (α × α)) (x : α) : α :=
((xs.map Prod.toSigma).dlookup x).getD x
#align slim_check.injective_function.list.apply_id SlimCheck.InjectiveFunction.List.applyId
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print SlimCheck.InjectiveFunction.List.applyId_cons /-
@[simp]
theorem List.applyId_cons [DecidableEq α] (xs : List (α × α)) (x y z : α) :
List.applyId ((y, z)::xs) x = if y = x then z else List.applyId xs x := by
simp only [list.apply_id, List.dlookup, eq_rec_constant, Prod.toSigma, List.map] <;> split_ifs <;>
rfl
#align slim_check.injective_function.list.apply_id_cons SlimCheck.InjectiveFunction.List.applyId_cons
+-/
open Function _Root_.List
@@ -305,6 +345,7 @@ open _Root_.Prod (toSigma)
open _Root_.Nat
+#print SlimCheck.InjectiveFunction.List.applyId_zip_eq /-
theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs)
(h₁ : xs.length = ys.length) (x y : α) (i : ℕ) (h₂ : xs.get? i = some x) :
List.applyId.{u} (xs.zip ys) x = y ↔ ys.get? i = some y :=
@@ -327,8 +368,10 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
· apply xs_ih <;> solve_by_elim [succ.inj]
· apply h₀; apply nth_mem h₂
#align slim_check.injective_function.list.apply_id_zip_eq SlimCheck.InjectiveFunction.List.applyId_zip_eq
+-/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:567:6: unsupported: specialize @hyp -/
+#print SlimCheck.InjectiveFunction.applyId_mem_iff /-
theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs) (h₁ : xs ~ ys)
(x : α) : List.applyId.{u} (xs.zip ys) x ∈ ys ↔ x ∈ xs :=
by
@@ -361,7 +404,9 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
simp only [nodupkeys, keys, comp, Prod.fst_toSigma, map_map]
rwa [map_fst_zip _ _ (le_of_eq h₆)]
#align slim_check.injective_function.apply_id_mem_iff SlimCheck.InjectiveFunction.applyId_mem_iff
+-/
+#print SlimCheck.InjectiveFunction.List.applyId_eq_self /-
theorem List.applyId_eq_self [DecidableEq α] {xs ys : List α} (x : α) :
x ∉ xs → List.applyId.{u} (xs.zip ys) x = x :=
by
@@ -373,7 +418,9 @@ theorem List.applyId_eq_self [DecidableEq α] {xs ys : List α} (x : α) :
intro y hy
exact h (mem_zip hy).1
#align slim_check.injective_function.list.apply_id_eq_self SlimCheck.InjectiveFunction.List.applyId_eq_self
+-/
+#print SlimCheck.InjectiveFunction.applyId_injective /-
theorem applyId_injective [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs) (h₁ : xs ~ ys) :
Injective.{u + 1, u + 1} (List.applyId (xs.zip ys)) :=
by
@@ -401,11 +448,13 @@ theorem applyId_injective [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup
contradiction
· rwa [list.apply_id_eq_self, list.apply_id_eq_self] at h <;> assumption
#align slim_check.injective_function.apply_id_injective SlimCheck.InjectiveFunction.applyId_injective
+-/
open TotalFunction (list.to_finmap')
open Sampleable
+#print SlimCheck.InjectiveFunction.Perm.slice /-
/-- Remove a slice of length `m` at index `n` in a list and a permutation, maintaining the property
that it is a permutation.
-/
@@ -416,7 +465,9 @@ def Perm.slice [DecidableEq α] (n m : ℕ) :
have h₀ : xs' ~ ys.inter xs' := Perm.dropSlice_inter _ _ h h'
⟨xs', ys.inter xs', h₀, h'.inter _⟩
#align slim_check.injective_function.perm.slice SlimCheck.InjectiveFunction.Perm.slice
+-/
+#print SlimCheck.InjectiveFunction.sliceSizes /-
/-- A lazy list, in decreasing order, of sizes that should be
sliced off a list of length `n`
-/
@@ -427,7 +478,9 @@ def sliceSizes : ℕ → LazyList ℕ+
LazyList.cons ⟨_, h⟩ (slice_sizes <| n / 2)
else LazyList.nil
#align slim_check.injective_function.slice_sizes SlimCheck.InjectiveFunction.sliceSizes
+-/
+#print SlimCheck.InjectiveFunction.shrinkPerm /-
/-- Shrink a permutation of a list, slicing a segment in the middle.
The sizes of the slice being removed start at `n` (with `n` the length
@@ -451,10 +504,12 @@ protected def shrinkPerm {α : Type} [DecidableEq α] [SizeOf α] :
unfold_wf <;>
apply List.sizeOf_dropSlice_lt _ _ n.2 _ this⟩
#align slim_check.injective_function.shrink_perm SlimCheck.InjectiveFunction.shrinkPerm
+-/
instance [SizeOf α] : SizeOf (InjectiveFunction α) :=
⟨fun ⟨xs, _, _⟩ => SizeOf.sizeOf (xs.map Sigma.fst)⟩
+#print SlimCheck.InjectiveFunction.shrink /-
/-- Shrink an injective function slicing a segment in the middle of the domain and removing
the corresponding elements in the codomain, hence maintaining the property that
one is a permutation of the other.
@@ -477,18 +532,22 @@ protected def shrink {α : Type} [SizeOf α] [DecidableEq α] : ShrinkFn (Inject
intro h₂ <;>
convert h₂⟩
#align slim_check.injective_function.shrink SlimCheck.InjectiveFunction.shrink
+-/
+#print SlimCheck.InjectiveFunction.mk /-
/-- Create an injective function from one list and a permutation of that list. -/
protected def mk (xs ys : List α) (h : xs ~ ys) (h' : ys.Nodup) : InjectiveFunction α :=
have h₀ : xs.length ≤ ys.length := le_of_eq h.length_eq
have h₁ : ys.length ≤ xs.length := le_of_eq h.length_eq.symm
- InjectiveFunction.map_to_self (List.toFinmap' (xs.zip ys))
+ InjectiveFunction.mapToSelf (List.toFinmap' (xs.zip ys))
(by
simp only [list.to_finmap', comp, map_fst_zip, map_snd_zip, *, Prod.fst_toSigma,
Prod.snd_toSigma, map_map])
(by simp only [list.to_finmap', comp, map_snd_zip, *, Prod.snd_toSigma, map_map])
#align slim_check.injective_function.mk SlimCheck.InjectiveFunction.mk
+-/
+#print SlimCheck.InjectiveFunction.injective /-
protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Injective (apply f) :=
by
cases' f with xs hperm hnodup
@@ -510,7 +569,9 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
· rwa [← h₀, hxs, hperm.nodup_iff]
· rwa [← hxs, h₀, h₁] at hperm
#align slim_check.injective_function.injective SlimCheck.InjectiveFunction.injective
+-/
+#print SlimCheck.InjectiveFunction.PiInjective.sampleableExt /-
instance PiInjective.sampleableExt : SampleableExt { f : ℤ → ℤ // Function.Injective f }
where
ProxyRepr := InjectiveFunction ℤ
@@ -526,11 +587,13 @@ instance PiInjective.sampleableExt : SampleableExt { f : ℤ → ℤ // Function
pure r
shrink := @InjectiveFunction.shrink ℤ _ _
#align slim_check.injective_function.pi_injective.sampleable_ext SlimCheck.InjectiveFunction.PiInjective.sampleableExt
+-/
end InjectiveFunction
open Function
+#print SlimCheck.Injective.testable /-
instance Injective.testable (f : α → β)
[I :
Testable
@@ -539,7 +602,9 @@ instance Injective.testable (f : α → β)
Testable (Injective f) :=
I
#align slim_check.injective.testable SlimCheck.Injective.testable
+-/
+#print SlimCheck.Monotone.testable /-
instance Monotone.testable [Preorder α] [Preorder β] (f : α → β)
[I :
Testable
@@ -548,7 +613,9 @@ instance Monotone.testable [Preorder α] [Preorder β] (f : α → β)
Testable (Monotone f) :=
I
#align slim_check.monotone.testable SlimCheck.Monotone.testable
+-/
+#print SlimCheck.Antitone.testable /-
instance Antitone.testable [Preorder α] [Preorder β] (f : α → β)
[I :
Testable
@@ -557,6 +624,7 @@ instance Antitone.testable [Preorder α] [Preorder β] (f : α → β)
Testable (Antitone f) :=
I
#align slim_check.antitone.testable SlimCheck.Antitone.testable
+-/
end SlimCheck
mathlib commit https://github.com/leanprover-community/mathlib/commit/f2ad3645af9effcdb587637dc28a6074edc813f9
@@ -141,7 +141,7 @@ instance Pi.sampleableExt : SampleableExt (α → β)
interp := TotalFunction.apply
sample := do
let xs ← (Sampleable.sample (List (α × β)) : Gen (List (α × β)))
- let ⟨x⟩ ← (Uliftable.up <| sample β : Gen (ULift.{max u v} β))
+ let ⟨x⟩ ← (ULiftable.up <| sample β : Gen (ULift.{max u v} β))
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
#align slim_check.total_function.pi.sampleable_ext SlimCheck.TotalFunction.Pi.sampleableExt
@@ -202,7 +202,7 @@ instance Finsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (α →₀ β
interp := TotalFunction.applyFinsupp
sample := do
let xs ← (Sampleable.sample (List (α × β)) : Gen (List (α × β)))
- let ⟨x⟩ ← (Uliftable.up <| sample β : Gen (ULift.{max u v} β))
+ let ⟨x⟩ ← (ULiftable.up <| sample β : Gen (ULift.{max u v} β))
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
#align slim_check.total_function.finsupp.sampleable_ext SlimCheck.TotalFunction.Finsupp.sampleableExt
@@ -214,7 +214,7 @@ instance Dfinsupp.sampleableExt [Repr α] [Repr β] : SampleableExt (Π₀ a :
interp := Finsupp.toDfinsupp ∘ TotalFunction.applyFinsupp
sample := do
let xs ← (Sampleable.sample (List (α × β)) : Gen (List (α × β)))
- let ⟨x⟩ ← (Uliftable.up <| sample β : Gen (ULift.{max u v} β))
+ let ⟨x⟩ ← (ULiftable.up <| sample β : Gen (ULift.{max u v} β))
pure <| total_function.with_default (list.to_finmap' xs) x
shrink := TotalFunction.shrink
#align slim_check.total_function.dfinsupp.sampleable_ext SlimCheck.TotalFunction.Dfinsupp.sampleableExt
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -328,7 +328,7 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
· apply h₀; apply nth_mem h₂
#align slim_check.injective_function.list.apply_id_zip_eq SlimCheck.InjectiveFunction.List.applyId_zip_eq
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:564:6: unsupported: specialize @hyp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:567:6: unsupported: specialize @hyp -/
theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs) (h₁ : xs ~ ys)
(x : α) : List.applyId.{u} (xs.zip ys) x ∈ ys ↔ x ∈ xs :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -344,7 +344,7 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
case cons x' xs xs_ih ys h₃ h₂ h₁ =>
cases' ys with y ys
· cases h₃
- dsimp [lookup] at h₃ ; split_ifs at h₃
+ dsimp [lookup] at h₃ ; split_ifs at h₃
· subst x'; subst val
simp only [mem_cons_iff, true_or_iff, eq_self_iff_true]
· cases' h₀ with _ _ h₀ h₅
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -70,7 +70,7 @@ We use `Σ` to encode mappings instead of `×` because we
rely on the association list API defined in `data.list.sigma`.
-/
inductive TotalFunction (α : Type u) (β : Type v) : Type max u v
- | with_default : List (Σ_ : α, β) → β → total_function
+ | with_default : List (Σ _ : α, β) → β → total_function
#align slim_check.total_function SlimCheck.TotalFunction
instance TotalFunction.inhabited [Inhabited β] : Inhabited (TotalFunction α β) :=
@@ -89,7 +89,7 @@ def apply [DecidableEq α] : TotalFunction α β → α → β
Creates a string for a given `finmap` and output, `x₀ ↦ y₀, .. xₙ ↦ yₙ`
for each of the entries. The brackets are provided by the calling function.
-/
-def reprAux [Repr α] [Repr β] (m : List (Σ_ : α, β)) : String :=
+def reprAux [Repr α] [Repr β] (m : List (Σ _ : α, β)) : String :=
String.join <|
List.qsort (fun x y => x < y)
(m.map fun x => s!"{(repr <| Sigma.fst x)} ↦ {repr <| Sigma.snd x}, ")
@@ -106,7 +106,7 @@ instance (α : Type u) (β : Type v) [Repr α] [Repr β] : Repr (TotalFunction
⟨TotalFunction.repr⟩
/-- Create a `finmap` from a list of pairs. -/
-def List.toFinmap' (xs : List (α × β)) : List (Σ_ : α, β) :=
+def List.toFinmap' (xs : List (α × β)) : List (Σ _ : α, β) :=
xs.map Prod.toSigma
#align slim_check.total_function.list.to_finmap' SlimCheck.TotalFunction.List.toFinmap'
@@ -186,7 +186,7 @@ def applyFinsupp (tf : TotalFunction α β) : α →₀ β
· simpa [List.dlookup_dedupKeys, WithTop.some_eq_coe]
· intro h
use (A.lookup a).getD (0 : β)
- rw [← List.dlookup_dedupKeys] at h⊢
+ rw [← List.dlookup_dedupKeys] at h ⊢
simp only [h, ← List.mem_dlookup_iff A.nodupkeys_dedupkeys, and_true_iff, not_false_iff,
Option.mem_def]
cases List.dlookup a A.dedupkeys
@@ -259,7 +259,7 @@ rely on the association list API defined in `data.list.sigma`.
-/
inductive InjectiveFunction (α : Type u) : Type u
|
- map_to_self (xs : List (Σ_ : α, α)) :
+ map_to_self (xs : List (Σ _ : α, α)) :
xs.map Sigma.fst ~ xs.map Sigma.snd → List.Nodup (xs.map Sigma.snd) → injective_function
#align slim_check.injective_function SlimCheck.InjectiveFunction
@@ -322,7 +322,7 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
· cases ys
· cases h₁
· cases' h₀ with _ _ h₀ h₁
- simp only [nth, zip_cons_cons, list.apply_id_cons] at h₂⊢
+ simp only [nth, zip_cons_cons, list.apply_id_cons] at h₂ ⊢
rw [if_neg]
· apply xs_ih <;> solve_by_elim [succ.inj]
· apply h₀; apply nth_mem h₂
@@ -344,7 +344,7 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
case cons x' xs xs_ih ys h₃ h₂ h₁ =>
cases' ys with y ys
· cases h₃
- dsimp [lookup] at h₃; split_ifs at h₃
+ dsimp [lookup] at h₃ ; split_ifs at h₃
· subst x'; subst val
simp only [mem_cons_iff, true_or_iff, eq_self_iff_true]
· cases' h₀ with _ _ h₀ h₅
@@ -353,8 +353,8 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
specialize xs_ih h₅ ys h₃ h₄ h₆
simp only [Ne.symm h, xs_ih, mem_cons_iff, false_or_iff]
suffices : val ∈ ys; tauto
- erw [← Option.mem_def, mem_lookup_iff] at h₃
- simp only [to_sigma, mem_map, heq_iff_eq, Prod.exists] at h₃
+ erw [← Option.mem_def, mem_lookup_iff] at h₃
+ simp only [to_sigma, mem_map, heq_iff_eq, Prod.exists] at h₃
rcases h₃ with ⟨a, b, h₃, h₄, h₅⟩
subst a; subst b
apply (mem_zip h₃).2
@@ -379,27 +379,27 @@ theorem applyId_injective [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup
by
intro x y h
by_cases hx : x ∈ xs <;> by_cases hy : y ∈ xs
- · rw [mem_iff_nth] at hx hy
+ · rw [mem_iff_nth] at hx hy
cases' hx with i hx
cases' hy with j hy
suffices some x = some y by injection this
have h₂ := h₁.length_eq
- rw [list.apply_id_zip_eq h₀ h₂ _ _ _ hx] at h
+ rw [list.apply_id_zip_eq h₀ h₂ _ _ _ hx] at h
rw [← hx, ← hy]; congr
apply nth_injective _ (h₁.nodup_iff.1 h₀)
· symm; rw [h]
rw [← list.apply_id_zip_eq] <;> assumption
· rw [← h₁.length_eq]
- rw [nth_eq_some] at hx
+ rw [nth_eq_some] at hx
cases' hx with hx hx'
exact hx
- · rw [← apply_id_mem_iff h₀ h₁] at hx hy
- rw [h] at hx
+ · rw [← apply_id_mem_iff h₀ h₁] at hx hy
+ rw [h] at hx
contradiction
- · rw [← apply_id_mem_iff h₀ h₁] at hx hy
- rw [h] at hx
+ · rw [← apply_id_mem_iff h₀ h₁] at hx hy
+ rw [h] at hx
contradiction
- · rwa [list.apply_id_eq_self, list.apply_id_eq_self] at h <;> assumption
+ · rwa [list.apply_id_eq_self, list.apply_id_eq_self] at h <;> assumption
#align slim_check.injective_function.apply_id_injective SlimCheck.InjectiveFunction.applyId_injective
open TotalFunction (list.to_finmap')
@@ -410,7 +410,7 @@ open Sampleable
that it is a permutation.
-/
def Perm.slice [DecidableEq α] (n m : ℕ) :
- (Σ'xs ys : List α, xs ~ ys ∧ ys.Nodup) → Σ'xs ys : List α, xs ~ ys ∧ ys.Nodup
+ (Σ' xs ys : List α, xs ~ ys ∧ ys.Nodup) → Σ' xs ys : List α, xs ~ ys ∧ ys.Nodup
| ⟨xs, ys, h, h'⟩ =>
let xs' := List.dropSlice n m xs
have h₀ : xs' ~ ys.inter xs' := Perm.dropSlice_inter _ _ h h'
@@ -435,7 +435,7 @@ of the list) and then `n / 2`, then `n / 4`, etc down to 1. The slices
will be taken at index `0`, `n / k`, `2n / k`, `3n / k`, etc.
-/
protected def shrinkPerm {α : Type} [DecidableEq α] [SizeOf α] :
- ShrinkFn (Σ'xs ys : List α, xs ~ ys ∧ ys.Nodup)
+ ShrinkFn (Σ' xs ys : List α, xs ~ ys ∧ ys.Nodup)
| xs => do
let k := xs.1.length
let n ← sliceSizes k
@@ -493,22 +493,22 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
by
cases' f with xs hperm hnodup
generalize h₀ : map Sigma.fst xs = xs₀
- generalize h₁ : xs.map (@id ((Σ_ : α, α) → α) <| @Sigma.snd α fun _ : α => α) = xs₁
- dsimp [id] at h₁
+ generalize h₁ : xs.map (@id ((Σ _ : α, α) → α) <| @Sigma.snd α fun _ : α => α) = xs₁
+ dsimp [id] at h₁
have hxs : xs = total_function.list.to_finmap' (xs₀.zip xs₁) :=
by
rw [← h₀, ← h₁, list.to_finmap']; clear h₀ h₁ xs₀ xs₁ hperm hnodup
induction xs
case nil => simp only [zip_nil_right, map_nil]
- case
- cons xs_hd xs_tl xs_ih =>
+ case cons xs_hd xs_tl
+ xs_ih =>
simp only [true_and_iff, to_sigma, eq_self_iff_true, Sigma.eta, zip_cons_cons, List.map]
exact xs_ih
revert hperm hnodup
rw [hxs]; intros
apply apply_id_injective
· rwa [← h₀, hxs, hperm.nodup_iff]
- · rwa [← hxs, h₀, h₁] at hperm
+ · rwa [← hxs, h₀, h₁] at hperm
#align slim_check.injective_function.injective SlimCheck.InjectiveFunction.injective
instance PiInjective.sampleableExt : SampleableExt { f : ℤ → ℤ // Function.Injective f }
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -442,7 +442,8 @@ protected def shrinkPerm {α : Type} [DecidableEq α] [SizeOf α] :
let i ← LazyList.ofList <| List.finRange <| k / n
have : ↑i * ↑n < xs.1.length :=
Nat.lt_of_div_lt_div
- (lt_of_le_of_lt (by simp only [Nat.mul_div_cancel, gt_iff_lt, [anonymous], PNat.pos]) i.2)
+ (lt_of_le_of_lt (by simp only [Nat.mul_div_cancel, gt_iff_lt, Fin.val_eq_coe, PNat.pos])
+ i.2)
pure
⟨perm.slice (i * n) n xs, by
rcases xs with ⟨a, b, c, d⟩ <;> dsimp [sizeof_lt] <;> unfold_wf <;>
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -313,8 +313,7 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
case nil ys i h₁ h₂ => cases h₂
case cons x' xs xs_ih ys i h₁ h₂ =>
cases i
- · injection h₂ with h₀ h₁
- subst h₀
+ · injection h₂ with h₀ h₁; subst h₀
cases ys
· cases h₁
·
@@ -326,8 +325,7 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
simp only [nth, zip_cons_cons, list.apply_id_cons] at h₂⊢
rw [if_neg]
· apply xs_ih <;> solve_by_elim [succ.inj]
- · apply h₀
- apply nth_mem h₂
+ · apply h₀; apply nth_mem h₂
#align slim_check.injective_function.list.apply_id_zip_eq SlimCheck.InjectiveFunction.List.applyId_zip_eq
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:564:6: unsupported: specialize @hyp -/
@@ -347,21 +345,18 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
cases' ys with y ys
· cases h₃
dsimp [lookup] at h₃; split_ifs at h₃
- · subst x'
- subst val
+ · subst x'; subst val
simp only [mem_cons_iff, true_or_iff, eq_self_iff_true]
· cases' h₀ with _ _ h₀ h₅
cases' h₂ with _ _ h₂ h₄
have h₆ := Nat.succ.inj h₁
specialize xs_ih h₅ ys h₃ h₄ h₆
simp only [Ne.symm h, xs_ih, mem_cons_iff, false_or_iff]
- suffices : val ∈ ys
- tauto
+ suffices : val ∈ ys; tauto
erw [← Option.mem_def, mem_lookup_iff] at h₃
simp only [to_sigma, mem_map, heq_iff_eq, Prod.exists] at h₃
rcases h₃ with ⟨a, b, h₃, h₄, h₅⟩
- subst a
- subst b
+ subst a; subst b
apply (mem_zip h₃).2
simp only [nodupkeys, keys, comp, Prod.fst_toSigma, map_map]
rwa [map_fst_zip _ _ (le_of_eq h₆)]
@@ -390,11 +385,9 @@ theorem applyId_injective [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup
suffices some x = some y by injection this
have h₂ := h₁.length_eq
rw [list.apply_id_zip_eq h₀ h₂ _ _ _ hx] at h
- rw [← hx, ← hy]
- congr
+ rw [← hx, ← hy]; congr
apply nth_injective _ (h₁.nodup_iff.1 h₀)
- · symm
- rw [h]
+ · symm; rw [h]
rw [← list.apply_id_zip_eq] <;> assumption
· rw [← h₁.length_eq]
rw [nth_eq_some] at hx
@@ -503,8 +496,7 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
dsimp [id] at h₁
have hxs : xs = total_function.list.to_finmap' (xs₀.zip xs₁) :=
by
- rw [← h₀, ← h₁, list.to_finmap']
- clear h₀ h₁ xs₀ xs₁ hperm hnodup
+ rw [← h₀, ← h₁, list.to_finmap']; clear h₀ h₁ xs₀ xs₁ hperm hnodup
induction xs
case nil => simp only [zip_nil_right, map_nil]
case
@@ -512,8 +504,7 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
simp only [true_and_iff, to_sigma, eq_self_iff_true, Sigma.eta, zip_cons_cons, List.map]
exact xs_ih
revert hperm hnodup
- rw [hxs]
- intros
+ rw [hxs]; intros
apply apply_id_injective
· rwa [← h₀, hxs, hperm.nodup_iff]
· rwa [← hxs, h₀, h₁] at hperm
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce86f4e05e9a9b8da5e316b22c76ce76440c56a1
@@ -176,7 +176,7 @@ def applyFinsupp (tf : TotalFunction α β) : α →₀ β
mem_support_toFun := by
intro a
rcases tf with ⟨A, y⟩
- simp only [apply, zero_default_supp, List.mem_map', List.mem_filter, exists_and_right,
+ simp only [apply, zero_default_supp, List.mem_map, List.mem_filter, exists_and_right,
List.mem_toFinset, exists_eq_right, Sigma.exists, Ne.def, zero_default]
constructor
· rintro ⟨od, hval, hod⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -185,7 +185,7 @@ def applyFinsupp (tf : TotalFunction α β) : α →₀ β where
intro a
rcases tf with ⟨A, y⟩
simp only [apply, zeroDefaultSupp, List.mem_map, List.mem_filter, exists_and_right,
- List.mem_toFinset, exists_eq_right, Sigma.exists, Ne.def, zeroDefault]
+ List.mem_toFinset, exists_eq_right, Sigma.exists, Ne, zeroDefault]
constructor
· rintro ⟨od, hval, hod⟩
have := List.mem_dlookup (List.nodupKeys_dedupKeys A) hval
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -7,8 +7,10 @@ import Mathlib.Data.List.Sigma
import Mathlib.Data.Int.Range
import Mathlib.Data.Finsupp.Defs
import Mathlib.Data.Finsupp.ToDFinsupp
+import Std.Data.LazyList
import Mathlib.Testing.SlimCheck.Sampleable
import Mathlib.Testing.SlimCheck.Testable
+import Std.Data.LazyList
import Std.Data.List.Perm
#align_import testing.slim_check.functions from "leanprover-community/mathlib"@"f9c300047a57aeda7c2fe15a3ac2455eb05ec225"
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -77,7 +77,7 @@ instance TotalFunction.inhabited [Inhabited β] : Inhabited (TotalFunction α β
namespace TotalFunction
--- porting note: new
+-- Porting note: new
/-- Compose a total function with a regular function on the left -/
def comp {γ : Type w} (f : β → γ) : TotalFunction α β → TotalFunction α γ
| TotalFunction.withDefault m y => TotalFunction.withDefault
@@ -120,7 +120,7 @@ section
universe ua ub
variable [SampleableExt.{_,u} α] [SampleableExt.{_,ub} β]
--- porting note: removed, there is no `sizeof` in the new `Sampleable`
+-- Porting note: removed, there is no `sizeof` in the new `Sampleable`
-- /-- Redefine `sizeof` to follow the structure of `sampleable` instances. -/
-- def Total.sizeof : TotalFunction α β → ℕ
@@ -320,13 +320,13 @@ theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodu
· injection h₂ with h₀; subst h₀
cases ys
· cases h₁
- · -- porting note: `open List` no longer makes `zip_cons_cons` visible
+ · -- Porting note: `open List` no longer makes `zip_cons_cons` visible
simp only [List.applyId, Prod.toSigma, Option.getD_some, List.get?, List.dlookup_cons_eq,
List.zip_cons_cons, List.map, Option.some_inj]
· cases ys
· cases h₁
· cases' h₀ with _ _ h₀ h₁
- -- porting note: `open List` no longer makes `zip_cons_cons` visible
+ -- Porting note: `open List` no longer makes `zip_cons_cons` visible
simp only [List.get?, List.zip_cons_cons, List.applyId_cons] at h₂ ⊢
rw [if_neg]
· apply xs_ih <;> solve_by_elim [Nat.succ.inj]
@@ -447,7 +447,7 @@ protected def shrinkPerm {α : Type} [DecidableEq α] :
#align slim_check.injective_function.shrink_perm SlimCheck.InjectiveFunction.shrinkPerm
--- porting note: removed, there is no `sizeof` in the new `Sampleable`
+-- Porting note: removed, there is no `sizeof` in the new `Sampleable`
-- instance [SizeOf α] : SizeOf (InjectiveFunction α) :=
-- ⟨fun ⟨xs, _, _⟩ => SizeOf.sizeOf (xs.map Sigma.fst)⟩
#noalign slim_check.injective_function.has_sizeof
@@ -7,7 +7,6 @@ import Mathlib.Data.List.Sigma
import Mathlib.Data.Int.Range
import Mathlib.Data.Finsupp.Defs
import Mathlib.Data.Finsupp.ToDFinsupp
-import Mathlib.Data.LazyList
import Mathlib.Testing.SlimCheck.Sampleable
import Mathlib.Testing.SlimCheck.Testable
import Std.Data.List.Perm
@@ -82,7 +82,7 @@ namespace TotalFunction
/-- Compose a total function with a regular function on the left -/
def comp {γ : Type w} (f : β → γ) : TotalFunction α β → TotalFunction α γ
| TotalFunction.withDefault m y => TotalFunction.withDefault
- (m.map <| Sigma.map id <| fun _ => f) (f y)
+ (m.map <| Sigma.map id fun _ => f) (f y)
/-- Apply a total function to an argument. -/
def apply [DecidableEq α] : TotalFunction α β → α → β
@@ -35,7 +35,7 @@ permutation. One has to be careful when generating the domain to make
it vast enough that, when generating arguments to apply `f` to,
they argument should be likely to lie in the domain of `f`. This is
the reason that injective functions `f : ℤ → ℤ` are generated by
-fixing the domain to the range `[-2*size .. -2*size]`, with `size`
+fixing the domain to the range `[-2*size .. 2*size]`, with `size`
the size parameter of the `gen` monad.
Much of the machinery provided in this file is applicable to generate
@@ -61,11 +61,11 @@ namespace SlimCheck
and a default value returned when the input is not in the domain of
the partial function.
-`with_default f y` encodes `x ↦ f x` when `x ∈ f` and `x ↦ y`
+`withDefault f y` encodes `x ↦ f x` when `x ∈ f` and `x ↦ y`
otherwise.
We use `Σ` to encode mappings instead of `×` because we
-rely on the association list API defined in `data.list.sigma`.
+rely on the association list API defined in `Mathlib/Data/List/Sigma.lean`.
-/
inductive TotalFunction (α : Type u) (β : Type v) : Type max u v
| withDefault : List (Σ _ : α, β) → β → TotalFunction α β
@@ -89,7 +89,7 @@ def apply [DecidableEq α] : TotalFunction α β → α → β
| TotalFunction.withDefault m y, x => (m.dlookup x).getD y
#align slim_check.total_function.apply SlimCheck.TotalFunction.apply
-/-- Implementation of `has_repr (total_function α β)`.
+/-- Implementation of `Repr (TotalFunction α β)`.
Creates a string for a given `finmap` and output, `x₀ ↦ y₀, .. xₙ ↦ yₙ`
for each of the entries. The brackets are provided by the calling function.
@@ -168,7 +168,7 @@ def zeroDefault : TotalFunction α β → TotalFunction α β
variable [DecidableEq α] [DecidableEq β]
-/-- The support of a zero default `total_function`. -/
+/-- The support of a zero default `TotalFunction`. -/
@[simp]
def zeroDefaultSupp : TotalFunction α β → Finset α
| withDefault A _ =>
@@ -259,11 +259,11 @@ namespace SlimCheck
and a default value returned when the input is not in the domain of
the partial function.
-`map_to_self f` encodes `x ↦ f x` when `x ∈ f` and `x ↦ x`,
+`mapToSelf f` encodes `x ↦ f x` when `x ∈ f` and `x ↦ x`,
i.e. `x` to itself, otherwise.
We use `Σ` to encode mappings instead of `×` because we
-rely on the association list API defined in `data.list.sigma`.
+rely on the association list API defined in `Mathlib/Data/List/Sigma.lean`.
-/
inductive InjectiveFunction (α : Type u) : Type u
| mapToSelf (xs : List (Σ _ : α, α)) :
@@ -281,9 +281,9 @@ def apply [DecidableEq α] : InjectiveFunction α → α → α
| InjectiveFunction.mapToSelf m _ _, x => (m.dlookup x).getD x
#align slim_check.injective_function.apply SlimCheck.InjectiveFunction.apply
-/-- Produce a string for a given `total_function`.
+/-- Produce a string for a given `InjectiveFunction`.
The output is of the form `[x₀ ↦ f x₀, .. xₙ ↦ f xₙ, x ↦ x]`.
-Unlike for `total_function`, the default value is not a constant
+Unlike for `TotalFunction`, the default value is not a constant
but the identity function.
-/
protected def repr [Repr α] : InjectiveFunction α → String
@@ -299,7 +299,6 @@ def List.applyId [DecidableEq α] (xs : List (α × α)) (x : α) : α :=
((xs.map Prod.toSigma).dlookup x).getD x
#align slim_check.injective_function.list.apply_id SlimCheck.InjectiveFunction.List.applyId
-/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@[simp]
theorem List.applyId_cons [DecidableEq α] (xs : List (α × α)) (x y z : α) :
List.applyId ((y, z)::xs) x = if y = x then z else List.applyId xs x := by
@@ -315,9 +314,9 @@ open Nat
theorem List.applyId_zip_eq [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs)
(h₁ : xs.length = ys.length) (x y : α) (i : ℕ) (h₂ : xs.get? i = some x) :
List.applyId.{u} (xs.zip ys) x = y ↔ ys.get? i = some y := by
- induction xs generalizing ys i
- case nil => cases h₂
- case cons x' xs xs_ih =>
+ induction xs generalizing ys i with
+ | nil => cases h₂
+ | cons x' xs xs_ih =>
cases i
· injection h₂ with h₀; subst h₀
cases ys
@@ -360,7 +359,7 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs
have h₆ := Nat.succ.inj h₁
specialize xs_ih h₅ h₃ h₄ h₆
simp only [Ne.symm h, xs_ih, List.mem_cons, false_or_iff]
- suffices : val ∈ ys; tauto
+ suffices val ∈ ys by tauto
erw [← Option.mem_def, List.mem_dlookup_iff] at h₃
simp only [Prod.toSigma, List.mem_map, heq_iff_eq, Prod.exists] at h₃
rcases h₃ with ⟨a, b, h₃, h₄, h₅⟩
@@ -489,10 +488,9 @@ protected theorem injective [DecidableEq α] (f : InjectiveFunction α) : Inject
dsimp [id] at h₁
have hxs : xs = TotalFunction.List.toFinmap' (xs₀.zip xs₁) := by
rw [← h₀, ← h₁, List.toFinmap']; clear h₀ h₁ xs₀ xs₁ hperm hnodup
- induction xs
- case nil => simp only [List.zip_nil_right, List.map_nil]
- case cons xs_hd xs_tl
- xs_ih =>
+ induction xs with
+ | nil => simp only [List.zip_nil_right, List.map_nil]
+ | cons xs_hd xs_tl xs_ih =>
simp only [true_and_iff, Prod.toSigma, eq_self_iff_true, Sigma.eta, List.zip_cons_cons,
List.map, List.cons_inj]
exact xs_ih
outParam
and adjust universe orders (#8849)
The most useful universe argument to up
and down
(the one in the ULift
type) is now first.
Combined with the outParam
, this makes using ULiftable.up
more ergonomic downstream, removing a handful of type annotations.
@@ -147,8 +147,7 @@ instance Pi.sampleableExt : SampleableExt (α → β) where
interp f := SampleableExt.interp ∘ f.apply
sample := do
let xs : List (_ × _) ← (SampleableExt.sample (α := List (α × β)))
- let ⟨x⟩ ← (ULiftable.up <|
- SampleableExt.sample : Gen (ULift.{max u ub} (SampleableExt.proxy β)))
+ let ⟨x⟩ ← ULiftable.up.{max u ub} <| (SampleableExt.sample : Gen (SampleableExt.proxy β))
pure <| TotalFunction.withDefault (List.toFinmap' <| xs.map <|
Prod.map SampleableExt.interp id) x
-- note: no way of shrinking the domain without an inverse to `interp`
@@ -10,6 +10,7 @@ import Mathlib.Data.Finsupp.ToDFinsupp
import Mathlib.Data.LazyList
import Mathlib.Testing.SlimCheck.Sampleable
import Mathlib.Testing.SlimCheck.Testable
+import Std.Data.List.Perm
#align_import testing.slim_check.functions from "leanprover-community/mathlib"@"f9c300047a57aeda7c2fe15a3ac2455eb05ec225"
@@ -246,6 +247,15 @@ end SampleableExt
end TotalFunction
+end SlimCheck
+
+-- We need List perm notation from `List` namespace but can't open `_root_.List` directly,
+-- so have to close the `SlimCheck` namespace first.
+-- Lean issue: https://github.com/leanprover/lean4/issues/3045
+open List
+
+namespace SlimCheck
+
/-- Data structure specifying a total function using a list of pairs
and a default value returned when the input is not in the domain of
the partial function.
@@ -2,11 +2,6 @@
Copyright (c) 2020 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-
-! This file was ported from Lean 3 source module testing.slim_check.functions
-! leanprover-community/mathlib commit f9c300047a57aeda7c2fe15a3ac2455eb05ec225
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.List.Sigma
import Mathlib.Data.Int.Range
@@ -16,6 +11,8 @@ import Mathlib.Data.LazyList
import Mathlib.Testing.SlimCheck.Sampleable
import Mathlib.Testing.SlimCheck.Testable
+#align_import testing.slim_check.functions from "leanprover-community/mathlib"@"f9c300047a57aeda7c2fe15a3ac2455eb05ec225"
+
/-!
## `slim_check`: generators for functions
@@ -11,7 +11,7 @@ Authors: Simon Hudon
import Mathlib.Data.List.Sigma
import Mathlib.Data.Int.Range
import Mathlib.Data.Finsupp.Defs
-import Mathlib.Data.Finsupp.ToDfinsupp
+import Mathlib.Data.Finsupp.ToDFinsupp
import Mathlib.Data.LazyList
import Mathlib.Testing.SlimCheck.Sampleable
import Mathlib.Testing.SlimCheck.Testable
@@ -215,13 +215,13 @@ instance Finsupp.sampleableExt : SampleableExt (α →₀ β) where
#align slim_check.total_function.finsupp.sampleable_ext SlimCheck.TotalFunction.Finsupp.sampleableExt
-- TODO: support a non-constant codomain type
-instance Dfinsupp.sampleableExt : SampleableExt (Π₀ _ : α, β) where
+instance DFinsupp.sampleableExt : SampleableExt (Π₀ _ : α, β) where
proxy := TotalFunction α (SampleableExt.proxy β)
- interp := fun f => (f.comp SampleableExt.interp).applyFinsupp.toDfinsupp
+ interp := fun f => (f.comp SampleableExt.interp).applyFinsupp.toDFinsupp
sample := SampleableExt.sample (α := α → β)
-- note: no way of shrinking the domain without an inverse to `interp`
shrink := { shrink := letI : Shrinkable α := {}; TotalFunction.shrink }
-#align slim_check.total_function.dfinsupp.sampleable_ext SlimCheck.TotalFunction.Dfinsupp.sampleableExt
+#align slim_check.total_function.dfinsupp.sampleable_ext SlimCheck.TotalFunction.DFinsupp.sampleableExt
end Finsupp
This diverges fairly considerably from mathlib3 since we changed the SampleableExt
API when porting the previous file.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>
The unported dependencies are