This is a talk about decoupling the cloud foundry build packs from the cloud foundry application runtime. I'm going to talk about CF local I'm also going to kind of talk about build packs model in general and why we like build packs and think they are awesome So I am a software engineer at Pivotal. I'm the project lead for CF build packs CF dev and CF local right now I am required by the city of Boston to announce this fire exit announcement So very quickly, please note the locations of the surrounding emergency exits and locate the nearest exit sign near you In the event of a fire alarm or emergency, please calmly exit the public concourse area emergency Exit stairwells leading to the outside of this facility are located along the public concourse for your safety in an emergency Please follow the directions of the public safety staff. Thank you okay so Why should I use build packs and why are build packs important and I think a big part of this question is Why should I use build packs over docker files, which are really popular right now? So docker files have a lot of purported benefits. They are really transparent You can really tell what's going on in the docker file That's a really simple model and people sort of like that that you can you know read each each line and understand What's happening and they provide a lot of control so you can in a docker file. You can do whatever you want you can Set up your application, you know correctly or you can set it up to be really insecure and you know Have a lot of production stability problems They also build images that are really convenient for sort of shipping to production because they're immutable layers that They're sort of made of immutable layers that You know don't change and so you can know that you're deploying the same thing that you tested and people like those things And you know they're they're benefits to that But there are a lot of caveats for building applications using docker files So and when you build an app using a docker file, you tend to lock external dependencies Behind application code so that when you patch when you need to patch those dependencies it's really expensive because you have to rebuild all the layers on top of them and With docker files that also know part of that model means it's really difficult to enforce structures Sorry to enforce structure or opinions about how application code how application should be built Because you can kind of do whatever you want The there's a loose contract between base layers in a docker file and application layers so you don't have to configure your application any particular way and Developers you know a lot of developers like this because it means they can you know configure their app however they want to and it's it's straightforward, but In an enterprise setting especially this is you know difficult for security and for You know configuring apps the same way for production stability so This is especially bad for enterprise apps because it makes it difficult for an operator to control the contents of applications that are shipped as images and it makes it really difficult for Enterprise operators to audit docker files as well because there's no particular structure to them You could have insecure dependencies kind of anywhere anywhere you'd think So I'm going to do examine this one I'm going to talk about this one CVE and open SSL from 2016 it was a high severity CVE as a memory leak in open SSL that could result in Denial of service attack if your application is fed ciphertext like encrypted Data that is sort of malicious so if you have a Node.js app that uses open SSL and the app is built using docker The usually your app would be built Excuse me From three docker files So one docker file might be from canonical or from an operating system vendor where it would have Ubuntu packages in it or SunTOS packages or whatever Then include open SSL and then on top of that you might have Node.js Docker file that's based on that image and Ed's Node.js And then on top and then you'd have your application docker file on top of that from the Node.js layer and that would contain your application code And in the case of Node you'd install your your node modules So in that high CVE hits you have The vulnerable open SSL at the very bottom layer of that locked beneath all those different layers So updating that that requires rebuilding all the layers on top of it So if you have 500 Node.js apps Then on September 26th, 2016 you're in a little bit of a pickle so If you don't do your dot if you don't manage your docker files Well, all your developers will have started their docker files on different base images And so you'll have to hope that they rebuild all their applications and deploy them in Some amount of time in order to patch this high CVE quickly Realistically, that's not gonna happen. It may if their base images aren't maintained You may never patch the CVE for every app in your organization If you do docker files better you can You know you'd use a corporate Base image with a corporate version of node potentially that everybody in your organization would use and then to patch the CVE You just have to rebuild all of the applications retest them and redeploy them That's definitely better than the previous scenario here, but it's still not great the You know you'd have to hope that all the all the pipelines for all these applications are working and it could you know still take a week Or more to to patch everything Let's look at the CF model for applications though. So in cloud foundry. We don't use immutable container layers We build a droplet. That's the separate artifact from the operating system level dependencies. That's not linked to it it's we rely on something called a bi compatibility that allows us to update the Operating system level packages separate from the droplet And so when that open SSL CVE hits you're in a much better position So I'll talk a little bit about a bi compatibility. So that means application binary interface It's a guarantee that operating system providers provide that says that when They patch their their operating system level packages They won't break compatibility at the binary level. So if you have Object code that's linked to object code at the operating system Provided by the operating system it will still work after they patch those packages and in cloud foundry our operating system layer and Applications is called CF Linux FS 2 and it's currently based on Ubuntu 14.04 This month or next month will be releasing CF Linux FS 3 which is based on Ubuntu 18.04 LTS They'll come really soon hopefully So I want to talk about how cloud foundry manages this the same process So when you do a Bosch deploy of cloud foundry, we're going to go cell by cell and start new cells with a new Root FS so each application is starting with new operating system level dependencies While the previous version of the application is running and this happens live in production So your applications are running you do the Bosch deploy new applications start coming up on new cells with a new root FS And we take the old cells down and we do this cell by cell until your whole platform is Has been patched and this process usually takes a few hours It's really fast compared to having lots of pipelines rebuild all of your Docker images every time a CD comes out So why you all might be here is why limit this to cloud foundry? Why why do we want to you know? Why is this model something that only cloud foundry can provide can we do this in other places the answer is we can So let's go back to that node.js app. I talked about before we could translate that into So OCI image land world Where we could build a droplet layer and a root FS layer And and link those to each other like Docker images are built But then you know we have a bi compatibility between those layers But we wouldn't be stopped to rebuild the droplet on top of a new root FS It wouldn't really give us many benefits So recently some new tools have come out that let you rebase Docker images And so you can take a previously generated Docker image and point it at a new Base image an example of this is Jason Hall at Google has a tool called imagery base that works really well for this purpose and Oh, sorry, so you can see here you can rebase the droplet on a new root FS And with some of these tools like Jason Hall's imagery base You can do this remotely in a Docker registry without downloading anything So you can take a layer in a Docker registry and point it at another base layer without really any data transfer And you know pretty instantly so with 500 node.js apps You could update a Docker registry to have all new base or to point all your droplet layers in your root FS layer pretty much Instantly, which is very similar to what you do in cloud boundary No, you don't you don't have to download anything you can just Yeah, so you wouldn't have to do a Docker rebuild of those images you would still have to redeploy those those images, you know However your platform handles that right Not not picking a particular, you know container platform to describe this anything it uses image layers, you know, you could do it Cool, so why stop there we connect on top of these You know if we use this OCI image model, we can extend the Way we do things currently to be even sort of more effective So for instance, we could separate the application layer from the dependency layer so that node.js and your application are separate and the build pack could manage the a Contract between those there wouldn't be a bi compatibility But would be something like in the case of node if your package.json file doesn't change Then we can reuse the same dependency layer from the last build to be to make this even more efficient and in multi build pack mode We could separate dependency layers generated by different build packs So that we don't even have to run every build pack to restage an application just the build packs that are you know associated with your app You know or just the build packs that Would need to be rerun to build dependencies that need to be pulled in for when they're updated and your application specification so we can go even further different than this and We can make use of build caching so that That could be shared between build packs So that build packs could still take advantage of each other's dependencies But you wouldn't have to redownload droplet layers to restage you could just literally do the minimum thing possible to generate new layers So the goal here is to minimize build time and data transfer for these builds So we have a few things in progress that sort of work towards building this new You know interface One is CF local so CF local is a tool I put together that lets you use build packs to generate droplets and the only dependency this has is docker Usually you use a local docker daemon to do this, but you can actually use a remote docker daemon to So CF local will let you build droplets using build packs locally. It'll let you pull droplets from cloud foundry and You can also run those locally too or you can push droplets to cloud foundry Droplets you've generated or droplets that you pulled from it So it's a great it's a great tool for debugging and iterating locally on cloud foundry apps And it's much faster than cloud foundry because you don't have to upload anything and you're doing the whole staging process locally It also has sort of special support for connecting to services running in cloud foundry and If you're interested in this here's some it's up on github and cloud foundry incubator It's also still on pivotal IO at pivotal IO slash CF dash local So the back end for CF local was just been extracted into Images that are independently usable from CF local So there's an image published a docker hub called pack slash CF that will let you without CF local without any other tools besides docker use docker images a Sort of processing tools to build droplets and run them and export them as images. These are sort of is the same interface That's similar to Google's cloud builders so You can use these Docker images as base images in platforms like concourse or really anything that runs Application containers or anything that runs up Docker images In the future, I'm so I'm currently working on a concourse resource That'll use these base images and just spit out new versions of applications all the time using these strategies like remote imagery basing and a remote layer appending and Finally most exciting announcement here is we we are collaborating with heroku on a new sort of more uniform build pack API that Would were of cloud foundry build packs and heroku build packs would be more compatible with each other when used and with in multi build pack mode we're also trying to collaborate on sharing more tools and Optimizing application builds So I'll have more about that later this year Sorry optimizing application builds And that's it any questions sorry Brett you want a hand of the mic? It's just wondering if you could go back a couple slides to that initial one more. There you go. Thanks Sure any other questions There In your talk in the demo you mentioned that CF local is available only for Mac now, but Windows is coming soon. When is that? So actually that's CF dev. Oh, the first alpha release of CF dev, which is a different tool It's a whole cloud founder. You can install locally is only for Mac But CF local runs on Windows Linux and Mac all same features across all platforms as long as you have Docker there Cool, and the second thing you showed is the multi-build pack thing. Yeah, is that? Available today with the CF V3 push or is that something else? Yeah, you can use multiple build packs with CF V3 push eventually it'll be in the CF push command also. That's that's coming pretty soon Having talked to the CLI team It doesn't work quite like this. It doesn't use images But it still lets you supply dependencies from different build packs to the application Yeah, what I've also noticed is when you do the V3 push, it's overriding some of the core Dependencies in the initial build pack what I was hoping is let's say I push a Java one and then I will push a static build pack or Binary build pack that says just overlay the same container with additional files But keep the original entry point. That's is there any way to get that behavior? So let me see if I understood that you want to provide Different dependencies from different build packs into one application But you want you want like multiple processes running at the same time No, only one process the Java one, but let's say it uses IBM Cplex Runtime which includes some runtimes and some libraries and things like that There are need to be available in the host, but I don't need to be actively running They will be invoked to the JNI on the jar through the jar files that are already put in my first app So I want to be able to manage the second set of Cplex libraries independently than packaging into my original app That way it can be versioned independently Than doing it all as one app and then have this nightmare of managing versions of Cplex Makes sense. Let's talk after I think it'd be easier to figure out exactly where you use cases and Talk about offline anybody else Over there in the back So that was just a very high-level introduction to CF local So can you tell us how people are using it to make their lives easier or better? so CF local will let you iterate really quickly on Cloud Foundry apps without needing to Re-push them and that staging process is much faster So if you want an environment that looks more similar to your production Cloud Foundry environment you can use CF local to Iterate really rapidly, but also have that environment available locally so You know this this works across all languages and that's you know, I've seen people Use it that way It's especially nice with Java actually because you can use spring boot dev tools Locally with an app running in CF local To you know sort of update application source code and see it your application update instantly without even restaging That that's one example of a place where I've seen people use it really effectively Anybody else When you build things When you do a CF local image, is it always going to be a Docker image? Or can you convert it back into the standard syntax where we can do CF push? So actually CF local doesn't generate Docker images. It generates droplets that don't include the root of s That's when you do a CF local stage You get a droplet file in your local directory and you can get a build cache file in your local directory And so you can re-export those without restaging with a new root of s whenever you want to so it gives that model The platform has but the locally in Docker So on a build Jenkins server, let's say what are the steps that would be there when would it be doing a CF push there? Or would it be running CF local on the Jenkins server and doing this and then pushing it? So if you want to push you see if local to push an application to cloud foundry that you built locally Is that the question? Yeah, so you could do a CF local stage and then you get a droplet file in your local directory And then you could do a CF local push and it would actually push that droplet without the root of s part up to cloud boundary and then start the application in cloud boundary and That you wouldn't need a Docker image, you know anywhere in that process. You'd just be uploading the droplet What does the Jenkins server have like if I'm doing the CI CD and Is this just for purely testing and is there any artifacts that I do with CF local Reusable when I check into bid bucket somehow to be picked up by Jenkins server So not not sure I totally understood that I don't think you want the end end results of the CF local process to be able to push to an OCI registry if that's what you're saying Yeah, that's You could and that that's a workflow I've seen people do in concourse where you generate a droplet and you store that in s3 And then you re-export image out of the droplet and upload that to that platform or upload the droplet to cloud boundary That that's that's a workable workflow We're working on a concourse resource and some other tools that are sort of more effective tools for CI And less that are less targeted at local development to it should help you with things like that Yeah, I think I think you're gonna want things in your CI pipeline that are gonna validate in other ways that the dev wouldn't necessarily So you don't want the devs to push up the final droplet necessarily All right. So I've had some people express concerns that the typical CF development pipeline is to have something like you push an app through development And it works and then pipeline pushes it through dev and then our stage and then into production But each time you have a different Droplet it does this give us a much better tool set then for saying yes We have one droplet that then is then moved through different pipelines or different stages in a pipeline and validated Or is there some other path that you would go through to realize that? Yes, you can use CF local to do that You because it has this ability to pull droplets from cloud boundary and push them up to cloud boundary you can Download a droplet from one application once you've validated to that application works and upload it to another application in a different space Or org or wherever So you can use CF local to to enable that kind of workflow There are some features in the platform that are coming up that will let you do that You know without needing to use CF local as a separate tool. Is that like the better push stuff? They showed sorry Say again, is that like the better push stuff that was in the keynote the where you have like multiple droplets and you're selecting which one Yeah, I think sorry are there plans for this Build pack process to be extended for things other than CF local So do you mean do we plan to have other tools that you know use the same kind of model besides CF local to do it? So Yeah, so the packs docker images I was talking about before our tool you can use independently in CI and concourse You know with whatever your CI system is as long as it supports container images And those are a little more Flexible you can sort of you know fit those into different kinds of pipelines in different ways to be able to use build packs You know in platforms that support images and to build droplets and platforms that support images We're looking at a whole bunch of different options for tools We can build on top of those images for concourse for Jenkins for you know different CI platforms people use For doing even for doing builds and Kubernetes for instance Would you mind advancing one slide? I want to take a picture of that one. Yeah, no problem Any other questions From a jacquard side Real quick one. You mentioned Jason Hall's work on image rebase. Where would I go looking for that? I? Think it's in pretty sure it's in the github google org. It's called image-rebase Any other questions? All right


