Compfiles/Usa1990P4.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned compfiles documentation, Pinned compfiles corpus index
39 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1990, Problem 4
How many positive integers can be written in base n so that (1) the integer has no two digits the same, and (2) each digit after the first differs by one from an earlier digit? For example, in base 3, the possible numbers are 1, 2, 10, 12, 21, 102, 120, 210.
Imports (6)
Imported by 1 file
- def
Usa1990P4.DiffByOneDocumented declaration: DiffByOne line 35 sourceSource documentation
Condition (2) of the problem, phrased for the list of base-
ndigits of a number as produced byNat.digits(least significant digit first, so the "first" digit of the number is the last entry of the list): every digit except the most significant one differs by one from some more significant digit.standard axioms: Quot.sound, propext what this means
Statement uses:
List,NatProof uses:
LT.lt,HAdd.hAdd,OfNat.ofNat,List.length,Exists,And,Or,Eq,GetElem.getElem6 instances, coercions and auxiliary constants left out.
def DiffByOne (l : List ℕ) : Prop := …
- inductive
Usa1990P4.IVDocumented declaration: IV line 45 sourceSource documentation
IV a b lholds whenlis a list of natural numbers whose set of entries is exactly the interval[a, b], built by starting from a single digit and repeatedly prepending a new minimum or a new maximum. These are essentially the valid digit lists of the problem (up to the leading-digit condition).no axioms what this means
Statement uses:
Nat,Listinductive IV : ℕ → ℕ → List ℕ → Prop | single (d : ℕ) : IV d d [d] | consLo {a b : ℕ} {l : List ℕ} (h : IV (a + 1) b l) : IV a b (a :: l) | consHi {a b : ℕ} {l : List ℕ} (h : IV a (b - 1) l) (hhi : 0 < b) : IV a b (b :: l) namespace IVMentions: h
- theorem
Usa1990P4.IV.ne_nilline 53 sourceno axioms what this means
Statement uses:
Nat,List, Usa1990P4.IV,Ne,List.nilProof uses:
Eq,HEq,List.cons,Usa1990P4.IV.single,List.cons_ne_nil,Eq.symm,HAdd.hAdd,OfNat.ofNat,Usa1990P4.IV.consLo,HSub.hSub,LT.lt,Usa1990P4.IV.consHi,Eq.refl,HEq.refl8 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.IV.lo_le_hiline 56 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,LE.leProof uses:
Usa1990P4.IV.rec,Nat.le_refl,HAdd.hAdd,OfNat.ofNat,HSub.hSub,LT.lt10 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.IV.mem_iffline 62 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,Iff,Membership.mem,And,LE.leProof uses:
Usa1990P4.IV.rec,Eq.mpr,List.cons,List.nil,Eq,id,congrArg,propext,List.mem_singleton,ge_antisymm_iff,HAdd.hAdd,OfNat.ofNat, Usa1990P4.IV.lo_le_hi,Or,List.mem_cons,HSub.hSub,LT.lt13 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.IV.mem_loline 75 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,Membership.memProof uses:
Iff.mpr,And,LE.le, Usa1990P4.IV.mem_iff,And.intro,Nat.le_refl, Usa1990P4.IV.lo_le_hi3 instances, coercions and auxiliary constants left out.
- theorem
Usa1990P4.IV.mem_hiline 78 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,Membership.memProof uses:
Iff.mpr,And,LE.le, Usa1990P4.IV.mem_iff,And.intro, Usa1990P4.IV.lo_le_hi,Nat.le_refl3 instances, coercions and auxiliary constants left out.
- theorem
Usa1990P4.IV.nodupline 81 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,List.NodupProof uses:
Usa1990P4.IV.rec,of_eq_true,List.cons,List.nil,Eq.trans,And,Not,Membership.mem,True,congr,congrArg,False,not_false_eq_true,and_self,HAdd.hAdd,OfNat.ofNat,Iff.mpr,List.nodup_cons,And.intro,LE.leand 4 more13 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.IV.length_eqline 95 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,Eq,List.length,HSub.hSub,HAdd.hAdd,OfNat.ofNatProof uses:
Usa1990P4.IV.rec,id,List.cons,List.nil,LE.le, Usa1990P4.IV.lo_le_hi,Eq.mpr,congrArg,List.length_cons,LT.lt15 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.IV.cons_iffInversion principle forIVon a cons list line 107 sourceSource documentation
Inversion principle for
IVon a cons list.no axioms what this means
Statement uses:
Nat,List,Iff, Usa1990P4.IV,List.cons,Or,And,Eq,HAdd.hAdd,OfNat.ofNat,LT.lt,HSub.hSub,List.nilProof uses:
Iff.intro,HEq,Usa1990P4.IV.single,Or.inr,And.intro,rfl,Eq.symm,eq_of_heq,Usa1990P4.IV.consLo,Or.inl,Usa1990P4.IV.consHi,Eq.refl,HEq.refl17 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
theorem cons_iff {a b d : ℕ} {l : List ℕ} : IV a b (d :: l) ↔ (d = a ∧ IV (a + 1) b l) ∨ (d = b ∧ 0 < b ∧ IV a (b - 1) l) ∨ (a = d ∧ b = d ∧ l = []) := by …Mentions: Usa1990P4.IV
- theorem
Usa1990P4.IV.diffByOneIVlists satisfy condition (2) of the problem line 124 sourceSource documentation
IVlists satisfy condition (2) of the problem.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV, Usa1990P4.DiffByOneProof uses:
Usa1990P4.IV.rec,LT.lt,HAdd.hAdd,OfNat.ofNat,List.length,List.cons,List.nil,Eq,rfl,Nat.casesAuxOn,Exists,And,Or,GetElem.getElem,Iff.mp,Membership.mem,List.mem_iff_getElem, Usa1990P4.IV.mem_lo,Exists.intro,And.introand 14 more16 instances, coercions and auxiliary constants left out.
Tactic trace: 48 steps
Open to load the checked before-and-after goal states.
theorem diffByOne {a b : ℕ} {l : List ℕ} (h : IV a b l) : DiffByOne l := by …Mentions: h, Usa1990P4.IV, Usa1990P4.DiffByOne
- theorem
Usa1990P4.IV.of_diffByOneLists with distinct entries satisfying condition (2) are exactly theIVlists line 163 sourceSource documentation
Lists with distinct entries satisfying condition (2) are exactly the
IVlists.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
List,Nat,Ne,List.nil,List.Nodup, Usa1990P4.DiffByOne,Exists, Usa1990P4.IVProof uses:
List.rec,absurd,Eq,rfl,List.cons,Exists.intro,Usa1990P4.IV.single,And.right,Not,Membership.mem,Iff.mp,And,List.nodup_cons,LT.lt,HAdd.hAdd,OfNat.ofNat,List.length,Or,GetElem.getElem,Eq.mprand 23 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 51 steps
Open to load the checked before-and-after goal states.
theorem of_diffByOne {l : List ℕ} (hne : l ≠ []) (hn : l.Nodup) (hd : DiffByOne l) : ∃ a b, IV a b l := by …Mentions: Usa1990P4.DiffByOne, Usa1990P4.IV
- theorem
Usa1990P4.IV.unique_indicesThe interval endpoints of anIVlist are uniquely determined line 202 sourceSource documentation
The interval endpoints of an
IVlist are uniquely determined.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,And,EqProof uses:
LE.le,Iff.mp,Membership.mem, Usa1990P4.IV.mem_iff, Usa1990P4.IV.mem_lo, Usa1990P4.IV.mem_hi3 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
theorem unique_indices {a b a' b' : ℕ} {l : List ℕ} (h : IV a b l) (h' : IV a' b' l) : a = a' ∧ b = b' := by …Mentions: h, Usa1990P4.IV
- def
Usa1990P4.ValidListsDocumented declaration: ValidLists line 216 sourceSource documentation
Digit lists satisfying the conditions of the problem in base
n: distinct digits, condition (2), all digits less thann, and a nonzero leading digit (the last entry of the list, since digits are stored least-significant first).standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Set,ListProof uses:
Set.ofPred,And,List.Nodup, Usa1990P4.DiffByOne,Membership.mem,LT.lt,Ne,List.nil,List.getLast,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
def ValidLists (n : ℕ) : Set (List ℕ) := …
- def
Usa1990P4.WValid digit lists whose digits form exactly the interval[a, b]line 221 sourceSource documentation
Valid digit lists whose digits form exactly the interval
[a, b].no axioms what this means
Statement uses:
Nat,Set,ListProof uses:
Set.ofPred,And, Usa1990P4.IV,Ne,List.nil,List.getLast,OfNat.ofNat1 instances, coercions and auxiliary constants left out.
def W (a b : ℕ) : Set (List ℕ) := {l | IV a b l ∧ ∀ h : l ≠ [], l.getLast h ≠ 0}Mentions: Usa1990P4.IV, h
- def
Usa1990P4.IVSetLists whose digits form exactly the interval[a, b]line 224 sourceSource documentation
Lists whose digits form exactly the interval
[a, b].no axioms what this means
Statement uses:
Nat,Set,ListProof uses:
Set.ofPred, Usa1990P4.IVdef IVSet (a b : ℕ) : Set (List ℕ) := {l | IV a b l}Mentions: Usa1990P4.IV
- def
Usa1990P4.descendThe decreasing listb, b-1, ..., 1, 0line 227 sourceSource documentation
The decreasing list
b, b-1, ..., 1, 0.no axioms what this means
Statement uses:
Nat,List2 instances, coercions and auxiliary constants left out.
def descend : ℕ → List ℕ | 0 => [0] | b + 1 => (b + 1) :: descend b
- theorem
Usa1990P4.descend_ne_nilline 231 sourceno axioms what this means
Statement uses:
Nat,Ne,List, Usa1990P4.descend,List.nilProof uses:
Nat.casesAuxOn,List.cons_ne_nil,OfNat.ofNat,HAdd.hAdd3 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.descend_eqline 237 sourcestandard axioms: propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,List, Usa1990P4.descend,List.cons,HSub.hSubProof uses:
Nat.casesAuxOn,HAdd.hAdd,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.IV_descendline 242 sourceno axioms what this means
Statement uses:
Nat, Usa1990P4.IV,OfNat.ofNat, Usa1990P4.descendProof uses:
Nat.recAux,Usa1990P4.IV.single,Usa1990P4.IV.consHi,HAdd.hAdd,Nat.zero_lt_succ4 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.getLast?_descendline 248 sourcestandard axioms: propext what this means
Statement uses:
Nat,Eq,Option,List.getLast?, Usa1990P4.descend,Option.some,OfNat.ofNatProof uses:
Nat.recAux,Eq.refl,id,HAdd.hAdd,Eq.mpr,List.cons,congrArg,List.getLast?_cons_of_ne_nil, Usa1990P4.descend_ne_nil4 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.getLast_descendline 257 sourcestandard axioms: propext what this means
Statement uses:
Nat,Ne,List, Usa1990P4.descend,List.nil,Eq,List.getLast,OfNat.ofNatProof uses:
Iff.mpr,Option,List.getLast?,Option.some,List.getLast_eq_iff_getLast?_eq_some, Usa1990P4.getLast?_descend2 instances, coercions and auxiliary constants left out.
- theorem
Usa1990P4.eq_descendAmongIV 0 blists, only the decreasing list ends in0line 261 sourceSource documentation
Among
IV 0 blists, only the decreasing list ends in0.standard axioms: propext what this means
Statement uses:
Nat,List, Usa1990P4.IV,Ne,List.nil,Eq,List.getLast,OfNat.ofNat,And, Usa1990P4.descendProof uses:
Usa1990P4.IV.rec,List.cons,List.cons_ne_nil,Eq.mp,congrArg,List.getLast_singleton,And.intro,rfl,Eq.symm,HAdd.hAdd,List.getLast_cons,absurd,Nat.succ_ne_zero,HSub.hSub,LT.lt,Eq.mpr,id, Usa1990P4.descend_eq,Eq.refl9 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
theorem eq_descend {a b : ℕ} {l : List ℕ} (h : IV a b l) (hgl : ∀ hh : l ≠ [], l.getLast hh = 0) : a = 0 ∧ l = descend b := by …Mentions: h, Usa1990P4.IV, Usa1990P4.descend
- theorem
Usa1990P4.finite_and_ncard_IVSetThe number ofIVlists over the interval[a, a + k]is2 ^ kline 287 sourceSource documentation
The number of
IVlists over the interval[a, a + k]is2 ^ k.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,And,Set.Finite,List, Usa1990P4.IVSet,HAdd.hAdd,Eq,Set.ncard,HPow.hPow,OfNat.ofNatProof uses:
Nat.recAux,Set,Singleton.singleton,List.cons,List.nil,Set.ext,Eq.mpr,Iff,Membership.mem, Usa1990P4.IV,id,congrArg,Iff.intro,LE.le, Usa1990P4.IV.lo_le_hi,List.length,HSub.hSub, Usa1990P4.IV.length_eq,Exists,Iff.mpand 66 more70 instances, coercions and auxiliary constants left out.
Tactic trace: 72 steps
Open to load the checked before-and-after goal states.
theorem finite_and_ncard_IVSet : ∀ (k a : ℕ), (IVSet a (a + k)).Finite ∧ (IVSet a (a + k)).ncard = 2 ^ k := by …Mentions: Usa1990P4.IVSet
- theorem
Usa1990P4.geom2Geometric series with ratio2line 347 sourceSource documentation
Geometric series with ratio
2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum,Finset.range,HPow.hPow,OfNat.ofNat,HSub.hSubProof uses:
Nat.recAux,of_eq_true,Eq.trans,True,congrArg,congrFun',pow_zero,tsub_self,eq_self,Eq.mpr,HAdd.hAdd,id,Finset.sum_range_succ,HMul.hMul,pow_succ,LT.lt,pow_pos,Mathlib.Meta.Positivity.pos_of_isNat,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refland 2 more46 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
theorem geom2 : ∀ m, ∑ k ∈ Finset.range m, 2 ^ k = 2 ^ m - 1 := by …
- theorem
Usa1990P4.two_pow_geline 356 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,HAdd.hAdd,HMul.hMul,OfNat.ofNat,HPow.hPowProof uses:
Nat.recAux,of_eq_true,Eq.trans,True,congr,congrArg,congrFun',MulZeroClass.mul_zero,zero_add,pow_one,Eq.mpr,id,Eq,pow_succ32 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.outer_sumline 364 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum,Finset.range,HSub.hSub,HPow.hPow,OfNat.ofNat,HAdd.hAdd,HMul.hMulProof uses:
Nat.recAux,of_eq_true,Eq.trans,True,congrArg,congrFun',congr,zero_add,pow_one,MulZeroClass.mul_zero,tsub_zero,tsub_self,eq_self,Eq.mpr,id,Finset.sum_range_succ,LE.le, Usa1990P4.two_pow_ge,pow_succ,Mathlib.Tactic.Ring.of_eqand 27 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.ncard_biUnionFinite disjoint unions of sets of lists have the sum of the cardinalities line 376 sourceSource documentation
Finite disjoint unions of sets of lists have the sum of the cardinalities.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Set,Membership.mem,Ne,Disjoint,Set.Finite,Eq,Set.ncard,Set.iUnion,Finset.sumProof uses:
Finset.induction,EmptyCollection.emptyCollection,Set.ext,of_eq_true,Iff,Eq.trans,False,True,congr,congrArg,congrFun',funext,Set.iUnion_congr_Prop,Iff.of_eq,Eq.refl,Set.iUnion_of_empty,Set.iUnion_empty,iff_self,Eq.mpr,idand 22 more51 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
theorem ncard_biUnion {α : Type*} (s : Finset ℕ) (f : ℕ → Set α) (hd : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → Disjoint (f i) (f j)) (hf : ∀ i ∈ s, (f i).Finite) : (⋃ i ∈ s, f i).ncard = ∑ i ∈ s, (f i).ncard := by …Mentions: f
- theorem
Usa1990P4.W_finiteline 406 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Set.Finite,List, Usa1990P4.WProof uses:
dite,LE.le, Usa1990P4.IVSet,HAdd.hAdd,HSub.hSub,Eq,Set.ncard,HPow.hPow,OfNat.ofNat,And, Usa1990P4.finite_and_ncard_IVSet,Set.Finite.subset,Eq.mp,congrArg,Membership.mem,Set,And.left, Usa1990P4.IV,Ne,List.niland 12 more17 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.disjoint_Wline 420 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne,Prod,Prod.mk,Disjoint,Set,List, Usa1990P4.WProof uses:
Eq.mpr,Membership.mem,Not,id,Eq,congrArg,propext,Set.disjoint_left, Usa1990P4.IV,List.nil,List.getLast,OfNat.ofNat,False,And, Usa1990P4.IV.unique_indices,rfl24 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.ncard_WThe number of valid digit lists with digit interval[a, b]line 428 sourceSource documentation
The number of valid digit lists with digit interval
[a, b].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,Eq,Set.ncard,List, Usa1990P4.W,HSub.hSub,HPow.hPow,OfNat.ofNat,iteProof uses:
Set.Finite, Usa1990P4.IVSet,HAdd.hAdd,And, Usa1990P4.finite_and_ncard_IVSet,dite,Set,SDiff.sdiff,Singleton.singleton, Usa1990P4.descend,Set.ext,Eq.mpr,Iff,Membership.mem, Usa1990P4.IV,Ne,List.nil,List.getLast,Not,idand 27 more33 instances, coercions and auxiliary constants left out.
Tactic trace: 35 steps
Open to load the checked before-and-after goal states.
theorem ncard_W {a b : ℕ} (hle : a ≤ b) : (W a b).ncard = 2 ^ (b - a) - (if a = 0 then 1 else 0) := by …Mentions: Usa1990P4.W
- theorem
Usa1990P4.validLists_eq_biUnionThe valid digit lists are the disjoint union of theW a bover0 ≤ a ≤ b < nline 461 sourceSource documentation
The valid digit lists are the disjoint union of the
W a bover0 ≤ a ≤ b < n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Set,List, Usa1990P4.ValidLists,Set.iUnion,Membership.mem,Finset,Finset.range,HAdd.hAdd,OfNat.ofNat, Usa1990P4.WProof uses:
Set.ext,Iff.intro,List.Nodup,And, Usa1990P4.DiffByOne,LT.lt,Ne,List.nil,List.getLast,Exists, Usa1990P4.IV, Usa1990P4.IV.of_diffByOne, Usa1990P4.IV.mem_hi,Nat.lt_succ_of_le, Usa1990P4.IV.lo_le_hi,Iff.mpr,Set.mem_iUnion₂,Exists.intro,Finset.mem_range,And.introand 9 more17 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
theorem validLists_eq_biUnion (n : ℕ) : ValidLists n = ⋃ b ∈ Finset.range n, ⋃ a ∈ Finset.range (b + 1), W a b := by …Mentions: Usa1990P4.ValidLists, Usa1990P4.W
- theorem
Usa1990P4.disjoint_innerline 481 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne,Disjoint,Set,List,Set.iUnion,Membership.mem,Finset,Finset.range,HAdd.hAdd,OfNat.ofNat, Usa1990P4.WProof uses:
Eq.mpr,Not,id,Eq,congrArg,propext,Set.disjoint_left,Exists,False,Eq.mp,Set.mem_iUnion₂,And, Usa1990P4.IV.unique_indices,And.left, Usa1990P4.IV,List.nil,List.getLast33 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- theorem
Usa1990P4.inner_finiteline 492 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Set.Finite,List,Set.iUnion,Membership.mem,Finset,Finset.range,HAdd.hAdd,OfNat.ofNat, Usa1990P4.WProof uses:
Set.Finite.biUnion,Finset.finite_toSet,Set, Usa1990P4.W_finite11 instances, coercions and auxiliary constants left out.
- theorem
Usa1990P4.ncard_innerThe number of valid digit lists whose largest digit is exactlybline 497 sourceSource documentation
The number of valid digit lists whose largest digit is exactly
b.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Set.ncard,List,Set.iUnion,Membership.mem,Finset,Finset.range,HAdd.hAdd,OfNat.ofNat, Usa1990P4.W,HSub.hSub,HPow.hPowProof uses:
Eq.mpr,Finset.sum,id,congrArg, Usa1990P4.ncard_biUnion,Ne, Usa1990P4.disjoint_W,Prod,Prod.mk,Not,Eq.trans,And,Prod.mk.injEq,True,eq_self,and_true, Usa1990P4.W_finite,Finset.sum_range_succ',ite, Usa1990P4.ncard_W and 29 more58 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
theorem ncard_inner (b : ℕ) : (⋃ a ∈ Finset.range (b + 1), W a b).ncard = 2 ^ (b + 1) - 2 := by …Mentions: Usa1990P4.W
- theorem
Usa1990P4.ncard_validListsThe total number of valid digit lists in basenline 521 sourceSource documentation
The total number of valid digit lists in base
n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Set.ncard,List, Usa1990P4.ValidLists,HSub.hSub,HPow.hPow,OfNat.ofNat,HAdd.hAdd,HMul.hMulProof uses:
Eq.mpr,Set.iUnion,Membership.mem,Finset,Finset.range, Usa1990P4.W,id,congrArg,Set, Usa1990P4.validLists_eq_biUnion,Finset.sum, Usa1990P4.ncard_biUnion,Ne, Usa1990P4.disjoint_inner, Usa1990P4.inner_finite,Eq.trans,Finset.sum_congr,rfl, Usa1990P4.ncard_inner, Usa1990P4.outer_sum25 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
theorem ncard_validLists (n : ℕ) : (ValidLists n).ncard = 2 ^ (n + 1) - 2 * n - 2 := by …Mentions: Usa1990P4.ValidLists
- theorem
Usa1990P4.ncard_numbers_eqPositive integers satisfying the conditions of the problem correspond to valid digit lists viaNat.digitsline 530 sourceSource documentation
Positive integers satisfying the conditions of the problem correspond to valid digit lists via
Nat.digits.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,Set.ncard,Set.ofPred,And,List.Nodup,Nat.digits, Usa1990P4.DiffByOne,List, Usa1990P4.ValidListsProof uses:
Set.ncard_congr,Membership.mem,Set,Ne,List.nil,Iff.mpr,Nat.digits_ne_nil_iff_ne_zero,And.intro,List.getLast,Nat.digits_lt_base,Nat.getLast_digit_ne_zero,Nat.digits.injective,Exists,Nat.ofDigits,Nat.digits_ofDigits,GT.gt,Or,Nat.eq_zero_or_pos,absurd,Eq.symmand 6 more10 instances, coercions and auxiliary constants left out.
Tactic trace: 23 steps
Open to load the checked before-and-after goal states.
theorem ncard_numbers_eq (n : ℕ) (hn : 1 < n) : Set.ncard {m : ℕ | 0 < m ∧ (Nat.digits n m).Nodup ∧ DiffByOne (Nat.digits n m)} = (ValidLists n).ncard := by …Mentions: Usa1990P4.DiffByOne, Usa1990P4.ValidLists
- determine
Usa1990P4.answerline 554 sourcestandard axioms: propext what this means
Statement uses:
NatProof uses:
HSub.hSub,HPow.hPow,OfNat.ofNat,HAdd.hAdd,HMul.hMul11 instances, coercions and auxiliary constants left out.
- problem
Usa1990P4.usa1990_p4line 556 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Set.ncard,Set.ofPred,And,LT.lt,List.Nodup,Nat.digits, Usa1990P4.DiffByOne, Usa1990P4.answerProof uses:
Eq.mpr,List, Usa1990P4.ValidLists,id,congrArg, Usa1990P4.ncard_numbers_eq,HSub.hSub,HPow.hPow,HAdd.hAdd,HMul.hMul, Usa1990P4.ncard_validLists,Eq.refl17 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.