refactor(library/data/set/finite): make proof more robust

This commit is contained in:
Leonardo de Moura 2015-08-31 17:26:24 -10:00
parent 92716972c0
commit 63b93cf762

View file

@ -129,14 +129,16 @@ by rewrite [-finset.to_set_upto n]; apply finite_finset
theorem to_finset_upto (n : ) : to_finset {i | i < n} = finset.upto n := theorem to_finset_upto (n : ) : to_finset {i | i < n} = finset.upto n :=
by apply (to_finset_eq_of_to_set_eq !finset.to_set_upto) by apply (to_finset_eq_of_to_set_eq !finset.to_set_upto)
set_option pp.notation false
theorem finite_powerset (s : set A) [fins : finite s] : finite 𝒫 s := theorem finite_powerset (s : set A) [fins : finite s] : finite 𝒫 s :=
assert H : 𝒫 s = finset.to_set '[finset.to_set (#finset 𝒫 (to_finset s))], assert H : 𝒫 s = finset.to_set '[finset.to_set (#finset 𝒫 (to_finset s))],
from ext (take t, iff.intro from ext (take t, iff.intro
(suppose t ∈ 𝒫 s, (suppose t ∈ 𝒫 s,
assert t ⊆ s, from this, assert t ⊆ s, from this,
assert finite t, from finite_subset this, assert finite t, from finite_subset this,
have (#finset to_finset t ∈ 𝒫 (to_finset s)), assert (#finset to_finset t ∈ 𝒫 (to_finset s)),
by rewrite [finset.mem_powerset_iff_subset, to_finset_subset_to_finset_eq]; apply `t ⊆ s`, by rewrite [finset.mem_powerset_iff_subset, to_finset_subset_to_finset_eq]; apply `t ⊆ s`,
assert to_finset t ∈ (finset.to_set (finset.powerset (to_finset s))), from this,
mem_image this (by rewrite to_set_to_finset)) mem_image this (by rewrite to_set_to_finset))
(assume H', (assume H',
obtain t' [(tmem : (#finset t' ∈ 𝒫 (to_finset s))) (teq : finset.to_set t' = t)], obtain t' [(tmem : (#finset t' ∈ 𝒫 (to_finset s))) (teq : finset.to_set t' = t)],