I'm fine with you doing that. I thought there was a segue there talking about the Ray Dalio thing that Friedberg cares about. I mean, this is, I mean, this debate that you're having between kind of realism and idealism and foreign policy is sort of what Dalio tackles, right, Friedberg?  There always needs to be, as Chamath points out a narrative on framing our enemy when, you know, you're running out of land. I mean, you guys saw this, was it a journal article or New York Times article that came out today that US intelligence revealed that Putin had actually put some actors into the Eastern Ukraine to set up for a reason to have a response and therefore an excuse to invade the Ukraine. So he was trying to create a bit of a fireworks show to give him an excuse.  Basically, what he's going to argue is that we can't even know that anything is happening to the Uyghurs, because it could be just a story that some Americans are telling us in order to justify us not liking the Chinese. So the Chinese are really great, they're fantastic, but the competitors are ours and therefore we need to create a story, a mythology around how evil they are to justify being tough on the Chinese, just like the Russians need to create an excuse to invade Ukraine. So they create this, they'll create some kind of attack on themselves. They'll initiate it in order to give them that excuse. Again, this is the kind of stuff that happens when people stop trusting the media, the news sources, the politicians, everybody else, and they don't have first hand experience, they don't have first knowledge of these places, first hand knowledge. So they start making stuff up or accuse others of making stuff up. So there's no real crisis in China. None of this stuff is really bad.  A lot of people believe bad things about China because they want to believe bad things about China. I find it fascinating that, for example, on stuff that the mainstream media says about, I don't know, Trump or about COVID, well, it's the mainstream media. We can't believe anything they tell us, they're all politically motivated. But when the mainstream media tells us stuff about China that fits the narrative, that is, China's really, really bad, oh, then they're absolutely right. So it's fascinating that people adopt what the mainstream media provides them when it fits into their tribal construct, and they reject it when they don't. And a lot of this is a consequence of the difficulty in figuring out what's objectively true and what's objectively not. And given them out of conspiracy theories, given the bias that actually exists in the media, given everything else that is going on, it's hard. It actually takes work to figure out what's true and what's not true, what's accurately portrayed by the media, and what's not accurately portrayed in the media. Now I've said many times what I would do in China. I think in looking at a country like China and its behavior towards its own people, whether it's the Uighurs or whether it's their tech executives, or whether it's, although we're about to do very similar things to the tech executives, or whether it's free speech, everything, the whole attitude of the Chinese government to its own people, we should be very wary of China, and we should be willing to condemn that kind of behavior morally. And when China steals intellectual property rights and when China uses hackers to hack into American companies or hack into our national security computers, I think the United States should treat China harshly in a sense of withdrawing ambassador, shut down diplomatic relations with China, and then tell our companies they're on their own, if they want to do business in China, they're on their own. China is a system of government, is a bad place and becoming worse, becoming worse. And I think we should call them on it. I have always been an advocate for president of the United States and for leaders of the United States to use the bully pulpit to make clear, moral, unequivocal statements, just the fact that China took over Hong Kong should have been a major event that should have concerned us. And we need to do the same with Saudi Arabia, and we need to do the same with lots of other countries. And I think if we did, and if we did it consistently, I think these countries would change. So we should criticize their loud behavior, not you as an individual out there.  But our leaders, that's what they're there for, should use the bully pulpit to criticize, to condemn, and should make clear what our moral estimation of the regime is by not being friendly to them. Somebody says the U.S. cannot afford to be unfriendly to Saudi Arabia. Why? What does Saudis give us that we can't afford to be unfriendly with them? Nothing. Zero. We get nothing from the Saudi Arabians that we don't already have. We have nothing to fear from the Saudis. We could crush them in a minute. What are the Saudis exactly? What is it that we can't afford to upset them about? I mean, China, we're far, far more dependent in an economic sense on China than we on Saudi Arabia. Saudi Arabia is a close ally. That's a joke. So no, I mean, we need a foreign policy guided by idealism, guided by ideas. But then we have to have a clear vision of what those ideals are. And yes, I think we should be implementing those ideas internally and externally. We should be doing it both inside and outside. So the Saudis accept, start accepting gold for the oil or start accepting euros for the oil. Who cares? Why does that matter? What economic value does the fact that the Saudis only accept dollars for the oil provide us? It's not clear any. It's a mirage. It's a pretense to think that we depend on Saudi Arabia in anything. By the way, the Saudis only accept dollars because it's in the Saudis' interests only to accept dollars. They don't trust any other currency, but the Saudis are reforming in the right direction but too slow. And as long as they're killing people and stoning people and harassing people, we should condemn them all. It's, I think, very informative to know that when people don't have a clear moral code, when people don't know what idealism could actually be, that there is an idealism of self-interest, which is what I'm talking about. But an idealism of self-interest views human life as valuable, therefore views the violation of human rights as bad, and then therefore views it as selfish to condemn bad behavior, bad behavior, and an act of justice to call out the bad guys. But selfish justice. Quint, thank you for the support, I appreciate it, Quint. But most people, particularly the kind of people, successful people, businessman, business people out there, they don't have a moral context for what they believe. They are pragmatists. So on the one hand, he's absolutely right. What do I care? Busy living my life. On the other hand, he's wrong. He does care to some extent. The question is, how much is he willing to do about it? Not much, because we live in a world in which there are other bigger problems that need to handle, because he's living in the context of his own life. It's fascinating to me that somebody like that would say, I'll care about it when the United Nations cares about it, when Biden cares about it. That's a real weakness, real weakness. Thank you for listening or watching the Iran book show. If you'd like to support the show, we make it as easy as possible for you to trade with me. You get value from listening. You get value from watching. Show your appreciation. You can do that by going to iranbookshow.com slash support by going to Patreon, subscribe star, locals, and just making a appropriate contribution on any one of those, any one of those channels. Also, if you'd like to see the Iran book show grow, please consider sharing our content and of course, subscribe. Press that little bell button right down there on YouTube so that you get an announcement when we go live. Those of you who are already subscribers and those of you who are already supporters of the show, thank you. I very much appreciate it.


