Lean 4 · 36
declarations statementsfull
instance baseLinearOrder : LinearOrder Base := LinearOrder.lift' body · 5 lines
(fun A => A.val.sort (· ≤ ·)) (by
intro A B h
apply Subtype.ext
have he := congrArg List.toFinset h
simpa only [Finset.sort_toFinset] using he)instance (priority := 2000) baseLE : LE Base := baseLinearOrder.toLE instance (priority := 2000) baseLT : LT Base := baseLinearOrder.toLT instance questionLinearOrder : LinearOrder Question := LinearOrder.lift' body · 4 lines
(fun q => [q.1,q.2.1,q.2.2]) (by
intro q r h
simp only [List.cons.injEq,and_true] at h
exact Prod.ext h.1 (Prod.ext h.2.1 h.2.2))instance (priority := 2000) questionLE : LE Question := questionLinearOrder.toLE instance (priority := 2000) questionLT : LT Question := questionLinearOrder.toLT abbrev Eight := {S : Finset Question // S.card=8} instance eightLinearOrder : LinearOrder Eight := LinearOrder.lift' body · 5 lines
(fun S => S.val.sort (· ≤ ·)) (by
intro S T h
apply Subtype.ext
have he := congrArg List.toFinset h
simpa only [Finset.sort_toFinset] using he)instance (priority := 2000) eightLE : LE Eight := eightLinearOrder.toLE instance (priority := 2000) eightLT : LT Eight := eightLinearOrder.toLT lemma eight_card : Fintype.card Eight=L := by proof · 1 line
rw [L_def,Fintype.card_finset_len,question_card]def six (S : Eight) (t : Fin 6) : Question := body · 1 line
S.val.orderEmbOfFin S.property (Fin.castLE (by decide) t)lemma six_mem (S : Eight) (t : Fin 6) : six S t ∈ S.val := proof · 1 line
S.val.orderEmbOfFin_mem S.property _lemma six_injective (S : Eight) : Function.Injective (six S) := proof · 1 line
(S.val.orderEmbOfFin S.property).injective.comp (Fin.castLE_injective (by decide))def OrthogonalEight (S : Eight) : Prop := body · 1 line
Clique (fun q r => ProjectionCriterion.correlation u q r=0) S.valdef contextAt (S : Eight) (q : Question) : Option (Fin 6) := by body · 4 lines
classical
exact if OrthogonalEight S then
if h : ∃ t, six S t=q then some (Classical.choose h) else none
else nonelemma contextAt_six (S : Eight) (hS : OrthogonalEight S) (t : Fin 6) :
contextAt S (six S t)=some t := by proof · 4 lines
unfold contextAt
rw [ite_eq_left hS,dite_eq_left (show ∃ t', six S t'=six S t from ⟨t,rfl⟩)]
congr 1
exact six_injective S (Classical.choose_spec (show ∃ t', six S t'=six S t from ⟨t,rfl⟩))lemma contextAt_some (S : Eight) (q : Question) (t : Fin 6)
(ht : contextAt S q=some t) : OrthogonalEight S ∧ six S t=q := by proof · 6 lines
unfold contextAt at ht
split_ifs at ht with ho he
· have heq := Option.some.inj ht
refine ⟨ho,?_⟩
rw [← heq]
exact Classical.choose_spec heabbrev OutputCoordinate := Eight → Four abbrev Label := Question × (Eight → Outcome) lemma four_card : Fintype.card Four=4 := rfl lemma outcome_card : Fintype.card Outcome=4 := rfl lemma card_arrow_eq {α β : Type} [Fintype α] [Fintype β] [DecidableEq α]
{a b : ℕ} (ha : Fintype.card α=a) (hb : Fintype.card β=b) :
Fintype.card (α → β)=b^a := by rw [Fintype.card_fun,ha,hb] lemma card_pair_eq {α β : Type} [Fintype α] [Fintype β]
{a b : ℕ} (ha : Fintype.card α=a) (hb : Fintype.card β=b) :
Fintype.card (α × β)=a*b := by rw [Fintype.card_prod,ha,hb] lemma output_card : Fintype.card OutputCoordinate=D := by proof · 2 lines
have he := card_arrow_eq eight_card four_card
exact helemma outcomeString_card : Fintype.card (Eight → Outcome)=D := by proof · 2 lines
have he := card_arrow_eq eight_card outcome_card
exact helemma label_card : Fintype.card Label=m := by proof · 2 lines
have he := card_pair_eq question_card outcomeString_card
exact heinstance fourLinearOrder : LinearOrder Four := body · 1 line
LinearOrder.lift' (toLex : Four ≃ Lex Four) toLex.injectiveinstance (priority := 2000) fourLE : LE Four := fourLinearOrder.toLE instance (priority := 2000) fourLT : LT Four := fourLinearOrder.toLT instance eightWellFounded : @WellFoundedLT Eight eightLinearOrder.toLT := body · 1 line
@Finite.to_wellFoundedLT Eight inferInstance eightLinearOrder.toPreorderinstance outputLinearOrder : LinearOrder OutputCoordinate := body · 1 line
LinearOrder.lift' (toLex : OutputCoordinate ≃ Lex OutputCoordinate) toLex.injectiveinstance labelLinearOrder : LinearOrder Label := body · 1 line
LinearOrder.lift' (toLex : Label ≃ Lex Label) toLex.injectivedef orderedEnumeration {τ : Type} [Fintype τ] [LinearOrder τ] {n : ℕ}
(hc : Fintype.card τ=n) : Fin n ≃ τ := body · 5 lines
((Finset.univ : Finset τ).orderIsoOfFin (by simpa using hc)).toEquiv.trans
{ toFun := Subtype.val
invFun := fun x => ⟨x,Finset.mem_univ x⟩
left_inv := fun x => by cases x; rfl
right_inv := fun x => rfl }def outputEnumeration : Fin D ≃ OutputCoordinate := orderedEnumeration output_card def labelEnumeration : Fin m ≃ Label := orderedEnumeration label_card Outline
- instance
baseLinearOrder10 - instance
baseLE16 - instance
baseLT17 - instance
questionLinearOrder19 - instance
questionLE25 - instance
questionLT26 - abbrev
Eight27 - instance
eightLinearOrder28 - instance
eightLE34 - instance
eightLT35 - lemma
eight_card36 - def
six39 - lemma
six_mem41 - lemma
six_injective43 - def
OrthogonalEight46 - def
contextAt49 - lemma
contextAt_six54 - lemma
contextAt_some60 - abbrev
OutputCoordinate69 - abbrev
Label70 - lemma
four_card71 - lemma
outcome_card72 - lemma
card_arrow_eq74 - lemma
card_pair_eq77 - lemma
output_card80 - lemma
outcomeString_card83 - lemma
label_card86 - instance
fourLinearOrder90 - instance
fourLE92 - instance
fourLT93 - instance
eightWellFounded94 - instance
outputLinearOrder97 - instance
labelLinearOrder99 - def
orderedEnumeration102 - def
outputEnumeration109 - def
labelEnumeration110
Xet Storage Details
- Size:
- 4.97 kB
- Xet hash:
- c0d726aed1ef4536dc3a97165dcd9f0e4cfed71d31e7bcd896ffc4a01c2c025c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.