Compfiles/ZeroesOnesAndTwos.lean
27 declarations, 0 contain sorry, 0 declared as axioms
(From Mathematical Puzzles: A Connoisseur's Collection by Peter Winkler.)
Let n be a natural number. Prove that
(a) n has a (nonzero) multiple whose representation in base 10 contains only zeroes and ones; and (b) 2^n has a multiple whose representation contains only ones and twos.
Imported by 1 file
- def
ZerosOnesAndTwos.onesline 32 sourcestandard axioms: propext what this means
Statement uses:
NatProof uses:
Nat.ofDigits,List.replicate,OfNat.ofNat2 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.ones_addline 35 sourcestandard axioms: propext what this means
Statement uses:
Nat,Eq, ZerosOnesAndTwos.ones,HAdd.hAdd,Nat.ofDigits,HAppend.hAppend,List,List.replicate,OfNat.ofNatProof uses:
id,Eq.mpr,congrArg,List.replicate_add,HMul.hMul,HPow.hPow,List.length,Nat.ofDigits_append,List.length_replicate,Nat.ofDigits_replicate_zero,zero_add,Eq.refl24 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- def
ZerosOnesAndTwos.map_modline 41 sourceno axioms what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,FinProof uses:
Fin.mk,HMod.hMod7 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.pigeonholeline 44 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Exists,And,LT.lt,EqProof uses:
Ne,Finite.exists_ne_map_eq_of_infinite,Or.elim,Ne.lt_or_gt,Exists.intro,And.intro,Eq.symm10 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.lemma_3line 49 sourcestandard axioms: propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,HMod.hMod,Exists,PNat,HMul.hMulProof uses:
exists_eq_mul_right_of_dvd,Nat.dvd_of_mod_eq_zero,lt_of_mul_lt_mul_left',Eq.rec,Exists.intro,Subtype.mk20 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.two_le_tenline 54 sourcestandard axioms: propext what this means
Statement uses:
LE.le,Nat,OfNat.ofNatProof uses:
Iff.mp,Eq,HSub.hSub,tsub_eq_zero_iff_le,rfl16 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.one_lt_tenline 55 sourcestandard axioms: propext what this means
Statement uses:
LE.le,Nat,OfNat.ofNatProof uses:
Iff.mp,Eq,HSub.hSub,tsub_eq_zero_iff_le,rfl16 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.one_le_tenline 56 sourcestandard axioms: propext what this means
Statement uses:
LE.le,Nat,OfNat.ofNatProof uses:
Iff.mp,Eq,HSub.hSub,tsub_eq_zero_iff_le,rfl16 instances, coercions and auxiliary constants left out.
- problem
ZerosOnesAndTwos.zeroes_and_onesline 60 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Exists,PNat,Membership.mem,List,Nat.digits,OfNat.ofNat,HMul.hMul,Or,EqProof uses:
GT.gt,Nat.eq_zero_or_pos,Exists.intro,Eq.mpr,id,congrArg,of_eq_true,Eq.trans,True,forall_congr,False,implies_congr,List.nil,congrFun',mul_one,Nat.digits_zero,Eq.refl,implies_true,And,LT.ltand 58 more68 instances, coercions and auxiliary constants left out.
Tactic trace: 37 steps
Open to load the checked before-and-after goal states.
- abbrev
ZerosOnesAndTwos.all_one_or_twoline 105 sourceno axioms what this means
Statement uses:
List,NatProof uses:
Membership.mem,Or,Eq,OfNat.ofNat2 instances, coercions and auxiliary constants left out.
- def
ZerosOnesAndTwos.prepend_oneline 107 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
HAdd.hAdd,HPow.hPow,OfNat.ofNat,List.length,Nat.digits7 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.prepend_one_posline 109 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat, ZerosOnesAndTwos.prepend_oneProof uses:
Nat.casesAuxOn,Eq,of_eq_true,Eq.trans,True,congrArg,HAdd.hAdd,HPow.hPow,List.length,Nat.digits,congrFun',List,List.nil,Nat.digits_zero,pow_zero,add_zero,eq_self,Eq.symm,Eq.mpr,idand 21 more79 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.digits_len'line 114 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,List.length,Nat.digits,HAdd.hAdd,HDiv.hDivProof uses:
Eq.mpr,List.cons,HMod.hMod,id,congrArg,List,Nat.digits_def', ZerosOnesAndTwos.two_le_ten,List.length.eq_2,add_comm16 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_one_divline 119 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,HDiv.hDiv, ZerosOnesAndTwos.prepend_oneProof uses:
Eq.mpr,HAdd.hAdd,HPow.hPow,List.length,Nat.digits,id,congrArg,ZerosOnesAndTwos.prepend_one.eq_1,Nat.casesAuxOn,False.elim,Nat.lt_asymm,Eq.symm,Nat.succ, ZerosOnesAndTwos.digits_len',Nat.succ_pos,HMul.hMul,pow_add,pow_one,add_comm,Nat.add_mul_div_leftand 1 more23 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_one_modline 129 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,HMod.hMod, ZerosOnesAndTwos.prepend_oneProof uses:
Eq.mpr,HAdd.hAdd,HPow.hPow,List.length,Nat.digits,id,congrArg,ZerosOnesAndTwos.prepend_one.eq_1,Nat.log,Nat.length_digits, ZerosOnesAndTwos.two_le_ten,ne_of_gt16 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_one_eq_appendline 134 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List,Nat.digits,OfNat.ofNat, ZerosOnesAndTwos.prepend_one,HAppend.hAppend,List.cons,List.nilProof uses:
Nat.strong_induction_on,LT.lt,Nat.casesAuxOn,of_eq_true,Eq.trans,True,congr,congrArg,HMod.hMod,HDiv.hDiv,HAdd.hAdd,HPow.hPow,List.length,congrFun',Nat.digits_zero,pow_zero,add_zero,Nat.digits_of_two_le_of_pos,LE.le,eq_true_of_decideand 17 more44 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_one_all_one_or_twoline 147 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, ZerosOnesAndTwos.all_one_or_two,Nat.digits,OfNat.ofNat, ZerosOnesAndTwos.prepend_oneProof uses:
Eq.mpr,HAppend.hAppend,List,List.cons,List.nil,id,Eq,congrArg, ZerosOnesAndTwos.prepend_one_eq_append,Membership.mem,Or,ZerosOnesAndTwos.all_one_or_two.eq_1,Eq.mp,propext,List.mem_append,of_eq_true,Eq.trans,True,False,congrand 4 more11 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- def
ZerosOnesAndTwos.prepend_twoline 158 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
HAdd.hAdd,HMul.hMul,OfNat.ofNat,HPow.hPow,List.length,Nat.digits9 instances, coercions and auxiliary constants left out.
- lemma
ZerosOnesAndTwos.prepend_two_posline 160 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat, ZerosOnesAndTwos.prepend_twoProof uses:
of_eq_true,HAdd.hAdd,HMul.hMul,HPow.hPow,List.length,Nat.digits,Eq.trans,Or,True,congrFun',congrArg,Mathlib.Meta.NormNum.isNat_lt_true,Mathlib.Meta.NormNum.isNat_ofNat,Nat.cast_zero,Eq.refl,Mathlib.Meta.NormNum.instAtLeastTwo,Bool,Bool.false,eq_true,True.introand 1 more45 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_two_divline 162 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,HDiv.hDiv, ZerosOnesAndTwos.prepend_twoProof uses:
Eq.mpr,HAdd.hAdd,HMul.hMul,HPow.hPow,List.length,Nat.digits,id,congrArg,ZerosOnesAndTwos.prepend_two.eq_1,Nat.casesAuxOn,False,Nat.lt_asymm,Eq.refl,Eq.symm,Nat.succ, ZerosOnesAndTwos.digits_len',Nat.succ_pos19 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_two_modline 170 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,HMod.hMod, ZerosOnesAndTwos.prepend_twoProof uses:
Eq.mpr,HAdd.hAdd,HMul.hMul,HPow.hPow,List.length,Nat.digits,id,congrArg,ZerosOnesAndTwos.prepend_two.eq_1,Nat.log,Nat.length_digits, ZerosOnesAndTwos.two_le_ten,ne_of_gt18 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_two_eq_appendline 175 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,List,Nat.digits,OfNat.ofNat, ZerosOnesAndTwos.prepend_two,HAppend.hAppend,List.cons,List.nilProof uses:
Nat.strong_induction_on,LT.lt,Nat.casesAuxOn,of_eq_true,Eq.trans,True,congr,congrArg,HMod.hMod,HDiv.hDiv,HAdd.hAdd,HMul.hMul,HPow.hPow,List.length,congrFun',Nat.digits_zero,pow_zero,mul_one,add_zero,Nat.digits_of_two_le_of_posand 25 more33 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.prepend_two_all_one_or_twoline 188 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, ZerosOnesAndTwos.all_one_or_two,Nat.digits,OfNat.ofNat, ZerosOnesAndTwos.prepend_twoProof uses:
Eq.mpr,HAppend.hAppend,List,List.cons,List.nil,id,Eq,congrArg, ZerosOnesAndTwos.prepend_two_eq_append,Membership.mem,Or,ZerosOnesAndTwos.all_one_or_two.eq_1,Eq.mp,propext,List.mem_append,Or.inr,List.mem_singleton6 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.factor_ten_powline 199 sourcestandard axioms: propext what this means
Statement uses:
Nat,Eq,HPow.hPow,OfNat.ofNat,HMul.hMulProof uses:
Nat.recAux,of_eq_true,Eq.trans,True,congr,congrArg,pow_zero,mul_one,eq_self,Eq.mpr,HAdd.hAdd,id,pow_succ,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,Mathlib.Tactic.Ring.Common.mul_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refland 17 more35 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.even_5_pow_plus_oneline 204 sourcestandard axioms: propext what this means
Statement uses:
Nat,Dvd.dvd,OfNat.ofNat,HAdd.hAdd,HPow.hPowProof uses:
Nat.dvd_of_mod_eq_zero,Eq.mpr,Eq,HMod.hMod,id,congrArg,Nat.add_mod,Nat.pow_mod,of_eq_true,Eq.trans,True,congrFun',congr,Mathlib.Meta.NormNum.IsNat.to_eq,Mathlib.Meta.NormNum.isNat_natMod,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,one_pow,Nat.mod_succ,Nat.mod_selfand 3 more24 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
ZerosOnesAndTwos.ones_and_twos_auxline 209 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Exists,PNat,And,Eq,List.length,Nat.digits,OfNat.ofNat,HMul.hMul,HPow.hPow,Nat.succ, ZerosOnesAndTwos.all_one_or_twoProof uses:
Nat.recAux,Exists.intro,of_eq_true,Eq.trans,True,congr,congrArg,List.cons,List.nil,List,HMod.hMod,HDiv.hDiv,congrFun',Mathlib.Meta.NormNum.IsNat.to_eq,Mathlib.Meta.NormNum.isNat_pow,Eq.refl,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Meta.NormNum.isNat_natSucc,Mathlib.Meta.NormNum.natPow_one,mul_oneand 92 more75 instances, coercions and auxiliary constants left out.
Tactic trace: 62 steps
Open to load the checked before-and-after goal states.
- problem
ZerosOnesAndTwos.ones_and_twosline 276 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Exists,PNat,Membership.mem,List,Nat.digits,OfNat.ofNat,HMul.hMul,HPow.hPow,Or,EqProof uses:
Nat.casesAuxOn,Exists.intro,of_eq_true,Eq.trans,True,forall_congr,implies_congr,List.nil,List.cons,congrFun',congrArg,HMod.hMod,HDiv.hDiv,Mathlib.Meta.NormNum.IsNat.to_eq,Mathlib.Meta.NormNum.isNat_pow,Eq.refl,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Meta.NormNum.natPow_zero,mul_one,Nat.digits_of_two_le_of_posand 24 more39 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.