So it's a long title and those of you who are familiar with the theory of quadratic forms might think it'll be a very short talk because there's not too much to say about this. I'll try to convince you that there is actually. So let me introduce some notation. First of all, so let S be a three by three symmetric matrix. So I'll write my ternary quadratic form in terms of S. So X will be a variable. These will usually be integers. And so I'll let S of X be the quadratic form associated to S. So this guy. But it's not singular. So the determinant's not zero. So I'll call that capital D. And I'll assume it's positive. When you're dealing with ternary forms, it doesn't the sign of the determinant doesn't really matter because you can just multiply S by minus one. Now, if you're talking about, it's a more modern way to do this would be to talk about. Let us is and quadratic spaces in which case, you know, the, the S would be a matrix of inner products of basis elements and changes of variables would be encoded in changing the matrix. But for what I'm going to do it's more convenient for me to actually use matrices, even though it's more elegant actually to not do that. But anyway, so S and S prime two different matrices are in the same class or equivalent. If you can transform one to the other. And I'm going to use jail equivalence. I'm going to be using seagulls work. So this, this kind of constrained me in a lot of ways. And this is the most natural thing for what I'm going to be doing. So it means that there exists an A such that a transpose S a is equal to S prime. So this corresponds to a change of basis. But I'll say that they're in the same class. And then the same genius. If this happens over all primes, including infinity. And it turns out that there's only finally made classes in a genius. So we assume that a nice way to put it is to say that a is in GL three ZP, he had a cantors for all P, including infinity. And what that means is we're talking about GL three are in that case. So this is a weaker condition for you know if you have an individual prime, if they're in the same class they're kind of obviously in the same ZP class, and actually they're in the same genius if they're in the same class, but not necessarily in the other direction. However, there are only finally many classes in a genius is a theorem. Now, the Hassel principle. Well, okay, so first of all, we have a notion of isotropy. So, as is said to be isotropic over Z say, if you can find a zero of it, if there exists a primitive, meaning the GCD is one such that S of X equals zero. Okay, so this is you know a very well studied thing. And one of the early, early cases of the Hassel principle says that S is isotropic. If it only if it's us s x equals zero is solvable over ZP for all P. So S facts is isotropic. If it only if it's this question is solvable over ZP non trivial or primitive leaf you like. And again, you know, this is the opposite direction is is if it's solvable over Z it's obviously solvable over ZP, but the opposite direction is non trivial. And that's the, an early case of the Hassel principle. So, actually, in this case, the Hassel principle is equivalent to a very classical result. It's one of the actually hardest cases to prove if you're talking about over Z. It's a non trivial result. It's equivalent to Lejean's theorem. So it's a, it's a special case it looks like so this says that if I let S of X be diagonal so AX one squared plus BX two squared. You know, one of the things that makes this questions a lot easier is because we were talking about isotropy, the equation being zero. You can have a rational solutions and and factor out the denominator so it's really a question. It looks like it's completely a question about rational solvability. That's why the Hassel principle is an effect here. But anyway, this allows you to reduce the principle to Lejean's theorem where in a special case where a B and C are integers and you can assume that they're square free their product is square free so they're relatively prime. And you know they, in order for them to be isotropic it has to be indefinite so they have to be different signs. The Lejean theorem says that this is isotropic. So if and only if you can make the local conditions into a very nice form. So minus AB minus AC minus BC, these have to be quadratic residues over the sort of obvious things that's the opposite. The thing that's being left out. So that's famous Lejean theorem everybody's heard of this, and they also have to be not the same sign, ABC, not the same sign. So it's not trivial to see that this is equivalent to Hassel principle in general, you know for a general turn, but it's not to it's not really hard either. By the way, there's a, you're probably aware of this book by Andre Bay on the history of number theory, I think it's just called number theory. It's really a beautiful book, because he, he mixes the history with, you know, modern explanations of the results so it's a great place to learn about this. If you if you want to see it. So I think it's just number theory, not the basic number theory but number theory. It's really a history book. Okay. Now. So, again, you might think okay this is this is the end of the story, because we have a complete understanding of when a ternary quadratic form represents zero. Well, I want to convince you it's not the end of the story because what you can also look at orbits of solutions and there's a lot of interesting questions about orbits of solutions. So look at orbits. Well, what kind of orbits. Well, maybe the first way to look at it is to think about orbits under automorphs of the of the quadratic form. So, let me say that. Let me let me denote capital C of X capital C of S sorry to be. So these are the primitive solutions. I'm a to with S of X zero. So these are the these are the solutions that we're interested in. Now suppose you have two solutions. So if you have one of it. If you can go from one to the other using an automorph. So I'll just write out what that means so if there is an A in G o 3 Z that first of all takes x to x prime, and is preserved and preserves S. So it's an automorph of S or isometry however you want to look at it. So let's up the solutions assuming that they exist into orbits and there's actually finitely many is a theorem. I mean this is a classical result to it's true in much greater generality. So there are finitely many orbits, Z orbits, maybe I'll say Z orbit. So let's go back to that by little C of S. Okay, now you can be interested in how many orbits are. It's not trivial question it's not obvious at all. How many orbits there would be. And you'll see why I guess eventually, but you can also look at the orbits over the pediatric integers. So the parallel question. So, it's the same Z p orbit. If the corresponding relations hold, or you know a and G o 3 of Z p, including infinity. And again there's only finitely many Z p orbits for each P. So let's see P of S, he's a number of Z p orbits. The result I want to describe is the following so given an S that we've been talking about. So for S non singular ternary. There's a relation between the number of Z orbits and the number of Z p orbits. It does involve the genius, which may not be consistent just one class. But the theorem is that if you sum over the genius forms in the same genius, and you take the number of orbits, the forms in the genius. That's the same thing as the product over the primes of the number of local orbits. And this is a finite product. So CP of S. It's usually one. So it's not equal to one for most finitely many. So, this is a kind of a quantitative version of the House of principle. It's not exactly. It doesn't imply the house principle, as it stated because the hospital would say that any yes prime would be isotropic provided the right hand side is not zero.  Excuse me, do you count orbits with one over the size of the centralizer. No, so that's that so that leads me to the next comment because it looks like Ziegels main theorem. Yeah, because Ziegels main theorem has looks looks kind of like this but for the sum over the genius you would have measure of representation, which is basically a measure of the size of the isotropic group. And on the right hand side, you would have periodic product of periodic densities. So this is kind of a simpler version. It looks, it looks similar but it's actually simpler because these are all integers. And there's no waiting going on at all. So I got into this because I was reading Ziegels and he there's some cases where his theorem doesn't apply and this is one of them. Because the both sides of his identity are actually infinite in this case. So he didn't he didn't treat this case and I got very curious as to what was going on here. After many struggles and many sort of missteps this is this had finally emerged as sort of a version of the Ziegels theorem. In a way, it kind of looks like you can think of it as being, if you know about Ziegels theorem. It always has a mass formula embedded in it. And kind of what's happening here is I'm moving the mass formula from one side to the other. And maybe that'll become a little more clear when I sketch the proof. Now, there's a corollary if, if H is one. So if the class number of the genius is one, then you have a very nice statement, because it just says that to L two solutions are equivalent over Z, if not only if they're equivalent over ZP for all P. So that that really is a quantitative version of the, or a refinement of the house of principle. So XX prime in CFS are equivalent. So I like I like this statement a lot. I say more of it equivalent and Z orbit if only you are in the same ZP orbit will be I have one more question. Does it realize as a zero Fourier coefficient of Eisenstein series. If you look at the Ziegels. Yeah, that's a good question. I'm not. Yeah, I'm not I'm not sure. I have to think about that. Yeah, that's a good question. Thanks. Yeah, let me let me think about it. Maybe it'll pop into my head. So, I want to give you some examples of this. So first of all, the, you get nice examples just with the Legendre equation with the diagonal equation. So if you take the case that's used in the proof of the house of principles of you assume AB and Sears a times B times C is square free. And it's isotropic. Let me just always assume that then the class number is one and the number of orbits is one. I'll give you some indication at the end how this is how this is proved I mean, you can compute the right hand side of the theorem in different ways but you can also do this by reduction. And this includes the case of the Pythagorean triples and that's kind of an old theorem from the 30s but as far as I know people haven't really looked at this question much in general. So, if you take a more general case of Legendre theorem, which over the rational these are not interesting questions because everything's equivalent. So it's really over the integers that the, and the orbit question is really an integral question. You think about it. This is a case where you don't have square freeness. And in this case, if Q is a product of prime of distinct primes distinct primes congruent to three mod four. And you can prove it's a classical result of Meyer that the class number is one. But the number of orbits is not. In this case, it's the product of P minus one over two over the primes. It's not always true that there's one orbit. I mean, you could think that that might be true, but that's definitely not true. And also the class number is not always one even though it often is if you have simple S is usually the class number is one but when you have high powers of primes dividing the coefficients. It's often that it's not usually true that the class number is one. Another case would be if the Q if the Q is prime product of primes distinct, which are congruent to one mod eight. And also if you have a condition that they're all quadratic residues of each other, which is kind of an interesting condition. So the P quadratic residues of each other. They have a pretty big class number. H is two to the number of primes. Class numbers always a power of two this is a theorem of Meyer and then laser actually worked on this much later and gave much more general nice results. But the class numbers always a power of two. In this case, the number of orbits of each class of each S in the genus. It's all the same. It's P minus one over four. So the, well, basically, lots of different things can happen here I just wanted to illustrate that now. At the end if I have time I'll tell you how how you actually prove these from. It's actually better not to use the theorem to prove these in fact there's a different approach that you can use some more elementary approach. Okay, so what really led me this question of Ziegels what led me to this problem but also I was motivated by a proof of Ziegels theorem that was due to ask in Rudnik and Sarnac from many years ago. Where they, they used an idea of comparing asymptotic counts in an orbit to asymptotic count of the of all solutions. So I wanted to see if you could apply that method to this problem and some and somehow get some substitute for Ziegels theorem and that's really what happened. So, but you need to know first of all you need to know the mass formula, you can't get around this. So this is part of it. And to formulate this one very beautiful circumstance here is it if I take the group of automorphs. So these are the things that came into the orbit. So these are just the transformations that leave us alone. So this is a nice group of subgroup of the orthogonal group of s. Now, if I think of it as being in the or thought the orthogonal group over our, it has a subgroup, which is what you get when you restrict everything in a vast to the connected component of the identity of the special orthogonal group. So that's, that turns out to be the group that you want to look at. So it's the spinner group. And this turns out to be isomorphic to a fuchsian group acting on the upper half plane. This is the entry of analysis for me into this. And there's different ways you can do this, but this is a fuchsian group. This is a subgroup of SL to our PSL to our, and it's co finite. And this is due to Frick a client. Originally, I think although you know instances that were known even all the way back to Gauss. But there's an explicit map that you can write down, which I actually need. It tells you how to go from an element and O plus s to I did I didn't write down what this is but this again it's it's the subgroup kind of in the connected component the identity. And this, this group has many nice properties for example it's has cusps if and only if s is isotropic, but it's always co finite and the volume. This is the volume hyperbolic volume of h pod gamma s. So that's finite as well. And that's what enters into the mass formula. So the mass formula compares the sum of the volumes over the genus to product of local densities and the local densities of the are the local densities of the orthogonal group, restricted to ZP. There's lots of local densities that show up here. So this is Eagles theorem. So you compute the number of elements in the orthogonal group over the pedics, but taken modulo p to the end. So you can think of this is counting solutions to a congrats by p to the M. So this is OP. So OP of s is the, I'm not going to write out the definition so this is the ZP version of the orthogonal. But anyway so you count the number of solutions, modulo p and then divide by p to the 3M and take this limit. And it's a result of zeal that it stabilizes. So this gives you a rational number. And then you take and the product is actually convergent. So when you take the product over here. This is actually convergent and gamma infinity is the corresponding thing for infinity, and it's explicit gamma delta delta infinity. In this case is pi over 4d squared. There's lots of little subtleties that you have to deal with in dealing with the subject because the whole zeal uses volume on the orthogonal group and the volume on the fuchsian group is is twice his volume. And there's all kinds of little things that have to match up exactly so it's kind of a it can be quite a tricky, tricky thing to deal with zeal's theorems. Okay, so what, what are the asymptotics I'm talking about. They're really well known. So one of them is counting all the, all the points x primitive solutions with some restriction on their size there's definitely many so you have to put some restriction on the size. The usual way to do this is to use a norm. What you're really doing is you're counting rational points on a chronic. So this is a special case of a very general set of theorems. Due to fraca many and shinkle, and also pair who counted who gave the constants in the asymptotic. What I needed to do was not to use the norm but a slight variation. So, to describe this. So this would R be the ad adjunct of s so this is just the determinant of s it's basically the inverse made integral. So I take the inverse and multiply by the determinant. And if I take a Y in our three. So that this adjunct form has the value four times to the determinant, which is positive, then there's only finitely many. conditions that have an inner product between X and why so why is general with this condition and that turns out to be important it's that it's general but so this would be the X is for which the inner product of X and why is between zero and T say. It's finite. And even though this condition is you're talking about something lying between two planes. And, but you can see that it's finite with this condition because basically what you're doing is you're taking the lattice points that lie, you're cutting this cone, the condition that s is zero is a cone. And what you're doing is you're cutting the cone in an ellipse instead of a hyperbola. You get my pictures pretty bad here but you're counting points on the cone between two planes that cut it so that it's a compact set. And what their theorem implies is that this has an asymptotic formula, not only is it finite has an asymptotic formula. And so what is it what's the constant. It's a product of local of local densities again. One half, there's a density infinity product of Sigma P's. And these, these Sigma P's are the local density for counting the solutions, sort of the natural thing. So this is an actually pretty non trivial theorem. In fact, I approach it from the point of view of the Hardy Hardy little with circle method which is where this kind of asymptotic was first given is given for usually for quadratic forms and many variables, in which case you're getting Gauss sums, and these products of local densities converge nicely. And I've introduced some notation which I haven't defined this CP of S of the solutions, the periodic solutions. So, I'll just, I won't write that down, but that's what they are. It's sort of the net everything's kind of natural here, which you'd expect. Again, this is non trivial because we're talking about ternary forms and the, the Hardy little with method becomes difficult because very difficult actually to do it directly. Because you get non convergent products. So there's there are ways around it he's Brown found a very nice way to deal with the local densities in the ternary case, when you have weights. So I won't go into this but you can prove this. There's this, there's several different proofs that you can give of this there's the original proof of Franca chinko and many and pair. You can also give a sort of a more classical proof but it's highly non trivial. Okay, so the new thing that I did was to try to do the corresponding count when you're restricting to an orbit. So if I let's, if I take a fixed x, which is a solution, and I define the orbit of it, which is what basically what we define before. So these are the points in here, which are in the image of something in the orthogonal in the group of automorphs. So just basically what we did before. And we also have a local version of this. So, we have this local orthogonal group. Well, it's it's the isotropy group. So, this is this, I have to look at the group, the subgroup of the of the automorphs to fix this point x. So this is the difference here. So, then we can define local the local densities. So, I'll call Delta P because it's really part of the group of automorphs. So again, it's sort of the obvious thing, you have to get all the little constants in front right. So again, you take the number of points in the isotropy group module P to the M and then you compute that that's a finite number to group finite group, and then you take the limit and again this stabilizes. Okay, so what is the theorem. So again, it s is going to be isotropic. And I'll fix this why, which is going to give me the norm type thing. Then it for a fixed x in a fixed solution, we can count the points in the orbit of x little x with this constraint on the size. And again, this is asymptotic to a constant times T. And let me write down what the constant is. It does involve the volume. And then it involves the product of the local densities of the isotropy subgroup inverted. And this actually converges and for most P it's, it's easy to see these are actually powers of P, except for primes to don't divide two times the discriminant so it's actually pretty, pretty simple in some sense. And how these, what these look like, not so simple to compute them exactly but there's no problem with convergence of the of the product over primes can be given. In fact, let me let me write down. Okay, so anyway this, this is the orbital asymptotic. You know, this I view this kind of as the main theorem for me. This is the hardest thing to prove the thing that's hard to prove is not that there's isn't asymptotic but to compute the constant. This is actually turns out to be kind of kind of challenging thing to do. And it's what you need to prove the first theorem and everything has to be exactly right. So both and factors of two, the bane of the number theorists show up in every way you can imagine sure. So it's a anyway, that's the key result and for me anyway that's the key, the key result. So you can, you can ask questions about this you can say what about the constant does it change as the orbit changes or are the is a distribution uniform across orbits. And the answer is sometimes it is and sometimes it isn't. So the examples that I wrote down earlier, it turns out that they are all the same, but you can come up with examples where they're not all the same. So it's kind of an interesting question which I haven't looked at in detail as to understand, you know, more in terms of s, how the orbits themselves are distributed. Okay, but for here I'm going to concentrate on how you can use this to prove the main theorem about counting orbits. What's the error term in T. I didn't. I didn't computed it. What this does is it comes from counting orbits of an Eisenstein series. So if you know something about the poles of the Eisenstein series, you know, you can, you can definitely give an error estimate. The group is an arithmetic group. But I, I don't think it's congruent subgroups so what I use is I use a general result about Eisenstein series, the meromorphicity. That's another interesting question, which I haven't, but I haven't looked at this. I'm concentrating mostly on the constant. Okay, so a corollary of this which is, is where the mass formula comes in is the sum over the orbits. So, if we sum over the. Peter can ask a question. You say it's not a group but I assume that that's because you went to the spin group and then it's metaplectic congruence I guess. So I think it's sort of fundamentally non congruent just in terms of the polls. That's my guess. Okay, yeah, so that would mean that you could, you could definitely give a good error term. Right, I think so. Yeah. Thanks. Okay. Also, you got asking the chat. You should be X dash y t in a way here. Here. Yes. So that's just an inner product right. These are vectors so that's the that's a dot product of the vectors. You're looking at X. Oh, oh. Thank you. Why am I writing is pretty bad sorry but that's correct. Yeah, so X is fixed and then everything depends on X. All right, so what you can do here then is is sum up over the orbits and you, you are going to get first of all you're going to get an identity, because you have these two different asymptotics. So when you sum over the orbits, one way to write the corollary is a formula for the volume. There are two ways you could write this but one way is to write it as a formula for the volume, which is kind of kind of nice because it doesn't involve something over the genus, but involves something over the orbits. And the local density is product is actually a finite product if you write it this way. And then this also involves the sigma from the first asymptotic. And so that's kind of a nice little formula. By the way, I didn't do this but I think you could play around with this with the gasp on a formula to try to say something more about the structure of the group, because we basically the number of orbits is a number of cusps of this group, and the volume in the gasp on a formula also relates the number of cusps and all and the number of points of fight order. So it might be kind of interesting to use this to say something more about the geometry of the group. I haven't done that really. So to get to the, to use this in order to count orbits, you need to relate the isotropy group and the size of the group to the size of the orbits, but that's something you can do. So, how I say this I won't write down the definition but you can you can probably extrapolate what they should be. So I can talk about the Zp orbits and their densities. I'm being a little bit imprecise here but then you can use the orbit stabilizer theorem to relate to relate these on a finite level. So this will give you an identity between these local densities. So here's basically the sizes of the orbits, the Zp orbits and the size of the group, the whole group divided by the size of the isotropy subgroup. So this varies with X. That's going to tell you the size of the orbits. And, and that's what the other, the first asymptotic really did for you it related the count and the of all the solutions to the sizes of the orbit of the sum of the orbits, right. So, by combining these, then you get, you can get a statement which allows you to compare the orbits, the sizes of the local orbits and the global orbit. So, but we still have this problem with the fact that the genus consists of several classes. This is a headache that you can't get rid of. So, but there's only finitely many so let me list them. So I'll take representatives of the genius. And then I'll take orbit representatives for each of these guys. Okay, so what you can then get from this. And this is not an immediate corollary but is that you take the product of the sigma piece from the, from the full asymptotic. And relate that to the sum over the, over the genus, and then a sum over the orbit representatives. This little C, and then the product of the local densities of the local orbits. Okay, so that's what comes out from the these two asymptotic formulas. And that's the thing that's useful for proving the first theorem. One of the problems that arises is, when you're doing the local orbits, they can, they include solutions to your S of X equal to zero, they're simply local solutions. But the theorem, the main theorem was talking about global solutions and their local representatives. So we have to know that every local solution actually comes from a global solution to use this. And for that I learned this from Reiner Schultz Appelot, who helped me with this because he, he was able to show that you can deduce this from a Knazer, in Knazer's book on quadratic forms. But you have to translate his theorem into, for me anyway, into the language of forms. And also, his theorem is about representations of one lattice into another, but that translates nicely into into representations of an integer by quadratic forms. And the, the advantage of that approach is that it doesn't require that you look at different classes in the genus, it combines all the classes of a genus into one thing. So, what he, what he explained to me is that what the, what theorem, the first term actually is equivalent to is a statement that representations of zero that fall into, into genera. And that's that theorem says that each genus consists of one class of representations. This is only for people who really know the subject already, but that's what I was able, I was able to then apply that theorem of Knazer together with this result to get theorem one. Now the way I actually did it was to go to, instead of having pediatric densities to actually go to counting solutions to congruences. And so that's, that's actually what I did. Okay, so, you know, if you're interested in this I put a preprint on my website and you can see more details of this. Okay, now I do want to say something about what's involved in the proof of this theorem here. Because it's, to me it was kind of, kind of fun. So, again, we use the Eisenstein series. Okay, but there's a subtlety that happens because how are you going to get these product of local densities of isotropy groups from the Eisenstein series. Well, the volume is natural because that comes from the residue of the pole of the Eisenstein series at one that just shows up very naturally, but these guys maybe don't. Maybe they do, maybe somebody knows how to do that, you know, immediately, but the way I did it was to actually compute the first of all you do a reduction of your s. This being isotropic has a nice has a nice effect. So I can, I can basically do a reduction on it and make it be equivalent to another s which has a simple form. So first of all I can put zero here because it's isotropic. You can also make these, these terms zero, and then you get this nice form. So this is basically Gauss, where a b and a and b are positive integers and c and d can be not they can be their integers. But what this is doing at the level of the group is you're taking x, which is the solution to the equation. You can think of this as representing a cusp. And what it's doing is it's taking that cusp to infinity. And this change it's really a change of variables which takes the cusp to infinity. This has a nice result that you can compute the parabolic subgroup. And then infinity, of course, it looks like this. There's some positive kappa. So this to be in. And the problem is to compute this kappa, depending on s. It depends on A, B, C and D. And this is the fun part. So that's where the relation to the local isotropic group comes in. So what you do is you use the explicit isomorphism to compute kappa. And this is going to be what it is. So kappa turns out to be square root of B. This B is in this reduced guy. And there's an integer F. And this is where F is minimal in C plus such that I realize I'm running out of time here. So A, B and C. So this is an integer. This, this come, it's kind of natural. So this is, you compute the pair, you compute the group element that corresponds to the parabolic transformation. And then the, to be in our Fuchsian group means that the entries have to be integral. And that turns out to be this condition. These are integers. So then what you have to do is you have to compute the isotropic group of this special guy. And by taking the cusp to infinity, the point is simple. It's 100. And then you actually compute them. You count the number of points in the isotropic group modulo p to the m. In different primes, everything is related to A, B, C and F. You know, because they actually compute the isotropic group, you look at, you look at S one of X equal to X. And you write down what the, you write down actually. I'm saying this wrong. You have to, you have to take the transformation of S one by an element in your group and count the number of elements in the group modulo p to the m. And I was quite amazed that it actually worked out because everything depends on A, B, C, A, B and C, and these change over the orbits. But it actually works out perfectly when you do this. It tells me there's probably a much easier proof in the background because usually when there's a highly computational proof. And usually when a highly computational proof works out beautifully for no apparent reason, then there's something behind it which is making it work. And I suspect somebody will find this and tell me about it at some point. But just before I stop, I had to do this for p equal to two, which those of you who have experienced with Ziegels theorem know that that's something that's usually not done for good reason. But here it's actually not so bad. It turned out it was by doable. And again, everything worked out perfectly through the theorem. So one last thing to get the examples. My my original approach to this was was element my original approach was like this but in a special case but then I did an elementary approach, which is to take this reduction further, and actually it's an elementary proof of the theorem, but it only works for special s, but those special s are actually the ones in the example. So you can, they can actually be derived by an elementary method, which is just taking the reduction technique further. Okay, so I guess I'll stop there.


