2015-06-04 00:35:03 +00:00
|
|
|
import data.finset
|
|
|
|
open subtype setoid finset set
|
|
|
|
|
|
|
|
inductive finite_set [class] {T : Type} (xs : set T) :=
|
|
|
|
| mk : ∀ (fxs : finset T), to_set fxs = xs → finite_set xs
|
|
|
|
|
|
|
|
definition card {T : Type} (xs : set T) [fn : finite_set xs] : nat :=
|
|
|
|
begin
|
|
|
|
induction fn,
|
|
|
|
exact finset.card fxs
|
|
|
|
end
|
|
|
|
|
2015-12-13 20:23:44 +00:00
|
|
|
example {T : Type} (xs : set T) [fn₁ : finite_set xs] [fn₂ : finite_set xs] : @card T xs fn₁ = @card T xs fn₂ :=
|
2015-06-04 00:35:03 +00:00
|
|
|
begin
|
|
|
|
induction fn₁ with fxs₁ h₁,
|
|
|
|
induction fn₂ with fxs₂ h₂,
|
|
|
|
subst xs,
|
|
|
|
apply sorry
|
|
|
|
end
|
|
|
|
|
2015-12-13 20:23:44 +00:00
|
|
|
example {T : Type} (xs : set T) [fn₁ : finite_set xs] [fn₂ : finite_set xs] : @card T xs fn₁ = @card T xs fn₂ :=
|
2015-06-04 00:35:03 +00:00
|
|
|
begin
|
|
|
|
induction fn₁ with fxs₁ h₁,
|
|
|
|
induction fn₂ with fxs₂ h₂,
|
|
|
|
subst xs,
|
2015-12-10 18:37:55 +00:00
|
|
|
note aux := to_set.inj h₂,
|
2015-06-04 00:35:03 +00:00
|
|
|
subst aux
|
|
|
|
end
|