import ConNF.Counting.BaseCounting
import ConNF.Counting.CountSupportOrbit
import ConNF.Counting.Recode
# Concluding the counting argument
In this file, we finish the counting argument.
* `ConNF.card_tSet_le`: There are at most `μ`-many t-sets at each level.
variable [Params.{u}] [Level] [CoherentData]
theorem card_codingFunction (β : TypeIndex) [LeLevel β] :
#(CodingFunction β) < #μ := by
induction β using WellFoundedLT.induction
cases β using WithBot.recBotCoe
case bot => exact card_bot_codingFunction_lt
· exact card_codingFunction_lt_of_isMin hβ
have hγ := WithBot.coe_lt_coe.mpr hγ
have : LeLevel γ := ⟨hγ.le.trans LeLevel.elim⟩
have := exists_combination_raisedSingleton hγ
choose s o h₁ h₂ using this
refine (mk_le_of_injective (f := λ χ ↦ (s χ, o χ)) ?_).trans_lt ?_
simp only [h.1, h.2, ← hχ₂] at hχ₁
· rw [mk_prod, mk_set, Cardinal.lift_id, Cardinal.lift_id]
refine mul_lt_of_lt μ_isStrongLimit.aleph0_le ?_ (card_supportOrbit_lt ih)
exact card_raisedSingleton_lt _ (card_supportOrbit_lt ih) ih
theorem card_supportOrbit (β : TypeIndex) [LeLevel β] :
#(SupportOrbit β) < #μ := by
apply card_supportOrbit_lt
exact card_codingFunction δ
/-- Note that we cannot prove the reverse implication because all of our hypotheses at this stage
are about permutations, not objects. -/
theorem card_tSet_le (β : TypeIndex) [LeLevel β] :
refine (mk_le_of_injective
(f := λ x : TSet β ↦ (Tangle.code ⟨x, designatedSupport x, designatedSupport_supports x⟩,
designatedSupport x)) ?_).trans ?_
rw [Prod.mk.injEq, Tangle.code_eq_code_iff] at h
have := (designatedSupport_supports x).supports ρ ?_
· have hρx := congr_arg (·.set) hρ
simp only [Tangle.smul_set] at hρx
· have hρx := congr_arg (·.support) hρ
simp only [Tangle.smul_support] at hρx
· rw [mk_prod, Cardinal.lift_id, Cardinal.lift_id]
apply mul_le_of_le μ_isStrongLimit.aleph0_le (card_codingFunction β).le
theorem card_tangle_le (β : TypeIndex) [LeLevel β] :
card_tangle_le_of_card_tSet (card_tSet_le β)