Hey, hey there guys, it's me again back in the game with another reaction video and now we're going to be reacting to Stray Kids' Grrrrr. But yeah, we're going to be reacting to Stray Kids' live performance for their new song called Grrr. I've already seen this before so I'm just seeing you know that I've already seen it. I've watched the entire series and it's really freaking good. The only reason why I'm reacting to it is because I've only seen it once and I just want to freaking have, you know, like, what I had when I first saw it.  So I was like, why don't I watch it and that you guys see my reaction. So it's going to be a fun time. legit, this is such a good song. I cannot wait to actually watch the live performance and I cannot wait for it. Freaking Stray Kids to debut when they debut. I'm going to be on that as soon as possible, like legit as soon as possible. But yeah, I'm going to let this get straight into this. I'm freaking excited. I hope you guys are too. And let's do this. Just like this beat. It's so, it's just so straight forward. Freaking just sick. My heart's here. Not here. Oh, J-Bin man. Oh, he's so good. This song is just so good. Let's go. Dude, his voice is so good. Woojin. I love his voice as well. Jiyoung. Oh, it's just so good. Oh, dude, I'm getting the factors again. The chill factors. Oh, dude, I love that freaking, the body swiping stuff on. Oh, it's so cool. And Jisung, man, he is just a hack. He can dance. He's got the visuals. He can sing and he can rap. All together. He's just an amazing, amazing man. All of them are amazing. I do not understand. And the story behind this song is amazing. This is just so good. But Phoenix. Phoenix's voice is just so good. I love it. I love it so much. Dude, there it's my throat. How does Phoenix do it? Go on it.  It might sound like a prayer though.  Like, pfft. But man, freaking J-Bin woman is run.  I can't do it. My throat's still sore. Man, that song. I love that song, the pieces. I reckon that all the songs from their final freaking performance or stage is going to be in their debut album or debut mini album, whichever one they're going to do. So there's going to be School Life, Young Wings, Yaya Yaya, the Russian song. I can't even remember what it's called.  I can't remember. But that would be in their album. I'm missing another song. School Life. I know I'm missing a song and I'm very disappointed.  Comment down below the song that I'm missing. I really can't remember it. But yeah, that's just going to be all for this video. I hope you guys did. And if you guys did, don't forget to share some support by leaving a like and also comment down below your favorite straight kids song that you guys have listened to. I'm pretty sure my favorite one is Young Wings. School Life? Oh, it's so hard between those two. School Life or Young Wings. Both of those songs are freaking amazing. Same with all of the other songs. But those two songs, man, they just get to me. They really get to me. So yeah, comment down below your favorite songs that you've listened to from straight kids. And also, subscribe to the channel because there will be more straight kids videos coming to you guys because I am really loving these guys. They're my top three for my favorite groups. ECF 9, Day 6, then Straight Kids. They're my top three. These guys haven't even debuted yet. But yeah, I hope you guys have a great day. And just keep on smiling. And adios, amigo.