{"text": "/-\nCopyright (c) 2020 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Eric Wieser\n\n! This file was ported from Lean 3 source module algebra.char_p.quotient\n! leanprover-community/mathlib commit 85e3c05a94b27c84dc6f234cf88326d5e0096ec3\n! Please do not edit these lines, except to modify the commit id\n! if you have ported upstream changes.\n-/\nimport Mathbin.Algebra.CharP.Basic\nimport Mathbin.RingTheory.Ideal.Quotient\n\n/-!\n# Characteristic of quotients rings\n-/\n\n\nuniverse u v\n\nnamespace CharP\n\n/- warning: char_p.quotient -> CharP.quotient is a dubious translation:\nlean 3 declaration is\n  forall (R : Type.{u1}) [_inst_1 : CommRing.{u1} R] (p : Nat) [hp1 : Fact (Nat.Prime p)], (Membership.Mem.{u1, u1} R (Set.{u1} R) (Set.hasMem.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p) (nonunits.{u1} R (Ring.toMonoid.{u1} R (CommRing.toRing.{u1} R _inst_1)))) -> (CharP.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.hasSingleton.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p)))) (AddGroupWithOne.toAddMonoidWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.hasSingleton.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p)))) (AddCommGroupWithOne.toAddGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.hasSingleton.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p)))) (Ring.toAddCommGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.hasSingleton.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p)))) (CommRing.toRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.hasSingleton.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p)))) (Ideal.Quotient.commRing.{u1} R _inst_1 (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.hasSingleton.{u1} R) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) p)))))))) p)\nbut is expected to have type\n  forall (R : Type.{u1}) [_inst_1 : CommRing.{u1} R] (p : Nat) [hp1 : Fact (Nat.Prime p)], (Membership.mem.{u1, u1} R (Set.{u1} R) (Set.instMembershipSet.{u1} R) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) p) (nonunits.{u1} R (MonoidWithZero.toMonoid.{u1} R (Semiring.toMonoidWithZero.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)))))) -> (CharP.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.instSingletonSet.{u1} R) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) p)))) (AddGroupWithOne.toAddMonoidWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.instSingletonSet.{u1} R) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) p)))) (Ring.toAddGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.instSingletonSet.{u1} R) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) p)))) (CommRing.toRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.instSingletonSet.{u1} R) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) p)))) (Ideal.Quotient.commRing.{u1} R _inst_1 (Ideal.span.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Singleton.singleton.{u1, u1} R (Set.{u1} R) (Set.instSingletonSet.{u1} R) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) p))))))) p)\nCase conversion may be inaccurate. Consider using '#align char_p.quotient CharP.quotient\u2093'. -/\ntheorem quotient (R : Type u) [CommRing R] (p : \u2115) [hp1 : Fact p.Prime] (hp2 : \u2191p \u2208 nonunits R) :\n    CharP (R \u29f8 (Ideal.span {p} : Ideal R)) p :=\n  have hp0 : (p : R \u29f8 (Ideal.span {p} : Ideal R)) = 0 :=\n    map_natCast (Ideal.Quotient.mk (Ideal.span {p} : Ideal R)) p \u25b8\n      Ideal.Quotient.eq_zero_iff_mem.2 (Ideal.subset_span <| Set.mem_singleton _)\n  ringChar.of_eq <|\n    Or.resolve_left ((Nat.dvd_prime hp1.1).1 <| ringChar.dvd hp0) fun h1 =>\n      hp2 <|\n        isUnit_iff_dvd_one.2 <|\n          Ideal.mem_span_singleton.1 <|\n            Ideal.Quotient.eq_zero_iff_mem.1 <|\n              @Subsingleton.elim (@CharP.subsingleton _ <| ringChar.of_eq h1) _ _\n#align char_p.quotient CharP.quotient\n\n/- warning: char_p.quotient' -> CharP.quotient' is a dubious translation:\nlean 3 declaration is\n  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (p : Nat) [_inst_2 : CharP.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))) p] (I : Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))), (forall (x : Nat), (Membership.Mem.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (SetLike.hasMem.{u1, u1} (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) R (Submodule.setLike.{u1, u1} R R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))) (Semiring.toModule.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) x) I) -> (Eq.{succ u1} R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTC\u2093.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) x) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))))))))))) -> (CharP.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (AddGroupWithOne.toAddMonoidWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (AddCommGroupWithOne.toAddGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (Ring.toAddCommGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (CommRing.toRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (Ideal.Quotient.commRing.{u1} R _inst_1 I))))) p)\nbut is expected to have type\n  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (p : Nat) [_inst_2 : CharP.{u1} R (AddGroupWithOne.toAddMonoidWithOne.{u1} R (Ring.toAddGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1))) p] (I : Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))), (forall (x : Nat), (Membership.mem.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (SetLike.instMembership.{u1, u1} (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) R (Submodule.setLike.{u1, u1} R R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))) (Semiring.toModule.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))))) (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) x) I) -> (Eq.{succ u1} R (Nat.cast.{u1} R (NonAssocRing.toNatCast.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))) x) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (CommMonoidWithZero.toZero.{u1} R (CommSemiring.toCommMonoidWithZero.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))))))) -> (CharP.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (AddGroupWithOne.toAddMonoidWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (Ring.toAddGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (CommRing.toRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (Ideal.Quotient.commRing.{u1} R _inst_1 I)))) p)\nCase conversion may be inaccurate. Consider using '#align char_p.quotient' CharP.quotient'\u2093'. -/\n/-- If an ideal does not contain any coercions of natural numbers other than zero, then its quotient\ninherits the characteristic of the underlying ring. -/\ntheorem quotient' {R : Type _} [CommRing R] (p : \u2115) [CharP R p] (I : Ideal R)\n    (h : \u2200 x : \u2115, (x : R) \u2208 I \u2192 (x : R) = 0) : CharP (R \u29f8 I) p :=\n  \u27e8fun x => by\n    rw [\u2190 cast_eq_zero_iff R p x, \u2190 map_natCast (Ideal.Quotient.mk I)]\n    refine' ideal.quotient.eq.trans (_ : \u2191x - 0 \u2208 I \u2194 _)\n    rw [sub_zero]\n    exact \u27e8h x, fun h' => h'.symm \u25b8 I.zero_mem\u27e9\u27e9\n#align char_p.quotient' CharP.quotient'\n\nend CharP\n\n/- warning: ideal.quotient.index_eq_zero -> Ideal.Quotient.index_eq_zero is a dubious translation:\nlean 3 declaration is\n  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (I : Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))), Eq.{succ u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (HasLiftT.mk.{1, succ u1} Nat (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (CoeTC\u2093.coe.{1, succ u1} Nat (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (Nat.castCoe.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (AddMonoidWithOne.toNatCast.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (AddGroupWithOne.toAddMonoidWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (AddCommGroupWithOne.toAddGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (Ring.toAddCommGroupWithOne.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (CommRing.toRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (Ideal.Quotient.commRing.{u1} R _inst_1 I))))))))) (AddSubgroup.index.{u1} R (AddCommGroup.toAddGroup.{u1} R (NonUnitalNonAssocRing.toAddCommGroup.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))))) (Submodule.toAddSubgroup.{u1, u1} R R (CommRing.toRing.{u1} R _inst_1) (NonUnitalNonAssocRing.toAddCommGroup.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1)))) (Semiring.toModule.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) I))) (OfNat.ofNat.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) 0 (OfNat.mk.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) 0 (Zero.zero.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.hasQuotient.{u1} R _inst_1) I) (Submodule.Quotient.HasQuotient.Quotient.hasZero.{u1, u1} R R (CommRing.toRing.{u1} R _inst_1) (NonUnitalNonAssocRing.toAddCommGroup.{u1} R (NonAssocRing.toNonUnitalNonAssocRing.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1)))) (Semiring.toModule.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) I))))\nbut is expected to have type\n  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (I : Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))), Eq.{succ u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (Nat.cast.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (NonAssocRing.toNatCast.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (Ring.toNonAssocRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (CommRing.toRing.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (Ideal.Quotient.commRing.{u1} R _inst_1 I)))) (AddSubgroup.index.{u1} R (AddCommGroup.toAddGroup.{u1} R (Ring.toAddCommGroup.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Submodule.toAddSubgroup.{u1, u1} R R (CommRing.toRing.{u1} R _inst_1) (Ring.toAddCommGroup.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Semiring.toModule.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) I))) (OfNat.ofNat.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) 0 (Zero.toOfNat0.{u1} (HasQuotient.Quotient.{u1, u1} R (Ideal.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) (Ideal.instHasQuotientIdealToSemiringToRing.{u1} R _inst_1) I) (Submodule.Quotient.instZeroQuotientSubmoduleToSemiringToAddCommMonoidHasQuotient.{u1, u1} R R (CommRing.toRing.{u1} R _inst_1) (Ring.toAddCommGroup.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Semiring.toModule.{u1} R (Ring.toSemiring.{u1} R (CommRing.toRing.{u1} R _inst_1))) I)))\nCase conversion may be inaccurate. Consider using '#align ideal.quotient.index_eq_zero Ideal.Quotient.index_eq_zero\u2093'. -/\ntheorem Ideal.Quotient.index_eq_zero {R : Type _} [CommRing R] (I : Ideal R) :\n    (I.toAddSubgroup.index : R \u29f8 I) = 0 :=\n  by\n  rw [AddSubgroup.index, Nat.card_eq]\n  split_ifs with hq; swap; simp\n  by_contra h\n  -- TODO: can we avoid rewriting the `I.to_add_subgroup` here?\n  letI : Fintype (R \u29f8 I) := @Fintype.ofFinite _ hq\n  have h : (Fintype.card (R \u29f8 I) : R \u29f8 I) \u2260 0 := h\n  simpa using h\n#align ideal.quotient.index_eq_zero Ideal.Quotient.index_eq_zero\n\n", "meta": {"author": "leanprover-community", "repo": "mathlib3port", "sha": "62505aa236c58c8559783b16d33e30df3daa54f4", "save_path": "github-repos/lean/leanprover-community-mathlib3port", "path": "github-repos/lean/leanprover-community-mathlib3port/mathlib3port-62505aa236c58c8559783b16d33e30df3daa54f4/Mathbin/Algebra/CharP/Quotient.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6224593312018546, "lm_q2_score": 0.3208213008246071, "lm_q1q2_score": 0.19969821234659393}}
{"text": "import mll\n\ndef sequent := list Form\n\ninstance : has_append sequent := \u27e8list.append\u27e9\ninstance : has_mem Form sequent := \u27e8list.mem\u27e9\n\ninductive proof : sequent \u2192 Type\n| ax (A)                   : proof [~A, A]\n| cut (A) {\u0393 \u0393' \u0394 \u0394'}      : proof (\u0393 ++ [A] ++ \u0393') \u2192 proof (\u0394 ++ [~A] ++ \u0394') \u2192 proof (\u0393++\u0393'++\u0394++\u0394')\n| tensor {A B} {\u0393 \u0393' \u0394 \u0394'} : proof (\u0393 ++ [A] ++ \u0393') \u2192 proof (\u0394 ++ [B] ++ \u0394') \u2192 proof (\u0393++\u0393'++ [A \u2297 B] ++\u0394++\u0394') \n| par {A B} {\u0393 \u0393'}         : proof (\u0393 ++ [A,B] ++ \u0393') \u2192 proof (\u0393 ++ [A \u214b B] ++ \u0393')\n| ex {A B} {\u0393 \u0393'}          : proof (\u0393 ++ [A,B] ++ \u0393') \u2192 proof (\u0393 ++ [B,A] ++ \u0393')\n\ninductive proof_net : sequent \u2192 Type\n| mk {\u0393 : sequent} (ps : proof_structure) : (\u03a0 A \u2208 \u0393, { i : \u2115 // (A,i) \u2208 ps \u2227 \u2200 \u0394 \u2208 ps.links, \u00acpremise (A,i) \u0394 }) \u2192 proof_net \u0393\n\ninstance {\u0393 : sequent} : has_coe (proof_net \u0393) proof_structure := \u27e8by rintro \u27e8\u0393,ps,_\u27e9; exact ps\u27e9\n\ndef relabel_Link (f : \u2115 \u2192 \u2115) : Link \u2192 Link\n| (Link.ax pi ni A) := Link.ax (f pi) (f ni) A\n| (Link.cut pi ni A) := Link.cut (f pi) (f ni) A\n| (Link.tensor ai bi ci A B) := Link.tensor (f ai) (f bi) (f ci) A B\n| (Link.par ai bi ci A B) := Link.par (f ai) (f bi) (f ci) A B\n\nlemma relabel_valid {l f} (hf : function.injective f): valid_link l \u2192 valid_link (relabel_Link f l) :=\nbegin\n  cases l,\n  case Link.ax : pi ni A { rintro \u27e8_\u27e9, constructor, },\n  case Link.cut : pi ni A { rintro \u27e8_\u27e9, constructor, },\n  case Link.tensor : ai bi ci A B {\n    rintro \u27e8_\u27e9, constructor, rintro e, injection e with e\u2081 e\u2082, apply \u1fb0_\u1fb0, congr, assumption, exact hf e\u2082, },\n  case Link.par : ai bi ci A B {\n    rintro \u27e8_\u27e9, constructor, rintro e, injection e with e\u2081 e\u2082, apply \u1fb0_\u1fb0, congr, assumption, exact hf e\u2082, },\nend\n\nlemma relabel_injective {f} (hf : function.injective f) : function.injective (relabel_Link f) :=\nby rintros \u27e8l\u2081\u27e9 \u27e8l\u2082\u27e9; intros h; injection h; congr; repeat {refl <|> assumption <|> apply hf}\n\nlemma relabel_premise {l f D i } (hf : function.injective f) : premise (D,i) (relabel_Link f l) \u2192 \u2203 j, f j = i \u2227 premise (D,j) l :=\nbegin\n  cases l,\n  case Link.ax : pi ni A { rintro \u27e8_\u27e9 },\n  case Link.cut : pi ni A { rintro \u27e8_\u27e9, exact \u27e8pi,rfl,premise.cut_pos\u27e9, exact \u27e8ni,rfl,premise.cut_neg\u27e9, },\n  case Link.tensor : ai bi ci A B {\n    rintro \u27e8_\u27e9, exact \u27e8ai,rfl,premise.tensor_left\u27e9, exact \u27e8bi,rfl,premise.tensor_right\u27e9, },\n  case Link.par : ai bi ci A B {\n    rintro \u27e8_\u27e9, exact \u27e8ai,rfl,premise.par_left\u27e9, exact \u27e8bi,rfl,premise.par_right\u27e9, },\nend\n\nlemma relabel_conclusion {l f D i } (hf : function.injective f) : conclusion (D,i) (relabel_Link f l) \u2192 \u2203j, f j = i \u2227 conclusion (D,j) l :=\nbegin\n  cases l,\n  case Link.ax : pi ni A {\n    rintro \u27e8_\u27e9, exact \u27e8pi,rfl,conclusion.ax_pos\u27e9, exact \u27e8ni,rfl,conclusion.ax_neg\u27e9, },\n  case Link.cut : pi ni A { rintro \u27e8_\u27e9 },\n  case Link.tensor : ai bi ci A B { rintro \u27e8_\u27e9, exact \u27e8ci,rfl,conclusion.tensor\u27e9 },\n  case Link.par : ai bi ci A B { rintro \u27e8_\u27e9, exact \u27e8ci,rfl,conclusion.par\u27e9 },\nend\n\nlemma relabel_mem {\u0394 f A i} (hf : function.injective f) : (A,i) \u2208 (relabel_Link f \u0394) \u2192 \u2203 j, f j = i \u2227 (A,j) \u2208 \u0394 :=\nbegin\n  intro h, cases h with h h,\n  rcases (relabel_premise hf h) with \u27e8j, \u27e8fji,p\u0394\u27e9\u27e9, refine \u27e8j,fji,mem_Link.prem p\u0394\u27e9,\n  rcases (relabel_conclusion hf h) with \u27e8j, \u27e8fji,p\u0394\u27e9\u27e9, refine \u27e8j,fji,mem_Link.con p\u0394\u27e9,\nend\n\n\ndef proof_structure.relabel (ps : proof_structure) (f : \u2115 \u2192 \u2115) (hf : function.injective f) : proof_structure :=\n\u27e8set.image (relabel_Link f) ps.links,\n  by rintros l \u27e8l', \u27e8hl',\u27e8_\u27e9\u27e9\u27e9; exact relabel_valid hf (ps.valid l' hl'),\nbegin\n  rintros \u27e8A,i\u27e9 _ _ \u27e8k\u2081, \u27e8hk\u2081,\u27e8_\u27e9\u27e9\u27e9 \u27e8k\u2082, \u27e8hk\u2082,\u27e8_\u27e9\u27e9\u27e9,\n  intros pk\u2081 pk\u2082,\n  congr, \n  rcases relabel_premise hf pk\u2081 with \u27e8j,hfj,u\u2081\u27e9,\n  rcases relabel_premise hf pk\u2082 with \u27e8j',hfj',u\u2082\u27e9,\n  have : j' = j, rw \u2190hfj at hfj', exact hf hfj', rw this at u\u2082,  \n  exact ps.prem_unique (A,j) _ _ hk\u2081 hk\u2082 u\u2081 u\u2082\nend\n,\nbegin\n  rintros \u27e8A,i\u27e9 _ _ \u27e8k\u2081, \u27e8hk\u2081,\u27e8_\u27e9\u27e9\u27e9 \u27e8k\u2082, \u27e8hk\u2082,\u27e8_\u27e9\u27e9\u27e9,\n  intros pk\u2081 pk\u2082,\n  congr, \n  rcases relabel_conclusion hf pk\u2081 with \u27e8j,hfj,u\u2081\u27e9,\n  rcases relabel_conclusion hf pk\u2082 with \u27e8j',hfj',u\u2082\u27e9,\n  have : j' = j, rw \u2190hfj at hfj', exact hf hfj', rw this at u\u2082,  \n  exact ps.con_unique (A,j) _ _ hk\u2081 hk\u2082 u\u2081 u\u2082\nend\u27e9\n\ndef separators {\u03b1 \u03b2} (f g : \u03b1 \u2192 \u03b2) : Prop := \u2200 x y, f x \u2260 g y\n\nlemma sep_even_odd : separators (\u03bb x, 2 * x) (\u03bb x, 2 * x + 1) :=\n  \u03bb x y, nat.two_mul_ne_two_mul_add_one\n\ndef disjoint_of_separators {ps\u2081 ps\u2082 : proof_structure} {f g} (hf hg) : separators f g \u2192 disjoint { Ai | Ai \u2208 (ps\u2081.relabel f hf) } { Ai | Ai \u2208 (ps\u2082.relabel g hg) } :=\nbegin\n  rintros s \u27e8A,i\u27e9 \u27e8\u27e8\u0394\u2081,\u27e8\u0394\u2081', h\u0394\u2081', \u27e8_\u27e9\u27e9,h\u2081\u27e9,\u27e8\u0394\u2082,\u27e8\u0394\u2082', h\u0394\u2082', \u27e8_\u27e9\u27e9,h\u2082\u27e9\u27e9,\n  rcases (relabel_mem hf h\u2081) with \u27e8j\u2081,hfg,h\u2081\u27e9,\n  rcases (relabel_mem hg h\u2082) with \u27e8j\u2082,\u27e8_\u27e9,h\u2082\u27e9,\n  exact s j\u2081 j\u2082 hfg,\nend\n\ndef proof_net.disjoint {\u0393 \u0394} : proof_net \u0393 \u2192 proof_net \u0394 \u2192 Prop :=\n  by rintro \u27e8_,ps\u2081,_\u27e9 \u27e8_,ps\u2082,_\u27e9; exact disjoint {Ai | Ai \u2208 ps\u2081} {Ai | Ai \u2208 ps\u2082}\n\ndef net_links_ax (pi ni A) : set Link :=\n  {Link.ax pi ni A}\n\ndef net_links_tensor (ai bi ci A B) (sA sB : set Link) : set Link :=\n  {Link.tensor ai bi ci A B} \u222a sA \u222a sB\n\ndef net_links_par (ai bi ci A B) (s : set Link) : set Link :=\n  {Link.par ai bi ci A B} \u222a s\n\ndef net_links_cut (pi ni A) (sA snA : set Link) : set Link :=\n  {Link.cut pi ni A} \u222a sA \u222a snA\n\ndef proof_net_ax (A) : proof_net [~A,A] :=\n\u27e8\n  \u27e8{Link.ax 0 0 A},\n  by rintro l \u27e8h\u27e9; exact valid_link.ax,\n  by rintro Ai \u0394\u2081 \u0394\u2082 \u27e8_\u27e9 \u27e8_\u27e9; finish,\n  by rintro Ai \u0394\u2081 \u0394\u2082 \u27e8_\u27e9 \u27e8_\u27e9; finish \u27e9\n,\n  begin\n    rintro B Bmem,\n    refine \u27e80,_,_\u27e9, rcases Bmem with \u27e8_,_\u27e9, use Link.ax 0 0 A, simp, exact mem_Link.con conclusion.ax_neg,\n      \n      -- exact \u27e80,Link.ax 0 0 A,by simp,conclusion.ax_neg,_\u27e9, rintro \u0394' \u27e8_\u27e9 \u27e8_\u27e9,\n    rcases H with \u27e8\u27e8_\u27e9\u27e9,\n      exact \u27e80,Link.ax 0 0 A,by simp,conclusion.ax_pos,_\u27e9, rintro \u0394' \u27e8_\u27e9 \u27e8_\u27e9,\n    cases H,\n  end\n\u27e9\n\ndef proof_net_tensor {\u0393 \u0393' A B \u0394 \u0394'} (pnA : proof_net (\u0393 ++ [A] ++ \u0393')) (pnB : proof_net (\u0394 ++ [B] ++ \u0394')) : pnA.disjoint pnB \u2192 proof_net (\u0393 ++ \u0393' ++ [A \u2297 B] ++ \u0394 ++ \u0394') :=\nbegin\n  rcases pnA with \u27e8_,psA, hA\u27e9,\n  rcases pnB with \u27e8_,psB, hB\u27e9,\n  intro dAB,\n  specialize hA A (by refine list.mem_append_left _ (list.mem_append_right _ (list.mem_cons_self A list.nil))),\n  specialize hB B,\n  cases hA with ai \u0394A hA,\n  \nend", "meta": {"author": "blinkybool", "repo": "proofnet", "sha": "4c94599d3cb45530b0e082ef3991900f9dd023eb", "save_path": "github-repos/lean/blinkybool-proofnet", "path": "github-repos/lean/blinkybool-proofnet/proofnet-4c94599d3cb45530b0e082ef3991900f9dd023eb/src/sequent.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5389832354982645, "lm_q2_score": 0.3702253856469203, "lm_q1q2_score": 0.19954527621956986}}
{"text": "import mcl\nimport parlang.lemmas_memory\n\nopen mcl\n\nnamespace coarsening\n\ndef sigc : signature_core\n| \"tid\" := { scope := scope.tlocal, type := \u27e81, type.int\u27e9 }\n| \"i\" := { scope := scope.tlocal, type := \u27e81, type.int\u27e9 }\n| \"j\" := { scope := scope.tlocal, type := \u27e81, type.int\u27e9 }\n| _ := { scope := scope.shared, type := \u27e81, type.float\u27e9 }\n\ndef sig : signature := \u27e8sigc, \u27e8rfl, rfl, rfl\u27e9\u27e9\n\nopen mcl.expression\nopen parlang\n\n/-- Copies the *j*-th element from a to b -/\ndef copy : mclk sig := mclk.shared_assign \"b\" v[@tlocal_var sig _ _ \"j\" (\u03bb_, 0) rfl rfl rfl] rfl rfl (@shared_var sig _ _ \"a\" (v[@tlocal_var sig _ _ \"j\" (\u03bb_, 0) rfl rfl rfl]).nth rfl rfl rfl)\n\ndef e\u2081 := 10\ndef f\u2081 := 10\ndef p\u2081 : mclp sig := mclp.intro (\u03bb m, e\u2081) (\n    mclk.for \"i\" rfl rfl (literal_int 0 rfl) (@tlocal_var sig _ _ \"i\" (\u03bb_, 0) rfl rfl rfl < literal_int f\u2081 rfl) (mclk.tlocal_assign \"i\" v[0] rfl rfl $ tlocal_var \"i\" (\u03bb_, 0) rfl rfl rfl + literal_int 1 rfl) (\n        mclk.tlocal_assign \"j\" v[literal_int 0 rfl] rfl rfl (@tlocal_var sig _ _ \"tid\" (\u03bb_, 0) rfl rfl rfl * literal_int e\u2081 rfl + @tlocal_var sig _ _ \"i\" (\u03bb_, 0) rfl rfl rfl) ;;\n        copy\n    )\n)\n\ndef e\u2082 := 5\ndef f\u2082 := 20\ndef p\u2082 : mclp sig := mclp.intro (\u03bb m, e\u2082) (\n    mclk.for \"i\" rfl rfl (literal_int 0 rfl) (@tlocal_var sig _ _ \"i\" (\u03bb_, 0) rfl rfl rfl < literal_int f\u2082 rfl) (mclk.tlocal_assign \"i\" v[0] rfl rfl $ @tlocal_var sig _ _ \"i\" (\u03bb_, 0) rfl rfl rfl + literal_int 1 rfl) (\n        mclk.tlocal_assign \"j\" v[literal_int 0 rfl] rfl rfl (@tlocal_var sig _ _ \"tid\" (\u03bb_, 0) rfl rfl rfl * literal_int e\u2082 rfl + @tlocal_var sig _ _ \"i\" (\u03bb_, 0) rfl rfl rfl) ;;\n        copy\n    )\n)\n\ndef read_tid {sig : signature} := @tlocal_var sig _ _ \"tid\" (\u03bb_, 0) sig.property.left sig.property.right.left sig.property.right.right\n\ndef coarsen_kernel_assertion {sig : signature}\n(P : memory (parlang_mcl_shared sig) \u2192 memory (parlang_mcl_shared sig) \u2192 Prop)\n(f\u2081 : memory (parlang_mcl_shared sig) \u2192 \u2115) (f\u2082 : memory (parlang_mcl_shared sig) \u2192 \u2115) \n(m\u2081 : memory (parlang_mcl_shared sig)) (m\u2082 : memory (parlang_mcl_shared sig)) \n(n\u2081) (s\u2081 : state n\u2081 (memory $ parlang_mcl_tlocal sig) $ parlang_mcl_shared sig) \n(ac\u2081 : vector bool n\u2081) (n\u2082) (s\u2082 : state n\u2082 (memory $ parlang_mcl_tlocal sig) $ parlang_mcl_shared sig) \n(ac\u2082 : vector bool n\u2082) := \ns\u2081.syncable m\u2081 \u2227 s\u2082.syncable m\u2082 \u2227 n\u2081 = f\u2081 m\u2081 \u2227 n\u2082 = f\u2082 m\u2082 \u2227\n(\u2200 i : fin n\u2081, s\u2081.threads.nth i = { tlocal := mcl_init i, shared := m\u2081, stores := \u2205, loads := \u2205 }) \u2227 \n(\u2200 i : fin n\u2082, s\u2082.threads.nth i = { tlocal := mcl_init i, shared := m\u2082, stores := \u2205, loads := \u2205 }) \u2227\nP m\u2081 m\u2082 \u2227 all_threads_active ac\u2081 \u2227 all_threads_active ac\u2082\n\n/-- only works with constant number of threads -/\ntheorem coarsen (e\u2081 e\u2082) \n(sig) (k\u2081 : mclk sig) (k\u2082 : mclk sig) (h\u2081 : type_of (sig.val \"k\") = type.int) (h\u2082 : ((sig.val \"k\").type).dim = 1) (h\u2083) (Q : parlang.memory (parlang_mcl_shared sig) \u2192 parlang.memory (parlang_mcl_shared sig) \u2192 Prop)\n(h : rhl.mclk_rel (\u03bbn\u2081 (s\u2081 : state n\u2081 (memory (parlang_mcl_tlocal sig)) (parlang_mcl_shared sig)) ac\u2081 n\u2082 s\u2082 ac\u2082, \u2203 m\u2081 m\u2082, \nparlang.initial_kernel_assertion mcl_init mcl_init eq (\u03bbm, e\u2081) (\u03bbm, e\u2082) m\u2081 m\u2082 n\u2081 \n(s\u2081.map_active_threads ac\u2081 $ \u03bbts, ts.compute $ \u03bbm, m.update \u27e8\"k\", by rw h\u2082; exact v[0]\u27e9 (eq.mpr (show _ = \u2115, from begin unfold parlang_mcl_tlocal, simp, unfold signature.lean_type_of lean_type_of, rw h\u2081, end) 0)) ac\u2081 n\u2082 \n(s\u2082.map_active_threads ac\u2082 $ \u03bbts, ts.compute $ \u03bbm, m.update \u27e8\"k\", by rw h\u2082; exact v[0]\u27e9 (eq.mpr (show _ = \u2115, from begin unfold parlang_mcl_tlocal, simp, unfold signature.lean_type_of lean_type_of, rw h\u2081, end) 0)) ac\u2082)\n    k\u2081 k\u2082 \n  (\u03bbn\u2081 s\u2081 ac\u2081 n\u2082 s\u2082 ac\u2082, \u2203 m\u2081 m\u2082, s\u2081.syncable m\u2081 \u2227 s\u2082.syncable m\u2082 \u2227 Q m\u2081 m\u2082)) :\nrhl.mclp_rel eq \n(mclp.intro (\u03bb m, e\u2081) (\n    @mclk.tlocal_assign sig type.int _ \"k\" v[literal_int 0 rfl] h\u2081 h\u2082 read_tid ;;\n    k\u2081\n))\n(mclp.intro (\u03bb m, e\u2082) (\n    mclk.for \"k\" h\u2081 h\u2082 read_tid ((@tlocal_var sig _ _ \"k\" (\u03bb_, 0) h\u2081 h\u2082 h\u2083) < literal_int e\u2082 rfl) (mclk.tlocal_assign \"k\" v[0] h\u2081 h\u2082 $ tlocal_var \"k\" (\u03bb_, 0) h\u2081 h\u2082 h\u2083 + literal_int e\u2082 rfl)\n        k\u2082\n)) Q := begin\n    apply rhl.rel_mclk_to_mclp,\n    intros n\u2081 n\u2082 s\u2081 s\u2081' s\u2082 ac\u2081 ac\u2082 hp he\u2081,\n    cases hp with m\u2081 hp,\n    cases hp with m\u2082 hp,\n    specialize h n\u2081 n\u2082 (state.map_active_threads ac\u2081 (thread_state.compute $ \u03bbm, m.update \u27e8\"k\", by rw h\u2082; exact v[0]\u27e9 (eq.mpr _ $ m.get \u27e8\"tid\", begin rw sig.property.right.left, exact v[0], end\u27e9)) s\u2081) s\u2081' s\u2082 ac\u2081 ac\u2082,\n    swap 2, {\n        unfold parlang_mcl_tlocal signature.lean_type_of lean_type_of,\n        rw h\u2081,\n        rw sig.property.left,\n    },\n    specialize h _,\n    swap 2,\n    {\n        use m\u2081,\n        use m\u2082,\n        unfold initial_kernel_assertion,\n        unfold initial_kernel_assertion at hp,\n        delta thread_state.compute,\n        rw \u2190 state.syncable_tlocal,\n        rw \u2190 state.syncable_tlocal,\n        rw \u2190 state.syncable_tlocal,\n        split, {\n            exact hp.left,\n        },\n        split, {\n            exact hp.right.left,\n        },\n        split, {\n            exact hp.right.right.left,\n        },\n        split, {\n            exact hp.right.right.right.left,\n        },\n        split, {\n            intros i,\n            have : vector.nth ac\u2081 i = tt := sorry,\n            simp only [state.map_active_threads_nth_ac this],\n            rw memory.update_update_eq,\n            rw hp.right.right.right.right.left i,\n            simp [mcl_init],\n            funext i,\n            cases i,\n            by_cases a : i_fst = \"k\",\n            {\n                subst a,\n                sorry,\n            },\n            sorry,\n        },\n        sorry,\n    },\n    sorry,\n    sorry,\nend\n\nexample : rhl.mclp_rel eq p\u2081 p\u2082 eq := begin \n    sorry,\n    -- apply main transformation rule\nend\n\nend coarsening", "meta": {"author": "fischerman", "repo": "GPU-transformation-verifier", "sha": "75a5016f05382738ff93ce5859c4cfa47ccb63c1", "save_path": "github-repos/lean/fischerman-GPU-transformation-verifier", "path": "github-repos/lean/fischerman-GPU-transformation-verifier/GPU-transformation-verifier-75a5016f05382738ff93ce5859c4cfa47ccb63c1/src/use_cases/coarsening/defs.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5117166047041654, "lm_q2_score": 0.3886180267058489, "lm_q1q2_score": 0.19886229715274964}}
{"text": "import Preloaded Solution\n\ntheorem task_1 : TASK_1 := immediate\n#print axioms task_1\n\ntheorem task_2 : TASK_2 := plus_comm\n#print axioms task_2\n\ntheorem task_3 : TASK_3 := excluded_middle\n#print axioms task_3\n\ntheorem task_4 : TASK_4 := one_plus_one_is_three\n#print axioms task_4", "meta": {"author": "DonaldKellett", "repo": "CW-Lean3-Examples", "sha": "9dd81b7c9327b029c859f37534232ab556f69699", "save_path": "github-repos/lean/DonaldKellett-CW-Lean3-Examples", "path": "github-repos/lean/DonaldKellett-CW-Lean3-Examples/CW-Lean3-Examples-9dd81b7c9327b029c859f37534232ab556f69699/kata1/SolutionTest.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.600188359260205, "lm_q2_score": 0.33111974622959367, "lm_q1q2_score": 0.19873421720819526}}
{"text": "import analysis.inner_product_space.pi_L2\nimport topology.paracompact\n\n\n--OUTPUT 1\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (A : set (euclidean_space \u211d (fin n))) (hA : is_open A) (hAcover : A \u2286 \u22c3\u2080 A),\n  have h1 : \u2200 (x : \u211d^(fin n)), \u2203 (m : \u2115), \u2200 (y : \u211d^(fin n)), (\u2225 x \u2225 \u2264 m) \u2192 (\u2225 y \u2225 \u2264 m + 1) \u2192 (y \u2208 A), from \n    assume x : \u211d^(fin n),\n    have h1_1 : \u2203 (m : \u2115), \u2200 (y : \u211d^(fin n)), (\u2225 x \u2225 \u2264 m) \u2192 (\u2225 y \u2225 \u2264 m + 1) \u2192 (y \u2208 A), from\n      begin\n        have h1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2192 (\u2225 x \u2225 \u2264 m + 1), from\n          begin\n            have h1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m), from\n              begin\n                have h1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1), from\n                  begin\n                    have h1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2), from\n                      begin\n                        have h1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3), from\n                          begin\n                            have h1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4), from\n                              begin\n                                have h1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5), from\n                                  begin\n                                    have h1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6), from\n                                      begin\n                                        have h1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6) \u2227 (\u2225 x \u2225 \u2264 m + 7), from\n                                          begin\n                                            have h1_1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6) \u2227 (\u2225 x \u2225 \u2264 m + 7) \u2227 (\u2225 x \u2225 \u2264 m + 8), from\n                                              begin\n                                                have h1_1_1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6) \u2227 (\u2225 x \u2225 \u2264 m + 7) \u2227 (\u2225 x \u2225 \u2264 m + 8) \u2227 (\u2225 x \u2225 \u2264 m + 9), from\n                                                begin\n                                                  have h1_1_1_1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6) \u2227 (\u2225 x \u2225 \u2264 m + 7) \u2227 (\u2225 x \u2225 \u2264 m + 8) \u2227 (\u2225 x \u2225 \u2264 m + 9) \u2227 (\u2225 x \u2225 \u2264 m + 10), from\n                                                    begin\n                                                      have h1_1_1_1_1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6) \u2227 (\u2225 x \u2225 \u2264 m + 7) \u2227 (\u2225 x \u2225 \u2264 m + 8) \u2227 (\u2225 x \u2225 \u2264 m + 9) \u2227 (\u2225 x \u2225 \u2264 m + 10) \u2227 (\u2225 x \u2225 \u2264 m + 11), from\n                                                        begin\n                                                          have h1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x \u2225 \u2264 m + 5) \u2227 (\u2225 x \u2225 \u2264 m + 6) \u2227 (\u2225 x \u2225 \u2264 m + 7) \u2227 (\u2225 x \u2225 \u2264 m + 8) \u2227 (\u2225 x \u2225 \u2264 m + 9) \u2227 (\u2225 x \u2225 \u2264 m + 10) \u2227 (\u2225 x \u2225 \u2264 m + 11) \u2227 (\u2225 x \u2225 \u2264 m + 12), from\n                                                            begin\n                                                              have h1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1 : \u2203 (m : \u2115), (\u2225 x \u2225 \u2264 m) \u2227 (\u2225 x \u2225 \u2264 m + 1) \u2227 (\u2225 x \u2225 \u2264 m + 2) \u2227 (\u2225 x \u2225 \u2264 m + 3) \u2227 (\u2225 x \u2225 \u2264 m + 4) \u2227 (\u2225 x\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume A : set (euclidean_space \u211d (fin n)),\n  assume hA : A.is_open,\n  assume hA2 : A.is_cover,\n  have hA3 : \u2200 a : euclidean_space \u211d (fin n), \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n    assume a : euclidean_space \u211d (fin n),\n    have hA4 : A \u2260 \u2205, from by {\n      assume hA5 : A = \u2205,\n      have hA6 : a \u2209 A, from by {\n        assume hA7 : a \u2208 A,\n        have hA8 : A = \u2205, from by {\n          assume hA9 : A \u2260 \u2205,\n          have hA10 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n            assume hA11 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n            have hA12 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n              assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA13 : a \u2208 U),\n              have hA14 : U \u2260 \u2205, from by {\n                assume hA15 : U = \u2205,\n                have hA16 : a \u2209 U, from by {\n                  assume hA17 : a \u2208 U,\n                  have hA18 : U = \u2205, from by {\n                    assume hA19 : U \u2260 \u2205,\n                    have hA20 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n                      assume hA21 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n                      have hA22 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n                        assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA23 : a \u2208 U),\n                        have hA24 : U \u2260 \u2205, from by {\n                          assume hA25 : U = \u2205,\n                          have hA26 : a \u2209 U, from by {\n                            assume hA27 : a \u2208 U,\n                            have hA28 : U = \u2205, from by {\n                              assume hA29 : U \u2260 \u2205,\n                              have hA30 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n                                assume hA31 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n                                have hA32 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n                                  assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA33 : a \u2208 U),\n                                  have hA34 : U \u2260 \u2205, from by {\n                                    assume hA35 : U = \u2205,\n                                    have hA36 : a \u2209 U, from by {\n                                      assume hA37 : a \u2208 U,\n                                      have hA38 : U = \u2205, from by {\n                                        assume hA39 : U \u2260 \u2205,\n                                        have hA40 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n                                          assume hA41 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n                                          have hA42 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n                                            assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA43 : a \u2208 U),\n                                            have hA44 : U \u2260 \u2205, from by {\n                                              assume hA45 : U = \u2205,\n                                              have hA46 : a \u2209 U, from by {\n                                                assume hA47 : a \u2208 U,\n                                                have hA48 : U = \u2205, from by {\n                                                  assume hA49 : U \u2260 \u2205,\n                                                  have hA50 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n                                                    assume hA51 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n                                                    have hA52 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n                                                      assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA53 : a \u2208 U),\n                                                      have hA54 : U \u2260 \u2205, from by {\n                                                        assume hA55 : U = \u2205,\n                                                        have hA56 : a \u2209 U, from by {\n                                                          assume hA57 : a \u2208 U,\n                                                          have hA58 : U = \u2205, from by {\n                                                            assume hA59 : U \u2260 \u2205,\n                                                            have hA60 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n                                                              assume hA61 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n                                                              have hA62 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n                                                                assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA63 : a \u2208 U),\n                                                                have hA64 : U \u2260 \u2205, from by {\n                                                                  assume hA65 : U = \u2205,\n                                                                  have hA66 : a \u2209 U, from by {\n                                                                    assume hA67 : a \u2208 U,\n                                                                    have hA68 : U = \u2205, from by {\n                                                                      assume hA69 : U \u2260 \u2205,\n                                                                      have hA70 : \u2203 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U, from by {\n                                                                        assume hA71 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2209 U,\n                                                                        have hA72 : \u2200 (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A), a \u2208 U \u2192 false, from by {\n                                                                          assume (U : set (euclidean_space \u211d (fin n))) (hU : U \u2208 A) (hA73 : a\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (A : set (euclidean_space \u211d (fin n))) (hA : is_open A) (hAcover : \u22c3\u2080 A = univ),\n  have h1 : \u2200 x : euclidean_space \u211d (fin n), \u2203 m : \u2115, \u2200 y : euclidean_space \u211d (fin n), (\u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 y \u2208 z) \u2192 dist x y \u2264 m, from\n    begin\n      assume (x : euclidean_space \u211d (fin n)),\n      have h1 : \u2200 m : \u2115, \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n        begin\n          assume (m : \u2115),\n          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n            begin\n              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                begin\n                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                    begin\n                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                        begin\n                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                            begin\n                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                begin\n                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                    begin\n                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                        begin\n                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                            begin\n                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                begin\n                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                    begin\n                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                        begin\n                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                            begin\n                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                begin\n                                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                    begin\n                                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                        begin\n                                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                            begin\n                                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                begin\n                                                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                    begin\n                                                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                        begin\n                                                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                            begin\n                                                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                begin\n                                                                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                    begin\n                                                                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                        begin\n                                                                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                            begin\n                                                                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                begin\n                                                                                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                    begin\n                                                                                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                        begin\n                                                                                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                            begin\n                                                                                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                begin\n                                                                                                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                    begin\n                                                                                                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                        begin\n                                                                                                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                            begin\n                                                                                                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                                begin\n                                                                                                                                                  have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                                    begin\n                                                                                                                                                      have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                                        begin\n                                                                                                                                                          have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist x z \u2264 m, from\n                                                                                                                                                            begin\n                                                                                                                                                              have h1 : \u2203 z : euclidean_space \u211d (fin n), z \u2208 A \u2227 dist\nend --Needs more than 2000 tokens!\n\n--OUTPUT 4\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (A : set (euclidean_space \u211d (fin n))) (hA : is_open A) (hAcover : A \u2283 univ),\n  have h1 : \u2200 (m : \u2115), is_compact (set.closure (ball (0 : \u211d^n) m)), from by {\n    assume (m : \u2115),\n    have h2 : is_open (set.compl (ball (0 : \u211d^n) m)), from by {\n      rw set.compl_eq_univ_diff,\n      apply is_open_ball,\n    },\n    have h3 : is_closed (ball (0 : \u211d^n) m), from by {\n      apply is_closed_ball,\n    },\n    have h4 : is_compact (ball (0 : \u211d^n) m), from by {\n      apply is_compact_of_is_closed_of_is_open h3 h2,\n    },\n    have h5 : (set.closure (ball (0 : \u211d^n) m)) \u2286 (ball (0 : \u211d^n) m), from by {\n      apply set.closure_mono,\n      apply set.subset_univ,\n    },\n    have h6 : (set.closure (ball (0 : \u211d^n) m)) \u2286 univ, from by {\n      apply set.subset.trans h5,\n      apply set.subset_univ,\n    },\n    have h7 : (set.closure (ball (0 : \u211d^n) m)) \u2208 \ud835\udc9e (ball (0 : \u211d^n) m), from by {\n      apply set.mem_closure,\n      apply set.mem_univ,\n    },\n    have h8 : (set.closure (ball (0 : \u211d^n) m)) \u2208 \ud835\udc9e univ, from by {\n      apply set.mem_closure,\n      apply set.mem_univ,\n    },\n    show is_compact (set.closure (ball (0 : \u211d^n) m)), from by {\n      apply is_compact_of_is_closed_of_is_open h4 h2,\n    },\n  },\n  have h2 : \u2200 (m : \u2115), is_open (set.compl (set.closure (ball (0 : \u211d^n) m))), from by {\n    assume (m : \u2115),\n    have h3 : is_closed (set.closure (ball (0 : \u211d^n) m)), from by {\n      apply is_closed_closure,\n    },\n    have h4 : is_open (set.compl (ball (0 : \u211d^n) m)), from by {\n      rw set.compl_eq_univ_diff,\n      apply is_open_ball,\n    },\n    have h5 : (set.compl (set.closure (ball (0 : \u211d^n) m))) \u2286 (set.compl (ball (0 : \u211d^n) m)), from by {\n      apply set.compl_mono,\n    },\n    have h6 : (set.compl (set.closure (ball (0 : \u211d^n) m))) \u2286 univ, from by {\n      apply set.subset.trans h5,\n      apply set.subset_univ,\n    },\n    have h7 : (set.compl (set.closure (ball (0 : \u211d^n) m))) \u2208 \ud835\udc9e (set.compl (ball (0 : \u211d^n) m)), from by {\n      apply set.mem_compl,\n      apply set.mem_univ,\n    },\n    have h8 : (set.compl (set.closure (ball (0 : \u211d^n) m))) \u2208 \ud835\udc9e univ, from by {\n      apply set.mem_compl,\n      apply set.mem_univ,\n    },\n    show is_open (set.compl (set.closure (ball (0 : \u211d^n) m))), from by {\n      apply is_open_of_is_closed_of_is_open h3 h4,\n    },\n  },\n  have h3 : \u2200 (m : \u2115), is_open (set.compl (ball (0 : \u211d^n) (m - 1))), from by {\n    assume (m : \u2115),\n    rw set.compl_eq_univ_diff,\n    apply is_open_ball,\n  },\n  have h4 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))), Cm \u2286 A \u2227 Cm \u2286 (set.compl (ball (0 : \u211d^n) (m - 1))) \u2227 Cm \u2286 (set.compl (set.closure (ball (0 : \u211d^n) m))) \u2227 Cm \u2283 (set.closure (ball (0 : \u211d^n) m)), from by {\n    assume (m : \u2115),\n    have h5 : (set.closure (ball (0 : \u211d^n) m)) \u2286 univ, from by {\n      apply set.subset_univ,\n    },\n    have h6 : (set.closure (ball (0 : \u211d^n) m)) \u2208 \ud835\udc9e univ, from by {\n      apply set.mem_closure,\n      apply set.mem_univ,\n    },\n    have h7 : (set.closure (ball (0 : \u211d^n) m)) \u2208 \ud835\udc9e (set.compl (ball (0 : \u211d^n) (m - 1))), from by {\n      apply set.mem_closure,\n      apply set.mem_compl,\n      apply set.mem_univ,\n    },\n    have h8 : (set.closure (ball (0 : \u211d^n) m)) \u2208 \ud835\udc9e (set.compl (set.closure (ball (0 : \u211d^n) m))), from by {\n      apply set.mem_closure,\n      apply set.mem_compl,\n      apply set.mem_univ,\n    },\n    have h9 : (set.closure (ball (0 : \u211d^n) m)) \u2286 A, from by {\n      apply hAcover,\n    },\n    have h10 : (set.closure (ball (0 : \u211d^n) m)) \u2286 (set.compl (ball (0 : \u211d^n) (m - 1))), from by {\n      apply set.subset.trans h9,\n      apply set.subset_compl_iff.mpr,\n      have h11 : (ball (0 : \u211d^n) m) \u2286 (ball (0 : \u211d^n) (m - 1)), from by {\n        apply set.subset_ball,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.norm_eq_zero,\n        rw real.\nend --Needs more than 2000 tokens!\n\n--OUTPUT 5\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (U : set (euclidean_space \u211d (fin n))) (hU : is_open U) (hcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U),\n  have h1 : \u2200 m : \u2115, \u2203 (Cm : set (euclidean_space \u211d (fin n))), is_open Cm \u2227 \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (A : set (euclidean_space \u211d (fin n))), x \u2208 A \u2227 A \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 A \u2192 y \u2208 U \u2227 \u2200 z : euclidean_space \u211d (fin n), z \u2208 A \u2192 \u2203 (B : set (euclidean_space \u211d (fin n))), z \u2208 B \u2227 B \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y \u2208 U \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 y\nend --Needs more than 2000 tokens!\n\n--OUTPUT 6\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume A : set (euclidean_space \u211d (fin n)),\n  assume hA : is_open A,\n  assume hA2 : is_covering A,\n  have h1 : \u2200 (x : euclidean_space \u211d (fin n)), \u2203 (m : \u2115), \u2200 (y : euclidean_space \u211d (fin n)), dist x y < m \u2192 y \u2208 A, from \n    assume x : euclidean_space \u211d (fin n),\n    have h2 : \u2200 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A, from \n      assume m : \u2115,\n      have h3 : \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m, from \n        by {exact exists_ball x m},\n      have h4 : \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A, from \n        by {exact classical.by_contradiction (hA2 (exists.elim h3 (assume y h5, h5.left)) x)},\n      exact h4,\n    have h5 : \u2203 (m : \u2115), \u2200 (y : euclidean_space \u211d (fin n)), dist x y < m \u2192 y \u2208 A, from \n      by {exact exists.intro 1 (assume y h6, h2 1)},\n    exact h5,\n  have h6 : \u2200 (x : euclidean_space \u211d (fin n)), \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A, from \n    assume x : euclidean_space \u211d (fin n),\n    have h7 : \u2203 (m : \u2115), \u2200 (y : euclidean_space \u211d (fin n)), dist x y < m \u2192 y \u2208 A, from h1 x,\n    have h8 : \u2203 (y : euclidean_space \u211d (fin n)), dist x y < (exists.elim h7 (assume m h9, m)), from \n      by {exact exists_ball x (exists.elim h7 (assume m h9, m))},\n    have h9 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A, from \n      by {exact exists.intro (exists.elim h7 (assume m h10, m)) (exists.elim h8 (assume y h11, h11))},\n    exact h9,\n  have h10 : \u2200 (x : euclidean_space \u211d (fin n)), \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A, from \n    assume x : euclidean_space \u211d (fin n),\n    have h11 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A, from h6 x,\n    have h12 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A, from \n      by {exact exists.intro (exists.elim h11 (assume m h13, m)) (exists.elim h11 (assume m h13, exists.elim h13 (assume y h14, exists.intro y (exists.intro (exists.elim h14 (assume h15 h16, h15)) (exists.elim h14 (assume h15 h16, h16))))))},\n    exact h12,\n  have h13 : \u2200 (x : euclidean_space \u211d (fin n)), \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 \u2203 (w : euclidean_space \u211d (fin n)), dist x w < m \u2227 w \u2208 A, from \n    assume x : euclidean_space \u211d (fin n),\n    have h14 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A, from h10 x,\n    have h15 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 \u2203 (w : euclidean_space \u211d (fin n)), dist x w < m \u2227 w \u2208 A, from \n      by {exact exists.intro (exists.elim h14 (assume m h16, m)) (exists.elim h14 (assume m h16, exists.elim h16 (assume y h17, exists.intro y (exists.intro (exists.elim h17 (assume h18 h19, h18)) (exists.intro (exists.elim h17 (assume h18 h19, h19)) (exists.elim h17 (assume h18 h19, h1)))))))},\n    exact h15,\n  have h16 : \u2200 (x : euclidean_space \u211d (fin n)), \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 \u2203 (w : euclidean_space \u211d (fin n)), dist x w < m \u2227 w \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 \u2203 (w : euclidean_space \u211d (fin n)), dist x w < m \u2227 w \u2208 A, from \n    assume x : euclidean_space \u211d (fin n),\n    have h17 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 \u2203 (w : euclidean_space \u211d (fin n)), dist x w < m \u2227 w \u2208 A, from h13 x,\n    have h18 : \u2203 (m : \u2115), \u2203 (y : euclidean_space \u211d (fin n)), dist x y < m \u2227 y \u2208 A \u2227 \u2200 (z : euclidean_space \u211d (fin n)), dist x z < m \u2192 z \u2208 A \u2227 \u2200 (z\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by {split,apply set.subset_of_mem_powerset,exact hA,apply set.subset_of_mem_powerset,exact hB},\n  have h2 : (A \u2229 B) \u2286 A, from by apply set.inter_subset_left,\n  have h3 : (A \u2229 B) \u2286 S, from by {apply set.subset.trans h2 h1.left},\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by {apply set.mem_powerset h3},\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by rw sq\n  ... = x*(x+y) + y*(x+y) : by rw add_mul\n  ... = x*x + x*y + y*x + y*y : by {rw [mul_comm x (x+y),mul_comm y (x+y)], rw [add_mul,add_mul], ring}\n  ... = x^2 + 2*x*y + y^2 : by {repeat {rw \u2190 sq}, rw mul_comm y x, ring}\nend\n\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by {\n    assume a b : G, use a\u207b\u00b9 * b, obviously, },\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by {\n    assume a b : G, use b * a\u207b\u00b9, obviously, }, \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from \n    assume a : G, h1 a a,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from\n    assume a : G, h2 a a,\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from assume a :G,\n    exists_unique.unique (h3 a) (classical.some_spec (exists_unique.exists (h3 a)))\n    (mul_one a),\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from assume a : G,\n    exists_unique.unique (h4 a) (classical.some_spec (exists_unique.exists (h4 a))) (one_mul a), \n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (hident : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a).exists, from assume (a : G),\n        exists_unique.unique (h3 a) (hident a).right\n        (classical.some_spec (exists_unique.exists (h3 a))), \n      have h9 : \u2200 a : G, e = classical.some (h4 a).exists, from assume (a : G),\n        exists_unique.unique (h4 a) (hident a).left\n        (classical.some_spec (exists_unique.exists (h4 a))),\n      show e = (1 : G), from eq.trans (h9 e) (h6 _),     \n    },\n    exact \u27e8by obviously, h7\u27e9,\n  }\nend\n\n/--`theorem`\n\\mathbb{R}^n is paracompact\n$\\mathbb{R}^n$ is paracompact for all $n$.\n`proof`\nLet $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$. We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$. First, we define a collection of pen balls. Let $B_0 = \\phi$, and for each $n \\in \\mathbb{N}$, let $B_m$ denote the ball of radius $m$\ncentered at 0. Given $m$, set $\\Bar{B_m}$ is compact in $\\mathbb{R}^n$ by the Heine-Borel theorem, so choose finitely many elements of $\\mathcal{A}$ that cover $\\Bar{B_m}$ and intersect each one with the open set $\\mathbb{R}^n \\setminus \\Bar{B_{m - 1}}$, and let $\\mathcal{C}_{m}$ denote this collection of open sets (each an open subset of an element of $\\mathcal{A}$). So $\\mathcal{C} = \\bigcup_{m = 0}^{\\infty} \\mathcal{C}_m$ is an open refinement of $\\mathcal{A}$. Note that $\\mathcal{C}$ covers $\\mathbb{R}^n$ since for any $x \\in \\mathbb{R}^n$, there is a smallest $m \\in \\mathbb{N}$ such that $x \\in \\Bar{B_{m}}$ (namely, some $m$ where $\\rVert x \\lVert \\leq m \\leq \\rVert x \\lVert + 1$), and so $x$ is an element of $\\mathcal{C}_m$. Now collection $\\mathcal{C}$ is locally finite since for given $x \\in \\mathbb{R}^n$, neighborhood $B_m$ intersects only finitely many elements of $\\mathcal{C}$, namely those elements in collection $\\mathcal{C}_1 \\cup \\mathcal{C}_2 \\cup \\cdots \\mathcal{C}_m$. So $\\mathcal{C}$ is a locally finite open refinement of $\\mathcal{A}$ that covers $\\mathbb{R}^n$, hence $\\mathbb{R}^n$ is paracompact.\n\nQED\n-/\ntheorem  \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof-Natural-Language-Proof-Translation/Correct_statement-lean_proof-3_few_shot_temperature_0.4_max_tokens_2000_n_6/clean_files/Rn is paracompact.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5813030906443133, "lm_q2_score": 0.341582499438317, "lm_q1q2_score": 0.19856296263350307}}
{"text": "import for_mathlib.category_theory.localization.derived_functor\nimport for_mathlib.category_theory.localization.triangulated\nimport for_mathlib.category_theory.triangulated.pretriangulated_misc\nimport for_mathlib.category_theory.triangulated.shift_triangle\nimport for_mathlib.category_theory.triangulated.triangulated\nimport for_mathlib.category_theory.preadditive_subcategory\nimport for_mathlib.category_theory.triangulated.coproducts\nimport for_mathlib.category_theory.limits.products\nimport for_mathlib.category_theory.triangulated.is_triangulated_subcategory\nimport category_theory.limits.full_subcategory\nimport data.int.order.units\n\nnoncomputable theory\n\nuniverses v\u2081 v\u2082 u\u2081 u\u2082\n\nopen_locale zero_object\n\nopen category_theory\n\nnamespace category_theory\n\nopen limits category preadditive category_theory\n\nnamespace functor\n\n@[simps]\ndef map_arrow_nat_trans_of_nat_trans {C : Type u\u2081} {D : Type u\u2082} [category.{v\u2081} C] [category.{v\u2082} D]\n  {F G : C \u2964 D} (\u03c4 : F \u27f6 G) : F.map_arrow \u27f6 G.map_arrow :=\n{ app := \u03bb f,\n  { left := \u03c4.app _,\n    right := \u03c4.app _, }, }\n\n@[simps]\ndef map_arrow_nat_iso_of_nat_iso {C : Type u\u2081} {D : Type u\u2082} [category.{v\u2081} C] [category.{v\u2082} D]\n  {F G : C \u2964 D} (e : F \u2245 G) : F.map_arrow \u2245 G.map_arrow :=\n{ hom := map_arrow_nat_trans_of_nat_trans e.hom,\n  inv := map_arrow_nat_trans_of_nat_trans e.inv, }\n\nend functor\n\nnamespace triangulated\n\nopen pretriangulated\n\nvariables (C : Type*) [category C] [has_zero_object C] [has_shift C \u2124]\n  [preadditive C] [\u2200 (n : \u2124), functor.additive (shift_functor C n)]\n  [pretriangulated C]\n\n/-structure subcategory :=\n(set : set C)\n(zero : (0 : C) \u2208 set)\n(shift : \u2200 (X : C) (n : \u2124) (hX : X \u2208 set), (shift_functor C n).obj X \u2208 set)\n(ext\u2082 : \u2200 (T : triangle C) (hT : T \u2208 dist_triang C) (h\u2081 : T.obj\u2081 \u2208 set) (h\u2083 : T.obj\u2083 \u2208 set), T.obj\u2082 \u2208 set)-/\n\nvariable {C}\n\nnamespace subcategory\n\nvariables (S : set C) [is_triangulated_subcategory S]\n\ndef W : morphism_property C :=\n\u03bb X Y f, \u2203 (Z : C) (g : Y \u27f6 Z) (h : Z \u27f6 (shift_functor C (1 : \u2124)).obj X)\n  (H : triangle.mk f g h \u2208 dist_triang C), Z \u2208 S\n\ndef W' : morphism_property C :=\n\u03bb Y Z g, \u2203 (X : C) (f : X \u27f6 Y) (h : Z \u27f6 X\u27e6(1 : \u2124)\u27e7) (H : triangle.mk f g h \u2208 dist_triang C),\n    X \u2208 S\n\nvariable {S}\n\ndef W.mk {T : triangle C} (hT : T \u2208 dist_triang C) (h : T.obj\u2083 \u2208 S) :\n  (W S) T.mor\u2081 :=\n\u27e8T.obj\u2083, T.mor\u2082, T.mor\u2083, (by { cases T, exact hT, }), h\u27e9\n\ndef W'.mk {T : triangle C} (hT : T \u2208 dist_triang C) (h : T.obj\u2081 \u2208 S) :\n  (W' S) T.mor\u2082 :=\n\u27e8T.obj\u2081, T.mor\u2081, T.mor\u2083, (by { cases T, exact hT, }), h\u27e9\n\ndef W.triangle {X Y : C} (f : X \u27f6 Y) (hf : (W S) f) : triangle C :=\ntriangle.mk f hf.some_spec.some hf.some_spec.some_spec.some\n\nlemma W.triangle_distinguished {X Y : C} (f : X \u27f6 Y) (hf : (W S) f) :\n  W.triangle f hf \u2208 dist_triang C := hf.some_spec.some_spec.some_spec.some\n\nlemma W.triangle_obj\u2083_mem {X Y : C} (f : X \u27f6 Y) (hf : (W S) f) :\n  (W.triangle f hf).obj\u2083 \u2208 S :=\nhf.some_spec.some_spec.some_spec.some_spec\n\nvariable (S)\n\nlemma W_eq_W' : W S = W' S :=\nbegin\n  ext X Y f,\n  split,\n  { rintro \u27e8Z, g, h, H, mem\u27e9,\n    exact \u27e8_, _, _, inv_rot_of_dist_triangle C _ H,\n      is_triangulated_subcategory.shift _ _ mem\u27e9, },\n  { rintro \u27e8Z, g, h, H, mem\u27e9,\n    refine \u27e8_, _, _, rot_of_dist_triangle C _ H,\n      is_triangulated_subcategory.shift _ _ mem\u27e9, },\nend\n\nvariable {S}\n\ndef W.mk' {T : triangle C} (hT : T \u2208 dist_triang C) (h : T.obj\u2081 \u2208 S) :\n  (W S) T.mor\u2082 :=\nby simpa only [W_eq_W'] using W'.mk hT h\n\ninstance W_contains_identities : (W S).contains_identities :=\n\u27e8\u03bb X, \u27e80, 0, 0, pretriangulated.contractible_distinguished X,\n  is_triangulated_subcategory.zero S\u27e9\u27e9\n\nvariable (S)\n\nlemma W_stable_under_composition [is_triangulated C] : (W S).stable_under_composition :=\n\u03bb X\u2081 X\u2082 X\u2083 u\u2081\u2082 u\u2082\u2083 h\u2081\u2082 h\u2082\u2083,\nbegin\n  rcases h\u2081\u2082 with \u27e8Z\u2081\u2082, v\u2081\u2082, w\u2081\u2082, H\u2081\u2082, mem\u2081\u2082\u27e9,\n  rcases h\u2082\u2083 with \u27e8Z\u2082\u2083, v\u2082\u2083, w\u2082\u2083, H\u2082\u2083, mem\u2082\u2083\u27e9,\n  rcases pretriangulated.distinguished_cocone_triangle _ _ (u\u2081\u2082 \u226b u\u2082\u2083) with \u27e8Z\u2081\u2083, v\u2081\u2083, w\u2081\u2083, H\u2081\u2083\u27e9,\n  refine \u27e8_, _, _, H\u2081\u2083, _\u27e9,\n  exact is_triangulated_subcategory.ext\u2082 _\n    (is_triangulated.octahedron_axiom rfl H\u2081\u2082 H\u2082\u2083 H\u2081\u2083).some.mem mem\u2081\u2082 mem\u2082\u2083,\nend\n\ninstance W_multiplicative [is_triangulated C] : (W S).multiplicative :=\n{ contains_identities := infer_instance,\n  comp := W_stable_under_composition S, }\n\nlemma W_respects_iso : (W S).respects_iso :=\nbegin\n  split,\n  { rintro X' X Y e f \u27e8Z, g, h, mem, mem'\u27e9,\n    refine \u27e8Z, g, h \u226b (shift_functor C 1).map e.inv, _, mem'\u27e9,\n    refine pretriangulated.isomorphic_distinguished _ mem _ _,\n    refine triangle.mk_iso _ _ e (iso.refl _) (iso.refl _) (by tidy) (by tidy) _,\n    dsimp,\n    simp only [assoc, \u2190 functor.map_comp, e.inv_hom_id, functor.map_id, comp_id, id_comp], },\n  { rintro X Y Y' e f \u27e8Z, g, h, mem, mem'\u27e9,\n    refine \u27e8Z, e.inv \u226b g, h, _, mem'\u27e9,\n    refine pretriangulated.isomorphic_distinguished _ mem _ _,\n    refine triangle.mk_iso _ _ (iso.refl _) e.symm (iso.refl _) (by tidy) (by tidy) (by tidy), },\nend\n\ninstance [is_triangulated C] : left_calculus_of_fractions (W S) :=\n{ id := infer_instance,\n  comp := W_stable_under_composition S,\n  ex := \u03bb X' X Y s hs u, begin\n    obtain \u27e8Z, f, g, H, mem\u27e9 := hs,\n    obtain \u27e8Y', s', f', mem'\u27e9 := pretriangulated.distinguished_cocone_triangle\u2082 (g \u226b u\u27e61\u27e7'),\n    obtain \u27e8b, \u27e8hb\u2081, hb\u2082\u27e9\u27e9 := pretriangulated.complete_distinguished_triangle_morphism\u2082 _ _\n      H mem' u (\ud835\udfd9 Z) (by { dsimp, rw id_comp, }),\n    exact nonempty.intro \u27e8Y', b, s', \u27e8Z, f', g \u226b u\u27e61\u27e7', mem', mem\u27e9, hb\u2081.symm\u27e9,\n  end,\n  ext := \u03bb X' X Y f\u2081 f\u2082 s hs hf\u2081, begin\n    let f := f\u2081 - f\u2082,\n    have hf\u2082 : s \u226b f = 0 := by { dsimp [f], rw [comp_sub, hf\u2081, sub_self], },\n    obtain \u27e8Z, g, h, H, mem\u27e9 := hs,\n    obtain \u27e8q, hq\u27e9 := contravariant_yoneda_exact\u2082 _ H f hf\u2082,\n    dsimp at q hq,\n    obtain \u27e8Y', r, t, mem'\u27e9 := pretriangulated.distinguished_cocone_triangle _ _ q,\n    refine \u27e8Y', r, _, _\u27e9,\n    { exact \u27e8_, _, _, rot_of_dist_triangle C _ mem',\n        is_triangulated_subcategory.shift _ _ mem\u27e9, },\n    { rw [\u2190 sub_eq_zero, \u2190 sub_comp],\n      change f \u226b r = 0,\n      have eq := comp_dist_triangle_mor_zero\u2081\u2082 C _ mem',\n      dsimp at eq,\n      rw [hq, assoc, eq, comp_zero], },\n  end, }\n\ninstance [is_triangulated C] : right_calculus_of_fractions (W S) :=\n{ id := infer_instance,\n  comp := W_stable_under_composition S,\n  ex := \u03bb X Y Y' s hs u, begin\n    obtain \u27e8Z, f, g, H, mem\u27e9 := hs,\n    obtain \u27e8X', f', h', mem'\u27e9 := pretriangulated.distinguished_cocone_triangle\u2081 (u \u226b f),\n    obtain \u27e8a, \u27e8ha\u2081, ha\u2082\u27e9\u27e9 := pretriangulated.complete_distinguished_triangle_morphism\u2081 _ _ mem' H u (\ud835\udfd9 Z)\n      (comp_id _),\n    exact nonempty.intro \u27e8X', a, f', \u27e8Z, u \u226b f, h', mem', mem\u27e9, ha\u2081\u27e9,\n  end,\n  ext := \u03bb Y Z Z' f\u2081 f\u2082 s hs hf\u2081, begin\n    let f := f\u2081 - f\u2082,\n    have hf\u2082 : f \u226b s = 0 := by { dsimp [f], rw [sub_comp, hf\u2081, sub_self], },\n    rw W_eq_W' at hs,\n    obtain \u27e8X, g, h, H, mem\u27e9 := hs,\n    obtain \u27e8q, hq\u27e9 := covariant_yoneda_exact\u2082 _ H f hf\u2082,\n    dsimp at q hq,\n    obtain \u27e8Y', r, t, mem'\u27e9 := pretriangulated.distinguished_cocone_triangle\u2081 q,\n    refine \u27e8Y', r, _, _\u27e9,\n    { exact \u27e8_, _, _, mem', mem\u27e9, },\n    { rw [\u2190 sub_eq_zero, \u2190 comp_sub],\n    change r \u226b f = 0,\n    have eq := comp_dist_triangle_mor_zero\u2081\u2082 C _ mem',\n    dsimp at eq,\n    rw [hq, \u2190 assoc, eq, zero_comp], },\n  end, }\n\nlemma mul_mem_W_iff {X Y : C} (f : X \u27f6 Y) (n : \u2124) :\n  (W S) ((\u2191((-1 : units \u2124) ^ n) : \u2124) \u2022 f) \u2194 (W S) f :=\n(W_respects_iso S).arrow_mk_iso_iff\nbegin\n  let e : X \u2245 X :=\n  { hom := (\u2191((-1 : units \u2124) ^ n) : \u2124) \u2022 \ud835\udfd9 X,\n    inv := (\u2191((-1 : units \u2124) ^ n) : \u2124) \u2022 \ud835\udfd9 X,\n    hom_inv_id' := by simp only [zsmul_comp, id_comp, smul_smul, int.units_coe_mul_self, one_smul],\n    inv_hom_id' := by simp only [zsmul_comp, id_comp, smul_smul, int.units_coe_mul_self, one_smul], },\n  refine arrow.iso_mk e (iso.refl _) _,\n  dsimp,\n  rw [comp_id, zsmul_comp, id_comp],\nend\n\ninstance W_compatible_with_shift : (W S).compatible_with_shift \u2124 :=\n\u27e8begin\n  have h : \u2200 (X Y : C) (f : X \u27f6 Y) (hf : (W S) f) (n : \u2124), (W S) (f\u27e6n\u27e7'),\n  { rintro X Y f \u27e8Z, g, h, H, mem\u27e9 n,\n    rw \u2190 mul_mem_W_iff S _ n,\n    exact \u27e8_, _, _, triangle.shift_distinguished C _ H n,\n      is_triangulated_subcategory.shift Z n mem\u27e9, },\n  intro n,\n  ext X Y f,\n  refine \u27e8\u03bb hf, _, \u03bb hf, h _ _ f hf n\u27e9,\n   exact ((W_respects_iso S).arrow_mk_iso_iff\n    ((functor.map_arrow_nat_iso_of_nat_iso\n    (shift_functor_comp_shift_functor_neg C n)).app (arrow.mk f))).mp (h _ _ _ hf (-n)),\nend\u27e9\n\nvariable {S}\n\nlemma W.shift {X\u2081 X\u2082 : C} {f : X\u2081 \u27f6 X\u2082} (hf : (W S) f) (n : \u2124) :\n  (W S) ((shift_functor C n).map f) :=\nby simpa only [(morphism_property.compatible_with_shift.iff (W S) f n)] using hf\n\nlemma W.unshift {X\u2081 X\u2082 : C} {f : X\u2081 \u27f6 X\u2082} (n : \u2124) (hf : (W S) ((shift_functor C n).map f)) :\n  (W S) f :=\nby simpa only [\u2190 (morphism_property.compatible_with_shift.iff (W S) f n)] using hf\n\nvariable (S)\n\nlemma binary_product_stable (X\u2081 X\u2082 : C) (hX\u2081 : X\u2081 \u2208 S)\n  (hX\u2082 : X\u2082 \u2208 S) : (X\u2081 \u2a2f X\u2082) \u2208 S :=\nis_triangulated_subcategory.ext\u2082 _ (binary_product_triangle_distinguished X\u2081 X\u2082) hX\u2081 hX\u2082\n\nlemma pi_finite_stable {J : Type} [finite J]\n  (X : J \u2192 C) (hX : \u2200 j, X j \u2208 S) : (\u220f X) \u2208 S :=\nbegin\n  revert hX X,\n  let P : Type \u2192 Prop := \u03bb J,\n    \u2200 [hJ : finite J] (X : J \u2192 C) (hX : \u2200 j, X j \u2208 S),\n      by { haveI := hJ, exact (\u220f X) \u2208 S, },\n  suffices : P J,\n  { exact this, },\n  refine finite.induction_empty_option _ _ _ J,\n  { intros J\u2081 J\u2082 e hJ\u2081, introI, intros X hX,\n    haveI : finite J\u2081 := finite.of_equiv _ e.symm,\n    haveI := has_product_of_equiv X e,\n    exact set.respects_iso.condition S (product_iso_of_equiv X e)\n      (hJ\u2081 (X \u2218 e) (\u03bb j\u2081, hX _)), },\n  { introI, intros X hX,\n    refine set.respects_iso.condition S  _ (is_triangulated_subcategory.zero S),\n    refine (limits.is_zero.iso_zero _).symm,\n    haveI : mono (0 : \u220f X \u27f6 0),\n    { constructor,\n      intros Z f\u2081 f\u2082 hf,\n      ext,\n      discrete_cases,\n      induction j, },\n    exact limits.is_zero.of_mono (0 : \u220f X \u27f6 0) (is_zero_zero C), },\n  { intro J,\n    introI,\n    intros hJ hJ' X hX,\n    exact set.respects_iso.condition _ (product_iso_option X).symm\n      (binary_product_stable S _ _ (hJ (\u03bb j, X (some j)) (\u03bb j, hX _)) (hX none)), },\nend\n\ninstance W_stable_under_finite_products : (W S).stable_under_finite_products :=\n\u27e8\u03bb J, begin\n  introI,\n  refine morphism_property.stable_under_products_of_shape.mk _ _ (W_respects_iso S) _,\n  intros X\u2081 X\u2082 f hf,\n  let T := \u03bb j, W.triangle _ (hf j),\n  exact W.mk (triangle.product_distinghished T (\u03bb j, W.triangle_distinguished _ (hf j)))\n    (pi_finite_stable S (\u03bb j, (T j).obj\u2083) (\u03bb j, W.triangle_obj\u2083_mem _ (hf j))),\nend\u27e9\n\ninstance W_compatible_with_triangulation [is_triangulated C] :\n  (W S).compatible_with_triangulation :=\n\u27e8\u03bb T\u2081 T\u2083 hT\u2081 hT\u2083 a b ha hb comm, begin\n  let T'\u2081 := triangle.mk T\u2081.mor\u2081 T\u2081.mor\u2082 T\u2081.mor\u2083,\n  let T'\u2083 := triangle.mk T\u2083.mor\u2081 T\u2083.mor\u2082 T\u2083.mor\u2083,\n  have mem\u2081 : T'\u2081 \u2208 dist_triang C := by { cases T\u2081, exact hT\u2081, },\n  have mem\u2083 : T'\u2083 \u2208 dist_triang C := by { cases T\u2083, exact hT\u2083, },\n  rcases pretriangulated.distinguished_cocone_triangle _ _ (T\u2081.mor\u2081 \u226b b) with \u27e8Z\u2082, g\u2082, h\u2082, mem\u2082\u27e9,\n  let T'\u2082 := triangle.mk (T\u2081.mor\u2081 \u226b b) g\u2082 h\u2082,\n  change T'\u2082 \u2208 dist_triang C at mem\u2082,\n  rcases hb with \u27e8Z\u2084, g\u2084, h\u2084, mem\u2084, mem\u2084'\u27e9,\n  let H := (is_triangulated.octahedron_axiom rfl mem\u2081 mem\u2084 mem\u2082).some,\n  let \u03c6\u2081\u2082 : T'\u2081 \u27f6 T'\u2082 := H.triangle_morphism\u2081,\n  have h\u03c6\u2081\u2082 : (W S) \u03c6\u2081\u2082.hom\u2083 := W.mk H.mem mem\u2084',\n  rcases ha with \u27e8Z\u2085, g\u2085, h\u2085, mem\u2085, mem\u2085'\u27e9,\n  let H' := (is_triangulated.octahedron_axiom comm.symm mem\u2085 mem\u2083 mem\u2082).some,\n  let \u03c6\u2082\u2083 : T'\u2082 \u27f6 T'\u2083 := H'.triangle_morphism\u2082,\n  have h\u03c6\u2082\u2083 : (W S) \u03c6\u2082\u2083.hom\u2083 := W.mk' H'.mem mem\u2085',\n  refine \u27e8(\u03c6\u2081\u2082 \u226b \u03c6\u2082\u2083).hom\u2083, W_stable_under_composition S _ _ h\u03c6\u2081\u2082 h\u03c6\u2082\u2083, \u27e8_, _\u27e9\u27e9,\n  { have h := (\u03c6\u2081\u2082 \u226b \u03c6\u2082\u2083).comm\u2082,\n    dsimp at h,\n    simpa only [comp_id] using h, },\n  { have h := (\u03c6\u2081\u2082 \u226b \u03c6\u2082\u2083).comm\u2083,\n    dsimp at h,\n    simpa only [triangle_category_comp, triangle_morphism.comp_hom\u2083, id_comp] using h, },\nend\u27e9\n\n\ninstance W_is_saturated [saturated S] [is_triangulated C] : (W S).is_saturated :=\n\u27e8\u03bb X\u2081 X\u2082 X\u2083 X\u2084 f\u2081\u2082 f\u2082\u2083 f\u2083\u2084 h\u2081\u2083 h\u2082\u2084, begin\n  obtain \u27e8Y\u2081\u2083, g\u2081\u2083, h\u2081\u2083, H\u2081\u2083, mem\u2081\u2083\u27e9 := h\u2081\u2083,\n  obtain \u27e8Y\u2082\u2084, g\u2082\u2084, h\u2082\u2084, H\u2082\u2084, mem\u2082\u2084\u27e9 := h\u2082\u2084,\n  obtain \u27e8Y\u2081\u2082, g\u2081\u2082, h\u2081\u2082, H\u2081\u2082\u27e9 := pretriangulated.distinguished_cocone_triangle _ _ f\u2081\u2082,\n  obtain \u27e8Y\u2082\u2083, g\u2082\u2083, h\u2082\u2083, H\u2082\u2083\u27e9 := pretriangulated.distinguished_cocone_triangle _ _ f\u2082\u2083,\n  obtain \u27e8Y\u2083\u2084, g\u2083\u2084, h\u2083\u2084, H\u2083\u2084\u27e9 := pretriangulated.distinguished_cocone_triangle _ _ f\u2083\u2084,\n  refine \u27e8Y\u2082\u2083, g\u2082\u2083, h\u2082\u2083, H\u2082\u2083, _\u27e9,\n  have H\u2081\u2082\u2083 := (is_triangulated.octahedron_axiom rfl H\u2081\u2082 H\u2082\u2083 H\u2081\u2083).some,\n  have H\u2082\u2083\u2084 := (is_triangulated.octahedron_axiom rfl H\u2082\u2083 H\u2083\u2084 H\u2082\u2084).some,\n  let s := h\u2082\u2083 \u226b g\u2081\u2082\u27e61\u27e7',\n  let t := h\u2083\u2084 \u226b g\u2082\u2083\u27e61\u27e7',\n  have hs : (W S) s := W.mk (rot_of_dist_triangle _ _\n    (rot_of_dist_triangle _ _ H\u2081\u2082\u2083.mem)) (set.is_stable_by_shift.condition 1 _ mem\u2081\u2083),\n  have ht : (W S) t := W.mk (rot_of_dist_triangle _ _\n    (rot_of_dist_triangle _ _ H\u2082\u2083\u2084.mem)) (set.is_stable_by_shift.condition 1 _ mem\u2082\u2084),\n  let st := t \u226b s\u27e61\u27e7',\n  have hst : st = 0,\n  { dsimp [st],\n    have eq : g\u2082\u2083 \u226b h\u2082\u2083 = 0 := triangle.comp_zero\u2082\u2083 _ H\u2082\u2083,\n    simp only [assoc, \u2190 functor.map_comp, reassoc_of eq,\n      zero_comp, functor.map_zero, comp_zero], },\n  have hst' := W_stable_under_composition S t (s\u27e61\u27e7') ht (hs.shift 1),\n  obtain \u27e8Z, g, h, H, mem\u27e9 := hst',\n  let i := (triangle.mk (t \u226b (shift_functor C 1).map s) g h).mor\u2082,\n  haveI : mono i := mono_of_dist_triang\u2082 _ H hst,\n  haveI : is_split_mono i := is_split_mono_of_mono i,\n  have mem\u2081\u2082 := saturated.condition i mem,\n  dsimp [triangle.mk] at mem\u2081\u2082,\n  rw [\u2190 is_triangulated_subcategory.shift_iff, \u2190 is_triangulated_subcategory.shift_iff] at mem\u2081\u2082,\n  exact is_triangulated_subcategory.ext\u2083 _ H\u2081\u2082\u2083.mem mem\u2081\u2082 mem\u2081\u2083,\nend\u27e9\n\nlemma category_closed_under_finite_products (J : Type) [finite J] :\n  closed_under_limits_of_shape (discrete J) S :=\n\u03bb F c hc mem, begin\n  let X := \u03bb j, F.obj \u27e8j\u27e9,\n  refine set.respects_iso.condition S _ (pi_finite_stable S X (\u03bb j, mem \u27e8j\u27e9)),\n  exact\n  { hom := hc.lift (cone.mk (\u220f X) (discrete.nat_trans (by { rintro \u27e8i\u27e9, exact pi.\u03c0 _ i,}))),\n    inv := pi.lift (\u03bb i, c.\u03c0.app \u27e8i\u27e9),\n    hom_inv_id' := begin\n      ext i,\n      discrete_cases,\n      simp only [assoc, limit.lift_\u03c0, fan.mk_\u03c0_app, is_limit.fac, discrete.nat_trans_app, id_comp],\n    end,\n    inv_hom_id' := hc.hom_ext begin\n      rintro \u27e8i\u27e9,\n      simp only [assoc, is_limit.fac, discrete.nat_trans_app, limit.lift_\u03c0, fan.mk_\u03c0_app, id_comp],\n    end, },\nend\n\n--instance category_has_finite_products : has_finite_products (full_subcategory S) :=\n--infer_instance\n\n--instance shift_functor_additive (n : \u2124) : (shift_functor (full_subcategory S) n).additive :=\n--  infer_instance\n\n--instance full_subcategory_inclusion_has_comm_shift :\n--  A.inclusion.has_comm_shift \u2124 := infer_instance\n\n--instance category_inclusion_additive : A.inclusion.additive := infer_instance\n\n--instance : pretriangulated (full_subcategory S) := infer_instance\n\nlemma dist_triang_iff {X Y Z : full_subcategory S} (f : X \u27f6 Y) (g : Y \u27f6 Z) (h : Z \u27f6 X\u27e6(1 : \u2124)\u27e7) :\n  (triangle.mk f g h \u2208 dist_triang (full_subcategory S)) \u2194\n    (@triangle.mk C _ _ _ _ _ f g h \u2208 dist_triang C) :=\nbegin\n  change (_ \u2208 dist_triang C) \u2194 _,\n  let e : (full_subcategory_inclusion S).map_triangle.obj (triangle.mk f g h) \u2245\n    @triangle.mk C _ _ _ _ _ f g h,\n  { refine triangle.mk_iso _ _ (iso.refl _) (iso.refl _) (iso.refl _) (by tidy) (by tidy) _,\n    dsimp,\n    erw [id_comp, functor.map_id, comp_id, comp_id], },\n  split,\n  { exact \u03bb h, pretriangulated.isomorphic_distinguished _ h _ e.symm, },\n  { exact \u03bb h, pretriangulated.isomorphic_distinguished _ h _ e, },\nend\n\ninstance is_triangulated_full_subcategory [is_triangulated C] :\n  is_triangulated (full_subcategory S) := infer_instance\n\n--instance inclusion_is_triangulated : (full_subcategory_inclusion S).is_triangulated :=\n--infer_instance\n\n\ndef Q [is_triangulated C] : C \u2964 (W S).localization :=\nbegin\n  let F := localization_functor (W S).Q (W S),\n  exact F,\nend\n\ninstance Q_has_comm_shift [is_triangulated C] : (Q S).has_comm_shift \u2124 :=\n(infer_instance : (localization_functor (W S).Q (W S)).has_comm_shift \u2124)\n\ninstance Q_is_triangulated [is_triangulated C] : (Q S).is_triangulated :=\n(infer_instance : (localization_functor (W S).Q (W S)).is_triangulated)\n\n\n/- TODO :\n1) show a universal property for the triangulated functor `L` : if\n`G : D \u2964 E` is a functor which lifts a triangulated functor `F : C \u2964 E`\nthen `G` is a triangulated functor.\n -/\n\ninstance Q_to_functor_is_localization [is_triangulated C] : (Q S).is_localization (W S) :=\n(infer_instance : (W S).Q.is_localization (W S))\n\nlemma is_iso_map_iff [saturated S] [is_triangulated C] {D : Type*} [category D] (L : C \u2964 D)\n  [L.is_localization (W S)] {X Y : C} (f : X \u27f6 Y) : is_iso (L.map f) \u2194 (W S) f :=\nlocalization.is_iso_map_iff_of_calculus_of_fractions L (W S) f\n\nlemma is_zero_obj_iff' [is_triangulated C] (X : C) :\n  is_zero ((Q S).obj X) \u2194 \u2203 (Y : C) (i : X \u27f6 Y) [is_split_mono i], Y \u2208 S :=\nbegin\n  rw limits.is_zero.iff_id_eq_zero,\n  split,\n  { intro h,\n    have h' : (W S).Q.map (\ud835\udfd9 X) = (W S).Q.map 0 :=\n      by simpa only [functor.map_id, functor.map_zero] using h,\n    rw right_calculus_of_fractions.L_map_eq_iff (W S).Q (W S) at h',\n    obtain \u27e8Z, s, hs, eq\u27e9 := h',\n    rw [comp_id, comp_zero] at eq,\n    obtain \u27e8Y, i, p, H, mem\u27e9 := hs,\n    haveI : mono i := mono_of_dist_triang\u2082 _ H eq,\n    exact \u27e8Y, i, is_split_mono_of_mono i, mem\u27e9, },\n  { rintro \u27e8Y, i, hi, mem\u27e9,\n    haveI : is_iso ((W S).Q.map (0 : Y \u27f6 0)) := localization.inverts (W S).Q (W S) _\n      (W.mk' (contractible_distinguished Y) mem),\n    rw [\u2190 cancel_mono ((W S).Q.map i), id_comp, zero_comp,\n      \u2190 cancel_mono ((W S).Q.map (0 : Y \u27f6 0)), functor.map_zero, comp_zero, comp_zero], },\nend\n\nlemma is_zero_obj_iff [saturated S] [is_triangulated C] (X : C) :\n  is_zero ((Q S).obj X) \u2194 X \u2208 S :=\nbegin\n  rw is_zero_obj_iff',\n  split,\n  { intro h,\n    obtain \u27e8Y, i, hi, mem\u27e9 := h,\n    haveI := hi,\n    exact saturated.condition i mem, },\n  { exact \u03bb h, \u27e8X, \ud835\udfd9 X, infer_instance, h\u27e9, },\nend\n\nlemma left_orthogonal_comp_W_bijective (X : C) (hX : X \u2208 left_orthogonal S)\n  {Y Z : C} (w : Y \u27f6 Z) (hw : (W S) w) :\n  function.bijective (\u03bb (f : X \u27f6 Y), f \u226b w) :=\nbegin\n  rw W_eq_W' at hw,\n  obtain \u27e8U, f, g, H, mem\u27e9 := hw,\n  split,\n  { intros y\u2081 y\u2082 hy,\n    let y := y\u2081 - y\u2082,\n    suffices : y = 0,\n    { rw \u2190 sub_eq_zero,\n      exact this, },\n    dsimp at hy,\n    obtain \u27e8u, hu\u27e9 := covariant_yoneda_exact\u2082 _ H y\n      (by { dsimp [y], rw [sub_comp, hy, sub_self], }),\n    rw [hu, hX u mem, zero_comp], },\n  { intro z,\n    obtain \u27e8y, hy\u27e9 := covariant_yoneda_exact\u2083 _ H z\n      (hX _ (is_triangulated_subcategory.shift _ _ mem)),\n    exact \u27e8y, hy.symm\u27e9, },\nend\n\nlemma left_orthogonal_bijective_L_map [is_triangulated C] {D : Type*} [category D]\n  (L : C \u2964 D) [L.is_localization (W S)] (X Y : C) (hX : X \u2208 left_orthogonal S) :\n  function.bijective (\u03bb (f : X \u27f6 Y), L.map f) :=\nbegin\n  split,\n  { intros f\u2081 f\u2082 hf,\n    dsimp at hf,\n    rw left_calculus_of_fractions.L_map_eq_iff L (W S) at hf,\n    rcases hf with \u27e8Z, s, hs, eq\u27e9,\n    exact (left_orthogonal_comp_W_bijective S _ hX s hs).1 eq, },\n  { intro g,\n    obtain \u27e8z, hz\u27e9 := left_calculus_of_fractions.L_map_fac L (W S) g,\n    dsimp [left_calculus_of_fractions.map_roof] at hz,\n    obtain \u27e8f, hf\u27e9 := (left_orthogonal_comp_W_bijective S _ hX z.s z.hs).2 z.f,\n    refine \u27e8f, _\u27e9,\n    dsimp at hf \u22a2,\n    rw [hz, \u2190 hf, L.map_comp, assoc, is_iso.hom_inv_id, comp_id], },\nend\n\nlemma left_orthogonal_bijective_Q_map [is_triangulated C]\n  (X Y : C) (hX : X \u2208 left_orthogonal S) :\n  function.bijective (\u03bb (f : X \u27f6 Y), (Q S).map f) :=\nleft_orthogonal_bijective_L_map S (Q S) _ _ hX\n\nlemma right_orthogonal_comp_W_bijective (Z : C) (hZ : Z \u2208 right_orthogonal S)\n  {X Y : C} (w : X \u27f6 Y) (hw : (W S) w) :\n  function.bijective (\u03bb (f : Y \u27f6 Z), w \u226b f) :=\nbegin\n  split,\n  { intros y\u2081 y\u2082 hy,\n    let y := y\u2081 - y\u2082,\n    suffices : y = 0,\n    { rw \u2190 sub_eq_zero,\n      exact this, },\n    dsimp at hy,\n    obtain \u27e8U, f, g, H, mem\u27e9 := hw,\n    obtain \u27e8u, hu\u27e9 := contravariant_yoneda_exact\u2082 _ H y\n      (by { dsimp [y], rw [comp_sub, hy, sub_self], }),\n    rw [hu, hZ u mem, comp_zero], },\n  { intro z,\n    rw W_eq_W' at hw,\n    obtain \u27e8U, f, g, H, mem\u27e9 := hw,\n    obtain \u27e8y, hy\u27e9 := contravariant_yoneda_exact\u2082 _ H z (hZ _ mem),\n    exact \u27e8y, hy.symm\u27e9, },\nend\n\nlemma right_orthogonal_bijective_L_map [is_triangulated C] {D : Type*} [category D]\n  (L : C \u2964 D) [L.is_localization (W S)] (X Y : C) (hY : Y \u2208 right_orthogonal S) :\n  function.bijective (\u03bb (f : X \u27f6 Y), L.map f) :=\nbegin\n  split,\n  { intros f\u2081 f\u2082 hf,\n    dsimp at hf,\n    rw right_calculus_of_fractions.L_map_eq_iff L (W S) at hf,\n    rcases hf with \u27e8Z, s, hs, eq\u27e9,\n    exact (right_orthogonal_comp_W_bijective S _ hY s hs).1 eq, },\n  { intro g,\n    obtain \u27e8z, hz\u27e9 := right_calculus_of_fractions.L_map_fac L (W S) g,\n    dsimp [right_calculus_of_fractions.map_roof] at hz,\n    obtain \u27e8f, hf\u27e9 := (right_orthogonal_comp_W_bijective S _ hY z.s z.hs).2 z.f,\n    refine \u27e8f, _\u27e9,\n    dsimp at hf \u22a2,\n    rw [hz, \u2190 hf, L.map_comp, is_iso.inv_hom_id_assoc], },\nend\n\nlemma right_orthogonal_bijective_Q_map\n  [is_triangulated C] (X Y : C) (hY : Y \u2208 right_orthogonal S) :\n  function.bijective (\u03bb (f : X \u27f6 Y), (Q S).map f) :=\nright_orthogonal_bijective_L_map S (Q S) _ _ hY\n\nend subcategory\n\nend triangulated\n\nend category_theory\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/category_theory/localization/triangulated_subcategory.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5156199157230156, "lm_q2_score": 0.3849121444839335, "lm_q1q2_score": 0.198468367499571}}
{"text": "import init.meta.tactic\nimport system.io\nimport assignment\n\nopen tactic\n\nmeta def in_import (env : environment) (n : name) (path : string) : bool :=\n(env.decl_olean n = path) && env.contains n && (n \u2209 [``quot, ``quot.mk, ``quot.lift, ``quot.ind])\n\nmeta def exact_list : list name \u2192 tactic unit \n| [] := failed \n| (H :: Hs) := do \n                  e \u2190 mk_const H,\n                  exact e <|> exact_list Hs\n\nmeta def check_solutions : tactic unit :=\ndo env <- get_env,\n   let decls := env.fold [] list.cons,\n   cwd \u2190 unsafe_run_io io.env.get_cwd,\n   let names := decls.map declaration.to_name,\n   let assignment_names := names.filter\n     (\u03bb x, in_import env x (cwd ++ \"/src/assignment.lean\") && not x.is_internal),\n   exact_list assignment_names\n\ntheorem check_problem1 : \u2200 (x : Type), x = x :=\nbegin\n  check_solutions,\nend\n\n#print \"Problem 1\"\n#print axioms check_problem1\n#print \"---\"\n\ntheorem check_problem2 : 1 + 1 = 2 :=\nbegin\n  sorry\nend\n\n#print \"Problem 2\"\n#print axioms check_problem2\n#print \"---\"\n\n/-\ntheorem check_problem2 : 0 = 1 :=\nbegin\n  check_solutions,\nend\n\n#print \"Problem 2\"\n#print axioms check_problem2\n#print \"---\"\n\ntheorem check_problem3 : \u2115 \u00d7 \u2115 \u00d7 \u2115 :=\nbegin\n  check_solutions,\nend\n\n#print \"Problem 3\"\n#print axioms check_problem3\n#print \"---\"\n\ntheorem check_problem4 : bool :=\nbegin\n  check_solutions,\nend\n\n#print \"Problem 4\"\n#print axioms check_problem4\n#print \"---\"\n\n-/\n", "meta": {"author": "gihanmarasingha", "repo": "lean_autograder_test", "sha": "a795df730fa6ca760be6d85b11b581b569682621", "save_path": "github-repos/lean/gihanmarasingha-lean_autograder_test", "path": "github-repos/lean/gihanmarasingha-lean_autograder_test/lean_autograder_test-a795df730fa6ca760be6d85b11b581b569682621/.test/test.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5506073655352404, "lm_q2_score": 0.35936414516010196, "lm_q1q2_score": 0.19786854523442743}}
{"text": "import breen_deligne.apply_Pow\n\nnoncomputable theory\n\nuniverses v\n\nnamespace breen_deligne\n\nopen category_theory category_theory.category category_theory.limits universal_map\n  category_theory.preadditive\n\nvariables  {A\u2081 A\u2082 : Type*} [category.{v} A\u2081] [category.{v} A\u2082]\n  [preadditive A\u2081] [preadditive A\u2082] [has_finite_biproducts A\u2081] [has_finite_biproducts A\u2082]\n  (BD : data)\n  (F\u2081 : A\u2081 \u2964 A\u2081) (F\u2082 : A\u2082 \u2964 A\u2082) {G G' : A\u2081 \u2964 A\u2082} [functor.additive G] [functor.additive G']\n  (\u03c4 : G \u27f6 G')\n  (e : F\u2081 \u22d9 G \u2245 G \u22d9 F\u2082) (e' : F\u2081 \u22d9 G' \u2245 G' \u22d9 F\u2082)\n\nlemma eval_Pow_functor_nat_trans_compatibility\n  (h : e.hom \u226b whisker_right \u03c4 F\u2082 = whisker_left F\u2081 \u03c4 \u226b e'.hom) (M : A\u2081) (n : FreeMat) :\n  \u03c4.app (((eval_Pow_functor F\u2081).obj n).obj M) \u226b e'.hom.app _ \u226b\n    F\u2082.map ((apply_Pow G' n).hom.app M) =\n  e.hom.app _ \u226b F\u2082.map ((apply_Pow G n).hom.app M) \u226b\n    ((eval_Pow_functor F\u2082).obj n).map (\u03c4.app M) :=\nbegin\n  dsimp only [eval_Pow_functor],\n  have h\u2081 := nat_trans.congr_app h ((Pow n).obj M),\n  simp only [nat_trans.comp_app, whisker_right_app, whisker_left] at h\u2081,\n  slice_lhs 1 2 { erw \u2190 h\u2081, },\n  simp only [category.assoc],\n  erw [\u2190 F\u2082.map_comp, \u2190 F\u2082.map_comp],\n  congr' 2,\n  apply apply_Pow_naturality,\nend\n\nend breen_deligne\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/breen_deligne/eval_Pow_functor_nat_trans_compatibility.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.523420348936324, "lm_q2_score": 0.3775406687981454, "lm_q1q2_score": 0.1976124685999784}}
{"text": "import pseudo_normed_group.CLC\n/-!\n\n# V-hat((M_c)^n)^{T\u207b\u00b9}\n\nThis file defines a fundamental construction defined just above Definition 9.3\nin `analytic.pdf`: the subspac of V-hat(M_c^n) where the two actions of T\u207b\u00b9 coincide.\n\n## Main definition\n\nHere `M` is a profinitely filtered pseudo-normed group with `T\u207b\u00b9` scaling things by `r'`,\n`V` is a seminormed group with `T\u207b\u00b9` scaling norms by `r`, `c` is a real (a filtration coefficient)\nand `n` is a natural.\n\n- `CLCFPTinv r V r' c n M`: the seminormed group defined as the subgroup of `V-hat(M_c^n)` where\n  the two actions of `T\u207b\u00b9` (one coming from the action on M, the other coming from the\n  action on V) coincide.\n\n-/\nopen_locale classical nnreal\nnoncomputable theory\nlocal attribute [instance] type_pow\n\nnamespace category_theory\n\ntheorem comm_sq\u2082 {C} [category C] {A\u2081 A\u2082 A\u2083 B\u2081 B\u2082 B\u2083 : C}\n  {f\u2081 : A\u2081 \u27f6 B\u2081} {f\u2082 : A\u2082 \u27f6 B\u2082} {f\u2083 : A\u2083 \u27f6 B\u2083}\n  {a : A\u2081 \u27f6 A\u2082} {a' : A\u2082 \u27f6 A\u2083} {b : B\u2081 \u27f6 B\u2082} {b' : B\u2082 \u27f6 B\u2083}\n  (h\u2081 : a \u226b f\u2082 = f\u2081 \u226b b) (h\u2082 : a' \u226b f\u2083 = f\u2082 \u226b b') : (a \u226b a') \u226b f\u2083 = f\u2081 \u226b b \u226b b' :=\nby rw [category.assoc, h\u2082, \u2190 category.assoc, h\u2081, \u2190 category.assoc]\n\nend category_theory\n\nopen SemiNormedGroup opposite Profinite pseudo_normed_group category_theory breen_deligne\nopen profinitely_filtered_pseudo_normed_group category_theory.limits\nopen normed_group_hom\n\nnamespace SemiNormedGroup\n\ndef equalizer {V W : SemiNormedGroup} (f g : V \u27f6 W) := of (f.equalizer g)\n\nnamespace equalizer\n\ndef \u03b9 {V W : SemiNormedGroup} (f g : V \u27f6 W) :\n  equalizer f g \u27f6 V :=\nnormed_group_hom.equalizer.\u03b9 _ _\n\n@[reassoc] lemma condition {V W : SemiNormedGroup} (f g : V \u27f6 W) :\n  \u03b9 f g \u226b f = \u03b9 f g \u226b g :=\nnormed_group_hom.equalizer.comp_\u03b9_eq _ _\n\nlemma \u03b9_range {V W : SemiNormedGroup} (f g : V \u27f6 W) :\n  (\u03b9 f g).range = (f - g).ker :=\nbegin\n  ext, rw [normed_group_hom.mem_range, normed_group_hom.mem_ker],\n  split,\n  { rintro \u27e8x, rfl\u27e9, rw [normed_group_hom.sub_apply], exact x.2 },\n  { intro h, refine \u27e8\u27e8x, h\u27e9, rfl\u27e9, }\nend\n\nlemma \u03b9_range' {V W : SemiNormedGroup} (f g : V \u27f6 W) :\n  (\u03b9 f g).range = (g - f).ker :=\nbegin\n  rw \u03b9_range, ext x,\n  simp only [normed_group_hom.mem_ker, normed_group_hom.sub_apply, sub_eq_zero],\n  rw eq_comm\nend\n\ndef map {V\u2081 V\u2082 W\u2081 W\u2082 : SemiNormedGroup} {f\u2081 f\u2082 g\u2081 g\u2082} (\u03c6 : V\u2081 \u27f6 V\u2082) (\u03c8 : W\u2081 \u27f6 W\u2082)\n  (hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8) (hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  equalizer f\u2081 g\u2081 \u27f6 equalizer f\u2082 g\u2082 :=\nnormed_group_hom.equalizer.map _ _ hf.symm hg.symm\n\nlemma map_comp_\u03b9 {V\u2081 V\u2082 W\u2081 W\u2082 : SemiNormedGroup} {f\u2081 f\u2082 g\u2081 g\u2082} (\u03c6 : V\u2081 \u27f6 V\u2082) (\u03c8 : W\u2081 \u27f6 W\u2082)\n  (hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8) (hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  map \u03c6 \u03c8 hf hg \u226b \u03b9 _ _ = \u03b9 _ _ \u226b \u03c6 :=\nrfl\n\ntheorem map_congr\n  {V\u2081 V\u2082 W\u2081 W\u2082 : SemiNormedGroup} {f\u2081 f\u2082 g\u2081 g\u2082} {\u03c6 : V\u2081 \u27f6 V\u2082} {\u03c8 : W\u2081 \u27f6 W\u2082}\n  {V\u2081' V\u2082' W\u2081' W\u2082' : SemiNormedGroup} {f\u2081' f\u2082' g\u2081' g\u2082'} {\u03c6' : V\u2081' \u27f6 V\u2082'} {\u03c8' : W\u2081' \u27f6 W\u2082'}\n  {hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8} {hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8}\n  {hf' : \u03c6' \u226b f\u2082' = f\u2081' \u226b \u03c8'} {hg' : \u03c6' \u226b g\u2082' = g\u2081' \u226b \u03c8'}\n  (H\u03c6 : arrow.mk \u03c6 = arrow.mk \u03c6') (H\u03c8 : arrow.mk \u03c8 = arrow.mk \u03c8')\n  (Hf\u2081 : arrow.mk f\u2081 = arrow.mk f\u2081') (Hf\u2082 : arrow.mk f\u2082 = arrow.mk f\u2082')\n  (Hg\u2081 : arrow.mk g\u2081 = arrow.mk g\u2081') (Hg\u2082 : arrow.mk g\u2082 = arrow.mk g\u2082') :\n  arrow.mk (map \u03c6 \u03c8 hf hg) = arrow.mk (map \u03c6' \u03c8' hf' hg') :=\nby { cases H\u03c6, cases H\u03c8, cases Hf\u2081, cases Hf\u2082, cases Hg\u2081, cases Hg\u2082, refl }\n\nlemma map_comp_map {V\u2081 V\u2082 V\u2083 W\u2081 W\u2082 W\u2083 : SemiNormedGroup} {f\u2081 f\u2082 f\u2083 g\u2081 g\u2082 g\u2083}\n  {\u03c6 : V\u2081 \u27f6 V\u2082} {\u03c8 : W\u2081 \u27f6 W\u2082} {\u03c6' : V\u2082 \u27f6 V\u2083} {\u03c8' : W\u2082 \u27f6 W\u2083}\n  (hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8) (hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8)\n  (hf' : \u03c6' \u226b f\u2083 = f\u2082 \u226b \u03c8') (hg' : \u03c6' \u226b g\u2083 = g\u2082 \u226b \u03c8') :\n  map \u03c6 \u03c8 hf hg \u226b map \u03c6' \u03c8' hf' hg' =\n  map (\u03c6 \u226b \u03c6') (\u03c8 \u226b \u03c8') (comm_sq\u2082 hf hf') (comm_sq\u2082 hg hg') :=\nby { ext, refl }\n\nlemma map_id {J} [category J] {V W : SemiNormedGroup} (f g : V \u27f6 W) :\n  map (\ud835\udfd9 V) (\ud835\udfd9 W) (show \ud835\udfd9 V \u226b f = f \u226b \ud835\udfd9 W, by simp) (show \ud835\udfd9 V \u226b g = g \u226b \ud835\udfd9 W, by simp) = \ud835\udfd9 _ :=\nby { ext, refl }\n\nlemma norm_map_le {V\u2081 V\u2082 W\u2081 W\u2082 : SemiNormedGroup} {f\u2081 f\u2082 g\u2081 g\u2082} {\u03c6 : V\u2081 \u27f6 V\u2082} {\u03c8 : W\u2081 \u27f6 W\u2082}\n  (hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8) (hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8) (C : \u211d) (h\u03c6 : \u2225\u03b9 f\u2081 g\u2081 \u226b \u03c6\u2225 \u2264 C) :\n  \u2225map \u03c6 \u03c8 hf hg\u2225 \u2264 C :=\nnormed_group_hom.equalizer.norm_map_le _ _ C h\u03c6\n\n@[simps obj map]\nprotected def F {J} [category J] {V W : J \u2964 SemiNormedGroup} (f g : V \u27f6 W) : J \u2964 SemiNormedGroup :=\n{ obj := \u03bb X, of ((f.app X).equalizer (g.app X)),\n  map := \u03bb X Y \u03c6, equalizer.map (V.map \u03c6) (W.map \u03c6) (f.naturality _) (g.naturality _),\n  map_id' := \u03bb X, by simp only [category_theory.functor.map_id]; exact normed_group_hom.equalizer.map_id,\n  map_comp' := \u03bb X Y Z \u03c6 \u03c8, begin\n    simp only [functor.map_comp],\n    exact (map_comp_map _ _ _ _).symm\n  end }\n\n@[simps]\ndef map_nat {J} [category J] {V\u2081 V\u2082 W\u2081 W\u2082 : J \u2964 SemiNormedGroup}\n  {f\u2081 f\u2082 g\u2081 g\u2082} (\u03c6 : V\u2081 \u27f6 V\u2082) (\u03c8 : W\u2081 \u27f6 W\u2082)\n  (hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8) (hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  equalizer.F f\u2081 g\u2081 \u27f6 equalizer.F f\u2082 g\u2082 :=\n{ app := \u03bb X, equalizer.map (\u03c6.app X) (\u03c8.app X)\n    (by rw [\u2190 nat_trans.comp_app, \u2190 nat_trans.comp_app, hf])\n    (by rw [\u2190 nat_trans.comp_app, \u2190 nat_trans.comp_app, hg]),\n  naturality' := \u03bb X Y \u03b1, by simp only [equalizer.F_map, map_comp_map, nat_trans.naturality] }\n\nlemma map_nat_comp_map_nat {J} [category J] {V\u2081 V\u2082 V\u2083 W\u2081 W\u2082 W\u2083 : J \u2964 SemiNormedGroup}\n  {f\u2081 f\u2082 f\u2083 g\u2081 g\u2082 g\u2083} {\u03c6 : V\u2081 \u27f6 V\u2082} {\u03c8 : W\u2081 \u27f6 W\u2082} {\u03c6' : V\u2082 \u27f6 V\u2083} {\u03c8' : W\u2082 \u27f6 W\u2083}\n  (hf : \u03c6 \u226b f\u2082 = f\u2081 \u226b \u03c8) (hg : \u03c6 \u226b g\u2082 = g\u2081 \u226b \u03c8)\n  (hf' : \u03c6' \u226b f\u2083 = f\u2082 \u226b \u03c8') (hg' : \u03c6' \u226b g\u2083 = g\u2082 \u226b \u03c8') :\n  map_nat \u03c6 \u03c8 hf hg \u226b map_nat \u03c6' \u03c8' hf' hg' =\n  map_nat (\u03c6 \u226b \u03c6') (\u03c8 \u226b \u03c8') (comm_sq\u2082 hf hf') (comm_sq\u2082 hg hg') :=\nby { ext, refl }\n\nlemma map_nat_id {J} [category J] {V W : J \u2964 SemiNormedGroup} (f g : V \u27f6 W) :\n  map_nat (\ud835\udfd9 V) (\ud835\udfd9 W) (show \ud835\udfd9 V \u226b f = f \u226b \ud835\udfd9 W, by simp) (show \ud835\udfd9 V \u226b g = g \u226b \ud835\udfd9 W, by simp) = \ud835\udfd9 _ :=\nby { ext, refl }\n\nend equalizer\nend SemiNormedGroup\n\nuniverse variable u\nvariables (r : \u211d\u22650) (V : SemiNormedGroup) [normed_with_aut r V] [fact (0 < r)]\nvariables (r' : \u211d\u22650) [fact (0 < r')] [fact (r' \u2264 1)]\nvariables (M M\u2081 M\u2082 M\u2083 : ProFiltPseuNormGrpWithTinv.{u} r')\nvariables (c c\u2081 c\u2082 c\u2083 c\u2084 c\u2085 c\u2086 c\u2087 c\u2088 : \u211d\u22650) (l m n : \u2115)\nvariables (f : M\u2081 \u27f6 M\u2082) (g : M\u2082 \u27f6 M\u2083)\n\ndef CLCTinv (r : \u211d\u22650) (V : SemiNormedGroup)\n  [normed_with_aut r V] [fact (0 < r)] {A B : Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  SemiNormedGroup :=\nSemiNormedGroup.of $ normed_group_hom.equalizer\n  ((CLC V).map f)\n  ((CLC V).map g \u226b (CLC.T_inv r V).app B)\n\nnamespace CLCTinv\n\ndef \u03b9 (r : \u211d\u22650) (V : SemiNormedGroup)\n  [normed_with_aut r V] [fact (0 < r)] {A B : Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  CLCTinv r V f g \u27f6 (CLC V).obj A :=\nSemiNormedGroup.equalizer.\u03b9 _ _\n\nlemma \u03b9_range (r : \u211d\u22650) (V : SemiNormedGroup)\n  [normed_with_aut r V] [fact (0 < r)] {A B : Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  (\u03b9 r V f g).range =\n    normed_group_hom.ker ((CLC V).map f - ((CLC V).map g \u226b (CLC.T_inv r V).app B)) :=\nSemiNormedGroup.equalizer.\u03b9_range _ _\n\nlemma \u03b9_range' (r : \u211d\u22650) (V : SemiNormedGroup)\n  [normed_with_aut r V] [fact (0 < r)] {A B : Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  (\u03b9 r V f g).range =\n    normed_group_hom.ker (((CLC V).map g \u226b (CLC.T_inv r V).app B) - (CLC V).map f) :=\nSemiNormedGroup.equalizer.\u03b9_range' _ _\n\ndef map {A\u2081 B\u2081 A\u2082 B\u2082 : Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u27f6 A\u2082) (\u03c8 : B\u2081 \u27f6 B\u2082) (h\u2081 : \u03d5 \u226b f\u2082 = f\u2081 \u226b \u03c8) (h\u2082 : \u03d5 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  CLCTinv r V f\u2081 g\u2081 \u27f6 CLCTinv r V f\u2082 g\u2082 :=\nSemiNormedGroup.equalizer.map ((CLC V).map \u03d5) ((CLC V).map \u03c8)\n  (by rw [\u2190 functor.map_comp, \u2190 functor.map_comp, h\u2081]) $\nby rw [\u2190 category.assoc, \u2190 functor.map_comp, h\u2082, functor.map_comp,\n  category.assoc, (CLC.T_inv _ _).naturality, category.assoc]\n\nlemma map_comp_\u03b9 {A\u2081 B\u2081 A\u2082 B\u2082 : Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u27f6 A\u2082) (\u03c8 : B\u2081 \u27f6 B\u2082) (h\u2081 : \u03d5 \u226b f\u2082 = f\u2081 \u226b \u03c8) (h\u2082 : \u03d5 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  map r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5 \u03c8 h\u2081 h\u2082 \u226b \u03b9 r V _ _ = \u03b9 _ _ _ _ \u226b (CLC V).map \u03d5 :=\nnormed_group_hom.equalizer.\u03b9_comp_map _ _\n\nlemma map_norm_noninc {A\u2081 B\u2081 A\u2082 B\u2082 : Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u27f6 A\u2082) (\u03c8 : B\u2081 \u27f6 B\u2082) (h\u2081 h\u2082) :\n  (CLCTinv.map r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5 \u03c8 h\u2081 h\u2082).norm_noninc :=\nequalizer.map_norm_noninc _ _ $ CLC.map_norm_noninc _ _\n\nlemma norm_map_le {A\u2081 B\u2081 A\u2082 B\u2082 : Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u27f6 A\u2082) (\u03c8 : B\u2081 \u27f6 B\u2082) (h\u2081 h\u2082) (C : \u211d\u22650)\n  (H : \u2225SemiNormedGroup.equalizer.\u03b9\n         ((CLC V).map f\u2081)\n         ((CLC V).map g\u2081 \u226b (CLC.T_inv r V).app B\u2081) \u226b\n       (CLC V).map \u03d5\u2225 \u2264 C) :\n  \u2225CLCTinv.map r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5 \u03c8 h\u2081 h\u2082\u2225 \u2264 C :=\nSemiNormedGroup.equalizer.norm_map_le _ _ C H\n\n@[simp] lemma map_id {A B : Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  map r V f g f g (\ud835\udfd9 A) (\ud835\udfd9 B) rfl rfl = \ud835\udfd9 _ :=\nbegin\n  simp only [map, SemiNormedGroup.equalizer.map, category_theory.functor.map_id],\n  exact equalizer.map_id,\nend\n\nlemma map_comp {A\u2081 A\u2082 A\u2083 B\u2081 B\u2082 B\u2083 : Profinite\u1d52\u1d56}\n  {f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081} {f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082} {f\u2083 g\u2083 : A\u2083 \u27f6 B\u2083}\n  (\u03d5\u2081 : A\u2081 \u27f6 A\u2082) (\u03d5\u2082 : A\u2082 \u27f6 A\u2083) (\u03c8\u2081 : B\u2081 \u27f6 B\u2082) (\u03c8\u2082 : B\u2082 \u27f6 B\u2083)\n  (h1 h2 h3 h4 h5 h6) :\n  CLCTinv.map r V f\u2081 g\u2081 f\u2083 g\u2083 (\u03d5\u2081 \u226b \u03d5\u2082) (\u03c8\u2081 \u226b \u03c8\u2082) h1 h2 =\n  CLCTinv.map r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5\u2081 \u03c8\u2081 h3 h4 \u226b\n  CLCTinv.map r V f\u2082 g\u2082 f\u2083 g\u2083 \u03d5\u2082 \u03c8\u2082 h5 h6 :=\nbegin\n  simp only [map, SemiNormedGroup.equalizer.map, category_theory.functor.map_comp],\n  exact (equalizer.map_comp_map _ _ _ _).symm,\nend\n\nlemma map_comp_map {A\u2081 A\u2082 A\u2083 B\u2081 B\u2082 B\u2083 : Profinite\u1d52\u1d56}\n  {f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081} {f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082} {f\u2083 g\u2083 : A\u2083 \u27f6 B\u2083}\n  (\u03d5\u2081 : A\u2081 \u27f6 A\u2082) (\u03d5\u2082 : A\u2082 \u27f6 A\u2083) (\u03c8\u2081 : B\u2081 \u27f6 B\u2082) (\u03c8\u2082 : B\u2082 \u27f6 B\u2083)\n  (h\u2081 h\u2082 h\u2083 h\u2084) :\n  CLCTinv.map r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5\u2081 \u03c8\u2081 h\u2081 h\u2082 \u226b\n  CLCTinv.map r V f\u2082 g\u2082 f\u2083 g\u2083 \u03d5\u2082 \u03c8\u2082 h\u2083 h\u2084 =\n  CLCTinv.map r V f\u2081 g\u2081 f\u2083 g\u2083 (\u03d5\u2081 \u226b \u03d5\u2082) (\u03c8\u2081 \u226b \u03c8\u2082) (comm_sq\u2082 h\u2081 h\u2083) (comm_sq\u2082 h\u2082 h\u2084) :=\n(map_comp _ _ _ _ _ _ _ _ _ _ _ _).symm\n\n@[simps]\ndef map_iso {A\u2081 B\u2081 A\u2082 B\u2082 : Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u2245 A\u2082) (\u03c8 : B\u2081 \u2245 B\u2082) (h\u2081 : \u03d5.hom \u226b f\u2082 = f\u2081 \u226b \u03c8.hom) (h\u2082 : \u03d5.hom \u226b g\u2082 = g\u2081 \u226b \u03c8.hom) :\n  CLCTinv r V f\u2081 g\u2081 \u2245 CLCTinv r V f\u2082 g\u2082 :=\n{ hom := map r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5.hom \u03c8.hom h\u2081 h\u2082,\n  inv := map r V f\u2082 g\u2082 f\u2081 g\u2081 \u03d5.inv \u03c8.inv\n    (by rw [iso.inv_comp_eq, \u2190 category.assoc, iso.eq_comp_inv, h\u2081])\n    (by rw [iso.inv_comp_eq, \u2190 category.assoc, iso.eq_comp_inv, h\u2082]),\n  hom_inv_id' := by { simp only [map_comp_map, iso.hom_inv_id], apply map_id },\n  inv_hom_id' := by { simp only [map_comp_map, iso.inv_hom_id], apply map_id } }\n\nlemma map_iso_isometry {A\u2081 B\u2081 A\u2082 B\u2082 : Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u2245 A\u2082) (\u03c8 : B\u2081 \u2245 B\u2082) (h\u2081 : \u03d5.hom \u226b f\u2082 = f\u2081 \u226b \u03c8.hom) (h\u2082 : \u03d5.hom \u226b g\u2082 = g\u2081 \u226b \u03c8.hom) :\n  isometry (map_iso r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5 \u03c8 h\u2081 h\u2082).hom :=\nbegin\n  apply SemiNormedGroup.iso_isometry_of_norm_noninc;\n  apply map_norm_noninc\nend\n\n@[simps]\nprotected def F {J} [category J] (r : \u211d\u22650) (V : SemiNormedGroup)\n  [normed_with_aut r V] [fact (0 < r)] {A B : J \u2964 Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  J \u2964 SemiNormedGroup :=\n{ obj := \u03bb X, CLCTinv r V (f.app X) (g.app X),\n  map := \u03bb X Y \u03c6, map _ _ _ _ _ _ (A.map \u03c6) (B.map \u03c6) (f.naturality _) (g.naturality _),\n  map_id' := \u03bb X, by simp only [category_theory.functor.map_id]; apply map_id,\n  map_comp' := \u03bb X Y Z \u03c6 \u03c8, by simp only [functor.map_comp]; apply map_comp }\n\ntheorem F_def {J} [category J] (r : \u211d\u22650) (V : SemiNormedGroup)\n  [normed_with_aut r V] [fact (0 < r)] {A B : J \u2964 Profinite\u1d52\u1d56} (f g : A \u27f6 B) :\n  CLCTinv.F r V f g = SemiNormedGroup.equalizer.F\n    (whisker_right f (CLC V))\n    (whisker_right g (CLC V) \u226b whisker_left B (CLC.T_inv r V)) := rfl\n\n@[simps]\ndef map_nat {J} [category J] {A\u2081 B\u2081 A\u2082 B\u2082 : J \u2964 Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u27f6 A\u2082) (\u03c8 : B\u2081 \u27f6 B\u2082) (h\u2081 : \u03d5 \u226b f\u2082 = f\u2081 \u226b \u03c8) (h\u2082 : \u03d5 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  CLCTinv.F r V f\u2081 g\u2081 \u27f6 CLCTinv.F r V f\u2082 g\u2082 :=\n{ app := \u03bb X, map _ _ _ _ _ _ (\u03d5.app X) (\u03c8.app X)\n    (by rw [\u2190 nat_trans.comp_app, h\u2081, nat_trans.comp_app])\n    (by rw [\u2190 nat_trans.comp_app, h\u2082, nat_trans.comp_app]),\n  naturality' := \u03bb X Y \u03b1, by simp only [CLCTinv.F_map, map_comp_map, \u03d5.naturality, \u03c8.naturality] }\n\ntheorem map_nat_def {J} [category J] {A\u2081 B\u2081 A\u2082 B\u2082 : J \u2964 Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u27f6 A\u2082) (\u03c8 : B\u2081 \u27f6 B\u2082) (h\u2081 : \u03d5 \u226b f\u2082 = f\u2081 \u226b \u03c8) (h\u2082 : \u03d5 \u226b g\u2082 = g\u2081 \u226b \u03c8) :\n  map_nat r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5 \u03c8 h\u2081 h\u2082 = begin\n    dsimp only [F_def],\n    refine SemiNormedGroup.equalizer.map_nat\n      (whisker_right \u03d5 (CLC V))\n      (whisker_right \u03c8 (CLC V))\n      (by rw [\u2190 whisker_right_comp, \u2190 whisker_right_comp, h\u2081])\n      (comm_sq\u2082 _ _).symm,\n    { exact whisker_right \u03c8 _ },\n    { rw [\u2190 whisker_right_comp, \u2190 whisker_right_comp, h\u2082] },\n    ext x : 2,\n    simp only [nat_trans.comp_app, whisker_left_app, whisker_right_app,\n      (CLC.T_inv _ _).naturality],\n  end := rfl\n.\n\n-- @[simps]\ndef map_nat_iso {J} [category J] {A\u2081 B\u2081 A\u2082 B\u2082 : J \u2964 Profinite\u1d52\u1d56} (f\u2081 g\u2081 : A\u2081 \u27f6 B\u2081) (f\u2082 g\u2082 : A\u2082 \u27f6 B\u2082)\n  (\u03d5 : A\u2081 \u2245 A\u2082) (\u03c8 : B\u2081 \u2245 B\u2082) (h\u2081 : \u03d5.hom \u226b f\u2082 = f\u2081 \u226b \u03c8.hom) (h\u2082 : \u03d5.hom \u226b g\u2082 = g\u2081 \u226b \u03c8.hom) :\n  CLCTinv.F r V f\u2081 g\u2081 \u2245 CLCTinv.F r V f\u2082 g\u2082 :=\n{ hom := map_nat r V f\u2081 g\u2081 f\u2082 g\u2082 \u03d5.hom \u03c8.hom h\u2081 h\u2082,\n  inv := map_nat r V f\u2082 g\u2082 f\u2081 g\u2081 \u03d5.inv \u03c8.inv\n    (by rw [iso.inv_comp_eq, \u2190 category.assoc, iso.eq_comp_inv, h\u2081])\n    (by rw [iso.inv_comp_eq, \u2190 category.assoc, iso.eq_comp_inv, h\u2082]),\n  hom_inv_id' :=\n  begin\n    simp only [map_nat_def, _root_.id, SemiNormedGroup.equalizer.map_nat_comp_map_nat,\n      \u2190 whisker_right_comp, iso.hom_inv_id, whisker_right_id', SemiNormedGroup.equalizer.map_nat_id],\n    refl\n  end,\n  inv_hom_id' :=\n  begin\n    simp only [map_nat_def, _root_.id, SemiNormedGroup.equalizer.map_nat_comp_map_nat,\n      \u2190 whisker_right_comp, iso.inv_hom_id, whisker_right_id', SemiNormedGroup.equalizer.map_nat_id],\n    refl\n  end, }\n\nend CLCTinv\n\nlemma aux (r' c c\u2082 : \u211d\u22650) [r1 : fact (r' \u2264 1)] [h : fact (c\u2082 \u2264 r' * c)] : fact (c\u2082 \u2264 c) :=\n\u27e8h.1.trans $ (mul_le_mul' r1.1 le_rfl).trans (by simp)\u27e9\n\n@[simps obj]\ndef CLCFPTinv\u2082 (r : \u211d\u22650) (V : SemiNormedGroup)\n  (r' : \u211d\u22650) [fact (0 < r)] [fact (0 < r')] [r1 : fact (r' \u2264 1)] [normed_with_aut r V]\n  (c c\u2082 : \u211d\u22650) [fact (c\u2082 \u2264 r' * c)] (n : \u2115) : (ProFiltPseuNormGrpWithTinv r')\u1d52\u1d56 \u2964 SemiNormedGroup :=\nby haveI : fact (c\u2082 \u2264 c) := aux r' c c\u2082; exact\nCLCTinv.F r V\n  (nat_trans.op (FiltrationPow.Tinv r' c\u2082 c n))\n  (nat_trans.op (FiltrationPow.cast_le r' c\u2082 c n))\n\ntheorem CLCFPTinv\u2082_def (r : \u211d\u22650) (V : SemiNormedGroup)\n  (r' : \u211d\u22650) [fact (0 < r)] [fact (0 < r')] [r1 : fact (r' \u2264 1)] [normed_with_aut r V]\n  (c c\u2082 : \u211d\u22650) [fact (c\u2082 \u2264 r' * c)] (n : \u2115) :\n  CLCFPTinv\u2082 r V r' c c\u2082 n = SemiNormedGroup.equalizer.F\n    (CLCFP.Tinv V r' c c\u2082 n)\n    (@CLCFP.res V r' c c\u2082 n (aux r' c c\u2082) \u226b CLCFP.T_inv r V r' c\u2082 n) := rfl\n\ninstance CLCFPTinv\u2082.separated_space [fact (c\u2082 \u2264 r' * c\u2081)] (M) :\n  separated_space ((CLCFPTinv\u2082 r V r' c\u2081 c\u2082 n).obj M) :=\nbegin\n  rw separated_iff_t2,\n  refine @subtype.t2_space _ _ (id _) (id _),\n  rw \u2190 separated_iff_t2,\n  apply uniform_space.completion.separated_space\nend\n\ninstance CLCFPTinv\u2082.complete_space [fact (c\u2082 \u2264 r' * c\u2081)] (M) :\n  complete_space ((CLCFPTinv\u2082 r V r' c\u2081 c\u2082 n).obj M) :=\nbegin\n  refine @is_closed.complete_space_coe _ (id _) (id _) _ _,\n  { apply uniform_space.completion.complete_space },\n  { refine is_closed_eq _ continuous_const,\n    apply normed_group_hom.continuous }\nend\n\n/-- The functor that sends `M` and `c` to `V-hat((filtration M c)^n)^{T\u207b\u00b9}`,\ndefined by taking `T\u207b\u00b9`-invariants for two different actions by `T\u207b\u00b9`:\n\n* The first comes from the action of `T\u207b\u00b9` on `M`.\n* The second comes from the action of `T\u207b\u00b9` on `V`.\n\nWe take the equalizer of those two actions.\n\nSee the lines just above Definition 9.3 of [Analytic]. -/\ndef CLCFPTinv (r : \u211d\u22650) (V : SemiNormedGroup) (r' : \u211d\u22650)\n  (c : \u211d\u22650) (n : \u2115) [normed_with_aut r V] [fact (0 < r)] [fact (0 < r')] [fact (r' \u2264 1)] :\n  (ProFiltPseuNormGrpWithTinv r')\u1d52\u1d56 \u2964 SemiNormedGroup :=\nCLCFPTinv\u2082 r V r' c (r' * c) n\n\nnamespace CLCFPTinv\u2082\n\nlemma map_norm_noninc [fact (c\u2082 \u2264 r' * c)] [fact (c\u2082 \u2264 c)]\n  {M\u2081 M\u2082} (f : M\u2081 \u27f6 M\u2082) : ((CLCFPTinv\u2082 r V r' c c\u2082 n).map f).norm_noninc :=\nCLCTinv.map_norm_noninc _ _ _ _ _ _ _ _ _ _\n\ndef res [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2082 \u2264 c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)] [fact (c\u2084 \u2264 c\u2083)]\n  [fact (c\u2083 \u2264 c\u2081)] [fact (c\u2084 \u2264 c\u2082)] : CLCFPTinv\u2082 r V r' c\u2081 c\u2082 n \u27f6 CLCFPTinv\u2082 r V r' c\u2083 c\u2084 n :=\nCLCTinv.map_nat r V _ _ _ _\n  (nat_trans.op (FiltrationPow.cast_le _ c\u2083 c\u2081 n))\n  (nat_trans.op (FiltrationPow.cast_le _ c\u2084 c\u2082 n)) rfl rfl\n\n@[simp] lemma res_refl [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2082 \u2264 c\u2081)] : res r V r' c\u2081 c\u2082 c\u2081 c\u2082 n = \ud835\udfd9 _ :=\nby { simp only [res, FiltrationPow.cast_le_refl, nat_trans.op_id], ext x : 2, apply CLCTinv.map_id }\n\nlemma res_comp_res\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2082 \u2264 c\u2081)]\n  [fact (c\u2084 \u2264 r' * c\u2083)] [fact (c\u2084 \u2264 c\u2083)]\n  [fact (c\u2086 \u2264 r' * c\u2085)] [fact (c\u2086 \u2264 c\u2085)]\n  [fact (c\u2083 \u2264 c\u2081)] [fact (c\u2084 \u2264 c\u2082)]\n  [fact (c\u2085 \u2264 c\u2083)] [fact (c\u2086 \u2264 c\u2084)]\n  [fact (c\u2085 \u2264 c\u2081)] [fact (c\u2086 \u2264 c\u2082)] :\n  res r V r' c\u2081 c\u2082 c\u2083 c\u2084 n \u226b res r V r' c\u2083 c\u2084 c\u2085 c\u2086 n = res r V r' c\u2081 c\u2082 c\u2085 c\u2086 n :=\nbegin\n  ext x : 2, simp only [res, nat_trans.comp_app],\n  exact (CLCTinv.map_comp _ _ _ _ _ _ _ _ _ _ _ _).symm\nend\n\nlemma res_norm_noninc {_ : fact (c\u2082 \u2264 r' * c\u2081)} {_ : fact (c\u2082 \u2264 c\u2081)}\n  {_ : fact (c\u2084 \u2264 r' * c\u2083)} {_ : fact (c\u2084 \u2264 c\u2083)} {_ : fact (c\u2083 \u2264 c\u2081)} {_ : fact (c\u2084 \u2264 c\u2082)} (M) :\n  ((res r V r' c\u2081 c\u2082 c\u2083 c\u2084 n).app M).norm_noninc :=\nCLCTinv.map_norm_noninc _ _ _ _ _ _ _ _ _ _\n\nlemma norm_res_le [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2082 \u2264 c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)] [fact (c\u2084 \u2264 c\u2083)]\n  [fact (c\u2083 \u2264 c\u2081)] [fact (c\u2084 \u2264 c\u2082)] (h\u2082\u2083 : c\u2082 = c\u2083) (M) :\n  \u2225(res r V r' c\u2081 c\u2082 c\u2083 c\u2084 n).app M\u2225 \u2264 r :=\nbegin\n  apply CLCTinv.norm_map_le,\n  rw [\u2190 category.comp_id ((CLC V).map ((nat_trans.op (FiltrationPow.cast_le r' c\u2083 c\u2081 n)).app M))],\n  have := nat_trans.congr_app (CLC.T r V).inv_hom_id ((FiltrationPow r' c\u2083 n).op.obj M),\n  dsimp only [nat_trans.id_app] at this,\n  rw [\u2190 this, CLC.T_inv_eq, nat_trans.comp_app, \u2190 category.assoc ((CLC V).map _)],\n  unfreezingI { subst c\u2083 },\n  rw [\u2190 SemiNormedGroup.equalizer.condition_assoc, \u2190 category.assoc],\n  refine normed_group_hom.norm_comp_le_of_le' 1 r r (mul_one \u2191r).symm _ _,\n  { apply CLC.norm_T_le },\n  { apply norm_noninc.norm_noninc_iff_norm_le_one.1,\n    exact (CLC.map_norm_noninc V _).comp equalizer.\u03b9_norm_noninc }\nend\n\nend CLCFPTinv\u2082\n\nnamespace CLCFPTinv\n\nlemma map_norm_noninc {M\u2081 M\u2082} (f : M\u2081 \u27f6 M\u2082) : ((CLCFPTinv r V r' c n).map f).norm_noninc :=\nCLCFPTinv\u2082.map_norm_noninc _ _ _ _ _ _ _\n\ndef res [fact (c\u2082 \u2264 c\u2081)] : CLCFPTinv r V r' c\u2081 n \u27f6 CLCFPTinv r V r' c\u2082 n :=\nCLCFPTinv\u2082.res r V r' c\u2081 _ c\u2082 _ n\n\n@[simp] lemma res_refl : res r V r' c\u2081 c\u2081 n = \ud835\udfd9 _ :=\nCLCFPTinv\u2082.res_refl _ _ _ _ _ _\n\nlemma res_comp_res [fact (c\u2083 \u2264 c\u2081)] [fact (c\u2085 \u2264 c\u2083)] [fact (c\u2085 \u2264 c\u2081)] :\n  res r V r' c\u2081 c\u2083 n \u226b res r V r' c\u2083 c\u2085 n = res r V r' c\u2081 c\u2085 n :=\nCLCFPTinv\u2082.res_comp_res _ _ _ _ _ _ _ _ _ _\n\nlemma res_norm_noninc {_ : fact (c\u2082 \u2264 c\u2081)} (M) :\n  ((res r V r' c\u2081 c\u2082 n).app M).norm_noninc :=\nCLCFPTinv\u2082.res_norm_noninc r V r' _ _ _ _ _ _\n\nlemma norm_res_le [fact (c\u2082 \u2264 c\u2081)] [fact (c\u2082 \u2264 r' * c\u2081)] (M) :\n  \u2225(res r V r' c\u2081 c\u2082 n).app M\u2225 \u2264 r :=\nbegin\n  rw \u2190 res_comp_res r V r' c\u2081 (r' * c\u2081) c\u2082,\n  refine norm_comp_le_of_le' _ _ _ (one_mul \u2191r).symm _ (CLCFPTinv\u2082.norm_res_le r V r' _ _ _ _ n rfl M),\n  apply norm_noninc.norm_noninc_iff_norm_le_one.1,\n  exact CLCTinv.map_norm_noninc r V _ _ _ _ _ _ _ _\nend\n\nlemma norm_res_le_pow (N : \u2115) [fact (c\u2082 \u2264 c\u2081)] [h : fact (c\u2082 \u2264 r' ^ N * c\u2081)] (M) :\n  \u2225(res r V r' c\u2081 c\u2082 n).app M\u2225 \u2264 (r ^ N) :=\nbegin\n  unfreezingI { induction N with N ih generalizing c\u2081 c\u2082 },\n  { rw pow_zero,\n    apply norm_noninc.norm_noninc_iff_norm_le_one.1,\n    exact CLCTinv.map_norm_noninc r V _ _ _ _ _ _ _ _ },\n  haveI : fact (c\u2082 \u2264 r' ^ N * c\u2081) := nnreal.fact_le_pow_mul_of_le_pow_succ_mul _ _ _,\n  rw [pow_succ, mul_assoc] at h, resetI,\n  rw [\u2190 res_comp_res r V r' c\u2081 (r' ^ N * c\u2081) c\u2082],\n  exact norm_comp_le_of_le' _ _ _ (pow_succ _ _) (norm_res_le r V r' _ _ n M) (ih _ _)\nend\n\nend CLCFPTinv\n\nnamespace breen_deligne\n\nopen CLCFPTinv\n\nvariables (M) {l m n}\n\nnamespace universal_map\n\nvariables (\u03d5 \u03c8 : universal_map m n)\n\ndef eval_CLCFPTinv\u2082\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)]\n  [\u03d5.suitable c\u2083 c\u2081] [\u03d5.suitable c\u2084 c\u2082] :\n  CLCFPTinv\u2082 r V r' c\u2081 c\u2082 n \u27f6 CLCFPTinv\u2082 r V r' c\u2083 c\u2084 m :=\nbegin\n  dsimp only [CLCFPTinv\u2082_def],\n  refine SemiNormedGroup.equalizer.map_nat (\u03d5.eval_CLCFP _ _ _ _) (\u03d5.eval_CLCFP _ _ _ _)\n    (Tinv_comp_eval_CLCFP V r' c\u2081 c\u2082 c\u2083 c\u2084 \u03d5).symm _,\n  haveI : fact (c\u2082 \u2264 c\u2081) := aux r' _ _, haveI : fact (c\u2084 \u2264 c\u2083) := aux r' _ _,\n  have h\u2081 := res_comp_eval_CLCFP V r' c\u2081 c\u2082 c\u2083 c\u2084 \u03d5,\n  have h\u2082 := T_inv_comp_eval_CLCFP r V r' c\u2082 c\u2084 \u03d5,\n  have := comm_sq\u2082 h\u2081 h\u2082,\n  exact this.symm\nend\n\n@[simp] lemma eval_CLCFPTinv\u2082_zero\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)] :\n  (0 : universal_map m n).eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 = 0 :=\nby { simp only [eval_CLCFPTinv\u2082, eval_CLCFP_zero], ext, refl }\n\n@[simp] lemma eval_CLCFPTinv\u2082_add\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)]\n  [\u03d5.suitable c\u2083 c\u2081] [\u03d5.suitable c\u2084 c\u2082]\n  [\u03c8.suitable c\u2083 c\u2081] [\u03c8.suitable c\u2084 c\u2082] :\n  (\u03d5 + \u03c8 : universal_map m n).eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 =\n  \u03d5.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 + \u03c8.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 :=\nby { simp only [eval_CLCFPTinv\u2082, eval_CLCFP_add], ext, refl }\n\n@[simp] lemma eval_CLCFPTinv\u2082_sub\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)]\n  [\u03d5.suitable c\u2083 c\u2081] [\u03d5.suitable c\u2084 c\u2082]\n  [\u03c8.suitable c\u2083 c\u2081] [\u03c8.suitable c\u2084 c\u2082] :\n  (\u03d5 - \u03c8 : universal_map m n).eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 =\n  \u03d5.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 - \u03c8.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 :=\nby { simp only [eval_CLCFPTinv\u2082, eval_CLCFP_sub], ext, refl }\n\nlemma eval_CLCFPTinv\u2082_comp {l m n : FreeMat} (f : l \u27f6 m) (g : m \u27f6 n)\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)] [fact (c\u2086 \u2264 r' * c\u2085)]\n  [f.suitable c\u2085 c\u2083] [f.suitable c\u2086 c\u2084] [g.suitable c\u2083 c\u2081] [g.suitable c\u2084 c\u2082] :\n  @eval_CLCFPTinv\u2082 r V _ _ r' _ _ c\u2081 c\u2082 c\u2085 c\u2086 _ _ (f \u226b g)\n    _ _ (suitable.comp c\u2083) (suitable.comp c\u2084) =\n  g.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084 \u226b f.eval_CLCFPTinv\u2082 r V r' c\u2083 c\u2084 c\u2085 c\u2086 :=\nbegin\n  dsimp only [eval_CLCFPTinv\u2082, CLCFPTinv\u2082_def], delta id,\n  simp only [SemiNormedGroup.equalizer.map_nat_comp_map_nat],\n  generalize_proofs h1 h2 h3 h4 h5 h6 h7 h8,\n  revert h5 h6 h7 h8, resetI,\n  have H1 : eval_CLCFP V r' c\u2081 c\u2085 (f \u226b g) = eval_CLCFP V r' c\u2081 c\u2083 g \u226b eval_CLCFP V r' c\u2083 c\u2085 f :=\n    eval_CLCFP_comp V r' c\u2081 c\u2083 c\u2085 g f,\n  have H2 : eval_CLCFP V r' c\u2082 c\u2086 (f \u226b g) = eval_CLCFP V r' c\u2082 c\u2084 g \u226b eval_CLCFP V r' c\u2084 c\u2086 f :=\n    eval_CLCFP_comp V r' c\u2082 c\u2084 c\u2086 g f,\n  rw [H1, H2],\n  intros, refl,\nend\n\nlemma res_comp_eval_CLCFPTinv\u2082\n  [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)]\n  [fact (c\u2086 \u2264 r' * c\u2085)] [fact (c\u2088 \u2264 r' * c\u2087)]\n  [fact (c\u2082 \u2264 c\u2081)] [fact (c\u2083 \u2264 c\u2081)] [fact (c\u2084 \u2264 c\u2082)] [fact (c\u2084 \u2264 c\u2083)]\n  [fact (c\u2086 \u2264 c\u2085)] [fact (c\u2087 \u2264 c\u2085)] [fact (c\u2088 \u2264 c\u2086)] [fact (c\u2088 \u2264 c\u2087)]\n  [\u03d5.suitable c\u2085 c\u2081] [\u03d5.suitable c\u2086 c\u2082]\n  [\u03d5.suitable c\u2087 c\u2083] [\u03d5.suitable c\u2088 c\u2084] :\n  CLCFPTinv\u2082.res r V r' c\u2081 c\u2082 c\u2083 c\u2084 n \u226b \u03d5.eval_CLCFPTinv\u2082 r V r' c\u2083 c\u2084 c\u2087 c\u2088 =\n    \u03d5.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2085 c\u2086 \u226b CLCFPTinv\u2082.res r V r' c\u2085 c\u2086 c\u2087 c\u2088 m :=\nbegin\n  dsimp only [CLCFPTinv\u2082.res, eval_CLCFPTinv\u2082, CLCFPTinv\u2082_def, CLCTinv.map_nat_def], delta id,\n  simp only [SemiNormedGroup.equalizer.map_nat_comp_map_nat],\n  congr' 1; { simp only [\u2190 CLCFP.res_def], apply res_comp_eval_CLCFP },\nend\n\nlemma norm_eval_CLCFPTinv\u2082_le [fact (c\u2082 \u2264 r' * c\u2081)] [fact (c\u2084 \u2264 r' * c\u2083)]\n  [\u03d5.suitable c\u2083 c\u2081] [\u03d5.suitable c\u2084 c\u2082] (N : \u2115) (h : \u03d5.bound_by N) (M) :\n  \u2225(\u03d5.eval_CLCFPTinv\u2082 r V r' c\u2081 c\u2082 c\u2083 c\u2084).app M\u2225 \u2264 N :=\nbegin\n  apply SemiNormedGroup.equalizer.norm_map_le,\n  refine normed_group_hom.norm_comp_le_of_le' _ _ _ (mul_one _).symm _ _,\n  { apply norm_eval_CLCFP_le, exact h },\n  { apply norm_noninc.norm_noninc_iff_norm_le_one.1,\n    exact equalizer.\u03b9_norm_noninc }\nend\n\ndef eval_CLCFPTinv [\u03d5.suitable c\u2082 c\u2081] :\n  CLCFPTinv r V r' c\u2081 n \u27f6 CLCFPTinv r V r' c\u2082 m :=\n\u03d5.eval_CLCFPTinv\u2082 r V r' c\u2081 _ c\u2082 _\n\nlemma eval_CLCFPTinv_def [\u03d5.suitable c\u2082 c\u2081] :\n  \u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2082 = \u03d5.eval_CLCFPTinv\u2082 r V r' c\u2081 _ c\u2082 _ := rfl\n\n@[simp] lemma eval_CLCFPTinv_zero :\n  (0 : universal_map m n).eval_CLCFPTinv r V r' c\u2081 c\u2082 = 0 :=\nby apply eval_CLCFPTinv\u2082_zero\n\n@[simp] lemma eval_CLCFPTinv_add [\u03d5.suitable c\u2082 c\u2081] [\u03c8.suitable c\u2082 c\u2081] :\n  (\u03d5 + \u03c8 : universal_map m n).eval_CLCFPTinv r V r' c\u2081 c\u2082 =\n  \u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2082 + \u03c8.eval_CLCFPTinv r V r' c\u2081 c\u2082 :=\neval_CLCFPTinv\u2082_add _ _ _ _ _ _ _ _ _\n\n@[simp] lemma eval_CLCFPTinv_sub [\u03d5.suitable c\u2082 c\u2081] [\u03c8.suitable c\u2082 c\u2081] :\n  (\u03d5 - \u03c8 : universal_map m n).eval_CLCFPTinv r V r' c\u2081 c\u2082 =\n  \u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2082 - \u03c8.eval_CLCFPTinv r V r' c\u2081 c\u2082 :=\neval_CLCFPTinv\u2082_sub _ _ _ _ _ _ _ _ _\n\nlemma eval_CLCFPTinv_comp {l m n : FreeMat} (f : l \u27f6 m) (g : m \u27f6 n)\n  [hg : g.suitable c\u2082 c\u2081] [hf : f.suitable c\u2083 c\u2082] :\n  @eval_CLCFPTinv r V _ _ r' _ _ c\u2081 c\u2083 _ _ (f \u226b g) (suitable.comp c\u2082) =\n    g.eval_CLCFPTinv r V r' c\u2081 c\u2082 \u226b f.eval_CLCFPTinv r V r' c\u2082 c\u2083 :=\nby apply eval_CLCFPTinv\u2082_comp\n\nlemma res_comp_eval_CLCFPTinv\n  [fact (c\u2082 \u2264 c\u2081)] [\u03d5.suitable c\u2084 c\u2082] [\u03d5.suitable c\u2083 c\u2081] [fact (c\u2084 \u2264 c\u2083)] :\n  res r V r' c\u2081 c\u2082 n \u226b \u03d5.eval_CLCFPTinv r V r' c\u2082 c\u2084 =\n    \u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2083 \u226b res r V r' c\u2083 c\u2084 m :=\nby apply res_comp_eval_CLCFPTinv\u2082\n\nlemma res_comp_eval_CLCFPTinv_absorb\n  [fact (c\u2082 \u2264 c\u2081)] [h\u03d5 : \u03d5.suitable c\u2083 c\u2082] :\n  res r V r' c\u2081 c\u2082 n \u226b \u03d5.eval_CLCFPTinv r V r' c\u2082 c\u2083 =\n    @eval_CLCFPTinv r V _ _ r' _ _ c\u2081 c\u2083 _ _ \u03d5 (h\u03d5.le _ _ _ _ le_rfl (fact.out _)) :=\nby rw [@res_comp_eval_CLCFPTinv r V _ _ r' _ _ c\u2081 c\u2082 c\u2083 c\u2083 _ _ \u03d5\n      (_root_.id _) (_root_.id _) (_root_.id _) (_root_.id _),\n    res_refl, category.comp_id]\n\nlemma eval_CLCFPTinv_comp_res_absorb\n  {_: fact (c\u2083 \u2264 c\u2082)} [h\u03d5 : \u03d5.suitable c\u2082 c\u2081] :\n  \u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2082 \u226b res r V r' c\u2082 c\u2083 m =\n    @eval_CLCFPTinv r V _ _ r' _ _ c\u2081 c\u2083 _ _ \u03d5 (h\u03d5.le _ _ _ _ (fact.out _) le_rfl) :=\nby rw [\u2190 @res_comp_eval_CLCFPTinv r V _ _ r' _ _ c\u2081 c\u2081 c\u2082 c\u2083 _ _ \u03d5\n      (_root_.id _) (_root_.id _) (_root_.id _) (_root_.id _),\n    res_refl, category.id_comp]\n\nlemma norm_eval_CLCFPTinv_le [normed_with_aut r V] [fact (0 < r)] [\u03d5.suitable c\u2082 c\u2081]\n  (N : \u2115) (h : \u03d5.bound_by N) (M) :\n  \u2225(\u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2082).app M\u2225 \u2264 N :=\nnorm_eval_CLCFPTinv\u2082_le r V r' _ _ _ _ _ N h M\n\nlemma eval_CLCFPTinv_norm_noninc [normed_with_aut r V] [fact (0 < r)]\n  [h : \u03d5.very_suitable r r' c\u2082 c\u2081] (M) :\n  ((\u03d5.eval_CLCFPTinv r V r' c\u2081 c\u2082).app M).norm_noninc :=\nbegin\n  apply norm_noninc.norm_noninc_iff_norm_le_one.2,\n  have h' := h,\n  unfreezingI { rcases h with \u27e8N, k, c', hN, h\u03d5, hr, H\u27e9 },\n  haveI : fact (c' \u2264 c\u2081) := \u27e8H.trans $ fact.out _\u27e9,\n  have aux := res_comp_eval_CLCFPTinv r V r' c\u2081 c' c\u2082 c\u2082 \u03d5,\n  rw [res_refl, category.comp_id] at aux,\n  rw \u2190 aux,\n  refine le_trans _ hr,\n  rw mul_comm,\n  apply normed_group_hom.norm_comp_le_of_le,\n  { apply_mod_cast norm_eval_CLCFPTinv_le, exact hN },\n  { haveI : fact (c' \u2264 r' ^ k * c\u2081) := \u27e8H\u27e9,\n    rw nnreal.coe_pow,\n    apply norm_res_le_pow },\nend\n\nend universal_map\n\nend breen_deligne\n\nattribute [irreducible] CLCFPTinv\u2082 CLCFPTinv\u2082.res\n  breen_deligne.universal_map.eval_CLCFPTinv\u2082\n", "meta": {"author": "bentoner", "repo": "debug", "sha": "b8a75381caa90aa9942c20e08a44e45d0ae60d18", "save_path": "github-repos/lean/bentoner-debug", "path": "github-repos/lean/bentoner-debug/debug-b8a75381caa90aa9942c20e08a44e45d0ae60d18/src/pseudo_normed_group/Tinv.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5078118642792044, "lm_q2_score": 0.38861802670584894, "lm_q1q2_score": 0.19734484463400281}}
{"text": "-- Copyright (c) 2018 Scott Morrison. All rights reserved.\n-- Released under Apache 2.0 license as described in the file LICENSE.\n-- Authors: Scott Morrison\n\nimport category_theory.const\n\nuniverses v w u -- declare the `v`'s first; see `category_theory.category` for an explanation\n\nnamespace category_theory\n\ninstance punit_category : small_category punit :=\n{ hom  := \u03bb X Y, punit,\n  id   := \u03bb _, punit.star,\n  comp := \u03bb _ _ _ _ _, punit.star }\n\nnamespace functor\nvariables {C : Type u} [\ud835\udc9e : category.{v} C]\ninclude \ud835\udc9e\n\n/-- The constant functor. For `X : C`, `of.obj X` is the functor `punit \u2964 C`\n  that maps `punit.star` to `X`. -/\ndef of : C \u2964 (punit.{w+1} \u2964 C) := const punit\n\nnamespace of\n@[simp] lemma obj_obj (X : C) : (of.obj X).obj = \u03bb _, X := rfl\n@[simp] lemma obj_map (X : C) : (of.obj X).map = \u03bb _ _ _, \ud835\udfd9 X := rfl\n@[simp] lemma map_app {X Y : C} (f : X \u27f6 Y) : (of.map f).app = \u03bb _, f := rfl\nend of\n\nend functor\n\nend category_theory\n", "meta": {"author": "digama0", "repo": "mathlib-ITP2019", "sha": "5cbd0362e04e671ef5db1284870592af6950197c", "save_path": "github-repos/lean/digama0-mathlib-ITP2019", "path": "github-repos/lean/digama0-mathlib-ITP2019/mathlib-ITP2019-5cbd0362e04e671ef5db1284870592af6950197c/src/category_theory/punit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5583269943353745, "lm_q2_score": 0.35220178204788966, "lm_q1q2_score": 0.19664376237036088}}
{"text": "example (x : Nat) : True :=\nmatch h:x with\n\nsection end\n\nstructure A where\nh : Nat := 1\nh2 : h \u2260 0 := by\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/lean/689.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5156199157230157, "lm_q2_score": 0.38121956625614994, "lm_q1q2_score": 0.19656440062496064}}
{"text": "/-\nCopyright (c) 2016 Microsoft Corporation. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthor: Leonardo de Moura\n-/\nprelude\nimport Init.Data.UInt.Basic\n\n/-- Determines if the given integer is a valid [Unicode scalar value](https://www.unicode.org/glossary/#unicode_scalar_value).\n\nNote that values in `[0xd800, 0xdfff]` are reserved for [UTF-16 surrogate pairs](https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates).\n-/\n@[inline, reducible] def isValidChar (n : UInt32) : Prop :=\n  n < 0xd800 \u2228 (0xdfff < n \u2227 n < 0x110000)\n\nnamespace Char\n\nprotected def lt (a b : Char) : Prop := a.val < b.val\nprotected def le (a b : Char) : Prop := a.val \u2264 b.val\n\ninstance : LT Char := \u27e8Char.lt\u27e9\ninstance : LE Char := \u27e8Char.le\u27e9\n\ninstance (a b : Char) :  Decidable (a < b) :=\n  UInt32.decLt _ _\n\ninstance (a b : Char) : Decidable (a \u2264 b) :=\n  UInt32.decLe _ _\n\n/-- Determines if the given nat is a valid [Unicode scalar value](https://www.unicode.org/glossary/#unicode_scalar_value).-/\nabbrev isValidCharNat (n : Nat) : Prop :=\n  n < 0xd800 \u2228 (0xdfff < n \u2227 n < 0x110000)\n\ntheorem isValidUInt32 (n : Nat) (h : isValidCharNat n) : n < UInt32.size := by\n  match h with\n  | Or.inl h        =>\n    apply Nat.lt_trans h\n    decide\n  | Or.inr \u27e8_,  h\u2082\u27e9 =>\n    apply Nat.lt_trans h\u2082\n    decide\n\ntheorem isValidChar_of_isValidChar_Nat (n : Nat) (h : isValidCharNat n) : isValidChar (UInt32.ofNat' n (isValidUInt32 n h)) :=\n  match h with\n  | Or.inl h        => Or.inl h\n  | Or.inr \u27e8h\u2081, h\u2082\u27e9 => Or.inr \u27e8h\u2081, h\u2082\u27e9\n\ntheorem isValidChar_zero : isValidChar 0 :=\n  Or.inl (by decide)\n\n/-- Underlying unicode code point as a `Nat`. -/\n@[inline] def toNat (c : Char) : Nat :=\n  c.val.toNat\n\ninstance : Inhabited Char where\n  default := 'A'\n\n/-- Is the character a space (U+0020) a tab (U+0009), a carriage return (U+000D) or a newline (U+000A)? -/\ndef isWhitespace (c : Char) : Bool :=\n  c = ' ' || c = '\\t' || c = '\\r' || c = '\\n'\n\n/-- Is the character in `ABCDEFGHIJKLMNOPQRSTUVWXYZ`? -/\ndef isUpper (c : Char) : Bool :=\n  c.val \u2265 65 && c.val \u2264 90\n\n/-- Is the character in `abcdefghijklmnopqrstuvwxyz`? -/\ndef isLower (c : Char) : Bool :=\n  c.val \u2265 97 && c.val \u2264 122\n\n/-- Is the character in `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`? -/\ndef isAlpha (c : Char) : Bool :=\n  c.isUpper || c.isLower\n\n/-- Is the character in `0123456789`? -/\ndef isDigit (c : Char) : Bool :=\n  c.val \u2265 48 && c.val \u2264 57\n\n/-- Is the character in `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`? -/\ndef isAlphanum (c : Char) : Bool :=\n  c.isAlpha || c.isDigit\n\n/-- Convert an upper case character to its lower case character.\n\nOnly works on basic latin letters.\n-/\ndef toLower (c : Char) : Char :=\n  let n := toNat c;\n  if n >= 65 \u2227 n <= 90 then ofNat (n + 32) else c\n\n/-- Convert a lower case character to its upper case character.\n\nOnly works on basic latin letters.\n-/\ndef toUpper (c : Char) : Char :=\n  let n := toNat c;\n  if n >= 97 \u2227 n <= 122 then ofNat (n - 32) else c\n\nend Char\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/src/Init/Data/Char/Basic.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5195213219520929, "lm_q2_score": 0.3775406687981454, "lm_q1q2_score": 0.19614042734468976}}
{"text": "import mcl.defs\nimport mcl.rhl\nimport mcl.compute_list\nimport mcl.ts_updates\nimport syncablep\nimport mcl.syncablep\nimport mcl.lemmas\nimport .defs\n\nopen mcl\nopen mcl.mclk\nopen mcl.rhl\nopen parlang\nopen parlang.state\nopen parlang.thread_state\n\nnamespace assign_mcl\nnamespace proof2\n\nnotation m ` & ` n ` ::= ` v := memory.update m n v\nnotation s ` \u00a7 ` f ` \u21c2 ` ac := map_active_threads ac f s\n\nlemma assign_rel' : mclp_rel eq p\u2081 p\u2082 eq := begin\n    apply rel_mclk_to_mclp,\n\n    apply skip_right.mpr,\n    apply rhl.seq,\n    swap,\n\n    apply skip_left_after.mpr,\n    apply skip_right.mpr,\n    apply rhl.seq,\n    swap,\n\n    -- break it down into individual proofs\n    apply add_skip_left.mpr,\n    apply rhl.seq,\n    swap,\n    {\n        apply shared_assign_right,\n    },{\n        apply shared_assign_right,\n    }, {\n        apply shared_assign_left,\n    },\n    apply shared_assign_left',\n    intros _ _ _ _ _ _ h hs,\n    cases h with m\u2081 h,\n    cases h with m\u2082 h,\n    simp only [map_map_active_threads],\n    have : n\u2081 = n\u2082 := begin\n        sorry\n    end,\n    subst this,\n    have hseq : s\u2081 = s\u2082 := begin\n        sorry\n    end,\n\n    -- the proof obligation in the form of a map thread on syncable is the simple version because we never consider threads to change active state (here all threads are always active)\n\n    -- the two updates store indepedently because \"a\" \u2260 \"b\"\n    -- the two updates read indepedently because they both depend on the same state (AFAIK they could still be swaped because the state is fixed)\n    apply exists.intro _,\n    apply exists.intro _,\n\n    -- split up the proof for the individual memories\n    split, {\n        have : thread_state.update_shared_vars_for_expr read_tid = id := by refl,\n        rw this,\n        have : thread_state.update_shared_vars_for_exprs v[read_tid] = id := by refl,\n        rw this,\n        have : thread_state.update_shared_vars_for_expr (read_tid + (expression.literal_int 1 (show type_of (sig.val \"b\") = type_of (sig.val \"b\"), by refl))) = id := by refl,\n        rw this,\n        simp,\n\n        -- resolve get and update (the result should only be mcl_init, literals and memory (in case of loads))\n        rw \u2190 syncable_syncable',\n        rw function.comp.assoc,\n        rw \u2190 ts_updates_nil (thread_state.tlocal_to_shared _ _ _ _ \u2218 _),\n        rw [ts_updates_store, ts_updates_compute, ts_updates_store],\n        rw [\u2190 function.comp.right_id (compute _)],\n        rw [ts_updates_compute],\n        rw [function.comp.right_id],\n        apply syncable'_store (show ((sig.val \"a\").type).dim = 1, by refl),\n        {\n            simp,\n        }, {\n            simp,\n        }, {\n            intros tid\u2081 tid\u2082 hneq,\n            simp [vector.map_cons],\n            repeat { rw vector.map_nil },\n            rw initial_kernel_assertion_left_thread_state h,\n            rw initial_kernel_assertion_left_thread_state h,\n            simp,\n            rw \u2190 vector.eq_one',\n            intro a,\n            cases tid\u2081,\n            cases tid\u2082,\n            have : tid\u2081_val = tid\u2082_val := begin\n                apply a,\n            end,\n            subst this,\n            contradiction,\n        },\n        rw ts_updates_merge_computes_list,\n        apply syncable'_store (show ((sig.val \"b\").type).dim = 1, by refl),\n        {\n            intro idx,\n            have : \"b\" \u2260 \"a\" := by intro; cases a,\n            simp [this],\n        }, {\n            intro idx,\n            have : \"b\" \u2260 \"a\" := by intro; cases a,\n            simp [this],\n        }, {\n            intros tid\u2081 tid\u2082 hneq,\n            simp [vector.map_cons],\n            repeat { rw vector.map_nil },\n            rw initial_kernel_assertion_left_thread_state h,\n            rw initial_kernel_assertion_left_thread_state h,\n            simp,\n            rw \u2190 vector.eq_one',\n            intro a,\n            cases tid\u2081,\n            cases tid\u2082,\n            have : tid\u2081_val = tid\u2082_val := begin\n                apply a,\n            end,\n            subst this,\n            contradiction,\n        },\n        simp [append, list.append],\n        apply syncable'_compute_list_syncable,\n        exact h.left,\n        sorry, --trivial from h\n        sorry, --trivial from h\n    }, \n    split, {\n        have : thread_state.update_shared_vars_for_expr read_tid = id := by refl,\n        rw this,\n        have : thread_state.update_shared_vars_for_exprs v[read_tid] = id := by refl,\n        rw this,\n        have : thread_state.update_shared_vars_for_expr (read_tid + (expression.literal_int 1 (show type_of (sig.val \"b\") = type_of (sig.val \"b\"), by refl))) = id := by refl,\n        rw this,\n        simp,\n\n        -- resolve get and update (the result should only be mcl_init, literals and memory (in case of loads))\n        rw \u2190 syncable_syncable',\n        rw function.comp.assoc,\n        rw \u2190 ts_updates_nil (thread_state.tlocal_to_shared _ _ _ _ \u2218 _),\n        rw [ts_updates_store, ts_updates_compute, ts_updates_store],\n        rw [\u2190 function.comp.right_id (compute _)],\n        rw [ts_updates_compute],\n        rw [function.comp.right_id],\n        apply syncable'_store (show ((sig.val \"b\").type).dim = 1, by refl),\n        {\n            simp,\n        }, {\n            simp,\n        }, {\n            intros tid\u2081 tid\u2082 hneq,\n            simp [vector.map_cons],\n            repeat { rw vector.map_nil },\n            rw h.right_thread_state,\n            rw h.right_thread_state,\n            simp,\n            rw \u2190 vector.eq_one',\n            intro a,\n            cases tid\u2081,\n            cases tid\u2082,\n            have : tid\u2081_val = tid\u2082_val := begin\n                apply a,\n            end,\n            subst this,\n            contradiction,\n        },\n        rw ts_updates_merge_computes_list,\n        apply syncable'_store (show ((sig.val \"a\").type).dim = 1, by refl),\n        {\n            intro idx,\n            have : \"a\" \u2260 \"b\" := by intro; cases a,\n            simp [this],\n        }, {\n            intro idx,\n            have : \"a\" \u2260 \"b\" := by intro; cases a,\n            simp [this],\n        }, {\n            intros tid\u2081 tid\u2082 hneq,\n            simp [vector.map_cons],\n            repeat { rw vector.map_nil },\n            rw h.right_thread_state,\n            rw h.right_thread_state,\n            simp,\n            rw \u2190 vector.eq_one',\n            intro a,\n            cases tid\u2081,\n            cases tid\u2082,\n            have : tid\u2081_val = tid\u2082_val := begin\n                apply a,\n            end,\n            subst this,\n            contradiction,\n        },\n        simp [append, list.append],\n        apply syncable'_compute_list_syncable,\n        exact h.right.left,\n        sorry, --trivial from h\n        sorry, --trivial from h\n    }, {\n        -- show post-condition\n        simp [append, list.append],\n        rw ts_update_compute_list,\n        rw from_tlocal_comm,\n        have := h.precondition,\n        subst this,\n        have := h.initial_state_eq,\n        subst this,\n        apply from_tlocal_eq,\n        {\n            intro tid,\n            rw map_active_threads_nth_ac,\n            rw map_active_threads_nth_ac,\n            refl,\n            sorry, -- trivial\n            sorry, -- trivial\n        },\n        apply from_tlocal_eq,\n        {\n            intro tid,\n            rw map_active_threads_nth_ac,\n            rw map_active_threads_nth_ac,\n            refl,\n            sorry, -- trivial\n            sorry, -- trivial\n        },\n        refl,\n    }, {\n        sorry, --trivial\n    }\nend\n\nend proof2\nend assign_mcl", "meta": {"author": "fischerman", "repo": "GPU-transformation-verifier", "sha": "75a5016f05382738ff93ce5859c4cfa47ccb63c1", "save_path": "github-repos/lean/fischerman-GPU-transformation-verifier", "path": "github-repos/lean/fischerman-GPU-transformation-verifier/GPU-transformation-verifier-75a5016f05382738ff93ce5859c4cfa47ccb63c1/src/use_cases/assign_mcl/proof2.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5078118642792044, "lm_q2_score": 0.3849121444839335, "lm_q1q2_score": 0.19546295367409278}}
{"text": "import order\n\nimport lib.list\n\nimport etv\n\nopen order_dual\n\nvariables {\u03b1 : Type*} [linear_order \u03b1] (C : config \u03b1)\n\nlemma config.join_n2_n3_n2_ff \n  (S : finset \u03b1) (cap4_free : \u00acC.has_ncap 4 S)\n  {n : \u2115} (x y : \u03b1)\n  {P : list \u03b1} (hPx : C.ncup (n+2) (P ++ [x])) (Px_in_S : (P ++ [x]).in S)\n  {Q : list \u03b1} (hxQy : C.ncup (n+3) (x :: Q ++ [y])) \n  (xQy_in_S : (x :: Q ++ [y]).in S)\n  {R : list \u03b1} (hyR : C.ncup (n+2) (y :: R)) (yR_in_S : (y :: R).in S)\n  (label : C.label S) (sxy : \u00aclabel.slope x y) :\n  \u2203 p q r s, C.has_interweaved_laced (n+3) S p q r s :=\nbegin\n  have x_in_S : x \u2208 S := by simp at xQy_in_S; tauto,\n  have y_in_S : y \u2208 S := by simp at xQy_in_S; tauto,\n  have x_lt_y : x < y := by apply hxQy.head'_lt_last' x y; simp,\n  \n  have hP := hPx.init, simp at hP,\n  have hQy := hxQy.tail, simp at hQy,\n  rcases hP.init_append_last with \u27e8P', a, eq_P, hP'\u27e9, subst eq_P,\n  rcases hQy.cons_head_tail with \u27e8b, Q', eq_Q, hQ'\u27e9,\n  have eq_xQy : x :: Q ++ [y] = x :: (Q ++ [y]) := by simp,\n  rw [eq_xQy, eq_Q] at *, clear eq_xQy,\n  have a_in_S : a \u2208 S := by simp at Px_in_S; tauto,\n  have b_in_S : b \u2208 S := by simp at xQy_in_S; tauto,\n\n  have hR := hyR.tail, simp at hR,\n  rcases hR.init_append_last with \u27e8R', z, eq_R, hR'\u27e9,\n  have xy_laced : C.has_laced (n+3) S x y := begin\n    have hy : C.ncup 1 [y] := by simp,\n    existsi [_, _, _, _, _, hPx, hxQy, hy], \n    refine \u27e8_, _, _\u27e9, \n    split, assumption, split, assumption,\n    simp, simp at xQy_in_S, tauto,\n    simp, simp, rw \u2190eq_Q, simp,\n  end,\n  have xz_laced : C.has_laced (n+3) S x z := begin\n    have hxyR : C.ncup (n+3) (x :: y :: R) := begin\n      apply hyR.extend_left sxy; try {assumption}, simp,\n    end,\n    rw eq_R at hxyR,\n    have hz : C.ncup 1 [z] := by simp,\n    existsi [_, _, _, _, _, hPx, hxyR, hz],\n    refine \u27e8_, _, _\u27e9,\n    split, assumption, rw eq_R at yR_in_S,\n    simp, simp at yR_in_S, tauto,\n    simp, simp,\n  end,\n\n  have a_lt_x : a < x := \n    by rw [config.ncup, config.cup] at hPx; simp at hPx; tauto,\n  have x_lt_b : x < b :=\n    by rw [config.ncup, config.cup] at hxQy; simp at hxQy; tauto,\n  have y_lt_z : y < z := begin\n    rw eq_R at hyR, apply hyR.head'_lt_last' y z,\n    simp, simp,\n  end,\n  have a_lt_b : a < b := has_lt.lt.trans a_lt_x x_lt_b,\n  by_cases sab : label.slope a b, swap,\n  -- case \u00aclabel.slope a b\n  { have hQy := hxQy.tail, simp at hQy, rw \u2190eq_Q at hQy,\n    have haQy : C.ncup (n+3) (a :: Q ++ [y]) := begin\n      apply hQy.extend_left sab; try {assumption},\n      simp, rw \u2190eq_Q at xQy_in_S, simp at xQy_in_S, tauto, simp,\n      rw eq_Q, simp,\n    end,\n    have ha : C.ncup 1 [a] := by simp,\n    have ay_laced : C.has_laced (n+3) S a y := begin\n      existsi [_, _, _, _, _, ha, haQy, hyR],\n      refine \u27e8_, _, _\u27e9, \n      simp, rw \u2190eq_Q at xQy_in_S, simp at xQy_in_S yR_in_S, tauto,\n      rw nat.add_comm, simp,\n    end,\n    use [a, x, y, z], split,\n    { split, assumption, split, \n      exact le_of_lt x_lt_y, assumption },\n    { tauto }, },\n  -- case label.slope a b\n  have b_lt_y : b < y := begin\n    have hQy := hxQy.tail, simp at hQy,\n    apply hQy.head'_lt_last' b y; simp,\n    rw \u2190eq_Q, simp,\n  end,\n  have hP := hPx.init, simp at hP,\n  have hPb : C.ncup (n+2) (P' ++ [a] ++ [b]) := begin\n    apply hP.extend_right sab; try { assumption },\n    simp; simp at Px_in_S; tauto,\n    simp,\n  end,\n  by_cases sby : label.slope b y, swap,\n  { have bz_laced : C.has_laced (n+3) S b z := begin\n      have hbyR : C.ncup (n+3) (b :: y :: R) := begin\n        apply hyR.extend_left sby; try {assumption}, simp,\n      end,\n      have hz : C.ncup 1 [z] := by simp,\n      existsi [_, _, _, _, _, hPb, hbyR, hz], rw eq_R,\n      refine \u27e8_, _, _\u27e9, \n      rw eq_R at yR_in_S, simp at Px_in_S yR_in_S, simp, tauto,\n      simp, simp,\n    end,\n    use [x, b, y, z], split, \n    split, assumption, split, apply le_of_lt, assumption, assumption,\n    tauto, },\n  { have hPby : C.ncup (n+3) (P' ++ [a] ++ [b] ++ [y]) := begin\n      apply hPb.extend_right sby; try { assumption },\n      simp; simp at Px_in_S; tauto, simp,\n    end,\n    have P_nnil : P' ++ [a] \u2260 [] := by simp,\n    rcases list.take_head P_nnil with \u27e8w, P_, eq_P_\u27e9,\n    rw eq_P_ at hPby,\n    have wy_laced : C.has_laced (n+3) S w y := begin\n      have hw : C.ncup 1 [w] := by simp,\n      existsi [_, _, _, _, _, hw, hPby, hyR], \n      refine \u27e8_, _, _\u27e9,\n      rw eq_P_ at Px_in_S, simp at yR_in_S Px_in_S, simp, tauto,\n      rw nat.add_comm, simp,\n    end,\n    use [w, x, y, z], split, split,\n    rw eq_P_ at hPx, apply hPx.head'_lt_last' w x; simp,\n    split, exact le_of_lt x_lt_y, assumption, tauto, },\nend\n\nlemma config.join_n2_n3_n2_tt\n  (S : finset \u03b1) (cap4_free : \u00acC.has_ncap 4 S)\n  {n : \u2115} (x y : \u03b1)\n  {P : list \u03b1} (hPx : C.ncup (n+2) (P ++ [x])) (Px_in_S : (P ++ [x]).in S)\n  {Q : list \u03b1} (hxQy : C.ncup (n+3) (x :: Q ++ [y])) \n  (xQy_in_S : (x :: Q ++ [y]).in S)\n  {R : list \u03b1} (hyR : C.ncup (n+2) (y :: R)) (yR_in_S : (y :: R).in S)\n  (label : C.label S) (sxy : label.slope x y) :\n  \u2203 p q r s, C.has_interweaved_laced (n+3) S p q r s :=\nbegin\n  have mirrored_goal : \u2203 s r q p, \n    C.mirror.has_interweaved_laced (n+3) S.mirror s r q p :=\n  begin\n    rw \u2190mirror.ncup at hPx hxQy hyR, simp at hPx hxQy hyR,\n    rw \u2190mirror.has_ncap at cap4_free,\n    rw \u2190list.mirror_in at Px_in_S xQy_in_S yR_in_S,\n    simp [-list.cons_in, -list.append_in] at Px_in_S xQy_in_S yR_in_S,\n    have syx := sxy, rw \u2190mirror_slope at syx,\n    apply C.mirror.join_n2_n3_n2_ff \n      _ _ (to_dual y) (to_dual x)\n      hyR _ hxQy _ hPx _ label.mirror _; assumption,\n  end,\n  simp at mirrored_goal,\n  rcases mirrored_goal with \u27e8s, r, q, p, h\u27e9,\n  rw mirror.has_interweaved_laced at h,\n  use [p, q, r, s], exact h,\nend\n\nlemma config.join_n2_n3_n2 (S : finset \u03b1) {n : \u2115}\n  (cap4_free : \u00acC.has_ncap 4 S) (cup_free : \u00acC.has_ncup (n+4) S)\n  {cx : list \u03b1} (cx_ncup : C.ncup (n+2) cx) (cx_in_S : cx.in S)\n  {c : list \u03b1} (c_ncup : C.ncup (n+3) c) (c_in_S : c.in S)\n  {cy : list \u03b1} (cy_ncup : C.ncup (n+2) cy) (cy_in_S : cy.in S)\n  (x : \u03b1) (hxcx : x \u2208 cx.last') (hxc : x \u2208 c.head')\n  (y : \u03b1) (hyc : y \u2208 c.last') (hycy : y \u2208 cy.head') : \n  \u2203 p q r s, C.has_interweaved_laced (n+3) S p q r s :=\nbegin\n  rcases c_ncup.take_head_last with \u27e8x, Q, y, eq_Q, Q_ncup\u27e9,\n  subst eq_Q, simp at hxc hyc, subst hxc, subst hyc,\n  rcases cx_ncup.init_append_last with \u27e8P, x, eq_P, P_ncup\u27e9, \n  subst eq_P, simp at hxcx, subst hxcx,\n  rcases cy_ncup.cons_head_tail with \u27e8y, R, eq_R, R_ncup\u27e9,\n  subst eq_R, simp at hycy, subst hycy,\n\n  have label := cap4_free_label cap4_free,\n  by_cases sxy : label.slope x y,\n  { apply C.join_n2_n3_n2_tt S; try {assumption}, },\n  { apply C.join_n2_n3_n2_ff S; try {assumption}, },\nend", "meta": {"author": "jcpaik", "repo": "erdos-tuza-valtr", "sha": "7fceb6f4f7d73bc3a0a09f48426b0e9350bc82ef", "save_path": "github-repos/lean/jcpaik-erdos-tuza-valtr", "path": "github-repos/lean/jcpaik-erdos-tuza-valtr/erdos-tuza-valtr-7fceb6f4f7d73bc3a0a09f48426b0e9350bc82ef/src/main/lemmas/join_n2_n3_n2.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5273165233795671, "lm_q2_score": 0.3702253925955866, "lm_q1q2_score": 0.19522596689034008}}
{"text": "import for_mathlib.valuation_subring\nimport morphisms.proper\nimport algebraic_geometry.properties\n\nnoncomputable theory\n\nopen category_theory category_theory.limits opposite topological_space\n\nuniverses v u\n\nnamespace algebraic_geometry\n\nvariables {X Y : Scheme.{u}} (f : X \u27f6 Y)\n\nopen category_theory.morphism_property\nopen algebraic_geometry.morphism_property (topologically)\n\nstructure valuative_comm_sq {X Y : Scheme.{u}} (f : X \u27f6 Y) :=\n(R : Type.{u})\n[hR : comm_ring R]\n[hR\u2081 : is_domain R]\n[hR\u2082 : valuation_ring R]\n(K : Type.{u})\n[hK : field K]\n[hRK : algebra R K]\n[hRK' : is_fraction_ring R K]\n(i\u2081 : Scheme.Spec.obj (op $ CommRing.of K) \u27f6 X)\n(i\u2082 : Scheme.Spec.obj (op $ CommRing.of R) \u27f6 Y)\n(comm_sq : comm_sq i\u2081 (Scheme.Spec.map (CommRing.of_hom $ algebra_map R K).op) f i\u2082)\n.\ndef valuative_criterion.existence : morphism_property Scheme :=\n\u03bb X Y f, \u2200 S : valuative_comm_sq f, S.comm_sq.has_lift\n\ndef valuative_criterion.uniqueness : morphism_property Scheme :=\n\u03bb X Y f, \u2200 S : valuative_comm_sq f, subsingleton S.comm_sq.lift_struct\n\ndef valuative_criterion : morphism_property Scheme :=\n\u03bb X Y f, \u2200 S : valuative_comm_sq f, nonempty (unique (S.comm_sq.lift_struct))\n\nsection existence\n\nlemma valuative_criterion.existence.specializing_map (H : valuative_criterion.existence f) :\n  specializing_map f.1.base :=\nbegin\n  rintros x y (h : f.1.base x \u2933 y),\n  let \u03d5 := Y.presheaf.stalk_specializes h \u226b PresheafedSpace.stalk_map f.1 x \u226b X.stalk_residue x,\n  obtain \u27e8A, hA, hA'\u27e9 := exists_factor_valuation_ring \u03d5,\n  let \u03d5' := \u03d5.cod_restrict A.to_subring hA,\n  have : CommRing.of_hom \u03d5' \u226b CommRing.of_hom (algebra_map \u21a5A \u21a5(X.residue_field x)) = \u03d5,\n  { ext, refl },\n  obtain \u27e8\u27e8H'\u27e9\u27e9 := H \u27e8A, X.residue_field x, X.from_Spec_residue_field x,\n    Scheme.Spec.map (CommRing.of_hom \u03d5').op \u226b Y.from_Spec_stalk y, \u27e8_\u27e9\u27e9,\n  refine \u27e8H'.l.1.base (local_ring.closed_point A), _, _\u27e9,\n  { simp only [\u2190 functor.map_comp_assoc, \u2190 op_comp, this, \u03d5],\n    erw op_comp,\n    simp only [op_comp, functor.map_comp_assoc],\n    erw Scheme.stalk_specializes_from_Spec_stalk h,\n    rw [stalk_map_from_Spec_stalk, \u2190 category.assoc], refl },\n  { show local_ring A, by apply_instance },\n  { change _ \u2933 _,\n    conv_lhs { rw [\u2190 Scheme.from_Spec_residue_field_base x (\u22a5 : prime_spectrum $ X.residue_field x),\n      \u2190 (show _ = X.from_Spec_residue_field x, from H'.fac_left)] },\n    refine specializes.map _ H'.l.1.base.2,\n    apply_with local_ring.specializes_closed_point { instances := ff } },\n  { rw [\u2190 Scheme.comp_val_base_apply, H'.fac_right],\n    dsimp only,\n    erw Scheme.comp_val_base_apply,\n    convert Scheme.from_Spec_stalk_closed_point _,\n    apply_with local_ring.comap_closed_point { instances := ff },\n    exact hA' }\nend\n\n-- move me\nlemma _root_.category_theory.functor.preimage_injective {C D} [category C] [category D]\n  (F : C \u2964 D) [full F] {X Y : C} : \n  function.injective (F.preimage : _ \u2192 (X \u27f6 Y)) :=\n\u03bb f g e, by rw [\u2190 F.image_preimage f, \u2190 F.image_preimage g, e]\n\nlemma valuative_criterion.existence.of_specializing_map\n  (H : universally (topologically @specializing_map) f) :\n  valuative_criterion.existence f :=\nbegin\n  rintros \u27e8R, K, i\u2081, i\u2082, c\u27e9,\n  resetI,\n  let X' := pullback f i\u2082,\n  let S := Scheme.Spec.obj (op $ CommRing.of R),\n  let f' : X' \u27f6 S := pullback.snd,\n  let i\u2081' : _ \u27f6 X' := pullback.lift i\u2081 _ c.1,\n  let x' : X'.carrier := i\u2081'.1.base (show prime_spectrum K, from local_ring.closed_point _),\n  let s' : S.carrier := (show prime_spectrum R, from local_ring.closed_point _),\n  have hxs : f'.1.base x' \u2933 s' := local_ring.specializes_closed_point _,\n  have hf' : specializing_map f'.1.base := H _ _ _ (is_pullback.of_has_pullback _ _).flip,\n  obtain \u27e8x, hx : _ \u2933 _, e\u27e9 := hf' hxs,\n  let \u03d5 : CommRing.of R \u27f6 X'.stalk x := structure_sheaf.to_stalk R s' \u226b\n    S.presheaf.stalk_specializes (specializes_of_eq e) \u226b PresheafedSpace.stalk_map f'.1 x,\n  haveI : is_local_ring_hom \u03d5 := by apply is_local_ring_hom_comp,\n  let \u03c8 : X'.presheaf.stalk x \u27f6 CommRing.of K :=\n    X'.presheaf.stalk_specializes hx \u226b stalk_closed_point_to _ i\u2081',\n  have h\u03d5 : \u03d5 \u226b \u03c8 = CommRing.of_hom (algebra_map R K),\n  { simp only [\u03d5, stalk_closed_point_to, category.assoc,\n      \u2190 PresheafedSpace.stalk_map.stalk_specializes_stalk_map_assoc,\n      Top.presheaf.stalk_specializes_comp_assoc],\n    slice_lhs 3 4 { erw \u2190 PresheafedSpace.stalk_map.comp },\n    have : i\u2081'.val \u226b f'.val = (Scheme.Spec.map (CommRing.of_hom (algebra_map R K)).op).1 := \n      congr_arg LocallyRingedSpace.hom.val (pullback.lift_snd i\u2081 _ c.1),\n    erw [PresheafedSpace.stalk_map.congr_hom' _ _ this],\n    simp only [category.assoc, Top.presheaf.stalk_specializes_comp_assoc],\n    erw structure_sheaf.to_stalk_stalk_specializes_assoc,\n    slice_lhs 1 2 { erw stalk_map_to_stalk },\n    rw iso.comp_inv_eq,\n    simp_rw category.assoc,\n    erw structure_sheaf.to_stalk_comp_stalk_to_fiber_ring_hom,\n    refl },\n  have h\u03c8 := @bijective_range_restrict_comp_of_valuation_ring R (X'.presheaf.stalk x) K\n    _ _ _ _ _ _ _ _ _ _ h\u03d5 _,\n  let \u03c8' : _ \u27f6 CommRing.of R :=\n    (ring_equiv.of_bijective _ h\u03c8).symm.to_ring_hom.comp \u03c8.range_restrict,\n  haveI : is_local_ring_hom \u03c8',\n  { apply_with is_local_ring_hom_comp { instances := ff },\n    { exact is_local_ring_hom_equiv (ring_equiv.of_bijective _ h\u03c8).symm },\n    { exact is_local_ring_hom_of_surjective _ \u03c8.range_restrict_surjective } },\n  have h\u03c8'' : \u03d5 \u226b \u03c8' = \ud835\udfd9 _, \n  { ext1 y, exact (ring_equiv.of_bijective _ h\u03c8).symm_apply_apply y },\n  haveI : mono (CommRing.of_hom (algebra_map R K)),\n  { apply functor.mono_of_mono_map (forget CommRing), rw mono_iff_injective,\n    exact (is_fraction_ring.injective R K : _) },\n  have h\u03c8' : \u03c8' \u226b CommRing.of_hom (algebra_map R K) = \u03c8, \n  { rw \u2190 h\u03d5, apply ring_hom.ext, intro y,\n    change ((ring_equiv.of_bijective _ h\u03c8) $ (ring_equiv.of_bijective _ h\u03c8).symm _).1 = _,\n    rw ring_equiv.apply_symm_apply, refl },\n  haveI : local_ring (CommRing.of R) := show local_ring R, by apply_instance,\n  refine \u27e8\u27e8\u27e8(Spec_to_equiv_of_local_ring (CommRing.of R) _).symm \u27e8_, \u03c8', infer_instance\u27e9\n    \u226b pullback.fst, _, _\u27e9\u27e9\u27e9,\n  { dsimp only,\n    transitivity i\u2081' \u226b pullback.fst, swap, { exact pullback.lift_fst _ _ _ },\n    rw \u2190 category.assoc, congr' 1,\n    refine (functor.map_comp_assoc _ _ _ _).symm.trans _,\n    dsimp only,\n    rw [\u2190 op_comp, h\u03c8', op_comp, functor.map_comp_assoc, Scheme.stalk_specializes_from_Spec_stalk],\n    exact Spec_map_stalk_closed_point_to_from_stalk _ _ },\n  { dsimp only,\n    rw [category.assoc, pullback.condition, \u2190 category.assoc],\n    convert category.id_comp _,\n    show (_ \u226b _) \u226b f' = \ud835\udfd9 _,\n    apply Scheme.Spec.preimage_injective,\n    rw \u2190 cancel_epi (CommRing.of_hom (algebra_map R K)).op,\n    apply Scheme.Spec.map_injective,\n    simp only [functor.map_comp, op_comp, functor.image_preimage, category.assoc],\n    rw [\u2190 functor.map_comp_assoc, \u2190 op_comp, h\u03c8', op_comp, functor.map_comp_assoc,\n      Scheme.stalk_specializes_from_Spec_stalk_assoc],\n    erw Spec_map_stalk_closed_point_to_from_stalk_assoc,\n    rw [pullback.lift_snd, category.comp_id] }\nend\n.\nlemma valuative_criterion.existence_stable_under_base_change : \n  valuative_criterion.existence.stable_under_base_change :=\nbegin\n  rintros X Y Y' S f g h k H hg \u27e8R, K, i\u2084, i\u2082, c\u27e9,\n  resetI,\n  obtain \u27e8\u27e8\u27e8l, hl\u2081, hl\u2082\u27e9\u27e9\u27e9 := hg \u27e8R, K, i\u2084 \u226b h, i\u2082 \u226b f, \u27e8_\u27e9\u27e9,\n  obtain \u27e8l', hl\u2083, hl\u2084\u27e9 := pullback_cone.is_limit.lift' H.is_limit l i\u2082 hl\u2082,\n  refine \u27e8\u27e8\u27e8l', _, hl\u2084\u27e9\u27e9\u27e9,\n  apply pullback_cone.is_limit.hom_ext H.is_limit,\n  { simp only [category.assoc, hl\u2083, hl\u2081], refl },\n  { simp only [category.assoc, hl\u2084, c.w.symm], refl },\n  { simp only [category.assoc, \u2190 c.w_assoc, H.w] }\nend\n\nlemma valuative_criterion.existence_eq :\n  valuative_criterion.existence = universally (topologically @specializing_map) :=\nbegin\n  apply le_antisymm,\n  { rw \u2190 valuative_criterion.existence_stable_under_base_change.universally_eq,\n    exact universally_mono (\u03bb X Y f, valuative_criterion.existence.specializing_map f) },\n  { exact \u03bb X Y f, valuative_criterion.existence.of_specializing_map f }\nend\n\nlemma universally_closed_eq_valuative_criterion : \n  @universally_closed = @quasi_compact \u2293 valuative_criterion.existence :=\nby rw [valuative_criterion.existence_eq,\n  universally_closed_eq_quasi_compact_and_universally_specializing]\n\nlemma universally_closed_of_valuative_criterion [quasi_compact f]\n  (hf : valuative_criterion.existence f) : universally_closed f :=\nbegin\n  rw universally_closed_eq_valuative_criterion,\n  exact \u27e8infer_instance, hf\u27e9\nend\n\n\nend existence\n\nsection uniqueness\n\nlemma separated_of_valuative_criterion [quasi_separated f]\n  (hf : valuative_criterion.uniqueness f) : separated f :=\nbegin\n  suffices : universally_closed (pullback.diagonal f),\n  { constructor,\n    apply is_closed_immersion.of_is_immersion,\n    exactI (universally_closed.is_closed_map $ pullback.diagonal f).closed_range },\n  apply universally_closed_of_valuative_criterion,\n  rintro \u27e8R, K, i\u2081, i\u2082, c\u27e9,\n  resetI,\n  have c' : comm_sq i\u2081 (Scheme.Spec.map (CommRing.of_hom (algebra_map R K)).op) f\n    (i\u2082 \u226b pullback.fst \u226b f),\n  { constructor, rw [\u2190 c.w_assoc, pullback.diagonal_fst_assoc] },\n  have : i\u2082 \u226b pullback.fst = i\u2082 \u226b pullback.snd,\n  { injection @@subsingleton.elim (hf \u27e8R, K, i\u2081, i\u2082 \u226b pullback.fst \u226b f, c'\u27e9)\n      \u27e8i\u2082 \u226b pullback.fst, _, category.assoc _ _ _\u27e9 \u27e8i\u2082 \u226b pullback.snd, _, _\u27e9; dsimp only,\n    { rw [\u2190 c.w_assoc, pullback.diagonal_fst, category.comp_id] },\n    { rw [\u2190 c.w_assoc, pullback.diagonal_snd, category.comp_id] },\n    { rw [category.assoc, pullback.condition] } },\n  refine \u27e8\u27e8\u27e8i\u2082 \u226b pullback.fst, _, _\u27e9\u27e9\u27e9; dsimp only,\n  { rw [\u2190 c.w_assoc, pullback.diagonal_fst, category.comp_id] },\n  { apply pullback.hom_ext; simp only [category.assoc, pullback.diagonal_fst, pullback.diagonal_snd,\n      category.comp_id, this] }\nend\n\nlemma separated.valuative_criterion [separated f] :\n  valuative_criterion.uniqueness f :=\nbegin\n  rintro \u27e8R, K, i\u2081, i\u2082, c\u27e9,\n  constructor,\n  rintro \u27e8l\u2081, hl\u2081, hl\u2081'\u27e9 \u27e8l\u2082, hl\u2082, hl\u2082'\u27e9,\n  ext1,\n  dsimp only at *,\n  let h := hl\u2081'.trans hl\u2082'.symm,\n  have := is_closed_immersion_stable_under_base_change\n    (pullback_fst_map_snd_is_pullback f f (pullback.diagonal f)\n    (pullback.lift l\u2081 l\u2082 h)) infer_instance,\n  haveI : is_iso (pullback.diagonal f \u226b pullback.snd),\n  { rw [pullback.diagonal_snd], apply_instance },\n  rw \u2190 is_closed_immersion_respects_iso.cancel_right_is_iso _ pullback.snd at this,\n  swap, { apply_instance },\n  rw [pullback.lift_snd, category.comp_id] at this,\n  let Z := pullback (pullback.diagonal f) (pullback.lift l\u2081 l\u2082 h),\n  let g : Z \u27f6 _ := pullback.snd,\n  change is_closed_immersion g at this,\n  resetI,\n  haveI : is_affine Z := is_affine_of_affine g,\n  have hg\u2082 := ((is_closed_immersion_over_affine_iff g).mp this).2,\n  suffices : is_iso g,\n  { resetI, \n    refine (pullback.lift_fst l\u2081 l\u2082 h).symm.trans (eq.trans _ (pullback.lift_snd l\u2081 l\u2082 h)),\n    rw [\u2190 cancel_epi g, \u2190 pullback.condition_assoc, \u2190 pullback.condition_assoc,\n      pullback.diagonal_fst, pullback.diagonal_snd] },\n  let l : Scheme.Spec.obj (op $ CommRing.of K) \u27f6 Z :=\n    pullback.lift i\u2081 (Scheme.Spec.map (CommRing.of_hom (algebra_map R K)).op) _,\n  swap,\n  { apply pullback.hom_ext; simp only [pullback.diagonal_fst, pullback.diagonal_snd,\n      category.assoc, category.comp_id, pullback.lift_fst, pullback.lift_snd, hl\u2081, hl\u2082] },\n  have hg : l \u226b g = Scheme.Spec.map (CommRing.of_hom (algebra_map R K)).op := pullback.lift_snd _ _ _,\n  have hg\u2081 := ((morphism_property.injective_respects_iso _).arrow_mk_iso_iff\n    (\u0393_Spec_arrow_iso $ CommRing.of_hom $ algebra_map R K)).mp (is_fraction_ring.injective R K : _),\n  rw [\u2190 hg, op_comp, functor.map_comp] at hg\u2081,\n  rw is_iso_respects_iso.arrow_mk_iso_iff (Spec_\u0393_arrow_iso_of_is_affine g),\n  convert_to is_iso\n    (Scheme.Spec.map (ring_equiv.of_bijective _ \u27e8hg\u2081.of_comp, hg\u2082\u27e9).to_CommRing_iso.hom.op),\n  apply_instance\nend\n\nlemma separated_eq_valuative_criterion :\n  @separated = @quasi_separated \u2293 valuative_criterion.uniqueness :=\nbegin\n  ext X Y f, split,\n  { introI H, exact \u27e8infer_instance, separated.valuative_criterion f\u27e9 },\n  { rintro \u27e8h\u2081, h\u2082\u27e9, exactI separated_of_valuative_criterion f h\u2082 }\nend\n\nend uniqueness\n\nlemma valuative_criterion_eq :\n  valuative_criterion = valuative_criterion.existence \u2293 valuative_criterion.uniqueness :=\nbegin\n  ext X Y f,\n  refine (forall_congr _).trans forall_and_distrib,\n  intro S,\n  split,\n  { rintro \u27e8h\u27e9, exactI \u27e8\u27e8\u27e8h.1.1\u27e9\u27e9, infer_instance\u27e9 },\n  { rintro \u27e8\u27e8\u27e8h\u2081\u27e9\u27e9, _\u27e9, exactI \u27e8\u27e8\u27e8h\u2081\u27e9, \u03bb _, subsingleton.elim _ _\u27e9\u27e9 }\nend\n\nlemma proper_eq_valuative_criterion :\n  @proper = @quasi_compact \u2293 @quasi_separated \u2293 @locally_of_finite_type \u2293 valuative_criterion :=\nbegin\n  rw [proper_eq, valuative_criterion_eq, separated_eq_valuative_criterion,\n    universally_closed_eq_valuative_criterion],\n  simp_rw [inf_comm, inf_assoc, inf_left_comm],\n  congr' 2,\n  rw [inf_comm, inf_assoc]\nend\n\nend algebraic_geometry", "meta": {"author": "erdOne", "repo": "lean-AG-morphisms", "sha": "bfb65e7d5c17f333abd7b1806717f12cd29427fd", "save_path": "github-repos/lean/erdOne-lean-AG-morphisms", "path": "github-repos/lean/erdOne-lean-AG-morphisms/lean-AG-morphisms-bfb65e7d5c17f333abd7b1806717f12cd29427fd/src/morphisms/valuative_criterion.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.640635868562172, "lm_q2_score": 0.30404167496654744, "lm_q1q2_score": 0.1947800025212917}}
{"text": "import for_mathlib.category_theory.abelian.extensions\nimport for_mathlib.algebra.homology.double\n\nnoncomputable theory\n\nopen category_theory category_theory.limits category_theory.category derived_category\n\nnamespace homological_complex\n\nvariables {C \u03b9 : Type*} [category C] [has_zero_morphisms C] [has_zero_object C]\n  (c : complex_shape \u03b9) (n : \u03b9) [decidable_eq \u03b9]\n\nend homological_complex\n\nvariables {C : Type*} [category C] [abelian C]\n\n@[simps]\ndef category_theory.short_complex.short_exact.extension\n  {S : short_complex C} (ex : S.short_exact) :\n  category_theory.abelian.extension S.X\u2083 S.X\u2081 :=\n{ X := S.X\u2082,\n  i := S.f,\n  p := S.g,\n  w := S.zero,\n  ex := begin\n    refine (short_complex.short_exact.iff_of_iso _).1 ex,\n    exact (short_complex.mk_iso (iso.refl _) (iso.refl _) (iso.refl _) (by tidy) (by tidy)),\n  end, }\n\ninstance category_theory.preadditive.is_iso_neg {C : Type*} [category C] [preadditive C]\n  {X Y : C} (f : X \u27f6 Y) [is_iso f] : is_iso (-f) :=\nby simpa only [iso.trans_hom, preadditive.mul_iso_hom, units.coe_neg_one, iso.refl_hom,\n  neg_smul, one_zsmul, as_iso_hom, preadditive.neg_comp, id_comp]\n  using is_iso.of_iso ((preadditive.mul_iso (-1 : units \u2124) (iso.refl X)).trans (as_iso f))\n\n@[simp]\nlemma category_theory.preadditive.neg_inv {C : Type*} [category C] [preadditive C]\n  {X Y : C} (f : X \u27f6 Y) [is_iso f] : inv (-f) = - inv f :=\nby rw [\u2190 cancel_mono (-f), is_iso.inv_hom_id, preadditive.neg_comp,\n  preadditive.comp_neg, neg_neg, is_iso.inv_hom_id]\n\nopen category_theory category_theory.limits category_theory.category derived_category\n\nnamespace category_theory.abelian\n\nnamespace extension\n\nvariables {A B : C} (e : extension A B)\n\ndef \u03c3 := cochain_complex.double.\u03c3 (neg_add_self 1) e.w\ndef \u03b9 := cochain_complex.double.\u03b9 (neg_add_self 1) e.p\ndef \u03c3' := cochain_complex.double.\u03c3' (neg_add_self 1) e.w\ndef \u03c0 := cochain_complex.double.\u03c0 (neg_add_self 1) e.i\n\ndef homotopy_\u03c0\u03c3'_\u03c3\u03b9 : homotopy (e.\u03c0 \u226b e.\u03c3') (-e.\u03c3 \u226b e.\u03b9)  :=\ncochain_complex.double.homotopy_\u03c0\u03c3'_\u03c3\u03b9 (neg_add_self 1) e.w\n\ninstance : quasi_iso e.\u03c3 :=\ncochain_complex.double.quasi_iso_\u03c3 (neg_add_self 1) e.w e.ex\n\ninstance : quasi_iso e.\u03c3' :=\ncochain_complex.double.quasi_iso_\u03c3' (neg_add_self 1) e.w e.ex\n\ndef \u03b4' : (single_functor C 0).obj A \u27f6 (single_functor C (-1)).obj B :=\n-inv (Q.map e.\u03c3) \u226b Q.map e.\u03c0\n\nlemma \u03b4'_eq : e.\u03b4' = -inv (Q.map e.\u03c3) \u226b Q.map e.\u03c0 := rfl\n\nlemma \u03b4'_eq' : e.\u03b4' = Q.map e.\u03b9 \u226b inv (Q.map e.\u03c3') :=\nby simp only [\u03b4', \u2190 cancel_epi (Q.map e.\u03c3), \u2190 cancel_mono (Q.map e.\u03c3'), assoc,\n  is_iso.hom_inv_id_assoc, preadditive.comp_neg, preadditive.neg_comp, is_iso.inv_hom_id,\n  comp_id, \u2190 Q.map_comp, derived_category.Q_map_eq_of_homotopy _ _ e.homotopy_\u03c0\u03c3'_\u03c3\u03b9,\n  functor.map_neg, neg_neg]\n\nlemma \u03b4_eq'' : e.\u03b4' = (short_complex.short_exact.extension e.ex).\u03b4' := rfl\n\ndef \u03b4 : (single_functor C 0).obj A \u27f6 ((single_functor C 0).obj B)\u27e6(1 : \u2124)\u27e7 :=\ne.\u03b4' \u226b (single_functor_shift_iso C 0 1 (-1) (neg_add_self 1)).inv.app B\n\ndef triangle : pretriangulated.triangle (derived_category C) :=\npretriangulated.triangle.mk ((single_functor C 0).map e.i) ((single_functor C 0).map e.p) e.\u03b4\n\n@[simps]\ndef single_short_complex : short_complex (cochain_complex C \u2124) :=\nshort_complex.mk ((homological_complex.single C _ 0).map e.i)\n  ((homological_complex.single C _ 0).map e.p)\n  (by rw [\u2190 functor.map_comp, e.w, functor.map_zero])\n\nlemma single_short_complex_short_exact : e.single_short_complex.short_exact :=\nshort_complex.short_exact.map_of_exact e.ex (homological_complex.single C (complex_shape.up \u2124) 0)\n\ndef iso_mapping_cone := cochain_complex.double_iso_mapping_cone e.i\n\nlemma compatibility_mapping_cone_\u03c3 : e.\u03c3 = (cochain_complex.double_iso_mapping_cone e.i).hom \u226b\n  cochain_complex.from_mapping_cone_of_ses e.single_short_complex_short_exact :=\nbegin\n  refine cochain_complex.from_double_ext (neg_add_self 1) _ _ _ _,\n  { dsimp,\n    simp only [\u03c3, cochain_complex.from_mapping_cone_of_ses, single_short_complex_g,\n      cochain_complex.double.\u03c3_f\u2081, id_comp, cochain_complex.double.desc.f\u2081, assoc,\n      zero_eq_neg, preadditive.is_iso.comp_left_eq_zero],\n    erw [cochain_complex.mapping_cone.inl_desc_v, cochain_complex.hom_complex.cochain.zero_v,\n      comp_zero], },\n  { dsimp,\n    simp only [\u03c3, cochain_complex.from_mapping_cone_of_ses, single_short_complex_g,\n      cochain_complex.double.\u03c3_f\u2082, homological_complex.single_obj_X_self_inv,\n      eq_to_hom_refl, comp_id, id_comp, cochain_complex.double.desc.f\u2082, assoc],\n    erw [cochain_complex.mapping_cone.inr_desc_f],\n    dsimp,\n    simp only [eq_self_iff_true, comp_id, id_comp, if_true], },\nend\n\nopen cochain_complex.hom_complex\n\nlemma compatibility_mapping_cone_\u03c0 :\n  e.\u03c0 = -(cochain_complex.double_iso_mapping_cone e.i).hom \u226b\n  cochain_complex.mapping_cone.\u03b4 ((homological_complex.single C _ 0).map e.i) \u226b\n  (cochain_complex.single_shift_iso C 0 1 (-1) (neg_add_self 1).symm).hom.app B :=\nbegin\n  refine cochain_complex.to_single_ext _ _ (-1) _,\n  simp only [\u03c0, cochain_complex.mapping_cone.\u03b4, cochain_complex.double.\u03c0_f, eq_to_hom_refl,\n    cochain_complex.double.desc.f\u2081, comp_id, homological_complex.single_obj_X_self_inv,\n    id_comp, cochain_complex.double_iso_mapping_cone_hom, homological_complex.neg_f_apply,\n    homological_complex.comp_f, cochain_complex.double.desc_f,\n    cochain_complex.hom_complex.cocycle.hom_of_f,\n    cochain_complex.hom_complex.cocycle.right_shift_coe,\n    cochain_complex.mapping_cone.\u03b4_as_cocycle_coe, assoc,\n    cochain_complex.hom_complex.cochain.right_shift_v _ 1 0\n      (zero_add 1).symm (-1) (-1) (by linarith) 0 (neg_add_self 1).symm, cochain.neg_v,\n    preadditive.neg_comp, preadditive.comp_neg, neg_neg],\n  erw cochain_complex.mapping_cone.inl_fst_assoc,\n  dsimp [cochain_complex.double.X_iso\u2081, homological_complex.X_iso_of_eq, iso.refl,\n    cochain_complex.single_shift_iso, cochain_complex.single_shift_iso_app],\n  simp only [cochain_complex.lift_single_f, id_comp],\n  erw [id_comp, id_comp],\n  refl,\nend\n\nlemma \u03b4_eq_triangle_of_ses_\u03b4 :\n  e.\u03b4 = triangle_of_ses_\u03b4 e.single_short_complex_short_exact :=\nbegin\n  dsimp [triangle_of_ses_\u03b4, \u03b4, \u03b4', mapping_cone_triangle],\n  simp only [\u2190 cancel_epi (Q.map (cochain_complex.from_mapping_cone_of_ses\n    e.single_short_complex_short_exact)), is_iso.hom_inv_id_assoc,\n    \u2190 Q.map (cochain_complex.double_iso_mapping_cone e.i).hom,\n    preadditive.neg_comp, preadditive.comp_neg,\n    e.compatibility_mapping_cone_\u03c3, functor.map_neg, Q.map_comp, preadditive.neg_inv,\n    is_iso.inv_comp, neg_neg, assoc,\n    \u2190 cancel_epi (Q.map (cochain_complex.double_iso_mapping_cone e.i).hom), mapping_cone_\u03b4,\n    \u2190 cancel_mono ((Q.comm_shift_iso (1 : \u2124)).inv.app ((homological_complex.single C _ 0).obj B)),\n    iso.hom_inv_id_app, single_functor_shift_iso_inv_app, compatibility_mapping_cone_\u03c0],\n    erw [\u2190 Q.map_comp, iso.hom_inv_id_app, Q.map_id],\n    refl,\nend\n\nlemma triangle_iso : e.triangle \u2245 triangle_of_ses e.single_short_complex_short_exact :=\npretriangulated.triangle.mk_iso _ _ (iso.refl _) (iso.refl _) (iso.refl _) (by tidy) (by tidy)\n  (by { dsimp [triangle], simp only [category_theory.functor.map_id, comp_id,\n    id_comp, \u03b4_eq_triangle_of_ses_\u03b4], })\n\nlemma triangle_distinguished : e.triangle \u2208 dist_triang (derived_category C) :=\npretriangulated.isomorphic_distinguished _ (triangle_of_ses_dist _) _ e.triangle_iso\n\nlemma iso_of_triangle_map (e\u2081 e\u2082 : extension A B)\n  (\u03c6 : e\u2081.triangle \u27f6 e\u2082.triangle) (h\u03c6\u2081 : \u03c6.hom\u2081 = \ud835\udfd9 _) (h\u03c6\u2083 : \u03c6.hom\u2083 = \ud835\udfd9 _) : e\u2081 \u2245 e\u2082 :=\nas_iso begin\n  have eq\u2081 := \u03c6.comm\u2081,\n  have eq\u2082 := \u03c6.comm\u2082,\n  dsimp only [triangle] at eq\u2081 eq\u2082,\n  simp only [pretriangulated.triangle.mk_mor\u2081, h\u03c6\u2081] at eq\u2081,\n  erw id_comp at eq\u2081,\n  simp only [pretriangulated.triangle.mk_mor\u2082, h\u03c6\u2083] at eq\u2082,\n  erw comp_id at eq\u2082,\n  refine extension.hom.mk' ((single_functor C 0).preimage \u03c6.hom\u2082) _ _,\n  { apply (single_functor C 0).map_injective,\n    rw [functor.map_comp, functor.image_preimage, eq\u2081], },\n  { apply (single_functor C 0).map_injective,\n    rw [functor.map_comp, functor.image_preimage, eq\u2082], },\nend\n\nsection naturality\n\nvariables {S\u2081 S\u2082 : short_complex C} (\u03c6 : S\u2081 \u27f6 S\u2082)\n  (ex\u2081 : S\u2081.short_exact) (ex\u2082 : S\u2082.short_exact)\n\ninclude \u03c6 ex\u2081 ex\u2082\n\n@[reassoc]\nlemma \u03c3_naturality :\n  ex\u2081.extension.\u03c3 \u226b (homological_complex.single C _ 0).map \u03c6.\u03c4\u2083 =\n    cochain_complex.double.map (neg_add_self 1) S\u2081.f S\u2082.f \u03c6.\u03c4\u2081 \u03c6.\u03c4\u2082 \u03c6.comm\u2081\u2082.symm \u226b\n      ex\u2082.extension.\u03c3 :=\nbegin\n  refine cochain_complex.to_single_ext _ _ 0 _,\n  { dsimp only [short_complex.short_exact.extension, extension.\u03c3],\n    simp only [homological_complex.comp_f, cochain_complex.double.\u03c3_f\u2082,\n      homological_complex.single_obj_X_self_inv, eq_to_hom_refl,\n      comp_id, homological_complex.single_map_f_self, homological_complex.single_obj_X_self_hom,\n      assoc, cochain_complex.double.map_f\u2082, iso.inv_hom_id_assoc, iso.cancel_iso_hom_left,\n      \u03c6.comm\u2082\u2083],\n    erw id_comp, },\nend\n\n@[reassoc]\nlemma \u03c0_naturality :\n  ex\u2081.extension.\u03c0 \u226b (homological_complex.single C _ (-1 : \u2124)).map \u03c6.\u03c4\u2081 =\n    cochain_complex.double.map (neg_add_self 1) S\u2081.f S\u2082.f \u03c6.\u03c4\u2081 \u03c6.\u03c4\u2082 \u03c6.comm\u2081\u2082.symm \u226b\n    ex\u2082.extension.\u03c0 :=\nbegin\n  refine cochain_complex.to_single_ext _ _ (-1) _,\n  { dsimp only [short_complex.short_exact.extension, extension.\u03c0],\n    simp only [homological_complex.comp_f, cochain_complex.double.\u03c0_f, eq_to_hom_refl,\n      cochain_complex.double.desc.f\u2081, comp_id, homological_complex.single_map_f_self,\n      homological_complex.single_obj_X_self_hom, homological_complex.single_obj_X_self_inv,\n      cochain_complex.double.map_f\u2081, assoc, iso.inv_hom_id, iso.cancel_iso_hom_left],\n    apply id_comp, },\nend\n\n@[reassoc]\nlemma \u03b4'_naturality :\n  ex\u2081.extension.\u03b4' \u226b (single_functor C (-1)).map \u03c6.\u03c4\u2081 =\n    (single_functor C 0).map \u03c6.\u03c4\u2083 \u226b ex\u2082.extension.\u03b4' :=\nbegin\n  dsimp only [extension.\u03b4', single_functor, functor.comp_map],\n  have h\u03c3 := Q.congr_map (\u03c3_naturality \u03c6 ex\u2081 ex\u2082),\n  have h\u03c0 := Q.congr_map (\u03c0_naturality \u03c6 ex\u2081 ex\u2082),\n  simp only [Q.map_comp, \u2190 cancel_mono (inv (Q.map ex\u2082.extension.\u03c3)), assoc,\n    is_iso.hom_inv_id, comp_id] at h\u03c3,\n  simp only [Q.map_comp] at h\u03c0,\n  simp only [\u2190 cancel_epi (Q.map ex\u2081.extension.\u03c3), assoc, is_iso.hom_inv_id_assoc,\n    h\u03c0, \u2190 h\u03c3, preadditive.comp_neg, preadditive.neg_comp],\nend\n\n@[reassoc]\nlemma \u03b4_naturality :\n  ex\u2081.extension.\u03b4 \u226b ((single_functor C 0).map \u03c6.\u03c4\u2081)\u27e61\u27e7' =\n    (single_functor C 0).map \u03c6.\u03c4\u2083 \u226b ex\u2082.extension.\u03b4 :=\nbegin\n  dsimp only [extension.triangle, pretriangulated.triangle.mk, extension.\u03b4],\n  simpa only [\u2190 \u03b4'_naturality_assoc \u03c6 ex\u2081 ex\u2082, assoc, nat_trans.naturality],\nend\n\n@[simps]\ndef triangle_map : ex\u2081.extension.triangle \u27f6 ex\u2082.extension.triangle :=\n{ hom\u2081 := (single_functor C 0).map \u03c6.\u03c4\u2081,\n  hom\u2082 := (single_functor C 0).map \u03c6.\u03c4\u2082,\n  hom\u2083 := (single_functor C 0).map \u03c6.\u03c4\u2083,\n  comm\u2081' := by simpa only [functor.map_comp] using (single_functor C 0).congr_map \u03c6.comm\u2081\u2082.symm,\n  comm\u2082' := by simpa only [functor.map_comp] using (single_functor C 0).congr_map \u03c6.comm\u2082\u2083.symm,\n  comm\u2083' := \u03b4_naturality \u03c6 ex\u2081 ex\u2082, }\n\nend naturality\n\nend extension\n\nnamespace extensions\n\nvariables {A B : C} (e : extension A B)\n\ndef \u03b4 : extensions A B \u2192 ((single_functor C 0).obj A \u27f6\n  ((single_functor C 0).obj B)\u27e6(1 : \u2124)\u27e7) :=\nquot.lift extension.\u03b4 begin\n  rintros E\u2081 E\u2082 \u27e8e\u27e9,\n  have eq := extension.\u03b4_naturality\n    ((extension.to_short_exact_sequence_functor A B).map e.hom) E\u2081.ex E\u2082.ex,\n  dsimp at eq,\n  simpa only [category_theory.functor.map_id, id_comp, comp_id] using eq,\nend\n\nvariable (C)\n\n@[simps]\ndef \u03b4_nat_trans : extensions_functor C \u27f6\n  ((single_functor C 0).op \u22d9 (single_functor C 0 \u22d9 shift_functor _ (1 : \u2124) \u22d9 yoneda).flip).flip :=\n{ app := \u03bb B,\n  { app := \u03bb A, extensions.\u03b4,\n    naturality' := \u03bb A\u2081 A\u2082 \u03c0, begin\n      ext e,\n      obtain \u27e8E, rfl\u27e9 := quotient.surjective_quotient_mk' e,\n      have eq := extension.\u03b4_naturality (E.pull_short_complex \u03c0.unop)\n        ((E.pull \u03c0.unop).ex) E.ex,\n      dsimp at eq,\n      simpa only [category_theory.functor.map_id, comp_id] using eq,\n    end, },\n  naturality' := begin\n    rintro B\u2081 B\u2082 \u03b9,\n    ext A e,\n    obtain \u27e8E, rfl\u27e9 := quotient.surjective_quotient_mk' e,\n    have eq := extension.\u03b4_naturality (E.push_short_complex \u03b9) E.ex (E.push \u03b9).ex,\n    dsimp at eq,\n    simpa only [category_theory.functor.map_id, id_comp] using eq.symm,\n  end, }\n\nvariables {C}\n\nlemma \u03b4_nat_trans_surjective'\n  (\u03c6 : (single_functor C 0).obj A \u27f6 ((single_functor C 0).obj B)\u27e6(1 : \u2124)\u27e7) :\n  \u2203 (e : extension A B), \u03c6 = e.\u03b4 :=\nbegin\n  obtain \u27e8\u03c6, rfl\u27e9 : \u2203 (\u03c6' : (single_functor C 0).obj A \u27f6 (single_functor C (-1)).obj B),\n    \u03c6 = \u03c6' \u226b (single_functor_shift_iso C 0 1 (-1) (neg_add_self 1)).inv.app B,\n  { refine \u27e8\u03c6 \u226b (single_functor_shift_iso C 0 1 (-1) (neg_add_self 1)).hom.app B, _\u27e9,\n    simp only [assoc, iso.hom_inv_id_app],\n    erw comp_id, },\n  suffices : \u2203 (E' A' : C) (f' : A \u27f6 A') (i' : B \u27f6 E') (p' : E' \u27f6 A') (w : i' \u226b p' = 0)\n    (ex : (short_complex.mk _ _ w).short_exact),\n      \u03c6 \u226b Q.map ex.extension.\u03c3' = (single_functor C 0).map f' \u226b Q.map ex.extension.\u03b9,\n  { obtain \u27e8E', A', f', i', p', w, ex, z\u27e9 := this,\n    refine \u27e8ex.extension.pull f', _\u27e9,\n    have eq := extension.\u03b4_naturality (ex.extension.pull_short_complex f')\n      (ex.extension.pull f').ex ex.extension.ex,\n    simp only [extension.pull_short_complex, category_theory.functor.map_id, comp_id] at eq,\n    refine trans _ eq.symm,\n    dsimp only [extension.\u03b4],\n    rw \u2190 assoc,\n    congr' 1,\n    erw [extension.\u03b4'_eq', \u2190 cancel_mono (Q.map ex.extension.\u03c3'), assoc, assoc, is_iso.inv_hom_id,\n      comp_id],\n    exact z, },\n  haveI : cochain_complex.is_strictly_le ((homological_complex.single C\n    (complex_shape.up \u2124) (-1)).obj B) 0 :=\n      cochain_complex.is_strictly_le_of_le _ (-1) 0 (by linarith),\n  obtain \u27e8E', A', p', f, s, hs, eq\u27e9 : \u2203 (B' E' : C) (i' : B' \u27f6 E')\n   (f : (homological_complex.single C _ 0).obj A \u27f6 cochain_complex.double (neg_add_self 1) i')\n   (s : (homological_complex.single C _ (-1)).obj B \u27f6 cochain_complex.double (neg_add_self 1) i')\n   (hs : quasi_iso s), by { haveI := hs, exact \u03c6 = Q.map f \u226b inv (Q.map s), },\n  { obtain \u27e8L', L'_le, L'_ge, f, s, hs, h\u03c6\u27e9 :=\n      left_factorisation_of_is_strictly_le_of_is_strictly_ge \u03c6 0 (-1),\n    haveI := L'_le,\n    obtain \u27e8E', A', p', \u27e8e\u27e9\u27e9 := cochain_complex.exists_iso_double (neg_add_self 1) L',\n    refine \u27e8E', A', p', f \u226b e.hom, s \u226b e.hom, infer_instance, _\u27e9,\n    simp only [h\u03c6, Q.map_comp, is_iso.inv_comp, assoc, is_iso.hom_inv_id_assoc], },\n  obtain \u27e8f', rfl\u27e9 := cochain_complex.eq_single_to_double' f,\n  obtain \u27e8i', w, hs'\u27e9 := cochain_complex.eq_single_to_double s,\n  refine \u27e8E', A', f', i', p', w, _, _\u27e9,\n  { simpa only [hs', cochain_complex.single_to_double_quasi_iso_iff] using hs, },\n  { dsimp only [single_functor, functor.comp_map],\n    rw \u2190 Q.map_comp,\n    haveI := hs,\n    simp only [\u2190 cancel_mono (Q.map s), assoc, is_iso.inv_hom_id, comp_id, hs'] at eq,\n    convert eq,\n    refine cochain_complex.from_single_ext _ _ 0 _,\n    dsimp [short_complex.short_exact.extension, extension.\u03b9],\n    simp only [eq_self_iff_true, comp_id, id_comp, if_true, cochain_complex.double.lift.f\u2082,\n      cochain_complex.desc_single_f],\n    erw id_comp, },\nend\n\nlemma _root_.category_theory.abelian.extension.\u03b4_eq_iff (e\u2081 e\u2082 : extension A B) :\n  (e\u2081.\u03b4 = e\u2082.\u03b4) \u2194 nonempty (e\u2081 \u2245 e\u2082) :=\nbegin\n  split,\n  { intro h,\n    obtain \u27e8\u03b2, h\u03b2\u2081, h\u03b2\u2082\u27e9 := pretriangulated.complete_distinguished_triangle_morphism\u2082 _ _\n      e\u2081.triangle_distinguished e\u2082.triangle_distinguished (\ud835\udfd9 _) (\ud835\udfd9 _)\n      (by simpa only [category_theory.functor.map_id, comp_id, id_comp] using h),\n    let \u03b3 : e\u2081.triangle \u27f6 e\u2082.triangle :=\n    { hom\u2081 := \ud835\udfd9 _,\n      hom\u2082 := \u03b2,\n      hom\u2083 := \ud835\udfd9 _, },\n    exact \u27e8extension.iso_of_triangle_map e\u2081 e\u2082 \u03b3 rfl rfl\u27e9, },\n  { rintro \u27e8h\u27e9,\n    change extensions.\u03b4 (quot.mk _ e\u2081) = extensions.\u03b4 (quot.mk _ e\u2082),\n    congr' 1,\n    exact quot.sound \u27e8h\u27e9, },\nend\n\nvariables (A B)\n\nlemma \u03b4_nat_trans_bijective :\n  function.bijective (@extensions.\u03b4 _ _ _ A B) :=\nbegin\n  split,\n  { rintros \u27e8e\u2081\u27e9 \u27e8e\u2082\u27e9 (h : e\u2081.\u03b4 = e\u2082.\u03b4),\n    rw extension.\u03b4_eq_iff at h,\n    exact quot.sound h, },\n  { intro \u03c6,\n    obtain \u27e8e, rfl\u27e9 := \u03b4_nat_trans_surjective' \u03c6,\n    exact \u27e8quotient.mk' e, rfl\u27e9, },\nend\n\ninstance : is_iso (\u03b4_nat_trans C) :=\nbegin\n  haveI : \u2200 (A : C), is_iso ((\u03b4_nat_trans C).app A),\n  { intro A,\n    haveI : \u2200 (B : C\u1d52\u1d56), is_iso (((\u03b4_nat_trans C).app A).app B),\n    { intro B,\n      rw is_iso_iff_bijective,\n      apply \u03b4_nat_trans_bijective, },\n    apply nat_iso.is_iso_of_is_iso_app, },\n  apply nat_iso.is_iso_of_is_iso_app,\nend\n\nvariable (C)\n\n@[simps]\ndef \u03b4_nat_iso := as_iso (\u03b4_nat_trans C)\n\nend extensions\n\nnamespace extension\n\nvariables (A B : C)\n\n@[simp]\nlemma trivial.\u03b4 : (trivial A B).\u03b4 = 0 :=\nbegin\n  haveI : is_split_epi (abelian.extension.trivial A B).triangle.mor\u2082 := is_split_epi.mk'\n  { section_ := Q.map ((homological_complex.single _ _ _).map biprod.inr),\n    id' := begin\n      erw [\u2190 functor.map_comp, \u2190 functor.map_comp, biprod.inr_snd,\n        category_theory.functor.map_id, category_theory.functor.map_id],\n      refl,\n    end, },\n  simpa only [\u2190 cancel_epi (abelian.extension.trivial A B).triangle.mor\u2082, comp_zero]\n    using pretriangulated.triangle.comp_zero\u2082\u2083 _ (trivial A B).triangle_distinguished,\nend\n\n\nvariables {A B}\n\nlemma \u03b4_eq_zero_iff (e : extension A B) : e.\u03b4 = 0 \u2194 nonempty (e \u2245 trivial A B) :=\nby simp only [\u2190 extension.\u03b4_eq_iff, trivial.\u03b4]\n\nlemma \u03b4_neq_zero_iff (e : extension A B) : e.\u03b4 \u2260 0 \u2194 is_empty (e \u2245 trivial A B) :=\nby simpa only [not_nonempty_iff] using e.\u03b4_eq_zero_iff.not\n\nend extension\n\nend category_theory.abelian\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/category_theory/abelian/extensions_derived_category.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5350984286266116, "lm_q2_score": 0.3629692055196168, "lm_q1q2_score": 0.1942242515133966}}
{"text": "import dnf\n\nnamespace first_order\n\nsection quantifier_elimination\n\nvariables {L : language} (A : Type) (\u0393 : list (formula L)) {\u03c6 \u03c6\u2081 \u03c6\u2082 \u03c8 : formula L} {p q : formula L}\nvariable [has_coe A (formula L)]\n\n/- If a formula \u03c6 has has quantifier elimination in a theory -/\n@[simp]\ndef equiv_qf (\u03c6 : formula L) := \u2203 \u03c8 : qf L, (A\u2223[] \u22a2 \u03c6) \u2194 (A\u2223[] \u22a2 (\u03c8 : formula L))\n\ndef Eq_equiv_qf {A : Type} [has_coe A (formula L)] : ((A\u2223[] \u22a2 p) \u2194 (A\u2223[] \u22a2 q)) \u2192 (equiv_qf A p \u2192 equiv_qf A q) := begin\n   intros h\u2081 h\u2082,\n   rcases h\u2082 with \u27e8\u03c6\u2083, h\u2083\u27e9,\n   existsi \u03c6\u2083,\n   split,\n   intro h\u2084,\n   apply h\u2083.mp (h\u2081.mpr h\u2084),\n   intro h\u2084,\n   apply h\u2081.mp (h\u2083.mpr h\u2084),\nend\n\n/- If a theory \u0393 has quantifier elimination -/\n@[simp]\ndef qe := \u2200 (\u03c6 : formula L), equiv_qf A \u03c6\n\n/- If a theory \u0393 has quantifier elimination on conjunctions of literals with\n   with a single existential quantifier -/\ndef qe_ecl1 := \u2200 (\u03c6 : ecl1 L), equiv_qf A (\u03c6 : formula L)\n\n/- If a theory \u0393 has quantifier elimination on disjunctions of conjunctions\n   of literals with a single existential quantifier -/\ndef qe_edcl1 := \u2200 (\u03c6 : edcl1 L), equiv_qf A (\u03c6 : formula L)\n\n/- If a theory \u0393 has quantifier elimination on disjunctions of conjugations \n   of literals with a single quantifier -/\n@[simp]\ndef qe_qdcl1 := \u2200 (\u03c6 : qdcl1 L), equiv_qf A (\u03c6 : formula L)\n\n@[simp]\ndef qe_dnf := \u2200 (\u03c6 : dnf L), equiv_qf A (\u03c6 : formula L)\n\n/- If a theory \u0393 has quantifier elimination on quantifier free formulas -/\n@[simp]\ndef qe_qf := \u2200 (\u03c6 : qf L), equiv_qf A (\u03c6 : formula L)\n\n/- All theories have quantifier elimination on quantifier free formulas -/\ndef for_all_qe_qf : @qe_qf L A _ := by { intros \u03c6, existsi \u03c6, refl }\n\n/- If a theory has quantifier elimination on \u03c6\u2081 \u03c6\u2082 then it has quantifier \n   elimination on (\u03c6\u2081 or \u03c6\u2082) -/\nlemma equiv_qf_or_equiv_qf : equiv_qf A \u03c6\u2081 \u2192 equiv_qf A \u03c6\u2082 \u2192 equiv_qf A (\u03c6\u2081 or \u03c6\u2082) := begin\n   intros h_\u03c6\u2081 h_\u03c6\u2082,\n   rcases h_\u03c6\u2081 with \u27e8\u03c6\u2081', h\u2081\u27e9,\n   rcases h_\u03c6\u2082 with \u27e8\u03c6\u2082', h\u2082\u27e9,\n   apply Eq_equiv_qf (R_Eq_Or_ \u27e8h\u2081.mpr, h\u2081.mp\u27e9 \u27e8h\u2082.mpr, h\u2082.mp\u27e9),\n   existsi (qf.o \u03c6\u2081' \u03c6\u2082'), refl,\nend\n\nlemma qe_ecl1_qe_edcl1 : (\u2200 x : \u2115, @var_not_free_in_axioms L x A _) \u2192 ((@qe_ecl1 L A _) \u2192 (@qe_edcl1 L A _)) := begin\n   intros h h\u2081 \u03c6,\n   cases \u03c6,\n   {  existsi (\u03c6 : qf L), refl, },\n   {  induction \u03c6_\u1fb0_1,\n      rcases (h\u2081 (ecl1.ex \u03c6_\u1fb0 \u03c6_\u1fb0_1)) with \u27e8\u03c6\u2082, h\u2082\u27e9,\n      apply Eq_equiv_qf \u27e8h\u2082.mpr, h\u2082.mp\u27e9,\n      existsi \u03c6\u2082, refl,\n      rcases \u03c6_\u1fb0_1_ih_\u1fb0 with \u27e8\u03c6\u2082, h\u2082\u27e9,\n      rcases \u03c6_\u1fb0_1_ih_\u1fb0_1 with \u27e8\u03c6\u2083, h\u2083\u27e9,\n      apply Eq_equiv_qf \u27e8R_ (ExOrOut (h \u03c6_\u1fb0)), R_ (ExOrIn (h \u03c6_\u1fb0))\u27e9,\n      apply Eq_equiv_qf (R_Eq_Or_ \u27e8h\u2082.mpr, h\u2082.mp\u27e9 \u27e8h\u2083.mpr, h\u2083.mp\u27e9),\n      existsi qf.o \u03c6\u2082 \u03c6\u2083, refl,\n   },\nend\n\nlemma qe_edcl1_qe_qdcl1 : (@qe_edcl1 L A _) \u2192 (@qe_qdcl1 L A _) := begin\n   intros h\u2081 \u03c6,\n   induction \u03c6,\n   {  existsi (\u03c6 : qf L), refl, },\n   { \n      rcases (qf_equiv_dcl A (qf.n \u2191\u03c6_\u1fb0_1)) with \u27e8\u03c6\u2082, h\u2082\u27e9,\n      apply Eq_equiv_qf \u27e8R_ Ex_To_All, R_ All_To_Ex\u27e9,\n      apply Eq_equiv_qf\n         (R_Eq_Not_ (R_Eq_Ex_ \u27e8h\u2082.mpr, h\u2082.mp\u27e9)),\n      rcases (h\u2081 (edcl1.ex \u03c6_\u1fb0 \u03c6\u2082)) with \u27e8\u03c6\u2083, h\u2083\u27e9,\n      apply Eq_equiv_qf (R_Eq_Not_ \u27e8h\u2083.mpr, h\u2083.mp\u27e9),\n      existsi (qf.n \u03c6\u2083), refl,\n   },\n   {  rcases (h\u2081 (edcl1.ex \u03c6_\u1fb0 \u03c6_\u1fb0_1)) with \u27e8\u03c6\u2082, h\u2082\u27e9,\n      apply Eq_equiv_qf \u27e8h\u2082.mpr, h\u2082.mp\u27e9,\n      existsi \u03c6\u2082, refl,\n   }\nend\n\nlemma qe_qdcl1_qe_dnf : (@qe_qdcl1 L A _) \u2192 (@qe_dnf L A _) := begin\n   intros h\u2081 \u03c6\u2081,\n   induction \u03c6\u2081,\n   {  existsi (\u03c6\u2081 : qf L), refl, },\n   {  cases \u03c6\u2081_\u1fb0_1,\n      {  rcases (h\u2081 (qdcl1.al \u03c6\u2081_\u1fb0 \u03c6\u2081_\u1fb0_1)) with \u27e8\u03c6\u2082, h\u2082\u27e9,\n         apply Eq_equiv_qf \u27e8h\u2082.mpr, h\u2082.mp\u27e9,\n         existsi \u03c6\u2082, refl, },\n      all_goals {  rcases \u03c6\u2081_ih with \u27e8\u03c6\u2082, h\u2082\u27e9,\n         apply Eq_equiv_qf (R_Eq_All_ \u27e8h\u2082.mpr, h\u2082.mp\u27e9),\n         rcases (qf_equiv_dcl A \u03c6\u2082) with \u27e8\u03c6\u2083, h\u2083\u27e9,\n         apply Eq_equiv_qf (R_Eq_All_ \u27e8h\u2083.mpr, h\u2083.mp\u27e9),\n         rcases (h\u2081 (qdcl1.al \u03c6\u2081_\u1fb0 \u03c6\u2083)) with \u27e8\u03c6\u2084, h\u2084\u27e9,\n         apply Eq_equiv_qf \u27e8h\u2084.mpr, h\u2084.mp\u27e9,\n         existsi \u03c6\u2084, refl,\n      },\n   },\n   {  induction \u03c6\u2081_\u1fb0_1,\n      {  rcases (h\u2081 (qdcl1.ex \u03c6\u2081_\u1fb0 \u03c6\u2081_\u1fb0_1)) with \u27e8\u03c6\u2082, h\u2082\u27e9,\n         apply Eq_equiv_qf \u27e8h\u2082.mpr, h\u2082.mp\u27e9,\n         existsi \u03c6\u2082, refl, },\n      all_goals {  rcases \u03c6\u2081_ih with \u27e8\u03c6\u2082, h\u2082\u27e9,\n         apply Eq_equiv_qf (R_Eq_Ex_ \u27e8h\u2082.mpr, h\u2082.mp\u27e9),\n         rcases (qf_equiv_dcl A \u03c6\u2082) with \u27e8\u03c6\u2083, h\u2083\u27e9,\n         apply Eq_equiv_qf (R_Eq_Ex_ \u27e8h\u2083.mpr, h\u2083.mp\u27e9),\n         rcases (h\u2081 (qdcl1.ex \u03c6\u2081_\u1fb0 \u03c6\u2083)) with \u27e8\u03c6\u2084, h\u2084\u27e9,\n         apply Eq_equiv_qf \u27e8h\u2084.mpr, h\u2084.mp\u27e9,\n         existsi \u03c6\u2084, refl,\n      },\n   }\nend\n\n/- If a theory has quantifer elimination on conjunctions of literals with \n   a single existential quantifier, it has quantifier elimination -/\nlemma qe_ecl1_qe : (\u2200 x : \u2115, @var_not_free_in_axioms L x A _) \u2192 ((@qe_ecl1 L A _) \u2192 (@qe L A _)) := begin\n   intros h\u2081 h\u2082,\n   have h_dnf : qe_dnf A := \n      by { apply qe_qdcl1_qe_dnf, apply qe_edcl1_qe_qdcl1,\n           apply qe_ecl1_qe_edcl1 A h\u2081, assumption },\n   intro \u03c6\u2081,\n   rcases (for_all_equiv_dnf A \u03c6\u2081) with \u27e8\u03c6\u2082, h\u2082\u27e9,\n   apply Eq_equiv_qf \u27e8h\u2082.mpr, h\u2082.mp\u27e9,\n   rcases (h_dnf \u03c6\u2082) with \u27e8\u03c6\u2083, h\u2083\u27e9,\n   apply Eq_equiv_qf \u27e8h\u2083.mpr, h\u2083.mp\u27e9,\n   existsi \u03c6\u2083, refl,\nend\n\n/- Deciable sentences in a theory -/\n--def decidable_sent (\u03c6 : sentence L) : Prop \n--   := ((A\u2223[] \u22a2 (\u03c6 : formula L)) \u2194 (A\u2223\u0393 \u22a2 F)) \u2228 ((A\u2223[] \u22a2 \u03c6) \u2194 (A\u2223\u0393 \u22a2 T))\n\nend quantifier_elimination\n\nend first_order", "meta": {"author": "pilottinick", "repo": "QuantifierElimination", "sha": "770ebc3f8075c9c75d791d1cc0ffde4dd9c8dafc", "save_path": "github-repos/lean/pilottinick-QuantifierElimination", "path": "github-repos/lean/pilottinick-QuantifierElimination/QuantifierElimination-770ebc3f8075c9c75d791d1cc0ffde4dd9c8dafc/src/quantifier_elimination.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5428632831725052, "lm_q2_score": 0.35577489351363034, "lm_q1q2_score": 0.1931371267631578}}
{"text": "import parlang\n\n/- IDEA: try to remove the active map from the assertions -/\n\nnamespace parlang\n\nopen kernel\n\n-- notation ac ` \u21c3 ` c ` \u25c2 `  x:(foldr ` \u25c2 ` (h t, deactivate_threads c ac h) ac) := x\nnotation ac ` \u21c3 ` c ` \u25c2 `  s := deactivate_threads c ac s\n\nexample {\u03c3\u2081 \u03b9\u2081 \u03b9\u2082 : Type} {\u03c4\u2081 : \u03b9\u2081 \u2192 Type} {\u03c4\u2082 : \u03b9\u2082 \u2192 Type} [decidable_eq \u03b9\u2081] [decidable_eq \u03b9\u2082] : \n{* \u03bb n\u2081 s\u2081 ac\u2081 n\u2082 (s\u2082 : state n\u2082 (memory (\u03bb (n: string), \u2115)) \u03c4\u2082) ac\u2082, 0 < n\u2082 \u2227 all_threads_active ac\u2082 *} \n@kernel.compute \u03b9\u2081 \u03c3\u2081 \u03c4\u2081 id ~> kernel.ite (\u03bbm, m.get \"tid\" = 1) (kernel.compute (\u03bb m, m.update \"x\" 1)) (kernel.compute (\u03bbm, m.update \"x\" 0)) \n{* \u03bb n\u2081 s\u2081 ac\u2081 n\u2082 s\u2082 ac\u2082, \u2200 (h : 0 < n\u2082), (s\u2082.threads.nth \u27e80, h\u27e9).tlocal.get \"x\" = 1 *} := begin\n    suffices : {* \u03bb n\u2081 s\u2081 ac\u2081 n\u2082 (s\u2082 : state n\u2082 (memory (\u03bb (n: string), \u2115)) \u03c4\u2082) ac\u2082, 0 < n\u2082 \u2227 (\u03bbac\u2082, all_threads_active ac\u2082) ac\u2082 *} \n        @kernel.compute \u03b9\u2081 \u03c3\u2081 \u03c4\u2081 id ~> kernel.ite (\u03bbm, m.get \"tid\" = 1) (kernel.compute (\u03bb m, m.update \"x\" 1)) (kernel.compute (\u03bbm, m.update \"x\" 0)) \n    {* \u03bb n\u2081 s\u2081 ac\u2081 n\u2082 s\u2082 ac\u2082, (\u2200 (h : 0 < n\u2082), (s\u2082.threads.nth \u27e80, h\u27e9).tlocal.get \"x\" = 1) \u2227 (\u03bbac\u2082, all_threads_active ac\u2082) ac\u2082 *},\n    {\n        apply consequence,\n        exact this,\n        simp,\n        intros,\n        exact \u27e8a, a_1\u27e9,\n        intros,\n        exact (a.left) h,\n    },\n    apply ite_right,\n    swap 7,\n    exact (\u03bbn\u2081 s\u2081 ac\u2081 n\u2082 s\u2082 ac\u2082, \u2200 (h : 0 < n\u2082), (s\u2082.threads.nth \u27e80, h\u27e9).tlocal.get \"x\" = 1),\n    {\n        intros,\n        simp *,\n    }, {\n        intros,\n        exact a,\n    }, {\n        intros,\n        exact a,\n    }, {\n        intros,\n        exact a h,\n    }, {\n        apply consequence_pre,\n        apply compute_right,\n        intros _ _ _ _ _ _ hp _,\n        rw state.map_active_threads_nth_ac,\n        refl,\n        sorry,\n    }, {\n        apply consequence_pre,\n        apply compute_right,\n        intros _ _ _ _ _ _ hp _,\n        rw \u2190 state.map_active_threads_nth_inac,\n        exact hp.left h,\n        sorry,\n    }\nend\n\nsection\n\nparameters (k : kernel bool (\u03bb (s : string), \u2115))\n\ndef p\u2081 : program bool (\u03bb (s : string), \u2115) :=\nprogram.intro (\u03bbm, m.get \"x\") (\n    compute (\u03bb_, tt) ;;\n    ite id (\n        k\n    ) (\n        store (\u03bb_, \u27e8\"a\", 5\u27e9)\n    )\n)\n\ndef p\u2082 : program bool (\u03bb (s : string), \u2115) :=\nprogram.intro (\u03bbm, m.get \"x\") (\n    compute (\u03bb_, tt) ;;\n    k\n)\n\nexample : rel_hoare_program (\u03bb_, ff) (\u03bb_, ff) (\u03bb m\u2081 m\u2082, eq m\u2081 m\u2082 \u2227 0 < m\u2081.get \"x\") p\u2081 p\u2082 eq := begin\n    apply rel_kernel_to_program,\n    apply single_step_left,\n    swap,\n    apply single_step_right,\n    swap,\n    {\n        apply known_branch_left,\n        swap,\n        {\n            apply consequence,\n            apply rhl_eq,\n            swap,\n            {intros,\n            cases a_1 with m\u2081,\n            use m\u2081,\n            use m\u2081,\n            split,\n            assumption,\n            cases a,\n            subst a_left,\n            specialize a_right rfl,\n            cases a_right,\n            subst a_right_left,\n            split,\n            exact a_1_h,\n            refl,},\n            intros,\n            have : (\u2200 (tid : fin n\u2081), id ((vector.nth (s\u2081.threads) tid).tlocal) = tt) \u2227 n\u2081 = n\u2082 \u2227 \u2200 h : n\u2081 = n\u2082, s\u2081 = (by rw h; exact s\u2082) \u2227 ac\u2081 = (by rw h; exact ac\u2082) := a,\n            exact this.right,\n        },\n        intros,\n        exact a.left tid,\n    },\n    apply compute_right,\n    {\n        apply consequence_pre,\n        apply swap (compute_right _),\n        {\n            intros,\n            use s\u2081,\n            apply exec_skip,\n        }, {\n            intros _ _ _ _ _ _ h,\n            simp[assertion_swap_side],\n            cases h with m\u2081 h,\n            cases h with m\u2082 h,\n            cases h with h\u2081 h,\n            cases h with h\u2082 h,\n            cases h with h\u2083 h,\n            cases h with h\u2084 h,\n            cases h with h\u2085 h,\n            cases h with h\u2086 h,\n            cases h with h\u2087 h,\n            cases h with h\u2088 h\u2089,\n            split,\n            {\n                intro tid,\n                rw state.map_active_threads_nth_ac,\n                refl,\n                apply all_threads_active_nth h\u2088,\n            }, \n            split,\n            {\n                cases h\u2087,\n                subst h\u2087_left,\n                rw [h\u2083, \u2190 h\u2084],\n            },\n            intro h',\n            subst h',\n            split, {\n                rw eq.mpr.intro,\n                unfold state.map_active_threads,\n                simp,\n                apply vector.eq_element_wise,\n                intro i,\n                simp,\n                have : ac\u2081 = ac\u2082 := all_threads_active_eq h\u2088 h\u2089,\n                subst this,\n                rw h\u2086,\n                rw h\u2085,\n                cases h\u2087,\n                subst h\u2087_left,\n            }, {\n                have : ac\u2081 = ac\u2082 := all_threads_active_eq h\u2088 h\u2089,\n                exact this,\n            }\n        }\n    }, {\n        intros,\n        exact a.right,\n    }\nend\n\nend\n\nend parlang", "meta": {"author": "fischerman", "repo": "GPU-transformation-verifier", "sha": "75a5016f05382738ff93ce5859c4cfa47ccb63c1", "save_path": "github-repos/lean/fischerman-GPU-transformation-verifier", "path": "github-repos/lean/fischerman-GPU-transformation-verifier/GPU-transformation-verifier-75a5016f05382738ff93ce5859c4cfa47ccb63c1/src/use_cases/parlang/if.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5583269943353745, "lm_q2_score": 0.34510528442897664, "lm_q1q2_score": 0.19268159618448505}}
{"text": "import pseudo_normed_group.FP2\nimport condensed.adjunctions\nimport free_pfpng.acyclic\nimport for_mathlib.derived.ext_coproducts\nimport for_mathlib.derived.example\nimport breen_deligne.eval2\nimport system_of_complexes.shift_sub_id\nimport for_mathlib.AddCommGroup.explicit_products\nimport condensed.Qprime_isoms\nimport condensed.short_exact\nimport condensed.bd_ses\nimport condensed.filtered_colimits\n\nnoncomputable theory\n\nopen_locale nnreal\n\nuniverse u\n\nopen category_theory category_theory.limits breen_deligne\n\ndef ProFiltPseuNormGrpWithTinv\u2081.to_CHFPNG {r'} (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r') :\n  CompHausFiltPseuNormGrp :=\n(PFPNGT\u2081_to_CHFPNG\u2081\u2091\u2097 r' \u22d9 CHFPNG\u2081_to_CHFPNG\u2091\u2097).obj M\n\nsection step1\n\nvariables (r' : \u211d\u22650)\nvariables (BD : breen_deligne.data) (\u03ba : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 c, BD.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\n\nabbreviation freeCond := Profinite_to_Condensed.{u} \u22d9 CondensedSet_to_Condensed_Ab\n\ndef QprimeFP_nat : \u211d\u22650 \u2964 chain_complex (Condensed.{u} Ab.{u+1}) \u2115 :=\nFPsystem r' BD \u27e8M\u27e9 \u03ba \u22d9 (freeCond.{u}.map_FreeAb \u22d9 FreeAb.eval _).map_homological_complex _\n\ndef QprimeFP_int : \u211d\u22650 \u2964 cochain_complex (Condensed.{u} Ab.{u+1}) \u2124 :=\nQprimeFP_nat r' BD \u03ba M \u22d9 homological_complex.embed complex_shape.embedding.nat_down_int_up\n\ndef QprimeFP : \u211d\u22650 \u2964 bounded_homotopy_category (Condensed.{u} Ab.{u+1}) :=\nQprimeFP_nat r' BD \u03ba M \u22d9 chain_complex.to_bounded_homotopy_category\n\nend step1\n\nsection step2\n\nvariables {r' : \u211d\u22650}\nvariables (BD : breen_deligne.package) (\u03ba : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 c, BD.data.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\n\ndef ProFiltPseuNormGrpWithTinv\u2081.to_Condensed : Condensed.{u} Ab.{u+1} :=\n(PFPNGT\u2081_to_CHFPNG\u2081\u2091\u2097 r' \u22d9 CHFPNG\u2081_to_CHFPNG\u2091\u2097.{u} \u22d9\n  CompHausFiltPseuNormGrp.to_Condensed.{u}).obj M\n\n-- move me\n/-- `Tinv : M \u2192 M` as hom of condensed abelian groups -/\ndef _root_.ProFiltPseuNormGrpWithTinv\u2081.Tinv_cond : M.to_Condensed \u27f6 M.to_Condensed :=\n(CompHausFiltPseuNormGrp.to_Condensed.{u}).map\n  profinitely_filtered_pseudo_normed_group_with_Tinv.Tinv\n\nlocal attribute [instance] type_pow\n\nset_option pp.universes true\n\ndef QprimeFP_incl_aux'' (c : \u211d\u22650) (n : \u2115) (M : ProFiltPseuNormGrpWithTinv.{u} r') (i : fin n) :\n  (FiltrationPow r' c n).obj M \u27f6 ((Filtration r').obj c).obj M :=\n((Filtration r').obj c).map $\n  profinitely_filtered_pseudo_normed_group_with_Tinv.pi_proj _ _ i\n\ndef QprimeFP_incl_aux'\n  (c : \u211d\u22650) (n : \u2115) (i : (fin n)) (S : Profinite.{u}\u1d52\u1d56) :\n  ulift_functor.{u+1 u}.obj (opposite.unop.{u+2} S \u27f6 pseudo_normed_group.filtration_obj.{u} (M ^ n) c) \u27f6\n  ulift_functor.{u+1 u}.obj ((CompHausFiltPseuNormGrp.of.{u} \u21a5((PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097.{u} r').obj M)).presheaf (opposite.unop.{u+2} S)) :=\nulift_functor.map $ \u03bb f, \u27e8subtype.val \u2218 QprimeFP_incl_aux'' c n \u27e8M\u27e9 i \u2218 f,\n  by refine \u27e8_, _, continuous.comp _ _, rfl\u27e9; apply continuous_map.continuous\u27e9\n\n-- move me\ninstance : preserves_limits (Condensed_Ab_to_CondensedSet.{u}) :=\nadjunction.right_adjoint_preserves_limits Condensed_Ab_CondensedSet_adjunction\n\n-- move me\ninstance : preserves_limits CondensedSet_to_presheaf :=\nadjunction.right_adjoint_preserves_limits CondensedSet_presheaf_adjunction\n\nuniverse v\n\nlemma _root_.Ab.ulift_map_apply {A B : Ab.{u}} (f : A \u27f6 B) :\n  \u21d1(Ab.ulift.{v}.map f) = ulift_functor.map f :=\nby { ext, refl }\n\n-- def QprimeFP_incl_aux_foo (c : \u211d\u22650) (n : \u2115) :\n--   (pseudo_normed_group.filtration_obj (M ^ n) c).to_Condensed \u27f6\n--   (Condensed_Ab_to_CondensedSet.obj (\u2a01 \u03bb (i : ulift (fin n)), M.to_Condensed)) :=\n-- begin\n--   let x := biproduct.is_bilimit (\u03bb (i : ulift (fin n)), M.to_Condensed),\n--   let y := is_bilimit_of_preserves Condensed_Ab_to_presheaf x,\n--   refine \u27e8y.is_limit.lift \u27e8_, \u27e8\u03bb i, \u27e8_, _\u27e9, _\u27e9\u27e9\u27e9,\n--   { refine QprimeFP_incl_aux' _ _ _ i.down, },\n--   { intros S T f,\n--     dsimp [QprimeFP_incl_aux', ProFiltPseuNormGrpWithTinv\u2081.to_Condensed],\n--     rw [\u2190 ulift_functor.map_comp, Ab.ulift_map_apply, \u2190 ulift_functor.map_comp],\n--     congr' 1, },\n--   { clear y x,\n--     rintros \u27e8i\u27e9 \u27e8j\u27e9 \u27e8\u27e8\u27e8\u27e9\u27e9\u27e9,\n--     ext S : 2,\n--     dsimp [QprimeFP_incl_aux', ProFiltPseuNormGrpWithTinv\u2081.to_Condensed],\n--     simp only [discrete.functor_map_id, category.id_comp],\n--     symmetry, apply category.comp_id, }\n-- end\n\ndef QprimeFP_incl_aux (c : \u211d\u22650) (n : \u2115) :\n  (pseudo_normed_group.filtration_obj (M ^ n) c).to_Condensed \u27f6\n  (Condensed_Ab_to_CondensedSet.obj (\u2a01 \u03bb (i : (fin n)), M.to_Condensed)) :=\nbegin\n  let x := biproduct.is_limit (\u03bb (i : (fin n)), M.to_Condensed),\n  let y := is_limit_of_preserves (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf) x,\n  refine \u27e8y.lift \u27e8_, \u27e8\u03bb i, \u27e8_, _\u27e9, _\u27e9\u27e9\u27e9,\n  { refine QprimeFP_incl_aux' _ _ _ i.as, },\n  { intros S T f,\n    rcases i with \u27e8\u27e8i\u27e9\u27e9,\n    dsimp [QprimeFP_incl_aux', ProFiltPseuNormGrpWithTinv\u2081.to_Condensed],\n    rw [\u2190 ulift_functor.map_comp, Ab.ulift_map_apply, \u2190 ulift_functor.map_comp],\n    congr' 1, },\n  { clear y x,\n    rintros \u27e8i\u27e9 \u27e8j\u27e9 \u27e8\u27e8\u27e8\u27e9\u27e9\u27e9,\n    ext S : 2,\n    dsimp [QprimeFP_incl_aux', ProFiltPseuNormGrpWithTinv\u2081.to_Condensed],\n    simp only [discrete.functor_map_id, category.id_comp],\n    symmetry, apply category.comp_id, }\nend\n.\n\nset_option pp.universes false\n\nlemma lift_app {C \ud835\udcd0 \u03b9 : Type*} [category C] [category \ud835\udcd0] [preadditive \ud835\udcd0]\n  {F G : C \u2964 \ud835\udcd0} (f : \u03b9 \u2192 (F \u27f6 G)) (x) (T) :\n  (free_abelian_group.lift f x).app T = free_abelian_group.lift (\u03bb i, (f i).app T) x :=\nbegin\n  simp only [\u2190 nat_trans.app_hom_apply, \u2190 add_monoid_hom.comp_apply],\n  congr' 1, clear x, ext x,\n  simp only [add_monoid_hom.coe_comp, function.comp_app, free_abelian_group.lift.of],\nend\n\nlemma map_FreeAb_comp_map {X Y Z : Type*} [category X] [category Y] [category Z]\n  (F : X \u2964 Y) (G : Y \u2964 Z) {\u03b1 \u03b2 : FreeAb X} (f : \u03b1 \u27f6 \u03b2) :\n  (F \u22d9 G).map_FreeAb.map f = G.map_FreeAb.map (F.map_FreeAb.map f) :=\nbegin\n  dsimp only [functor.map_FreeAb, functor.comp_map],\n  rw [\u2190 add_monoid_hom.comp_apply], congr' 1, clear f,\n  ext f,\n  simp only [free_abelian_group.map_of_apply, functor.comp_map, add_monoid_hom.coe_comp, function.comp_app],\nend\n\nopen category_theory.preadditive\nopen_locale big_operators\n\nlemma biproduct.desc_eq_sum {\ud835\udcd0 \u03b9 : Type*} [category \ud835\udcd0] [abelian \ud835\udcd0] [fintype \u03b9]\n  (M : \u03b9 \u2192 \ud835\udcd0) (X : \ud835\udcd0) (f : \u03a0 i, M i \u27f6 X) :\n  biproduct.desc f = \u2211 i : \u03b9, (biproduct.\u03c0 _ _) \u226b (f i) :=\nbegin\n  classical,\n  ext i, simp only [biproduct.\u03b9_desc, comp_sum],\n  rw finset.sum_eq_single_of_mem i (finset.mem_univ _),\n  { rw [biproduct.\u03b9_\u03c0_assoc, dif_pos rfl, eq_to_hom_refl, category.id_comp], },\n  { rintro j - hj, rw [biproduct.\u03b9_\u03c0_ne_assoc, zero_comp], exact hj.symm }\nend\n\ninstance group_of_sections (A : Condensed.{u} Ab.{u+1})\n  (S : Profinite.{u}\u1d52\u1d56) :\n  add_comm_group (((Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).obj A).obj S) :=\nAddCommGroup.add_comm_group_instance\n  ((@Sheaf.val Profinite Profinite.category proetale_topology Ab AddCommGroup.large_category A).obj S)\n\ninstance group_of_homs (X A : Type u) [add_comm_group A] :\n  add_comm_group (X \u27f6 A) :=\n@pi.add_comm_group X _ _\n\ninstance ulift_functor_group (A : Type u) [add_comm_group A] :\n  add_comm_group (ulift_functor.obj A) :=\nulift.add_comm_group\n\nlemma QprimeFP_incl_aux3 {X A : Type u} [add_comm_group A] {\u03b9 : Type*}\n  (s : finset \u03b9) (n : \u03b9 \u2192 \u2124) (f : \u03b9 \u2192 (X \u27f6 A)) :\n  (\u2211 i in s, n i \u2022 (ulift_functor.{v}).map (f i)) = ulift_functor.map (\u2211 i in s, n i \u2022 (f i)) :=\nbegin\n  let \u03c6 := add_monoid_hom.mk' (\u03bb g : X \u27f6 A, ulift_functor.{v}.map g) _,\n  { show \u2211 i in s, n i \u2022 \u03c6 (f i) = _, simp only [\u2190 \u03c6.map_sum, \u2190 \u03c6.map_zsmul], refl },\n  intros g\u2081 g\u2082, refl,\nend\n\ninstance group_of_sheaf_homs (X) (A : Condensed.{u} Ab.{u+1}) :\n  add_comm_group (X \u27f6 (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).obj A) :=\n{ add := \u03bb f g, \u27e8\u03bb S, f.app S + g.app S,\n    by { intros S T \u03c6, show X.map \u03c6 \u226b f.app T + X.map \u03c6 \u226b g.app T = _,\n      simp only [nat_trans.naturality], ext1 x, symmetry,\n      exact (A.val.map \u03c6).map_add (f.app S x) (g.app S x) }\u27e9,\n  add_assoc := by { intros, ext : 2, apply add_assoc },\n  zero := \u27e8\u03bb S, 0, by { intros S T \u03c6, ext1 x, symmetry, exact (A.val.map \u03c6).map_zero }\u27e9,\n  zero_add := by { intros, ext : 2, apply zero_add },\n  add_zero := by { intros, ext : 2, apply add_zero },\n  nsmul := \u03bb n f, \u27e8\u03bb S, n \u2022 f.app S,\n    by { intros S T \u03c6, show n \u2022 (X.map \u03c6 \u226b f.app T) = _,\n      simp only [nat_trans.naturality], ext1 x, symmetry,\n      exact (A.val.map \u03c6).map_nsmul (f.app S x) n }\u27e9,\n  nsmul_zero' := by { intros, ext : 2, apply add_comm_group.nsmul_zero' },\n  nsmul_succ' := by { intros, ext : 2, apply add_comm_group.nsmul_succ' },\n  neg := \u03bb f, \u27e8\u03bb S, -f.app S,\n    by { intros S T \u03c6, show -(X.map \u03c6 \u226b f.app T) = _,\n      simp only [nat_trans.naturality], ext1 x, symmetry,\n      exact (A.val.map \u03c6).map_neg (f.app S x) }\u27e9,\n  sub := \u03bb f g, \u27e8\u03bb S, f.app S - g.app S,\n    by { intros S T \u03c6, show X.map \u03c6 \u226b f.app T - X.map \u03c6 \u226b g.app T = _,\n      simp only [nat_trans.naturality], ext1 x, symmetry,\n      exact (A.val.map \u03c6).map_sub (f.app S x) (g.app S x) }\u27e9,\n  sub_eq_add_neg := by { intros, ext : 2, apply sub_eq_add_neg },\n  zsmul := \u03bb n f, \u27e8\u03bb S, n \u2022 f.app S,\n    by { intros S T \u03c6, show n \u2022 (X.map \u03c6 \u226b f.app T) = _,\n      simp only [nat_trans.naturality], ext1 x, symmetry,\n      exact (A.val.map \u03c6).map_zsmul (f.app S x) n }\u27e9,\n  zsmul_zero' := by { intros, ext : 2, apply add_comm_group.zsmul_zero' },\n  zsmul_succ' := by { intros, ext : 2, apply add_comm_group.zsmul_succ' },\n  zsmul_neg' := by { intros, ext : 2, apply add_comm_group.zsmul_neg' },\n  add_left_neg := by { intros, ext : 2, apply add_left_neg },\n  add_comm := by { intros, ext : 2, apply add_comm } }\n\nlemma QprimeFP_incl_aux1 {A B : Condensed.{u} Ab.{u+1}} {\u03b9 : Type*} {X}\n  (f : X \u27f6 (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).obj A)\n  (s : finset \u03b9) (n : \u03b9 \u2192 \u2124) (g : \u03b9 \u2192 (A \u27f6 B)) :\n  f \u226b (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map (\u2211 i in s, n i \u2022 g i) =\n  \u2211 i in s, n i \u2022 (f \u226b (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map (g i)) :=\nbegin\n  let \u03c6 := add_monoid_hom.mk' (\u03bb g : A \u27f6 B, f \u226b (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map g) _,\n  { show \u03c6 _ = _, simp only [\u03c6.map_sum, \u03c6.map_zsmul], refl },\n  intros g\u2081 g\u2082, refl,\nend\n\nlemma QprimeFP_incl_aux2 {A : Condensed.{u} Ab.{u+1}} {\u03b9 : Type*} {X}\n  (s : finset \u03b9) (n : \u03b9 \u2192 \u2124)\n  (f : \u03b9 \u2192 (X \u27f6 (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).obj A)) (S) :\n  (\u2211 i in s, n i \u2022 f i).app S = \u2211 i in s, n i \u2022 ((f i).app S) :=\nbegin\n  let \u03c6 := add_monoid_hom.mk' (\u03bb g : X \u27f6 (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).obj A, nat_trans.app g S) _,\n  { show \u03c6 _ = _, simp only [\u03c6.map_sum, \u03c6.map_zsmul], refl },\n  intros g\u2081 g\u2082, refl,\nend\n\n-- move me\n-- lemma _root_.comphaus_filtered_pseudo_normed_group_hom.coe_to_add_monoid_hom\n--   {M N : Type*} [comphaus_filtered_pseudo_normed_group M] [comphaus_filtered_pseudo_normed_group N]\n--   (f : comphaus_filtered_pseudo_normed_group_hom M N) :\n--   \u21d1f.to_add_monoid_hom = f := rfl\n\n@[simps] def _root_.CompHausFiltPseuNormGrp.presheaf_incl\n  (A : CompHausFiltPseuNormGrp.{u}) (S : Profinite.{u}) :\n  CompHausFiltPseuNormGrp.presheaf A S \u2192+ (S \u2192 A) :=\nadd_monoid_hom.mk' subtype.val $ \u03bb _ _, rfl\n\ndef QprimeFP_incl (c : \u211d\u22650) :\n  (QprimeFP_int r' BD.data \u03ba M).obj c \u27f6\n  (BD.eval' freeCond').obj M.to_Condensed :=\n(homological_complex.embed complex_shape.embedding.nat_down_int_up).map\n{ f := \u03bb n, CondensedSet_to_Condensed_Ab.map $ QprimeFP_incl_aux _ _ _,\n  comm' := begin\n    rintro _ n (rfl : _ = _),\n    rw [package.eval_functor_obj_d],\n    dsimp only [universal_map.eval_Pow],\n    dsimp only [QprimeFP_nat, FPsystem, functor.comp_obj, functor.map_homological_complex_obj_d],\n    rw [chain_complex.of_d],\n    delta freeCond freeCond',\n    rw [functor.comp_map, map_FreeAb_comp_map, lift_app],\n    dsimp only [FreeAb.eval, functor.map_FreeAb, FPsystem.d,\n      universal_map.eval_FP2],\n    simp only [whisker_right_app, free_abelian_group.lift_map, function.comp.left_id,\n      nat_trans.app_sum, map_sum, basic_universal_map.eval_Pow_app,\n      nat_trans.app_zsmul, basic_universal_map.eval_FP2, map_zsmul],\n    dsimp only [FreeAb.of_functor],\n    simp only [free_abelian_group.lift.of, function.comp_app],\n    rw [free_abelian_group.lift_eq_sum, comp_sum, sum_comp, \u2190 finset.sum_coe_sort],\n    apply finset.sum_congr rfl,\n    rintro t -,\n    rw [comp_zsmul, zsmul_comp], refine congr_arg2 _ rfl _,\n    rw [functor.comp_map, \u2190 functor.map_comp, \u2190 functor.map_comp],\n    congr' 1,\n    ext1,\n    let x := \u03bb n, biproduct.is_limit (\u03bb (i : (fin (BD.data.X n))), M.to_Condensed),\n    let y := \u03bb n, is_limit_of_preserves (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf) (x n),\n    apply (y _).hom_ext, rintro \u27e8j\u27e9,\n    rw [\u2190 CondensedSet_to_presheaf_map, \u2190 CondensedSet_to_presheaf_map, functor.map_comp,\n      \u2190 functor.comp_map, category.assoc, functor.map_comp, category.assoc],\n    erw [\u2190 functor.map_comp, biproduct.matrix_\u03c0],\n    dsimp only [QprimeFP_incl_aux, CondensedSet_to_presheaf_map],\n    rw (y _).fac,\n    simp only [biproduct.desc_eq_sum, comp_zsmul, category.comp_id],\n    rw [QprimeFP_incl_aux1],\n    have help : \u2200 n i,\n      ((Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map_cone\n        (biproduct.bicone (\u03bb (i : (fin (BD.data.X n))), M.to_Condensed)).to_cone).\u03c0.app \u27e8i\u27e9 =\n      (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map\n        (biproduct.\u03c0 (\u03bb (i : (fin (BD.data.X n))), M.to_Condensed) i),\n    { intros, refl },\n    simp only [\u2190 help, (y _).fac], clear help,\n    dsimp only [basic_universal_map.eval_FP, Profinite_to_Condensed_map_val,\n      basic_universal_map.eval_png\u2080],\n    ext S : 2,\n    erw QprimeFP_incl_aux2,\n    dsimp only [nat_trans.comp_app, whisker_right_app, QprimeFP_incl_aux'],\n    rw [\u2190 ulift_functor.map_comp, types_comp, QprimeFP_incl_aux3],\n    congr' 1,\n    dsimp only [function.comp, yoneda_map_app, yoneda_obj_obj, chain_complex.of_X,\n      Profinite.coe_comp_apply, continuous_map.coe_mk, QprimeFP_incl_aux''],\n    ext f s, clear y x,\n    dsimp only [subtype.coe_mk, Filtration_obj_map_apply, add_monoid_hom.mk'_apply,\n      comphaus_filtered_pseudo_normed_group_with_Tinv_hom.level, pseudo_normed_group.level,\n      profinitely_filtered_pseudo_normed_group_with_Tinv.pi_proj,\n      comphaus_filtered_pseudo_normed_group_with_Tinv_hom.coe_mk,\n      pi.eval_add_monoid_hom_apply, breen_deligne.basic_universal_map.eval_png\u2080,\n      breen_deligne.basic_universal_map.eval_png,\n      comphaus_filtered_pseudo_normed_group.pi_lift,\n      comphaus_filtered_pseudo_normed_group_hom.coe_mk, add_monoid_hom.mk_to_pi_apply],\n    simp only [\u2190 comphaus_filtered_pseudo_normed_group_hom.to_add_monoid_hom_hom_apply,\n      add_monoid_hom.map_sum],\n    rw [fintype.sum_apply, \u2190 add_monoid_hom.eval_apply_apply, add_monoid_hom.map_sum,\n      \u2190 CompHausFiltPseuNormGrp.presheaf_incl_apply, add_monoid_hom.map_sum, fintype.sum_apply],\n    --rw [\u2190 equiv.ulift.{u+1 0}.sum_comp],\n    refine finset.sum_congr rfl _,\n    intros t ht, refl,\n  end }\n\nvariables (\u03b9 : ulift.{u+1} \u2115 \u2192 \u211d\u22650) (h\u03b9 : monotone \u03b9)\n\ndef QprimeFP_sigma_proj :\n  \u2210 (\u03bb k, (QprimeFP_int r' BD.data \u03ba M).obj (\u03b9 k)) \u27f6\n  (BD.eval' freeCond').obj M.to_Condensed :=\nsigma.desc $ \u03bb n, QprimeFP_incl BD \u03ba M _\n\ninstance QprimeFP.uniformly_bounded :\n  bounded_homotopy_category.uniformly_bounded (\u03bb k, (QprimeFP r' BD.data \u03ba M).obj (\u03b9 k)) :=\nbegin\n  use 1, intro k, apply chain_complex.bounded_by_one,\nend\n\nend step2\n\nsection step3\nopen bounded_homotopy_category\n\nvariables (\u03b9 : ulift.{u+1} \u2115 \u2192 \u211d\u22650) (h\u03b9 : monotone \u03b9)\nvariables {C : Type*} [category C] [preadditive C]\nvariables (A B : \u211d\u22650 \u2964 C)\nvariables [has_coproduct (\u03bb (k : ulift \u2115), A.obj (\u03b9 k))]\nvariables [has_coproduct (\u03bb (k : ulift \u2115), B.obj (\u03b9 k))]\n\ninclude h\u03b9\n\ndef sigma_shift_cone (c : cofan (\u03bb k, A.obj (\u03b9 k))) :\n  cofan (\u03bb k, A.obj (\u03b9 k)) :=\n{ X := c.X,\n  \u03b9 := discrete.nat_trans $ \u03bb \u27e8(j: ulift \u2115)\u27e9,\n        A.map (hom_of_le $ h\u03b9 $ (by { cases j, apply nat.le_succ } : j \u2264 \u27e8j.down+1\u27e9)) \u226b\n          c.\u03b9.app \u27e8\u27e8j.down + 1\u27e9\u27e9 }\n\nomit h\u03b9\n\ndef sigma_shift' (c : cofan (\u03bb k, A.obj (\u03b9 k))) (hc : is_colimit c) :\n  c.X \u27f6 (sigma_shift_cone \u03b9 h\u03b9 A c).X := hc.desc _\n\ndef sigma_shift : \u2210 (\u03bb k, A.obj (\u03b9 k)) \u27f6 \u2210 (\u03bb k, A.obj (\u03b9 k)) :=\nsigma_shift' _ h\u03b9 _ _ (colimit.is_colimit _)\n\ndef QprimeFP.shift_sub_id : \u2210 (\u03bb k, A.obj (\u03b9 k)) \u27f6 \u2210 (\u03bb k, A.obj (\u03b9 k)) :=\nsigma_shift _ h\u03b9 _ - \ud835\udfd9 _\n\nvariables {A B}\n\ndef sigma_map (f : A \u27f6 B) : \u2210 (\u03bb k, A.obj (\u03b9 k)) \u27f6 \u2210 (\u03bb k, B.obj (\u03b9 k)) :=\nsigma.desc $ \u03bb k, f.app _ \u226b sigma.\u03b9 _ k\n\nend step3\n\nsection step4\n\nvariables {r' : \u211d\u22650}\nvariables (BD : breen_deligne.package) (\u03ba : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 c, BD.data.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\nvariables (\u03b9 : ulift.{u+1} \u2115 \u2192 \u211d\u22650) (h\u03b9 : monotone \u03b9)\n\nopen opposite category_theory.preadditive\n\nopen_locale classical\n\nset_option pp.universes true\n\ndef coproduct_eval_iso\n  {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 homological_complex (Condensed.{u} Ab.{u+1}) (complex_shape.up \u2124))\n  (n : \u2124) (T : ExtrDisc.{u}) :\n  ((\u2210 X).X n).val.obj (op T.val) \u2245\n  AddCommGroup.of (direct_sum \u03b1 (\u03bb a, ((X a).X n).val.obj (op T.val))) :=\nbegin\n  refine preserves_colimit_iso\n    ((homological_complex.eval (Condensed.{u} Ab.{u+1}) (complex_shape.up \u2124) n\n    \u22d9 Condensed.evaluation Ab.{u+1} T.val)) _ \u226a\u226b _,\n  refine _ \u226a\u226b (colimit.is_colimit $ discrete.functor\n    (\u03bb a, ((X a).X n).val.obj (op T.val))).cocone_point_unique_up_to_iso\n    (AddCommGroup.is_colimit_direct_sum_cofan.{u+1 u+1} (\u03bb a, ((X a).X n).val.obj (op T.val))),\n  refine has_colimit.iso_of_nat_iso (discrete.nat_iso _),\n  intros i, exact iso.refl _,\nend\n\nlemma sigma_\u03b9_coproduct_eval_iso\n  {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 homological_complex (Condensed.{u} Ab.{u+1}) (complex_shape.up \u2124))\n  (n : \u2124) (T : ExtrDisc.{u}) (a : \u03b1) :\n  ((sigma.\u03b9 X a : X a \u27f6 _).f n).val.app (op T.val) \u226b\n  (coproduct_eval_iso _ _ _).hom =\n  direct_sum.of ((\u03bb a, ((X a).X n).val.obj (op T.val))) a :=\nbegin\n  dsimp only [coproduct_eval_iso],\n  erw (is_colimit_of_preserves (homological_complex.eval.{u+1 u+2 0}\n    (Condensed.{u u+1 u+2} Ab.{u+1}) (complex_shape.up.{0} \u2124) n \u22d9\n    Condensed.evaluation.{u+2 u+1 u} Ab.{u+1} T.val) _).fac_assoc,\n  dsimp,\n  erw colimit.\u03b9_desc_assoc,\n  dsimp, simpa only [category.id_comp, colimit.comp_cocone_point_unique_up_to_iso_hom],\nend\n\n-- Move this!\ninstance CondensedSet_to_Condensed_Ab_preserves_colimits :\n  preserves_colimits CondensedSet_to_Condensed_Ab.{u} :=\nadjunction.left_adjoint_preserves_colimits Condensed_Ab_CondensedSet_adjunction\n\nsection ses_setup\n\nlocal attribute [instance] type_pow\n\ndef Condensed_prod_val_iso {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 CondensedSet.{u}) :\n  (\u220f X).val \u2245 \u220f (\u03bb i, (X i).val) :=\npreserves_limit_iso CondensedSet_to_presheaf _ \u226a\u226b\nhas_limit.iso_of_nat_iso (discrete.nat_iso $ \u03bb p, iso.refl _)\n\n@[simp, reassoc]\nlemma Condensed_prod_val_iso_spec {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 CondensedSet.{u}) (i : \u03b1) :\n  (Condensed_prod_val_iso X).hom \u226b pi.\u03c0 _ i =\n  (pi.\u03c0 X i : \u220f X \u27f6 X i).val :=\nbegin\n  dsimp [Condensed_prod_val_iso],\n  simp only [category.assoc],\n  erw limit.lift_\u03c0,\n  dsimp,\n  erw limit.lift_\u03c0_assoc,\n  erw category.comp_id,\n  refl,\nend\n\n@[simp, reassoc]\nlemma Condensed_prod_val_iso_spec' {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 CondensedSet.{u}) (i : \u03b1) :\n  (Condensed_prod_val_iso X).inv \u226b (pi.\u03c0 X i : \u220f X \u27f6 X i).val = pi.\u03c0 _ _ :=\nby { rw iso.inv_comp_eq, rw Condensed_prod_val_iso_spec }\n\ndef functor_prod_eval_iso {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 (Profinite.{u}\u1d52\u1d56 \u2964 Type (u+1))) (T) :\n  (\u220f X).obj T \u2245 \u220f (\u03bb i, (X i).obj T) :=\npreserves_limit_iso ((evaluation _ _).obj T) _ \u226a\u226b\nhas_limit.iso_of_nat_iso (discrete.nat_iso $ \u03bb p, iso.refl _)\n\n@[simp, reassoc]\nlemma functor_prod_eval_iso_spec\n  {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 (Profinite.{u}\u1d52\u1d56 \u2964 Type (u+1))) (T) (i : \u03b1) :\n  (functor_prod_eval_iso X T).hom \u226b pi.\u03c0 _ i =\n  (pi.\u03c0 X i : \u220f X \u27f6 X i).app _ :=\nbegin\n  dsimp [functor_prod_eval_iso],\n  simp only [category.assoc],\n  erw limit.lift_\u03c0,\n  dsimp,\n  erw limit.lift_\u03c0_assoc,\n  erw category.comp_id,\n  refl,\nend\n\n@[simp, reassoc]\nlemma functor_prod_eval_iso_spec'\n  {\u03b1 : Type (u+1)} (X : \u03b1 \u2192 (Profinite.{u}\u1d52\u1d56 \u2964 Type (u+1))) (T) (i : \u03b1) :\n  (functor_prod_eval_iso X T).inv \u226b (pi.\u03c0 X i : \u220f X \u27f6 X i).app _ =\n  pi.\u03c0 _ i :=\nby { rw iso.inv_comp_eq, rw functor_prod_eval_iso_spec }\n\ndef filtration_pow_iso_aux (j : \u2115) (r : \u211d\u22650) :\n  (ProFiltPseuNormGrp\u2081.level.obj r).obj\n    (\u220f \u03bb i : ulift.{u} (fin j), (PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097 _).obj M) \u2245\n  (\u220f \u03bb i : ulift.{u} (fin j), pseudo_normed_group.filtration_obj M r) :=\npreserves_limit_iso (ProFiltPseuNormGrp\u2081.level.obj r) _ \u226a\u226b\nhas_limit.iso_of_nat_iso (discrete.nat_iso $ \u03bb q, iso.refl _)\n\n@[simp, reassoc]\nlemma filtration_pow_iso_aux_spec (j : \u2115) (r : \u211d\u22650) (i) :\n  (filtration_pow_iso_aux M j r).hom \u226b pi.\u03c0\n    (\u03bb i : ulift.{u} (fin j), pseudo_normed_group.filtration_obj M r) i =\n  (ProFiltPseuNormGrp\u2081.level.obj r).map (pi.\u03c0 _ i) :=\nbegin\n  dsimp [filtration_pow_iso_aux],\n  simp only [category.assoc],\n  erw limit.lift_\u03c0,\n  dsimp,\n  erw limit.lift_\u03c0_assoc,\n  erw category.comp_id,\n  refl,\nend\n\n@[simp, reassoc]\nlemma filtration_pow_iso_aux_spec' (j : \u2115) (r : \u211d\u22650) (i) :\n  (filtration_pow_iso_aux M j r).inv \u226b\n  (ProFiltPseuNormGrp\u2081.level.obj r).map (pi.\u03c0 _ i) =\n  pi.\u03c0 _ i :=\nby { rw iso.inv_comp_eq, rw filtration_pow_iso_aux_spec }\n\ndef ProFiltPseuNormGrp\u2081.product_fan {\u03b1 : Type u} [fintype \u03b1] (X : \u03b1 \u2192 ProFiltPseuNormGrp\u2081.{u}) :\n  fan X :=\nfan.mk (ProFiltPseuNormGrp\u2081.product X) $ \u03bb i, ProFiltPseuNormGrp\u2081.product.\u03c0 _ _\n\ndef ProFiltPseuNormGrp\u2081.is_limit_product_fan {\u03b1 : Type u} [fintype \u03b1]\n  (X : \u03b1 \u2192 ProFiltPseuNormGrp\u2081.{u}) :\n  is_limit (ProFiltPseuNormGrp\u2081.product_fan X) :=\n{ lift := \u03bb S, ProFiltPseuNormGrp\u2081.product.lift _ _ $ \u03bb i, S.\u03c0.app \u27e8i\u27e9,\n  fac' := begin\n    rintro S \u27e8j\u27e9,\n    dsimp,\n    erw ProFiltPseuNormGrp\u2081.product.lift_\u03c0,\n  end,\n  uniq' := begin\n    intros S m hm,\n    apply ProFiltPseuNormGrp\u2081.product.hom_ext,\n    rintro j,\n    erw hm \u27e8j\u27e9,\n    erw ProFiltPseuNormGrp\u2081.product.lift_\u03c0,\n  end }\n\ndef ProFiltPseuNormGrp\u2081.product_pow_iso {\u03b1 : Type u} [fintype \u03b1]\n  (X : \u03b1 \u2192 ProFiltPseuNormGrp\u2081.{u}) :\n  \u220f X \u2245 ProFiltPseuNormGrp\u2081.product X :=\n(limit.is_limit _).cone_point_unique_up_to_iso (ProFiltPseuNormGrp\u2081.is_limit_product_fan _)\n\n@[simp, reassoc]\nlemma ProFiltPseuNormGrp\u2081.product_pow_iso_spec {\u03b1 : Type u} [fintype \u03b1]\n  (X : \u03b1 \u2192 ProFiltPseuNormGrp\u2081.{u}) (i) :\n  (ProFiltPseuNormGrp\u2081.product_pow_iso X).hom \u226b\n  ProFiltPseuNormGrp\u2081.product.\u03c0 _ _ = pi.\u03c0 _ i :=\nbegin\n  erw ProFiltPseuNormGrp\u2081.product.lift_\u03c0,\n  refl,\nend\n\n@[simp, reassoc]\nlemma ProFiltPseuNormGrp\u2081.product_pow_iso_spec' {\u03b1 : Type u} [fintype \u03b1]\n  (X : \u03b1 \u2192 ProFiltPseuNormGrp\u2081.{u}) (i) :\n  (ProFiltPseuNormGrp\u2081.product_pow_iso X).inv \u226b pi.\u03c0 _ i =\n  ProFiltPseuNormGrp\u2081.product.\u03c0 _ _ :=\nby { rw iso.inv_comp_eq, rw ProFiltPseuNormGrp\u2081.product_pow_iso_spec }\n\ndef filtration_pow_proj (j : \u2115) (r : \u211d\u22650) (i : fin j) :\n  pseudo_normed_group.filtration_obj.{u} (\u21a5M ^ j) r \u27f6\n  pseudo_normed_group.filtration_obj.{u} M r :=\n{ to_fun := \u03bb t, \u27e8t.1 i, t.2 _\u27e9,\n  continuous_to_fun := begin\n    let e := (comphaus_filtered_pseudo_normed_group.filtration_pi_homeo\n      (\u03bb i : (fin j), M) r),\n    let t := _, change continuous t,\n    suffices : continuous (t \u2218 e.symm), by simpa using this,\n    convert continuous_apply i,\n    ext, refl,\n  end }\n\ndef filtration_pow_iso_aux'\u2080 (j : \u2115) (r : \u211d\u22650) :\n  pseudo_normed_group.filtration_obj.{u} (\u21a5M ^ j) r \u2245\n  (ProFiltPseuNormGrp\u2081.level.{u}.obj r).obj\n  (ProFiltPseuNormGrp\u2081.product.{u} (\u03bb (i : ulift.{u 0} (fin j)),\n    (PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097.{u} r').obj M)) :=\n-- This can't be the best way to do this, but at this point I'm quite annoyed.\n{ hom :=\n  { to_fun := \u03bb q, \u27e8\u03bb i, q.1 i.down, begin\n      intros i,\n      apply q.2,\n    end\u27e9,\n    continuous_to_fun := begin\n      rw (comphaus_filtered_pseudo_normed_group.filtration_pi_homeo\n        (\u03bb i : ulift.{u} (fin j), M) r).inducing.continuous_iff,\n      apply continuous_pi,\n      intros i, dsimp,\n      let e := (comphaus_filtered_pseudo_normed_group.filtration_pi_homeo\n        (\u03bb i : (fin j), M) r),\n      let t := _, change continuous t,\n      suffices : continuous (t \u2218 e.symm), by simpa using this,\n      convert continuous_apply i.down,\n      ext, refl,\n    end },\n  inv :=\n  { to_fun := \u03bb q, \u27e8\u03bb i, q.1 \u27e8i\u27e9, begin\n      intros i,\n      apply q.2,\n    end\u27e9,\n    continuous_to_fun := begin\n      let e\u2081 := (comphaus_filtered_pseudo_normed_group.filtration_pi_homeo\n        (\u03bb i : (fin j), M) r),\n      let e\u2082 := (comphaus_filtered_pseudo_normed_group.filtration_pi_homeo\n        (\u03bb i : ulift.{u} (fin j), M) r),\n      let t := _, change continuous t,\n      suffices : continuous (e\u2081 \u2218 t \u2218 e\u2082.symm), by simpa using this,\n      apply continuous_pi,\n      intros i, convert continuous_apply (ulift.up i),\n      ext, refl,\n    end },\n  hom_inv_id' := by { ext, refl },\n  inv_hom_id' := by { ext _ \u27e8\u27e9, refl } }\n\n@[simp, reassoc]\nlemma filtration_pow_iso_aux'\u2080_spec (j : \u2115) (r : \u211d\u22650) (i) :\n  (filtration_pow_iso_aux'\u2080 M j r).hom \u226b\n  ((ProFiltPseuNormGrp\u2081.level.obj r).map $ ProFiltPseuNormGrp\u2081.product.\u03c0 _ i) =\n  filtration_pow_proj M j r i.down := by { ext, refl }\n\n@[simp, reassoc]\nlemma filtration_pow_iso_aux'\u2080_spec' (j : \u2115) (r : \u211d\u22650) (i : ulift.{u} (fin j)) :\n  (filtration_pow_iso_aux'\u2080 M j r).inv \u226b filtration_pow_proj M j r i.down =\n  ((ProFiltPseuNormGrp\u2081.level.obj r).map $ ProFiltPseuNormGrp\u2081.product.\u03c0 _ i) :=\nby { cases i, ext _ \u27e8k\u27e9, refl }\n\ndef filtration_pow_iso_aux' (j : \u2115) (r : \u211d\u22650) :\n  pseudo_normed_group.filtration_obj.{u} (\u21a5M ^ j) r \u2245\n  (ProFiltPseuNormGrp\u2081.level.obj r).obj\n    (\u220f \u03bb i : ulift.{u} (fin j), (PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097 _).obj M) :=\nfiltration_pow_iso_aux'\u2080 _ _ _ \u226a\u226b\n(ProFiltPseuNormGrp\u2081.level.obj r).map_iso (ProFiltPseuNormGrp\u2081.product_pow_iso _).symm\n\n@[simp, reassoc]\nlemma filtration_pow_iso_aux'_spec (j : \u2115) (r : \u211d\u22650) (i) :\n  (filtration_pow_iso_aux' M j r).hom \u226b\n  (ProFiltPseuNormGrp\u2081.level.obj r).map (pi.\u03c0 _ i) =\n  filtration_pow_proj _ _ _ i.down :=\nbegin\n  dsimp [filtration_pow_iso_aux'],\n  simp only [category.assoc],\n  simp only [\u2190 functor.map_comp, ProFiltPseuNormGrp\u2081.product_pow_iso_spec'],\n  simp,\nend\n\n@[simp, reassoc]\nlemma filtration_pow_iso_aux'_spec' (j : \u2115) (r : \u211d\u22650) (i : ulift.{u} (fin j)) :\n  (filtration_pow_iso_aux' M j r).inv \u226b filtration_pow_proj _ _ _ i.down =\n  (ProFiltPseuNormGrp\u2081.level.obj r).map (pi.\u03c0 _ i) :=\nby { rw iso.inv_comp_eq, rw filtration_pow_iso_aux'_spec }\n\ndef filtration_pow_iso (j : \u2115) (r : \u211d\u22650) :\n  pseudo_normed_group.filtration_obj.{u} (M ^ j) r \u2245\n  \u220f \u03bb i : ulift.{u} (fin j), pseudo_normed_group.filtration_obj M r :=\nfiltration_pow_iso_aux' _ _ _ \u226a\u226b filtration_pow_iso_aux _ _ _\n\n@[simp, reassoc]\nlemma filtration_pow_iso_spec (j : \u2115) (r : \u211d\u22650) (i : ulift.{u} (fin j)) :\n  (filtration_pow_iso M j r).hom \u226b pi.\u03c0 _ i =\n  filtration_pow_proj _ _ _ i.down :=\nbegin\n  dsimp [filtration_pow_iso],\n  simp,\nend\n\n@[simp, reassoc]\nlemma filtration_pow_iso_spec' (j : \u2115) (r : \u211d\u22650) (i : ulift.{u} (fin j)) :\n  (filtration_pow_iso M j r).inv \u226b filtration_pow_proj _ _ _ i.down =\n  pi.\u03c0 _ i :=\nby { rw iso.inv_comp_eq, rw filtration_pow_iso_spec }\n\ndef profinite_pow_filtration_iso_component (j : \u2115) (r : \u211d\u22650) (T : Profinite.{u}) :\n  ulift.{u+1} (T \u27f6 pseudo_normed_group.filtration_obj.{u} (\u21a5M ^ j) r) \u2245\n  \u220f \u03bb (i : ulift.{u+1} (fin j)), ulift.{u+1}\n    (T \u27f6 (ProFiltPseuNormGrp\u2081.level.{u}.obj r).obj ((PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097.{u} r').obj M)) :=\nulift_functor.map_iso\n((yoneda.flip.obj (op T)).map_iso $ filtration_pow_iso _ _ _) \u226a\u226b\n{ hom := pi.lift $ \u03bb i f, ulift.up $ ulift.down f \u226b pi.\u03c0 _ (ulift.up i.down),\n  inv := \u03bb t, ulift.up $ pi.lift $ \u03bb i,\n    let q := pi.\u03c0 (\u03bb (i : ulift.{u+1 0} (fin j)),\n      ulift.{u+1 u}\n      (T \u27f6 (ProFiltPseuNormGrp\u2081.level.{u}.obj r).obj\n      ((PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097.{u} r').obj M))) (ulift.up $ ulift.down i) t in q.down,\n  hom_inv_id' := begin\n    ext \u27e8t\u27e9 : 2, dsimp,\n    apply limit.hom_ext, rintros \u27e8\u27e8q\u27e9\u27e9,\n    simp,\n  end,\n  inv_hom_id' := begin\n    apply limit.hom_ext, rintro \u27e8\u27e8q\u27e9\u27e9,\n    simp only [category.assoc, limit.lift_\u03c0, fan.mk_\u03c0_app, category.id_comp],\n    ext t,\n    dsimp,\n    rw [\u2190 comp_apply, limit.lift_\u03c0],\n    refl,\n  end }\n\n.\n\n@[simp, reassoc]\nlemma profinite_pow_filtration_iso_component_spec (j : \u2115) (r : \u211d\u22650) (T : Profinite.{u})\n  (i : ulift.{u+1} (fin j)) :\n  (profinite_pow_filtration_iso_component M j r T).hom \u226b pi.\u03c0 _ i =\n  ulift_functor.map ((yoneda.flip.obj (op T)).map $ filtration_pow_proj _ _ _ i.down) :=\nbegin\n  dsimp [profinite_pow_filtration_iso_component],\n  simp,\n  ext \u27e8t\u27e9 : 2,\n  dsimp,\n  simp,\nend\n\n@[simp, reassoc]\nlemma profinite_pow_filtration_iso_component_spec' (j : \u2115) (r : \u211d\u22650) (T : Profinite.{u})\n  (i : ulift.{u+1} (fin j)) :\n  (profinite_pow_filtration_iso_component M j r T).inv \u226b\n  ulift_functor.map ((yoneda.flip.obj (op T)).map $ filtration_pow_proj _ _ _ i.down) =\n  pi.\u03c0 _ i :=\nby { rw iso.inv_comp_eq, rw profinite_pow_filtration_iso_component_spec }\n\ndef profinite_pow_filtration_iso (j : \u2115) (r : \u211d\u22650) :\n  (pseudo_normed_group.filtration_obj.{u} (\u21a5M ^ j) r).to_Condensed \u2245\n  \u220f \u03bb (k : ulift.{u+1 0} (fin j)), ((ProFiltPseuNormGrp\u2081.level.obj r).obj\n    ((PFPNGT\u2081_to_PFPNG\u2081\u2091\u2097 _).obj M)).to_Condensed :=\nbegin\n  refine Sheaf.iso.mk _ _ _,\n  refine _ \u226a\u226b (Condensed_prod_val_iso _).symm,\n  refine nat_iso.of_components _ _,\n  { intros T,\n    refine _ \u226a\u226b (functor_prod_eval_iso _ _).symm,\n    refine profinite_pow_filtration_iso_component _ _ _ _ },\n  { intros X Y f, dsimp,\n    apply (is_limit_of_preserves ((evaluation _ _).obj Y) (limit.is_limit _)).hom_ext,\n    rintro \u27e8i\u27e9, swap, apply_instance,\n    dsimp, simp only [category.assoc],\n    erw [functor_prod_eval_iso_spec', nat_trans.naturality,\n      functor_prod_eval_iso_spec'_assoc, profinite_pow_filtration_iso_component_spec,\n      profinite_pow_filtration_iso_component_spec_assoc],\n    ext, refl }\nend\n\n@[simp, reassoc]\nlemma profinite_pow_filtration_iso_spec (j : \u2115) (r : \u211d\u22650) (i : ulift.{u+1} (fin j)) :\n  (profinite_pow_filtration_iso M j r).hom \u226b pi.\u03c0 _ i =\n  Profinite_to_Condensed.map (filtration_pow_proj _ _ _ i.down) :=\nbegin\n  dsimp [profinite_pow_filtration_iso, Sheaf.iso.mk],\n  ext1, dsimp,\n  simp only [category.assoc],\n  rw Condensed_prod_val_iso_spec',\n  ext T : 2,\n  dsimp,\n  simp only [category.assoc],\n  rw functor_prod_eval_iso_spec',\n  erw profinite_pow_filtration_iso_component_spec,\n  refl,\nend\n\n@[simp, reassoc]\nlemma profinite_pow_filtration_iso_spec' (j : \u2115) (r : \u211d\u22650) (i : ulift.{u+1} (fin j)) :\n  (profinite_pow_filtration_iso M j r).inv \u226b\n  Profinite_to_Condensed.map (filtration_pow_proj _ _ _ i.down) = pi.\u03c0 _ i :=\nby { rw iso.inv_comp_eq, rw profinite_pow_filtration_iso_spec }\n\ndef combine (h\u03b9 : monotone \u03b9) (n : \u2115) : \u2115 \u2192o \u211d\u22650 :=\n{ to_fun := \u03bb t, \u03ba (\u03b9 $ ulift.up t) n,\n  monotone' := begin\n    intros a b h,\n    apply (fact.out (monotone (function.swap \u03ba n))),\n    apply h\u03b9,\n    exact h\n  end }\n\ndef iso_on_the_left_zero\u2080 :\n (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X 0 \u2245\n (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), ((QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X 0) :=\nbegin\n  refine preserves_colimit_iso (homological_complex.eval _ _ 0) _ \u226a\u226b _,\n  refine has_colimit.iso_of_nat_iso (discrete.nat_iso $ \u03bb i, iso.refl _),\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_zero\u2080_spec' (i : ulift.{u+1} \u2115) :\n  sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), ((QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X 0) i \u226b\n  (iso_on_the_left_zero\u2080 BD \u03ba M \u03b9).inv =\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) i).f 0 :=\nbegin\n  dsimp [iso_on_the_left_zero\u2080],\n  erw colimit.\u03b9_desc_assoc, dsimp, simp only [category.id_comp],\n  erw colimit.\u03b9_desc, refl,\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_zero\u2080_spec (i : ulift.{u+1} \u2115) :\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) i).f 0 \u226b\n  (iso_on_the_left_zero\u2080 BD \u03ba M \u03b9).hom =\n  sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), ((QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X 0) i :=\nby { rw \u2190 iso.eq_comp_inv, rw iso_on_the_left_zero\u2080_spec', }\n\ndef iso_on_the_left_zero  :\n (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X 0 \u2245\n  \u2210 \u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n      (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X 0))),\n      (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 0)).obj i) :=\nbegin\n  refine iso_on_the_left_zero\u2080 BD \u03ba M _ \u226a\u226b _,\n  refine sigma.map_iso _,\n  rintros \u27e8j\u27e9,\n  dsimp [QprimeFP_int, QprimeFP_nat, FreeAb.eval, functor.map_FreeAb,\n    FPsystem, FPsystem.X],\n  refine CondensedSet_to_Condensed_Ab.map_iso _,\n  refine profinite_pow_filtration_iso M (BD.data.X 0) (\u03ba (\u03b9 \u27e8j\u27e9) 0), --\u226a\u226b _,\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_zero_spec' (k : \u2115) :\n  sigma.\u03b9 (\u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n    (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X 0))),\n    (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 0)).obj i))\n    \u27e8k\u27e9 \u226b (iso_on_the_left_zero _ _ _ _ _).inv =\n  CondensedSet_to_Condensed_Ab.map (profinite_pow_filtration_iso M\n    (BD.data.X 0) (\u03ba (\u03b9 \u27e8k\u27e9) 0)).inv \u226b\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) \u27e8k\u27e9).f 0 :=\nbegin\n  dsimp [iso_on_the_left_zero],\n  erw colimit.\u03b9_desc_assoc, dsimp,\n  rw [category.assoc],\n  slice_lhs 2 3\n  { rw iso_on_the_left_zero\u2080_spec' },\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_zero_spec (k : \u2115) :\n  CondensedSet_to_Condensed_Ab.map (profinite_pow_filtration_iso M\n    (BD.data.X 0) (\u03ba (\u03b9 \u27e8k\u27e9) 0)).inv \u226b\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) \u27e8k\u27e9).f 0 \u226b\n  (iso_on_the_left_zero _ _ _ _ _).hom =\n  sigma.\u03b9 (\u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n    (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X 0))),\n    (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 0)).obj i))\n    \u27e8k\u27e9 :=\nbegin\n  rw [\u2190 category.assoc, \u2190 iso.eq_comp_inv, iso_on_the_left_zero_spec'],\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_zero_spec_alt (k : \u2115) :\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) \u27e8k\u27e9).f 0 \u226b\n  (iso_on_the_left_zero _ _ _ _ _).hom =\n  CondensedSet_to_Condensed_Ab.map (profinite_pow_filtration_iso M\n    (BD.data.X 0) (\u03ba (\u03b9 \u27e8k\u27e9) 0)).hom \u226b\n  sigma.\u03b9 (\u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n    (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X 0))),\n    (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 0)).obj i))\n    \u27e8k\u27e9 :=\nbegin\n  rw [\u2190 functor.map_iso_hom, \u2190 iso.inv_comp_eq,\n    functor.map_iso_inv, iso_on_the_left_zero_spec],\nend\n\ndef pseudo_normed_group.map_filtration (M : Type*) [profinitely_filtered_pseudo_normed_group M]\n  (a b : \u211d\u22650) (h : a \u2264 b) :\n  pseudo_normed_group.filtration_obj M a \u27f6 pseudo_normed_group.filtration_obj M b :=\n{ to_fun := pseudo_normed_group.cast_le' h,\n  continuous_to_fun := begin\n    haveI : fact (a \u2264 b) := \u27e8h\u27e9,\n    apply comphaus_filtered_pseudo_normed_group.continuous_cast_le,\n  end }\n\nlemma pow_filtration_hom_ext {T : Profinite.{u}} (j : \u2115) (r : \u211d\u22650)\n  (f g : T \u27f6 pseudo_normed_group.filtration_obj (M^j) r)\n  (h : \u2200 k, f \u226b filtration_pow_proj M j r k = g \u226b filtration_pow_proj M j r k) : f = g :=\nbegin\n  ext t x,\n  specialize h x,\n  apply_fun (\u03bb e, (e t).1) at h,\n  exact h,\nend\n\nlemma iso_on_the_left_zero_conj_aux (j : \u2115) :\n  ((profinite_pow_filtration_iso.{u} M (BD.data.X 0) (\u03ba (\u03b9 {down := j}) 0)).hom \u226b\n    (Condensed.as_nat_diagram_pow.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 0) (BD.data.X 0)).map\n    (as_small.up.{0 0 u+1}.map (hom_of_le.{0} (nat.le_succ _)))) \u226b\n  (profinite_pow_filtration_iso.{u} M (BD.data.X 0) (\u03ba (\u03b9 {down := j + 1}) 0)).inv =\n  Profinite_to_Condensed.map (pseudo_normed_group.map_filtration _ _ _\n    (fact.out (monotone (function.swap \u03ba 0)) (h\u03b9 $ by { exact_mod_cast j.le_succ }))) :=\nbegin\n  rw iso.comp_inv_eq,\n  apply limit.hom_ext, rintro \u27e8k\u27e9,\n  dsimp [Condensed.as_nat_diagram_pow, pow_functor], simp only [category.assoc],\n  erw profinite_pow_filtration_iso_spec,\n  simp only [lim_map_\u03c0, discrete.nat_trans_app],\n  erw profinite_pow_filtration_iso_spec_assoc,\n  dsimp [Condensed.as_nat_diagram, restrict_diagram,\n    CompHausFiltPseuNormGrp.level_Condensed_diagram,\n    CompHausFiltPseuNormGrp.level_Condensed_diagram'],\n  rw \u2190 Profinite_to_Condensed.map_comp,\n  have h : \u03ba (\u03b9 \u27e8j\u27e9) 0 \u2264 \u03ba (\u03b9 \u27e8j+1\u27e9) 0,\n  { apply fact.out (monotone (function.swap \u03ba 0)),\n    apply h\u03b9,\n    exact_mod_cast j.le_succ },\n  change _ \u226b Profinite_to_Condensed.map (pseudo_normed_group.map_filtration M _ _ h) = _,\n  rw \u2190 Profinite_to_Condensed.map_comp,\n  congr' 1,\nend\n\nlemma iso_on_the_left_zero_conj :\n  ((QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba M)).f 0) =\n  (iso_on_the_left_zero _ _ _ _ h\u03b9).hom \u226b\n  (Condensed.coproduct_to_coproduct (Condensed.as_nat_diagram_pow M.to_CHFPNG\n    (combine \u03ba \u03b9 h\u03b9 0) _ \u22d9 _) - \ud835\udfd9 _) \u226b (iso_on_the_left_zero _ _ _ _ h\u03b9).inv :=\nbegin\n  dsimp [QprimeFP.shift_sub_id],\n  simp only [comp_sub, sub_comp, category.id_comp, iso.hom_inv_id,\n    category.assoc], congr' 1,\n  apply (is_colimit_of_preserves (homological_complex.eval _ _ _)\n    (colimit.is_colimit _)).hom_ext, swap, apply_instance,\n  rintros \u27e8\u27e8j\u27e9\u27e9, dsimp,\n  erw [\u2190 homological_complex.comp_f, colimit.\u03b9_desc],\n  dsimp [sigma_shift_cone],\n  rw iso_on_the_left_zero_spec_alt_assoc,\n  erw colimit.\u03b9_desc_assoc, dsimp,\n  simp only [category.assoc],\n  slice_rhs 3 4\n  { erw iso_on_the_left_zero_spec' },\n  simp only [\u2190 category.assoc],\n  congr' 1,\n  dsimp [CondensedSet_to_Condensed_Ab],\n  simp only [\u2190 functor.map_comp],\n  dsimp [QprimeFP_int, QprimeFP_nat, FreeAb.eval, functor.map_FreeAb,\n    FPsystem, FPsystem.X, FreeAb.of_functor],\n  rw free_abelian_group.lift.of, dsimp,\n  congr' 1,\n  ext S : 2,\n  dsimp,\n  simp only [\u2190 functor.map_comp], congr' 1,\n  simp only [\u2190 nat_trans.comp_app, \u2190 Sheaf.hom.comp_val],\n  rw iso_on_the_left_zero_conj_aux,\n  ext, refl,\nend\n\ndef iso_on_the_left_neg\u2080 (q : \u2115) :\n (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X (-[1+q]) \u2245\n (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), ((QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X (-[1+q])) :=\nbegin\n  refine preserves_colimit_iso (homological_complex.eval _ _ _) _ \u226a\u226b _,\n  refine has_colimit.iso_of_nat_iso (discrete.nat_iso $ \u03bb i, iso.refl _),\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_neg\u2080_spec' (q : \u2115) (i : ulift.{u+1} \u2115) :\n  sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), ((QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X (-[1+q])) i \u226b\n  (iso_on_the_left_neg\u2080 BD \u03ba M \u03b9 q).inv =\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) i).f (-[1+q]) :=\nbegin\n  dsimp [iso_on_the_left_neg\u2080],\n  erw colimit.\u03b9_desc_assoc, dsimp, simp only [category.id_comp],\n  erw colimit.\u03b9_desc, refl,\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_neg\u2080_spec (q : \u2115) (i : ulift.{u+1} \u2115) :\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) i).f (-[1+q]) \u226b\n  (iso_on_the_left_neg\u2080 BD \u03ba M \u03b9 q).hom =\n  sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), ((QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X (-[1+q])) i :=\nby { rw \u2190 iso.eq_comp_inv, rw iso_on_the_left_neg\u2080_spec', }\n\ndef iso_on_the_left_neg (q : \u2115) :\n (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)).X (-[1+q]) \u2245\n  \u2210 \u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n      (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X (q+1)))),\n      (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 (q+1))).obj i) :=\nbegin\n  refine iso_on_the_left_neg\u2080 BD \u03ba M _ q \u226a\u226b _,\n  refine sigma.map_iso _,\n  rintros \u27e8j\u27e9,\n  dsimp [QprimeFP_int, QprimeFP_nat, FreeAb.eval, functor.map_FreeAb,\n    FPsystem, FPsystem.X],\n  refine CondensedSet_to_Condensed_Ab.map_iso _,\n  refine profinite_pow_filtration_iso M (BD.data.X (q+1)) (\u03ba (\u03b9 \u27e8j\u27e9) (q+1)),\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_neg_spec' (q : \u2115) (k : \u2115) :\n  sigma.\u03b9 (\u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n    (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X (q+1)))),\n    (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 (q+1))).obj i))\n    \u27e8k\u27e9 \u226b (iso_on_the_left_neg _ _ _ _ _ q).inv =\n  CondensedSet_to_Condensed_Ab.map (profinite_pow_filtration_iso M\n    (BD.data.X (q+1)) (\u03ba (\u03b9 \u27e8k\u27e9) (q+1))).inv \u226b\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) \u27e8k\u27e9).f (-[1+q]) :=\nbegin\n  dsimp [iso_on_the_left_neg],\n  erw colimit.\u03b9_desc_assoc, dsimp,\n  rw [category.assoc],\n  slice_lhs 2 3\n  { rw iso_on_the_left_neg\u2080_spec' },\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_neg_spec (q : \u2115) (k : \u2115) :\n  CondensedSet_to_Condensed_Ab.map (profinite_pow_filtration_iso M\n    (BD.data.X (q+1)) (\u03ba (\u03b9 \u27e8k\u27e9) (q+1))).inv \u226b\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) \u27e8k\u27e9).f (-[1+q]) \u226b\n  (iso_on_the_left_neg _ _ _ _ _ q).hom =\n  sigma.\u03b9 (\u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n    (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X (q+1)))),\n    (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 (q+1))).obj i))\n    \u27e8k\u27e9 :=\nbegin\n  rw [\u2190 category.assoc, \u2190 iso.eq_comp_inv, iso_on_the_left_neg_spec'],\nend\n\n@[simp, reassoc]\nlemma iso_on_the_left_neg_spec_alt (q : \u2115) (k : \u2115) :\n  (sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)) \u27e8k\u27e9).f (-[1+q]) \u226b\n  (iso_on_the_left_neg _ _ _ _ _ q).hom =\n  CondensedSet_to_Condensed_Ab.map (profinite_pow_filtration_iso M\n    (BD.data.X (q+1)) (\u03ba (\u03b9 \u27e8k\u27e9) (q+1))).hom \u226b\n  sigma.\u03b9 (\u03bb (i : as_small.{u+1 0 0} \u2115), CondensedSet_to_Condensed_Ab.{u}.obj\n    (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X (q+1)))),\n    (Condensed.as_nat_diagram.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 (q+1))).obj i))\n    \u27e8k\u27e9 :=\nbegin\n  rw [\u2190 functor.map_iso_hom, \u2190 iso.inv_comp_eq,\n    functor.map_iso_inv, iso_on_the_left_neg_spec],\nend\n\nlemma iso_on_the_left_neg_conj_aux (q : \u2115) (j : \u2115) :\n  ((profinite_pow_filtration_iso.{u} M (BD.data.X (q+1)) (\u03ba (\u03b9 {down := j}) (q+1))).hom \u226b\n    (Condensed.as_nat_diagram_pow.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 (q+1)) (BD.data.X (q+1))).map\n    (as_small.up.{0 0 u+1}.map (hom_of_le.{0} (nat.le_succ _)))) \u226b\n  (profinite_pow_filtration_iso.{u} M (BD.data.X (q+1)) (\u03ba (\u03b9 {down := j + 1}) (q+1))).inv =\n  Profinite_to_Condensed.map (pseudo_normed_group.map_filtration _ _ _\n    (fact.out (monotone (function.swap \u03ba (q+1))) (h\u03b9 $ by { exact_mod_cast j.le_succ }))) :=\nbegin\n  rw iso.comp_inv_eq,\n  apply limit.hom_ext, rintro \u27e8k\u27e9,\n  dsimp [Condensed.as_nat_diagram_pow, pow_functor], simp only [category.assoc],\n  erw profinite_pow_filtration_iso_spec,\n  simp only [lim_map_\u03c0, discrete.nat_trans_app],\n  erw profinite_pow_filtration_iso_spec_assoc,\n  dsimp [Condensed.as_nat_diagram, restrict_diagram,\n    CompHausFiltPseuNormGrp.level_Condensed_diagram,\n    CompHausFiltPseuNormGrp.level_Condensed_diagram'],\n  rw \u2190 Profinite_to_Condensed.map_comp,\n  have h : \u03ba (\u03b9 \u27e8j\u27e9) (q+1) \u2264 \u03ba (\u03b9 \u27e8j+1\u27e9) (q+1),\n  { apply fact.out (monotone (function.swap \u03ba (q+1))),\n    apply h\u03b9,\n    exact_mod_cast j.le_succ },\n  change _ \u226b Profinite_to_Condensed.map (pseudo_normed_group.map_filtration M _ _ h) = _,\n  rw \u2190 Profinite_to_Condensed.map_comp,\n  congr' 1,\nend\n\nlemma iso_on_the_left_neg_conj (q : \u2115) :\n  ((QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba M)).f (-[1+q])) =\n  (iso_on_the_left_neg _ _ _ _ h\u03b9 _).hom \u226b\n  (Condensed.coproduct_to_coproduct (Condensed.as_nat_diagram_pow M.to_CHFPNG\n    (combine \u03ba \u03b9 h\u03b9 (q+1)) _ \u22d9 _) - \ud835\udfd9 _) \u226b (iso_on_the_left_neg _ _ _ _ h\u03b9 _).inv :=\nbegin\n  dsimp [QprimeFP.shift_sub_id],\n  simp only [comp_sub, sub_comp, category.id_comp, iso.hom_inv_id,\n    category.assoc], congr' 1,\n  apply (is_colimit_of_preserves (homological_complex.eval _ _ _)\n    (colimit.is_colimit _)).hom_ext, swap, apply_instance,\n  rintros \u27e8\u27e8j\u27e9\u27e9, dsimp,\n  erw [\u2190 homological_complex.comp_f, colimit.\u03b9_desc],\n  dsimp [sigma_shift_cone],\n  rw iso_on_the_left_neg_spec_alt_assoc,\n  erw colimit.\u03b9_desc_assoc, dsimp,\n  simp only [category.assoc],\n  slice_rhs 3 4\n  { erw iso_on_the_left_neg_spec' },\n  simp only [\u2190 category.assoc],\n  congr' 1,\n  dsimp [CondensedSet_to_Condensed_Ab],\n  simp only [\u2190 functor.map_comp],\n  dsimp [QprimeFP_int, QprimeFP_nat, FreeAb.eval, functor.map_FreeAb,\n    FPsystem, FPsystem.X, FreeAb.of_functor],\n  rw free_abelian_group.lift.of, dsimp,\n  congr' 1,\n  ext S : 2,\n  dsimp,\n  simp only [\u2190 functor.map_comp], congr' 1,\n  simp only [\u2190 nat_trans.comp_app, \u2190 Sheaf.hom.comp_val],\n  rw iso_on_the_left_neg_conj_aux,\n  ext, refl,\nend\n\n.\n\ndef product_iso_biproduct {A : Type (u+2)} [category.{u+1} A]\n  [abelian A] {\u03b1 : Type (u+1)} [fintype \u03b1] (X : \u03b1 \u2192 A) :\n  \u220f X \u2245 biproduct X :=\n(limit.is_limit _).cone_point_unique_up_to_iso (biproduct.is_limit _)\n\n@[simp, reassoc]\nlemma product_iso_biproduct_spec' {A : Type (u+2)} [category.{u+1} A]\n  [abelian A] {\u03b1 : Type (u+1)} [fintype \u03b1] (X : \u03b1 \u2192 A) (t) :\n  (product_iso_biproduct X).inv \u226b pi.\u03c0 _ t =\n  biproduct.\u03c0 _ t :=\nbegin\n  erw limit.lift_\u03c0, refl,\nend\n\n@[simp, reassoc]\nlemma product_iso_biproduct_spec {A : Type (u+2)} [category.{u+1} A]\n  [abelian A] {\u03b1 : Type (u+1)} [fintype \u03b1] (X : \u03b1 \u2192 A) (t) :\n  (product_iso_biproduct X).hom \u226b biproduct.\u03c0 _ t = pi.\u03c0 _ t :=\nbegin\n  rw [\u2190 iso.eq_inv_comp, product_iso_biproduct_spec'],\nend\n\ndef Condensed_product_iso_biproduct (q : \u2115) :\n  Condensed_Ab_to_CondensedSet.{u}.obj\n  (\u220f \u03bb (i : ulift.{u+1 0} (fin (q))), M.to_Condensed) \u2245\n  Condensed_Ab_to_CondensedSet.{u}.obj\n  (\u2a01 \u03bb (i : (fin (q))), M.to_Condensed) :=\nCondensed_Ab_to_CondensedSet.map_iso $\n{ hom := biproduct.lift $ \u03bb i, pi.\u03c0 _ \u27e8i\u27e9,\n  inv := pi.lift $ \u03bb i, biproduct.\u03c0 _ i.down,\n  hom_inv_id' := by { apply limit.hom_ext, rintros \u27e8\u27e8j\u27e9\u27e9, dsimp, simp, },\n  inv_hom_id' := by { apply biproduct.hom_ext, rintros \u27e8j\u27e9, dsimp, simp } }\n--(limit.is_limit _).cone_point_unique_up_to_iso (biproduct.is_limit _)\n\n@[simp, reassoc]\nlemma Condensed_product_iso_biproduct_spec' (q : \u2115) (i : ulift.{u+1} (fin q)) :\n  (Condensed_product_iso_biproduct M q).inv \u226b\n  Condensed_Ab_to_CondensedSet.map (pi.\u03c0 _ i) =\n  Condensed_Ab_to_CondensedSet.map (biproduct.\u03c0 _ i.down) :=\nbegin\n  dsimp only [Condensed_product_iso_biproduct, functor.map_iso_inv, functor.map_iso_hom],\n  rw \u2190 Condensed_Ab_to_CondensedSet.map_comp,\n  erw limit.lift_\u03c0,\n  refl,\nend\n\n@[simp, reassoc]\nlemma Condensed_product_iso_biproduct_spec (q : \u2115) (i : ulift.{u+1} (fin q)) :\n  (Condensed_product_iso_biproduct M q).hom \u226b\n  Condensed_Ab_to_CondensedSet.map (biproduct.\u03c0 _ i.down) =\n  Condensed_Ab_to_CondensedSet.map (pi.\u03c0 _ i) :=\nbegin\n  rw \u2190 iso.eq_inv_comp, rw Condensed_product_iso_biproduct_spec',\nend\n\ndef Condensed_product_iso_product (q : \u2115) :\n  Condensed_Ab_to_CondensedSet.{u}.obj\n  (\u220f \u03bb (i : ulift.{u+1 0} (fin (q))), M.to_Condensed) \u2245\n  \u220f \u03bb i : ulift.{u+1} (fin q), Condensed_Ab_to_CondensedSet.obj M.to_Condensed :=\npreserves_limit_iso Condensed_Ab_to_CondensedSet _ \u226a\u226b\nhas_limit.iso_of_nat_iso (discrete.nat_iso $ \u03bb i, iso.refl _)\n\n@[simp, reassoc]\nlemma Condensed_product_iso_product_spec (q : \u2115) (i : ulift.{u+1} (fin q)) :\n  (Condensed_product_iso_product M q).hom \u226b pi.\u03c0 _ i =\n  Condensed_Ab_to_CondensedSet.map (pi.\u03c0 _ i) :=\nbegin\n  dsimp [Condensed_product_iso_product], simp only [category.assoc],\n  erw limit.lift_\u03c0,\n  dsimp,\n  erw [category.comp_id, limit.lift_\u03c0], refl,\nend\n\n@[simp, reassoc]\nlemma Condensed_product_iso_product_spec' (q : \u2115) (i : ulift.{u+1} (fin q)) :\n  (Condensed_product_iso_product M q).inv \u226b Condensed_Ab_to_CondensedSet.map (pi.\u03c0 _ i) =\n  pi.\u03c0 _ i :=\nby { rw iso.inv_comp_eq, rw Condensed_product_iso_product_spec }\n\ndef iso_on_the_right_zero :\n  CondensedSet_to_Condensed_Ab.{u}.obj\n  (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X 0))),\n  (Condensed.as_nat_cocone.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 0)).X) \u2245\n  ((BD.eval' freeCond'.{u}).obj M.to_Condensed).X 0 :=\nbegin\n  refine CondensedSet_to_Condensed_Ab.map_iso _,\n  dsimp,\n  refine _ \u226a\u226b Condensed_product_iso_biproduct _ _,\n  refine (Condensed_product_iso_product _ _).symm,\nend\n\n-- Why is this thing tagged with simp in the first place!?\nlocal attribute [-simp] forget_map_eq_coe\n\n@[simp, reassoc]\nlemma iso_on_the_right_zero_spec' (i : ulift.{u+1} (fin (BD.data.X 0))) :\n  (iso_on_the_right_zero BD \u03ba M \u03b9 h\u03b9).inv \u226b\n  CondensedSet_to_Condensed_Ab.map (pi.\u03c0 _ i) =\n  CondensedSet_to_Condensed_Ab.map (Condensed_Ab_to_CondensedSet.map $ biproduct.\u03c0 _ i.down) :=\nbegin\n  dsimp [iso_on_the_right_zero], simp only [\u2190 functor.map_comp], congr' 1, ext S : 2,\n  dsimp, simp_rw [\u2190 functor.map_comp, \u2190 nat_trans.comp_app, \u2190 Sheaf.hom.comp_val, category.assoc],\n  erw Condensed_product_iso_product_spec,\n  erw Condensed_product_iso_biproduct_spec',\n  refl,\nend\n\n@[simp, reassoc]\nlemma iso_on_the_right_zero_spec (i : ulift.{u+1} (fin (BD.data.X 0))) :\n  (iso_on_the_right_zero BD \u03ba M \u03b9 h\u03b9).hom \u226b\n  CondensedSet_to_Condensed_Ab.map (Condensed_Ab_to_CondensedSet.map $ biproduct.\u03c0 _ i.down) =\n  CondensedSet_to_Condensed_Ab.map (pi.\u03c0 _ i) :=\nby { rw \u2190 iso.eq_inv_comp, rw iso_on_the_right_zero_spec' }\n\nlemma iso_on_the_right_zero_conj :\n  ((QprimeFP_sigma_proj BD \u03ba M \u03b9).f 0) =\n  (iso_on_the_left_zero _ _ _ _ h\u03b9).hom \u226b\n  Condensed.coproduct_presentation_with_pow CondensedSet_to_Condensed_Ab M.to_CHFPNG\n    (combine _ _ _ _) _ \u226b (iso_on_the_right_zero _ _ _ _ _).hom :=\nbegin\n  dsimp [QprimeFP_sigma_proj],\n  apply (is_colimit_of_preserves (homological_complex.eval _ _ 0)\n    (colimit.is_colimit (discrete.functor $\n    \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)))).hom_ext,\n  rintros \u27e8\u27e8i\u27e9\u27e9, dsimp, rw [\u2190 homological_complex.comp_f, colimit.\u03b9_desc], dsimp,\n  slice_rhs 1 2 { erw iso_on_the_left_zero_spec_alt BD \u03ba M \u03b9 h\u03b9 i },\n  dsimp [Condensed.coproduct_presentation_with_pow,\n    -CondensedSet_to_Condensed_Ab_map], simp only [category.assoc, colimit.\u03b9_desc],\n  dsimp [-CondensedSet_to_Condensed_Ab_map],\n  dsimp [QprimeFP_incl, -CondensedSet_to_Condensed_Ab_map, iso_on_the_right_zero],\n  simp only [\u2190 functor.map_comp], congr' 1,\n  simp_rw \u2190 category.assoc, rw [\u2190 iso.comp_inv_eq, iso.eq_comp_inv],\n  apply limit.hom_ext, rintro \u27e8j\u27e9,\n  simp only [category.assoc, lim_map_\u03c0],\n  erw Condensed_product_iso_product_spec,\n  erw Condensed_product_iso_biproduct_spec',\n  erw profinite_pow_filtration_iso_spec_assoc,\n  ext S : 3,\n  dsimp [QprimeFP_incl_aux],\n  rw [\u2190 whisker_right_app, \u2190 nat_trans.comp_app],\n  have := (is_limit_of_preserves\n    (Condensed_Ab_to_CondensedSet.{u} \u22d9 CondensedSet_to_presheaf.{u})\n    (biproduct.is_limit (\u03bb (i : (fin (BD.data.X 0))), M.to_Condensed))).fac,\n  dsimp at this, erw this _ \u27e8j.down\u27e9,\n  ext, refl,\nend\n\n.\n\ndef iso_on_the_right_neg (q : \u2115) :\n  CondensedSet_to_Condensed_Ab.{u}.obj\n  (\u220f \u03bb (j : ulift.{u+1 0} (fin (BD.data.X (q+1)))),\n  (Condensed.as_nat_cocone.{u} M.to_CHFPNG (combine.{u} \u03ba \u03b9 h\u03b9 (q+1))).X) \u2245\n  ((BD.eval' freeCond'.{u}).obj M.to_Condensed).X (-[1+q]) :=\nbegin\n  refine CondensedSet_to_Condensed_Ab.map_iso _,\n  dsimp,\n  refine _ \u226a\u226b Condensed_product_iso_biproduct _ _,\n  refine (Condensed_product_iso_product _ _).symm,\nend\n\n@[simp, reassoc]\nlemma iso_on_the_right_neg_spec' (q : \u2115) (i : ulift.{u+1} (fin (BD.data.X (q+1)))) :\n  (iso_on_the_right_neg BD \u03ba M \u03b9 h\u03b9 q).inv \u226b\n  CondensedSet_to_Condensed_Ab.map (pi.\u03c0 _ i) =\n  CondensedSet_to_Condensed_Ab.map (Condensed_Ab_to_CondensedSet.map $ biproduct.\u03c0 _ i.down) :=\nbegin\n  dsimp [iso_on_the_right_neg], simp only [\u2190 functor.map_comp], congr' 1, ext S : 2,\n  dsimp, simp_rw [\u2190 functor.map_comp, \u2190 nat_trans.comp_app, \u2190 Sheaf.hom.comp_val, category.assoc],\n  erw Condensed_product_iso_product_spec,\n  erw Condensed_product_iso_biproduct_spec',\n  refl,\nend\n\n@[simp, reassoc]\nlemma iso_on_the_right_neg_spec (q : \u2115) (i : ulift.{u+1} (fin (BD.data.X (q+1)))) :\n  (iso_on_the_right_neg BD \u03ba M \u03b9 h\u03b9 q).hom \u226b\n  CondensedSet_to_Condensed_Ab.map (Condensed_Ab_to_CondensedSet.map $ biproduct.\u03c0 _ i.down) =\n  CondensedSet_to_Condensed_Ab.map (pi.\u03c0 _ i) :=\nby { rw \u2190 iso.eq_inv_comp, rw iso_on_the_right_neg_spec' }\n\nlemma iso_on_the_right_neg_conj (q : \u2115) :\n  ((QprimeFP_sigma_proj BD \u03ba M \u03b9).f (-[1+q])) =\n  (iso_on_the_left_neg _ _ _ _ h\u03b9 q).hom \u226b\n  Condensed.coproduct_presentation_with_pow CondensedSet_to_Condensed_Ab M.to_CHFPNG\n    (combine _ _ _ _) _ \u226b (iso_on_the_right_neg _ _ _ _ _ _).hom :=\nbegin\n  dsimp [QprimeFP_sigma_proj],\n  apply (is_colimit_of_preserves (homological_complex.eval _ _ (-[1+q]))\n    (colimit.is_colimit (discrete.functor $\n    \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj (\u03b9 k)))).hom_ext,\n  rintros \u27e8\u27e8i\u27e9\u27e9, dsimp, rw [\u2190 homological_complex.comp_f, colimit.\u03b9_desc], dsimp,\n  slice_rhs 1 2 { erw iso_on_the_left_neg_spec_alt BD \u03ba M \u03b9 h\u03b9 q i },\n  dsimp [Condensed.coproduct_presentation_with_pow,\n    -CondensedSet_to_Condensed_Ab_map], simp only [category.assoc, colimit.\u03b9_desc],\n  dsimp [-CondensedSet_to_Condensed_Ab_map],\n  dsimp [QprimeFP_incl, -CondensedSet_to_Condensed_Ab_map, iso_on_the_right_neg],\n  simp only [\u2190 functor.map_comp], congr' 1,\n  simp_rw \u2190 category.assoc, rw [\u2190 iso.comp_inv_eq, iso.eq_comp_inv],\n  apply limit.hom_ext, rintro \u27e8j\u27e9,\n  simp only [category.assoc, lim_map_\u03c0],\n  erw Condensed_product_iso_product_spec,\n  erw Condensed_product_iso_biproduct_spec',\n  erw profinite_pow_filtration_iso_spec_assoc,\n  ext S : 3,\n  dsimp [QprimeFP_incl_aux],\n  rw [\u2190 whisker_right_app, \u2190 nat_trans.comp_app],\n  erw (is_limit_of_preserves (Condensed_Ab_to_CondensedSet.{u} \u22d9\n    CondensedSet_to_presheaf.{u})\n    (biproduct.is_limit (\u03bb (i : (fin (BD.data.X (q+1)))), M.to_Condensed))).fac _ \u27e8j.down\u27e9,\n  ext, refl,\nend\n\nend ses_setup\n\nlemma QprimeFP.mono (n : \u2124) :\n  mono ((QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba M)).f n) :=\nbegin\n  rcases n with (_|q)|q,\n  { erw iso_on_the_left_zero_conj,\n    apply_with mono_comp { instances := ff }, apply_instance,\n    apply_with mono_comp { instances := ff }, swap, apply_instance,\n    apply Condensed.mono_coproduct_to_coproduct },\n  { apply mono_of_is_zero_object,\n    let e :\n      (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj\n        (\u03b9 k)).X (int.of_nat q.succ) \u2245\n      \u2210 \u03bb k : ulift.{u+1} \u2115, ((QprimeFP_int.{u} r' BD.data \u03ba M).obj\n        (\u03b9 k)).X (int.of_nat q.succ) :=\n      preserves_colimit_iso (homological_complex.eval _ _ _) _ \u226a\u226b\n      has_colimit.iso_of_nat_iso (discrete.nat_iso $ \u03bb p, iso.refl _),\n    apply is_zero_of_iso_of_zero _ e.symm,\n    apply is_zero_colimit, intros j,\n    exact is_zero_zero _ },\n  { erw iso_on_the_left_neg_conj,\n    apply_with mono_comp { instances := ff }, apply_instance,\n    apply_with mono_comp { instances := ff }, swap, apply_instance,\n    apply Condensed.mono_coproduct_to_coproduct },\n\n  /-\n  rw Condensed.mono_iff_ExtrDisc, intros T,\n  let Q := QprimeFP_int r' BD.data \u03ba M,\n  let e : ((\u2210 \u03bb (k : ulift.{u+1 0} \u2115), Q.obj (\u03b9 k)).X n).val.obj\n    (op T.val) \u2245 _ := coproduct_eval_iso _ _ _,\n  let \u03c6 : ulift.{u+1} \u2115 \u2192 Ab.{u+1} := \u03bb k, ((Q.obj (\u03b9 k)).X n).val.obj (op T.val),\n  let D := AddCommGroup.direct_sum_cofan.{u+1 u+1} \u03c6,\n  let hD := AddCommGroup.is_colimit_direct_sum_cofan.{u+1 u+1} \u03c6,\n  let g : D.X \u27f6 D.X := sigma_shift'.{u u+2 u+1} _ h\u03b9 (Q \u22d9 (homological_complex.eval\n    (Condensed.{u} Ab.{u+1}) (complex_shape.up \u2124) n) \u22d9 Condensed.evaluation _ T.val) D hD,\n  let f := _, change mono f,\n  have hf : f = e.hom \u226b (g - \ud835\udfd9 _) \u226b e.inv,\n  { rw [\u2190 category.assoc, iso.eq_comp_inv],\n    dsimp [f, QprimeFP.shift_sub_id],\n    change (_ - _) \u226b _ = _,\n    simp only [comp_sub, sub_comp, category.id_comp, category.comp_id, Sheaf.hom.id_val,\n      nat_trans.id_app], congr' 1,\n    refine ((is_colimit_of_preserves (homological_complex.eval.{u+1 u+2 0}\n      (Condensed.{u u+1 u+2} Ab.{u+1}) (complex_shape.up.{0} \u2124) n \u22d9\n      Condensed.evaluation.{u+2 u+1 u} Ab.{u+1} T.val) (colimit.is_colimit _))).hom_ext (\u03bb j, _),\n    dsimp [sigma_shift],\n    slice_lhs 1 2\n    { erw [\u2190 nat_trans.comp_app, \u2190 Sheaf.hom.comp_val, \u2190 homological_complex.comp_f,\n        colimit.\u03b9_desc] },\n    slice_rhs 1 2\n    { erw sigma_\u03b9_coproduct_eval_iso },\n    dsimp [sigma_shift_cone],\n    rw category.assoc,\n    slice_lhs 2 3\n    { erw sigma_\u03b9_coproduct_eval_iso },\n    erw hD.fac, refl },\n  suffices : mono (g - \ud835\udfd9 _),\n  { rw hf,\n    apply_with mono_comp { instances := ff },\n    apply_instance,\n    apply_with mono_comp { instances := ff },\n    exact this,\n    apply_instance },\n  rw [AddCommGroup.mono_iff_injective, injective_iff_map_eq_zero],\n  intros x hx,\n  erw [sub_eq_zero, id_apply] at hx,\n  ext \u27e8i\u27e9,\n  classical,\n  induction i with i IH,\n  { rw \u2190 hx,\n    dsimp [g, sigma_shift', sigma_shift_cone, hD, AddCommGroup.is_colimit_direct_sum_cofan,\n      AddCommGroup.direct_sum_desc, discrete.nat_trans, direct_sum.to_add_monoid],\n    rw [dfinsupp.sum_add_hom_apply, dfinsupp.sum_apply],\n    apply finset.sum_eq_zero,\n    rintro \u27e8j\u27e9 -,\n    convert dif_neg _,\n    rw [finset.mem_singleton],\n    intro H, rw ulift.ext_iff at H, revert H, apply nat.no_confusion, },\n  { rw \u2190 hx,\n    classical,\n    dsimp [g, sigma_shift', sigma_shift_cone, hD, AddCommGroup.is_colimit_direct_sum_cofan,\n      AddCommGroup.direct_sum_desc, discrete.nat_trans, direct_sum.to_add_monoid],\n    rw [dfinsupp.sum_add_hom_apply, dfinsupp.sum_apply],\n    rw dfinsupp.zero_apply at IH,\n    convert finset.sum_eq_single (ulift.up $ i) _ _,\n    { rw [IH, add_monoid_hom.map_zero, dfinsupp.zero_apply], },\n    { rintro \u27e8j\u27e9 - hj, convert dif_neg _, rw [finset.mem_singleton],\n      intro H, apply hj, rw ulift.ext_iff at H \u22a2, change i+1 = j+1 at H,\n      change j = i, linarith only [H] },\n    { intro, rw [IH, add_monoid_hom.map_zero, dfinsupp.zero_apply], }, },\n  recover, all_goals { classical; apply_instance }\n  -/\nend\n.\n\nlemma QprimeFP_sigma_proj_eq_0 (n : \u2115) : ((QprimeFP_sigma_proj BD \u03ba M \u03b9).f (n+1:\u2124)) = 0 :=\nby { apply is_zero.eq_of_tgt, apply is_zero_zero }\n\n-- move me\nlemma AddCommGroup.eq_of_is_zero (A : AddCommGroup) (hA : is_zero A) (x y : A) : x = y :=\nbegin\n  rw [\u2190 Ab.pt_apply' x, \u2190 Ab.pt_apply' y], congr' 1, apply hA.eq_of_tgt,\nend\n\nattribute [simps] Condensed_Ab_to_presheaf\n\nlemma QprimeFP.epi (h\u03b9 : monotone \u03b9)\n  (h\u03ba\u03b9 : \u2200 (r : \u211d\u22650) q, \u2203 (n : \u2115), r \u2264 (combine.{u} \u03ba \u03b9 h\u03b9 q) n)\n  (n : \u2124) : epi ((QprimeFP_sigma_proj BD \u03ba M \u03b9).f n) :=\nbegin\n  rcases n with (_|q)|q,\n  { erw iso_on_the_right_zero_conj,\n    swap, assumption,\n    apply_with epi_comp { instances := ff }, apply_instance,\n    apply_with epi_comp { instances := ff }, swap, apply_instance,\n    rw Condensed.coproduct_presentation_with_pow_eq,\n    apply_with epi_comp { instances := ff }, swap, apply_instance,\n    swap, { intros r, apply h\u03ba\u03b9 },\n    exact Condensed.epi_coproduct_to_colimit (Condensed.as_nat_diagram_pow.{u} M.to_CHFPNG\n      (combine.{u} \u03ba \u03b9 h\u03b9 0) (BD.data.X 0) \u22d9 CondensedSet_to_Condensed_Ab.{u}) },\n  { apply epi_of_is_zero,\n    exact is_zero_zero _ },\n  { erw iso_on_the_right_neg_conj, swap, assumption,\n    apply_with epi_comp { instances := ff }, apply_instance,\n    apply_with epi_comp { instances := ff }, swap, apply_instance,\n    rw Condensed.coproduct_presentation_with_pow_eq,\n    apply_with epi_comp { instances := ff }, swap, apply_instance,\n    swap, { intros r, apply h\u03ba\u03b9 },\n    exact Condensed.epi_coproduct_to_colimit (Condensed.as_nat_diagram_pow.{u} M.to_CHFPNG\n      (combine.{u} \u03ba \u03b9 h\u03b9 (q + 1)) (BD.data.X (q + 1)) \u22d9 CondensedSet_to_Condensed_Ab.{u}) }\n\n  /-\n  rw is_epi_iff_forall_surjective,\n  intros S,\n  rcases n with ((_|n)|n),\n  swap,\n  { intro f,\n    refine \u27e80, _\u27e9, apply AddCommGroup.eq_of_is_zero,\n    rw [\u2190 evaluation_obj_obj, \u2190 Condensed_Ab_to_presheaf_obj],\n    apply functor.map_is_zero, apply functor.map_is_zero, exact is_zero_zero _, },\n  { admit },\n  { admit },\n  -/\nend\n\nlemma QprimeFP.exact (n : \u2124)\n  (h\u03ba\u03b9 : \u2200 (r : \u211d\u22650) q, \u2203 (n : \u2115), r \u2264 (combine.{u} \u03ba \u03b9 h\u03b9 q) n) :\n  exact\n    ((QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba M)).f n)\n    ((QprimeFP_sigma_proj BD \u03ba M \u03b9).f n) :=\nbegin\n  rcases n with (_|q)|q,\n  { erw iso_on_the_left_zero_conj,\n    erw iso_on_the_right_zero_conj, swap, assumption,\n    rw \u2190 category.assoc,\n    apply category_theory.exact_comp_inv_hom_comp,\n    rw exact_iso_comp, rw exact_comp_iso,\n    apply (Condensed.short_exact_sequence_with_pow _ _ _ _ _).exact,\n    intros r, apply h\u03ba\u03b9 },\n  { apply exact_of_is_zero,\n    let e :\n      (\u2210 \u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP_int.{u} r' BD.data \u03ba M).obj\n        (\u03b9 k)).X (int.of_nat q.succ) \u2245\n      \u2210 \u03bb k : ulift.{u+1} \u2115, ((QprimeFP_int.{u} r' BD.data \u03ba M).obj\n        (\u03b9 k)).X (int.of_nat q.succ) :=\n      preserves_colimit_iso (homological_complex.eval _ _ _) _ \u226a\u226b\n      has_colimit.iso_of_nat_iso (discrete.nat_iso $ \u03bb p, iso.refl _),\n    apply is_zero_of_iso_of_zero _ e.symm,\n    apply is_zero_colimit, intros j,\n    exact is_zero_zero _ },\n  { erw iso_on_the_left_neg_conj,\n    erw iso_on_the_right_neg_conj, swap, assumption,\n    rw \u2190 category.assoc,\n    apply category_theory.exact_comp_inv_hom_comp,\n    rw exact_iso_comp, rw exact_comp_iso,\n    apply (Condensed.short_exact_sequence_with_pow _ _ _ _ _).exact,\n    intros r, apply h\u03ba\u03b9 },\nend\n\nlemma QprimeFP.short_exact\n  (h\u03ba\u03b9 : \u2200 (r : \u211d\u22650) q, \u2203 (n : \u2115), r \u2264 (combine.{u} \u03ba \u03b9 h\u03b9 q) n) (n : \u2124) :\n  short_exact\n    ((QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba M)).f n)\n    ((QprimeFP_sigma_proj BD \u03ba M \u03b9).f n) :=\nbegin\n  apply_with short_exact.mk {instances:=ff},\n  { apply QprimeFP.mono },\n  { apply QprimeFP.epi, assumption, },\n  { apply QprimeFP.exact, assumption },\nend\n\nend step4\n\nsection step5\n\nvariables {r' : \u211d\u22650} [fact (0 < r')] [fact (r' \u2264 1)]\nvariables (BD : breen_deligne.data)\nvariables (\u03ba \u03ba\u2082 : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 (c : \u211d\u22650), BD.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables [\u2200 (c : \u211d\u22650), BD.suitable (\u03ba\u2082 c)] [\u2200 n, fact (monotone (function.swap \u03ba\u2082 n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\nvariables (\u03b9 : ulift.{u+1} \u2115 \u2192 \u211d\u22650) (h\u03b9 : monotone \u03b9)\n\ndef QprimeFP_nat.Tinv [\u2200 c n, fact (\u03ba c n \u2264 r' * \u03ba\u2082 c n)] :\n  (QprimeFP_nat r' BD \u03ba M) \u27f6 (QprimeFP_nat r' BD \u03ba\u2082 M) :=\nwhisker_right (FPsystem.Tinv.{u} r' BD \u27e8M\u27e9 _ _) _\n\ndef QprimeFP_int.Tinv [\u2200 c n, fact (\u03ba c n \u2264 r' * \u03ba\u2082 c n)] :\n  (QprimeFP_int r' BD \u03ba M) \u27f6 (QprimeFP_int r' BD \u03ba\u2082 M) :=\nwhisker_right (QprimeFP_nat.Tinv _ _ _ _)\n  (homological_complex.embed complex_shape.embedding.nat_down_int_up)\n\ndef QprimeFP.Tinv [\u2200 c n, fact (\u03ba c n \u2264 r' * \u03ba\u2082 c n)] :\n  (QprimeFP r' BD \u03ba M) \u27f6 (QprimeFP r' BD \u03ba\u2082 M) :=\nwhisker_right (QprimeFP_nat.Tinv _ _ _ _) chain_complex.to_bounded_homotopy_category\n\n/-- The natural inclusion map -/\ndef QprimeFP_nat.\u03b9 [\u2200 c n, fact (\u03ba c n \u2264 \u03ba\u2082 c n)] :\n  (QprimeFP_nat r' BD \u03ba M) \u27f6 (QprimeFP_nat r' BD \u03ba\u2082 M) :=\nwhisker_right (FPsystem.res r' BD \u27e8M\u27e9 _ _) _\n\n/-- The natural inclusion map -/\ndef QprimeFP_int.\u03b9 [\u2200 c n, fact (\u03ba c n \u2264 \u03ba\u2082 c n)] :\n  (QprimeFP_int r' BD \u03ba M) \u27f6 (QprimeFP_int r' BD \u03ba\u2082 M) :=\nwhisker_right (QprimeFP_nat.\u03b9 _ _ _ _)\n  (homological_complex.embed complex_shape.embedding.nat_down_int_up)\n\n/-- The natural inclusion map -/\ndef QprimeFP.\u03b9 [\u2200 c n, fact (\u03ba c n \u2264 \u03ba\u2082 c n)] :\n  (QprimeFP r' BD \u03ba M) \u27f6 (QprimeFP r' BD \u03ba\u2082 M) :=\nwhisker_right (QprimeFP_nat.\u03b9 _ _ _ _) chain_complex.to_bounded_homotopy_category\n\nopen category_theory.preadditive\n\nlemma commsq_shift_sub_id_Tinv [\u2200 (c : \u211d\u22650) (n : \u2115), fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)] :\n  commsq (QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD \u03ba\u2082 M))\n  (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.Tinv BD \u03ba\u2082 \u03ba M))\n  (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.Tinv BD \u03ba\u2082 \u03ba M))\n  (QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD \u03ba M)) :=\ncommsq.of_eq begin\n  delta QprimeFP.shift_sub_id,\n  rw [sub_comp, comp_sub, category.id_comp, category.comp_id],\n  refine congr_arg2 _ _ rfl,\n  apply colimit.hom_ext, rintro \u27e8\u27e8j\u27e9\u27e9,\n  dsimp [sigma_shift, sigma_shift', sigma_shift_cone, sigma_map],\n  rw [colimit.\u03b9_desc_assoc, colimit.\u03b9_desc_assoc],\n  dsimp [sigma_shift_cone],\n  simp only [category.assoc, colimit.\u03b9_desc],\n  dsimp [sigma_shift_cone],\n  simp only [sigma_shift, sigma_shift', sigma_shift_cone, sigma_map, colimit.\u03b9_desc_assoc,\n     colimit.\u03b9_desc, cofan.mk_\u03b9_app, category.assoc, nat_trans.naturality_assoc,\n     discrete.nat_trans_app],\nend\n\nlemma commsq_shift_sub_id_\u03b9 [\u2200 (c : \u211d\u22650) (n : \u2115), fact (\u03ba\u2082 c n \u2264 \u03ba c n)] :\n  commsq (QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD \u03ba\u2082 M))\n  (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.\u03b9 BD \u03ba\u2082 \u03ba M))\n  (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.\u03b9 BD \u03ba\u2082 \u03ba M))\n  (QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD \u03ba M)) :=\ncommsq.of_eq begin\n  delta QprimeFP.shift_sub_id,\n  rw [sub_comp, comp_sub, category.id_comp, category.comp_id],\n  refine congr_arg2 _ _ rfl,\n  apply colimit.hom_ext, rintro \u27e8\u27e8j\u27e9\u27e9,\n  dsimp [sigma_shift, sigma_shift', sigma_shift_cone],\n  simp only [sigma_shift_cone, sigma_map, colimit.\u03b9_desc_assoc, colimit.\u03b9_desc, cofan.mk_\u03b9_app,\n    category.assoc, nat_trans.naturality_assoc, discrete.nat_trans_app, colimit.cocone_\u03b9],\nend\n\nend step5\n\nsection step6\n\nvariables {r' : \u211d\u22650} [fact (0 < r')] [fact (r' \u2264 1)]\nvariables (BD : breen_deligne.package)\nvariables (\u03ba \u03ba\u2082 : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 (c : \u211d\u22650), BD.data.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables [\u2200 (c : \u211d\u22650), BD.data.suitable (\u03ba\u2082 c)] [\u2200 n, fact (monotone (function.swap \u03ba\u2082 n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\nvariables (\u03b9 : ulift.{u+1} \u2115 \u2192 \u211d\u22650) (h\u03b9 : monotone \u03b9)\n\nopen category_theory.preadditive\n\n-- lemma commsq_sigma_proj_Tinv' (j) (n : \u2115) [fact (\u03ba\u2082 (\u03b9 j) n \u2264 r' * \u03ba (\u03b9 j) n)] :\n-- QprimeFP_incl_aux M (\u03ba\u2082 (\u03b9 j) n) (BD.data.X n) \u226b\n--     Condensed_Ab_to_CondensedSet.map (biproduct.map (\u03bb (i : ulift (fin (BD.data.X n))), M.Tinv_cond)) =\n--   Profinite_to_Condensed.map\n--       ((FiltrationPow.Tinv r' (\u03ba\u2082 (\u03b9 j) n) (\u03ba (\u03b9 j) n) (BD.data.X n)).app \u27e8M\u27e9) \u226b\n--     QprimeFP_incl_aux M (\u03ba (\u03b9 j) n) (BD.data.X n) :=\n-- by admit\n\nlemma commsq_sigma_proj_Tinv [\u2200 (c : \u211d\u22650) (n : \u2115), fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)] :\n  commsq (QprimeFP_sigma_proj BD \u03ba\u2082 M \u03b9) (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k)\n    (QprimeFP_int.Tinv BD.data \u03ba\u2082 \u03ba M))\n  ((BD.eval' freeCond').map M.Tinv_cond)\n  (QprimeFP_sigma_proj BD \u03ba M \u03b9) :=\ncommsq.of_eq begin\n  apply colimit.hom_ext, rintro \u27e8j\u27e9,\n  simp only [QprimeFP_sigma_proj, sigma_map, colimit.\u03b9_desc_assoc, colimit.\u03b9_desc,\n    cofan.mk_\u03b9_app, category.assoc, nat_trans.naturality_assoc],\n  dsimp only [QprimeFP_incl, QprimeFP_int.Tinv, whisker_right_app,\n    package.eval', functor.comp_map],\n  rw [\u2190 functor.map_comp, \u2190 functor.map_comp],\n  refine congr_arg _ _,\n  ext n : 2,\n  dsimp only [homological_complex.comp_f, data.eval_functor, functor.comp_obj, functor.flip_obj_map,\n    homological_complex.functor_eval_map_app_f, data.eval_functor'_obj_X_map, functor.comp_map,\n    QprimeFP_nat.Tinv, whisker_right_app, functor.map_homological_complex_map_f],\n  rw [map_FreeAb_comp_map],\n  dsimp only [FreeAb.eval, functor.map_FreeAb, FPsystem.Tinv, FP2.Tinv_app, FreeAb.of_functor],\n  simp only [free_abelian_group.lift_map, function.comp, function.comp.left_id],\n  rw [free_abelian_group.lift.of],\n  simp only [\u2190 functor.map_comp],\n  congr' 1,\n  ext1,\n  let x := biproduct.is_limit (\u03bb (i : (fin (BD.data.X n))), M.to_Condensed),\n  let y := is_limit_of_preserves (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf) x,\n  apply y.hom_ext, rintro \u27e8k\u27e9,\n  simp only [Sheaf.hom.comp_val, category.assoc, QprimeFP_incl_aux, y.fac],\n  rw [\u2190 CondensedSet_to_presheaf_map, \u2190 functor.comp_map],\n  simp only [functor.map_cone_\u03c0_app, bicone.to_cone_\u03c0_app, biproduct.bicone_\u03c0],\n  rw [\u2190 functor.map_comp, biproduct.map_\u03c0, functor.map_comp],\n  have : ((Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map_cone\n    (biproduct.bicone (\u03bb (i : (fin (BD.data.X n))), M.to_Condensed)).to_cone).\u03c0.app \u27e8k\u27e9 =\n    (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf).map\n    (biproduct.\u03c0 (\u03bb (j : (fin (BD.data.X n))), M.to_Condensed) k) := rfl,\n  rw [\u2190 this, \u2190 category.assoc, y.fac], clear this y x,\n  ext S : 2,\n  dsimp only [nat_trans.comp_app, QprimeFP_incl_aux', functor.comp_map,\n    Condensed_Ab_to_CondensedSet_map, CondensedSet_to_presheaf_map,\n    Profinite_to_Condensed_map_val, whisker_right_app, ProFiltPseuNormGrpWithTinv\u2081.Tinv_cond,\n    forget_map_eq_coe, yoneda_map_app, CompHausFiltPseuNormGrp.to_Condensed_map,\n    Ab.ulift_map_apply],\n  simp only [\u2190 ulift_functor.map_comp],\n  refl\nend\n\nlemma commsq_sigma_proj_\u03b9 [\u2200 (c : \u211d\u22650) (n : \u2115), fact (\u03ba\u2082 c n \u2264 \u03ba c n)] :\n  commsq (QprimeFP_sigma_proj BD \u03ba\u2082 M \u03b9) (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k)\n    (QprimeFP_int.\u03b9 BD.data \u03ba\u2082 \u03ba M)) (\ud835\udfd9 _) (QprimeFP_sigma_proj BD \u03ba M \u03b9) :=\ncommsq.of_eq begin\n  simp only [category.comp_id],\n  apply colimit.hom_ext, intro j,\n  simp only [QprimeFP_sigma_proj, sigma_map, colimit.\u03b9_desc_assoc, colimit.\u03b9_desc,\n    cofan.mk_\u03b9_app, category.assoc, nat_trans.naturality_assoc],\n  dsimp only [QprimeFP_incl, QprimeFP_int.\u03b9, whisker_right_app,\n    package.eval', functor.comp_map],\n  rw [\u2190 functor.map_comp],\n  refine congr_arg _ _,\n  ext n : 2,\n  dsimp only [homological_complex.comp_f, data.eval_functor, functor.comp_obj, functor.flip_obj_map,\n    homological_complex.functor_eval_map_app_f, data.eval_functor'_obj_X_map, functor.comp_map,\n    QprimeFP_nat.\u03b9, whisker_right_app, functor.map_homological_complex_map_f],\n  rw [map_FreeAb_comp_map],\n  dsimp only [FreeAb.eval, functor.map_FreeAb, FPsystem.res, FP2.res_app, FreeAb.of_functor],\n  simp only [free_abelian_group.lift_map, function.comp, function.comp.left_id],\n  rw [free_abelian_group.lift.of, \u2190 functor.map_comp],\n  refine congr_arg _ _,\n  ext1,\n  let x := biproduct.is_limit (\u03bb (i : (fin (BD.data.X n))), M.to_Condensed),\n  let y := is_limit_of_preserves (Condensed_Ab_to_CondensedSet \u22d9 CondensedSet_to_presheaf) x,\n  apply y.hom_ext, intro k,\n  simp only [Sheaf.hom.comp_val, category.assoc, QprimeFP_incl_aux, y.fac],\n  rw [\u2190 CondensedSet_to_presheaf_map, \u2190 functor.comp_map],\n  ext S : 2,\n  dsimp only [nat_trans.comp_app, QprimeFP_incl_aux', functor.comp_map,\n    Condensed_Ab_to_CondensedSet_map, CondensedSet_to_presheaf_map,\n    Profinite_to_Condensed_map_val, whisker_right_app,\n    forget_map_eq_coe, yoneda_map_app, CompHausFiltPseuNormGrp.to_Condensed_map,\n    Ab.ulift_map_apply],\n  simp only [\u2190 ulift_functor.map_comp],\n  refl,\nend\n\nend step6\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/pseudo_normed_group/QprimeFP.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.600188359260205, "lm_q2_score": 0.3208213138121609, "lm_q1q2_score": 0.19255321795262417}}
{"text": "import model_theory.substructures\nimport model_theory.bundled\n\n\n--OUTPUT 1\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h36 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h37 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h38 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h39 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h40 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h41 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h42 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h43 : \u2200 n : \u2115, \u2203 (m : F.Model) [\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  sorry,\nend\n\n--OUTPUT 3\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h36 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h37 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h38 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h39 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h40 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h41 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h42 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from sorry,\n  have h43 : \u2200 n : \u2115, \u2203 (m : F.Model) [\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from sorry,\n  have h2 : (A \u2229 B) \u2286 A, from sorry,\n  have h3 : (A \u2229 B) \u2286 S, from sorry,\n  show (A \u2229 B) \u2208  \ud835\udcab S, from sorry,\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by sorry\n  ... = x*(x+y) + y*(x+y) : by sorry\n  ... = x*x + x*y + y*x + y*y : by sorry\n  ... = x^2 + 2*x*y + y^2 : by sorry,\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from sorry,\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from sorry,\n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from sorry,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from sorry,\n\n  have h5 : \u2200 a : G, classical.some (h3 a) = (1 : G), from sorry,\n  have h6 : \u2200 a : G, classical.some (h4 a) = (1 : G), from sorry,\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (h7 : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a), from sorry,\n      have h9 : \u2200 a : G, e = classical.some (h4 a), from sorry,\n      show e = (1 : G), from sorry,     \n    },\n    sorry,\n  }\nend\n\n/--`theorem`\nOverflow theorem\nLet $F$ be a set of first-order formulas which has finite models of arbitrarily large size. Then $F$ has an infinite model.\n`proof`\nFor each $n$, let $\\mathbf A_n$ be the formula:\n\n$\\exists x_1 \\exists x_2 \\ldots \\exists x_n: \\{x_1 \\ne x_2 \\land x_1 \\ne x_3 \\land \\ldots \\land x_{n - 1} \\ne x_n\\}$\n\nThen $\\mathbf A_i$ is true in a structure $\\AA$ iff $\\AA$ has at least $n$ elements.\n\nTake:\n$$ \\Gamma := F \\cup \\bigcup_{i \\mathop = 1}^\\infty A_i $$\n\nSince $F$ has models of arbitrarily large size, every finite subset of $\\Gamma$ is satisfiable.\n\nFrom the Compactness Theorem, $\\Gamma$ is satisfiable in some model $\\mathbf{M}$.\n\nBut since $\\mathbf{M} \\models A_i$ for each $i$, $\\mathbf{M}$ must be infinite.\n\nSo $F$ has an infinite model.\n\nQED\n-/\ntheorem  overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_outline-Natural-Language-Proof-Translation/Correct_statement-lean_proof_outline-3_few_shot_temperature_0.2_max_tokens_2000_n_3/clean_files/Overflow theorem.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5621765155565327, "lm_q2_score": 0.34158251284363395, "lm_q1q2_score": 0.1920296668454787}}
{"text": "import data.real.irrational\nimport topology.basic\nimport algebra.order.floor\n\n\n--OUTPUT 1\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=density_of_irrational_orbit (\u03b1 : \u211d) (h\u03b1 : \u00ac (\u03b1 \u2208 \u211a)) : \u2200 \u03b5 > 0, \u2203 N, \u2200 n > N, |n*\u03b1 - \u230an*\u03b1\u230b| < \u03b5 :=\nbegin\n  assume \u03b5 (h\u03b5 : \u03b5 > 0),\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h3 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h4 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h5 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h6 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h7 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h8 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h9 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h10 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h11 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h12 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h13 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h14 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h15 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h16 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h17 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h18 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h19 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h20 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h21 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h22 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h23 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h24 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h25 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h26 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h27 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h28 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h29 : \u2200 i j : \u2124, i \u2260 j \u2192 (i*\u03b1 - \u230ai*\u03b1\u230b) \u2260 (j*\u03b1 - \u230aj*\u03b1\u230b), from by auto [ne.def, floor_eq_iff],\n  have h\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=density_irrational_orbit (\u03b1 : \u211d) (h\u03b1 : \u00ac is_rational \u03b1) : \u2200 x \u2208 set.Ioo 0 1, \u2203 n : \u2124, n \u2260 0 \u2227 \u2203 y \u2208 set.Ioo 0 1, y \u2208 {i | i \u2208 \u2124} \u2227 |x - y| < (1 / (abs n)) :=\nbegin\n  assume x hx,\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h3 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h4 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h5 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h6 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h7 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h8 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h9 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h10 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h11 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h12 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h13 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h14 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h15 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h16 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h17 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h18 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h19 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h20 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h21 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h22 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h23 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h24 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h25 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h26 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is_rational.def, floor_eq_iff_rat_mul_nat],\n  have h27 : \u2200 i j : \u2124, i \u2260 j \u2192 \u00ac (i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor), from by auto [h\u03b1, is\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=irrational_orbit_dense {\u03b1 : Type*} [linear_ordered_field \u03b1] (\u03b1_irrational : \u00ac is_rat \u03b1) : \u2200 y : \u03b1, \u2203 x : \u03b1, 0 \u2264 x \u2227 x < y :=\nbegin\n  assume y : \u03b1,\n  have h1 : \u2200 x : \u03b1, \u2203 n : \u2115, (n : \u03b1) * x > y, from by auto [mul_lt_mul_of_pos_right],\n  have h2 : \u2203 n : \u2115, (n : \u03b1) * (1 : \u03b1) > y, from h1 1,\n  cases h2 with n h3,\n  use (n : \u03b1),\n  show 0 \u2264 (n : \u03b1) \u2227 (n : \u03b1) < y, from by auto [h3, one_mul],\nend\n\n--OUTPUT 4\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=density_of_irrational_orbit (\u03b1 : \u211d) (h1 : \u00ac (\u03b1 \u2208 \u211a)) : \u2200 y \u2208 Icc 0 1, \u2203 x \u2208 Icc 0 1, x \u2260 y \u2227 |y - x| < 1 :=\nbegin\n  assume (y : \u211d) (h2 : y \u2208 Icc 0 1),\n  have h3 : \u2200 y \u2208 Icc 0 1, \u2203 x \u2208 Icc 0 1, x \u2260 y \u2227 |y - x| < 1 := by auto [dense_iff_open_of_irrational],\n  show \u2203 x \u2208 Icc 0 1, x \u2260 y \u2227 |y - x| < 1, from by auto [h3],\nend\n\n--OUTPUT 5\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=density_of_irrational_orbit (\u03b1 : \u211d) [irrational \u03b1] : \u2200 \u03b5 > 0, \u2203 N : \u2124, \u2200 n : \u2124, |n*\u03b1 - n*\u03b1%\u2124| < \u03b5 :=\nbegin\n  assume \u03b5,\n  assume h1 : \u03b5 > 0,\n  have h2 : \u2200 x y : \u2124, x \u2260 y \u2192 x*\u03b1%\u2124 \u2260 y*\u03b1%\u2124, from by auto [irrational.irrational],\n  have h3 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x, from by auto [exists_ne],\n  have h4 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124, from by auto [h2, h3],\n  have h5 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1, from by auto [irrational.irrational],\n  have h6 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5, from by auto [h5],\n  have h7 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5, from by auto [h6],\n  have h8 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5, from by auto [h7],\n  have h9 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5, from by auto [h8],\n  have h10 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - y*\u03b1%\u2124 - (x*\u03b1 - x*\u03b1%\u2124)| < \u03b5, from by auto [h9],\n  have h11 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - y*\u03b1%\u2124 - (x*\u03b1 - x*\u03b1%\u2124)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124 - (y*\u03b1 - x*\u03b1)| < \u03b5, from by auto [h10],\n  have h12 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - y*\u03b1%\u2124 - (x*\u03b1 - x*\u03b1%\u2124)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124 - (y*\u03b1 - x*\u03b1)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5, from by auto [h11],\n  have h13 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - y*\u03b1%\u2124 - (x*\u03b1 - x*\u03b1%\u2124)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124 - (y*\u03b1 - x*\u03b1)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5, from by auto [h12],\n  have h14 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - y*\u03b1%\u2124 - (x*\u03b1 - x*\u03b1%\u2124)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124 - (y*\u03b1 - x*\u03b1)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5, from by auto [h13],\n  have h15 : \u2200 x : \u2124, \u2203 y : \u2124, y \u2260 x \u2227 y*\u03b1%\u2124 \u2260 x*\u03b1%\u2124 \u2227 y*\u03b1 \u2260 x*\u03b1 \u2227 |y*\u03b1 - y*\u03b1%\u2124| < \u03b5 \u2227 |x*\u03b1 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - x*\u03b1| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227 |y*\u03b1 - y*\u03b1%\u2124 - (x*\u03b1 - x*\u03b1%\u2124)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124 - (y*\u03b1 - x*\u03b1)| < \u03b5 \u2227 |y*\u03b1%\u2124 - x*\u03b1%\u2124| < \u03b5 \u2227\nend --Needs more than 2000 tokens!\n\n--OUTPUT 6\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=density_of_irrational_orbit (\u03b1 : \u211d) (h\u03b1 : \u00ac (\u03b1 \u2208 \u211a)) : \u2200 y \u2208 Icc 0 1, \u2203 x \u2208 Icc 0 1, \u2203 n : \u2124, |y - (n \u2022\u03b1)%R| < 1 :=\nbegin\n  assume (y : \u211d) (h1 : y \u2208 Icc 0 1),\n  have h2 : \u2200 (x : \u211d) (hx : x \u2208 Icc 0 1), \u2203 n : \u2124, n \u2022\u03b1 \u2208 Icc 0 1 \u2227 |y - n \u2022\u03b1| < 1,\n  from by auto [h\u03b1, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat_one_lt_of_lt, exists_nat\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by auto [set.subset_of_mem_powerset, set.subset_of_mem_powerset],\n  have h2 : (A \u2229 B) \u2286 A, from by auto [set.inter_subset_left],\n  have h3 : (A \u2229 B) \u2286 S, from by auto [set.subset.trans],\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by auto [set.mem_powerset],\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by auto [sq]\n  ... = x*(x+y) + y*(x+y) : by auto [add_mul]\n  ... = x*x + x*y + y*x + y*y : by auto [mul_comm, add_mul] using [ring]\n  ... = x^2 + 2*x*y + y^2 : by auto [sq, mul_comm] using [ring]\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by auto using [use (a\u207b\u00b9 * b)],\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by auto using [use b * a\u207b\u00b9], \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from by auto [h1],\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from by auto [h2],\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from by auto [exists_unique.unique, h3, classical.some_spec, exists_unique.exists, mul_one],\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from by auto [exists_unique.unique, h4, classical.some_spec, exists_unique.exists, one_mul],\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by auto [h3, h4, exists_unique.unique, classical.some_spec, exists_unique.exists] using [use (1 : G)],\nend\n\n/--`theorem`\nSqueeze Theorem for Real Numbers\nLet $\\sequence {x_n}$, $\\sequence {y_n}$ and $\\sequence {z_n}$ be sequences in $\\R$.\n\nLet $\\sequence {y_n}$ and $\\sequence {z_n}$ both be convergent to the following limit:\n:$\\ds \\lim_{n \\mathop \\to \\infty} y_n = l, \\lim_{n \\mathop \\to \\infty} z_n = l$\n\nSuppose that:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\n\nThen:\n:$x_n \\to l$ as $n \\to \\infty$\nthat is:\n:$\\ds \\lim_{n \\mathop \\to \\infty} x_n = l$\n\n`proof`\nFrom Negative of Absolute Value:\n:$\\size {x - l} < \\epsilon \\iff l - \\epsilon < x < l + \\epsilon$\n\nLet $\\epsilon > 0$.\n\nWe need to prove that:\n:$\\exists N: \\forall n > N: \\size {x_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} y_n = l$ we know that:\n:$\\exists N_1: \\forall n > N_1: \\size {y_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} z_n = l$ we know that:\n:$\\exists N_2: \\forall n > N_2: \\size {z_n - l} < \\epsilon$\n\n\nLet $N = \\max \\set {N_1, N_2}$.\n\nThen if $n > N$, it follows that $n > N_1$ and $n > N_2$.\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n < l + \\epsilon$\n:$\\forall n > N: l - \\epsilon < z_n < l + \\epsilon$\n\nBut:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n \\le x_n \\le z_n < l + \\epsilon$\n\nand so:\n:$\\forall n > N: l - \\epsilon < x_n < l + \\epsilon$\n\nSo:\n:$\\forall n > N: \\size {x_n - l} < \\epsilon$\n\nHence the result.\n{{qed}}\n\n-/\ntheorem squeeze_theorem_real_numbers (x y z : \u2115 \u2192 \u211d) (l : \u211d) : \nlet seq_limit : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=  \u03bb (u : \u2115 \u2192 \u211d) (l : \u211d), \u2200 \u03b5 > 0, \u2203 N, \u2200 n > N, |u n - l| < \u03b5 in\n seq_limit y l \u2192 seq_limit z l \u2192  (\u2200 n : \u2115, (y n) \u2264 (x n) \u2227 (x n) \u2264 (z n)) \u2192 seq_limit x l :=\nbegin\n  assume seq_limit (h2 : seq_limit y l) (h3 : seq_limit z l) (h4 : \u2200 (n : \u2115), y n \u2264 x n \u2227 x n \u2264 z n) (\u03b5), \n\n  have h5 : \u2200 x, |x - l| < \u03b5 \u2194 (((l - \u03b5) < x) \u2227 (x < (l + \u03b5))), \n  from by auto [abs_sub_lt_iff] using [linarith],\n  \n  assume (h7 : \u03b5 > 0),\n\n  cases h2 \u03b5 h7 with N1 h8,\n  cases h3 \u03b5 h7 with N2 h9,\n  let N := max N1 N2,\n  use N,\n\n  have h10 : \u2200 n > N, n > N1 \u2227 n > N2 := by auto [lt_of_le_of_lt, le_max_left, le_max_right],\n  \n  have h11 : \u2200 n > N, (((l - \u03b5) < (y n)) \u2227 ((y n) \u2264 (x n))) \u2227 (((x n) \u2264 (z n)) \u2227 ((z n) < l+\u03b5)), \n  from by auto [h8, h10, h5, h9],\n\n  have h15 : \u2200 n > N, ((l - \u03b5) < (x n)) \u2227 ((x n) < (l+\u03b5)), \n  from by auto [h11] using [linarith],\n\n  show  \u2200 (n : \u2115), n > N \u2192 |x n - l| < \u03b5, \n  from by auto [h5, h15], \n\nend\n\n/--`theorem`\nDensity of irrational orbit\nThe fractional parts of the integer multiples of an irrational number form a dense subset of the unit interval\n`proof`\nLet $\\alpha$ be an irrational number. Then for distinct $i, j \\in \\mathbb{Z}$, we must have $\\{i \\alpha\\} \\neq\\{j \\alpha\\}$. If this were not true, then\n$$\ni \\alpha-\\lfloor i \\alpha\\rfloor=\\{i \\alpha\\}=\\{j \\alpha\\}=j \\alpha-\\lfloor j \\alpha\\rfloor,\n$$\nwhich yields the false statement $\\alpha=\\frac{\\lfloor i \\alpha\\rfloor-\\lfloor j \\alpha\\rfloor}{i-j} \\in \\mathbb{Q}$. Hence,\n$$\nS:=\\{\\{i \\alpha\\} \\mid i \\in \\mathbb{Z}\\}\n$$\nis an infinite subset of $\\left[0,1\\right]$.\n\nBy the Bolzano-Weierstrass theorem, $S$ has a limit point in $[0, 1]$. One can thus find pairs of elements of $S$ that are arbitrarily close. Since (the absolute value of) the difference of any two elements of $S$ is also an element of $S$, it follows that $0$ is a limit point of $S$.\n\nTo show that $S$ is dense in $[0, 1]$, consider $y \\in[0,1]$, and $\\epsilon>0$. Then by selecting $x \\in S$ such that $\\{x\\}<\\epsilon$ (which exists as $0$ is a limit point), and $N$ such that $N \\cdot\\{x\\} \\leq y<(N+1) \\cdot\\{x\\}$, we get: $|y-\\{N x\\}|<\\epsilon$.\n\nQED\n-/\ntheorem \nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_auto-Natural-Language-Proof-Translation/lean_proof_auto-4_few_shot_temperature_0.4_max_tokens_2000_n_6/clean_files/Density of irrational orbit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.658417487156366, "lm_q2_score": 0.2909808600663598, "lm_q1q2_score": 0.19158688669549082}}
{"text": "import Lbar.ext_aux3\nimport Lbar.iota\n\nnoncomputable theory\n\nuniverses v u u'\n\nopen opposite category_theory category_theory.limits category_theory.preadditive\nopen_locale nnreal zero_object\n\nvariables (r r' : \u211d\u22650)\nvariables [fact (0 < r)] [fact (0 < r')] [fact (r < r')] [fact (r < 1)] [fact (r' < 1)]\n\nopen bounded_homotopy_category\n\nvariables {r'}\nvariables (BD : breen_deligne.package)\nvariables (\u03ba \u03ba\u2082 : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 (c : \u211d\u22650), BD.data.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables [\u2200 (c : \u211d\u22650), BD.data.suitable (\u03ba\u2082 c)] [\u2200 n, fact (monotone (function.swap \u03ba\u2082 n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\n\nsection preps\n\nvariables (V : SemiNormedGroup.{u}) [complete_space V] [separated_space V]\nvariables (\u03b9 : ulift.{u+1} \u2115 \u2192 \u211d\u22650) (h\u03b9 : monotone \u03b9)\n\nset_option pp.universes true\n\nlemma homotopy_category.colimit_cofan_bdd {A : Type u} [category.{v} A] [abelian A]\n[has_coproducts.{v} A] {\u03b1 : Type v} (X : \u03b1 \u2192 bounded_homotopy_category A)\n  [uniformly_bounded X] : homotopy_category.is_bounded_above\n  (homotopy_category.colimit_cofan $ \u03bb a : \u03b1, (X a).val).X :=\nbegin\n    obtain \u27e8n,hn\u27e9 := homotopy_category.is_uniformly_bounded_above.cond (val \u2218 X),\n      use n, intros i hi,\n    dsimp [homotopy_category.colimit_cofan],\n    let e : (\u2210 \u03bb (a : \u03b1), (X a).val.as).X i \u2245\n      (\u2210 \u03bb (a : \u03b1), (X a).val.as.X i) := homotopy_category.coproduct_iso _ _,\n    refine is_zero_of_iso_of_zero _ e.symm,\n    apply category_theory.is_zero_colimit,\n    rintros \u27e8j\u27e9,\n    apply hn j _ hi,\n  end\n\ndef Tinv2_iso_of_bicartesian_aux_1\n  (i : \u2124) : commsq.{u+2 u+1}\n  (shift_sub_id.{u+1}\n     ((QprimeFP.{u} r' BD.data \u03ba\u2082 M).op \u22d9\n        (Ext.{u+1 u+2} i).flip.obj ((single.{u+1 u+2} (Condensed.{u u+1 u+2} Ab.{u+1}) 0).obj V.to_Cond))\n     \u03b9\n     h\u03b9)\n  (pi_Ext_iso_Ext_sigma.{u} BD \u03ba\u2082 M V (\u03bb (k : ulift.{u+1 0} \u2115), \u03b9 k) i).hom\n  (pi_Ext_iso_Ext_sigma.{u} BD \u03ba\u2082 M V (\u03bb (k : ulift.{u+1 0} \u2115), \u03b9 k) i).hom\n  (((Ext.{u+1 u+2} i).map\n      (of_hom.{u+1 u+2} (QprimeFP.shift_sub_id.{u u+2 u+1} \u03b9 h\u03b9 (QprimeFP_int.{u} r' BD.data \u03ba\u2082 M))).op).app\n     ((single.{u+1 u+2} (Condensed.{u u+1 u+2} Ab.{u+1}) 0).obj (Condensed.of_top_ab.{u} \u21a5V))) :=\nbegin\n    apply commsq.of_eq,\n    dsimp only [shift_sub_id, QprimeFP.shift_sub_id],\n    simp only [sub_comp, comp_sub, homological_complex.of_hom_sub, category_theory.op_sub,\n      functor.map_sub, op_id, category_theory.functor.map_id, of_hom_id,\n      nat_trans.app_sub, nat_trans.id_app, category.comp_id, category.id_comp],\n    apply congr_arg2 _ _ rfl,\n    rw \u2190 iso.eq_comp_inv,\n    dsimp only [pi_Ext_iso_Ext_sigma, iso.trans_hom, iso.trans_inv,\n      iso.symm_hom, iso.symm_inv, functor.map_iso_hom,\n      iso.op_hom, op_comp, functor.flip_obj_map, functor.map_iso_inv],\n    simp only [category.assoc, \u2190 nat_trans.comp_app_assoc, \u2190 functor.map_comp_assoc,\n      \u2190 functor.map_comp, iso.op_inv, \u2190 op_comp],\n    rw cofan_point_iso_colimit_conj_eq_desc,\n    rw iso.eq_inv_comp,\n    have := Ext_coproduct_iso_naturality_shift _\n      (\u03bb (k : ulift \u2115), (QprimeFP r' BD.data \u03ba\u2082 M).obj (\u03b9 k))\n      (\u03bb k, (QprimeFP r' BD.data \u03ba\u2082 M).map (hom_of_le $ h\u03b9 $\n        by exact_mod_cast k.down.le_succ)) i ((single (Condensed Ab) 0).obj V.to_Cond),\n    exact this.symm,\n    { apply homotopy_category.colimit_cofan_bdd },\nend\n\n@[reassoc]\nlemma Ext_coproduct_iso_\u03c0\n  (A : Type u) [category.{v} A] [abelian A] [enough_projectives A] [has_coproducts.{v} A] [AB4 A]\n  (X : ulift.{v} \u2115 \u2192 bounded_homotopy_category A) [uniformly_bounded X] (i : \u2124) (Y) (k) :\n  (Ext_coproduct_iso X i Y).hom \u226b pi.\u03c0 _ k =\n  ((Ext i).map $ quiver.hom.op $ sigma.\u03b9 _ _).app Y :=\nbegin\n  dsimp only [Ext_coproduct_iso, iso.trans_hom, pi_iso, preadditive_yoneda_coproduct_iso,\n    as_iso_hom, preadditive_yoneda_coproduct_to_product],\n  simp only [category.assoc, limit.lift_\u03c0, limit.lift_\u03c0_assoc, fan.mk_\u03c0_app],\n  dsimp only [Ext_iso, iso.symm_hom, functor.map_iso_hom, functor.map_iso_inv],\n  simp only [\u2190 functor.map_comp, iso.op_hom, iso.op_inv, \u2190 op_comp],\n  dsimp only [Ext, Ext0, functor.comp_map, whiskering_left_obj_map, whisker_left_app,\n    functor.flip_map_app, replacement_iso],\n  congr' 2,\n  simp only [category.assoc, iso.inv_comp_eq, quiver.hom.unop_op, unop_op, op_unop],\n  apply lift_unique,\n  simp only [category.assoc, iso.inv_comp_eq, quiver.hom.unop_op, unop_op, op_unop],\n  erw lift_lifts,\n  simp only [uniform_\u03c0, colimit.\u03b9_desc, cofan.mk_\u03b9_app, lift_lifts_assoc],\n  refl,\nend\n\nlemma Tinv2_iso_of_bicartesian_aux_2\n  [\u2200 c n, fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)]\n  (j) {e : (homotopy_category.colimit_cofan.{u+1 u+2}\n     (\u03bb (a : ulift.{u+1 0} \u2115),\n        ((\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba\u2082 M).obj (\u03b9 k)) a).val)).X.is_bounded_above } :\n  ((cofan.{u+1 u+2} (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba\u2082 M).obj (\u03b9 k))).\u03b9.app j \u226b\n     of_hom.{u+1 u+2} (sigma_map.{u u+2 u+1} \u03b9 (QprimeFP_int.Tinv.{u} BD.data \u03ba\u2082 \u03ba M))) \u226b\n  (cofan_point_iso_colimit.{u} (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba M).obj (\u03b9 k))).hom =\n  (QprimeFP.Tinv _ _ _ _).app _ \u226b\n  sigma.\u03b9 (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba M).obj (\u03b9 k)) j.1 :=\nbegin\n  rw [\u2190 iso.eq_comp_inv], simp only [category.assoc, cofan_point_iso_colimit,\n    colimit.comp_cocone_point_unique_up_to_iso_inv],\n  dsimp only [bounded_homotopy_category.cofan, cofan.mk_\u03b9_app, of_hom,\n    homotopy_category.colimit_cofan, QprimeFP.Tinv, whisker_right_app,\n    chain_complex.to_bounded_homotopy_category, functor.comp_map],\n  erw [\u2190 (homotopy_category.quotient.{u+1 u+2 0} (Condensed.{u u+1 u+2} Ab.{u+1}) (complex_shape.up.{0} \u2124)).map_comp],\n  erw [\u2190 (homotopy_category.quotient.{u+1 u+2 0} (Condensed.{u u+1 u+2} Ab.{u+1}) (complex_shape.up.{0} \u2124)).map_comp],\n  congr' 1,\n  dsimp only [sigma_map],\n  erw [colimit.\u03b9_desc],\n  refl,\nend\n\nlemma Tinv2_iso_of_bicartesian_aux_3\n  [\u2200 c n, fact (\u03ba\u2082 c n \u2264 \u03ba c n)]\n  [\u2200 c n, fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)]\n  (j)\n  {e : (homotopy_category.colimit_cofan.{u+1 u+2}\n     (\u03bb (a : ulift.{u+1 0} \u2115),\n        ((\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba\u2082 M).obj (\u03b9 k)) a).val)).X.is_bounded_above} :\n  (cofan.{u+1 u+2} (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba\u2082 M).obj (\u03b9 k))).\u03b9.app j \u226b\n  of_hom.{u+1 u+2} (sigma_map.{u u+2 u+1} \u03b9 (QprimeFP_int.\u03b9.{u} BD.data \u03ba\u2082 \u03ba M)) \u226b\n    (cofan_point_iso_colimit.{u} (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba M).obj (\u03b9 k))).hom =\n  (QprimeFP.\u03b9 _ \u03ba\u2082 \u03ba M).app _ \u226b\n  sigma.\u03b9 ((\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba M).obj (\u03b9 k))) j.1 :=\nbegin\n  simp only [\u2190 category.assoc], rw [\u2190 iso.eq_comp_inv],\n  simp only [category.assoc, cofan_point_iso_colimit, colimit.comp_cocone_point_unique_up_to_iso_inv],\n  dsimp only [bounded_homotopy_category.cofan, cofan.mk_\u03b9_app, of_hom,\n    homotopy_category.colimit_cofan, QprimeFP.\u03b9, whisker_right_app,\n    chain_complex.to_bounded_homotopy_category, functor.comp_map],\n  erw [\u2190 (homotopy_category.quotient.{u+1 u+2 0} (Condensed.{u u+1 u+2} Ab.{u+1}) (complex_shape.up.{0} \u2124)).map_comp],\n  erw [\u2190 (homotopy_category.quotient.{u+1 u+2 0} (Condensed.{u u+1 u+2} Ab.{u+1}) (complex_shape.up.{0} \u2124)).map_comp],\n  congr' 1,\n  dsimp only [sigma_map],\n  erw [colimit.\u03b9_desc],\n  refl,\nend\n\nlemma Tinv2_iso_of_bicartesian_aux [normed_with_aut r V]\n  [\u2200 c n, fact (\u03ba\u2082 c n \u2264 \u03ba c n)] [\u2200 c n, fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)]\n  (i : \u2124)\n  (H1 : (shift_sub_id.commsq (ExtQprime.Tinv2 r r' BD.data \u03ba \u03ba\u2082 M V i) \u03b9 h\u03b9).bicartesian) :\n  (Ext_Tinv2_commsq (of_hom (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.Tinv BD.data \u03ba\u2082 \u03ba M)))\n  (of_hom (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.\u03b9 BD.data \u03ba\u2082 \u03ba M)))\n  (of_hom (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.Tinv BD.data \u03ba\u2082 \u03ba M)))\n  (of_hom (sigma_map (\u03bb (k : ulift \u2115), \u03b9 k) (QprimeFP_int.\u03b9 BD.data \u03ba\u2082 \u03ba M)))\n  (of_hom (QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba\u2082 M)))\n  (of_hom (QprimeFP.shift_sub_id \u03b9 h\u03b9 (QprimeFP_int r' BD.data \u03ba M)))\n  (auux $ commsq_shift_sub_id_Tinv _ _ _ _ _ _)\n  (auux $ commsq_shift_sub_id_\u03b9 _ _ _ _ _ _)\n  ((single _ 0).map (Condensed.of_top_ab_map (normed_add_group_hom.to_add_monoid_hom (normed_with_aut.T.inv : V \u27f6 V)) (normed_add_group_hom.continuous _)))\n  i).bicartesian :=\nbegin\n  have h1 := _, have h2 := _, have h3 := _,\n  refine commsq.bicartesian.of_iso\n    (pi_Ext_iso_Ext_sigma _ _ _ _ _ _) (pi_Ext_iso_Ext_sigma _ _ _ _ _ _)\n    (pi_Ext_iso_Ext_sigma _ _ _ _ _ _) (pi_Ext_iso_Ext_sigma _ _ _ _ _ _)\n    h1 h2 h2 h3 H1,\n  apply Tinv2_iso_of_bicartesian_aux_1,\n  { clear h1, apply commsq.of_eq, rw \u2190 iso.eq_comp_inv,\n    apply limit.hom_ext, rintros \u27e8j\u27e9, rw lim_map_\u03c0,\n    dsimp [pi_Ext_iso_Ext_sigma],\n    simp only [category.assoc],\n    have := Ext_coproduct_iso_\u03c0 _\n      (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba\u2082 M).obj (\u03b9 k))\n      i ((single.{u+1 u+2} (Condensed.{u u+1 u+2} Ab.{u+1}) 0).obj V.to_Cond) j,\n    rw [this, \u2190 nat_trans.comp_app, \u2190 functor.map_comp, \u2190 op_comp],\n    clear this,\n    erw colimit.\u03b9_desc,\n    dsimp [Ext_Tinv2, ExtQprime.Tinv2],\n    simp only [sub_comp, comp_sub],\n    refine congr_arg2 _ _ _,\n    { simp only [\u2190 nat_trans.comp_app, \u2190 functor.map_comp, \u2190 op_comp],\n      rw Tinv2_iso_of_bicartesian_aux_2,\n      swap,\n      { apply homotopy_category.colimit_cofan_bdd },\n      simp only [functor.map_comp, op_comp, nat_trans.comp_app, category.assoc],\n      have := Ext_coproduct_iso_\u03c0 _\n        (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba M).obj (\u03b9 k))\n        i ((single.{u+1 u+2} (Condensed.{u u+1 u+2} Ab.{u+1}) 0).obj V.to_Cond) j,\n      rw \u2190 iso.eq_inv_comp at this,\n      rw \u2190 reassoc_of this, refl },\n    { simp only [category.assoc, nat_trans.naturality, \u2190 nat_trans.comp_app_assoc,\n        \u2190 functor.map_comp_assoc, \u2190 functor.map_comp, \u2190 nat_trans.comp_app, \u2190 op_comp],\n      rw Tinv2_iso_of_bicartesian_aux_3,\n      simp only [functor.map_comp, op_comp, nat_trans.comp_app, category.assoc],\n      have := Ext_coproduct_iso_\u03c0 _\n        (\u03bb (k : ulift.{u+1 0} \u2115), (QprimeFP.{u} r' BD.data \u03ba M).obj (\u03b9 k))\n        i ((single.{u+1 u+2} (Condensed.{u u+1 u+2} Ab.{u+1}) 0).obj V.to_Cond) j,\n      rw \u2190 iso.eq_inv_comp at this,\n      rw \u2190 reassoc_of this,\n      refl,\n      { apply homotopy_category.colimit_cofan_bdd } } },\n  apply Tinv2_iso_of_bicartesian_aux_1,\nend\n\nlemma Tinv2_iso_of_bicartesian [normed_with_aut r V]\n  [\u2200 c n, fact (\u03ba\u2082 c n \u2264 \u03ba c n)] [\u2200 c n, fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)]\n  (h\u03ba : Lbar.sufficiently_increasing \u03ba \u03b9)\n  (h\u03ba\u2082 : Lbar.sufficiently_increasing \u03ba\u2082 \u03b9)\n  (i : \u2124)\n  (H1 : (shift_sub_id.commsq (ExtQprime.Tinv2 r r' BD.data \u03ba \u03ba\u2082 M V i) \u03b9 h\u03b9).bicartesian)\n  (H2 : (shift_sub_id.commsq (ExtQprime.Tinv2 r r' BD.data \u03ba \u03ba\u2082 M V (i+1)) \u03b9 h\u03b9).bicartesian) :\n  is_iso (((Ext (i+1)).map ((BD.eval freeCond'.{u}).map M.Tinv_cond).op).app\n    ((single (Condensed Ab) 0).obj V.to_Cond) -\n    ((Ext (i+1)).obj ((BD.eval freeCond').op.obj (op (M.to_Condensed)))).map\n      ((single (Condensed Ab) 0).map\n        (Condensed.of_top_ab_map\n          (normed_add_group_hom.to_add_monoid_hom normed_with_aut.T.inv) (normed_add_group_hom.continuous _)))) :=\nbegin\n  let Vc := (single (Condensed Ab) 0).obj V.to_Cond,\n  have SES\u2081 := QprimeFP.short_exact BD \u03ba\u2082 M \u03b9 h\u03b9 h\u03ba\u2082,\n  have SES\u2082 := QprimeFP.short_exact BD \u03ba M \u03b9 h\u03b9 h\u03ba,\n  have := Ext_iso_of_bicartesian_of_bicartesian SES\u2081 SES\u2082\n    (sigma_map _ (QprimeFP_int.Tinv BD.data _ _ M))\n    (sigma_map _ (QprimeFP_int.Tinv BD.data _ _ M))\n    (category_theory.functor.map _ M.Tinv_cond)\n    (sigma_map _ (QprimeFP_int.\u03b9 BD.data _ _ M))\n    (sigma_map _ (QprimeFP_int.\u03b9 BD.data _ _ M))\n    (commsq_shift_sub_id_Tinv BD.data _ _ M \u03b9 h\u03b9)\n    (commsq_sigma_proj_Tinv BD _ _ M \u03b9)\n    (commsq_shift_sub_id_\u03b9 BD.data _ _ M \u03b9 h\u03b9)\n    (commsq_sigma_proj_\u03b9 BD _ _ M \u03b9)\n    Vc ((single _ _).map $ Condensed.of_top_ab_map\n      (normed_add_group_hom.to_add_monoid_hom normed_with_aut.T.inv) (normed_add_group_hom.continuous _))\n    _\n    (Tinv2_iso_of_bicartesian_aux _ _ _ _ _ _ _ _ _ H1)\n    (Tinv2_iso_of_bicartesian_aux _ _ _ _ _ _ _ _ _ H2),\n  delta Ext_Tinv2 at this,\n  simpa only [op_id, category_theory.functor.map_id, category.id_comp, nat_trans.id_app],\nend\n\nlemma Tinv2_iso_of_bicartesian' [normed_with_aut r V]\n  [\u2200 c n, fact (\u03ba\u2082 c n \u2264 \u03ba c n)] [\u2200 c n, fact (\u03ba\u2082 c n \u2264 r' * \u03ba c n)]\n  (H : \u2200 i, \u2203 (\u03b9) (h\u03b9),\n    Lbar.sufficiently_increasing \u03ba \u03b9 \u2227\n    Lbar.sufficiently_increasing \u03ba\u2082 \u03b9 \u2227\n    (shift_sub_id.commsq (ExtQprime.Tinv2 r r' BD.data \u03ba \u03ba\u2082 M V i) \u03b9 h\u03b9).bicartesian \u2227\n    (shift_sub_id.commsq (ExtQprime.Tinv2 r r' BD.data \u03ba \u03ba\u2082 M V (i+1)) \u03b9 h\u03b9).bicartesian)\n  (i : \u2124) :\n  is_iso (((Ext i).map ((BD.eval freeCond'.{u}).map M.Tinv_cond).op).app\n    ((single (Condensed Ab) 0).obj V.to_Cond) -\n    ((Ext i).obj ((BD.eval freeCond').op.obj (op (M.to_Condensed)))).map\n      ((single (Condensed Ab) 0).map\n        (Condensed.of_top_ab_map\n          (normed_add_group_hom.to_add_monoid_hom normed_with_aut.T.inv) (normed_add_group_hom.continuous _)))) :=\nbegin\n  obtain \u27e8i, rfl\u27e9 : \u2203 k, k+1 = i := \u27e8i-1, sub_add_cancel _ _\u27e9,\n  obtain \u27e8\u03b9, h\u03b9, h\u03ba, h\u03ba\u2082, H1, H2\u27e9 := H i,\n  apply Tinv2_iso_of_bicartesian _ _ _ _ _ _ \u03b9 h\u03b9 h\u03ba h\u03ba\u2082 i H1 H2,\nend\n\nend preps\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/Lbar/ext_aux4.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5156199157230157, "lm_q2_score": 0.3702254064929193, "lm_q1q2_score": 0.19089559289439828}}
{"text": "/-\nCopyright (c) 2019 Seul Baek. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthor: Seul Baek\n-/\nimport Mathlib.PrePort\nimport Mathlib.Lean3Lib.init.default\nimport Mathlib.tactic.omega.prove_unsats\nimport Mathlib.tactic.omega.nat.dnf\nimport Mathlib.tactic.omega.nat.neg_elim\nimport Mathlib.tactic.omega.nat.sub_elim\nimport Mathlib.PostPort\n\nnamespace Mathlib\n\n/-\nMain procedure for linear natural number arithmetic.\n-/\n\nnamespace omega\n\n\nnamespace nat\n\n\ntheorem univ_close_of_unsat_neg_elim_not (m : \u2115) (p : preform) :\n    preform.unsat (neg_elim (preform.not p)) \u2192 univ_close p (fun (_x : \u2115) => 0) m :=\n  sorry\n\nend Mathlib", "meta": {"author": "AurelienSaue", "repo": "Mathlib4_auto", "sha": "590df64109b08190abe22358fabc3eae000943f2", "save_path": "github-repos/lean/AurelienSaue-Mathlib4_auto", "path": "github-repos/lean/AurelienSaue-Mathlib4_auto/Mathlib4_auto-590df64109b08190abe22358fabc3eae000943f2/Mathlib/tactic/omega/nat/main_auto.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5813030906443133, "lm_q2_score": 0.3276683008207139, "lm_q1q2_score": 0.19047459597325156}}
{"text": "import mcl.defs\nimport mcl.rhl\nimport mcl.lemmas\nimport mcl.compute_list\nimport mcl.ts_updates\nimport syncablep\n\nopen parlang\nopen parlang.thread_state\nopen parlang.state\nopen mcl\nopen mcl.rhl\n\n/-- Copies *var* from tlocal of the nth thread into index n of *m* (forall n). Generally used as an assertion language for Hoare proofs -/\ndef from_tlocal {sig : signature} {n} (var) (s : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig)) (m : memory (parlang_mcl_shared sig)) (h : (((sig.val var).type).dim) = 1) := \n((list.range_fin n).foldl (\u03bb (m : parlang.memory (parlang_mcl_shared sig)) tid, \n    m.update \u27e8var, eq.mpr (by rw h) v[tid.val]\u27e9 ((s.threads.nth tid).tlocal.get \u27e8var, eq.mpr (by rw h) v[tid.val]\u27e9))) m\n\nlemma from_tlocal_comm_update {sig : signature} {n} (var\u2081 var\u2082) (s : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig))\n(m : memory (parlang_mcl_shared sig)) {h\u2081} {idx val} :\nfrom_tlocal var\u2081 s (m.update \u27e8var\u2082, idx\u27e9 val) h\u2081 = memory.update (from_tlocal var\u2081 s m h\u2081) \u27e8var\u2082, idx\u27e9 val := begin\n    unfold from_tlocal,\n    induction n,\n    { refl, },\n    {\n        rw [list.foldl_range_fin_succ],\n        sorry, -- complicated with dependent type fin\n    }\nend\n\nlemma from_tlocal_comm {sig : signature} {n} (var\u2081 var\u2082) (s : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig))\n(s' : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig)) (m : memory (parlang_mcl_shared sig)) {h\u2081 h\u2082} :\nfrom_tlocal var\u2081 s (from_tlocal var\u2082 s' m h\u2082) h\u2081 = from_tlocal var\u2082 s' (from_tlocal var\u2081 s m h\u2081) h\u2082 := begin\n    unfold from_tlocal,\n    induction n,\n    {\n        refl,\n    }, {\n        rw [list.foldl_range_fin_succ],\n        rw [list.foldl_range_fin_succ],\n        repeat { rw \u2190 from_tlocal },\n        sorry,\n    }\nend\n\n--lemma : from_tlocal \"b\" (map_active_threads ac (ts_updates [op.compute_list (... :: coms)]) s = from_tlocal \"b\" (map_active_threads ac (ts_updates [op.compute_list (... :: coms)]) s\n\nlemma from_tlocal_eq {sig : signature} {n}\n{s s' : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig)}\n{m m' : memory (parlang_mcl_shared sig)} {var} {h : ((sig.val var).type).dim = 1} :\n(\u2200 tid, (s.threads.nth tid).tlocal.get \u27e8var, begin rw h, exact v[tid] end\u27e9 = (s'.threads.nth tid).tlocal.get \u27e8var, begin rw h, exact v[tid] end\u27e9) \u2192\nm = m' \u2192\nfrom_tlocal var s m h = from_tlocal var s' m' h := begin\n    intros hveq hmeq,\n    subst hmeq,\n    unfold from_tlocal,\n    induction n,\n    { refl, },\n    {\n        rw list.foldl_range_fin_succ,\n        sorry,\n    }\nend\n\nlemma syncable'_compute_list_syncable {sig : signature} {n} {ac : vector bool n} {computes} {shole lhole : set $ mcl_address sig}\n{s : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig)}\n{m : memory (parlang_mcl_shared sig)} : \ns.syncable m \u2192\n(\u2200 tid : fin n, (s.threads.nth tid).stores = \u2205) \u2192\n(\u2200 tid : fin n, (s.threads.nth tid).loads = \u2205) \u2192\nsyncable' shole lhole (map_active_threads ac (ts_updates [op.compute_list computes]) s) m := begin\n    intros syncable no_stores no_loads,\n    unfold syncable' state.syncable,\n    split,\n    {\n        simp only [accesses, compute_list_stores', compute_list_loads', compute_list_shared'],\n        exact syncable,\n    }, {\n        intros i tid,\n        simp [no_stores tid, no_loads tid],\n    }\nend\n\ninstance deciable_exists_nat (p) : decidable (@Exists \u2115 p) := sorry\ninstance deciable_exists_fin (n p) : decidable (@Exists (fin n) p) := sorry\n\n\n/-- Processes a store\nWhich thread accesses which index doesn't matter \n-/\nlemma syncable'_store {sig : signature} {n} {ac : vector bool n} {computes} {shole lhole : set $ mcl_address sig}\n{dim} {idx : vector (expression sig type.int) dim} {var t} {h\u2081 : type_of (sig.val var) = t} {h\u2082}\n{updates : list $ op sig}\n{s : state n (memory $ parlang_mcl_tlocal sig) (parlang_mcl_shared sig)}\n{m : memory (parlang_mcl_shared sig)} \n(idx_1 : (((sig.val var).type).dim) = 1) : \n(\u2200 idx, (\u27e8var, idx\u27e9 : mcl_address sig) \u2209 shole) \u2192\n(\u2200 idx, (\u27e8var, idx\u27e9 : mcl_address sig) \u2209 lhole) \u2192\n(\u2200 tid\u2081 tid\u2082, tid\u2081 \u2260 tid\u2082 \u2192 idx.map (\u03bb ind, eval (s.threads.nth tid\u2081).tlocal ind) \u2260 idx.map (\u03bb ind, eval (s.threads.nth tid\u2082).tlocal ind)) \u2192\nsyncable' (shole \u222a array_address_range var) (lhole \u222a array_address_range var) (map_active_threads ac (ts_updates $ op.compute_list computes :: updates) s) m \u2192\nsyncable' shole lhole (map_active_threads ac (ts_updates $ op.compute_list computes :: op.store var idx h\u2081 h\u2082 :: updates) s) (from_tlocal var (map_active_threads ac (ts_updates [op.compute_list computes]) s) m idx_1)\n| var_not_in_shole var_not_in_lhole distinct_idx (and.intro syncable holes_constraint) := begin\n    clear syncable'_store,\n    unfold syncable',\n    -- proof: syncable\n    split, {\n        intros i,\n        by_cases i_is_var : i.fst = var,\n        {\n            subst i_is_var,\n            specialize var_not_in_shole i.snd,\n            specialize var_not_in_lhole i.snd,\n            -- cases distinct out-of-bound\n            -- by_cases i_is_oob : (\u2203 (tid : fin n), i.snd = eq.mpr _ (idx.map (\u03bb ind, eval (s.threads.nth tid).tlocal ind))),\n            sorry,\n        },\n        sorry,\n    }, {\n        -- proof: store hole\n        intros i tid,\n        have : i \u2208 shole \u222a array_address_range var := sorry, --trivial\n        \n        by_cases i_is_var : i.fst = var,\n        {\n            -- if i is var we store into hole -> contradiction\n            subst i_is_var,\n            specialize var_not_in_shole i.snd,\n            specialize var_not_in_lhole i.snd,\n            cases i,\n            split,\n            {\n                intros i_in_store,\n                contradiction,\n            }, {\n                intros i_in_loads,\n                contradiction,\n            }\n        }, {\n            by_cases tid_activeness : ac.nth tid = tt,\n            {\n                rw map_active_threads_nth_ac tid_activeness,\n                specialize holes_constraint i tid,\n                \n                rw map_active_threads_nth_ac tid_activeness at holes_constraint,\n                rw [ts_updates] at holes_constraint,\n                /- LARGE PROOF STARTS HERE -/\n                clear syncable,\n                rw [ts_updates, ts_updates],\n                revert holes_constraint,\n                generalize eq : compute_list computes (vector.nth (s.threads) tid) = s',\n                rw \u2190 list.reverse_reverse updates,\n                generalize eq' : list.reverse updates = ups,\n                intro holes_constraint,\n                -- we do induction on the reverse of the list, such that we \"append\" elements to the end of updates (i.e. later)\n                -- afterwards cases on the update (either store or compute)\n                induction ups generalizing updates,\n                {\n                    simp [ts_updates, thread_state.tlocal_to_shared, store],\n                    simp [ts_updates, thread_state.tlocal_to_shared, store] at holes_constraint,\n                    cases holes_constraint with shole_constraint lhole_constraint,\n                    split, {\n                        intros i_in_shole i_in_stores,\n                        cases i_in_stores, {\n                            subst i_in_stores,\n                            apply i_is_var,\n                            refl,\n                        }, {\n                            specialize shole_constraint (or.inl i_in_shole),\n                            contradiction,\n                        },\n                    }, {\n                        intro i_in_lhole,\n                        apply lhole_constraint (or.inl i_in_lhole),\n                    }\n                }, {\n                    rw [ts_update_split],\n                    simp,\n                    cases ups_hd,\n                    {\n                        simp only [ts_updates],\n                        simp only [ts_update_split] at holes_constraint,\n                        simp [ts_updates, -set.mem_union_eq] at holes_constraint,\n                        specialize @ups_ih _ (list.reverse ups_tl),\n                        swap,\n                        {\n                            split, {\n                                intro,\n                                apply store_stores,\n                                apply holes_constraint.left a,\n                            }, {\n                                intro,\n                                apply store_loads,\n                                apply holes_constraint.right a,\n                            },\n                        },\n                        simp [thread_state.tlocal_to_shared, store],\n                        simp [thread_state.tlocal_to_shared, store] at ups_ih,\n                        split,\n                        {\n                            intros i_in_shole,\n                            rw not_or_distrib,\n                            split, {\n                                -- proof that the new store doesn't store in i\n                                cases holes_constraint with shole_constraint lhole_constraint,\n                                simp [thread_state.tlocal_to_shared, store] at shole_constraint,\n                                rw not_or_distrib at shole_constraint,\n                                cases shole_constraint (or.inl i_in_shole),\n                                rw ts_updates_tlocal s'.shared s'.loads s'.stores,\n                                simp,\n                                have : s' = {tlocal := s'.tlocal, shared := s'.shared, loads := s'.loads, stores := s'.stores} := begin\n                                    cases s',\n                                    simp,\n                                end,\n                                rw \u2190 this,\n                                assumption,\n                            }, {\n                                apply ups_ih.left i_in_shole,\n                            }\n                        }, {\n                            intros i_in_lhole,\n                            apply ups_ih.right i_in_lhole,\n                        }\n                    }, {\n                        -- the head element is compute_list\n                        simp [ts_updates],\n                        apply ups_ih,\n                        swap 3,\n                        exact list.reverse ups_tl,\n                        rw [ts_update_split] at holes_constraint,\n                        simp [ts_updates] at holes_constraint,\n                        simp,\n                        exact holes_constraint,\n                        simp,\n                    }\n                },\n            }, {\n                specialize holes_constraint i tid,\n                rw \u2190 map_active_threads_nth_inac tid_activeness,\n                rw \u2190 map_active_threads_nth_inac tid_activeness at holes_constraint,\n                simp *,\n                intro a,\n                apply holes_constraint.right (or.inl a),\n            }\n        }\n    },\nend", "meta": {"author": "fischerman", "repo": "GPU-transformation-verifier", "sha": "75a5016f05382738ff93ce5859c4cfa47ccb63c1", "save_path": "github-repos/lean/fischerman-GPU-transformation-verifier", "path": "github-repos/lean/fischerman-GPU-transformation-verifier/GPU-transformation-verifier-75a5016f05382738ff93ce5859c4cfa47ccb63c1/src/mcl/syncablep.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5039061705290805, "lm_q2_score": 0.37754066879814546, "lm_q1q2_score": 0.1902450726330614}}
{"text": "import topology.sheaves.sheaf\nimport algebra.category.Group.abelian\nimport algebra.category.Group.colimits\nimport algebra.category.Group.limits\nimport topology.sheaves.sheaf_condition.sites\nimport group_epi_mono\n\nnoncomputable theory\n\nsection Ab\n\nopen Top category_theory opposite\nopen category_theory.limits\n\nuniverse u\n\nnamespace AddCommGroup\n\ndef range_to_image {A B : Ab} (f : A \u27f6 B) : mono_factorisation f :=\n{ I := \u27e8f.range\u27e9, \n  m := \n  { to_fun := \u03bb y, y.1, \n    map_add' := \u03bb _ _, rfl, \n    map_zero' := rfl },\n  m_mono := { right_cancellation := \u03bb C g h eq1, begin\n    ext1 x,\n    replace eq1 := add_monoid_hom.congr_fun eq1 x,\n    simpa only [comp_apply, add_monoid_hom.coe_mk, set_like.coe_eq_coe, subtype.val_eq_coe] using eq1,\n  end },\n  e := \n  { to_fun := \u03bb a, \u27e8f a, \u27e8_, rfl\u27e9\u27e9,\n    map_add' := \u03bb _ _, by { simp only [map_add, subtype.ext_iff_val], refl, },\n    map_zero' := by simp only [map_zero, subtype.ext_iff_val, show (0 : f.range).1 = 0, from rfl] } }.\n\nlemma range_is_image {A B : Ab} (f : A \u27f6 B) : is_image (range_to_image f) :=\n{ lift := \u03bb F, \n  { to_fun := \u03bb x, F.e (classical.some x.2), -- x \u2208 f.range so x.2 says that \u2203 y, f y = x\n    map_zero' := begin\n      have h : (0 : B) \u2208 f.range := \u27e80, by rw map_zero\u27e9,\n      have eq1 := classical.some_spec h,\n      have eq2 := add_monoid_hom.congr_fun F.fac' (classical.some h),\n      erw eq1 at eq2,\n      have h2 : function.injective F.m,\n      { apply add_monoid_hom.inj_of_mono F.m, },\n      apply h2,\n      rw map_zero,\n      convert eq2,\n    end,\n    map_add' := \u03bb \u27e8_, \u27e8x, rfl\u27e9\u27e9 \u27e8_, \u27e8y, rfl\u27e9\u27e9, begin\n      rw \u2190 map_add,\n      apply_fun F.m using (add_monoid_hom.inj_of_mono F.m),\n      have : \u2200 x, F.m (F.e x) = f x := add_monoid_hom.congr_fun F.fac',\n      rw [this, this],\n      have t1 : ((\u27e8f x, \u27e8x, rfl\u27e9\u27e9 : f.range) + (\u27e8f y, \u27e8y, rfl\u27e9\u27e9 : f.range)).1 \u2208 f.range := \u27e8x + y, by simpa only [map_add, subtype.ext_iff_val]\u27e9,\n      change \u2203 _, _ at t1,\n      have  := classical.some_spec t1,\n      erw this,\n      change f x + f y = _,\n      rw map_add,\n      have t2 : (\u27e8f x, \u27e8_, rfl\u27e9\u27e9 : f.range).1 \u2208 f.range := \u27e8x, rfl\u27e9,\n      have t3 : (\u27e8f y, \u27e8_, rfl\u27e9\u27e9 : f.range).1 \u2208 f.range := \u27e8y, rfl\u27e9,\n      change \u2203 _, _ at t2,\n      change \u2203 _, _ at t3,\n      have := classical.some_spec t2,\n      erw this,\n      have := classical.some_spec t3,\n      erw this,\n    end },\n  lift_fac' := \u03bb F, begin\n    ext,\n    change F.m (F.e _) = x.1,\n    have eq1 : \u2200 y, F.m (F.e y) = f y := add_monoid_hom.congr_fun F.fac',\n    rw eq1,\n    have t1 : x.1 \u2208 f.range := x.2,\n    change \u2203 _, _ at t1,\n    have := classical.some_spec t1,\n    erw this,\n  end }\n\nend AddCommGroup\n\nend Ab\n\nsection sheaf_has_image\n\nopen Top category_theory opposite\nopen category_theory.limits\n\nuniverse u\n\nvariables {T : Top.{u}}\n\nnamespace Top.presheaf\n\nsection presheaf\n\nopen Top.presheaf\n\ndef presheaf.image' {F G : presheaf Ab T} (f : F \u27f6 G) : presheaf Ab T :=\n{ obj := \u03bb U, image (f.app U),\n  map := \u03bb U V inc, begin\n    refine (is_image.iso_ext (AddCommGroup.range_is_image (f.app U)) (image.is_image (f.app U))).inv \u226b _ \u226b\n      (is_image.iso_ext (AddCommGroup.range_is_image (f.app V)) (image.is_image (f.app V))).hom,\n    refine \n    { to_fun := \u03bb x, \u27e8f.app V (F.map inc (classical.some x.2)), \u27e8_, rfl\u27e9\u27e9, \n      map_add' := sorry, \n      map_zero' := sorry },\n  end,\n  map_id' := sorry,\n  map_comp' := sorry }\n\ndef presheaf.image'_\u03b9 {F G : presheaf Ab T} (f : F \u27f6 G) : presheaf.image' f \u27f6 G :=\n{ app := \u03bb U, image.\u03b9 _,\n  naturality' := sorry }\n\ndef presheaf.image'_e {F G : presheaf Ab T} (f : F \u27f6 G) : F \u27f6 presheaf.image' f :=\n{ app := \u03bb U, factor_thru_image (f.app U),\n  naturality' := sorry }\n\ndef presheaf.mono_factorisation {F G : presheaf Ab T} (f : F \u27f6 G) : mono_factorisation f :=\n{ I := presheaf.image' f,\n  m := presheaf.image'_\u03b9 f,\n  m_mono := sorry,\n  e := presheaf.image'_e f,\n  fac' := begin\n    ext U x,\n    simp only [comp_apply, nat_trans.comp_app],\n    change (image.\u03b9 (f.app U)) (factor_thru_image (f.app U) x) = _,\n    erw add_monoid_hom.congr_fun (image.fac (f.app U)) x,\n  end }\n\ndef presheaf.image_factorisation {F G : presheaf Ab T} (f : F \u27f6 G) : image_factorisation f := \n{ F := presheaf.mono_factorisation f,\n  is_image := sorry }\n\ninstance {F G : presheaf Ab T} (f : F \u27f6 G) : has_image f := \n{ exists_image := \u27e8presheaf.image_factorisation f\u27e9 }\ninstance : has_images (presheaf Ab T) :=\n{ has_image := \u03bb F G f, by apply_instance }\n\nend presheaf\n\nsection sheaf\n\nopen Top.presheaf category_theory.grothendieck_topology Top topological_space\n\nvariable [\u03a0 (X : opens T), preserves_colimits_of_shape ((opens.grothendieck_topology T).cover X)\u1d52\u1d56 (forget Ab.{u})]\n\n-- sheafify `image f`\ndef sheaf.image' {F G : sheaf Ab T} (f : F \u27f6 G) : sheaf Ab T :=\nlet f' : (F.1 : presheaf Ab T) \u27f6 (G.1 : presheaf Ab T) := f in\n(Sheaf_sites_to_sheaf_spaces Ab T).obj ((presheaf_to_Sheaf (opens.grothendieck_topology T) _).obj  (image f'))\n\ndef sheaf.image'_\u03b9 {F G : sheaf Ab T} (f : F \u27f6 G) : sheaf.image' f \u27f6 G := sorry\ndef sheaf.image'_e {F G : sheaf Ab T} (f : F \u27f6 G) : F \u27f6 sheaf.image' f := sorry\n\ndef sheaf.mono_factorisation {F G : sheaf Ab T} (f : F \u27f6 G) : mono_factorisation f :=\nlet f' : (F.1 : presheaf Ab T) \u27f6 (G.1 : presheaf Ab T) := f in\n{ I := sheaf.image' f,\n  m := sheaf.image'_\u03b9 f,\n  m_mono := sorry,\n  e := sheaf.image'_e f,\n  fac' := sorry }\n\n#check Top.presheaf.category_theory.limits.has_image\ndef sheaf.image_factorisation {F G : sheaf Ab T} (f : F \u27f6 G) : image_factorisation f :=\n{ F := sheaf.mono_factorisation f,\n  is_image := sorry }\n\ninstance sheaf.has_image {F G : sheaf Ab T} (f : F \u27f6 G) : has_image f :=\n{ exists_image := \u27e8sheaf.image_factorisation f\u27e9 }\n\ninstance : has_images (sheaf Ab T) :=\n{ has_image := \u03bb F G f, sheaf.has_image f }\n\nend sheaf\nend Top.presheaf\n\nend sheaf_has_image", "meta": {"author": "jjaassoonn", "repo": "quasicoherent", "sha": "d96ccacf00364afd6d0de7958024f1da10e015da", "save_path": "github-repos/lean/jjaassoonn-quasicoherent", "path": "github-repos/lean/jjaassoonn-quasicoherent/quasicoherent-d96ccacf00364afd6d0de7958024f1da10e015da/src/sheaf_has_image.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5312093733737562, "lm_q2_score": 0.35577489351363034, "lm_q1q2_score": 0.1889909582454904}}
{"text": "import ClausalExtraction.Context\n\nopen Lean\nopen Lean.Meta\n\nnamespace ClausalExtraction\n\nsection ExpressionUtils\n\nprivate def propExpr : Expr := mkSort levelZero\n\ndef exprHead : Expr \u2192 Option Name\n| Expr.bvar .. => none\n-- FIXME: Figure out if we want to see through free variables with let bindings in local context.\n| Expr.fvar .. => none\n| Expr.mvar .. => none\n| Expr.sort .. => none\n| Expr.const nm .. => nm\n| Expr.app f a .. => exprHead f\n| Expr.lam .. => none\n| Expr.forallE .. => none\n-- FIXME: Figure out if we want to see through let bindings.\n| Expr.letE .. => none\n| Expr.lit .. =>  none\n-- FIXME: Figure out if ignoring metadata is always ok.\n| Expr.mdata  _ x .. => exprHead x\n -- FIXME: Figure out if we want to see through projections.\n| Expr.proj n i s .. => none\n\nend ExpressionUtils\n\ndef falseExpr : Expr := mkConst ``False\n\n-- | Assertion added\nstructure Assertion where\n  -- Identifies the free variable in the initial context used to generate this one.\n  -- Used to allow deleting original proposition from local context.\n  origin : Option FVarId\n  -- The free variable used to identify the assertion in the local context\n  -- generated for the assertion.\n  name : Name\n  -- Predicate that was asserted.\n  pred : Pred\n  -- A proof of the predicate in the context of the original goal.\n  --\n  -- N.B. It may be ideal to explore if we can defer producing this until needed.\n  proof : Expr\n\nnamespace Assertion\n\ninstance : Inhabited Assertion := \u27e8\n     { origin := arbitrary,\n       name := arbitrary,\n       pred := arbitrary,\n       proof := arbitrary,\n     }\n  \u27e9\n\nend Assertion\n\n\nstructure State where\n  -- Predicates asserted to be true.\n  assertions : Array Assertion := #[]\n\nnamespace State\n\n-- | Return proofs associated with assertions.\ndef proofs (s:State) : Array Expr := s.assertions.map Assertion.proof\n\nend State\n\n/--\nThis contains the inferred satisfiability problem from a lean proof.\n-/\nstructure SatProblem where\n  -- Identifier of original goal to prove\n  goalId : MVarId\n  -- Context used to convert to a decision proedure\n  context : Context\n  -- Assumptions inferred\n  state : State\n  -- Given a proof from the solver this constructs a proof of the goal.\n  onMkProof : Expr \u2192 Expr\n\nnamespace SatProblem\n\n-- | Add assertions to local context.\n-- Return new local context along with array of free variables identifying assertions.\ndef adjustLocalContext (ctx:Context) (s:State) (lctx:LocalContext) : MetaM (LocalContext \u00d7 Array Expr) := do\n  let mut lctx := lctx\n  let mut fvars : Array Expr := #[]\n  for a in s.assertions do\n    let newVar \u2190 mkFreshFVarId\n    fvars := fvars.push (mkFVar newVar)\n    match a.origin with\n    | some prevVar =>\n      -- FIXME: Make sure erasing the previous declaration does not break things.\n      lctx := lctx.erase prevVar\n    | none =>\n      pure ()\n    let e \u2190 ctx.predExpr a.pred\n    lctx := lctx.mkLocalDecl newVar a.name e\n  pure (lctx, fvars)\n\n/-\nThis does the work of actually applying the normalization procedure to the problem.\n\nIt is setup as an extra step so that a decision procedure could be tried before\ncommitting to using the normalization procedure.\n-/\ndef apply (g:SatProblem) : MetaM (List MVarId) := do\n  let tag   \u2190 getMVarTag g.goalId\n  let lctx \u2190 getLCtx\n  let (lctx, fvars) \u2190 adjustLocalContext g.context g.state lctx\n  withReader (fun ctx => { ctx with lctx := lctx }) $ do\n    let solverSatProblem \u2190 mkFreshExprSyntheticOpaqueMVar falseExpr tag\n    -- Turn goal into lambda with free variables from assertions\n    let fn \u2190 Meta.mkLambdaFVars fvars solverSatProblem\n    -- Assign goal\n    assignExprMVar g.goalId (g.onMkProof (mkAppN fn g.state.proofs))\n    pure [solverSatProblem.mvarId!]\n\nend SatProblem\n\ndef matchNot (e:Expr) : MetaM (Option Expr) := do\n  let mvar \u2190 mkFreshExprMVar propExpr MetavarKind.natural `a\n  let p := mkApp (mkConst ``Not) mvar\n  pure $ if \u2190 isDefEq p e then mvar else none\n\n-- | See if we can add the local declaration to the arithmetic unit.\n-- proof is a term of type prop.\ndef tryAddPred (ctx:Context)\n                 (r:IO.Ref State)\n                 (origin : Option FVarId)\n                 (name:Name)\n                 (proof:Expr)\n                 (prop:Expr) : MetaM Bool := do\n  let rules \u2190 ctx.propTheoryMap.getMatch prop\n  for t in rules do\n    match \u2190 t.action prop ctx.services with\n    | none => pure ()\n    | some (p, proofFn) => do\n      let pred := Pred.mkPred t.theoryRef p\n      let a := { origin := origin, name := name, proof := mkApp proofFn proof, pred := pred }\n      r.modify $ \u03bbs => { s with assertions := s.assertions.push a }\n      return true\n  return false\n\ntheorem decidable_by_contra {P:Prop} [h:Decidable P] (q : \u00ac\u00acP) : P :=\n  match h with\n  | isFalse h => False.elim (q h)\n  | isTrue h => h\n\ndef processDecls (ctx:Context) (r:IO.Ref State) (lctx:LocalContext) : MetaM Unit := do\n  let mut seenFirst := false\n  for md in lctx.decls do\n    -- Skip first declaration (as it corresponds to initial goal for\n    -- recursive purposes)\n    unless seenFirst do\n      seenFirst := true\n      continue\n    -- Skip if declaration has been deleted.\n    let some d \u2190 pure md\n         | continue\n    -- FIXME: Figure out how to support let declarations\n    if d.isLet then\n      continue\n    -- If this is a proposition then try assuming it.\n    if \u2190 isDefEq (\u2190 inferType d.type) propExpr then do\n      let _ \u2190 tryAddPred ctx r (some d.fvarId) d.userName (mkFVar d.fvarId) d.type\n\n-- | This analyze the goal of the problem.\ndef analyzeSatProblem (ctx:Context) (r : IO.Ref State) (tactic:Name) (goalId:MVarId) (target:Expr)\n   : MetaM (Expr \u2192 Expr) := do\n  -- If goal is already false, then just negate it.\n  if \u2190 isDefEq target falseExpr then\n    return id\n  -- If goal has form `Not p` then we can diretly process property.\n  match \u2190 matchNot target with\n  | some prop => do\n    if \u2190 tryAddPred ctx r none `negGoal (mkBVar 0) prop then\n      return (mkLambda Name.anonymous BinderInfo.default prop)\n  -- Goal is not a negation, so we seeing if we can extract a predicate from\n  -- negated goal and then use decidable_by_contra to get proof of negation\n  -- of target.\n  | none =>\n    let prop := mkApp (mkConst ``Not) target\n    if \u2190 tryAddPred ctx r none `negGoal (mkBVar 0) prop then\n      let some classVal \u2190 synthInstance? (mkApp (mkConst ``Decidable) target)\n          | throwTacticEx tactic goalId \"Could not synthesize Decidable instance for proposition:.\"\n      let decideByContraExpr := mkAppN (mkConst ``decidable_by_contra) #[target, classVal]\n      return (fun goalProof => mkApp decideByContraExpr (mkLambda Name.anonymous BinderInfo.default prop goalProof))\n\n  -- In final case, we just ignore the goal and try to prove a contradiction from assumptions\n  -- alone.\n  match \u2190 inferType target with\n  | Expr.sort lvl _ =>\n    pure (mkApp (mkApp (mkConst ``False.elim [lvl]) target))\n  | _ =>\n    throwTacticEx tactic goalId \"Expected a type.\"\n\ndef mkGoal (ctx:Context) (tactic:Name) (goalId:MVarId) : MetaM SatProblem := do\n  withMVarContext goalId do\n    let md \u2190 getMVarDecl goalId\n    let stateRef \u2190 IO.mkRef {}\n    processDecls ctx stateRef md.lctx\n    let fn \u2190 analyzeSatProblem ctx stateRef tactic goalId md.type\n    let s \u2190 stateRef.get\n    pure { goalId := goalId, context := ctx, state := s, onMkProof := fn }\n\nend ClausalExtraction\n", "meta": {"author": "joehendrix", "repo": "lean-arith-solver", "sha": "95041be7b67fa1525644ad60896ae71881efdd29", "save_path": "github-repos/lean/joehendrix-lean-arith-solver", "path": "github-repos/lean/joehendrix-lean-arith-solver/lean-arith-solver-95041be7b67fa1525644ad60896ae71881efdd29/lib/ClausalExtraction/State.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5312093733737563, "lm_q2_score": 0.35577488668296436, "lm_q1q2_score": 0.18899095461697665}}
{"text": "import analysis.inner_product_space.pi_L2\nimport topology.paracompact\n\n\n--OUTPUT 1\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  -- Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$\n  assume A : set (euclidean_space \u211d (fin n)),\n  assume hA : is_open_cover A,\n\n  -- We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$.\n  let C := {s : euclidean_space \u211d (fin n) | \u2203 t \u2208 A, \u2203 m : \u2115, \u2203 r : \u211d, s = ball t m r \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 C, \u2203 m : \u2115, ball s m 1 \u2282 ball x m 1}},\n\n  -- First, we define a collection of pen balls\n  have h1 : {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} = \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m 1} \u2229 (euclidean_space \u211d (fin n)) \\ {x | \u2203 s \u2208 \u22c3 r : \u2115, {s : euclidean_space \u211d (fin n) | \u2203 m : \u2115,ball s m 1 \u2282 ball 0 m\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) := sorry\n\ntheorem  \u211d_paracompact : paracompact_space euclidean : paracompact_space (euclidean_space \u211d (fin 1)) := sorry\n\n/-`theorem`\nTwelve Fold Symmetry of Rhombic Dodecahedron\nLet $\\struct {D, \\mathcal{E}}$ be a rhombic dodecahedron. Then $D$ has a twelve-fold symmetry.\n`proof`\nLet the twelve edges of $D$ be denoted by $\\mathcal{E} = \\anset{E_1, E_2, \\ldots, E_{12}}$. Since every vertex has valence 3, every edge is incident to two vertices. Let $\\mathcal{V}$ denote the set of all vertices of $D$. Then it follows that $\\mathcal{E} \\subseteq \\mathcal{V} \\times \\mathcal{V}$. We now define a binary relation $R$ on $\\mathcal{V}$ such that for all $v, w \\in \\mathcal{V}$:\n\n- $v R w$ if and only if $(v, w) \\in \\mathcal{E}$\n\nLet $p$ be a permutation of $\\anset{E_1, E_2, \\ldots, E_{12}}$. We now define a map $f_p$ on $\\mathcal{V}$ such that for any $v \\in \\mathcal{V}$:\n\n- $f_p(v) = w$ such that $(v, w) \\in \\mathcal{E}$ and $(v, w) \\in p(\\mathcal{E})$\n\nWe now prove $\\mathcal{V}$ has a partition $\\mathcal{V} = \\bigcup_{v \\in \\mathcal{V}} C_v$ such that for every $v \\in \\mathcal{V}$:\n\n- $v \\in C_v$,\n- $C_v \\cap C_w = \\phi$ if $v \\not= w$, and\n- $f_p(x) = y$ for some $x \\in C_v$ and for some $y \\in C_w$ if and only if $x = y$ and $v = w$.\n\nTo prove that $D$ has a twelve-fold symmetry, we will then prove that for every $x \\in \\mathcal{V}$, there exists a $y \\in \\mathcal{V}$ such that $x R y$. ${pf}$\n{{qed}}\n-/\ntheorem rhombic_dodecahedron_12_fold_symmetry : \u2203 f : perm (fin 12) \u2192 perm (fin 12), \u2200 x : fin 12, f x = x := sorry\n\nend\n\n--OUTPUT 3\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  -- Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$.\n  assume A : set (euclidean_space \u211d (fin n)),\n  assume h1 : is_open A,\n  assume h2 : \u2200 x : euclidean_space \u211d (fin n), \u2203 U \u2208 A, x \u2208 U,\n\n  -- We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$. \n  let C1 : set (euclidean_space \u211d (fin n)) := {B : set (euclidean_space \u211d (fin n)) | \u2203 (b : euclidean_space \u211d (fin n)) (m : \u211d), \n    is_open B \u2227 is_ball \u211d \u211d ((b : euclidean_space \u211d (fin n)).to_fun) m \u2227 \u22c2 (x : euclidean_space \u211d (fin n)) (h3 : x \u2208 B), \n    \u2203 (U : euclidean_space \u211d (fin n)) (h4 : U \u2208 A) (h5 : x \u2208 U), B \u2286 U},\n  have h3 : \u2200 B : set (euclidean_space \u211d (fin n)), \u2203 B : set (euclidean_space \u211d (fin n)) (m : \u211d), \n    is_open B \u2227 is_ball \u211d \u211d (0 : \u211d^(fin n)) m \u2227 \u22c2 (x : euclidean_space \u211d (fin n)) (h3 : x \u2208 B), \n    \u2203 (U : euclidean_space \u211d (fin n)) (h4 : U \u2208 A) (h5 : x \u2208 U), B \u2286 U, from by {\n      assume B : set (euclidean_space \u211d (fin n)),\n      have h4 : \u2203 U \u2208 A, B \u2286 U, from by {\n        have h5 : \u2205 \u2208 A, from by {\n          by_contradiction h6,\n          have h7 : \u2203 x : euclidean_space \u211d (fin n), x \u2209 A, from by {\n            let f : \u2115 \u2192 (euclidean_space \u211d (fin n)), from by {\n              assume z : \u2115,\n              use (z : \u211d) 0,\n            },\n            have h8 : \u2200 (z : \u2115) (h9 : z \u2208 f \u207b\u00b9' A), false, from by {\n              assume (z : \u2115) (h9 : z \u2208 f \u207b\u00b9' A),\n              have h10 : f z \u2208 A, from by  {\n                simp at h9,\n                exact h9,\n              },\n              have h11 : (0 : \u211d) 0 \u2208 A, from by {\n                simp at h10,\n                exact h10,\n              },\n              have h12 : \u2203 U \u2208 A, (0 : \u211d) 0 \u2208 U, from by {\n                have h13 : \u2203 U \u2208 A, (0 : \u211d) 0 \u2208 U, from by {\n                  assume h14,\n                  have h15 : (0 : \u211d) 0 \u2209 A, from by {\n                    assume h16,\n                    have h17 : \u2205 \u2208 A, from by {\n                      apply set.subset.subset_singleton,\n                      assume x : euclidean_space \u211d (fin n),\n                      assume h18 : x \u2208 \u2205,\n                      exact h16,\n                    },\n                    show false, from h14 h17,\n                  },\n                  show false, from h15 h16,\n                },\n                show \u2203 U \u2208 A, (0 : \u211d) 0 \u2208 U, from h13,\n              },\n              rw show (0 : \u211d) 0 = f z, from rfl,\n              exact h12,\n            },\n            have h14 : f '' A = \u2205, from by {\n              apply set.subset.antisymm,\n              {\n                assume x : \u2115,\n                assume h15 : x \u2208 f '' A,\n                show false, from h8 x h15,\n              },\n              {\n                assume x : \u2115,\n                assume h15 : x \u2208 f '' A,\n                show false, from h8 x h15,\n              },\n            },\n            have h16 : A \u2260 \u2205, from by {\n              assume h17,\n              have h18 : \u2205 = f ''  A, from by {\n                rw show \u2205 = f '' A, from eq.symm h17,\n              },\n              show false, from h14 h18,\n            },\n            show \u2203 x : euclidean_space \u211d (fin n), x \u2209 A, from \u27e8f 0,h16\u27e9,\n          },\n          have h8 : \u2205 \u2209 A, from by {\n            assume h9,\n            show false, from h5 h9,\n          },\n          exact h8,\n        },\n        have h6 : \u2203 (U : euclidean_space \u211d (fin n)) (h7 : U \u2208 A), \u2205 \u2286 U, from \u27e8h5,univ_subset_iff.mpr (\u03bb x, true.intro)\u27e9,\n        exact h6,\n      },\n      let d : \u211d, from by {\n        have h7 : \u2203 d : \u211d, \u2200 (x : \u211d) (h8 : x \u2208 B), d < dist x 0, from by {\n          have h9 : \u2203 (x : \u211d) (h10 : x \u2208 B), d < dist x 0, from by {\n            have h11 : \u2203 (x : \u211d) (h12 : x \u2208 B), d < dist x 0, from by {\n              have h13 : \u2203 (x : \u211d) (h14 : x \u2208 B), dist x 0 < d + 1, from by {\n                let f : (euclidean_space \u211d (fin n)) \u2192 \u211d, from by {\n                  assume x : euclidean_space \u211d (fin n),\n                  use x.to_fun.sum,\n                },\n                have h16 : \u2200 (g : (euclidean_space \u211d (fin n)) \u2192 \u211d), \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                  assume (g : (euclidean_space \u211d (fin n)) \u2192 \u211d),\n                  have h17 : \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                    have h18 : \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                      have h19 : \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                        have h21 : \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                          have h23 : \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                            have h24 : \u2203 (x : \u211d) (h15 : x \u2208 B), dist x 0 < d + 1, from by {\n                              use f 0,\n                              have h25 : \u2203 (U : euclidean_space \u211d (fin n)) (h26 : U \u2208 A) (h27 : f 0 \u2208 U), B \u2286 U, from by {\n                                use h4.left,\n                                use h4.right.left,\n                                use h4.right.right.left,\n                                use h4.right.right.right,\n                              },\n                              have h28 : f 0 \u2208 B, from by {\n                                simp at h25,\n                                exact h25,\n                              },\nend --Needs more than 2000 tokens!\n\n--OUTPUT 4\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  let A := \u03bb x : fin n, Ioo x x,\n  let K := \u03bb m : \u2115, { x : fin n | 0 \u2264 (fintype.card x).val \u2227 (fintype.card x).val < m+1},\n  \n  have memA_K : \u2200 m : \u2115, A (K m) \u2208 \ud835\udcdd (0 : fin n), from \n    by {\n      assume (m : \u2115),\n      use (\u03bb x : fin n, x \u2208 K m),\n      exact \u27e8by obviously, by obviously\u27e9,\n    },\n  \n  have emptyset_in_memA : \u2205 \u2208 A \u2205, from begin\n    use (\u03bb x : fin n, x = 0),\n    have h1 : (\u03bb x : fin n, x = 0) 0 = tt, from by obviously,\n    have h2 : (\u03bb x : fin n, x = 0) 0 \u2208 \ud835\udcdd 0, from by {\n      use (\u03bb x : fin n, x = 0),\n      show \u2200 x, x = 0 \u2192 x \u2208 \ud835\udcdd 0, from id,\n      exact \u27e8by obviously, by obviously\u27e9,\n    },\n    exact \u27e8h1, h2\u27e9,\n  end,\n  \n  have set_emptyset_in_memA_in_Km : \u2200 m : \u2115, (A \u2205) \u2229 K m = \u2205, from by {\n    assume (m : \u2115),\n    show (A \u2205) \u2229 K m = \u2205, from begin\n      rw set.inter_eq_self_of_subset_left,\n      rw set.inter_eq_self_of_subset_left,\n      intro x,\n      exact \u27e8assume h1, fintype.card_pos_iff.mpr h1.right.left, assume h2, h2.elim $ by {unfold_coes \u2205, apply empty_ne_univ}\u27e9,\n    end \n  },\n\n  have memA_Km_in_Km : \u2200 m : \u2115, A (K m) \u2208 A (K m), from by {\n    assume m,\n    show A (K m) \u2208 A (K m), from begin\n      use (\u03bb x : fin n, x \u2208 K m),\n      have h1 : (\u03bb x : fin n, x \u2208 K m) \u2208 \ud835\udcdd (K m), from by {\n        use (\u03bb x : fin n, x \u2208 K m),\n        show \u2200 x, x \u2208 K m \u2192 x \u2208 \ud835\udcdd (K m), from by assume x h1, from memA_K m,\n        exact \u27e8by obviously, by obviously\u27e9\n      },\n      exact \u27e8by obviously, h1\u27e9\n    end \n  },\n  \n  show paracompact_space (euclidean_space \u211d (fin n)), from paracompact_space.intro \u27e8emptyset_in_memA, set_emptyset_in_memA_in_Km, memA_Km_in_Km\u27e9,\nend\n\n--OUTPUT 5\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n\n/-\n  -- Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$. \n  assume \ud835\udc9c : opens (euclidean_space \u211d (fin n)), \n  -- We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$.\n  have h1 : \u2203 \ud835\udc9e : opens (euclidean_space \u211d (fin n)), euclidean_space \u211d (fin n).is_open_cover \ud835\udc9e \u2227\n  -- refinement\n  euclidean_space \u211d (fin n).is_open_refinement \ud835\udc9c \ud835\udc9e \u2227\n  -- locally finite\n  locally_finite_family \ud835\udc9e \u2227\n  -- covers $\\mathbb{R}^n$\n  euclidean_space \u211d (fin n).is_open_cover \ud835\udc9e,\n  from\n  begin\n    have h2 : \u2203! (B\u2080 : opens (euclidean_space \u211d (fin n))), B\u2080 = \u2205, from\n      by {use (\u2205 : opens (euclidean_space \u211d (fin n))),\n        obviously, obviously,},\n    let B\u2080 := classical.some h2, \n    have h3 : B\u2080 = \u2205, from classical.some_spec (exists_unique.exists h2),\n\n    -- Given $m$, set $\\Bar{B_m}$ is compact in $\\mathbb{R}^n$ by the Heine-Borel theorem, so choose finitely many elements of $\\mathcal{A}$ that cover $\\Bar{B_m}$ and intersect each one with the open set $\\mathbb{R}^n \\setminus \\Bar{B_{m - 1}}$, and let $\\mathcal{C}_{m}$ denote this collection of open sets (each an open subset of an element of $\\mathcal{A}$).\n    have h4 : \u2200 (m : \u2115), \u2203 \u2203 (Cm : opens (euclidean_space \u211d (fin n))),\n    have h5 : \u2203 \u2203 (Cm : opens (euclidean_space \u211d (fin n))),\n      euclidean_space \u211d (fin n).is_open_refinement \u2205 Cm \u2227\n      euclidean_space \u211d (fin n).is_open_refinement \ud835\udc9c Cm \u2227\n      \u2203 (m : \u2115), \n      comp \ud835\udc9c Cm \u2227\n      is_compact (euclidean_space \u211d (fin n) \u222a \ud835\udc9c \u222a \u2205 \u222a Cm),\n      from \n      begin\n        use B\u2080, \n        obviously, obviously, \n        have h6 : \ud835\udc9c = (\u2205 : opens (euclidean_space \u211d (fin n))), from \ud835\udc9c,\n        split,\n        obviously, obviously, \n        obviously, obviously, \n        obviously, obviously, \n        obviously, obviously, \n        obviously, obviously, \n        obviously, obviously, \n      end,\n  end,\n-/\nend\n\n--OUTPUT 6\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  -- Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$\n  assume (h : open_cover (euclidean_space \u211d (fin n))) (U : set (euclidean_space \u211d (fin n))),\n  have h1 : \u2203 (A : set (fin n \u2192 \u211d)), open_cover A, from h,\n  have h2 : \u2203 (A : set (fin n \u2192 \u211d)), is_open A \u2227 (\u2200 (x : fin n \u2192 \u211d), x \u2208 U \u2192 \u2203 (a \u2208 A), x \u2208 a), from h1,\n  have h3 : \u2203 (A : set (fin n \u2192 \u211d)), (\u2200 (x : fin n \u2192 \u211d), x \u2208 U \u2192 \u2203 (a \u2208 A), x \u2208 a), from h2.left,\n\n  -- We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$\n  -- First, we define a collection of pen balls.\n  -- Let $B_0 = \\phi$, and for each $n \\in \\mathbb{N}$, let $B_m$ denote the ball of radius $m$\n  -- centered at 0.\n  have h4 : \u2200 (m : \u2115), \u2203 (Bm : set (fin n \u2192 \u211d)), (\u2200 (x : fin n \u2192 \u211d), (\u2203 (a \u2208 Bm), x \u2208 a) \u2194 \u2200 (y : fin n \u2192 \u211d), dist x y < m), from\n    by {\n      assume (m : \u2115),\n      use {x | \u2200 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m},\n      assume (x : fin n \u2192 \u211d) (h : (\u2203 (a \u2208 {x | \u2200 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m}), x \u2208 a) \u2194\n        \u2200 (y : fin n \u2192 \u211d), dist x y < m),\n      split,\n      assume h1 : \u2203 (a \u2208 {x | \u2200 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m}), x \u2208 a,\n      assume (y : fin n \u2192 \u211d),\n      --have h2 : \u2200 (y : fin n \u2192 \u211d), dist x y < m \u2194 \u2211 i, (x i - y i) ^ 2 = m, from cauchy_swartz_squared,\n      have h2 : dist x y < m \u2194 \u2211 i, (x i - y i) ^ 2 = m, from cauchy_swartz_squared,\n      have h3 : dist x y < m \u2194 \u2211 i, (x i - y i) ^ 2 < m, from by ring,\n      have h4 : dist x y < m \u2194 \u2211 i, (x i - y i) ^ 2 < m \u2194 x \u2208 {x | \u2200 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m},\n        from h,\n      rw [h4,h1.right],\n      assume h1 : \u2200 (y : fin n \u2192 \u211d), dist x y < m,\n      rw h,\n      rw h1,\n      split,\n      exact set.mem_set_of_eq (eq.symm (dist_self x)),\n      assume (y : fin n \u2192 \u211d),\n      rw eq.symm (dist_self x),\n      rw h1,\n      exact eq.symm (dist_self x),\n    },\n\n  -- Given $m$, set $\\Bar{B_m}$ is compact in $\\mathbb{R}^n$ by the Heine-Borel theorem, so choose finitely many elements of $\\mathcal{A}$ that cover $\\Bar{B_m}$\n  -- and intersect each one with the open set $\\mathbb{R}^n \\setminus \\Bar{B_{m - 1}}$, and let $\\mathcal{C}_{m}$ denote this collection of open sets (each an open subset of an element of $\\mathcal{A}$).\n  have h5 : \u2200 (m : \u2115), \u2203 (Cm : set (fin n \u2192 \u211d)), (\u2200 (x : fin n \u2192 \u211d), (\u2203 (a \u2208 Cm), x \u2208 a) \u2194 \u2200 (y : fin n \u2192 \u211d), dist x y < m) \u2227 (\u2200 (x : fin n \u2192 \u211d), \u2203 (z \u2208 Cm), x \u2208 z \u2194 x \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m}),\n    from by {\n      assume (m : \u2115),\n      have h6 : \u2203 (Bm : set (fin n \u2192 \u211d)), (\u2200 (x : fin n \u2192 \u211d), (\u2203 (a \u2208 Bm), x \u2208 a) \u2194 \u2200 (y : fin n \u2192 \u211d), dist x y < m), from h4 m,\n      have h7 : \u2203 (Bm : set (fin n \u2192 \u211d)), (\u2200 (x : fin n \u2192 \u211d), \u2203 (z \u2208 Bm), x \u2208 z \u2194 x \u2208 {x | \u2200 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m}), from by {exact subset_finite_intersection_union (h6.left) (h3.left.left)},\n      -- use A \u2229 B\n      use {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m} \u2229 {x | \u2200 (y : fin n \u2192 \u211d), dist x y < m},\n      -- split\n      split,\n      assume (x : fin n \u2192 \u211d) (h : (\u2203 (a \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m} \u2229 {x | \u2200 (y : fin n \u2192 \u211d), dist x y < m}), x \u2208 a) \u2194 \u2200 (y : fin n \u2192 \u211d), dist x y < m),\n        by {\n          split,\n          assume h1 : \u2203 (a \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m} \u2229 {x | \u2200 (y : fin n \u2192 \u211d), dist x y < m}), x \u2208 a,\n          rw h,\n          rw h6,\n          rw h1.right,\n          assume h1 : \u2200 (y : fin n \u2192 \u211d), dist x y < m,\n          rw h,\n          rw h6,\n          rw h1,\n          exact set.mem_set_of_eq (eq.symm (dist_self x)),\n        },\n      assume (x : fin n \u2192 \u211d) (h : \u2203 (z \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m} \u2229 {x | \u2200 (y : fin n \u2192 \u211d), dist x y < m}), x \u2208 z \u2194 x \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m}),\n        by {\n          split,\n          assume h1 : \u2203 (z \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i, (x i - y i) ^ 2 =  m} \u2229 {x | \u2200 (y : fin n \u2192 \u211d), dist x y < m}), x \u2208 z,\n          rw h3,\n          rw h,\n          rw h1.right,\n          rw set.inter_def,\n          assume h1 : x \u2208 {x | \u2203 (y : fin n \u2192 \u211d), \u2211 i\nend --Needs more than 2000 tokens!\n\n--OUTPUT 7\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) := \nbegin\n  assume A : set (euclidean_space \u211d (fin n)),\n  assume ha : (is_open_set_cover A),\n\n  have h1 : \u2200 m : \u2115, \u2200 x : \u211d, \u2203! n : \u2115, \u2200 j : \u2115, n \u2264 j \u2192 \u2225x - 0\u2225 < j := \n    assume m : \u2115, assume x : \u211d, exists_unique.intro m \n    (exists_unique.intro (le_of_lt (lt_add_one (abs x))) \n    (exists_unique.intro rfl rfl)),\n\n  let B_0 := {0 : \u211d^(fin n)}, \n  let B_m : \u2115 \u2192 set (euclidean_space \u211d (fin n)) := assume m : \u2115, \n    {x : \u211d^(fin n) | \u2203 y : \u211d, \u2203 m' : \u2115, \u2225y\u2225 = \u2225x\u2225 \u2227 y \u2208 B(0,m) \u2227 m' = m \u2227 m' \u2264 m + 1 \u2227 \u2225y\u2225 < m'},\n  let Bar_B_m_n : set (euclidean_space \u211d (fin n)) := \u03bb m : \u2115, closure (B_m m),\n  let Bar_B_m_n_plus_1 : set (euclidean_space \u211d (fin n)) := \u03bb m : \u2115, closure (B_m (m+1)),\n  let C_m_n : set (euclidean_space \u211d (fin n)) := \u03bb m : \u2115, {(X \u2229 (univ \\ Bar_B_m_n m)) | X \u2208 A \u2227 X \u2286 (univ \\ Bar_B_m_n_plus_1 m)},\n  have h2 : \u2200 m : \u2115, \u2203 C : set (euclidean_space \u211d (fin n)), is_cover C A \u2227 is_locally_finite C := \n    assume m : \u2115, let p := closure (B_m (m+1)) in exists.intro (\u03bb m : \u2115, {(X \u2229 (univ \\ Bar_B_m_n m)) | X \u2208 A \u2227 X \u2286 (univ \\ p)}) \n    (and.intro (is_cover_of_subcover (\u03bb m : \u2115, {(X \u2229 (univ \\ Bar_B_m_n m)) | X \u2208 A \u2227 X \u2286 (univ \\ p)}) (\u03bb m : \u2115, (\u03bb X : set (euclidean_space \u211d (fin n)), (X \u2229 (univ \\ Bar_B_m_n m)) \u2208 A \u2227 (X \u2229 (univ \\ Bar_B_m_n m)) \u2286 (univ \\ p)) A)) (show is_locally_finite (\u03bb m : \u2115, {(X \u2229 (univ \\ Bar_B_m_n m)) | X \u2208 A \u2227 X \u2286 (univ \\ p)}), from \n    (is_locally_finite_inter_compact_open (\u03bb m : \u2115, {(X \u2229 (univ \\ Bar_B_m_n m)) | X \u2208 A \u2227 X \u2286 (univ \\ p)}) (is_locally_finite_of_subcover (\u03bb m : \u2115, {(X \u2229 (univ \\ Bar_B_m_n m)) | X \u2208 A \u2227 X \u2286 (univ \\ p)}) (\u03bb m : \u2115, {X \u2208 A | X \u2286 (univ \\ p)}) (is_cover_of_subcover (\u03bb m : \u2115, {X \u2208 A | X \u2286 (univ \\ p)}) (\u03bb m : \u2115, {X \u2208 A | X \u2286 (univ \\ p)} A)) (\u03bb m : \u2115, is_open_set.inter_open_set (is_open_set.univ) (is_open_set_set.diff (is_open_set.univ) (B_m (m+1))))) (show is_compact_set (\u03bb m : \u2115, closure (B_m (m+1))), from \n      is_compact_set_union (is_compact_set (closure (B_m 0))) (show is_compact_set (\u03bb m : \u2115, closure (B_m (m + 1))), from \n        @is_compact_iff_closed_of_heine_borel_is_closed_of_uniform_continuity_of_order_is_compact_of_iota_nat_is_order (\u03bb m : \u2115, closure (B_m (m + 1))) (is_compact_set (closure (B_m 0)))) (is_closed_set_closure (B_m 0)) (show \u2200 m : \u2115, is_closed_set (closure (B_m (m + 1))), from \n        assume m : \u2115, is_closed_set_closure (B_m (m+1))) (show \u2200 m : \u2115, continuous (\u03bb x : \u211d^(fin n), (\u03bb m : \u2115, closure (B_m m)) (m + 1)) x, from \n        assume m : \u2115, continuous_at_continuous_on_of_continuous_on_subset (by {apply continuous_closure_of_ball_at_point,} ) (show continuous_on (B_m (m + 1)) (\u03bb x : \u211d^(fin n), (\u03bb m : \u2115, closure (B_m m)) (m + 1)), from \n        continuous_on_const)) (show uniform_continuity_on (\u03bb x : \u211d^(fin n), (\u03bb m : \u2115, closure (B_m m)) (m + 1)) (closure (B_m 0)), from \n       uniform_continuity_on_of_uniform_continuity_of_subset_of_subset (show uniform_continuity (\u03bb x : \u211d^(fin n), (\u03bb m : \u2115, closure (B_m m)) (m + 1)), from \n        (uniform_continuous_on.const (\u03bb m : \u2115, closure (B_m m))).comp (uniform_continuous_on.fst (by {apply uniform_continuous_on_nat,}) (show uniform_continuous_on (\u03bb n : \u2115, closure (B_m (n + 1))) (\u03bb n : \u2115, n + 1), from \n        continuous_on.comp (uniform_continuous_on.id (univ)) (show continuous_on (univ) (\u03bb x : \u2115, x + 1), from \n        continuous_on_add_one)))) (show (\u03bb x : \u211d^(fin n), (\u03bb m : \u2115, closure (B_m m)) (m + 1)) '' closure (B_m 0) \u2286 closure (B_m 0), from by {apply image_subset_closure,} ) (show \u2200 x : \u211d^(fin n), (\u03bb m : \u2115, closure (B_m m)) (m + 1) x \u2208 closure (B_m 0), from \n        assume x : \u211d^(fin n), by {apply closure_mono, rw iota_succ, apply set.mem_union_left,} )) (is_order_nat (\u03bb m : \u2115, closure (B_m m))))) (is_order_nat (\u03bb m : \u2115, B_m (m + 1))) (show \u2200 n x : \u2115, B_m (n + 1) x \u27f6 B_m (n + 1) x, from \n        assume n x : \u2115, trivial) (show \u2200 n x : \u2115, classically (\u2200 m : \u2115, (\u03bb m : \u2115, closure (B_m m)) m x \u27f6 (\u03bb m : \u2115, closure (B_m m)) (m + 1) x), from \n        assume n x :\nend --Needs more than 2000 tokens!\n\n--OUTPUT 8\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  -- Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$.\n  assume (U : set (euclidean_space \u211d (fin n))),\n  assume (hU : is_open_cover U),\n\n  -- We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$. \n  show \u2203 (W : set (euclidean_space \u211d (fin n))), is_open_cover W \u2227 is_locally_finite W, from\n  begin \n    let W := set.univ,\n    have hW : is_open_cover W, by obviously,\n    have hW' : is_locally_finite W, by {sorry},\n    have hW'' : W \u2286 U, by obviously,\n    have hW_is_refinement : is_refinement W U, from is_refinement_intro hW'' hW,\n\n    have hW'_is_refinement : is_refinement W U \u2227 is_locally_finite W, from \u27e8hW_is_refinement,hW'\u27e9,\n    show is_locally_finite W \u2227 \u2203 V : set (euclidean_space \u211d (fin n)), is_open_cover V \u2227 is_refinement W V, from hW'_is_refinement,\n  end,\nend\n\n--OUTPUT 9\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) := \nbegin\n  /-\n    Part 1:\n    Goal: For any $x \\in \\mathbb{R}^n$, construct a ball around it.\n  -/\n  -- Let $x$ be a variable we chose from $\\mathbb{R}^n$\n  variable x : euclidean_space \u211d (fin n),\n  -- Let $B_0$ be empty set\n  def B_0 := \u2205,\n  -- Construct a ball centered at 0 with radius $m$\n  def B_m : set (euclidean_space \u211d (fin n)) := {y : euclidean_space \u211d (fin n) | \u2225y - 0\u2225 \u2264 (\u2191m : \u211d) },\n  -- Let $B_m$ be compact in $\\mathbb{R}^n$, by Heine-Borel Theorem\n  def Bar_B_m : compact_space (euclidean_space \u211d (fin n)) := by apply_instance,\n  -- Let $\\{B_m\\}$ be the collection of all balls centered at 0 with radius $m \\in \\mathbb{N}$ \n  def f : \u2115 \u2192 set (euclidean_space \u211d (fin n)) := \u03bb (m : \u2115), B_m,\n\n  /-\n    Part 2:\n    Goal: construct a nested collection of sets.\n    Let $B_0 = \\phi$ be empty set\n  -/\n  have h1 : B_0 \u222a (B_1 \\ B_0) = B_1, from by obviously,\n  have h2 : B_1 \u222a (B_2 \\ B_1) = B_2, from by obviously,\n  have h3 : B_2 \u222a (B_3 \\ B_2) = B_3, from by obviously,\n  have h4 : B_3 \u222a (B_4 \\ B_3) = B_4, from by obviously,  \n  have h5 : B_4 \u222a (B_5 \\ B_4) = B_5, from by obviously, \n  -- ... and for any other $B_m, m \\in \\mathbb{N}$, we have this sequence\n  have h6 : B_m \u222a (B_{m+1} \\ B_m) = B_{m+1}, from by obviously,\n  -- Let $C_0$ be empty set\n  def C_0 := \u2205,\n  /-\n    Construct all $C_m$ as follows.\n    We have $C_m$ to be the ball centered at 0 with radius $m$ and an open set in $\\mathbb{R}^n$\n  -/\n  def C_m : set (euclidean_space \u211d (fin n)) := {y : euclidean_space \u211d (fin n) | (\u2225y - 0\u2225 \u2264 (m : \u211d)) \u2227 (y \u2208 set.univ)}, \n  -- Let $\\{C_m\\}$ be the collection of all $C_m$ for any $m \\in \\mathbb{N}$ \n  def g : \u2115 \u2192 set (euclidean_space \u211d (fin n)) := \u03bb (m : \u2115), C_m,\n  -- Hence we have a nested sequence of open sets.\n  have h7 : B_0 \u2282 B_1, from by rw [set.subset_empty_iff],\n  have h8 : B_1 \u2282 B_2, from by rw [set.subset_empty_iff],\n  have h9 : B_2 \u2282 B_3, from by rw [set.subset_empty_iff],\n  have h10 : B_3 \u2282 B_4, from by rw [set.subset_empty_iff],\n  have h11 : B_4 \u2282 B_5, from by rw [set.subset_empty_iff],\n  -- ... and for any other $B_m, m \\in \\mathbb{N}$, we have this sequence\n  have h12 : B_m \u2282 B_{m+1}, from by rw [set.subset_empty_iff],\n\n  /-\n    Part 3:\n    Goal: Give the open cover $\\mathcal{A}$, and construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$.\n    Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$\n  -/\n  variable A : set (set (euclidean_space \u211d (fin n))),\n  -- $\\mathcal{A}$ is an open covering of $\\mathbb{R}^n$\n  assume hA : is_open_cover (euclidean_space \u211d (fin n)) A,\n  -- By Heine-Borel theorem, $\\Bar{B_m}$ is compact in $\\mathbb{R}^n$\n  -- Hence we pick finitely many elements of $\\mathcal{A}$ that cover $\\Bar{B_m}$\n  have h13 : \u2203 (F : set (set (euclidean_space \u211d (fin n)))), (F \u2286 A) \u2227 is_open_cover (euclidean_space \u211d (fin n)) F \u2227 compact_space.compact (euclidean_space \u211d (fin n)) F,\n     from compact_space.exists_finite_open_cover Bar_B_m (by {apply_instance}),\n  -- and intersect each one with the open set $\\mathbb{R}^n \\setminus \\Bar{B_{m - 1}}$\n  -- Let $C_m$ denote this collection of open sets (each an open subset of an element of $\\mathcal{A}$)\n  have h14 : \u2203 (C_m : set (set (euclidean_space \u211d (fin n)))), (C_m \u2286 A) \u2227 is_open_cover (euclidean_space \u211d (fin n)) C_m \u2227 (\u2200 (x : euclidean_space \u211d (fin n)), x \u2208 \u22c3\u2080 C_m \u2192 (x \u2208 B_m) \u2192 (x \u2209 Bar_B_m)) \u2227 (\u2200 (x : euclidean_space \u211d (fin n)), x \u2208 \u22c3\u2080 C_m \u2192 (x \u2209 B_m) \u2192 (x \u2208 Bar_B_m)), \n    from exists.elim h13\n    (assume (F : set (set (euclidean_space \u211d (fin n)))),\n     assume (h15 : (F \u2286 A) \u2227 is_open_cover (euclidean_space \u211d (fin n)) F \u2227 compact_space.compact (euclidean_space \u211d (fin n)) F),\n     assume (h16 : (\u2200 (x : euclidean_space \u211d (fin n)), x \u2208 \u22c3\u2080 F \u2192 (\u2203 (A : set (euclidean_space \u211d (fin n))), (A \u2208 F) \u2227 (x \u2208 A)))),\n     use {U : set (euclidean_space \u211d (fin n)) | (U \u2208 F) \u2227 (U \u2286 B_m)},\n     show (\u2203 (C_m : set (set (euclidean_space \u211d (fin n)))), (C_m \u2286 A) \u2227 is_open_cover (euclidean_space \u211d (fin n)) C_m \u2227 (\u2200 (x : euclidean_space \u211d (fin n)), x \u2208 \u22c3\u2080 C_m \u2192 (x \u2208 B_m) \u2192 (x \u2209 Bar_B_m)) \u2227 (\u2200 (x : euclidean_space \u211d (fin n)), x \u2208 \u22c3\u2080 C_m \u2192 (x \u2209 B_m) \u2192 (x \u2208 Bar_B_m))), from\n     and.intro \n     (and.intro (by obviously) \n                (and.intro (by {rw [set.forall_mem_iff],\n                             intros j jmem,\n                             simp [set.mem_\nend --Needs more than 2000 tokens!\n\n--OUTPUT 10\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  -- Let $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$. We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$. First, we define a collection of pen balls. Let $B_0 = \\phi$, and for each $n \\in \\mathbb{N}$, let $B_m$ denote the ball of radius $m$\n  -- centered at 0. \n  fix (A : set (euclidean_space \u211d (fin n))) (hA : is_open A) (hA_cover : \u2200 p \u2208 \ud835\udd5c, \u2203 U \u2208 A, p \u2208 U),\n\n  let Bm := ball n 0 m,\n  let j : \u2115 \u2192 set (euclidean_space \u211d (fin n)) := \u03bb i, Bm \u2293 A,\n  let \u03a0m := (\u2200 U \u2208 j m, \u2200 V \u2208 j m, V \u2260 U \u2192 V \u2229 U \u2260 \u2205 \u2192 \u2203 W \u2208 A, W \u2286 U \u2229 V),\n  let \u27e8U, hU\u27e9 := exists_is_open_ball 0 m,\n\n  have h1 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) < m, from begin\n    assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n    by {\n      unfold U Bm T,\n      unfold ball,\n      simp,\n      assume hmx,\n      exact lt_add_of_pos_of_le (show 0 < m, from nat.pos_of_ne_zero H) hmx,\n    }\n  end,\n\n  have h2 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Bm \u2192 x \u2208 U, from begin\n    assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 Bm),\n    show x \u2208 U, by {\n      unfold U Bm T,\n      unfold ball,\n      simp,\n      assume hmx,\n      exact le_add_of_nonneg_of_le hmx (show 0 \u2264 m, from nat.zero_le _),\n    },\n  end,\n\n  have h3 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 x \u2208 Bm, from begin\n    assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n    have h4 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) < m, from h1 x hx,\n    have h5 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) \u2264 m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) \u2264 m, from le_of_lt (h1 x hx),\n    end,\n    have h6 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) = m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) = m, from eq_of_le_of_ge (h5 x hx) (h5 x hx),\n    end,\n    have h7 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Bm \u2192 T(x) \u2264 m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 Bm),\n      unfold Bm T,\n      unfold ball,\n      simp,\n      assume hmx,\n      exact le_add_of_nonneg_of_le hmx (show 0 \u2264 m, from nat.zero_le _),\n    end,\n    have h8 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Bm \u2192 T(x) = m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 Bm),\n      show T(x) = m, from eq_of_le_of_ge (h7 x hx) (h7 x hx),\n    end,\n    have h9 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) \u2264 m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) \u2264 m, from eq.symm (h6 x hx) \u25b8 (h7 x hx) ,\n    end,\n    have h10 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) = m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) = m, from eq_of_le_of_ge (h9 x hx) (h9 x hx),\n    end,\n    show x \u2208 Bm, from begin\n      unfold Bm T,\n      unfold ball,\n      simp,\n      assume hmx,\n      exact eq.symm (h10 x hx) \u25b8 hmx,\n    end,\n  end,\n\n  have h4 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Bm \u2192 x \u2208 U, from begin\n    assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 Bm),\n    have h5 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) < m, from h1 x hx,\n    have h6 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) \u2264 m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) \u2264 m, from le_of_lt (h1 x hx),\n    end,\n    have h7 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) = m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) = m, from eq_of_le_of_ge (h6 x hx) (h6 x hx),\n    end,\n    have h8 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Bm \u2192 T(x) \u2264 m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 Bm),\n      unfold Bm T,\n      unfold ball,\n      simp,\n      assume hmx,\n      exact le_add_of_nonneg_of_le hmx (show 0 \u2264 m, from nat.zero_le _),\n    end,\n    have h9 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Bm \u2192 T(x) = m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 Bm),\n      show T(x) = m, from eq_of_le_of_ge (h8 x hx) (h8 x hx),\n    end,\n    have h10 : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U \u2192 T(x) \u2264 m, from begin\n      assume (x : euclidean_space \u211d (fin n)) (hx : x \u2208 U),\n      show T(x) \u2264 m, from eq.symm (h7 x hx) \u25b8 (h8 x hx),\n    end,\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  -- $A$ and $B$ are sets. $A$ and $B$ belong to power set of $S$\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  -- Then $A \u2286 S$ and $B \u2286 S$, by power set definition\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by {split,apply set.subset_of_mem_powerset,exact hA,apply set.subset_of_mem_powerset,exact hB},\n  -- Then $(A \u2229 B) \u2286 A$, by intersection of set is a subset\n  have h2 : (A \u2229 B) \u2286 A, from by apply set.inter_subset_left,\n  -- Then $(A \u2229 B) \u2286 S$, by subset relation is transitive \n  have h3 : (A \u2229 B) \u2286 S, from by {apply set.subset.trans h2 h1.left},\n  -- Hence $(A \u2229 B) \u2208  \ud835\udcab S$, by power set definition\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by {apply set.mem_powerset h3},\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  -- expand the power\n  calc (x + y)^2 = (x+y)*(x+y) : by rw sq\n  -- distributive property of multiplication over addition gives:\n  ... = x*(x+y) + y*(x+y) : by rw add_mul\n  -- applying the above property further gives:\n  ... = x*x + x*y + y*x + y*y : by {rw [mul_comm x (x+y),mul_comm y (x+y)], rw [add_mul,add_mul], ring}\n  -- rearranging the terms using commutativity and adding gives:\n  ... = x^2 + 2*x*y + y^2 : by {repeat {rw \u2190 sq}, rw mul_comm y x, ring}\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  -- Group has Latin Square Property\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by {\n    assume a b : G, use a\u207b\u00b9 * b, obviously, },\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by {\n    assume a b : G, use b * a\u207b\u00b9, obviously, }, \n\n  -- Setting $b = a$, this becomes:\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from \n    assume a : G, h1 a a,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from\n    assume a : G, h2 a a,\n\n  -- These $x$ and $y$ are both $(1 : G)$, by definition of identity element\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from assume a :G,\n    exists_unique.unique (h3 a) (classical.some_spec (exists_unique.exists (h3 a)))\n    (mul_one a),\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from assume a : G,\n    exists_unique.unique (h4 a) (classical.some_spec (exists_unique.exists (h4 a))) (one_mul a), \n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (hident : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a).exists, from assume (a : G),\n        exists_unique.unique (h3 a) (hident a).right\n        (classical.some_spec (exists_unique.exists (h3 a))), \n      have h9 : \u2200 a : G, e = classical.some (h4 a).exists, from assume (a : G),\n        exists_unique.unique (h4 a) (hident a).left\n        (classical.some_spec (exists_unique.exists (h4 a))),\n      show e = (1 : G), from eq.trans (h9 e) (h6 _),     \n    },\n    exact \u27e8by obviously, h7\u27e9,\n  }\nend\n\n/--`theorem`\n\\mathbb{R}^n is paracompact\n$\\mathbb{R}^n$ is paracompact for all $n$.\n`proof`\nLet $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$. We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$. First, we define a collection of pen balls. Let $B_0 = \\phi$, and for each $n \\in \\mathbb{N}$, let $B_m$ denote the ball of radius $m$\ncentered at 0. Given $m$, set $\\Bar{B_m}$ is compact in $\\mathbb{R}^n$ by the Heine-Borel theorem, so choose finitely many elements of $\\mathcal{A}$ that cover $\\Bar{B_m}$ and intersect each one with the open set $\\mathbb{R}^n \\setminus \\Bar{B_{m - 1}}$, and let $\\mathcal{C}_{m}$ denote this collection of open sets (each an open subset of an element of $\\mathcal{A}$). So $\\mathcal{C} = \\bigcup_{m = 0}^{\\infty} \\mathcal{C}_m$ is an open refinement of $\\mathcal{A}$. Note that $\\mathcal{C}$ covers $\\mathbb{R}^n$ since for any $x \\in \\mathbb{R}^n$, there is a smallest $m \\in \\mathbb{N}$ such that $x \\in \\Bar{B_{m}}$ (namely, some $m$ where $\\rVert x \\lVert \\leq m \\leq \\rVert x \\lVert + 1$), and so $x$ is an element of $\\mathcal{C}_m$. Now collection $\\mathcal{C}$ is locally finite since for given $x \\in \\mathbb{R}^n$, neighborhood $B_m$ intersects only finitely many elements of $\\mathcal{C}$, namely those elements in collection $\\mathcal{C}_1 \\cup \\mathcal{C}_2 \\cup \\cdots \\mathcal{C}_m$. So $\\mathcal{C}$ is a locally finite open refinement of $\\mathcal{A}$ that covers $\\mathbb{R}^n$, hence $\\mathbb{R}^n$ is paracompact.\n\nQED\n-/\ntheorem  \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_with_comments-Natural-Language-Proof-Translation/Correct_statement-lean_proof_with_comments-3_few_shot_temperature_0.8_max_tokens_2000_n_10/clean_files/Rn is paracompact.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5195213219520929, "lm_q2_score": 0.36296921930155557, "lm_q1q2_score": 0.18857024863946326}}
{"text": "import for_mathlib.short_complex_projections\nimport for_mathlib.homological_complex_abelian\nimport for_mathlib.homology_map_datum\nimport for_mathlib.abelian_sheaves.functor_category\nimport for_mathlib.short_complex_functor_category\n\nnoncomputable theory\n\nopen category_theory category_theory.category category_theory.limits\nopen_locale zero_object\n\nuniverses v\n\nnamespace short_complex\n\nsection construction\n\nvariables {C : Type*} [category C] [has_zero_morphisms C]\nvariables {J : Type*} [category J] (F : J \u2964 short_complex C)\n  [has_colimit (F \u22d9 \u03c0\u2081)] [has_colimit (F \u22d9 \u03c0\u2082)] [has_colimit (F \u22d9 \u03c0\u2083)]\n\n@[simps]\ndef colimit_cocone.cocone : cocone F :=\n{ X := mk (colim_map (\ud835\udfd9 F \u25eb \u03c6\u2081\u2082)) (colim_map (\ud835\udfd9 F \u25eb \u03c6\u2082\u2083)) begin\n    ext,\n    dsimp,\n    simp only [\u03b9_colim_map_assoc, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app, \u03c0\u2082_map,\n      \u03b9_colim_map, \u03c6\u2082\u2083_app, \u03c0\u2083_map, assoc, comp_zero],\n    erw [composable_morphisms.id_\u03c4\u2082, id_comp, (F.obj j).zero_assoc, zero_comp],\n  end,\n  \u03b9 :=\n    { app := \u03bb j, begin\n        refine \u27e8colimit.\u03b9 (F \u22d9 \u03c0\u2081) j, colimit.\u03b9 (F \u22d9 \u03c0\u2082) j, colimit.\u03b9 (F \u22d9 \u03c0\u2083) j, _, _\u27e9,\n        { dsimp,\n          simp only [\u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app, \u03c0\u2082_map,\n            assoc],\n          erw [composable_morphisms.id_\u03c4\u2082, id_comp], },\n        { dsimp,\n          simp only [\u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2082\u2083_app, nat_trans.id_app, \u03c0\u2083_map,\n            assoc],\n          erw [composable_morphisms.id_\u03c4\u2083, id_comp], },\n      end,\n      naturality' := \u03bb i j f, begin\n        ext,\n        { dsimp, simpa only [comp_id] using colimit.w (F \u22d9 \u03c0\u2081) f, },\n        { dsimp, simpa only [comp_id] using colimit.w (F \u22d9 \u03c0\u2082) f, },\n        { dsimp, simpa only [comp_id] using colimit.w (F \u22d9 \u03c0\u2083) f, },\n      end }, }\n\ndef colimit_cocone : colimit_cocone F :=\n{ cocone := colimit_cocone.cocone F,\n  is_colimit :=\n  { desc := \u03bb s, begin\n      refine \u27e8colimit.desc (F \u22d9 \u03c0\u2081) (\u03c0\u2081.map_cocone s),\n        colimit.desc (F \u22d9 \u03c0\u2082) (\u03c0\u2082.map_cocone s),\n        colimit.desc (F \u22d9 \u03c0\u2083) (\u03c0\u2083.map_cocone s), _, _\u27e9,\n      { ext,\n        dsimp,\n        simp only [\u03b9_colim_map_assoc, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app,\n          \u03c0\u2082_map, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, assoc, colimit.\u03b9_desc_assoc, \u03c0\u2081_map],\n        erw [composable_morphisms.id_\u03c4\u2082, id_comp],\n        exact (s.\u03b9.app j).comm\u2081\u2082, },\n      { ext,\n        dsimp,\n        simp only [\u03b9_colim_map_assoc, nat_trans.hcomp_app, \u03c6\u2082\u2083_app, nat_trans.id_app,\n          \u03c0\u2083_map, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, assoc, colimit.\u03b9_desc_assoc, \u03c0\u2082_map],\n        erw [composable_morphisms.id_\u03c4\u2083, id_comp],\n        exact (s.\u03b9.app j).comm\u2082\u2083, },\n    end,\n    fac' := \u03bb s j, begin\n      ext,\n      { dsimp, simp only [colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2081_map], },\n      { dsimp, simp only [colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2082_map], },\n      { dsimp, simp only [colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2083_map], },\n    end,\n    uniq' := \u03bb s m hm, begin\n      have h\u2081 := \u03bb j, congr_arg (\u03bb (\u03c6 : F.obj j \u27f6 s.X), \u03c0\u2081.map \u03c6) (hm j),\n      have h\u2082 := \u03bb j, congr_arg (\u03bb (\u03c6 : F.obj j \u27f6 s.X), \u03c0\u2082.map \u03c6) (hm j),\n      have h\u2083 := \u03bb j, congr_arg (\u03bb (\u03c6 : F.obj j \u27f6 s.X), \u03c0\u2083.map \u03c6) (hm j),\n      dsimp at h\u2081 h\u2082 h\u2083,\n      ext,\n      { dsimp, simp only [h\u2081, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2081_map], },\n      { dsimp, simp only [h\u2082, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2082_map], },\n      { dsimp, simp only [h\u2083, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2083_map], },\n    end, }, }\n\ninstance : has_colimit F := \u27e8nonempty.intro (colimit_cocone F)\u27e9\n\ndef \u03c0\u2081_preserves_colimit : preserves_colimit F (\u03c0\u2081 : short_complex C \u2964 C) :=\npreserves_colimit_of_preserves_colimit_cocone (colimit_cocone F).is_colimit\n  (is_colimit.of_iso_colimit (get_colimit_cocone (F \u22d9 \u03c0\u2081)).is_colimit\n    (cocones.ext (iso.refl _) (\u03bb j, comp_id _)))\n\ndef \u03c0\u2082_preserves_colimit : preserves_colimit F (\u03c0\u2082 : short_complex C \u2964 C) :=\npreserves_colimit_of_preserves_colimit_cocone (colimit_cocone F).is_colimit\n  (is_colimit.of_iso_colimit (get_colimit_cocone (F \u22d9 \u03c0\u2082)).is_colimit\n    (cocones.ext (iso.refl _) (\u03bb j, comp_id _)))\n\ndef \u03c0\u2083_preserves_colimit : preserves_colimit F (\u03c0\u2083 : short_complex C \u2964 C) :=\npreserves_colimit_of_preserves_colimit_cocone (colimit_cocone F).is_colimit\n  (is_colimit.of_iso_colimit (get_colimit_cocone (F \u22d9 \u03c0\u2083)).is_colimit\n    (cocones.ext (iso.refl _) (\u03bb j, comp_id _)))\n\nend construction\n\nsection preserves\n\nvariables {C : Type*} [category C] [has_zero_morphisms C]\nvariables {J D : Type*} [category J] [category D]\n\ndef \u03c0\u2081\u2082\u2083_reflects_colimits {F : J \u2964 short_complex C} (s : cocone F)\n  (h\u2081 : is_colimit (\u03c0\u2081.map_cocone s)) (h\u2082 : is_colimit (\u03c0\u2082.map_cocone s))\n  (h\u2083 : is_colimit (\u03c0\u2083.map_cocone s)) :\n  is_colimit s :=\nbegin\n  haveI : has_colimit (F \u22d9 \u03c0\u2081) := \u27e8nonempty.intro \u27e8_, h\u2081\u27e9\u27e9,\n  haveI : has_colimit (F \u22d9 \u03c0\u2082) := \u27e8nonempty.intro \u27e8_, h\u2082\u27e9\u27e9,\n  haveI : has_colimit (F \u22d9 \u03c0\u2083) := \u27e8nonempty.intro \u27e8_, h\u2083\u27e9\u27e9,\n  refine is_colimit.of_iso_colimit (colimit_cocone F).is_colimit (cocones.ext _ _),\n  { suffices : is_iso ((colimit_cocone F).is_colimit.desc s),\n    { haveI := this,\n      exact as_iso ((colimit_cocone F).is_colimit.desc s), },\n    apply is_iso_of_is_isos,\n    { exact is_iso.of_iso (is_colimit.cocone_point_unique_up_to_iso (colimit.is_colimit _) h\u2081), },\n    { exact is_iso.of_iso (is_colimit.cocone_point_unique_up_to_iso (colimit.is_colimit _) h\u2082), },\n    { exact is_iso.of_iso (is_colimit.cocone_point_unique_up_to_iso\n        (colimit.is_colimit _) h\u2083), }, },\n  { intro j,\n    simp only [as_iso_hom, is_colimit.fac], },\nend\n\ndef \u03c0\u2081\u2082\u2083_reflect_preserves_colimits (G : J \u2964 D) (F : D \u2964 short_complex C)\n  (h\u2081 : preserves_colimit G (F \u22d9 \u03c0\u2081)) (h\u2082 : preserves_colimit G (F \u22d9 \u03c0\u2082))\n  (h\u2083 : preserves_colimit G (F \u22d9 \u03c0\u2083)) : preserves_colimit G F :=\n\u27e8\u03bb s hs, \u03c0\u2081\u2082\u2083_reflects_colimits _\n  (@is_colimit_of_preserves _ _ _ _ _ _ G (F \u22d9 \u03c0\u2081) _ hs _)\n  (@is_colimit_of_preserves _ _ _ _ _ _ G (F \u22d9 \u03c0\u2082) _ hs _)\n  (@is_colimit_of_preserves _ _ _ _ _ _ G (F \u22d9 \u03c0\u2083) _ hs _)\u27e9\n\nvariable (J)\n\ndef preserves_colimits_of_shape_of_projections (F : D \u2964 short_complex C)\n  (h\u2081 : preserves_colimits_of_shape J (F \u22d9 \u03c0\u2081))\n  (h\u2082 : preserves_colimits_of_shape J (F \u22d9 \u03c0\u2082))\n  (h\u2083 : preserves_colimits_of_shape J (F \u22d9 \u03c0\u2083)) :\n  preserves_colimits_of_shape J F :=\n\u27e8by { intro G, apply \u03c0\u2081\u2082\u2083_reflect_preserves_colimits; apply_instance, }\u27e9\n\nend preserves\n\nsection functor_homological_complex\n\nvariables {C : Type*} [category C] [abelian C]\nvariables {M : Type*} {c : complex_shape M}\nvariables {J : Type*} [category J]\n\ninstance zero_preserves_colimits_of_shape {D : Type*} [category D]:\n  preserves_colimits_of_shape J (0 : D \u2964 C) :=\n\u27e8\u03bb F, \u27e8\u03bb s hs,\n{ desc := \u03bb t, 0,\n  fac' := \u03bb t j, begin\n    dsimp,\n    apply is_zero.eq_of_src,\n    apply is_zero.obj,\n    apply is_zero_zero,\n  end,\n  uniq' := \u03bb t m j, begin\n    dsimp,\n    apply is_zero.eq_of_src,\n    apply is_zero.obj,\n    apply is_zero_zero,\n  end, }\u27e9\u27e9\n\nlemma functor_homological_complex_\u03c0\u2081_iso_eval (i j : M) (hij : c.rel j i) :\n  functor_homological_complex C c i \u22d9 \u03c0\u2081 \u2245 homological_complex.eval C c j :=\nnat_iso.of_components (\u03bb X, X.X_prev_iso hij)\n(\u03bb X Y f, begin\n  dsimp,\n  simp only [homological_complex.hom.prev_eq f hij, assoc, iso.inv_hom_id, comp_id],\nend)\n\nlemma functor_homological_complex_\u03c0\u2083_iso_eval (i j : M) (hij : c.rel i j) :\n  functor_homological_complex C c i \u22d9 \u03c0\u2083 \u2245 homological_complex.eval C c j :=\nnat_iso.of_components (\u03bb X, X.X_next_iso hij)\n(\u03bb X Y f, begin\n  dsimp,\n  simp only [homological_complex.hom.next_eq f hij, assoc, iso.inv_hom_id, comp_id],\nend)\n\ninstance (i : M) [has_colimits_of_shape J C] :\n  preserves_colimits_of_shape J (short_complex.functor_homological_complex C c i) :=\nbegin\n  apply preserves_colimits_of_shape_of_projections;\n  { exact (infer_instance : preserves_colimits_of_shape J (homological_complex.eval C c _)), },\nend\n\nend functor_homological_complex\n\nsection functor_homology\n\nvariables {C : Type*} [category.{v} C] [abelian C]\nvariables {M : Type*} {c : complex_shape M}\n  {J : Type v} [small_category J] [is_filtered J]\n  [has_colimits_of_shape J C]\n  [preserves_finite_limits (limits.colim : (J \u2964 C) \u2964 C)]\n  [preserves_finite_colimits (limits.colim : (J \u2964 C) \u2964 C)]\n\nnamespace homology_functor_preserves_colimit\n\nvariable (F : short_complex (J \u2964 C))\n\ndef iso_datum := homology_iso_datum.tautological' F.1.f F.1.g F.2\n\ninstance (j : J) : preserves_finite_limits ((evaluation J C).obj j) :=\n\u27e8by { intro F, introI, introI, apply_instance, }\u27e9\ninstance (j : J) : preserves_finite_colimits ((evaluation J C).obj j) :=\n\u27e8by { intro F, introI, introI, apply_instance, }\u27e9\ninstance (j : J) : functor.additive ((evaluation J C).obj j) := { }\ninstance colim_additive : functor.additive (colim : (J \u2964 C) \u2964 C) := { }\n\n@[simps]\ndef nat_trans_\u03b9 (j : J) : (evaluation J C).obj j \u27f6 (colim : (J \u2964 C) \u2964 C) :=\n{ app := \u03bb F, colimit.\u03b9 F j,\n  naturality' := \u03bb F\u2081 F\u2082 \u03c6, by { dsimp, simp only [colimit.\u03b9_map], }, }\n\ndef iso_datum\u2081 := (iso_datum F).apply_exact_functor (colim : (J \u2964 C) \u2964 C)\n\ndef F\u2080 := functor_category_equivalence.functor.obj F\n\ndef e\u2081 : (F\u2080 F) \u22d9 homology_functor \u2245 (iso_datum F).H :=\nnat_iso.of_components\n  (\u03bb j, ((iso_datum F).apply_exact_functor ((evaluation J C).obj j)).iso.symm)\n  (\u03bb i j f, begin\n    simp only [functor.comp_map, iso.symm_hom],\n    erw ((iso_datum F).map_nat_trans ((evaluation J C).map f)).homology_map_eq,\n    simpa only [evaluation_map_app, assoc, iso.hom_inv_id, comp_id,\n      iso.cancel_iso_inv_left],\n  end)\n\ndef e\u2082 : colim.map_short_complex.obj F \u2245 (colimit_cocone.cocone (F\u2080 F)).X :=\nbegin\n  refine iso_mk _ _ _ _ _,\n  { refine colim.map_iso (nat_iso.of_components (\u03bb j, iso.refl _) (\u03bb i j f, _)),\n    dsimp, erw [id_comp, comp_id], refl, },\n  { refine colim.map_iso (nat_iso.of_components (\u03bb j, iso.refl _) (\u03bb i j f, _)),\n    dsimp, erw [id_comp, comp_id], refl, },\n  { refine colim.map_iso (nat_iso.of_components (\u03bb j, iso.refl _) (\u03bb i j f, _)),\n    dsimp, erw [id_comp, comp_id], refl, },\n  { ext, dsimp, simp only [colimit.\u03b9_map_assoc, colimit.\u03b9_map, nat_iso.of_components_hom_app,\n      iso.refl_hom, id_comp, \u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app,\n      \u03c0\u2082_map, assoc], erw id_comp, refl, },\n  { ext, dsimp, simp only [colimit.\u03b9_map_assoc, colimit.\u03b9_map, nat_iso.of_components_hom_app,\n      iso.refl_hom, id_comp, \u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2082\u2083_app, nat_trans.id_app,\n      \u03c0\u2083_map, assoc], erw id_comp, refl, },\nend\n\ndef e\u2083 : colimit (F\u2080 F \u22d9 homology_functor) \u2245 (colim.map_short_complex.obj F).homology :=\ncolim.map_iso (e\u2081 F) \u226a\u226b (iso_datum\u2081 F).iso\n\ndef e\u2084 : colimit (F\u2080 F \u22d9 homology_functor) \u2245 (colimit_cocone.cocone (F\u2080 F)).X.homology :=\ne\u2083 F \u226a\u226b homology_functor.map_iso (e\u2082 F)\n\nlemma compatibility (j : J) : (colimit.cocone (F\u2080 F \u22d9 homology_functor)).\u03b9.app j \u226b\n  (e\u2083 F).hom = homology_functor.map ((nat_trans_\u03b9 j).map_short_complex.app F) :=\nbegin\n  rw ((iso_datum F).map_nat_trans (nat_trans_\u03b9 j)).homology_map_eq,\n  dsimp only [e\u2081, e\u2083, iso_datum\u2081, nat_iso.of_components],\n  simpa only [colimit.cocone_\u03b9, iso.trans_hom, functor.map_iso_hom, colimit.\u03b9_map_assoc,\n    iso.symm_hom, nat_trans_\u03b9_app, iso.cancel_iso_hom_right_assoc, iso.cancel_iso_inv_left],\nend\n\nlemma preserves : preserves_colimit (F\u2080 F) short_complex.homology_functor :=\n\u27e8\u03bb s hs, begin\n  have e\u2081 : s \u2245 colimit_cocone.cocone (F\u2080 F),\n  { refine is_initial.unique_up_to_iso _ _,\n    all_goals { equiv_rw (cocone.is_colimit_equiv_is_initial _).symm, },\n    exacts [hs, (colimit_cocone (F\u2080 F)).is_colimit], },\n  suffices : is_colimit (homology_functor.map_cocone (colimit_cocone.cocone (F\u2080 F))),\n  { exact is_colimit.of_iso_colimit this\n      ((cocones.functoriality _ homology_functor).map_iso e\u2081.symm), },\n  clear e\u2081 hs s,\n  refine is_colimit.of_iso_colimit (colimit.is_colimit (F\u2080 F \u22d9 homology_functor))\n     (cocones.ext (e\u2084 F) _),\n  intro j,\n  dsimp only [functor.map_cocone, cocones.functoriality, e\u2084, iso.trans, functor.map_iso],\n  rw [\u2190 assoc, compatibility, \u2190 homology_functor.map_comp],\n  congr' 1,\n  ext1,\n  all_goals\n  { dsimp [e\u2082], simp only [colimit.\u03b9_map, nat_iso.of_components_hom_app,\n      iso.refl_hom, id_comp], },\nend\u27e9\n\nend homology_functor_preserves_colimit\n\ninstance (F\u2080 : J \u2964 short_complex C) : preserves_colimit F\u2080 short_complex.homology_functor :=\nbegin\n  let F := functor_category_equivalence.inverse.obj F\u2080,\n  haveI : preserves_colimit (homology_functor_preserves_colimit.F\u2080 F) homology_functor\n    := homology_functor_preserves_colimit.preserves F,\n  have h : homology_functor_preserves_colimit.F\u2080 F \u2245 F\u2080 :=\n    functor_category_equivalence.counit_iso.app F\u2080,\n  exact preserves_colimit_of_iso_diagram short_complex.homology_functor h,\nend\n\ninstance : preserves_colimits_of_shape J\n  (short_complex.homology_functor : short_complex C \u2964 C) := \u27e8\u03bb F, infer_instance\u27e9\n\nend functor_homology\n\nend short_complex\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/for_mathlib/short_complex_colimits.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.519521321952093, "lm_q2_score": 0.3629692055196168, "lm_q1q2_score": 0.18857024147945226}}
{"text": "import Lean.Meta\n\nsyntax (name := stx_rfl) \"stx_rfl\" : tactic\n\nopen Lean.Elab.Tactic Lean Meta in\n@[tactic stx_rfl] def syntacticRefl : Tactic := fun _ => do\n  let goal \u2190 getMainGoal\n  let goalType \u2190 goal.getType\n  match goalType.app3? ``Eq with\n  | none => throwTacticEx `stx_rfl goal m!\"equality expected\"\n  | some (_,lhs,rhs) => \n\n    let lhs \u2190 instantiateMVars lhs\n    let rhs \u2190 instantiateMVars rhs\n\n    -- This is a very crude test and maybe too strict\n    -- In my use case I wand defEq witout zeta reduction\n    if lhs == rhs then\n      goal.applyRefl\n    else\n      throwTacticEx `stx_rfl goal m!\"{\u2190 Lean.Meta.ppExpr lhs} and {\u2190 Lean.Meta.ppExpr rhs} are not syntactically equal!\"  \n\nexample : 0 = 0 := \nby\n  stx_rfl\n", "meta": {"author": "lecopivo", "repo": "SciLean", "sha": "e4fe5962c862f9854a6c88a4082eb01bc1147086", "save_path": "github-repos/lean/lecopivo-SciLean", "path": "github-repos/lean/lecopivo-SciLean/SciLean-e4fe5962c862f9854a6c88a4082eb01bc1147086/SciLean/Tactic/SyntacticRefl.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5039061705290805, "lm_q2_score": 0.3738758227716966, "lm_q1q2_score": 0.18839833410629483}}
{"text": "import for_mathlib.derived.les_facts\nimport liquid\nimport Lbar.functor\nimport condensed.projective_resolution\nimport condensed.condensify\nimport condensed.bd_lemma\nimport breen_deligne.eg\n\nimport for_mathlib.derived.ext_coproducts\nimport condensed.ab4\nimport Lbar.squares\nimport pseudo_normed_group.QprimeFP\nimport for_mathlib.acyclic\nimport free_pfpng.acyclic\nimport for_mathlib.SemiNormedGroup_ulift\nimport for_mathlib.bicartesian4\nimport for_mathlib.has_homology_aux\n\nimport for_mathlib.derived.Ext_lemmas\n\nnoncomputable theory\n\nuniverses u\n\nopen opposite category_theory category_theory.limits\nopen_locale nnreal zero_object\n\n\nvariables (r r' : \u211d\u22650)\nvariables [fact (0 < r)] [fact (0 < r')] [fact (r < r')] [fact (r < 1)] [fact (r' < 1)]\n\nabbreviation SemiNormedGroup.to_Cond (V : SemiNormedGroup.{u}) := Condensed.of_top_ab V\n\nsection\n\nopen bounded_homotopy_category\n\nvariables (BD : breen_deligne.data)\nvariables (\u03ba \u03ba\u2082 : \u211d\u22650 \u2192 \u2115 \u2192 \u211d\u22650)\nvariables [\u2200 (c : \u211d\u22650), BD.suitable (\u03ba c)] [\u2200 n, fact (monotone (function.swap \u03ba n))]\nvariables [\u2200 (c : \u211d\u22650), BD.suitable (\u03ba\u2082 c)] [\u2200 n, fact (monotone (function.swap \u03ba\u2082 n))]\nvariables (M : ProFiltPseuNormGrpWithTinv\u2081.{u} r')\nvariables (V : SemiNormedGroup.{u}) [complete_space V] [separated_space V]\n\nlemma ExtQprime_iso_aux_system_aux (c : \u211d\u22650) (k i : \u2124) (hi : i > 0) :\n  is_zero (((Ext' i).obj (op (((homological_complex.embed complex_shape.embedding.nat_down_int_up).obj\n      ((QprimeFP_nat.{u} r' BD \u03ba M).obj c)).X k))).obj V.to_Cond) :=\nbegin\n  rcases k with (_|_)|_,\n  { apply free_acyclic.{u} _ V i hi },\n  { apply bounded_derived_category.Ext'_zero_left_is_zero, refine (is_zero_zero _).op },\n  { apply free_acyclic.{u} _ V i hi },\nend\n\ndef embed_unop {\ud835\udcd0 : Type*} [category \ud835\udcd0] [abelian \ud835\udcd0] :\n  (homological_complex.embed complex_shape.embedding.nat_down_int_up).op \u22d9\n    @homological_complex.unop_functor \ud835\udcd0 _ _ _ _ \u2245\n  homological_complex.unop_functor \u22d9\n    homological_complex.embed complex_shape.embedding.nat_up_int_down :=\nbegin\n  refine nat_iso.of_components _ _,\n  { intro X, refine homological_complex.hom.iso_of_components _ _,\n    { rintro ((_|n)|n),\n      { exact iso.refl _ },\n      { refine is_zero.iso (is_zero_zero _).unop (is_zero_zero _), },\n      { exact iso.refl _ }, },\n    { rintro i (j|(_|j)) (rfl : _ = _),\n      { apply is_zero.eq_of_src, exact (is_zero_zero _).unop },\n      { dsimp only [iso.refl_hom], erw [category.id_comp, category.comp_id], refl },\n      { dsimp only [iso.refl_hom], erw [category.id_comp, category.comp_id], refl }, } },\n  { intros X Y f, ext ((_|n)|n),\n    { dsimp only [homological_complex.comp_f, homological_complex.hom.iso_of_components_hom_f, iso.refl_hom],\n      erw [category.id_comp, category.comp_id], refl },\n    { apply is_zero.eq_of_tgt, exact is_zero_zero _ },\n    { dsimp only [homological_complex.comp_f, homological_complex.hom.iso_of_components_hom_f, iso.refl_hom],\n      erw [category.id_comp, category.comp_id], refl } }\nend\n.\n\n-- move me\nlemma nat_up_int_down_c_iff : complex_shape.embedding.nat_up_int_down.c_iff :=\n\u03bb i j, complex_shape.embedding.nat_down_int_up_c_iff j i\n\ndef forget\u2082_unop :\n  ((forget\u2082 SemiNormedGroup Ab).op.map_homological_complex (complex_shape.down \u2115)).op \u22d9\n  homological_complex.unop_functor \u2245\n  homological_complex.unop_functor \u22d9\n  (forget\u2082 SemiNormedGroup Ab).map_homological_complex (complex_shape.down \u2115).symm :=\nbegin\n  refine nat_iso.of_components _ _,\n  { intro X, refine homological_complex.hom.iso_of_components _ _,\n    { intro n, exact iso.refl _ },\n    { rintro i j (rfl : _ = _), dsimp only [iso.refl_hom],\n      rw [category.id_comp, category.comp_id], refl } },\n  { intros X Y f, ext n,\n    dsimp only [homological_complex.comp_f, homological_complex.hom.iso_of_components_hom_f, iso.refl_hom],\n    rw [category.id_comp, category.comp_id], refl }\nend\n.\n\ndef preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab\n  (M : Condensed.{u} Ab.{u+1}) (X : Profinite) :\n  (preadditive_yoneda.obj M).obj (op $ CondensedSet_to_Condensed_Ab.obj (Profinite_to_Condensed.obj X)) \u2245\n  M.val.obj (op X) :=\nlet e := Condensed_Ab_CondensedSet_adjunction.hom_equiv X.to_Condensed M in\nadd_equiv.to_AddCommGroup_iso $\n{ to_fun := \u03bb t, yoneda'_equiv _ _ (e t).val,\n  inv_fun := \u03bb t, e.symm $ \u27e8(yoneda'_equiv _ _).symm $ by apply t\u27e9,\n  left_inv := \u03bb t, begin\n    dsimp only,\n    apply_fun e, rw equiv.apply_symm_apply, ext1,\n    dsimp only, erw equiv.apply_symm_apply,\n  end,\n  right_inv := \u03bb t, begin\n    dsimp only,\n    rw equiv.apply_symm_apply,\n    rw equiv.apply_symm_apply,\n  end,\n  map_add' := begin\n    intros x y,\n    refl,\n  end }\n\n@[reassoc]\nlemma preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab_natural\n  {M\u2081 M\u2082 : Condensed.{u} Ab.{u+1}} (f : M\u2081 \u27f6 M\u2082) (X : Profinite) :\n  (preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab M\u2081 X).hom \u226b f.val.app _ =\n  (preadditive_yoneda.map f).app _ \u226b\n  (preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab M\u2082 X).hom :=\nby { ext, refl }\n\n@[reassoc]\nlemma preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab_natural'\n  (M : Condensed.{u} Ab.{u+1}) {X Y : Profinite.{u}} (f : X \u27f6 Y) :\n  (preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab M Y).hom \u226b M.val.map f.op =\n  (preadditive_yoneda.obj M).map (CondensedSet_to_Condensed_Ab.map $\n    Profinite_to_Condensed.map f).op \u226b\n  (preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab M X).hom :=\nbegin\n  ext t,\n  rw comp_apply,\n  rw comp_apply,\n  dsimp [preadditive_yoneda_obj_obj_CondensedSet_to_Condensed_Ab, adjunction.whisker_right],\n  simp only [\u2190 nat_trans.comp_app],\n  rw \u2190 grothendieck_topology.to_sheafify_naturality_assoc,\n  dsimp [functor.right_unitor],\n  simp only [\u2190 comp_apply, category.assoc, \u2190 nat_trans.comp_app, \u2190 nat_trans.comp_app_assoc],\n  simp only [\u2190 nat_trans.naturality, functor.comp_map, category.assoc],\n  refl,\nend\n\nend\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/Lbar/ext_preamble.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5039061705290805, "lm_q2_score": 0.373875808818685, "lm_q1q2_score": 0.18839832707528617}}
{"text": "class L1 (\u03b1 : Type u) where\n  add    : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1  : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n\ninstance L1.toAdd [inst : L1 \u03b1] : Add \u03b1 := { inst with }\n\nclass L2 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n\ninstance L2.toL1 [inst : L2 \u03b1] : L1 \u03b1 := { inst with }\n\nclass L3 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n\ninstance L3.toL2 [inst : L3 \u03b1] : L2 \u03b1 := { inst with }\n\nclass L4 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n\ninstance L4.toL3 [inst : L4 \u03b1] : L3 \u03b1 := { inst with }\n\nclass L5 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n\ninstance L5.toL4 [inst : L5 \u03b1] : L4 \u03b1 := { inst with }\n\nclass L6 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n\ninstance L6.toL5 [inst : L6 \u03b1] : L5 \u03b1 := { inst with }\n\nclass L7 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n\ninstance L7.toL6 [inst : L7 \u03b1] : L6 \u03b1 := { inst with }\n\nclass L8 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n\ninstance L8.toL7 [inst : L8 \u03b1] : L7 \u03b1 := { inst with }\n\nclass L9 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n  addc9 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) y x\n\ninstance L9.toL8 [inst : L9 \u03b1] : L8 \u03b1 := { inst with }\n\nclass T1 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n  addc9 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) y x\n\n-- slow\ninstance T1.toL9 [inst : T1 \u03b1] : L9 \u03b1 := { inst with }\n\nclass T2 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @Add.add \u03b1 \u27e8add\u27e9 x y = @Add.add \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @Add.add \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n  addc9 : \u2200 (x y : \u03b1), @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) x y = @Add.add \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) y x\n\n-- slow\ninstance T2.toL9 [inst : T2 \u03b1] : L9 \u03b1 := { inst with }\n\n\nset_option pp.all true in\n-- #print T2.toL9\n\naxiom C : Type\naxiom C.add   : C \u2192 C \u2192 C\n\nnoncomputable instance C.T1 : T1 C := \u27e8add, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry\u27e9\nnoncomputable instance C.T2 : T2 C := \u27e8add, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry\u27e9\n\n-- slow\nexample : @T1.toL9 _ C.T1 = @T2.toL9 _ C.T2 := rfl\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/lean/run/tryHeuristicPerfIssue.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.519521321952093, "lm_q2_score": 0.35936413143782797, "lm_q1q2_score": 0.1866973286267461}}
{"text": "import for_mathlib.abelian_category\nimport for_mathlib.exact_seq3\n\nnoncomputable theory\n\nnamespace category_theory\nopen category_theory.limits\n\nvariables {\ud835\udcd0 : Type*} [category \ud835\udcd0] [abelian \ud835\udcd0]\n\n-- lemma exact_seq.is_iso_of_is_zero_of_is_zero\n--   {A B C D : \ud835\udcd0} {f : A \u27f6 B} {g : B \u27f6 C} {h : C \u27f6 D} {L : list (arrow \ud835\udcd0)}\n--   (H : exact_seq \ud835\udcd0 (f::g::h::L)) (hA : is_zero A) (hD : is_zero D) :\n--   is_iso g :=\n-- begin\n--   admit\n-- end\n\nend category_theory\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/for_mathlib/exact_seq4.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5350984286266115, "lm_q2_score": 0.34864513533394575, "lm_q1q2_score": 0.1865594640655067}}
{"text": "import for_mathlib.algebra.homology.k_projective\nimport for_mathlib.category_theory.localization.derived_functor_triangulated\nimport category_theory.abelian.injective\nimport for_mathlib.algebra.homology.cochain_complex_opposites\n\nnoncomputable theory\n\nopen category_theory category_theory.category category_theory.limits\n  category_theory.pretriangulated\nopen_locale zero_object\n\ninstance inverse_image_multiplicative {C D : Type*} [category C] [category D]\n  (F : C \u2964 D) (W : morphism_property D)\n  [W.multiplicative] : (W.inverse_image F).multiplicative :=\n{ contains_identities := \u27e8\u03bb X, begin\n    change W _,\n    rw F.map_id,\n    apply morphism_property.contains_identities.id W,\n  end\u27e9,\n  comp := (morphism_property.multiplicative.comp W).inverse_image F, }\n\nvariables {C : Type*} [category C] [abelian C]\n\nnamespace homological_complex\n\nvariables {\u03b9 : Type*} {c : complex_shape \u03b9} (K L : homological_complex C c)\n\nclass is_K_injective : Prop :=\n(null_homotopic : \u2200 \u2983X : homological_complex C c\u2984 (f : X \u27f6 K)\n  (hX : acyclic X), nonempty (homotopy f 0))\n\nvariables {K L}\n\nlemma is_K_injective.of_homotopy_equiv [K.is_K_injective] (e : homotopy_equiv K L) :\n  L.is_K_injective :=\n\u27e8\u03bb X f hX, begin\n  obtain \u27e8h\u27e9 := is_K_injective.null_homotopic (f \u226b e.inv) hX,\n  refine \u27e8(homotopy.of_eq (comp_id f)).symm.trans\n    (((e.homotopy_inv_hom_id.symm.comp_left f).trans\n      (homotopy.of_eq (assoc _ _ _).symm)).trans\n        ((h.comp_right e.hom).trans (homotopy.of_eq zero_comp)))\u27e9,\nend\u27e9\n\nlemma is_K_injective.of_iso [K.is_K_injective] (e : K \u2245 L) : L.is_K_injective :=\nis_K_injective.of_homotopy_equiv (homotopy_equiv.of_iso e)\n\nlemma is_K_injective.iff_of_iso (e : K \u2245 L) :\n  K.is_K_injective \u2194 L.is_K_injective :=\nbegin\n  split,\n  { introI, exact is_K_injective.of_iso e, },\n  { introI, exact is_K_injective.of_iso e.symm, },\nend\n\nlemma is_K_injective.of_is_zero (h : is_zero K) : K.is_K_injective :=\n\u27e8\u03bb X f hX, begin\n  rw h.eq_of_tgt f 0,\n  exact \u27e8homotopy.refl _\u27e9\nend\u27e9\n\ninstance zero_is_K_injective : is_K_injective (0 : homological_complex C c) :=\nis_K_injective.of_is_zero (limits.is_zero_zero _)\n\nend homological_complex\n\nnamespace cochain_complex\n\nopen homological_complex\n\nvariables (K : cochain_complex C \u2124)\n\nlemma is_K_injective_iff : is_K_injective K \u2194\n  (homotopy_category.quotient _ _).obj K\n    \u2208 triangulated.right_orthogonal (homotopy_category.acyclic C) :=\nbegin\n  split,\n  { introI,\n    rintros \u27e8X\u27e9 f hX,\n    obtain \u27e8f, rfl\u27e9 := (homotopy_category.quotient _ _).map_surjective f,\n    rw \u2190 (homotopy_category.quotient C (complex_shape.up \u2124)).map_zero,\n    refine homotopy_category.eq_of_homotopy _ _ (is_K_injective.null_homotopic _ _).some,\n    erw homotopy_category.quotient_obj_mem_acyclic_iff at hX,\n    exact hX, },\n  { intro hK,\n    refine \u27e8\u03bb X f hX, \u27e8homotopy_category.homotopy_of_eq _ _ _\u27e9\u27e9,\n    simp only [functor.map_zero],\n    apply hK,\n    simpa only [homotopy_category.quotient_obj_mem_acyclic_iff] using hX, },\nend\n\nlemma shift_is_K_injective_iff (K : cochain_complex C \u2124) (r : \u2124) :\n  is_K_injective (K\u27e6r\u27e7) \u2194 is_K_injective K :=\nbegin\n  simp only [is_K_injective_iff],\n  erw [set.respects_iso.mem_iff_of_iso (triangulated.right_orthogonal (homotopy_category.acyclic C))\n   (((homotopy_category.quotient C (complex_shape.up \u2124)).comm_shift_iso r).app K),\n   \u2190 triangulated.is_triangulated_subcategory.shift_iff],\nend\n\nlemma is_K_injective_of_op (K : cochain_complex C \u2124)\n  (hK : (op_equivalence.op_obj K).is_K_projective) :\n  is_K_injective K :=\n\u27e8\u03bb (L : cochain_complex C \u2124) f hL, \u27e8begin\n  apply cochain_complex.unop_homotopy,\n  let f' : op_equivalence.op_obj K \u27f6 _ :=\n    (cochain_complex.op_equivalence.functor C).map f.op,\n  exact (is_K_projective.null_homotopic f' (cochain_complex.acyclic_op hL)).some,\nend\u27e9\u27e9\n\nlemma is_K_injective_of_bounded_below_of_injective\n  (K : cochain_complex C \u2124) (n : \u2124) [K.is_strictly_ge n]\n  [\u2200 (n : \u2124), injective (K.X n)] : is_K_injective K :=\nbegin\n  haveI : K.is_strictly_ge (-(-n)),\n  { simp only [neg_neg], apply_instance, },\n  haveI : (op_equivalence.op_obj K).is_strictly_le (-n) := op_obj_is_strictly_le K (-n),\n  haveI : \u2200 (n : \u2124), projective ((op_equivalence.op_obj K).X n),\n  { intro n,\n    dsimp,\n    apply_instance, },\n  exact is_K_injective_of_op _ (is_K_projective_of_bounded_above_of_projective _ (-n)),\nend\n\nend cochain_complex\n\nnamespace homotopy_category\n\nvariables {C} {\u03b9 : Type*} {c : complex_shape \u03b9}\n\nclass is_K_injective (K : homotopy_category C c) : Prop :=\n(K_injective : K.as.is_K_injective)\n\nlemma is_K_injective_iff' (K : homotopy_category C c) :\n  K.is_K_injective \u2194 K.as.is_K_injective :=\nbegin\n  split,\n  { exact \u03bb h, h.K_injective, },\n  { exact \u03bb h, \u27e8h\u27e9, },\nend\n\nlemma is_K_injective_iff (K : homotopy_category C (complex_shape.up \u2124)) : is_K_injective K \u2194\n  K \u2208 triangulated.right_orthogonal (homotopy_category.acyclic C) :=\nbegin\n  rw K.is_K_injective_iff',\n  cases K,\n  dsimp,\n  apply cochain_complex.is_K_injective_iff,\nend\n\nvariables (C c)\n\ninstance zero_is_K_injective :\n  (0 : homotopy_category C c).is_K_injective :=\n\u27e8\u27e8\u03bb X f hf, \u27e8begin\n  have e : \u2200 (X : homotopy_category C c), ((quotient C c).obj X.1 \u2245 X),\n  { rintro \u27e8X\u27e9, exact (iso.refl _), },\n  refine homotopy_of_eq _ _ (is_zero.eq_of_tgt (is_zero.of_iso (is_zero_zero _) (e _)) _ _),\nend\u27e9\u27e9\u27e9\n\nabbreviation K_injective := full_subcategory (\u03bb (K : homotopy_category C c), K.is_K_injective)\n\ninstance is_K_injective_is_triangulated_subcategory :\n  triangulated.is_triangulated_subcategory\n    (\u03bb (K : homotopy_category C (complex_shape.up \u2124)), K.is_K_injective) :=\nbegin\n  convert (infer_instance : triangulated.is_triangulated_subcategory\n      (triangulated.right_orthogonal (homotopy_category.acyclic C))),\n  ext,\n  exact is_K_injective_iff _,\nend\n\ninstance K_injective_is_K_injective (K : K_injective C c) : K.obj.is_K_injective := K.2\n\n--instance : pretriangulated (K_injective C (complex_shape.up \u2124)) := infer_instance\n\nabbreviation K_injective.\u03b9 : K_injective C c \u2964 homotopy_category C c :=\nfull_subcategory_inclusion _\n\nend homotopy_category\n\nnamespace derived_category\n\nlemma Qh_map_bijective_of_is_K_injective\n  (K L : homotopy_category C (complex_shape.up \u2124)) [L.is_K_injective] :\n  function.bijective (\u03bb (f : K \u27f6 L), Qh.map f) :=\n(triangulated.subcategory.right_orthogonal_bijective_Q_map\n  (homotopy_category.acyclic C) _ _\n  (by { rw \u2190 L.is_K_injective_iff, apply_instance, }))\n\nlemma Qh_map_bijective_of_is_K_injective'\n  (K L : cochain_complex C \u2124) [L.is_K_injective] :\n  function.bijective (\u03bb (f : ((homotopy_category.quotient _ _).obj K \u27f6\n    (homotopy_category.quotient _ _).obj L)), Qh.map f) :=\n(triangulated.subcategory.right_orthogonal_bijective_Q_map\n  (homotopy_category.acyclic C) _ _\n  ((cochain_complex.is_K_injective_iff L).1 infer_instance))\n\nlemma Q_map_surjective_of_is_K_injective\n  (K L : cochain_complex C \u2124) [L.is_K_injective] :\n  function.surjective (\u03bb (f : K \u27f6 L), Q.map f) :=\n\u03bb f, begin\n  obtain \u27e8g, hg\u27e9 := (Qh_map_bijective_of_is_K_injective' K L).2 f,\n  dsimp at hg,\n  obtain \u27e8g, rfl\u27e9 := (homotopy_category.quotient _ _).map_surjective g,\n  exact \u27e8g, hg\u27e9,\nend\n\ndef homotopy_of_eq_Qh_map_eq_of_is_K_injective\n  {K L : cochain_complex C \u2124} [L.is_K_injective] (f\u2081 f\u2082 : K \u27f6 L)\n  (h : Q.map f\u2081 = Q.map f\u2082) : homotopy f\u2081 f\u2082 :=\nhomotopy_category.homotopy_of_eq _ _ ((Qh_map_bijective_of_is_K_injective' K L).1 h)\n\nend derived_category\n\nnamespace homotopy_category\n\nvariable (C)\n\nnamespace K_injective\n\ndef W : morphism_property (homotopy_category.K_injective C (complex_shape.up \u2124)) :=\n(triangulated.subcategory.W (homotopy_category.acyclic C)).inverse_image (K_injective.\u03b9 _ _)\n\ninstance W_multiplicative : (W C).multiplicative :=\nby { dsimp [W], apply_instance, }\n\nvariable {C}\n\ndef \u03a6 : localizor_morphism (W C) (triangulated.subcategory.W (homotopy_category.acyclic C)) :=\n{ functor := K_injective.\u03b9 _ _,\n  mapW := \u03bb X Y f hf, hf, }\n\ninstance \u03a6_functor_has_comm_shift :\n  (\u03a6 : localizor_morphism (W C) _).functor.has_comm_shift \u2124 :=\nby { dsimp only [\u03a6], apply_instance, }\n\ninstance \u03a6_functor_is_triangulated :\n  (\u03a6 : localizor_morphism (W C) _).functor.is_triangulated :=\nby { dsimp only [\u03a6], apply_instance, }\n\nend K_injective\n\nend homotopy_category\n\nnamespace category_theory\n\nvariable (C)\n\ninclude C\n\nclass has_enough_K_injectives : Prop :=\n(condition : \u2200 (K : homotopy_category C (complex_shape.up \u2124)),\n  nonempty (homotopy_category.K_injective.\u03a6.right_resolution K))\n\nend category_theory\n\nopen category_theory\n\nnamespace homotopy_category\n\nnamespace K_injective\n\nvariable {C}\n\ndef Qh : K_injective C (complex_shape.up \u2124) \u2964 derived_category C :=\nK_injective.\u03b9 _ _ \u22d9 derived_category.Qh\n\ninstance full_Qh : full (Qh : _ \u2964 derived_category C) :=\nfunctor.full_of_surjective _ (\u03bb K L, (derived_category.Qh_map_bijective_of_is_K_injective _ _).2)\n\ninstance faithful_Qh : faithful (Qh : _ \u2964 derived_category C) :=\n\u27e8\u03bb K L, (derived_category.Qh_map_bijective_of_is_K_injective _ _).1\u27e9\n\nvariable (C)\n\nlemma W_eq_isomorphisms : W C = morphism_property.isomorphisms _ :=\nbegin\n  ext K L f,\n  split,\n  { intro hf,\n    haveI : is_iso (Qh.map f) := (triangulated.subcategory.is_iso_map_iff\n      (acyclic C) derived_category.Qh f).2 hf,\n    exact is_iso_of_reflects_iso f Qh, },\n  { rintro (h : is_iso _),\n    haveI := h,\n    exact (triangulated.subcategory.is_iso_map_iff (acyclic C) derived_category.Qh ((\u03b9 _ _).map f)).1\n      infer_instance, },\nend\n\nvariable {C}\n\nlemma W_inverts {D : Type*} [category D]\n  (G : K_injective C (complex_shape.up \u2124) \u2964 D) :\n  (W C).is_inverted_by G :=\nbegin\n  intros X Y f hf,\n  haveI : is_iso f := by simpa only [W_eq_isomorphisms] using hf,\n  apply_instance,\nend\n\nvariables [has_enough_K_injectives C]\n\ninstance (Y : homotopy_category C (complex_shape.up \u2124)) :\n  nonempty (\u03a6.right_resolution Y) :=\nhas_enough_K_injectives.condition Y\n\ninstance (Y : homotopy_category C (complex_shape.up \u2124)) (X : \u03a6.right_resolution Y) :\n  is_iso (derived_category.Qh.map X.hom.f) :=\nby simpa only [triangulated.subcategory.is_iso_map_iff (homotopy_category.acyclic C)\n  derived_category.Qh] using X.hom.hf\n\ninstance ess_surj_Qh : ess_surj (Qh : _ \u2964 derived_category C) :=\n\u27e8\u03bb Z, begin\n  have e := derived_category.Qh.obj_obj_preimage_iso Z,\n  let Y := derived_category.Qh.obj_preimage Z,\n  let X := (has_enough_K_injectives.condition Y).some,\n  exact \u27e8X.right.obj, \u27e8(as_iso (derived_category.Qh.map X.hom.f)).symm \u226a\u226b\n    derived_category.Qh.obj_obj_preimage_iso Z\u27e9\u27e9,\nend\u27e9\n\ninstance : is_equivalence (Qh : _ \u2964 derived_category C) :=\nequivalence.of_fully_faithfully_ess_surj _\n\ninstance Qh_is_localization : Qh.is_localization (W C) :=\nbegin\n  haveI : (\ud835\udfed _).is_localization (W C),\n  { refine functor.is_localization.for_id _ _,\n    rw W_eq_isomorphisms, },\n  exact functor.is_localization.of_equivalence_target (\ud835\udfed _) (W C) Qh\n    (functor.as_equivalence Qh) (functor.left_unitor _),\nend\n\ninstance \u03a6_induced_functor_obj_is_K_injective (Y : homotopy_category C (complex_shape.up \u2124))\n  (X : \u03a6.right_resolution Y) : (\u03a6.induced_functor.obj X.right).obj.is_K_injective :=\nX.right.obj.2\n\ninstance \u03a6_induced_functor_obj_is_K_injective' (Y : homotopy_category C (complex_shape.up \u2124))\n  (X : \u03a6.right_resolution Y) : (\u03a6.functor.obj X.right.obj).is_K_injective :=\nX.right.obj.2\n\nlemma lift_map {Y\u2081 Y\u2082 : homotopy_category C (complex_shape.up \u2124)} (f : Y\u2081 \u27f6 Y\u2082)\n  (X\u2081 : \u03a6.right_resolution Y\u2081) (X\u2082 : \u03a6.right_resolution Y\u2082) :\n  \u2203 (f' : X\u2081.right.obj \u27f6 X\u2082.right.obj), X\u2081.hom.f \u226b \u03a6.functor.map f' = f \u226b X\u2082.hom.f :=\nbegin\n  let f'' := inv (derived_category.Qh.map (X\u2081.hom.f)) \u226b\n    derived_category.Qh.map (f \u226b X\u2082.hom.f),\n  obtain \u27e8f', hf'\u27e9 := (derived_category.Qh_map_bijective_of_is_K_injective _ _).2 f'',\n  refine \u27e8f', (derived_category.Qh_map_bijective_of_is_K_injective _ _).1 _\u27e9,\n  dsimp [\u03a6] at hf' \u22a2,\n  simp only [functor.map_comp, hf', f'', is_iso.hom_inv_id_assoc],\nend\n\ninstance (Y : homotopy_category C (complex_shape.up \u2124)) :\n  is_preconnected' (\u03a6.right_resolution Y) :=\n\u27e8\u27e8begin\n  rintro \u27e8X\u2081\u27e9 \u27e8X\u2082\u27e9,\n  obtain \u27e8g, hg\u27e9 := K_injective.lift_map (\ud835\udfd9 Y) X\u2081 X\u2082,\n  dsimp at hg,\n  rw id_comp at hg,\n  refine quot.sound \u27e8structured_arrow.hom_mk \u27e8g, _\u27e9 _\u27e9,\n  { change (triangulated.subcategory.W (homotopy_category.acyclic C)) _,\n    rw \u2190 triangulated.subcategory.is_iso_map_iff (homotopy_category.acyclic C)\n      derived_category.Qh,\n    replace hg := derived_category.Qh.congr_map hg,\n    rw functor.map_comp at hg,\n    exact is_iso.of_is_iso_fac_left hg, },\n  { ext, exact hg, },\nend\u27e9\u27e9\n\ninstance \u03a6_is_localization_equivalence : (\u03a6 : localizor_morphism (W C) _).is_localization_equivalence :=\nbegin\n  rw localizor_morphism.is_localization_equivalence.iff_is_localization \u03a6\n    (derived_category.Qh : _ \u2964 derived_category C),\n  change Qh.is_localization _,\n  apply_instance,\nend\n\nlemma right_derivability_structure :\n  right_derivability_structure.basic (\u03a6 : localizor_morphism (W C) _) :=\n{ right_resolution_connected := \u03bb Y, { },\n  nonempty_arrow_right_resolution := \u03bb Y\u2081 Y\u2082 f, begin\n    let X\u2081 := (has_enough_K_injectives.condition Y\u2081).some,\n    let X\u2082 := (has_enough_K_injectives.condition Y\u2082).some,\n    obtain \u27e8f', fac\u27e9 := K_injective.lift_map f X\u2081 X\u2082,\n    exact \u27e8X\u2081, X\u2082, f', fac\u27e9,\n  end, }\n\ninstance \u03a6_functor_comp_Qh_ess_surj_on_dist_triang : (\u03a6.functor \u22d9\n  derived_category.Qh : _ \u2964 derived_category C).ess_surj_on_dist_triang :=\nK_injective.right_derivability_structure.\u03a6_functor_comp_L_ess_surj_on_dist_triang _\n\nsection\n\nvariables {D : Type*} [category D]\n  (F : homotopy_category C (complex_shape.up \u2124) \u2964 D)\n\ninstance existence_right_derived_functor :\n  F.has_right_derived_functor (triangulated.subcategory.W (acyclic C)) :=\nright_derivability_structure.basic.existence_derived_functor\n  K_injective.right_derivability_structure F (W_inverts _)\n\nlemma is_iso_app (RF : derived_category C \u2964 D)\n  (\u03b1 : F \u27f6 derived_category.Qh \u22d9 RF)\n  [RF.is_right_derived_functor \u03b1]\n  (K : homotopy_category C (complex_shape.up \u2124)) [K.is_K_injective] :\n  is_iso (\u03b1.app K) :=\nright_derivability_structure.basic.is_iso_app\n  K_injective.right_derivability_structure derived_category.Qh F (W_inverts _)\n  RF \u03b1 \u27e8K, infer_instance\u27e9\n\ninstance (K : homotopy_category C (complex_shape.up \u2124)) [K.is_K_injective] :\n  is_iso ((F.right_derived_functor_\u03b1 derived_category.Qh\n    (triangulated.subcategory.W (acyclic C))).app K) :=\nis_iso_app _ _ _ _\n\nsection\n\nvariables [has_zero_object D] [has_shift D \u2124] [preadditive D]\n  [\u2200 (n : \u2124), (shift_functor D n).additive] [pretriangulated D]\n  [F.has_comm_shift \u2124] [functor.is_triangulated F]\n\ninstance right_derived_functor_is_triangulated :\n  (F.right_derived_functor derived_category.Qh\n    (triangulated.subcategory.W (acyclic C))).is_triangulated :=\nright_derivability_structure.basic.derived_functor_is_triangulated'\n    K_injective.right_derivability_structure F derived_category.Qh (W_inverts _)\n\nend\n\nend\n\nend K_injective\n\nend homotopy_category\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/algebra/homology/k_injective.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.523420348936324, "lm_q2_score": 0.35577488668296436, "lm_q1q2_score": 0.18621981533037835}}
{"text": "-- Copyright (c) 2017 Scott Morrison. All rights reserved.\n-- Released under Apache 2.0 license as described in the file LICENSE.\n-- Authors: Stephen Morgan, Scott Morrison\nimport .pentagon_in_terms_of_natural_transformations_definitions\nimport tidy.its\n\nopen categories\nopen categories.functor\nopen categories.products\nopen categories.natural_transformation\n\nnamespace categories.monoidal_category\n\nuniverse variables u v\n\nvariables (C : Type u) [\ud835\udc9e : monoidal_category.{u v} C]\ninclude \ud835\udc9e\n\nlocal attribute [tidy] dsimp_all'\n\n\nset_option trace.check true\n\n-- TODO tidy this up\nlemma pentagon_in_terms_of_natural_transformations :\n  pentagon_3step C = pentagon_2step C :=\n  begin \n    dsimp',\n    apply NaturalTransformations_componentwise_equal,\n    intros WXYZ,\n    induction WXYZ with WXY Z,\n    induction WXY with WX Y,\n    induction WX with W X,\n    {\n      tidy,\n      -- erw rewrite_tensor_as_otimes, -- FIXME terrifying: equalities between objects are evil, and hence rewriting along them is hard\n      have p := monoidal_category.pentagon C W X Y Z,\n      -- have p := monoidal_category.pentagon C X_fst_fst_fst X_fst_fst_snd X_fst_snd X_snd,\n      obviously, -- FIXME\n    },\nend\n\nend categories.monoidal_category\n", "meta": {"author": "semorrison", "repo": "lean-monoidal-categories", "sha": "81f43e1e0d623a96695aa8938951d7422d6d7ba6", "save_path": "github-repos/lean/semorrison-lean-monoidal-categories", "path": "github-repos/lean/semorrison-lean-monoidal-categories/lean-monoidal-categories-81f43e1e0d623a96695aa8938951d7422d6d7ba6/src/monoidal_categories/lemmas/pentagon_in_terms_of_natural_transformations.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5078118642792044, "lm_q2_score": 0.36658975016245987, "lm_q1q2_score": 0.18615862445564654}}
{"text": "example : if x = 0 then y + x = y else x \u2260 0 := by\n  simp (config := { contextual := true })\n\nexample : if x = 0 then y + x = y else x \u2260 0 := by\n  split\n  simp_all\n  simp_all\n\nexample : if x = 0 then y + x = y else x \u2260 0 := by\n  simp (config := { contextual := true })\n  split -- Error: no goals to be solved\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/lean/1062.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5117166047041654, "lm_q2_score": 0.36296921241058616, "lm_q1q2_score": 0.18573737298689014}}
{"text": "import for_mathlib.endomorphisms.basic\nimport for_mathlib.exact_functor\n\nuniverse v\n\nnamespace category_theory\n\nnamespace endomorphisms\n\nopen homological_complex category_theory category_theory.limits category\n\nvariables (\ud835\udcd0 : Type*) [category.{v} \ud835\udcd0]\n\n@[simps]\ndef tautological_nat_trans :\n  (endomorphisms.forget \ud835\udcd0) \u27f6 (endomorphisms.forget \ud835\udcd0) :=\n{ app := \u03bb X, X.e, }\n\nvariable {\ud835\udcd0}\n\nvariables [abelian \ud835\udcd0]\n  [has_coproducts_of_shape (ulift.{v} \u2115) \ud835\udcd0] [has_products_of_shape (ulift.{v} \u2115) \ud835\udcd0]\nvariables {M : Type*} {c : complex_shape M} (F : endomorphisms \ud835\udcd0 \u2964 homological_complex \ud835\udcd0 c)\nvariables (Y : homological_complex (endomorphisms \ud835\udcd0) c)\n\n@[simps]\ndef _root_.homological_complex.tautological_endomorphism : Y \u27f6 Y :=\n{ f := \u03bb i, \u27e8(Y.X i).e, rfl\u27e9, }\n\nlemma homology_functor_obj_e (i : M) :\n  ((homology_functor (endomorphisms \ud835\udcd0) c i).obj Y).e =\n    ((homology_functor (endomorphisms \ud835\udcd0) c i).map Y.tautological_endomorphism).f  :=\nbegin\n  have h\u2081 := ((endomorphisms.forget \ud835\udcd0).homology_functor_iso c i).hom.naturality\n    Y.tautological_endomorphism,\n  rw [\u2190 cancel_mono (((endomorphisms.forget \ud835\udcd0).homology_functor_iso c i).inv.app Y),\n    assoc] at h\u2081,\n  conv_lhs at h\u2081 { congr, skip, rw [\u2190 nat_trans.comp_app, iso.hom_inv_id, nat_trans.id_app], },\n  rw comp_id at h\u2081,\n  conv_lhs at h\u2081 { dsimp only [functor.comp, endomorphisms.forget], },\n  rw h\u2081,\n  clear h\u2081,\n  have h\u2082 := nat_trans.congr_app (functor.naturality_homology_functor_iso\n    (tautological_nat_trans \ud835\udcd0) c i) Y,\n  dsimp [nat_trans.hcomp] at h\u2082,\n  rw [comp_id, id_comp, \u2190 cancel_mono\n    (((endomorphisms.forget \ud835\udcd0).homology_functor_iso c i).inv.app Y), assoc] at h\u2082,\n  conv_lhs at h\u2082 { congr, skip, rw [\u2190 nat_trans.comp_app, iso.hom_inv_id, nat_trans.id_app], },\n  erw comp_id at h\u2082,\n  exact h\u2082,\nend\n\nend endomorphisms\n\nend category_theory\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/for_mathlib/endomorphisms/homology.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5660185351961015, "lm_q2_score": 0.32766830738621877, "lm_q1q2_score": 0.18546633537693347}}
{"text": "import Yatima.Typechecker.Equal\n\n/-!\n# Yatima typechecker: Infer\n\n## Basic Structure\n\nThis is the third of the three main files that constitute the Yatima typechecker: `Eval`, `Equal`,\nand `Infer`.\n\nTODO: Add a high level overview of Infer in the context of Eval-Equal-Infer.\n\n## Infer\n\nIn this module the two major functions `check` and `infer` are defined.\n* `check` : Checks that a Yatima expression has a prescribed type.\n* `infer` : Determines the type of a given Yatima expression.\n-/\n\nnamespace Yatima.Typechecker\n\nopen IR PP\nopen Lurk (F)\n\n/--\n  Gives the correct type information for a lambda based on the information of the body.\n  No lambdas can be a proposition, a struct or be elements of the unit type.\n-/\ndef lamInfo : TypeInfo \u2192 TypeInfo\n| .proof => .proof\n| _ => .none\n\ndef piInfo (dom img : TypeInfo) : TypecheckM TypeInfo := match dom, img with\n| .sort lvl, .sort lvl' => pure $ .sort $ .reduceIMax lvl lvl'\n| .sort _, _ => throw \"Image is not a type\"\n| _, .sort _ => throw \"Domain is not a type\"\n| _, _ => throw \"Neither image nor domain are types\"\n\ndef eqSortInfo (inferType expectType : SusValue) : TypecheckM Bool := do\n  match inferType.info, expectType.info with\n  | .sort lvl, .sort lvl' => pure $ lvl.equalUniv lvl'\n  | .sort _, e => throw s!\"Expected type {\u2190 ppValue expectType.get} {repr e} is not actually a type\"\n  | e, .sort _ => throw s!\"Inferred type {\u2190 ppValue inferType.get} {repr e} is not actually a type\"\n  | e, e' => throw s!\"Neither expected {\u2190 ppValue expectType.get} {repr e} nor inferred types {\u2190 ppValue inferType.get} {repr e'} are actually types\"\n/--\n  Gives the correct type information for a term based on its type.\n-/\ndef infoFromType (typ : SusValue) : TypecheckM TypeInfo :=\n  match typ.info with\n  | .sort .zero => pure .proof\n  | _ =>\n    match typ.get with\n    | .app (.const f _) _ _ => do match derefConst f (\u2190 read).store with\n      | .inductiveProj p =>\n        let induct \u2190 getIndFromProj p\n        if induct.unit then pure .unit else pure .none\n      | _ => pure .none\n    | .sort lvl => pure (.sort lvl)\n    | _ => pure .none\n\nmutual\n\n  partial def getStructInfo (v : Value) :\n      TypecheckM (F \u00d7 TypedExpr \u00d7 List Univ \u00d7 List SusValue) := do\n    match v with\n    | .app (.const indF univs) params _ =>\n      let .inductiveProj p := derefConst indF (\u2190 read).store \n        | throw s!\"Expected a structure type, found {\u2190 ppValue v}\"\n      let ind \u2190 getIndFromProj p\n      -- Sanity check\n      unless ind.struct && ind.params == params.length do\n        throw s!\"Expected a structure type, found {\u2190 ppValue v}\"\n      withLimitedAxioms $ checkConst indF\n      let ctorF := mkConstructorProjF p.block p.idx 0 (\u2190 read).quick\n      match (\u2190 get).typedConsts.find? ctorF with\n      | .some (.constructor type _ _) =>\n        return (indF, type, univs, params)\n      | _ => throw s!\"Implementation broken: ctorF {ctorF} is not a constructor\"\n    | v => throw s!\"Expected a structure type, found {\u2190 ppValue v}\"\n\n  /--\n  Checks if `term : IR.Expr` has type `type : SusValue`. Returns the typed IR for `term`\n  -/\n  partial def check (term : IR.Expr) (type : SusValue) : TypecheckM TypedExpr := do\n    let (term, inferType) \u2190 infer term\n    if !(\u2190 eqSortInfo inferType type) then\n      throw s!\"Term: {\u2190 ppTypedExpr term}\\nInfo mismatch:\\n{repr inferType.info}\\n\\nnot equal to\\n{repr type.info}\\n\\nExpected type: {\u2190 ppValue type.get}\\nInferred type: {\u2190 ppValue inferType.get}\"\n    if !(\u2190 equal (\u2190 read).lvl type inferType) then\n      throw s!\"Expected type {\u2190 ppValue type.get}, found type {\u2190 ppValue inferType.get}\"\n    pure term\n\n  /-- Infers the type of `term : IR.Expr`. Returns the typed IR for `term` along with its inferred type  -/\n  partial def infer (term : IR.Expr) : TypecheckM (TypedExpr \u00d7 SusValue) := do\n    match term with\n    | .var idx lvls =>\n      let ctx \u2190 read\n      if idx < ctx.lvl then\n        -- this is a bound free variable\n        if !lvls.isEmpty then\n          -- bound free variables should never have universe levels (sanity check)\n          throw s!\"found var@{idx} with unexpected universe variables\"\n        let types := ctx.types\n        let some type := types.get? idx\n          | throw s!\"var@{idx} out of environment range (size {types.length})\"\n        let term := \u27e8\u2190 infoFromType type, .var idx\u27e9\n        pure (term, type)\n      else\n        -- this free variable came from `recrCtx`, and thus represents a mutual reference\n        match ctx.mutTypes.find? (idx - ctx.lvl) with\n        | some (constF, typeValFn) =>\n          if some constF == ctx.recF? then\n            throw s!\"Invalid recursion in {(\u2190 read).constNames.getF constF}\"\n          let type := typeValFn lvls\n          let term := \u27e8\u2190 infoFromType type, .const constF lvls\u27e9\n          pure (term, type)\n        | none =>\n          throw $ s!\"var@{idx} out of environment range (size {ctx.types.length})\"\n            ++ \" and does not represent a mutual constant\"\n    | .sort lvl =>\n      let univs := (\u2190 read).env.univs\n      let lvl := Univ.instBulkReduce univs lvl\n      let lvl' := lvl.succ\n      let typ := .mk (.sort lvl'.succ) \u27e8 fun _ => .sort lvl' \u27e9\n      -- NOTE: we populate `SusTypeInfo.sort` here for consistency but technically it isn't necessary\n      -- because `lvl'` can never become `Univ.zero`.\n      let term := \u27e8.sort lvl', .sort lvl\u27e9\n      return (term, typ)\n    | .app fnc' arg =>\n      let (fnc, fncType) \u2190 infer fnc'\n      match fncType.get with\n      | .pi dom img env =>\n        let arg \u2190 check arg dom\n        let ctx \u2190 read\n        let stt \u2190 get\n        let typ := suspend img { ctx with env := env.extendWith $ suspend arg ctx stt} stt\n        let term := \u27e8\u2190 infoFromType typ, .app fnc arg\u27e9\n        pure (term, typ)\n      | val => throw s!\"Expected a pi type, found {\u2190 ppValue val}\"\n    | .lam dom bod => do\n      let (dom, _) \u2190 isSort dom\n      let ctx \u2190 read\n      let domVal := suspend dom ctx (\u2190 get)\n      let var := mkSusVar (\u2190 infoFromType domVal) ctx.lvl\n      let (bod, imgVal) \u2190 withExtendedCtx var domVal $ infer bod\n      let term := \u27e8lamInfo bod.info, .lam dom bod\u27e9\n      let typ := .mk (\u2190 piInfo domVal.info imgVal.info) $\n        Value.pi domVal (\u2190 quoteTyped (ctx.lvl+1) ctx.env imgVal.getTyped) ctx.env\n      pure (term, typ)\n    | .pi dom img =>\n      let (dom, domLvl) \u2190 isSort dom\n      let ctx \u2190 read\n      let domVal := suspend dom ctx (\u2190 get)\n      let domSusVal := mkSusVar (\u2190 infoFromType domVal) ctx.lvl\n      withExtendedCtx domSusVal domVal $ do\n        let (img, imgLvl) \u2190 isSort img\n        let sortLvl := .reduceIMax domLvl imgLvl\n        let typ := .mk (.sort sortLvl.succ) \u27e8 fun _ => .sort $ sortLvl \u27e9\n        let term := \u27e8\u2190 infoFromType typ, .pi dom img\u27e9\n        return (term, typ)\n    | .letE expType exp bod =>\n      let (expType, _) \u2190 isSort expType\n      let ctx \u2190 read\n      let expTypeVal := suspend expType ctx (\u2190 get)\n      let exp \u2190 check exp expTypeVal\n      let expVal := suspend exp ctx (\u2190 get)\n      let (bod, typ) \u2190 withExtendedCtx expVal expTypeVal $ infer bod\n      let term := \u27e8bod.info, .letE expType exp bod\u27e9\n      return (term, typ)\n    | .lit (.natVal v) =>\n      let typ := .mk (.sort $ .succ .zero) (mkConst (\u2190 primF .nat) [])\n      let term := \u27e8.none, .lit (.natVal v)\u27e9\n      pure $ (term, typ)\n    | .lit (.strVal s) =>\n      let typ := .mk (.sort $ .succ .zero) (mkConst (\u2190 primF .string) [])\n      let term := \u27e8.none, .lit (.strVal s)\u27e9\n      pure $ (term, typ)\n    | .const k constUnivs =>\n      withLimitedAxioms $ checkConst k\n      let ctx \u2190 read\n      let univs := ctx.env.univs\n      let tconst \u2190 derefTypedConst k\n      let env := \u27e8[], constUnivs.map (Univ.instBulkReduce univs)\u27e9\n      let typ := suspend tconst.type { ctx with env := env } (\u2190 get)\n      let term := \u27e8\u2190 infoFromType typ, .const k constUnivs\u27e9\n      pure (term, typ)\n    | .proj idx expr =>\n      let (expr, exprType) \u2190 infer expr\n      let (indF, ctorType, univs, params) \u2190  getStructInfo exprType.get\n      let mut ctorType \u2190 applyType (\u2190 withEnv \u27e8[], univs\u27e9 $ eval ctorType) params.reverse\n      for i in [:idx] do\n        match ctorType with\n        | .pi dom img piEnv =>\n          let info \u2190 infoFromType dom\n          let proj := suspend \u27e8info, .proj indF i expr\u27e9 (\u2190 read) (\u2190 get)\n          ctorType \u2190 withNewExtendedEnv piEnv proj $ eval img\n        | _ => pure ()\n      match ctorType with\n      | .pi dom _ _  =>\n        match exprType.info, dom.info with\n        | .sort .zero, .sort .zero =>\n          let term := \u27e8\u2190 infoFromType dom, .proj indF idx expr\u27e9\n          pure (term, dom)\n        | .sort .zero, _ =>\n          throw s!\"Projection {\u2190 ppTypedExpr expr}.{idx} not allowed\"\n        | _, _ =>\n          let term := \u27e8\u2190 infoFromType dom, .proj indF idx expr\u27e9\n          pure (term, dom)\n      | _ => throw \"Impossible case. Implementation broken.\"\n\n  /--\n  Checks if `expr : IR.Expr` is `Sort lvl` for some level `lvl`, and throws `TypecheckerError.notTyp`\n  if it is not.\n  -/\n  partial def isSort (expr : IR.Expr) : TypecheckM (TypedExpr \u00d7 Univ) := do\n    let (expr, typ) \u2190 infer expr\n    match typ.get with\n    | .sort u =>\n      pure (expr, u)\n    | val => throw s!\"Expected a sort type, found {\u2190 ppValue val}\"\n\n  partial def checkIndBlock (indBlockF : F) : TypecheckM Unit := do\n    let quick := (\u2190 read).quick\n    let indBlock \u2190 match derefConst indBlockF (\u2190 read).store with\n      | .mutIndBlock blk => pure blk\n      | _ => throw \"Invalid Const kind. Expected mutIndBlock\"\n\n    -- Check all inductives\n    let mut mutTypes := .empty\n    for (indIdx, ind) in indBlock.enum do\n      let f := mkInductiveProjF indBlockF indIdx quick\n      let univs := List.range ind.lvls |>.map .var\n      let (type, _) \u2190 withEnv \u27e8 [], univs \u27e9 $ isSort ind.type\n      let ctx \u2190 read\n      let stt \u2190 get\n      let typeSus := (suspend type {ctx with env := .mk ctx.env.exprs \u00b7} stt)\n      mutTypes := mutTypes.insert indIdx (f, typeSus)\n      modify fun stt => { stt with typedConsts := stt.typedConsts.insert f (.inductive type ind.struct) }\n\n    -- Check all constructors\n    for (indIdx, ind) in indBlock.enum do\n      let start := mutTypes.size\n      for (cidx, ctor) in ind.ctors.enum do\n        let f := mkConstructorProjF indBlockF indIdx cidx quick\n        let univs := List.range ctor.lvls |>.map .var\n        let (type, _) \u2190 withEnv \u27e8 [], univs \u27e9 $ withMutTypes mutTypes $ isSort ctor.type\n        let ctx \u2190 read\n        let stt \u2190 get\n        let typeSus := (suspend type {ctx with env := .mk ctx.env.exprs \u00b7} stt)\n        mutTypes := mutTypes.insert (start + cidx) (f, typeSus)\n        modify fun stt => { stt with typedConsts := stt.typedConsts.insert f (.constructor type ctor.idx ctor.fields) }\n\n    -- Check all recursor types\n    for (indIdx, ind) in indBlock.enum do\n      let start := mutTypes.size\n      for (ridx, recr) in ind.recrs.enum do\n        let f := mkRecursorProjF indBlockF indIdx ridx quick\n        let univs := List.range recr.lvls |>.map .var\n        let (type, _) \u2190 withEnv \u27e8 [], univs \u27e9 $ withMutTypes mutTypes $ isSort recr.type\n        let ctx \u2190 read\n        let stt \u2190 get\n        let typeSus := (suspend type {ctx with env := .mk ctx.env.exprs \u00b7} stt)\n        mutTypes := mutTypes.insert (start + ridx) (f, typeSus)\n\n    -- Check all recursor rules\n    for (indIdx, ind) in indBlock.enum do\n      for (ridx, recr) in ind.recrs.enum do\n        -- TODO: do not recompute `f`, `univs` and `type`\n        let f := mkRecursorProjF indBlockF indIdx ridx quick\n        let univs := List.range recr.lvls |>.map .var\n        let (type, _) \u2190 withEnv \u27e8 [], univs \u27e9 $ withMutTypes mutTypes $ isSort recr.type\n        let indProj := \u27e8indBlockF, indIdx\u27e9\n        let rules \u2190 recr.rules.mapM fun rule => do\n          let (rhs, _) \u2190 withEnv \u27e8 [], univs \u27e9 $ withMutTypes mutTypes $ infer rule.rhs\n          pure (rule.fields, rhs)\n        let recrConst := .recursor type recr.params recr.motives recr.minors recr.indices recr.isK indProj \u27e8rules\u27e9\n        modify fun stt => { stt with typedConsts := stt.typedConsts.insert f recrConst }\n\n    return ()\n\n  /-- Typechecks a `Yatima.Const`. The `TypecheckM Unit` computation finishes if the check finishes,\n  otherwise a `TypecheckError` is thrown in some other function in the typechecker stack.\n\n  Note that inductives, constructors, and recursors are constructed to typecheck, so this function\n  only has to check the other `Const` constructors.\n  -/\n  partial def checkConst (f : F) : TypecheckM Unit := withResetCtx do\n    match (\u2190 get).typedConsts.find? f with\n    | some _ =>\n      pure ()\n    | none =>\n      let c := derefConst f (\u2190 read).store\n      if c.isMutType then return ()\n      let univs := List.range (\u2190 c.levels) |>.map .var\n      withEnv \u27e8 [], univs \u27e9 do\n        let quick := (\u2190 read).quick\n        let newConst \u2190 match c with\n          | .axiom ax =>\n            if (\u2190 read).limitAxioms then\n              if quick then\n                if !(allowedAxiomQuick f) then\n                  throw s!\"Axiom {(\u2190 read).constNames.getF f} is not allowed\"\n              else\n                if !(allowedAxiom f) then\n                  throw s!\"Axiom {(\u2190 read).constNames.getF f} is not allowed\"\n            let (type, _) \u2190 isSort ax.type\n            pure $ TypedConst.axiom type\n          | .opaque data =>\n            let (type, _) \u2190 isSort data.type\n            let typeSus := suspend type (\u2190 read) (\u2190 get)\n            let value \u2190 withRecF f $ check data.value typeSus\n            pure $ TypedConst.opaque type value\n          | .theorem data =>\n            let (type, _) \u2190 isSort data.type\n            let typeSus := suspend type (\u2190 read) (\u2190 get)\n            let value \u2190 withRecF f $ check data.value typeSus\n            pure $ TypedConst.theorem type value\n          | .definition data =>\n            let (type, _) \u2190 isSort data.type\n            let ctx \u2190 read\n            let typeSus := suspend type ctx (\u2190 get)\n            let value \u2190\n              if data.part then\n                let mutTypes :=\n                  let typeSus := (suspend type {ctx with env := .mk ctx.env.exprs \u00b7} (\u2190 get))\n                  (default : RecrCtx).insert 0 (f, typeSus)\n                withMutTypes mutTypes $ withRecF f $ check data.value typeSus\n              else withRecF f $ check data.value typeSus\n            pure $ TypedConst.definition type value data.part\n          | .definitionProj p@\u27e8defBlockF, _\u27e9 =>\n            let data \u2190 getDefFromProj p\n            let (type, _) \u2190 isSort data.type\n            let ctx \u2190 read\n            let defBlock \u2190 match derefConst defBlockF ctx.store with\n              | .mutDefBlock blk => pure blk\n              | _ => throw \"Invalid Const kind. Expected mutDefBlock\"\n            let typeSus := suspend type ctx (\u2190 get)\n            let value \u2190\n              if data.part then\n                -- check order should be the same as `recrCtx` in CA\n                let mutTypes \u2190 defBlock.enum.foldlM (init := default) fun acc (i, defn) => do\n                  let defProjF := mkDefinitionProjF defBlockF i quick\n                  -- TODO avoid repeated work here\n                  let (type, _) \u2190 isSort defn.type\n                  let typeSus := (suspend type {ctx with env := .mk ctx.env.exprs \u00b7} (\u2190 get))\n                  pure $ acc.insert i (defProjF, typeSus)\n                withMutTypes mutTypes $ withRecF f $ check data.value typeSus\n              else withRecF f $ check data.value typeSus\n            pure $ TypedConst.definition type value data.part\n          | .inductiveProj \u27e8indBlockF, _\u27e9 =>\n            checkIndBlock indBlockF\n            return ()\n          | .constructorProj \u27e8indBlockF, _, _\u27e9 =>\n            checkIndBlock indBlockF\n            return ()\n          | .recursorProj \u27e8indBlockF, _, _\u27e9 =>\n            checkIndBlock indBlockF\n            return ()\n          | .quotient data =>\n            let (type, _) \u2190 isSort (\u2190 c.type)\n            pure $ .quotient type data.kind\n          | _ => throw \"Impossible case. Cannot typecheck a mutual block.\"\n        -- TODO is it okay to use the original hash for the `TypedConst`, or should we compute a new one?\n        modify fun stt => { stt with typedConsts := stt.typedConsts.insert f newConst }\nend\n\nend Yatima.Typechecker\n", "meta": {"author": "lurk-lab", "repo": "yatima", "sha": "f33b0bf1052d95f9acbbe61681b1b58c0b97121e", "save_path": "github-repos/lean/lurk-lab-yatima", "path": "github-repos/lean/lurk-lab-yatima/yatima-f33b0bf1052d95f9acbbe61681b1b58c0b97121e/Yatima/Typechecker/Infer.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5078118642792044, "lm_q2_score": 0.36296921241058616, "lm_q1q2_score": 0.18432007243017431}}
{"text": "import for_mathlib.category_theory.localization.shift\nimport for_mathlib.category_theory.triangulated.triangulated_functor\n\nopen category_theory category_theory.limits\n\nnamespace category_theory\n\nnamespace functor\n\nvariables {C H D : Type*} [category C] [category H] [category D]\n  [has_shift C \u2124] [has_shift H \u2124] [has_shift D \u2124]\n  [has_zero_object C] [has_zero_object H] [has_zero_object D]\n  [preadditive C] [preadditive H] [preadditive D]\n  [\u2200 (n : \u2124), (shift_functor C n).additive]\n  [\u2200 (n : \u2124), (shift_functor H n).additive]\n  [\u2200 (n : \u2124), (shift_functor D n).additive]\n  [pretriangulated C] [pretriangulated H] [pretriangulated D]\n  (L : C \u2964 H) [L.has_comm_shift \u2124]\n\nclass ess_surj_on_dist_triang :=\n(condition [] : \u2200 (T : pretriangulated.triangle H) (hT : T \u2208 dist_triang H),\n  \u2203 (T' : pretriangulated.triangle C) (hT' : T' \u2208 dist_triang C),\n    nonempty (L.map_triangle.obj T' \u2245 T))\n\nvariables {L}\n\nlemma is_triangulated.of_ess_surj_on_dist_triang [L.ess_surj_on_dist_triang]\n  {F : C \u2964 D} {G : H \u2964 D} (e : L \u22d9 G \u2245 F) [G.has_comm_shift \u2124] [F.has_comm_shift \u2124]\n  [F.is_triangulated] [e.hom.respects_comm_shift \u2124] : G.is_triangulated :=\n{ map_distinguished' := \u03bb T hT, begin\n    obtain \u27e8T', hT', \u27e8e\u2081\u27e9\u27e9 := ess_surj_on_dist_triang.condition L T hT,\n    exact pretriangulated.isomorphic_distinguished _ (F.map_distinguished _ hT') _\n      (G.map_triangle.map_iso e\u2081.symm \u226a\u226b (map_triangle_comp L G).symm.app T' \u226a\u226b\n      (map_triangle_nat_iso e).app T'),\n  end }\n\ninstance localization_lift_is_triangulated [L.ess_surj_on_dist_triang]\n  (W : morphism_property C) [L.is_localization W]\n  (F : C \u2964 D) (hF : W.is_inverted_by F) [F.has_comm_shift \u2124] [F.is_triangulated] :\n  (localization.lift F hF L).is_triangulated :=\nis_triangulated.of_ess_surj_on_dist_triang (localization.fac F hF L)\n\nend functor\n\nend category_theory\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/category_theory/localization/triangulated_functor.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5506073655352404, "lm_q2_score": 0.33458945452352534, "lm_q1q2_score": 0.1842274180910714}}
{"text": "/-\nFile: signature_recover_public_key_recover_public_key_soundness.lean\n\nAutogenerated file.\n-/\nimport starkware.cairo.lean.semantics.soundness.hoare\nimport .signature_recover_public_key_code\nimport ..signature_recover_public_key_spec\nimport .signature_recover_public_key_get_generator_point_soundness\nimport .signature_recover_public_key_ec_negate_soundness\nimport .signature_recover_public_key_div_mod_n_soundness\nimport .signature_recover_public_key_get_point_from_x_soundness\nimport .signature_recover_public_key_ec_mul_soundness\nopen tactic\n\nopen starkware.cairo.common.cairo_secp.signature\nopen starkware.cairo.common.math\nopen starkware.cairo.common.cairo_secp.bigint\nopen starkware.cairo.common.cairo_secp.field\nopen starkware.cairo.common.cairo_secp.ec\n\nvariables {F : Type} [field F] [decidable_eq F] [prelude_hyps F]\nvariable  mem : F \u2192 F\nvariable  \u03c3 : register_state F\n\n/- starkware.cairo.common.cairo_secp.signature.recover_public_key autogenerated soundness theorem -/\n\ntheorem auto_sound_recover_public_key\n    -- arguments\n    (range_check_ptr : F) (msg_hash r s : BigInt3 F) (v : F)\n    -- code is in memory at \u03c3.pc\n    (h_mem : mem_at mem code_recover_public_key \u03c3.pc)\n    -- all dependencies are in memory\n    (h_mem_0 : mem_at mem code_assert_nn (\u03c3.pc  - 817))\n    (h_mem_1 : mem_at mem code_assert_le (\u03c3.pc  - 813))\n    (h_mem_2 : mem_at mem code_assert_nn_le (\u03c3.pc  - 808))\n    (h_mem_3 : mem_at mem code_bigint_mul (\u03c3.pc  - 799))\n    (h_mem_4 : mem_at mem code_nondet_bigint3 (\u03c3.pc  - 785))\n    (h_mem_5 : mem_at mem code_unreduced_mul (\u03c3.pc  - 773))\n    (h_mem_6 : mem_at mem code_unreduced_sqr (\u03c3.pc  - 753))\n    (h_mem_7 : mem_at mem code_verify_zero (\u03c3.pc  - 737))\n    (h_mem_8 : mem_at mem code_is_zero (\u03c3.pc  - 714))\n    (h_mem_9 : mem_at mem code_reduce (\u03c3.pc  - 678))\n    (h_mem_10 : mem_at mem code_validate_reduced_field_element (\u03c3.pc  - 665))\n    (h_mem_11 : mem_at mem code_ec_negate (\u03c3.pc  - 625))\n    (h_mem_12 : mem_at mem code_compute_doubling_slope (\u03c3.pc  - 609))\n    (h_mem_13 : mem_at mem code_compute_slope (\u03c3.pc  - 565))\n    (h_mem_14 : mem_at mem code_ec_double (\u03c3.pc  - 541))\n    (h_mem_15 : mem_at mem code_fast_ec_add (\u03c3.pc  - 468))\n    (h_mem_16 : mem_at mem code_ec_add (\u03c3.pc  - 381))\n    (h_mem_17 : mem_at mem code_ec_mul_inner (\u03c3.pc  - 325))\n    (h_mem_18 : mem_at mem code_ec_mul (\u03c3.pc  - 224))\n    (h_mem_19 : mem_at mem code_get_generator_point (\u03c3.pc  - 144))\n    (h_mem_20 : mem_at mem code_div_mod_n (\u03c3.pc  - 131))\n    (h_mem_21 : mem_at mem code_get_point_from_x (\u03c3.pc  - 66))\n    -- input arguments on the stack\n    (hin_range_check_ptr : range_check_ptr = mem (\u03c3.fp - 13))\n    (hin_msg_hash : msg_hash = cast_BigInt3 mem (\u03c3.fp - 12))\n    (hin_r : r = cast_BigInt3 mem (\u03c3.fp - 9))\n    (hin_s : s = cast_BigInt3 mem (\u03c3.fp - 6))\n    (hin_v : v = mem (\u03c3.fp - 3))\n    -- conclusion\n  : ensures_ret mem \u03c3 (\u03bb \u03ba \u03c4,\n      \u2203 \u03bc \u2264 \u03ba, rc_ensures mem (rc_bound F) \u03bc (mem (\u03c3.fp - 13)) (mem $ \u03c4.ap - 7)\n        (spec_recover_public_key mem \u03ba range_check_ptr msg_hash r s v (mem (\u03c4.ap - 7)) (cast_EcPoint mem (\u03c4.ap - 6)))) :=\nbegin\n  apply ensures_of_ensuresb, intro \u03bdbound,\n  have h_mem_rec := h_mem,\n  unpack_memory code_recover_public_key at h_mem with \u27e8hpc0, hpc1, hpc2, hpc3, hpc4, hpc5, hpc6, hpc7, hpc8, hpc9, hpc10, hpc11, hpc12, hpc13, hpc14, hpc15, hpc16, hpc17, hpc18, hpc19, hpc20, hpc21, hpc22, hpc23, hpc24, hpc25, hpc26, hpc27, hpc28, hpc29, hpc30, hpc31, hpc32, hpc33, hpc34, hpc35, hpc36, hpc37, hpc38, hpc39, hpc40, hpc41, hpc42, hpc43, hpc44, hpc45, hpc46, hpc47, hpc48, hpc49, hpc50, hpc51, hpc52, hpc53, hpc54, hpc55, hpc56, hpc57, hpc58, hpc59, hpc60, hpc61, hpc62, hpc63, hpc64, hpc65, hpc66, hpc67, hpc68, hpc69, hpc70, hpc71, hpc72, hpc73, hpc74, hpc75, hpc76, hpc77, hpc78, hpc79, hpc80, hpc81, hpc82, hpc83, hpc84, hpc85\u27e9,\n  -- ap += 15\n  step_advance_ap hpc0 hpc1,\n  -- function call\n  step_assert_eq hpc2 with arg0,\n  step_assert_eq hpc3 with arg1,\n  step_assert_eq hpc4 with arg2,\n  step_assert_eq hpc5 with arg3,\n  step_assert_eq hpc6 with arg4,\n  step_sub hpc7 (auto_sound_get_point_from_x mem _ range_check_ptr r v _ _ _ _ _ _ _ _ _ _ _ _ _),\n  { rw hpc8, norm_num2, exact h_mem_21 },\n  { rw hpc8, norm_num2, exact h_mem_0 },\n  { rw hpc8, norm_num2, exact h_mem_1 },\n  { rw hpc8, norm_num2, exact h_mem_2 },\n  { rw hpc8, norm_num2, exact h_mem_4 },\n  { rw hpc8, norm_num2, exact h_mem_5 },\n  { rw hpc8, norm_num2, exact h_mem_6 },\n  { rw hpc8, norm_num2, exact h_mem_7 },\n  { rw hpc8, norm_num2, exact h_mem_9 },\n  { rw hpc8, norm_num2, exact h_mem_10 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v] },\n    try { dsimp [cast_BigInt3] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v] },\n      try { dsimp [cast_BigInt3] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v] },\n    try { dsimp [cast_BigInt3] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  intros \u03ba_call9 ap9 h_call9,\n  rcases h_call9 with \u27e8rc_m9, rc_mle9, hl_range_check_ptr\u2081, h_call9\u27e9,\n  generalize' hr_rev_range_check_ptr\u2081: mem (ap9 - 7) = range_check_ptr\u2081,\n  have htv_range_check_ptr\u2081 := hr_rev_range_check_ptr\u2081.symm, clear hr_rev_range_check_ptr\u2081,\n  generalize' hr_rev_r_point: cast_EcPoint mem (ap9 - 6) = r_point,\n  simp only [hr_rev_r_point] at h_call9,\n  have htv_r_point := hr_rev_r_point.symm, clear hr_rev_r_point,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4] at hl_range_check_ptr\u2081 },\n  rw [\u2190htv_range_check_ptr\u2081, \u2190hin_range_check_ptr] at hl_range_check_ptr\u2081,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4] at h_call9 },\n  rw [hin_range_check_ptr] at h_call9,\n  clear arg0 arg1 arg2 arg3 arg4,\n  -- local var\n  step_assert_eq hpc9 with temp0,\n  step_assert_eq hpc10 with temp1,\n  step_assert_eq hpc11 with temp2,\n  step_assert_eq hpc12 with temp3,\n  step_assert_eq hpc13 with temp4,\n  step_assert_eq hpc14 with temp5,\n  have lc_r_point: r_point = cast_EcPoint mem \u03c3.fp, {\n    try { ext } ; {\n      try { simp only [htv_r_point] },\n      try { dsimp [cast_EcPoint, cast_BigInt3] },\n      try { arith_simps }, try { simp only [temp0, temp1, temp2, temp3, temp4, temp5] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  clear temp0 temp1 temp2 temp3 temp4 temp5,\n  -- function call\n  step_sub hpc15 (auto_sound_get_generator_point mem _  _),\n  { rw hpc16, norm_num2, exact h_mem_19 },\n  intros \u03ba_call17 ap17 h_call17,\n  rcases h_call17 with \u27e8h_call17_ap_offset, h_call17\u27e9,\n  generalize' hr_rev_generator_point: cast_EcPoint mem (ap17 - 6) = generator_point,\n  simp only [hr_rev_generator_point] at h_call17,\n  have htv_generator_point := hr_rev_generator_point.symm, clear hr_rev_generator_point,\n  clear ,\n  -- function call\n  step_assert_eq hpc17 with arg0,\n  step_assert_eq hpc18 with arg1,\n  step_assert_eq hpc19 with arg2,\n  step_assert_eq hpc20 with arg3,\n  step_assert_eq hpc21 with arg4,\n  step_assert_eq hpc22 with arg5,\n  step_assert_eq hpc23 with arg6,\n  step_sub hpc24 (auto_sound_div_mod_n mem _ range_check_ptr\u2081 msg_hash r _ _ _ _ _ _),\n  { rw hpc25, norm_num2, exact h_mem_20 },\n  { rw hpc25, norm_num2, exact h_mem_3 },\n  { rw hpc25, norm_num2, exact h_mem_4 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point] },\n    try { dsimp [cast_BigInt3, cast_EcPoint] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6] },\n    try { simp only [h_call17_ap_offset] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6] },\n      try { simp only [h_call17_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6] },\n      try { simp only [h_call17_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  intros \u03ba_call26 ap26 h_call26,\n  rcases h_call26 with \u27e8h_call26_ap_offset, h_call26\u27e9,\n  rcases h_call26 with \u27e8rc_m26, rc_mle26, hl_range_check_ptr\u2082, h_call26\u27e9,\n  generalize' hr_rev_range_check_ptr\u2082: mem (ap26 - 4) = range_check_ptr\u2082,\n  have htv_range_check_ptr\u2082 := hr_rev_range_check_ptr\u2082.symm, clear hr_rev_range_check_ptr\u2082,\n  generalize' hr_rev_u1: cast_BigInt3 mem (ap26 - 3) = u1,\n  simp only [hr_rev_u1] at h_call26,\n  have htv_u1 := hr_rev_u1.symm, clear hr_rev_u1,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6] at hl_range_check_ptr\u2082 },\n  try { rw [h_call17_ap_offset] at hl_range_check_ptr\u2082 }, try { arith_simps at hl_range_check_ptr\u2082 },\n  rw [\u2190htv_range_check_ptr\u2082, \u2190htv_range_check_ptr\u2081] at hl_range_check_ptr\u2082,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6] at h_call26 },\n  try { rw [h_call17_ap_offset] at h_call26 }, try { arith_simps at h_call26 },\n  rw [\u2190htv_range_check_ptr\u2081, hl_range_check_ptr\u2081, hin_range_check_ptr] at h_call26,\n  clear arg0 arg1 arg2 arg3 arg4 arg5 arg6,\n  -- function call\n  step_assert_eq hpc26 with arg0,\n  step_assert_eq hpc27 with arg1,\n  step_assert_eq hpc28 with arg2,\n  step_assert_eq hpc29 with arg3,\n  step_assert_eq hpc30 with arg4,\n  step_assert_eq hpc31 with arg5,\n  step_assert_eq hpc32 with arg6,\n  step_sub hpc33 (auto_sound_div_mod_n mem _ range_check_ptr\u2082 s r _ _ _ _ _ _),\n  { rw hpc34, norm_num2, exact h_mem_20 },\n  { rw hpc34, norm_num2, exact h_mem_3 },\n  { rw hpc34, norm_num2, exact h_mem_4 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1] },\n    try { dsimp [cast_BigInt3, cast_EcPoint] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6] },\n    try { simp only [h_call17_ap_offset, h_call26_ap_offset] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  intros \u03ba_call35 ap35 h_call35,\n  rcases h_call35 with \u27e8h_call35_ap_offset, h_call35\u27e9,\n  rcases h_call35 with \u27e8rc_m35, rc_mle35, hl_range_check_ptr\u2083, h_call35\u27e9,\n  generalize' hr_rev_range_check_ptr\u2083: mem (ap35 - 4) = range_check_ptr\u2083,\n  have htv_range_check_ptr\u2083 := hr_rev_range_check_ptr\u2083.symm, clear hr_rev_range_check_ptr\u2083,\n  generalize' hr_rev_u2: cast_BigInt3 mem (ap35 - 3) = u2,\n  simp only [hr_rev_u2] at h_call35,\n  have htv_u2 := hr_rev_u2.symm, clear hr_rev_u2,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6] at hl_range_check_ptr\u2083 },\n  rw [\u2190htv_range_check_ptr\u2083, \u2190htv_range_check_ptr\u2082] at hl_range_check_ptr\u2083,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6] at h_call35 },\n  rw [\u2190htv_range_check_ptr\u2082, hl_range_check_ptr\u2082, hl_range_check_ptr\u2081, hin_range_check_ptr] at h_call35,\n  clear arg0 arg1 arg2 arg3 arg4 arg5 arg6,\n  -- local var\n  step_assert_eq hpc35 with temp0,\n  step_assert_eq hpc36 with temp1,\n  step_assert_eq hpc37 with temp2,\n  have lc_u2: u2 = cast_BigInt3 mem (\u03c3.fp + 6), {\n    try { ext } ; {\n      try { simp only [htv_u2] },\n      try { dsimp [cast_BigInt3] },\n      try { arith_simps }, try { simp only [temp0, temp1, temp2] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  clear temp0 temp1 temp2,\n  -- function call\n  step_assert_eq hpc38 with arg0,\n  step_assert_eq hpc39 with arg1,\n  step_assert_eq hpc40 with arg2,\n  step_assert_eq hpc41 with arg3,\n  step_assert_eq hpc42 with arg4,\n  step_assert_eq hpc43 with arg5,\n  step_assert_eq hpc44 with arg6,\n  step_assert_eq hpc45 with arg7,\n  step_assert_eq hpc46 with arg8,\n  step_assert_eq hpc47 with arg9,\n  step_sub hpc48 (auto_sound_ec_mul mem _ range_check_ptr\u2083 generator_point u1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _),\n  { rw hpc49, norm_num2, exact h_mem_18 },\n  { rw hpc49, norm_num2, exact h_mem_4 },\n  { rw hpc49, norm_num2, exact h_mem_5 },\n  { rw hpc49, norm_num2, exact h_mem_6 },\n  { rw hpc49, norm_num2, exact h_mem_7 },\n  { rw hpc49, norm_num2, exact h_mem_8 },\n  { rw hpc49, norm_num2, exact h_mem_12 },\n  { rw hpc49, norm_num2, exact h_mem_13 },\n  { rw hpc49, norm_num2, exact h_mem_14 },\n  { rw hpc49, norm_num2, exact h_mem_15 },\n  { rw hpc49, norm_num2, exact h_mem_16 },\n  { rw hpc49, norm_num2, exact h_mem_17 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2] },\n    try { dsimp [cast_BigInt3, cast_EcPoint] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9] },\n    try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  intros \u03ba_call50 ap50 h_call50,\n  rcases h_call50 with \u27e8rc_m50, rc_mle50, hl_range_check_ptr\u2084, h_call50\u27e9,\n  generalize' hr_rev_range_check_ptr\u2084: mem (ap50 - 7) = range_check_ptr\u2084,\n  have htv_range_check_ptr\u2084 := hr_rev_range_check_ptr\u2084.symm, clear hr_rev_range_check_ptr\u2084,\n  generalize' hr_rev_point1: cast_EcPoint mem (ap50 - 6) = point1,\n  simp only [hr_rev_point1] at h_call50,\n  have htv_point1 := hr_rev_point1.symm, clear hr_rev_point1,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9] at hl_range_check_ptr\u2084 },\n  rw [\u2190htv_range_check_ptr\u2084, \u2190htv_range_check_ptr\u2083] at hl_range_check_ptr\u2084,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9] at h_call50 },\n  rw [\u2190htv_range_check_ptr\u2083, hl_range_check_ptr\u2083, hl_range_check_ptr\u2082, hl_range_check_ptr\u2081, hin_range_check_ptr] at h_call50,\n  clear arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9,\n  -- function call\n  step_sub hpc50 (auto_sound_ec_negate mem _ range_check_ptr\u2084 point1 _ _ _ _ _),\n  { rw hpc51, norm_num2, exact h_mem_11 },\n  { rw hpc51, norm_num2, exact h_mem_4 },\n  { rw hpc51, norm_num2, exact h_mem_7 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1] },\n    try { dsimp [cast_BigInt3, cast_EcPoint] },\n    try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  intros \u03ba_call52 ap52 h_call52,\n  rcases h_call52 with \u27e8h_call52_ap_offset, h_call52\u27e9,\n  rcases h_call52 with \u27e8rc_m52, rc_mle52, hl_range_check_ptr\u2085, h_call52\u27e9,\n  generalize' hr_rev_range_check_ptr\u2085: mem (ap52 - 7) = range_check_ptr\u2085,\n  have htv_range_check_ptr\u2085 := hr_rev_range_check_ptr\u2085.symm, clear hr_rev_range_check_ptr\u2085,\n  generalize' hr_rev_minus_point1: cast_EcPoint mem (ap52 - 6) = minus_point1,\n  simp only [hr_rev_minus_point1] at h_call52,\n  have htv_minus_point1 := hr_rev_minus_point1.symm, clear hr_rev_minus_point1,\n  rw [\u2190htv_range_check_ptr\u2085, \u2190htv_range_check_ptr\u2084] at hl_range_check_ptr\u2085,\n  rw [\u2190htv_range_check_ptr\u2084, hl_range_check_ptr\u2084, hl_range_check_ptr\u2083, hl_range_check_ptr\u2082, hl_range_check_ptr\u2081, hin_range_check_ptr] at h_call52,\n  clear ,\n  -- local var\n  step_assert_eq hpc52 with temp0,\n  step_assert_eq hpc53 with temp1,\n  step_assert_eq hpc54 with temp2,\n  step_assert_eq hpc55 with temp3,\n  step_assert_eq hpc56 with temp4,\n  step_assert_eq hpc57 with temp5,\n  have lc_minus_point1: minus_point1 = cast_EcPoint mem (\u03c3.fp + 9), {\n    try { ext } ; {\n      try { simp only [htv_minus_point1] },\n      try { dsimp [cast_EcPoint, cast_BigInt3] },\n      try { arith_simps }, try { simp only [temp0, temp1, temp2, temp3, temp4, temp5] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  clear temp0 temp1 temp2 temp3 temp4 temp5,\n  -- function call\n  step_assert_eq hpc58 with arg0,\n  step_assert_eq hpc59 with arg1,\n  step_assert_eq hpc60 with arg2,\n  step_assert_eq hpc61 with arg3,\n  step_assert_eq hpc62 with arg4,\n  step_assert_eq hpc63 with arg5,\n  step_assert_eq hpc64 with arg6,\n  step_assert_eq hpc65 with arg7,\n  step_assert_eq hpc66 with arg8,\n  step_assert_eq hpc67 with arg9,\n  step_sub hpc68 (auto_sound_ec_mul mem _ range_check_ptr\u2085 r_point u2 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _),\n  { rw hpc69, norm_num2, exact h_mem_18 },\n  { rw hpc69, norm_num2, exact h_mem_4 },\n  { rw hpc69, norm_num2, exact h_mem_5 },\n  { rw hpc69, norm_num2, exact h_mem_6 },\n  { rw hpc69, norm_num2, exact h_mem_7 },\n  { rw hpc69, norm_num2, exact h_mem_8 },\n  { rw hpc69, norm_num2, exact h_mem_12 },\n  { rw hpc69, norm_num2, exact h_mem_13 },\n  { rw hpc69, norm_num2, exact h_mem_14 },\n  { rw hpc69, norm_num2, exact h_mem_15 },\n  { rw hpc69, norm_num2, exact h_mem_16 },\n  { rw hpc69, norm_num2, exact h_mem_17 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1] },\n    try { dsimp [cast_BigInt3, cast_EcPoint] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9] },\n    try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  intros \u03ba_call70 ap70 h_call70,\n  rcases h_call70 with \u27e8rc_m70, rc_mle70, hl_range_check_ptr\u2086, h_call70\u27e9,\n  generalize' hr_rev_range_check_ptr\u2086: mem (ap70 - 7) = range_check_ptr\u2086,\n  have htv_range_check_ptr\u2086 := hr_rev_range_check_ptr\u2086.symm, clear hr_rev_range_check_ptr\u2086,\n  generalize' hr_rev_point2: cast_EcPoint mem (ap70 - 6) = point2,\n  simp only [hr_rev_point2] at h_call70,\n  have htv_point2 := hr_rev_point2.symm, clear hr_rev_point2,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9] at hl_range_check_ptr\u2086 },\n  rw [\u2190htv_range_check_ptr\u2086, \u2190htv_range_check_ptr\u2085] at hl_range_check_ptr\u2086,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9] at h_call70 },\n  rw [\u2190htv_range_check_ptr\u2085, hl_range_check_ptr\u2085, hl_range_check_ptr\u2084, hl_range_check_ptr\u2083, hl_range_check_ptr\u2082, hl_range_check_ptr\u2081, hin_range_check_ptr] at h_call70,\n  clear arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9,\n  -- function call\n  step_assert_eq hpc70 with arg0,\n  step_assert_eq hpc71 with arg1,\n  step_assert_eq hpc72 with arg2,\n  step_assert_eq hpc73 with arg3,\n  step_assert_eq hpc74 with arg4,\n  step_assert_eq hpc75 with arg5,\n  step_assert_eq hpc76 with arg6,\n  step_assert_eq hpc77 with arg7,\n  step_assert_eq hpc78 with arg8,\n  step_assert_eq hpc79 with arg9,\n  step_assert_eq hpc80 with arg10,\n  step_assert_eq hpc81 with arg11,\n  step_assert_eq hpc82 with arg12,\n  step_sub hpc83 (auto_sound_ec_add mem _ range_check_ptr\u2086 minus_point1 point2 _ _ _ _ _ _ _ _ _ _ _ _ _),\n  { rw hpc84, norm_num2, exact h_mem_16 },\n  { rw hpc84, norm_num2, exact h_mem_4 },\n  { rw hpc84, norm_num2, exact h_mem_5 },\n  { rw hpc84, norm_num2, exact h_mem_6 },\n  { rw hpc84, norm_num2, exact h_mem_7 },\n  { rw hpc84, norm_num2, exact h_mem_8 },\n  { rw hpc84, norm_num2, exact h_mem_12 },\n  { rw hpc84, norm_num2, exact h_mem_13 },\n  { rw hpc84, norm_num2, exact h_mem_14 },\n  { rw hpc84, norm_num2, exact h_mem_15 },\n  { try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1, htv_range_check_ptr\u2086, htv_point2] },\n    try { dsimp [cast_BigInt3, cast_EcPoint] },\n    try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12] },\n    try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n    try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } }, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1, htv_range_check_ptr\u2086, htv_point2] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  { try { ext } ; {\n      try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1, htv_range_check_ptr\u2086, htv_point2] },\n      try { dsimp [cast_BigInt3, cast_EcPoint] },\n      try { arith_simps }, try { simp only [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12] },\n      try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n      try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },}, },\n  intros \u03ba_call85 ap85 h_call85,\n  rcases h_call85 with \u27e8rc_m85, rc_mle85, hl_range_check_ptr\u2087, h_call85\u27e9,\n  generalize' hr_rev_range_check_ptr\u2087: mem (ap85 - 7) = range_check_ptr\u2087,\n  have htv_range_check_ptr\u2087 := hr_rev_range_check_ptr\u2087.symm, clear hr_rev_range_check_ptr\u2087,\n  generalize' hr_rev_public_key_point: cast_EcPoint mem (ap85 - 6) = public_key_point,\n  simp only [hr_rev_public_key_point] at h_call85,\n  have htv_public_key_point := hr_rev_public_key_point.symm, clear hr_rev_public_key_point,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9 ,arg10 ,arg11 ,arg12] at hl_range_check_ptr\u2087 },\n  rw [\u2190htv_range_check_ptr\u2087, \u2190htv_range_check_ptr\u2086] at hl_range_check_ptr\u2087,\n  try { simp only [arg0 ,arg1 ,arg2 ,arg3 ,arg4 ,arg5 ,arg6 ,arg7 ,arg8 ,arg9 ,arg10 ,arg11 ,arg12] at h_call85 },\n  rw [\u2190htv_range_check_ptr\u2086, hl_range_check_ptr\u2086, hl_range_check_ptr\u2085, hl_range_check_ptr\u2084, hl_range_check_ptr\u2083, hl_range_check_ptr\u2082, hl_range_check_ptr\u2081, hin_range_check_ptr] at h_call85,\n  clear arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12,\n  -- return\n  step_ret hpc85,\n  -- finish\n  step_done, use_only [rfl, rfl],\n  -- range check condition\n  use_only (rc_m9+rc_m26+rc_m35+rc_m50+rc_m52+rc_m70+rc_m85+0+0), split,\n  linarith [rc_mle9, rc_mle26, rc_mle35, rc_mle50, rc_mle52, rc_mle70, rc_mle85],\n  split,\n  { arith_simps,\n    rw [\u2190htv_range_check_ptr\u2087, hl_range_check_ptr\u2087, hl_range_check_ptr\u2086, hl_range_check_ptr\u2085, hl_range_check_ptr\u2084, hl_range_check_ptr\u2083, hl_range_check_ptr\u2082, hl_range_check_ptr\u2081, hin_range_check_ptr],\n    try { arith_simps, refl <|> norm_cast }, try { refl } },\n  intro rc_h_range_check_ptr, repeat { rw [add_assoc] at rc_h_range_check_ptr },\n  have rc_h_range_check_ptr' := range_checked_add_right rc_h_range_check_ptr,\n  -- Final Proof\n  -- user-provided reduction\n  suffices auto_spec: auto_spec_recover_public_key mem _ range_check_ptr msg_hash r s v _ _,\n  { apply sound_recover_public_key, apply auto_spec },\n  -- prove the auto generated assertion\n  dsimp [auto_spec_recover_public_key],\n  try { norm_num1 }, try { arith_simps },\n  use_only [\u03ba_call9],\n  use_only [range_check_ptr\u2081],\n  use_only [r_point],\n  have rc_h_range_check_ptr\u2081 := range_checked_offset' rc_h_range_check_ptr,\n  have rc_h_range_check_ptr\u2081' := range_checked_add_right rc_h_range_check_ptr\u2081, try { norm_cast at rc_h_range_check_ptr\u2081' },\n  have spec9 := h_call9 rc_h_range_check_ptr',\n  rw [\u2190hin_range_check_ptr, \u2190htv_range_check_ptr\u2081] at spec9,\n  try { dsimp at spec9, arith_simps at spec9 },\n  use_only [spec9],\n  use_only [\u03ba_call17],\n  use_only [generator_point],\n  try { dsimp at h_call17, arith_simps at h_call17 },\n  try { use_only [h_call17] },\n  use_only [\u03ba_call26],\n  use_only [range_check_ptr\u2082],\n  use_only [u1],\n  have rc_h_range_check_ptr\u2082 := range_checked_offset' rc_h_range_check_ptr\u2081,\n  have rc_h_range_check_ptr\u2082' := range_checked_add_right rc_h_range_check_ptr\u2082, try { norm_cast at rc_h_range_check_ptr\u2082' },\n  have spec26 := h_call26 rc_h_range_check_ptr\u2081',\n  rw [\u2190hin_range_check_ptr, \u2190hl_range_check_ptr\u2081, \u2190htv_range_check_ptr\u2082] at spec26,\n  try { dsimp at spec26, arith_simps at spec26 },\n  use_only [spec26],\n  use_only [\u03ba_call35],\n  use_only [range_check_ptr\u2083],\n  use_only [u2],\n  have rc_h_range_check_ptr\u2083 := range_checked_offset' rc_h_range_check_ptr\u2082,\n  have rc_h_range_check_ptr\u2083' := range_checked_add_right rc_h_range_check_ptr\u2083, try { norm_cast at rc_h_range_check_ptr\u2083' },\n  have spec35 := h_call35 rc_h_range_check_ptr\u2082',\n  rw [\u2190hin_range_check_ptr, \u2190hl_range_check_ptr\u2081, \u2190hl_range_check_ptr\u2082, \u2190htv_range_check_ptr\u2083] at spec35,\n  try { dsimp at spec35, arith_simps at spec35 },\n  use_only [spec35],\n  use_only [\u03ba_call50],\n  use_only [range_check_ptr\u2084],\n  use_only [point1],\n  have rc_h_range_check_ptr\u2084 := range_checked_offset' rc_h_range_check_ptr\u2083,\n  have rc_h_range_check_ptr\u2084' := range_checked_add_right rc_h_range_check_ptr\u2084, try { norm_cast at rc_h_range_check_ptr\u2084' },\n  have spec50 := h_call50 rc_h_range_check_ptr\u2083',\n  rw [\u2190hin_range_check_ptr, \u2190hl_range_check_ptr\u2081, \u2190hl_range_check_ptr\u2082, \u2190hl_range_check_ptr\u2083, \u2190htv_range_check_ptr\u2084] at spec50,\n  try { dsimp at spec50, arith_simps at spec50 },\n  use_only [spec50],\n  use_only [\u03ba_call52],\n  use_only [range_check_ptr\u2085],\n  use_only [minus_point1],\n  have rc_h_range_check_ptr\u2085 := range_checked_offset' rc_h_range_check_ptr\u2084,\n  have rc_h_range_check_ptr\u2085' := range_checked_add_right rc_h_range_check_ptr\u2085, try { norm_cast at rc_h_range_check_ptr\u2085' },\n  have spec52 := h_call52 rc_h_range_check_ptr\u2084',\n  rw [\u2190hin_range_check_ptr, \u2190hl_range_check_ptr\u2081, \u2190hl_range_check_ptr\u2082, \u2190hl_range_check_ptr\u2083, \u2190hl_range_check_ptr\u2084, \u2190htv_range_check_ptr\u2085] at spec52,\n  try { dsimp at spec52, arith_simps at spec52 },\n  use_only [spec52],\n  use_only [\u03ba_call70],\n  use_only [range_check_ptr\u2086],\n  use_only [point2],\n  have rc_h_range_check_ptr\u2086 := range_checked_offset' rc_h_range_check_ptr\u2085,\n  have rc_h_range_check_ptr\u2086' := range_checked_add_right rc_h_range_check_ptr\u2086, try { norm_cast at rc_h_range_check_ptr\u2086' },\n  have spec70 := h_call70 rc_h_range_check_ptr\u2085',\n  rw [\u2190hin_range_check_ptr, \u2190hl_range_check_ptr\u2081, \u2190hl_range_check_ptr\u2082, \u2190hl_range_check_ptr\u2083, \u2190hl_range_check_ptr\u2084, \u2190hl_range_check_ptr\u2085, \u2190htv_range_check_ptr\u2086] at spec70,\n  try { dsimp at spec70, arith_simps at spec70 },\n  use_only [spec70],\n  use_only [\u03ba_call85],\n  use_only [range_check_ptr\u2087],\n  use_only [public_key_point],\n  have rc_h_range_check_ptr\u2087 := range_checked_offset' rc_h_range_check_ptr\u2086,\n  have rc_h_range_check_ptr\u2087' := range_checked_add_right rc_h_range_check_ptr\u2087, try { norm_cast at rc_h_range_check_ptr\u2087' },\n  have spec85 := h_call85 rc_h_range_check_ptr\u2086',\n  rw [\u2190hin_range_check_ptr, \u2190hl_range_check_ptr\u2081, \u2190hl_range_check_ptr\u2082, \u2190hl_range_check_ptr\u2083, \u2190hl_range_check_ptr\u2084, \u2190hl_range_check_ptr\u2085, \u2190hl_range_check_ptr\u2086, \u2190htv_range_check_ptr\u2087] at spec85,\n  try { dsimp at spec85, arith_simps at spec85 },\n  use_only [spec85],\n  try { split, linarith },\n  try { ensures_simps; try { simp only [add_neg_eq_sub, hin_range_check_ptr, hin_msg_hash, hin_r, hin_s, hin_v, htv_range_check_ptr\u2081, htv_r_point, lc_r_point, htv_generator_point, htv_range_check_ptr\u2082, htv_u1, htv_range_check_ptr\u2083, htv_u2, lc_u2, htv_range_check_ptr\u2084, htv_point1, htv_range_check_ptr\u2085, htv_minus_point1, lc_minus_point1, htv_range_check_ptr\u2086, htv_point2, htv_range_check_ptr\u2087, htv_public_key_point] }, },\n  try { dsimp [cast_BigInt3, cast_EcPoint] },\n  try { simp only [h_call17_ap_offset, h_call26_ap_offset, h_call35_ap_offset, h_call52_ap_offset] },\n  try { arith_simps; try { split }; triv <|> refl <|> simp <|> abel; try { norm_num } },\nend\n\n", "meta": {"author": "starkware-libs", "repo": "formal-proofs", "sha": "35613c65b6715601bbc0a550d52754f8e7d93e30", "save_path": "github-repos/lean/starkware-libs-formal-proofs", "path": "github-repos/lean/starkware-libs-formal-proofs/formal-proofs-35613c65b6715601bbc0a550d52754f8e7d93e30/src/starkware/cairo/common/cairo_secp/verification/verification/signature_recover_public_key_recover_public_key_soundness.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5389832206876841, "lm_q2_score": 0.341582499438317, "lm_q1q2_score": 0.18410723567781315}}
{"text": "import phase2.approximation\n\nopen set\nopen_locale classical\n\nuniverse u\n\nnamespace con_nf\nvariables [params.{u}] (\u03b1 : \u039b) [position_data.{}] [phase_2_assumptions \u03b1] {\u03b2 : type_index}\n  (\u03c0 : near_litter_approx) (A : extended_index \u03b2)\n\nnamespace near_litter_approx\n\ndef id_on_flexible : local_perm litter := {\n  to_fun := id,\n  inv_fun := id,\n  domain := {L | flexible \u03b1 L A} \\ \u03c0.litter_perm.domain,\n  to_fun_domain' := \u03bb L h, h,\n  inv_fun_domain' := \u03bb L h, h,\n  left_inv' := \u03bb L h, rfl,\n  right_inv' := \u03bb L h, rfl,\n}\n\nlemma id_on_flexible_domain :\n  (id_on_flexible \u03b1 \u03c0 A).domain = {L | flexible \u03b1 L A} \\ \u03c0.litter_perm.domain := rfl\n\nlemma id_on_flexible_domain_disjoint :\n  disjoint \u03c0.litter_perm.domain (id_on_flexible \u03b1 \u03c0 A).domain :=\nby rw [disjoint_iff_inter_eq_empty, id_on_flexible_domain, inter_diff_self]\n\nnoncomputable def flexible_completion_litter_perm : local_perm litter :=\nlocal_perm.piecewise \u03c0.litter_perm (id_on_flexible \u03b1 \u03c0 A) (id_on_flexible_domain_disjoint \u03b1 \u03c0 A)\n\nlemma flexible_completion_litter_perm_domain' :\n  (flexible_completion_litter_perm \u03b1 \u03c0 A).domain = \u03c0.litter_perm.domain \u222a {L | flexible \u03b1 L A} :=\nby rw [flexible_completion_litter_perm, local_perm.piecewise_domain,\n  id_on_flexible_domain, union_diff_self]\n\nnoncomputable def flexible_completion : near_litter_approx := {\n  atom_perm := \u03c0.atom_perm,\n  litter_perm := flexible_completion_litter_perm \u03b1 \u03c0 A,\n  domain_small := \u03c0.domain_small,\n}\n\nlemma flexible_completion_litter_perm_domain :\n  (flexible_completion \u03b1 \u03c0 A).litter_perm.domain = \u03c0.litter_perm.domain \u222a {L | flexible \u03b1 L A} :=\nby rw [flexible_completion, flexible_completion_litter_perm_domain']\n\nlemma flexible_completion_litter_perm_domain_free (h\u03c0 : \u03c0.free \u03b1 A) :\n  (flexible_completion \u03b1 \u03c0 A).litter_perm.domain = {L | flexible \u03b1 L A} :=\nbegin\n  rw [flexible_completion_litter_perm_domain, union_eq_right_iff_subset],\n  exact \u03bb L hL, h\u03c0 L hL,\nend\n\nend near_litter_approx\n\nend con_nf\n", "meta": {"author": "leanprover-community", "repo": "con-nf", "sha": "f0b66bd73ca5d3bd8b744985242c4c0b5464913f", "save_path": "github-repos/lean/leanprover-community-con-nf", "path": "github-repos/lean/leanprover-community-con-nf/con-nf-f0b66bd73ca5d3bd8b744985242c4c0b5464913f/src/phase2/flexible_completion.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.538983220687684, "lm_q2_score": 0.341582499438317, "lm_q1q2_score": 0.1841072356778131}}
{"text": "import for_mathlib.algebra.homology.derived_category\n\nnoncomputable theory\n\nopen category_theory category_theory.limits category_theory.category\nopen_locale zero_object\n\nvariables {C : Type*} [category C] [abelian C]\n\nnamespace category_theory\n\nlemma iso.is_iso_app_iff {C D : Type*} [category C] [category D] {X Y : C} (e : X \u2245 Y)\n  {F G : C \u2964 D} (\u03c6 : F \u27f6 G) :\n  is_iso (\u03c6.app X) \u2194 is_iso (\u03c6.app Y) :=\nbegin\n  suffices : \u2200 \u2983X Y : C\u2984 (e : X \u2245 Y) (hX : is_iso (\u03c6.app X)), is_iso (\u03c6.app Y),\n  { exact \u27e8this e, this e.symm\u27e9, },\n  intros X Y e,\n  introI,\n  refine \u27e8\u27e8G.map e.inv \u226b inv (\u03c6.app X) \u226b F.map e.hom,\n    by simp only [\u2190 functor.map_comp, nat_iso.naturality_2'_assoc, iso.inv_hom_id, functor.map_id],\n    by simp only [\u2190 functor.map_comp, assoc, nat_trans.naturality, is_iso.inv_hom_id_assoc,\n      iso.inv_hom_id, functor.map_id]\u27e9\u27e9,\nend\n\nend category_theory\n\nnamespace category_theory.short_complex\n/-- should be moved... -/\n\nlemma exact.of_is_zero_X\u2082 {C : Type*} [category C] [has_zero_morphisms C]\n  (S : short_complex C) (h : is_zero S.X\u2082) : S.exact :=\nbegin\n  rw (homology_data.of_zeros S (h.eq_of_tgt _ _) (h.eq_of_src _ _)).exact_iff,\n  exact h,\nend\n\nlemma quasi_iso.of_cokernel_cofork {C : Type*} [category C] [has_zero_morphisms C]\n  {S\u2081 S\u2082 : short_complex C} (\u03c6 : S\u2081 \u27f6 S\u2082) [S\u2081.has_homology] [S\u2082.has_homology]\n  [mono \u03c6.\u03c4\u2083] (hf\u2082 : S\u2082.f = 0) (h\u03c4\u2082 : is_colimit (cokernel_cofork.of_\u03c0 \u03c6.\u03c4\u2082\n    (show S\u2081.f \u226b \u03c6.\u03c4\u2082 = 0, by rw [\u2190 \u03c6.comm\u2081\u2082, hf\u2082, comp_zero]))) :\n  short_complex.quasi_iso \u03c6 :=\nbegin\n  have w : S\u2081.f \u226b \u03c6.\u03c4\u2082 = 0 := by rw [\u2190 \u03c6.comm\u2081\u2082, hf\u2082, comp_zero],\n  let h\u2081 := S\u2081.some_right_homology_data,\n  let e : S\u2082.X\u2082 \u2245 h\u2081.Q := is_colimit.cocone_point_unique_up_to_iso h\u03c4\u2082 h\u2081.hp,\n  have he : \u03c6.\u03c4\u2082 \u226b e.hom = h\u2081.p :=\n    is_colimit.comp_cocone_point_unique_up_to_iso_hom h\u03c4\u2082 h\u2081.hp walking_parallel_pair.one,\n  have wp : S\u2082.f \u226b e.hom = 0 := by simp only [hf\u2082, zero_comp],\n  let hp : is_colimit (cokernel_cofork.of_\u03c0 e.hom wp) :=\n    cokernel_cofork.is_colimit.of_\u03c0 _ _ (\u03bb A x hx, e.inv \u226b x)\n      (\u03bb A x hx, e.hom_inv_id_assoc _) (\u03bb A x hx b hb, by simp only [\u2190hb, iso.inv_hom_id_assoc]),\n  have comm : e.inv \u226b S\u2082.g = h\u2081.g' \u226b \u03c6.\u03c4\u2083,\n  { rw [\u2190 cancel_epi h\u2081.p, h\u2081.p_g'_assoc, \u2190 \u03c6.comm\u2082\u2083, \u2190 he, assoc, e.hom_inv_id_assoc], },\n  have w\u03b9 : h\u2081.\u03b9 \u226b e.inv \u226b S\u2082.g = 0 :=\n    by simp only [comm, right_homology_data.\u03b9_g'_assoc, zero_comp],\n  have h\u03b9 : is_limit (kernel_fork.of_\u03b9 h\u2081.\u03b9 w\u03b9) := kernel_fork.is_limit.of_\u03b9 _ _\n      (\u03bb A x hx, h\u2081.h\u03b9.lift (kernel_fork.of_\u03b9 _\n        (show x \u226b h\u2081.g' = 0, by rw [\u2190 cancel_mono \u03c6.\u03c4\u2083, assoc, \u2190 comm, hx, zero_comp])))\n      (\u03bb A x hx, fork.is_limit.lift_\u03b9' _ _)\n      (\u03bb A x hx b hb, by { erw [\u2190 cancel_mono h\u2081.\u03b9, hb, fork.is_limit.lift_\u03b9'], refl, }),\n  let h\u2082 : S\u2082.right_homology_data :=\n  { Q := h\u2081.Q,\n    H := h\u2081.H,\n    p := e.hom,\n    wp := wp,\n    hp := hp,\n    \u03b9 := h\u2081.\u03b9,\n    w\u03b9 := w\u03b9,\n    h\u03b9 := h\u03b9, },\n  let h\u03c6 : right_homology_map_data \u03c6 h\u2081 h\u2082 :=\n  { \u03c6Q := \ud835\udfd9 _,\n    \u03c6H := \ud835\udfd9 _,\n    commp' := begin\n      dsimp [h\u2082],\n      simp only [comp_id, he],\n    end, },\n  rw h\u03c6.quasi_iso_iff,\n  dsimp,\n  apply_instance,\nend\n\nend category_theory.short_complex\n\nopen category_theory category_theory.limits category_theory.category\n\nnamespace cochain_complex\n\nvariables (K L : cochain_complex C \u2124)\n\ndef trunc_ge.X (n : \u2124) (i : \u2124) : C :=\nif i < n\n  then 0\n  else if i = n\n    then (homological_complex.short_complex_functor C (complex_shape.up \u2124) i \u22d9\n      short_complex.cycles_co_functor C).obj K\n    else K.X i\n\nlemma trunc_ge.is_zero_X (n : \u2124) (i : \u2124) (hn : i < n) :\n  is_zero (trunc_ge.X K n i) :=\nbegin\n  dsimp [trunc_ge.X],\n  simpa only [if_pos hn] using is_zero_zero C,\nend\n\ndef trunc_ge.X_iso_X (n : \u2124) (i : \u2124) (hn : n < i) :\n  trunc_ge.X K n i \u2245 K.X i :=\neq_to_iso begin\n  dsimp [trunc_ge.X],\n  rw [if_neg (show \u00aci<n, by linarith), if_neg (show i \u2260 n, by linarith)],\nend\n\ndef trunc_ge.X_iso_cycles_co (n : \u2124) (i : \u2124) (hn : i = n) :\n  trunc_ge.X K n i \u2245 (K.sc' i).cycles_co :=\neq_to_iso begin\n  dsimp [trunc_ge.X],\n  simpa only [if_neg (show \u00ac i<n, by linarith), if_pos hn],\nend\n\ndef trunc_ge.d (n : \u2124) (i j : \u2124) : trunc_ge.X K n i \u27f6 trunc_ge.X K n j :=\nbegin\n  by_cases hij : i+1 = j,\n  { by_cases hi\u2080 : i<n,\n    { exact 0, },\n    { by_cases hn : i = n,\n      { refine (trunc_ge.X_iso_cycles_co K n i hn).hom \u226b\n          short_complex.desc_cycles_co _ (K.d i j \u226b (trunc_ge.X_iso_X K n j (by linarith)).inv) _,\n        have hj : j = (complex_shape.up \u2124).next i,\n        { rw [next],\n          linarith, },\n        subst hj,\n        erw [reassoc_of ((homological_complex.sc' K i).zero), zero_comp], },\n      { exact (trunc_ge.X_iso_X K n i (by { cases (not_lt.1 hi\u2080).lt_or_eq; tauto, })).hom \u226b\n          K.d i j \u226b (trunc_ge.X_iso_X K n j (by linarith)).inv, }, }, },\n  { exact 0, },\nend\n\ndef trunc_ge.\u03c0_f (n i : \u2124) : K.X i \u27f6 trunc_ge.X K n i :=\nbegin\n  by_cases hi : i < n,\n  { exact 0, },\n  { by_cases hn : i = n,\n    { exact (K.sc' i).p_cycles_co \u226b (trunc_ge.X_iso_cycles_co K n i hn).inv, },\n    { exact (trunc_ge.X_iso_X K n i (by { cases (not_lt.1 hi).lt_or_eq; tauto, })).inv, }, },\nend\n\ninstance (n i : \u2124) : epi (trunc_ge.\u03c0_f K n i) :=\nbegin\n  dsimp [trunc_ge.\u03c0_f],\n  by_cases h\u2080 : i < n,\n  { rw dif_pos h\u2080,\n    constructor,\n    intros Z f\u2081 f\u2082 eq,\n    apply (trunc_ge.is_zero_X K n i h\u2080).eq_of_src, },\n  { rw dif_neg h\u2080,\n    by_cases hn : i = n,\n    { rw dif_pos hn,\n      apply epi_comp, },\n    { rw dif_neg hn,\n      apply_instance, }, },\nend\n\nlemma trunc_ge.is_iso_\u03c0_f (n i : \u2124) (hi : n < i) :\n  is_iso (trunc_ge.\u03c0_f K n i) :=\nbegin\n  dsimp [trunc_ge.\u03c0_f],\n  simp only [dif_neg (show \u00ac i < n, by linarith),\n    dif_neg (show i \u2260 n, by linarith)],\n  apply_instance,\nend\n\nlemma trunc_ge.\u03c0_f_eq_zero (n i : \u2124) (hi : i < n) :\n  trunc_ge.\u03c0_f K n i = 0 :=\nby { dsimp [trunc_ge.\u03c0_f], rw [dif_pos hi], }\n\nlemma trunc_ge.\u03c0_f_eq_of_eq (n i : \u2124) (hn : i = n) :\n  trunc_ge.\u03c0_f K n i = (K.sc' i).p_cycles_co \u226b (trunc_ge.X_iso_cycles_co K n i hn).inv :=\nby { dsimp [trunc_ge.\u03c0_f], rw [dif_neg (show \u00aci<n, by linarith), dif_pos hn], }\n\nlemma trunc_ge.\u03c0_f_eq_X_iso_X_inv (n i : \u2124) (hi : n < i) :\n  trunc_ge.\u03c0_f K n i = (trunc_ge.X_iso_X K n i hi).inv :=\nby { dsimp [trunc_ge.\u03c0_f], rw [dif_neg, dif_neg]; linarith, }\n\nlemma trunc_ge.shape (n i j : \u2124) (hij : i+1 \u2260 j) : trunc_ge.d K n i j = 0 :=\nby { dsimp only [trunc_ge.d], rw dif_neg hij, }\n\nlemma trunc_ge.d_eq_zero (n : \u2124) (i j : \u2124) (hj : j \u2264 n) :\n  trunc_ge.d K n i j = 0 :=\nbegin\n  by_cases hij : i+1 = j,\n  { dsimp [trunc_ge.d],\n    rw [dif_pos hij, dif_pos],\n    linarith, },\n  { rw trunc_ge.shape K n i j hij, },\nend\n\nlemma trunc_ge.d_eq_d (n : \u2124) (i j : \u2124) (hij : i + 1 = j) (hi : n < i) :\n  trunc_ge.d K n i j = (trunc_ge.X_iso_X K n i hi).hom \u226b K.d i j \u226b\n    (trunc_ge.X_iso_X K n j (by simpa only [\u2190 hij] using hi.trans (lt_add_one i))).inv :=\nby { dsimp [trunc_ge.d], rw [dif_pos hij, dif_neg, dif_neg]; linarith, }\n\nlemma trunc_ge.d_comp_\u03c0_eq_zero (n : \u2124) (i j : \u2124) (hij : i + 1 = j) (hj : j = n) :\n  K.d i j \u226b trunc_ge.\u03c0_f K n j = 0 :=\nbegin\n  have hi : i = (complex_shape.up \u2124).prev j := by { rw [prev], linarith, },\n  subst hi,\n  dsimp [trunc_ge.\u03c0_f],\n  erw [dif_neg (show \u00acj<n, by linarith), dif_pos hj, \u2190 assoc,\n    (homological_complex.sc' K j).f_cycles_co_p, zero_comp],\nend\n\ndef trunc_ge.\u03c0_is_cokernel (n i j : \u2124) (hij : i + 1 = j) (hj : j = n) :\n  is_colimit (cokernel_cofork.of_\u03c0 _ (trunc_ge.d_comp_\u03c0_eq_zero K n i j hij hj)) :=\nbegin\n  have hij' : i = (complex_shape.up \u2124).prev j := by { rw [prev], linarith, },\n  subst hij',\n  exact is_colimit.of_iso_colimit (homological_complex.sc' K j).cycles_co_is_cokernel\n    (cofork.ext (trunc_ge.X_iso_cycles_co K n j hj).symm (trunc_ge.\u03c0_f_eq_of_eq K n j hj).symm),\nend\n\n@[simp, reassoc]\nlemma trunc_ge.d_comm (n i j : \u2124) :\n  trunc_ge.\u03c0_f K n i \u226b trunc_ge.d K n i j =\n    K.d i j \u226b trunc_ge.\u03c0_f K n j :=\nbegin\n  by_cases hij : i+1 = j,\n  { by_cases hj\u2080 : j < n,\n    { apply (trunc_ge.is_zero_X K n j hj\u2080).eq_of_tgt, },\n    by_cases hj : j = n,\n    { simp only [trunc_ge.d_comp_\u03c0_eq_zero K n i j hij hj,\n        trunc_ge.d_eq_zero K n i j (by linarith), comp_zero], },\n    by_cases hi : i = n,\n    { dsimp [trunc_ge.d, trunc_ge.\u03c0_f],\n      simp only [dif_pos hij, dif_neg (show \u00ac i < n, by linarith), dif_pos hi, dif_neg hj\u2080,\n        trunc_ge.\u03c0_f_eq_X_iso_X_inv K n j (by linarith), assoc, iso.inv_hom_id_assoc,\n        dif_neg hj, short_complex.p_desc_cycles_co], },\n    { have hi' : n < i,\n      { subst hij,\n        cases (not_lt.1 hj\u2080).lt_or_eq,\n        { rw int.lt_add_one_iff at h,\n          cases h.lt_or_eq with h' h',\n          { exact h', },\n          { exfalso, exact hi h'.symm, }, },\n        { exfalso, exact hj h.symm, }, },\n      simp only [trunc_ge.d_eq_d K n i j hij hi', trunc_ge.\u03c0_f_eq_X_iso_X_inv K n i hi',\n        trunc_ge.\u03c0_f_eq_X_iso_X_inv K n j (by linarith), iso.inv_hom_id_assoc], }, },\n  { rw [trunc_ge.shape K n i j hij, K.shape i j hij, zero_comp, comp_zero], },\nend\n\n@[simp, reassoc]\nlemma trunc_ge.d_comp_d (n i j k : \u2124) : trunc_ge.d K n i j \u226b trunc_ge.d K n j k = 0 :=\nby simp only [\u2190 cancel_epi (trunc_ge.\u03c0_f K n i), trunc_ge.d_comm_assoc,\n  trunc_ge.d_comm, homological_complex.d_comp_d_assoc, zero_comp, comp_zero]\n\n@[simps]\ndef trunc_ge (n : \u2124) : cochain_complex C \u2124 :=\n{ X := trunc_ge.X K n,\n  d := trunc_ge.d K n,\n  shape' := trunc_ge.shape K n,\n  d_comp_d' := \u03bb i j k hij hjk, trunc_ge.d_comp_d K n i j k, }\n\n@[simps]\ndef trunc_ge.\u03c0 (n : \u2124) : K \u27f6 K.trunc_ge n :=\n{ f := trunc_ge.\u03c0_f K n,\n  comm' := \u03bb i j hij, trunc_ge.d_comm K n i j, }\n\nvariables {K L}\n\ndef trunc_ge.map_f (\u03c6 : K \u27f6 L) (n i : \u2124) :\n  (K.trunc_ge n).X i \u27f6 (L.trunc_ge n).X i :=\nbegin\n  by_cases hi : n < i,\n  { exact (trunc_ge.X_iso_X K n i hi).hom \u226b \u03c6.f i \u226b\n    (trunc_ge.X_iso_X L n i hi).inv, },\n  { by_cases hn : i = n,\n    { exact (trunc_ge.X_iso_cycles_co K n i hn).hom \u226b\n        (homological_complex.short_complex_functor C (complex_shape.up \u2124) i \u22d9\n        short_complex.cycles_co_functor C).map \u03c6 \u226b (trunc_ge.X_iso_cycles_co L n i hn).inv, },\n    { exact 0, }, },\nend\n\nlemma trunc_ge.map_f_eq_f (\u03c6 : K \u27f6 L) (n i : \u2124) (hi : n < i) :\n  trunc_ge.map_f \u03c6 n i = (trunc_ge.X_iso_X K n i hi).hom \u226b \u03c6.f i \u226b\n    (trunc_ge.X_iso_X L n i hi).inv :=\nbegin\n  dsimp only [trunc_ge.map_f],\n  simp only [dif_pos hi],\nend\n\n@[simp, reassoc]\nlemma trunc_ge.\u03c0_f_comm_map_f (\u03c6 : K \u27f6 L) (n i : \u2124) :\n  trunc_ge.\u03c0_f K n i \u226b trunc_ge.map_f \u03c6 n i =\n    \u03c6.f i \u226b trunc_ge.\u03c0_f L n i :=\nbegin\n  by_cases hi : n < i,\n  { simp only [trunc_ge.\u03c0_f_eq_X_iso_X_inv _ n i hi,\n      trunc_ge.map_f_eq_f \u03c6 n i hi, iso.inv_hom_id_assoc], },\n  { by_cases hn : i = n,\n    { dsimp [trunc_ge.map_f, trunc_ge.\u03c0_f],\n      simp only [dif_neg hi, dif_pos hn, dif_neg (show \u00ac i < n, by linarith), assoc,\n        iso.inv_hom_id_assoc],\n      exact ((short_complex.p_cycles_co_nat_trans C).naturality_assoc\n        ((homological_complex.short_complex_functor C (complex_shape.up \u2124) i).map \u03c6) _).symm, },\n    { refine (trunc_ge.is_zero_X L n i _).eq_of_tgt _ _,\n      cases (not_lt.1 hi).lt_or_eq,\n      { exact h, },\n      { exfalso, exact hn h, }, }, },\nend\n\n@[reassoc]\nlemma trunc_ge.map_comm_f (\u03c6 : K \u27f6 L) (n i j : \u2124) :\n  trunc_ge.map_f \u03c6 n i \u226b trunc_ge.d L n i j =\n    trunc_ge.d K n i j \u226b trunc_ge.map_f \u03c6 n j :=\nby simp only [\u2190 cancel_epi (trunc_ge.\u03c0_f K n i), trunc_ge.\u03c0_f_comm_map_f_assoc,\n  trunc_ge.d_comm, homological_complex.hom.comm_assoc,\n  trunc_ge.d_comm_assoc, trunc_ge.\u03c0_f_comm_map_f]\n\n@[simp]\nlemma trunc_ge.map_id_f (K : cochain_complex C \u2124) (n i : \u2124) :\n  trunc_ge.map_f (\ud835\udfd9 K) n i = \ud835\udfd9 _ :=\nbegin\n  simp only [\u2190 cancel_epi (trunc_ge.\u03c0_f K n i), trunc_ge.\u03c0_f_comm_map_f,\n    homological_complex.id_f, id_comp],\n  erw comp_id,\nend\n\n@[simp]\nlemma trunc_ge.map_comp_f {K L M : cochain_complex C \u2124}\n  (\u03c6 : K \u27f6 L) (\u03c6' : L \u27f6 M) (n i : \u2124) :\n  trunc_ge.map_f (\u03c6 \u226b \u03c6') n i =\n    trunc_ge.map_f \u03c6 n i \u226b trunc_ge.map_f \u03c6' n i :=\nby simp only [\u2190 cancel_epi (trunc_ge.\u03c0_f K n i), trunc_ge.\u03c0_f_comm_map_f,\n    homological_complex.comp_f, assoc, trunc_ge.\u03c0_f_comm_map_f_assoc]\n\nvariable (C)\n\n@[simps]\ndef trunc_ge_functor (n : \u2124) :\n  cochain_complex C \u2124 \u2964 cochain_complex C \u2124 :=\n{ obj := \u03bb K, K.trunc_ge n,\n  map := \u03bb K L \u03c6,\n  { f := \u03bb i, trunc_ge.map_f \u03c6 n i,\n    comm' := \u03bb i j hij, trunc_ge.map_comm_f \u03c6 n i j, }, }\n\n@[simps]\ndef trunc_ge.nat_trans_\u03c0 (n : \u2124) :\n  \ud835\udfed _ \u27f6 trunc_ge_functor C n :=\n{ app := \u03bb K, trunc_ge.\u03c0 K n,\n  naturality' := \u03bb K L \u03c6, begin\n    ext i\n    dsimp,\n    simp only [functor.id_map, homological_complex.comp_f, trunc_ge_functor_map_f],\n    dsimp,\n    simp only [trunc_ge.\u03c0_f_comm_map_f],\n  end, }\n\nvariables {C} (K)\n\nlemma trunc_ge.is_zero_homology (n i : \u2124) (hi : i < n) :\n  is_zero ((homology_functor C _ i).obj (K.trunc_ge n)) :=\nbegin\n  dsimp [homology_functor],\n  rw \u2190 short_complex.exact_iff_is_zero_homology,\n  exact short_complex.exact.of_is_zero_X\u2082 _ (trunc_ge.is_zero_X K n i hi),\nend\n\nlemma trunc_ge.is_iso_homology_map_\u03c0 (n i : \u2124) (hi : n \u2264 i) :\n  is_iso ((homology_functor C _ i).map (trunc_ge.\u03c0 K n)) :=\nbegin\n  let \u03c6 := (homological_complex.short_complex_functor C (complex_shape.up \u2124) i).map\n    (trunc_ge.\u03c0 K n),\n  haveI : is_iso \u03c6.\u03c4\u2083 := trunc_ge.is_iso_\u03c0_f K n _ (by { rw [next], linarith, }),\n  cases hi.lt_or_eq,\n  { haveI : epi \u03c6.\u03c4\u2081 := by { dsimp, apply_instance, },\n    haveI : is_iso \u03c6.\u03c4\u2082 := trunc_ge.is_iso_\u03c0_f K n i h,\n    exact short_complex.quasi_iso.of_epi_of_is_iso_of_mono \u03c6, },\n  { exact short_complex.quasi_iso.of_cokernel_cofork \u03c6\n      ((trunc_ge.is_zero_X K n _ (by { rw [prev], linarith, })).eq_of_src _ _)\n      (trunc_ge.\u03c0_is_cokernel K n _ i (by { rw [prev], linarith, }) h.symm), },\nend\n\nvariables {K L}\n\nlemma trunc_ge.map_homology_iso (\u03c6 : K \u27f6 L) (n i : \u2124) [is_iso (homology_map \u03c6 i)] :\n  is_iso (homology_map ((trunc_ge_functor C n).map \u03c6) i) :=\nbegin\n  by_cases hi : n \u2264 i,\n  { have eq := (homology_functor C _ i).congr_map ((trunc_ge.nat_trans_\u03c0 C n).naturality \u03c6),\n    simp only [functor.map_comp, functor.id_map, trunc_ge.nat_trans_\u03c0_app] at eq,\n    change homology_map \u03c6 i \u226b homology_map (trunc_ge.\u03c0 L n) i =\n      homology_map (trunc_ge.\u03c0 K n) i \u226b homology_map _ i at eq,\n    haveI : \u2200 (M : cochain_complex C \u2124), is_iso (homology_map (trunc_ge.\u03c0 M n) i) :=\n      \u03bb M, trunc_ge.is_iso_homology_map_\u03c0 M n i hi,\n    simp only [\u2190 cancel_epi (inv (homology_map (trunc_ge.\u03c0 K n) i)),\n      is_iso.inv_hom_id_assoc] at eq,\n    rw \u2190 eq,\n    apply_instance, },\n  { simp only [not_le] at hi,\n    exact \u27e8\u27e80, (trunc_ge.is_zero_homology K n i hi).eq_of_src _ _,\n       (trunc_ge.is_zero_homology L n i hi).eq_of_src _ _\u27e9\u27e9, },\nend\n\ninstance trunc_ge.map_quasi_iso (\u03c6 : K \u27f6 L) (n : \u2124) [quasi_iso \u03c6] :\n  quasi_iso ((trunc_ge_functor _ n).map \u03c6) :=\n\u27e8\u03bb i, trunc_ge.map_homology_iso \u03c6 n i\u27e9\n\nvariable (C)\n\nlemma trunc_ge_functor_comp_Q_inverts_quasi_isomorphisms (n : \u2124) :\n  (quasi_isomorphisms _ _).is_inverted_by\n    (cochain_complex.trunc_ge_functor C n \u22d9 derived_category.Q) :=\n\u03bb K L \u03c6 h\u03c6, begin\n  haveI : quasi_iso \u03c6 := by simpa only [\u2190 mem_quasi_isomorphisms_iff] using h\u03c6,\n  dsimp,\n  apply_instance,\nend\n\nvariable {C}\n\nclass is_strictly_ge (K : cochain_complex C \u2124) (n : \u2124) : Prop :=\n(is_zero' : \u2200 (i : \u2124) (hi : i < n), is_zero (K.X i))\n\nlemma is_strictly_ge.is_zero (K : cochain_complex C \u2124) (n i : \u2124) [K.is_strictly_ge n]\n  (hi : i < n) : is_zero (K.X i) :=\nis_strictly_ge.is_zero' i hi\n\nlemma is_strictly_ge_of_le (K : cochain_complex C \u2124) (n m : \u2124) (hnm : n \u2264 m)\n  [K.is_strictly_ge m] :\n  K.is_strictly_ge n :=\n\u27e8\u03bb i hi, is_strictly_ge.is_zero K m i (by linarith)\u27e9\n\nlemma is_strictly_ge.of_iso {K L : cochain_complex C \u2124} (e : K \u2245 L) (n : \u2124)\n  [K.is_strictly_ge n] : L.is_strictly_ge n :=\n\u27e8\u03bb i hi, is_zero.of_iso (is_strictly_ge.is_zero K n i hi)\n  ((homological_complex.eval _ _ i).map_iso e.symm)\u27e9\n\nlemma is_strictly_ge.iff_of_iso {K L : cochain_complex C \u2124} (e : K \u2245 L) (n : \u2124) :\n  K.is_strictly_ge n \u2194 L.is_strictly_ge n :=\nbegin\n  split,\n  { introI,\n    exact is_strictly_ge.of_iso e n, },\n  { introI,\n    exact is_strictly_ge.of_iso e.symm n, },\nend\n\nclass is_ge (K : cochain_complex C \u2124) (n : \u2124) : Prop :=\n(is_zero' : \u2200 (i : \u2124) (hi : i < n ), is_zero (K.homology i))\n\nlemma is_ge.is_zero (K : cochain_complex C \u2124) (n i : \u2124) [K.is_ge n] (hi : i < n) :\n  is_zero (K.homology i) :=\nis_ge.is_zero' i hi\n\nlemma is_ge_of_le (K : cochain_complex C \u2124) (n m : \u2124) (hnm : n \u2264 m) [K.is_ge m] : K.is_ge n :=\n\u27e8\u03bb i hi, is_ge.is_zero K m i (by linarith)\u27e9\n\nlemma is_ge.of_iso {K L : cochain_complex C \u2124} (e : K \u2245 L) (n : \u2124) [K.is_ge n] : L.is_ge n :=\n\u27e8\u03bb i hi, is_zero.of_iso (is_ge.is_zero K n i hi) ((homology_functor _ _ i).map_iso e.symm)\u27e9\n\nlemma is_ge.iff_of_iso {K L : cochain_complex C \u2124} (e : K \u2245 L) (n : \u2124) :\n  K.is_ge n \u2194 L.is_ge n :=\nbegin\n  split,\n  { introI,\n    exact is_ge.of_iso e n, },\n  { introI,\n    exact is_ge.of_iso e.symm n, },\nend\n\n@[priority 100]\ninstance is_ge_of_is_strictly_ge (K : cochain_complex C \u2124) (n : \u2124)\n  [K.is_strictly_ge n] : K.is_ge n :=\n\u27e8\u03bb i hi, begin\n  rw \u2190 short_complex.exact_iff_is_zero_homology,\n  exact short_complex.exact.of_is_zero_X\u2082 _ (is_strictly_ge.is_zero K n i hi),\nend\u27e9\n\ninstance trunc_ge_is_strictly_ge (K : cochain_complex C \u2124) (n : \u2124) :\n  (K.trunc_ge n).is_strictly_ge n :=\n\u27e8trunc_ge.is_zero_X K n\u27e9\n\ninstance trunc_ge_is_strictly_ge' (K : cochain_complex C \u2124) (n : \u2124) :\n  ((trunc_ge_functor C n).obj K).is_strictly_ge n :=\n(infer_instance : (K.trunc_ge n).is_strictly_ge n)\n\nlemma trunc_ge.is_iso_\u03c0_f_iff_d_eq_zero (K : cochain_complex C \u2124) (n i j : \u2124)\n  (hij : i+1 = j) (hj : j = n) :\n  is_iso ((trunc_ge.\u03c0 K n).f j) \u2194 K.d i j = 0 :=\nbegin\n  split,\n  { intro h,\n    haveI : is_iso (trunc_ge.\u03c0_f K n j) := h,\n    rw [\u2190 cancel_mono (trunc_ge.\u03c0_f K n j), trunc_ge.d_comp_\u03c0_eq_zero K n i j hij hj,\n      zero_comp], },\n  { exact cokernel_cofork.is_colimit.is_iso_\u03c0_of_zero _ (trunc_ge.\u03c0_is_cokernel K n i j hij hj), },\nend\n\ninstance (K : cochain_complex C \u2124) (n : \u2124) [K.is_strictly_ge n] :\n  is_iso (trunc_ge.\u03c0 K n) :=\nbegin\n  haveI : \u2200 (i : \u2124), is_iso ((trunc_ge.\u03c0 K n).f i),\n  { intro i,\n    by_cases hi : n < i,\n    { exact trunc_ge.is_iso_\u03c0_f K n i hi, },\n    { cases (not_lt.1 hi).lt_or_eq,\n      { refine \u27e8\u27e80, (is_strictly_ge.is_zero K n i h).eq_of_src _ _, _\u27e9\u27e9,\n        rw \u2190 cancel_epi (trunc_ge.\u03c0_f K n i),\n        apply (is_strictly_ge.is_zero K n i h).eq_of_src, },\n      { rw trunc_ge.is_iso_\u03c0_f_iff_d_eq_zero K n (i-1) i (by linarith) h,\n        apply (is_strictly_ge.is_zero K n (i-1) (by linarith)).eq_of_src, }, }, },\n  apply homological_complex.hom.is_iso_of_components,\nend\n\nend cochain_complex\n\nnamespace derived_category\n\nvariable (C)\n\ndef trunc_ge_functor (n : \u2124) : derived_category C \u2964 derived_category C :=\nlocalization.lift _ (cochain_complex.trunc_ge_functor_comp_Q_inverts_quasi_isomorphisms C n) Q\n\ninstance (n : \u2124) : localization.lifting Q (quasi_isomorphisms _ _)\n  (cochain_complex.trunc_ge_functor C n \u22d9 derived_category.Q) (trunc_ge_functor C n) :=\nlocalization.lifting_lift _ _ _\n\ndef trunc_ge_functor_iso (n : \u2124) :\n  Q \u22d9 trunc_ge_functor C n \u2245 (cochain_complex.trunc_ge_functor C n \u22d9 derived_category.Q) :=\nlocalization.lifting.iso _ (quasi_isomorphisms _ _) _ _\n\ndef trunc_ge_nat_trans_\u03c0 (n : \u2124) : \ud835\udfed (derived_category C) \u27f6 trunc_ge_functor C n :=\nlocalization.lift_nat_trans Q (quasi_isomorphisms _ _)\n  Q (cochain_complex.trunc_ge_functor C n \u22d9 derived_category.Q) _ _\n  (whisker_right (cochain_complex.trunc_ge.nat_trans_\u03c0 C n) Q)\n\n@[simp]\nlemma trunc_ge_nat_trans_\u03c0_app (K : cochain_complex C \u2124) (n : \u2124) :\n  (trunc_ge_nat_trans_\u03c0 C n).app (Q.obj K) =\n    Q.map (cochain_complex.trunc_ge.\u03c0 K n) \u226b (trunc_ge_functor_iso C n).inv.app K :=\nbegin\n  dsimp only [trunc_ge_nat_trans_\u03c0, trunc_ge_functor_iso],\n  simp only [localization.lifting.id_iso, functor.right_unitor_hom_app, whisker_right_app,\n    cochain_complex.trunc_ge.nat_trans_\u03c0_app, localization.lift_nat_trans_app],\n  dsimp,\n  rw id_comp,\nend\n\nvariable {C}\n\nclass is_ge (K : derived_category C) (n : \u2124) : Prop :=\n(is_zero' : \u2200 (i : \u2124) (hi : i < n ), is_zero (K.homology i))\n\nlemma is_ge.is_zero (K : derived_category C) (n i : \u2124) [K.is_ge n]\n  (hi : i < n) : is_zero (K.homology i) :=\nis_ge.is_zero' i hi\n\nlemma is_ge_of_le (K : derived_category C) (n m : \u2124) (hnm : n \u2264 m) [K.is_ge m] : K.is_ge n :=\n\u27e8\u03bb i hi, is_ge.is_zero K m i (by linarith)\u27e9\n\nlemma is_ge.of_iso {K L : derived_category C} (e : K \u2245 L) (n : \u2124) [K.is_ge n] : L.is_ge n :=\n\u27e8\u03bb i hi, is_zero.of_iso (is_ge.is_zero K n i hi) ((homology_functor _ i).map_iso e.symm)\u27e9\n\nlemma is_ge.iff_of_iso {K L : derived_category C} (e : K \u2245 L) (n : \u2124) :\n  K.is_ge n \u2194 L.is_ge n :=\nbegin\n  split,\n  { introI,\n    exact is_ge.of_iso e n, },\n  { introI,\n    exact is_ge.of_iso e.symm n, },\nend\n\nvariable (C)\n\ndef Q_comp_trunc_ge_functor_comp_homology_functor_iso (n i : \u2124) :\n  Q \u22d9 trunc_ge_functor C n \u22d9 homology_functor C i \u2245\n    cochain_complex.trunc_ge_functor C n \u22d9 _root_.homology_functor _ _ i :=\n(functor.associator _ _ _).symm \u226a\u226b\n  iso_whisker_right (trunc_ge_functor_iso C n) (homology_functor C i) \u226a\u226b\n  functor.associator _ _ _ \u226a\u226b iso_whisker_left _ (homology_functor_factors C i)\n\nvariable {C}\n\nlemma is_zero_homology_trunc_ge_of_lt (K : derived_category C) (n i : \u2124)\n  (hi : i < n) :\n  is_zero (((trunc_ge_functor C n).obj K).homology i) :=\nis_zero.of_iso (cochain_complex.is_ge.is_zero _ n i hi)\n  (((trunc_ge_functor C n \u22d9 homology_functor C i).map_iso (Q.obj_obj_preimage_iso K)).symm \u226a\u226b\n    ((Q_comp_trunc_ge_functor_comp_homology_functor_iso C n i).app _))\n\nlemma is_iso_homology_map_trunc_ge_nat_trans_\u03c0_of_ge (K : derived_category C) (n i : \u2124)\n  (hi : n \u2264 i) :\n  is_iso ((homology_functor C i).map ((trunc_ge_nat_trans_\u03c0 C n).app K)) :=\nbegin\n  erw \u2190 (Q.obj_obj_preimage_iso K).is_iso_app_iff\n    (whisker_right (trunc_ge_nat_trans_\u03c0 C n) (homology_functor C i)),\n  dsimp,\n  erw [trunc_ge_nat_trans_\u03c0_app, functor.map_comp],\n  haveI : \u2200 (L : cochain_complex C \u2124), is_iso ((homology_functor C i).map (Q.map\n    (cochain_complex.trunc_ge.\u03c0 L n))),\n  { intro L,\n    erw nat_iso.is_iso_map_iff (homology_functor_factors C i),\n    exact cochain_complex.trunc_ge.is_iso_homology_map_\u03c0 L n i hi, },\n  apply_instance,\nend\n\nlemma is_iso_trunc_ge_nat_trans_\u03c0_app_iff (K : derived_category C) (n : \u2124) :\n  is_iso ((trunc_ge_nat_trans_\u03c0 C n).app K) \u2194 K.is_ge n :=\nbegin\n  rw is_iso_iff_is_iso_homology,\n  split,\n  { introI hK,\n    exact \u27e8\u03bb i hi, is_zero.of_iso (is_zero_homology_trunc_ge_of_lt K n i hi)\n      (as_iso ((homology_functor C i).map ((trunc_ge_nat_trans_\u03c0 C n).app K)))\u27e9, },\n  { introI,\n    intro i,\n    by_cases hi : n \u2264 i,\n    { exact is_iso_homology_map_trunc_ge_nat_trans_\u03c0_of_ge K n i hi, },\n    { simp only [not_le] at hi,\n      exact \u27e8\u27e80, (is_ge.is_zero K n i hi).eq_of_src _ _,\n        (is_zero_homology_trunc_ge_of_lt K n i hi).eq_of_src _ _\u27e9\u27e9, }, },\nend\n\ninstance (K : derived_category C) (n : \u2124) [K.is_ge n] :\n  is_iso ((trunc_ge_nat_trans_\u03c0 C n).app K) :=\nby { rw is_iso_trunc_ge_nat_trans_\u03c0_app_iff, apply_instance, }\n\nend derived_category\n\nnamespace cochain_complex\n\nlemma is_zero_homology_iff_is_zero_homology_Q_obj (K : cochain_complex C \u2124) (n : \u2124) :\n  is_zero (K.homology n) \u2194 is_zero ((derived_category.Q.obj K).homology n) :=\n((derived_category.homology_functor_factors C n).app K).symm.is_zero_iff\n\nlemma is_ge_iff_Q_obj_is_ge (K : cochain_complex C \u2124) (n : \u2124) :\n  K.is_ge n \u2194 (derived_category.Q.obj K).is_ge n :=\nbegin\n  split,\n  { introI,\n    exact \u27e8\u03bb i hi, by simpa only [\u2190 is_zero_homology_iff_is_zero_homology_Q_obj]\n      using is_ge.is_zero K n i hi\u27e9, },\n  { introI,\n    exact \u27e8\u03bb i hi, by simpa only [is_zero_homology_iff_is_zero_homology_Q_obj]\n      using derived_category.is_ge.is_zero (derived_category.Q.obj _) n i hi\u27e9, },\nend\n\ninstance Q_obj_is_ge_of_is_ge (K : cochain_complex C \u2124) (n : \u2124) [K.is_ge n] :\n  (derived_category.Q.obj K).is_ge n :=\nbegin\n  rw \u2190 is_ge_iff_Q_obj_is_ge,\n  apply_instance,\nend\n\n\nlemma is_ge_iff_of_quasi_iso {K L : cochain_complex C \u2124} (\u03c6 : K \u27f6 L) [quasi_iso \u03c6] (n : \u2124) :\n  K.is_ge n \u2194 L.is_ge n :=\nbegin\n  simp only [is_ge_iff_Q_obj_is_ge],\n  exact derived_category.is_ge.iff_of_iso (as_iso (derived_category.Q.map \u03c6)) n,\nend\n\nlemma quasi_iso_trunc_ge_\u03c0_iff (K : cochain_complex C \u2124) (n : \u2124) :\n  quasi_iso (trunc_ge.\u03c0 K n) \u2194 K.is_ge n :=\nbegin\n  rw [is_ge_iff_Q_obj_is_ge, \u2190 derived_category.is_iso_Q_map_iff,\n    \u2190 derived_category.is_iso_trunc_ge_nat_trans_\u03c0_app_iff,\n    derived_category.trunc_ge_nat_trans_\u03c0_app],\n  split,\n  { introI,\n    apply_instance, },\n  { apply is_iso.of_is_iso_comp_right, },\nend\n\ninstance (K : cochain_complex C \u2124) (n : \u2124) [K.is_ge n] :\n  quasi_iso (trunc_ge.\u03c0 K n) :=\nby { rw quasi_iso_trunc_ge_\u03c0_iff, apply_instance, }\n\nend cochain_complex\n\nnamespace derived_category\n\nlemma left_factorisation_of_is_ge {K L : cochain_complex C \u2124} (\u03c6 : Q.obj K \u27f6 Q.obj L) (n : \u2124)\n  [L.is_ge n] :\n  \u2203 (L' : cochain_complex C \u2124) (hL' : L'.is_strictly_ge n) (f : K \u27f6 L') (s : L \u27f6 L') (hs : quasi_iso s),\n    \u03c6 = Q.map f \u226b (by { haveI := hs, exact inv (Q.map s), }) :=\nbegin\n  obtain \u27e8L', f, s, hs, eq\u27e9 := left_factorisation \u03c6,\n  haveI := hs,\n  haveI : quasi_iso ((cochain_complex.trunc_ge.nat_trans_\u03c0 C n).app L'),\n  { erw cochain_complex.quasi_iso_trunc_ge_\u03c0_iff,\n    dsimp,\n    rw \u2190 cochain_complex.is_ge_iff_of_quasi_iso s,\n    apply_instance, },\n  exact \u27e8_, infer_instance,\n    f \u226b (cochain_complex.trunc_ge.nat_trans_\u03c0 _ n).app L',\n    s \u226b (cochain_complex.trunc_ge.nat_trans_\u03c0 _ n).app L', infer_instance,\n    by simp only [assoc, functor.map_comp, is_iso.inv_comp, is_iso.hom_inv_id_assoc, eq]\u27e9,\nend\n\nlemma right_factorisation_of_is_strictly_ge {K L : cochain_complex C \u2124} (\u03c6 : Q.obj K \u27f6 Q.obj L)\n  (n : \u2124) [K.is_strictly_ge n] [L.is_strictly_ge n] :\n  \u2203 (K' : cochain_complex C \u2124) (hK' : K'.is_strictly_ge n) (s : K' \u27f6 K) (f : K' \u27f6 L) (hs : quasi_iso s),\n    \u03c6 = (by { haveI := hs, exact inv (Q.map s), }) \u226b Q.map f :=\nbegin\n  obtain \u27e8K', s, f, hs, eq\u27e9 := right_factorisation \u03c6,\n  haveI := hs,\n  haveI : quasi_iso (cochain_complex.trunc_ge.\u03c0 K' n),\n  { rw [cochain_complex.quasi_iso_trunc_ge_\u03c0_iff, cochain_complex.is_ge_iff_of_quasi_iso s],\n    apply_instance, },\n  refine \u27e8(cochain_complex.trunc_ge K' n), infer_instance,\n    (cochain_complex.trunc_ge_functor C n).map s \u226b\n      category_theory.inv (cochain_complex.trunc_ge.\u03c0 K n),\n    (cochain_complex.trunc_ge_functor C n).map f \u226b\n      category_theory.inv (cochain_complex.trunc_ge.\u03c0 L n), infer_instance, _\u27e9,\n  have comms := Q.congr_map ((cochain_complex.trunc_ge.nat_trans_\u03c0 C n).naturality s),\n  have commf := Q.congr_map ((cochain_complex.trunc_ge.nat_trans_\u03c0 C n).naturality f),\n  dsimp at comms commf,\n  simp only [Q.map_comp, \u2190 cancel_epi (inv (Q.map (cochain_complex.trunc_ge.\u03c0 K' n))),\n    is_iso.inv_hom_id_assoc] at comms commf,\n  simp only [eq, Q.map_comp, \u2190 commf, \u2190 comms, functor.map_inv, assoc, is_iso.hom_inv_id, comp_id,\n    is_iso.hom_inv_id_assoc, is_iso.eq_inv_comp],\nend\n\nlemma exists_iso_Q_obj_of_ge (K : derived_category C) (n : \u2124) [K.is_ge n] :\n  \u2203 (K' : cochain_complex C \u2124) (hK' : K'.is_strictly_ge n),\n    nonempty (K \u2245 Q.obj K') :=\nbegin\n  let K' := Q.obj_preimage K,\n  haveI : K'.is_ge n,\n  { rw [cochain_complex.is_ge_iff_Q_obj_is_ge, is_ge.iff_of_iso (Q.obj_obj_preimage_iso K)],\n    apply_instance, },\n  exact \u27e8K'.trunc_ge n, infer_instance, \u27e8(Q.obj_obj_preimage_iso K).symm \u226a\u226b\n    (as_iso ((trunc_ge_nat_trans_\u03c0 C n).app (Q.obj K'))) \u226a\u226b\n    (trunc_ge_functor_iso C n).app K'\u27e9\u27e9,\nend\n\nend derived_category\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/algebra/homology/trunc_ge.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5428632979641571, "lm_q2_score": 0.3380771241500058, "lm_q1q2_score": 0.18352966258230993}}
{"text": "import category_theory.abelian.exact\nimport .split_exact\n\nuniverses v u u'\n\nnamespace category_theory\n\nnamespace functor\n\nopen category_theory.limits\n\nvariables {A : Type u} {B : Type u'} [category.{v} A] [category.{v} B]\n  [abelian A] [abelian B] (F : A \u2964 B) [functor.additive F]\n  [preserves_finite_limits F] [preserves_finite_colimits F]\n\nvariables {X Y Z : A} (f : X \u27f6 Y) (g : Y \u27f6 Z)\n\nlemma map_short_exact (h : short_exact f g) : short_exact (F.map f) (F.map g) :=\nbegin\n  rcases h with \u27e8hfg\u27e9,\n  haveI : mono (F.map f),\n  { rw (abelian.tfae_mono X f).out 0 2 at h_mono,\n    rw (abelian.tfae_mono (F.obj X) (F.map f)).out 0 2,\n    have := F.map_exact _ _ h_mono, rwa F.map_zero at this, },\n  haveI : epi (F.map g),\n  { rw (abelian.tfae_epi Z g).out 0 2 at h_epi,\n    rw (abelian.tfae_epi (F.obj Z) (F.map g)).out 0 2,\n    have := F.map_exact _ _ h_epi, rwa F.map_zero at this, },\n  refine \u27e8F.map_exact f g hfg\u27e9,\nend\n\nend functor\n\nend category_theory", "meta": {"author": "jjaassoonn", "repo": "flat", "sha": "bab2f5c18fdee0042680c31b0350c69d241e9a82", "save_path": "github-repos/lean/jjaassoonn-flat", "path": "github-repos/lean/jjaassoonn-flat/flat-bab2f5c18fdee0042680c31b0350c69d241e9a82/src/lte/for_mathlib/preserves_exact.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5583269943353745, "lm_q2_score": 0.3276683139517237, "lm_q1q2_score": 0.18294606486760573}}
{"text": "import tactic.linarith\nimport category_theory.triangulated.rotate\nimport for_mathlib.category_theory.triangulated.shift_compatibility\nimport for_mathlib.category_theory.triangulated.pretriangulated_misc\nimport for_mathlib.category_theory.functor.shift\nimport for_mathlib.category_theory.triangulated.triangulated_functor\n\nnoncomputable theory\n\nnamespace category_theory\n\nopen limits\n\nnamespace pretriangulated\n\nopen preadditive category pretriangulated\n\nvariables (C : Type*) [category C] [preadditive C] [has_shift C \u2124]\n\n@[simps]\ndef triangle.shift_functor (n : \u2124) : triangle C \u2964 triangle C :=\n{ obj := \u03bb T, begin\n    let \u03b5 : \u2124 := \u2191((-1 : units \u2124) ^ n),\n    exact triangle.mk (\u03b5 \u2022 (shift_functor C n).map T.mor\u2081)\n      (\u03b5 \u2022 (shift_functor C n).map T.mor\u2082)\n      ((\u03b5 \u2022 (shift_functor C n).map T.mor\u2083) \u226b (shift_functor_add_comm C 1 n).hom.app _),\n  end,\n  map := \u03bb T\u2081 T\u2082 f,\n  { hom\u2081 := (shift_functor C n).map f.hom\u2081,\n    hom\u2082 := (shift_functor C n).map f.hom\u2082,\n    hom\u2083 := (shift_functor C n).map f.hom\u2083,\n    comm\u2081' := by { dsimp, simp only [preadditive.zsmul_comp, preadditive.comp_zsmul,\n      \u2190 functor.map_comp, f.comm\u2081], },\n    comm\u2082' := by { dsimp, simp only [preadditive.zsmul_comp, preadditive.comp_zsmul,\n      \u2190 functor.map_comp, f.comm\u2082], },\n    comm\u2083' := by { dsimp,\n      simp only [assoc, preadditive.zsmul_comp, preadditive.comp_zsmul, \u2190 functor.map_comp_assoc,\n        \u2190 f.comm\u2083],\n      simp only [functor.map_comp, assoc],\n      erw \u2190 nat_trans.naturality,\n      refl, }, }, }\n\nvariables [has_zero_object C] [\u2200 (n : \u2124), functor.additive (shift_functor C n)]\n\ndef triangle.shift_functor_one_iso : triangle.shift_functor C 1 \u2245 rotate C \u22d9 rotate C \u22d9 rotate C :=\nnat_iso.of_components\n  (\u03bb T, triangle.mk_iso _ _ (iso.refl _) (iso.refl _) (iso.refl _) (by tidy) (by tidy) begin\n    dsimp,\n    simp only [zpow_one, units.coe_neg_one, neg_smul, one_zsmul, neg_comp, functor.map_id,\n      comp_id, id_comp, neg_inj, shift_functor_add_comm_eq_refl, iso.refl_hom, nat_trans.id_app],\n    apply comp_id,\n  end)\n  (by tidy)\n\nlocal attribute [reducible] discrete.add_monoidal\n\ndef triangle.shift_functor_zero : triangle.shift_functor C 0 \u2245 \ud835\udfed _ :=\nnat_iso.of_components (\u03bb T, triangle.mk_iso _ _ ((shift_functor_zero C \u2124).app _)\n  ((shift_functor_zero C \u2124).app _) ((shift_functor_zero C \u2124).app _) (by tidy) (by tidy) begin\n  dsimp,\n  simp only [zpow_zero, units.coe_one, one_zsmul, assoc, shift_functor_add_comm_hom_app],\n  erw \u2190 nat_trans.naturality,\n  congr' 1,\n  dsimp,\n  simp only [obj_\u03b5_inv_app, discrete.functor_map_id, nat_trans.id_app, comp_id,\n    \u03bc_inv_hom_app, \u03b5_inv_app_obj],\nend) (by tidy)\n\ndef triangle.shift_functor_add (a\u2081 a\u2082 : \u2124) :\n  triangle.shift_functor C (a\u2081 + a\u2082) \u2245\n    triangle.shift_functor C a\u2081 \u22d9 triangle.shift_functor C a\u2082 :=\nnat_iso.of_components (\u03bb T, begin\n  dsimp only [triangle.shift_functor],\n  refine triangle.mk_iso _ _ ((shift_functor_add C a\u2081 a\u2082).app _) ((shift_functor_add C a\u2081 a\u2082).app _)\n    ((shift_functor_add C a\u2081 a\u2082).app _) _ _ _,\n  { dsimp only [triangle.mk, functor.comp],\n    simp only [zsmul_comp, comp_zsmul, functor.map_zsmul, smul_smul],\n    congr' 1,\n    { rw [zpow_add, units.coe_mul, mul_comm], },\n    { exact (shift_functor_add C a\u2081 a\u2082).hom.naturality T.mor\u2081, }, },\n  { dsimp only [triangle.mk, functor.comp],\n    simp only [zsmul_comp, comp_zsmul, functor.map_zsmul, smul_smul,\n      zpow_add, units.coe_mul, mul_comm],\n    congr' 1,\n    exact (shift_functor_add C a\u2081 a\u2082).hom.naturality T.mor\u2082, },\n  { dsimp only [triangle.mk, functor.comp],\n    simp only [zsmul_comp, comp_zsmul, functor.map_zsmul, smul_smul,\n      zpow_add, units.coe_mul, mul_comm],\n    congr' 1,\n    simp only [functor.map_comp, assoc],\n    erw \u2190 nat_trans.naturality_assoc,\n    congr' 1,\n    apply shift_compatibility, },\nend)\n(\u03bb T T' f, by ext; apply nat_trans.naturality)\n\ndef triangle.shift_functor_sub_one_iso : triangle.shift_functor C (-1) \u2245 inv_rotate C \u22d9 inv_rotate C \u22d9 inv_rotate C :=\nbegin\n  symmetry,\n  calc inv_rotate C \u22d9 inv_rotate C \u22d9 inv_rotate C \u2245 \ud835\udfed _ \u22d9 inv_rotate C \u22d9 inv_rotate C \u22d9 inv_rotate C : (functor.left_unitor _).symm\n  ... \u2245 triangle.shift_functor C 0 \u22d9 inv_rotate C \u22d9 inv_rotate C \u22d9 inv_rotate C :\n    iso_whisker_right (triangle.shift_functor_zero C).symm _\n  ... \u2245 triangle.shift_functor C ((-1) + 1) \u22d9 inv_rotate C \u22d9 inv_rotate C \u22d9 inv_rotate C :\n    iso_whisker_right (eq_to_iso (by congr)) _\n  ... \u2245 (triangle.shift_functor C (-1) \u22d9 triangle.shift_functor C 1) \u22d9 inv_rotate C \u22d9 inv_rotate C \u22d9 inv_rotate C :\n    iso_whisker_right (triangle.shift_functor_add C _ _) _\n  ... \u2245 _ : functor.associator _ _ _\n  ... \u2245 _ : iso_whisker_left _ _\n  ... \u2245 triangle.shift_functor C (-1) : functor.right_unitor _,\n  let e : rotate C \u22d9 inv_rotate C \u2245 \ud835\udfed _ := (triangle_rotation C).unit_iso.symm,\n  let \u03b1 := iso_whisker_left (rotate C \u22d9 rotate C) (iso_whisker_right e (inv_rotate C \u22d9 inv_rotate C)),\n  let \u03b2 := iso_whisker_left (rotate C) (iso_whisker_right e (inv_rotate C)),\n  exact iso_whisker_right (triangle.shift_functor_one_iso C) _ \u226a\u226b \u03b1 \u226a\u226b \u03b2 \u226a\u226b e,\nend\n\ndef triangle.shift_functor_iso_of_eq {a\u2081 a\u2082 : \u2124} (h : a\u2081 = a\u2082) :\n  triangle.shift_functor C a\u2081 \u2245 triangle.shift_functor C a\u2082 := by subst h\n\nlemma triangle.shift_distinguished [pretriangulated C]\n  (T : triangle C) (hT : T \u2208 dist_triang C) (n : \u2124) :\n  (triangle.shift_functor C n).obj T \u2208 dist_triang C :=\nbegin\n  have hpos : \u2200 (T' : triangle C) (hT' : T' \u2208 dist_triang C),\n    (triangle.shift_functor C (1 : \u2124)).obj T' \u2208 dist_triang C,\n  { intros T' hT',\n    exact pretriangulated.isomorphic_distinguished _ (rot_of_dist_triangle C _\n      (rot_of_dist_triangle C _ (rot_of_dist_triangle C _ hT'))) _\n      ((triangle.shift_functor_one_iso C).app T'), },\n  have hneg : \u2200 (T' : triangle C) (hT' : T' \u2208 dist_triang C),\n    (triangle.shift_functor C (-1 : \u2124)).obj T' \u2208 dist_triang C,\n  { intros T' hT',\n    exact pretriangulated.isomorphic_distinguished _ (inv_rot_of_dist_triangle C _\n      (inv_rot_of_dist_triangle C _ (inv_rot_of_dist_triangle C _ hT'))) _\n      ((triangle.shift_functor_sub_one_iso C).app T'), },\n  by_cases 0 \u2264 n,\n  { obtain \u27e8m, hm\u27e9 : \u2203 (m : \u2115), n = m := int.eq_coe_of_zero_le h,\n    subst hm, clear h,\n    induction m with n hn,\n    { exact pretriangulated.isomorphic_distinguished _ hT _\n        ((triangle.shift_functor_zero C).app T), },\n    { refine pretriangulated.isomorphic_distinguished _ _ _\n        ((triangle.shift_functor_add C (\u2191n) 1).app T),\n      apply hpos,\n      apply hn, }, },\n  { obtain \u27e8m, hm\u27e9 : \u2203 (m : \u2115), n = -(m : \u2124),\n    { obtain \u27e8k, hk\u27e9 := int.eq_coe_of_zero_le (show 0 \u2264 -n, by linarith),\n      exact \u27e8k, by linarith\u27e9, },\n    subst hm, clear h,\n    induction m with n hn,\n    { exact pretriangulated.isomorphic_distinguished _ hT _\n        ((triangle.shift_functor_zero C).app T), },\n    { refine pretriangulated.isomorphic_distinguished _ _ _\n        (_ \u226a\u226b (triangle.shift_functor_add C (-\u2191n) (-1 : \u2124)).app T),\n      { apply hneg,\n        apply hn, },\n      { refine (triangle.shift_functor_iso_of_eq C _).app _,\n        simp only [nat.cast_succ, neg_add_rev, int.add_neg_one],\n        linarith, }, }, },\nend\n\nexample : \u2115 := 42\n\ndef triangle.shift_functor_comm {C D : Type*} [category C] [category D]\n  [preadditive C] [preadditive D] [has_shift C \u2124] [has_shift D \u2124] [has_zero_object C] [has_zero_object D]\n  [\u2200 (n : \u2124), (shift_functor C n).additive] [\u2200 (n : \u2124), (shift_functor D n).additive] (F : C \u2964 D)\n  [F.additive]\n  [F.has_comm_shift \u2124] (n : \u2124) :\n  triangle.shift_functor C n \u22d9 F.map_triangle \u2245\n    F.map_triangle \u22d9 triangle.shift_functor D n :=\nbegin\n  refine nat_iso.of_components (\u03bb T, triangle.mk_iso _ _\n    ((F.comm_shift_iso n).app _) ((F.comm_shift_iso n).app _) ((F.comm_shift_iso n).app _) _ _ _)\n    (\u03bb T\u2081 T\u2082 f, _),\n  { have eq\u2081 := (F.comm_shift_iso n).hom.naturality T.mor\u2081,\n    dsimp at \u22a2 eq\u2081,\n    simp only [F.map_zsmul, zsmul_comp, eq\u2081, comp_zsmul], },\n  { have eq\u2082 := (F.comm_shift_iso n).hom.naturality T.mor\u2082,\n    dsimp at \u22a2 eq\u2082,\n    simp only [F.map_zsmul, zsmul_comp, eq\u2082, comp_zsmul], },\n  { have eq\u2083 := (F.comm_shift_iso n).hom.naturality T.mor\u2083,\n    dsimp at \u22a2 eq\u2083,\n    simp only [F.map_zsmul, zsmul_comp, comp_zsmul, functor.map_comp, assoc, \u2190 reassoc_of eq\u2083,\n      F.map_shift_functor_add_comm], },\n  { ext; apply (F.comm_shift_iso n).hom.naturality, },\nend\n\nend pretriangulated\n\nend category_theory\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/category_theory/triangulated/shift_triangle.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5156199157230157, "lm_q2_score": 0.3522017752483203, "lm_q1q2_score": 0.18160224967103542}}
{"text": "import model_theory.substructures\nimport model_theory.bundled\n\n\n--OUTPUT 1\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h n,\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h1 n,\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h2 n,\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h3 n,\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h4 n,\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h5 n,\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h6 n,\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h7 n,\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h8 n,\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h9 n,\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h10 n,\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h11 n,\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h12 n,\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h13 n,\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h14 n,\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h15 n,\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h16 n,\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h17 n,\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h18 n,\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h19 n,\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h20 n,\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h21 n,\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h22 n,\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h23 n,\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h24 n,\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h25 n,\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h26 n,\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h27 n,\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h28 n,\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h29 n,\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h30 n,\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h31 n,\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h32 n,\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h33 n,\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from assume (n : \u2115), h34 n,\n  have h\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  -- set \u0393 := F \u222a (\u22c3 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin)\n  let \u0393 := F.Theory.mk_set (\u03bb (\u03c6 : L.Formula), \u2203 (n : \u2115), nth_mem_union n h \u03c6),\n  have h1 : \u2200 (\u03c6 : L.Formula), \u2203 (n : \u2115), nth_mem_union n h \u03c6, from\n    assume \u03c6 : L.Formula, exists.elim (h (L.Formula.arity \u03c6)) (\n      assume (m : F.Model) (mfin : fintype m), (\n        assume h2 : (L.Formula.arity \u03c6) \u2264 @fintype.card m mfin,\n        have h3 : \u2203 (n : \u2115), nth_mem_union n h \u03c6, from by {\n          use (L.Formula.arity \u03c6),\n          have h4 : L.Formula.arity \u03c6 \u2264 @fintype.card m mfin, from h2,\n          have h5 : @fintype.card m mfin < @fintype.card m mfin + 1, from\n            fintype.card_lt_card_of_lt_of_finite mfin (fintype.card_pos mfin),\n          have h6 : L.Formula.arity \u03c6 < @fintype.card m mfin + 1, from \n            nat.lt_trans h4 h5,\n          have h7 : \u2203 (v : L.Formula.arity \u03c6 \u2192 m), L.Formula.arity \u03c6 \u2264 @fintype.card m mfin, from \n            exists.intro (\u03bb _, (default m)) h4,\n          have h8 : \u2203 (v : L.Formula.arity \u03c6 \u2192 m), L.Formula.arity \u03c6 < @fintype.card m mfin + 1, from \n            exists.intro (\u03bb _, (default m)) h6,\n          show \u2203 (n : \u2115), nth_mem_union n h \u03c6, from\n            exists.intro (L.Formula.arity \u03c6) (exists.elim (nat.lt_succ_iff.mp h6) (\n              assume h9 : L.Formula.arity \u03c6 \u2264 @fintype.card m mfin,\n              assume h10 : L.Formula.arity \u03c6 < @fintype.card m mfin + 1,\n              have h11 : \u2203 (v : L.Formula.arity \u03c6 \u2192 m), L.Formula.arity \u03c6 \u2264 @fintype.card m mfin, from \n                exists.intro (\u03bb _, (default m)) h9,\n              have h12 : \u2203 (v : L.Formula.arity \u03c6 \u2192 m), L.Formula.arity \u03c6 < @fintype.card m mfin + 1, from \n                exists.intro (\u03bb _, (default m)) h10,\n              show nth_mem_union (L.Formula.arity \u03c6) h \u03c6, from\n                nth_mem_union_val h9 h12 \u03c6)),\n          show \u2203 (n : \u2115), nth_mem_union n h \u03c6, from\n            exists.intro (L.Formula.arity \u03c6) (exists.elim (nat.lt_succ_iff.mp h6) (\n              assume h9 : L.Formula.arity \u03c6 \u2264 @fintype.card m mfin,\n              assume h10 : L.Formula.arity \u03c6 < @fintype.card m mfin + 1,\n              have h11 : \u2203 (v : L.Formula.arity \u03c6 \u2192 m), L.Formula.arity \u03c6 \u2264 @fintype.card m mfin, from \n                exists.intro (\u03bb _, (default m)) h9,\n              have h12 : \u2203 (v : L.Formula.arity \u03c6 \u2192 m), L.Formula.arity \u03c6 < @fintype.card m mfin + 1, from \n                exists.intro (\u03bb _, (default m)) h10,\n              show nth_mem_union (L.Formula.arity \u03c6) h \u03c6, from\n                nth_mem_union_val h9 h12 \u03c6)),\n        show \u2203 (n : \u2115), nth_mem_union n h \u03c6, from h3),\n    have h2 : F.Theory.mk_set (\u03bb (\u03c6 : L.Formula), \u2203 (n : \u2115), nth_mem_union n h \u03c6) \u2286 F, from\n      assume \u03c6 : L.Formula, assume h3 : \u2203 (n : \u2115), nth_mem_union n h \u03c6, L.Theory.subset (\n        assume h4 : \u03c6 \u2208 F, h4),\n    have h3 : F.Theory.mk_set (\u03bb (\u03c6 : L.Formula), \u2203 (n : \u2115), nth_mem_union n h \u03c6) \u2286 \u222a n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from\n      assume \u03c6 : L.Formula, assume h4 : \u2203 (n : \u2115), nth_mem_union n h \u03c6, exists.elim h4 (\n        assume n : \u2115, (\n          assume h5 : nth_mem_union n h \u03c6,\n          have h6 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h7 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h8 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h9 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h10 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h11 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h12 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h13 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h14 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h15 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h16 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h17 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h18 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\n            apply h,\n          },\n          have h19 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by {\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 (n : \u2115), F \u22a2 L.exists (L.numeral n), from by {\n    assume (n : \u2115),\n    have h1 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h n,\n    have h2 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h1,\n    have h3 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h2,\n    have h4 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h3,\n    have h5 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h4,\n    have h6 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h5,\n    have h7 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h6,\n    have h8 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h7,\n    have h9 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h8,\n    have h10 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h9,\n    have h11 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h10,\n    have h12 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h11,\n    have h13 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h12,\n    have h14 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h13,\n    have h15 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h14,\n    have h16 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h15,\n    have h17 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h16,\n    have h18 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h17,\n    have h19 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h18,\n    have h20 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h19,\n    have h21 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h20,\n    have h22 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h21,\n    have h23 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h22,\n    have h24 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h23,\n    have h25 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h24,\n    have h26 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h25,\n    have h27 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h26,\n    have h28 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h27,\n    have h29 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h28,\n    have h30 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h29,\n    have h31 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h30,\n    have h32 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h31,\n    have h33 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h32,\n    have h34 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h33,\n    have h35 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h34,\n    have h36 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h35,\n    have h37 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h36,\n    have h38 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h37,\n    have h39 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h38,\n    have h40 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h39,\n    have h41 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h40,\n    have h42 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h41,\n    have h43 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h42,\n    have h44 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h43,\n    have h45 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h44,\n    have h46 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h45,\n    have h47 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h46,\n    have h48 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h47,\n    have h49 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin\nend --Needs more than 2000 tokens!\n\n--OUTPUT 4\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  let A := \u03bb (n : \u2115), \u2203 x\u2081 x\u2082, (\u2200 (i j : \u2115), i \u2260 j \u2192 x\u2081 i \u2260 x\u2082 j),\n  let \u0393 := F.Theory \u222a A,\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from\n    assume n : \u2115, by {\n      let m := classical.some (h1 n),\n      exact \u27e8m, classical.some_spec (h1 n)\u27e9, },\n  have h3 : \u2200 (n : \u2115) (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin \u2192 \u2203 (f : m \u2192 m), fintype.injective f \u2227 fintype.card m \u2264 n, from\n    assume n : \u2115, assume (m : F.Model), assume mfin : fintype m, assume h4 : n \u2264 @fintype.card m mfin,\n    have h5 : \u2200 (x : m), \u2203 (y : m), x \u2260 y, from\n      assume x : m, have h6 : @fintype.card m mfin > 0, from nat.pos_of_ne_zero\n        (show @fintype.card m mfin \u2260 0, from (mt (fintype.card_eq_zero.1) (\u03bb h7, h4.elim (\u03bb h8, h8.symm \u25b8 h7)))),\n      have h7 : \u2200 (y : m), y \u2260 x \u2192 \u2203 (z : m), z \u2260 y, from\n        assume y : m, assume h8 : y \u2260 x, have h9 : @fintype.card m mfin > 1, from (nat.succ_pos (nat.pos_of_ne_zero h6)).symm \u25b8 h4,\n        have h10 : \u2203 (z : m), z \u2260 y, from (fintype.card_pos_iff.2 h9).elim (\u03bb h11, h11.elim (\u03bb h12, \u27e8x, h8\u27e9) (\u03bb h13, \u27e8y, \u03bb h14, h13 (h14.symm \u25b8 h8)\u27e9)),\n        h10,\n      have h8 : \u2203 (y : m), y \u2260 x \u2227 (\u2200 (z : m), z \u2260 x \u2192 \u2203 (w : m), w \u2260 z), from\n        let y := classical.some (h7 x),\n        have h9 : y \u2260 x, from classical.some_spec (h7 x),\n        have h10 : \u2200 (z : m), z \u2260 x \u2192 \u2203 (w : m), w \u2260 z, from\n          assume z : m, assume h11 : z \u2260 x, have h12 : \u2203 (w : m), w \u2260 z, from h7 z h11,\n          h12,\n        \u27e8y, h9, h10\u27e9,\n      let y := classical.some (h8 x),\n      have h9 : y \u2260 x \u2227 (\u2200 (z : m), z \u2260 x \u2192 \u2203 (w : m), w \u2260 z), from classical.some_spec (h8 x),\n      have h10 : y \u2260 x, from h9.left,\n      \u27e8y, h10\u27e9,\n    have h6 : \u2203 (f : m \u2192 m), \u2200 (x : m), f x \u2260 x \u2227 \u2200 (y : m), f y \u2260 x \u2192 \u2203 (z : m), f z \u2260 y, from\n      let f := \u03bb (x : m), classical.some (h5 x),\n      have h7 : \u2200 (x : m), f x \u2260 x \u2227 \u2200 (y : m), f y \u2260 x \u2192 \u2203 (z : m), f z \u2260 y, from\n        assume x : m,\n        have h8 : f x \u2260 x \u2227 \u2200 (y : m), f y \u2260 x \u2192 \u2203 (z : m), f z \u2260 y, from classical.some_spec (h5 x),\n        h8,\n      \u27e8f, h7\u27e9,\n    have h7 : \u2200 (x y : m), (f x = f y) \u2192 (x = y), from\n      assume x y : m, assume h8 : f x = f y,\n      have h9 : f x \u2260 x, from h6.right x,\n      have h10 : f y \u2260 y, from h6.right y,\n      have h11 : f x \u2260 f y, from (h6.right x y h10).elim (\u03bb h12, h12.symm \u25b8 h9),\n      (h11 h8).elim,\n    have h8 : \u2203 (g : m \u2192 m), fintype.injective g \u2227 fintype.card m \u2264 n, from \u27e8f, \u27e8h7\u27e9, h4\u27e9,\n    h8,\n  have h4 : \u2200 (n : \u2115) (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin \u2192 F.Model.satisfies (A n) m, from\n    assume n : \u2115, assume (m : F.Model), assume mfin : fintype m, assume h5 : n \u2264 @fintype.card m mfin,\n    have h6 : \u2203 (f : m \u2192 m), fintype.injective f \u2227 fintype.card m \u2264 n, from h3 n m mfin h5,\n    have h7 : \u2203 (f : m \u2192 m), fintype.injective f, from h6.elim (\u03bb f, \u27e8f, h6.right.left\u27e9),\n    have h8 : \u2203 (f : m \u2192 m), fintype.injective f, from h6.elim (\u03bb f, \u27e8f, h6.right.left\u27e9),\n    have h9 : \u2203 (f : m \u2192 m), fintype.injective f, from h6.elim (\u03bb f, \u27e8f, h6.right.left\u27e9),\n    F.Model.satisfies.rec_on (A n)\n    (by {\n      assume (a : m \u2192 m \u2192 Prop),\n      assume (h10 : \u2200 (i j : m), i \u2260 j \u2192 a i j),\n      have h11 : \u2203 (i : m), \u2200 (j : m), i \u2260 j \u2192 a i j, from\n        have h12 : \u2203 (i : m), \u2203 (j : m), i \u2260 j \u2227 a i j, from\n          have h13 : \u2203 (i : m), \u2203 (j : m), i \u2260 j, from h7.elim (\u03bb (f : m \u2192 m), \n            have h14 : \u2203 (i : m), \u2203 (j : m), i \u2260 j \u2227 f i = f j, from\n              let i := f (classical.choice (h7.elim (\u03bb (f : m \u2192 m), fintype.exists_ne_of_injective f))),\n              have h15 : \u2203 (j : m), i \u2260 j \u2227 f i = f j, from \n                let j := f (classical.choice (h7.elim (\u03bb (f : m \u2192 m), fintype.exists_ne_of_injective f))),\n                have h16 : f i \u2260 f j, from classical.some_spec (h7.elim (\u03bb (f : m \u2192 m), fintype.exists_ne_of_injective f)),\n                have h17 : j \u2260 i, from h7.elim (\u03bb (f : m \u2192 m), fintype.injective.ne_of_injective_of_ne f h16),\n                \u27e8j, h17, h16\u27e9,\n             \nend --Needs more than 2000 tokens!\n\n--OUTPUT 5\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  let A_n : L.Formula := \u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203' (\u2203\nend --Needs more than 2000 tokens!\n\n--OUTPUT 6\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  -- set A_n to be the formula:\n  -- exists x_1 exists x_2 ... exists x_n : {x_1 != x_2 \u2227 x_1 != x_3 \u2227 ... \u2227 x_{n-1} != x_n}\n  let A_n : L.formula := L.formula.exists (L.formula.var 0) (L.formula.exists (L.formula.var 0) \n    (L.formula.exists (L.formula.var 0) (L.formula.and (L.formula.ne (L.formula.var 0) (L.formula.var 1))\n    (L.formula.and (L.formula.ne (L.formula.var 0) (L.formula.var 2)) (L.formula.and (L.formula.ne (L.formula.var 0)\n    (L.formula.var 3)) (L.formula.ne (L.formula.var 1) (L.formula.var 2)))))) n,\n  -- set \u0393 to be the union of F and A_i for i = 1 to infinity\n  let \u0393 : L.Theory := L.Theory.union F (L.Theory.union (L.Theory.singleton (A_n 1)) (L.Theory.union \n    (L.Theory.singleton (A_n 2)) (L.Theory.singleton (A_n 3)))),\n  -- by the compactness theorem, \u0393 is satisfiable in some model M\n  have h1 : \u2203 (M : F.Model), \u0393 \u2286 M, from by {\n    suffices : \u2200 (\u0393' : L.Theory), (\u2200 (\u0393'' : L.Theory), \u0393'' \u2286 \u0393' \u2192 \u2203 (M : F.Model), \u0393'' \u2286 M) \u2192 \u2203 (M : F.Model), \u0393' \u2286 M, from by \n      {apply this, assume \u0393'' h2, have h3 : \u0393'' \u2286 \u0393, from by {apply set.subset.trans h2, apply set.subset.refl \u0393}, \n      have h4 : \u0393'' \u2286 F, from by {apply set.subset.trans h3, apply set.subset_union_left}, \n      have h5 : \u0393'' \u2286 A_n 1 \u222a A_n 2 \u222a A_n 3, from by {apply set.subset.trans h3, apply set.subset_union_right, \n        apply set.subset_union_left}, \n      have h6 : \u2200 (e : L.formula), e \u2208 \u0393'' \u2192 e \u2208 F \u2228 e \u2208 A_n 1 \u2228 e \u2208 A_n 2 \u2228 e \u2208 A_n 3, from \n        by {apply set.mem_or_mem_of_mem_union, apply set.mem_or_mem_of_mem_union}, \n      have h7 : \u2200 (e : L.formula), e \u2208 \u0393'' \u2192 e \u2208 F, from by {assume e h8, apply h6 e h8, from or_iff_not_imp_right.mpr, \n        assume h9, apply h6 e h8, from or_iff_not_imp_right.mpr, assume h10, apply h6 e h8, from or_iff_not_imp_right.mpr, \n        assume h11, have h12 : e \u2208 A_n 1 \u2228 e \u2208 A_n 2 \u2228 e \u2208 A_n 3, from or_iff_not_imp_left.mpr h9, apply or.elim h12, \n        assume h13, apply h6 e h8, from or_iff_not_imp_right.mpr, assume h14, apply h6 e h8, from or_iff_not_imp_right.mpr, \n        assume h15, have h16 : e \u2208 A_n 2 \u2228 e \u2208 A_n 3, from or_iff_not_imp_left.mpr h10, apply or.elim h16, assume h17, \n        apply h6 e h8, from or_iff_not_imp_right.mpr, assume h18, have h19 : e \u2208 A_n 3, from or_iff_not_imp_left.mpr h11, \n        apply h6 e h8, from or_iff_not_imp_right.mpr, }, \n      have h8 : (\u2200 (\u0393'' : L.Theory), \u0393'' \u2286 F \u2192 \u2203 (M : F.Model), \u0393'' \u2286 M), from by {assume \u0393'' h9, \n        have h10 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h11 : \u2200 (e : L.formula), e \u2208 \u0393'' \u2192 e \u2208 F, from by {assume e h12, apply h7 e h12, from or_iff_not_imp_right.mpr, \n        assume h13, apply h7 e h12, from or_iff_not_imp_right.mpr, assume h14, apply h7 e h12, from or_iff_not_imp_right.mpr, \n        assume h15, have h16 : e \u2208 A_n 1 \u2228 e \u2208 A_n 2 \u2228 e \u2208 A_n 3, from or_iff_not_imp_left.mpr h13, apply or.elim h16, \n        assume h17, apply h7 e h12, from or_iff_not_imp_right.mpr, assume h18, apply h7 e h12, from or_iff_not_imp_right.mpr, \n        assume h19, have h20 : e \u2208 A_n 2 \u2228 e \u2208 A_n 3, from or_iff_not_imp_left.mpr h14, apply or.elim h20, assume h21, \n        apply h7 e h12, from or_iff_not_imp_right.mpr, assume h22, have h23 : e \u2208 A_n 3, from or_iff_not_imp_left.mpr h15, \n        apply h7 e h12, from or_iff_not_imp_right.mpr, }, \n        have h12 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h13 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h14 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h15 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h16 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h17 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h18 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h19 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h20 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h21 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h22 : \u2203 (m : F.Model) [mfin : fintype m], \u0393'' \u2286 m, from by {apply h, \n        have h23 : \u2203 (m : F.Model) [mfin : fintype m],\nend --Needs more than 2000 tokens!\n\n--OUTPUT 7\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), h k,\n  have h2 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h1 k),\n  have h3 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h2 k),\n  have h4 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h3 k),\n  have h5 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h4 k),\n  have h6 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h5 k),\n  have h7 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h6 k),\n  have h8 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h7 k),\n  have h9 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h8 k),\n  have h10 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h9 k),\n  have h11 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h10 k),\n  have h12 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h11 k),\n  have h13 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h12 k),\n  have h14 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h13 k),\n  have h15 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h14 k),\n  have h16 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h15 k),\n  have h17 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h16 k),\n  have h18 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h17 k),\n  have h19 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h18 k),\n  have h20 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h19 k),\n  have h21 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h20 k),\n  have h22 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h21 k),\n  have h23 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h22 k),\n  have h24 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h23 k),\n  have h25 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h24 k),\n  have h26 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h25 k),\n  have h27 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h26 k),\n  have h28 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h27 k),\n  have h29 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h28 k),\n  have h30 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h29 k),\n  have h31 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h30 k),\n  have h32 : \u2200 (k : \u2115), \u2203 (M : F.Model) [mfin : fintype M], k \u2264 @fintype.card M mfin, from assume (k : \u2115), classical.some (h31 k),\n  have h33 : \u2200 (k : \u2115), \u2203 (M : F.Model), k \u2264 @fintype.card M (fintype.mk M), from assume (k : \u2115), classical.some (h32 k),\n  have h34 : \u2200 (k : \u2115), \u2203 (M : F.Model) [\nend --Needs more than 2000 tokens!\n\n--OUTPUT 8\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  let A : L.Theory, from by {\n    have h1 : \u2200 n : \u2115, \u2203 (A : L.Theory) (hA : A.nonempty), n \u2264 @fintype.card (A.Model) hA, from by {\n      assume (n : \u2115),\n      obtain \u27e8m,mfin,h2\u27e9 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h n,\n      use m,\n      use mfin,\n      exact h2,\n    },\n    have h2 : \u2200 n : \u2115, \u2203 (A : L.Theory) (hA : A.nonempty), n \u2264 @fintype.card (A.Model) hA, from by {\n      assume (n : \u2115),\n      obtain \u27e8m,mfin,h2\u27e9 : \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h n,\n      use m,\n      use mfin,\n      exact h2,\n    },\n    use \u27e8\u2200 n : \u2115, \u2203 (A : L.Theory) (hA : A.nonempty), n \u2264 @fintype.card (A.Model) hA\u27e9,\n    use h2,\n  },\n  have h1 : \u2200 n : \u2115, \u2203 (A : L.Theory) (hA : A.nonempty), n \u2264 @fintype.card (A.Model) hA, from A.right,\n  have h2 : \u2200 n : \u2115, \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty), n \u2264 @fintype.card (A.Model) hA, from h1 n,\n    use A, use hA, use hA,\n  },\n  have h3 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h4 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h5 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h6 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h7 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h8 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h9 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h10 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h11 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h12 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty), n \u2264 @fintype.card (A.Model) hB, from h2 n,\n    use A,\n    use hC,\n  },\n  have h13 : \u2200 n : \u2115, \u2203 (A : L.Theory), n \u2264 @fintype.card (A.Model) A.right, from by {\n    assume n : \u2115,\n    obtain \u27e8A,hA,hB,hC\u27e9 : \u2203 (A : L.Theory) (hA : A.nonempty) (hB : A.nonempty),\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by {split,apply set.subset_of_mem_powerset,exact hA,apply set.subset_of_mem_powerset,exact hB},\n  have h2 : (A \u2229 B) \u2286 A, from by apply set.inter_subset_left,\n  have h3 : (A \u2229 B) \u2286 S, from by {apply set.subset.trans h2 h1.left},\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by {apply set.mem_powerset h3},\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by rw sq\n  ... = x*(x+y) + y*(x+y) : by rw add_mul\n  ... = x*x + x*y + y*x + y*y : by {rw [mul_comm x (x+y),mul_comm y (x+y)], rw [add_mul,add_mul], ring}\n  ... = x^2 + 2*x*y + y^2 : by {repeat {rw \u2190 sq}, rw mul_comm y x, ring}\nend\n\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by {\n    assume a b : G, use a\u207b\u00b9 * b, obviously, },\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by {\n    assume a b : G, use b * a\u207b\u00b9, obviously, }, \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from \n    assume a : G, h1 a a,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from\n    assume a : G, h2 a a,\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from assume a :G,\n    exists_unique.unique (h3 a) (classical.some_spec (exists_unique.exists (h3 a)))\n    (mul_one a),\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from assume a : G,\n    exists_unique.unique (h4 a) (classical.some_spec (exists_unique.exists (h4 a))) (one_mul a), \n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (hident : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a).exists, from assume (a : G),\n        exists_unique.unique (h3 a) (hident a).right\n        (classical.some_spec (exists_unique.exists (h3 a))), \n      have h9 : \u2200 a : G, e = classical.some (h4 a).exists, from assume (a : G),\n        exists_unique.unique (h4 a) (hident a).left\n        (classical.some_spec (exists_unique.exists (h4 a))),\n      show e = (1 : G), from eq.trans (h9 e) (h6 _),     \n    },\n    exact \u27e8by obviously, h7\u27e9,\n  }\nend\n\n/--`theorem`\nOverflow theorem\nLet $F$ be a set of first-order formulas which has finite models of arbitrarily large size. Then $F$ has an infinite model.\n`proof`\nFor each $n$, let $\\mathbf A_n$ be the formula:\n\n$\\exists x_1 \\exists x_2 \\ldots \\exists x_n: \\{x_1 \\ne x_2 \\land x_1 \\ne x_3 \\land \\ldots \\land x_{n - 1} \\ne x_n\\}$\n\nThen $\\mathbf A_i$ is true in a structure $\\AA$ iff $\\AA$ has at least $n$ elements.\n\nTake:\n$$ \\Gamma := F \\cup \\bigcup_{i \\mathop = 1}^\\infty A_i $$\n\nSince $F$ has models of arbitrarily large size, every finite subset of $\\Gamma$ is satisfiable.\n\nFrom the Compactness Theorem, $\\Gamma$ is satisfiable in some model $\\mathbf{M}$.\n\nBut since $\\mathbf{M} \\models A_i$ for each $i$, $\\mathbf{M}$ must be infinite.\n\nSo $F$ has an infinite model.\n\nQED\n-/\ntheorem  overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof-Natural-Language-Proof-Translation/Correct_statement-lean_proof-3_few_shot_temperature_0.6_max_tokens_2000_n_8/clean_files/Overflow theorem.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5660185498374789, "lm_q2_score": 0.32082130731838393, "lm_q1q2_score": 0.18159081112531583}}
{"text": "import for_mathlib.short_complex_projections\nimport for_mathlib.homological_complex_abelian\nimport for_mathlib.homology_map_datum\nimport for_mathlib.abelian_sheaves.functor_category\nimport for_mathlib.short_complex_functor_category\n\nnoncomputable theory\n\nopen category_theory category_theory.category category_theory.limits\nopen_locale zero_object\n\nuniverses v\n\nnamespace short_complex\n\nsection construction\n\nvariables {C : Type*} [category C] [has_zero_morphisms C]\nvariables {J : Type*} [category J] (F : J \u2964 short_complex C)\n  [has_colimit (F \u22d9 \u03c0\u2081)] [has_colimit (F \u22d9 \u03c0\u2082)] [has_colimit (F \u22d9 \u03c0\u2083)]\n\n@[simps]\ndef colimit_cocone.cocone : cocone F :=\n{ X := mk (colim_map (\ud835\udfd9 F \u25eb \u03c6\u2081\u2082)) (colim_map (\ud835\udfd9 F \u25eb \u03c6\u2082\u2083)) begin\n    ext,\n    dsimp,\n    simp only [\u03b9_colim_map_assoc, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app, \u03c0\u2082_map,\n      \u03b9_colim_map, \u03c6\u2082\u2083_app, \u03c0\u2083_map, assoc, comp_zero],\n    erw [composable_morphisms.id_\u03c4\u2082, id_comp, (F.obj j).zero_assoc, zero_comp],\n  end,\n  \u03b9 :=\n    { app := \u03bb j, begin\n        refine \u27e8colimit.\u03b9 (F \u22d9 \u03c0\u2081) j, colimit.\u03b9 (F \u22d9 \u03c0\u2082) j, colimit.\u03b9 (F \u22d9 \u03c0\u2083) j, _, _\u27e9,\n        { dsimp,\n          simp only [\u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app, \u03c0\u2082_map,\n            assoc],\n          erw [composable_morphisms.id_\u03c4\u2082, id_comp],\n          refl, },\n        { dsimp,\n          simp only [\u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2082\u2083_app, nat_trans.id_app, \u03c0\u2083_map,\n            assoc],\n          erw [composable_morphisms.id_\u03c4\u2083, id_comp],\n          refl, },\n      end,\n      naturality' := \u03bb i j f, begin\n        ext,\n        { dsimp, simpa only [comp_id] using colimit.w (F \u22d9 \u03c0\u2081) f, },\n        { dsimp, simpa only [comp_id] using colimit.w (F \u22d9 \u03c0\u2082) f, },\n        { dsimp, simpa only [comp_id] using colimit.w (F \u22d9 \u03c0\u2083) f, },\n      end }, }\n\ndef colimit_cocone : colimit_cocone F :=\n{ cocone := colimit_cocone.cocone F,\n  is_colimit :=\n  { desc := \u03bb s, begin\n      refine \u27e8colimit.desc (F \u22d9 \u03c0\u2081) (\u03c0\u2081.map_cocone s),\n        colimit.desc (F \u22d9 \u03c0\u2082) (\u03c0\u2082.map_cocone s),\n        colimit.desc (F \u22d9 \u03c0\u2083) (\u03c0\u2083.map_cocone s), _, _\u27e9,\n      { ext,\n        dsimp,\n        simp only [\u03b9_colim_map_assoc, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app,\n          \u03c0\u2082_map, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, assoc, colimit.\u03b9_desc_assoc, \u03c0\u2081_map],\n        erw [composable_morphisms.id_\u03c4\u2082, id_comp],\n        exact (s.\u03b9.app j).comm\u2081\u2082, },\n      { ext,\n        dsimp,\n        simp only [\u03b9_colim_map_assoc, nat_trans.hcomp_app, \u03c6\u2082\u2083_app, nat_trans.id_app,\n          \u03c0\u2083_map, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, assoc, colimit.\u03b9_desc_assoc, \u03c0\u2082_map],\n        erw [composable_morphisms.id_\u03c4\u2083, id_comp],\n        exact (s.\u03b9.app j).comm\u2082\u2083, },\n    end,\n    fac' := \u03bb s j, begin\n      ext,\n      { dsimp, simp only [colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2081_map], },\n      { dsimp, simp only [colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2082_map], },\n      { dsimp, simp only [colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2083_map], },\n    end,\n    uniq' := \u03bb s m hm, begin\n      have h\u2081 := \u03bb j, congr_arg (\u03bb (\u03c6 : F.obj j \u27f6 s.X), \u03c0\u2081.map \u03c6) (hm j),\n      have h\u2082 := \u03bb j, congr_arg (\u03bb (\u03c6 : F.obj j \u27f6 s.X), \u03c0\u2082.map \u03c6) (hm j),\n      have h\u2083 := \u03bb j, congr_arg (\u03bb (\u03c6 : F.obj j \u27f6 s.X), \u03c0\u2083.map \u03c6) (hm j),\n      dsimp at h\u2081 h\u2082 h\u2083,\n      ext,\n      { dsimp, simp only [h\u2081, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2081_map], },\n      { dsimp, simp only [h\u2082, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2082_map], },\n      { dsimp, simp only [h\u2083, colimit.\u03b9_desc, functor.map_cocone_\u03b9_app, \u03c0\u2083_map], },\n    end, }, }\n\ninstance : has_colimit F := \u27e8nonempty.intro (colimit_cocone F)\u27e9\n\ndef \u03c0\u2081_preserves_colimit : preserves_colimit F (\u03c0\u2081 : short_complex C \u2964 C) :=\npreserves_colimit_of_preserves_colimit_cocone (colimit_cocone F).is_colimit\n  (is_colimit.of_iso_colimit (get_colimit_cocone (F \u22d9 \u03c0\u2081)).is_colimit\n    (cocones.ext (iso.refl _) (\u03bb j, comp_id _)))\n\ndef \u03c0\u2082_preserves_colimit : preserves_colimit F (\u03c0\u2082 : short_complex C \u2964 C) :=\npreserves_colimit_of_preserves_colimit_cocone (colimit_cocone F).is_colimit\n  (is_colimit.of_iso_colimit (get_colimit_cocone (F \u22d9 \u03c0\u2082)).is_colimit\n    (cocones.ext (iso.refl _) (\u03bb j, comp_id _)))\n\ndef \u03c0\u2083_preserves_colimit : preserves_colimit F (\u03c0\u2083 : short_complex C \u2964 C) :=\npreserves_colimit_of_preserves_colimit_cocone (colimit_cocone F).is_colimit\n  (is_colimit.of_iso_colimit (get_colimit_cocone (F \u22d9 \u03c0\u2083)).is_colimit\n    (cocones.ext (iso.refl _) (\u03bb j, comp_id _)))\n\nend construction\n\nsection preserves\n\nvariables {C : Type*} [category C] [has_zero_morphisms C]\nvariables {J D : Type*} [category J] [category D]\n\ndef \u03c0\u2081\u2082\u2083_reflects_colimits {F : J \u2964 short_complex C} (s : cocone F)\n  (h\u2081 : is_colimit (\u03c0\u2081.map_cocone s)) (h\u2082 : is_colimit (\u03c0\u2082.map_cocone s))\n  (h\u2083 : is_colimit (\u03c0\u2083.map_cocone s)) :\n  is_colimit s :=\nbegin\n  haveI : has_colimit (F \u22d9 \u03c0\u2081) := \u27e8nonempty.intro \u27e8_, h\u2081\u27e9\u27e9,\n  haveI : has_colimit (F \u22d9 \u03c0\u2082) := \u27e8nonempty.intro \u27e8_, h\u2082\u27e9\u27e9,\n  haveI : has_colimit (F \u22d9 \u03c0\u2083) := \u27e8nonempty.intro \u27e8_, h\u2083\u27e9\u27e9,\n  refine is_colimit.of_iso_colimit (colimit_cocone F).is_colimit (cocones.ext _ _),\n  { suffices : is_iso ((colimit_cocone F).is_colimit.desc s),\n    { haveI := this,\n      exact as_iso ((colimit_cocone F).is_colimit.desc s), },\n    apply is_iso_of_is_isos,\n    { exact is_iso.of_iso (is_colimit.cocone_point_unique_up_to_iso (colimit.is_colimit _) h\u2081), },\n    { exact is_iso.of_iso (is_colimit.cocone_point_unique_up_to_iso (colimit.is_colimit _) h\u2082), },\n    { exact is_iso.of_iso (is_colimit.cocone_point_unique_up_to_iso\n        (colimit.is_colimit _) h\u2083), }, },\n  { intro j,\n    simp only [as_iso_hom, is_colimit.fac], },\nend\n\ndef \u03c0\u2081\u2082\u2083_reflect_preserves_colimits (G : J \u2964 D) (F : D \u2964 short_complex C)\n  (h\u2081 : preserves_colimit G (F \u22d9 \u03c0\u2081)) (h\u2082 : preserves_colimit G (F \u22d9 \u03c0\u2082))\n  (h\u2083 : preserves_colimit G (F \u22d9 \u03c0\u2083)) : preserves_colimit G F :=\n\u27e8\u03bb s hs, \u03c0\u2081\u2082\u2083_reflects_colimits _\n  (@is_colimit_of_preserves _ _ _ _ _ _ G (F \u22d9 \u03c0\u2081) _ hs _)\n  (@is_colimit_of_preserves _ _ _ _ _ _ G (F \u22d9 \u03c0\u2082) _ hs _)\n  (@is_colimit_of_preserves _ _ _ _ _ _ G (F \u22d9 \u03c0\u2083) _ hs _)\u27e9\n\nvariable (J)\n\ndef preserves_colimits_of_shape_of_projections (F : D \u2964 short_complex C)\n  (h\u2081 : preserves_colimits_of_shape J (F \u22d9 \u03c0\u2081))\n  (h\u2082 : preserves_colimits_of_shape J (F \u22d9 \u03c0\u2082))\n  (h\u2083 : preserves_colimits_of_shape J (F \u22d9 \u03c0\u2083)) :\n  preserves_colimits_of_shape J F :=\n\u27e8by { intro G, apply \u03c0\u2081\u2082\u2083_reflect_preserves_colimits; apply_instance, }\u27e9\n\nend preserves\n\nsection functor_homological_complex\n\nvariables {C : Type*} [category C] [abelian C]\nvariables {M : Type*} {c : complex_shape M}\nvariables {J : Type*} [category J]\n\ninstance zero_preserves_colimits_of_shape {D : Type*} [category D]:\n  preserves_colimits_of_shape J (0 : D \u2964 C) :=\n\u27e8\u03bb F, \u27e8\u03bb s hs,\n{ desc := \u03bb t, 0,\n  fac' := \u03bb t j, begin\n    dsimp,\n    apply is_zero.eq_of_src,\n    apply is_zero.obj,\n    apply is_zero_zero,\n  end,\n  uniq' := \u03bb t m j, begin\n    dsimp,\n    apply is_zero.eq_of_src,\n    apply is_zero.obj,\n    apply is_zero_zero,\n  end, }\u27e9\u27e9\n\nlemma functor_homological_complex_\u03c0\u2081_iso_zero (i : M) (h : c.prev i = none) :\n  functor_homological_complex C c i \u22d9 \u03c0\u2081 \u2245 0 :=\nbegin\n  refine is_zero.iso _ (is_zero_zero _),\n  rw is_zero.iff_id_eq_zero,\n  ext X,\n  apply is_zero.eq_of_src,\n  exact is_zero.of_iso (is_zero_zero _) (X.X_prev_iso_zero h),\nend\n\nlemma functor_homological_complex_\u03c0\u2083_iso_zero (i : M) (h : c.next i = none) :\n  functor_homological_complex C c i \u22d9 \u03c0\u2083 \u2245 0 :=\nbegin\n  refine is_zero.iso _ (is_zero_zero _),\n  rw is_zero.iff_id_eq_zero,\n  ext X,\n  apply is_zero.eq_of_src,\n  exact is_zero.of_iso (is_zero_zero _) (X.X_next_iso_zero h),\nend\n\nlemma functor_homological_complex_\u03c0\u2081_iso_eval (i j : M) (hij : c.rel j i) :\n  functor_homological_complex C c i \u22d9 \u03c0\u2081 \u2245 homological_complex.eval C c j :=\nnat_iso.of_components (\u03bb X, X.X_prev_iso hij)\n(\u03bb X Y f, begin\n  dsimp,\n  simp only [homological_complex.hom.prev_eq f hij, assoc, iso.inv_hom_id, comp_id],\nend)\n\nlemma functor_homological_complex_\u03c0\u2083_iso_eval (i j : M) (hij : c.rel i j) :\n  functor_homological_complex C c i \u22d9 \u03c0\u2083 \u2245 homological_complex.eval C c j :=\nnat_iso.of_components (\u03bb X, X.X_next_iso hij)\n(\u03bb X Y f, begin\n  dsimp,\n  simp only [homological_complex.hom.next_eq f hij, assoc, iso.inv_hom_id, comp_id],\nend)\n\ninstance (i : M) [has_colimits_of_shape J C] :\n  preserves_colimits_of_shape J (short_complex.functor_homological_complex C c i) :=\nbegin\n  apply preserves_colimits_of_shape_of_projections,\n  { rcases h : c.prev i with _ | \u27e8j, hij\u27e9,\n    { exact preserves_colimits_of_shape_of_nat_iso\n        (functor_homological_complex_\u03c0\u2081_iso_zero i h).symm, },\n    { exact preserves_colimits_of_shape_of_nat_iso\n        (functor_homological_complex_\u03c0\u2081_iso_eval i j hij).symm, }, },\n  { exact (infer_instance : preserves_colimits_of_shape J (homological_complex.eval C c i)), },\n  { rcases h : c.next i with _ | \u27e8j, hij\u27e9,\n    { exact preserves_colimits_of_shape_of_nat_iso\n        (functor_homological_complex_\u03c0\u2083_iso_zero i h).symm, },\n    { exact preserves_colimits_of_shape_of_nat_iso\n        (functor_homological_complex_\u03c0\u2083_iso_eval i j hij).symm, }, },\nend\n\nend functor_homological_complex\n\nsection functor_homology\n\nvariables {C : Type*} [category.{v} C] [abelian C]\nvariables {M : Type*} {c : complex_shape M}\n  {J : Type v} [small_category J] [is_filtered J]\n  [has_colimits_of_shape J C]\n  [preserves_finite_limits (limits.colim : (J \u2964 C) \u2964 C)]\n  [preserves_finite_colimits (limits.colim : (J \u2964 C) \u2964 C)]\n\nnamespace homology_functor_preserves_colimit\n\nvariable (F : short_complex (J \u2964 C))\n\ndef iso_datum := homology_iso_datum.tautological' F.1.f F.1.g F.2\n\ninstance (j : J) : preserves_finite_limits ((evaluation J C).obj j) :=\n\u27e8by { intro F, introI, introI, apply_instance, }\u27e9\ninstance (j : J) : preserves_finite_colimits ((evaluation J C).obj j) :=\n\u27e8by { intro F, introI, introI, apply_instance, }\u27e9\ninstance (j : J) : functor.additive ((evaluation J C).obj j) := { }\ninstance colim_additive : functor.additive (colim : (J \u2964 C) \u2964 C) := { }\n\n@[simps]\ndef nat_trans_\u03b9 (j : J) : (evaluation J C).obj j \u27f6 (colim : (J \u2964 C) \u2964 C) :=\n{ app := \u03bb F, colimit.\u03b9 F j,\n  naturality' := \u03bb F\u2081 F\u2082 \u03c6, by { dsimp, simp only [colimit.\u03b9_map], }, }\n\ndef iso_datum\u2081 := (iso_datum F).apply_exact_functor (colim : (J \u2964 C) \u2964 C)\n\ndef F\u2080 := functor_category_equivalence.functor.obj F\n\ndef e\u2081 : (F\u2080 F) \u22d9 homology_functor \u2245 (iso_datum F).H :=\nnat_iso.of_components\n  (\u03bb j, ((iso_datum F).apply_exact_functor ((evaluation J C).obj j)).iso.symm)\n  (\u03bb i j f, begin\n    simp only [functor.comp_map, iso.symm_hom],\n    erw ((iso_datum F).map_nat_trans ((evaluation J C).map f)).homology_map_eq,\n    simpa only [evaluation_map_app, assoc, iso.hom_inv_id, comp_id,\n      iso.cancel_iso_inv_left],\n  end)\n\ndef e\u2082 : colim.map_short_complex.obj F \u2245 (colimit_cocone.cocone (F\u2080 F)).X :=\nbegin\n  refine iso_mk _ _ _ _ _,\n  { refine colim.map_iso (nat_iso.of_components (\u03bb j, iso.refl _) (\u03bb i j f, _)),\n    dsimp, erw [id_comp, comp_id], refl, },\n  { refine colim.map_iso (nat_iso.of_components (\u03bb j, iso.refl _) (\u03bb i j f, _)),\n    dsimp, erw [id_comp, comp_id], refl, },\n  { refine colim.map_iso (nat_iso.of_components (\u03bb j, iso.refl _) (\u03bb i j f, _)),\n    dsimp, erw [id_comp, comp_id], refl, },\n  { ext, dsimp, simp only [colimit.\u03b9_map_assoc, colimit.\u03b9_map, nat_iso.of_components.hom_app,\n      iso.refl_hom, id_comp, \u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2081\u2082_app, nat_trans.id_app,\n      \u03c0\u2082_map, assoc], erw id_comp, refl, },\n  { ext, dsimp, simp only [colimit.\u03b9_map_assoc, colimit.\u03b9_map, nat_iso.of_components.hom_app,\n      iso.refl_hom, id_comp, \u03b9_colim_map, nat_trans.hcomp_app, \u03c6\u2082\u2083_app, nat_trans.id_app,\n      \u03c0\u2083_map, assoc], erw id_comp, refl, },\nend\n\ndef e\u2083 : colimit (F\u2080 F \u22d9 homology_functor) \u2245 (colim.map_short_complex.obj F).homology :=\ncolim.map_iso (e\u2081 F) \u226a\u226b (iso_datum\u2081 F).iso\n\ndef e\u2084 : colimit (F\u2080 F \u22d9 homology_functor) \u2245 (colimit_cocone.cocone (F\u2080 F)).X.homology :=\ne\u2083 F \u226a\u226b homology_functor.map_iso (e\u2082 F)\n\nlemma compatibility (j : J) : (colimit.cocone (F\u2080 F \u22d9 homology_functor)).\u03b9.app j \u226b\n  (e\u2083 F).hom = homology_functor.map ((nat_trans_\u03b9 j).map_short_complex.app F) :=\nbegin\n  rw ((iso_datum F).map_nat_trans (nat_trans_\u03b9 j)).homology_map_eq,\n  dsimp only [e\u2081, e\u2083, iso_datum\u2081, nat_iso.of_components],\n  simpa only [colimit.cocone_\u03b9, iso.trans_hom, functor.map_iso_hom, colimit.\u03b9_map_assoc,\n    iso.symm_hom, nat_trans_\u03b9_app, iso.cancel_iso_hom_right_assoc, iso.cancel_iso_inv_left],\nend\n\nlemma preserves : preserves_colimit (F\u2080 F) short_complex.homology_functor :=\n\u27e8\u03bb s hs, begin\n  have e\u2081 : s \u2245 colimit_cocone.cocone (F\u2080 F),\n  { refine is_initial.unique_up_to_iso _ _,\n    all_goals { equiv_rw (cocone.is_colimit_equiv_is_initial _).symm, },\n    exacts [hs, (colimit_cocone (F\u2080 F)).is_colimit], },\n  suffices : is_colimit (homology_functor.map_cocone (colimit_cocone.cocone (F\u2080 F))),\n  { exact is_colimit.of_iso_colimit this\n      ((cocones.functoriality _ homology_functor).map_iso e\u2081.symm), },\n  clear e\u2081 hs s,\n  refine is_colimit.of_iso_colimit (colimit.is_colimit (F\u2080 F \u22d9 homology_functor))\n     (cocones.ext (e\u2084 F) _),\n  intro j,\n  dsimp only [functor.map_cocone, cocones.functoriality, e\u2084, iso.trans, functor.map_iso],\n  rw [\u2190 assoc, compatibility, \u2190 homology_functor.map_comp],\n  congr' 1,\n  ext1,\n  all_goals\n  { dsimp [e\u2082], simp only [colimit.\u03b9_map, nat_iso.of_components.hom_app,\n      iso.refl_hom, id_comp], },\nend\u27e9\n\nend homology_functor_preserves_colimit\n\ninstance (F\u2080 : J \u2964 short_complex C) : preserves_colimit F\u2080 short_complex.homology_functor :=\nbegin\n  let F := functor_category_equivalence.inverse.obj F\u2080,\n  haveI : preserves_colimit (homology_functor_preserves_colimit.F\u2080 F) homology_functor\n    := homology_functor_preserves_colimit.preserves F,\n  have h : homology_functor_preserves_colimit.F\u2080 F \u2245 F\u2080 :=\n    functor_category_equivalence.counit_iso.app F\u2080,\n  exact preserves_colimit_of_iso_diagram short_complex.homology_functor h,\nend\n\ninstance : preserves_colimits_of_shape J\n  (short_complex.homology_functor : short_complex C \u2964 C) := \u27e8\u03bb F, infer_instance\u27e9\n\nend functor_homology\n\nend short_complex\n", "meta": {"author": "bentoner", "repo": "debug", "sha": "b8a75381caa90aa9942c20e08a44e45d0ae60d18", "save_path": "github-repos/lean/bentoner-debug", "path": "github-repos/lean/bentoner-debug/debug-b8a75381caa90aa9942c20e08a44e45d0ae60d18/src/for_mathlib/short_complex_colimits.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5039061705290805, "lm_q2_score": 0.35936415888237616, "lm_q1q2_score": 0.1810858171278222}}
{"text": "def main (xs : List String) : IO UInt32 :=\nlet n := xs.head.toNat in\nIO.println \"prelude\\ninductive Bool : Type\\n| ff : Bool\\n| tt : Bool\\n\\n\" *>\nNat.mrepeat n (\u03bb i, IO.println (\"theorem x\" ++ toString i ++ \" : Bool := Bool.tt\")) *>\npure 0\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/playground/gen.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5078118642792044, "lm_q2_score": 0.35577488668296436, "lm_q1q2_score": 0.18066670847019883}}
{"text": "import data.cpi.semantics.space tactic.abel\n\nnamespace cpi\n\nvariables {\u2102 \u210d : Type} {\u03c9 : context} {M : affinity \u210d} {conc : \u210d \u21aa \u2102} [half_ring \u2102] [decidable_eq \u2102]\n\n/-- The main body of the interaction tensor. Split out into a separate function\n    to make unfolding possible. -/\nprivate def interaction_tensor_worker [cpi_equiv \u210d \u03c9] (conc : \u210d \u21aa \u2102)\n  : ( prime_species' \u210d \u03c9 (context.extend M.arity context.nil)\n    \u00d7 (\u03a3 (b y), concretion' \u210d \u03c9 (context.extend M.arity context.nil) b y)\n    \u00d7 name (context.extend M.arity context.nil))\n  \u2192 ( prime_species' \u210d \u03c9 (context.extend M.arity context.nil)\n    \u00d7 (\u03a3 (b y), concretion' \u210d \u03c9 (context.extend M.arity context.nil) b y)\n    \u00d7 name (context.extend M.arity context.nil))\n  \u2192 process_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil)\n| \u27e8 A, \u27e8 bF, yF, F \u27e9, x \u27e9 \u27e8 B, \u27e8 bG, yG, G \u27e9, y \u27e9 :=\n  option.cases_on (M.f x.to_idx y.to_idx) 0 (\u03bb aff,\n    if h : bF = yG \u2227 yF = bG then begin\n      rcases h with \u27e8 \u27e8 _ \u27e9, \u27e8 _ \u27e9 \u27e9,\n      from conc aff \u2022 ( to_process_space (cpi_equiv.pseudo_apply F G)\n                      - fin_fn.single A 1 - fin_fn.single B (1 : \u2102)),\n    end else 0)\n\n/-- Show that the interaction tensor worker is commutitive. -/\nprivate lemma interaction_tensor_worker.comm [cpi_equiv_prop \u210d \u03c9]\n  : \u2200 (A B : prime_species' \u210d \u03c9 (context.extend M.arity context.nil)\n           \u00d7 (\u03a3 (b y), concretion' \u210d \u03c9 (context.extend M.arity context.nil) b y)\n           \u00d7 name (context.extend M.arity context.nil))\n  , interaction_tensor_worker conc A B = interaction_tensor_worker conc B A\n| \u27e8 A, \u27e8 bF, yF, F \u27e9, a \u27e9 \u27e8 B, \u27e8 bG, yG, G \u27e9, b \u27e9 := begin\n  simp only [interaction_tensor_worker],\n  rw M.symm a.to_idx b.to_idx,\n\n  cases M.f (name.to_idx b) (name.to_idx a),\n  case option.none { from rfl },\n  case option.some {\n    simp only [],\n    by_cases this : (bF = yG \u2227 yF = bG),\n    {\n      rcases this with \u27e8 \u27e8 _ \u27e9, \u27e8 _ \u27e9 \u27e9,\n      let h : bF = bF \u2227 yF = yF := \u27e8 rfl, rfl \u27e9,\n      let g : yF = yF \u2227 bF = bF := \u27e8 rfl, rfl \u27e9,\n      simp only [dif_pos h, dif_pos g, cpi_equiv_prop.pseudo_apply_symm],\n      simp only [sub_eq_add_neg, add_comm, add_left_comm],\n    },\n    {\n      have h : \u00ac (bG = yF \u2227 yG = bF),\n      { rintros \u27e8 \u27e8 _ \u27e9, \u27e8 _ \u27e9 \u27e9, from this \u27e8 rfl, rfl \u27e9 },\n      simp only [dif_neg this, dif_neg h],\n    }\n  }\nend\n\n/-- Compute the interaction tensor between two elements in the interaction\n    space. -/\ndef interaction_tensor [cpi_equiv \u210d \u03c9] (conc: \u210d \u21aa \u2102)\n  : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil)\n  \u2192 interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil)\n  \u2192 process_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil)\n| x y := fin_fn.bind\u2082 x y (interaction_tensor_worker conc)\n\ninfix ` \u2298 `:73 := interaction_tensor _\nnotation x ` \u2298[`:73 conc `] ` y:73 := interaction_tensor conc x y\n\n@[simp]\nlemma interaction_tensor.zero_left [cpi_equiv \u210d \u03c9]\n  : \u2200 (A : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil))\n  , A \u2298[conc] 0 = 0\n| A := fin_fn.bind\u2082_zero_left A _\n\n@[simp]\nlemma interaction_tensor.zero_right [cpi_equiv \u210d \u03c9]\n  : \u2200 (A : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil))\n  , 0 \u2298[conc] A = 0\n| A := fin_fn.bind\u2082_zero_right A _\n\nlemma interaction_tensor.comm [cpi_equiv_prop \u210d \u03c9]\n    (A B : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil))\n  : A \u2298[conc] B = B \u2298[conc] A := begin\n  suffices : (\u03bb x y, interaction_tensor_worker conc x y)\n           = (\u03bb x y, interaction_tensor_worker conc y x),\n  { show fin_fn.bind\u2082 A B (interaction_tensor_worker conc)\n       = fin_fn.bind\u2082 B A (\u03bb x y, interaction_tensor_worker conc x y),\n    -- Sneaky use of \u03b7-expanding one function to make sure the rewrite applies.\n    rw this,\n    from fin_fn.bind\u2082_swap A B (interaction_tensor_worker conc) },\n\n  from funext (\u03bb x, funext (interaction_tensor_worker.comm x)),\nend\n\n@[simp]\nlemma interaction_tensor.left_distrib [cpi_equiv \u210d \u03c9]\n    (A B C : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil))\n  : (A + B) \u2298[conc] C = A \u2298[conc] C + B \u2298[conc] C\n  := by simp only [interaction_tensor, fin_fn.bind\u2082, fin_fn.bind_distrib]\n\n@[simp]\nlemma interaction_tensor.right_distrib [cpi_equiv_prop \u210d \u03c9]\n    (A B C : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil))\n  : A \u2298[conc] (B + C) = A \u2298[conc] B + A \u2298[conc] C\n  := calc  A \u2298 (B + C)\n         = (B + C) \u2298 A : interaction_tensor.comm A _\n     ... = B \u2298 A + C \u2298 A : interaction_tensor.left_distrib B C A\n     ... = A \u2298 B + A \u2298 C : by rw [interaction_tensor.comm B, interaction_tensor.comm C]\n\ninstance interaction_tensor.monoid_hom_left [cpi_equiv_prop \u210d \u03c9]\n    (\u03be : interaction_space \u2102 \u210d \u03c9 (context.extend M.arity context.nil))\n  : is_add_monoid_hom (interaction_tensor conc \u03be)\n  := { map_add := interaction_tensor.right_distrib \u03be,\n       map_zero := interaction_tensor.zero_left \u03be }\n\nend cpi\n\n#lint-\n", "meta": {"author": "continuouspi", "repo": "lean-cpi", "sha": "443bf2cb236feadc45a01387099c236ab2b78237", "save_path": "github-repos/lean/continuouspi-lean-cpi", "path": "github-repos/lean/continuouspi-lean-cpi/lean-cpi-443bf2cb236feadc45a01387099c236ab2b78237/src/data/cpi/semantics/interaction_tensor.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5506073802837477, "lm_q2_score": 0.32766829425520916, "lm_q1q2_score": 0.1804165811019049}}
{"text": "import data.real.irrational\nimport topology.basic\nimport algebra.order.floor\n\n\n--OUTPUT 1\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h2 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h3 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h4 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h5 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h6 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h7 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h8 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h9 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h10 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h11 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h12 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h13 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h14 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h15 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h16 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h17 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h18 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h19 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h20 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h21 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h22 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h23 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h24 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h25 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h26 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h27 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h28 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h29 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h30 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h31 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h32 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h33 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h34 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h35 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h36 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h37 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h38 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h39 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h40 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h41 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h42 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h43 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from sorry,\n  have h44 : \u2200 (i j : \u2124), i \u2260 j\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from sorry,\n  have h2 : (A \u2229 B) \u2286 A, from sorry,\n  have h3 : (A \u2229 B) \u2286 S, from sorry,\n  show (A \u2229 B) \u2208  \ud835\udcab S, from sorry,\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by sorry\n  ... = x*(x+y) + y*(x+y) : by sorry\n  ... = x*x + x*y + y*x + y*y : by sorry\n  ... = x^2 + 2*x*y + y^2 : by sorry,\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from sorry,\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from sorry,\n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from sorry,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from sorry,\n\n  have h5 : \u2200 a : G, classical.some (h3 a) = (1 : G), from sorry,\n  have h6 : \u2200 a : G, classical.some (h4 a) = (1 : G), from sorry,\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (h7 : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a), from sorry,\n      have h9 : \u2200 a : G, e = classical.some (h4 a), from sorry,\n      show e = (1 : G), from sorry,     \n    },\n    sorry,\n  }\nend\n\n/--`theorem`\nSqueeze Theorem for Real Numbers\nLet $\\sequence {x_n}$, $\\sequence {y_n}$ and $\\sequence {z_n}$ be sequences in $\\R$.\n\nLet $\\sequence {y_n}$ and $\\sequence {z_n}$ both be convergent to the following limit:\n:$\\ds \\lim_{n \\mathop \\to \\infty} y_n = l, \\lim_{n \\mathop \\to \\infty} z_n = l$\n\nSuppose that:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\n\nThen:\n:$x_n \\to l$ as $n \\to \\infty$\nthat is:\n:$\\ds \\lim_{n \\mathop \\to \\infty} x_n = l$\n\n`proof`\nFrom Negative of Absolute Value:\n:$\\size {x - l} < \\epsilon \\iff l - \\epsilon < x < l + \\epsilon$\n\nLet $\\epsilon > 0$.\n\nWe need to prove that:\n:$\\exists N: \\forall n > N: \\size {x_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} y_n = l$ we know that:\n:$\\exists N_1: \\forall n > N_1: \\size {y_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} z_n = l$ we know that:\n:$\\exists N_2: \\forall n > N_2: \\size {z_n - l} < \\epsilon$\n\n\nLet $N = \\max \\set {N_1, N_2}$.\n\nThen if $n > N$, it follows that $n > N_1$ and $n > N_2$.\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n < l + \\epsilon$\n:$\\forall n > N: l - \\epsilon < z_n < l + \\epsilon$\n\nBut:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n \\le x_n \\le z_n < l + \\epsilon$\n\nand so:\n:$\\forall n > N: l - \\epsilon < x_n < l + \\epsilon$\n\nSo:\n:$\\forall n > N: \\size {x_n - l} < \\epsilon$\n\nHence the result.\n{{qed}}\n\n-/\ntheorem squeeze_theorem_real_numbers (x y z : \u2115 \u2192 \u211d) (l : \u211d) : \nlet seq_limit : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=  \u03bb (u : \u2115 \u2192 \u211d) (l : \u211d), \u2200 \u03b5 > 0, \u2203 N, \u2200 n > N, |u n - l| < \u03b5 in\n seq_limit y l \u2192 seq_limit z l \u2192  (\u2200 n : \u2115, (y n) \u2264 (x n) \u2227 (x n) \u2264 (z n)) \u2192 seq_limit x l :=\nbegin\n  assume seq_limit (h2 : seq_limit y l) (h3 : seq_limit z l) (h4 : \u2200 (n : \u2115), y n \u2264 x n \u2227 x n \u2264 z n) (\u03b5), \n\n  have h5 : \u2200 x, |x - l| < \u03b5 \u2194 (((l - \u03b5) < x) \u2227 (x < (l + \u03b5))), \n  from sorry,\n  \n  assume (h7 : \u03b5 > 0),\n  cases h2 \u03b5 h7 with N1 h8,\n  cases h3 \u03b5 h7 with N2 h9,\n  let N := max N1 N2,\n  use N,\n\n  have h10 : \u2200 n > N, n > N1 \u2227 n > N2 := sorry,\n  have h11 : \u2200 n > N, (((l - \u03b5) < (y n)) \u2227 ((y n) \u2264 (x n))) \u2227 (((x n) \u2264 (z n)) \u2227 ((z n) < l+\u03b5)), \n  from sorry,\n\n  have h15 : \u2200 n > N, ((l - \u03b5) < (x n)) \u2227 ((x n) < (l+\u03b5)), \n  from sorry,\n\n  show  \u2200 (n : \u2115), n > N \u2192 |x n - l| < \u03b5, \n  from sorry,\nend\n\n/--`theorem`\nDensity of irrational orbit\nThe fractional parts of the integer multiples of an irrational number form a dense subset of the unit interval\n`proof`\nLet $\\alpha$ be an irrational number. Then for distinct $i, j \\in \\mathbb{Z}$, we must have $\\{i \\alpha\\} \\neq\\{j \\alpha\\}$. If this were not true, then\n$$\ni \\alpha-\\lfloor i \\alpha\\rfloor=\\{i \\alpha\\}=\\{j \\alpha\\}=j \\alpha-\\lfloor j \\alpha\\rfloor,\n$$\nwhich yields the false statement $\\alpha=\\frac{\\lfloor i \\alpha\\rfloor-\\lfloor j \\alpha\\rfloor}{i-j} \\in \\mathbb{Q}$. Hence,\n$$\nS:=\\{\\{i \\alpha\\} \\mid i \\in \\mathbb{Z}\\}\n$$\nis an infinite subset of $\\left[0,1\\right]$.\n\nBy the Bolzano-Weierstrass theorem, $S$ has a limit point in $[0, 1]$. One can thus find pairs of elements of $S$ that are arbitrarily close. Since (the absolute value of) the difference of any two elements of $S$ is also an element of $S$, it follows that $0$ is a limit point of $S$.\n\nTo show that $S$ is dense in $[0, 1]$, consider $y \\in[0,1]$, and $\\epsilon>0$. Then by selecting $x \\in S$ such that $\\{x\\}<\\epsilon$ (which exists as $0$ is a limit point), and $N$ such that $N \\cdot\\{x\\} \\leq y<(N+1) \\cdot\\{x\\}$, we get: $|y-\\{N x\\}|<\\epsilon$.\n\nQED\n-/\ntheorem  irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_outline-Natural-Language-Proof-Translation/Correct_statement-lean_proof_outline-4_few_shot_temperature_0_max_tokens_2000_n_1/clean_files/Density of irrational orbit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6477982179521103, "lm_q2_score": 0.2782567937024021, "lm_q1q2_score": 0.18025425509348408}}
{"text": "/-\nCopyright (c) 2022 Jo\u00ebl Riou. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jo\u00ebl Riou\n-/\n\nimport category_theory.idempotents.karoubi\nimport algebra.homology.homological_complex\n\nnoncomputable theory\n\nopen category_theory.category\nopen category_theory.preadditive\nopen category_theory.limits\nopen_locale big_operators\n\nnamespace category_theory\n\nvariables {C : Type*} [category C]\n\nnamespace idempotents\n\nnamespace karoubi\n\n--@[simp]\n--lemma zsmul_hom [preadditive C] {P Q : karoubi C} (f : P \u27f6 Q) (n : \u2124) :\n--  (n \u2022 f).f = n \u2022 f.f :=\n--map_zsmul (inclusion_hom P Q) n f\n\nend karoubi\n\nvariable (C)\n\n@[simps functor inverse]\ndef to_karoubi_equivalence [is_idempotent_complete C] : C \u224c karoubi C :=\nbegin\n  haveI := to_karoubi_is_equivalence C,\n  exact functor.as_equivalence (to_karoubi C),\nend\n\n\n--instance [preadditive C] [is_idempotent_complete C] :\n--  is_idempotent_complete (chain_complex C \u2115) := sorry\n\nend idempotents\n\nend category_theory\n", "meta": {"author": "joelriou", "repo": "dold-kan", "sha": "a083fe264275774ac49ac520caf25f2ee29debb1", "save_path": "github-repos/lean/joelriou-dold-kan", "path": "github-repos/lean/joelriou-dold-kan/dold-kan-a083fe264275774ac49ac520caf25f2ee29debb1/src/for_mathlib/idempotents/karoubi_misc.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5851011542032312, "lm_q2_score": 0.30404168757891037, "lm_q1q2_score": 0.17789514232831866}}
{"text": "import Duper.Tactic\n\naxiom f : Nat \u2192 Nat\naxiom a : Nat\n\nexample (h : f a = a) : \nf (f (f (f (f (f (f (f (f (f (\nf (f (f (f (f (f (f (f (f (f (\nf (f (f (f (f (f (f (f (f (f (\nf (f (f (f (f (f (f (f (f (f (\nf (f (f (f (f (f (f (f (f (f (\na\n))))))))))\n))))))))))\n))))))))))\n))))))))))\n)))))))))) = a\n := by duper", "meta": {"author": "leanprover-community", "repo": "duper", "sha": "96b8f8383363e800976b0fa99830c1b5e8c19b09", "save_path": "github-repos/lean/leanprover-community-duper", "path": "github-repos/lean/leanprover-community-duper/duper-96b8f8383363e800976b0fa99830c1b5e8c19b09/Duper/Tests/ffffa.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5273165233795672, "lm_q2_score": 0.3345894478883556, "lm_q1q2_score": 0.17643454441997655}}
{"text": "def myAdd [Add \u03b1] (x y : \u03b1) := x + y\n\nclass L1 (\u03b1 : Type u) where\n  add    : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1  : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n\ninstance L1.toAdd [inst : L1 \u03b1] : Add \u03b1 := { inst with }\n\nclass L2 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n\ninstance L2.toL1 [inst : L2 \u03b1] : L1 \u03b1 := { inst with }\n\nclass L3 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n\ninstance L3.toL2 [inst : L3 \u03b1] : L2 \u03b1 := { inst with }\n\nclass L4 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n\ninstance L4.toL3 [inst : L4 \u03b1] : L3 \u03b1 := { inst with }\n\nclass L5 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n\ninstance L5.toL4 [inst : L5 \u03b1] : L4 \u03b1 := { inst with }\n\nclass L6 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n\ninstance L6.toL5 [inst : L6 \u03b1] : L5 \u03b1 := { inst with }\n\nclass L7 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n\ninstance L7.toL6 [inst : L7 \u03b1] : L6 \u03b1 := { inst with }\n\nclass L8 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n\ninstance L8.toL7 [inst : L8 \u03b1] : L7 \u03b1 := { inst with }\n\nclass L9 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n  addc9 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) y x\n\ninstance L9.toL8 [inst : L9 \u03b1] : L8 \u03b1 := { inst with }\n\nclass T1 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n  addc9 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) y x\n\n-- slow\ninstance T1_toL9 {\u03b1 : Type u} [inst : T1 \u03b1] : L9 \u03b1 := { inst with }\n\nclass T2 (\u03b1 : Type u) where\n  add   : \u03b1 \u2192 \u03b1 \u2192 \u03b1\n  addc1 : \u2200 (x y : \u03b1), @myAdd \u03b1 \u27e8add\u27e9 x y = @myAdd \u03b1 \u27e8add\u27e9 y x\n  addc2 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) x y = @myAdd \u03b1 (@L1.toAdd _ \u27e8add, addc1\u27e9) y x\n  addc3 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ \u27e8add, addc1, addc2\u27e9)) y x\n  addc4 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ \u27e8add, addc1, addc2, addc3\u27e9))) y x\n  addc5 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ \u27e8add, addc1, addc2, addc3, addc4\u27e9)))) y x\n  addc6 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ \u27e8add, addc1, addc2, addc3, addc4, addc5\u27e9))))) y x\n  addc7 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6\u27e9)))))) y x\n  addc8 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7\u27e9))))))) y x\n  addc9 : \u2200 (x y : \u03b1), @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) x y = @myAdd \u03b1 (@L1.toAdd _ (@L2.toL1 _ (@L3.toL2 _ (@L4.toL3 _ (@L5.toL4 _ (@L6.toL5 _ (@L7.toL6 _ (@L8.toL7 _ \u27e8add, addc1, addc2, addc3, addc4, addc5, addc6, addc7, addc8\u27e9)))))))) y x\n\n-- slow\ninstance T2_toL9 {\u03b1 : Type u} [inst : T2 \u03b1] : L9 \u03b1 := { inst with }\n\n\nset_option pp.all true in\n-- #print T2.toL9\n\naxiom C : Type\naxiom C.add   : C \u2192 C \u2192 C\n\nnoncomputable instance C.T1 : T1 C := \u27e8add, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry\u27e9\nnoncomputable instance C.T2 : T2 C := \u27e8add, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry, sorry\u27e9\n\n-- slow\ntheorem ex : @T1_toL9 _ C.T1 = @T2_toL9 _ C.T2 := rfl\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/lean/run/tryHeuristicPerfIssue2.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5698526514141571, "lm_q2_score": 0.3073580105206753, "lm_q1q2_score": 0.1751487772285872}}
{"text": "universe u\nvariables {\u03b1 : Type u} [decidable_linear_order \u03b1]\n\nlemma right_le {a b c : \u03b1} (h :(max a b) \u2264 c) : b \u2264 c := \nhave h0 : \u00acb > c, from \n  (assume h1: b > c,\n  have h2: (max a b ) \u2265 b, from (le_max_right a b),\n  have h3: c < b, from h1,\n  have h4: b \u2264 (max a b), from h2,\n  have h5: c < (max a b), from lt_of_lt_of_le h3 h4,\n  have h6: (max a b) > c, from h5,\n  have h7: \u00ac((max a b) \u2264 c), from not_le_of_gt h6,\n  show false, from (h7 h)),\nshow b\u2264c, from  le_of_not_gt h0\n\nlemma left_le {a b c : \u03b1} (h :(max a b) \u2264 c) : a \u2264 c := \nhave h0: (max b a) \u2264 c, from (max_comm a b) \u25b8 h,\nshow a \u2264 c, from right_le h0\n\nnamespace nat\ndef test (k : set nat) (a: \u2115) : \u2115 := a\ndef kk : \u2115 := 9\n#reduce kk.test {} \n\n\nend nat", "meta": {"author": "johoelzl", "repo": "mason-stother", "sha": "573ecfaada288176462c03c87b80ad05bdab4644", "save_path": "github-repos/lean/johoelzl-mason-stother", "path": "github-repos/lean/johoelzl-mason-stother/mason-stother-573ecfaada288176462c03c87b80ad05bdab4644/auxiliary.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.6688802471698041, "lm_q2_score": 0.2598256379609837, "lm_q1q2_score": 0.1737922369403948}}
{"text": "import for_mathlib.algebra.homology.derivability_structure_injective\nimport for_mathlib.category_theory.abelian.extensions_derived_category\n\nnoncomputable theory\n\nopen category_theory category_theory.category category_theory.limits\n\nnamespace category_theory\n\nnamespace short_complex\n\nvariables {C : Type*} [category C] [preadditive C] [balanced C]\n\nlemma five_lemma.is_iso_\u03c4\u2081 {S\u2081 S\u2082 : short_complex C} (f : S\u2081 \u27f6 S\u2082)\n  (ex\u2081 : S\u2081.exact) [is_iso f.\u03c4\u2082] [mono f.\u03c4\u2083] [mono S\u2081.f] [mono S\u2082.f] :\n  is_iso f.\u03c4\u2081 :=\nbegin\n  refine \u27e8\u27e8short_complex.exact.lift ex\u2081 (S\u2082.f \u226b inv f.\u03c4\u2082) _, _, _\u27e9\u27e9,\n  { rw [\u2190 cancel_mono f.\u03c4\u2083, assoc, assoc, \u2190 f.comm\u2082\u2083, is_iso.inv_hom_id_assoc,\n    S\u2082.zero, zero_comp], },\n  { rw [\u2190 cancel_mono (S\u2081.f), assoc, short_complex.exact.lift_f, f.comm\u2081\u2082_assoc,\n      is_iso.hom_inv_id, comp_id, id_comp], },\n  { rw [\u2190 cancel_mono (S\u2082.f), assoc, f.comm\u2081\u2082, short_complex.exact.lift_f_assoc, assoc,\n    is_iso.inv_hom_id, comp_id, id_comp], },\nend\n\nend short_complex\n\nvariables {C D : Type*} [category C] [category D] [abelian C] [abelian D]\n  (F : C \u2964 D) [functor.additive F]\n\nnamespace injective_embedding\n\nvariables [enough_injectives C] (X : C)\n\ndef short_complex : short_complex C :=\nshort_complex.mk (injective.\u03b9 X) (cokernel.\u03c0 (injective.\u03b9 X)) (by simp)\n\ninstance injective_short_complex_X\u2082 : injective (short_complex X).X\u2082 :=\nby { dsimp [short_complex], apply_instance, }\n\ninstance : mono (short_complex X).f :=\nby { dsimp [short_complex], apply_instance, }\n\ninstance : epi (short_complex X).g :=\nby { dsimp [short_complex], apply_instance, }\n\nlemma short_exact : (short_complex X).short_exact :=\nshort_complex.short_exact.of_g_is_cokernel (cokernel_is_cokernel _)\n\nend injective_embedding\n\nnamespace functor\n\nsection\n\nvariables {\u03b9 : Type*} (c : complex_shape \u03b9) (n : \u03b9)\n\ndef single_comp_map_homological_complex_app [decidable_eq \u03b9] (X : C) :\n  (F.map_homological_complex c).obj ((homological_complex.single C c n).obj X) \u2245\n    (homological_complex.single D c n).obj (F.obj X) :=\nhomological_complex.hom.iso_of_components\n(\u03bb i, begin\n  by_cases i = n,\n  { exact eq_to_iso (by { dsimp, simp only [if_pos h], }), },\n  { dsimp,\n    simp only [if_neg h],\n    exact F.map_zero_object, },\nend)\n(\u03bb i j hij, begin\n  dsimp,\n  simp only [F.map_zero, zero_comp, comp_zero],\nend)\n\ndef single_comp_map_homological_complex [decidable_eq \u03b9] :\n  homological_complex.single C c n \u22d9 F.map_homological_complex c \u2245\n    F \u22d9 homological_complex.single D c n :=\nnat_iso.of_components (F.single_comp_map_homological_complex_app c n)\n(\u03bb X Y f, begin\n  ext i,\n  dsimp [single_comp_map_homological_complex_app],\n  by_cases i = n,\n  { simp only [dif_pos h, map_comp, eq_to_iso.hom, assoc, eq_to_hom_trans_assoc,\n      eq_to_hom_map, eq_to_hom_trans], },\n  { simp only [dif_neg h, F.map_zero, zero_comp, comp_zero], },\nend)\n\nvariable {c}\n\nlemma _root_.homotopy_category_quotient_map_functor_map_homological_complex\n  {K L : homological_complex C c} (f : K \u27f6 L) (F : C \u2964 D) [F.additive] :\n  (homotopy_category.quotient D c).map ((F.map_homological_complex c).map f) =\n    (map_homotopy_category c F).map ((homotopy_category.quotient C c).map f) :=\nbegin\n  apply homotopy_category.eq_of_homotopy,\n  apply F.map_homotopy,\n  apply homotopy_category.homotopy_of_eq,\n  simp only [homotopy_category.quotient_map_out],\nend\n\nend\n\ninstance map_is_strictly_ge (X : cochain_complex C \u2124) (n : \u2124) [X.is_strictly_ge n] :\n  cochain_complex.is_strictly_ge ((F.map_homological_complex _ ).obj X) n :=\n\u27e8\u03bb i hi, is_zero.of_iso (is_zero_zero D)\n  (F.map_iso (cochain_complex.is_strictly_ge.is_zero X n i hi).iso_zero \u226a\u226b F.map_zero_object)\u27e9\n\nlemma _root_.cochain_complex.is_plus.map {X : cochain_complex C \u2124} (h : X.is_plus)\n  (F : C \u2964 D) [functor.additive F] :\n  cochain_complex.is_plus ((map_homological_complex F (complex_shape.up \u2124)).obj X) :=\nbegin\n  obtain \u27e8n, hn\u27e9 := h,\n  haveI := hn,\n  exact \u27e8n, infer_instance\u27e9,\nend\n\ndef map_homotopy_category_factors :\n  homotopy_category.quotient _ _ \u22d9 map_homotopy_category (complex_shape.up \u2124) F \u2245\n    F.map_homological_complex _ \u22d9 homotopy_category.quotient _ _ :=\nnat_iso.of_components (\u03bb K, iso.refl _)\n(\u03bb K L f, begin\n  dsimp only [iso.refl, functor.comp_map],\n  rw [id_comp, comp_id],\n  apply homotopy_category.eq_of_homotopy,\n  apply F.map_homotopy,\n  apply homotopy_category.homotopy_of_eq,\n  simp only [homotopy_category.quotient_map_out],\nend)\n\ninstance map_homotopy_category_has_comm_shift :\n  (functor.map_homotopy_category (complex_shape.up \u2124) F).has_comm_shift \u2124 :=\n@quotient.has_comm_shift _ _ _ _ _ _ _ F.map_homotopy_category_factors \u2124\n  _ _ _ (infer_instance : has_shift (homotopy_category C (complex_shape.up \u2124)) \u2124)\n  (infer_instance : (homotopy_category.quotient _ _).has_comm_shift \u2124) _\n\ninstance : nat_trans.respects_comm_shift F.map_homotopy_category_factors.hom \u2124 :=\n\u27e8\u03bb n, begin\n  ext K,\n  dsimp only [map_homotopy_category_factors, nat_iso.of_components, whisker_right,\n    nat_trans.comp_app, iso.refl, whisker_left],\n  erw [functor.map_id, comp_id, id_comp],\n  apply homotopy_category.eq_of_homotopy,\n  erw [id_comp, id_comp, id_comp, id_comp, id_comp, id_comp, id_comp, id_comp,\n    comp_id, comp_id, comp_id],\n  apply homotopy_category.homotopy_of_eq,\n  simp only [functor.map_comp, homotopy_category.quotient_map_out,\n    homotopy_category_quotient_map_functor_map_homological_complex, iso.symm_hom,\n    \u2190 functor.map_comp_assoc],\n  erw [\u2190 functor.map_comp, iso.hom_inv_id_app, functor.map_id, id_comp],\nend\u27e9\n\ndef map_homotopy_category_plus : homotopy_category.plus C \u2964 homotopy_category.plus D :=\nfull_subcategory.lift _ (homotopy_category.plus.\u03b9 \u22d9 functor.map_homotopy_category _ F)\n  (\u03bb K, cochain_complex.is_plus.map K.2 F)\n\ndef map_homotopy_category_plus_factors :\n  F.map_homotopy_category_plus \u22d9 homotopy_category.plus.\u03b9 \u2245\n    homotopy_category.plus.\u03b9 \u22d9 functor.map_homotopy_category _ F :=\nfull_subcategory.lift_comp_inclusion _ _ _\n\n\ninstance map_homotopy_category_is_triangulated :\n  (map_homotopy_category (complex_shape.up \u2124) F).is_triangulated :=\n\u27e8\u03bb T hT, begin\n  rw homotopy_category.triangle_distinguished_iff at hT \u22a2,\n  obtain \u27e8K, L, f, \u27e8e\u27e9\u27e9 := hT,\n  exact \u27e8_, _, (F.map_homological_complex _).map f,\n    \u27e8(map_homotopy_category (complex_shape.up \u2124) F).map_triangle.map_iso e \u226a\u226b\n    (map_triangle_comp (homotopy_category.quotient C (complex_shape.up \u2124))\n    (map_homotopy_category (complex_shape.up \u2124) F)).symm.app _ \u226a\u226b\n    (map_triangle_nat_iso F.map_homotopy_category_factors).app _ \u226a\u226b\n    (map_triangle_comp (F.map_homological_complex (complex_shape.up \u2124))\n    (homotopy_category.quotient D (complex_shape.up \u2124))).app _ \u226a\u226b\n    (homotopy_category.quotient D (complex_shape.up \u2124)).map_triangle.map_iso\n      (cochain_complex.mapping_cone.triangle_map_iso f F)\u27e9\u27e9,\nend\u27e9\n\ninstance map_homotopy_category_plus_has_comm_shift :\n  (functor.map_homotopy_category_plus F).has_comm_shift \u2124 :=\nby { dsimp only [map_homotopy_category_plus], apply_instance, }\n\ninstance map_homotopy_category_plus_is_triangulated :\n  (functor.map_homotopy_category_plus F).is_triangulated :=\nby { dsimp only [map_homotopy_category_plus], apply_instance, }\n\nvariable [hF : (functor.map_homotopy_category_plus F \u22d9\n    derived_category.plus.Qh).has_right_derived_functor\n    (triangulated.subcategory.W (homotopy_category.plus.acyclic C))]\n\ninclude hF\n\nabbreviation right_derived_functor_plus : derived_category.plus C \u2964 derived_category.plus D :=\n  (functor.map_homotopy_category_plus F \u22d9\n    derived_category.plus.Qh).right_derived_functor derived_category.plus.Qh\n      (triangulated.subcategory.W (homotopy_category.plus.acyclic C))\n\ndef right_derived_functor_plus_\u03b1h :\n  functor.map_homotopy_category_plus F \u22d9\n    derived_category.plus.Qh \u27f6 derived_category.plus.Qh \u22d9\n      right_derived_functor_plus F :=\nfunctor.right_derived_functor_\u03b1 _ _ _\n\ndef abelian_right_derived_functor (n : \u2115) : C \u2964 D :=\nderived_category.plus.single_functor C 0 \u22d9 right_derived_functor_plus F \u22d9\n  derived_category.plus.homology_functor D (n : \u2124)\n\ninstance abelian_right_derived_functor_additive (n : \u2115)\n  [F.right_derived_functor_plus.is_triangulated] :\n  (F.abelian_right_derived_functor n).additive :=\nby { dsimp only [abelian_right_derived_functor], apply_instance, }\n\nomit hF\n\ninstance single_functor_is_termwise_injective (X : C) (n : \u2124) [injective X] :\n  ((homotopy_category.plus.single_functor C n).obj X).obj.as.is_termwise_injective :=\nbegin\n  change ((homological_complex.single C (complex_shape.up \u2124) n).obj X).is_termwise_injective,\n  apply_instance,\nend\n\ninstance (X : homotopy_category.plus C) [X.obj.as.is_termwise_injective]\n  [enough_injectives C] :\n  is_iso (F.right_derived_functor_plus_\u03b1h.app X) :=\nby { dsimp only [right_derived_functor_plus_\u03b1h], apply_instance, }\n\ndef map_homotopy_plus_single_functor_homology_iso_zero :\n  F \u2245 homotopy_category.plus.single_functor C 0 \u22d9 F.map_homotopy_category_plus \u22d9\n    derived_category.plus.Qh \u22d9 derived_category.plus.homology_functor D 0 :=\nbegin\n  change F \u2245 homotopy_category.plus.single_functor C 0 \u22d9 F.map_homotopy_category_plus \u22d9\n    derived_category.plus.Qh \u22d9 derived_category.plus.\u03b9 \u22d9 derived_category.homology_functor D 0,\n  refine F.right_unitor.symm \u226a\u226b\n    iso_whisker_left F (homological_complex.single_homology_functor_iso D (complex_shape.up \u2124) 0).symm \u226a\u226b\n    (functor.associator _ _ _).symm \u226a\u226b\n    iso_whisker_right (F.single_comp_map_homological_complex (complex_shape.up \u2124) 0).symm\n      (homology_functor D (complex_shape.up \u2124) 0) \u226a\u226b\n    functor.associator _ _ _ \u226a\u226b iso_whisker_left _ _ \u226a\u226b (functor.associator _ _ _).symm \u226a\u226b\n    iso_whisker_right (homotopy_category.plus.single_functor_factors C 0).symm _ \u226a\u226b\n    functor.associator _ _ _ \u226a\u226b iso_whisker_left _ (functor.associator _ _ _).symm \u226a\u226b\n    iso_whisker_left _ (iso_whisker_right (F.map_homotopy_category_plus_factors).symm _\n      \u226a\u226b functor.associator _ _ _ \u226a\u226b iso_whisker_left _ (functor.associator _ _ _).symm) \u226a\u226b\n    iso_whisker_left _ (iso_whisker_left _\n      (iso_whisker_right (derived_category.plus.Qh_comp_\u03b9_iso D).symm\n      (derived_category.homology_functor D 0) \u226a\u226b functor.associator _ _ _)),\n  refine iso_whisker_left _ _ \u226a\u226b (functor.associator _ _ _).symm \u226a\u226b\n    iso_whisker_right F.map_homotopy_category_factors.symm _ \u226a\u226b\n    functor.associator _ _ _,\n  refine (homotopy_category.homology_factors D (complex_shape.up \u2124) 0).symm \u226a\u226b\n    iso_whisker_left _ (derived_category.homology_functor_factors_Qh D 0).symm,\nend\n\ninstance derived_category_plus_single_functor_obj_obj_is_ge (X : C) (n : \u2124) :\n  ((derived_category.plus.single_functor C n).obj X).obj.is_ge n :=\nbegin\n  change ((derived_category.single_functor C n).obj X).is_ge n,\n  apply_instance,\nend\n\ninclude hF\n\ninstance right_derived_functor_plus_obj_is_ge [enough_injectives C]\n  (K : derived_category.plus C) (n : \u2124) [K.obj.is_ge n] :\n  (F.right_derived_functor_plus.obj K).obj.is_ge n :=\nbegin\n  obtain \u27e8K', hK', \u27e8e\u27e9\u27e9 := derived_category.exists_iso_Q_obj_of_ge K.obj n,\n  haveI := hK',\n  obtain \u27e8Z, hZ, f, hf, hZ'\u27e9 := homotopy_category.plus.termwise_injective.right_resolution_exists K' n,\n  let Z' : homotopy_category.plus C :=\n    \u27e8(homotopy_category.quotient _ _).obj Z, \u27e8n, hZ\u27e9\u27e9,\n  haveI : Z'.obj.as.is_termwise_injective := hZ',\n  let e' : K \u2245 derived_category.plus.Qh.obj Z' :=\n    derived_category.plus.\u03b9.preimage_iso (e \u226a\u226b as_iso (derived_category.Q.map f)),\n  have e'' := (derived_category.Qh.map_iso ((map_homotopy_category_factors F).app Z)).symm \u226a\u226b\n    (derived_category.Qh.map_iso (F.map_homotopy_category_plus_factors.app Z')).symm \u226a\u226b\n    (derived_category.plus.Qh_comp_\u03b9_iso D).symm.app\n    (F.map_homotopy_category_plus.obj Z') \u226a\u226b derived_category.plus.\u03b9.map_iso\n    (as_iso (F.right_derived_functor_plus_\u03b1h.app Z')) \u226a\u226b\n    ((F.right_derived_functor_plus \u22d9 derived_category.plus.\u03b9).map_iso e'.symm),\n  erw \u2190 derived_category.is_ge.iff_of_iso e'' n,\n  change (derived_category.Q.obj _).is_ge n,\n  apply_instance,\nend\n\ndef abelian_right_derived_functor_\u03b1 : F \u27f6 F.abelian_right_derived_functor 0 :=\nbegin\n  refine _ \u226b whisker_right (whisker_left (homotopy_category.plus.single_functor C 0)\n    F.right_derived_functor_plus_\u03b1h) (derived_category.plus.homology_functor D 0) \u226b \ud835\udfd9 _,\n  { exact F.map_homotopy_plus_single_functor_homology_iso_zero.hom, },\nend\n\nlemma abelian_right_derived_functor_\u03b1_app (X : C) :\n  F.abelian_right_derived_functor_\u03b1.app X =\n  F.map_homotopy_plus_single_functor_homology_iso_zero.hom.app X \u226b\n    (derived_category.plus.homology_functor D 0).map\n      (F.right_derived_functor_plus_\u03b1h.app ((homotopy_category.plus.single_functor C 0).obj X)) :=\nbegin\n  dsimp only [abelian_right_derived_functor_\u03b1, whisker_right, whisker_left,\n    nat_trans.comp_app, nat_trans.id_app],\n  rw comp_id,\nend\n\ninstance is_iso_abelian_right_derived_functor_plus_\u03b1_app (X : C) [injective X] [enough_injectives C] :\n  is_iso (F.abelian_right_derived_functor_\u03b1.app X) :=\nbegin\n  rw abelian_right_derived_functor_\u03b1_app,\n  apply_instance,\nend\n\nlemma abelian_right_derived_functor_obj_is_zero_of_injective'\n  (X : C) [injective X] [enough_injectives C] (n : \u2115) (hn : 1 \u2264 n) :\n  limits.is_zero ((F.abelian_right_derived_functor n).obj X) :=\nbegin\n  refine is_zero.of_iso _ (((derived_category.plus.homology_functor D n).map_iso\n    (as_iso (F.right_derived_functor_plus_\u03b1h.app\n      ((homotopy_category.plus.single_functor C 0).obj X)))).symm),\n  have h : limits.is_zero ((derived_category.homology_functor D n).obj\n    ((derived_category.single_functor D 0).obj (F.obj X))),\n  { apply derived_category.is_le.is_zero _ 0,\n    rw \u2190 int.coe_nat_le_coe_nat_iff at hn,\n    rw [algebra_map.coe_one] at hn,\n    linarith, },\n  refine is_zero.of_iso h ((derived_category.homology_functor D \u2191n).map_iso _),\n  let e : homotopy_category.plus.single_functor C 0 \u22d9 F.map_homotopy_category_plus \u22d9\n    derived_category.plus.Qh \u22d9 derived_category.plus.\u03b9 \u2245 F \u22d9 derived_category.single_functor D 0,\n  { refine iso_whisker_left _ (iso_whisker_left _ (derived_category.plus.Qh_comp_\u03b9_iso D)) \u226a\u226b\n      iso_whisker_left _ ((functor.associator _ _ _).symm \u226a\u226b\n      iso_whisker_right F.map_homotopy_category_plus_factors derived_category.Qh) \u226a\u226b\n      iso_whisker_left _ (functor.associator _ _ _) \u226a\u226b\n      (functor.associator _ _ _).symm \u226a\u226b\n      iso_whisker_right (homotopy_category.plus.single_functor_factors C 0)\n        (map_homotopy_category (complex_shape.up \u2124) F \u22d9 derived_category.Qh) \u226a\u226b\n      functor.associator _ _ _ \u226a\u226b\n      iso_whisker_left _ ((functor.associator _ _ _).symm \u226a\u226b\n      iso_whisker_right F.map_homotopy_category_factors _) \u226a\u226b\n      iso_whisker_left _ (functor.associator _ _ _) \u226a\u226b\n      (functor.associator _ _ _).symm \u226a\u226b\n      iso_whisker_right (F.single_comp_map_homological_complex (complex_shape.up \u2124) 0) derived_category.Q, },\n  exact e.app _,\nend\n\nlemma abelian_right_derived_functor_obj_is_zero_of_injective (X : C)\n  [injective X] [enough_injectives C] (n : \u2115) :\n  limits.is_zero ((F.abelian_right_derived_functor (n+1)).obj X) :=\nabelian_right_derived_functor_obj_is_zero_of_injective' _ _ _ (by linarith)\n\nnamespace abelian_right_derived_functor_homology_sequence\n\nvariables {S : short_complex C} (ex : S.short_exact) (n : \u2115 )\n\ndef triangle : pretriangulated.triangle (derived_category.plus D) :=\nF.right_derived_functor_plus.map_triangle.obj (derived_category.plus.triangle_of_ses\n  (short_complex.short_exact.map_of_exact ex (homological_complex.single C (complex_shape.up \u2124) 0))\n  (by { dsimp, exact \u27e80, infer_instance\u27e9, })\n  (by { dsimp, exact \u27e80, infer_instance\u27e9, })\n  (by { dsimp, exact \u27e80, infer_instance\u27e9, }))\n\ndef triangle' : pretriangulated.triangle (derived_category D) :=\nderived_category.plus.\u03b9.map_triangle.obj (triangle F ex)\n\nvariable [hF' : F.right_derived_functor_plus.is_triangulated]\n\ninclude hF'\n\nlemma triangle_mem : (triangle F ex).distinguished :=\nF.right_derived_functor_plus.map_distinguished _\n  (derived_category.plus.triangle_of_ses_dist _ _ _ _)\n\nlemma triangle'_mem : (triangle' F ex).distinguished :=\nderived_category.plus.\u03b9.map_distinguished _ (triangle_mem F ex)\n\nlemma ex\u2082 (n : \u2115) :\n  (short_complex.mk ((F.abelian_right_derived_functor n).map S.f)\n    ((F.abelian_right_derived_functor n).map S.g)\n    (by { rw [\u2190 functor.map_comp, S.zero, functor.map_zero], })).exact :=\nderived_category.homology_sequence.ex\u2082 (triangle'_mem F ex) n\n\ndef \u03b4 (n\u2080 n\u2081 : \u2115) (h : n\u2081 = n\u2080+1) :\n  (F.abelian_right_derived_functor n\u2080).obj S.X\u2083 \u27f6 (F.abelian_right_derived_functor n\u2081).obj S.X\u2081 :=\nderived_category.homology_sequence.\u03b4 (triangle'_mem F ex) n\u2080 n\u2081 (by simp [h])\n\n@[simp, reassoc]\nlemma \u03b4_comp (n\u2080 n\u2081 : \u2115) (h : n\u2081 = n\u2080+1) :\n  \u03b4 F ex n\u2080 n\u2081 h \u226b (F.abelian_right_derived_functor n\u2081).map S.f = 0 :=\nderived_category.homology_sequence.\u03b4_comp (triangle'_mem F ex) n\u2080 n\u2081 (by simp [h])\n\n@[simp, reassoc]\nlemma comp_\u03b4 (n\u2080 n\u2081 : \u2115) (h : n\u2081 = n\u2080+1) :\n   (F.abelian_right_derived_functor n\u2080).map S.g \u226b \u03b4 F ex n\u2080 n\u2081 h = 0 :=\nderived_category.homology_sequence.comp_\u03b4 (triangle'_mem F ex) n\u2080 n\u2081 (by simp [h])\n\nlemma ex\u2083 (n\u2080 n\u2081 : \u2115) (h : n\u2081 = n\u2080+1) :\n  (short_complex.mk ((F.abelian_right_derived_functor n\u2080).map S.g) (\u03b4 F ex n\u2080 n\u2081 h)\n    (by simp)).exact :=\nderived_category.homology_sequence.ex\u2083 (triangle'_mem F ex) n\u2080 n\u2081 (by simp [h])\n\nlemma ex\u2081 (n\u2080 n\u2081 : \u2115) (h : n\u2081 = n\u2080+1) :\n  (short_complex.mk (\u03b4 F ex n\u2080 n\u2081 h) ((F.abelian_right_derived_functor n\u2081).map S.f)\n    (by simp)).exact :=\nderived_category.homology_sequence.ex\u2081 (triangle'_mem F ex) n\u2080 n\u2081 (by simp [h])\n\ninclude ex\n\nlemma ex\u2080\n  [(F.right_derived_functor_plus.obj\n ((derived_category.plus.single_functor C 0).obj S.X\u2083)).obj.is_ge 0] :\n  mono ((F.abelian_right_derived_functor 0).map S.f) :=\nbegin\n  refine (short_complex.exact_iff_mono _ (is_zero.eq_of_src _ _ _)).1\n    (derived_category.homology_sequence.ex\u2081 (triangle'_mem F ex) (-1) 0 (neg_add_self 1).symm),\n  have h := derived_category.is_ge.is_zero ((F.right_derived_functor_plus.obj\n   ((derived_category.plus.single_functor C 0).obj S.X\u2083)).obj) 0 (-1) (by simp),\n  exact h,\nend\n\nomit ex\nomit hF'\n\ninstance (X : C) [F.preserves_monomorphisms] [enough_injectives C]:\n  mono (F.abelian_right_derived_functor_\u03b1.app X) :=\nbegin\n  suffices : mono (F.abelian_right_derived_functor_\u03b1.app X \u226b\n    (F.abelian_right_derived_functor 0).map (injective.\u03b9 X)),\n  { haveI := this,\n    exact mono_of_mono _ ((F.abelian_right_derived_functor 0).map (injective.\u03b9 X)), },\n  rw \u2190 nat_trans.naturality,\n  apply_instance,\nend\n\ninstance (X : C) [preserves_finite_limits F] [enough_injectives C] :\n  is_iso (F.abelian_right_derived_functor_\u03b1.app X) :=\nbegin\n  haveI : mono ((injective_embedding.short_complex X).map (F.abelian_right_derived_functor 0)).f :=\n    ex\u2080 F (injective_embedding.short_exact X),\n  haveI : mono ((injective_embedding.short_complex X).map F).f,\n  { dsimp, apply_instance, },\n  let f := short_complex.map_nat_trans (injective_embedding.short_complex X)\n    F.abelian_right_derived_functor_\u03b1,\n  haveI : mono f.\u03c4\u2083 := (infer_instance : mono (F.abelian_right_derived_functor_\u03b1.app _)),\n  haveI : is_iso f.\u03c4\u2082 := (infer_instance : is_iso (F.abelian_right_derived_functor_\u03b1.app _)),\n  refine short_complex.five_lemma.is_iso_\u03c4\u2081 f _,\n  apply short_complex.exact.of_f_is_kernel,\n  let e : parallel_pair (injective_embedding.short_complex X).g 0 \u22d9 F \u2245\n    parallel_pair (F.map (injective_embedding.short_complex X).g) 0 :=\n    parallel_pair.ext (iso.refl _) (iso.refl _) (by tidy) (by tidy),\n  equiv_rw (limits.is_limit.postcompose_inv_equiv e _).symm,\n  refine limits.is_limit.of_iso_limit\n    (is_limit_of_preserves F ((injective_embedding.short_exact X).exact.f_is_kernel))\n    (cones.ext (iso.refl _) _),\n  rintro (_|_),\n  { tidy, },\n  { dsimp,\n    simp only [short_complex.zero, functor.map_zero, comp_id, id_comp,\n      \u2190 F.map_comp], },\nend\n\ninstance [preserves_finite_limits F] [enough_injectives C] :\n  is_iso F.abelian_right_derived_functor_\u03b1 :=\nnat_iso.is_iso_of_is_iso_app _\n\nend abelian_right_derived_functor_homology_sequence\n\nend functor\n\nend category_theory\n", "meta": {"author": "joelriou", "repo": "homotopical_algebra", "sha": "697f49d6744b09c5ef463cfd3e35932bdf2c78a3", "save_path": "github-repos/lean/joelriou-homotopical_algebra", "path": "github-repos/lean/joelriou-homotopical_algebra/homotopical_algebra-697f49d6744b09c5ef463cfd3e35932bdf2c78a3/src/for_mathlib/algebra/homology/right_derived_functor.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5774953651858117, "lm_q2_score": 0.30074557894124154, "lm_q1q2_score": 0.17367917793869064}}
{"text": "import Runtime.Reaction\nimport Runtime.Reactor\n\nstructure Network.Graph where\n  classes : Type\n  schemes : classes \u2192 (Reactor.Scheme classes)\n  [decEqClasses : DecidableEq classes]\n\nattribute [instance] Network.Graph.decEqClasses\n\nnamespace Network.Graph\n\ndef Class (graph : Graph) := graph.classes\n\nnamespace Class\n\ninstance : DecidableEq (Class graph) :=\n  fun cls\u2081 cls\u2082 =>\n    let c\u2081 : graph.classes := cls\u2081\n    let c\u2082 : graph.classes := cls\u2082\n    if h : c\u2081 = c\u2082 then isTrue h else isFalse h\n\nprivate def scheme (cls : Class graph) := graph.schemes cls\n\nabbrev interface (cls : Class graph) := cls.scheme.interface\n\nabbrev timers (cls : Class graph) := cls.scheme.timers\n\nstructure Child (cls : Class graph) where\n  id : cls.scheme.children\n  deriving DecidableEq\n\ndef Child.class {cls : Class graph} (child : Child cls) : Class graph :=\n  cls.scheme.class child.id\n\n-- TODO: Get this coercion to work at call site.\ninstance {cls : Class graph} : Coe (Child cls) (Class graph) where\n  coe child := child.class\n\nabbrev subinterface (cls : Class graph) (kind : Reactor.InterfaceKind) :=\n  \u2a04 fun child : Child cls => child.class.interface kind\n\nabbrev reactionInputScheme (cls : Class graph) :=\n  let localInputs := cls.interface .inputs\n  let nestedOutputs := cls.subinterface .outputs\n  localInputs \u228e nestedOutputs\n\n@[simp]\ntheorem reactionInputScheme_type_left {cls : Class graph} (localInput) :\n  cls.reactionInputScheme.type (.inl localInput) = (cls.interface .inputs).type localInput := rfl\n\n@[simp]\ntheorem reactionInputScheme_type_right {cls : Class graph} (child childOutput) :\n  cls.reactionInputScheme.type (.inr \u27e8child, childOutput\u27e9) = (child.class.interface .outputs).type childOutput := by\n  simp [Interface.Scheme.bUnion_type]\n\nabbrev reactionOutputScheme (cls : Class graph) :=\n  let localOutputs := cls.interface .outputs\n  let nestedInputs := cls.subinterface .inputs\n  localOutputs \u228e nestedInputs\n\nopen Interface in\nstructure Reaction (cls : Class graph) where\n  val : Reaction\n  [subPS : Subscheme val.portSources cls.reactionInputScheme]\n  [subPE : Subscheme val.portEffects cls.reactionOutputScheme]\n  [subAS : Subscheme val.actionSources (cls.interface .actions)]\n  [subAE : Subscheme val.actionEffects (cls.interface .actions)]\n  eqState  : cls.interface .state = val.state   := by rfl\n  eqParams : cls.interface .params = val.params := by rfl\n  eqTimers : cls.timers = val.timers            := by rfl\n\nopen Reaction in\nattribute [instance] subPS subPE subAS subAE\n\nstructure Subport (cls : Class graph) (kind : Reactor.PortKind) where\n  child : Child cls\n  port  : (child.class.interface kind).vars\n  deriving DecidableEq\n\nabbrev Subport.type (subport : Subport cls kind) : Type :=\n  (subport.child.class.interface kind).type subport.port\n\nstructure Connections.DelayedDestination {cls : Class graph} (src : Subport cls .output) where\n  dst    : Subport cls .input\n  delay  : Duration\n  eqType : src.type = dst.type := by rfl\n\n-- The data layout of this type is motivated by execution-specific use cases:\n-- * Non-delayed connections are used in a context where a destination\n--   port needs to find its corresponding source port (if it exists).\n-- * Delayed connections are used in a context where a given source\n--   port needs to enumerate all of its delayed destinations.\n--\n-- Note: We're not to enforcing uniqueness of connections to input ports,\n--       as this is handled by the LF frontend.\nopen Connections in\nstructure Connections (cls : Class graph) where\n  instantaneous : (Subport cls .input) \u2192 Option (Subport cls .output)\n  delayed       : (src : Subport cls .output) \u2192 Array (DelayedDestination src)\n  instEqType    : \u2200 {dst src}, (instantaneous dst = some src) \u2192 dst.type = src.type\n\nend Class\nend Network.Graph\n", "meta": {"author": "lf-lang", "repo": "reactor-lean", "sha": "d2eb5458446af838be34ebb6f69549b2f6d9c04d", "save_path": "github-repos/lean/lf-lang-reactor-lean", "path": "github-repos/lean/lf-lang-reactor-lean/reactor-lean-d2eb5458446af838be34ebb6f69549b2f6d9c04d/Runtime/Network/Graph/Basic.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5312093733737563, "lm_q2_score": 0.32423539898095244, "lm_q1q2_score": 0.1722368831182616}}
{"text": "import smt2\n\nlemma fstar_goal_with_unit\n(a b q : nat)\n(prf_b : 0 < b)\n(prf_q : 0 < q)\n(p : unit \u2192 Prop)\n(x : forall (x : unit), p x) : a = a :=\nbegin\n    z3 \"fst.log\"\nend\n", "meta": {"author": "leanprover", "repo": "smt2_interface", "sha": "7ff0ce248b68ea4db2a2d4966a97b5786da05ed7", "save_path": "github-repos/lean/leanprover-smt2_interface", "path": "github-repos/lean/leanprover-smt2_interface/smt2_interface-7ff0ce248b68ea4db2a2d4966a97b5786da05ed7/test/unit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5117166047041654, "lm_q2_score": 0.3345894478883556, "lm_q1q2_score": 0.1712149762432706}}
{"text": "\nimport data.finset.basic\nimport data.nat.basic\nimport init.data.fin.ops\nimport init.data.option.basic\n\nimport .yul_cmd\n\nnamespace YulSemantics\n\nopen YulCommands\nopen YulCommands.TermType\nopen YulCommands.IsInFunc\nopen YulCommands.IsInFor\nopen YulCommands.YulTerm\n\nvariable \u03c4 : Type\nvariable \u0393 : FTContext\n\ninductive Mode : IsInFor \u2192 IsInFunc \u2192 Type\n  | NormMode : \u2200 {b : IsInFor} {b' : IsInFunc}, Mode b b'\n  | BreakMode  : \u2200 {b' : IsInFunc}, Mode NestedInFor b' \n  | ContinueMode : \u2200 {b' : IsInFunc}, Mode NestedInFor b'\n  | LeaveMode : \u2200 {b : IsInFor}, Mode b InFunc\n  | TermMode : \u2200 {b : IsInFor} {b' : IsInFunc}, Mode b b'\n\nopen Mode\n\ndef liftMode : \n      \u2200 {b : IsInFor} {b' : IsInFunc}, \n    Mode NotNestedInFor NotInFunc \u2192 Mode b b' \n| _ _ NormMode := NormMode\n| _ _ TermMode := TermMode\n\ndef mode_eq : \u2200 {b : IsInFor} {b' : IsInFunc}, Mode b b' -> Mode b b' -> Prop \n| _ _ NormMode NormMode := true\n| _ _ BreakMode BreakMode := true\n| _ _ ContinueMode ContinueMode := true\n| _ _ LeaveMode LeaveMode := true\n| _ _ TermMode TermMode := true\n| _ _ BreakMode NormMode := false\n| _ _ ContinueMode NormMode := false\n| _ _ LeaveMode NormMode := false\n| _ _ TermMode NormMode := false\n| _ _ NormMode BreakMode := false\n| _ _ ContinueMode BreakMode := false\n| _ _ LeaveMode BreakMode := false\n| _ _ TermMode BreakMode := false\n| _ _ NormMode ContinueMode := false\n| _ _ BreakMode ContinueMode := false\n| _ _ LeaveMode ContinueMode := false\n| _ _ TermMode ContinueMode := false\n| _ _ NormMode LeaveMode := false\n| _ _ BreakMode LeaveMode := false\n| _ _ ContinueMode LeaveMode := false\n| _ _ TermMode LeaveMode := false\n| _ _ NormMode TermMode := false\n| _ _ BreakMode TermMode := false\n| _ _ ContinueMode TermMode := false\n| _ _ LeaveMode TermMode := false\n\n\ninstance (b : IsInFor) (b' : IsInFunc) (a : Mode b b') (b : Mode b b') : decidable (mode_eq a b) :=\n  begin\n    cases a,\n    repeat {\n      cases b,\n      repeat {\n        rw mode_eq,\n        apply decidable.is_false,\n        intro f,\n        exact f,\n      },\n      rw mode_eq,\n      apply decidable.is_true,\n      trivial,\n    },\n  end\n\ndef cast_not_in_for_mode : \u2200 {b : IsInFor} {b' : IsInFunc}, Mode NotNestedInFor b' \u2192 Mode b b' :=\n  begin\n    intros b b' mode,\n    cases mode,\n    exact NormMode,\n    exact LeaveMode,\n    exact TermMode,\n  end\n\ndef cast_not_in_func_mode : \u2200 {b : IsInFor} {b' : IsInFunc}, Mode b NotInFunc \u2192 Mode b b' :=\n  begin\n    intros b b' mode,\n    cases mode,\n    exact NormMode,\n    exact BreakMode,\n    exact ContinueMode,\n    exact TermMode,\n  end\n\n\ndef FDef (n : \u2115) (m : \u2115)  := \n  \u03a3 (arg_ids : vector Identifier n) (ret_args : vector Identifier m) (fin_args : finset Identifier), \n    YulTerm \u0393 \n      (BlockList \n        (tofinset' arg_ids \u222a tofinset' ret_args) \n        (fin_args \u222a tofinset' ret_args) \n        NotNestedInFor\n        InFunc\n      )\n\n/- \n   FPrim n m primState is the type of state transformers which\n   can fail over primState with arity n and returning m values.\n-/\n\ndef FPrim (n : \u2115) (m : \u2115) :=\n  vector Literal n \u2192 \u03c4 \u2192 option (\u03c4 \u00d7 vector Literal m \u00d7 Mode NotNestedInFor NotInFunc)\n\ndef FImpl (\u0393 : FTContext) := \n  \u2200 i : Identifier, \u2200 {n m : \u2115}, \u0393 i = some (n,m) \u2192 FDef \u0393 n m \u2295 FPrim \u03c4 n m\n\ndef YulState (\u0393 : FTContext) (vars : finset Identifier) := \n  VarStore vars \u00d7 FImpl \u03c4 \u0393 \u00d7 \u03c4\n\ndef merge_scopes : \u2200 {vars_outer vars_inner : finset Identifier},\n   VarStore vars_outer \u2192 VarStore vars_inner \u2192 VarStore (vars_inner \u222a vars_outer)\n| vars_outer vars_inner vso vsi i i_in_vo_u_vi := \n    dite (i \u2208 vars_inner)\n      (\u03bb i_in_inner, vsi i i_in_inner)\n      (\u03bbi_n_in_inner, \n        dite (i \u2208 vars_outer)\n        (\u03bbi_in_outer, vso i i_in_outer)\n        (\u03bbi_n_in_outer, \n          let i_n_in_vo_u_vi : \u00ac  (i \u2208 vars_inner \u222a vars_outer) := \n            begin\n              intro i_in_vo_u_vi,\n              cases finset.mem_union.1 i_in_vo_u_vi with h,\n              exact (i_n_in_inner h),\n              exact (i_n_in_outer h),\n            end\n          in absurd i_in_vo_u_vi i_n_in_vo_u_vi\n        )\n      )\n\ndef split_scope : \u2200 {vars_inner vars_outer : finset Identifier}, \n  VarStore vars_outer \u2192 VarStore (vars_outer \u222a vars_inner) \u2192 \n  (VarStore vars_outer \u00d7 VarStore vars_inner)\n| vars_inner vars_outer outer_\u03c3 merged_\u03c3' :=\n  let outer_\u03c3' : VarStore vars_outer :=\n        \u03bb i i_in_o, \n          let i_in_o_u_i : i \u2208 vars_outer \u222a vars_inner :=\n            begin\n              apply finset.mem_union.2,\n              exact (or.inl i_in_o),\n            end\n          in merged_\u03c3' i i_in_o_u_i,\n      inner_\u03c3' : VarStore vars_inner :=\n          \u03bb i i_in_i, \n            let i_in_o_u_i : i \u2208 vars_outer \u222a vars_inner :=\n            begin\n              apply finset.mem_union.2,\n              exact (or.inr i_in_i),\n            end\n          in merged_\u03c3' i i_in_o_u_i\n  in (outer_\u03c3', inner_\u03c3')\n\ndef extend_var_store : \n  \u2200 {vars : finset Identifier} {n : \u2115} (arg_ids : vector Identifier n) (arg_vals : vector Literal n), \n  VarStore vars \u2192 VarStore (vars \u222a tofinset' arg_ids)\n  | vars 0 _ _ \u03c3 i i_in_vars_u_ids := \n    \u03c3 i \n      begin\n        rw tofinset' at i_in_vars_u_ids,\n        rw finset.union_empty at i_in_vars_u_ids,\n        exact i_in_vars_u_ids,\n      end\n  | vars (nat.succ n) arg_ids arg_vals \u03c3 i i_in_vars_u_ids :=\n    dite (i = arg_ids.head)\n        (\u03bb_, arg_vals.head)\n      (\u03bbarg_id_neq_i, \n        let i_in_vars_u_ids' : i \u2208 vars \u222a tofinset' (arg_ids.tail) :=\n              begin\n                rw finset.mem_union at i_in_vars_u_ids,\n                cases i_in_vars_u_ids,\n                apply finset.mem_union.2,\n                exact (or.inl i_in_vars_u_ids),\n                rw tofinset' at i_in_vars_u_ids,\n                rw finset.mem_union at i_in_vars_u_ids,\n                cases i_in_vars_u_ids,\n                apply finset.mem_union.2,\n                exact (or.inr i_in_vars_u_ids),\n                exfalso,\n                exact arg_id_neq_i (finset.mem_singleton.1 i_in_vars_u_ids),\n              end\n        in @extend_var_store vars n arg_ids.tail arg_vals.tail \u03c3 i i_in_vars_u_ids')\n\ndef extract_vars : \n  \u2200 {n : \u2115} {vars : finset Identifier}, \n    VarStore vars \u2192 \u2200 (vec : vector Identifier n),\n    tofinset' vec \u2286 vars \u2192 vector Literal n \n  | 0 _ _ _ _ := vector.nil\n  | (nat.succ n) vars \u03c3 vec vec_finset_ss_vars :=\n      let head_in_vars : vec.head \u2208 vars :=\n            by {\n              exact finset.mem_of_subset \n                vec_finset_ss_vars \n                (vec_head_in_finset vec),\n            },\n          tail_ss_vars : tofinset' vec.tail \u2286 vars :=\n            by {\n              exact finset.subset.trans \n                (tl_finset_subset_vec_finset vec) \n                vec_finset_ss_vars,\n            }\n      in vector.cons (\u03c3 vec.head head_in_vars) \n          (@extract_vars n vars \u03c3 vec.tail tail_ss_vars)\n\ndef termSize : \u2200 {t : TermType}, YulTerm \u0393 t \u2192 \u2115\n| _ EmpCBlock := 0\n| t blklst@(SeqCBlock _ cstmnt blklst') := 1 + termSize cstmnt\n| _ (NestedScope _ _ _ blklst) := 1 + termSize blklst\n\n| _ (CCase _ cblk swtchbody) := 1 + termSize swtchbody\n| _ (CDefault cblk) := 0\n| _ CNone := 0\n\n| _ (CFunctionCall _ n _ arg_exprs) := 1 + list.sum (list.of_fn (\u03bb i : fin n, 1 + termSize (arg_exprs i)))\n| _ (CId _ _) := 0\n| _ (CLit _) := 0\n| _ (Scope _ _ _ _ cstmnt) := 1 + termSize cstmnt\n| _ (Result _) := 0\n\n| _ (CBlock cblk) := 1 + termSize cblk\n| _ (CVariableDeclarationAss _ _ cexpr) := 1 + termSize cexpr\n| _ (CVariableDeclaration n new_vars) := 0\n| _ (CAssignment _ _ _ cexpr) := 1 + termSize cexpr \n| _ (CIf cexpr cblk) := 1 + termSize cexpr\n| _ (CExpressionStatement cexpr) := 1 + termSize cexpr \n| _ (CSwitch cexpr swtchbody) := 1 + termSize cexpr \n| _ (CFor _ _ _ init cond body post) := 0\n| _ CBreak := 0\n| _ CContinue := 0\n| _ CLeave := 0\n| _ (ForExecInit _ _ _ _ _ _ _ _ eval_init) := 1 + termSize eval_init\n| _ (ForCheckCond _ _ _ _ _ _ _ eval_cond) := 1 + termSize eval_cond \n| _ (ForExecBody _ _ _ _ _ _ _ _ _ eval_loop) := 1 + termSize eval_loop\n| _ (ForExecPost _ _ _ _ _ _ _ _ eval_post) := 1 + termSize eval_post\n| _ Skip := 0\n\ndef evalMetric :\n     (psum\n       (\u03a3' {vars vars'' : finset Identifier} {b : IsInFor} {b' : IsInFunc}\n          (blklst : YulTerm \u0393 (BlockList vars vars'' b b')) (\u1fb0 : \u00acis_empcblock \u0393 blklst),\n          YulState \u03c4 \u0393 vars)\n       (psum\n          (\u03a3' {vars : finset Identifier} {b : IsInFor} {b' : IsInFunc} (blk : YulTerm \u0393 (CBlock vars b b'))\n             (\u1fb0 : \u00acis_empblock \u0393 blk),\n             YulState \u03c4 \u0393 vars)\n          (psum\n             (\u03a3' {vars : finset Identifier} {n : \u2115} (cexprs : vector (YulTerm \u0393 (CExpr vars 1)) n)\n                (\u1fb0 : \u00acare_args_reduced \u0393 cexprs),\n                YulState \u03c4 \u0393 vars)\n             (psum\n                (\u03a3' {vars : finset Identifier} {n : \u2115} (cexpr : YulTerm \u0393 (CExpr vars n))\n                   (\u1fb0 : \u00acis_result \u0393 cexpr),\n                   YulState \u03c4 \u0393 vars)\n                (\u03a3' {vars vars'' : finset Identifier} {b : IsInFor} {b' : IsInFunc}\n                   (cstmnt : YulTerm \u0393 (CStatement vars vars'' b b')) (\u1fb0 : \u00acis_skip \u0393 cstmnt),\n                   YulState \u03c4 \u0393 vars))))) \u2192 \u2115\n| (psum.inl \u27e8_, _, _, _, blklst, _, _\u27e9) := termSize \u0393 blklst\n| (psum.inr (psum.inl \u27e8_, _, _, blk, _, _\u27e9)) := termSize \u0393 blk\n| (psum.inr (psum.inr (psum.inl \u27e8_, n, cexprs, _, _\u27e9))) := list.sum (list.of_fn (\u03bb i : fin n, 1 + termSize \u0393 (cexprs.nth i)))\n| (psum.inr (psum.inr (psum.inr (psum.inl \u27e8_, _, cexpr, _, _\u27e9)))) := termSize \u0393 cexpr\n| (psum.inr (psum.inr (psum.inr (psum.inr \u27e8_, _, _, _, cstmnt, _, _\u27e9)))) := termSize \u0393 cstmnt\n\nmutual def evalBlockList, evalCBlock, reduce_last, evalCExpr, evalCStatement\n\nwith evalBlockList : \n  \u2200 {vars vars'' : finset Identifier} {b : IsInFor} {b' : IsInFunc} \n      (blklst : YulTerm \u0393 (BlockList vars vars'' b b')),\n    \u00acis_empcblock \u0393 blklst \u2192 YulState \u03c4 \u0393 vars \u2192\n    option \n      \u03a3 vars' : finset Identifier,\n        pprod \n          (vars \u2286 vars') \n          (YulState \u03c4 \u0393 vars' \u00d7 YulTerm \u0393 (BlockList vars' vars'' b b') \u00d7 Mode b b')\n      \n| _ _ _ _ blklst@(EmpCBlock) n_is_empcblock _ :=\n    let is_empcblock : is_empcblock \u0393 blklst :=\n          begin\n            rw is_empcblock,\n            trivial,\n          end\n    in absurd is_empcblock n_is_empcblock\n| vars vars'' b b' blklst@(SeqCBlock vars' cstmnt cblklst') n_is_empcblock st :=\n  have termSize \u0393 cstmnt < termSize \u0393 blklst,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_skip \u0393 cstmnt)\n      (\u03bbcstmnt_is_skip,\n        pure $\n          sigma.mk vars \n            \u27e8\n              finset.subset.refl vars,\n              (\n                st, \n                eq.rec cblklst' (is_skip_imp_vars_eq_vars' \u0393 cstmnt_is_skip), \n                Mode.NormMode\n              )\n            \u27e9\n      )\n      (\u03bbcstmnt_n_is_skip,\n        do\n        (sigma.mk vars'\u2081 \u27e8p, (st', cstmnt', mode)\u27e9) \u2190 evalCStatement cstmnt cstmnt_n_is_skip st,\n        pure $\n          sigma.mk vars'\u2081\n            \u27e8\n              p,\n              (st', SeqCBlock vars' cstmnt' cblklst', mode)\n            \u27e9\n  )\n\nwith evalCBlock : \n  \u2200 {vars : finset Identifier} {b : IsInFor} {b' : IsInFunc} \n      (blk : YulTerm \u0393 (CBlock vars b b')),\n    \u00acis_empblock \u0393 blk \u2192 YulState \u03c4 \u0393 vars \u2192\n    option (YulState \u03c4 \u0393 vars \u00d7 YulTerm \u0393 (CBlock vars b b') \u00d7 Mode b b') \n| vars b b' cblk@(NestedScope inner_vars inner_vars'' inner_\u03c3 blklst) n_is_empblock st :=\n  have termSize \u0393 blklst < termSize \u0393 cblk,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  }, do\n  let inner_st : YulState \u03c4 \u0393 (inner_vars \u222a vars) := \n    (merge_scopes st.1 inner_\u03c3, st.2),\n  let blklst_n_is_empcblock : \u00ac is_empcblock \u0393 blklst :=\n    by {\n      rw is_empblock at n_is_empblock,\n      exact n_is_empblock,\n    },\n  (sigma.mk all_vars' \u27e8p, (inner_st', blklst', mode)\u27e9) \u2190 \n    evalBlockList blklst blklst_n_is_empcblock inner_st,\n  let inner_vars' := all_vars' \\ vars,\n  let p' : vars \u2286 all_vars' := by {exact finset.union_subset_right p},\n  let all_vars'_cast_p : all_vars' = vars \u222a (all_vars' \\ vars) :=\n    by {\n      apply eq.symm,\n      exact finset.union_sdiff_of_subset p',\n    },\n  let cast_all_vars' : VarStore (vars \u222a (all_vars' \\ vars)) := \n    eq.rec inner_st'.1 all_vars'_cast_p,\n  let (outer_\u03c3', inner_\u03c3') := split_scope st.1 cast_all_vars',\n  let st' := (outer_\u03c3', inner_st'.2),\n  let blklst'_cast_p : all_vars' = all_vars' \\ vars \u222a vars :=\n    by {\n      apply eq.symm,\n      exact finset.sdiff_union_of_subset p',\n    },\n  let cast_blklst' : YulTerm \u0393 (BlockList (all_vars' \\ vars \u222a vars) (inner_vars'' \u222a vars) b b') :=\n    eq.rec blklst' blklst'_cast_p,\n  pure (st', NestedScope (all_vars' \\ vars) inner_vars'' inner_\u03c3' cast_blklst', mode)\n\nwith reduce_last : \n  \u2200 {vars : finset Identifier} {n : \u2115} \n    (cexprs : vector (YulTerm \u0393 (CExpr vars 1)) n), \n      \u00ac(are_args_reduced \u0393 cexprs) \u2192 YulState \u03c4 \u0393 vars \u2192 \n      option (YulState \u03c4 \u0393 vars \u00d7 vector (YulTerm \u0393 (CExpr vars 1)) n \u00d7 Mode NotNestedInFor NotInFunc)\n| vars 0 _ p _ := absurd (@nil_reduced \u0393 vars) p\n| vars (nat.succ n) cexprs n_is_red st :=\n  let cexpr' : vector (YulTerm \u0393 (CExpr vars 1)) n := cexprs.tail in\n  have termSize \u0393 cexprs.head < list.sum (list.of_fn (\u03bb i : fin (nat.succ n), 1 + termSize \u0393 (cexprs.nth i))),\n  by {\n    rw list.sum,\n    rw (list.foldl_eq_foldr nat.comm_semiring.add_comm \n          nat.comm_semiring.add_assoc 0 \n            (list.of_fn (\u03bb (i : fin n.succ), 1 + termSize \u0393 (cexprs.nth i)))),\n    rw list.of_fn_succ _,\n    rw list.foldr,\n    rw vector.nth_zero cexprs,\n    linarith,\n  },\n  have list.sum (list.of_fn (\u03bb i : fin n, 1 + termSize \u0393 (cexprs.tail.nth i))) \n          < list.sum (list.of_fn (\u03bb i : fin (nat.succ n), 1 + termSize \u0393 (cexprs.nth i))),\n  by {\n    rw list.sum,\n    rw list.of_fn_succ _,\n    rw (list.foldl_eq_foldr nat.comm_semiring.add_comm \n          nat.comm_semiring.add_assoc 0 \n            ((1 + termSize \u0393 (cexprs.nth 0)) :: list.of_fn (\u03bb (i : fin n), 1 + termSize \u0393 (cexprs.nth i.succ)))),\n    rw list.foldr,\n    apply (ord_lem (termSize \u0393 (cexprs.nth 0))),\n    rw \u2190(list.foldl_eq_foldr nat.comm_semiring.add_comm \n          nat.comm_semiring.add_assoc 0 \n            (list.of_fn (\u03bb (i : fin n), 1 + termSize \u0393 (cexprs.nth i.succ)))),\n    change list.foldl has_add.add 0 (list.of_fn (\u03bb (i : fin n), 1 + termSize \u0393 (cexprs.tail.nth i))) \u2264\n            list.foldl has_add.add 0 (list.of_fn (\u03bb (i : fin n), 1 + termSize \u0393 (cexprs.nth i.succ))),\n    apply nat.le_of_eq,\n    apply (@congr_arg (list \u2115) \u2115\n            (list.of_fn (\u03bb (i : fin n), 1 + termSize \u0393 (cexprs.tail.nth i)))\n              (list.of_fn (\u03bb (i : fin n), 1 + termSize \u0393 (cexprs.nth i.succ)))\n                (list.foldl has_add.add 0)),\n    apply (of_fn_lemma _ _),\n    intro i,\n    rw vector.nth_tail_succ cexprs i,\n  },\n  let arg_vec' : vector (YulTerm \u0393 (CExpr vars 1)) n := cexprs.tail\n  in dite (are_args_reduced \u0393 cexprs.tail)\n      (\u03bbtl_red, do\n        let res : \u00acis_result \u0393 cexprs.head :=\n              begin\n                rw \u2190(vector.cons_head_tail cexprs) at n_is_red,\n                exact reduced_and_n_tail_reduced_imp_n_lit \n                        \u0393 cexprs.head cexprs.tail n_is_red tl_red,\n              end,\n        (st', arg', mode) \u2190 evalCExpr cexprs.head res st,\n        pure (st', vector.cons arg' arg_vec', mode)\n      )\n      (\u03bbn_tl_red, do\n        (st', \u27e8args', p\u27e9, mode) \u2190 @reduce_last vars n cexpr' n_tl_red st,\n        pure \n            (\n              st', \n              \u27e8 \n                cexprs.head :: args', \n                (by {\n                  rw list.length,\n                  rw p,\n                } : (cexprs.head :: args').length = nat.succ n) \n              \u27e9, \n              mode\n            )\n      )\n\nwith evalCExpr : \n  \u2200 {vars : finset Identifier} {n : \u2115} (cexpr : YulTerm \u0393 (CExpr vars n)),\n    \u00acis_result \u0393 cexpr \u2192 YulState \u03c4 \u0393 vars \u2192 \n    option (YulState \u03c4 \u0393 vars \u00d7 YulTerm \u0393 (CExpr vars n) \u00d7 Mode NotNestedInFor NotInFunc)\n  | _ _ cexpr@(Result _) n_is_res _ := \n    let is_res : is_result \u0393 cexpr :=\n          begin\n            rw is_result,\n            trivial,\n          end\n    in absurd is_res n_is_res\n  | _ 1 cexpr@(CLit l) _ st := \n    pure \n        (\n          st, \n          Result\n            \u27e8 \n              [l], \n              by {\n                repeat {\n                  rw list.length,\n                },\n              }\n            \u27e9, \n          Mode.NormMode\n        )\n| _ 1 (CId i i_in_vars) _ st :=\n      let l := st.1 i i_in_vars\n      in pure (st, CLit l, Mode.NormMode)\n| _ _ cexpr@(CFunctionCall f_id n ar_match arg_map) _ st :=\n  let arg_vec := (vector.of_fn arg_map)\n  in \n    have list.sum (list.of_fn (\u03bb i : fin n, 1 + termSize \u0393 ((vector.of_fn arg_map).nth i))) < termSize \u0393 cexpr,\n      by {\n        rw termSize,\n        apply (ord_lem 0),\n        apply @nat.le.intro _ _ 0,\n        rw (nat_add_zero  _),\n        apply congr_arg list.sum,\n        apply (of_fn_lemma _ _),\n        intros i,\n        rw vector.nth_of_fn arg_map i,\n      },\n    dite (are_args_reduced \u0393 (vector.of_fn arg_map))\n      (\u03bb is_red, \n          let arg_vals := get_lits \u0393 (vector.of_fn arg_map) is_red,\n              \u03c3 := st.1,\n              fimpl := st.2.1,\n              \u03bc := st.2.2\n          in \n            let f_impl := fimpl f_id ar_match\n            in match f_impl with\n                | sum.inl (sigma.mk arg_ids (sigma.mk ret_args (sigma.mk fin_args fbody))) := \n                    let inner_\u03c3 : VarStore (tofinset' arg_ids \u222a tofinset' ret_args):= \n                          extend_var_store ret_args (default_vals literal_zero)\n                            (eq.rec (extend_var_store arg_ids arg_vals empStore)\n                              (finset.empty_union $ tofinset' arg_ids))\n                    in pure \n                        (st, Scope (tofinset' arg_ids) fin_args ret_args inner_\u03c3 fbody, Mode.NormMode)\n                | sum.inr prim_def := do\n                    (\u03bc', res_vec, mode) \u2190 prim_def arg_vals \u03bc,\n                    let st' := (\u03c3, fimpl, \u03bc'),\n                    pure (st', Result res_vec, mode)\n               end\n      )\n      (\u03bb np, do\n        (st', arg_vec', mode) \u2190 reduce_last (vector.of_fn arg_map) np st,\n        pure (st', CFunctionCall f_id n ar_match arg_vec'.nth, mode)\n      )\n| _ _ cexpr@(Scope vars_inner vars_fin ret_ids inner_\u03c3 blklst) _ st :=\n  have termSize \u0393 blklst < termSize \u0393 cexpr,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_empcblock \u0393 blklst)\n      (\u03bb_,  let res_vec := extract_vars inner_\u03c3 ret_ids\n                            (by {\n                              intros i i_in_finset,\n                              apply finset.mem_union.2,\n                              exact or.inr i_in_finset,\n                            })\n            in pure (st, Result res_vec, Mode.NormMode)\n      )\n      (\u03bbcstmnt_n_is_empcblock, do\n        let inner_st := (inner_\u03c3, st.2),\n        (sigma.mk vars_inner' \u27e8p, (inner_st', blklst', mode)\u27e9) \u2190 \n          evalBlockList blklst cstmnt_n_is_empcblock inner_st,\n        let st' := (st.1, inner_st'.2),\n        let inner_\u03c3' := inner_st'.1,\n        let inner_\u03c3'_cast_p : vars_inner' = vars_inner' \u222a tofinset' ret_ids :=\n          begin\n            apply finset.ext_iff.2,\n            intro a,\n            apply\n              (iff_iff_implies_and_implies \n                (a \u2208 vars_inner')\n                (a \u2208 vars_inner' \u222a tofinset' ret_ids)).2,\n            split,\n            intro a_in_vars_inner',\n            apply finset.mem_union.2,\n            exact or.inl a_in_vars_inner',\n            intro a_in_vars_inner'_u_ret_ids,\n            cases finset.mem_union.1 a_in_vars_inner'_u_ret_ids,\n            exact h,\n            exact (finset.union_subset_iff.1 p).2 h,\n          end,\n        let cast_inner_\u03c3' : VarStore (vars_inner' \u222a tofinset' ret_ids) := \n          eq.rec inner_\u03c3' inner_\u03c3'_cast_p,\n        let cast_blklst' : \n              YulTerm \u0393 (BlockList (vars_inner' \u222a tofinset' ret_ids) (vars_fin \u222a tofinset' ret_ids) NotNestedInFor InFunc) := \n            eq.rec blklst' inner_\u03c3'_cast_p,\n        pure $\n          begin\n            cases mode,\n            exact (st', Scope vars_inner' vars_fin ret_ids cast_inner_\u03c3' cast_blklst', NormMode),\n            exact (st', Scope vars_inner' vars_inner' ret_ids cast_inner_\u03c3' EmpCBlock, NormMode),\n            exact (st', Scope vars_inner' vars_fin ret_ids cast_inner_\u03c3' cast_blklst', TermMode),\n          end\n      )\n\nwith evalCStatement : \n  \u2200 {vars vars'' : finset Identifier} {b : IsInFor} {b' : IsInFunc}\n      (cstmnt : YulTerm \u0393 (CStatement vars vars'' b b')),\n    \u00ac is_skip \u0393 cstmnt \u2192 YulState \u03c4 \u0393 vars \u2192\n    option\n      \u03a3 vars' : finset Identifier,\n        pprod\n          (vars \u2286 vars')\n          (YulState \u03c4 \u0393 vars' \u00d7 YulTerm \u0393 (CStatement vars' vars'' b b') \u00d7 Mode b b')\n| _ _  _ _ cstmnt@Skip cstmnt_n_is_skip  _ :=\n  let cstmnt_is_skip : is_skip \u0393 cstmnt :=\n        begin\n          rw is_skip,\n          trivial,\n        end\n  in absurd cstmnt_is_skip cstmnt_n_is_skip\n| vars _ _ _ cstmnt@(CBlock blk) _ st :=\n  have termSize \u0393 blk < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_empblock \u0393 blk)\n    (\u03bb_, pure $\n          sigma.mk vars \n            \u27e8finset.subset.refl vars, (st, Skip, Mode.NormMode)\u27e9\n    )\n    (\u03bbblk_is_empblock, do\n      (st', blk', mode) \u2190 evalCBlock blk blk_is_empblock st,\n      pure $\n        sigma.mk vars \n          \u27e8finset.subset.refl vars, (st', CBlock blk', mode)\u27e9\n    )\n| vars _ _ _ cstmnt@(CVariableDeclarationAss n new_vars cexpr) _ st :=\n  have termSize \u0393 cexpr < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_result \u0393 cexpr)\n    (\u03bbcexpr_is_result, \n      pure $\n        sigma.mk (vars \u222a tofinset new_vars)\n        \u27e8\n          by {\n            intros var var_in_vars,\n            apply finset.mem_union.2,\n            exact or.inl var_in_vars,\n          }, \n          (\n            by {\n              cases cexpr,\n              repeat {\n                exfalso,\n                rw is_result at cexpr_is_result,\n                exact cexpr_is_result,\n              },\n              rw tofinset,\n              exact (extend_var_store (vector.of_fn new_vars) cexpr_\u1fb0 st.1, st.2),\n            }, \n            Skip, \n            Mode.NormMode\n          )\n        \u27e9\n    )\n    (\u03bbcexpr_n_is_result, do\n      (st', cexpr', mode) \u2190 evalCExpr cexpr cexpr_n_is_result st,\n      pure $\n        sigma.mk vars \n          \u27e8\n            finset.subset.refl vars, \n            (st', CVariableDeclarationAss n new_vars cexpr', liftMode mode)\n          \u27e9\n    )\n| vars _ _ _ cstmnt@(CVariableDeclaration n new_vars) _ st :=\n  pure $ \n    sigma.mk (vars \u222a tofinset new_vars)\n      \u27e8\n        by {\n            intros var var_in_vars,\n            apply finset.mem_union.2,\n            exact or.inl var_in_vars,\n          },\n        (\n          (extend_var_store (vector.of_fn new_vars) (default_vals literal_zero) st.1, st.2), \n          Skip, \n          Mode.NormMode\n        )\n      \u27e9\n| vars _ _ _ cstmnt@(CAssignment n ids p cexpr) _ st :=\n  have termSize \u0393 cexpr < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_result \u0393 cexpr)\n    (\u03bbcexpr_is_result, do\n      let vars_eq_vars_u_ids : vars = vars \u222a tofinset' (vector.of_fn ids) :=\n            begin\n              rw tofinset at p,\n              exact finset.left_eq_union_iff_subset.2 p,\n            end,\n      pure $\n        sigma.mk vars\n        \u27e8\n          finset.subset.refl vars, \n          (\n            by {\n              cases cexpr,\n              repeat {\n                exfalso,\n                rw is_result at cexpr_is_result,\n                exact cexpr_is_result,\n              },\n              have \u03c3' := extend_var_store (vector.of_fn ids) cexpr_\u1fb0 st.1,\n              rw \u2190 vars_eq_vars_u_ids at \u03c3',\n              exact (\u03c3', st.2),\n            }, \n            Skip, \n            Mode.NormMode\n          )\n        \u27e9\n    )\n    (\u03bbcexpr_n_is_result, do\n      (st', cexpr', mode) \u2190 evalCExpr cexpr cexpr_n_is_result st,\n      pure $\n        sigma.mk vars \n          \u27e8\n            finset.subset.refl vars, \n            (st', CAssignment n ids p cexpr', liftMode mode)\n          \u27e9\n    )\n| vars _ _ _ cstmnt@(CIf cond body) _ st :=\n  have termSize \u0393 cond < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_result \u0393 cond)\n    (\u03bbcond_is_result,\n      pure $\n        sigma.mk vars\n          \u27e8\n            finset.subset.refl vars,\n            (\n              st, \n              by {\n                cases cond,\n                repeat {\n                  exfalso,\n                  rw is_result at cond_is_result,\n                  exact cond_is_result,\n                },\n                cases cond_\u1fb0.head,\n                cases val,\n                exact Skip,\n                exact CBlock body,\n              }, \n              Mode.NormMode\n            )\n          \u27e9\n    )\n    (\u03bbcond_n_is_result, do\n      (st', cond', mode) \u2190 evalCExpr cond cond_n_is_result st,\n      pure $\n        sigma.mk vars\n          \u27e8\n            finset.subset.refl vars,\n            (st', CIf cond' body, liftMode mode)\n          \u27e9\n    )\n| vars _ _ _ cstmnt@(CExpressionStatement cexpr) _ st :=\n  have termSize \u0393 cexpr < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_result \u0393 cexpr)\n    (\u03bb_, pure $\n          sigma.mk vars \n            \u27e8\n              finset.subset.refl vars,\n              (st, Skip, Mode.NormMode)\n            \u27e9\n    )\n    (\u03bbcexpr_n_is_result, do\n      (st', cexpr', mode) \u2190 evalCExpr cexpr cexpr_n_is_result st,\n      pure $\n        sigma.mk vars\n          \u27e8\n            finset.subset.refl vars, \n            (st', CExpressionStatement cexpr', liftMode mode)\n          \u27e9\n    )\n| vars _ _ _ cstmnt@(CSwitch cexpr swtchbody) _ st :=\n  have termSize \u0393 cexpr < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_result \u0393 cexpr)\n    (\u03bbcexpr_is_result,\n      let lit : Literal := (to_literal \u0393 cexpr cexpr_is_result).head,\n          cblk := getCase \u0393 lit swtchbody\n      in pure $\n          sigma.mk vars\n            \u27e8\n              finset.subset.refl vars,\n              (st, CBlock cblk, NormMode)\n            \u27e9\n    )\n    (\u03bbcexpr_n_is_result, do\n      (st', cexpr', mode) \u2190 evalCExpr cexpr cexpr_n_is_result st,\n      pure $\n        sigma.mk vars \n          \u27e8\n            finset.subset.refl vars, \n            (st', CSwitch cexpr' swtchbody, liftMode mode)\n          \u27e9\n    )\n| vars _ b b' (CFor inner_vars inner_vars' inner_vars'' init cond loop post) _ st :=\n  pure $\n    sigma.mk vars \n      \u27e8\n        finset.subset.refl vars,\n        let eq_vars : vars = vars \u222a \u2205 := eq.symm (finset.union_empty vars),\n            init_cast : YulTerm \u0393 (BlockList (vars \u222a \u2205) (vars \u222a inner_vars) NotNestedInFor b') := \n              @eq.rec (finset Identifier) vars \n                (\u03bbvs, YulTerm \u0393 (BlockList vs (vars \u222a inner_vars) NotNestedInFor b')) init (vars \u222a \u2205)\n                  eq_vars,\n            cstmnt' : YulTerm \u0393 (CStatement vars vars b b') := \n              ForExecInit \u2205 inner_vars inner_vars' inner_vars'' empStore cond loop post init_cast\n        in (st, cstmnt', NormMode)\n      \u27e9\n| vars _ _ b' CBreak _ st :=\n  pure $\n    sigma.mk vars \n      \u27e8\n          finset.subset.refl vars,\n          (st, Skip, BreakMode)\n      \u27e9\n| vars _ _ b' CContinue _ st :=\n  pure $\n    sigma.mk vars \n      \u27e8\n          finset.subset.refl vars,\n          (st, Skip, ContinueMode)\n      \u27e9\n| vars _ b _ CLeave _ st :=\n  pure $\n    sigma.mk vars \n      \u27e8\n          finset.subset.refl vars,\n          (st, Skip, LeaveMode)\n      \u27e9\n| vars _ b b' cstmnt@(ForExecInit curr_inner_vars inner_vars inner_vars' inner_vars'' \u03c3 cond loop post eval_init) _ st :=\n  have termSize \u0393 eval_init < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_empcblock \u0393 eval_init)\n    (\u03bbeval_init_is_empcblock, do\n      let vars_eq_vars' := eq.symm $ is_empcblock_imp_vars_eq_vars' \u0393 eval_init_is_empcblock,\n      pure $\n        sigma.mk vars\n          \u27e8\n            finset.subset.refl vars,\n            (\n              eq.rec st vars_eq_vars', \n              ForCheckCond curr_inner_vars inner_vars' inner_vars'' \u03c3 \n                (eq.rec cond vars_eq_vars') (eq.rec loop vars_eq_vars') post (eq.rec cond vars_eq_vars'), \n              NormMode\n            )\n          \u27e9\n    )\n    (\u03bbeval_init_n_is_empcblock, do\n      let inner_st : YulState \u03c4 \u0393 (vars \u222a curr_inner_vars) := \n            (merge_scopes \u03c3 st.1, st.2),\n      (sigma.mk all_vars' \u27e8p, (inner_st', eval_init', mode)\u27e9)  \u2190 evalBlockList eval_init eval_init_n_is_empcblock inner_st,\n      let p' : vars \u2286 all_vars' := by {exact finset.union_subset_left p},\n      let all_vars'_cast_p : all_vars' = vars \u222a (all_vars' \\ vars) :=\n        by {\n          apply eq.symm,\n          exact finset.union_sdiff_of_subset p',\n        },\n      let cast_all_vars' : VarStore (vars \u222a (all_vars' \\ vars)) := \n            eq.rec inner_st'.1 all_vars'_cast_p,\n      let (outer_\u03c3', inner_\u03c3') := split_scope st.1 cast_all_vars',\n      let st' := (outer_\u03c3', inner_st'.2),\n      let cast_eval_init' : YulTerm \u0393 (BlockList (vars \u222a (all_vars' \\ vars)) (vars \u222a inner_vars) NotNestedInFor b') :=\n            eq.rec eval_init' all_vars'_cast_p,\n      pure $\n        sigma.mk vars \n          \u27e8\n            finset.subset.refl vars,\n            (\n              st', \n              ForExecInit (all_vars' \\ vars) inner_vars inner_vars' inner_vars'' inner_\u03c3' cond loop post cast_eval_init', \n              cast_not_in_for_mode mode\n            )\n          \u27e9\n    )\n| vars _ _ _ cstmnt@(ForCheckCond inner_vars inner_vars' inner_vars'' \u03c3 cond body post eval_cond) _ st :=\n  have termSize \u0393 eval_cond < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_result \u0393 eval_cond)\n    (\u03bbeval_cond_is_result,\n        let lit : Literal := (to_literal \u0393 eval_cond eval_cond_is_result).head\n        in pure $\n            sigma.mk vars \n              \u27e8\n                finset.subset.refl vars,\n                (\n                  st,\n                  if lit \u2260 literal_zero\n                  then ForExecBody inner_vars inner_vars inner_vars' inner_vars'' \u03c3 \n                        (finset.subset.refl (vars \u222a inner_vars)) cond body post body\n                  else Skip,\n                  NormMode\n                )\n              \u27e9\n    )\n    (\u03bbeval_cond_n_is_result, do\n      let inner_st : YulState \u03c4 \u0393 (vars \u222a inner_vars) := \n             (merge_scopes \u03c3 st.1, st.2),\n      (inner_st', eval_cond', mode) \u2190 evalCExpr eval_cond eval_cond_n_is_result inner_st,\n      let (outer_\u03c3', inner_\u03c3') := split_scope st.1 inner_st'.1,\n      pure $\n        sigma.mk vars \n          \u27e8\n            finset.subset.refl vars,\n            (\n              (outer_\u03c3', inner_st'.2), \n              ForCheckCond inner_vars inner_vars' inner_vars'' \u03c3 cond body post eval_cond', \n              cast_not_in_func_mode (cast_not_in_for_mode mode)\n            )\n          \u27e9\n    )\n| vars _ b b' cstmnt@(ForExecBody curr_inner_vars inner_vars inner_vars' inner_vars'' \u03c3 ss_p cond body post eval_body) _ st :=\n  have termSize \u0393 eval_body < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_empcblock \u0393 eval_body)\n    (\u03bbeval_body_is_empcblock, do\n      let vars_eq_vars' := eq.symm $ is_empcblock_imp_vars_eq_vars' \u0393 eval_body_is_empcblock,\n      pure $\n        sigma.mk vars\n          \u27e8\n            finset.subset.refl vars,\n            (\n              eq.rec st vars_eq_vars', \n              ForExecPost curr_inner_vars inner_vars inner_vars' inner_vars'' \u03c3 \n                (eq.rec cond vars_eq_vars') (eq.rec body vars_eq_vars') post (eq.rec post vars_eq_vars'), \n              NormMode\n            )\n          \u27e9\n    )\n    (\u03bbeval_body_n_is_empcblock, do\n      let inner_st : YulState \u03c4 \u0393 (vars \u222a curr_inner_vars) := \n            (merge_scopes \u03c3 st.1, st.2),\n      (sigma.mk all_vars' \u27e8p, (inner_st', eval_body', mode)\u27e9) \u2190 evalBlockList eval_body eval_body_n_is_empcblock inner_st,\n      let p' : vars \u2286 all_vars' := by {exact finset.union_subset_left p},\n      let all_vars'_cast_p : all_vars' = vars \u222a (all_vars' \\ vars) :=\n        by {\n          apply eq.symm,\n          exact finset.union_sdiff_of_subset p',\n        },\n      let cast_all_vars' : VarStore (vars \u222a (all_vars' \\ vars)) := \n            eq.rec inner_st'.1 all_vars'_cast_p,\n      let (outer_\u03c3', inner_\u03c3') := split_scope st.1 cast_all_vars',\n      let st' := (outer_\u03c3', inner_st'.2),\n      let cast_eval_body' : YulTerm \u0393 (BlockList (vars \u222a (all_vars' \\ vars)) (vars \u222a inner_vars') NestedInFor b') :=\n            eq.rec eval_body' all_vars'_cast_p,\n      let ss_p' : vars \u222a inner_vars \u2286 vars \u222a (all_vars' \\ vars) := \n            begin\n              apply (finset.subset.trans ss_p),\n              rw \u2190all_vars'_cast_p,\n              exact p,\n            end,\n      begin\n        apply some,\n        apply sigma.mk vars,\n        apply (\u27e8finset.subset.refl vars, _\u27e9 : \n          pprod (vars \u2286 vars) (YulState \u03c4 \u0393 vars \u00d7 YulTerm \u0393 (CStatement vars vars b b') \u00d7 Mode b b')),\n        apply (st', _),\n        clear _do_match _let_match,\n        cases mode,\n        exact (\n                ForExecBody (all_vars' \\ vars) inner_vars inner_vars' inner_vars'' \n                  inner_\u03c3' ss_p' cond body post cast_eval_body',\n                NormMode\n              ),\n        exact (Skip, NormMode),\n        apply (ForCheckCond (all_vars' \\ vars) inner_vars' inner_vars'' inner_\u03c3' _ _ _ _, NormMode),\n        have cond_framed := frame \u0393 (vars \u222a (all_vars' \\ vars)) cond,\n        rw frame_TermType at cond_framed,\n        rw finset.right_eq_union_iff_subset.2 ss_p',\n        exact cond_framed,\n        have body_framed := frame \u0393 (vars \u222a (all_vars' \\ vars)) body,\n        rw frame_TermType at body_framed,\n        rw finset.right_eq_union_iff_subset.2 ss_p',\n        rw finset.left_eq_union_iff_subset.2\n            (term_scope_monotonic \u0393 eval_body' \n                      all_vars' \n                      (vars \u222a inner_vars') _),\n        rw \u2190all_vars'_cast_p at body_framed,\n        rw \u2190all_vars'_cast_p,\n        exact body_framed,\n        rw getVariableUpdate,\n        exact post,\n        have cond_framed := frame \u0393 (vars \u222a (all_vars' \\ vars)) cond,\n        rw frame_TermType at cond_framed,\n        rw finset.right_eq_union_iff_subset.2 ss_p',\n        exact cond_framed,\n        exact (\n                ForExecBody (all_vars' \\ vars) inner_vars inner_vars' inner_vars'' \n                  inner_\u03c3' ss_p' cond body post cast_eval_body',\n                LeaveMode\n              ),\n        exact (\n                ForExecBody (all_vars' \\ vars) inner_vars inner_vars' inner_vars'' \n                  inner_\u03c3' ss_p' cond body post cast_eval_body',\n                TermMode\n              ),\n      end\n    )\n| vars _ _ b' cstmnt@(ForExecPost curr_inner_vars inner_vars inner_vars' inner_vars'' \u03c3 cond body post eval_post) _ st := \n  have termSize \u0393 eval_post < termSize \u0393 cstmnt,\n  by {\n    repeat {\n      rw termSize,\n    },\n    linarith,\n  },\n  dite (is_empcblock \u0393 eval_post)\n    (\u03bbeval_post_is_empcblock, do\n      let vars_eq_vars' := eq.symm $ is_empcblock_imp_vars_eq_vars' \u0393 eval_post_is_empcblock,\n      pure $\n        sigma.mk vars\n          \u27e8\n            finset.subset.refl vars,\n            (\n              eq.rec st vars_eq_vars', \n              (begin\n                apply (ForCheckCond curr_inner_vars curr_inner_vars curr_inner_vars \u03c3),\n                have cond_framed := frame \u0393 (vars \u222a inner_vars'') cond,\n                rw \u2190vars_eq_vars',\n                rw frame_TermType at cond_framed,\n                rw (finset.right_eq_union_iff_subset.2 $\n                    finset.subset.trans\n                              (term_scope_monotonic \u0393 body\n                                (vars \u222a inner_vars)\n                                (vars \u222a inner_vars') _)\n                              (term_scope_monotonic \u0393 post\n                                (vars \u222a inner_vars')\n                                (vars \u222a inner_vars'') _)),\n                exact cond_framed,\n                repeat {\n                  rw getVariableUpdate,\n                },\n                have body_framed := frame \u0393 (vars \u222a inner_vars'') body,\n                rw \u2190vars_eq_vars',\n                rw frame_TermType at body_framed,\n                rw \u2190(finset.right_eq_union_iff_subset.2 $\n                      finset.subset.trans\n                        (term_scope_monotonic \u0393 body\n                          (vars \u222a inner_vars)\n                          (vars \u222a inner_vars') \n                          _\n                        )\n                        (term_scope_monotonic \u0393 post\n                          (vars \u222a inner_vars')\n                          (vars \u222a inner_vars'') \n                          _\n                        )\n                     ) at body_framed,\n                rw \u2190(finset.right_eq_union_iff_subset.2 $\n                      (term_scope_monotonic \u0393 post\n                        (vars \u222a inner_vars')\n                        (vars \u222a inner_vars'') \n                        _\n                      )\n                    ) at body_framed,\n                exact body_framed,\n                repeat {\n                  rw getVariableUpdate,\n                },\n                have post_framed := frame \u0393 (vars \u222a inner_vars'') post,\n                rw \u2190vars_eq_vars',\n                rw frame_TermType at post_framed,\n                rw \u2190(finset.right_eq_union_iff_subset.2 $\n                      (term_scope_monotonic \u0393 post\n                        (vars \u222a inner_vars')\n                        (vars \u222a inner_vars'') \n                        _\n                      )\n                    ) at post_framed,\n                rw finset.union_self (vars \u222a inner_vars'') at post_framed,\n                exact post_framed,\n                repeat {\n                  rw getVariableUpdate,\n                },\n                have cond_eval_framed := frame \u0393 (vars \u222a inner_vars'') cond,\n                rw \u2190vars_eq_vars',\n                rw frame_TermType at cond_eval_framed,\n                rw (finset.right_eq_union_iff_subset.2 $\n                    finset.subset.trans\n                              (term_scope_monotonic \u0393 body\n                                (vars \u222a inner_vars)\n                                (vars \u222a inner_vars') _)\n                              (term_scope_monotonic \u0393 post\n                                (vars \u222a inner_vars')\n                                (vars \u222a inner_vars'') _)),\n                exact cond_eval_framed,\n                repeat {\n                  rw getVariableUpdate,\n                },\n              end),\n              NormMode\n            )\n          \u27e9\n    )\n    (\u03bbeval_post_n_is_empcblock, do\n      let inner_st : YulState \u03c4 \u0393 (vars \u222a curr_inner_vars) := \n            (merge_scopes \u03c3 st.1, st.2),\n      (sigma.mk all_vars' \u27e8p, (inner_st', eval_post', mode)\u27e9) \u2190 \n        evalBlockList eval_post eval_post_n_is_empcblock inner_st,\n      let p' : vars \u2286 all_vars' := by {exact finset.union_subset_left p},\n      let all_vars'_cast_p : all_vars' = vars \u222a (all_vars' \\ vars) :=\n      by {\n        apply eq.symm,\n        exact finset.union_sdiff_of_subset p',\n      },\n      let cast_all_vars' : VarStore (vars \u222a (all_vars' \\ vars)) := \n            eq.rec inner_st'.1 all_vars'_cast_p,\n      let (outer_\u03c3', inner_\u03c3') := split_scope st.1 cast_all_vars',\n      let st' := (outer_\u03c3', inner_st'.2),\n      let cast_eval_post' : YulTerm \u0393 (BlockList (vars \u222a (all_vars' \\ vars)) (vars \u222a inner_vars'') NotNestedInFor b') :=\n            eq.rec eval_post' all_vars'_cast_p,\n      pure $\n        sigma.mk vars \n          \u27e8\n            finset.subset.refl vars,\n            (\n              st', \n              ForExecPost (all_vars' \\ vars) inner_vars inner_vars' inner_vars'' inner_\u03c3' cond body post cast_eval_post', \n              cast_not_in_for_mode mode\n            )\n          \u27e9\n    )\n    \nusing_well_founded {\n  rel_tac := \u03bb _ _, `[exact \u27e8_, measure_wf (evalMetric \u03c4 \u0393)\u27e9],\n  dec_tac := `[assumption] }\n  \nend YulSemantics", "meta": {"author": "NethermindEth", "repo": "Yul-Specification", "sha": "35b8620b920758684f13810859ec48c55544a8fe", "save_path": "github-repos/lean/NethermindEth-Yul-Specification", "path": "github-repos/lean/NethermindEth-Yul-Specification/Yul-Specification-35b8620b920758684f13810859ec48c55544a8fe/yul_sem.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5926666143433998, "lm_q2_score": 0.2877678218692626, "lm_q1q2_score": 0.17055038070423043}}
{"text": "import data.real.basic\n\ntheorem exo:\n  (exists f: nat -> nat, forall n, f^[2003] (n) = 5 * n)\n:=\n  sorry\n", "meta": {"author": "ahayat16", "repo": "lean_exos", "sha": "682f2552d5b04a8c8eb9e4ab15f875a91b03845c", "save_path": "github-repos/lean/ahayat16-lean_exos", "path": "github-repos/lean/ahayat16-lean_exos/lean_exos-682f2552d5b04a8c8eb9e4ab15f875a91b03845c/src_icannos_totilas/aops/2003-Pan_African_MO-Problem_4.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5350984286266116, "lm_q2_score": 0.3174262591305011, "lm_q1q2_score": 0.16985429246555475}}
{"text": "import ReactorModel.Objects\nimport Mathlib.Data.Finset.Lattice\n\nnoncomputable section\nopen Classical\nopen ReactorType Updatable Indexable\n\ndef Action.schedule (a : Action) (t : Time) (v : Value) : Action :=\n  match a.tags.filter (\u00b7.time = t) |>.max with\n  | \u22a5           => a.insert \u27e8t, 0\u27e9 v\n  | some \u27e8_, m\u27e9 => a.insert \u27e8t, m + 1\u27e9 v\n\nnamespace ReactorType\nnamespace Updatable\n\nvariable [Updatable \u03b1] \n\ndef apply (rtr : \u03b1) : Change \u2192 \u03b1 \n  | .prt k i v => update rtr (.prt k) i (fun _ => v)\n  | .stv i v   => update rtr .stv     i (fun _ => v)\n  | .act i t v => update rtr .act     i (\u00b7.schedule t v)\n  | .mut ..    => rtr -- Mutations are currently no-ops.\n\ndef apply' (rtr : \u03b1) (cs : List Change) : \u03b1 :=\n  cs.foldl apply rtr\n\nend Updatable\n\nnamespace Indexable\n\nvariable [Indexable \u03b1] \n\ndef dependencies (rtr : \u03b1) (rcn : ID) : Set ID := \n  { rcn' | rcn' <[rtr] rcn }\n\ntheorem equiv_eq_dependencies {rtr\u2081 : \u03b1} (e : rtr\u2081 \u2248 rtr\u2082) : \n  dependencies rtr\u2081 = dependencies rtr\u2082 := by\n  ext i j\n  exact \u27e8.equiv $ .symm e, .equiv e\u27e9 \n\ndef scheduledTags (rtr : \u03b1) : Set Time.Tag := \n  { g | \u2203 i a, (rtr[.act][i] = some a) \u2227 (g \u2208 a.keys) }\n\n-- TODO?: Make this handle tag names better.\nscoped macro \"change_cases \" change:term : tactic => \n  `(tactic| cases $change:term <;> try cases \u2039Change.Normal\u203a; cases \u2039Reactor.Component.Valued\u203a)\n\ntheorem apply_equiv (rtr : \u03b1) (c : Change) : (apply rtr c) \u2248 rtr := by\n  change_cases c <;> first | rfl | apply LawfulUpdatable.equiv\n\ntheorem apply_preserves_unchanged {c : Change} (rtr : \u03b1) (h : \u00acc.Targets cpt i) :\n    (apply rtr c)[cpt][i] = rtr[cpt][i] := by\n  change_cases c <;> first | rfl | exact LawfulUpdatable.obj?_preserved (Change.Targets.norm_not h)\n\nvariable {rtr : \u03b1}\n\ntheorem apply_port_change (h : i \u2208 rtr[.prt k]) : (apply rtr $ .prt k i v)[.prt k][i] = some v := by\n  simp [apply, LawfulUpdatable.obj?_updated]\n  exact h\n\ntheorem apply_state_change (h : i \u2208 rtr[.stv]) : (apply rtr $ .stv i v)[.stv][i] = some v := by\n  simp [apply, LawfulUpdatable.obj?_updated]\n  exact h\n\ntheorem apply_action_change (h : rtr[.act][i] = some a) : \n    (apply rtr $ .act i t v)[.act][i] = some (a.schedule t v) := by\n  simp [apply, LawfulUpdatable.obj?_updated]\n  exact \u27e8_, \u27e8h, rfl\u27e9\u27e9 \n\ntheorem apply'_equiv (rtr : \u03b1) : (cs : List Change) \u2192 (apply' rtr cs) \u2248 rtr \n  | .nil        => .refl\n  | .cons hd tl => Equivalent.trans (apply'_equiv (apply rtr hd) tl) (apply_equiv rtr hd)\n\ntheorem apply'_preserves_unchanged {cs : List Change} {cpt : Reactor.Component.Valued} {i}\n    (h : cs.All\u2082 (\u00ac\u00b7.Targets cpt i)) : (apply' rtr cs)[cpt][i] = rtr[cpt][i] := by\n  induction cs generalizing rtr <;> try rfl\n  case cons hd tl hi => \n    have \u27e8hh, ht\u27e9 := List.all\u2082_cons _ _ _ |>.mp h\n    exact apply_preserves_unchanged rtr hh \u25b8 hi ht \n\ntheorem apply'_normal_disjoint_comm \n    (h : List.Disjoint (cs\u2081.filter (\u00b7.IsNormal)) (cs\u2082.filter (\u00b7.IsNormal))) : \n    apply' (apply' rtr cs\u2081) cs\u2082 = apply' (apply' rtr cs\u2082) cs\u2081 :=\n  sorry\n\nend Indexable\nend ReactorType", "meta": {"author": "marcusrossel", "repo": "reactor-model", "sha": "f82fffb489b4352a0cc6bee964d44a142fee18ce", "save_path": "github-repos/lean/marcusrossel-reactor-model", "path": "github-repos/lean/marcusrossel-reactor-model/reactor-model-f82fffb489b4352a0cc6bee964d44a142fee18ce/src/ReactorModel/Execution/Reactor.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5350984137988772, "lm_q2_score": 0.31405055141190724, "lm_q1q2_score": 0.16804795191317431}}
{"text": "import model_theory.substructures\nimport model_theory.bundled\n\n\n--OUTPUT 1\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h],\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h1],\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h2],\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h3],\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h4],\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h5],\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h6],\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h7],\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h8],\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h9],\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h10],\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h11],\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h12],\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h13],\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h14],\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h15],\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h16],\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h17],\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h18],\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h19],\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h20],\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h21],\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h22],\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h23],\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h24],\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h25],\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h26],\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h27],\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h28],\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h29],\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h30],\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h31],\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h32],\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h33],\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h34],\n  have h36 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h35],\n  have h37 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h36],\n  have h38 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h37],\n  have h39 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h38],\n  have h40 : \u2200 n :\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h],\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h1],\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h2],\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h3],\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h4],\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h5],\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h6],\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h7],\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h8],\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h9],\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h10],\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h11],\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h12],\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h13],\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h14],\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h15],\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h16],\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h17],\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h18],\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h19],\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h20],\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h21],\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h22],\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h23],\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h24],\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h25],\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h26],\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h27],\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h28],\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h29],\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h30],\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h31],\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h32],\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h33],\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h34],\n  have h36 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h35],\n  have h37 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h36],\n  have h38 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h37],\n  have h39 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from by auto [h38],\n  have h40 : \u2200 n :\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  let A : \u2115 \u2192 L.Theory,\n  { assume n,\n    let A : L.Theory,\n    { assume n,\n      let A : L.Theory,\n      { assume n,\n        let A : L.Theory,\n        { assume n,\n          let A : L.Theory,\n          { assume n,\n            let A : L.Theory,\n            { assume n,\n              let A : L.Theory,\n              { assume n,\n                let A : L.Theory,\n                { assume n,\n                  let A : L.Theory,\n                  { assume n,\n                    let A : L.Theory,\n                    { assume n,\n                      let A : L.Theory,\n                      { assume n,\n                        let A : L.Theory,\n                        { assume n,\n                          let A : L.Theory,\n                          { assume n,\n                            let A : L.Theory,\n                            { assume n,\n                              let A : L.Theory,\n                              { assume n,\n                                let A : L.Theory,\n                                { assume n,\n                                  let A : L.Theory,\n                                  { assume n,\n                                    let A : L.Theory,\n                                    { assume n,\n                                      let A : L.Theory,\n                                      { assume n,\n                                        let A : L.Theory,\n                                        { assume n,\n                                          let A : L.Theory,\n                                          { assume n,\n                                            let A : L.Theory,\n                                            { assume n,\n                                              let A : L.Theory,\n                                              { assume n,\n                                                let A : L.Theory,\n                                                { assume n,\n                                                  let A : L.Theory,\n                                                  { assume n,\n                                                    let A : L.Theory,\n                                                    { assume n,\n                                                      let A : L.Theory,\n                                                      { assume n,\n                                                        let A : L.Theory,\n                                                        { assume n,\n                                                          let A : L.Theory,\n                                                          { assume n,\n                                                            let A : L.Theory,\n                                                            { assume n,\n                                                              let A : L.Theory,\n                                                              { assume n,\n                                                                let A : L.Theory,\n                                                                { assume n,\n                                                                  let A : L.Theory,\n                                                                  { assume n,\n                                                                    let A : L.Theory,\n                                                                    { assume n,\n                                                                      let A : L.Theory,\n                                                                      { assume n,\n                                                                        let A : L.Theory,\n                                                                        { assume n,\n                                                                          let A : L.Theory,\n                                                                          { assume n,\n                                                                            let A : L.Theory,\n                                                                            { assume n,\n                                                                              let A : L.Theory,\n                                                                              { assume n,\n                                                                                let A : L.Theory,\n                                                                                { assume n,\n                                                                                  let A : L.Theory,\n                                                                                  { assume n,\n                                                                                    let A : L.Theory,\n                                                                                    { assume n,\n                                                                                      let A : L.Theory,\n                                                                                      { assume n,\n                                                                                        let A : L.Theory,\n                                                                                        { assume n,\n                                                                                          let A : L.Theory,\n                                                                                          { assume n,\n                                                                                            let A : L.Theory,\n                                                                                            { assume n,\n                                                                                              let A : L.Theory,\n                                                                                              { assume n,\n                                                                                                let A : L.Theory,\n                                                                                                { assume n,\n                                                                                                  let A : L.Theory,\n                                                                                                  { assume n,\n                                                                                                    let A : L.Theory,\n                                                                                                    { assume n,\n                                                                                                      let A : L.Theory,\n                                                                                                      { assume n,\n                                                                                                        let A : L.Theory,\n                                                                                                        { assume n,\n                                                                                                          let A : L.Theory,\n                                                                                                          { assume n,\n                                                                                                            let A : L.Theory,\n                                                                                                            { assume n,\n                                                                                                              let A : L.Theory,\n                                                                                                              { assume n,\n                                                                                                                let A : L.Theory,\n                                                                                                                { assume n,\n                                                                                                                  let A : L.Theory,\n                                                                                                                  { assume n,\n                                                                                                                    let A : L.Theory,\n                                                                                                                    { assume n,\n                                                                                                                      let A : L.Theory,\n                                                                                                                      { assume n,\n                                                                                                                        let A : L.Theory,\n                                                                                                                        { assume n,\n                                                                                                                          let A : L.Theory,\n                                                                                                                          { assume n,\n                                                                                                                            let A : L.Theory,\n                                                                                                                            { assume n,\n                                                                                                                              let A : L.Theory,\n                                                                                                                              { assume n,\n                                                                                                                                let A : L.Theory,\n                                                                                                                                { assume n,\n                                                                                                                                  let A : L.Theory,\n                                                                                                                                  { assume n,\n                                                                                                                                    let A : L.Theory,\n                                                                                                                                    { assume n,\n                                                                                                                                      let A : L.Theory,\n                                                                                                                                      { assume n,\n                                                                                                                                        let A : L.Theory,\n                                                                                                                                        { assume n,\n                                                                                                                                          let A : L.Theory,\n                                                                                                                                          { assume n,\n                                                                                                                                            let A : L.Theory,\n                                                                                                                                            { assume n,\n                                                                                                                                              let A : L.Theory,\n                                                                                                                                              { assume n,\n                                                                                                                                                let A : L.Theory,\n                                                                                                                                                { assume n,\n                                                                                                                                                  let A : L.Theory,\n                                                                                                                                                  { assume n,\n                                                                                                                                                    let A : L.Theory,\n                                                                                                                                                    { assume n,\n                                                                                                                                                      let A : L.Theory,\n                                                                                                                                                      { assume n,\n                                                                                                                                                        let A : L.Theory,\n                                                                                                                                                        { assume n,\n                                                                                                                                                          let A : L.Theory,\n                                                                                                                                                          { assume n,\n                                                                                                                                                            let A : L.Theory,\n                                                                                                                                                            { assume n,\n                                                                                                                                                              let A : L.Theory,\n                                                                                                                                                              { assume n,\n                                                                                                                                                                let A : L.Theory,\n                                                                                                                                                                { assume n,\n                                                                                                                                                                  let A : L.Theory,\n                                                                                                                                                                  { assume n,\n                                                                                                                                                                    let A : L.Theory,\n                                                                                                                                                                    { assume\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by auto [set.subset_of_mem_powerset, set.subset_of_mem_powerset],\n  have h2 : (A \u2229 B) \u2286 A, from by auto [set.inter_subset_left],\n  have h3 : (A \u2229 B) \u2286 S, from by auto [set.subset.trans],\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by auto [set.mem_powerset],\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by auto [sq]\n  ... = x*(x+y) + y*(x+y) : by auto [add_mul]\n  ... = x*x + x*y + y*x + y*y : by auto [mul_comm, add_mul] using [ring]\n  ... = x^2 + 2*x*y + y^2 : by auto [sq, mul_comm] using [ring]\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by auto using [use (a\u207b\u00b9 * b)],\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by auto using [use b * a\u207b\u00b9], \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from by auto [h1],\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from by auto [h2],\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from by auto [exists_unique.unique, h3, classical.some_spec, exists_unique.exists, mul_one],\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from by auto [exists_unique.unique, h4, classical.some_spec, exists_unique.exists, one_mul],\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by auto [h3, h4, exists_unique.unique, classical.some_spec, exists_unique.exists] using [use (1 : G)],\nend\n\n/--`theorem`\nOverflow theorem\nLet $F$ be a set of first-order formulas which has finite models of arbitrarily large size. Then $F$ has an infinite model.\n`proof`\nFor each $n$, let $\\mathbf A_n$ be the formula:\n\n$\\exists x_1 \\exists x_2 \\ldots \\exists x_n: \\{x_1 \\ne x_2 \\land x_1 \\ne x_3 \\land \\ldots \\land x_{n - 1} \\ne x_n\\}$\n\nThen $\\mathbf A_i$ is true in a structure $\\AA$ iff $\\AA$ has at least $n$ elements.\n\nTake:\n$$ \\Gamma := F \\cup \\bigcup_{i \\mathop = 1}^\\infty A_i $$\n\nSince $F$ has models of arbitrarily large size, every finite subset of $\\Gamma$ is satisfiable.\n\nFrom the Compactness Theorem, $\\Gamma$ is satisfiable in some model $\\mathbf{M}$.\n\nBut since $\\mathbf{M} \\models A_i$ for each $i$, $\\mathbf{M}$ must be infinite.\n\nSo $F$ has an infinite model.\n\nQED\n-/\ntheorem  overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_auto-Natural-Language-Proof-Translation/Correct_statement-lean_proof_auto-3_few_shot_temperature_0.2_max_tokens_2000_n_3/clean_files/Overflow theorem.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5698526514141571, "lm_q2_score": 0.29421496597446145, "lm_q1q2_score": 0.16765917844627287}}
{"text": "import math.alexandroff_space math.notation\nopen set topological_space classical\nset_option pp.generalized_field_notation true\nlocal attribute [instance] prop_decidable\nnoncomputable theory\nuniverse u\n\n/-! \n# A topological formal ontology and foundation of philosophy\n\n  The purpose of this work is to implement in the Lean Theorem Prover an \n  upper level ontology that minimizes the number of primitive concepts and axioms,\n  while maximizing explanatory power with regards to the interpretability of \n  philosophical concepts in the theory. We seek to give to the whole of philosophy the same sort\n  of rigorous foundation that set/type theory gave to mathematics, without having to rely\n  on the introduction of a primitive concept for almost every new concept of philosophy. \n  The most basic version of our theory admits of only two primitives: possible worlds and existential events,\n  everything else being defined in terms of those, in much the same way that everything in mathematics can be\n  defined in terms of the primitive notions of set and set-membership. \n  We name our theory simply as the **Topological Ontology**.\n\n  Among other things, we seek to precisely define in our theory the concepts of: substance, simple substance, \n  composite substance, physical substance, metaphysical substance, accident, property, positive property,\n  essence and existence, causality, parthood, God, theism,\n  atheism, physicalism, monism, pantheism, eleaticism, platonism, modal realism, etc...\n  We also seek to formalize theories of: causality, counterfactuals, mereology,\n  epistemology, ethics, philosophy of nature, metaphysics and natural theology. \n\n  And in a higher order extension of our theory, we also seek to define: concept/abstract object, \n  the process of abstraction, universal, matter, form, the categories of being, the post-predicaments, etc...\n\n  All of it based on the foundation of possible worlds and existential events. Pretty audacious, ain't it?\n\n## Ontologies and Events\n\n  The fundamental concept upon which all of our work is based, is the concept of an *ontology of possible worlds*.\n  Which is to be comprised of a Type of possible worlds equipped with some fundamental topological structure, \n  the philosophical significance of which shall be made clear shortly.\n\n  The notion of possible world is of course a primitive one, and you may interpret it as you will. \n  We take a possible world in our theory to be a point in the phase space of the whole of possible reality,\n  a fully qualified description of a possible state of existence, \n  an outcome of the most general random experiment one could possible think of, etc... \n\n  For simplicity, we  will also consider that possible worlds are *atomic truth-indexers*. This is to say that \n  they are truth-indexers, i.e. things with respect to which propositions are said to be true or false \n  (*tertium non datur*) but which cannot be thought to be composed of further things which have this property. \n  In particular, our possible worlds will not have any intrinsic temporal or spatial structure, so it will simply\n  *not make sense* at first to say that some event like \"Socrates is sitting\" will occur in \n  the future of a possible world `w`, it will not make sense to claim \"Socrates will sit in the future\" is true at `w`,\n  at least initially. Later on, by equipping our topological space of possible worlds with additional temporal structure,\n  we *will* be able to make sense of these claims by defining timelines in terms of continuous paths of possible worlds.\n  In this manner we can think of possible worlds as being possible spatio-temporal locations in possible space-times\n  rather than as being space-times themselves; since if they were space-times they could be thought to be composed \n  of points which would themselves be truth-indexers, and so our possible worlds would not be atomic truth-indexers. \n  This seems to be a much simpler foundation to build upon than assuming that, somehow,\n  possible worlds should have some intrinsic temporal structure, which would be very hard \n  to define right from the start.  \n\n  Perhaps more importantly, given this primitive notion we can readily define the notion of an ontological \n  **Event** as simply a set of possible worlds; the notion should be familiar to those acquainted \n  with probability theory (probability spaces). An (not necessarily \"random\") event is something that \"happens\" or \"occurs\", \n  precisely in the possible worlds which are its elements, i.e. an event is the set of all possible worlds in which\n  the event occurs. We would like to talk a little bit about events before delving into the mathematical definitions.\n\n  Another way to see an event is as the semantic content of a proposition. \n  Not all events are necessarily propositions because,\n  perhaps, we could have uncountably many events, but countably many propositions.\n  However every proposition is to be associated with an event: \n  the set of all possible worlds in which the proposition is true.\n  For instance the proposition \"Socrates exists\" corresponds to the event {w : world | Socrates exists in w}.\n\n  Now, it is quite clear that some propositions \"talk about\" or postulate one or more things existing, while others do not. \n  \"Socrates exists\" clearly postulates the existence of Socrates, just as \"Humans exist\" postulates the existence of \n  Human beings, and \"Socrates and Plato exist\" postulates the existence of both Plato and Socrates, etc... \n  On the other hand, \"Unicorns do not exist\", does not seem to postulate or \"talk about\" \n  the existence of anything, but merely about the *absence* of an existence. \n  So there is quite clearly a primitive notion of which propositions \n  talk about existence and which do not. I would not want to reduce this notion\n  to merely \"using an existential quantifier in formal language X\" because I do \n  not want to assume anything about the syntactical makeup of propositions in the first\n  place.\n\n  For the sake of generality, simplicity, and removing from our formal system the unnecessary concept of what a \n  \"proposition\" is supposed to be, we can take this notion to apply to all events regardless\n  of whether they are propositions or not, and stop talking about propositions altogether.\n  So an event will be **existential** or **open** \n  precisely when its occurrence postulates that one or more entities from a set of entities must exist,\n  which is to say that the event can only occur in a possible world if those entities it postulates \n  do exist in that possible world.\n\n  Now, as we have already exemplified, we should expect that arbitrary set unions of existential \n  events be existential events, since the event \"(Some)Humans exist\" is the union of all events of the form\n  \"X exists\" for any possible human X. The same should apply for intersections, since \"All possible humans exist\" \n  is the intersection of \"X exists\" for any possible human X. And generally speaking, regardless of the \n  particular notion of \"existential event\" that we adopt, we should expect the set of all existential events to be \n  closed by arbitrary unions and intersections. \n\n  However, although plausible,\n  this amounts to assuming more than what we actually need to develop our theory. \n  For the purposes of our theory, we will only really be committed to the claim that \n  *finite* intersections of existential events are existential events, rather than\n  claiming that this works for *arbitrarily large* intersections. \n  This latter assumption we will denominate, for very sound mathematical reasons, the **Alexandroff Postulate**,\n  and we will neither affirm nor deny it, though we might occasionally derive some conclusions from its assumption.\n\n  Furthermore, we should also assume that both the set of all possible worlds, i.e. the **necessary event**\n  and the empty set of worlds, i.e. the **impossible event**, are both\n  existential events. There are many ways to argue this point, the simplest one seems to consist in the\n  consideration that the proposition \"Something (whatsoever) exists\" should be associated to the necessary event,\n  and that the proposition \"A squared-circle exists\" should be associated to the impossible event. In that case,\n  it is clear that these events postulate the existence of some things.\n\n  It is however clear that we need not assume that the set complements of existential events are existential for, as we \n  have previously exemplified, \"Unicorns do not exist\" is not existential, even though it is the complement, or negation, of \n  \"Unicorns exist\", which is clearly existential.\n\n  We are also going to assume, as the only real axiom in our theory, that there is an extensionality\n  principle for possible worlds: possible worlds worlds in which exactly the same existential events occur\n  are equal. This will allow us to think of possible worlds as the sets of possible entities which exist\n  in that particular world, so that if two worlds are to be distinct, at least one entity would have to exist in one\n  which does not exist in the other. This can be seen as the \"identity of indiscernibles\" principle\n  applied to possible worlds. It might turn out however that for many applications we won't even need this axiom,\n  so we might consider turning it into a postulate if the need arises, but as of now it looks like such a simple\n  assumption that it makes sense to include it as an axiom.\n\n  Now, we shall not explain here the mathematics involved, but \n  a competent mathematician should already be able to conclude that what\n  we are assuming is that existential events constitute a T\u2080-topology of \n  possible worlds. \n  \n  This leads us to the very first formal definitions of our theory:\n\n-/\n\n/-- An `ontology` is a nonempty T\u2080 topological space\nof possible worlds. -/\nstructure ontology :=\n    (world : Type u)\n    [wne : nonempty world]\n    [t : topological_space world]\n    -- identity of indiscernibles for possible worlds\n    [axiom\u2080 : @t0_space world t]\n\n/-- identity of indiscernibles for possible worlds. -/\nadd_decl_doc ontology.axiom\u2080\n\ninstance ontology_top  (\u03c9 : ontology)  : topological_space \u03c9.world := \u03c9.t\ninstance ontology_ne  (\u03c9 : ontology)  : nonempty \u03c9.world := \u03c9.wne\ninstance ontology_t0  (\u03c9 : ontology)  : t0_space \u03c9.world := \u03c9.axiom\u2080\n\n/-- **Events** in an ontology are simply sets of possible worlds.\n Events are said to **occur** at their element worlds. -/\n@[reducible]\ndef ontology.event (\u03c9 : ontology) := set \u03c9.world\n\n/-- **Existential** `events` in an ontology are open sets of possible worlds. -/\n@[reducible, simp]\ndef ontology.event.existential {\u03c9 : ontology} (e : \u03c9.event) := is_open e\n\n-- We will start developing the most basic conclusions of the theory:\nnamespace ontology\n\nvariable {\u03c9 : ontology}\n\n-- We develop further the notion of events. \nsection events\n \n  variable (e : \u03c9.event)\n\n  @[reducible, simp]\n  def event.occurs (w : \u03c9.world) := w \u2208 e\n\n  -- We define the related topological notions for events:\n\n  @[reducible, simp]\n  def event.closure : \u03c9.event := closure e\n  @[reducible, simp]\n  def event.dense : Prop := closure e = univ\n  @[reducible, simp]\n  def event.exterior : \u03c9.event := interior (-e)\n  @[reducible, simp]\n  def event.regular : Prop := e = e.exterior.exterior\n  /-- also called `boundary` -/\n  @[reducible, simp]\n  def event.frontier : \u03c9.event := frontier e\n  /-- also called `frontier` -/\n  @[reducible, simp, alias]\n  def event.boundary : \u03c9.event := e.frontier\n  @[reducible, simp]\n  def event.connected : Prop := is_connected e\n  @[reducible, simp]\n  def event.irreducible : Prop := is_irreducible e\n  @[reducible, simp]\n  def event.clopen : Prop := is_clopen e\n  @[reducible, simp]\n  def event.closed : Prop := is_closed e\n  @[reducible, simp]\n  def event.nnegative : Prop := \u00ac is_closed e\n  /-- **Not Purely Negative** events -/\n  @[reducible, simp]\n  def event.npnegative : Prop := \u00ac is_closed e \u2228 is_clopen e\n  @[reducible, simp]\n  def event.compact : Prop := compact e\n\n  -- necessity, possibility, impossibility, contingency\n  @[reducible, simp]\n  def event.necessary := e = univ\n  @[reducible, simp]\n  def event.possible := e.nonempty\n  @[reducible, simp]\n  def event.impossible := \u00ace.possible\n  @[reducible, simp]\n  def event.contingent := e.possible \u2227 \u00ace.necessary\n\n  /-- The **ground**, or *ontological counterpart* of an `event e` is its interior, \n      i.e. the largest existential event below `e`.\n      This will be the event of some entity existing whose\n      existence necessitates the ocurrence of `e`. -/\n  @[reducible, simp]\n  def event.ground : \u03c9.event := interior e\n\n  /-- An `event` is **groundable** if its ground is `possible`. -/\n  @[reducible, simp]\n  def event.groundable := e.ground.possible\n\n  /-- An `event` is **ungroundable** if it is not groundable. -/\n  @[reducible, simp]\n  def event.ungroundable := \u00ace.groundable\n\n  -- Setting up notation:\n\n  /-- Use `\u25a1e` for \"`e` is necessary\" -/\n  @[reducible, simp]\n  instance has_box_event : has_box \u03c9.event := \u27e8event.necessary\u27e9\n\n  /-- Use `\u25fee` for \"the ground of `e`\" -/\n  @[reducible, simp]\n  instance has_black_box_event : has_black_box \u03c9.event := \u27e8event.ground\u27e9\n\n  /-- Use `\u22c4e` for \"`e` is possible\" -/\n  @[reducible, simp]\n  instance has_diamond_event : has_diamond \u03c9.event := \u27e8event.possible\u27e9\n\n  /-- Use `\u2726e` for \"the event of nothing precluding `e` from happening\", or `-\u25fe-e` -/\n  @[reducible, simp]\n  instance has_black_diamond_event : has_black_diamond \u03c9.event := \u27e8event.closure\u27e9\n\n  /-- Use `~e` for \"the exterior of `e`\" -/\n  @[reducible, simp]\n  instance has_tilde_event : has_tilde \u03c9.event := \u27e8event.exterior\u27e9\n\n  /-- Use `e\u2081 \u21d2 e\u2082` instead of `e\u2081 \u2286 e\u2082`, replace with `\u21d2'` for `\u2282`.\n      Use `e\u2081 \u21cf e\u2082` instead of `\u00ac e\u2081 \u21d2 e\u2082`.\n      Use `e\u2081 \u2261 e\u2082` instead of `e\u2081 \u21d2 e\u2082 \u2228 e\u2082 \u21d2 e\u2081`. \n      Use `e\u2081 \u2262 e\u2082` instead of `\u00ac e\u2081 \u2261 e\u2082`.\n  -/\n  @[reducible, simp]\n  instance has_entailment_event : has_entailment \u03c9.event := \u27e8set.subset\u27e9\n\n  /-- Use `e\u2081 \u27f6 e\u2082`  instead of `-e\u2081 \u222a e\u2082`.\n      Use `e\u2081 !\u27f6 e\u2082` instead of `-(e\u2081 \u27f6 e\u2082)`.\n      Use `e\u2081 \u27f7 e\u2082`  instead of `(e\u2081 \u27f6 e\u2082) \u2229 (e\u2082 \u27f6 e\u2081)`. \n      Use `e\u2081 !\u27f7 e\u2082` instead of `-(e\u2081 \u27f7 e\u2082)`. \n  -/\n  @[reducible, simp]\n  instance has_local_entailment_event : has_local_entailment \u03c9.event := \u27e8\u03bb e\u2081 e\u2082, -e\u2081 \u222a e\u2082\u27e9\n\n  --tests:\n  -- variables (e\u2081 e\u2082 : \u03c9.event)\n  -- #check \u25a1e\n  -- #check \u25fee\n  -- #check \u22c4e\n  -- #check \u2726e\n  -- #check ~e\n  -- #check e\u2081 \u21d2 e\u2082\n  -- #check e\u2081 \u21d2' e\u2082\n  -- #check e\u2081 \u21cf e\u2082\n  -- #check e\u2081 \u2261 e\u2082\n  -- #check e\u2081 \u2262 e\u2082\n  -- #check e\u2081 \u27f6 e\u2082\n  -- #check e\u2081 \u27f7 e\u2082\n  -- #check e\u2081 !\u27f6 e\u2082\n  -- #check e\u2081 !\u27f7 e\u2082\n  -- example : e.groundable \u2194 \u22c4\u25fee := by simp\n\nend events\n\n-- And we prove some simple useful lemmas about them \nsection event_lemmas\n\n  variable {e : \u03c9.event} \n  lemma event_union_exterior_open : e.existential \u2192 (e \u222a ~e).existential :=\n    by intro h; apply is_open_union h; simp\n\n  -- For some reason in the standard library there is a lemma\n  -- like this for finsets but not one for sets.\n  lemma event_possible_of_ne_empty : e \u2260 \u2205 \u2192 \u22c4e :=\n    begin\n        intro h,\n        simp [set.nonempty],\n        by_contradiction h\u2082,\n        push_neg at h\u2082,\n        replace h\u2082 := eq_empty_iff_forall_not_mem.2 h\u2082,\n        contradiction,\n    end\n\n  lemma event_union_exterior_possible : \u22c4(e \u222a ~e) :=\n    begin\n        apply event_possible_of_ne_empty,\n        intro h,\n        simp at h,\n        obtain \u27e8h\u2081, h\u2082\u27e9 := h,\n        rw h\u2081 at h\u2082,\n        simp at h\u2082,\n        have c := \u03c9.wne,\n        contradiction,\n    end\n\n  @[simp]\n  lemma existential_iff_ground_eq : e.existential \u2194 e = e.ground := \n    begin \n      simp, \n      symmetry, \n      constructor; intros h,\n        symmetry' at h,\n        exact interior_eq_iff_open.mp h,\n      symmetry,\n      exact interior_eq_iff_open.2 h,\n    end\n\nend event_lemmas\n\n-- We define (extensional) possible entities to be particular kinds of events, so\n-- that existence is a special case of occurrence. \n-- We defer full philosophical explanation to the \"Intensionality and Extensionality\" section.\nsection entities\n \n  /-- The (possible, extensional) `entities` in the ontology are nonempty open sets of possible worlds.\n      An entity is said to **exist** precisely at the worlds which are its elements. -/\n  structure entity (\u03c9 : ontology) :=\n    -- the event of the entity existing (\"exists\" is a reserved word)\n    (\u00abexists\u00bb : \u03c9.event)\n    (existential : exists.existential)\n    (possible : \u22c4\u00abexists\u00bb)\n\n  /-- the event of the `entity` existing -/\n  add_decl_doc entity.exists\n\n  /-- Any groundable event `e` can be cast to an entity, \n      the existence of which is the ground of `e`. -/\n  def event.entity (e : \u03c9.event) (h : \u22c4\u25fee) : \u03c9.entity := \u27e8\u25fee, is_open_interior, h\u27e9\n  /-- An event is entitative if it is both existential and possible. -/\n  def event.entitative (e : \u03c9.event) : Prop := e.existential \u2227 \u22c4e\n\n  @[simp]\n  lemma entity.entitative (e : \u03c9.entity) : e.exists.entitative := \u27e8e.existential, e.possible\u27e9\n  @[reducible]\n  lemma event.entitative.entity {e : \u03c9.event} (h : e.entitative) : \u03c9.entity := \u27e8e, h.1, h.2\u27e9\n\n  /-- main extensionality lemma for entities. -/\n  @[ext]\n  lemma entity_ext {e\u2081 e\u2082 : \u03c9.entity} (h : e\u2081.exists = e\u2082.exists) : e\u2081 = e\u2082 := \n    by casesm* \u03c9.entity; simp at h; simpa\n\n  @[simp]\n  lemma entity_ext_iff (e\u2081 e\u2082 : \u03c9.entity) : e\u2081 = e\u2082 \u2194 e\u2081.exists = e\u2082.exists := \n    \u27e8(\u03bb h, by rw h), entity_ext\u27e9\n\n  variables (e e\u2081 e\u2082 : \u03c9.entity)\n\n  lemma entity_exists_inj : function.injective (@entity.exists \u03c9) :=\n    \u03bb e\u2081 e\u2082, @entity_ext \u03c9 e\u2081 e\u2082\n\n  /-- Two entities are said to be `contrary` if there is no possible world\n      in which both exist together.\n      they are otherwise said to be `compatible`. -/\n  @[reducible, simp]\n  def entity.contrary := e\u2081.exists \u2229 e\u2082.exists = \u2205\n  /-- Negation of `entity.contrary`. -/\n  @[reducible, simp]\n  def entity.compatible := \u22c4(e\u2081.exists \u2229 e\u2082.exists)\n\n  -- Some very important entities have no contraries\n  @[reducible, simp]\n  def entity.nocontrary := \u00ac \u2203 y, e.contrary y\n\n  /-- Entity e\u2081 is said to existentially entail entity e\u2082,\n      or to existentially depend on e\u2082,\n      if in every possible world in which e\u2081 exists, e\u2082 exists.\n      For this relation we use the ` \u21d2 ` notation.\n      This is defined via coercion to events and \n      the `cross_entailment` typeclass instances. -/\n  @[reducible, simp]\n  instance has_coe_entity : has_coe \u03c9.entity \u03c9.event := \u27e8entity.exists\u27e9\n\n  -- tests:\n  -- #reduce \u03bb (e\u2081 : \u03c9.entity) (e\u2082 : \u03c9.entity), e\u2081 \u21d2 e\u2082\n  -- #reduce \u03bb (e\u2081 : \u03c9.entity) (e\u2082 : \u03c9.event), e\u2081 \u21d2 e\u2082\n  -- #reduce \u03bb (e\u2081 : \u03c9.entity) (e\u2082 : \u03c9.event), e\u2082 \u21d2 e\u2081\n\n  /-- An entity is said to be a **truthmaker** for any event its existence entails. -/\n  def entity.truthmaker (e : \u03c9.entity) (ev : \u03c9.event) : Prop := e \u21d2 ev\n\n  /-- The event of an entity being \"removed\" from a possible world. -/\n  def entity.removed (w : \u03c9.world) : \u03c9.event := \n    {w' | e.exists w \u2227 w' < w \u2227 \u00ac e.exists w'}\n  /-- The event of an entity being \"added\" to a possible world. -/\n  def entity.added (w : \u03c9.world) : \u03c9.event := \n    {w' | \u00ace.exists w \u2227 w < w' \u2227 e.exists w'}\n  /-- The set of all possible worlds from which an entity can be \"removed\". -/\n  def entity.removable : \u03c9.event := \n    {w | \u22c4e.removed w}\n  /-- The set of all possible worlds to which an entity can be \"added\". -/\n  def entity.addable : \u03c9.event := \n    {w | \u22c4e.added w}\n\n  /-- The necessary being (entity) is the entity which exists in\n      every possible world. -/\n  def nbe (\u03c9 : ontology) : \u03c9.entity := \u27e8univ, is_open_univ, by simp [empty_ne_univ]\u27e9\n  instance entity_inhabited : inhabited \u03c9.entity := \u27e8\u03c9.nbe\u27e9\n\n  /-- An entity is `contingent` if it is not the necessary being. -/\n  @[reducible, simp]\n  def entity.contingent := e \u2260 \u03c9.nbe\n  /-- An entity is `necessary` if it is the necessary being. -/\n  @[reducible, simp]\n  def entity.necessary := e = \u03c9.nbe\n\n  @[reducible, simp]\n  def entity.compact := e.exists.compact\n\n  /-- Use `\u25a1e` for \"`e` is necessary\" -/\n  @[reducible, simp]\n  instance has_box_entity : has_box \u03c9.entity := \u27e8entity.necessary\u27e9\n\n  lemma nbe_unique : \u2203! e : \u03c9.entity, \u25a1e := by use \u03c9.nbe; simp\n\n  /-- A contingent entity is said to be **complemented** if \n      its existence is a clopen set.\n      Complemented entities `e` are such that the event\n      of their non-existence `-e.exists` is itself\n      just as much of an entity as `e`.\n      It can be proven that the possibility\n      of the existence of complemented\n      entities is logically equivalent to atheism. -/\n  def entity.complemented : Prop := e.contingent \u2227 e.exists.clopen\n\n  -- Here are some definitions which look more like lemmas:\n\n  -- Arbitrary nonempty unions of entities are entities.\n  def entity_Sup (s : set \u03c9.entity) (h : s.nonempty) : \u03c9.entity :=\n    begin\n      fsplit,\n          exact \u22c3 i \u2208 s, entity.exists i,\n      apply is_open_bUnion,\n      intros i H,\n      exact i.existential,\n          simp [set.nonempty],\n\n      let i := h.some,\n      let w := i.possible.some,\n      existsi w,\n      existsi i,\n      constructor,\n        exact h.some_mem,\n        exact i.possible.some_mem,\n    end\n\n  -- so are pairwise unions, obviously\n  def entity_sup (e\u2081 e\u2082 : \u03c9.entity) : \u03c9.entity := \n    begin\n      fconstructor,\n        exact e\u2081.exists \u222a e\u2082.exists,\n      apply is_open_union,\n        exact e\u2081.existential,\n        exact e\u2082.existential,\n      simp, left,\n      exact e\u2081.possible,\n    end\n\n  -- @[reducible, simp]\n  instance has_Sup_entity : has_Sup \u03c9.entity := \n  \u27e8\u03bb s, if h : s.nonempty then entity_Sup s h else \u03c9.nbe\u27e9\n\n  -- @[reducible, simp]\n  instance has_sup_entity : has_sup \u03c9.entity := \u27e8entity_sup\u27e9\n\n  @[simp]\n  lemma Sup_sup (e\u2081 e\u2082 : \u03c9.entity) : Sup {e\u2081, e\u2082} = e\u2081 \u2294 e\u2082 :=\n    begin\n      have c : ({e\u2081, e\u2082} : set \u03c9.entity).nonempty, \n        use e\u2081, simp,\n      simp [Sup, has_Sup.Sup, entity_Sup, entity_sup, c],\n      exact sup_comm,\n    end\n\n  /-- Intersections of compatible entities are entities.\n      If `h` is a proof of the compatibility of the entities\n      `e\u2081` and `e\u2082`, then `h.inter` is the intersection of\n      `e\u2081` and `e\u2082`. -/\n  def entity.compatible.inter {e\u2081 e\u2082 : \u03c9.entity} (h : e\u2081.compatible e\u2082) : \u03c9.entity :=\n      \u27e8  e\u2081.exists \u2229 e\u2082.exists\n      , is_open_inter e\u2081.existential e\u2082.existential\n      , h\n      \u27e9\n\n  /-- possibly_not_exists_of_contingent -/\n  lemma pnexists_of_contingent {e : \u03c9.entity} : e.contingent \u2192 \u22c4-e.exists :=\n    begin\n      intro h,\n      simp [nbe, entity_ext_iff] at h,\n      by_contradiction c,\n      simp [has_neg.neg, compl, set.nonempty] at c,\n      replace c := eq_univ_of_forall c,\n      contradiction,\n    end\n  \n  def entity.complement (h : e.complemented) : \u03c9.entity :=\n    \u27e8 -e.exists\n    , h.2.2\n    , pnexists_of_contingent h.1 \n    \u27e9\n\nend entities\n\n-- We discuss some properties of possible worlds\nsection worlds\n\n  variables (w w\u2081 w\u2082 : \u03c9.world)\n\n  -- We can also talk about an entity existing in a world\n  -- as belonging to it, so we can use the notation e \u2208 w.\n  @[reducible, simp]\n  instance world.has_mem : has_mem \u03c9.entity \u03c9.world := \u27e8\u03bbe w, w \u2208 e.exists\u27e9\n  @[reducible, simp]\n  def world.entities := {e : \u03c9.entity | e \u2208 w}\n\n  -- extensionality principle for possible worlds\n  @[ext]\n  lemma world.ext {w\u2081 w\u2082 : \u03c9.world} (h : w\u2081.entities = w\u2082.entities) : w\u2081 = w\u2082 :=\n    begin\n      by_contradiction contra,\n      have c\u2080 := \u03c9.axiom\u2080.t0,\n      obtain \u27e8U, U_open, \u27e8hU\u2081, hU\u2082\u27e9|\u27e8hU\u2081, hU\u2082\u27e9\u27e9 := c\u2080 w\u2081 w\u2082 contra;\n      clear c\u2080;\n      have ne := nonempty_of_mem hU\u2081;\n      let e : \u03c9.entity := \u27e8U, U_open, ne\u27e9,\n      replace h : w\u2081.entities \u2286 w\u2082.entities, finish,\n      swap,\n      replace h : w\u2082.entities \u2286 w\u2081.entities, finish,\n      all_goals {\n        simp [world.entities, entity.exists] at h,\n        specialize h e,\n        simp [e, hU\u2081, hU\u2082] at h,\n        contradiction,\n      },\n    end\n\n  @[reducible, simp]\n  def world.ideal : \u03c9.event := {w' | w' \u2264 w}\n  def world.filter : \u03c9.event := {w' | w \u2264 w'}\n  def world.nonactuality : \u03c9.event := {w' | w' \u2260 w}\n\n  variable (\u03c9)\n\n  def nonparmenidean : \u03c9.event := {w | \u2203 e : \u03c9.entity, e.contingent \u2227 e.exists w}\n  def parmenidean : \u03c9.event := {w | \u2200 e : \u03c9.entity, e \u2208 w \u2192 \u25a1 e}\n\n  @[reducible, simp]\n  def weakly_parmenidean : Prop := \u22c4\u03c9.parmenidean\n  @[reducible, simp]\n  def strongly_parmenidean : Prop := \u25a1\u03c9.parmenidean\n  /-- A modal collapsing ontology is an ontology with a single possible world -/\n  def mcollapse : Prop := \u2200 w\u2081 w\u2082 : \u03c9.world, w\u2081 = w\u2082\n\n  def Parmenides : ontology := { world := unit }\n  def Sierpinski : ontology := { world := Prop }\n\n  lemma mcollapse_iff_str_parme : \u03c9.mcollapse \u2194 \u03c9.strongly_parmenidean :=\n    begin\n      constructor; intro h;\n        simp [strongly_parmenidean, nbe, ext_iff, parmenidean] at *,\n        intros w\u2081 e he w\u2082,\n        specialize h w\u2081 w\u2082,\n        rwa h at he,\n      intros w\u2081 w\u2082,\n      ext e, constructor; intro h\u2080,\n        exact h w\u2081 e h\u2080 w\u2082,\n      exact h w\u2082 e h\u2080 w\u2081,\n    end\n\n  -- #reduce Sierpinski.t.is_open {false}\n  -- lemma weakly_parme_weaker : \u2203 \u03c9\u2080 : ontology.{0}, \u03c9\u2080.weakly_parmenidean \u2227 \u00ac \u03c9\u2080.mcollapse :=\n  --   begin\n  --     use Sierpinski, constructor,\n  --       use false, simp [parmenidean],\n  --       intros e h, \n  --       by_cases hyp : e.exists = {false, true};\n  --         simp [nbe, hyp, ext_iff],\n  --         exact em,\n  --       have c := e.existential,\n  --       change (generate_open (\u03bb (b : Prop \u2192 Prop), (b = \u03bb (b : Prop), b = true \u2228 false) \u2228 false) e.exists) at c,\n  --       simp at c,\n  --       intro w,\n  --       apply generate_open.cases_on c,\n  --       -- simp at d,\n  --       -- induction c; try {simp},\n  --       --   change (c_s = \u03bb (b : Prop), b) at c_H,\n  --       --   rw c_H at h,\n  --       --   change (false) at h, \n  --       --   contradiction,\n        \n        -- simp [set_of, set.mem] at c_H,\n        --; simp [nbe],\n        -- simp [sierpinski_space.is_open] at c,\n  -- end\n\n\nend worlds\n\n-- Here we discuss basic general properties of ontologies themselves.\nsection ontology\n \n  variable (\u03c9)\n\n  /-- The least we should assume for an ontology to be worthy of consideration as being\n      the true ontology is that we can add or remove entities from its worlds.\n      A `viable` ontology is one satisfying this postulate. -/\n  class viable : Prop :=\n      (postulate\u2081 : \u2200 w : \u03c9.world, \u2203 w', w < w' \u2228 w' < w)\n\n  -- common (sensical) ontologies\n  class common extends viable \u03c9 : Prop :=\n      (postulate\u2082 : uncountable \u03c9.world)\n\n  def alexandroff_discrete := alexandroff_space \u03c9.world\n\n  class alexandroff extends common \u03c9 : Prop :=\n    (postulate\u2083 : \u03c9.alexandroff_discrete)\n\n  /-- A complemented ontology supports complemented entities. -/\n  def complemented := \u2203 e : \u03c9.entity, e.complemented\n\n  /-- The **Principle of Non-Negative Nonactual Existence** claims\n      that the nonactual (a.k.a. merely possible) existence of any entity is a non-negative event. -/\n  def pnnnae : Prop := \u2200 (w : \u03c9.world) (e : \u03c9.entity), (\u2191e \u2229 w.nonactuality).nnegative\n\nend ontology\n\n\n/- We introduce a custom notion of subbasis in an ontology. -/\nsection subbasis\n\n  def {v} is_subbasis {\u03c9 : ontology.{v}} (B : set \u03c9.event) : Prop :=\n    (\u2200 ev : \u03c9.event, ev \u2208 B \u2192 ev.entitative) \u2227\n    \u2200 e : \u03c9.entity, \u2203 (I : Type v) (ne : nonempty I) (S : I \u2192 set \u03c9.event),\n    (\u2200 i, (S i).finite \u2227 (S i).nonempty \u2227 (S i) \u2286 B) \u2227\n    (\u22c3 i, \u22c2\u2080 S i) = e\n\n  def is_subbasis' (B : set \u03c9.entity) : Prop := is_subbasis $ entity.exists '' B\n\n  variable {B : set \u03c9.event}\n\n  lemma is_subbasis.ne : is_subbasis B \u2192 B.nonempty :=\n    begin\n      intro h,\n      by_contradiction contra,\n      replace contra := not_nonempty_iff_eq_empty.mp contra,\n      simp [is_subbasis, contra] at h,\n      specialize h \u03c9.nbe,\n      obtain \u27e8I, ne, S, h\u27e9 := h,\n      replace h := (h.1 ne).2,\n      obtain \u27e8h\u2081, h\u2082\u27e9 := h,\n      replace h\u2081 := h\u2081.not_subset_empty,\n      contradiction,\n    end\n  \n  lemma is_subbasis.ne_of_mem : is_subbasis B \u2192 \u2200 {b : \u03c9.event}, b \u2208 B \u2192 \u22c4b :=\n    \u03bb h b hb, (h.1 b hb).2\n\n  lemma is_subbasis.existential_of_mem : is_subbasis B \u2192 \u2200 {b : \u03c9.event}, b \u2208 B \u2192 b.existential :=\n    \u03bb h b hb, (h.1 b hb).1\n  \n  lemma is_subbasis.sUnion_necessary :  is_subbasis B \u2192 \u25a1 \u22c3\u2080 B :=\n    begin\n      intro h,\n      replace h := h.2 \u03c9.nbe,\n      obtain \u27e8I, ne, S, \u27e8h\u2081, h\u2082\u27e9\u27e9 := h,\n      unfold_coes at h\u2082,\n      simp [nbe, Union, ext_iff] at h\u2082,\n      simp [sUnion, ext_iff],\n      intro w, specialize h\u2082 w,\n      obtain \u27e8i, hi\u27e9 := h\u2082,\n      specialize h\u2081 i,\n      obtain \u27e8h\u2081, \u27e8e,he\u27e9, h\u2083\u27e9 := h\u2081,\n      specialize hi e he,\n      specialize h\u2083 he,\n      exact \u27e8e, h\u2083, hi\u27e9,\n    end\n\n  lemma {v} default_subbasis (\u03c9 : ontology.{v}) : @is_subbasis \u03c9 event.entitative := \n    begin\n      refine \u27e8\u03bb_,id, _\u27e9,\n      intro e,\n      refine \u27e8(punit.{v+1} : Type v), \u27e8punit.star\u27e9,(\u03bb_,{e.exists}), _\u27e9,\n      unfold_coes, simp,\n      refine \u27e8\u27e8e.existential, e.possible\u27e9,_\u27e9,\n      simp [Union],\n    end\n\nend subbasis\n\n/-! ## Intensionality and Extensionality\n\n  A fundamental question in any ontological theory is that of\n  whether the basic entities that the theory postulates have a clearly\n  defined identity criteria or whether their identity should be assumed \n  to be a primitive relation. This amounts to asking whether the entities\n  in the theory admit an *extensionality* principle, such as the\n  one admitted for sets, or whether no such extensionality principle is admitted.\n  We can readily call the basic entities in an extensional ontological theory \n  *extensional* entities, and likewise name the entities in an intensional theory\n  *intensional* entities.\n\n  As can be seen from the previous section, it is easy to turn our ontology into an extensional theory\n  by identifying non-empty existential events to be possible extensional entities. Their\n  extensionality principle is then naturally deduced from the extensionality\n  principle for sets. We will indeed be primarily focusing on these entities for much of our work,\n  but to demonstrate the generality of our theory we must \n  also discuss shortly the introduction of primitive intensional entities via \n  an intensional extension to our theory.\n\n  It might indeed look somewhat controversial, to some,\n  that we so readily move from existential events to \"entities\". \n  It may look like we are saying that entities, or at least our particular kind of\n  \"extensional\" entities, are *nothing but* sets of possible worlds, or that nothing but\n  sets of possible worlds are supposed to \"exist\" in our theory. This of course seems implausible\n  among other reasons because sets are abstract mathematical objects, not concretely existing \"things\".\n  This objection can however be resolved by understanding that, this being a mathematical theory,\n  we are not really claiming that possible entities *are* nothing other than sets of possible worlds, \n  but only that these entities can be *represented* as the sets of possible worlds in which they exist.\n  We are also not really committed to claiming that existence really just *is* a particular special case\n  of the occurrence of events, but only that for all mathematical intents and purposes it can be so *represented*.\n  We will look shortly into a way to make this representation formal by showing that any intensional ontological theory\n  of possible entities naturally gives rise to our extensional topological theory in a mathematically well understood way.\n\n-/\n\n/-- An **Intensional ontology** is an ontology generated by a mapping of intensional entities to existential events -/\nstructure iontology (\u03c9 : ontology.{u}) :=\n  (ientity : Type u)\n  [iene : nonempty ientity]\n  (\u00abexists\u00bb : ientity \u2192 \u03c9.event)\n  (axiom\u2081 : is_subbasis $ range \u00abexists\u00bb)\n\nnamespace iontology\n\n  section ientity\n\n    variables {\u03a9 : \u03c9.iontology} (ie : \u03a9.ientity)\n\n    /-- the `event` of an intensional entity existing -/\n    def ientity.exists := \u03a9.exists ie\n\n    /-! **...**\n\n      As can be seen, we can define an intensional ontology as a particular kind of ontology whose \n      topological structure was generated as the least topology containing the image of a map from some\n      type of intensional entities to events. These events will provably be extensional entities, as we\n      show bellow:\n\n    -/\n    \n    lemma ientity.possible : ie.exists.possible := \n      \u03a9.axiom\u2081.ne_of_mem \n      (by simp [ientity.exists]; use ie)\n\n    lemma ientity.existential : ie.exists.existential :=\n      \u03a9.axiom\u2081.existential_of_mem\n      (by simp [ientity.exists]; use ie)\n\n    -- \"up\" is used for informal inheritance here\n    /-- cast from `ientity` to `entity` -/\n    def ientity.up : \u03c9.entity := \u27e8ie.exists, ie.existential, ie.possible\u27e9\n\n    instance ientity_coe : has_coe \u03a9.ientity \u03c9.entity := \u27e8ientity.up\u27e9\n\n    -- #check ie \u21d2 ie\n\n  end ientity\n  \nend iontology\n\n-- We discuss whether extensional entities, and other Lean types, are real or mere abstracta. \nsection realism\n\n  variables (e : \u03c9.entity) (\u03a9 : \u03c9.iontology)\n\n  /-! ## Real and Virtual Entities\n  \n    Some philosophers might furthermore be skeptical with the prospect that, for example,\n    the existential event \"human beings exist\" \n    corresponds to some particular, unique, \"extensional entity\"\n    which may possibly exist concretely in the world;\n    i.e. the (not necessarily Platonic) universal of \"Man\", or Humanity.\n    We make a concession to this sort of skepticism in order to make our\n    system more general, and we will admit that some such extensional entities might be,\n    in some sense, abstracta, figures of speech, concoctions of language, etc...\n    and these we will call **virtual** entities; all other entities we shall call **real** entities. \n    Formally what will make a non-empty existential event a real entity is its belonging \n    to the image of the representation function which maps intensional possible entities to \n    their extensional representations.\n\n  -/\n\n  /-- An `entity` `e` is real with respect to an iontology `\u03a9` if there is an `\u03a9.ientity`\n      which exists in the same possible worlds as `e`. -/\n  def entity.real : Prop := \u2203 ie : \u03a9.ientity, ie.up = e\n  /-- An `entity` is virtual with respect to an iontology `\u03a9` if its is not real with respect to `\u03a9`. -/\n  @[reducible]\n  def entity.virtual : Prop := \u00ac e.real \u03a9\n\n  /-! **Example**\n  \n    To give an example, the extensional entity \"Socrates\"\n    defined as the existential event \"(the set of all possible worlds in which) Socrates exists\"\n    is real because there is some possible intensional entity Socrates such that the event of \n    this Socrates existing is precisely the same event which defines the extensional \"Socrates\".\n    However one could consistently hold that the event \"Humans exist\" does not represent some\n    distinct intensional entity over and above the individual intensional human beings from whose\n    representations it is constructed. In this case, the associated extensional entity, \"Humanity\",\n    would be a virtual entity. This is compatible with doctrines of mereological nihilism and such.\n\n    We assume that talk of \"virtual entities\" is just a figure of speech for talk about \n    existential events which talk about the existence of more than a single intensional entity,\n    and as such we can conclude that the jump from existential events to extensional entities\n    does not indeed commits us to any novel metaphysical thesis, nor to anything which could possibly\n    be controversial.\n\n  -/\n\n  /-! In what follows, we speak of \"realizations\" instead of \"instances\" whenever we, informally, take the \n      type in question to be a kind of proof-relevant \"proposition\". -/\n\n  -- Specific Forms of realism:\n\n  /-- An intensional ontology is realist about a class `C` of entities, if every entity in `C` is real. -/\n  def iontology.realist (C : set \u03c9.entity) := \u2200 e : \u03c9.entity, e \u2208 C \u2192 e.real \u03a9\n\n  /-- A *realization* of a position of **realism about instances of type `\u03b1`**, \n      relative to a mapping `\u00abexists\u00bb` of the `\u03b1`s to their extensional representations,\n      consists in an injective map associating every `x : \u03b1` to some intensional entity, `map x`,\n      such that `(map x).exists = \u00abexists\u00bb x`. The default view is that all instances of `\u03b1`\n      are necessary, such that (e.g.) `\u03a9.realism \u2115` correspond to the default view of realism about natural numbers \n      which take them to be necessary entities. -/\n  structure iontology.realism (\u03a9 : \u03c9.iontology) (\u03b1 : Type u) (\u00abexists\u00bb : \u03b1 \u2192 \u03c9.entity := \u03bb_, \u03c9.nbe) :=\n    (map : \u03b1 \u2192 \u03a9.ientity)\n    (h\u2080 : function.injective map)\n    (h\u2081 : \u2200 x, \u03a9.exists (map x) = \u00abexists\u00bb x)\n\n  /-- A *realization* of a position of **simplified realism about instances of type `\u03b1`**, \n      consists in an injective map associating every `x : \u03b1` to some intensional entity, `map x`. -/\n  structure iontology.srealism (\u03a9 : \u03c9.iontology) (\u03b1 : Type u) :=\n    (map : \u03b1 \u2192 \u03a9.ientity)\n    (h\u2080 : function.injective map)\n\n  -- simplified realism can be cast to regular realism:\n  def iontology.srealism.to_realism {\u03a9 : \u03c9.iontology} {\u03b1} (h : \u03a9.srealism \u03b1) :  \u03a9.realism \u03b1 (iontology.ientity.up \u2218 h.map) :=\n    by refine \u27e8h.map, h.h\u2080, _\u27e9; unfold_coes; simp [iontology.ientity.up, iontology.ientity.exists]\n\n  /-- A *realization* of the position of **extensional realism** is a realization of `\u03a9.realism \u03c9.entity id`.\n      In other words, it consists of an injective map taking extensional entities to intensional entities\n      which exist in the same possible worlds. It can be seem as associating to every equivalence class of intensional \n      entities a canonical representative which reifies the class itself and/or \n      the extensional entity corresponding to the class. The existence of a realization implies algebraic realism. -/\n  def iontology.erealism := \u03a9.realism \u03c9.entity id\n\n  /-- A *realization* of the position of **restricted extensional realism** for some class of entities `C`, \n      is a realization of `\u03a9.realism (subtype C) subtype.val`.\n      In other words, it consists of an injective map, defined in `C`, \n      taking extensional entities to intensional entities\n      which exist in the same possible worlds. It can be seem as associating to every equivalence class of intensional \n      entities represented by entities in `C`, a canonical representative which reifies \n      the class itself and/or the extensional entity corresponding to the class. \n      The existence of a realization implies realism about the `C`s. -/\n  def iontology.rerealism (C : set \u03c9.entity):= \u03a9.realism (subtype C) subtype.val\n\n  /-! Now, if a map of this sort is not injective, we can take the position in question to be a realization\n      of a position of **grounding** rather than a position of realism. Since however a position of grounding \n      is just a (possibly partial) function, we do not define a new structure for it. -/\n\n  /-! **Absolutely Real Entities**\n    \n      One important notion that will arise out of intensionality will be the property \n      of an entity being absolutely real, i.e. real regardless of the underlying intensional ontology used\n      to generate the ontological structure. This will allow us to think about intensional ontologies much \n      in the same way that geometers think about a choice of \"basis\", or \"chart\", so that we --like them-- \n      shall be most interested in proving only the results which do not depend on an arbitrary choice of\n      intensional ontology.\n\n  -/\n\n  /-- An `entity` is absolutely real if it is real regardless of the choice of iontology -/\n  def entity.absolutely_real : Prop := \u2200 \u03a9 : \u03c9.iontology, e.real \u03a9\n\nend realism\n\nsection algebraic_realism\n\n  variables (\u03a9 : \u03c9.iontology)\n\n  /-! **Algebraic Realism**\n\n    We shall name the theory which claims that all extensional entities are real **algebraic realism**,\n    and we can also prove that both this theory and its denial are logically consistent. \n    The theory is to be so called because it is realistic about the set theoretic constructions\n    of extensional entities (unions and intersections), which are algebraic constructions \n    in a complete Heyting algebra, or topological frame. \n    Because we are not committed to algebraic realism from the outset,\n    we intend our identification of existential events with extensional entities to be metaphysically neutral.\n\n  -/\n\n  /-- **Algebraic realism** for intensional ontologies claims that all \n  extensional entities are real.   \n  It is realist about the algebraic operations of topological frames. -/\n  class iontology.arealist : Prop :=\n    (postulate\u2080 : \u2200 e : \u03c9.entity, e.real \u03a9)\n  \n  /-! We prove below that every ontology admits a canonical algebraic realist iontology. \n      In order to do so, we first show that it is possible to construct an iontology out of\n      any subbasis, then we prove that for the default subbasis the generated iontology is\n      indeed `arealist`.\n  -/\n  \n  /-- The `iontology` generated by events in a subbasis. -/\n  def is_subbasis.intensionalize {B : set \u03c9.event} : is_subbasis B \u2192 \u03c9.iontology :=\n    \u03bb h, { ientity := subtype B\n         , iene := let \u27e8b, hb\u27e9 := h.ne in \u27e8\u27e8b, hb\u27e9\u27e9\n         , \u00abexists\u00bb := subtype.val\n         , axiom\u2081 := by simpa [range, subtype.val] \n         }\n\n  lemma natural_arealism : \u03c9.default_subbasis.intensionalize.arealist :=\n    begin\n      constructor, intro e,\n      use e; unfold_coes; simp [iontology.ientity.up],\n      change (e.exists = e.exists), refl,\n    end\n\nend algebraic_realism\n\n/-! **Final remarks about Intensionality**\n\n  Even though we are not assuming algebraic realism, our general intention is indeed to avoid talking about \n  intensional entities as most as possible. If we completely abstract away talk of intensional entities from\n  our system, we will be left simply with a topological space of possible worlds from which the distinction \n  between real and virtual entities cannot be defined. In order to define it we would at the very least have \n  to equip the space with an additional sub-basis to stand in for the events which are used to represent the\n  intensional entities we intend to abstract, and then claim that an entity is real only if it belong to the sub-basis.\n  As such, in order to make the distinction we would need to introduce this sub-basis as a new unwanted and \n  unneeded primitive concept to which our system would have to be committed. \n  In order to eschew this primitive, we must say that the distinction between real and virtual entities is,\n  for the most part, not really useful in our system, and we have introduced it,\n  along with the discussion of intensional entities, only in order to anticipate some \n  objections which might be leveled against our theory \n  (e.g. that it is committed to algebraic realism, or to an universal extensionality principle for the most \n  basic sort of possible entities). Because of this, in what follows we will simply be talking about \n  extensional entities and will pay no attention to whether they are real or virtual unless \n  it becomes important (and in general it won't be).\n\n-/\n\n-- additional auxiliary lemmas involving compact events and entities\nsection compact\n  -- It is annoying that mathlib doesn't export this\n  -- sort of lemma using sets of sets instead of set families.\n  lemma event.compact.elim {e : \u03c9.event} : e.compact \u2192 (\u2200 (S : set \u03c9.event), \n                                                         (\u2200 i \u2208 S, is_open i) \u2192\n                                                         e \u21d2 \u22c3\u2080 S \u2192\n                                                         \u2203 s : set \u03c9.event, s \u2286 S \u2227 finite s \u2227 e \u21d2 \u22c3\u2080 s)\n                                                         :=\n    begin\n      intros h S hS he,\n      have c :=  @compact.elim_finite_subcover_image _ _ _ e S id h hS,\n      specialize c _, swap,\n        intros w hw,\n        simp,\n        specialize he hw,\n        simp at he,\n        exact he,\n      simp at c,\n      obtain \u27e8s, h\u2081, h\u2082, h\u2083\u27e9 := c,\n      refine \u27e8s, h\u2081, h\u2082, _\u27e9,\n      intros w hw,\n      specialize h\u2083 hw,\n      simp at h\u2083,\n      simp,\n      exact h\u2083,\n    end\n\n  lemma entity.compact.elim {e : \u03c9.entity} : e.compact \u2192 (\u2200 {S : set \u03c9.entity}, S.nonempty \u2192\n                                                         e \u21d2 Sup S \u2192\n                                                         \u2203 s : set \u03c9.entity, s.nonempty \u2227 s \u2286 S \u2227 finite s \u2227 e \u21d2 Sup s)\n                                                         :=\n    begin\n      intros h S hS he,\n      simp [Sup, has_Sup.Sup, hS, entity_Sup, has_entailment.entails] at he,\n      have c := h.elim (entity.exists '' S),\n      specialize c _, swap,\n        intros i hi,\n        simp at hi,\n        obtain \u27e8x, _, hx\u27e9 := hi,\n        rw \u2190hx, exact x.existential,\n      specialize c _, swap,\n        simp [has_entailment.entails],\n        exact he,\n      obtain \u27e8s, hs\u2081, hs\u2082, hs\u2083\u27e9 := c,\n      have sne : s.nonempty,\n        simp [sUnion, set.subset] at hs\u2083,\n        obtain \u27e8w, hw\u27e9 := e.possible,\n        obtain \u27e8ev, hev,_\u27e9 := hs\u2083 hw,\n        exact \u27e8ev, hev\u27e9,\n      replace sne : {e : \u03c9.entity | e.exists \u2208 s}.nonempty,\n        obtain \u27e8ev, hev\u27e9 := sne,\n        have c := hs\u2081 hev, simp [image] at c,\n        obtain \u27e8e',_, he'\u27e9 := c,\n        rw \u2190he' at hev,\n        exact \u27e8e', hev\u27e9,\n      refine \u27e8{e | e.exists \u2208 s}, sne, _\u27e9,\n      constructor,\n        intros e' he', simp at he',\n        have c := hs\u2081 he', simp [image] at c,\n        obtain \u27e8e'', goal, eq\u27e9 := c,\n        replace eq := (entity_ext_iff e'' e').2 eq,\n        rwa \u2190eq,\n      constructor,\n        set S' := {e : \u03c9.entity | e.exists \u2208 s},\n        have c : entity.exists '' S' = s,\n          simp [image],\n          ext, constructor; intro hyp,\n            simp at hyp,\n            obtain \u27e8_, _, hyp\u27e9 := hyp,\n            rwa \u2190hyp,\n          simp,\n          have c := hs\u2081 hyp, simp [image] at c,\n          obtain \u27e8e', _, eq\u27e9 := c,\n          rw \u2190eq at hyp,\n          exact \u27e8e', hyp, eq\u27e9,\n        have c\u2081 := entity_exists_inj.inj_on S',\n        apply finite_of_finite_image c\u2081,\n        rwa c,\n      simp [Sup, has_Sup.Sup, sne, entity_Sup, has_entailment.entails, set.subset],\n      simp [has_entailment.entails, sUnion, set.subset] at hs\u2083,\n      intros w hw,\n      obtain \u27e8ev, hev\u2081,hev\u2082\u27e9 := hs\u2083 hw,\n      specialize hs\u2081 hev\u2081, simp [image] at hs\u2081,\n      obtain \u27e8e', aux, he'\u27e9 := hs\u2081, clear aux,\n      rw \u2190he' at hev\u2081,  \n      rw \u2190he' at hev\u2082,\n      exact \u27e8e', hev\u2081, hev\u2082\u27e9,\n    end\n\nend compact\n\nend ontology\n\n", "meta": {"author": "maxd13", "repo": "topological_ontology", "sha": "68d21c9a00024fba3aed301e16c31e05733c1786", "save_path": "github-repos/lean/maxd13-topological_ontology", "path": "github-repos/lean/maxd13-topological_ontology/topological_ontology-68d21c9a00024fba3aed301e16c31e05733c1786/src/ontology.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5389832206876841, "lm_q2_score": 0.3073580105206753, "lm_q1q2_score": 0.16566081041459266}}
{"text": "import for_mathlib.short_exact_sequence\n\nnoncomputable theory\n\nopen category_theory\nopen category_theory.limits\n\nuniverses v u\n\nnamespace category_theory\nvariables (\ud835\udc9e : Type u) [category.{v} \ud835\udc9e]\nvariables {C : Type u} [category.{v} C] {D : Type*} [category D]\nvariables [has_images C] [has_zero_morphisms C] [has_kernels C]\nvariables [has_images D] [has_zero_morphisms D] [has_kernels D]\n\n/-- Cohomological covariant delta functor. -/\nclass delta_functor (F : \u2115 \u2192 C \u2964 D) :=\n(\u03b4 : \u03a0 (n : \u2115), short_exact_sequence.Trd C \u22d9 (F n) \u27f6 short_exact_sequence.Fst C \u22d9 (F (n+1)))\n(mono : \u2200 (A : short_exact_sequence C), mono ((F 0).map A.f))\n(exact' : \u2200 (n : \u2115) (A : short_exact_sequence C), exact ((F n).map A.f) ((F n).map A.g))\n(exact_\u03b4 : \u2200 (n : \u2115) (A : short_exact_sequence C), exact ((F n).map A.g) ((\u03b4 n).app A))\n(\u03b4_exact : \u2200 (n : \u2115) (A : short_exact_sequence C), exact ((\u03b4 n).app A) ((F (n+1)).map A.f))\n\nnamespace delta_functor\n\nvariables {\ud835\udc9c : Type*} [category \ud835\udc9c] [abelian \ud835\udc9c]\nvariables (F : \u2115 \u2192 C \u2964 \ud835\udc9c) [delta_functor F]\n\nexample (A : short_exact_sequence C)\n  (hA\u2082 : \u2200 i, 0 < i \u2192 is_zero ((F i).obj A.2)) (hA\u2083 : \u2200 i, 0 < i \u2192 is_zero ((F i).obj A.3))\n  (i : \u2115) (hi : 1 < i) :\n  is_zero ((F i).obj A.1) :=\nbegin\n  obtain \u27e8i, rfl\u27e9 : \u2203 k, i = k + 2, { simpa only [add_comm] using nat.exists_eq_add_of_le hi },\n  refine is_zero_of_exact_zero_zero' _ _ (delta_functor.\u03b4_exact (i+1) A) _ _,\n  { exact (hA\u2083 (i+1) i.succ_pos).eq_of_src _ _ },\n  { refine (hA\u2082 (i+2) _).eq_of_tgt _ _, exact pos_of_gt hi }\nend\n\nend delta_functor\n\nend category_theory\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/backup/delta_functor.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.519521321952093, "lm_q2_score": 0.3174262785020255, "lm_q1q2_score": 0.1649097198297055}}
{"text": "import doubleround\nimport littleendian\n\nimport category_theory.category.basic\nimport category_theory.core\n\nopen doubleround\nopen littleendian\nopen operations\nopen params\nopen utils\n\nopen category_theory\n\nnamespace core\n\nvariable [category (bitvec word_len)]\n\n/-!\n  # Core\n\n  - The `doubleround10` function and its inverse.\n  - The `hash` and `core` functions, the non existing inverse.\n-/\n\n/-- Apply double round 10 times to a reduced input. -/\n@[simp] def doubleround_10 (X : matrixType): matrixType :=\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  doubleround_salsa20 $\n  X\n\n/-- Inverse of `doubleround_10`. -/\n@[simp] def doubleround_10_inv (X : matrixType): matrixType :=\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  doubleround_salsa20_inv $\n  X\n\n/- Just some notation for inverses. -/\nlocal notation `doubleround_10\u207b\u00b9` := doubleround_10_inv\n\n/-- The `doubleround` function is invertible. -/\nlemma doubleround_is_inv (I : doubleround_10 \u2245 doubleround_10\u207b\u00b9) : I.hom \u226b I.inv = \ud835\udfd9 doubleround_10 :=\n  by rw [iso.hom_inv_id]\n\n/-!\n## Core and hash definitions\n\n  - There is no isomorphism (\u2245) between `core` and any `core\u207b\u00b9`.\n  - There is no isomorphism (\u2245) between `hash` and any `hash\u207b\u00b9` because the use of `core` and `core\u207b\u00b9`.\n-/\n\n/-- Do addition modulo 2^32 of the reduced input and the doubleround of the reduced input. -/\n@[simp] def core (X : matrixType) : matrixType := mod_matrix (doubleround_10 X) X\n\n/-- Do the hash. -/\ndef hash (X : matrix64Type) : matrix64Type := aument (core (reduce X))\n\n\nend core\n", "meta": {"author": "oxarbitrage", "repo": "salsa20", "sha": "12d0ebb3c27801931e61d470fb2ed548a5562578", "save_path": "github-repos/lean/oxarbitrage-salsa20", "path": "github-repos/lean/oxarbitrage-salsa20/salsa20-12d0ebb3c27801931e61d470fb2ed548a5562578/src/core.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5273165085228825, "lm_q2_score": 0.3106943895971202, "lm_q1q2_score": 0.16383428074000161}}
{"text": "import data.real.irrational\nimport topology.basic\nimport algebra.order.floor\n\n\n--OUTPUT 1\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : (\u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)), from sorry,\n  have h2 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1)), from sorry,\n  have h3 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 0), from sorry,\n  have h4 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 1), from sorry,\n  have h5 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 ({0} \u222a {1})), from sorry,\n  have h6 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ ({0} \u222a {1})), from sorry,\n  have h7 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -1) \u222a (1, \u221e)), from sorry,\n  have h8 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -1), from sorry,\n  have h9 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 2), from sorry,\n  have h10 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 ({-1} \u222a {2})), from sorry,\n  have h11 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ ({-1} \u222a {2})), from sorry,\n  have h12 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -2) \u222a (2, \u221e)), from sorry,\n  have h13 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -2), from sorry,\n  have h14 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 3), from sorry,\n  have h15 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 ({-2} \u222a {3})), from sorry,\n  have h16 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ ({-2} \u222a {3})), from sorry,\n  have h17 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -3) \u222a (3, \u221e)), from sorry,\n  have h18 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -3), from sorry,\n  have h19 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 4), from sorry,\n  have h20 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 ({-3} \u222a {4})), from sorry,\n  have h21 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ ({-3} \u222a {4})), from sorry,\n  have h22 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -4) \u222a (4, \u221e)), from sorry,\n  have h23 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -4), from sorry,\n  have h24 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 5), from sorry,\n  have h25 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 ({-4} \u222a {5})), from sorry,\n  have h26 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ ({-4} \u222a {5})), from sorry,\n  have h27 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -5) \u222a (5, \u221e)), from sorry,\n  have h28 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -5), from sorry,\n  have h29 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 {-5}), from sorry,\n  have h30 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ {-5}), from sorry,\n  have h31 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -5) \u222a (5, \u221e)), from sorry,\n  have h32 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -6), from sorry,\n  have h33 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 {-6}), from sorry,\n  have h34 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ {-6}), from sorry,\n  have h35 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -6) \u222a (6, \u221e)), from sorry,\n  have h36 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -7), from sorry,\n  have h37 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 {-7}), from sorry,\n  have h38 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ {-7}), from sorry,\n  have h39 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -7) \u222a (7, \u221e)), from sorry,\n  have h40 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -8), from sorry,\n  have h41 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 {-8}), from sorry,\n  have h42 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ {-8}), from sorry,\n  have h43 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -8) \u222a (8, \u221e)), from sorry,\n  have h44 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -9), from sorry,\n  have h45 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 {-9}), from sorry,\n  have h46 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (set.Icc 0 1) \\ {-9}), from sorry,\n  have h47 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2208 (-\u221e, -9) \u222a (9, \u221e)), from sorry,\n  have h48 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2260 -10), from sorry,\n  have h49 : (\u2200 (i : \u2124), int.fract (\u03b1 * \u2191i) \u2209 {-10}), from sorry,\n  have h50 : (\u2200 (i : \u2124), int.fract\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  sorry\nend\n\n--OUTPUT 3\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), \n  from sorry,  \n  \n  have S := {x : \u211d | \u2203 (i : \u2124), x = int.fract (\u03b1 * \u2191i)},\n  have h2 : S \u2286 set.Icc 0 1, \n  from sorry,\n  have h3 : \u2200 (x : \u211d), x \u2208 S \u2192 x \u2208 closure S, from sorry,\n  have h4 : S \u2286 closure S, from sorry,\n  \n  have h5 : closure S \u2286 set.Icc 0 1, from sorry,\n  \n  have h6 : set.Icc 0 1 \u2286 closure S, from \n    assume x,\n    assume h6 : x \u2208 set.Icc 0 1,\n    assume \u03b5 : \u211d,\n    assume h7 : \u03b5 > 0,\n    cases set.mem_Icc.mp h6 with h6 h6,\n    let x := (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)),\n    \n    \n    \n    \n    cases set.mem_Icc.mp h6 with h6 h6,\n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \nend\n\n--OUTPUT 4\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : (\u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from begin\n    assume (i j : \u2124),\n    assume h1 : (i \u2260 j),\n    assume h2 : int.fract (\u03b1 * \u2191i) = int.fract (\u03b1 * \u2191j),\n    calc \u03b1 = (\u2191(int.fract (\u03b1 * \u2191i)) + \u2191(int.floor (\u03b1 * \u2191i))) * 1 : by sorry\n    ... = (int.fract (\u03b1 * \u2191i) + int.floor (\u03b1 * \u2191i)) * (1 : \u211d) : by sorry\n    ... =  int.fract (\u03b1 * \u2191i) + int.floor (\u03b1 * \u2191i) : by rw mul_one\n    ... =  int.fract (\u03b1 * \u2191i) + int.floor (\u03b1 * \u2191j) : by rw h2\n    ... =  int.fract (\u03b1 * \u2191i) + int.fract (\u03b1 * \u2191j) + int.floor (\u03b1 * \u2191j) - int.fract (\u03b1 * \u2191j) : by rw nat.add_sub_cancel -- this is not a valid line\n    ... =  int.fract (\u03b1 * \u2191i) + int.fract (\u03b1 * \u2191j) + (\u03b1 * \u2191j) - int.fract (\u03b1 * \u2191j) : by rw int.floor_eq\n    ... =  int.fract (\u03b1 * \u2191i) + int.fract (\u03b1 * \u2191j) + (\u03b1 * \u2191j) - int.fract (\u03b1 * \u2191i) : by rw h2\n    ... =  int.fract (\u03b1 * \u2191i) + (1 : \u211d) * (\u03b1 * \u2191j) - int.fract (\u03b1 * \u2191i) : by rw int.fract_eq\n    ... =  int.fract (\u03b1 * \u2191i) + \u03b1 * \u2191j - int.fract (\u03b1 * \u2191i) : by rw mul_one\n    ... =  \u03b1 * \u2191j + int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191i) : by rw add_comm\n    ... =  \u03b1 * \u2191j : by rw nat.add_sub_cancel\n    ... =  \u2191j * \u03b1 : by rw mul_comm\n    ... =  \u2191j * (\u03b1 : \u211d) : by rw mul_comm\n    ... =  \u2191j * \u2191i : by rw int.fract_eq\n    ... =  \u2191i * \u2191j : by rw mul_comm\n    ... =  \u2191i * \u03b1 : by rw h2\n    ... =  (\u03b1 : \u211d) * \u2191i : by rw mul_comm\n    ... =  \u03b1 : by rw int.fract_eq\n    ... \u2208 \u211a : by sorry,\n    show false, from sorry,\n  end,\n\n  have set_S : (set.univ : set \u2124) = set.Iio 0, \n  from sorry, --this is no a valid line\n\n  have h2 : (\u03bb m : \u2124, (int.fract (\u03b1 * m))) '' (set.Iio 0) = (\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (set.univ : set \u2124),\n  from sorry, --this is no a valid line\n\n  have h3 : (\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (set.univ : set \u2124) = (\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' set.univ,\n  from sorry, --this is no a valid line\n\n  have h4 : \u2200 (i : \u2115), \u2203 (x : \u211d), x \u2208 (\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (set.univ : set \u2124),\n  from sorry, --this is no a valid line\n\n  have h5 : \u2200 (i : \u2115), \u2203 (x : \u211d), x \u2208 (\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' set.univ,\n  from sorry, --this is no a valid line\n\n  have h6 : \u2200 (i : \u2115), \u2203 m, m \u2208 set.univ \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h7 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h8 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h9 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h10 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h11 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h12 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h13 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h14 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h15 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h16 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h17 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h18 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h19 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h20 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h21 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h22 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h23 : \u2200 i : \u2115, \u2203 m, m \u2208 set.Iio 0 \u2227 (int.fract (\u03b1 * \u2191m) = i),\n  from sorry, --this is no a valid line\n\n  have h24 :\nend --Needs more than 2000 tokens!\n\n--OUTPUT 5\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i \u2260 (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j,\n  {\n    intros i j h12,\n    assume h13 : (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i = (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j,\n    have h14 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = int.fract (\u03b1 * \u2191i), \n    from sorry,\n    have h15 : (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)) = int.fract (\u03b1 * \u2191i), \n    from sorry,\n    have h16 : (\u03b1 * \u2191i)  = \u03b1 * \u2191i - (int.floor (\u03b1 * \u2191i)) + (int.floor (\u03b1 * \u2191i)), \n    from sorry,\n    have h17 : (\u03b1 * \u2191j)  = \u03b1 * \u2191j - (int.floor (\u03b1 * \u2191j)) + (int.floor (\u03b1 * \u2191j)), \n    from sorry,\n    have h18 : \u03b1 = (int.floor (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191j)))/(i - j), \n    begin\n      calc \u03b1 = (\u03b1 * \u2191i - (int.floor (\u03b1 * \u2191i)))/(i - j) : by sorry\n      ... = ((\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) + (int.floor (\u03b1 * \u2191i)))/(i - j) : by sorry\n      ... = ((\u03b1 * \u2191i) + (int.floor (\u03b1 * \u2191i)) - (int.floor (\u03b1 * \u2191i)))/(i - j) : by sorry\n      ... = ((\u03b1 * \u2191i) + (int.floor (\u03b1 * \u2191i)) - (int.floor (\u03b1 * \u2191j)) - (int.floor (\u03b1 * \u2191i)) + (int.floor (\u03b1 * \u2191j)))/(i - j) : by sorry\n      ... = ((\u03b1 * \u2191i) + (int.floor (\u03b1 * \u2191j)) - (int.floor (\u03b1 * \u2191i)) + (int.floor (\u03b1 * \u2191j)) - (int.floor (\u03b1 * \u2191i)))/(i - j) : by sorry\n      ... = ((\u03b1 * \u2191j) + (int.floor (\u03b1 * \u2191j)) - (int.floor (\u03b1 * \u2191i)))/(i - j) : sorry\n      ... = ((\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)) + (int.floor (\u03b1 * \u2191j)))/(i - j) : by sorry\n      ... = (\u03b1 * \u2191j - (int.floor (\u03b1 * \u2191j)))/(i - j) : by sorry\n      ... = \u03b1 : sorry,\n    end,\n    show false, from h\u03b1_irrat h18,\n  },\n  \n  have h2 : \u2200 i j : \u2124, ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i = (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j) \u2194 (i = j), \n  from sorry,\n  \n  have h3 : \u2200 i j : \u2124, i \u2260 j \u2192 ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i \u2260 (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j) \u2194 (i \u2260 j),\n  from sorry,\n  \n  have h4 : \u2200 i j : \u2124, ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i = (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j) \u2194 (i = j) \u2194 ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i \u2260 (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j) \u2194 (i \u2260 j), \n  from sorry,\n  \n  have h5 : equiv.set ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) := sorry,\n  \n  have h6 : inj ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) : \u2124 \u2192 (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) := sorry,\n  \n  have h7 : \u2200 i j : \u2124, ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i = (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j) \u2194 (i = j),\n  from sorry,\n  \n  have h8 : setoid ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) := sorry,\n  \n  have h9 : \u2200 i j : \u2124, pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i \u2194 pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j \u2192 i = j,\n  from sorry,\n  \n  have h10 : \u2200 i j : \u2124, pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i \u2194 pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j \u2194 i = j,\n  from sorry,\n  \n  have h11 : decidable_eq ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) := sorry,\n  \n  have h12 : fintype ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) := sorry,\n  \n  have h13 : unique ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) := sorry,\n  \n  have h14 : \u00ac(\u2203 i : \u2124, (\u2200 (j : \u2124), pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) i \u2194 pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j)) := \n  begin\n    assume h14,\n    have h15 : \u2200 j : \u2124, pfinset.finset.mem (@set.univ \u2124) j \u2194 pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) j,\n    from sorry,\n    \n    have h16 : \u2200 j : \u2124, j \u2208 (@set.univ \u2124) \u2194  pfinset.finset.mem ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) (\u03bb (m :\nend --Needs more than 2000 tokens!\n\n--OUTPUT 6\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * i) \u2260 int.fract (\u03b1 * j)), from sorry,\n  have h2 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (\u03b1 * i \u2260 \u03b1 * j), from sorry,\n  \n  have h3 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (i * \u03b1 \u2260 j * \u03b1),\n  from sorry,\n\n  have h4 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (i * \u03b1 - (i * \u03b1).floor \u2260 j * \u03b1 - (j * \u03b1).floor), \n  from sorry,\n\n  have h5 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (i * \u03b1 - (i * \u03b1).floor \u2260 j * \u03b1 - (j * \u03b1).floor), \n  from sorry,\n\n  have h6 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (i * \u03b1 - (i * \u03b1).floor \u2260 j * \u03b1 - (j * \u03b1).floor), \n  from sorry,\n\n  have h7 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) \u2260 0, \n  from sorry,\n  \n  have h8 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) > 0, \n  from sorry,\n  \n  have h9 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) < 1, \n  from sorry,\n  \n  have h10 : \u2200 i : \u2124, i * \u03b1 \u2260 0, \n  from sorry,\n  \n  have h11 : \u2200 i : \u2124, i * \u03b1 \u2260 1, \n  from sorry,\n  \n  have h12 : \u2200 i : \u2124, i * \u03b1 - (i * \u03b1).floor \u2260 0, \n  from sorry,\n  \n  have h13 : \u2200 i : \u2124, i * \u03b1 - (i * \u03b1).floor \u2260 1, \n  from sorry,\n  \n  have h14 : \u2200 i : \u2124, i * \u03b1 \u2260 0, \n  from sorry,\n  \n  have h15 : \u2200 i : \u2124, i * \u03b1 \u2260 1, \n  from sorry,\n\n  have h16 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) \u2260 0, \n  from sorry,\n  \n  have h17 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) \u2260 1, \n  from sorry,\n  \n  have h18 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) \u2260 0, \n  from sorry,\n  \n  have h19 : \u2200 i : \u2124, (i * \u03b1 - (i * \u03b1).floor) \u2260 1, \n  from sorry,\n  \n  have h20 : \u2200 x : \u2124, (\u2200 i : \u2124, i * \u03b1 - (i * \u03b1).floor \u2260 x) \u2192 (x < 0) \u2228 (x > 1)\n  := assume (x : \u2124) (h20 : \u2200 i : \u2124, i * \u03b1 - (i * \u03b1).floor \u2260 x), \n  begin\n    have h21 : \u2200 i : \u2124,  ((i * \u03b1 - (i * \u03b1).floor \u2260 x) \u2227 (i * \u03b1 - (i * \u03b1).floor \u2260 0))\n    := assume (i : \u2124), \u27e8h20 i, h18 i\u27e9,\n    have h22 : \u2200 i : \u2124,  ((i * \u03b1 - (i * \u03b1).floor \u2260 x) \u2227 (i * \u03b1 - (i * \u03b1).floor \u2260 1))\n    := assume (i : \u2124), \u27e8h20 i, h17 i\u27e9,\n\n    have h23 : \u2200 i : \u2124,  ((i * \u03b1 - (i * \u03b1).floor \u2260 x) \u2227 (i * \u03b1 - (i * \u03b1).floor \u2260 0) \u2227 (i * \u03b1 - (i * \u03b1).floor \u2260 1))\n    := assume (i : \u2124), and.intro (h21 i) (h22 i),\n\n    have h24 : \u2200 i : \u2124, (x < i * \u03b1 - (i * \u03b1).floor) \u2228 (x > i * \u03b1 - (i * \u03b1).floor)\n    := assume (i : \u2124), lt_or_gt_of_ne (h20 i),\n\n    have h25 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h26 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n\n    have h27 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h28 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n\n    have h29 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h30 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n    \n    have h31 : ((x < 0) \u2228 (0 < x))\n    := sorry,\n\n    have h32 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h33 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n\n    have h34 : ((x < 0) \u2228 (0 < x))\n    := sorry,\n\n    have h35 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h36 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n\n    have h37 : ((x < 0) \u2228 (0 < x))\n    := sorry,\n\n    have h38 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h39 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n\n    have h40 : ((x < 0) \u2228 (0 < x))\n    := sorry,\n\n    have h41 : \u2200 i : \u2124, ((x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x))\n    := assume (i : \u2124), sorry,\n\n    have h42 : \u2200 i : \u2124, ((x < 0) \u2228 (0 < x))\n    := assume (i : \u2124), sorry,\n\n    have h43 : ((x < 0) \u2228 (0 < x))\n    := sorry,\n\n    have h44 : \u2200 i : \u2124, (x < i * \u03b1 - (i * \u03b1).floor) \u2228 (i * \u03b1 - (i * \u03b1).floor < x)\n    := assume (i : \u2124), sorry,\n\n    have h45 : \u2200 i : \u2124, (x < 0) \u2228 (0 < x)\n    := assume (i\nend --Needs more than 2000 tokens!\n\n--OUTPUT 7\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 := begin\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from \n  begin\n    assume (i j : \u2124) (h3 : i \u2260 j),\n    assume (h4 : int.fract (\u03b1 * \u2191i) = int.fract (\u03b1 * \u2191j)),\n    have h5 : \u03b1 = (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j))/(i - j), by simp [h4],\n    exact h\u03b1_irrat h5,\n  end,\n\n  let S : set \u211d := {int.fract (\u03b1 * \u2191i) | i : \u2124},\n\n  have h6 : irrational \u03b1, from h\u03b1_irrat,\n  have h7 : S.finite = ff, from set.finite_iff.mpr sorry,\n  \n  have h8 : \u2200 x : \u211d, (\u2203 (x' : S), x' \u2264 x) \u2228 (\u2203 (x' : S), x \u2264 x') := \n  begin\n    assume (x : \u211d),\n    --split\n    cases classical.em (\u2203 (x' : S), x' \u2264 x) with hh hh,\n      {left,\n        exact hh\n      },\n    {right,\n      exact show \u2203 (x' : S), x \u2264 x',\n        from sorry,\n    },\n  end,\n\n  have h9 : (\u2200 (x : S), \u2200 (n : \u2115), 0 < n \u2192 int.fract (\u2191n * x) < 1)\n  \u2227 (\u2200 (x : S), \u2200 (n : \u2115), n < 0 \u2192 0 < int.fract (\u2191n * x))  := sorry,\n  \n  set_option trace.class_instances true,\n  have h10 : S.finite = ff, from set.finite_iff.mpr (sorry),\n  have h11 : \u00ac (S.finite \u2227 \u00ac \u2203 x : S, \u2200 y : S, \u00ac x \u2264 y \u2227 \u00ac y \u2264 x), from sorry,\n  set_option trace.class_instances false,\n\n  have h12 : \u00ac \u2203 x : S, \u2200 y : S, \u00ac x \u2264 y \u2227 \u00ac y \u2264 x, from sorry,\n  have h13 : \u2203 x : S, \u2200 y : S, y < x \u2228 x < y, from sorry,\n\n  have h14 : \u2203 y : S, \u2200 x : S, y < x \u2228 x < y, from sorry,\n\n  let y := classical.some h14, let m := classical.some sorry,\n\n  have h15 : (\u2200 x : S, x < y \u2228 y < x) \u2227 \u2203 m, y = classical.some (sorry), from sorry,\n  \n  have h16 : \u2200 (m n : \u2115), int.fract (m * \u2191y) < int.fract (n * \u2191y) \u2228 int.fract (n * \u2191y) < int.fract (m * \u2191y), \n  from sorry,\n\n  have h17 : \u2203 m, \u2200 n, \u2203 p, m \u2264 p \u2227 p \u2264 n \u2227 (int.fract (p * \u2191y) \u2264 1/2) \u2227 (\u03a0 y, int.fract (p * \u2191y) \u2264 1/2 \u2192 n \u2264 p),\n  from sorry,\n\n  have h18 : \u2203 m, \u2200 n, \u2203 p, m \u2264 p \u2227 p \u2264 n \u2227 (int.fract (p * \u2191y) \u2264 1/2) \n  \u2227 (\u03a0 y, int.fract (p * \u2191y) \u2264 1/2 \u2192 p \u2264 n), from sorry,\n\n  have h19 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h20 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 p \u2264 m \u2227 m \u2264 p,\n  from sorry,\n  \n  have h21 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 p \u2264 m,\n  from sorry,\n\n  have h22 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 p \u2264 n \u2227 m \u2264 p,\n  from sorry,\n\n  have h23 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h24 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h25 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h26 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h27 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h28 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h29 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h30 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from sorry,\n\n  have h31 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int.fract (p * \u2191y) \u2264 1/2 \u2192 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 m \u2264 p \u2227 p \u2264 n,\n  from h30,\n  \n  have h32 : \u2203 m, \u2200 n, \u2203 p, int.fract (p * \u2191y) \u2264 1/2 \u2227 int\nend --Needs more than 2000 tokens!\n\n--OUTPUT 8\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : (\u2203 m : \u2124, 0 < m) \u2192 (\u2203 m : \u2124, m < 0), from sorry,\n  have h2 : irrational \u03b1 \u2192 \u2200 m : \u2124, \u2200 n : \u2124, m \u2260 n \u2192 int.fract (\u03b1 * \u2191m) \u2260 int.fract (\u03b1 * \u2191n), from sorry,\n  have h3 : ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) \u2208 closure (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m) '' (@set.univ \u2124)), from sorry,\n  have h4 : closure (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m) '' (@set.univ \u2124)) \u2286 closure (set.Icc 0 1), from sorry,\n  have h5 : closure (set.Icc 0 1) \u2286 closure (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m) '' (@set.univ \u2124)), from sorry,\n  show closure (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m) '' (@set.univ \u2124)) = set.Icc 0 1, from sorry,\nend\n\n--OUTPUT 9\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 := \nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 \n    int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from sorry,\n\n  have h2 : \u2200 i, i \u2208 @set.univ \u2124 \u2192 int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1,\n  from sorry,\n\n  show closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1,\n  from sorry,\nend\n\n--OUTPUT 10\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h0 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), {\n    assume i j h1,\n    have h2 : (\u03b1 * \u2191i - (\u03b1 * \u2191i).floor) = (\u03b1 * \u2191j - (\u03b1 * \u2191j).floor), {\n      rw int.fract_eq_sub_floor,\n    },\n    have h3 : \u03b1 = ((((\u03b1 * \u2191i).floor : \u211d) - ((\u03b1 * \u2191j).floor : \u211d)) / (i - j)), {\n      rw h2,\n      field_simp,\n    },\n    have h4 : irrational \u03b1, {\n      exact h\u03b1_irrat,\n    },\n    have h5 : irrational (((((\u03b1 * \u2191i).floor) - ((\u03b1 * \u2191j).floor)) / (i - j)) : \u211d), {\n      rw \u2190 h3,\n      exact h4,\n    },\n    have h6 : (((((\u03b1 * \u2191i).floor) - ((\u03b1 * \u2191j).floor)) / (i - j)) : \u211d) \u2209 (@set.univ \u211a), {\n      have h7 : \u211a \u2209 {r : \u211d | irrational r}, {\n        exact (irrational_of_rat_of_irrational_of_ne_bot \u211a),\n      },\n      assumption,\n    },\n    have h8 : (((((\u03b1 * \u2191i).floor) - ((\u03b1 * \u2191j).floor)) / (i - j)) : \u211d) \u2209 set.univ, {\n      rw \u2190 (@set.mem_univ \u211d _),\n      exact h6,\n    },\n    have h9 : (((((\u03b1 * \u2191i).floor) - ((\u03b1 * \u2191j).floor)) / (i - j)) : \u211d) \u2209 set.range ((\u03bb (m : \u2124), (\u03b1 * \u2191m) - (\u03b1 * \u2191m).floor) : \u2124 \u2192 \u211d), {\n      sorry,\n    },\n    have h10 : (((((\u03b1 * \u2191i).floor) - ((\u03b1 * \u2191j).floor)) / (i - j)) : \u211d) \u2209 set.univ, {\n      rw \u2190 (@set.mem_univ \u211d _),\n      exact h9,\n    },\n    exact h10,\n  },\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2209 (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124), {\n    assume i j h2,\n    have h3 : {m : \u2124 | (int.fract (\u03b1 * \u2191m)) = (int.fract (\u03b1 * \u2191i))} \u2286 {m : \u2124 | m = i}, { \n      assume x h4,\n      have h5 : int.fract (\u03b1 * \u2191x) = int.fract (\u03b1 * \u2191i), {\n        exact h4,\n      },\n      have h6 : (int.fract (\u03b1 * \u2191x - \u03b1 * \u2191i)) = 0, {\n        rw \u2190 h5,\n        field_simp,\n      },\n      rw int.fract_eq_sub_floor at h6,\n      have h7 : int.fract (\u03b1 * \u2191x) = int.fract (\u03b1 * \u2191x - \u03b1 * \u2191i), {\n        exact h6,\n      },\n      rw h7 at h5,\n      have h8 : (int.fract (\u2191x * \u03b1 - \u2191i * \u03b1)) = (int.fract (\u03b1 * \u2191x - \u03b1 * \u2191i)), {\n        have h9 : int.fract (\u2191x * \u03b1) = int.fract (\u03b1 * \u2191x),\n        begin\n          field_simp,\n        end,\n        have h10 : int.fract (\u2191i * \u03b1) = int.fract (\u03b1 * \u2191i), {\n          field_simp,\n        },\n        rw h9 at h5,\n        rw h10 at h5,\n        exact h5,\n      },\n      have h11 : (int.fract (\u2191x * \u03b1 - \u2191i * \u03b1)) = 0, {\n        exact h8,\n      },\n      have h12 : (int.fract (\u2191x * \u03b1 - \u2191i * \u03b1)) \u2208 {r : \u211d | r = 0}, {\n        exact h11,\n      },\n      have h13 : int.fract (\u2191x * \u03b1 - \u2191i * \u03b1) = 0, {\n        have h14 : int.fract (\u2191x * \u03b1 - \u2191i * \u03b1) \u2208 {r : \u211d | r = 0}, {\n          exact h11,\n        },\n        rw \u2190 (@set.mem_univ \u211d _),\n        assumption,\n      },\n      rw h13 at h4,\n      have h15 : \u2191x * \u03b1 - \u2191i * \u03b1 = 0, {\n        field_simp,\n      },\n      have h16 : \u2191x = \u2191i, {\n        rw \u2190 @set.mem_univ \u2124 _ at h4,\n        have h17 : \u2191x * \u03b1 - \u2191i * \u03b1 = (\u2191x - \u2191i) * \u03b1, {\n          ring,\n        },\n        rw h17 at h15,\n        have h18 : (\u2191x - \u2191i) * \u03b1 = 0, {\n          exact h15,\n        },\n        have h19 : \u2191x - \u2191i = 0, {\n          have h20 : \u03b1 \u2260 0, {\n            have h21 : \u00ac (\u03b1 = 0), {\n              have h22 : irrational \u03b1, {\n                exact h\u03b1_irrat,\n              },\n              have h23 : \u00ac (\u03b1 = 0), {\n                have h24 : \u03b1 \u2208 (@set.univ \u211d), {\n                  exact set.mem_univ \u03b1,\n                },\n                have h25 : \u03b1 \u2209 ({r : \u211d | rational r}), {\n                  rw set.mem_compl,\n                  exact h22,\n                },\n                exact h25,\n              },\n              exact h23,\n            },\n            exact h21,\n          },\n          field_simp,\n        },\n        exact h19,\n      },\n      have h17 : x = i, {\n        exact h16,\n      },\n      exact h17,\n    },\n    have h18 : {m : \u2124 | (int.fract (\u03b1 * \u2191m)) = (int.fract (\u03b1 * \u2191i))} \u2286 {i}, {\n      have h19 : {m : \u2124 | (int.fract (\u03b1 * \u2191m)) = (int.fract (\u03b1 * \u2191i))} \u2286 {m : \u2124 | m = i}, {\n        exact h3,\n      },\n      exact h19,\n    },\n    have h20 : {m : \u2124 | (int.fract (\u03b1 * \u2191m)) = (int.fract (\u03b1 * \u2191i))} \u2286 {i}, {\n      have h21 : {m : \u2124 | (int.fract (\u03b1 * \u2191m)) = (int.fract (\u03b1 * \u2191i))} \u2286 {i}, {\n        exact h3,\n      },\n      exact h21,\n    },\n    have h22 : {m : \u2124 | m = i} \u2286 (\u03bb (m : \u2124), (int.fract (\u03b1 * \u2191m))), {\n      assume x h23,\n      have h24 : x = i, {\n        exact h23,\n      },\n      have h25 : int.fract (\u03b1 * \u2191x) = int.fract (\u03b1 * \u2191i), {\n        have h26 : \u03b1 \u2260 0, {\n          have h27 : \u03b1 \u2208 @set.univ \u211d, {\n            exact set.mem_univ \u03b1,\n          },\n          have h28 : \u03b1 \u2209 ({r : \u211d | rational r} : set \u211d), {\n            rw set.mem_compl,\n            exact h\u03b1_irrat,\n          },\n          exact h28,\n        },\n        have h29 : int.fract (\u03b1 * \u2191x - \u03b1 * \u2191i) = 0\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from sorry,\n  have h2 : (A \u2229 B) \u2286 A, from sorry,\n  have h3 : (A \u2229 B) \u2286 S, from sorry,\n  show (A \u2229 B) \u2208  \ud835\udcab S, from sorry,\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by sorry\n  ... = x*(x+y) + y*(x+y) : by sorry\n  ... = x*x + x*y + y*x + y*y : by sorry\n  ... = x^2 + 2*x*y + y^2 : by sorry,\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from sorry,\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from sorry,\n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from sorry,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from sorry,\n\n  have h5 : \u2200 a : G, classical.some (h3 a) = (1 : G), from sorry,\n  have h6 : \u2200 a : G, classical.some (h4 a) = (1 : G), from sorry,\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (h7 : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a), from sorry,\n      have h9 : \u2200 a : G, e = classical.some (h4 a), from sorry,\n      show e = (1 : G), from sorry,     \n    },\n    sorry,\n  }\nend\n\n/--`theorem`\nSqueeze Theorem for Real Numbers\nLet $\\sequence {x_n}$, $\\sequence {y_n}$ and $\\sequence {z_n}$ be sequences in $\\R$.\n\nLet $\\sequence {y_n}$ and $\\sequence {z_n}$ both be convergent to the following limit:\n:$\\ds \\lim_{n \\mathop \\to \\infty} y_n = l, \\lim_{n \\mathop \\to \\infty} z_n = l$\n\nSuppose that:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\n\nThen:\n:$x_n \\to l$ as $n \\to \\infty$\nthat is:\n:$\\ds \\lim_{n \\mathop \\to \\infty} x_n = l$\n\n`proof`\nFrom Negative of Absolute Value:\n:$\\size {x - l} < \\epsilon \\iff l - \\epsilon < x < l + \\epsilon$\n\nLet $\\epsilon > 0$.\n\nWe need to prove that:\n:$\\exists N: \\forall n > N: \\size {x_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} y_n = l$ we know that:\n:$\\exists N_1: \\forall n > N_1: \\size {y_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} z_n = l$ we know that:\n:$\\exists N_2: \\forall n > N_2: \\size {z_n - l} < \\epsilon$\n\n\nLet $N = \\max \\set {N_1, N_2}$.\n\nThen if $n > N$, it follows that $n > N_1$ and $n > N_2$.\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n < l + \\epsilon$\n:$\\forall n > N: l - \\epsilon < z_n < l + \\epsilon$\n\nBut:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n \\le x_n \\le z_n < l + \\epsilon$\n\nand so:\n:$\\forall n > N: l - \\epsilon < x_n < l + \\epsilon$\n\nSo:\n:$\\forall n > N: \\size {x_n - l} < \\epsilon$\n\nHence the result.\n{{qed}}\n\n-/\ntheorem squeeze_theorem_real_numbers (x y z : \u2115 \u2192 \u211d) (l : \u211d) : \nlet seq_limit : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=  \u03bb (u : \u2115 \u2192 \u211d) (l : \u211d), \u2200 \u03b5 > 0, \u2203 N, \u2200 n > N, |u n - l| < \u03b5 in\n seq_limit y l \u2192 seq_limit z l \u2192  (\u2200 n : \u2115, (y n) \u2264 (x n) \u2227 (x n) \u2264 (z n)) \u2192 seq_limit x l :=\nbegin\n  assume seq_limit (h2 : seq_limit y l) (h3 : seq_limit z l) (h4 : \u2200 (n : \u2115), y n \u2264 x n \u2227 x n \u2264 z n) (\u03b5), \n\n  have h5 : \u2200 x, |x - l| < \u03b5 \u2194 (((l - \u03b5) < x) \u2227 (x < (l + \u03b5))), \n  from sorry,\n  \n  assume (h7 : \u03b5 > 0),\n  cases h2 \u03b5 h7 with N1 h8,\n  cases h3 \u03b5 h7 with N2 h9,\n  let N := max N1 N2,\n  use N,\n\n  have h10 : \u2200 n > N, n > N1 \u2227 n > N2 := sorry,\n  have h11 : \u2200 n > N, (((l - \u03b5) < (y n)) \u2227 ((y n) \u2264 (x n))) \u2227 (((x n) \u2264 (z n)) \u2227 ((z n) < l+\u03b5)), \n  from sorry,\n\n  have h15 : \u2200 n > N, ((l - \u03b5) < (x n)) \u2227 ((x n) < (l+\u03b5)), \n  from sorry,\n\n  show  \u2200 (n : \u2115), n > N \u2192 |x n - l| < \u03b5, \n  from sorry,\nend\n\n/--`theorem`\nDensity of irrational orbit\nThe fractional parts of the integer multiples of an irrational number form a dense subset of the unit interval\n`proof`\nLet $\\alpha$ be an irrational number. Then for distinct $i, j \\in \\mathbb{Z}$, we must have $\\{i \\alpha\\} \\neq\\{j \\alpha\\}$. If this were not true, then\n$$\ni \\alpha-\\lfloor i \\alpha\\rfloor=\\{i \\alpha\\}=\\{j \\alpha\\}=j \\alpha-\\lfloor j \\alpha\\rfloor,\n$$\nwhich yields the false statement $\\alpha=\\frac{\\lfloor i \\alpha\\rfloor-\\lfloor j \\alpha\\rfloor}{i-j} \\in \\mathbb{Q}$. Hence,\n$$\nS:=\\{\\{i \\alpha\\} \\mid i \\in \\mathbb{Z}\\}\n$$\nis an infinite subset of $\\left[0,1\\right]$.\n\nBy the Bolzano-Weierstrass theorem, $S$ has a limit point in $[0, 1]$. One can thus find pairs of elements of $S$ that are arbitrarily close. Since (the absolute value of) the difference of any two elements of $S$ is also an element of $S$, it follows that $0$ is a limit point of $S$.\n\nTo show that $S$ is dense in $[0, 1]$, consider $y \\in[0,1]$, and $\\epsilon>0$. Then by selecting $x \\in S$ such that $\\{x\\}<\\epsilon$ (which exists as $0$ is a limit point), and $N$ such that $N \\cdot\\{x\\} \\leq y<(N+1) \\cdot\\{x\\}$, we get: $|y-\\{N x\\}|<\\epsilon$.\n\nQED\n-/\ntheorem  irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_outline-Natural-Language-Proof-Translation/Correct_statement-lean_proof_outline-4_few_shot_temperature_0.8_max_tokens_2000_n_10/clean_files/Density of irrational orbit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.7217432062975979, "lm_q2_score": 0.22541661063147309, "lm_q1q2_score": 0.16269290730989658}}
{"text": "def Nat.Up (ub a i : Nat) := i < a \u2227 i < ub\n\ntheorem Nat.Up.next {ub i} (h : i < ub) : Up ub (i+1) i := \u27e8Nat.lt_succ_self _, h\u27e9\n\n/-- A terminal byte slice, a suffix of a byte array. -/\nstructure ByteSliceT := (arr : ByteArray) (off : Nat)\n\nnamespace ByteSliceT\n\n/-- The number of elements in the byte slice. -/\n@[inline] def size (self : ByteSliceT) : Nat := self.arr.size - self.off\n\n/-- Index into a byte slice. The `getOp` function allows the use of the `buf[i]` notation. -/\n@[inline] def getOp (self : ByteSliceT) (idx : Nat) : UInt8 := self.arr.get! (self.off + idx)\n\nend ByteSliceT\n\n/-- Convert a byte array into a terminal slice. -/\ndef ByteArray.toSliceT (arr : ByteArray) : ByteSliceT := \u27e8arr, 0\u27e9\n\n/-- A byte slice, given by a backing byte array, and an offset and length. -/\nstructure ByteSlice := (arr : ByteArray) (off len : Nat)\n\nnamespace ByteSlice\n\n/-- Convert a byte slice into an array, by copying the data if necessary. -/\ndef toArray : ByteSlice \u2192 ByteArray\n| \u27e8arr, off, len\u27e9 => arr.extract off len\n\n/-- Index into a byte slice. The `getOp` function allows the use of the `buf[i]` notation. -/\n@[inline] def getOp (self : ByteSlice) (idx : Nat) : UInt8 := self.arr.get! (self.off + idx)\n\n\n/-- The inner loop of the `forIn` implementation for byte slices. -/\ndef forIn.loop [Monad m] (f : UInt8 \u2192 \u03b2 \u2192 m (ForInStep \u03b2))\n  (arr : ByteArray) (off _end : Nat) (i : Nat) (b : \u03b2) : m \u03b2 :=\n  if h : i < _end then do\n    match \u2190 f (arr.get! i) b with\n    | ForInStep.done b => pure b\n    | ForInStep.yield b => have := Nat.Up.next h; loop f arr off _end (i+1) b\n  else pure b\ntermination_by _ => _end - i\n\nattribute [simp] ByteSlice.forIn.loop\n#check @ByteSlice.forIn.loop._eq_1\n", "meta": {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/lean/run/byteSliceIssue.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5078118642792044, "lm_q2_score": 0.3174262655876759, "lm_q1q2_score": 0.16119282369926358}}
{"text": "import data.real.irrational\nimport topology.basic\nimport algebra.order.floor\n\n\n--OUTPUT 1\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h2 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h3 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h4 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h5 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h6 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h7 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h8 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h9 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h10 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h11 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h12 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h13 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h14 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h15 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h16 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h17 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h18 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h19 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h20 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h21 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h22 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h23 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h24 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h25 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h26 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h27 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h28 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h29 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h30 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_mul, int.fract_eq_of_eq],\n  have h31 : \u2200 (i j : \u2124), i\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from assume (i j : \u2124) (h1 : i \u2260 j),\n  have h2 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = (int.fract (\u03b1 * \u2191i)),\n  from by auto [int.fract_eq_iff_eq_or_eq_add_one],\n  have h3 : (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)) = (int.fract (\u03b1 * \u2191j)),\n  from by auto [int.fract_eq_iff_eq_or_eq_add_one],\n  have h4 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)),\n  from by auto [h2, h3],\n  have h5 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)),\n  from by auto [h4],\n  have h6 : \u03b1 = (int.floor (\u03b1 * \u2191i) - int.floor (\u03b1 * \u2191j)) / (i - j),\n  from by auto [h5, mul_sub, mul_comm, mul_assoc, mul_left_comm, mul_div_cancel'],\n  have h7 : \u03b1 \u2208 \u211a,\n  from by auto [h6],\n  have h8 : irrational \u03b1,\n  from by auto [h\u03b1_irrat],\n  have h9 : false,\n  from by auto [h8, h7],\n  show (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h9],\n\n  have h10 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h1],\n\n  have h11 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h10],\n\n  have h12 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h11],\n\n  have h13 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h12],\n\n  have h14 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h13],\n\n  have h15 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h14],\n\n  have h16 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h15],\n\n  have h17 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h16],\n\n  have h18 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h17],\n\n  have h19 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h18],\n\n  have h20 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h19],\n\n  have h21 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h20],\n\n  have h22 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h21],\n\n  have h23 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h22],\n\n  have h24 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h23],\n\n  have h25 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h24],\n\n  have h26 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h25],\n\n  have h27 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h26],\n\n  have h28 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h27],\n\n  have h29 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h28],\n\n  have h30 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h29],\n\n  have h31 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h30],\n\n  have h32 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h31],\n\n  have h33 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h32],\n\n  have h34 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h33],\n\n  have h35 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h34],\n\n  have h36 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h35],\n\n  have h37 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h36],\n\n  have h38 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)),\n  from by auto [h37],\n\n  have h39\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n    have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from \n    begin\n        assume (i j : \u2124) (h1 : i \u2260 j),\n        have h2 : i * \u03b1 - \u2191(floor (i * \u03b1)) = int.fract (\u03b1 * \u2191i), from by auto [int.fract],\n        have h3 : j * \u03b1 - \u2191(floor (j * \u03b1)) = int.fract (\u03b1 * \u2191j), from by auto [int.fract],\n        have h4 : int.fract (\u03b1 * \u2191i) = int.fract (\u03b1 * \u2191j), from by auto [h2, h3],\n        have h5 : \u03b1 = (floor (i * \u03b1) - floor (j * \u03b1)) / (i - j), from by auto [h4, int.fract_eq_iff_eq_or_eq_add_one],\n        have h6 : \u03b1 \u2208 \u211a, from by auto [h5],\n        have h7 : irrational \u03b1, from h\u03b1_irrat,\n        show int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [h6, h7],\n    end,\n\n    have h2 : (\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124) \u2286 set.Icc 0 1, from by auto [int.fract_nonneg, int.fract_lt_one],\n\n    have h3 : \u2200 (x : \u211d), x \u2208 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) \u2192 x \u2208 set.Icc 0 1, from \n    begin\n        assume (x : \u211d) (h3 : x \u2208 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124))),\n        have h4 : \u2200 (\u03b5 : \u211d), \u03b5 > 0 \u2192 \u2203 (m : \u2124), abs (x - int.fract (\u03b1 * \u2191m)) < \u03b5, from by auto [h3, closure_iff_nhds],\n        have h5 : \u2203 (m : \u2124), x < int.fract (\u03b1 * \u2191m) + 1, from by auto [int.fract_lt_one],\n        have h6 : \u2203 (m : \u2124), int.fract (\u03b1 * \u2191m) < x, from by auto [int.fract_nonneg],\n        have h7 : \u2203 (m : \u2124), abs (x - int.fract (\u03b1 * \u2191m)) < 1, from by auto [h4, h5, h6],\n        cases h7 with m h7,\n        have h8 : int.fract (\u03b1 * \u2191m) < x + 1, from by auto [h7],\n        have h9 : int.fract (\u03b1 * \u2191m) < 1, from by auto [h8],\n        have h10 : int.fract (\u03b1 * \u2191m) \u2265 0, from by auto [int.fract_nonneg],\n        have h11 : x \u2208 set.Icc 0 1, from by auto [h10, h9],\n        show x \u2208 set.Icc 0 1, from h11,\n    end,\n\n    have h4 : set.Icc 0 1 \u2286 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)), from \n    begin\n        have h4 : \u2200 (x : \u211d), x \u2208 set.Icc 0 1 \u2192 x \u2208 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)), from \n        begin\n            assume (x : \u211d) (h4 : x \u2208 set.Icc 0 1),\n            have h5 : \u2200 (\u03b5 : \u211d), \u03b5 > 0 \u2192 \u2203 (m : \u2124), abs (x - int.fract (\u03b1 * \u2191m)) < \u03b5, from \n            begin\n                assume (\u03b5 : \u211d) (h5 : \u03b5 > 0),\n                have h6 : \u2203 (N : \u2124), x < N + 1, from by auto [h4, lt_add_one],\n                have h7 : \u2203 (N : \u2124), N < x, from by auto [h4, lt_add_one],\n                cases h6 with N h6,\n                cases h7 with M h7,\n                have h8 : abs (x - int.fract (\u03b1 * \u2191M)) < 1, from by auto [h7, int.fract_nonneg],\n                have h9 : abs (x - int.fract (\u03b1 * \u2191N)) < 1, from by auto [h6, int.fract_lt_one],\n                have h10 : abs (x - int.fract (\u03b1 * \u2191M)) < \u03b5 \u2228 abs (x - int.fract (\u03b1 * \u2191N)) < \u03b5, from by auto [h5, h8, h9],\n                cases h10 with h10 h10,\n                show \u2203 (m : \u2124), abs (x - int.fract (\u03b1 * \u2191m)) < \u03b5, from by auto [h10],\n                show \u2203 (m : \u2124), abs (x - int.fract (\u03b1 * \u2191m)) < \u03b5, from by auto [h10],\n            end,\n            have h6 : x \u2208 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)), from by auto [h5, closure_iff_nhds],\n            show x \u2208 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)), from h6,\n        end,\n        show set.Icc 0 1 \u2286 closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)), from by auto [h4],\n    end,\n\n    show closure ((\u03bb (m : \u2124), int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1, from by auto [h2, h3, h4, set.subset.antisymm],\nend\n\n--OUTPUT 4\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (int.fract (\u03b1 * \u2191m) \u2260 int.fract (\u03b1 * \u2191n)),\n  from assume (m n : \u2124) (h2 : m \u2260 n),\n  have h3 : \u03b1 * \u2191m - int.floor (\u03b1 * \u2191m) = int.fract (\u03b1 * \u2191m),\n  from by auto [int.fract_eq_of_nat_floor],\n  have h4 : \u03b1 * \u2191n - int.floor (\u03b1 * \u2191n) = int.fract (\u03b1 * \u2191n),\n  from by auto [int.fract_eq_of_nat_floor],\n  have h5 : (\u03b1 * \u2191m - int.floor (\u03b1 * \u2191m)) = (\u03b1 * \u2191n - int.floor (\u03b1 * \u2191n)),\n  from by auto [h3, h4, eq_of_sub_eq_zero],\n  have h6 : \u03b1 = ((int.floor (\u03b1 * \u2191m) - int.floor (\u03b1 * \u2191n)) / \u2191(m - n)),\n  from by auto [h5, div_eq_iff_mul_eq],\n  have h7 : (m - n) \u2260 0,\n  from by auto [h2, sub_eq_zero],\n  have h8 : \u03b1 \u2208 \u211a,\n  from by auto [h6, h7, int.coe_nat_dvd, dvd_iff_mod_eq_zero, int.mod_eq_of_lt, int.coe_nat_lt],\n  have h9 : \u00ac (irrational \u03b1),\n  from by auto [h8],\n  show \u00ac (int.fract (\u03b1 * \u2191m) = int.fract (\u03b1 * \u2191n)),\n  from by auto [h9],\n\n  let S : set \u2124 := @set.univ \u2124,\n  let f : \u2124 \u2192 \u211d := \u03bb (m : \u2124), int.fract (\u03b1 * \u2191m),\n  let g : \u2124 \u2192 \u211d := \u03bb (m : \u2124), int.fract (\u03b1 * \u2191m),\n  have h10 : \u2200 x, f x = g x, from by auto [funext, f, g],\n  have h11 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h1, f, g],\n  have h12 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h1, f, g],\n  have h13 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h14 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h15 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h16 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h17 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h18 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h19 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h20 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h21 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h22 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h23 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h24 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h25 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h26 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h27 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h28 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h29 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h30 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h31 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h32 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h33 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h34 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h35 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h36 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h37 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h38 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h39 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h40 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by auto [h11, h12],\n  have h41 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 g n), \n  from by auto [h11, h12],\n  have h42 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 f n), \n  from by auto [h11, h12],\n  have h43 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (f m \u2260 f n), \n  from by auto [h11, h12],\n  have h44 : \u2200 m n : \u2124, (m \u2260 n) \u2192 (g m \u2260 g n), \n  from by\nend --Needs more than 2000 tokens!\n\n--OUTPUT 5\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 ((int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j))), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h2 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [h1],\n  have h3 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) < int.fract (\u03b1 * \u2191j) \u2228 int.fract (\u03b1 * \u2191j) < int.fract (\u03b1 * \u2191i), from by auto [h2],\n  have h4 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h3],\n  have h5 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h4],\n\n  have h6 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h5],\n  have h7 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h6],\n  have h8 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h7],\n  have h9 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h8],\n  have h10 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h9],\n  have h11 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h10],\n  have h12 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h11],\n  have h13 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h12],\n  have h14 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h13],\n  have h15 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h14],\n  have h16 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h15],\n  have h17 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h16],\n  have h18 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h17],\n  have h19 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h18],\n  have h20 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h19],\n  have h21 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h20],\n  have h22 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h21],\n  have h23 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h22],\n  have h24 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h23],\n  have h25 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h24],\n  have h26 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract (\u03b1 * \u2191i)), from by auto [h25],\n  have h27 : \u2200 (i j : \u2124), i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) < (int.fract (\u03b1 * \u2191j)) \u2228 (int.fract (\u03b1 * \u2191j)) < (int.fract\nend --Needs more than 2000 tokens!\n\n--OUTPUT 6\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h2 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h3 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h4 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h5 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h6 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h7 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h8 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h9 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h10 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h11 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h12 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h13 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h14 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h15 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h16 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h17 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h18 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h19 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h20 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h21 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h22 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h23 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h24 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_eq_iff, irrational_iff_not_int_mul_eq_int] using [h\u03b1_irrat],\n\n  have h25 : \u2200 (i j : \u2124), i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j),\n  from by auto [int.fract_\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by auto [set.subset_of_mem_powerset, set.subset_of_mem_powerset],\n  have h2 : (A \u2229 B) \u2286 A, from by auto [set.inter_subset_left],\n  have h3 : (A \u2229 B) \u2286 S, from by auto [set.subset.trans],\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by auto [set.mem_powerset],\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by auto [sq]\n  ... = x*(x+y) + y*(x+y) : by auto [add_mul]\n  ... = x*x + x*y + y*x + y*y : by auto [mul_comm, add_mul] using [ring]\n  ... = x^2 + 2*x*y + y^2 : by auto [sq, mul_comm] using [ring]\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by auto using [use (a\u207b\u00b9 * b)],\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by auto using [use b * a\u207b\u00b9], \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from by auto [h1],\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from by auto [h2],\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from by auto [exists_unique.unique, h3, classical.some_spec, exists_unique.exists, mul_one],\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from by auto [exists_unique.unique, h4, classical.some_spec, exists_unique.exists, one_mul],\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by auto [h3, h4, exists_unique.unique, classical.some_spec, exists_unique.exists] using [use (1 : G)],\nend\n\n/--`theorem`\nSqueeze Theorem for Real Numbers\nLet $\\sequence {x_n}$, $\\sequence {y_n}$ and $\\sequence {z_n}$ be sequences in $\\R$.\n\nLet $\\sequence {y_n}$ and $\\sequence {z_n}$ both be convergent to the following limit:\n:$\\ds \\lim_{n \\mathop \\to \\infty} y_n = l, \\lim_{n \\mathop \\to \\infty} z_n = l$\n\nSuppose that:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\n\nThen:\n:$x_n \\to l$ as $n \\to \\infty$\nthat is:\n:$\\ds \\lim_{n \\mathop \\to \\infty} x_n = l$\n\n`proof`\nFrom Negative of Absolute Value:\n:$\\size {x - l} < \\epsilon \\iff l - \\epsilon < x < l + \\epsilon$\n\nLet $\\epsilon > 0$.\n\nWe need to prove that:\n:$\\exists N: \\forall n > N: \\size {x_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} y_n = l$ we know that:\n:$\\exists N_1: \\forall n > N_1: \\size {y_n - l} < \\epsilon$\n\nAs $\\ds \\lim_{n \\mathop \\to \\infty} z_n = l$ we know that:\n:$\\exists N_2: \\forall n > N_2: \\size {z_n - l} < \\epsilon$\n\n\nLet $N = \\max \\set {N_1, N_2}$.\n\nThen if $n > N$, it follows that $n > N_1$ and $n > N_2$.\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n < l + \\epsilon$\n:$\\forall n > N: l - \\epsilon < z_n < l + \\epsilon$\n\nBut:\n:$\\forall n \\in \\N: y_n \\le x_n \\le z_n$\n\nSo:\n:$\\forall n > N: l - \\epsilon < y_n \\le x_n \\le z_n < l + \\epsilon$\n\nand so:\n:$\\forall n > N: l - \\epsilon < x_n < l + \\epsilon$\n\nSo:\n:$\\forall n > N: \\size {x_n - l} < \\epsilon$\n\nHence the result.\n{{qed}}\n\n-/\ntheorem squeeze_theorem_real_numbers (x y z : \u2115 \u2192 \u211d) (l : \u211d) : \nlet seq_limit : (\u2115 \u2192 \u211d) \u2192 \u211d \u2192 Prop :=  \u03bb (u : \u2115 \u2192 \u211d) (l : \u211d), \u2200 \u03b5 > 0, \u2203 N, \u2200 n > N, |u n - l| < \u03b5 in\n seq_limit y l \u2192 seq_limit z l \u2192  (\u2200 n : \u2115, (y n) \u2264 (x n) \u2227 (x n) \u2264 (z n)) \u2192 seq_limit x l :=\nbegin\n  assume seq_limit (h2 : seq_limit y l) (h3 : seq_limit z l) (h4 : \u2200 (n : \u2115), y n \u2264 x n \u2227 x n \u2264 z n) (\u03b5), \n\n  have h5 : \u2200 x, |x - l| < \u03b5 \u2194 (((l - \u03b5) < x) \u2227 (x < (l + \u03b5))), \n  from by auto [abs_sub_lt_iff] using [linarith],\n  \n  assume (h7 : \u03b5 > 0),\n\n  cases h2 \u03b5 h7 with N1 h8,\n  cases h3 \u03b5 h7 with N2 h9,\n  let N := max N1 N2,\n  use N,\n\n  have h10 : \u2200 n > N, n > N1 \u2227 n > N2 := by auto [lt_of_le_of_lt, le_max_left, le_max_right],\n  \n  have h11 : \u2200 n > N, (((l - \u03b5) < (y n)) \u2227 ((y n) \u2264 (x n))) \u2227 (((x n) \u2264 (z n)) \u2227 ((z n) < l+\u03b5)), \n  from by auto [h8, h10, h5, h9],\n\n  have h15 : \u2200 n > N, ((l - \u03b5) < (x n)) \u2227 ((x n) < (l+\u03b5)), \n  from by auto [h11] using [linarith],\n\n  show  \u2200 (n : \u2115), n > N \u2192 |x n - l| < \u03b5, \n  from by auto [h5, h15], \n\nend\n\n/--`theorem`\nDensity of irrational orbit\nThe fractional parts of the integer multiples of an irrational number form a dense subset of the unit interval\n`proof`\nLet $\\alpha$ be an irrational number. Then for distinct $i, j \\in \\mathbb{Z}$, we must have $\\{i \\alpha\\} \\neq\\{j \\alpha\\}$. If this were not true, then\n$$\ni \\alpha-\\lfloor i \\alpha\\rfloor=\\{i \\alpha\\}=\\{j \\alpha\\}=j \\alpha-\\lfloor j \\alpha\\rfloor,\n$$\nwhich yields the false statement $\\alpha=\\frac{\\lfloor i \\alpha\\rfloor-\\lfloor j \\alpha\\rfloor}{i-j} \\in \\mathbb{Q}$. Hence,\n$$\nS:=\\{\\{i \\alpha\\} \\mid i \\in \\mathbb{Z}\\}\n$$\nis an infinite subset of $\\left[0,1\\right]$.\n\nBy the Bolzano-Weierstrass theorem, $S$ has a limit point in $[0, 1]$. One can thus find pairs of elements of $S$ that are arbitrarily close. Since (the absolute value of) the difference of any two elements of $S$ is also an element of $S$, it follows that $0$ is a limit point of $S$.\n\nTo show that $S$ is dense in $[0, 1]$, consider $y \\in[0,1]$, and $\\epsilon>0$. Then by selecting $x \\in S$ such that $\\{x\\}<\\epsilon$ (which exists as $0$ is a limit point), and $N$ such that $N \\cdot\\{x\\} \\leq y<(N+1) \\cdot\\{x\\}$, we get: $|y-\\{N x\\}|<\\epsilon$.\n\nQED\n-/\ntheorem  irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_auto-Natural-Language-Proof-Translation/Correct_statement-lean_proof_auto-4_few_shot_temperature_0.4_max_tokens_2000_n_6/clean_files/Density of irrational orbit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5851011397337391, "lm_q2_score": 0.27512971787959795, "lm_q1q2_score": 0.16097871150597487}}
{"text": "import data.real.irrational\nimport topology.basic\nimport algebra.order.floor\n\n\n--OUTPUT 1\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)), from by auto [int.fract_eq_iff],\n  have h2 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff, int.fract_add_int, int.fract_mul, int.fract_eq_zero_iff, h\u03b1_irrat, int.fract_add_int],\n  have h3 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff, int.fract_add_int, int.fract_mul, int.fract_eq_zero_iff, h\u03b1_irrat, int.fract_add_int],\n  have h4 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h5 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h6 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h7 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h8 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h9 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h10 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h11 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h12 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [h1, h2, h3],\n  have h13 : \u2200 i j : \u2124, (i \u2260 j) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0) \u2192 (int.fract (\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  let S := (\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124),\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from\n    begin\n      assume (i j : \u2124) (hij : i \u2260 j),\n      have h1 : i * \u03b1 - (i * \u03b1).floor \u2260 j * \u03b1 - (j * \u03b1).floor, from\n        begin\n          assume h2 : i * \u03b1 - (i * \u03b1).floor = j * \u03b1 - (j * \u03b1).floor,\n          have h3 : \u03b1 = ((i * \u03b1).floor - (j * \u03b1).floor) / (i - j), from by auto [mul_div_cancel, mul_eq_iff_eq_one_mul, one_mul],\n          have h4 : \u03b1 \u2208 \u211a, from by auto [h3],\n          have h5 : irrational \u03b1, from h\u03b1_irrat,\n          have h6 : false, from by auto [h4, h5],\n          show false, from h6,\n        end,\n      have h2 : int.fract (\u03b1 * \u2191i) = i * \u03b1 - (i * \u03b1).floor, from by auto [int.fract_def, int.fract_lt_one],\n      have h3 : int.fract (\u03b1 * \u2191j) = j * \u03b1 - (j * \u03b1).floor, from by auto [int.fract_def, int.fract_lt_one],\n      have h4 : int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [h1, h2, h3],\n      show int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h4,\n    end,\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h1,\n  have h3 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from h2,\n  have h4 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h3,\n  have h5 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h4,\n  have h6 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h5,\n  have h7 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h6,\n  have h8 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h7,\n  have h9 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h8,\n  have h10 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h9,\n  have h11 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h10,\n  have h12 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h11,\n  have h13 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h12,\n  have h14 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h13,\n  have h15 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h14,\n  have h16 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h15,\n  have h17 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h16,\n  have h18 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h17,\n  have h19 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h18,\n  have h20 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h19,\n  have h21 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h20,\n  have h22 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h21,\n  have h23 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h22,\n  have h24 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h23,\n  have h25 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h24,\n  have h26 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h25,\n  have h27 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h26,\n  have h28 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h27,\n  have h29 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h28,\n  have h30 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h29,\n  have h31 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h30,\n  have h32 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h31,\n  have h33 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h32,\n  have h34 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from h33,\n  have h35 : \u2200 i j : \u2124, i \u2260 j \u2192 int.f\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from\n  begin\n    assume i j h1,\n    assume h2 : int.fract (\u03b1 * \u2191i) = int.fract (\u03b1 * \u2191j),\n    have h3 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = int.fract (\u03b1 * \u2191i), from by auto [int.fract_def],\n    have h4 : (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)) = int.fract (\u03b1 * \u2191j), from by auto [int.fract_def],\n    have h5 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)), from by auto [h2, h3, h4],\n    have h6 : (\u03b1 * \u2191i) - (int.floor (\u03b1 * \u2191i)) = (\u03b1 * \u2191j) - (int.floor (\u03b1 * \u2191j)), from by auto [h2, h3, h4],\n    have h7 : \u03b1 = (int.floor (\u03b1 * \u2191i) - int.floor (\u03b1 * \u2191j)) / (i - j), from by auto [int.sub_eq_iff_eq_add, h5, mul_sub, mul_add, mul_comm, mul_assoc, mul_left_comm, mul_sub, add_sub_cancel, int.sub_eq_iff_eq_add, h6, mul_sub, mul_add, mul_comm, mul_assoc, mul_left_comm, mul_sub, add_sub_cancel] using [field],\n    have h8 : \u03b1 \u2208 \u211a, from by auto [h7],\n    have h9 : irrational \u03b1, from by auto [h\u03b1_irrat],\n    show false, from by auto [h8, h9],\n  end,\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h1],\n  have h3 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [int.fract_range],\n  have h4 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h2],\n  have h5 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h3],\n  have h6 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h4],\n  have h7 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h5],\n  have h8 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h6],\n  have h9 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h7],\n  have h10 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h8],\n  have h11 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h9],\n  have h12 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h10],\n  have h13 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h11],\n  have h14 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h12],\n  have h15 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h13],\n  have h16 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h14],\n  have h17 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h15],\n  have h18 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h16],\n  have h19 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h17],\n  have h20 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h18],\n  have h21 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h19],\n  have h22 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h20],\n  have h23 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h21],\n  have h24 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h22],\n  have h25 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h23],\n  have h26 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h24],\n  have h27 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h25],\n  have h28 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h26],\n  have h29 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h27],\n  have h30 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h28],\n  have h31 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h29],\n  have h32 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h30],\n  have h33 : \u2200 i : \u2124, int.fract (\u03b1 * \u2191i) \u2208 set.Icc 0 1, from by auto [h31],\n  have h34 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i)) \u2260 (int.fract (\u03b1 * \u2191j)), from by auto [h32],\n  have h35 : \u2200\nend --Needs more than 2000 tokens!\n\n--OUTPUT 4\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 := \nbegin\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h3 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h4 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h5 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h6 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h7 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h8 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h9 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h10 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h11 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h12 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h13 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h14 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h15 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h16 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h17 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h18 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h19 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h20 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h21 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h22 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h23 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h24 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h25 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h26 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h27 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h28 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h29 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h30 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h31 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h32 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto [int.fract_eq_iff, h\u03b1_irrat],\n  have h33 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from by auto\nend --Needs more than 2000 tokens!\n\n--OUTPUT 5\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j), from \n  begin\n    assume i j hi_ne_j,\n    assume h2 : int.fract (\u03b1 * \u2191i) = int.fract (\u03b1 * \u2191j),\n    have h3 : int.fract (\u03b1 * \u2191i) = \u03b1 * \u2191i - int.nat_abs (\u03b1 * \u2191i), from by auto [int.fract],\n    have h4 : int.fract (\u03b1 * \u2191j) = \u03b1 * \u2191j - int.nat_abs (\u03b1 * \u2191j), from by auto [int.fract],\n    have h5 : \u03b1 * \u2191i - int.nat_abs (\u03b1 * \u2191i) = \u03b1 * \u2191j - int.nat_abs (\u03b1 * \u2191j), from by auto [h2],\n    have h6 : \u03b1 = (int.nat_abs (\u03b1 * \u2191i) - int.nat_abs (\u03b1 * \u2191j)) / (i - j), from by auto [int.nat_abs, int.coe_nat_sub, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat_lt_coe_nat_iff, int.coe_nat\nend --Needs more than 2000 tokens!\n\n--OUTPUT 6\ntheorem irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nbegin\n  have h1 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) \u2260 int.fract (\u03b1 * \u2191j)), from by auto [h\u03b1_irrat, int.fract_eq_iff_eq_int_mul_sub_int_mul],\n  have h2 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h3 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h4 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h5 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h6 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h7 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h8 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h9 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h10 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h11 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h12 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h13 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h14 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h15 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h16 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h17 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h18 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h19 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h20 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h21 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h22 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h23 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h24 : \u2200 i j : \u2124, i \u2260 j \u2192 (int.fract (\u03b1 * \u2191i) - int.fract (\u03b1 * \u2191j) \u2260 0), from by auto [int.fract_eq_iff_eq_int_mul_sub_int_mul, sub_eq_zero_iff_eq],\n  have h25 : \u2200 i j :\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by auto [set.subset_of_mem_powerset, set.subset_of_mem_powerset],\n  have h2 : (A \u2229 B) \u2286 A, from by auto [set.inter_subset_left],\n  have h3 : (A \u2229 B) \u2286 S, from by auto [set.subset.trans],\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by auto [set.mem_powerset],\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by auto [sq]\n  ... = x*(x+y) + y*(x+y) : by auto [add_mul]\n  ... = x*x + x*y + y*x + y*y : by auto [mul_comm, add_mul] using [ring]\n  ... = x^2 + 2*x*y + y^2 : by auto [sq, mul_comm] using [ring]\nend\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by auto using [use (a\u207b\u00b9 * b)],\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by auto using [use b * a\u207b\u00b9], \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from by auto [h1],\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from by auto [h2],\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from by auto [exists_unique.unique, h3, classical.some_spec, exists_unique.exists, mul_one],\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from by auto [exists_unique.unique, h4, classical.some_spec, exists_unique.exists, one_mul],\n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by auto [h3, h4, exists_unique.unique, classical.some_spec, exists_unique.exists] using [use (1 : G)],\nend\n\n/--`theorem`\nDensity of irrational orbit\nThe fractional parts of the integer multiples of an irrational number form a dense subset of the unit interval\n`proof`\nLet $\\alpha$ be an irrational number. Then for distinct $i, j \\in \\mathbb{Z}$, we must have $\\{i \\alpha\\} \\neq\\{j \\alpha\\}$. If this were not true, then\n$$\ni \\alpha-\\lfloor i \\alpha\\rfloor=\\{i \\alpha\\}=\\{j \\alpha\\}=j \\alpha-\\lfloor j \\alpha\\rfloor,\n$$\nwhich yields the false statement $\\alpha=\\frac{\\lfloor i \\alpha\\rfloor-\\lfloor j \\alpha\\rfloor}{i-j} \\in \\mathbb{Q}$. Hence,\n$$\nS:=\\{\\{i \\alpha\\} \\mid i \\in \\mathbb{Z}\\}\n$$\nis an infinite subset of $\\left[0,1\\right]$.\n\nBy the Bolzano-Weierstrass theorem, $S$ has a limit point in $[0, 1]$. One can thus find pairs of elements of $S$ that are arbitrarily close. Since (the absolute value of) the difference of any two elements of $S$ is also an element of $S$, it follows that $0$ is a limit point of $S$.\n\nTo show that $S$ is dense in $[0, 1]$, consider $y \\in[0,1]$, and $\\epsilon>0$. Then by selecting $x \\in S$ such that $\\{x\\}<\\epsilon$ (which exists as $0$ is a limit point), and $N$ such that $N \\cdot\\{x\\} \\leq y<(N+1) \\cdot\\{x\\}$, we get: $|y-\\{N x\\}|<\\epsilon$.\n\nQED\n-/\ntheorem  irrational_orbit_dense {\u03b1 : \u211d} (h\u03b1_irrat : irrational \u03b1) : closure ((\u03bb m : \u2124, int.fract (\u03b1 * \u2191m)) '' (@set.univ \u2124)) = set.Icc 0 1 :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof_auto-Natural-Language-Proof-Translation/Correct_statement-lean_proof_auto-3_few_shot_temperature_0.4_max_tokens_2000_n_6/clean_files/Density of irrational orbit.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.6187804337438501, "lm_q2_score": 0.2538610126142736, "lm_q1q2_score": 0.1570842274961132}}
{"text": "import analysis.inner_product_space.pi_L2\nimport topology.paracompact\n\n\n--OUTPUT 1\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (A : set (euclidean_space \u211d (fin n))) (hA : is_open A) (hA_cover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 A),\n  have h1 : \u2200 m : \u2115, \u2203 (B : set (euclidean_space \u211d (fin n))), is_open B \u2227 \u2200 x : euclidean_space \u211d (fin n), x \u2208 B \u2192 x \u2208 A \u2227 \u2200 y : euclidean_space \u211d (fin n), y \u2208 B \u2192 \u2203 (C : set (euclidean_space \u211d (fin n))), C \u2208 A \u2227 y \u2208 C \u2227 \u2200 z : euclidean_space \u211d (fin n), z \u2208 C \u2192 \u2200 (k : \u2115), k < m \u2192 \u2200 (l : \u2115), l < m \u2192 \u2200 (w : euclidean_space \u211d (fin n)), w \u2208 B \u2192 \u2200 (v : euclidean_space \u211d (fin n)), v \u2208 B \u2192 \u2200 (u : euclidean_space \u211d (fin n)), u \u2208 B \u2192 \u2200 (t : euclidean_space \u211d (fin n)), t \u2208 B \u2192 \u2200 (s : euclidean_space \u211d (fin n)), s \u2208 B \u2192 \u2200 (r : euclidean_space \u211d (fin n)), r \u2208 B \u2192 \u2200 (q : euclidean_space \u211d (fin n)), q \u2208 B \u2192 \u2200 (p : euclidean_space \u211d (fin n)), p \u2208 B \u2192 \u2200 (o : euclidean_space \u211d (fin n)), o \u2208 B \u2192 \u2200 (n : euclidean_space \u211d (fin n)), n \u2208 B \u2192 \u2200 (i : euclidean_space \u211d (fin n)), i \u2208 B \u2192 \u2200 (h : euclidean_space \u211d (fin n)), h \u2208 B \u2192 \u2200 (g : euclidean_space \u211d (fin n)), g \u2208 B \u2192 \u2200 (f : euclidean_space \u211d (fin n)), f \u2208 B \u2192 \u2200 (e : euclidean_space \u211d (fin n)), e \u2208 B \u2192 \u2200 (d : euclidean_space \u211d (fin n)), d \u2208 B \u2192 \u2200 (c : euclidean_space \u211d (fin n)), c \u2208 B \u2192 \u2200 (b : euclidean_space \u211d (fin n)), b \u2208 B \u2192 \u2200 (a : euclidean_space \u211d (fin n)), a \u2208 B \u2192 \u2200 (z : euclidean_space \u211d (fin n)), z \u2208 B \u2192 \u2200 (y : euclidean_space \u211d (fin n)), y \u2208 B \u2192 \u2200 (x : euclidean_space \u211d (fin n)), x \u2208 B \u2192 \u2200 (w : euclidean_space \u211d (fin n)), w \u2208 B \u2192 \u2200 (v : euclidean_space \u211d (fin n)), v \u2208 B \u2192 \u2200 (u : euclidean_space \u211d (fin n)), u \u2208 B \u2192 \u2200 (t : euclidean_space \u211d (fin n)), t \u2208 B \u2192 \u2200 (s : euclidean_space \u211d (fin n)), s \u2208 B \u2192 \u2200 (r : euclidean_space \u211d (fin n)), r \u2208 B \u2192 \u2200 (q : euclidean_space \u211d (fin n)), q \u2208 B \u2192 \u2200 (p : euclidean_space \u211d (fin n)), p \u2208 B \u2192 \u2200 (o : euclidean_space \u211d (fin n)), o \u2208 B \u2192 \u2200 (n : euclidean_space \u211d (fin n)), n \u2208 B \u2192 \u2200 (i : euclidean_space \u211d (fin n)), i \u2208 B \u2192 \u2200 (h : euclidean_space \u211d (fin n)), h \u2208 B \u2192 \u2200 (g : euclidean_space \u211d (fin n)), g \u2208 B \u2192 \u2200 (f : euclidean_space \u211d (fin n)), f \u2208 B \u2192 \u2200 (e : euclidean_space \u211d (fin n)), e \u2208 B \u2192 \u2200 (d : euclidean_space \u211d (fin n)), d \u2208 B \u2192 \u2200 (c : euclidean_space \u211d (fin n)), c \u2208 B \u2192 \u2200 (b : euclidean_space \u211d (fin n)), b \u2208 B \u2192 \u2200 (a : euclidean_space \u211d (fin n)), a \u2208 B \u2192 \u2200 (z : euclidean_space \u211d (fin n)), z \u2208 B \u2192 \u2200 (y : euclidean_space \u211d (fin n)), y \u2208 B \u2192 \u2200 (x : euclidean_space \u211d (fin n)), x \u2208 B \u2192 \u2200 (w : euclidean_space \u211d (fin n)), w \u2208 B \u2192 \u2200 (v : euclidean_space \u211d (fin n)), v \u2208 B \u2192 \u2200 (u : euclidean_space \u211d (fin n)), u \u2208 B \u2192 \u2200 (t : euclidean_space \u211d (fin n)), t \u2208 B \u2192 \u2200 (s : euclidean_space \u211d (fin n)), s \u2208 B \u2192 \u2200 (r : euclidean_space \u211d (fin n)), r \u2208 B \u2192 \u2200 (q : euclidean_space \u211d (fin n)), q \u2208 B \u2192 \u2200 (p : euclidean_space \u211d (fin n)), p \u2208 B \u2192 \u2200 (o : euclidean_space \u211d (fin n)), o \u2208 B \u2192 \u2200 (n : euclidean_space \u211d (fin n)), n \u2208 B \u2192 \u2200 (i : euclidean_space \u211d (fin n)), i \u2208 B \u2192 \u2200 (h : euclidean_space \u211d (fin n)), h \u2208 B \u2192 \u2200 (g : euclidean_space \u211d (fin n)), g \u2208 B \u2192 \u2200 (f : euclidean_space \u211d (fin n)), f \u2208 B \u2192 \u2200 (e : euclidean_space \u211d (fin n)), e \u2208 B \u2192 \u2200 (d : euclidean_space \u211d (fin n)), d \u2208 B \u2192 \u2200 (c : euclidean_space \u211d (fin n)), c \u2208 B \u2192 \u2200 (b : euclidean_space \u211d (fin n)), b \u2208 B \u2192 \u2200 (a : euclidean_space \u211d (fin n)), a \u2208 B \u2192 \u2200 (z : euclidean_space \u211d (fin n)), z \u2208 B \u2192 \u2200 (y : euclidean_space \u211d (fin n)), y \u2208 B \u2192 \u2200 (x : euclidean_space \u211d (fin n)), x \u2208 B \u2192 \u2200 (w : euclidean_space \u211d (fin n)), w \u2208 B \u2192 \u2200 (v : euclidean_space \u211d (fin n)), v \u2208 B \u2192 \u2200 (u : euclidean_space \u211d (fin n)), u \u2208 B \u2192 \u2200 (t : euclidean_space \u211d (fin n)), t \u2208 B \u2192 \u2200 (s : euclidean_space \u211d (fin n)), s \u2208 B \u2192 \u2200 (r : euclidean_space \u211d (fin n)), r \u2208 B \u2192 \u2200 (q : euclidean_space \u211d (fin n)), q \u2208 B \u2192 \u2200 (p : euclidean_space \u211d (fin n)), p \u2208 B \u2192 \u2200 (o : euclidean_space \u211d (fin n)), o \u2208 B \u2192 \u2200 (n : euclidean_space \u211d (fin n)), n \u2208 B \u2192 \u2200 (i : euclidean_space \u211d (fin n)), i\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (U : set (euclidean_space \u211d (fin n))) (hU : is_open U) (hcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 U),\n  have h1 : \u2200 m : \u2115, \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n    assume m : \u2115,\n    have h2 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n      begin\n        have h3 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n          begin\n            have h4 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n              begin\n                have h5 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                  begin\n                    have h6 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                      begin\n                        have h7 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                          begin\n                            have h8 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                              begin\n                                have h9 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                  begin\n                                    have h10 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                      begin\n                                        have h11 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                          begin\n                                            have h12 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                              begin\n                                                have h13 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                                  begin\n                                                    have h14 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                                      begin\n                                                        have h15 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space \u211d (fin n) \\ (closure (ball (0 : euclidean_space \u211d (fin n)) m))) \u2260 \u2205), from\n                                                          begin\n                                                            have h16 : \u2203 Cm : set (euclidean_space \u211d (fin n)), (is_open Cm) \u2227 (\u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 A \u2208 U, x \u2208 A \u2227 A \u2229 (euclidean_space\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nbegin\n  assume (U : set (euclidean_space \u211d (fin n))) (hU : is_open U) (hcover : \u2200 x : euclidean_space \u211d (fin n), \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry),\n  have h1 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h2 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h3 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h4 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h5 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h6 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h7 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h8 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h9 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h10 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h11 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h12 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h13 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h14 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm \u2192 \u2203 (V : set (euclidean_space \u211d (fin n))) (hV : is_open V) (hVx : x \u2208 V) (hVU : V \u2286 U), sorry), sorry,\n  have h15 : \u2200 (m : \u2115), \u2203 (Cm : set (euclidean_space \u211d (fin n))) (hCm : is_open Cm) (hCmcover : \u2200 x : euclidean_space \u211d (fin n), x \u2208 Cm\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by {split,apply set.subset_of_mem_powerset,exact hA,apply set.subset_of_mem_powerset,exact hB},\n  have h2 : (A \u2229 B) \u2286 A, from by apply set.inter_subset_left,\n  have h3 : (A \u2229 B) \u2286 S, from by {apply set.subset.trans h2 h1.left},\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by {apply set.mem_powerset h3},\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by rw sq\n  ... = x*(x+y) + y*(x+y) : by rw add_mul\n  ... = x*x + x*y + y*x + y*y : by {rw [mul_comm x (x+y),mul_comm y (x+y)], rw [add_mul,add_mul], ring}\n  ... = x^2 + 2*x*y + y^2 : by {repeat {rw \u2190 sq}, rw mul_comm y x, ring}\nend\n\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by {\n    assume a b : G, use a\u207b\u00b9 * b, obviously, },\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by {\n    assume a b : G, use b * a\u207b\u00b9, obviously, }, \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from \n    assume a : G, h1 a a,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from\n    assume a : G, h2 a a,\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from assume a :G,\n    exists_unique.unique (h3 a) (classical.some_spec (exists_unique.exists (h3 a)))\n    (mul_one a),\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from assume a : G,\n    exists_unique.unique (h4 a) (classical.some_spec (exists_unique.exists (h4 a))) (one_mul a), \n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (hident : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a).exists, from assume (a : G),\n        exists_unique.unique (h3 a) (hident a).right\n        (classical.some_spec (exists_unique.exists (h3 a))), \n      have h9 : \u2200 a : G, e = classical.some (h4 a).exists, from assume (a : G),\n        exists_unique.unique (h4 a) (hident a).left\n        (classical.some_spec (exists_unique.exists (h4 a))),\n      show e = (1 : G), from eq.trans (h9 e) (h6 _),     \n    },\n    exact \u27e8by obviously, h7\u27e9,\n  }\nend\n\n/--`theorem`\n\\mathbb{R}^n is paracompact\n$\\mathbb{R}^n$ is paracompact for all $n$.\n`proof`\nLet $\\mathcal{A}$ be an open covering of $\\mathbb{R}^n$. We now construct a locally finite open refinement $\\mathcal{C}$ of $\\mathcal{A}$ that covers $\\mathbb{R}^n$. First, we define a collection of pen balls. Let $B_0 = \\phi$, and for each $n \\in \\mathbb{N}$, let $B_m$ denote the ball of radius $m$\ncentered at 0. Given $m$, set $\\Bar{B_m}$ is compact in $\\mathbb{R}^n$ by the Heine-Borel theorem, so choose finitely many elements of $\\mathcal{A}$ that cover $\\Bar{B_m}$ and intersect each one with the open set $\\mathbb{R}^n \\setminus \\Bar{B_{m - 1}}$, and let $\\mathcal{C}_{m}$ denote this collection of open sets (each an open subset of an element of $\\mathcal{A}$). So $\\mathcal{C} = \\bigcup_{m = 0}^{\\infty} \\mathcal{C}_m$ is an open refinement of $\\mathcal{A}$. Note that $\\mathcal{C}$ covers $\\mathbb{R}^n$ since for any $x \\in \\mathbb{R}^n$, there is a smallest $m \\in \\mathbb{N}$ such that $x \\in \\Bar{B_{m}}$ (namely, some $m$ where $\\rVert x \\lVert \\leq m \\leq \\rVert x \\lVert + 1$), and so $x$ is an element of $\\mathcal{C}_m$. Now collection $\\mathcal{C}$ is locally finite since for given $x \\in \\mathbb{R}^n$, neighborhood $B_m$ intersects only finitely many elements of $\\mathcal{C}$, namely those elements in collection $\\mathcal{C}_1 \\cup \\mathcal{C}_2 \\cup \\cdots \\mathcal{C}_m$. So $\\mathcal{C}$ is a locally finite open refinement of $\\mathcal{A}$ that covers $\\mathbb{R}^n$, hence $\\mathbb{R}^n$ is paracompact.\n\nQED\n-/\ntheorem  \u211dn_paracompact (n : \u2115) : paracompact_space (euclidean_space \u211d (fin n)) :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof-Natural-Language-Proof-Translation/Correct_statement-lean_proof-3_few_shot_temperature_0.2_max_tokens_2000_n_3/clean_files/Rn is paracompact.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.588889130767832, "lm_q2_score": 0.26588047309981694, "lm_q1q2_score": 0.15657412069189114}}
{"text": "import model_theory.substructures\nimport model_theory.bundled\n\n\n--OUTPUT 1\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  let A : L.Theory,\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h36 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h37 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h38 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h39 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h40 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h41 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h42 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h43 : \u2200 n : \u2115,\nend --Needs more than 2000 tokens!\n\n--OUTPUT 2\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  have h1 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h,\n  have h2 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h1,\n  have h3 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h2,\n  have h4 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h3,\n  have h5 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h4,\n  have h6 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h5,\n  have h7 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h6,\n  have h8 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h7,\n  have h9 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h8,\n  have h10 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h9,\n  have h11 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h10,\n  have h12 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h11,\n  have h13 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h12,\n  have h14 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h13,\n  have h15 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h14,\n  have h16 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h15,\n  have h17 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h16,\n  have h18 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h17,\n  have h19 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h18,\n  have h20 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h19,\n  have h21 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h20,\n  have h22 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h21,\n  have h23 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h22,\n  have h24 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h23,\n  have h25 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h24,\n  have h26 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h25,\n  have h27 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h26,\n  have h28 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h27,\n  have h29 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h28,\n  have h30 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h29,\n  have h31 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h30,\n  have h32 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h31,\n  have h33 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h32,\n  have h34 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h33,\n  have h35 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h34,\n  have h36 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h35,\n  have h37 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h36,\n  have h38 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h37,\n  have h39 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h38,\n  have h40 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h39,\n  have h41 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin, from h40,\n  have h42 : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m\nend --Needs more than 2000 tokens!\n\n--OUTPUT 3\ntheorem overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nbegin\n  let A := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 : F.Model), x\u2081 \u2260 x\u2082,\n  let A' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083,\n  let A'' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084,\n  let A''' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 x\u2085 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084 \u2227 x\u2081 \u2260 x\u2085 \u2227 x\u2082 \u2260 x\u2085 \u2227 x\u2083 \u2260 x\u2085 \u2227 x\u2084 \u2260 x\u2085,\n  let A'''' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 x\u2085 x\u2086 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084 \u2227 x\u2081 \u2260 x\u2085 \u2227 x\u2082 \u2260 x\u2085 \u2227 x\u2083 \u2260 x\u2085 \u2227 x\u2084 \u2260 x\u2085 \u2227 x\u2081 \u2260 x\u2086 \u2227 x\u2082 \u2260 x\u2086 \u2227 x\u2083 \u2260 x\u2086 \u2227 x\u2084 \u2260 x\u2086 \u2227 x\u2085 \u2260 x\u2086,\n  let A''''' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 x\u2085 x\u2086 x\u2087 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084 \u2227 x\u2081 \u2260 x\u2085 \u2227 x\u2082 \u2260 x\u2085 \u2227 x\u2083 \u2260 x\u2085 \u2227 x\u2084 \u2260 x\u2085 \u2227 x\u2081 \u2260 x\u2086 \u2227 x\u2082 \u2260 x\u2086 \u2227 x\u2083 \u2260 x\u2086 \u2227 x\u2084 \u2260 x\u2086 \u2227 x\u2085 \u2260 x\u2086 \u2227 x\u2081 \u2260 x\u2087 \u2227 x\u2082 \u2260 x\u2087 \u2227 x\u2083 \u2260 x\u2087 \u2227 x\u2084 \u2260 x\u2087 \u2227 x\u2085 \u2260 x\u2087 \u2227 x\u2086 \u2260 x\u2087,\n  let A'''''' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 x\u2085 x\u2086 x\u2087 x\u2088 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084 \u2227 x\u2081 \u2260 x\u2085 \u2227 x\u2082 \u2260 x\u2085 \u2227 x\u2083 \u2260 x\u2085 \u2227 x\u2084 \u2260 x\u2085 \u2227 x\u2081 \u2260 x\u2086 \u2227 x\u2082 \u2260 x\u2086 \u2227 x\u2083 \u2260 x\u2086 \u2227 x\u2084 \u2260 x\u2086 \u2227 x\u2085 \u2260 x\u2086 \u2227 x\u2081 \u2260 x\u2087 \u2227 x\u2082 \u2260 x\u2087 \u2227 x\u2083 \u2260 x\u2087 \u2227 x\u2084 \u2260 x\u2087 \u2227 x\u2085 \u2260 x\u2087 \u2227 x\u2086 \u2260 x\u2087 \u2227 x\u2081 \u2260 x\u2088 \u2227 x\u2082 \u2260 x\u2088 \u2227 x\u2083 \u2260 x\u2088 \u2227 x\u2084 \u2260 x\u2088 \u2227 x\u2085 \u2260 x\u2088 \u2227 x\u2086 \u2260 x\u2088 \u2227 x\u2087 \u2260 x\u2088,\n  let A''''''' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 x\u2085 x\u2086 x\u2087 x\u2088 x\u2089 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084 \u2227 x\u2081 \u2260 x\u2085 \u2227 x\u2082 \u2260 x\u2085 \u2227 x\u2083 \u2260 x\u2085 \u2227 x\u2084 \u2260 x\u2085 \u2227 x\u2081 \u2260 x\u2086 \u2227 x\u2082 \u2260 x\u2086 \u2227 x\u2083 \u2260 x\u2086 \u2227 x\u2084 \u2260 x\u2086 \u2227 x\u2085 \u2260 x\u2086 \u2227 x\u2081 \u2260 x\u2087 \u2227 x\u2082 \u2260 x\u2087 \u2227 x\u2083 \u2260 x\u2087 \u2227 x\u2084 \u2260 x\u2087 \u2227 x\u2085 \u2260 x\u2087 \u2227 x\u2086 \u2260 x\u2087 \u2227 x\u2081 \u2260 x\u2088 \u2227 x\u2082 \u2260 x\u2088 \u2227 x\u2083 \u2260 x\u2088 \u2227 x\u2084 \u2260 x\u2088 \u2227 x\u2085 \u2260 x\u2088 \u2227 x\u2086 \u2260 x\u2088 \u2227 x\u2087 \u2260 x\u2088 \u2227 x\u2081 \u2260 x\u2089 \u2227 x\u2082 \u2260 x\u2089 \u2227 x\u2083 \u2260 x\u2089 \u2227 x\u2084 \u2260 x\u2089 \u2227 x\u2085 \u2260 x\u2089 \u2227 x\u2086 \u2260 x\u2089 \u2227 x\u2087 \u2260 x\u2089 \u2227 x\u2088 \u2260 x\u2089,\n  let A'''''''' := \u03bb (n : \u2115), \u2203 (x\u2081 x\u2082 x\u2083 x\u2084 x\u2085 x\u2086 x\u2087 x\u2088 x\u2089 x\u2081\u2080 : F.Model), x\u2081 \u2260 x\u2082 \u2227 x\u2082 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2083 \u2227 x\u2081 \u2260 x\u2084 \u2227 x\u2082 \u2260 x\u2084 \u2227 x\u2083 \u2260 x\u2084 \u2227 x\u2081 \u2260 x\u2085 \u2227 x\u2082 \u2260 x\u2085 \u2227 x\u2083 \u2260 x\u2085 \u2227 x\u2084 \u2260 x\u2085 \u2227 x\u2081 \u2260 x\u2086 \u2227 x\nend --Needs more than 2000 tokens!\n\n/- FEW SHOT PROMPTS TO CODEX(START)\n/--`theorem`\nPower Set is Closed under Intersection\nLet $S$ be a set.\n\nLet $\\powerset S$ be the power set of $S$.\n\n\nThen:\n:$\\forall A, B \\in \\powerset S: A \\cap B \\in \\powerset S$\n`proof`\nLet $A, B \\in \\powerset S$.\n\nThen by the definition of power set, $A \\subseteq S$ and $B \\subseteq S$.\n\nFrom Intersection is Subset we have that $A \\cap B \\subseteq A$.\n\nIt follows from Subset Relation is Transitive that $A \\cap B \\subseteq S$.\n\nThus $A \\cap B \\in \\powerset S$ and closure is proved.\n{{qed}}\n-/\ntheorem power_set_intersection_closed {\u03b1 : Type*} (S : set \u03b1) : \u2200 A B \u2208 \ud835\udcab S, (A \u2229 B) \u2208 \ud835\udcab S :=\nbegin\n  assume (A : set \u03b1) (hA : A \u2208 \ud835\udcab S) (B : set \u03b1) (hB : B \u2208 \ud835\udcab S),\n  have h1 : (A \u2286 S) \u2227 (B \u2286 S), from by {split,apply set.subset_of_mem_powerset,exact hA,apply set.subset_of_mem_powerset,exact hB},\n  have h2 : (A \u2229 B) \u2286 A, from by apply set.inter_subset_left,\n  have h3 : (A \u2229 B) \u2286 S, from by {apply set.subset.trans h2 h1.left},\n  show (A \u2229 B) \u2208  \ud835\udcab S, from by {apply set.mem_powerset h3},\nend\n\n/--`theorem`\nSquare of Sum\n :$\\forall x, y \\in \\R: \\paren {x + y}^2 = x^2 + 2 x y + y^2$\n`proof`\nFollows from the distribution of multiplication over addition:\n\n{{begin-eqn}}\n{{eqn | l = \\left({x + y}\\right)^2\n      | r = \\left({x + y}\\right) \\cdot \\left({x + y}\\right)\n}}\n{{eqn | r = x \\cdot \\left({x + y}\\right) + y \\cdot \\left({x + y}\\right)\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x \\cdot x + x \\cdot y + y \\cdot x + y \\cdot y\n      | c = Real Multiplication Distributes over Addition\n}}\n{{eqn | r = x^2 + 2xy + y^2\n      | c = \n}}\n{{end-eqn}}\n{{qed}}\n-/\ntheorem square_of_sum (x y : \u211d) : (x + y)^2 = (x^2 + 2*x*y + y^2) := \nbegin\n  calc (x + y)^2 = (x+y)*(x+y) : by rw sq\n  ... = x*(x+y) + y*(x+y) : by rw add_mul\n  ... = x*x + x*y + y*x + y*y : by {rw [mul_comm x (x+y),mul_comm y (x+y)], rw [add_mul,add_mul], ring}\n  ... = x^2 + 2*x*y + y^2 : by {repeat {rw \u2190 sq}, rw mul_comm y x, ring}\nend\n\n\n/--`theorem`\nIdentity of Group is Unique\nLet $\\struct {G, \\circ}$ be a group. Then there is a unique identity element $e \\in G$.\n`proof`\nFrom Group has Latin Square Property, there exists a unique $x \\in G$ such that:\n:$a x = b$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = b$\n\nSetting $b = a$, this becomes:\n\nThere exists a unique $x \\in G$ such that:\n:$a x = a$\n\nand there exists a unique $y \\in G$ such that:\n:$y a = a$\n\nThese $x$ and $y$ are both $e$, by definition of identity element.\n{{qed}}\n-/\ntheorem group_identity_unique {G : Type*} [group G] : \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a :=\nbegin\n  have h1 : \u2200 a b : G, \u2203! x : G, a * x = b, from by {\n    assume a b : G, use a\u207b\u00b9 * b, obviously, },\n  have h2 : \u2200 a b : G, \u2203! y : G, y * a = b, from by {\n    assume a b : G, use b * a\u207b\u00b9, obviously, }, \n\n  have h3 : \u2200 a : G, \u2203! x : G, a * x = a, from \n    assume a : G, h1 a a,\n  have h4 : \u2200 a : G, \u2203! y : G, y * a = a, from\n    assume a : G, h2 a a,\n\n  have h5 : \u2200 a : G, classical.some (h3 a).exists = (1 : G), from assume a :G,\n    exists_unique.unique (h3 a) (classical.some_spec (exists_unique.exists (h3 a)))\n    (mul_one a),\n  have h6 : \u2200 a : G, classical.some (h4 a).exists = (1 : G), from assume a : G,\n    exists_unique.unique (h4 a) (classical.some_spec (exists_unique.exists (h4 a))) (one_mul a), \n\n  show \u2203! e : G, \u2200 a : G, e * a = a \u2227 a * e = a, from by {\n    use (1 : G),\n    have h7 : \u2200 e : G, (\u2200 a : G, e * a = a \u2227 a * e = a) \u2192 e = 1, from by {\n      assume (e : G) (hident : \u2200 a : G, e * a = a \u2227 a * e = a),\n      have h8 : \u2200 a : G, e = classical.some (h3 a).exists, from assume (a : G),\n        exists_unique.unique (h3 a) (hident a).right\n        (classical.some_spec (exists_unique.exists (h3 a))), \n      have h9 : \u2200 a : G, e = classical.some (h4 a).exists, from assume (a : G),\n        exists_unique.unique (h4 a) (hident a).left\n        (classical.some_spec (exists_unique.exists (h4 a))),\n      show e = (1 : G), from eq.trans (h9 e) (h6 _),     \n    },\n    exact \u27e8by obviously, h7\u27e9,\n  }\nend\n\n/--`theorem`\nOverflow theorem\nLet $F$ be a set of first-order formulas which has finite models of arbitrarily large size. Then $F$ has an infinite model.\n`proof`\nFor each $n$, let $\\mathbf A_n$ be the formula:\n\n$\\exists x_1 \\exists x_2 \\ldots \\exists x_n: \\{x_1 \\ne x_2 \\land x_1 \\ne x_3 \\land \\ldots \\land x_{n - 1} \\ne x_n\\}$\n\nThen $\\mathbf A_i$ is true in a structure $\\AA$ iff $\\AA$ has at least $n$ elements.\n\nTake:\n$$ \\Gamma := F \\cup \\bigcup_{i \\mathop = 1}^\\infty A_i $$\n\nSince $F$ has models of arbitrarily large size, every finite subset of $\\Gamma$ is satisfiable.\n\nFrom the Compactness Theorem, $\\Gamma$ is satisfiable in some model $\\mathbf{M}$.\n\nBut since $\\mathbf{M} \\models A_i$ for each $i$, $\\mathbf{M}$ must be infinite.\n\nSo $F$ has an infinite model.\n\nQED\n-/\ntheorem  overflow {L : first_order.language} {F : L.Theory} (h : \u2200 n : \u2115, \u2203 (m : F.Model) [mfin : fintype m], n \u2264 @fintype.card m mfin) : \u2203 (M : F.Model), infinite M :=\nFEW SHOT PROMPTS TO CODEX(END)-/\n", "meta": {"author": "ayush1801", "repo": "Autoformalisation_benchmarks", "sha": "51e1e942a0314a46684f2521b95b6b091c536051", "save_path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks", "path": "github-repos/lean/ayush1801-Autoformalisation_benchmarks/Autoformalisation_benchmarks-51e1e942a0314a46684f2521b95b6b091c536051/proof/lean_proof-Natural-Language-Proof-Translation/Correct_statement-lean_proof-3_few_shot_temperature_0.2_max_tokens_2000_n_3/clean_files/Overflow theorem.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.519521321952093, "lm_q2_score": 0.3007455852086007, "lm_q1q2_score": 0.15624374399882804}}
{"text": "import category_theory.abelian.exact\nimport for_mathlib.split_exact\n\nuniverses v u u'\n\nnamespace category_theory\n\nnamespace functor\n\nopen category_theory.limits\n\nvariables {A : Type u} {B : Type u'} [category.{v} A] [category.{v} B]\n  [abelian A] [abelian B] (F : A \u2964 B) [functor.additive F]\n  [preserves_finite_limits F] [preserves_finite_colimits F]\n\nvariables {X Y Z : A} (f : X \u27f6 Y) (g : Y \u27f6 Z)\n\nlemma map_short_exact (h : short_exact f g) : short_exact (F.map f) (F.map g) :=\nbegin\n  rcases h with \u27e8hf, hg, hfg\u27e9,\n  haveI : mono (F.map f),\n  { rw (abelian.tfae_mono X f).out 0 2 at hf,\n    rw (abelian.tfae_mono (F.obj X) (F.map f)).out 0 2,\n    have := F.map_exact _ _ hf, rwa F.map_zero at this, },\n  haveI : epi (F.map g),\n  { rw (abelian.tfae_epi Z g).out 0 2 at hg,\n    rw (abelian.tfae_epi (F.obj Z) (F.map g)).out 0 2,\n    have := F.map_exact _ _ hg, rwa F.map_zero at this, },\n  refine \u27e8F.map_exact f g hfg\u27e9,\nend\n\nend functor\n\nend category_theory\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/for_mathlib/preserves_exact.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5583269943353745, "lm_q2_score": 0.275129717879598, "lm_q1q2_score": 0.15361234843605548}}
{"text": "import free_pfpng.main\nimport condensed.acyclic\nimport prop819\nimport locally_constant.completion\n.\n\nnoncomputable theory\n\nuniverses u\n\nopen category_theory category_theory.limits opposite ProFiltPseuNormGrp\u2081\nopen function (surjective)\nopen_locale nnreal\n\nvariables (S : Profinite.{u})\nvariables (V : SemiNormedGroup.{u}) [complete_space V] [separated_space V]\n\nset_option pp.universes true\n\nnamespace cosimplicial_object\n\nvariables {C D E : Type*} [category C] [category D] [category E]\nvariables (F : C \u2964 D) (G : D \u2964 E)\n\n@[simps]\ndef whiskering_comp :\n  (cosimplicial_object.whiskering C E).obj (F \u22d9 G) \u2245\n  (cosimplicial_object.whiskering C D).obj F \u22d9\n  (cosimplicial_object.whiskering D E).obj G :=\nnat_iso.of_components\n  (\u03bb X, (nat_iso.of_components\n    (\u03bb n, iso.refl _) $\n    by { intros, dsimp, simp only [category.comp_id, category.id_comp] })) $\n  by { intros, ext, dsimp, simp only [category.comp_id, category.id_comp] }\n\nnamespace augmented\n\ndef whiskering_comp :\n  (cosimplicial_object.augmented.whiskering C E).obj (F \u22d9 G) \u2245\n  (cosimplicial_object.augmented.whiskering C D).obj F \u22d9\n  (cosimplicial_object.augmented.whiskering D E).obj G :=\nnat_iso.of_components\n  (\u03bb X, comma.iso_mk (iso.refl _) ((cosimplicial_object.whiskering_comp F G).app _)\n    begin\n      ext,\n      dsimp,\n      simp only [iso.refl_hom, category_theory.functor.map_id, category.id_comp,\n        iso.app_hom, functor.id_map, category.comp_id],\n    end)\n  begin\n    intros, ext; dsimp;\n    simp only [iso.refl_hom, category_theory.functor.map_id, category.id_comp,\n      iso.app_hom, functor.id_map, category.comp_id],\n  end\n.\n\n-- move me\nattribute [simps obj map] cosimplicial_object.augmented.cocomplex\n\ndef cocomplex_whiskering_additive [preadditive C] [preadditive D] [F.additive] :\n  (cosimplicial_object.augmented.whiskering C D).obj F \u22d9\n  cosimplicial_object.augmented.cocomplex \u2245\n  cosimplicial_object.augmented.cocomplex \u22d9 F.map_homological_complex _ :=\nnat_iso.of_components\n  (\u03bb X, homological_complex.hom.iso_of_components\n    (\u03bb i, by { cases i; exact iso.refl _, })\n    begin\n      rintro i j (rfl : i + 1 = j), cases i,\n      { dsimp, rw [category.id_comp, category.comp_id, if_pos rfl, if_pos rfl,\n          category.comp_id, category.comp_id],\n        delta cosimplicial_object.augmented.to_cocomplex_d,\n        dsimp, simp only [category.id_comp], },\n      { dsimp, rw [category.id_comp, category.comp_id, if_pos rfl, if_pos rfl,\n          category.comp_id, category.comp_id],\n        delta cosimplicial_object.augmented.to_cocomplex_d cosimplicial_object.coboundary id_rhs,\n        dsimp, simp only [\u2190 functor.map_add_hom_apply, map_sum, map_zsmul], refl }\n    end)\n  begin\n    intros, ext n, dsimp, cases n;\n    { dsimp, rw [category.id_comp, category.comp_id], refl, },\n  end\n.\n\nend augmented\nend cosimplicial_object\n\nsection\nuniverse v\n-- move me\ninstance Ab.ulift_additive : Ab.ulift.{u v}.additive := {}\nend\n\nlemma free_acyclic_aux (F : arrow Profinite) (hF : surjective (F.hom)) (i : \u2115) :\n    is_zero ((((cosimplicial_object.augmented.whiskering Profinite\u1d52\u1d56 Ab).obj\n      (LCC V \u22d9 Ab.ulift.{u+1})).obj F.augmented_cech_nerve.right_op).to_cocomplex.homology i) :=\nbegin\n  let U := (forget\u2082.{u+1 u+1 u u u} SemiNormedGroup.{u} Ab.{u} \u22d9 Ab.ulift.{u+1 u}),\n  show is_zero (homological_complex.homology.{u+1 u+2 0}\n    (((cosimplicial_object.augmented.whiskering.{u u+1 u+1 u+2} Profinite.{u}\u1d52\u1d56 Ab.{u+1}).obj\n      (SemiNormedGroup.LCC.{u u}.obj V \u22d9 U)).obj F.augmented_cech_nerve.right_op).to_cocomplex i),\n  rw [\u2190 homology_functor_obj, \u2190 category_theory.cosimplicial_object.augmented.cocomplex_obj],\n  let e1 := (homology_functor _ (complex_shape.up.{0} \u2115) i).map_iso\n    (cosimplicial_object.augmented.cocomplex.map_iso\n    ((cosimplicial_object.augmented.whiskering_comp _ U).app\n    F.augmented_cech_nerve.right_op)),\n  refine is_zero_of_iso_of_zero _ e1.symm,\n  let e2 := (homology_functor Ab (complex_shape.up.{0} \u2115) i).map_iso\n    ((cosimplicial_object.augmented.cocomplex_whiskering_additive U).app _),\n  refine is_zero_of_iso_of_zero _ e2.symm,\n  clear e1 e2,\n  let C :=\n    (U.map_homological_complex (complex_shape.up.{0} \u2115)).obj\n    (((cosimplicial_object.augmented.whiskering Profinite.{u}\u1d52\u1d56 _).obj\n      (SemiNormedGroup.LCC.{u u}.obj V)).obj\n      F.augmented_cech_nerve.right_op).to_cocomplex,\n  show is_zero (C.homology i),\n  cases i,\n  { apply exact.homology_is_zero,\n    rw [AddCommGroup.exact_iff', homological_complex.d_to_comp_d_from, eq_self_iff_true, true_and,\n      homological_complex.d_to_eq_zero],\n    swap, { simp only [cochain_complex.prev_nat_zero, complex_shape.up_rel,\n        nat.one_ne_zero, not_false_iff], },\n    intros f hf, refine \u27e80, ulift.down_injective (prop819_degree_zero F hF V f.down _).symm\u27e9,\n    rw [add_monoid_hom.mem_ker] at hf,\n    have h01 : (complex_shape.up.{0} \u2115).rel 0 1 := rfl,\n    have := homological_complex.d_from_comp_X_next_iso C h01,\n    rw [\u2190 iso.eq_comp_inv] at this,\n    apply_fun (C.X_next_iso h01).hom at hf,\n    rw [this, \u2190 Ab.comp_apply, category.assoc, iso.inv_hom_id, category.comp_id, map_zero] at hf,\n    exact congr_arg ulift.down hf, },\n  { let e := (homology_iso C i (i+1) (i+2) rfl rfl),\n    refine is_zero_of_iso_of_zero _ e.symm,\n    apply exact.homology_is_zero,\n    rw [AddCommGroup.exact_iff', homological_complex.d_comp_d, eq_self_iff_true, true_and],\n    intros f hf,\n    -- use `prop819` from `prop819.lean`\n    obtain \u27e8g, hg, -\u27e9 := prop819 F hF V 1 zero_lt_one f.down (congr_arg ulift.down hf),\n    refine \u27e8ulift.up g, ulift.down_injective hg\u27e9, },\nend\n\ntheorem free_acyclic (i : \u2124) (hi : 0 < i) :\n  is_zero (((Ext' i).obj (op ((Profinite_to_Condensed \u22d9 CondensedSet_to_Condensed_Ab).obj S))).obj\n    (Condensed.of_top_ab V)) :=\nbegin\n  apply condensed.acyclic_of_exact _ _ _ i hi,\n  intros F hF i,\n  apply is_zero_of_iso_of_zero (free_acyclic_aux V F hF i),\n  refine (homology_functor _ _ i).map_iso _,\n  refine cosimplicial_object.augmented.cocomplex.map_iso _,\n  conv_lhs { rw [\u2190 functor.flip_obj_obj] },\n  conv_rhs { rw [\u2190 functor.flip_obj_obj] },\n  refine functor.map_iso _ _,\n  refine iso_whisker_right _ _,\n  exact LCC_iso_Cond_of_top_ab V,\nend\n\ntheorem free_pfpng_acyclic (i : \u2124) (hi : 0 < i) :\n  is_zero (((Ext' i).obj (op ((condensify (free_pfpng_functor \u22d9 PFPNG\u2081_to_CHFPNG\u2081\u2091\u2097)).obj S))).obj\n    (Condensed.of_top_ab V)) :=\nbegin\n  refine is_zero_of_iso_of_zero (free_acyclic S V i hi) _,\n  conv { rw \u2190 functor.flip_obj_obj, congr, skip, rw \u2190 functor.flip_obj_obj },\n  refine functor.map_iso _ (iso.app _ _).op,\n  exact free_pfpng_profinite_iso\nend\n", "meta": {"author": "leanprover-community", "repo": "lean-liquid", "sha": "92f188bd17f34dbfefc92a83069577f708851aec", "save_path": "github-repos/lean/leanprover-community-lean-liquid", "path": "github-repos/lean/leanprover-community-lean-liquid/lean-liquid-92f188bd17f34dbfefc92a83069577f708851aec/src/free_pfpng/acyclic.lean", "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO\n\n", "lm_q1_score": 0.5156199157230156, "lm_q2_score": 0.297469948832931, "lm_q1q2_score": 0.15338142994736564}}
